From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: redhat.com, ip: 209.132.183.28, mailfrom: lersek@redhat.com) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by groups.io with SMTP; Wed, 10 Jul 2019 02:45:47 -0700 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 mx1.redhat.com (Postfix) with ESMTPS id 2DC0B7FDF9; Wed, 10 Jul 2019 09:45:47 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-117-153.ams2.redhat.com [10.36.117.153]) by smtp.corp.redhat.com (Postfix) with ESMTP id D5A91838E6; Wed, 10 Jul 2019 09:45:45 +0000 (UTC) Subject: Re: [PATCH v3 28/35] OvmfPkg/PlatformBootManagerLib: Use XenDetected from XenPlatformLib To: Anthony PERARD , devel@edk2.groups.io Cc: xen-devel@lists.xenproject.org, Ard Biesheuvel , Jordan Justen , Julien Grall References: <20190704144233.27968-1-anthony.perard@citrix.com> <20190704144233.27968-29-anthony.perard@citrix.com> From: "Laszlo Ersek" Message-ID: <510fba40-da71-e414-bd1a-8c374da8dcc3@redhat.com> Date: Wed, 10 Jul 2019 11:45:44 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20190704144233.27968-29-anthony.perard@citrix.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 10 Jul 2019 09:45:47 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 07/04/19 16:42, Anthony PERARD wrote: > Replace the XenDetected() implementation by the one from > XenPlatformLib. > > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1689 > Signed-off-by: Anthony PERARD > --- > > Notes: > v3: > - new patch > > .../PlatformBootManagerLib.inf | 1 + > .../PlatformBootManagerLib/BdsPlatform.c | 33 +------------------ > 2 files changed, 2 insertions(+), 32 deletions(-) > > diff --git a/OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf b/OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf > index 060a3ab4c5..b2d3b4fb4d 100644 > --- a/OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf > +++ b/OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf > @@ -54,6 +54,7 @@ [LibraryClasses] > UefiLib > PlatformBmPrintScLib > Tcg2PhysicalPresenceLib > + XenPlatformLib > > [Pcd] > gUefiOvmfPkgTokenSpaceGuid.PcdEmuVariableEvent > diff --git a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c > index 797731a41c..e32969e63e 100644 > --- a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c > +++ b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c > @@ -12,6 +12,7 @@ > #include > #include > #include > +#include > > > // > @@ -1225,38 +1226,6 @@ PciAcpiInitialization ( > IoOr16 ((PciRead32 (Pmba) & ~BIT0) + 4, BIT0); > } > > -/** > - This function detects if OVMF is running on Xen. > - > -**/ > -STATIC > -BOOLEAN > -XenDetected ( > - VOID > - ) > -{ > - EFI_HOB_GUID_TYPE *GuidHob; > - STATIC INTN FoundHob = -1; > - > - if (FoundHob == 0) { > - return FALSE; > - } else if (FoundHob == 1) { > - return TRUE; > - } > - > - // > - // See if a XenInfo HOB is available > - // > - GuidHob = GetFirstGuidHob (&gEfiXenInfoGuid); > - if (GuidHob == NULL) { > - FoundHob = 0; > - return FALSE; > - } > - > - FoundHob = 1; > - return TRUE; > -} > - > EFI_STATUS > EFIAPI > ConnectRecursivelyIfPciMassStorage ( > Is it possible to clean up the remaining code a bit more, such as: (1) removing #include from "BdsPlatform.c", (2) removing "gEfiXenInfoGuid" from [Guids] in "PlatformBootManagerLib.inf"? With those: Reviewed-by: Laszlo Ersek Thanks Laszlo