@@ -451,7 +451,7 @@ static void __init map_mem(pgd_t *pgdp)
struct memblock_region *reg;
int flags = 0;
- if (debug_pagealloc_enabled())
+ if (debug_pagealloc_enabled() || xpfo_enabled())
flags = NO_BLOCK_MAPPINGS | NO_CONT_MAPPINGS;
/*
@@ -46,6 +46,8 @@ void xpfo_temp_map(const void *addr, size_t size, void **mapping,
void xpfo_temp_unmap(const void *addr, size_t size, void **mapping,
size_t mapping_len);
+bool xpfo_enabled(void);
+
#else /* !CONFIG_XPFO */
static inline void xpfo_kmap(void *kaddr, struct page *page) { }
@@ -68,6 +70,8 @@ static inline void xpfo_temp_unmap(const void *addr, size_t size,
}
+static inline bool xpfo_enabled(void) { return false; }
+
#endif /* CONFIG_XPFO */
#endif /* _LINUX_XPFO_H */
@@ -70,6 +70,12 @@ struct page_ext_operations page_xpfo_ops = {
.init = init_xpfo,
};
+bool __init xpfo_enabled(void)
+{
+ return !xpfo_disabled;
+}
+EXPORT_SYMBOL(xpfo_enabled);
+
static inline struct xpfo *lookup_xpfo(struct page *page)
{
struct page_ext *page_ext = lookup_page_ext(page);