From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 80870 invoked by alias); 12 Sep 2017 15:06:33 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 80861 invoked by uid 89); 12 Sep 2017 15:06:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_SORBS_SPAM,RP_MATCHES_RCVD,SPF_PASS,URIBL_RED autolearn=no version=3.3.2 spammy= X-HELO: mailbackend.panix.com X-Gm-Message-State: AHPjjUi9fsd3fjAhBzFNgrW/fINyfl+g2ch1h0XkdPUIHBmWxNSJljJW 3iUbJEVuQL5TCphF0p20h1mYGSaMyw== X-Google-Smtp-Source: AOwi7QBUb0S9f8HfZ4oWhvTeoLRSOBgeqlX2uHy4581zynucQZ+Ga0XlmJdEHSrr8u/Fu6bitbXCc/CmszqPKmpayMA= X-Received: by 10.202.74.143 with SMTP id x137mr14494575oia.236.1505228789516; Tue, 12 Sep 2017 08:06:29 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <1503033107-20047-1-git-send-email-raji@linux.vnet.ibm.com> From: Zack Weinberg Date: Tue, 12 Sep 2017 15:06:00 -0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] powerpc: Use aligned stores in memset To: Joseph Myers Cc: Florian Weimer , Rajalakshmi Srinivasaraghavan , GNU C Library Content-Type: text/plain; charset="UTF-8" X-SW-Source: 2017-09/txt/msg00516.txt.bz2 On Tue, Sep 12, 2017 at 10:37 AM, Joseph Myers wrote: > On Tue, 12 Sep 2017, Zack Weinberg wrote: >> >> mem* are required to behave as-if they access memory as an array of >> unsigned char. Therefore it is valid to give them arbitrarily >> (un)aligned pointers. The C abstract machine doesn't specifically >> contemplate the possibility of a CPU that can do unaligned word reads >> but maybe not to all memory addresses, but I would argue that if there >> is such a CPU, then mem* are obliged to cope with it. > > Only if there is a way, within the standard, in which you might obtain a > pointer to such memory. Perhaps it is only a matter of QoI, but I would argue that if there is _any_ way to obtain such a pointer, considering the entire operating system, then mem* can and should cope with it. > I think device memory with > special access requirements should be considered to be defined as > volatile. (So any access from C code should use volatile-qualified > lvalues.) I know you know that's violently disputed. zw