Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp970362lqt; Fri, 19 Apr 2024 17:09:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV2TOKkgIj3bh0i3i14TJe+NC3A9vZwKoMv9fAxa3Lw/WaE4Q1LXQyQtChdmoea4rvplbKT0lLeVYkeyL3UqqE8GI2hWuyMLce5XZqW0w== X-Google-Smtp-Source: AGHT+IHFb5AqJDhMvoA1hYY2mFTjyWZGI4cQTxXd2cNhex/GlVdXirBUn0JcYDsdM4lxRReRvNZV X-Received: by 2002:a05:6512:b8b:b0:515:bbe9:f208 with SMTP id b11-20020a0565120b8b00b00515bbe9f208mr2672882lfv.19.1713571783041; Fri, 19 Apr 2024 17:09:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713571783; cv=pass; d=google.com; s=arc-20160816; b=zQBOoopnA6sYkuBOnv+ZFuVI73IDStSsJ1x9ytoxSLMjPzLFY/bNVrfeAdoJHnbubh JMUYj7hbfqzNk2yK+4T7YJZfaUMe3nQRXvA3I+861LH5gfXbGaCqrpmQUSdANxe9QhWa CWSDts+Jh4aVsxkU3fXxCX33OL7dSV5a5HUXuZ+EVjz3B+NqOXsZpSbLpa82LDw3Qve7 YALuyq9pJiztTlNNhthskekJHg76j6omnA4ZiAKhnR1tqFk3gdmghfxUREV12Z9O2d3u 81TYzk7Xb7IjLuvFWvhswyCrubiADbpKBYeHTR04CUSwfh1VOVBOn9BpP9f7ywqISEEY zB8w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:references:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:in-reply-to:date :dkim-signature; bh=6ld8fmbXDb/pR3C8NsGTfnRCkO74P0Zyhqm1cvneZo0=; fh=0Mln7y5ODFeLp1s1J+IAYf1EiT0gkoJEvkKN7Jk5RgE=; b=BPIUxG6fOyijdS5OGlQu4LZ1SUKdTI5DNIfqCvnzi0DsQgSvFSCON3i7WB6pCLlQu9 bbZhMNYbSdWW/8hvLmRBmXgvVpBAgVXdO1AWpzGzo8uGWTVSmJyaUOO13aM5u7NDehoJ y8xE9DJgJY6PW9Bsr0Hx4FeWp6TgldLisaHn6nxUccO+9p3kCMktvwD2quVr66q+cuW2 C47xu2lhTOs0VUJBo/MHDTycQBApRzrbYi1d7FzR9D7PXWAljL77/qnNB5w7KVenLSBA tP0amn0bau5SM7p+JQfw5BBwwLWqgvUPw4XCbZvieHcm5stm1uJ/Bl5x2hDJUB9pLjWQ Y9Cw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=kNbQVRCp; arc=pass (i=1 spf=pass spfdomain=flex--seanjc.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-152054-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-152054-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id bm9-20020a0564020b0900b00571b20d411bsi2696848edb.449.2024.04.19.17.09.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 17:09:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-152054-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=kNbQVRCp; arc=pass (i=1 spf=pass spfdomain=flex--seanjc.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-152054-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-152054-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id C01441F21510 for ; Sat, 20 Apr 2024 00:09:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D686C63B; Sat, 20 Apr 2024 00:09:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="kNbQVRCp" Received: from mail-pf1-f202.google.com (mail-pf1-f202.google.com [209.85.210.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B4A0F17C for ; Sat, 20 Apr 2024 00:09:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713571775; cv=none; b=abjSqaXRQa8rtdrRlzJ2d2JlaR2Tgk235KtfCtAd9vdgGWhJ7oWEIFwu1ndbIZIJwoDIG+logD882z+GfPMX3MVsKUs4+dEtPbsh0x3cdR3pQ0uJufMSmhnq5rOFaDIpRBRidKfiVGFvyCfG6tUsnhKMfHgXSPd4o+89KwlTiC4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713571775; c=relaxed/simple; bh=BuLz/JHVB0gV5Hb4RmtjerjifU3c/PDa9CxmoO1LMKc=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=Yvo5HWotmbIuhODmwu/3avsnGD7MeyEVk4NPawhpDxW7gr/OLsFL3QsOgKUa5DNmSe3jQixKFwCptjVca2eHcnfIrfPTQf/xv5TezK6Qoei2kcfNS9I0nuJ5TAICTDTnoQGAesnYfnxeidJkErMNr4Tu+TmG7vFjT+KZ84G5WIo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=kNbQVRCp; arc=none smtp.client-ip=209.85.210.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Received: by mail-pf1-f202.google.com with SMTP id d2e1a72fcca58-6ed2f4e685bso2807643b3a.0 for ; Fri, 19 Apr 2024 17:09:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1713571773; x=1714176573; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=6ld8fmbXDb/pR3C8NsGTfnRCkO74P0Zyhqm1cvneZo0=; b=kNbQVRCpMV5VeXgXGLSIKXBRTlwwCq9tTZR2p95Gitte9w3371hjkCD3d5aMjUFJOK mW6q8gRv+qcb0ZSC8aXlyvUGL8yCEhU7aK/hP1aSxQJt7NRHOy/oisbpNhCgt77FmaBM Q600Y9o16KxCx6pAw3+Nkuyu2Mo+W+G0MbCyqyfOyeHOjhSkInsm6XI8fBBfmeGnC/jN eTMDeWcs8nBGBAcuQlqzEsuYF9vMusL/ER6n1fP/0NPoFnGR/o5IPW10ftZ2e21eL5Im m33n7s/yjrEBq9qpxcl3epRJHwYoaFDuVWHF+hCnM8Q0sSEnUTa4gNPXP6HA5iVe//Or QjoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713571773; x=1714176573; h=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=6ld8fmbXDb/pR3C8NsGTfnRCkO74P0Zyhqm1cvneZo0=; b=s/C97N7MCKH3piX61ptAoYgZ2eqyS9pBvHPQfdMJZVdcsKVR4Nv99683Axk4Q058GJ dWEo28B+w75NzMrBPHfS4hqJkuGXmJNApMtmgl2Fddceh9k0Qy7lxo6eZoLR4ghmxtmN C2EhsyHyzvD74GXXlXQd6d/KjWLJDE71+D770hM7Gcr/UMrVxd5waXVlXXa/heEIuHNt aj1/lbhNlYTUQKpGuM1wE64wxoHWct+TZE+9vLA9kApmLXK6Lb54AXbejw7hfHJBFt8R aTbN7DvMruvAhJEPXtg1sUTN+jX72wfsNUWuLAAo9ZI0kTdIy5zTBVp2qebft5eZuMcg yhTA== X-Forwarded-Encrypted: i=1; AJvYcCXXYLHBEgZIz7rKCQ67B523gaLKxdqRtyiLjFq5u5w2q6OJU4aCOdsY7biEwWV4IW4xa83vI+gB/AMMkFcpBofSIHiErNMOEJ1QJkmM X-Gm-Message-State: AOJu0YzCMSJUmtdy1dQcxWul2/mmKjxfxbej3L6RswVa3whJOErx1de8 PIIt8a8gBD6UD9Y3mK/Wibo9nIemxUFkbIN6JL5uwlZ7geWTEBeGS3/nuvjspNvy9AANYw1+peW /jg== X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a05:6a00:124a:b0:6eb:1d5:a3a with SMTP id u10-20020a056a00124a00b006eb01d50a3amr206560pfi.1.1713571772778; Fri, 19 Apr 2024 17:09:32 -0700 (PDT) Date: Fri, 19 Apr 2024 17:09:31 -0700 In-Reply-To: <9d3c997264829d0e2b28718222724ae8f9e7d8b4.1713559768.git.jpoimboe@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <9d3c997264829d0e2b28718222724ae8f9e7d8b4.1713559768.git.jpoimboe@kernel.org> Message-ID: Subject: Re: [PATCH v4 2/5] cpu/speculation: Fix CPU mitigation defaults for !x86 From: Sean Christopherson To: Josh Poimboeuf Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Linus Torvalds , Daniel Sneddon , Pawan Gupta , Thomas Gleixner , Alexandre Chartre , Konrad Rzeszutek Wilk , Peter Zijlstra , Greg Kroah-Hartman , Andrew Cooper , Dave Hansen , Nikolay Borisov , KP Singh , Waiman Long , Borislav Petkov , Ingo Molnar , Stephen Rothwell , Michael Ellerman , Geert Uytterhoeven Content-Type: text/plain; charset="us-ascii" On Fri, Apr 19, 2024, Josh Poimboeuf wrote: > CPU speculative execution mitigations were inadvertently disabled on > non-x86 arches by the following commit: > > f337a6a21e2f ("x86/cpu: Actually turn off mitigations by default for SPECULATION_MITIGATIONS=n") > > Fix it by replacing CONFIG_SPECULATION_MITIGATIONS with a new generic > CONFIG_CPU_MITIGATIONS option and moving the x86-specific mitigations to > a separate menu which depends on CONFIG_CPU_MITIGATIONS. Ah drat, I didn't check my mailbox until after Cc'ing Linus my own version[*]. I don't have a strong preference between the two, though I do think it's worth nothing that this will (obvioulsy) allow disabling mitigations at compile time on all architectures, which may or may not be desirable. [*] https://lore.kernel.org/all/20240420000556.2645001-2-seanjc@google.com > Fixes: f337a6a21e2f ("x86/cpu: Actually turn off mitigations by default for SPECULATION_MITIGATIONS=n") > Reported-by: Stephen Rothwell > Reported-by: Michael Ellerman > Reported-by: Geert Uytterhoeven > Closes: https://lkml.kernel.org/r/20240413115324.53303a68%40canb.auug.org.au > Signed-off-by: Josh Poimboeuf > --- > arch/Kconfig | 10 ++++++++++ > arch/x86/Kconfig | 15 +++------------ > kernel/cpu.c | 4 ++-- > 3 files changed, 15 insertions(+), 14 deletions(-) > > diff --git a/arch/Kconfig b/arch/Kconfig > index 9f066785bb71..5c96849eb957 100644 > --- a/arch/Kconfig > +++ b/arch/Kconfig > @@ -11,6 +11,16 @@ source "arch/$(SRCARCH)/Kconfig" > > menu "General architecture-dependent options" > > +config CPU_MITIGATIONS > + bool "Mitigations for CPU speculative execution vulnerabilities" > + default y > + help > + Say Y here to enable mitigations for CPU speculative execution > + vulnerabilities. > + > + If you say N, all mitigations will be disabled. You really > + should know what you are doing to say so.