Skip to content

Commit 3e93467

Browse files
tlendackybonzini
authored andcommitted
KVM: SVM: Fix build error when using -Werror=unused-but-set-variable
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]>
1 parent 3fdc608 commit 3e93467

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/kvm/svm/svm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ static int svm_hardware_enable(void)
691691
*/
692692
if (boot_cpu_has(X86_FEATURE_V_TSC_AUX)) {
693693
struct sev_es_save_area *hostsa;
694-
u32 msr_hi;
694+
u32 __maybe_unused msr_hi;
695695

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

0 commit comments

Comments
 (0)