From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=5.0 tests=MAILING_LIST_MULTI, NICE_REPLY_A,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 24635 invoked from network); 10 Sep 2020 13:05:18 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 10 Sep 2020 13:05:18 -0000 Received: (qmail 6106 invoked by uid 550); 10 Sep 2020 13:03:22 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 19890 invoked from network); 10 Sep 2020 09:59:22 -0000 To: Arnd Bergmann , Palmer Dabbelt Cc: Rich Felker , musl@lists.openwall.com References: <20200909213644.GB3265@brightrain.aerifal.cx> From: Vincenzo Frascino Message-ID: Date: Thu, 10 Sep 2020 11:01:31 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [musl] riscv32 v2 On 9/10/20 8:36 AM, Arnd Bergmann wrote: > On Thu, Sep 10, 2020 at 1:08 AM Palmer Dabbelt wrote: >> On Wed, 09 Sep 2020 14:36:44 PDT (-0700), dalias@libc.org wrote: >>> On Wed, Sep 09, 2020 at 02:28:55PM -0700, Palmer Dabbelt wrote: >>>> On Wed, 09 Sep 2020 13:28:27 PDT (-0700), dalias@libc.org wrote: >>> Possible addition of vdso clock_gettime isn't a blocker for moving >>> forward with the musl port, but syscall_arch.h should accurately >>> describe what's available and should not attempt to use vdso before >>> it's a public kernel interface (e.g. resolving the question of what >>> the function name will be). So I think it should be removed for now. >> >> Sorry if that was confusing, but I definitely agree. >> >> I guess my point was that the lack of VDSO clock functions on rv32 was probably >> an oversight, but one that shouldn't block the port. We definitely can't just >> make up a kernel interface, particularly as the reason we don't have these on >> rv32 is because the generic versions of the functions we're using don't appear >> to run on 32-bit targets. >> >> That probably means there's some more subtle issue, though TBH I don't know >> enough about the 64-bit-ification of time_t for it to just jump out at me. I >> don't want to derail the thread too much, but I tried the obvious thing > > When the vdso for rv64 was added, there was no time64 support in the > vdso code in general, as this only came with the "generic vdso" infrastructure > that was added later on, with commit ad5d1122b82f ("riscv: use vDSO > common flow to reduce the latency of the time-related functions") in v5.8. > > At that point it probably should have been added as well. > >> --- a/arch/riscv/kernel/vdso/Makefile >> +++ b/arch/riscv/kernel/vdso/Makefile >> @@ -7,9 +7,7 @@ ARCH_REL_TYPE_ABS := R_RISCV_32|R_RISCV_64|R_RISCV_JUMP_SLOT >> include $(srctree)/lib/vdso/Makefile >> # Symbols present in the vdso >> vdso-syms = rt_sigreturn >> -ifdef CONFIG_64BIT >> vdso-syms += vgettimeofday >> -endif >> vdso-syms += getcpu >> vdso-syms += flush_icache >> >> and it doesn't build. I've added Arnd, who might have a better idea of what's >> going on. Whatever happens, I think the best bet is to just drop the clock >> functions (specifically __vdso_{clock_gettime,gettimeofday,clock_getres}) from >> the rv32 port right now. > > For rv32 you need clock_gettime64, not clock_gettime, which in the Linux > ABI refers to the interface with the old timespec. There was some debate > over whether clock_getres_time64 and gettimeofday_time64 would make > sense to be added here, but I have so far leaned to the position that these > are not as performance critical and not worth the effort. > > Vincenzo has argued that we might want to extend the generic vdso code > to include a number of additional syscall implementations, which would > then include gettimeofday_time64 and clock_getres_time64. > I agree with Arnd, clock_getres_time64 and gettimeofday_time64 were not added in the original port because not considered as performance critical as clock_gettime64. We might reconsider if there is a strong use case for those. > Arnd > -- Regards, Vincenzo