Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp672266lqt; Fri, 19 Apr 2024 07:16:12 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUAlryFyQ2gbLeiGoeji1yXn1nmjUQw+f6H+ctvBrgzc1iokOt33unuDn21Oi2rIqaf/Wqjvfswip9/yAdhLQ5xdTgNxCggQIOvAvqYOA== X-Google-Smtp-Source: AGHT+IFWE2gTGk1UBkMGXNxbp5eNBXdH8JWDWf5z3Fpy1vQIeLk2PMH3stMB4jGP1NHX96eER8DM X-Received: by 2002:a05:6e02:1e0b:b0:36a:1e55:5358 with SMTP id g11-20020a056e021e0b00b0036a1e555358mr2802864ila.18.1713536171967; Fri, 19 Apr 2024 07:16:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713536171; cv=pass; d=google.com; s=arc-20160816; b=X3KzvyBbk5+SHEj4KjaR8tae24IfKtUt5p+OWNhT2M4lrSThl0pL0gPLTq0eHPOkkP ppDsAlRiqNDpBxJ4DVOurc6877jhF1zz8r1n12TVdaDTxfz6NzE8XDtrJL7nLTTxIFeh l2kqKFvSFSefSeysN+AF4hyrjijxlAB/1dXRxuE0Jts22SYNsam19gUiNBo1Qy3zXHLz 22mmNPrFMAcT8GXs2K866mk7qTGVvV1fmYPJK0DTgn0v/XxwySX+Y+H8ATjtRcwp13/8 0hNx3dOw7k2xMLnl+y6N+kaSN+IqG0sFZqqq6KgyOVTphAyuPXvLwrnNBZ3q5j2+pN5d +E6w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:references:message-id:subject:cc:to:from:date :dkim-signature; bh=CGV3qbeRRgA6/xBF1r7kvEonnns5yaYhgRpN+k1tw8s=; fh=eRYOnaqFK3u/Oh1Xzw3uPV7toVc/jbZZMGNeWcRyRR0=; b=Bi2g9dOTNsGKC3pWFRwzAwz4grbUJWy7Qk4b6LzUmF5mXBWF/ypecIu4diVCZrUEsA zdA4RJkw8cW7rYdBtyGCXWRojDY1SRnfuYwf2YgnPi88w2W29UWr0pIMXL5eDt/lsJ45 Et/ia1smEBwN7cwo4ixp2Bpf9txgFgPdLqdD39UrmVrw6DFt2fI9IKGg9dP/+el5nAUu Y1IdS25qGicEIvbpawPlf1F+jMOvCTJqbe8RAZi+T3L7xiIIHipyLOlLFse4TNHGbbo5 fRsR2X4xqziTlcqmcOemiHjiScNNQF6KGhIJVzOF//qjWkH9DmOuApZ5fjVntp2MmFHs 93/w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WJrriT5J; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-151537-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151537-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d5-20020a63f245000000b005dc423d758dsi3186329pgk.116.2024.04.19.07.16.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 07:16:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-151537-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WJrriT5J; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-151537-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151537-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 5A2D2B2544C for ; Fri, 19 Apr 2024 14:06:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A9EFA12FB31; Fri, 19 Apr 2024 14:03:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WJrriT5J" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 C1C0812FB23; Fri, 19 Apr 2024 14:03:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713535409; cv=none; b=RNxbMwF2fxI9okkwOpDvZ7Gv7UHdVH5737PMRjckmYyzwnuYT2+Y5IDbtnamvvuPlXG1dKwCUZmCxBVlL4sYyqJFiXSEE6UvIOws9QMKlt1CDXtxQLE0Xfw+QxsYXW8E1qAqUVqUzxPmWfDzEsDmGHOZonovIFrg9PXBmp+O1IY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713535409; c=relaxed/simple; bh=DU2Oh8nrRgXZi/yPndOQwhsltv4XMpBfwRnb1FWmP0Q=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=rKpjVek39pbyB0Kq4EdiIj3LnK3LrgMe0mTbetYPbXQHO306+29BghgowcXlY6nd+MflnqZzL6sQ1Z5JZlKU/KvV1/r039nIlP8rg0yXUgncz+he6TDIYCAUXRrMz1+Fae6dhVZq8SXXE2GtYYRBedACOvHDSWkZm3hsyGhalNg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WJrriT5J; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 72650C072AA; Fri, 19 Apr 2024 14:03:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713535409; bh=DU2Oh8nrRgXZi/yPndOQwhsltv4XMpBfwRnb1FWmP0Q=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WJrriT5J2X7hf4oYYUmstmlkPeq3DgvatCicCKVfFY05MHAXsGjIvsIH6c2UeFUCK b1tQA9eFfPT9My24Bx5MwU3csOfL2xbVgwabrXecyWtYmZRKLwmjFTjcB9j5GYWGoy bTMMwme5TOdiXtbdlz/weS3ViPl7AR23/VsdRSztQE4oWHicuv1Q1F6jzoDfRx6oFs e91S/8iEAE+36zTfeMrMhg/6jsGIwDPTUf6JEt6bvmNpYbnQaXgYkrjgO5C+kCE1Jv URoPOjT0e9X5jEpWoycpzzCiinEHMpKHGeCeKhjSjfGUKHI96+oFtwuokS//ELD+RL Qpa7Bkn0p5REw== Date: Fri, 19 Apr 2024 15:03:22 +0100 From: Will Deacon To: Sean Christopherson Cc: Geert Uytterhoeven , Michael Ellerman , 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 , Heiko Carstens , Linux-Renesas Subject: Re: [PATCH 1/3] x86/cpu: Actually turn off mitigations by default for SPECULATION_MITIGATIONS=n Message-ID: <20240419140321.GF3148@willie-the-truck> 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> 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-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) On Mon, Apr 15, 2024 at 07:31:23AM -0700, Sean Christopherson wrote: > On Mon, Apr 15, 2024, Geert Uytterhoeven wrote: > > On Sat, Apr 13, 2024 at 11:38 AM 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 = > > > >>> - 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 > > 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 > > +config SPECULATION_MITIGATIONS > + def_bool !X86 > + > config SOC_BUS > bool > select GLOB I can't see this in -next yet. Do you plan to post it as a proper patch to collect acks etc? Cheers, Will