From: Alexey Dobriyan <adobriyan@gmail.com>
To: Kees Cook <keescook@chromium.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Florian Weimer <fweimer@redhat.com>,
linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org,
linux-api@vger.kernel.org, x86@kernel.org
Subject: Re: [PATCH v2] ELF: supply userspace with available page shifts (AT_PAGE_SHIFT_MASK)
Date: Sat, 9 Dec 2023 12:44:53 +0300 [thread overview]
Message-ID: <a46e0141-98c3-4a09-bb74-578d2429c35a@p183> (raw)
In-Reply-To: <202312081027.BA44B7B3@keescook>
On Fri, Dec 08, 2023 at 10:29:25AM -0800, Kees Cook wrote:
> On Thu, Dec 07, 2023 at 05:57:05PM +0300, Alexey Dobriyan wrote:
> > On Wed, Dec 06, 2023 at 12:47:27PM -0800, Kees Cook wrote:
> > > Can't we have a generic ARCH_AT_PAGE_SHIFT_MASK too? Something like:
> > >
> > > #ifndef ARCH_AT_PAGE_SHIFT_MASK
> > > #define ARCH_AT_PAGE_SHIFT_MASK
> > > NEW_AUX_ENT(AT_PAGE_SHIFT_MASK, 1 << PAGE_SHIFT)
> > > #endif
> > >
> > > Or am I misunderstanding something here?
> >
> > 1) Arch maintainers can opt into this new way to report information at
> > their own pace.
> >
> > 2) AT_PAGE_SHIFT_MASK is about _all_ pagesizes supported by CPU.
> > Reporting just one is missing the point.
> >
> > I'll clarify comment: mmap() support require many things including
> > tests for hugetlbfs being mounted, this is about CPU support.
>
> I significantly prefer APIs not being arch-specific,
It will become arch-independent once all relevant archs opt-in.
I doubt anyone is writing new software for sparc or alpha.
> so I'd prefer we
> always include AT_PAGE_SHIFT_MASK. For an architecture that doesn't
> define its own ARCH_AT_PAGE_SHIFT_MASK, it's not _inaccurate_ to report
> 1 << PAGE_SHIFT, but it might be incomplete.
It is inaccurate if ARCH_AT_PAGE_SHIFT_MASK is defined as "_all_ page
shift CPU supports". Inaccurate version is called AT_PAGESZ which lists
just 1 page size, there is no need for 2 inaccurate APIs.
next prev parent reply other threads:[~2023-12-09 9:44 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-04 17:18 [PATCH] ELF: supply userspace with available page shifts (AT_PAGE_SHIFT_LIST) Alexey Dobriyan
2023-12-05 9:51 ` Florian Weimer
2023-12-05 14:26 ` Alexey Dobriyan
2023-12-05 16:01 ` [PATCH v2] ELF: supply userspace with available page shifts (AT_PAGE_SHIFT_MASK) Alexey Dobriyan
2023-12-06 20:47 ` Kees Cook
2023-12-06 21:05 ` Florian Weimer
2023-12-06 21:09 ` Kees Cook
2023-12-07 15:04 ` Alexey Dobriyan
2023-12-07 14:57 ` Alexey Dobriyan
2023-12-07 15:32 ` Florian Weimer
2023-12-08 18:29 ` Kees Cook
2023-12-08 18:35 ` Florian Weimer
2023-12-08 18:38 ` Kees Cook
2023-12-09 9:44 ` Alexey Dobriyan [this message]
2023-12-07 18:44 ` [PATCH v3] ELF: AT_PAGE_SHIFT_MASK -- supply userspace with available page shifts Alexey Dobriyan
2023-12-12 21:09 ` Kees Cook
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=a46e0141-98c3-4a09-bb74-578d2429c35a@p183 \
--to=adobriyan@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=fweimer@redhat.com \
--cc=keescook@chromium.org \
--cc=linux-api@vger.kernel.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=x86@kernel.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;
as well as URLs for NNTP newsgroup(s).