Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp2684374imw; Sun, 17 Jul 2022 14:38:18 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t6zohiY0JM1p/ov+PEuhVbfl+x0sbrZC8aJQbpdvU7tiy5cXTO9cdoSPrYl8HHSUpwyCZS X-Received: by 2002:a17:907:6e1c:b0:72b:5b54:bd87 with SMTP id sd28-20020a1709076e1c00b0072b5b54bd87mr22292190ejc.581.1658093898710; Sun, 17 Jul 2022 14:38:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658093898; cv=none; d=google.com; s=arc-20160816; b=o5vEC82wA67tLGpSihdwtt53/dVou6Dt9KiE7NZHDq5TZ8gDRLP27R6zRLuD+h4m+L GrL23KwRQyhCz+7MT6nJKnMvJQf/Kopj4kJNoBX9J1R/193Uuh5LnKiRlyFKrANwxWMV RDf+x6D397Um/emkfz4XPx+YqB4sw7N+xuIFZQJRiloaS4yd4I7lQ77cE5xX5Bja2Kgt zmjSGTfwvJ6wUCIhQc+7/YQ9nFWzGMc1SGUxhsDmrwI5w+ClWWWYv6TOvmbrrGayvXrX dzv0A1T+nFhWwarq3T/iFxLf7rGf6vsbO5FeWwWima0/gHWxbgM/VtClbXC0mcKx8/Jl zXaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=UW6ne7NX/MQH2keCY1T28GqN5Odh8+bR3Y4JfckUjzw=; b=fr0xiHQKED1svsOtUUCaSbHW24AMizbQwaCW8BUAuSMniJFDVK5hjPZsvp5Ld+tAN0 PUqOiTTc3CX0OSHOzu6sPP/TIwgKotcyLMobdBVpPd+qq/SmJ3LgRM/LJq+fBdPupmrv PtwZ/A3GNL2BZRe9uDfmt0V+JnR3gCPqlTQMJBE4c9kY6BwYgcpSGahffeLfi7N+/HiK IRGcp6DxPPP2S6rtGUeDBmEdkPLaPlSvC/vJlmoFhTCtJg19as+ANcLflVjfwqc1uVF4 rAawvoUJu5sLHkTWLOcoJSuf7NyvmoynFRXoaMYCTz2dUlDW4f7ujEcJe5WK0f0CdLQW Mrjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=fGm8hQQ8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id go35-20020a1709070da300b00711c6a5c5e6si16128746ejc.545.2022.07.17.14.37.54; Sun, 17 Jul 2022 14:38:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=fGm8hQQ8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230403AbiGQVMO (ORCPT + 99 others); Sun, 17 Jul 2022 17:12:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229547AbiGQVMM (ORCPT ); Sun, 17 Jul 2022 17:12:12 -0400 Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A354D1054B for ; Sun, 17 Jul 2022 14:12:11 -0700 (PDT) Received: by mail-ed1-x52a.google.com with SMTP id k30so12949855edk.8 for ; Sun, 17 Jul 2022 14:12:11 -0700 (PDT) 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=UW6ne7NX/MQH2keCY1T28GqN5Odh8+bR3Y4JfckUjzw=; b=fGm8hQQ8eUxP06yf85F7pPFkaBx3O3yo1wK9DD4XbIeo2GtzbzmYzDExIju1C1a60R Dzv0oONPL/fyrzdC81wDNIz/pDLCzxAPalxwEibU19Ogw3dmD4kDZ0qJ6xELiZw4kP9D 8KUm870xtTCqoYrYUBQZlFDq0IBMxvsinLQd8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=UW6ne7NX/MQH2keCY1T28GqN5Odh8+bR3Y4JfckUjzw=; b=dfQ9KaHcoHN0vRwglvRqwYP1rRVp7kWy2ONoLb5+YD+OA3Nnb9415TOmmMxySaryHr W8TweG2yZP7BIjESFCXjNEVtsG5TpHT/B4FPdclHz2ZKSyBL6NcSlYhJJR+B+vNCM/aS 2PcNrczCm247EZZu9SY7LqRbgIj60hdQBS2ry3wqfg18QFov9kBnJwjU0D3u0P40d49d TNjbZYmpFqaWUX5ShE76wAVS9tB04LBr7KMajCnIS2qeAqoyJQScYQjaXjnRpR5g7JFs F3DtqUMSGu0lAC0ccWt82uqnjZnJVK6yndv5FWDp/aIVdeDuFr75AyGWQqU/UAcvq8kW trFg== X-Gm-Message-State: AJIora91kkfcV6L2kk0byv7MP9rKtlZ9VG2vCrLDhPi3lK5LJKGqG00w e70yOvtm6JpgSgGoHFQ/X/EmaipeqalUIc7me1s= X-Received: by 2002:a50:c209:0:b0:435:6b37:46cb with SMTP id n9-20020a50c209000000b004356b3746cbmr33527834edf.341.1658092329912; Sun, 17 Jul 2022 14:12:09 -0700 (PDT) Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com. [209.85.221.45]) by smtp.gmail.com with ESMTPSA id uz7-20020a170907118700b0072b6d93b9afsm4739259ejb.210.2022.07.17.14.12.09 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 17 Jul 2022 14:12:09 -0700 (PDT) Received: by mail-wr1-f45.google.com with SMTP id r2so13544844wrs.3 for ; Sun, 17 Jul 2022 14:12:09 -0700 (PDT) X-Received: by 2002:a5d:544b:0:b0:21d:70cb:b4a2 with SMTP id w11-20020a5d544b000000b0021d70cbb4a2mr20297261wrv.281.1658092328759; Sun, 17 Jul 2022 14:12:08 -0700 (PDT) MIME-Version: 1.0 References: <20220717205615.GC25951@gate.crashing.org> In-Reply-To: <20220717205615.GC25951@gate.crashing.org> From: Linus Torvalds Date: Sun, 17 Jul 2022 14:11:52 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: mainline build failure of powerpc allmodconfig for prom_init_check To: Segher Boessenkool Cc: Sudip Mukherjee , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Kees Cook , linuxppc-dev , linux-kernel , linux-hardening@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jul 17, 2022 at 2:00 PM Segher Boessenkool wrote: > > Calling mem* on a volatile object (or a struct containing one) is not > valid. I opened gcc.gnu.org/PR106335. Well, that very quickly got marked as a duplicate of a decade-old bug. So I guess we shouldn't expect this to be fixed any time soon. That said, your test-case of copying the whole structure is very different from the one in the kernel that works on them one structure member at a time. I can *kind of* see the logic that when you do a whole struct assignment, it turns into a "memcpy" without regard for volatile members. You're not actually accessing the volatile members in some particular order, so the struct assignment arguably does not really have an access ordering that needs to be preserved. But the kernel code in question very much does access the members individually, and so I think that the compiler quite unequivocally did something horribly horribly bad by turning them into a memset. So I don't think your test-case is really particularly good, and maybe that's why that old bug has languished for over a decade - people didn't realize just *how* incredibly broken it was. Linus