unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Alistair Francis <alistair23@gmail.com>
To: Alistair Francis <alistair.francis@wdc.com>
Cc: GNU C Library <libc-alpha@sourceware.org>,
	Arnd Bergmann <arnd@arndb.de>,
	 Adhemerval Zanella <adhemerval.zanella@linaro.org>,
	Florian Weimer <fweimer@redhat.com>,
	 Palmer Dabbelt <palmer@sifive.com>,
	macro@wdc.com, Zong Li <zongbox@gmail.com>
Subject: Re: [RFC v3 00/23] RISC-V glibc port for the 32-bit
Date: Fri, 19 Jul 2019 10:14:52 -0700	[thread overview]
Message-ID: <CAKmqyKNQikbY8BEhD_rOH7kxh3cwca7YB4BD+hOtQDGL_dkTAA@mail.gmail.com> (raw)
In-Reply-To: <cover.1563321715.git.alistair.francis@wdc.com>

On Tue, Jul 16, 2019 at 5:11 PM Alistair Francis
<alistair.francis@wdc.com> wrote:
>
> This patch set contains the glibc port for the 32-bit RISC-V.
>
> This is based on all of the work that Zong Li has done [1].
>
> Unfortunately the Linux ABI has changed since Zong Li's latest
> submission. The RISC-V 32-bit (RV32) ABI no longer defines
> __ARCH_WANT_TIME32_SYSCALLS which means there are no 32-bit versions of
> time_t, off_t or any struct resource or system calls that use them.
>
> To mitigate this I have set the RV32 port to use 64-bit time_t and off_t
> (as is done in x86-32) and also changed the syscall imvocation to handle
> the missing syscalls.
>
> This series applies ontop of Lukasz's __clock_settime64 iomplementation [2].
>
> The ChangeLog will need to be updated, so don't worry too much
> about that.
>
> All testing has been done on a 5.1 kernel (it won't work on earlier
> kernels).
>
> Importantly glibc is not the only project that needs to be updated to
> work with a 32-bit kernel that doesn't define
> __ARCH_WANT_TIME32_SYSCALLS. So far OpenSSL, busybox and systemd all
> need patches to work with RV32. My hope here is that we can get a
> reasonable agreement on how to handle this in glibc and then use that to
> update other projects. This is why I would still really like feedback
> even though this won't go into the next release.
>
> Feedback on this series is very welcome!
>
> 1: https://sourceware.org/ml/libc-alpha/2018-07/msg00892.html
> 2: https://sourceware.org/ml/libc-alpha/2019-05/msg00661.html
>
> The latest version of my work can be found here: https://github.com/alistair23/glibc/tree/alistair/rv32.next
>
> This specific version can be found here: https://github.com/alistair23/glibc/tree/alistair/rv32.rfc3

Hey,

I thought I would document what the ongoing discussions/problems/todos
are for the RV32 work. This is mostly for my own use so I don't have
to remember everything but it might also be useful for others.

These are listed roughly in order of importance/merge order.

 1. Lukasz's y2038 clock_settime patches need to be reviewed and
merged. RV32 relies on these patches but these patches also introduce
the __ASSUME_TIME64_SYSCALLS plumbing which we use thought the RV32
port.
 2. The timespec_get, clock_gettime, gettimeofday and nanosleep
patches need to be finished based on the final state of Lukasz's
patches and the current feedback on list.
 3. The waitid syscall implementation needs to be reviewed and merged.
 4. The define __NR_* as __NR_*_time64/64 for 32-bit needs to be
agreed upon (or something else)
 5. The vdso calls need to be sorted out.
 6. RV32 needs to be reviewed and merged.

There is probably other things, but that's rougly what has to happen.

Alistair

>
> RFC v3:
>  - Remove all "Hack" patches
>  - Incorporate upstream comments
>  - Ensure we don't break RV64
>  - Lot's more testing and fixes
> RFC v2:
>  - Add Lukasz's patches
>  - Update the non HACK syscalls after feedback
>  - define __ASSUME_TIME64_SYSCALLS and __ASSUME_RLIM64_SYSCALLS
>  - Remove lockf64.c
>  - Other smaller changes from RFC v1
>
> --END---
>
> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> ---
>  __COVER__ | 0
>  1 file changed, 0 insertions(+), 0 deletions(-)
>  create mode 100644 __COVER__
>
> diff --git a/__COVER__ b/__COVER__
> new file mode 100644
> index 0000000000..e69de29bb2
> --
> 2.22.0
>
>
>
> Alistair Francis (13):
>   sysdeps/nanosleep: Use clock_nanosleep_time64 if avaliable
>   sysdeps/gettimeofday: Use clock_gettime64 if avaliable
>   sysdeps/wait: Use waitid if avaliable
>   sysdeps/clock_gettime: Use clock_gettime64 if avaliable
>   sysdeps/timespec_get: Use clock_gettime64 if avaliable
>   RISC-V: Use 64-bit time_t and off_t for RV32 and RV64
>   RISC-V: define __NR_futex as __NR_futex_time64 for 32-bit
>   RISC-V: define __NR_* as __NR_*_time64/64 for 32-bit
>   RISC-V: define __NR_clock_getres as __NR_*_time64 for 32-bit
>   RISC-V: define __vdso_clock_getres as __vdso_clock_getres_time64 for
>     32-bit
>   RISC-V: define __vdso_clock_gettime as __vdso_clock_gettime64 for
>     32-bit
>   RISC-V: Use 64-bit timespec in clock_gettime vdso calls
>   RISC-V: Use 64-bit vdso syscalls
>
> Zong Li (10):
>   Documentation for the RISC-V 32-bit port
>   RISC-V: Support dynamic loader for the 32-bit
>   RISC-V: Add path of library directories for the 32-bit
>   RISC-V: The ABI implementation for the 32-bit
>   RISC-V: Hard float support for the 32 bit
>   RISC-V: Regenerate ULPs of RISC-V
>   RISC-V: Add ABI lists
>   RISC-V: Build Infastructure for the 32-bit
>   RISC-V: Fix llrint and llround missing exceptions on RV32
>   Add RISC-V 32-bit target to build-many-glibcs.py
>
>  ChangeLog                                     |  113 +
>  NEWS                                          |    6 +
>  README                                        |    1 +
>  nptl/pthread_mutex_timedlock.c                |    7 +
>  nptl/thrd_sleep.c                             |   41 +-
>  scripts/build-many-glibcs.py                  |   15 +
>  sysdeps/riscv/bits/wordsize.h                 |    4 +-
>  sysdeps/riscv/nofpu/libm-test-ulps            |   16 +-
>  sysdeps/riscv/nptl/bits/pthreadtypes-arch.h   |   25 +-
>  sysdeps/riscv/preconfigure                    |    6 +-
>  sysdeps/riscv/rv32/Implies-after              |    1 +
>  .../riscv/rv32/fix-fp-int-convert-overflow.h  |   38 +
>  sysdeps/riscv/rv32/rvd/Implies                |    3 +
>  sysdeps/riscv/rv32/rvd/s_lrint.c              |   31 +
>  sysdeps/riscv/rv32/rvd/s_lround.c             |   31 +
>  sysdeps/riscv/rv32/rvf/Implies                |    1 +
>  sysdeps/riscv/rv32/rvf/s_lrintf.c             |   31 +
>  sysdeps/riscv/rv32/rvf/s_lroundf.c            |   31 +
>  sysdeps/riscv/{rv64 => }/rvd/libm-test-ulps   |   56 +-
>  .../riscv/{rv64 => }/rvd/libm-test-ulps-name  |    0
>  sysdeps/riscv/sfp-machine.h                   |   27 +-
>  sysdeps/riscv/sys/asm.h                       |    5 +-
>  sysdeps/unix/sysv/linux/clock_gettime.c       |   30 +
>  sysdeps/unix/sysv/linux/clock_nanosleep.c     |   42 +-
>  sysdeps/unix/sysv/linux/gettimeofday.c        |   28 +
>  sysdeps/unix/sysv/linux/nanosleep.c           |   50 +
>  sysdeps/unix/sysv/linux/nanosleep_nocancel.c  |   11 +
>  sysdeps/unix/sysv/linux/riscv/Makefile        |    4 +-
>  .../unix/sysv/linux/riscv/bits/environments.h |   85 +
>  sysdeps/unix/sysv/linux/riscv/bits/time64.h   |   36 +
>  sysdeps/unix/sysv/linux/riscv/bits/timesize.h |   22 +
>  .../unix/sysv/linux/riscv/bits/typesizes.h    |   84 +
>  sysdeps/unix/sysv/linux/riscv/configure       |   39 +
>  sysdeps/unix/sysv/linux/riscv/configure.ac    |    8 +
>  sysdeps/unix/sysv/linux/riscv/dl-cache.h      |   17 +-
>  sysdeps/unix/sysv/linux/riscv/init-first.c    |    6 +-
>  sysdeps/unix/sysv/linux/riscv/ldconfig.h      |    2 +-
>  sysdeps/unix/sysv/linux/riscv/libc-vdso.h     |    2 +-
>  sysdeps/unix/sysv/linux/riscv/rv32/Implies    |    3 +
>  .../unix/sysv/linux/riscv/rv32/c++-types.data |   67 +
>  .../sysv/linux/riscv/rv32/jmp_buf-macros.h    |   53 +
>  sysdeps/unix/sysv/linux/riscv/rv32/ld.abilist |    9 +
>  .../linux/riscv/rv32/libBrokenLocale.abilist  |    1 +
>  .../unix/sysv/linux/riscv/rv32/libanl.abilist |    4 +
>  .../unix/sysv/linux/riscv/rv32/libc.abilist   | 2101 +++++++++++++++++
>  .../sysv/linux/riscv/rv32/libcrypt.abilist    |    2 +
>  .../unix/sysv/linux/riscv/rv32/libdl.abilist  |    9 +
>  .../unix/sysv/linux/riscv/rv32/libm.abilist   | 1021 ++++++++
>  .../sysv/linux/riscv/rv32/libpthread.abilist  |  235 ++
>  .../sysv/linux/riscv/rv32/libresolv.abilist   |   79 +
>  .../unix/sysv/linux/riscv/rv32/librt.abilist  |   35 +
>  .../linux/riscv/rv32/libthread_db.abilist     |   40 +
>  .../sysv/linux/riscv/rv32/libutil.abilist     |    6 +
>  sysdeps/unix/sysv/linux/riscv/shlib-versions  |   10 +-
>  sysdeps/unix/sysv/linux/riscv/sysdep.h        |   61 +
>  sysdeps/unix/sysv/linux/timespec_get.c        |   37 +-
>  sysdeps/unix/sysv/linux/wait.c                |   39 +-
>  sysdeps/unix/sysv/linux/waitpid.c             |   46 +
>  sysdeps/unix/sysv/linux/waitpid_nocancel.c    |   45 +
>  59 files changed, 4796 insertions(+), 62 deletions(-)
>  create mode 100644 sysdeps/riscv/rv32/Implies-after
>  create mode 100644 sysdeps/riscv/rv32/fix-fp-int-convert-overflow.h
>  create mode 100644 sysdeps/riscv/rv32/rvd/Implies
>  create mode 100644 sysdeps/riscv/rv32/rvd/s_lrint.c
>  create mode 100644 sysdeps/riscv/rv32/rvd/s_lround.c
>  create mode 100644 sysdeps/riscv/rv32/rvf/Implies
>  create mode 100644 sysdeps/riscv/rv32/rvf/s_lrintf.c
>  create mode 100644 sysdeps/riscv/rv32/rvf/s_lroundf.c
>  rename sysdeps/riscv/{rv64 => }/rvd/libm-test-ulps (98%)
>  rename sysdeps/riscv/{rv64 => }/rvd/libm-test-ulps-name (100%)
>  create mode 100644 sysdeps/unix/sysv/linux/riscv/bits/environments.h
>  create mode 100644 sysdeps/unix/sysv/linux/riscv/bits/time64.h
>  create mode 100644 sysdeps/unix/sysv/linux/riscv/bits/timesize.h
>  create mode 100644 sysdeps/unix/sysv/linux/riscv/bits/typesizes.h
>  create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/Implies
>  create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/c++-types.data
>  create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/jmp_buf-macros.h
>  create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/ld.abilist
>  create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/libBrokenLocale.abilist
>  create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/libanl.abilist
>  create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
>  create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/libcrypt.abilist
>  create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/libdl.abilist
>  create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/libm.abilist
>  create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/libpthread.abilist
>  create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/libresolv.abilist
>  create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/librt.abilist
>  create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/libthread_db.abilist
>  create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/libutil.abilist
>
> --
> 2.22.0
>

      parent reply	other threads:[~2019-07-19 17:18 UTC|newest]

Thread overview: 127+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-17  0:08 [RFC v3 00/23] RISC-V glibc port for the 32-bit Alistair Francis
2019-07-17  0:08 ` [RFC v3 01/23] sysdeps/nanosleep: Use clock_nanosleep_time64 if avaliable Alistair Francis
2019-07-17  5:16   ` Florian Weimer
2019-07-19 17:25     ` Alistair Francis
2019-07-20 14:24       ` Stepan Golosunov
2019-07-22 21:14         ` Alistair Francis
2019-07-17  0:08 ` [RFC v3 02/23] sysdeps/gettimeofday: Use clock_gettime64 " Alistair Francis
2019-07-17  7:09   ` Florian Weimer
2019-07-20  3:20     ` Rich Felker
2019-07-25 20:54       ` Joseph Myers
2019-07-17 12:43   ` Lukasz Majewski
2019-07-17 12:48     ` Lukasz Majewski
2019-07-19 22:26     ` Alistair Francis
2019-07-17  0:08 ` [RFC v3 03/23] sysdeps/wait: Use waitid " Alistair Francis
2019-07-17  5:31   ` Florian Weimer
2019-07-19 17:49     ` Alistair Francis
2019-07-22 15:58       ` Florian Weimer
2019-07-22 21:02         ` Alistair Francis
2019-07-21  4:03   ` Rich Felker
2019-07-21  4:20     ` Rich Felker
2019-07-21 11:59       ` Eric W. Biederman
2019-07-21 22:59         ` Rich Felker
2019-07-21  7:57     ` Arnd Bergmann
2019-07-21 12:15       ` Eric W. Biederman
2019-07-21 12:28         ` Christian Brauner
2019-07-21 14:30         ` Arnd Bergmann
2019-07-21 15:45           ` Eric W. Biederman
2019-07-21 17:05             ` Arnd Bergmann
2019-07-21 17:16             ` Linus Torvalds
2019-07-21 21:40               ` Eric W. Biederman
2019-07-21 23:23                 ` Rich Felker
2019-07-23  0:00                   ` Eric W. Biederman
2019-07-23  8:12                     ` Arnd Bergmann
2019-07-23  8:28                       ` Christian Brauner
2019-07-23  8:45                         ` Arnd Bergmann
2019-07-25  0:04                           ` Alistair Francis
2019-07-25  4:40                             ` Rich Felker
2019-07-25 13:15                               ` Arnd Bergmann
2019-07-25 16:06                                 ` Christian Brauner
2019-07-25 17:14                                 ` Eric W. Biederman
2019-07-25 17:30                                   ` Christian Brauner
2019-08-13 22:22                                     ` Alistair Francis
2019-08-13 23:11                                       ` Rich Felker
2019-08-14  5:07                                         ` Christian Brauner
2019-08-14 11:38                                       ` [PATCH v1 0/1] waitid: process group enhancement christian.brauner
2019-08-14 11:38                                         ` [PATCH v1 1/1] waitid: Add support for waiting for the current process group christian.brauner
2019-08-14 12:29                                           ` Oleg Nesterov
2019-08-14 12:45                                             ` Christian Brauner
2019-08-14 12:50                                               ` Oleg Nesterov
2019-08-14 12:53                                                 ` Christian Brauner
2019-08-14 13:07                                       ` [PATCH v2 0/1] waitid: process group enhancement Christian Brauner
2019-08-14 13:07                                         ` [PATCH v2 1/1] waitid: Add support for waiting for the current process group Christian Brauner
2019-08-14 14:19                                           ` Oleg Nesterov
2019-08-14 14:35                                             ` Christian Brauner
2019-08-14 15:27                                               ` Oleg Nesterov
2019-08-14 15:30                                                 ` Christian Brauner
2019-08-14 15:43                                       ` [PATCH v3 0/1] waitid: process group enhancement Christian Brauner
2019-08-14 15:44                                         ` [PATCH v3 1/1] waitid: Add support for waiting for the current process group Christian Brauner
2019-08-14 16:09                                           ` Oleg Nesterov
2019-08-14 16:15                                             ` Christian Brauner
2019-08-14 16:34                                               ` Christian Brauner
2019-08-14 16:55                                                 ` Rich Felker
2019-08-14 17:02                                                   ` Christian Brauner
2019-08-14 17:06                                                   ` Linus Torvalds
2019-08-14 18:00                                                     ` Rich Felker
2019-08-14 20:50                                             ` Christian Brauner
2019-08-14 15:58                                         ` [PATCH v3 0/1] waitid: process group enhancement Rich Felker
2019-08-14 16:13                                           ` Christian Brauner
2019-07-26 23:35                                   ` [RFC v3 03/23] sysdeps/wait: Use waitid if avaliable Alistair Francis
2019-07-17  0:08 ` [RFC v3 04/23] sysdeps/clock_gettime: Use clock_gettime64 " Alistair Francis
2019-07-17  5:38   ` Florian Weimer
2019-07-17  8:04     ` Arnd Bergmann
2019-07-17  8:44       ` Florian Weimer
2019-07-17  9:10         ` Arnd Bergmann
2019-07-17 15:16           ` Florian Weimer
2019-07-18  7:38             ` Arnd Bergmann
2019-07-18  8:18               ` Florian Weimer
2019-07-18  9:14                 ` Arnd Bergmann
2019-07-18 18:10                 ` Adhemerval Zanella
2019-07-19 21:03     ` Alistair Francis
2019-07-17  7:03   ` Andreas Schwab
2019-07-17 12:37   ` Lukasz Majewski
2019-07-17  0:08 ` [RFC v3 05/23] sysdeps/timespec_get: " Alistair Francis
2019-07-17  5:08   ` Florian Weimer
2019-07-17  7:59     ` Arnd Bergmann
2019-07-17  8:11       ` Florian Weimer
2019-07-17  8:23         ` Arnd Bergmann
2019-07-17  8:41           ` Florian Weimer
2019-07-17  8:54             ` Arnd Bergmann
2019-07-25 20:14       ` Joseph Myers
2019-07-17 12:22   ` Lukasz Majewski
2019-07-17  0:08 ` [RFC v3 06/23] Documentation for the RISC-V 32-bit port Alistair Francis
2019-07-17  0:08 ` [RFC v3 07/23] RISC-V: Use 64-bit time_t and off_t for RV32 and RV64 Alistair Francis
2019-07-17  8:27   ` Arnd Bergmann
2019-07-17 22:39     ` Alistair Francis
2019-07-18  7:41       ` Arnd Bergmann
2019-07-18 17:36         ` Alistair Francis
2019-07-19  6:44           ` Arnd Bergmann
2019-07-19 17:02             ` Alistair Francis
2019-07-17  0:09 ` [RFC v3 08/23] RISC-V: define __NR_futex as __NR_futex_time64 for 32-bit Alistair Francis
2019-07-17  0:09 ` [RFC v3 09/23] RISC-V: define __NR_* as __NR_*_time64/64 " Alistair Francis
2019-07-17  0:09 ` [RFC v3 10/23] RISC-V: define __NR_clock_getres as __NR_*_time64 " Alistair Francis
2019-07-17  0:09 ` [RFC v3 11/23] RISC-V: define __vdso_clock_getres as __vdso_clock_getres_time64 " Alistair Francis
2019-07-17  0:09 ` [RFC v3 12/23] RISC-V: define __vdso_clock_gettime as __vdso_clock_gettime64 " Alistair Francis
2019-07-17  8:16   ` Arnd Bergmann
2019-07-19 17:15     ` Alistair Francis
2019-07-17  0:09 ` [RFC v3 13/23] RISC-V: Use 64-bit timespec in clock_gettime vdso calls Alistair Francis
2019-07-17  8:13   ` Arnd Bergmann
2019-07-17  0:09 ` [RFC v3 14/23] RISC-V: Support dynamic loader for the 32-bit Alistair Francis
2019-07-17  0:09 ` [RFC v3 15/23] RISC-V: Add path of library directories " Alistair Francis
2019-07-17 12:20   ` Florian Weimer
2019-07-17  0:09 ` [RFC v3 16/23] RISC-V: The ABI implementation " Alistair Francis
2019-07-17  0:09 ` [RFC v3 17/23] RISC-V: Hard float support for the 32 bit Alistair Francis
2019-07-17  0:09 ` [RFC v3 18/23] RISC-V: Regenerate ULPs of RISC-V Alistair Francis
2019-07-17  0:09 ` [RFC v3 19/23] RISC-V: Add ABI lists Alistair Francis
2019-07-17  0:09 ` [RFC v3 20/23] RISC-V: Build Infastructure for the 32-bit Alistair Francis
2019-07-17  0:09 ` [RFC v3 21/23] RISC-V: Fix llrint and llround missing exceptions on RV32 Alistair Francis
2019-07-17 12:22   ` Florian Weimer
2019-07-17 22:32     ` Alistair Francis
2019-07-17  0:09 ` [RFC v3 22/23] Add RISC-V 32-bit target to build-many-glibcs.py Alistair Francis
2019-07-17  0:09 ` [RFC v3 23/23] RISC-V: Use 64-bit vdso syscalls Alistair Francis
2019-07-17  5:33   ` Florian Weimer
2019-07-17  8:02     ` Arnd Bergmann
2019-07-17 22:23       ` Alistair Francis
2019-07-17 23:42         ` Alistair Francis
2019-07-18  0:01           ` Alistair Francis
2019-07-19 17:14 ` Alistair Francis [this message]

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

  List information: https://www.gnu.org/software/libc/involved.html

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

  git send-email \
    --in-reply-to=CAKmqyKNQikbY8BEhD_rOH7kxh3cwca7YB4BD+hOtQDGL_dkTAA@mail.gmail.com \
    --to=alistair23@gmail.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=alistair.francis@wdc.com \
    --cc=arnd@arndb.de \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=macro@wdc.com \
    --cc=palmer@sifive.com \
    --cc=zongbox@gmail.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).