Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp2684136imw; Sun, 17 Jul 2022 14:37:50 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sp8C4lts3zo/fLo7sCL2u0VCBRE2h7mKaKhB0KodXTA8b8nFjZT9BnacTlM79PFNiYueKA X-Received: by 2002:a05:6402:1d51:b0:41f:cf6c:35a5 with SMTP id dz17-20020a0564021d5100b0041fcf6c35a5mr34159701edb.25.1658093870251; Sun, 17 Jul 2022 14:37:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658093870; cv=none; d=google.com; s=arc-20160816; b=LRf9Xh+z6Ki2GrIfZ+U5Eu/QXPbQx5VIsklIMwx8ozuYadU2naZxNx2HP6sAYVl5wS qUO/r9aLtLpDKCvMA8pfOh2j0xuYxJyWaJsPsVmY8YEMiCaGHiaiUGKxdD7Y7Zho5dvY AUfcPdIEVp8i/p0XuoyV9aO4uQwQlljMml5y5Q7WF8Q98jAQhabDk6rsPB/vEDQZro2e jR8RCAxTQLmKMi6TcO40R4gSnTt5No4EXJvME+Knm+LZhS1VCphW/JuCwCsgyB10t/Po dJeDS4rmXWlAUTVI0sq7AW/poREro6Aj6VeepEhrWTTyYEHPhswwlWMoPvlAhkd1d7/L n6xA== 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=1ZqPRM2qcyTueyhf1A6Ua5dmBCzOfbjpMoyDTZFWtJk=; b=jRRlkyLgd60OMTYQ4DWuRw3WPK0Ft9g+KB0VUVkBGTPsOM4Z279cHn71JuTqoiQXg1 6ZHcBKSq6Rl2sXbNI5yUqZfLaT93CIfIDc8wRMl6KJMGiRw8Ry+ZkvxPKWMHHU1Yo6+x uy/82NwEFMqilEAiWJzh2JdLwxhtHbNh/B2nDRJdIkw0pC5VbdlszaDPZNfJ7ui1eyU+ zVjN99bMvwoVQhnxPLS3WTy6rDGBrol4EkN5ZumxMxB1bgR5j+qZsVbT0rOasS5oA9Ey TAkr3t3sAA0ZljrTOs+1WUyi0AjvtRad9iMvAhnwwNnpSH/Pqiqqmsg/0K2XOefQ5RFg 9NJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b="dZZ0/J3H"; 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 a3-20020aa7d743000000b0043777cec0dbsi11793605eds.138.2022.07.17.14.37.25; Sun, 17 Jul 2022 14:37:50 -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="dZZ0/J3H"; 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 S231629AbiGQU5S (ORCPT + 99 others); Sun, 17 Jul 2022 16:57:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231296AbiGQU5R (ORCPT ); Sun, 17 Jul 2022 16:57:17 -0400 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB54810FF4 for ; Sun, 17 Jul 2022 13:57:15 -0700 (PDT) Received: by mail-ed1-x535.google.com with SMTP id y4so12944552edc.4 for ; Sun, 17 Jul 2022 13:57:15 -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=1ZqPRM2qcyTueyhf1A6Ua5dmBCzOfbjpMoyDTZFWtJk=; b=dZZ0/J3Hz/3sOD/J3s9/31I0vY717Zhr1SM61AC5OANF6c/cfnYp6xRqg7y679cXn5 BLxGuF6o+L2w7BzW6F/YG74lJOnkvammDYV/T49wCqFk9duszqWdnIAuQbC1zx/SkC4N KdH5J6w0VRithPFum3wWbH58hx2nhU2bkmYp8= 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=1ZqPRM2qcyTueyhf1A6Ua5dmBCzOfbjpMoyDTZFWtJk=; b=jXzFB4zM8hqWUsmE473eZ0Dzbus2RKlStJOwQgg/ZLgQ8xJY9bxirdPL/wc9PfmgyT vf2NO7g+j1E3sVmqRJIx5aGTyclVkv1/Fk+iUizZf/OnoYvWc83NEP+HEmU64c36UUNo Ba2faee8Ew1Tx6gon/9nwP+mpVknyo5l5Hjv3FMqwFLyBZ46lT59iGfNFGYbpP9Nd6vt KMYhntMculEXupWA6clxu0hu+wpkTcSVyrfsTJVX7YviasYKV8v38cJT/fdgS9guZCtA ol5symTB/r88OjfGA+48pFIbKtQgA+SFFB656zAhsQaW5VPm94DyiDyjhNk5udWUSrAL TN2Q== X-Gm-Message-State: AJIora9vnAP8IluHGPcQ9FAdkgzhFU1ixsat1v1pIvLMpoJf68qWsOCI pf46YO1oueOn/XiNhzd577hqyXA4ZKh/Ae+/XdU= X-Received: by 2002:aa7:c2d3:0:b0:43a:707a:72c5 with SMTP id m19-20020aa7c2d3000000b0043a707a72c5mr33491292edp.54.1658091434319; Sun, 17 Jul 2022 13:57:14 -0700 (PDT) Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com. [209.85.221.51]) by smtp.gmail.com with ESMTPSA id p5-20020a170906b20500b0072af4af2f46sm4735700ejz.74.2022.07.17.13.57.12 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 17 Jul 2022 13:57:13 -0700 (PDT) Received: by mail-wr1-f51.google.com with SMTP id v16so14492135wrd.13 for ; Sun, 17 Jul 2022 13:57:12 -0700 (PDT) X-Received: by 2002:a05:6000:1a88:b0:21d:aa97:cb16 with SMTP id f8-20020a0560001a8800b0021daa97cb16mr20888588wry.97.1658091432023; Sun, 17 Jul 2022 13:57:12 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Linus Torvalds Date: Sun, 17 Jul 2022 13:56:55 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: mainline build failure of powerpc allmodconfig for prom_init_check To: Sudip Mukherjee Cc: Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Kees Cook , linuxppc-dev , linux-kernel , linux-hardening@vger.kernel.org, Segher Boessenkool 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 1:38 PM Sudip Mukherjee wrote: > > I have also tried adding volatile to all the members of that struct. :( Can you read the code to figure otu what the memcpy is all about? Or maybe there is something that disables 'volatile' with pre-processor hackery. Because a compiler that turns a loop over volatile members into 'memset()' isn't a C compiler, it's just a random noise generator. 'volatile' is fundamental enough that I really doubt both gcc and clang can be that broken. I just tested this struct hello { volatile int array[100]; }; void test(void) { int i; struct hello hello; for (i = 0; i < 100; i++) hello.array[i] = 0; } on x86-64, and sure enough, gcc-12 turns turns it into a memset without the volatile (in fact, the above will just be optimized away entirely since it has no user), but with the volatile it's a proper regular loop that does 32-byte accesses one by one (and in the proper ascending oder). Something that memset() most definitely does not guarantee: .L2: movslq %eax, %rdx addl $1, %eax movl $0, -120(%rsp,%rdx,4) cmpl $100, %eax jne .L2 and honestly, anything else sounds completely unacceptable. So I suspect there is something wrong with your testing, because gcc simply isn't that incredibly broken. Clang is interesting in that it seems to unroll the loop five times, but it still does the proper "write individual 32-bit entities in ascending order". The other alternative is that it's something else than that 'struct prom_args'. Again, I don't read powerpc asm good. Linus