Skip to content

Commit 732b531

Browse files
committed
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.
2 parents c012a0f + 46dec40 commit 732b531

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

arch/powerpc/kvm/book3s_64_mmu_hv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ static int kvmppc_mmu_book3s_64_hv_xlate(struct kvm_vcpu *vcpu, gva_t eaddr,
358358
unsigned long pp, key;
359359
unsigned long v, orig_v, gr;
360360
__be64 *hptep;
361-
int index;
361+
long int index;
362362
int virtmode = vcpu->arch.shregs.msr & (data ? MSR_DR : MSR_IR);
363363

364364
if (kvm_is_radix(vcpu->kvm))

arch/powerpc/kvm/book3s_64_mmu_radix.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -725,10 +725,10 @@ int kvm_unmap_radix(struct kvm *kvm, struct kvm_memory_slot *memslot,
725725
gpa, shift);
726726
kvmppc_radix_tlbie_page(kvm, gpa, shift);
727727
if ((old & _PAGE_DIRTY) && memslot->dirty_bitmap) {
728-
unsigned long npages = 1;
728+
unsigned long psize = PAGE_SIZE;
729729
if (shift)
730-
npages = 1ul << (shift - PAGE_SHIFT);
731-
kvmppc_update_dirty_map(memslot, gfn, npages);
730+
psize = 1ul << shift;
731+
kvmppc_update_dirty_map(memslot, gfn, psize);
732732
}
733733
}
734734
return 0;

0 commit comments

Comments
 (0)