Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp2150294lqe; Tue, 9 Apr 2024 10:51:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCURYmd+KNNLL8SQ72SdlKFOjIu8ubbJ+9Z3dvxXmScLvyXa+s15knPrIE3mX64rD0vqw6tJySS6+mf6nH2Wqx1qppMhI+8jhObg79tAJg== X-Google-Smtp-Source: AGHT+IFGzAtXBemxZSAzQJlBMaexK2VVtW0J9UwblLEmtGMWI5lNdFCSw4qKoVgBVA0q6iwHuJVh X-Received: by 2002:a05:620a:468d:b0:78b:ea9e:453b with SMTP id bq13-20020a05620a468d00b0078bea9e453bmr5423199qkb.34.1712685089419; Tue, 09 Apr 2024 10:51:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712685089; cv=pass; d=google.com; s=arc-20160816; b=oSjy2TMZ7hVs7UvgcH7MswDLWs8KAdemWjkSRjmNwdaS23cntw0jcssaNl+KXJc+FW hwEKDKkiKpeAwzvFTflJFJIgcdqaIwttvNirCCfB81khzsKmv0L5qQYyPkLLtxK3etl4 wIRaG49WB2fqg2yxZY2g/M3KRoDBhognV4bZiuMUWVlfdAasRVJPvElgUjp72qUbJ2xS hxoPm/Bgqc3RYTbcTPTeek8xPJF8LNKeP1dXV6vje93qJeyhWl7tqKB2xUMHxXrPg55E oSI3QRWf/Kx+hGZbWIImVMC6TGYw6BKpHvLbvySbl7tO8erDrXSpg+RcXRJsQsJJUQ+G 8rgg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :in-reply-to:date:reply-to:dkim-signature; bh=/vL198wTn+Uk37UUg6mX+X5B2xDFF41dQr7U2AoMPZ0=; fh=bLV7G7m3HasIhKFiR8O0ivt8vkQ2ft2x8i7XvhxnhFQ=; b=c3KhmRABjpA/6zmkFsRokyIuc1bNvDWighKEIandxhUqVKWrwyN4A2Xvbg9lDGCiKM IqaU1ryEI2Rtnws5d+nAx/5sulIFMP3erOH/OLIXNUeBFnfQQF28FTvM6SWYdLgdx+or PEr94dsX0WKPBZcKXwpGfL0icaIF7bO5Vkhuiv2iQOVruAplS7sONKFmVA3U7TLemBjd 8qip3aD2gwuSNH+3AY68Q228IHUDFG5EZLP7PGbRnjvszC205vNDhmyxhZqRCNj9EihV cZ4N5ScY0N1GwwSZX8/VUqwLpacH4x85px8vCKijBnjOf7fCnYYljCy4EUhFuGqHFBAo IXfQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=iZ6RqVLR; 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-137424-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137424-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id sq11-20020a05620a4acb00b0078a45419694si10358954qkn.467.2024.04.09.10.51.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Apr 2024 10:51:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-137424-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=iZ6RqVLR; 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-137424-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137424-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 209061C21C87 for ; Tue, 9 Apr 2024 17:51:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 72DF915699A; Tue, 9 Apr 2024 17:51:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="iZ6RqVLR" Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.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 31C59156866 for ; Tue, 9 Apr 2024 17:51:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712685074; cv=none; b=GHDRynp1WTRzCHsZlShQAaNnEa5nfWF4iwgzaz+C03Y6TBB1PyRQGJPf3hlIyQFveYTYqclXvLHXUnGx2Tb63PZLO+hj/Tverewqs4tyQEpCiJeyDbDnruhGZdTYxSI4NHFDW2MRVB7XGonnHmleCzoBkx274R9/hEybycbR+pI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712685074; c=relaxed/simple; bh=s2tc144aBgNbfS3s/tihGdBDGVdjaSbfQ+SMtFuveA0=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=p1SyUohIsEh7EYt4yEvNtLpgJfuDZpMn2bxsDRvGuO2kUNXXSM9N0pjyVIoXXLmfQpBlxeP7tsNjp89zNvLzxNGFxxGrgqoNeIKjf0Ee3uS4o4zZY4aNo2OXzeSflQPutr0kOGA6WBKGr1pzmsa8C33bbcjZTUs2iWH+0Gy33tE= 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=iZ6RqVLR; arc=none smtp.client-ip=209.85.128.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-yw1-f202.google.com with SMTP id 00721157ae682-6167463c60cso66825867b3.1 for ; Tue, 09 Apr 2024 10:51:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1712685072; x=1713289872; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:reply-to:from:to:cc:subject:date :message-id:reply-to; bh=/vL198wTn+Uk37UUg6mX+X5B2xDFF41dQr7U2AoMPZ0=; b=iZ6RqVLR8jrY5bVAUNJRGENQq2blNMurn4IYjP67hksPv3HrFsQ75oZ3tHBUorGCwS 2CxkLbEfy1iEgqpXcMbC2J+f4Rj58jweu0OvAljFu29ig2Yry2oi3pipyqWqip3bB0sL 2xyXKAvcPNnjAwaWf254RKGECXXg2xWFgceKA7eqOAgmdLiNBrbJ/HeLjbHc6I/jq02n owK87ZZ2KPD4DoBljFPtmspGt39bAmf7ZR/Ka+p1oJsTF/SrN4kgVFm6Kd822Fb3RyUS UHBRX0pJb8k2ra5JZWqgbOANyf8izTBwsaJUXtCKA56d7BP4E8xMClr68GaCWpo4sLol m8wA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712685072; x=1713289872; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:reply-to:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=/vL198wTn+Uk37UUg6mX+X5B2xDFF41dQr7U2AoMPZ0=; b=Z2zpQITWgosyQilG8brHah0gLyBIlN7kjmjFBAOI78iPjCj8oarQTMz0Vgy5loEbVo Ug4+b9egizzQeD6jTukSr5BsaZvzcCx+XGbmTGK60eFcs62uPqJPWgKcWwrI5GK5AIeZ S+VIlNHze2zD8peHiYqbjvVt9qr6VfCjJop0lJAd8FPPxjCAvZthwfBRPHnhH78Gjv7k PMdBQblrajuTzatw/NxMxjRyDaX02fDBB/gklaeEw5FvDDXoh7qUXqGCvwjPAIlxKWcC Xdc/Iw73bFfYIWpP1TLxk9xCm8T98uupSqJ+lMVHO5a5m7vj2fFNlkbsuQ7r2+Kio9/k ztCA== X-Forwarded-Encrypted: i=1; AJvYcCWVBl7RxVF4PbTQesv1LLAc0hUaZqXVHs9juAZzzDEE9atK7G5OMdZX20OjmitmjlMLyH1R4ynEV3BvYNTHNdc/RYM3NMUe+MYaG+8s X-Gm-Message-State: AOJu0YyGY5ij44g4cP06SFPfngJF4yVAmtq88QF0t+z9D7sPuYiBgiP+ 8dzjQb6IpU47dMY+AtjPf7XueXAX62nkr8qBQJogt+P9RVNRLzbbXmGJZj5Gi4pgcPz9nI10eTW mKg== X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a81:a002:0:b0:614:2a7d:5ad3 with SMTP id x2-20020a81a002000000b006142a7d5ad3mr819172ywg.0.1712685072337; Tue, 09 Apr 2024 10:51:12 -0700 (PDT) Reply-To: Sean Christopherson Date: Tue, 9 Apr 2024 10:51:05 -0700 In-Reply-To: <20240409175108.1512861-1-seanjc@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240409175108.1512861-1-seanjc@google.com> X-Mailer: git-send-email 2.44.0.478.gd926399ef9-goog Message-ID: <20240409175108.1512861-2-seanjc@google.com> Subject: [PATCH 1/3] x86/cpu: Actually turn off mitigations by default for SPECULATION_MITIGATIONS=n From: Sean Christopherson To: Jonathan Corbet , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, Peter Zijlstra , Josh Poimboeuf Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Sean Christopherson , Pawan Gupta , Daniel Sneddon Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Initialize cpu_mitigations to CPU_MITIGATIONS_OFF if the kernel is built with CONFIG_SPECULATION_MITIGATIONS=3Dn, as the help text quite clearly states that disabling SPECULATION_MITIGATIONS is supposed to turn off all mitigations by default. =E2=94=82 If you say N, all mitigations will be disabled. You really =E2=94=82 should know what you are doing to say so. As is, the kernel still defaults to CPU_MITIGATIONS_AUTO, which results in some mitigations being enabled in spite of SPECULATION_MITIGATIONS=3Dn. Fixes: f43b9876e857 ("x86/retbleed: Add fine grained Kconfig knobs") Cc: stable@vger.kernel.org Signed-off-by: Sean Christopherson --- kernel/cpu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 { }; =20 static enum cpu_mitigations cpu_mitigations __ro_after_init =3D - CPU_MITIGATIONS_AUTO; + IS_ENABLED(CONFIG_SPECULATION_MITIGATIONS) ? CPU_MITIGATIONS_AUTO : + CPU_MITIGATIONS_OFF; =20 static int __init mitigations_parse_cmdline(char *arg) { --=20 2.44.0.478.gd926399ef9-goog