public inbox for linuxppc-dev@ozlabs.org
 help / color / mirror / Atom feed
From: "Christophe Leroy (CS GROUP)" <chleroy@kernel.org>
To: "Thomas Weißschuh" <thomas.weissschuh@linutronix.de>,
	"Sverdlin, Alexander" <alexander.sverdlin@siemens.com>
Cc: "npiggin@gmail.com" <npiggin@gmail.com>,
	"luto@kernel.org" <luto@kernel.org>,
	"maddy@linux.ibm.com" <maddy@linux.ibm.com>,
	"tglx@kernel.org" <tglx@kernel.org>,
	"mpe@ellerman.id.au" <mpe@ellerman.id.au>,
	"vincenzo.frascino@arm.com" <vincenzo.frascino@arm.com>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] powerpc/vdso: Provide clock_getres_time64()
Date: Thu, 22 Jan 2026 11:58:04 +0100	[thread overview]
Message-ID: <230c749f-ebd6-4829-93ee-601d88000a45@kernel.org> (raw)
In-Reply-To: <20260122114217-79f13c16-0931-4c33-b68c-08e884a26004@linutronix.de>



Le 22/01/2026 à 11:49, Thomas Weißschuh a écrit :
> On Thu, Jan 22, 2026 at 11:27:43AM +0100, Christophe Leroy (CS GROUP) wrote:
>> Hi Thomas,
>>
>> Le 22/01/2026 à 10:50, Thomas Weißschuh a écrit :
>>> Hi Alexander,
>>>
>>> On Thu, Jan 22, 2026 at 09:39:09AM +0000, Sverdlin, Alexander wrote:
>>>> Hi Thomas, Christophe,
>>>>
>>>> On Wed, 2026-01-14 at 08:26 +0100, Thomas Weißschuh wrote:
>>>>> For consistency with __vdso_clock_gettime64() there should also be a
>>>>> 64-bit variant of clock_getres(). This will allow the extension of
>>>>> CONFIG_COMPAT_32BIT_TIME to the vDSO and finally the removal of 32-bit
>>>>> time types from the kernel and UAPI.
>>>>>
>>>>> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
>>>>
>>>> I've bisected this patch to cause the following build failure on my side:
>>>>
>>>>     LDS     arch/powerpc/kernel/vdso/vdso32.lds
>>>>     VDSO32A arch/powerpc/kernel/vdso/sigtramp32-32.o
>>>>     VDSO32A arch/powerpc/kernel/vdso/gettimeofday-32.o
>>>>     VDSO32A arch/powerpc/kernel/vdso/datapage-32.o
>>>>     VDSO32A arch/powerpc/kernel/vdso/cacheflush-32.o
>>>>     VDSO32A arch/powerpc/kernel/vdso/note-32.o
>>>>     VDSO32A arch/powerpc/kernel/vdso/getcpu-32.o
>>>>     VDSO32A arch/powerpc/kernel/vdso/getrandom-32.o
>>>>     VDSO32A arch/powerpc/kernel/vdso/vgetrandom-chacha-32.o
>>>>     VDSO32C arch/powerpc/kernel/vdso/vgettimeofday-32.o
>>>>     VDSO32C arch/powerpc/kernel/vdso/vgetrandom-32.o
>>>>     VDSO32A arch/powerpc/kernel/vdso/crtsavres-32.o
>>>>     VDSO32L arch/powerpc/kernel/vdso/vdso32.so.dbg
>>>> arch/powerpc/kernel/vdso/vdso32.so.dbg: dynamic relocations are not supported
>>>> make[2]: *** [arch/powerpc/kernel/vdso/Makefile:79: arch/powerpc/kernel/vdso/vdso32.so.dbg] Error 1
>>>> make[1]: *** [arch/powerpc/Makefile:388: vdso_prepare] Error 2
>>>
>>> Thanks for the report!
>>>
>>>> Does it ring any bells? What could I try/test?
>>>
>>> Not immediately, but I'll look into it.
>>>
>>>> I'm using gcc-15.2.0 and binutils 2.45.1.
>>>
>>> Is this a toolchain from https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcdn.kernel.org%2Fpub%2Ftools%2Fcrosstool%2F&data=05%7C02%7Cchristophe.leroy%40csgroup.eu%7C937051154ddf479721f708de59a3e01c%7C8b87af7d86474dc78df45f69a2011bb5%7C0%7C0%7C639046757528646789%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=qkl4zNfg2j%2F24vZV7nQ7LLDtxG0WbgaJc30kjHQZqpk%3D&reserved=0 ?
>>> Could you also share your configuration?
>>
>> I've just been able to reproduce it with ppc64_defconfig +
>> CONFIG_CC_OPTIMIZE_FOR_SIZE
> 
> Thanks for the hint, no I can reproduce it, too.
>>
>>    VDSO32L arch/powerpc/kernel/vdso/vdso32.so.dbg
>> arch/powerpc/kernel/vdso/vdso32.so.dbg: dynamic relocations are not
>> supported
>> make[2]: *** [arch/powerpc/kernel/vdso/Makefile:79:
>> arch/powerpc/kernel/vdso/vdso32.so.dbg] Error 1
>> make[1]: *** [arch/powerpc/Makefile:388: vdso_prepare] Error 2
>> make: *** [Makefile:248: __sub-make] Error 2
>>
>> I'll investigate
> 
> It seems the compiler decides to call memset(), which is not valid from the
> vDSO. We are are using -ffreestanding. Disabling CONFIG_INIT_STACK_ALL_ZERO
> fixes the issue. So I guess we should a) figure out why -ffreestanding does
> not seem to work here and b) exclude the vDSO from the stack initialization
> logic.
> 

Ah, ok.

Reminds me commit b91c8c42ffdd ("lib/vdso: Force inlining of 
__cvdso_clock_gettime_common()")

Problem fixed with:

diff --git a/lib/vdso/gettimeofday.c b/lib/vdso/gettimeofday.c
index 95df0153f05ab..4399e143d43a5 100644
--- a/lib/vdso/gettimeofday.c
+++ b/lib/vdso/gettimeofday.c
@@ -421,7 +421,7 @@ static __maybe_unused __kernel_old_time_t 
__cvdso_time(__kernel_old_time_t *time
  #endif /* VDSO_HAS_TIME */

  #ifdef VDSO_HAS_CLOCK_GETRES
-static __maybe_unused
+static __always_inline
  bool __cvdso_clock_getres_common(const struct vdso_time_data *vd, 
clockid_t clock,
  				 struct __kernel_timespec *res)
  {


Christophe


  reply	other threads:[~2026-01-22 10:58 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-14  7:26 [PATCH] powerpc/vdso: Provide clock_getres_time64() Thomas Weißschuh
2026-01-14  8:27 ` Christophe Leroy (CS GROUP)
2026-01-22  9:39 ` Sverdlin, Alexander
2026-01-22  9:50   ` Thomas Weißschuh
2026-01-22 10:00     ` Sverdlin, Alexander
2026-01-22 10:27     ` Christophe Leroy (CS GROUP)
2026-01-22 10:49       ` Thomas Weißschuh
2026-01-22 10:58         ` Christophe Leroy (CS GROUP) [this message]
2026-01-22 11:07           ` Thomas Weißschuh
2026-01-22 11:31             ` Christophe Leroy (CS GROUP)
2026-01-22 11:41               ` Thomas Weißschuh
2026-01-22 13:30                 ` Christophe Leroy (CS GROUP)
2026-01-22 10:49       ` Christophe Leroy (CS GROUP)
2026-01-22  9:53   ` Christophe Leroy (CS GROUP)

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=230c749f-ebd6-4829-93ee-601d88000a45@kernel.org \
    --to=chleroy@kernel.org \
    --cc=alexander.sverdlin@siemens.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=luto@kernel.org \
    --cc=maddy@linux.ibm.com \
    --cc=mpe@ellerman.id.au \
    --cc=npiggin@gmail.com \
    --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