linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Randy Dunlap <rdunlap@infradead.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
	linux-kernel@vger.kernel.org,
	 Paul Walmsley <paul.walmsley@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	 Albert Ou <aou@eecs.berkeley.edu>,
	linux-riscv@lists.infradead.org,  linux-arch@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org
Subject: Re: [PATCH] asm-generic: unistd.h: make 'compat_sys_fadvise64_64' conditional
Date: Mon, 8 Aug 2022 10:06:14 +0200	[thread overview]
Message-ID: <CAK8P3a140FFhCvrOXbCtYKCW6BR6tEz6uy8Wqd0aG3DdHiZSXg@mail.gmail.com> (raw)
In-Reply-To: <3a4dad85-1102-1bab-c0af-a2c6827663b1@infradead.org>

On Mon, Aug 8, 2022 at 12:39 AM Randy Dunlap <rdunlap@infradead.org> wrote:
> On 8/7/22 12:44, Arnd Bergmann wrote:
> > On Sun, Aug 7, 2022 at 7:28 PM Randy Dunlap <rdunlap@infradead.org> wrote:
> >>
> >
> > This does not work: __ARCH_WANT_COMPAT_FADVISE64_64 is defined in
> > arch/riscv/include/asm/unistd.h, which is not a UAPI header. By making the line
> > conditional on this, user space no longer sees the macro definition.
> >
> > It looks like you also drop the native definition on all architectures other
> > than riscv here. What we probably want is to just make all the
> > declarations in include/linux/compat.h unconditional and not have them
> > depend on architecture specific macros. Some of these may have
> > incompatible prototypes depending on the architecture, but if we run
> > into those, I would suggest we just give them unique names.
>
> Thanks for the comments.
>
> With the other patch to kernel/sys_ni.c, this one is no longer needed,

Ok.

> although I can look into making more entries in <linux/compat.h>
> unconditional.

This would be a nice cleanup, but it does involve making sure that
all prototypes are compatible with the implementation on each
architecture. I think we should definitely do this, it's just not as
simple as removing each #ifdef in linux/compat.h and linux/syscall.h

> That would also mean adding them to kernel/sys_ni.c, right?
> (if not already there)

That part should be completely independent. If the entry in
kernel/sys_ni.c is missing, that causes a link failure, while an
incorrect #ifdef would cause a compile-time error for the missing
prototype.

         Arnd


      reply	other threads:[~2022-08-08  8:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-07 17:28 Randy Dunlap
2022-08-07 19:44 ` Arnd Bergmann
2022-08-07 22:39   ` Randy Dunlap
2022-08-08  8:06     ` Arnd Bergmann [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

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

  git send-email \
    --in-reply-to=CAK8P3a140FFhCvrOXbCtYKCW6BR6tEz6uy8Wqd0aG3DdHiZSXg@mail.gmail.com \
    --to=arnd@arndb.de \
    --cc=akpm@linux-foundation.org \
    --cc=aou@eecs.berkeley.edu \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=rdunlap@infradead.org \
    /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