[patch 75/88] KVM: VMX: Flush volatile msrs before emulating rdmsr

Greg KH
2009-04-30T17:42:13Z

[-- Attachment #1: kvm-vmx-flush-volatile-msrs-before-emulating-rdmsr.patch --]
[-- Type: text/plain, Size: 857 bytes --]

2.6.28-stable review patch. If anyone has any objections, please let us know.

------------------

From: Avi Kivity <avi@redhat.com>

(cherry picked from 516a1a7e9dc80358030fe01aabb3bedf882db9e2)

Some msrs (notable MSR_KERNEL_GS_BASE) are held in the processor registers
and need to be flushed to the vcpu struture before they can be read.

This fixes cygwin longjmp() failure on Windows x64.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
arch/x86/kvm/vmx.c | 1 +
1 file changed, 1 insertion(+)

--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -897,6 +897,7 @@ static int vmx_get_msr(struct kvm_vcpu *
data = vmcs_readl(GUEST_SYSENTER_ESP);
break;
default:
+ vmx_load_host_state(to_vmx(vcpu));
msr = find_msr_entry(to_vmx(vcpu), msr_index);
if (msr) {
data = msr->data;