[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [RFC PATCH 0/9] "Non-shared" IOMMU support on ARM



Hi, all.

The purpose of this patch series is to create a base for porting
any "Non-shared" IOMMUs to Xen on ARM. Saying "Non-shared" IOMMU I mean
the IOMMU that can't share the page table with the CPU.
Primarily, we are interested in IPMMU-VMSA and I hope that it will be the first 
candidate.
It is VMSA-compatible IOMMU that integrated in the newest Renesas R-Car Gen3 
SoCs (ARM).
And this IOMMU can't share the page table with the CPU since it uses
stage-1 page table unlike the CPU that uses stage-2 therefore I name it
"Non-shared" IOMMU.

I have already raised disscusion [2] about some generic problems I had faced
during porting IPMMU-VMSA Linux driver to Xen. And on this basis I made
patches you can see it in this request. Only the first patch is not related to 
IOMMU. But, I decided to ship it with the current request since it is a generic 
change
which we will need in a moment.

The reason for this patch series to be RFC is that I still have some doubts 
about generic code I touched.
I hope that I haven't broken anything for x86, but confirmation is needed.

I didn't include IPMMU-VMSA driver in this request. Although, I am still in 
progress, I want to say
that passthrough use-cases (actually what this all are firstly needed for) work 
for me with some limitations.
I tested on Salvator-X board (R-Car H3) with the next devices that have DMA IPs
connected to IPMMU uTLBs (using current master branch):
1. AUDMA is assigned to dom0 (protected by IOMMU)
2. SDHC0 is assigned to dom1 (passthrough to domain)
3. SDHC3 is assigned to dom2 (passthrough to domain)

During porting IPMMU-VMSA driver to Xen I was trying to be as close as possible 
to Linux [1]. But,
it was a little bit difficult). It would be really nice to have some feedback 
and get your feeling regarding this driver.
I am also interested in if I took the right direction or there are some other 
ideas on doing the same.
So, is it a right direction to move on?

You can find IPMMU-VMSA driver here.
repo: https://github.com/otyshchenko1/xen.git branch: ipmmu_ml
or
https://github.com/otyshchenko1/xen/commits/ipmmu_ml
It is located on top of "Unshared" IOMMU patch series and consist of 6 patches.

Thank you.

[1] Question about porting IPMMU-VMSA Linux driver to XEN
https://lists.xenproject.org/archives/html/xen-devel/2016-12/msg00992.html
[2] Unshared IOMMU issues 
https://lists.xenproject.org/archives/html/xen-devel/2017-02/msg01781.html

Oleksandr Tyshchenko (9):
  xen/device-tree: Add dt_count_phandle_with_args helper
  iommu: Add ability to map/unmap the number of pages
  xen/arm: p2m: Add helper to convert p2m type to IOMMU flags
  xen/arm: p2m: Update IOMMU mapping whenever possible if page table is
    not shared
  iommu/arm: Re-define iommu_use_hap_pt(d) as iommu_hap_pt_share
  iommu: Pass additional use_iommu argument to iommu_domain_init()
  iommu/arm: Add alloc_page_table platform callback
  iommu: Split iommu_hwdom_init() into arch specific parts
  xen: Add use_iommu flag to createdomain domctl

 tools/libxl/libxl_create.c          |  5 ++
 xen/arch/arm/domain.c               |  4 +-
 xen/arch/arm/p2m.c                  | 40 +++++++++++++++-
 xen/arch/x86/domain.c               |  4 +-
 xen/common/device_tree.c            |  7 +++
 xen/common/domctl.c                 |  5 +-
 xen/drivers/passthrough/arm/iommu.c | 12 ++++-
 xen/drivers/passthrough/arm/smmu.c  |  3 ++
 xen/drivers/passthrough/iommu.c     | 91 ++++++++++++++++++++-----------------
 xen/drivers/passthrough/x86/iommu.c | 36 +++++++++++++++
 xen/include/asm-arm/iommu.h         |  7 ++-
 xen/include/asm-arm/p2m.h           | 34 ++++++++++++++
 xen/include/public/domctl.h         |  3 ++
 xen/include/xen/device_tree.h       | 19 ++++++++
 xen/include/xen/iommu.h             | 20 ++++++--
 xen/include/xen/sched.h             |  3 ++
 16 files changed, 239 insertions(+), 54 deletions(-)

-- 
2.7.4


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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.