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 329221F8C6 for ; Fri, 30 Jul 2021 07:00:38 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E7D84385BF9E for ; Fri, 30 Jul 2021 07:00:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E7D84385BF9E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1627628436; bh=vyupCUj9+detD0qC37VLkrRXOsbDixL7R6qziRyj4U4=; 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=raUz0rFN+LRIx3Ar+kXdZJX3NlXf46gN/+2UBTY5a+SM5Yw3ZOJ0uP0bHjSDg86Zk n+GSt8/m9UHkH4Lgzx47irGae7ROvmGEfnj9AP17U7qXYm0Pof+O4fThNgXN+H/C+A VGNP3WyLh3MBzovadBGnto3ZKOIMsmD1YycTUTtM= Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by sourceware.org (Postfix) with ESMTPS id 392F0385842F for ; Fri, 30 Jul 2021 07:00:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 392F0385842F Received: by mail-ed1-x52a.google.com with SMTP id ec13so11178399edb.0 for ; Fri, 30 Jul 2021 00:00:18 -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=vyupCUj9+detD0qC37VLkrRXOsbDixL7R6qziRyj4U4=; b=HVIf+EqjZo9RYJ3fIYmXbtuaeDTztjh79iND75GfrRm+3CNCP1mncIrrHmQKIj+7ZX BXqxNPFDYVIelEL+k7MOpWpuQWptO8bDliFBq/dooJ5Uwk11mscKvCCEIQ5dd4cTLfZY IBPkYqLGIBu5mddYKJdB0qlYOyXclG//qV1ppKp7jWcNegh8rgrmbF9DyJpZoe+3ShOZ N862JTOKoE0FNJu1IMPcw4EfPNZFAFa1k+1892phDdcp1whYc+jM9mtEn/dcF3Tok+F7 MP0NpIZE/JvmF2tjvBP0VVD348f1B3lZh9iDG+qDdVE8YFXhes2zF31uiRUBqZoHTfwE MI3A== X-Gm-Message-State: AOAM5314FWS7y1q1p/5NgVqYwZgHDoELPgjYE0j1wGsW1o6qltmXxKIl WHemDLb2d2UcrPo8QNUB9oIafebryh20qBd+4LLHaqf7 X-Google-Smtp-Source: ABdhPJzWwmb7IMOpk2LqCx4dqlAMJdLawaKMASKraZqgEJuD9mP44i8MD6NZ+FyKxvnfOfEzpf8WUVnv582JlDPI3ok= X-Received: by 2002:a50:ab1c:: with SMTP id s28mr1232613edc.214.1627628417297; Fri, 30 Jul 2021 00:00:17 -0700 (PDT) MIME-Version: 1.0 References: <87czr12u3t.fsf@oldenburg.str.redhat.com> In-Reply-To: Date: Fri, 30 Jul 2021 09:00:06 +0200 Message-ID: Subject: Re: Named address spaces on x86 GNU/Linux To: Joseph Myers 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 Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" On Thu, Jul 29, 2021 at 6:09 PM 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). 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