KVM: PPC: Book3S HV: Streamline setting of reference and change bits
authorPaul Mackerras <paulus@ozlabs.org>
Sat, 24 Feb 2018 09:08:51 +0000 (20:08 +1100)
committerPaul Mackerras <paulus@ozlabs.org>
Sun, 18 Mar 2018 23:08:44 +0000 (10:08 +1100)
commitf7caf712d885713986baeac86b1b64bcbd9dcd91
tree7673855e408cd3309c1204634e5eea8a9a4646fd
parentc4c8a7643e74ebd7f2cfa80807562f16bb58c1d9
KVM: PPC: Book3S HV: Streamline setting of reference and change bits

When using the radix MMU, we can get hypervisor page fault interrupts
with the DSISR_SET_RC bit set in DSISR/HSRR1, indicating that an
attempt to set the R (reference) or C (change) bit in a PTE atomically
failed.  Previously we would find the corresponding Linux PTE and
check the permission and dirty bits there, but this is not really
necessary since we only need to do what the hardware was trying to
do, namely set R or C atomically.  This removes the code that reads
the Linux PTE and just update the partition-scoped PTE, having first
checked that it is still present, and if the access is a write, that
the PTE still has write permission.

Furthermore, we now check whether any other relevant bits are set
in DSISR, and if there are, then we proceed with the rest of the
function in order to handle whatever condition they represent,
instead of returning to the guest as we did previously.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
arch/powerpc/kvm/book3s_64_mmu_radix.c