OpenCloudOS-Kernel/arch/arm/xen
Oleksandr Tyshchenko 035e3a4321 xen/virtio: Optimize the setup of "xen-grant-dma" devices
This is needed to avoid having to parse the same device-tree
several times for a given device.

For this to work we need to install the xen_virtio_restricted_mem_acc
callback in Arm's xen_guest_init() which is same callback as x86's
PV and HVM modes already use and remove the manual assignment in
xen_setup_dma_ops(). Also we need to split the code to initialize
backend_domid into a separate function.

Prior to current patch we parsed the device-tree three times:
1. xen_setup_dma_ops()->...->xen_is_dt_grant_dma_device()
2. xen_setup_dma_ops()->...->xen_dt_grant_init_backend_domid()
3. xen_virtio_mem_acc()->...->xen_is_dt_grant_dma_device()

With current patch we parse the device-tree only once in
xen_virtio_restricted_mem_acc()->...->xen_dt_grant_init_backend_domid()

Other benefits are:
- Not diverge from x86 when setting up Xen grant DMA ops
- Drop several global functions

Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Reviewed-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Link: https://lore.kernel.org/r/20221025162004.8501-2-olekstysh@gmail.com
Signed-off-by: Juergen Gross <jgross@suse.com>
2022-12-05 12:59:49 +01:00
..
Makefile xen/efi: have a common runtime setup function 2019-10-02 10:31:07 -04:00
enlighten.c xen/virtio: Optimize the setup of "xen-grant-dma" devices 2022-12-05 12:59:49 +01:00
grant-table.c xen: re-introduce support for grant v2 interface 2017-11-06 15:50:17 -05:00
hypercall.S xen: allow pv-only hypercalls only with CONFIG_XEN_PV 2021-11-02 08:11:01 -05:00
mm.c swiotlb-xen: fix DMA_ATTR_NO_KERNEL_MAPPING on arm 2022-05-11 19:48:32 +02:00
p2m.c xen/arm: Fix race in RB-tree based P2M accounting 2022-07-01 10:02:03 +02:00