audk/OvmfPkg/XenPlatformPei
Anthony PERARD c75c640512 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>
2021-04-13 11:54:58 +00:00
..
AmdSev.c OvmfPkg: Obtain SEV encryption mask with the new MemEncryptSevLib API 2021-01-07 19:34:39 +00:00
ClearCache.c OvmfPkg: Introduce XenPlatformPei 2019-08-21 18:03:49 +02:00
Cmos.c OvmfPkg: Introduce XenPlatformPei 2019-08-21 18:03:49 +02:00
Cmos.h OvmfPkg: Introduce XenPlatformPei 2019-08-21 18:03:49 +02:00
Fv.c OvmfPkg: Introduce XenPlatformPei 2019-08-21 18:03:49 +02:00
MemDetect.c OvmfPkg/XenPlatformPei: Use CPUID to get physical address width on Xen 2021-01-19 17:00:08 +00:00
Platform.c OvmfPkg/XenPlatformPei: Calibrate APIC timer frequency 2021-04-13 11:54:58 +00:00
Platform.h OvmfPkg/XenPlatformPei: Calibrate APIC timer frequency 2021-04-13 11:54:58 +00:00
Xen.c OvmfPkg/XenPlatformPei: Calibrate APIC timer frequency 2021-04-13 11:54:58 +00:00
Xen.h OvmfPkg: Introduce XenPlatformPei 2019-08-21 18:03:49 +02:00
XenPlatformPei.inf OvmfPkg/XenPlatformPei: Calibrate APIC timer frequency 2021-04-13 11:54:58 +00:00