Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp868471rdg; Fri, 13 Oct 2023 03:51:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFznx3qTdfmSupOWqW0+xICyz3FlFZf3CT3VvyX6HNQ28QCh/I0/TQAoRBGeycTOLxcXUHe X-Received: by 2002:a05:6a00:2e96:b0:68b:c562:da65 with SMTP id fd22-20020a056a002e9600b0068bc562da65mr28039178pfb.26.1697194279851; Fri, 13 Oct 2023 03:51:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697194279; cv=none; d=google.com; s=arc-20160816; b=lzYpRmmECpvG21Hd1QW8F/KP4I+HIMh0vKiB+Gi5IB4KRblP/aZXyPv2v6NDxjacfF L4UTkJyDuc1mXO1Vjq6tCZcBRjavsMNV63z8HgrBSxQcTL4xlvOdbJx0OvKJq6SfUxhe G2rB0iqxnD1r3Fi6br5KfhekTzZFYmQDChS+p45RdLOpcF2bh6ljUUiGt8OPjD/iRbRq jK9kVInMzUtpqfYjAneqoJdGjYesK4frkPaGB3RRfBSXg0PaI5wR0DVCeWk56jMXIoHw hr27f6f9z/0qpu19qwfp7o0S+kaEguA7H/lUQNBqSRkhwn7esuwrWjpIdJmexm1H4Op9 WzMg== 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:sender:dkim-signature; bh=6kip9DJFTL9bMNWFq3/LHE2ELIE/tSjyhKv8w3kgG/c=; fh=5/TW4ncCl/mUG1h0jOoW+lm+AQSMNpV2YG18iUwSy9E=; b=yoJ0lFaChb1TEzTswv4e99tR9TAyVNAeDejmxL5T3eJojOP3phoXEZhJJPqwd/K/0X ZT8K5DnbkYsFTsyAIke74j9R8JrXsjhhdNAEsrseNAARtbqX9lsH/PL9V9HTmrV6mYkC CTiEjSzsv5ESuWeXnEcf9jW5MoaRFH88IsNnVLxo12znrzOTcu0k9qalpt9GhSs/kVav vQMuAtrJa3tGQS/eJv2Abx8RprOM8YsuopsIgxsoliwHHfuMP+4bGWvYNzvb2pUUzMea hXyXHvD4TXtzXByuGtGkgHyFmcosGcqFGn7IcUtr0x3B8e/t0liPsFxIC0utAJuEPehX l92Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=J6qkJJf4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id r69-20020a632b48000000b0057751b7788esi4391393pgr.488.2023.10.13.03.51.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 03:51:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=J6qkJJf4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (Postfix) with ESMTP id ABC3B826A053; Fri, 13 Oct 2023 03:51:17 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230358AbjJMKvI (ORCPT + 99 others); Fri, 13 Oct 2023 06:51:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230323AbjJMKvF (ORCPT ); Fri, 13 Oct 2023 06:51:05 -0400 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F478CF for ; Fri, 13 Oct 2023 03:51:03 -0700 (PDT) Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-3231df054c4so1621211f8f.0 for ; Fri, 13 Oct 2023 03:51:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697194262; x=1697799062; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=6kip9DJFTL9bMNWFq3/LHE2ELIE/tSjyhKv8w3kgG/c=; b=J6qkJJf4V/KMSQSOgW14oB3AWsJldtN+hCDJwxVH6/nO2O2YhXpIcqaBukFYWNKoj0 MQK/Z7N/TnnSkJZ5EW+O8Jf07ghJi5in6vDfHXYQmY96waMMJvivwMNJLRbFqN0GUwiw hg/g2PYzny+kD0iIOMIbTmdV8VvK/RWtEmD4mMctJSEnLLcw/nPRM1wzaKyQYGw4ztsA WV8gJ58LMAFgbr4iI+JNQWtvMUzPOmWA0NlDYOSROGXurluN9fFnUpo0j8iG8QCIU9n3 JAZj3UcAhgC7snnivCOsi7qFZ+DgsYDCqIktNVd9NRn+U1ZhX1qZ7LgAMYQHfvUeFC/b 7p6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697194262; x=1697799062; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6kip9DJFTL9bMNWFq3/LHE2ELIE/tSjyhKv8w3kgG/c=; b=rMimJdGiBVsjSWvV2drH+lUMZ1lJSt/kSgXXggqOBTyD1uMN5/gEDcgKaUT3bf5x5Y 35JqSFiFybNgFKc/Vs+3Q1tjFvdYWthDkB51NAcb9z0Dw85LAhUXpAgYckxjFI0aG+wU inkrR+Vfbuotos828L5z6VG0x+E7Jf7fcQ63LjGdx5fE59uH0Ac/MgsIcfkUPakx5cSc tMjRaDB34FbndMJaWp1DVhLoMmvCP6ysFwdxP2q3bEuT+rPnEbYcaCSe8mJaUrAOZQkv n+iExVSnWrQOgXHR+JOXzZ8seDYM1VP+iEf1pPerboKXOO6bVWgmr7B+cTu3RHYOgrSa CGZQ== X-Gm-Message-State: AOJu0YxxwA9Q2WbnHvDPctO1xDca7wDv4/vxkLEOjR/FcrfRBp6QKRXY JlxwpP+b0dRA+uHeqkeKzQuZYgUXHXg= X-Received: by 2002:adf:fb0b:0:b0:31f:c1b5:d4c1 with SMTP id c11-20020adffb0b000000b0031fc1b5d4c1mr21424542wrr.35.1697194261742; Fri, 13 Oct 2023 03:51:01 -0700 (PDT) Received: from gmail.com (1F2EF405.nat.pool.telekom.hu. [31.46.244.5]) by smtp.gmail.com with ESMTPSA id v9-20020a5d6109000000b0031f3ad17b2csm1522231wrt.52.2023.10.13.03.51.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 03:51:01 -0700 (PDT) Sender: Ingo Molnar Date: Fri, 13 Oct 2023 12:50:59 +0200 From: Ingo Molnar To: Josh Poimboeuf 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: References: <20231010103028.4192223-1-leitao@debian.org> <20231012170548.o5vi4kgpvpjyld7s@treble> <20231012204347.4aei5jr64fsv2iv5@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231012204347.4aei5jr64fsv2iv5@treble> X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, 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 groat.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 (groat.vger.email [0.0.0.0]); Fri, 13 Oct 2023 03:51:17 -0700 (PDT) * Josh Poimboeuf wrote: > 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 ;-) Can be enforced with BUILD_BUG_ON(). Thanks, Ingo