From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 15D49C433EF for ; Sun, 13 Feb 2022 17:21:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1FAC76B0072; Sun, 13 Feb 2022 12:21:46 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1AA266B0073; Sun, 13 Feb 2022 12:21:46 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 073316B0078; Sun, 13 Feb 2022 12:21:46 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0083.hostedemail.com [216.40.44.83]) by kanga.kvack.org (Postfix) with ESMTP id E99466B0072 for ; Sun, 13 Feb 2022 12:21:45 -0500 (EST) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 7A46D8249980 for ; Sun, 13 Feb 2022 17:21:45 +0000 (UTC) X-FDA: 79138423770.17.ACD1EFE Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by imf04.hostedemail.com (Postfix) with ESMTP id EE2F040004 for ; Sun, 13 Feb 2022 17:21:38 +0000 (UTC) Received: from zn.tnic (dslb-088-067-221-104.088.067.pools.vodafone-ip.de [88.67.221.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 6A0361EC02B9; Sun, 13 Feb 2022 18:21:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1644772891; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=ufk7PMLyTSC7SBB9XUxAFhjH4Ne7SBwgRzzji7hMfcE=; b=CYZeT4CQKL7MRLKnjYmoY+MrvzzIwtQO7Us+DR5MjPMTd5AbVP5oiKrp1s6sRjnBgNs5uv 6HtIX8+MjLS6QIqU7GMB9UEaOxVQ7ZeR1NcgdtSiQgaPLpmCPWo3P3LD//xF6qeNNhmSkH ANF2rfVktTKli3h1ArNCrCoJMi370SM= Date: Sun, 13 Feb 2022 18:21:33 +0100 From: Borislav Petkov To: Tom Lendacky Cc: Brijesh Singh , "Kirill A . Shutemov" , x86@kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-efi@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-coco@lists.linux.dev, linux-mm@kvack.org, Thomas Gleixner , Ingo Molnar , Joerg Roedel , "H. Peter Anvin" , Ard Biesheuvel , Paolo Bonzini , Sean Christopherson , Vitaly Kuznetsov , Jim Mattson , Andy Lutomirski , Dave Hansen , Sergio Lopez , Peter Gonda , Peter Zijlstra , Srinivas Pandruvada , David Rientjes , Dov Murik , Tobin Feldman-Fitzthum , Michael Roth , Vlastimil Babka , Andi Kleen , "Dr . David Alan Gilbert" , brijesh.ksingh@gmail.com, tony.luck@intel.com, marcorr@google.com, sathyanarayanan.kuppuswamy@linux.intel.com Subject: Re: [PATCH v10 21/45] x86/mm: Add support to validate memory when changing C-bit Message-ID: References: <20220209181039.1262882-1-brijesh.singh@amd.com> <20220209181039.1262882-22-brijesh.singh@amd.com> <0242e383-5406-7504-ff3d-cf2e8dfaf8a3@amd.com> <7712e67b-f1c4-b818-ce20-b37e2a0e329b@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <7712e67b-f1c4-b818-ce20-b37e2a0e329b@amd.com> X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: EE2F040004 X-Rspam-User: Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=alien8.de header.s=dkim header.b=CYZeT4CQ; spf=pass (imf04.hostedemail.com: domain of bp@alien8.de designates 5.9.137.197 as permitted sender) smtp.mailfrom=bp@alien8.de; dmarc=temperror reason="query timed out" header.from=alien8.de (policy=temperror) X-Stat-Signature: qmgzkwkuzydhsjhoe1pixf6o838ypcdx X-HE-Tag: 1644772898-1671 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Sun, Feb 13, 2022 at 08:50:48AM -0600, Tom Lendacky wrote: > I think there were a lot of assumptions that only SME/SEV would set > sme_me_mask and that is used, for example, in the cc_platform_has() routine > to figure out whether we're AMD or Intel. If you go the cc_mask route, I > think we'll need to add a cc_vendor variable that would then be checked in > cc_platform_has(). Right, or cc_platform_type or whatever. It would probably be a good idea to have a variable explicitly state what the active coco flavor is anyway, as we had some ambiguity questions in the past along the lines of, what does cc_platform_has() need to return when running as a guest on the respective platform. If you have it explicitly, then it would work unambiguously simple. And then we can get rid of CC_ATTR_GUEST_SEV_SNP or CC_ATTR_GUEST_TDX which is clumsy. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette