From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS17314 8.43.84.0/22 X-Spam-Status: No, score=-4.2 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 44FB41F8C6 for ; Mon, 2 Aug 2021 10:07:47 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2CFA83886C5B for ; Mon, 2 Aug 2021 10:07:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2CFA83886C5B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1627898866; bh=iSxnmV8rYszs3m6yZxVU5/0ze/emwdqIs5zT750tO0Y=; h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=q6YVdeVr4a/oVOGG70KLP4UJKahA6g+nDC9cXc1Q6Jo5NuJBxdw/40KIsDJgrblPO +KAC+wPAvNA59w8lqdmanRwyXA0HO30Mt/d/53zhrw1iylVeyZWbMRA48rIHg4AI++ shIReOarub0oESACvB1LEMYJeNxpnV4peDTkl6Nw= Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) by sourceware.org (Postfix) with ESMTPS id 7D7853888016 for ; Mon, 2 Aug 2021 10:06:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7D7853888016 Received: by mail-ej1-x634.google.com with SMTP id gn26so30022922ejc.3 for ; Mon, 02 Aug 2021 03:06:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=iSxnmV8rYszs3m6yZxVU5/0ze/emwdqIs5zT750tO0Y=; b=eM4Hr7PWAfAjj/bcWf/fR1hIortiXs5gqv+JKzyS8r+h5zlXcub62dUiST7cZQIV9t n3Xov21wJgdYE1XKqhh9SMj0K9QWa5R7zF+uDz5aM3lxxFl6w15/5VHQvomZ40OfCKN6 c4Y00o3btgvsYJ6k0gztUifax1Bi2C9UvvASOZYQoG7wB1g2BKjx86E8RIM/8TM3fDPo ejBIv5fL82D4VrdTlo8+9SnuUcNZcK2IQA7uJXqMPcyGU/4dKI+pmnsTfInXYAFP2Bhq kvDBN0EetIRdijq4oizxns8Eq31gg4WGOBqqmACCyP+1vjyqtD6CE15pK5hl3wCaE64V dgmw== X-Gm-Message-State: AOAM533wpOmRAXb94PVGl2ywGgwb0ooSFByQd1L7D2sn/Wd8LCUvBTUM Ii4IFMEnGZJ3XaF/t62LUnqNkVlMJFFyqbgg5Fs= X-Google-Smtp-Source: ABdhPJx4TOZyRA8knBaarYFVPi6mQawZa3aT+20caUr7QaGMz5FGpipqimTOqVFWwL1oBfV13V5uIX7NltiAUVwY8Ic= X-Received: by 2002:a17:906:b2d9:: with SMTP id cf25mr14842943ejb.138.1627898818643; Mon, 02 Aug 2021 03:06:58 -0700 (PDT) MIME-Version: 1.0 References: <87czr12u3t.fsf@oldenburg.str.redhat.com> <20210731193219.GL1583@gate.crashing.org> In-Reply-To: <20210731193219.GL1583@gate.crashing.org> Date: Mon, 2 Aug 2021 12:06:47 +0200 Message-ID: Subject: Re: Named address spaces on x86 GNU/Linux To: Segher Boessenkool Content-Type: text/plain; charset="UTF-8" X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Richard Biener via Libc-alpha Reply-To: Richard Biener Cc: Florian Weimer , GCC Development , GNU C Library , Joseph Myers Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" On Sat, Jul 31, 2021 at 9:34 PM Segher Boessenkool wrote: > > 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? Yeah, looks like so. Richard. > > Segher