From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web08.5680.1634191491807332842 for ; Wed, 13 Oct 2021 23:04:52 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IdpnWXsU; spf=pass (domain: redhat.com, ip: 170.10.129.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1634191485; 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: in-reply-to:in-reply-to:references:references; bh=FB+qlATRdrvebvJLQyJ/o5GXmiR/fsXaC0z8jRTO0fg=; b=IdpnWXsUq/QPfMWpYZp6Le/ikj+Baaz9Shm7Eksm0qsEIt+2mm5QJBAyyYE19v6kaLkn4i 3fk6080q1fFryVShrBJAou3tYfXFc+zK76n5RmPAKb1M9D3LeQXXio3cZjC5zs35Il/Ee5 XodPeLWOm5oXskck6wtre28Qv48R7nA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-9-HveCqba2Oo-Hw_SCBmCq6A-1; Thu, 14 Oct 2021 02:04:42 -0400 X-MC-Unique: HveCqba2Oo-Hw_SCBmCq6A-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 199CB18125C0; Thu, 14 Oct 2021 06:04:41 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8B6E75C232; Thu, 14 Oct 2021 06:04:40 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id D468218007AC; Thu, 14 Oct 2021 08:04:38 +0200 (CEST) Date: Thu, 14 Oct 2021 08:04:38 +0200 From: "Gerd Hoffmann" To: "Xu, Min M" Cc: "devel@edk2.groups.io" , Brijesh Singh , Erdem Aktas , James Bottomley , "Yao, Jiewen" , Tom Lendacky , "Dong, Eric" , "Ni, Ray" , "Kumar, Rahul1" Subject: Re: [edk2-devel] [PATCH V2 13/28] UefiCpuPkg: Enable Tdx support in MpInitLib Message-ID: <20211014060438.yugrowggdtyohlkz@sirius.home.kraxel.org> References: <80403cd301cc6f0e88bc1c10e11ec262c1093cbf.1633401643.git.min.m.xu@intel.com> <20211012103139.4xkxi6p6jlkjo2wo@sirius.home.kraxel.org> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Oct 14, 2021 at 12:27:13AM +0000, Xu, Min M wrote: > On October 12, 2021 6:32 PM, Gerd Hoffman wrote: > > Hi, > > > > > + do { > > > + AsmCpuid (0, &LargestEax, &Ebx, &Ecx, &Edx); > > > > Again: this should use PCD. > ConfidentialComputing PCD is set in PlatformPei. So any check of this PCD should be after PlatformPei. Can we move that to the SEC phase? > MpInitLib will be included in CpuMpPei. So if PCD is checked in MpInitLib, then we must assume CpuMpPei is called after PlatformPei. > In current OVMF, CpuMpPei is called after PlatforPei. But I am not sure if it is always the case. Can we have such assumption? > Based on above consideration, CPUID is used to probe if it is Tdx guest. Not sure. There are no explicit depex dependencies, so I suspect the initialization order could change. take care, Gerd