Re: [PATCH v3 7/7] xen: tolerate ACPI NVS memory overlapping with Xen allocated memory
From: Jan Beulich
Date: Tue Sep 10 2024 - 08:37:04 EST
On 10.09.2024 12:39, Juergen Gross wrote:
> In order to minimize required special handling for running as Xen PV
> dom0, the memory layout is modified to match that of the host. This
> requires to have only RAM at the locations where Xen allocated memory
> is living. Unfortunately there seem to be some machines, where ACPI
> NVS is located at 64 MB, resulting in a conflict with the loaded
> kernel or the initial page tables built by Xen.
>
> Avoid this conflict by swapping the ACPI NVS area in the memory map
> with unused RAM. This is possible via modification of the dom0 P2M map.
> Accesses to the ACPI NVS area are done either for saving and restoring
> it across suspend operations (this will work the same way as before),
> or by ACPI code when NVS memory is referenced from other ACPI tables.
> The latter case is handled by a Xen specific indirection of
> acpi_os_ioremap().
>
> While the E820 map can (and should) be modified right away, the P2M
> map can be updated only after memory allocation is working, as the P2M
> map might need to be extended.
>
> Fixes: 808fdb71936c ("xen: check for kernel memory conflicting with memory layout")
> Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
> Tested-by: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>