aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/vmx.c
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2013-10-17 10:04:47 -0400
committerGleb Natapov <gleb@redhat.com>2013-10-17 10:41:49 -0400
commit13acfd5715144518232d8e29acf7c76ef1b089d8 (patch)
tree093c4311a737210bbdd3d1919f8193cb5f017241 /arch/x86/kvm/vmx.c
parentd570142674890fe10b3d7d86aa105e3dfce1ddfa (diff)
parent34ec4de42be5006abdd8d0c08b306ffaa64d0d5d (diff)
Powerpc KVM work is based on a commit after rc4.
Merging master into next to satisfy the dependencies. Conflicts: arch/arm/kvm/reset.c
Diffstat (limited to 'arch/x86/kvm/vmx.c')
-rw-r--r--arch/x86/kvm/vmx.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 0156560c68a8..06fd7629068a 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -3258,25 +3258,29 @@ static void vmx_decache_cr4_guest_bits(struct kvm_vcpu *vcpu)
3258 3258
3259static void ept_load_pdptrs(struct kvm_vcpu *vcpu) 3259static void ept_load_pdptrs(struct kvm_vcpu *vcpu)
3260{ 3260{
3261 struct kvm_mmu *mmu = vcpu->arch.walk_mmu;
3262
3261 if (!test_bit(VCPU_EXREG_PDPTR, 3263 if (!test_bit(VCPU_EXREG_PDPTR,
3262 (unsigned long *)&vcpu->arch.regs_dirty)) 3264 (unsigned long *)&vcpu->arch.regs_dirty))
3263 return; 3265 return;
3264 3266
3265 if (is_paging(vcpu) && is_pae(vcpu) && !is_long_mode(vcpu)) { 3267 if (is_paging(vcpu) && is_pae(vcpu) && !is_long_mode(vcpu)) {
3266 vmcs_write64(GUEST_PDPTR0, vcpu->arch.mmu.pdptrs[0]); 3268 vmcs_write64(GUEST_PDPTR0, mmu->pdptrs[0]);
3267 vmcs_write64(GUEST_PDPTR1, vcpu->arch.mmu.pdptrs[1]); 3269 vmcs_write64(GUEST_PDPTR1, mmu->pdptrs[1]);
3268 vmcs_write64(GUEST_PDPTR2, vcpu->arch.mmu.pdptrs[2]); 3270 vmcs_write64(GUEST_PDPTR2, mmu->pdptrs[2]);
3269 vmcs_write64(GUEST_PDPTR3, vcpu->arch.mmu.pdptrs[3]); 3271 vmcs_write64(GUEST_PDPTR3, mmu->pdptrs[3]);
3270 } 3272 }
3271} 3273}
3272 3274
3273static void ept_save_pdptrs(struct kvm_vcpu *vcpu) 3275static void ept_save_pdptrs(struct kvm_vcpu *vcpu)
3274{ 3276{
3277 struct kvm_mmu *mmu = vcpu->arch.walk_mmu;
3278
3275 if (is_paging(vcpu) && is_pae(vcpu) && !is_long_mode(vcpu)) { 3279 if (is_paging(vcpu) && is_pae(vcpu) && !is_long_mode(vcpu)) {
3276 vcpu->arch.mmu.pdptrs[0] = vmcs_read64(GUEST_PDPTR0); 3280 mmu->pdptrs[0] = vmcs_read64(GUEST_PDPTR0);
3277 vcpu->arch.mmu.pdptrs[1] = vmcs_read64(GUEST_PDPTR1); 3281 mmu->pdptrs[1] = vmcs_read64(GUEST_PDPTR1);
3278 vcpu->arch.mmu.pdptrs[2] = vmcs_read64(GUEST_PDPTR2); 3282 mmu->pdptrs[2] = vmcs_read64(GUEST_PDPTR2);
3279 vcpu->arch.mmu.pdptrs[3] = vmcs_read64(GUEST_PDPTR3); 3283 mmu->pdptrs[3] = vmcs_read64(GUEST_PDPTR3);
3280 } 3284 }
3281 3285
3282 __set_bit(VCPU_EXREG_PDPTR, 3286 __set_bit(VCPU_EXREG_PDPTR,
@@ -5359,7 +5363,9 @@ static int handle_ept_violation(struct kvm_vcpu *vcpu)
5359 * There are errata that may cause this bit to not be set: 5363 * There are errata that may cause this bit to not be set:
5360 * AAK134, BY25. 5364 * AAK134, BY25.
5361 */ 5365 */
5362 if (exit_qualification & INTR_INFO_UNBLOCK_NMI) 5366 if (!(to_vmx(vcpu)->idt_vectoring_info & VECTORING_INFO_VALID_MASK) &&
5367 cpu_has_virtual_nmis() &&
5368 (exit_qualification & INTR_INFO_UNBLOCK_NMI))
5363 vmcs_set_bits(GUEST_INTERRUPTIBILITY_INFO, GUEST_INTR_STATE_NMI); 5369 vmcs_set_bits(GUEST_INTERRUPTIBILITY_INFO, GUEST_INTR_STATE_NMI);
5364 5370
5365 gpa = vmcs_read64(GUEST_PHYSICAL_ADDRESS); 5371 gpa = vmcs_read64(GUEST_PHYSICAL_ADDRESS);
@@ -7827,10 +7833,6 @@ static void prepare_vmcs02(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12)
7827 vmcs_write64(GUEST_PDPTR1, vmcs12->guest_pdptr1); 7833 vmcs_write64(GUEST_PDPTR1, vmcs12->guest_pdptr1);
7828 vmcs_write64(GUEST_PDPTR2, vmcs12->guest_pdptr2); 7834 vmcs_write64(GUEST_PDPTR2, vmcs12->guest_pdptr2);
7829 vmcs_write64(GUEST_PDPTR3, vmcs12->guest_pdptr3); 7835 vmcs_write64(GUEST_PDPTR3, vmcs12->guest_pdptr3);
7830 __clear_bit(VCPU_EXREG_PDPTR,
7831 (unsigned long *)&vcpu->arch.regs_avail);
7832 __clear_bit(VCPU_EXREG_PDPTR,
7833 (unsigned long *)&vcpu->arch.regs_dirty);
7834 } 7836 }
7835 7837
7836 kvm_register_write(vcpu, VCPU_REGS_RSP, vmcs12->guest_rsp); 7838 kvm_register_write(vcpu, VCPU_REGS_RSP, vmcs12->guest_rsp);