Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp494027rdb; Tue, 5 Dec 2023 10:53:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IG5W0K4upjKgypO41h3LTWcCgy4/r2wERcxQBq6XsD133OylO3gprPMivT4DFCHQd5SpsxW X-Received: by 2002:a17:902:da82:b0:1d0:c345:c1d7 with SMTP id j2-20020a170902da8200b001d0c345c1d7mr1893140plx.77.1701802390806; Tue, 05 Dec 2023 10:53:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701802390; cv=none; d=google.com; s=arc-20160816; b=qDKSMy+1/lOSHkzsE3rUNRHL2NlQa5ZloelDrdr+h+mVIuThQK8BDpm8egB/5SGAF7 Sv/CUoizTDztTIIrY+2rowNDO1gYDh5U/7XS3E5bW1zHMy+gr34k6Vf1Puc9Ekbr1VXl lUaTNLfwRKjrrcvIKzzKB0A5ln0GX7T5hEceba3MRu1Q3fGb8z4m1myoPCUGsVsUm6c1 be24QEPrPx9lW+UbP0xRhuzDS3C/R/8JisNDX5dl9zBiV4jYM4G5fvWrnisSx6M4Zyif eg0hOY6avhH/Ukz4EltGj8Nkk2/SNmPqUnHCbeKNzusUBIbzMp/7/HreRzHjfMGeU/wC s89A== 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=COpgCkikT3z+JRnd2ns06QRSDfXH8wlW9tuJ0ai1Q54=; fh=j/FlFT3AFBrfyd4b6/GF0zOfkjD/Y07yr8XvngdfZeM=; b=xVFEb7cU7tr8dBjmcy8glzkkt50Grb//cvJ++0IkG8y1UMgu6lMWrFbjzY9ElFy4hO guE04hNZe5XQ1cJTblrMv8DIu6jjgNG3UpKEMKfv6pI7ss5EBinreg54QDFOKW1Uv+uD lKKVgBm115FdoT/S+O3YoHH2/pWOEQJQemAFmX5nK9rsADrHGih7L4FfgrqnFjV851bG Ar2QmAExCvGmHK3Gv4g8n1JHIy0z67n97VkJG2TjySFpsofU/U2BZt1spqYsDvwdmK/A Mg3p2IySnJjEPvGNqg/KakJHSuD2ldKKHTlIm7m/rOYTZjVt8xpZJSbGHm6+AosXZ6WH K/Vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=alien8 header.b=L2LDMDZg; 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=alien8.de Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id t13-20020a1709027fcd00b001d0bf633564si2113758plb.243.2023.12.05.10.53.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 10:53:10 -0800 (PST) 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=@alien8.de header.s=alien8 header.b=L2LDMDZg; 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=alien8.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id BBC45804EE45; Tue, 5 Dec 2023 10:53:07 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230460AbjLESwy (ORCPT + 99 others); Tue, 5 Dec 2023 13:52:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229569AbjLESwx (ORCPT ); Tue, 5 Dec 2023 13:52:53 -0500 Received: from mail.alien8.de (mail.alien8.de [65.109.113.108]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69DA1BA for ; Tue, 5 Dec 2023 10:52:59 -0800 (PST) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTP id 705DA40E01AD; Tue, 5 Dec 2023 18:52:57 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at mail.alien8.de Authentication-Results: mail.alien8.de (amavisd-new); dkim=pass (4096-bit key) header.d=alien8.de Received: from mail.alien8.de ([127.0.0.1]) by localhost (mail.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id J6-BrYYixBWq; Tue, 5 Dec 2023 18:52:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=alien8; t=1701802375; bh=COpgCkikT3z+JRnd2ns06QRSDfXH8wlW9tuJ0ai1Q54=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=L2LDMDZgpAK8mc+Y+JnHsQLOgod5dbCCOkwTjSoU5GWU4Iiw7QLIv5P7l2KV35keA vnm9DUxHxKPU9ShsZWSOIC8qIM1fAc8jnxAdwmqRSKibWVLmZfCLs+xeeNmT8RNXFy ycLZzX25TjUGQwyfSulbzjCZR1OkWG0nraW9vMK0JOffoVriyuwYKW7xO1aU0AAJjO 7DZkXnUudBEevfOxa+WfreQK5I9EV5+x5HgH0PPQZsgcI/wTUc2iTpUFRECJ4KLwpu eizRrxra395oxqFTGnHjQ3tOchDdwBGt2wpA/UMzcZSAjjlhbv+tJrkhqy90pYcIe3 vRbv5dIeKEjFteKEnQD/jzEEWJ/FVgXtwoj7cid8s3I0+TKFYCcOKJh4t8Lqty6ZYa +qfIsFWWI283HyQmz1veW7nkZGAdQ5ZXgixBhMJoAhzp+AHSytp/Lkvf3/5yT4Kmfm V2YC95zRco0aUNJYZ3dus+xX2GBd6Zc+F2Umt89CkHpAHY0OKxqbazLsdq/9CPZiv9 wUpY4O2p7YvCq+/IFhV/wqNdb2fqC9XNkEFerRrUtskr8OZ+k5E7K8N+UZoGCtFwjD 1MeJDBGlLRY2/Z3WgD2Lfz5FRWo/nbnZMm9SaZvvBljtFdksmno2pLRur7UE0egyps SyeMIpyx1zo6VoeiwAqxroHs= Received: from zn.tnic (pd95304da.dip0.t-ipconnect.de [217.83.4.218]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 7823440E0239; Tue, 5 Dec 2023 18:52:46 +0000 (UTC) Date: Tue, 5 Dec 2023 19:52:41 +0100 From: Borislav Petkov To: "Kirill A. Shutemov" 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: <20231205185241.GGZW9xeTtiG6sORMTr@fat_crate.local> 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> <20231205151437.aqmuydosfmnq3zr4@box.shutemov.name> <20231205160035.GEZW9JI8eKENXBo6EO@fat_crate.local> <20231205171643.zg7fwxjyccab53kf@box.shutemov.name> <20231205172436.GFZW9c1EaCaguGhglb@fat_crate.local> <20231205180813.phbxg5jdumfovshz@box.shutemov.name> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20231205180813.phbxg5jdumfovshz@box.shutemov.name> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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 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]); Tue, 05 Dec 2023 10:53:07 -0800 (PST) On Tue, Dec 05, 2023 at 09:08:13PM +0300, Kirill A. Shutemov wrote: > It is here and it is broken. It is not broken - it is getting improved as we go. > I think legitimate use case for cc_platfrom_has() is to check platform > capability, not specific implementation. Yes, and I already agreed that it is used the wrong way there. > And we have much more mature infrastructure around X86_FEATURE_ comparing > to CC_ATRR_. If we can use it, we should. Mature, shmature. X86_FEATURE_ has its own issues - don't even get me started on it. You want it because you use TDX_GUEST and it works fine for you. Yes, we can always do X86_FEATURE_ but X86_FEATURE_ doesn't belong in arch-agnostic code. cc_platform_has() does, OTOH. So yes, we will fix your issue, no worries. I'm figuring out the details as we speak. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette