Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3224759rdg; Tue, 17 Oct 2023 08:08:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGTwQfEK76QfnMi4ykHEVBxGSB5MXYlRPMFV27+PJ+8Z8a0V/JBDKq/4jfyEdz9oGcysktc X-Received: by 2002:a05:6a00:124a:b0:68e:496a:7854 with SMTP id u10-20020a056a00124a00b0068e496a7854mr2684267pfi.18.1697555339295; Tue, 17 Oct 2023 08:08:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697555339; cv=none; d=google.com; s=arc-20160816; b=NPtfrLNOggx3j5EjrAoZlmzox1yM4XkDWXdA/qu8K/rTDp1fMN52cVkPg4xxeqmpOV EZz28wr25/EnI1Ly8+KyKD7rNnHtpaI7/CEW/bv0f8fCoDnrC9lZb0IPmyvQ4/dgByeg x58pL+mxG5IA8MgqCIg6PX+H5mtIrMAfVh0u+VHjg6dzYpeBsXMhv9TW8/3cVgLmkaAa QBsIdogTUT2Ao4+XDCrhf1P5iFenyWvfiFdU1A/pJ40RFv4/ORBRmrlUX4xTOnmNWhv4 SoHCwLoGbstl7ACmqP57fwEWBb4sXaZUCVsn4RKILB4oNGQ3O5X6QVrs3CYVssPpm4Lr YKdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=/d3+rTugA3DW8t0EfmzpaNsmaGk1NkaP0v69txt+hAQ=; fh=WtXEr2Fg56QQmHyJoJMyrPTd0903keiU2O0Wp929Yb8=; b=Qo5q100UDvOCC7wll3ZEbCjNqDjBSBJPyigPmrZnud20S9s52eZ+YzhB4hORSphdIC KzbiWKmSplogZiWJImDV9VsXRE9ecehfuFRW32waXZ3kpWzrUh1/xdRYre20Mst7PbDz NgcBzIjWLDDcrh35jfSKLyVlxJVZh0G09mTO6DwlY2lsjCb0gH1SXP/yKMtYqLrp2ZB1 iCFZGQZzbzqvYi+MtVfRq9VYu/8SW4p1B8Th7NQF1xLdV/10oExBfJM/i7P0bbYss7Ho CPQIbWHZMygcG8mCJJmfaQA+Qd9NPirvTcBtfSN2utvDFwParI0VGJvtE5y9JulSD8oi uY4g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id e7-20020a056a001a8700b0068e405d9217si1847332pfv.302.2023.10.17.08.08.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 08:08:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 37E52809F3A1; Tue, 17 Oct 2023 08:08:54 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344199AbjJQPIr (ORCPT + 99 others); Tue, 17 Oct 2023 11:08:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235054AbjJQPIf (ORCPT ); Tue, 17 Oct 2023 11:08:35 -0400 Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4262530C2 for ; Tue, 17 Oct 2023 08:08:20 -0700 (PDT) Received: by mail-ed1-f54.google.com with SMTP id 4fb4d7f45d1cf-53d9f001b35so9991817a12.2 for ; Tue, 17 Oct 2023 08:08:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697555298; x=1698160098; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=/d3+rTugA3DW8t0EfmzpaNsmaGk1NkaP0v69txt+hAQ=; b=LL6FWeeXGDti5JR8H7tRru+w9DEP2dib2ddi09hxA24uD1FmzQIMNruuh9p2XpwP4r eqTJtC+KjetIW3j9el6ERD6LhvfuNh5NLiuQcXBHS9KQq/rkxPkU9St+AMWkzyaXqe2Z LJt9EUnXYQ9C9hWY3bccfniC8rzpz85jhBN5KQEkc5ac0qOSOYLf3q//ffP4EmPTjPtv XsOfaskbfJ5FiE8pwS5SRfwpP/IvowTdJOP/6Q2N23Vayh018CG3v3ZI3jmkxSlZQ/dv uf10TqGFlj2rK4tKJCShN6UvPWxxIi+3xi8BloKP4vQty+riIwfWtxbtx37AwofQ5kCn 0vPQ== X-Gm-Message-State: AOJu0Yzmjivhi+fNQ4tt3MzsSrO4lR4jTKhWVjrJmpURnq/hTmfFtnAZ CedmBztU1GIK+KWAhi7WknE= X-Received: by 2002:a50:aad1:0:b0:53b:9948:cc1f with SMTP id r17-20020a50aad1000000b0053b9948cc1fmr1943421edc.12.1697555298414; Tue, 17 Oct 2023 08:08:18 -0700 (PDT) Received: from gmail.com (fwdproxy-cln-011.fbsv.net. [2a03:2880:31ff:b::face:b00c]) by smtp.gmail.com with ESMTPSA id c16-20020aa7df10000000b0053e0f63ce33sm1331823edy.95.2023.10.17.08.08.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 08:08:17 -0700 (PDT) Date: Tue, 17 Oct 2023 08:08:15 -0700 From: Breno Leitao To: Borislav Petkov , mingo@kernel.org, jpoimboe@kernel.org Cc: Ingo Molnar , Josh Poimboeuf , tglx@linutronix.de, Ingo Molnar , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Peter Zijlstra , Pawan Gupta , leit@meta.com, "open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , Linus Torvalds , gustavold@meta.com Subject: Re: [PATCH v4] x86/bugs: Add a separate config for each mitigation Message-ID: References: <20231010103028.4192223-1-leitao@debian.org> <20231011044252.42bplzjsam3qsasz@treble> <20231011190317.GDZSbxdd5TuCIp5+JN@fat_crate.local> <20231011220325.5uje4xnfxuccumm7@treble> <20231012072920.GAZSegUJkwHbcernQo@fat_crate.local> <20231016124654.GDZS0wvqJlsf+iVAeu@fat_crate.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231016124654.GDZS0wvqJlsf+iVAeu@fat_crate.local> X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Tue, 17 Oct 2023 08:08:54 -0700 (PDT) On Mon, Oct 16, 2023 at 02:46:54PM +0200, Borislav Petkov wrote: > IOW, I don't see the particular reason for having those namespaced. But > since you and Josh care so much and I don't - not that much :-) - and > I definitely won't be doing the work, feel free. Thanks for all the discussion so far. I am summarizing what I got from this discussion so far, and starting to get the direction on where we want to be: 0) Each mitigation should have their own Kconfig entry under SPECULATION_MITIGATIONS. 1) Have "Mitigation" namespace for each mitigation. These are the new name for the mitigations: * MITIGATION_PAGE_TABLE_ISOLATION * MITIGATION_RETPOLINE * MITIGATION_UNRET_ENTRY * MITIGATION_CALL_DEPTH_TRACKING * MITIGATION_IBPB_ENTRY * MITIGATION_IBRS_ENTRY * MITIGATION_SRSO * MITIGATION_SLS 2) Split the GDS mitigation in two: * MITIGATION_GDS * MITIGATION_GDS_FORCE 3) Create new Kconfigs for the following missing mitigations: * MITIGATION_MDS * MITIGATION_TAA * MITIGATION_MMIO_STALE_DATA * MITIGATION_L1TF * MITIGATION_RETBLEED * MITIGATION_SPECTRE_V1 * MITIGATION_SPECTRE_V2 * MITIGATION_SRBDS * MITIGATION_SSB 4) Do no touch the enum order, instead use the something as the code below to avoid the #ifdefs in the code: static enum retbleed_mitigation_cmd retbleed_cmd __ro_after_init = IS_ENABLED(CONFIG_MITIGATION_RETBLEED) ? RETBLEED_CMD_AUTO : RETBLEED_CMD_OFF; 5) Make sure that there is clear messages when the mitigations are disabled. i.e, make sure that the current pr_info() we have today are called in case the mitigation is disabled. Am I missing something?