From e8ac19f1b9cbb757bb2fa606c3f5bb9c3edd94bc Mon Sep 17 00:00:00 2001 From: Juergen Gross Date: May 23 2023 11:25:33 +0000 Subject: KVM: x86: svm: report MSR_IA32_MCG_EXT_CTL as unsupported (git-fixes). --- diff --git a/patches.suse/KVM-x86-svm-report-MSR_IA32_MCG_EXT_CTL-as-unsupport.patch b/patches.suse/KVM-x86-svm-report-MSR_IA32_MCG_EXT_CTL-as-unsupport.patch new file mode 100644 index 0000000..a64cf7a --- /dev/null +++ b/patches.suse/KVM-x86-svm-report-MSR_IA32_MCG_EXT_CTL-as-unsupport.patch @@ -0,0 +1,45 @@ +Patch-mainline: v5.0-rc1 +Git-commit: e87555e550cef4941579cd879759a7c0dee24e68 +References: git-fixes +From: Vitaly Kuznetsov +Date: Wed, 19 Dec 2018 12:06:13 +0100 +Subject: [PATCH] KVM: x86: svm: report MSR_IA32_MCG_EXT_CTL as unsupported +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +AMD doesn't seem to implement MSR_IA32_MCG_EXT_CTL and svm code in kvm +knows nothing about it, however, this MSR is among emulated_msrs and +thus returned with KVM_GET_MSR_INDEX_LIST. The consequent KVM_GET_MSRS, +of course, fails. + +Report the MSR as unsupported to not confuse userspace. + +Signed-off-by: Vitaly Kuznetsov +Signed-off-by: Radim Krčmář +Signed-off-by: Juergen Gross +--- + arch/x86/kvm/svm.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c +index e4f18a305ef6..c4377f02a33b 100644 +--- a/arch/x86/kvm/svm.c ++++ b/arch/x86/kvm/svm.c +@@ -5840,6 +5840,13 @@ static bool svm_cpu_has_accelerated_tpr(void) + + static bool svm_has_emulated_msr(int index) + { ++ switch (index) { ++ case MSR_IA32_MCG_EXT_CTL: ++ return false; ++ default: ++ break; ++ } ++ + return true; + } + +-- +2.35.3 + diff --git a/series.conf b/series.conf index 77b9c87..8ea17ac 100644 --- a/series.conf +++ b/series.conf @@ -45365,6 +45365,7 @@ patches.suse/kvm-s390-fix-kmsg-component-kvm-s390.patch patches.suse/KVM-PPC-Book3S-HV-Fix-race-between-kvm_unmap_hva_ran.patch patches.suse/KVM-PPC-Book3S-PR-Set-hflag-to-indicate-that-POWER9-.patch + patches.suse/KVM-x86-svm-report-MSR_IA32_MCG_EXT_CTL-as-unsupport.patch patches.suse/kvm-Disallow-wraparound-in-kvm_gfn_to_hva_cache_init.patch patches.suse/kvm-Change-offset-in-kvm_write_guest_offset_cached-t.patch patches.suse/kvm-nvmx-nmi-window-and-interrupt-window-exiting-should-wake-l2-from-hlt