Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp149447pxb; Thu, 31 Mar 2022 01:47:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxL2IhAGqXkgAnCh+XsTD2HFcAwM3nAIwAZtx64rK6WOQOKCtT/QhQOZGpRY6d3cbFg9vNw X-Received: by 2002:a17:906:4786:b0:6e0:c7b:d267 with SMTP id cw6-20020a170906478600b006e00c7bd267mr4114527ejc.115.1648716455144; Thu, 31 Mar 2022 01:47:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648716455; cv=none; d=google.com; s=arc-20160816; b=0sIkABpI8vicYqnhz/QwCQaIJy8J19KUA+GNwHfhE6l7xwsKLM0Ln+o+unYSV3vS0L isEyo32i4moZkMXBqSZAl4rRkT2yYLoNcY92rwLSUpC2Y1Iiuxr5LwEgeEfuGHBOGSHk LMoWQr8VVrdwXIqecRgklcb5G8U/nylGAa5/1rnCcCaEfa/6zEw8krpQ3xv4c/ijpNFE rad86DRut0UYLw/UM7aSkhjWSDK3PtI6krfJwK9DbmT5wjGIG+OHdHczXJrzHvxIxCrl Vn1aOE09ACGamZnDDVGX4gLj38cZPzyB+CU/W+L3y9nzE8KLdhz8hzf3j2LfeIbQ4pyh Sfxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:in-reply-to :references:subject:cc:to:from:dkim-signature; bh=nf/qWBzUytDXbECIDDk1zTyl4OKvszb7UDH/TSEqrRs=; b=lWqgGRU70GDH1wYrwfPePyJtDofpziTjTN8rxpV15tZ15/l0ETFUwrp16sutA6+yhs kFhPAnGS6nPNed0nf1LaQfYcIyr6/lsW0jJhg89cSE4GLbENIsaBKHmlaS/KLmZUpRzt W2VSQVofrjL/PBepE370vIAgUM6BlndpD6wF5MbV0AHOEtGXgZahXuieouwyg4OvvVn5 ojEPbqIRzbHiuIJyfwbeyRROk236d8JGIRai2ieWMl+cLyHNzPCjLLcYA0jyVKbXGRYf BkNBRUQ9rYCfaaXWRnsvpwzMmlDC/CNW07KdbxX2FMcIgFuyo5prfCph8YDh6egzJO4j AHJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=iu1aarbz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d11-20020a170907272b00b006e4b402d3bdsi428339ejl.446.2022.03.31.01.47.09; Thu, 31 Mar 2022 01:47:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=iu1aarbz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232401AbiCaHuI (ORCPT + 99 others); Thu, 31 Mar 2022 03:50:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229924AbiCaHuH (ORCPT ); Thu, 31 Mar 2022 03:50:07 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56ED31EDA39 for ; Thu, 31 Mar 2022 00:48:20 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: rcn) with ESMTPSA id DE82D1F46109 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1648712898; bh=dKukK4EBMwxE2myPn4rShH4hfKp0m6xFnh6R3X3W3b0=; h=From:To:Cc:Subject:References:In-reply-to:Date:From; b=iu1aarbzkBjGD81V2pMM9JRRUx0OzSDknx+bsgdZuaMwhNmXWgA355oXZGFb5l82P Xrv/9F0c6hf4lS56XDS0vC3VFouBipEmW0Wsu55CpXD9MSQCFHIBDjc5MCuKbFXEEH bNQHRWqubyoU3gV8i4ksD3FQEjl/mcz2bOfZi8DsTMwSYpmlEL+r7yS1Uvcu51OvRp 5i+dMKRY9kHXL+XZJArvo+zdiZJ6vp/pWjZk/h/H1DcYVzzxYK0t3bZfi3iocoZPNu 5HrAZNslIWBp6CMSd8g0p57iqqX3Pt5Ls8D6Xksv4pmy9Q9rYYzhwslwnRXqeWTjIj Kbk+U3l6aIHFA== From: Ricardo =?utf-8?Q?Ca=C3=B1uelo?= To: Borislav Petkov Cc: linux-kernel@vger.kernel.org, Thadeu Lima de Souza Cascardo , Mark Gross , x86@kernel.org, "H. Peter Anvin" , Ingo Molnar , Thomas Gleixner , John Johansen , Steve Beattie , kernel@collabora.com, Pawan Gupta Subject: Re: [PATCH v2] x86/speculation/srbds: do not try to turn mitigation off when not supported References: <20220330082026.1549073-1-ricardo.canuelo@collabora.com> In-reply-to: Date: Thu, 31 Mar 2022 09:48:14 +0200 Message-ID: <87o81mzhoh.fsf@rcn-XPS-13-9305.i-did-not-set--mail-host-address--so-tickle-me> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Borislav Petkov writes: > So we could also do the below to denote what the situation is and > therefore clear the bug flag for such CPUs. > > The thing is: I want this to be as clear as possible because bugs.c is > already a nightmare and just slapping more logic to it without properly > thinking it through is going to be a serious pain to deal with later... Thanks Boris, I agree that the more explicit the better, I'll give this a try. I saw Pawan's suggestion as well but that one is similar to the originally proposed patch in that the logic/checks are split between two functions, this solution based on clearing the bug flag seems clearer considering the comment just before the code block: /* * Check to see if this is one of the MDS_NO systems supporting * TSX that are only exposed to SRBDS when TSX is enabled. */ Cheers, Ricardo