• Juergen Gross's avatar
    xen: tolerate ACPI NVS memory overlapping with Xen allocated memory · be35d91c
    Juergen Gross authored
    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: 808fdb71 ("xen: check for kernel memory conflicting with memory layout")
    Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
    Tested-by: default avatarMarek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Reviewed-by: default avatarJan Beulich <jbeulich@suse.com>
    Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
    be35d91c
setup.c 28.3 KB