Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1296291ybl; Thu, 12 Dec 2019 12:52:58 -0800 (PST) X-Google-Smtp-Source: APXvYqxEfT6bx+/xM41q3Ns6K5oXrWP7jTfL+vM7GvTuk9wBeciUgyDnjtyrm4NBmoYJTs7YJpd7 X-Received: by 2002:a9d:3425:: with SMTP id v34mr9934760otb.142.1576183977893; Thu, 12 Dec 2019 12:52:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576183977; cv=none; d=google.com; s=arc-20160816; b=YbMlUxy/zUR2qFTqt03YsR8MNWoAfOW9jDPuKVaJ4bTgqzKMpLpbu4p6Hrv/6j00PE PWRLqHa3NLgJ82vQ1etkl5OQzJse19oSqBy2jPxvX+IULPvuo6ghIrSdGb29Z4fTYBrf 9+1zOvvMXdUS7L+HestSN86D1b8aLvZEl5M+R6W3eEG2Nb0aixox3esT/tgAqtxiua2w e42tuk9X233fPQIFqMOjSvuE20G1UnLi7hQp1dREP3juL75VbnzncD9A3zlPI8sz3Wni DVZURssExH4Y89Az8Pb59B7T/GcUJJYEBGKlIAs9p9Ns8UvXkEf+b8pP2syW0EEGyJJj H1Fw== 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=udrNHrYblR3sF99SQEkYkwez4FCarU/iIh5v4su3FS8=; b=J3i46shKllv1NLQYadlO2rymWtxZbm25vbgpj47yJk3Y9uWVN2uZjlqkqBZXiOynLe Isber/fzc3FvvX/+xXDCzDzYNy/kxcyYV0i4MUuENP/49hBYJ/i5MomAxlVoP6MSZWP+ M0wJ0drExI7+8k+Sau2/zImQNA9QeTS7+aFswdxzgniW9haXzZ4jZgggm9YvAxrr90gi KnAZ35ZQ3LPMgGdTSDQAagaVxWX4KN3Mqyl0m5rXUIaIpRv8B88gZof+I3eCYP4nDJSk 6O39S14EQBxBE6xDM1tY3ftcw9fB7GgxFI15o+yNFpDJoyYo+CkKoxG7McfiOTyNR4Bm Hytw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=bkVtv5h8; 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 j18si3966701otq.275.2019.12.12.12.52.44; Thu, 12 Dec 2019 12:52:57 -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=bkVtv5h8; 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 S1730894AbfLLUuP (ORCPT + 99 others); Thu, 12 Dec 2019 15:50:15 -0500 Received: from mail-lf1-f68.google.com ([209.85.167.68]:34313 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730844AbfLLUuO (ORCPT ); Thu, 12 Dec 2019 15:50:14 -0500 Received: by mail-lf1-f68.google.com with SMTP id l18so309829lfc.1 for ; Thu, 12 Dec 2019 12:50:12 -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=udrNHrYblR3sF99SQEkYkwez4FCarU/iIh5v4su3FS8=; b=bkVtv5h8m32kLkiXM0qzlbz+nqjHfWFk9/qgPuPRhcgkiw0ZGyA729E8BGkFqzS3Dp q+Wa3RFyS+SBMMZulr9ppWHo8LKoN71JFOrHQs6VbNoqHdluxrgUNcjbxTHasQy97nOf M7t7yc8gf4qDYxsmtgtXGgGLWzQC2DeoAcm+w= 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=udrNHrYblR3sF99SQEkYkwez4FCarU/iIh5v4su3FS8=; b=cUS0xyk+NkHGRZCGVs4Ijx72oWU0le9xHSyCYUTZC7J+sIlhGfP0swaUH5ZKhav24s tB1aHh0Yp/uIh12gOKT3CzVB3iftKN/W7EPPoDSHXji5D2W9HPKY1N0tGEq2PEMsh16n TJjdEwQ+v7zWsEbmwybA4b2BMKhkm2MWjmjyco7waWiIkt+sJod4ldv7LKWJyz+OLYyJ 4sEZp0b+L8CRb9QKnq8RvNkTvV/TW7RkegX3Djl3uP3nJ0cyrhWzsV2uocAZRXU9C5o5 dwclEFKI8E/3S6/ZP0eBugtqcMjYWXONyJkgGQZhjykiml27sPdvZyUn7TpN7C7gIFEI coww== X-Gm-Message-State: APjAAAVre/CvWLZY4W2TJaVMA6/wUhOuG0b4x92uS6tZ7n5Gsz9CQNWe Yk1ziuKVft3qpnJeQT5yZWOdpXKGmXY= X-Received: by 2002:a19:8a06:: with SMTP id m6mr6459057lfd.99.1576183810914; Thu, 12 Dec 2019 12:50:10 -0800 (PST) Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com. [209.85.167.48]) by smtp.gmail.com with ESMTPSA id z13sm3647765ljh.21.2019.12.12.12.50.09 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 12 Dec 2019 12:50:09 -0800 (PST) Received: by mail-lf1-f48.google.com with SMTP id y19so279720lfl.9 for ; Thu, 12 Dec 2019 12:50:09 -0800 (PST) X-Received: by 2002:a19:23cb:: with SMTP id j194mr6971490lfj.79.1576183808614; Thu, 12 Dec 2019 12:50:08 -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> <20191212180634.GA19020@willie-the-truck> <20191212193401.GB19020@willie-the-truck> In-Reply-To: <20191212193401.GB19020@willie-the-truck> From: Linus Torvalds Date: Thu, 12 Dec 2019 12:49:52 -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: Will Deacon Cc: Peter Zijlstra , 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 11:34 AM Will Deacon wrote: > > The root of my concern in all of this, and what started me looking at it in > the first place, is the interaction with 'typeof()'. Inheriting 'volatile' > for a pointer means that local variables in macros declared using typeof() > suddenly start generating *hideous* code, particularly when pointless stack > spills get stackprotector all excited. Yeah, removing volatile can be a bit annoying. For the particular case of the bitops, though, it's not an issue. Since you know the type there, you can just cast it. And if we had the rule that READ_ONCE() was an arithmetic type, you could do typeof(0+(*p)) __var; since you might as well get the integer promotion anyway (on the non-volatile result). But that doesn't work with structures or unions, of course. I'm not entirely sure we have READ_ONCE() with a struct. I do know we have it with 64-bit entities on 32-bit machines, but that's ok with the "0+" trick. Linus