]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.19/kvm-x86-svm-report-msr_ia32_mcg_ext_ctl-as-unsupport.patch
autosel patches for 4.19
[thirdparty/kernel/stable-queue.git] / queue-4.19 / kvm-x86-svm-report-msr_ia32_mcg_ext_ctl-as-unsupport.patch
1 From ea2417f13474d37e347682bcf860c2fb67640845 Mon Sep 17 00:00:00 2001
2 From: Vitaly Kuznetsov <vkuznets@redhat.com>
3 Date: Wed, 19 Dec 2018 12:06:13 +0100
4 Subject: KVM: x86: svm: report MSR_IA32_MCG_EXT_CTL as unsupported
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 [ Upstream commit e87555e550cef4941579cd879759a7c0dee24e68 ]
10
11 AMD doesn't seem to implement MSR_IA32_MCG_EXT_CTL and svm code in kvm
12 knows nothing about it, however, this MSR is among emulated_msrs and
13 thus returned with KVM_GET_MSR_INDEX_LIST. The consequent KVM_GET_MSRS,
14 of course, fails.
15
16 Report the MSR as unsupported to not confuse userspace.
17
18 Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
19 Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
20 Signed-off-by: Sasha Levin <sashal@kernel.org>
21 ---
22 arch/x86/kvm/svm.c | 7 +++++++
23 1 file changed, 7 insertions(+)
24
25 diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
26 index f1d3fe5a0c65..02ac8fa0cd6d 100644
27 --- a/arch/x86/kvm/svm.c
28 +++ b/arch/x86/kvm/svm.c
29 @@ -5837,6 +5837,13 @@ static bool svm_cpu_has_accelerated_tpr(void)
30
31 static bool svm_has_emulated_msr(int index)
32 {
33 + switch (index) {
34 + case MSR_IA32_MCG_EXT_CTL:
35 + return false;
36 + default:
37 + break;
38 + }
39 +
40 return true;
41 }
42
43 --
44 2.19.1
45