unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Richard Biener via Libc-alpha <libc-alpha@sourceware.org>
To: Joseph Myers <joseph@codesourcery.com>
Cc: Florian Weimer <fweimer@redhat.com>,
	GCC Development <gcc@gcc.gnu.org>,
	GNU C Library <libc-alpha@sourceware.org>
Subject: Re: Named address spaces on x86 GNU/Linux
Date: Fri, 30 Jul 2021 09:00:06 +0200	[thread overview]
Message-ID: <CAFiYyc38RsjqyLeqok1efwEx1b4Ga3TgR5EtG38iqKyadJVWDg@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2107291603410.528367@digraph.polyomino.org.uk>

On Thu, Jul 29, 2021 at 6:09 PM Joseph Myers <joseph@codesourcery.com> wrote:
>
> On Thu, 29 Jul 2021, Florian Weimer via Gcc wrote:
>
> > On GNU/Linux, SEGFS is used to implement the thread pointer, to avoid
> > dedicating a general-purpose register to it.  At address zero with the
> > SEGFS prefix, the offset itself is stored so that userspace can read it
> > without having to call into the kernel.  So the SEGFS null pointer is a
> > valid address, and so are some bytes after it (depending on TCB layout,
> > some of which is specified by the ABI or is part of the de-facto ABI
> > used by GCC).
>
> That suggests that we need a target hook to describe null pointer
> properties for a given address space.  In an address space where null
> pointers are valid to dereference, there should be no diagnostics for
> arithmetic on / dereferencing them - and more generally,
> -fno-delete-null-pointer-checks should be in effect for pointers to such
> an address space (so I don't think this is just a warning issue, you can
> probably get wrong code from null pointer check deletion in such an
> address space).

Thus flag_no_delete_null_pointer_checks checks should be replaced
with sth that takes the address-space as argument.  A good default
implementation would be to only have the default address space
covered by NULL pointer rules.

Richard.

> --
> Joseph S. Myers
> joseph@codesourcery.com

  reply	other threads:[~2021-07-30  7:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-29 12:16 Named address spaces on x86 GNU/Linux Florian Weimer via Libc-alpha
2021-07-29 16:08 ` Joseph Myers
2021-07-30  7:00   ` Richard Biener via Libc-alpha [this message]
2021-07-31 19:32   ` Segher Boessenkool
2021-08-02 10:06     ` Richard Biener via Libc-alpha

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=CAFiYyc38RsjqyLeqok1efwEx1b4Ga3TgR5EtG38iqKyadJVWDg@mail.gmail.com \
    --to=libc-alpha@sourceware.org \
    --cc=fweimer@redhat.com \
    --cc=gcc@gcc.gnu.org \
    --cc=joseph@codesourcery.com \
    --cc=richard.guenther@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).