From a8df61457657ec82d957a001ea9b57be68bb6bc0 Mon Sep 17 00:00:00 2001 From: Kalesh Singh Date: Mon, 10 Jun 2024 11:21:43 -0700 Subject: [PATCH] ANDROID: 16K: Only support page size emulation for x86_64 The original intention was to keep this generic so that it can be used for other architectures (arm64). This is no longer needed, only emulate PAGE_SHIFT for x86_64. Bug: 383389337 Bug: 328138888 Bug: 345252092 Bug: 315325080 Bug: 302403436 Change-Id: Ie1fb9b8cf6a18de77b2ec615ba5452060216c483 Signed-off-by: Kalesh Singh --- include/linux/page_size_compat.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/linux/page_size_compat.h b/include/linux/page_size_compat.h index 644dc7e91ff4..7dcdc993aea0 100644 --- a/include/linux/page_size_compat.h +++ b/include/linux/page_size_compat.h @@ -40,6 +40,7 @@ DECLARE_STATIC_KEY_FALSE(page_shift_compat_enabled); extern int page_shift_compat __ro_after_init; +#ifdef CONFIG_X86_64 static __always_inline unsigned __page_shift(void) { if (static_branch_unlikely(&page_shift_compat_enabled)) @@ -47,6 +48,9 @@ static __always_inline unsigned __page_shift(void) else return PAGE_SHIFT; } +#else /* !CONFIG_X86_64 */ +#define __page_shift() PAGE_SHIFT +#endif /* CONFIG_X86_64 */ #define __PAGE_SHIFT __page_shift() #define __PAGE_SIZE (_AC(1,UL) << __PAGE_SHIFT)