aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm
diff options
context:
space:
mode:
authorAvi Kivity <avi@qumranet.com>2007-03-06 05:05:53 -0500
committerAvi Kivity <avi@qumranet.com>2007-03-18 04:49:06 -0400
commitf5b42c3324494ea3f9bf795e2a7e4d3cbb06c607 (patch)
tree98019c1e0f8d6ac45386dea3f4d5eab356ea864c /drivers/kvm
parentca45aaae1ef98890ac4e3ee48d65aa22401fd1dc (diff)
KVM: Fix guest sysenter on vmx
The vmx code currently treats the guest's sysenter support msrs as 32-bit values, which breaks 32-bit compat mode userspace on 64-bit guests. Fix by using the native word width of the machine. Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm')
-rw-r--r--drivers/kvm/vmx.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c
index c07178e61122..bfa0ce42ea92 100644
--- a/drivers/kvm/vmx.c
+++ b/drivers/kvm/vmx.c
@@ -371,10 +371,10 @@ static int vmx_get_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 *pdata)
371 data = vmcs_read32(GUEST_SYSENTER_CS); 371 data = vmcs_read32(GUEST_SYSENTER_CS);
372 break; 372 break;
373 case MSR_IA32_SYSENTER_EIP: 373 case MSR_IA32_SYSENTER_EIP:
374 data = vmcs_read32(GUEST_SYSENTER_EIP); 374 data = vmcs_readl(GUEST_SYSENTER_EIP);
375 break; 375 break;
376 case MSR_IA32_SYSENTER_ESP: 376 case MSR_IA32_SYSENTER_ESP:
377 data = vmcs_read32(GUEST_SYSENTER_ESP); 377 data = vmcs_readl(GUEST_SYSENTER_ESP);
378 break; 378 break;
379 default: 379 default:
380 msr = find_msr_entry(vcpu, msr_index); 380 msr = find_msr_entry(vcpu, msr_index);
@@ -412,10 +412,10 @@ static int vmx_set_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 data)
412 vmcs_write32(GUEST_SYSENTER_CS, data); 412 vmcs_write32(GUEST_SYSENTER_CS, data);
413 break; 413 break;
414 case MSR_IA32_SYSENTER_EIP: 414 case MSR_IA32_SYSENTER_EIP:
415 vmcs_write32(GUEST_SYSENTER_EIP, data); 415 vmcs_writel(GUEST_SYSENTER_EIP, data);
416 break; 416 break;
417 case MSR_IA32_SYSENTER_ESP: 417 case MSR_IA32_SYSENTER_ESP:
418 vmcs_write32(GUEST_SYSENTER_ESP, data); 418 vmcs_writel(GUEST_SYSENTER_ESP, data);
419 break; 419 break;
420 case MSR_IA32_TIME_STAMP_COUNTER: 420 case MSR_IA32_TIME_STAMP_COUNTER:
421 guest_write_tsc(data); 421 guest_write_tsc(data);