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 49530C4345F for ; Tue, 16 Apr 2024 11:07:25 +0000 (UTC) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ellerman.id.au header.i=@ellerman.id.au header.a=rsa-sha256 header.s=201909 header.b=BshHmH48; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4VJh8C6jX1z3vdR for ; Tue, 16 Apr 2024 21:07:23 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ellerman.id.au header.i=@ellerman.id.au header.a=rsa-sha256 header.s=201909 header.b=BshHmH48; dkim-atps=neutral Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) (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 4VJh7L6D9Xz3dVq for ; Tue, 16 Apr 2024 21:06:38 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellerman.id.au; s=201909; t=1713265594; bh=m0OXBfeSJNV67OWiwlg58xXaL5nRVTZ9FFXZTv4YfRA=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=BshHmH48hI2RHWM/xhDdoBq6VpEtUFcBGkMSWHrzLiOiE0TheY5hTBRpG1wc20YxQ BNWaqxEG4uZt80If+ksNGJS3kWD4eIS/i7uhp5CnKdC6VueM7JF0JSaTYKwQwih2/z Og+6U+bnQE9axLAC5y41TOmdCAi/9aH/2kGYIIa1Cqau8hD8mXXo53SbLknPqyv1Te xFY2lD888iOGSAomxoaCTXleIdnXZPzN2H87wCv/bR1q4kda/McrUf/xadTOE6qM0y MexQLEXPwXDr/cndRUWqG6qGdtu8OZscIqJbK4uu/keTeOEbMRm1eDLApmARTY/toS 9STWuWmVTv/xg== Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4VJh7C3WSSz4x1H; Tue, 16 Apr 2024 21:06:31 +1000 (AEST) From: Michael Ellerman To: Sean Christopherson , Geert Uytterhoeven Subject: Re: [PATCH 1/3] x86/cpu: Actually turn off mitigations by default for SPECULATION_MITIGATIONS=n In-Reply-To: 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> Date: Tue, 16 Apr 2024 21:06:31 +1000 Message-ID: <87sezlbm88.fsf@mail.lhotse> MIME-Version: 1.0 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 , Catalin Marinas , Heiko Carstens , Dave Hansen , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Linux-Renesas , Ingo Molnar , Borislav Petkov , 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" Sean Christopherson writes: > On Mon, Apr 15, 2024, Geert Uytterhoeven wrote: >> 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_A= UTO : >> > >>> + CPU_MITIGATIONS_O= FF; >> > >>> >> > >>> 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 th= at 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=20 > +config SPECULATION_MITIGATIONS > + def_bool !X86 > + Yeah that works too. cheers