From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 16F23C4332F for ; Thu, 9 Nov 2023 22:44:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230162AbjKIWoC (ORCPT ); Thu, 9 Nov 2023 17:44:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229587AbjKIWoB (ORCPT ); Thu, 9 Nov 2023 17:44:01 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72E873C2F for ; Thu, 9 Nov 2023 14:43:59 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A19D4C433C8; Thu, 9 Nov 2023 22:43:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1699569839; bh=J7Z1TIeSL+ecHsL867EqIQu1HuhYiRqQAIyQZP57BDY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=H3ZU15IwNxgEt75cYUU2e9Ny1xKFm4B8BJolByRNzxsrKvuIbIZ4W/NuC3X16+uPS DlF88cCYEnoar75dAwN4bUdaiEB+u7gL6igwBjb9m81aiy2sEglvhhoFbi47j0pujJ /rOUexJhy0q8TOXx+weSvZEchj6u/om3lfQpDo6yGojAUnOrcOJqcgupDFyz32+3LY LBVF1vxCKZlWsDPecTUkdi51ixdB+5U9XLx4YQokXZQovNk+OjL1rNen4y1hgqDeIn W/0fktVWg7aTuGbzZI0TCGrVIeVLEUQtxxqNyrjsUrm0yp8MF2jmkrXoZDkY1uEEIX 5kL7GuuB0jriA== Date: Thu, 9 Nov 2023 14:43:56 -0800 From: Josh Poimboeuf To: Breno Leitao Cc: mingo@redhat.com, tglx@linutronix.de, bp@alien8.de, Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Peter Zijlstra , Pawan Gupta , leit@meta.com, "open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)" Subject: Re: [PATCH v5 12/12] x86/bugs: Add a separate config for missing mitigation Message-ID: <20231109224356.diks3jws5ezfldzy@treble> References: <20231019181158.1982205-1-leitao@debian.org> <20231019181158.1982205-13-leitao@debian.org> <20231025162906.abnyb7xum7cpjwxy@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 26, 2023 at 10:09:17AM -0700, Breno Leitao wrote: > Hello Josh, > > On Wed, Oct 25, 2023 at 09:29:06AM -0700, Josh Poimboeuf wrote: > > On Thu, Oct 19, 2023 at 11:11:58AM -0700, Breno Leitao wrote: > > > Currently, the CONFIG_SPECULATION_MITIGATIONS is halfway populated, > > > where some mitigations have entries in Kconfig, and they could be > > > modified, while others mitigations do not have Kconfig entries, and > > > could not be controlled at build time. > > > > > > Create an entry for each CPU mitigation under > > > CONFIG_SPECULATION_MITIGATIONS. This allow users to enable or disable > > > them at compilation time. > > > > > > Signed-off-by: Breno Leitao > > > > We also probably need a CONFIG_MITIGATION_MELTDOWN. > > Isn't Meltdown covered by the MITIGATION_PAGE_TABLE_ISOLATION Kconfig > entry? Would you mind clarifying what would be the difference between > CONFIG_MITIGATION_MELTDOWN and MITIGATION_PAGE_TABLE_ISOLATION, and why > do we want CONFIG_MITIGATION_MELTDOWN? Ah yes, not sure how I missed that one. > > > + cmd = IS_ENABLED(CONFIG_MITIGATION_SPECTRE_V2) ? SPECTRE_V2_CMD_AUTO : SPECTRE_V2_CMD_NONE; > > > if (cmdline_find_option_bool(boot_command_line, "nospectre_v2") || > > > cpu_mitigations_off()) > > > return SPECTRE_V2_CMD_NONE; > > > > I'm thinking CONFIG_MITIGATION_SPECTRE_V2 should also affect whether the spectre v2 user > > mitigation gets enabled. > > Makes sense, would something like this be enough? Looks good to me. While you're at it, for consistency can you add a cpu_mitigations_off() check to spectre_v2_parse_user_cmdline()? -- Josh