On 15/5/23 17:17, Jan Beulich wrote:
On 13.05.2023 03:17, Stefano Stabellini wrote:
From: Stefano Stabellini <stefano.stabell...@amd.com>
Mapping the ACPI tables to Dom0 PVH 1:1 leads to memory corruptions of
the tables in the guest. Instead, copy the tables to Dom0.
Do you really mean "in the guest" (i.e. from Xen's perspective, i.e.
ignoring that when running on qemu it is kind of a guest itself)?
I also consider the statement too broad anyway: Various people have
run PVH Dom0 without running into such an issue, so it's clearly not
just "leads to".
In my opinion the issue is broader.
In pvh_setup_acpi(), the code adding the ACPI tables to dom0 memory map
does not check the return value of pvh_add_mem_range(). If there is an
overlap and the overlapping region is marked as E820_ACPI, it maps not
just the allowed tables but the entire overlapping range , while if the
overlapping range is marked as E820_RESERVED, it does not map the tables
at all (the issue that Stefano saw with qemu). Since dom0 memory map is
initialized based on the native one, the code adding the ACPI table
memory ranges will naturally fall into one of the two cases above.
So even when not running into this issue, pvh_add_mem_range() still
fails and the memory range mapped is wider than the allowed one.
Xenia