mbox series

[v3,0/2] arm64: Support Enhanced PAN

Message ID 20210119160723.116983-1-vladimir.murzin@arm.com (mailing list archive)
Headers show
Series arm64: Support Enhanced PAN | expand

Message

Vladimir Murzin Jan. 19, 2021, 4:07 p.m. UTC
Hi

ARM architecture gains support of Enhanced Privileged Access Never
(EPAN) which allows Privileged Access Never to be used with
Execute-only mappings.

As a consequence 24cecc377463 ("arm64: Revert support for execute-only
user mappings") can be revisited and re-enabled.

Changelog:

	RFC -> v1
	    - removed cap check in pte_valid_not_user (per Catalin)
	    - local_flush_tlb_all() in cpu_enable_epan() (per Catalin)
	    - reordered with CnP (per Catalin)
	    - s/HWCAP2_EPAN/HWCAP2_EXECONLY/ (per Catalin)

	v1 -> v2
	    - rebased on for-next/uaccess (for INIT_SCTLR_EL1_MMU_ON)
	    - moved EPAN enable to proc.S (via INIT_SCTLR_EL1_MMU_ON),
	      so no need in enable method from cpufeature, no need to
	      keep ordering relative to CnP (per Catalin)

	v2 -> v3
	    - rebased on 5.11-rc4

Thanks!

Vladimir Murzin (2):
  arm64: Support execute-only permissions with Enhanced PAN
  arm64: Introduce HWCAPS2_EXECONLY

 arch/arm64/Kconfig                    | 17 +++++++++++++++++
 arch/arm64/include/asm/cpucaps.h      |  3 ++-
 arch/arm64/include/asm/hwcap.h        |  1 +
 arch/arm64/include/asm/pgtable-prot.h |  5 +++--
 arch/arm64/include/asm/pgtable.h      | 14 +++++++++++++-
 arch/arm64/include/asm/sysreg.h       |  4 +++-
 arch/arm64/include/uapi/asm/hwcap.h   |  1 +
 arch/arm64/kernel/cpufeature.c        | 15 +++++++++++++++
 arch/arm64/kernel/cpuinfo.c           |  1 +
 arch/arm64/mm/fault.c                 |  3 +++
 10 files changed, 59 insertions(+), 5 deletions(-)

Comments

Will Deacon Jan. 26, 2021, 11:09 a.m. UTC | #1
On Tue, Jan 19, 2021 at 04:07:21PM +0000, Vladimir Murzin wrote:
> ARM architecture gains support of Enhanced Privileged Access Never
> (EPAN) which allows Privileged Access Never to be used with
> Execute-only mappings.
> 
> As a consequence 24cecc377463 ("arm64: Revert support for execute-only
> user mappings") can be revisited and re-enabled.

Does ptdump.c need updating too?

Will
Vladimir Murzin March 12, 2021, 11:18 a.m. UTC | #2
On 1/26/21 11:09 AM, Will Deacon wrote:
> On Tue, Jan 19, 2021 at 04:07:21PM +0000, Vladimir Murzin wrote:
>> ARM architecture gains support of Enhanced Privileged Access Never
>> (EPAN) which allows Privileged Access Never to be used with
>> Execute-only mappings.
>>
>> As a consequence 24cecc377463 ("arm64: Revert support for execute-only
>> user mappings") can be revisited and re-enabled.
> 
> Does ptdump.c need updating too?

I had a look at ptdump.c and IIUIC that supposed to pretty print bits for
page table entry. Thus with EPAN supported we stop seeing "USR" for execute
only mapping, but it correctly reflects state of pte. What I'm missing?

Cheers
Vladimir