Skip to content

Commit cffaefd

Browse files
arndbKAGA-KOKO
authored andcommitted
vdso: Use CONFIG_PAGE_SHIFT in vdso/datapage.h
Both the vdso rework and the CONFIG_PAGE_SHIFT changes were merged during the v6.9 merge window, so it is now possible to use CONFIG_PAGE_SHIFT instead of including asm/page.h in the vdso. This avoids the workaround for arm64 - commit 8b3843a ("vdso/datapage: Quick fix - use asm/page-def.h for ARM64") and addresses a build warning for powerpc64: In file included from <built-in>:4: In file included from /home/arnd/arm-soc/arm-soc/lib/vdso/gettimeofday.c:5: In file included from ../include/vdso/datapage.h:25: arch/powerpc/include/asm/page.h:230:9: error: result of comparison of constant 13835058055282163712 with expression of type 'unsigned long' is always true [-Werror,-Wtautological-constant-out-of-range-compare] 230 | return __pa(kaddr) >> PAGE_SHIFT; | ^~~~~~~~~~~ arch/powerpc/include/asm/page.h:217:37: note: expanded from macro '__pa' 217 | VIRTUAL_WARN_ON((unsigned long)(x) < PAGE_OFFSET); \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~ arch/powerpc/include/asm/page.h:202:73: note: expanded from macro 'VIRTUAL_WARN_ON' 202 | #define VIRTUAL_WARN_ON(x) WARN_ON(IS_ENABLED(CONFIG_DEBUG_VIRTUAL) && (x)) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~ arch/powerpc/include/asm/bug.h:88:25: note: expanded from macro 'WARN_ON' 88 | int __ret_warn_on = !!(x); \ | ^ Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Kees Cook <[email protected]> Acked-by: Michael Ellerman <[email protected]> (powerpc) Link: https://lore.kernel.org/r/[email protected]
1 parent 9e643ab commit cffaefd

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

arch/powerpc/include/asm/vdso/gettimeofday.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
#ifndef __ASSEMBLY__
66

7-
#include <asm/page.h>
87
#include <asm/vdso/timebase.h>
98
#include <asm/barrier.h>
109
#include <asm/unistd.h>
@@ -95,7 +94,7 @@ const struct vdso_data *__arch_get_vdso_data(void);
9594
static __always_inline
9695
const struct vdso_data *__arch_get_timens_vdso_data(const struct vdso_data *vd)
9796
{
98-
return (void *)vd + PAGE_SIZE;
97+
return (void *)vd + (1U << CONFIG_PAGE_SHIFT);
9998
}
10099
#endif
101100

include/vdso/datapage.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,6 @@
1919
#include <vdso/time32.h>
2020
#include <vdso/time64.h>
2121

22-
#ifdef CONFIG_ARM64
23-
#include <asm/page-def.h>
24-
#else
25-
#include <asm/page.h>
26-
#endif
27-
2822
#ifdef CONFIG_ARCH_HAS_VDSO_DATA
2923
#include <asm/vdso/data.h>
3024
#else
@@ -132,7 +126,7 @@ extern struct vdso_data _timens_data[CS_BASES] __attribute__((visibility("hidden
132126
*/
133127
union vdso_data_store {
134128
struct vdso_data data[CS_BASES];
135-
u8 page[PAGE_SIZE];
129+
u8 page[1U << CONFIG_PAGE_SHIFT];
136130
};
137131

138132
/*

0 commit comments

Comments
 (0)