diff options
author | Tom Lendacky <thomas.lendacky@amd.com> | 2023-10-02 21:28:54 +0300 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2023-10-12 18:09:36 +0300 |
commit | 3e9346734661cc20bd77aeb43dbf4e5f46a2c16e (patch) | |
tree | bd15b09e6300c182829cd5bc529741dad3159db0 /arch/x86/kvm | |
parent | 3fdc6087df3be73a212a81ce5dd6516638568806 (diff) | |
download | linux-3e9346734661cc20bd77aeb43dbf4e5f46a2c16e.tar.xz |
KVM: SVM: Fix build error when using -Werror=unused-but-set-variable
Commit 916e3e5f26ab ("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: 916e3e5f26ab ("KVM: SVM: Do not use user return MSR support for virtualized TSC_AUX")
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Reviewed-by: Sean Christopherson <seanjc@google.com>
Message-Id: <0da9874b6e9fcbaaa5edeb345d7e2a7c859fc818.1696271334.git.thomas.lendacky@amd.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm')
-rw-r--r-- | arch/x86/kvm/svm/svm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c index acdd0b89e471..beea99c8e8e0 100644 --- a/arch/x86/kvm/svm/svm.c +++ b/arch/x86/kvm/svm/svm.c @@ -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); |