• Oleksandr Tyshchenko's avatar
    arm/xen: Switch to use gnttab_setup_auto_xlat_frames() for DT · 5e1cdb8e
    Oleksandr Tyshchenko authored
    Read the start address of the grant table space from DT
    (region 0).
    
    This patch mostly restores behaviour before commit 3cf4095d
    ("arm/xen: Use xen_xlate_map_ballooned_pages to setup grant table")
    but trying not to break the ACPI support added after that commit.
    So the patch touches DT part only and leaves the ACPI part with
    xen_xlate_map_ballooned_pages(). Also in order to make a code more
    resilient use a fallback to xen_xlate_map_ballooned_pages() if grant
    table region wasn't found.
    
    This is a preparation for using Xen extended region feature
    where unused regions of guest physical address space (provided
    by the hypervisor) will be used to create grant/foreign/whatever
    mappings instead of wasting real RAM pages from the domain memory
    for establishing these mappings.
    
    The immediate benefit of this change:
    - Avoid superpage shattering in Xen P2M when establishing
      stage-2 mapping (GFN <-> MFN) for the grant table space
    - Avoid wasting real RAM pages (reducing the amount of memory
      usuable) for mapping grant table space
    - The grant table space is always mapped at the exact
      same place (region 0 is reserved for the grant table)
    Signed-off-by: default avatarOleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
    Reviewed-by: default avatarStefano Stabellini <sstabellini@kernel.org>
    Link: https://lore.kernel.org/r/1639080336-26573-3-git-send-email-olekstysh@gmail.comSigned-off-by: default avatarJuergen Gross <jgross@suse.com>
    5e1cdb8e
enlighten.c 11.9 KB