set_direct_map_*() implementations verify wheter the direct map can be effectively set. This verification can be costly. Add an "advanced" API __set_direct_map_*() where the direct map is modified without any check. The caller must have verified it is safe earlier with one of the can_set_direct_map() or can_set_direct_map_range() functions. Signed-off-by: Vincent Donnefort diff --git a/include/linux/set_memory.h b/include/linux/set_memory.h index 88175c3fa751..5a1917a3fd52 100644 --- a/include/linux/set_memory.h +++ b/include/linux/set_memory.h @@ -34,6 +34,15 @@ static inline int set_direct_map_default_noflush(struct page *page) return 0; } +static inline int __set_direct_map_invalid_noflush(struct page *page) +{ + return 0; +} +static inline int __set_direct_map_default_noflush(struct page *page) +{ + return 0; +} + static inline int set_direct_map_valid_noflush(struct page *page, unsigned nr, bool valid) { @@ -70,6 +79,22 @@ static inline bool can_set_direct_map_range(struct page *page, unsigned long nr_ } #define can_set_direct_map_range can_set_direct_map_range #endif + +#ifndef __set_direct_map_invalid_noflush +static inline int __set_direct_map_invalid_noflush(struct page *page) +{ + return set_direct_map_invalid_noflush(page); +} +#define __set_direct_map_invalid_noflush __set_direct_map_invalid_noflush +#endif + +#ifndef __set_direct_map_default_noflush +static inline int __set_direct_map_default_noflush(struct page *page) +{ + return set_direct_map_default_noflush(page); +} +#define __set_direct_map_default_noflush __set_direct_map_default_noflush +#endif #endif /* CONFIG_ARCH_HAS_SET_DIRECT_MAP */ #ifdef CONFIG_X86_64 -- 2.55.0.970.g62bdec98f9-goog