unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: Joseph Myers <joseph@codesourcery.com>
Cc: Florian Weimer <fweimer@redhat.com>,
	gcc@gcc.gnu.org, libc-alpha@sourceware.org
Subject: Re: Named address spaces on x86 GNU/Linux
Date: Sat, 31 Jul 2021 14:32:20 -0500	[thread overview]
Message-ID: <20210731193219.GL1583@gate.crashing.org> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2107291603410.528367@digraph.polyomino.org.uk>

On Thu, Jul 29, 2021 at 04:08:36PM +0000, Joseph Myers 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).

There already is TARGET_ADDR_SPACE_ZERO_ADDRESS_VALID?  So this just
isn't used everywhere it should?


Segher

  parent reply	other threads:[~2021-07-31 19:34 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
2021-07-31 19:32   ` Segher Boessenkool [this message]
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=20210731193219.GL1583@gate.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=fweimer@redhat.com \
    --cc=gcc@gcc.gnu.org \
    --cc=joseph@codesourcery.com \
    --cc=libc-alpha@sourceware.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 read-only IMAP folder(s) and NNTP newsgroup(s).