summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/XenPlatformPei
diff options
context:
space:
mode:
authorAnthony PERARD <anthony.perard@citrix.com>2019-08-13 12:31:04 +0100
committerLaszlo Ersek <lersek@redhat.com>2019-08-21 18:03:49 +0200
commit64eac29576dd4d6a8f990a61d81ff77c5e4180cb (patch)
tree9ab3664e8a866286ca19ad94d6b2a0339dc62cb1 /OvmfPkg/XenPlatformPei
parent12998837d5944e9d9fa447c918ab5e3c44459dd2 (diff)
downloadedk2-64eac29576dd4d6a8f990a61d81ff77c5e4180cb.tar.gz
edk2-64eac29576dd4d6a8f990a61d81ff77c5e4180cb.tar.bz2
edk2-64eac29576dd4d6a8f990a61d81ff77c5e4180cb.zip
OvmfPkg/XenPlatformPei: Introduce XenPvhDetected
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 <anthony.perard@citrix.com> Acked-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20190813113119.14804-21-anthony.perard@citrix.com>
Diffstat (limited to 'OvmfPkg/XenPlatformPei')
-rw-r--r--OvmfPkg/XenPlatformPei/Platform.h5
-rw-r--r--OvmfPkg/XenPlatformPei/Xen.c13
2 files changed, 18 insertions, 0 deletions
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