This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC v3 23/23] RISC-V: Use 64-bit vdso syscalls


 On Wed, Jul 17, 2019 at 3:23 PM Alistair Francis <alistair23@gmail.com> wrote:
>
> On Wed, Jul 17, 2019 at 1:02 AM Arnd Bergmann <arnd@arndb.de> wrote:
> >
> > On Wed, Jul 17, 2019 at 7:33 AM Florian Weimer <fweimer@redhat.com> wrote:
> > >
> > > * Alistair Francis:
> > >
> > > > Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> > > > ---
> > > >  sysdeps/unix/sysv/linux/riscv/init-first.c | 4 ++--
> > > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > > >
> > > > diff --git a/sysdeps/unix/sysv/linux/riscv/init-first.c b/sysdeps/unix/sysv/linux/riscv/init-first.c
> > > > index 155a4a2c0c..fa9c690cdd 100644
> > > > --- a/sysdeps/unix/sysv/linux/riscv/init-first.c
> > > > +++ b/sysdeps/unix/sysv/linux/riscv/init-first.c
> > > > @@ -43,11 +43,11 @@ _libc_vdso_platform_setup (void)
> > > >    PTR_MANGLE (p);
> > > >    VDSO_SYMBOL (gettimeofday) = p;
> > > >
> > > > -  p = _dl_vdso_vsym ("__vdso_clock_gettime", &linux_version);
> > > > +  p = _dl_vdso_vsym ("__vdso_clock_gettime64", &linux_version);
> > > >    PTR_MANGLE (p);
> > > >    VDSO_SYMBOL (clock_gettime) = p;
> > > >
> > > > -  p = _dl_vdso_vsym ("__vdso_clock_getres", &linux_version);
> > > > +  p = _dl_vdso_vsym ("__vdso_clock_getres_time64", &linux_version);
> > > >    PTR_MANGLE (p);
> > > >    VDSO_SYMBOL (clock_getres) = p;
> > > >  }
> > >
> > > I believe this will lose vDSO acceleration for RV64 on older kernels
> > > which do not define __vdso_clock_getres_time64.
> >
> > Also newer kernels, as 64-bit kernels only have __vdso_clock_getres,
> > not __vdso_clock_getres_time64.

Just to confirm (based on this thread and "RISC-V: Use 64-bit timespec
in clock_gettime vdso calls"):
 - change the clock_gettime64 vdso symbol to  __clock_gettime64 for
RV32 to match the kernel
 - Remove clock_gettime, clock_getres and gettimeofday vdso calls for RV32

Alistair

>
> Ok, I can #ifdef this based on word size.
>
> Alistair
>
> >
> >        Arnd


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]