Skip to content

Commit

Permalink
KVM: SVM: Fix build error when using -Werror=unused-but-set-variable
Browse files Browse the repository at this point in the history
Commit 916e3e5 ("KVM: SVM: Do not use user return MSR support for
virtualized TSC_AUX") introduced a local variable used for the rdmsr()
function for the high 32-bits of the MSR value. This variable is not used
after being set and triggers a warning or error, when treating warnings
as errors, when the unused-but-set-variable flag is set. Mark this
variable as __maybe_unused to fix this.

Fixes: 916e3e5 ("KVM: SVM: Do not use user return MSR support for virtualized TSC_AUX")
Signed-off-by: Tom Lendacky <[email protected]>
Reviewed-by: Sean Christopherson <[email protected]>
Message-Id: <0da9874b6e9fcbaaa5edeb345d7e2a7c859fc818.1696271334.git.thomas.lendacky@amd.com>
Signed-off-by: Paolo Bonzini <[email protected]>
  • Loading branch information
tlendacky authored and bonzini committed Oct 12, 2023
1 parent 3fdc608 commit 3e93467
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/x86/kvm/svm/svm.c
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ static int svm_hardware_enable(void)
*/
if (boot_cpu_has(X86_FEATURE_V_TSC_AUX)) {
struct sev_es_save_area *hostsa;
u32 msr_hi;
u32 __maybe_unused msr_hi;

hostsa = (struct sev_es_save_area *)(page_address(sd->save_area) + 0x400);

Expand Down

0 comments on commit 3e93467

Please sign in to comment.