Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp855864img; Fri, 22 Mar 2019 10:00:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqw5UOUXjiDnqY/Ddj5EClkw439zUOcfY09SfeypgBJnFvXNBK5m3S1zvT1rvaG0XEpG44rl X-Received: by 2002:a17:902:45a5:: with SMTP id n34mr10805554pld.127.1553274041600; Fri, 22 Mar 2019 10:00:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553274041; cv=none; d=google.com; s=arc-20160816; b=HWYyw6O6d1UEF7Bo8tONWDDqa6ZfAMhqYLQGlsSakvzi0lItAE6lILKPW0/sgzI6BL Q1L7BdHQKtK1tLvCn9uKuQfY0HxKA9lGGmSpalKbukjo5UXe+q4fzhxC5AiSnTIgpqZ6 AcAHuyE7CxiNt2o5dywe7rom0J+yfOAYvauMQ3wKpwru3O2CsOYImNbhR4xrrIFqgmOJ BXTyjnA/dG+L7xCh+7A4fnttQ4ebeSXeSq7J84F4M5ygWKGQL7jS9ii2T4kawco0veIt groFCjIV965NjodHpB6P7qimO4tYnlEGGYcQxNh8CXFiyRo6yvnhhUePW9JSbTHmng5x G3QA== 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; bh=jV/VlmiWT5ICHGENGi1uLztsqw5jkI8SLkdbegt9HLs=; b=EaP8uts8iqLZ/sf56+x9RNZuAbutal6pmM4oqxnDvOMFb/VUqwb1xtg629IcFqNqGs 4rAhNSosAWOe31sAnGDa2+Ha0CEflK1zaHMWSNd0t3IZiftlpE1Z/+pOn1vwfdz2h/mI OpZbQWC87c+zbsuvtQncT4W+UoJQ3VNSrmAvCFFXEdWSGs9rxW86NEP2F2kyE8wsw8d7 PyQWSmA+0izLDwlHCq+QJh+88YrUEHNO2nmk9Lne6IQgk0PcRZQ3jGt4oKNbZyxLOuRo Ee7FTrGqCLRAPTehG+EZrdMtpCAi2RDuuZWdTKMjEV9X/Aij4M6RDystN34KHYcvQzg4 011Q== ARC-Authentication-Results: i=1; mx.google.com; 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 k18si7144628pfi.224.2019.03.22.10.00.25; Fri, 22 Mar 2019 10:00:41 -0700 (PDT) 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; 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 S1728871AbfCVQ52 (ORCPT + 99 others); Fri, 22 Mar 2019 12:57:28 -0400 Received: from mail-qt1-f195.google.com ([209.85.160.195]:45753 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727410AbfCVQ52 (ORCPT ); Fri, 22 Mar 2019 12:57:28 -0400 Received: by mail-qt1-f195.google.com with SMTP id v20so3224930qtv.12 for ; Fri, 22 Mar 2019 09:57:27 -0700 (PDT) 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=jV/VlmiWT5ICHGENGi1uLztsqw5jkI8SLkdbegt9HLs=; b=eo8oglaBa7sE50Tqz2dDMFVuGHshg1z8dLe/sA13xA8kDP6FIWFDV9VVjU1YsoFBC8 xYYbsIdxGSGa+8ZeFta/nB1/3XNyI3iLI4ur5DrzqUSKcKL7HkFrA2osEX0vvGSb7Fkr GuACPo++D7inT/8aaW4EzF5Tq+0zBRfaYXY6DVyTotEPtuLWIx3OLBR50dGtG5RF19/w QylUXtntmx9X7pyYlRA3vi6OWOX/kkXaevbvH5iFCXNjxIrJzsnfl84XuqR6FhpCrEcp l+Hy8Ut/hmirQsRWdoqQWMPGq6/80/AhUTSA0wM4iKrD3vZfjAKdUN0UpnkIwkAtMCO6 gTwA== X-Gm-Message-State: APjAAAUAvGogyME5W0uKHgELiRibrBsGmu/g5FApgJYtH7RJkHZ+mgK8 IO6TN+XhIq9NSyAS63CcoLu2fVHYFL/H9tZgckA= X-Received: by 2002:ac8:276b:: with SMTP id h40mr8998796qth.319.1553273847171; Fri, 22 Mar 2019 09:57:27 -0700 (PDT) MIME-Version: 1.0 References: <20190321220009.29334-1-andi@firstfloor.org> <20190321220009.29334-2-andi@firstfloor.org> <20190322163954.GG7905@worktop.programming.kicks-ass.net> In-Reply-To: <20190322163954.GG7905@worktop.programming.kicks-ass.net> From: Arnd Bergmann Date: Fri, 22 Mar 2019 17:57:09 +0100 Message-ID: Subject: Re: [PATCH 01/17] kbuild: Disable -Waddress-of-packed-member for gcc 9 To: Peter Zijlstra Cc: Andi Kleen , "the arch/x86 maintainers" , Andrew Morton , Linux Kernel Mailing List , Andi Kleen , Masahiro Yamada 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 Fri, Mar 22, 2019 at 5:40 PM Peter Zijlstra wrote: > > On Fri, Mar 22, 2019 at 02:58:51PM +0100, Arnd Bergmann wrote: > > On Thu, Mar 21, 2019 at 11:00 PM Andi Kleen wrote: > > > > > > From: Andi Kleen > > > > > > This warning is very noisy in a default build with gcc 9. > > > Move it into W=2 only. > > > > > > Cc: arnd@arndb.de > > > Cc: Masahiro Yamada > > > Signed-off-by: Andi Kleen > > > > I think W=2 is too aggressive. On many architectures, this finds > > real bugs and the false positives tend to be trivial to fix > > (by removing the bogus __packed annotation), which improves > > the generated code in the process. > > > > Moving it to W=1 for the moment is probably fine, but ideally > > I think we should fix the kernel to behave according to the > > C standard. > > Lol... we're actively moving away from the C standard on many places. > > Why does the silly compiler think it is a problem to take the address of > a member of a packed structure? That sounds like something that's > perfectly fine and useful. The problem is casting a pointer of an unaligned variable to one of higher alignment and passing that to a function that does not expect unaligned data. On CPUs that don't have unaligned load/store instructions, this causes an alignment fault, which will have to be fixed up in software by doing a bytewise access or crash the system. Arnd