* [PATCH] vdso/datapage: Quick fix - use asm/page-def.h for ARM64
@ 2024-02-26 17:50 Anna-Maria Behnsen
2024-02-27 13:44 ` Catalin Marinas
2024-02-27 14:46 ` Vincenzo Frascino
0 siblings, 2 replies; 4+ messages in thread
From: Anna-Maria Behnsen @ 2024-02-26 17:50 UTC (permalink / raw)
To: linux-kernel
Cc: Andy Lutomirski, Thomas Gleixner, Vincenzo Frascino,
Arnd Bergmann, Kees Cook, Catalin Marinas, Will Deacon,
linux-arm-kernel, Anna-Maria Behnsen,
Linux Kernel Functional Testing
The vdso rework for the generic union vdso_data_store broke compat VDSO on
arm64:
In file included from arch/arm64/include/asm/lse.h:5,
from arch/arm64/include/asm/cmpxchg.h:14,
from arch/arm64/include/asm/atomic.h:16,
from include/linux/atomic.h:7,
from include/asm-generic/bitops/atomic.h:5,
from arch/arm64/include/asm/bitops.h:25,
from include/linux/bitops.h:68,
from arch/arm64/include/asm/memory.h:209,
from arch/arm64/include/asm/page.h:46,
from include/vdso/datapage.h:22,
from lib/vdso/gettimeofday.c:5,
from <command-line>:
arch/arm64/include/asm/atomic_ll_sc.h:298:9: error: unknown type name 'u128'
298 | u128 full;
| ^~~~
arch/arm64/include/asm/atomic_ll_sc.h:305:24: error: unknown type name 'u128'
305 | static __always_inline u128
\
|
The reason is the include of asm/page.h which in turn includes headers
which are outside the scope of compat VDSO. The only reason for the
asm/page.h include is the required definition of PAGE_SIZE. But as arm64
defines PAGE_SIZE in asm/page-def.h without extra header includes, this
could be used instead.
Caution: this is a quick fix only! The final fix is an upcoming cleanup of
Arnd which consolidates PAGE_SIZE definition. After the cleanup, the
include of asm/page.h to access PAGE_SIZE is no longer required.
Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>
Fixes: a0d2fcd62ac2 ("vdso/ARM: Make union vdso_data_store available for all architectures")
Link: https://lore.kernel.org/lkml/CA+G9fYtrXXm_KO9fNPz3XaRxHV7UD_yQp-TEuPQrNRHU+_0W_Q@mail.gmail.com/
Signed-off-by: Anna-Maria Behnsen <anna-maria@linutronix.de>
---
Patch applies on tip/timers/core and was tested with clang-14
---
include/vdso/datapage.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/include/vdso/datapage.h b/include/vdso/datapage.h
index 7ba44379a095..5d5c0b8efff2 100644
--- a/include/vdso/datapage.h
+++ b/include/vdso/datapage.h
@@ -19,7 +19,11 @@
#include <vdso/time32.h>
#include <vdso/time64.h>
+#ifdef CONFIG_ARM64
+#include <asm/page-def.h>
+#else
#include <asm/page.h>
+#endif
#ifdef CONFIG_ARCH_HAS_VDSO_DATA
#include <asm/vdso/data.h>
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] vdso/datapage: Quick fix - use asm/page-def.h for ARM64
2024-02-26 17:50 [PATCH] vdso/datapage: Quick fix - use asm/page-def.h for ARM64 Anna-Maria Behnsen
@ 2024-02-27 13:44 ` Catalin Marinas
2024-02-27 15:34 ` Thomas Gleixner
2024-02-27 14:46 ` Vincenzo Frascino
1 sibling, 1 reply; 4+ messages in thread
From: Catalin Marinas @ 2024-02-27 13:44 UTC (permalink / raw)
To: Anna-Maria Behnsen
Cc: linux-kernel, Andy Lutomirski, Thomas Gleixner, Vincenzo Frascino,
Arnd Bergmann, Kees Cook, Will Deacon, linux-arm-kernel,
Linux Kernel Functional Testing
On Mon, Feb 26, 2024 at 06:50:23PM +0100, Anna-Maria Behnsen wrote:
> diff --git a/include/vdso/datapage.h b/include/vdso/datapage.h
> index 7ba44379a095..5d5c0b8efff2 100644
> --- a/include/vdso/datapage.h
> +++ b/include/vdso/datapage.h
> @@ -19,7 +19,11 @@
> #include <vdso/time32.h>
> #include <vdso/time64.h>
>
> +#ifdef CONFIG_ARM64
> +#include <asm/page-def.h>
> +#else
> #include <asm/page.h>
> +#endif
I'm not a fan of guarding includes but I guess this would do until we
merge Arnd's clean-up patches. FWIW:
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] vdso/datapage: Quick fix - use asm/page-def.h for ARM64
2024-02-26 17:50 [PATCH] vdso/datapage: Quick fix - use asm/page-def.h for ARM64 Anna-Maria Behnsen
2024-02-27 13:44 ` Catalin Marinas
@ 2024-02-27 14:46 ` Vincenzo Frascino
1 sibling, 0 replies; 4+ messages in thread
From: Vincenzo Frascino @ 2024-02-27 14:46 UTC (permalink / raw)
To: Anna-Maria Behnsen, linux-kernel
Cc: Andy Lutomirski, Thomas Gleixner, Arnd Bergmann, Kees Cook,
Catalin Marinas, Will Deacon, linux-arm-kernel,
Linux Kernel Functional Testing
On 26/02/2024 17:50, Anna-Maria Behnsen wrote:
> The vdso rework for the generic union vdso_data_store broke compat VDSO on
> arm64:
>
> In file included from arch/arm64/include/asm/lse.h:5,
> from arch/arm64/include/asm/cmpxchg.h:14,
> from arch/arm64/include/asm/atomic.h:16,
> from include/linux/atomic.h:7,
> from include/asm-generic/bitops/atomic.h:5,
> from arch/arm64/include/asm/bitops.h:25,
> from include/linux/bitops.h:68,
> from arch/arm64/include/asm/memory.h:209,
> from arch/arm64/include/asm/page.h:46,
> from include/vdso/datapage.h:22,
> from lib/vdso/gettimeofday.c:5,
> from <command-line>:
> arch/arm64/include/asm/atomic_ll_sc.h:298:9: error: unknown type name 'u128'
> 298 | u128 full;
> | ^~~~
> arch/arm64/include/asm/atomic_ll_sc.h:305:24: error: unknown type name 'u128'
> 305 | static __always_inline u128
> \
> |
>
> The reason is the include of asm/page.h which in turn includes headers
> which are outside the scope of compat VDSO. The only reason for the
> asm/page.h include is the required definition of PAGE_SIZE. But as arm64
> defines PAGE_SIZE in asm/page-def.h without extra header includes, this
> could be used instead.
>
> Caution: this is a quick fix only! The final fix is an upcoming cleanup of
> Arnd which consolidates PAGE_SIZE definition. After the cleanup, the
> include of asm/page.h to access PAGE_SIZE is no longer required.
>
> Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>
> Fixes: a0d2fcd62ac2 ("vdso/ARM: Make union vdso_data_store available for all architectures")
> Link: https://lore.kernel.org/lkml/CA+G9fYtrXXm_KO9fNPz3XaRxHV7UD_yQp-TEuPQrNRHU+_0W_Q@mail.gmail.com/
> Signed-off-by: Anna-Maria Behnsen <anna-maria@linutronix.de>
> ---
>
> Patch applies on tip/timers/core and was tested with clang-14
Waiting for Arnd's fix:
Acked-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] vdso/datapage: Quick fix - use asm/page-def.h for ARM64
2024-02-27 13:44 ` Catalin Marinas
@ 2024-02-27 15:34 ` Thomas Gleixner
0 siblings, 0 replies; 4+ messages in thread
From: Thomas Gleixner @ 2024-02-27 15:34 UTC (permalink / raw)
To: Catalin Marinas, Anna-Maria Behnsen
Cc: linux-kernel, Andy Lutomirski, Vincenzo Frascino, Arnd Bergmann,
Kees Cook, Will Deacon, linux-arm-kernel,
Linux Kernel Functional Testing
On Tue, Feb 27 2024 at 13:44, Catalin Marinas wrote:
> On Mon, Feb 26, 2024 at 06:50:23PM +0100, Anna-Maria Behnsen wrote:
>> diff --git a/include/vdso/datapage.h b/include/vdso/datapage.h
>> index 7ba44379a095..5d5c0b8efff2 100644
>> --- a/include/vdso/datapage.h
>> +++ b/include/vdso/datapage.h
>> @@ -19,7 +19,11 @@
>> #include <vdso/time32.h>
>> #include <vdso/time64.h>
>>
>> +#ifdef CONFIG_ARM64
>> +#include <asm/page-def.h>
>> +#else
>> #include <asm/page.h>
>> +#endif
>
> I'm not a fan of guarding includes but I guess this would do until we
> merge Arnd's clean-up patches. FWIW:
Nobody is a fan of that, but the cleanup is not available tomorrow :)
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-02-27 15:35 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-26 17:50 [PATCH] vdso/datapage: Quick fix - use asm/page-def.h for ARM64 Anna-Maria Behnsen
2024-02-27 13:44 ` Catalin Marinas
2024-02-27 15:34 ` Thomas Gleixner
2024-02-27 14:46 ` Vincenzo Frascino
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).