Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp559360rdg; Thu, 12 Oct 2023 13:44:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGGgve8oRlqNZvjlcVt6fIlJy+WhCobsYhmnxrzQNlRDATX6XAmXPbJ3S8o3v/86bNiYTV8 X-Received: by 2002:ac2:44af:0:b0:505:7ac4:239 with SMTP id c15-20020ac244af000000b005057ac40239mr18432186lfm.1.1697143454683; Thu, 12 Oct 2023 13:44:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697143454; cv=none; d=google.com; s=arc-20160816; b=t+MVSf4Ouedzqvdc2la9hfkZMZ5lzbl99ivSK0S9tNlXMOnnMAKblyZomk/AS44du7 zX5JxShJ1n0J2pvULaymFRw2wkf6yOFZ/dBiT+TXafhc0bo/kjDV62bp6Svw2yTrylMO C+a90Q8Ia41kPqvN3uGSvur45f/4lYty6Ro1BCxeYJND+Cvip57GjbCz+wftU/nEdHQ/ CRDMy5+/PP5+0RYkTY002etst4wwbPiyQHzrJ1jVPKNZ2o/UIlqo/S9E4kI7B2RHMtDt ZBJKFAoTnH2r5EUay7u8USsfEnGq6A8Tn7caAheizd5dtyennEHs1mPl/GHrawjoFV25 fImQ== 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:dkim-signature; bh=v8ksWphjonliXA8nxLgvYkvxslr1eWaINRzuFrsJfhA=; fh=ZX/Oy7MD3c04GUTZ42O9/FGc0/XhwpKeKJgqQzkb4Ss=; b=lbgE54nHeAaf10FJY8ENwzHLxaayJK9pFReSN1cDMCIzEnU32Y8y+1t0pE8h7TX9r0 nvWI3PZ35gf87U/dhZ+d3v+xtxcrKqjuk/mS+/Ekl4tCTs3FQqhRO7Fpl98ydeiQA5d0 Xp1uPbgjJSk6KNjaI27dzEbNVXWVI1OagMiXZjTJ+CzU/Om1ACpo1sUMmqGKNE1g/jsb vwpqmGeTThGPhgJu6KflENOBj1P2va/2bwpNqnCeafmiweGg+fJvNKepu2193K5yFwfj b+jJl295B5xMLEXDghFEoEMhDe5ILiADL+RY5adYZmRIcRBh4MfcA6FJ0x5bixXSaJxv Fvhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rnhjuxLA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id e6-20020ac24e06000000b0050797ce8b14si418740lfr.590.2023.10.12.13.44.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 13:44:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rnhjuxLA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 3493681D55F5; Thu, 12 Oct 2023 13:44:11 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442682AbjJLUnw (ORCPT + 99 others); Thu, 12 Oct 2023 16:43:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343782AbjJLUnv (ORCPT ); Thu, 12 Oct 2023 16:43:51 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F40DC0 for ; Thu, 12 Oct 2023 13:43:50 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7388FC433C8; Thu, 12 Oct 2023 20:43:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697143429; bh=1qxJg5+j9FJGAfywTfM++up5rCZnKv8AEAHUzemY4yg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rnhjuxLAXn08gU7SSWiaXeSQ/z40RDPINScZOQUn+20Z9DUUmXFf/THtAab3m3nmf r37qxmYeB8UeoMrO4ljLr/FHX/xrjZJhNZ8hT84NxmkZ0WYbF2xDS5pYLowofABtSF NTcxbMXDsuyLND8FICU3XacuSAFv+r8gFj9yOkIM6Ndt5neWKvwdw/waAm09SBssWu 54T6n4a3noGyYlAW1S2OZ6ZP/fTN2NUkiYgVh/H+SxGG5E/tlFOqhS1It0qkOZLGou OR59fXT0SypmpJzz3lwfXT3fox3vvR+MjBZNAEstoeGxwPx1BXlYMEyCRN9X6Y9A2/ QD06Tsc1gDbcg== Date: Thu, 12 Oct 2023 13:43:47 -0700 From: Josh Poimboeuf To: Ingo Molnar Cc: Breno Leitao , tglx@linutronix.de, bp@alien8.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)" Subject: Re: [PATCH v4] x86/bugs: Add a separate config for each mitigation Message-ID: <20231012204347.4aei5jr64fsv2iv5@treble> References: <20231010103028.4192223-1-leitao@debian.org> <20231012170548.o5vi4kgpvpjyld7s@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 pete.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 (pete.vger.email [0.0.0.0]); Thu, 12 Oct 2023 13:44:11 -0700 (PDT) On Thu, Oct 12, 2023 at 08:51:24PM +0200, Ingo Molnar wrote: > > Another way to avoid ifdeffery: > > > > static enum retbleed_mitigation_cmd retbleed_cmd __ro_after_init = > > IS_ENABLED(CONFIG_MITIGATION_RETBLEED) ? RETBLEED_CMD_AUTO : RETBLEED_CMD_OFF; > > I think we could make it a simple: > > static enum retbleed_mitigation_cmd retbleed_cmd __ro_after_init = IS_ENABLED(CONFIG_MITIGATION_RETBLEED); > > Because RETBLEED_CMD_AUTO && RETBLEED_CMD_OFF maps naturally to 1 and 0. > Maybe add a comment to the enum to maintain this property in the future > too. Hm, that both obfuscates the default and makes it fragile. The fact that it would need a comment to try to prevent breaking it in the future is a clue that maybe we shouldn't do it ;-) -- Josh