Hello,

The SMMU driver has diverged from Linux. Having our own driver doesn't make
any benefits and make difficult to backport fixes and/or porting features
such as PCI.

With this series, the code of the SMMU drivers (copied from Linux) is mostly
not modified. If it's the case a comment /* Xen: ... */ has been added to
explain why. The driver is based on Linux 3.19. Even if they reworked the SMMU
code in 4.0 (page table code has been moved in a separate library), I think
we should stay on 3.19 version. Mainly because I don't want to spend again a
week to resync and Linux drivers can change fast.

To make the change obvious, the resync of the SMMU code is made in several
steps:
    1) Revert the current SMMU driver (patch #1)
    2) Import as it is the driver from Linux (patch #5)
    3) Changes for Xen (patch #6)

I also took the opportunity of the resync to consolidate the iommu ops in a
single set. When I added the IOMMU set to handle platform device passthrough
(ops assign_dt_device and reassign_dt_device), I didn't think about merging
the ops with the PCI one. In fact Linux is using a signel set and have only
few lines per driver specific to each set (PCI or platform device).

A branch is available with all changes:
    git://xenbits.xen.org/people/julieng/xen-unstable.git branch smmu-rework-v4

Major changes in v4:
    - Drop the support of midway in the patch which will be upstreamed.
    - Re-order/re-work the SMMU changes in order to modify less the Linux code.

Major changes in v3:
    - Add back coherent walk support (see patch #13)

Major changes in v2:
    - Introduce the geneirc struct to describe device on ARM. Alias it
    to pci_dev on x86.
    - Defer the introduction of PCI in the generic device later

For all changes see each patches.

I have summarized below the patch acked/modified:

    A: Patch acked
    M: Patch modified in this version

Sincerely yours,

Julien Grall (8):
  xen/iommu: arm: Remove temporary the SMMU driver
  xen/arm: Introduce a generic way to describe device
  xen/iommu: Consolidate device assignment ops into a single set
  xen/arm: Describe devices supported by a driver with dt_device_match
  xen/iommu: arm: Import the SMMU driver from Linux
  xen/iommu: smmu: Add Xen specific code to be able to use the driver
  xen/iommu: smmu: Advertise when the SMMU support coherent table walk
  DO NOT APPLY xen/iommu: smmu: Changes to support Midway SMMU

 xen/arch/arm/device.c                 |   21 +-
 xen/arch/arm/gic-v2.c                 |   10 +-
 xen/arch/arm/gic-v3.c                 |    8 +-
 xen/common/device_tree.c              |    3 +
 xen/drivers/char/exynos4210-uart.c    |    8 +-
 xen/drivers/char/ns16550.c            |   12 +-
 xen/drivers/char/omap-uart.c          |    8 +-
 xen/drivers/char/pl011.c              |    8 +-
 xen/drivers/char/scif-uart.c          |    8 +-
 xen/drivers/passthrough/arm/smmu.c    | 4057 +++++++++++++++++++++------------
 xen/drivers/passthrough/device_tree.c |    5 +-
 xen/drivers/passthrough/pci.c         |   20 +-
 xen/include/asm-arm/device.h          |   30 +-
 xen/include/asm-arm/gic.h             |   15 +-
 xen/include/asm-x86/device.h          |   25 +
 xen/include/xen/device_tree.h         |   13 +
 xen/include/xen/iommu.h               |   18 +-
 xen/include/xen/pci.h                 |    1 +
 18 files changed, 2672 insertions(+), 1598 deletions(-)
 create mode 100644 xen/include/asm-x86/device.h

-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

Reply via email to