]> www.infradead.org Git - users/hch/uuid.git/commit
KVM: arm/arm64: Preserve Exec permission across R/W permission faults
authorMarc Zyngier <marc.zyngier@arm.com>
Mon, 23 Oct 2017 16:11:21 +0000 (17:11 +0100)
committerChristoffer Dall <christoffer.dall@linaro.org>
Mon, 8 Jan 2018 14:20:46 +0000 (15:20 +0100)
commit7a3796d2ef5bb948f709467eef1bf96edbfc67a0
tree8b33f893ac17f71126f7960a7909d18be397353d
parenta9c0e12ebee56ef06b7eccdbc73bab71d0018df8
KVM: arm/arm64: Preserve Exec permission across R/W permission faults

So far, we loose the Exec property whenever we take permission
faults, as we always reconstruct the PTE/PMD from scratch. This
can be counter productive as we can end-up with the following
fault sequence:

X -> RO -> ROX -> RW -> RWX

Instead, we can lookup the existing PTE/PMD and clear the XN bit in the
new entry if it was already cleared in the old one, leadig to a much
nicer fault sequence:

X -> ROX -> RWX

Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
arch/arm/include/asm/kvm_mmu.h
arch/arm64/include/asm/kvm_mmu.h
virt/kvm/arm/mmu.c