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 ADF5FC04FFE for ; Mon, 15 Apr 2024 11:17:41 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4VJ4QX2lsFz3dWD for ; Mon, 15 Apr 2024 21:17:40 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=209.85.219.169; helo=mail-yb1-f169.google.com; envelope-from=geert.uytterhoeven@gmail.com; receiver=lists.ozlabs.org) Received: from mail-yb1-f169.google.com (mail-yb1-f169.google.com [209.85.219.169]) (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 4VJ4Pz6gMnz3dRm for ; Mon, 15 Apr 2024 21:17:10 +1000 (AEST) Received: by mail-yb1-f169.google.com with SMTP id 3f1490d57ef6-dd02fb9a31cso2464340276.3 for ; Mon, 15 Apr 2024 04:17:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713179825; x=1713784625; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BDiun8fBl0neiQNLp2j8KsuRQma3u2I4LgI70HkeRT4=; b=mBnjvOv6CY93PlwXS2OM/fKK068CHY+vWQBry8vT2sOmUliFTFtjNEpQpnF7YSAWet kLCE433uAEwQHwtidkxZLY8d83CisKEl/zdmVxDWbe3LieuwNulEOzVtqxLI3ULwKJa5 YuOsWVyymS2iJ3FUdcsyH53T5wXIr1T2QytSn3MZ8+UEgYmqghw0zGofRiXmni935RXm 8Uvc4PBCEcFUPcNRDKC5tongrVxoWd7k1bU7D6ej0KbLAvH74KHANYp1ZFLCKay6iqPC J2DB/t2LHxBawMBzbAh8w1i6GJY/9ek5g2unEGAEWw6ddrUU3zxpMFjekTfY+hTs3wRQ shgg== X-Forwarded-Encrypted: i=1; AJvYcCUUs1RdaR3S9xybvywzoRqpLXZOeIiRti3LBA8DwmWXWvJXJihKT9WnWHOMUSgtzPUUZZJI5yc+WVPPv6SLqYBABBRoHo8B6pEiHLw0xQ== X-Gm-Message-State: AOJu0YwWpGr7esA3L+oDAJICJParQeizDBAR7cgwC5puYXPb5adg+dQ3 9WqktchjtZbGjU2hqPP6WxAKNITLppySzfBY7gwC+4lsBvGRY46/5ed9HxWJ X-Google-Smtp-Source: AGHT+IHqIj/U4WrwPp8ZL2sgOJ4S5YcPsk0KRwuyVXScdTBvcksx/TkUE2VbAT/kuj/eZhOCtujr4g== X-Received: by 2002:a25:addc:0:b0:dc6:6307:d188 with SMTP id d28-20020a25addc000000b00dc66307d188mr9081100ybe.25.1713179824758; Mon, 15 Apr 2024 04:17:04 -0700 (PDT) Received: from mail-yb1-f176.google.com (mail-yb1-f176.google.com. [209.85.219.176]) by smtp.gmail.com with ESMTPSA id 205-20020a2500d6000000b00dc25d5f4c75sm2001090yba.10.2024.04.15.04.17.03 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 15 Apr 2024 04:17:03 -0700 (PDT) Received: by mail-yb1-f176.google.com with SMTP id 3f1490d57ef6-dcbf82cdf05so2609007276.2 for ; Mon, 15 Apr 2024 04:17:03 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCWalstmLZDG3KJGXUOJ4iWj3n17/7pajO3pmE5/ymJUCcmhf98nMajJXb5+KRMGNfy7RYyRFTY75UKasbxxOEyGQONRLnsvanpC7QumyA== X-Received: by 2002:a25:4b82:0:b0:de0:f753:ad25 with SMTP id y124-20020a254b82000000b00de0f753ad25mr8758272yba.1.1713179822967; Mon, 15 Apr 2024 04:17:02 -0700 (PDT) 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> In-Reply-To: <87bk6dd2l4.fsf@mail.lhotse> From: Geert Uytterhoeven Date: Mon, 15 Apr 2024 13:16:50 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/3] x86/cpu: Actually turn off mitigations by default for SPECULATION_MITIGATIONS=n To: Michael Ellerman 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 , Sean Christopherson , 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" Hi Michael, 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_AUTO= : > >>> + CPU_MITIGATIONS_OFF; > >>> > >>> 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 Thanks, that works for me (on arm64), so Tested-by: Geert Uytterhoeven Gr{oetje,eeting}s, Geert --=20 Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k= .org In personal conversations with technical people, I call myself a hacker. Bu= t when I'm talking to journalists I just say "programmer" or something like t= hat. -- Linus Torvalds