Message ID | 20230307140522.2311461-2-ardb@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp2459555wrd; Tue, 7 Mar 2023 06:26:23 -0800 (PST) X-Google-Smtp-Source: AK7set8vXNGFAxahIzKSc8xPLZiWcVfzFsPqgO3s33q0t/0z85G1O7cx492klha99WlPWfoYoB1s X-Received: by 2002:a17:902:ce90:b0:198:9e29:cc4f with SMTP id f16-20020a170902ce9000b001989e29cc4fmr18271289plg.43.1678199183505; Tue, 07 Mar 2023 06:26:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678199183; cv=none; d=google.com; s=arc-20160816; b=F4fKMrqA8n5bqA81U6SWMh7a+zDz1EPdnxRwJdIR+sbpYB5+UlYw/7rel/kuVKWF29 mNEDOQMbmlg1tW7c+i89K8B1BKYTSG1/eT652vWU4JYlwmkSRCrU40CEX8ExHzoOgHqk SxPd7nM3qvxC8J72Fbyp3v9598S6XC3PDLT276Y14jkh6UDoZY0tkBlwitDM2+sS0Lc9 YJ8sQVMH3McU0xpi5R2TzFCGyFok3W6wEJ8jwZK2UF2/s3WEz1bpCrz2ChEdgsOy+NAl h/e7YZAoULwqSpc8bAoMKod2qXX/U9uUoLu0pEdPpFPD6KJWu0z6dwEueWPQH6u/4Yjn ycsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=z6Ke9VA8DiW5jBhDqVDEjLSNJJrbZ6FNvEq1fXSRFlw=; b=WOYFTDH6AoTyqUCYODmBsrY7VBHq8q/5T9vqBIFNu5Hel7qTfxTLLrFvHgWlAWHEaY DtXnyJXNn+mANnZVWMzRrM+Dilm2Hl2PhCg42FP03OLRKW36ms9/yJkkSUhNcaPZ7MzT +gK2tmSFIiMc8AoJj8BYeh/AL1uD37qk0hxEkdUSQQjq1pLgMaL51ulCFhVmc9XHOhFF mLFw+OR3LievPgSm/Cv7+qvrgH68F/jQcbWN0q1apbjokJiz2MVpjsNSsqku6uu4hIvK qhAO/zUCxqGG3mT6uUAFKXTsByK1BF0lFXyhoXavPqcsnI8MslLvAIX0kcCEtGZjNomB kvQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Uc+w1oi7; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d15-20020a170902cecf00b0019489437a80si13605518plg.144.2023.03.07.06.26.10; Tue, 07 Mar 2023 06:26:23 -0800 (PST) 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=@kernel.org header.s=k20201202 header.b=Uc+w1oi7; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230183AbjCGOGt (ORCPT <rfc822;toshivichauhan@gmail.com> + 99 others); Tue, 7 Mar 2023 09:06:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230032AbjCGOGp (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 7 Mar 2023 09:06:45 -0500 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B10B37EA3A for <linux-kernel@vger.kernel.org>; Tue, 7 Mar 2023 06:06:44 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 8C655CE1BDD for <linux-kernel@vger.kernel.org>; Tue, 7 Mar 2023 14:06:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B8D5EC433A4; Tue, 7 Mar 2023 14:06:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1678198000; bh=UU7UHHKN3Bd0erW9JoS5OAfIvVMowd83YmJWUTJJyEU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Uc+w1oi7J43W+sD4f84reyCRhvx0QojS7oA8M0lOPvS0aFzJKjUuEgNxf9ToK6s9H t5NKs9aiJSi4y6ECXVmFzT7L5R6oT9nhikg9pIBHIJNXBQkADMSEntgvaHVatFhP03 n/WdLin+s9pnhkEaY9KiL/eV06cWSA4zmnKpSnCN/PHmRRkGFF7ohSZaEbIowVEgrH cjgqyleUtRxu9/mpXpndcjP+jPwNVTXNOoVC2AIqc/1nArhkEuENQWWo5s4Zx9JoKu ymYJt15AFHg4rKXCor9PpfVU8vVmka8c8XCfuo/hEG7AG1rOWzVnQ/SRbZUMlfgIy2 U5pRvMDz1+LDQ== From: Ard Biesheuvel <ardb@kernel.org> To: linux-kernel@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, Ard Biesheuvel <ardb@kernel.org>, Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will@kernel.org>, Marc Zyngier <maz@kernel.org>, Mark Rutland <mark.rutland@arm.com>, Ryan Roberts <ryan.roberts@arm.com>, Anshuman Khandual <anshuman.khandual@arm.com>, Kees Cook <keescook@chromium.org> Subject: [PATCH v3 01/60] arm64: kernel: Disable latent_entropy GCC plugin in early C runtime Date: Tue, 7 Mar 2023 15:04:23 +0100 Message-Id: <20230307140522.2311461-2-ardb@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230307140522.2311461-1-ardb@kernel.org> References: <20230307140522.2311461-1-ardb@kernel.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=849; i=ardb@kernel.org; h=from:subject; bh=UU7UHHKN3Bd0erW9JoS5OAfIvVMowd83YmJWUTJJyEU=; b=owGbwMvMwCFmkMcZplerG8N4Wi2JIYXd+d/V5Cme/D+mi/NJGKn5Lcrht9rvkyvS90//SWbo/ 41eltc6SlkYxDgYZMUUWQRm/3238/REqVrnWbIwc1iZQIYwcHEKwERWujD89+3Q6bQ9XsZZ9DDh 9J6VMdFZz4Nmx57J2xIq8LhbYU9+DiPDvai9f307ln1mOLlHKEtLYVurzUH73XN25TuaR2Tu/97 NBAA= X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759719387243886755?= X-GMAIL-MSGID: =?utf-8?q?1759719387243886755?= |
Series |
arm64: Add support for LPA2 at stage1 and WXN
|
|
Commit Message
Ard Biesheuvel
March 7, 2023, 2:04 p.m. UTC
Avoid build issues in the early C code related to the latent_entropy GCC
plugin, by incorporating the C flags fragment that disables it.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
arch/arm64/kernel/pi/Makefile | 1 +
1 file changed, 1 insertion(+)
Comments
On Tue, Mar 07, 2023 at 03:04:23PM +0100, Ard Biesheuvel wrote: > Avoid build issues in the early C code related to the latent_entropy GCC > plugin, by incorporating the C flags fragment that disables it. > > Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Just to check, are you seeing issues today? IIUC the plugin only instruments functions which are explicitly marked with __latent_entropy, and if we're seeing that happen unexpectedly (or due to that being applying to __meminit / __init), we might need to do likewise for other noinstr code. Regardless, for this patch: Acked-by: Mark Rutland <mark.rutland@arm.com> Mark. > --- > arch/arm64/kernel/pi/Makefile | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/arm64/kernel/pi/Makefile b/arch/arm64/kernel/pi/Makefile > index 4c0ea3cd4ea406b6..c844a0546d7f0e62 100644 > --- a/arch/arm64/kernel/pi/Makefile > +++ b/arch/arm64/kernel/pi/Makefile > @@ -3,6 +3,7 @@ > > KBUILD_CFLAGS := $(subst $(CC_FLAGS_FTRACE),,$(KBUILD_CFLAGS)) -fpie \ > -Os -DDISABLE_BRANCH_PROFILING $(DISABLE_STACKLEAK_PLUGIN) \ > + $(DISABLE_LATENT_ENTROPY_PLUGIN) \ > $(call cc-option,-mbranch-protection=none) \ > -I$(srctree)/scripts/dtc/libfdt -fno-stack-protector \ > -include $(srctree)/include/linux/hidden.h \ > -- > 2.39.2 > >
On Fri, 28 Apr 2023 at 11:38, Mark Rutland <mark.rutland@arm.com> wrote: > > On Tue, Mar 07, 2023 at 03:04:23PM +0100, Ard Biesheuvel wrote: > > Avoid build issues in the early C code related to the latent_entropy GCC > > plugin, by incorporating the C flags fragment that disables it. > > > > Signed-off-by: Ard Biesheuvel <ardb@kernel.org> > > Just to check, are you seeing issues today? IIUC the plugin only instruments > functions which are explicitly marked with __latent_entropy, and if we're > seeing that happen unexpectedly (or due to that being applying to __meminit / > __init), we might need to do likewise for other noinstr code. > I don't quite remember, tbh, but it is unlikely that I would have written or included this patch without having run into some actual issue. > Regardless, for this patch: > > Acked-by: Mark Rutland <mark.rutland@arm.com> > Thanks,
On Fri, Apr 28, 2023 at 11:54:16AM +0100, Ard Biesheuvel wrote: > On Fri, 28 Apr 2023 at 11:38, Mark Rutland <mark.rutland@arm.com> wrote: > > > > On Tue, Mar 07, 2023 at 03:04:23PM +0100, Ard Biesheuvel wrote: > > > Avoid build issues in the early C code related to the latent_entropy GCC > > > plugin, by incorporating the C flags fragment that disables it. > > > > > > Signed-off-by: Ard Biesheuvel <ardb@kernel.org> > > > > Just to check, are you seeing issues today? IIUC the plugin only instruments > > functions which are explicitly marked with __latent_entropy, and if we're > > seeing that happen unexpectedly (or due to that being applying to __meminit / > > __init), we might need to do likewise for other noinstr code. > > > > I don't quite remember, tbh, but it is unlikely that I would have > written or included this patch without having run into some actual > issue. Sure. Looking at the series, from patch 15 onwards you mark portions of the PI code as __init. As __init currently implies __latent_entropy (which I think is a bit crazy as of itself...), that's why this'll start to fail. It would be nice if we could mention that in the commit message, e.g. | In subsequent patches we'll mark portions of the early C code as __init. | Unfortunarely, __init implies __latent_entropy, and this would result in the | early C code being instrumented in an unsafe manner. | | Disable the latent entropy plugin for the early C code. ... though my ack stands regardless of whether we add such wording. Mark. > > Regardless, for this patch: > > > > Acked-by: Mark Rutland <mark.rutland@arm.com> > > > > Thanks,
diff --git a/arch/arm64/kernel/pi/Makefile b/arch/arm64/kernel/pi/Makefile index 4c0ea3cd4ea406b6..c844a0546d7f0e62 100644 --- a/arch/arm64/kernel/pi/Makefile +++ b/arch/arm64/kernel/pi/Makefile @@ -3,6 +3,7 @@ KBUILD_CFLAGS := $(subst $(CC_FLAGS_FTRACE),,$(KBUILD_CFLAGS)) -fpie \ -Os -DDISABLE_BRANCH_PROFILING $(DISABLE_STACKLEAK_PLUGIN) \ + $(DISABLE_LATENT_ENTROPY_PLUGIN) \ $(call cc-option,-mbranch-protection=none) \ -I$(srctree)/scripts/dtc/libfdt -fno-stack-protector \ -include $(srctree)/include/linux/hidden.h \