Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 732b5314 authored by Radim Krčmář's avatar Radim Krčmář
Browse files
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.
parents c012a0f2 46dec40f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -358,7 +358,7 @@ static int kvmppc_mmu_book3s_64_hv_xlate(struct kvm_vcpu *vcpu, gva_t eaddr,
	unsigned long pp, key;
	unsigned long v, orig_v, gr;
	__be64 *hptep;
	int index;
	long int index;
	int virtmode = vcpu->arch.shregs.msr & (data ? MSR_DR : MSR_IR);

	if (kvm_is_radix(vcpu->kvm))
+3 −3
Original line number Diff line number Diff line
@@ -725,10 +725,10 @@ int kvm_unmap_radix(struct kvm *kvm, struct kvm_memory_slot *memslot,
					      gpa, shift);
		kvmppc_radix_tlbie_page(kvm, gpa, shift);
		if ((old & _PAGE_DIRTY) && memslot->dirty_bitmap) {
			unsigned long npages = 1;
			unsigned long psize = PAGE_SIZE;
			if (shift)
				npages = 1ul << (shift - PAGE_SHIFT);
			kvmppc_update_dirty_map(memslot, gfn, npages);
				psize = 1ul << shift;
			kvmppc_update_dirty_map(memslot, gfn, psize);
		}
	}
	return 0;