arm/xen: Switch to use gnttab_setup_auto_xlat_frames() for DT
authorOleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Thu, 9 Dec 2021 20:05:32 +0000 (22:05 +0200)
committerJuergen Gross <jgross@suse.com>
Thu, 6 Jan 2022 08:53:31 +0000 (09:53 +0100)
commit5e1cdb8ee5e76bffbc11d300eebbb5193c7de530
tree5706b9967547901a072cd58b31076b5c626e4358
parentfbf3a5c301685f7e9224bf5de9c426cf8f11ae15
arm/xen: Switch to use gnttab_setup_auto_xlat_frames() for DT

Read the start address of the grant table space from DT
(region 0).

This patch mostly restores behaviour before commit 3cf4095d7446
("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: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Link: https://lore.kernel.org/r/1639080336-26573-3-git-send-email-olekstysh@gmail.com
Signed-off-by: Juergen Gross <jgross@suse.com>
arch/arm/xen/enlighten.c