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

KVM: PPC: Book3S HV: Make H_REMOVE return correct HPTE value for absent HPTEs

This fixes a bug where the old HPTE value returned by H_REMOVE has
the valid bit clear if the HPTE was an absent HPTE, as happens for
HPTEs for emulated MMIO pages and for RAM pages that have been paged
out by the host. If the absent bit is set, we clear it and set the
valid bit, because from the guest's point of view, the HPTE is valid.

Signed-off-by: Paul Mackerras <paulus@samba.org>

+2
+2
arch/powerpc/kvm/book3s_hv_rm_mmu.c
··· 470 470 note_hpte_modification(kvm, rev); 471 471 unlock_hpte(hpte, 0); 472 472 473 + if (v & HPTE_V_ABSENT) 474 + v = (v & ~HPTE_V_ABSENT) | HPTE_V_VALID; 473 475 hpret[0] = v; 474 476 hpret[1] = r; 475 477 return H_SUCCESS;