From: Chao Gao <chao.gao@intel.com>
To: xen-devel@lists.xen.org
Cc: "Kevin Tian" <kevin.tian@intel.com>,
"Stefano Stabellini" <sstabellini@kernel.org>,
"Wei Liu" <wei.liu2@citrix.com>,
"Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>,
"George Dunlap" <George.Dunlap@eu.citrix.com>,
"Ian Jackson" <ian.jackson@eu.citrix.com>,
"Tim Deegan" <tim@xen.org>, "Jan Beulich" <jbeulich@suse.com>,
"Andrew Cooper" <andrew.cooper3@citrix.com>,
"Chao Gao" <chao.gao@intel.com>,
"Roger Pau Monné" <roger.pau@citrix.com>
Subject: [PATCH v4 00/28] add vIOMMU support with irq remapping function of virtual VT-d
Date: Fri, 17 Nov 2017 14:22:07 +0800 [thread overview]
Message-ID: <1510899755-40237-1-git-send-email-chao.gao@intel.com> (raw)
This patchset is to introduce vIOMMU framework and add virtual VTD's
interrupt remapping support according "Xen virtual IOMMU high level
design doc V3"(https://lists.xenproject.org/archives/html/xen-devel/
2016-11/msg01391.html).
- vIOMMU framework
New framework provides viommu_ops and help functions to abstract
vIOMMU operations(E,G create, destroy, handle irq remapping request
and so on). Vendors(Intel, ARM, AMD and son) can implement their
vIOMMU callbacks.
- Virtual VTD
We enable irq remapping function and covers both
MSI and IOAPIC interrupts. Don't support post interrupt mode emulation
and post interrupt mode enabled on host with virtual VTD. will add
later.
In case of conflicts, this series also can be found in my personal github:
Xen: https://github.com/gc1008/viommu_xen.git vIOMMU4
Qemu: https://github.com/gc1008/viommu_qemu.git vIOMMU3
Any comments would be highly appreciated. And below is change history.
Changes since v3:
- add logic to build DMAR table for PVH guest. But only very limited tests are
performed on PVH guest.
- use one interface to binding guest remappable and non-remappable interrupts
with physical interrupts. To achieve this, current binding interface should
be changed. The advantage is that it can simplify the code to support the
new format guest interrupt. But the disadvantage is clearly incompatible with
old QEMU.
- VT-d posted interrupt feature can be used to deliver guest remappable
interrupt. The guest interrupt attributes (vector, affinity) are decoded from
guest IRTE and then accordingly written to host IRTE. In this version, when
guest invalidates an IRTE, the host IRTE will be updated according to the
new guest IRTE.
- add draining in-flight interrupt support. When guest invalidates
an IRTE, the in-flight interrupt related to the IRTE should be drained.
This version provides a very simple solution: process QI only when no
interrupt is delivering which definitely implies there is no in-flight
interrupt.
- use locks in QI and fault handling sub-feature. These locks guarantee
the registers/status won't be changed by guest when vvtd is dealing with
faults or invalidation requests.
- move viommu structure under hvm domain rather than making it a field of
struct domain.
- remove unneeded domctl interface for destroying viommu. Currently, dynamic
destruction aren't needed.
- reorder the patches per Roger's suggestion: the viommu abstract goes first,
then the implementation of emulated VT-d, several hooks of
configuring/delivering guest interrupt and EOI, and related changes of
toolstack.
- fix many coding style issues pointed out by Roger.
Change since v2:
1) Remove vIOMMU hypercall of query capabilities and introduce when
necessary.
2) Remove length field of vIOMMU create parameter of vIOMMU hypercall
3) Introduce irq remapping mode callback to vIOMMU framework and vIOMMU
device models
can check irq remapping mode by vendor specific ways.
4) Update vIOMMU docs.
5) Other changes please see patches' change logs.
Change since v1:
1) Fix coding style issues
2) Add definitions for vIOMMU type and capabilities
3) Change vIOMMU kconfig and select vIOMMU default on x86
4) Put vIOMMU creation in libxl__arch_domain_create()
5) Make vIOMMU structure of tool stack more general for both PV and HVM.
Change since RFC v2:
1) Move vvtd.c to drivers/passthrough/vtd directroy.
2) Make vIOMMU always built in on x86
3) Add new boot cmd "viommu" to enable viommu function
4) Fix some code stype issues.
Change since RFC v1:
1) Add Xen virtual IOMMU doc docs/misc/viommu.txt
2) Move vIOMMU hypercall of create/destroy vIOMMU and query
capabilities from dmop to domctl suggested by Paul Durrant. Because
these hypercalls can be done in tool stack and more VM mode(E,G PVH
or other modes don't use Qemu) can be benefit.
3) Add check of input MMIO address and length.
4) Add iommu_type in vIOMMU hypercall parameter to specify
vendor vIOMMU device model(E,G Intel VTD, AMD or ARM IOMMU. So far
only support Intel VTD).
5) Add save and restore support for vvtd
Chao Gao (23):
vtd: clean-up and preparation for vvtd
x86/hvm: Introduce a emulated VTD for HVM
x86/vvtd: Add MMIO handler for VVTD
x86/vvtd: Set Interrupt Remapping Table Pointer through GCMD
x86/vvtd: Enable Interrupt Remapping through GCMD
x86/vvtd: Process interrupt remapping request
x86/vvtd: decode interrupt attribute from IRTE
x86/vvtd: add a helper function to decide the interrupt format
x86/vvtd: Handle interrupt translation faults
x86/vvtd: Enable Queued Invalidation through GCMD
x86/vvtd: Add queued invalidation (QI) support
x86/vvtd: save and restore emulated VT-d
x86/vioapic: Hook interrupt delivery of vIOAPIC
x86/vioapic: extend vioapic_get_vector() to support remapping format
RTE
xen/pt: when binding guest msi, accept the whole msi message
vvtd: update hvm_gmsi_info when binding guest msi with pirq or
x86/vmsi: Hook delivering remapping format msi to guest and handling
eoi
tools/libacpi: Add DMA remapping reporting (DMAR) ACPI table
structures
tools/libacpi: Add new fields in acpi_config for DMAR table
tools/libxl: Add an user configurable parameter to control vIOMMU
attributes
tools/libxl: build DMAR table for a guest with one virtual VTD
tools/libxl: create vIOMMU during domain construction
tools/libxc: Add viommu operations in libxc
Lan Tianyu (5):
Xen/doc: Add Xen virtual IOMMU doc
VIOMMU: Add vIOMMU framework and vIOMMU domctl
VIOMMU: Add irq request callback to deal with irq remapping
VIOMMU: Add get irq info callback to convert irq remapping request
VIOMMU: Introduce callback of checking irq remapping mode
docs/man/xl.cfg.pod.5.in | 27 +
docs/misc/viommu.txt | 120 +++
docs/misc/xen-command-line.markdown | 7 +
tools/firmware/hvmloader/ovmf.c | 2 +-
tools/libacpi/acpi2_0.h | 61 ++
tools/libacpi/build.c | 61 ++
tools/libacpi/libacpi.h | 10 +
tools/libxc/Makefile | 1 +
tools/libxc/include/xenctrl.h | 10 +-
tools/libxc/xc_domain.c | 14 +-
tools/libxc/xc_viommu.c | 51 ++
tools/libxl/libxl_arch.h | 1 +
tools/libxl/libxl_create.c | 47 ++
tools/libxl/libxl_types.idl | 12 +
tools/libxl/libxl_x86.c | 21 +-
tools/libxl/libxl_x86_acpi.c | 98 ++-
tools/xl/xl_parse.c | 50 +-
xen/arch/x86/Kconfig | 1 +
xen/arch/x86/hvm/hvm.c | 5 +-
xen/arch/x86/hvm/irq.c | 6 +
xen/arch/x86/hvm/vioapic.c | 23 +-
xen/arch/x86/hvm/vmsi.c | 33 +-
xen/arch/x86/xen.lds.S | 3 +
xen/common/Kconfig | 3 +
xen/common/Makefile | 1 +
xen/common/domctl.c | 7 +
xen/common/viommu.c | 171 +++++
xen/drivers/passthrough/io.c | 144 ++--
xen/drivers/passthrough/vtd/Makefile | 7 +-
xen/drivers/passthrough/vtd/iommu.h | 197 +++--
xen/drivers/passthrough/vtd/vvtd.c | 1301 ++++++++++++++++++++++++++++++++
xen/include/asm-x86/hvm/domain.h | 3 +
xen/include/asm-x86/hvm/hvm.h | 2 +
xen/include/asm-x86/hvm/irq.h | 6 +-
xen/include/asm-x86/viommu.h | 82 ++
xen/include/public/arch-x86/hvm/save.h | 18 +-
xen/include/public/domctl.h | 39 +-
xen/include/xen/viommu.h | 85 +++
38 files changed, 2603 insertions(+), 127 deletions(-)
create mode 100644 docs/misc/viommu.txt
create mode 100644 tools/libxc/xc_viommu.c
create mode 100644 xen/common/viommu.c
create mode 100644 xen/drivers/passthrough/vtd/vvtd.c
create mode 100644 xen/include/asm-x86/viommu.h
create mode 100644 xen/include/xen/viommu.h
--
1.8.3.1
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next reply other threads:[~2017-11-17 6:22 UTC|newest]
Thread overview: 83+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-17 6:22 Chao Gao [this message]
2017-11-17 6:22 ` [PATCH v4 01/28] Xen/doc: Add Xen virtual IOMMU doc Chao Gao
2018-02-09 12:54 ` Roger Pau Monné
2018-02-09 15:53 ` Chao Gao
2017-11-17 6:22 ` [PATCH v4 02/28] VIOMMU: Add vIOMMU framework and vIOMMU domctl Chao Gao
2018-02-09 14:33 ` Roger Pau Monné
2018-02-09 16:13 ` Chao Gao
2017-11-17 6:22 ` [PATCH v4 03/28] VIOMMU: Add irq request callback to deal with irq remapping Chao Gao
2018-02-09 15:02 ` Roger Pau Monné
2018-02-09 16:21 ` Chao Gao
2017-11-17 6:22 ` [PATCH v4 04/28] VIOMMU: Add get irq info callback to convert irq remapping request Chao Gao
2018-02-09 15:06 ` Roger Pau Monné
2018-02-09 16:34 ` Chao Gao
2017-11-17 6:22 ` [PATCH v4 05/28] VIOMMU: Introduce callback of checking irq remapping mode Chao Gao
2018-02-09 15:11 ` Roger Pau Monné
2018-02-09 16:47 ` Chao Gao
2018-02-12 10:21 ` Roger Pau Monné
2017-11-17 6:22 ` [PATCH v4 06/28] vtd: clean-up and preparation for vvtd Chao Gao
2018-02-09 15:17 ` Roger Pau Monné
2018-02-09 16:51 ` Chao Gao
2017-11-17 6:22 ` [PATCH v4 07/28] x86/hvm: Introduce a emulated VTD for HVM Chao Gao
2018-02-09 16:27 ` Roger Pau Monné
2018-02-09 17:12 ` Chao Gao
2018-02-12 10:35 ` Roger Pau Monné
2017-11-17 6:22 ` [PATCH v4 08/28] x86/vvtd: Add MMIO handler for VVTD Chao Gao
2018-02-09 16:39 ` Roger Pau Monné
2018-02-09 17:21 ` Chao Gao
2018-02-09 17:51 ` Roger Pau Monné
2018-02-22 6:20 ` Chao Gao
2018-02-23 17:07 ` Roger Pau Monné
2018-02-23 17:37 ` Wei Liu
2017-11-17 6:22 ` [PATCH v4 09/28] x86/vvtd: Set Interrupt Remapping Table Pointer through GCMD Chao Gao
2018-02-09 16:59 ` Roger Pau Monné
2018-02-11 4:34 ` Chao Gao
2018-02-11 5:09 ` Chao Gao
2018-02-12 11:25 ` Roger Pau Monné
2017-11-17 6:22 ` [PATCH v4 10/28] x86/vvtd: Enable Interrupt Remapping " Chao Gao
2018-02-09 17:15 ` Roger Pau Monné
2018-02-11 5:05 ` Chao Gao
2018-02-12 11:30 ` Roger Pau Monné
2018-02-22 6:25 ` Chao Gao
2017-11-17 6:22 ` [PATCH v4 11/28] x86/vvtd: Process interrupt remapping request Chao Gao
2018-02-09 17:44 ` Roger Pau Monné
2018-02-11 5:31 ` Chao Gao
2018-02-23 17:04 ` Roger Pau Monné
2017-11-17 6:22 ` [PATCH v4 12/28] x86/vvtd: decode interrupt attribute from IRTE Chao Gao
2018-02-12 11:55 ` Roger Pau Monné
2018-02-22 6:33 ` Chao Gao
2017-11-17 6:22 ` [PATCH v4 13/28] x86/vvtd: add a helper function to decide the interrupt format Chao Gao
2018-02-12 12:14 ` Roger Pau Monné
2017-11-17 6:22 ` [PATCH v4 14/28] x86/vvtd: Handle interrupt translation faults Chao Gao
2018-02-12 12:55 ` Roger Pau Monné
2018-02-22 8:23 ` Chao Gao
2017-11-17 6:22 ` [PATCH v4 15/28] x86/vvtd: Enable Queued Invalidation through GCMD Chao Gao
2018-02-12 14:04 ` Roger Pau Monné
2018-02-22 10:33 ` Chao Gao
2017-11-17 6:22 ` [PATCH v4 16/28] x86/vvtd: Add queued invalidation (QI) support Chao Gao
2018-02-12 14:36 ` Roger Pau Monné
2018-02-23 4:38 ` Chao Gao
2017-11-17 6:22 ` [PATCH v4 17/28] x86/vvtd: save and restore emulated VT-d Chao Gao
2018-02-12 14:49 ` Roger Pau Monné
2018-02-23 5:22 ` Chao Gao
2018-02-23 17:19 ` Roger Pau Monné
2017-11-17 6:22 ` [PATCH v4 18/28] x86/vioapic: Hook interrupt delivery of vIOAPIC Chao Gao
2018-02-12 14:54 ` Roger Pau Monné
2018-02-24 1:51 ` Chao Gao
2018-02-24 3:17 ` Tian, Kevin
2017-11-17 6:22 ` [PATCH v4 19/28] x86/vioapic: extend vioapic_get_vector() to support remapping format RTE Chao Gao
2018-02-12 15:01 ` Roger Pau Monné
2017-11-17 6:22 ` [PATCH v4 20/28] xen/pt: when binding guest msi, accept the whole msi message Chao Gao
2018-02-12 15:16 ` Roger Pau Monné
2018-02-24 2:20 ` Chao Gao
2017-11-17 6:22 ` [PATCH v4 21/28] vvtd: update hvm_gmsi_info when binding guest msi with pirq or Chao Gao
2018-02-12 15:38 ` Roger Pau Monné
2018-02-24 5:05 ` Chao Gao
2017-11-17 6:22 ` [PATCH v4 22/28] x86/vmsi: Hook delivering remapping format msi to guest and handling eoi Chao Gao
2017-11-17 6:22 ` [PATCH v4 23/28] tools/libacpi: Add DMA remapping reporting (DMAR) ACPI table structures Chao Gao
2017-11-17 6:22 ` [PATCH v4 24/28] tools/libacpi: Add new fields in acpi_config for DMAR table Chao Gao
2017-11-17 6:22 ` [PATCH v4 25/28] tools/libxl: Add an user configurable parameter to control vIOMMU attributes Chao Gao
2017-11-17 6:22 ` [PATCH v4 26/28] tools/libxl: build DMAR table for a guest with one virtual VTD Chao Gao
2017-11-17 6:22 ` [PATCH v4 27/28] tools/libxl: create vIOMMU during domain construction Chao Gao
2017-11-17 6:22 ` [PATCH v4 28/28] tools/libxc: Add viommu operations in libxc Chao Gao
2018-10-04 15:51 ` [PATCH v4 00/28] add vIOMMU support with irq remapping function of virtual VT-d Jan Beulich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1510899755-40237-1-git-send-email-chao.gao@intel.com \
--to=chao.gao@intel.com \
--cc=George.Dunlap@eu.citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=jbeulich@suse.com \
--cc=kevin.tian@intel.com \
--cc=konrad.wilk@oracle.com \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--cc=tim@xen.org \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.