Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm

Pull kvm fixes from Paolo Bonzini:
"Fixes for 3.12-rc5: two old PPC bugs and one new (3.12-rc2) x86 bug"

* tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
kvm: ppc: booke: check range page invalidation progress on page setup
KVM: PPC: Book3S HV: Fix typo in saving DSCR
KVM: nVMX: fix shadow on EPT

+30 -14
+1 -1
arch/powerpc/kvm/book3s_hv_rmhandlers.S
··· 1066 1066 BEGIN_FTR_SECTION 1067 1067 mfspr r8, SPRN_DSCR 1068 1068 ld r7, HSTATE_DSCR(r13) 1069 - std r8, VCPU_DSCR(r7) 1069 + std r8, VCPU_DSCR(r9) 1070 1070 mtspr SPRN_DSCR, r7 1071 1071 END_FTR_SECTION_IFSET(CPU_FTR_ARCH_206) 1072 1072
+17 -1
arch/powerpc/kvm/e500_mmu_host.c
··· 332 332 unsigned long hva; 333 333 int pfnmap = 0; 334 334 int tsize = BOOK3E_PAGESZ_4K; 335 + int ret = 0; 336 + unsigned long mmu_seq; 337 + struct kvm *kvm = vcpu_e500->vcpu.kvm; 338 + 339 + /* used to check for invalidations in progress */ 340 + mmu_seq = kvm->mmu_notifier_seq; 341 + smp_rmb(); 335 342 336 343 /* 337 344 * Translate guest physical to true physical, acquiring ··· 456 449 gvaddr &= ~((tsize_pages << PAGE_SHIFT) - 1); 457 450 } 458 451 452 + spin_lock(&kvm->mmu_lock); 453 + if (mmu_notifier_retry(kvm, mmu_seq)) { 454 + ret = -EAGAIN; 455 + goto out; 456 + } 457 + 459 458 kvmppc_e500_ref_setup(ref, gtlbe, pfn); 460 459 461 460 kvmppc_e500_setup_stlbe(&vcpu_e500->vcpu, gtlbe, tsize, ··· 470 457 /* Clear i-cache for new pages */ 471 458 kvmppc_mmu_flush_icache(pfn); 472 459 460 + out: 461 + spin_unlock(&kvm->mmu_lock); 462 + 473 463 /* Drop refcount on page, so that mmu notifiers can clear it */ 474 464 kvm_release_pfn_clean(pfn); 475 465 476 - return 0; 466 + return ret; 477 467 } 478 468 479 469 /* XXX only map the one-one case, for now use TLB0 */
+12 -12
arch/x86/kvm/vmx.c
··· 3255 3255 3256 3256 static void ept_load_pdptrs(struct kvm_vcpu *vcpu) 3257 3257 { 3258 + struct kvm_mmu *mmu = vcpu->arch.walk_mmu; 3259 + 3258 3260 if (!test_bit(VCPU_EXREG_PDPTR, 3259 3261 (unsigned long *)&vcpu->arch.regs_dirty)) 3260 3262 return; 3261 3263 3262 3264 if (is_paging(vcpu) && is_pae(vcpu) && !is_long_mode(vcpu)) { 3263 - vmcs_write64(GUEST_PDPTR0, vcpu->arch.mmu.pdptrs[0]); 3264 - vmcs_write64(GUEST_PDPTR1, vcpu->arch.mmu.pdptrs[1]); 3265 - vmcs_write64(GUEST_PDPTR2, vcpu->arch.mmu.pdptrs[2]); 3266 - vmcs_write64(GUEST_PDPTR3, vcpu->arch.mmu.pdptrs[3]); 3265 + vmcs_write64(GUEST_PDPTR0, mmu->pdptrs[0]); 3266 + vmcs_write64(GUEST_PDPTR1, mmu->pdptrs[1]); 3267 + vmcs_write64(GUEST_PDPTR2, mmu->pdptrs[2]); 3268 + vmcs_write64(GUEST_PDPTR3, mmu->pdptrs[3]); 3267 3269 } 3268 3270 } 3269 3271 3270 3272 static void ept_save_pdptrs(struct kvm_vcpu *vcpu) 3271 3273 { 3274 + struct kvm_mmu *mmu = vcpu->arch.walk_mmu; 3275 + 3272 3276 if (is_paging(vcpu) && is_pae(vcpu) && !is_long_mode(vcpu)) { 3273 - vcpu->arch.mmu.pdptrs[0] = vmcs_read64(GUEST_PDPTR0); 3274 - vcpu->arch.mmu.pdptrs[1] = vmcs_read64(GUEST_PDPTR1); 3275 - vcpu->arch.mmu.pdptrs[2] = vmcs_read64(GUEST_PDPTR2); 3276 - vcpu->arch.mmu.pdptrs[3] = vmcs_read64(GUEST_PDPTR3); 3277 + mmu->pdptrs[0] = vmcs_read64(GUEST_PDPTR0); 3278 + mmu->pdptrs[1] = vmcs_read64(GUEST_PDPTR1); 3279 + mmu->pdptrs[2] = vmcs_read64(GUEST_PDPTR2); 3280 + mmu->pdptrs[3] = vmcs_read64(GUEST_PDPTR3); 3277 3281 } 3278 3282 3279 3283 __set_bit(VCPU_EXREG_PDPTR, ··· 7781 7777 vmcs_write64(GUEST_PDPTR1, vmcs12->guest_pdptr1); 7782 7778 vmcs_write64(GUEST_PDPTR2, vmcs12->guest_pdptr2); 7783 7779 vmcs_write64(GUEST_PDPTR3, vmcs12->guest_pdptr3); 7784 - __clear_bit(VCPU_EXREG_PDPTR, 7785 - (unsigned long *)&vcpu->arch.regs_avail); 7786 - __clear_bit(VCPU_EXREG_PDPTR, 7787 - (unsigned long *)&vcpu->arch.regs_dirty); 7788 7780 } 7789 7781 7790 7782 kvm_register_write(vcpu, VCPU_REGS_RSP, vmcs12->guest_rsp);