From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: [musl] riscv32 v2
Date: Mon, 7 Sep 2020 14:06:36 -0400 [thread overview]
Message-ID: <20200907180636.GM3265@brightrain.aerifal.cx> (raw)
In-Reply-To: <68b5e735-45be-413f-8153-cb97dd5967cd@www.fastmail.com>
On Mon, Sep 07, 2020 at 06:47:00AM -0400, Stefan O'Rear wrote:
> On Fri, Sep 4, 2020, at 1:48 AM, Stefan O'Rear wrote:
> > FAIL src/api/main.exe [status 1]
> > FAIL src/functional/fcntl-static.exe [status 1]
> > FAIL src/functional/fcntl.exe [status 1]
> > FAIL src/functional/ipc_msg-static.exe [status 1]
> > FAIL src/functional/ipc_msg.exe [status 1]
> > FAIL src/functional/ipc_sem-static.exe [status 1]
> > FAIL src/functional/ipc_sem.exe [status 1]
> > FAIL src/functional/ipc_shm-static.exe [status 1]
> > FAIL src/functional/ipc_shm.exe [status 1]
> > FAIL src/functional/strptime-static.exe [status 1]
> > FAIL src/functional/strptime.exe [status 1]
> > FAIL src/math/fma.exe [status 1]
> > FAIL src/math/fmaf.exe [status 1]
> > FAIL src/math/powf.exe [status 1]
> > FAIL src/regression/malloc-brk-fail-static.exe [status 1]
> > FAIL src/regression/malloc-brk-fail.exe [status 1]
> > FAIL src/regression/pthread_atfork-errno-clobber-static.exe [status 1]
> > FAIL src/regression/pthread_atfork-errno-clobber.exe [status 1]
> >
> > The fcntl and sysvipc errors do not correspond to any error in x86_64
> > and potentially require investigation, although they could be kernel
> > configuration issues. x86_64 has a different but overlapping set of
> > math errors; qemu is known to not give bit-exact results for RISC-V
> > floating point. The malloc, pthread, and src/api/main.exe failures
> > match failures on x86_64.
>
> Attached patch reaches test failure parity between riscv32 and riscv64
> and will be included in v3.
>
> * gdb HEAD wants ELF_NFPREG, so I set it in bits/user.h to the value
> gdb needs. (glibc does #define ELF_NFPREG NFPREG and expects gdb
> to define NFPREG. I don't get this.)
Ick. Indeed I think this is wrong/probably an oversight in glibc, and
the way you've done it sounds better.
> * Restore accidentally removed errno setting in waitpid, fixes a gdb
> assertion failure.
OK. As an aside (I haven't gotten to sending review for this yet,
sorry) I think I'd prefer to name the function __sys_wait4 or similar
to make it more clear that it's analogous to __sys_open[23] etc. (a
function or macro emulating the syscall) and not a namespace-safe
version of wait4. (musl's having __wait be a futex wait makes this
even more confusing, btw)
Perhaps also leave the int cp argument to the function but make
separate __sys_wait4 and __sys_wait4_cp macros to call it via so that
there's not a mysterious boolean argument that doesn't correspond to
an actual syscall argument. (This would also be parallel with how
__sys_open[23] is done.)
> * Zero IPC_64 because the kernel only recognizes one set of IPC commands.
OK.
> * Copy the IPC_TIME64 bits from arch/arm/bits to trigger the musl code
> for fixing time64 IPC_STAT results. I'm not super happy with this,
> maybe there should be a new mechanism in musl for fixing IPC_STAT for
> unconditionally-time64 architectures.
If the riscv32 IPC syscalls don't actually provide in-place time64 but
require translation, I think it's fairly appropriate as-is.
From the definitions in your patch, it looks like all the time fields
are fixed-word-order (little endian) and possibly not aligned, so it
seems like they can't be used in-place. Is this correct?
> * riscv32 _does_ provide both F_GETLK and F_GETLK32; make sure we use
> the right one.
IIRC someone already suggested using the generic bits/fcntl.h, which
would have solved this. I also have unpushed changed that let 64-bit
archs share the generic bits/fcntl.h too, via #if on __LONG_MAX.
Rich
next prev parent reply other threads:[~2020-09-07 18:06 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-04 5:48 Stefan O'Rear
2020-09-07 10:47 ` Stefan O'Rear
2020-09-07 18:06 ` Rich Felker [this message]
2020-09-07 21:35 ` Arnd Bergmann
2020-09-07 21:45 ` Rich Felker
2020-09-07 21:58 ` Arnd Bergmann
2020-09-07 22:11 ` Rich Felker
2020-09-07 22:30 ` Arnd Bergmann
2020-09-08 1:02 ` Rich Felker
2020-09-08 7:00 ` Arnd Bergmann
2020-09-07 11:27 ` Stefan O'Rear
2020-09-07 18:09 ` Rich Felker
2020-09-08 1:54 ` Rich Felker
2020-09-09 6:07 ` Rich Felker
2020-09-09 20:28 ` Rich Felker
2020-09-09 21:28 ` Palmer Dabbelt
2020-09-09 21:36 ` Rich Felker
2020-09-09 23:08 ` Palmer Dabbelt
2020-09-10 7:36 ` Arnd Bergmann
2020-09-10 10:01 ` Vincenzo Frascino
2020-09-11 0:08 ` Palmer Dabbelt
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=20200907180636.GM3265@brightrain.aerifal.cx \
--to=dalias@libc.org \
--cc=musl@lists.openwall.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.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
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 NNTP newsgroup(s).