|
|
Message-ID: <CAAYwqPvUgyjevzh99X_D1_bpbVgg+MOB+MJ7yc=JyLrAwn6+UQ@mail.gmail.com> Date: Thu, 23 Jul 2026 15:27:57 -0700 From: Jake Adamson <jakeadamson@...gle.com> To: Nick Desaulniers <ndesaulniers@...gle.com> Cc: Szabolcs Nagy <nsz@...t70.net>, musl@...ts.openwall.com, Peter Oskolkov <posk@...gle.com>, Peter Zijlstra <peterz@...radead.org>, mathieu.desnoyers@...icios.com Subject: Re: Question: number of arguments of musl's membarrier does not match Linux syscall * Szabolcs Nagy <nsz@...t70.net> [Thu, 23 Jul 2026 23:34:51 +0200]: >https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2a36ab717e8fe678d98f81c14a0b124712719840 >good example why libc does not like wrapping new syscalls >(the contract is not documented and reasonable assumptions >get broken instead of using a new syscall number) >now it has to be var arg if we want backward compat. Ah, that makes sense then. Thanks for pointing out the kernel commit. It seems like musl has MEMBARRIER_CMD_FLAG_CPU defined won't that break musl's membarrier function? The Linux man page says it checks the third argument if that flag is passed. Thanks, Jake On Thu, Jul 23, 2026 at 3:23 PM Nick Desaulniers <ndesaulniers@...gle.com> wrote: > > On Thu, Jul 23, 2026 at 11:34:51PM +0200, Szabolcs Nagy wrote: > > * Jake Adamson <jakeadamson@...gle.com> [2026-07-23 13:34:02 -0700]: > > > Hi I'm adding membarrier() to Android's Bionic and I noticed that > > > there are a different number of arguments in Musl than in Linux’s > > > system call. Is there a reason for that and is there any nuisance that > > > I should be thinking about when adding it? And do you plan on adding > > > the cpu_id argument? > > > > google broke it (silently) > > > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2a36ab717e8fe678d98f81c14a0b124712719840 > > Oops, did it get reported, yet? > > I didn't see any follow ups one the original LKML thread. > https://lore.kernel.org/all/20200923233618.2572849-1-posk@google.com/T/#u > > Patch from 2020...perhaps too late to do anything about it. Though shall > not break userspace... > > > > > good example why libc does not like wrapping new syscalls > > (the contract is not documented and reasonable assumptions > > get broken instead of using a new syscall number) > > > > now it has to be var arg if we want backward compat. > > > > > > > > Linux: int cmd, unsigned int flags, int cpu_id > > > https://man7.org/linux/man-pages/man2/membarrier.2.html > > > > > > > > > Musl: int cmd, int flags > > > https://git.musl-libc.org/cgit/musl/tree/src/linux/membarrier.c > > > > > > Jake Adamson > > > Android Native Tools and Libraries, Software Engineer
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.