Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp357627pxb; Wed, 8 Sep 2021 02:53:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdsv74itt6nDwLfdWkcjFIlIZg3M6SNa81EAyF65OLQPg5+/0CFGtgAKfLY/Vd+nbh0D0S X-Received: by 2002:aa7:ca4b:: with SMTP id j11mr2997090edt.342.1631094794418; Wed, 08 Sep 2021 02:53:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631094794; cv=none; d=google.com; s=arc-20160816; b=kPQfjLwTYKOECHnu22xYtfwJw8gHlC2tD6Pz41FSvbR6wfw9dYWVtjvl7lAXJBM2NC IZdM6LqHZsE6sRDCtLz/ocd7aimY64t9VzptM2QN1oAuyXhErET88B6kHV1YsAodnE+q sKILzKDVFqWq5rKSLkACjqO3hkKlBGMnnZHcLvT5CYCSsN9uQk1zV6Dqd4JeO2ZF/DkP MZSaR1ClttHmm41oEQTMuq7hci7wtwddbgW03eao2i2AU77MfsjWfKIBIzZN+ZQ8PeDz UtR4DyBqiOlJGCcD7+WYJnikF6Au6yTVGuOfbPDJXLllxr4y+ZZYaPfh8MqV927amRTQ CKkQ== 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=8fq+KnjXpLMOf6Iiwd8dOVnDSjIudbLlUrlMMmCYOwA=; b=VkejRQQKT8FgATACdLxLXDdw9iLLNJAEltEAX7Acf0b6O9g4og2OZmpl8cRQ9QHF03 1rQnnTtoEQjoRycZr1WEU4d7vNLhKVNIfs6hfFV+NCd7U8rLn939BAxsdJ9ZuPXNeAgr BKFNv2n5bnSHtmz+4J2E7PDh4vKfABVIFV+hUCv1tHBa4gLtGUBkIWJmb8pjcEQhrvlx w22/kv+ZaPshpR7IR7SZ1BKoRduJnSPAk2122lmGeSXJZ3w4yG2/9Piz99sb3xYNVeNu NLzwR9vEx1uD5lAm6zSDDqYrxWgCwyiIbh9LTJ3NKyuGn64f9/qYFQG6uSpzowaYQaaL payQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Hu8znGAF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p26si1708039edu.78.2021.09.08.02.52.47; Wed, 08 Sep 2021 02:53:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Hu8znGAF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348355AbhIHJvr (ORCPT + 99 others); Wed, 8 Sep 2021 05:51:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:43944 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347816AbhIHJvh (ORCPT ); Wed, 8 Sep 2021 05:51:37 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 39C0561153; Wed, 8 Sep 2021 09:50:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631094630; bh=pALvF7M+XI7KvL2Ye+Dan7R66fI5IMIY5AnMkVhaGZA=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Hu8znGAF933lSrOEjX5Y437Z3cjumDU8SVjYn3wF7GpkYBYcX/vmcf7Az7QmY+qPG WscydilWg1WyNOi2IeY9LiNtZON6Thwc//9vvDDQkTnShRuVSnzW81F2Ia0nLjeWkZ ywCvF/ovuLBoZpzW5pq5zBsmlSQwJRrFjcGp5YcIoLiuZjwE2LDtvG9apX0/upWTlf ba0WuUqM+EURiPIoQo17Gj+zkKfYBRbRIg+ssKfrfG149xEqMPOms94z0yLqBRVCD8 Sol0DBl5a6MYlQ6IfMR6tTACux1tLpP/42phjRRyGESlTAjh5qimDK6407R+zqWJ0o LK7ETwEP/tYeQ== Received: by mail-wm1-f45.google.com with SMTP id m25-20020a7bcb99000000b002e751bcb5dbso1037397wmi.5; Wed, 08 Sep 2021 02:50:30 -0700 (PDT) X-Gm-Message-State: AOAM531THLyCmjYCkqENi2l/lOeOxOZPQXXBgxrjxnUL67DnnJNitcw5 o0uoRwXyrUJ146ktuTs5+LA3HVHXR+3bZfzWkBQ= X-Received: by 2002:a7b:c956:: with SMTP id i22mr2660378wml.82.1631094628852; Wed, 08 Sep 2021 02:50:28 -0700 (PDT) MIME-Version: 1.0 References: <20210906142615.GA1917503@roeck-us.net> <20210906234921.GA1394069@roeck-us.net> <20210908042838.GA2585993@roeck-us.net> In-Reply-To: From: Arnd Bergmann Date: Wed, 8 Sep 2021 11:50:12 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] Enable '-Werror' by default for all kernel builds To: Geert Uytterhoeven Cc: Guenter Roeck , Al Viro , Linus Torvalds , "David S. Miller" , Dmitry Torokhov , Christian Koenig , Huang Rui , Linux Kernel Mailing List , linux-sparc , Martin Sebor Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 8, 2021 at 9:49 AM Geert Uytterhoeven wrote: > On Wed, Sep 8, 2021 at 7:16 AM Guenter Roeck wrote: > > On 9/7/21 9:48 PM, Al Viro wrote: > > > On Tue, Sep 07, 2021 at 09:28:38PM -0700, Guenter Roeck wrote: > > >> memcpy(eth_addr, sanitize_address((void *) 0xfffc1f2c), ETH_ALEN); > > >> > > >> but that just seems weird. Is there a better solution ? > > > > > > (char (*)[ETH_ALEN])? Said that, shouldn't that be doing something like > > > ioremap(), rather than casting explicit constants? > > > > Typecasts or even assigning the address to a variable does not help. > > The sanitizer function can not be static either. > > So it can only be fixed by obfuscating the constant address in a > chain of out-of-line functions... > How is this compiler to be used for bare-metal programming? I reported this as a gcc bug when I first saw it back in March: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99578 Martin Sebor suggested marking the pointer as 'volatile' as a workaround, which is probably fine for bare-metal programming, but I would consider that bad style for the kernel boot arguments. The RELOC_HIDE trick is probably fine here, as there are only a couple of instances, and for the network driver, using volatile is probably appropriate as well. I still hope this can be fixed in a future gcc-11.x release. Maybe we should add further instances of the problem on the gcc bug to boost the priority? > > I don't know the hardware, so I can not answer the ioremap() question. > > Yes it should. But this driver dates back to 2.1.110, when only > half of the architectures already had ioremap(). How does mvme16x even create the mapping? Is this a virtual address that is hardwired to the bus or do you have a static mapping somewhere? I see two other drivers accessing the nvram here arch/m68k/mvme16x/config.c:static MK48T08ptr_t volatile rtc = (MK48T08ptr_t)MVME_RTC_BASE; arch/m68k/mvme16x/rtc.c: volatile MK48T08ptr_t rtc = (MK48T08ptr_t)MVME_RTC_BASE; The same trick should work here, just create a local variable with a volatile pointer and read from that. Arnd