]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: KVM: Device mappings should be execute-never
authorJames Morse <james.morse@arm.com>
Tue, 27 Aug 2019 17:06:46 +0000 (18:06 +0100)
committerMarc Zyngier <maz@kernel.org>
Tue, 27 Aug 2019 17:16:02 +0000 (18:16 +0100)
commitbf02edf4bcdafb106e429606bed96aee4f5a5a21
tree6a74212f5ec43b4c9404df128a9e44a7fdf943b0
parent35fdd38f2ed52f0a9415f6e3f6250b14ef92d36d
arm64: KVM: Device mappings should be execute-never

Since commit 24e0d3ced8977 ("arm64: KVM: Avoid marking pages as XN in
Stage-2 if CTR_EL0.DIC is set"), KVM has stopped marking normal memory
as execute-never at stage2 when the system supports D->I Coherency at
the PoU. This avoids KVM taking a trap when the page is first executed,
in order to clean it to PoU.

The patch that added this change also wrapped PAGE_S2_DEVICE mappings
up in this too. The upshot is, if your CPU caches support DIC ...
you can execute devices.

Revert the PAGE_S2_DEVICE change so PTE_S2_XN is always used
directly.

Fixes: 24e0d3ced8977 ("arm64: KVM: Avoid marking pages as XN in Stage-2 if CTR_EL0.DIC is set")
Signed-off-by: James Morse <james.morse@arm.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/include/asm/pgtable-prot.h