diff options
author | Peter Zijlstra <peterz@infradead.org> | 2022-10-29 14:19:31 +0300 |
---|---|---|
committer | Dave Hansen <dave.hansen@linux.intel.com> | 2022-12-15 21:37:27 +0300 |
commit | 60463628c9e0a8060ac6bef0457b0505c7532c7c (patch) | |
tree | 7a55e6d4605579ac147d5e41fc3777d1ddcc2cd5 /include | |
parent | d48567c9a0d1e605639f8a8705a61bbb55fb4e84 (diff) | |
download | linux-60463628c9e0a8060ac6bef0457b0505c7532c7c.tar.xz |
x86/mm: Implement native set_memory_rox()
Provide a native implementation of set_memory_rox(), avoiding the
double set_memory_ro();set_memory_x(); calls.
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/set_memory.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/set_memory.h b/include/linux/set_memory.h index 023ebc67a36c..95ac8398ee72 100644 --- a/include/linux/set_memory.h +++ b/include/linux/set_memory.h @@ -14,6 +14,7 @@ static inline int set_memory_x(unsigned long addr, int numpages) { return 0; } static inline int set_memory_nx(unsigned long addr, int numpages) { return 0; } #endif +#ifndef set_memory_rox static inline int set_memory_rox(unsigned long addr, int numpages) { int ret = set_memory_ro(addr, numpages); @@ -21,6 +22,7 @@ static inline int set_memory_rox(unsigned long addr, int numpages) return ret; return set_memory_x(addr, numpages); } +#endif #ifndef CONFIG_ARCH_HAS_SET_DIRECT_MAP static inline int set_direct_map_invalid_noflush(struct page *page) |