Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1107499ybl; Thu, 12 Dec 2019 09:43:59 -0800 (PST) X-Google-Smtp-Source: APXvYqxJrIR9BnLlf29b+BFrmF7s1VYuETXh+pAZBI0Zj32wLpY2PhIWQR2jgZFWoFql//FKRak8 X-Received: by 2002:a9d:7147:: with SMTP id y7mr8992074otj.353.1576172639746; Thu, 12 Dec 2019 09:43:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576172639; cv=none; d=google.com; s=arc-20160816; b=g7C5BwsR94UXbEfDc7o7OQdGfT4iyN96A5mCG3y+pmsmj00OLocHYR+X+otm+IfQuz AcVFYLYEw2qrhXH7RvN9ZU5kUEfU0eRqBkKScZaIvFoDWDSOV+tWGDG9e9U1SZX3IiVg 0Y42YdmqOaACTMBIIT2VbesdQArFtBz1eMrzSek3JCkaHtM7kVqGXLcTa26Ij0iotQHJ 63tPupDqwoa1XxvzCYqKnEWkES9GYudGbW76nXPKCEoU3J9+HhEsiDAP/6M9yPZQr3An k2VO3L49Gip/GGW/ioNVvPvIQoTicRPBBEBqGtt5dIatIVApenj7dC/MAHjl5D8j0FdQ CI9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=bMM9+SXbUifsEu+Y3zqfvwzhjRsedDBd5kfOwAh/UwA=; b=xGtKW9OG5ba1JkxOkeCqvFm4O+9GypMNfCb/sYumqOHLRS6AsF1WBw19QedDTCfDPk MQeKcv/9lhm9t7sj0dBXdI00eyLNT5VNkwnhxEepFzhap+vTrFJKfvCr2/yxQSHYrmsl 2zM1KQe42Y44iwvYj97ulzdxZr/Nk8W1vdlKO0uH2fDztpPuHKAnDEwdCTs1P5gZTetn 1/bu7QtRyVMuYcuznGB+/HTVvfv749PxvWYxXJ8X9QTqo+mLjIEhHn0Y1cZZq4+1zzsA FO/O5cJJspL6jwgEeuliC3TkoSVARtPsbitPR9dBnhSNmlIrlwITOH/VzeWDDHiCAmuw 0D4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=MAwdhQ2A; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f53si3543666otf.235.2019.12.12.09.43.46; Thu, 12 Dec 2019 09:43:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=MAwdhQ2A; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730216AbfLLRlx (ORCPT + 99 others); Thu, 12 Dec 2019 12:41:53 -0500 Received: from mail-lj1-f193.google.com ([209.85.208.193]:34041 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730023AbfLLRlx (ORCPT ); Thu, 12 Dec 2019 12:41:53 -0500 Received: by mail-lj1-f193.google.com with SMTP id m6so3247525ljc.1 for ; Thu, 12 Dec 2019 09:41:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=bMM9+SXbUifsEu+Y3zqfvwzhjRsedDBd5kfOwAh/UwA=; b=MAwdhQ2ApXj+Y01Th4BCE3RSlffcMF2vn+S1n9g9eLPqUXBxqb7H1E20UVL+9mb/zo TUamH+60U4LyvobpVidwKOG160coaIFky35EjHAPgaruzcWX7fUztBbagb0MZDX0xKZK b+3B1PXWXfIs13GZ1+vXd3HB1o38BkFLHhGiE= 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=bMM9+SXbUifsEu+Y3zqfvwzhjRsedDBd5kfOwAh/UwA=; b=ds/YKjX1aL1ADNlXM6LCiDc9+jRF/vh7SMT6TbKXRpoOUwiHfBr1JpwobJ47ulK2al SZas584V//xDeQtZFjy1jexcMR/qTxZEQ97KhmKNoSMiy0T/gj53nuIAvoRsaXbkq4+I ZKS5pwNkJ2fwdYnAOdoTGXqUMvIDhXtTYN/V6ri5hnADcuIOuJNyTbYQq7O92mOJuFMB wzZgPXjg9iPLp5AnsaNs5KV3P0/9KlEyh6lUmvX8lFnSgp7zXStnkm4P4pko3FmkRgGF RKaOsWAe4vJmCPOr5cegKb0vFeVLD5pGGWNDJscy9sKkJ3G4vLWL0xnworUIZZrNnfew wpFw== X-Gm-Message-State: APjAAAW01a/Tacb6rJHLFk0Px9vVyu9Te/r4nJfD+XXcA+1zuUiO2Npl 4q89WjbZzl8484bQcGQkuaSs75im/1Y= X-Received: by 2002:a2e:9942:: with SMTP id r2mr6947647ljj.182.1576172510529; Thu, 12 Dec 2019 09:41:50 -0800 (PST) Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com. [209.85.208.170]) by smtp.gmail.com with ESMTPSA id b22sm3484752lji.66.2019.12.12.09.41.48 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 12 Dec 2019 09:41:50 -0800 (PST) Received: by mail-lj1-f170.google.com with SMTP id k8so3232210ljh.5 for ; Thu, 12 Dec 2019 09:41:48 -0800 (PST) X-Received: by 2002:a2e:241a:: with SMTP id k26mr6727345ljk.26.1576172507997; Thu, 12 Dec 2019 09:41:47 -0800 (PST) MIME-Version: 1.0 References: <87blslei5o.fsf@mpe.ellerman.id.au> <20191206131650.GM2827@hirez.programming.kicks-ass.net> <875zimp0ay.fsf@mpe.ellerman.id.au> <20191212080105.GV2844@hirez.programming.kicks-ass.net> <20191212100756.GA11317@willie-the-truck> <20191212104610.GW2827@hirez.programming.kicks-ass.net> In-Reply-To: <20191212104610.GW2827@hirez.programming.kicks-ass.net> From: Linus Torvalds Date: Thu, 12 Dec 2019 09:41:32 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: READ_ONCE() + STACKPROTECTOR_STRONG == :/ (was Re: [GIT PULL] Please pull powerpc/linux.git powerpc-5.5-2 tag (topic/kasan-bitops)) To: Peter Zijlstra Cc: Will Deacon , Michael Ellerman , dja@axtens.net, Linux Kernel Mailing List , linuxppc-dev@lists.ozlabs.org, Christophe Leroy , linux-arch , Mark Rutland , Segher Boessenkool , Arnd Bergmann , Christian Borntraeger Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 12, 2019 at 2:46 AM Peter Zijlstra wrote: > > +#ifdef GCC_VERSION < 40800 Where does that 4.8 version check come from, and why? Yeah, I know, but this really wants a comment. Sadly it looks like gcc bugzilla is down, so https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58145 currently gives an "Internal Server Error" for me. [ Delete the horrid code we have because of gcc bugs ] > +#else /* GCC_VERSION < 40800 */ > + > +#define READ_ONCE_NOCHECK(x) \ > +({ \ > + typeof(x) __x = *(volatile typeof(x))&(x); \ I think we can/should just do this unconditionally if it helps th eissue. Maybe add a warning about how gcc < 4.8 might mis-compile the kernel - those versions are getting close to being unacceptable for kernel builds anyway. We could also look at being stricter for the normal READ/WRITE_ONCE(), and require that they are (a) regular integer types (b) fit in an atomic word We actually did (b) for a while, until we noticed that we do it on loff_t's etc and relaxed the rules. But maybe we could have a "non-atomic" version of READ/WRITE_ONCE() that is used for the questionable cases? Linus