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; Thu, 15 Aug 2019 01:54:32 -0700 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5D219308FEC6; Thu, 15 Aug 2019 08:54:32 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-117-57.ams2.redhat.com [10.36.117.57]) by smtp.corp.redhat.com (Postfix) with ESMTP id C839A81768; Thu, 15 Aug 2019 08:54:30 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH v5 20/35] OvmfPkg/XenPlatformPei: Introduce XenPvhDetected To: devel@edk2.groups.io, anthony.perard@citrix.com Cc: Jordan Justen , Julien Grall , xen-devel@lists.xenproject.org, Ard Biesheuvel References: <20190813113119.14804-1-anthony.perard@citrix.com> <20190813113119.14804-21-anthony.perard@citrix.com> From: "Laszlo Ersek" Message-ID: <5650925a-3a21-6dbe-0576-49b21143fb3c@redhat.com> Date: Thu, 15 Aug 2019 10:54:29 +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: <20190813113119.14804-21-anthony.perard@citrix.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Thu, 15 Aug 2019 08:54:32 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 08/13/19 13:31, Anthony PERARD wrote: > XenPvhDetected() can be used to figure out if OVMF has started via the > Xen PVH entry point. > > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1689 > Signed-off-by: Anthony PERARD > Acked-by: Laszlo Ersek > --- > > Notes: > v5: > - in XenPvhDetected, check mXenInfo.HyperPages instead of .VersionMajor Right, and that seems to address http://mid.mail-archive.com/20190808104354.wcl2vicpmvbl3rlz@Air-de-Roger https://edk2.groups.io/g/devel/message/45159 So my ACK stands. Thanks Laszlo > OvmfPkg/XenPlatformPei/Platform.h | 5 +++++ > OvmfPkg/XenPlatformPei/Xen.c | 13 +++++++++++++ > 2 files changed, 18 insertions(+) > > diff --git a/OvmfPkg/XenPlatformPei/Platform.h b/OvmfPkg/XenPlatformPei/Platform.h > index 4a80057bdc..db9a62572f 100644 > --- a/OvmfPkg/XenPlatformPei/Platform.h > +++ b/OvmfPkg/XenPlatformPei/Platform.h > @@ -99,6 +99,11 @@ XenHvmloaderDetected ( > VOID > ); > > +BOOLEAN > +XenPvhDetected ( > + VOID > + ); > + > VOID > AmdSevInitialize ( > VOID > diff --git a/OvmfPkg/XenPlatformPei/Xen.c b/OvmfPkg/XenPlatformPei/Xen.c > index 29b42b746c..f26f0e56dd 100644 > --- a/OvmfPkg/XenPlatformPei/Xen.c > +++ b/OvmfPkg/XenPlatformPei/Xen.c > @@ -214,6 +214,19 @@ XenHvmloaderDetected ( > return (mXenHvmloaderInfo != NULL); > } > > +BOOLEAN > +XenPvhDetected ( > + VOID > + ) > +{ > + // > + // This function should only be used after XenConnect > + // > + ASSERT (mXenInfo.HyperPages != NULL); > + > + return mXenHvmloaderInfo == NULL; > +} > + > VOID > XenPublishRamRegions ( > VOID >