aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/vmx.c
diff options
context:
space:
mode:
authorSheng Yang <sheng@linux.intel.com>2009-03-24 22:08:52 -0400
committerAvi Kivity <avi@redhat.com>2009-06-10 04:48:34 -0400
commitf9c617f61127615dd054f3f159213bdd12451cab (patch)
treeaa7dd8cf106a451221fd83b254413f3b79c27bdb /arch/x86/kvm/vmx.c
parent7d433b9f942606f66da8ef68b8baecd2915c5627 (diff)
KVM: VMX: Correct wrong vmcs field sizes
EXIT_QUALIFICATION and GUEST_LINEAR_ADDRESS are natural width, not 64-bit. Signed-off-by: Sheng Yang <sheng@linux.intel.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/vmx.c')
-rw-r--r--arch/x86/kvm/vmx.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 37ae13d7b814..aba41ae2c81f 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -2991,7 +2991,7 @@ static int handle_vmcall(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
2991 2991
2992static int handle_invlpg(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) 2992static int handle_invlpg(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
2993{ 2993{
2994 u64 exit_qualification = vmcs_read64(EXIT_QUALIFICATION); 2994 unsigned long exit_qualification = vmcs_readl(EXIT_QUALIFICATION);
2995 2995
2996 kvm_mmu_invlpg(vcpu, exit_qualification); 2996 kvm_mmu_invlpg(vcpu, exit_qualification);
2997 skip_emulated_instruction(vcpu); 2997 skip_emulated_instruction(vcpu);
@@ -3007,11 +3007,11 @@ static int handle_wbinvd(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
3007 3007
3008static int handle_apic_access(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) 3008static int handle_apic_access(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
3009{ 3009{
3010 u64 exit_qualification; 3010 unsigned long exit_qualification;
3011 enum emulation_result er; 3011 enum emulation_result er;
3012 unsigned long offset; 3012 unsigned long offset;
3013 3013
3014 exit_qualification = vmcs_read64(EXIT_QUALIFICATION); 3014 exit_qualification = vmcs_readl(EXIT_QUALIFICATION);
3015 offset = exit_qualification & 0xffful; 3015 offset = exit_qualification & 0xffful;
3016 3016
3017 er = emulate_instruction(vcpu, kvm_run, 0, 0, 0); 3017 er = emulate_instruction(vcpu, kvm_run, 0, 0, 0);
@@ -3062,11 +3062,11 @@ static int handle_task_switch(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
3062 3062
3063static int handle_ept_violation(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) 3063static int handle_ept_violation(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
3064{ 3064{
3065 u64 exit_qualification; 3065 unsigned long exit_qualification;
3066 gpa_t gpa; 3066 gpa_t gpa;
3067 int gla_validity; 3067 int gla_validity;
3068 3068
3069 exit_qualification = vmcs_read64(EXIT_QUALIFICATION); 3069 exit_qualification = vmcs_readl(EXIT_QUALIFICATION);
3070 3070
3071 if (exit_qualification & (1 << 6)) { 3071 if (exit_qualification & (1 << 6)) {
3072 printk(KERN_ERR "EPT: GPA exceeds GAW!\n"); 3072 printk(KERN_ERR "EPT: GPA exceeds GAW!\n");
@@ -3078,7 +3078,7 @@ static int handle_ept_violation(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
3078 printk(KERN_ERR "EPT: Handling EPT violation failed!\n"); 3078 printk(KERN_ERR "EPT: Handling EPT violation failed!\n");
3079 printk(KERN_ERR "EPT: GPA: 0x%lx, GVA: 0x%lx\n", 3079 printk(KERN_ERR "EPT: GPA: 0x%lx, GVA: 0x%lx\n",
3080 (long unsigned int)vmcs_read64(GUEST_PHYSICAL_ADDRESS), 3080 (long unsigned int)vmcs_read64(GUEST_PHYSICAL_ADDRESS),
3081 (long unsigned int)vmcs_read64(GUEST_LINEAR_ADDRESS)); 3081 vmcs_readl(GUEST_LINEAR_ADDRESS));
3082 printk(KERN_ERR "EPT: Exit qualification is 0x%lx\n", 3082 printk(KERN_ERR "EPT: Exit qualification is 0x%lx\n",
3083 (long unsigned int)exit_qualification); 3083 (long unsigned int)exit_qualification);
3084 kvm_run->exit_reason = KVM_EXIT_UNKNOWN; 3084 kvm_run->exit_reason = KVM_EXIT_UNKNOWN;