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.web10.32047.1644833010146431570 for ; Mon, 14 Feb 2022 02:03:31 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=f8hFFlz/; 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=1644833009; 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=BTPHJFxta+XX206LVIumeaaphgeKh5UX7/Exr70VBIk=; b=f8hFFlz/0lea52P/WK1CoqLVnh6Wps1fi+mMrTyQ8WY72WHPxwQCz6vpYY/QBN9v4nKTqV PBiipBv4pnlull+oR+qsbq9gi2s8rE/J8XOEo5PhzP95luSiRUnI0pQm8YkhcqUYMt02dS bcLyhzmJUz2CCnyQ5lnYdMFR8tdZ99U= 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-93--bkrKIIXP3qaurCntbQKOA-1; Mon, 14 Feb 2022 05:03:26 -0500 X-MC-Unique: -bkrKIIXP3qaurCntbQKOA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7429983DD20; Mon, 14 Feb 2022 10:03:24 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.34]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3A0D66F116; Mon, 14 Feb 2022 10:03:24 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id CC17E1800091; Mon, 14 Feb 2022 11:03:21 +0100 (CET) Date: Mon, 14 Feb 2022 11:03:21 +0100 From: "Gerd Hoffmann" To: "Xu, Min M" Cc: "devel@edk2.groups.io" , "Kinney, Michael D" , Brijesh Singh , "Aktas, Erdem" , James Bottomley , "Yao, Jiewen" , Tom Lendacky Subject: Re: [PATCH V2 09/10] OvmfPkg: Update DxeAcpiTimerLib to read HostBridgeDevId in PlatformInfoHob Message-ID: <20220214100321.sdb4heedrrgqb33i@sirius.home.kraxel.org> References: <20220125063318.862-1-min.m.xu@intel.com> <20220125063318.862-10-min.m.xu@intel.com> <20220127134850.q5rrxeefqyh3yrru@sirius.home.kraxel.org> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 Tue, Feb 08, 2022 at 08:20:20AM +0000, Xu, Min M wrote: > On January 27, 2022 9:49 PM, Gerd Hoffmann wrote: > > > + EFI_HOB_GUID_TYPE *GuidHob; > > > + EFI_HOB_PLATFORM_INFO *PlatformInfo = NULL; > > > > > // Query Host Bridge DID to determine platform type > > > + // Tdx guest stores the HostBridgePciDevId in a GuidHob. > > > + // So we first check if this HOB exists > > > > Hmm, wouldn't it be better to create and use the PlatformInfo for both PEI- > > based and PEI-less boot? > > > > > - HostBridgeDevId = PcdGet16 (PcdOvmfHostBridgePciDevId); > > > + GuidHob = GetFirstGuidHob (&gUefiOvmfPkgTdxPlatformGuid); if > > > + (GuidHob != NULL) { > > > + PlatformInfo = (EFI_HOB_PLATFORM_INFO *)GET_GUID_HOB_DATA > > (GuidHob); > > > + HostBridgeDevId = PlatformInfo->HostBridgePciDevId; } else { > > > + HostBridgeDevId = PcdGet16 (PcdOvmfHostBridgePciDevId); } > > > > We would not need that kind of checks in the first place then. > > > As we agreed at the first stage, only OvmfPkg/PlatformPei will be refactored with PlatformInitLib. > OvmfPkg/Bhyve/PlatformPei and OvmfPkg/XenPlatformPei will be refactored in the future. HostBridgeDevId is set to PcdOvmfHostBridgePciDevId in these 2 platforms. > So we have to check both EFI_HOB_PLATFORM_INFO and PcdOvmfHostBridgePciDevId. Ok. Can you add a comment explaining this? thanks, Gerd