Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp352344rdb; Tue, 5 Dec 2023 07:14:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IERjKTyExeJjalB0zetxev70q1cPT+7473+X/gDiGFA9nI5KZqDueI277UgnhBe1uJw8wnD X-Received: by 2002:a17:902:ee44:b0:1d0:700b:3f6a with SMTP id 4-20020a170902ee4400b001d0700b3f6amr1760449plo.36.1701789294906; Tue, 05 Dec 2023 07:14:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701789294; cv=none; d=google.com; s=arc-20160816; b=rmIYqXon3Oro5JtJgrCJa561uuHeDFl4A54VMoTc7h0phWqSdeliqVXVcsD9MD6Oyp 3pOAtxVcBM5p4GrNKhqyexdE51RkHhpSJqwyl8WyinCfq0Y9m1IEfSt84CtGsoTIpVKc /EBSn36yEt7VdXxXO2CKdwq3tqchbfySXqxvukYDMDF7AeQt2kXohCGhgIL0Fbfq8LKl 3w7Oy10o38dlttY17Z3La95sGLY4jPvG4v8Fu8x6O1bvJcNa1qN5srOkDBEp5uLqgYcc 1eE7vbYYoHbMzqO3ghetmlwJ5ZdsErPbLikHH6S/Vz/xMVbolaMeO4dononmkPT54b+m 9Agw== 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=3QzW85cwS+XFkSURmdz+7COskA0eYzBwaIJQVp8urv8=; fh=mypGTL4gp7XugDmSg13w/lo2s65Hd0jynOduH/Ep6FQ=; b=0dfy9sq8gAmSlcF+mLQZz7Gf2zXHb+4jQohAtB2UERTzOiU6WRhTqagSdryajdhYKs cUrnrn3D0A4ywnmLaBtw37lutYHyHwkbPdDld/t7o4w5mxcU03W5nJYHvPykMcLnUTvE wxV9P6txO3hysT/V711pqhzzVktHGS9EGFGvNk2En1c4Cy/+VqQUguouxg2cJ7IQleUM OvdI8DPlsCsS6zdHvgOwlLeefPpEmJ9dUHSdOg+zHVcU8A7o4qhuhya7PMrcfJEVLuEe SskTE0uiTOL4AyikBqki1mKex+Pzyogl167daCDvcNl6GG6ymsd4ggg6QiL9dxDCfh5G sSZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=nVF77N2I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id e187-20020a6369c4000000b005c5e276b55esi9452603pgc.441.2023.12.05.07.14.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 07:14:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=nVF77N2I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 74C23803BA82; Tue, 5 Dec 2023 07:14:52 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346029AbjLEPOi (ORCPT + 99 others); Tue, 5 Dec 2023 10:14:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346031AbjLEPOg (ORCPT ); Tue, 5 Dec 2023 10:14:36 -0500 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2577BF for ; Tue, 5 Dec 2023 07:14:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701789282; x=1733325282; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=rWhM9A7WpcEtY4eQ9VQUlvS9vCQ5mG2Y67yAqwJoeew=; b=nVF77N2II/LlA0hM5lZxCR8Ej0cK5Nq79YC9EFjeOKL2ZQRN7Yo3QJIv LCHNAcezV+W464ZI0LgUp5EUMKMhKsy2k3y/btAlgS3PUSUQ6b6fpjOMt EjzFmN/ieY/RWCJVR427xAoZGOL9+VhmlMhofq2VlgLiWI3jI94PinRHn M4c/F4XXcKJBFNk8P0Nj1cl18x5JE6P9oXfQOGBf2ywdHq3R0n9IwKPQ6 94HQGhtlaOFOboOMXCBXvScPPJF9jFIU7TXMBf/mlmwaMuajGNrcOxZIk UURGBkA1Nau0mNdcZIpK17vfVCepZ8n+t2Z908nikADCtY2AH4P112H2g A==; X-IronPort-AV: E=McAfee;i="6600,9927,10915"; a="460393561" X-IronPort-AV: E=Sophos;i="6.04,252,1695711600"; d="scan'208";a="460393561" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Dec 2023 07:14:42 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10915"; a="774661313" X-IronPort-AV: E=Sophos;i="6.04,252,1695711600"; d="scan'208";a="774661313" Received: from rjongalo-mobl2.ger.corp.intel.com (HELO box.shutemov.name) ([10.252.46.235]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Dec 2023 07:14:39 -0800 Received: by box.shutemov.name (Postfix, from userid 1000) id 1EAE910A43A; Tue, 5 Dec 2023 18:14:37 +0300 (+03) Date: Tue, 5 Dec 2023 18:14:37 +0300 From: "Kirill A. Shutemov" To: Borislav Petkov Cc: Tom Lendacky , Thomas Gleixner , Ingo Molnar , Dave Hansen , "H. Peter Anvin" , x86@kernel.org, linux-coco@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH] x86/coco, x86/sev: Use cpu_feature_enabled() to detect SEV guest flavor Message-ID: <20231205151437.aqmuydosfmnq3zr4@box.shutemov.name> References: <20231205143738.2875-1-kirill.shutemov@linux.intel.com> <20231205144619.GCZW83uzAomKmupn7j@fat_crate.local> <20231205150012.6lma2wzcellr7pz7@box.shutemov.name> <20231205150648.GDZW88iAjBzYoIJ0+o@fat_crate.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231205150648.GDZW88iAjBzYoIJ0+o@fat_crate.local> X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.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 (lipwig.vger.email [0.0.0.0]); Tue, 05 Dec 2023 07:14:52 -0800 (PST) On Tue, Dec 05, 2023 at 04:06:48PM +0100, Borislav Petkov wrote: > On Tue, Dec 05, 2023 at 06:00:12PM +0300, Kirill A. Shutemov wrote: > > I don't think cc_platform_has() is the right check. On TDX side we use > > X86_FEATURE_TDX_GUEST for this and it works better than stretching > > CC_ATTRs beyond their meaning. > > You don't think it is the right check because you do something else on > Intel? > > I can't follow that argument. My point is that if you need to check for SEV you need to check SEV, not CC_ATTR. CC_ATTRs only make sense in generic code that deals with multiple CoCo environments. -- Kiryl Shutsemau / Kirill A. Shutemov