summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/XenPlatformPei/Platform.c
diff options
context:
space:
mode:
authorAnthony PERARD <anthony.perard@citrix.com>2021-04-12 14:30:02 +0100
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-04-13 11:54:58 +0000
commitc75c6405128e7c3f9cddb05180d55301f4d891a3 (patch)
tree2b439edbc466545440c24341d3b4b6a686e1da73 /OvmfPkg/XenPlatformPei/Platform.c
parent51e0bd28bba9631fd3e3244668b6ab9c561817b2 (diff)
downloadedk2-c75c6405128e7c3f9cddb05180d55301f4d891a3.tar.gz
edk2-c75c6405128e7c3f9cddb05180d55301f4d891a3.tar.bz2
edk2-c75c6405128e7c3f9cddb05180d55301f4d891a3.zip
OvmfPkg/XenPlatformPei: Calibrate APIC timer frequency
Calculate the frequency of the APIC timer that Xen provides. Even though the frequency is currently hard-coded, it isn't part of the public ABI that Xen provides and thus may change at any time. OVMF needs to determine the frequency by an other mean. Fortunately, Xen provides a way to determines the frequency of the TSC, so we can use TSC to calibrate the frequency of the APIC timer. That information is found in the shared_info page which we map and unmap once done (XenBusDxe is going to map the page somewhere else). The shared_info page is mapped at the highest physical address allowed as it doesn't need to be in the RAM, thus there's a call to update the page table. The calculated frequency is only logged in this patch, it will be used in a following patch. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2490 Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Acked-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210412133003.146438-7-anthony.perard@citrix.com>
Diffstat (limited to 'OvmfPkg/XenPlatformPei/Platform.c')
-rw-r--r--OvmfPkg/XenPlatformPei/Platform.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/OvmfPkg/XenPlatformPei/Platform.c b/OvmfPkg/XenPlatformPei/Platform.c
index 717fd0ab1a..e9511eb40c 100644
--- a/OvmfPkg/XenPlatformPei/Platform.c
+++ b/OvmfPkg/XenPlatformPei/Platform.c
@@ -448,6 +448,7 @@ InitializeXenPlatform (
InitializeRamRegions ();
InitializeXen ();
+ CalibrateLapicTimer ();
if (mBootMode != BOOT_ON_S3_RESUME) {
ReserveEmuVariableNvStore ();