Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1983830lqp; Tue, 16 Apr 2024 04:06:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWxqTUIrujH+6CJ3e90EKXg2Pj4IKJ//XxQRRtrx/+DMKrxIdKhjsHYTyXGxm8HT+jQDJfrcfBchUmz+nsAIlDsOvKGj1UA043HA4Cszg== X-Google-Smtp-Source: AGHT+IERAg+7DHO6eI59b3EMIQuVbLX2FoZ8K25UsLN7MJLw7uRf68Ol8MRnp4+n6MIO3mqYTuKt X-Received: by 2002:a05:6a20:d487:b0:1a9:c3ac:be77 with SMTP id im7-20020a056a20d48700b001a9c3acbe77mr11284733pzb.1.1713265616152; Tue, 16 Apr 2024 04:06:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713265616; cv=pass; d=google.com; s=arc-20160816; b=AAKvmu5AE+HPpCNibnCBnDu8TGmp8eSIkSOCosCIuA+MO7DPlbnLhhS5GvRLBvvYZF XA6At/F5JZbsueQnWNm/jbtjudyzW8WT61bggMpTzhbxHlUUr39ybRRVHqVgyaJJ2R1A H/65Df71U60Kz2bjxbjVfnGvqcewo3gwmHHQKIzQRjva274quyzOS8ugxU821k0ehozU rgYBAdOV9tBFcN2ZcO6a2fuD7Gv5vux0WxiUq7GFUofJ2ltc9ENLQTTPG8s02eqWw8eK 35g19YKJvrI3bZFY8UPanP4XHDdTlqQCFQhST7/8mkjBQZkQxg8BYnRhHMOIa/nEkGHu AThw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=m0OXBfeSJNV67OWiwlg58xXaL5nRVTZ9FFXZTv4YfRA=; fh=y4oBP1EMe4U9LPmebNgUkOuiY7RGZDywVUWCD0TPVc8=; b=OZbUbd2mys10ahWf1V/cTWIMYT8Cjknvl562AIKn4/4Vnj05+r1+Rq5hKR3IBKaIYJ nP7grbOVlL30ydDX2h8xTTK2DRkITRQpFisdceuXrMcon7h+VhZDurQXdhLZQSubOJXF yrp8LhhBGlJH4cVXjkBhSCH/65odUq+hd4z6W8sC/i8EHzzargcRjPk9RayZl6InLb8C jo4FTPVlNo7r4/L9EiTT/9VwxJv0tViGb5lVDj0QF6urEn2lXgyXixY1rUgT/5bt2lB+ BKfLS/J1apPFw76NrO+JYUgyDLksTTlYSR6rSogT1OGsVT4mK8mIcV2a0qX6QGHhkZTv LkUA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=BshHmH48; arc=pass (i=1 spf=pass spfdomain=ellerman.id.au dkim=pass dkdomain=ellerman.id.au); spf=pass (google.com: domain of linux-kernel+bounces-146688-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146688-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id u16-20020a170902e5d000b001e47f894beesi9950953plf.251.2024.04.16.04.06.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 04:06:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-146688-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=BshHmH48; arc=pass (i=1 spf=pass spfdomain=ellerman.id.au dkim=pass dkdomain=ellerman.id.au); spf=pass (google.com: domain of linux-kernel+bounces-146688-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146688-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id D0143282259 for ; Tue, 16 Apr 2024 11:06:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C78CA12881C; Tue, 16 Apr 2024 11:06:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ellerman.id.au header.i=@ellerman.id.au header.b="BshHmH48" Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CAFAB127E3D; Tue, 16 Apr 2024 11:06:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=150.107.74.76 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713265607; cv=none; b=Sj/v5DhAjR3uH/xXxRphluEduFG8JwrI8kNcwUJSU+alErJmDZIOjgTr1ijbabeC7wc7s1MBAjd71H6umsnqlod+pesmV0gjhMTbUac1fmgevNapC20LBwRPD1f1D6GwmGavMvQWuGZlTy2kA6UM7i6mdIAYFMSxnnWi/00oLqU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713265607; c=relaxed/simple; bh=6YyzjOcrpjM2awxpuoWmwqK1BSbLE0TEGbSa1cisklg=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=CYmkGAAtpV7+7kMHW7hBRYVwzlEuaQ2Czwk3yR7fRENlGn3ylPLua2+zdKFP8VJUR8+bcCbdX/tQEtG3cQHxsnj7V28GsYYE3j54X4AJkYz1cLdm0X+uJdi74VLzpeYSpthHELj9e1cWTEngeP7eOVDfGBoyrAZ6zrSE5qD8NNY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au; spf=pass smtp.mailfrom=ellerman.id.au; dkim=pass (2048-bit key) header.d=ellerman.id.au header.i=@ellerman.id.au header.b=BshHmH48; arc=none smtp.client-ip=150.107.74.76 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ellerman.id.au 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 Cc: Stephen Rothwell , Jonathan Corbet , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, Peter Zijlstra , Josh Poimboeuf , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Pawan Gupta , Daniel Sneddon , linuxppc-dev@lists.ozlabs.org, linux-arch@vger.kernel.org, Catalin Marinas , Will Deacon , Heiko Carstens , Linux-Renesas 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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