hvmloader: indicate ACPI tables with "ACPI data" type in e820
authorIgor Druzhinin <igor.druzhinin@citrix.com>
Tue, 22 Sep 2020 15:37:42 +0000 (17:37 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 22 Sep 2020 15:37:42 +0000 (17:37 +0200)
commit43eceee913cc76e533233568ca9390be3d080578
treee18a2bf427e8f87f44737857c2c9b4eee21ad2ef
parent03019c20b516be53ba0cd393f5291974a9a6c9a8
hvmloader: indicate ACPI tables with "ACPI data" type in e820

Guest kernel does need to know in some cases where the tables are located
to treat these regions properly. One example is kexec process where
the first kernel needs to pass ACPI region locations to the second
kernel which is now a requirement in Linux after 02a3e3cdb7f12 ("x86/boot:
Parse SRAT table and count immovable memory regions") in order for kexec
transition to actually work.

That commit introduced accesses to XSDT and SRAT while the second kernel
is still using kexec transition tables. The transition tables do not have
e820 "reserved" regions mapped where those tables are located currently
in a Xen guest. Instead "ACPI data" regions are mapped with the transition
tables that was introduced by the following commit 6bbeb276b7 ("x86/kexec:
Add the EFI system tables and ACPI tables to the ident map").

Reserve 1MB (out of 16MB currently available) right after ACPI info page for
ACPI tables exclusively but populate this region on demand and only indicate
populated memory as "ACPI data" since according to ACPI spec that memory is
reclaimable by the guest if necessary. That is close to how we treat
the same ACPI data in PVH guests. 1MB should be enough for now but could be
later extended if required.

Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
master commit: 8efa46516c5f4cf185c8df179812c185d3c27eb6
master date: 2020-09-09 17:56:13 +0200
tools/firmware/hvmloader/config.h
tools/firmware/hvmloader/e820.c
tools/firmware/hvmloader/hvmloader.c
tools/firmware/hvmloader/pci.c
tools/firmware/hvmloader/util.c
tools/firmware/hvmloader/util.h