From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F0696C4345F for ; Mon, 15 Apr 2024 14:32:16 +0000 (UTC) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20230601 header.b=JcshQ0Mn; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4VJ8l34SZqz3vXQ for ; Tue, 16 Apr 2024 00:32:15 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20230601 header.b=JcshQ0Mn; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=flex--seanjc.bounces.google.com (client-ip=2607:f8b0:4864:20::54a; helo=mail-pg1-x54a.google.com; envelope-from=3pdodzgykdf0n95ie7bjjbg9.7jhgdipskk7-89qgdnon.jug56n.jmb@flex--seanjc.bounces.google.com; receiver=lists.ozlabs.org) Received: from mail-pg1-x54a.google.com (mail-pg1-x54a.google.com [IPv6:2607:f8b0:4864:20::54a]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4VJ8kC0m58z3cGY for ; Tue, 16 Apr 2024 00:31:29 +1000 (AEST) Received: by mail-pg1-x54a.google.com with SMTP id 41be03b00d2f7-5c6245bc7caso2524956a12.3 for ; Mon, 15 Apr 2024 07:31:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1713191485; x=1713796285; darn=lists.ozlabs.org; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:from:to:cc:subject:date:message-id :reply-to; bh=3c2CdFnxXRBnmzc0kZKqWJbmgAhAN/X9RQGLQm4qlas=; b=JcshQ0MnDTGA0MJVFvFNYCwusSDcf+HMYGn1D5bn1MhV8Aoy521HtHX7qZ0veMWoIk lePYqcJHXOOMfcwrdG5v1KvDIebQDRpNSCMatACSgfsFOWy1Cb8ICli/GgKCIq3dbHTl z4eaplorkywIRl0VOCrNRTm3WmdNOekD6mqjIPQG4pUFGtg+sT54n72SnUm1lZM8kw6t C6p6e08++d8GeOSVZGMrnEb9G67r/ELTQLG4FGTPNB13v7O2cCZBPjAMU1i57wWe7dFw QExH6a/Gq3lLVMANHkU+I3FhwHJVhsoZyouiN7OM+sNHt09GKtZvXC6h0U7KB2x1EdYM vV1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713191485; x=1713796285; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=3c2CdFnxXRBnmzc0kZKqWJbmgAhAN/X9RQGLQm4qlas=; b=dC3ZTB6ki+SDbCmRXo2Pfh6RDPP3uO1X3EIR7jnfN67JHFD4fWXDykGwn10HOgf2Zh VQ9njjw/g+NJBF+LzR8cTm7nD9rus3w1ePd7fBLm4z14pNHoGul1LDhxDTgjdxZo7S1F VQgj7Gh4VT/2SYlrayWPbuMcBk4Emh0jCfvqC1eyvlMtMXQI8ATUOs4AyEEIXgc+SuiS 1Kv+pxNAx7Z/Fj0o64wt3+/XRvSqpSmnK/kuC9tOxTdk9TiJPDtlnODGfxH0DpVO4ZyI qtEM/tsNvMBFOHSq82R5WJRiUmsQ0Z9ee3SP+2S8vTKnbgcve5oWQhOHwNZO2rfcPsYP +mcA== X-Forwarded-Encrypted: i=1; AJvYcCVyFi2VW+ppx55w55WwOhw0s4bkxDw4S9TZH/FWrnejvNp9AOKiG9DdLXPA976EN2GJWBK2qgl6a6Om9V7kAfSmPJSXgeTLORrDcvxDOA== X-Gm-Message-State: AOJu0Yz6pKXanTWKnGq3FMag2wjYD1wM+7dechF0kh8aKUvqBD1wNbdx 5u+oUQweeqhOObgZRDB3k4r4PLVlyrVgBpz/GNKPdvhgUYWfOIhf/pMQnR53nPf1JSuwHDENEIM hpA== X-Google-Smtp-Source: AGHT+IHuch75LMAnc1U2ltEvl5EQtMTtzEb/8rE4LBdYCN+wg04KdOcX1kaXCFsKcUY8MvFdl8nCoh4Cvw4= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a63:ec02:0:b0:5dc:bc92:23c4 with SMTP id j2-20020a63ec02000000b005dcbc9223c4mr27975pgh.12.1713191484874; Mon, 15 Apr 2024 07:31:24 -0700 (PDT) Date: Mon, 15 Apr 2024 07:31:23 -0700 In-Reply-To: Mime-Version: 1.0 References: <20240409175108.1512861-1-seanjc@google.com> <20240409175108.1512861-2-seanjc@google.com> <20240413115324.53303a68@canb.auug.org.au> <87edb9d33r.fsf@mail.lhotse> <87bk6dd2l4.fsf@mail.lhotse> Message-ID: Subject: Re: [PATCH 1/3] x86/cpu: Actually turn off mitigations by default for SPECULATION_MITIGATIONS=n From: Sean Christopherson To: Geert Uytterhoeven Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, Stephen Rothwell , x86@kernel.org, Will Deacon , Jonathan Corbet , Peter Zijlstra , Heiko Carstens , Dave Hansen , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Linux-Renesas , Ingo Molnar , Borislav Petkov , Catalin Marinas , Pawan Gupta , Thomas Gleixner , linuxppc-dev@lists.ozlabs.org, Josh Poimboeuf , Daniel Sneddon Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Mon, Apr 15, 2024, Geert Uytterhoeven wrote: > Hi Michael, >=20 > On Sat, Apr 13, 2024 at 11:38=E2=80=AFAM Michael Ellerman wrote: > > Michael Ellerman writes: > > > Stephen Rothwell writes: > > ... > > >> On Tue, 9 Apr 2024 10:51:05 -0700 Sean Christopherson wrote: > > ... > > >>> diff --git a/kernel/cpu.c b/kernel/cpu.c > > >>> index 8f6affd051f7..07ad53b7f119 100644 > > >>> --- a/kernel/cpu.c > > >>> +++ b/kernel/cpu.c > > >>> @@ -3207,7 +3207,8 @@ enum cpu_mitigations { > > >>> }; > > >>> > > >>> static enum cpu_mitigations cpu_mitigations __ro_after_init =3D > > >>> - CPU_MITIGATIONS_AUTO; > > >>> + IS_ENABLED(CONFIG_SPECULATION_MITIGATIONS) ? CPU_MITIGATIONS_AU= TO : > > >>> + CPU_MITIGATIONS_OF= F; > > >>> > > >>> static int __init mitigations_parse_cmdline(char *arg) > > >>> { > > > > I think a minimal workaround/fix would be: > > > > diff --git a/drivers/base/Kconfig b/drivers/base/Kconfig > > index 2b8fd6bb7da0..290be2f9e909 100644 > > --- a/drivers/base/Kconfig > > +++ b/drivers/base/Kconfig > > @@ -191,6 +191,10 @@ config GENERIC_CPU_AUTOPROBE > > config GENERIC_CPU_VULNERABILITIES > > bool > > > > +config SPECULATION_MITIGATIONS > > + def_bool y > > + depends on !X86 > > + > > config SOC_BUS > > bool > > select GLOB >=20 > Thanks, that works for me (on arm64), so > Tested-by: Geert Uytterhoeven Oof. I completely missed that "cpu_mitigations" wasn't x86-only. I can't = think of better solution than an on-by-default generic Kconfig, though can't that= it more simply be: diff --git a/drivers/base/Kconfig b/drivers/base/Kconfig index 2b8fd6bb7da0..5930cb56ee29 100644 --- a/drivers/base/Kconfig +++ b/drivers/base/Kconfig @@ -191,6 +191,9 @@ config GENERIC_CPU_AUTOPROBE config GENERIC_CPU_VULNERABILITIES bool =20 +config SPECULATION_MITIGATIONS + def_bool !X86 + config SOC_BUS bool select GLOB