Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Christophe Leroy (CS GROUP)" <chleroy@kernel.org>
To: "Thomas Weißschuh" <thomas.weissschuh@linutronix.de>,
	"Thomas Gleixner" <tglx@kernel.org>,
	"Andy Lutomirski" <luto@kernel.org>,
	"Vincenzo Frascino" <vincenzo.frascino@arm.com>
Cc: linux-csky@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, loongarch@lists.linux.dev,
	linuxppc-dev@lists.ozlabs.org, linux-mips@vger.kernel.org,
	linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org
Subject: Re: [PATCH 5/9] powerpc/vdso: Directly include the generic vDSO implementations
Date: Fri, 4 Dec 2026 11:28:19 +0100	[thread overview]
Message-ID: <c8d58f15-a47d-4774-a519-b4399d806f0e@kernel.org> (raw)
In-Reply-To: <20261204-vdso-generic-include-v1-5-8f4ed31bfbbd@linutronix.de>



Le 04/12/2026 à 08:30, Thomas Weißschuh a écrit :
> The inclusion of the generic vDSO implementation through compiler
> arguments is complicated and non-obvious.
> 
> Directly include the .c files instead.
> 
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
> ---
>   arch/powerpc/kernel/vdso/Makefile        | 10 +---------
>   arch/powerpc/kernel/vdso/vgetrandom.c    |  2 ++
>   arch/powerpc/kernel/vdso/vgettimeofday.c |  2 ++
>   3 files changed, 5 insertions(+), 9 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/vdso/Makefile b/arch/powerpc/kernel/vdso/Makefile
> index 0d1a49529885..386eb3778934 100644
> --- a/arch/powerpc/kernel/vdso/Makefile
> +++ b/arch/powerpc/kernel/vdso/Makefile
> @@ -11,19 +11,11 @@ obj-vdso64 = sigtramp64-64.o gettimeofday-64.o datapage-64.o cacheflush-64.o not
>   obj-vdso32 += getrandom-32.o vgetrandom-chacha-32.o
>   obj-vdso64 += getrandom-64.o vgetrandom-chacha-64.o
>   
> -ifneq ($(c-gettimeofday-y),)
> -  CFLAGS_vgettimeofday-32.o += -include $(c-gettimeofday-y)
>   # Go prior to 1.16.x assumes r30 is not clobbered by any VDSO code. That used to be true
>   # by accident when the VDSO was hand-written asm code, but may not be now that the VDSO is
>   # compiler generated. To avoid breaking Go tell GCC not to use r30. Impact on code
>   # generation is minimal, it will just use r29 instead.
> -  CFLAGS_vgettimeofday-64.o += -include $(c-gettimeofday-y) $(call cc-option, -ffixed-r30)
> -endif
> -
> -ifneq ($(c-getrandom-y),)
> -  CFLAGS_vgetrandom-32.o += -include $(c-getrandom-y)
> -  CFLAGS_vgetrandom-64.o += -include $(c-getrandom-y)
> -endif
> +CFLAGS_vgettimeofday-64.o += $(call cc-option, -ffixed-r30)

Maybe it is time to get rid of this fixed r30 workaround ?

It was introduced in July 2021 by commit a88603f4b92e ("powerpc/vdso: 
Don't use r30 to avoid breaking Go lang")

But go 1.15 has been obsoleted in August 2021.

Allthought the comment gives the impression to go 1.16 is ok, it is only 
from go 1.16.7 that the problem is fixed. However go 1.17 onwoards are 
fixed, and go 1.16 was obsoleted by mi march 2022.

>   
>   # Build rules
>   
> diff --git a/arch/powerpc/kernel/vdso/vgetrandom.c b/arch/powerpc/kernel/vdso/vgetrandom.c
> index cc79b960a541..e164e2052615 100644
> --- a/arch/powerpc/kernel/vdso/vgetrandom.c
> +++ b/arch/powerpc/kernel/vdso/vgetrandom.c
> @@ -7,6 +7,8 @@
>   #include <linux/time.h>
>   #include <linux/types.h>
>   
> +#include "../../../../lib/vdso/getrandom.c"
> +
>   ssize_t __c_kernel_getrandom(void *buffer, size_t len, unsigned int flags, void *opaque_state,
>   			     size_t opaque_len)
>   {
> diff --git a/arch/powerpc/kernel/vdso/vgettimeofday.c b/arch/powerpc/kernel/vdso/vgettimeofday.c
> index 4b712fb01a3f..11a69411e04a 100644
> --- a/arch/powerpc/kernel/vdso/vgettimeofday.c
> +++ b/arch/powerpc/kernel/vdso/vgettimeofday.c
> @@ -5,6 +5,8 @@
>   #include <linux/time.h>
>   #include <linux/types.h>
>   
> +#include "../../../../lib/vdso/gettimeofday.c"
> +
>   #ifdef __powerpc64__
>   int __c_kernel_clock_gettime(clockid_t clock, struct __kernel_timespec *ts,
>   			     const struct vdso_time_data *vd)
> 



  reply	other threads:[~2026-12-04 10:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04  7:30 [PATCH 0/9] vdso: Directly include the generic vDSO implementations Thomas Weißschuh
2026-12-04  7:30 ` [PATCH 1/9] csky/vdso: Remove all gettimeofday() remnants Thomas Weißschuh
2026-12-04  7:30 ` [PATCH 2/9] arm64/vdso: Directly include the generic vDSO implementations Thomas Weißschuh
2026-12-04  7:30 ` [PATCH 3/9] ARM: vdso: " Thomas Weißschuh
2026-12-04  7:30 ` [PATCH 4/9] LoongArch: vDSO: " Thomas Weißschuh
2026-12-04  7:30 ` [PATCH 5/9] powerpc/vdso: " Thomas Weißschuh
2026-12-04 10:28   ` Christophe Leroy (CS GROUP) [this message]
2026-12-04 13:44     ` Thomas Weißschuh
2026-12-04  7:30 ` [PATCH 6/9] MIPS: VDSO: " Thomas Weißschuh
2026-12-04  7:30 ` [PATCH 7/9] riscv: vdso: " Thomas Weißschuh
2026-12-04  7:30 ` [PATCH 8/9] s390/vdso: " Thomas Weißschuh
2026-12-04  7:30 ` [PATCH 9/9] vdso: Drop the old inclusion machinery Thomas Weißschuh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c8d58f15-a47d-4774-a519-b4399d806f0e@kernel.org \
    --to=chleroy@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-csky@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=loongarch@lists.linux.dev \
    --cc=luto@kernel.org \
    --cc=tglx@kernel.org \
    --cc=thomas.weissschuh@linutronix.de \
    --cc=vincenzo.frascino@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox