unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Joseph Myers <joseph@codesourcery.com>
To: Florian Weimer <fweimer@redhat.com>
Cc: gcc@gcc.gnu.org, libc-alpha@sourceware.org
Subject: Re: Named address spaces on x86 GNU/Linux
Date: Thu, 29 Jul 2021 16:08:36 +0000	[thread overview]
Message-ID: <alpine.DEB.2.22.394.2107291603410.528367@digraph.polyomino.org.uk> (raw)
In-Reply-To: <87czr12u3t.fsf@oldenburg.str.redhat.com>

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).

-- 
Joseph S. Myers
joseph@codesourcery.com

  reply	other threads:[~2021-07-29 16:08 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 [this message]
2021-07-30  7:00   ` Richard Biener via Libc-alpha
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=alpine.DEB.2.22.394.2107291603410.528367@digraph.polyomino.org.uk \
    --to=joseph@codesourcery.com \
    --cc=fweimer@redhat.com \
    --cc=gcc@gcc.gnu.org \
    --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).