diff options
author | Radim Krčmář <rkrcmar@redhat.com> | 2018-09-04 15:12:46 -0400 |
---|---|---|
committer | Radim Krčmář <rkrcmar@redhat.com> | 2018-09-04 15:12:46 -0400 |
commit | 732b53146ac8f604e45c593efe0579f78205fdcc (patch) | |
tree | c23e340ff887c6f1ed51a875099e02cca85a3197 | |
parent | c012a0f2677529a0ae8f53a15bd7c61dc4ca5b5e (diff) | |
parent | 46dec40fb741f00f1864580130779aeeaf24fb3d (diff) |
Merge tag 'kvm-ppc-fixes-4.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
PPC KVM fixes for 4.19
Two small fixes for KVM on POWER machines; one fixes a bug where pages
might not get marked dirty, causing guest memory corruption on migration,
and the other fixes a bug causing reads from guest memory to use the
wrong guest real address for very large HPT guests (>256G of memory),
leading to failures in instruction emulation.
-rw-r--r-- | arch/powerpc/kvm/book3s_64_mmu_hv.c | 2 | ||||
-rw-r--r-- | arch/powerpc/kvm/book3s_64_mmu_radix.c | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/arch/powerpc/kvm/book3s_64_mmu_hv.c b/arch/powerpc/kvm/book3s_64_mmu_hv.c index 3c0e8fb2b773..68e14afecac8 100644 --- a/arch/powerpc/kvm/book3s_64_mmu_hv.c +++ b/arch/powerpc/kvm/book3s_64_mmu_hv.c | |||
@@ -358,7 +358,7 @@ static int kvmppc_mmu_book3s_64_hv_xlate(struct kvm_vcpu *vcpu, gva_t eaddr, | |||
358 | unsigned long pp, key; | 358 | unsigned long pp, key; |
359 | unsigned long v, orig_v, gr; | 359 | unsigned long v, orig_v, gr; |
360 | __be64 *hptep; | 360 | __be64 *hptep; |
361 | int index; | 361 | long int index; |
362 | int virtmode = vcpu->arch.shregs.msr & (data ? MSR_DR : MSR_IR); | 362 | int virtmode = vcpu->arch.shregs.msr & (data ? MSR_DR : MSR_IR); |
363 | 363 | ||
364 | if (kvm_is_radix(vcpu->kvm)) | 364 | if (kvm_is_radix(vcpu->kvm)) |
diff --git a/arch/powerpc/kvm/book3s_64_mmu_radix.c b/arch/powerpc/kvm/book3s_64_mmu_radix.c index 0af1c0aea1fe..fd6e8c13685f 100644 --- a/arch/powerpc/kvm/book3s_64_mmu_radix.c +++ b/arch/powerpc/kvm/book3s_64_mmu_radix.c | |||
@@ -725,10 +725,10 @@ int kvm_unmap_radix(struct kvm *kvm, struct kvm_memory_slot *memslot, | |||
725 | gpa, shift); | 725 | gpa, shift); |
726 | kvmppc_radix_tlbie_page(kvm, gpa, shift); | 726 | kvmppc_radix_tlbie_page(kvm, gpa, shift); |
727 | if ((old & _PAGE_DIRTY) && memslot->dirty_bitmap) { | 727 | if ((old & _PAGE_DIRTY) && memslot->dirty_bitmap) { |
728 | unsigned long npages = 1; | 728 | unsigned long psize = PAGE_SIZE; |
729 | if (shift) | 729 | if (shift) |
730 | npages = 1ul << (shift - PAGE_SHIFT); | 730 | psize = 1ul << shift; |
731 | kvmppc_update_dirty_map(memslot, gfn, npages); | 731 | kvmppc_update_dirty_map(memslot, gfn, psize); |
732 | } | 732 | } |
733 | } | 733 | } |
734 | return 0; | 734 | return 0; |