浏览代码

KVM: VMX: Flush volatile msrs before emulating rdmsr

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>
Avi Kivity 16 年之前
父节点
当前提交
516a1a7e9d
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      arch/x86/kvm/vmx.c

+ 1 - 0
arch/x86/kvm/vmx.c

@@ -903,6 +903,7 @@ static int vmx_get_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 *pdata)
 		data = vmcs_readl(GUEST_SYSENTER_ESP);
 		data = vmcs_readl(GUEST_SYSENTER_ESP);
 		break;
 		break;
 	default:
 	default:
+		vmx_load_host_state(to_vmx(vcpu));
 		msr = find_msr_entry(to_vmx(vcpu), msr_index);
 		msr = find_msr_entry(to_vmx(vcpu), msr_index);
 		if (msr) {
 		if (msr) {
 			data = msr->data;
 			data = msr->data;