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.26395.1643278574606438912 for ; Thu, 27 Jan 2022 02:16:14 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eyjWrHKN; 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=1643278573; 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=TAnuGzTUmoeHjA7sgllF5N4JLd/1LGrZQYWZQE8mXmc=; b=eyjWrHKNiRXzTOSn0km7uRPja1fcOrhakgGXKYrA2/a59rg6b5axDAUZUBDfqMBO1jzDqS q47PylHB+CK+xo4SjmXRMzKzEHn6YJKYEVoSkq3vgdw1GDapRtTofsGYKlOhKQxZlWf4et ucfmH5CEuiSeSBbaF39XgHELqfxw4pg= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-463-6FiAQNicMzCDS-iM7SROWg-1; Thu, 27 Jan 2022 05:16:08 -0500 X-MC-Unique: 6FiAQNicMzCDS-iM7SROWg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AAB031F6AD; Thu, 27 Jan 2022 10:16:06 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.193.47]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 324FB110F86; Thu, 27 Jan 2022 10:16:06 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 375F51800094; Thu, 27 Jan 2022 11:16:04 +0100 (CET) Date: Thu, 27 Jan 2022 11:16:04 +0100 From: "Gerd Hoffmann" To: Min Xu Cc: devel@edk2.groups.io, Ard Biesheuvel , Jordan Justen , Brijesh Singh , Erdem Aktas , James Bottomley , Jiewen Yao , Tom Lendacky Subject: Re: [PATCH V5 25/33] OvmfPkg: Update PlatformPei to support Tdx guest Message-ID: <20220127101604.ptqfjqnxmimkjwdn@sirius.home.kraxel.org> References: <4635cf3ec6e8ab5e24af1b06ef6b502740c142a1.1642899774.git.min.m.xu@intel.com> MIME-Version: 1.0 In-Reply-To: <4635cf3ec6e8ab5e24af1b06ef6b502740c142a1.1642899774.git.min.m.xu@intel.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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 Hi, > +/** > + This Function checks if TDX is available, if present then it sets > + the dynamic PCDs for Tdx guest. It also builds Guid hob which contains > + the Host Bridge DevId. > + **/ > +VOID > +IntelTdxInitialize ( > + VOID > + ) > +{ > + #ifdef MDE_CPU_X64 > + EFI_HOB_PLATFORM_INFO PlatformInfoHob; > + RETURN_STATUS PcdStatus; > + > + if (!TdIsEnabled ()) { > + return; > + } > + > + PcdStatus = PcdSet64S (PcdConfidentialComputingGuestAttr, CCAttrIntelTdx); > + ASSERT_RETURN_ERROR (PcdStatus); > + > + PcdStatus = PcdSetBoolS (PcdIa32EferChangeAllowed, FALSE); > + ASSERT_RETURN_ERROR (PcdStatus); > + > + PcdStatus = PcdSet64S (PcdTdxSharedBitMask, TdSharedPageMask ()); > + ASSERT_RETURN_ERROR (PcdStatus); > + > + PcdStatus = PcdSetBoolS (PcdSetNxForStack, TRUE); > + ASSERT_RETURN_ERROR (PcdStatus); > + > + ZeroMem (&PlatformInfoHob, sizeof (PlatformInfoHob)); > + PlatformInfoHob.HostBridgePciDevId = mHostBridgeDevId; > + > + BuildGuidDataHob (&gUefiOvmfPkgTdxPlatformGuid, &PlatformInfoHob, sizeof (EFI_HOB_PLATFORM_INFO)); > + #endif > +} So, what is the plan for this with pei-less boot? I think we should move this to PlatformInitLib, then link either into PlatformPei or the early dxe module for pei-less boot? take care, Gerd