Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3117883pxb; Tue, 19 Jan 2021 14:23:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJw7A8SSjdglfmWC3R8yjqcyg+AEU6c4zfC/mioSx4Y4OwRfw818Aktasj/arR5bRhYHkAqv X-Received: by 2002:a17:906:3bc2:: with SMTP id v2mr4303789ejf.291.1611095026731; Tue, 19 Jan 2021 14:23:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611095026; cv=none; d=google.com; s=arc-20160816; b=EBk+1InfH8xXM39RuDilsaBDB6CzJhf7i0mmjmKaOUFpdMxAoPukFaBOncGxipmfDf 2YB2DIWOKSAgwm3N1144WVOs05VK5F5l1QIfSIs5wuKSCJe10gvIHkiHHgZU/kiwDJ1N zK68ZCOyQBLNgRMBPcEQ5dwtmcnckeMr9UBZ091bBMbW2S4wgOowYm1B3nKXBB9i9mvr 0o7cOnDqahRkrcsCYUmwUE4rgJ2zOO8efxNQ7RnFil0YeR8zkt00/Pachwq06uxZbghh fULNZiQZah4o2iq5TGV2JVvvRP8AkcRXjc1jz1A1rM1UHMNyL5kUlylEgof/+0f0XJVb UxLA== 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=cXrBiBJi6Dfh9EHdaa74XDl1OgKypKBU2BA3Zhb7Oio=; b=HciAjXWvjOeuzgpJUcnhpPxJvpVmn3iv9NCaq6aJH44U+jw0kqkZCAJaVSDs9rPt+0 YfrMziarf5hEts/iy0YKqGBw0N9iD9KaA2GhLWAUSfw99lAYUMAArVhUvRpKICIvECtF +l3VWX697+ooBaGXzFOSUjko0nKZkIZkXZwAVyPi8qc53q9k5OcSoS5+Yn8ZkMykEbd6 kOUYqRYF6IoaGC0MMLbzZeuZGDYseyZJtueT46pKNaXGxBP7QjTlbQBzVpW8ANnEsUKw RbL1KZeNKjCcGb9ZBxPIBugrChETAeps8RxY9kH9ildyuIIBZol25LzVEZTsf+/hjLtR ltXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="BPS/wTOn"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a8si15138ejv.701.2021.01.19.14.23.20; Tue, 19 Jan 2021 14:23:46 -0800 (PST) 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=@google.com header.s=20161025 header.b="BPS/wTOn"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727354AbhASWV7 (ORCPT + 99 others); Tue, 19 Jan 2021 17:21:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729265AbhASWQf (ORCPT ); Tue, 19 Jan 2021 17:16:35 -0500 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 040E0C061573 for ; Tue, 19 Jan 2021 14:15:55 -0800 (PST) Received: by mail-pl1-x635.google.com with SMTP id x12so11337449plr.10 for ; Tue, 19 Jan 2021 14:15:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=cXrBiBJi6Dfh9EHdaa74XDl1OgKypKBU2BA3Zhb7Oio=; b=BPS/wTOnGz75i92A1dMKvgYAjl1WfvabQeCxCBiesEFZOBKuNb0RKlOXxWZWuN3lAL qMFrwq5d2cy2nA4zhODGMB5PG/sx+BujLtSq7cBLsDxHhsC607cX08dG1y9eIYhKt6jQ TYXb2tCvw3Sr20XDsLw/Gv9FKl9mvUV6nwZNy1Q1QVvwKPPTLA4bt954yXZT806s+1Od C4UFWkkThXWrs6vfKUyYZLhorrwz+wl7TncueuJwP7DII+uje/qs/YsHrwzJRYaYiRoU J7ByC0DMPsHi9a+N3kR4C0CvRpgmdfIw+V4TIDsAuohANSBFkE5YxfYoKglG6QqAAMrO TJxg== 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=cXrBiBJi6Dfh9EHdaa74XDl1OgKypKBU2BA3Zhb7Oio=; b=SP34vRjn4XUkILkJ/HEVH0MZp59TjkKE27ymCjQTjPGREKZl2HDcgI5PuGEvhhCcWc JImdZKrPXAFG2jg1I49zYmp3D2puQ6mJ7PnYPYQrDTF6EyyxDbwGFVl1j1oXyynUsKhh psf3lwZTOhFcRTulzPW8q2P54oXJqlNYfDb5fToKBS6Z3M+tyz0byoh3+t27CQxEHuqi ON3s5c3KB5Joj/dn6vndKbniJ61SZez5MXXQh82oscCUgzwY1Ox7HKPLXImLttxJzJNA gJ/yCAVZd1H1rqy2wG5ALi79teL1+qRGZFUqFLw3Dp4pjkIIC0UninsZ0h5fXkBrfhb4 OmzA== X-Gm-Message-State: AOAM533nB9V3v6tV3v2JTnBnqs5bg2gA5qG54di/2bsORPw2vE0Cudkt fCCeSeytuQig0CmbjnRdm3+QD108y7og2npn/fF0ng== X-Received: by 2002:a17:90a:6ba4:: with SMTP id w33mr2086115pjj.32.1611094554325; Tue, 19 Jan 2021 14:15:54 -0800 (PST) MIME-Version: 1.0 References: <20210118135426.17372-1-will@kernel.org> In-Reply-To: <20210118135426.17372-1-will@kernel.org> From: Nick Desaulniers Date: Tue, 19 Jan 2021 14:15:43 -0800 Message-ID: Subject: Re: [STABLE BACKPORT 4.4.y, 4.9.y and 4.14.y] compiler.h: Raise minimum version of GCC to 5.1 for arm64 To: Will Deacon , Greg KH , Arnd Bergmann Cc: "# 3.4.x" , LKML , Russell King , Nathan Chancellor , Linus Torvalds , "Theodore Ts'o" , Florian Weimer , Peter Zijlstra , Catalin Marinas , Caroline Tice , Luis Lozano , Stephen Hines Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 18, 2021 at 5:54 AM Will Deacon wrote: > > commit dca5244d2f5b94f1809f0c02a549edf41ccd5493 upstream. > > GCC versions >= 4.9 and < 5.1 have been shown to emit memory references > beyond the stack pointer, resulting in memory corruption if an interrupt > is taken after the stack pointer has been adjusted but before the > reference has been executed. This leads to subtle, infrequent data > corruption such as the EXT4 problems reported by Russell King at the > link below. > > Life is too short for buggy compilers, so raise the minimum GCC version > required by arm64 to 5.1. > > Reported-by: Russell King > Suggested-by: Arnd Bergmann > Signed-off-by: Will Deacon > Tested-by: Nathan Chancellor > Reviewed-by: Nick Desaulniers > Reviewed-by: Nathan Chancellor > Acked-by: Linus Torvalds > Cc: # 4.4.y, 4.9.y and 4.14.y only > Cc: Theodore Ts'o > Cc: Florian Weimer > Cc: Peter Zijlstra > Cc: Nick Desaulniers > Link: https://lore.kernel.org/r/20210105154726.GD1551@shell.armlinux.org.uk > Link: https://lore.kernel.org/r/20210112224832.10980-1-will@kernel.org > Signed-off-by: Catalin Marinas > [will: backport to 4.4.y/4.9.y/4.14.y] Merging this from stable into "Android Common Kernel" trees that were built with AOSP GCC 4.9, I expect this to break some builds. Arnd, IIRC did you mention that AOSP GCC had picked up a fix? If so, did you verify that via disassembly, or gerrit patch file? (AOSP GCC 4.9: https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/ master branch, roll back a few commits). It looks like AOSP GCC `#defines __android__ 1`. I'm not arguing against a backport, just trying to think through how we'll need to sort this out downstream. (Revert or patch on top that checks for __android__, if AOSP GCC does in fact have a fix.) > Signed-off-by: Will Deacon > --- > include/linux/compiler-gcc.h | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h > index af8b4a879934..3cc8adede67b 100644 > --- a/include/linux/compiler-gcc.h > +++ b/include/linux/compiler-gcc.h > @@ -145,6 +145,12 @@ > > #if GCC_VERSION < 30200 > # error Sorry, your compiler is too old - please upgrade it. > +#elif defined(CONFIG_ARM64) && GCC_VERSION < 50100 > +/* > + * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63293 > + * https://lore.kernel.org/r/20210107111841.GN1551@shell.armlinux.org.uk > + */ > +# error Sorry, your version of GCC is too old - please use 5.1 or newer. > #endif > > #if GCC_VERSION < 30300 > -- > 2.30.0.284.gd98b1dd5eaa7-goog > -- Thanks, ~Nick Desaulniers