summaryrefslogtreecommitdiff
path: root/arch/arm64/include/asm/kvm_emulate.h
diff options
context:
space:
mode:
authorArd Biesheuvel <ardb@kernel.org>2024-02-14 15:29:13 +0300
committerCatalin Marinas <catalin.marinas@arm.com>2024-02-16 15:42:37 +0300
commit60d043c101769b4fd6f609b4a7b9b8ad1f867860 (patch)
treebb01b6807a89167398520cbd578ffdabb253704c /arch/arm64/include/asm/kvm_emulate.h
parent68aec33f8f5a87b0450159e5e141d2d6c9d76850 (diff)
downloadlinux-60d043c101769b4fd6f609b4a7b9b8ad1f867860.tar.xz
arm64: Avoid #define'ing PTE_MAYBE_NG to 0x0 for asm use
The PROT_* macros resolve to expressions that are only valid in C and not in assembler, and so they are only usable from C code. Currently, we make an exception for the permission indirection init code in proc.S, which doesn't care about the bits that are conditionally set, and so we just #define PTE_MAYBE_NG to 0x0 for any assembler file that includes these definitions. This is dodgy because this means that PROT_NORMAL and friends is generally available in asm code, but defined in a way that deviates from the definition that C code will observe, which might lead to hard to diagnose issues down the road. So instead, #define PTE_MAYBE_NG only in the place where the PIE constants are evaluated, and #undef it again right after. This allows us to drop the #define from pgtable-prot.h, and avoid the risk of deviating definitions between asm and C. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Link: https://lore.kernel.org/r/20240214122845.2033971-72-ardb+git@google.com Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm64/include/asm/kvm_emulate.h')
0 files changed, 0 insertions, 0 deletions