]>
Commit | Line | Data |
---|---|---|
f63e0b72 TL |
1 | From 81b1b9ca6d5ca5f3ce91c0095402def657cf5db3 Mon Sep 17 00:00:00 2001 |
2 | From: Haozhong Zhang <haozhong.zhang@intel.com> | |
3 | Date: Mon, 14 Dec 2015 23:13:38 +0800 | |
4 | Subject: [PATCH] KVM: VMX: Fix host initiated access to guest MSR_TSC_AUX | |
5 | ||
6 | commit 81b1b9ca6d5ca5f3ce91c0095402def657cf5db3 upstream. | |
7 | ||
8 | The current handling of accesses to guest MSR_TSC_AUX returns error if | |
9 | vcpu does not support rdtscp, though those accesses are initiated by | |
10 | host. This can result in the reboot failure of some versions of | |
11 | QEMU. This patch fixes this issue by passing those host initiated | |
12 | accesses for further handling instead. | |
13 | ||
14 | Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com> | |
15 | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> | |
16 | Backported-by: Thomas Lamprecht <t.lamprecht@proxmox.com> | |
17 | --- | |
18 | arch/x86/kvm/vmx.c | 4 ++-- | |
19 | 1 file changed, 2 insertions(+), 2 deletions(-) | |
20 | ||
21 | diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c | |
22 | index 6b56056..44976a5 100644 | |
23 | --- a/arch/x86/kvm/vmx.c | |
24 | +++ b/arch/x86/kvm/vmx.c | |
25 | @@ -2673,7 +2673,7 @@ static int vmx_get_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info) | |
26 | msr_info->data = vcpu->arch.ia32_xss; | |
27 | break; | |
28 | case MSR_TSC_AUX: | |
29 | - if (!to_vmx(vcpu)->rdtscp_enabled) | |
30 | + if (!to_vmx(vcpu)->rdtscp_enabled && !msr_info->host_initiated) | |
31 | return 1; | |
32 | /* Otherwise falls through */ | |
33 | default: | |
34 | @@ -2779,7 +2779,7 @@ static int vmx_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info) | |
35 | clear_atomic_switch_msr(vmx, MSR_IA32_XSS); | |
36 | break; | |
37 | case MSR_TSC_AUX: | |
38 | - if (!vmx->rdtscp_enabled) | |
39 | + if (!vmx->rdtscp_enabled && !msr_info->host_initiated) | |
40 | return 1; | |
41 | /* Check reserved bit, higher 32 bits should be zero */ | |
42 | if ((data >> 32) != 0) | |
43 | -- | |
44 | 2.1.4 | |
45 |