diff options
author | Yury Khrustalev <yury.khrustalev@arm.com> | 2025-01-13 20:06:17 +0300 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2025-02-17 21:11:18 +0300 |
commit | 6d61527d931ba07bca691f204cdf3201b280879d (patch) | |
tree | 3cffd4b876c1a330f4fdc0f6fe2c19b123d99ff3 /tools/perf/scripts/python/export-to-postgresql.py | |
parent | 0ad2507d5d93f39619fc42372c347d6006b64319 (diff) | |
download | linux-6d61527d931ba07bca691f204cdf3201b280879d.tar.xz |
mm/pkey: Add PKEY_UNRESTRICTED macro
Memory protection keys (pkeys) uapi has two macros for pkeys restrictions:
- PKEY_DISABLE_ACCESS 0x1
- PKEY_DISABLE_WRITE 0x2
with implicit literal value of 0x0 that means "unrestricted". Code that
works with pkeys has to use this literal value when implying that a pkey
imposes no restrictions. This may reduce readability because 0 can be
written in various ways (e.g. 0x0 or 0) and also because 0 in the context
of pkeys can be mistaken for "no permissions" (akin PROT_NONE) while it
actually means "no restrictions". This is important because pkeys are
oftentimes used near mprotect() that uses PROT_ macros.
This patch adds PKEY_UNRESTRICTED macro defined as 0x0.
Signed-off-by: Yury Khrustalev <yury.khrustalev@arm.com>
Acked-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Kevin Brodsky <kevin.brodsky@arm.com>
Link: https://lore.kernel.org/r/20250113170619.484698-2-yury.khrustalev@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions