kernel-hacking-2024-linux-s.../drivers/xen
Stefano Stabellini 83862ccfc0 xen/arm,arm64: enable SWIOTLB_XEN
Xen on arm and arm64 needs SWIOTLB_XEN: when running on Xen we need to
program the hardware with mfns rather than pfns for dma addresses.
Remove SWIOTLB_XEN dependency on X86 and PCI and make XEN select
SWIOTLB_XEN on arm and arm64.

At the moment always rely on swiotlb-xen, but when Xen starts supporting
hardware IOMMUs we'll be able to avoid it conditionally on the presence
of an IOMMU on the platform.

Implement xen_create_contiguous_region on arm and arm64: for the moment
we assume that dom0 has been mapped 1:1 (physical addresses == machine
addresses) therefore we don't need to call XENMEM_exchange. Simply
return the physical address as dma address.

Initialize the xen-swiotlb from xen_early_init (before the native
dma_ops are initialized), set xen_dma_ops to &xen_swiotlb_dma_ops.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>


Changes in v8:
- assume dom0 is mapped 1:1, no need to call XENMEM_exchange.

Changes in v7:
- call __set_phys_to_machine_multi from xen_create_contiguous_region and
xen_destroy_contiguous_region to update the P2M;
- don't call XENMEM_unpin, it has been removed;
- call XENMEM_exchange instead of XENMEM_exchange_and_pin;
- set nr_exchanged to 0 before calling the hypercall.

Changes in v6:
- introduce and export xen_dma_ops;
- call xen_mm_init from as arch_initcall.

Changes in v4:
- remove redefinition of DMA_ERROR_CODE;
- update the code to use XENMEM_exchange_and_pin and XENMEM_unpin;
- add a note about hardware IOMMU in the commit message.

Changes in v3:
- code style changes;
- warn on XENMEM_put_dma_buf failures.
2013-10-10 13:40:44 +00:00
..
xen-pciback
xenbus Fixes: 2013-07-31 11:37:43 -07:00
xenfs
acpi.c xen / ACPI: notify xen when reduced hardware sleep is available 2013-07-31 14:22:35 +02:00
balloon.c xen/balloon: don't alloc page while non-preemptible 2013-09-24 16:22:27 -04:00
biomerge.c
cpu_hotplug.c
dbgp.c
events.c Linux 3.11-rc7 2013-09-09 12:05:37 -04:00
evtchn.c xen/evtchn: double free on error 2013-08-30 08:44:53 -04:00
fallback.c
features.c
gntalloc.c
gntdev.c xen/m2p: use GNTTABOP_unmap_and_replace to reinstate the original mapping 2013-08-20 10:25:35 -04:00
grant-table.c xen-gnt: prevent adding duplicate gnt callbacks 2013-08-09 10:58:11 -04:00
Kconfig xen/arm,arm64: enable SWIOTLB_XEN 2013-10-10 13:40:44 +00:00
Makefile xen/arm: enable PV control for ARM 2013-07-29 09:35:11 -04:00
manage.c
mcelog.c
pci.c
pcpu.c
platform-pci.c
privcmd.c Xen: Fix retry calls into PRIVCMD_MMAPBATCH*. 2013-08-30 08:44:53 -04:00
privcmd.h
swiotlb-xen.c xen/arm,arm64: enable SWIOTLB_XEN 2013-10-10 13:40:44 +00:00
sys-hypervisor.c
tmem.c
xen-acpi-cpuhotplug.c
xen-acpi-memhotplug.c
xen-acpi-pad.c
xen-acpi-processor.c
xen-balloon.c
xen-selfballoon.c xen: replace strict_strtoul() with kstrtoul() 2013-08-09 10:59:01 -04:00
xen-stub.c
xencomm.c