Re: [virtio-dev] Re: [RFC 0/3] virtio-iommu: a paravirtualized IOMMU

2017-04-10 Thread Jean-Philippe Brucker
On 07/04/17 22:19, Michael S. Tsirkin wrote: > On Fri, Apr 07, 2017 at 08:17:44PM +0100, Jean-Philippe Brucker wrote: >> There are a number of advantages in a paravirtualized IOMMU over a full >> emulation. It is portable and could be reused on different architectures. >> It i

[virtio-dev] Re: [RFC 0/3] virtio-iommu: a paravirtualized IOMMU

2017-04-13 Thread Jean-Philippe Brucker
On 13/04/17 09:16, Tian, Kevin wrote: >> From: Jason Wang >> Sent: Wednesday, April 12, 2017 5:07 PM >> >> On 2017年04月08日 03:17, Jean-Philippe Brucker wrote: >>> This is the initial proposal for a paravirtualized IOMMU device using >>> virtio transpor

[virtio-dev] Re: [RFC 0/3] virtio-iommu: a paravirtualized IOMMU

2017-04-13 Thread Jean-Philippe Brucker
On 13/04/17 09:41, Tian, Kevin wrote: >> From: Jean-Philippe Brucker >> Sent: Saturday, April 8, 2017 3:18 AM >> >> This is the initial proposal for a paravirtualized IOMMU device using >> virtio transport. It contains a description of the device, a Linux drive

[virtio-dev] Re: [RFC 1/3] virtio-iommu: firmware description of the virtual topology

2017-04-18 Thread Jean-Philippe Brucker
On 18/04/17 10:51, Tian, Kevin wrote: >> From: Jean-Philippe Brucker >> Sent: Saturday, April 8, 2017 3:18 AM >> >> Unlike other virtio devices, the virtio-iommu doesn't work independently, >> it is linked to other virtual or assigned devices. So before jumping into

[virtio-dev] Re: [RFC 2/3] virtio-iommu: device probing and operations

2017-04-18 Thread Jean-Philippe Brucker
On 18/04/17 11:26, Tian, Kevin wrote: >> From: Jean-Philippe Brucker >> Sent: Saturday, April 8, 2017 3:18 AM >> > [...] >> II. Feature bits >> >> >> VIRTIO_IOMMU_F_INPUT_RANGE (0) >> Available range of virtual addr

[virtio-dev] [RFC PATCH kvmtool 12/15] vfio: add support for virtual IOMMU

2017-04-07 Thread Jean-Philippe Brucker
to be attached to the same address space, they all have different page tables. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> --- include/kvm/iommu.h | 6 ++ include/kvm/vfio.h | 2 + iommu.c | 7 +- vfio.c

[virtio-dev] [RFC PATCH kvmtool 10/15] virtio-pci: translate MSIs with the virtual IOMMU

2017-04-07 Thread Jean-Philippe Brucker
into a physical one, and store it in a secondary table for easy access. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> --- include/kvm/iommu.h | 4 include/kvm/virtio-pci.h | 1 + iommu.c | 23 +++ virtio/pci.c

[virtio-dev] [RFC PATCH kvmtool 06/15] irq: register MSI doorbell addresses

2017-04-07 Thread Jean-Philippe Brucker
For passed-through devices behind a vIOMMU, we'll need to translate writes to MSI vectors. Let the IRQ code register MSI doorbells, and add a simple way for other systems to check if an address is a doorbell. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> --- arm

[virtio-dev] [RFC PATCH kvmtool 07/15] virtio: factor virtqueue initialization

2017-04-07 Thread Jean-Philippe Brucker
All virtio devices are doing the same few operations when initializing their virtqueues. Move these operations to virtio core, as we'll have to complexify vring initialization when implementing a virtual IOMMU. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> --- inclu

[virtio-dev] [RFC PATCH kvmtool 14/15] virtio-iommu: implement basic debug commands

2017-04-07 Thread Jean-Philippe Brucker
stics at the moment, since there is no concurrent write on most of them. Only 'accesses' might be incremented concurrently, so we might get imprecise values. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> --- include/kvm/iommu.h | 17

[virtio-dev] [RFC 1/3] virtio-iommu: firmware description of the virtual topology

2017-04-07 Thread Jean-Philippe Brucker
Unlike other virtio devices, the virtio-iommu doesn't work independently, it is linked to other virtual or assigned devices. So before jumping into device operations, we need to define a way for the guest to discover the virtual IOMMU and the devices it translates. The host must describe the

[virtio-dev] [RFC 0/3] virtio-iommu: a paravirtualized IOMMU

2017-04-07 Thread Jean-Philippe Brucker
This is the initial proposal for a paravirtualized IOMMU device using virtio transport. It contains a description of the device, a Linux driver, and a toy implementation in kvmtool. With this prototype, you can translate DMA to guest memory from emulated (virtio), or passed-through (VFIO) devices.

[virtio-dev] [RFC PATCH linux] iommu: Add virtio-iommu driver

2017-04-07 Thread Jean-Philippe Brucker
be calmer in next versions. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> --- drivers/iommu/Kconfig | 11 + drivers/iommu/Makefile| 1 + drivers/iommu/virtio-iommu.c | 980 ++ include/uapi/linux/

[virtio-dev] [RFC PATCH kvmtool 03/15] virtio: add virtio-iommu

2017-04-07 Thread Jean-Philippe Brucker
MMU features. Add a global --viommu parameter to enable the virtual IOMMU. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> --- Makefile | 1 + builtin-run.c | 2 + include/kvm/devices.h | 4 + include/kvm/iommu.h| 64 +

[virtio-dev] [RFC PATCH kvmtool 05/15] iommu: describe IOMMU topology in device-trees

2017-04-07 Thread Jean-Philippe Brucker
in kvmtool. Add an "iommus" property to plaform devices that are behind an iommu. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> --- arm/pci.c | 49 - fdt.c | 20 include/kvm/

[virtio-dev] [RFC PATCH kvmtool 00/15] Add virtio-iommu

2017-04-07 Thread Jean-Philippe Brucker
ARM Juno. [1] http://www.spinics.net/lists/kvm/msg147624.html Jean-Philippe Brucker (15): virtio: synchronize virtio-iommu headers with Linux FDT: (re)introduce a dynamic phandle allocator virtio: add virtio-iommu Add a simple IOMMU iommu: describe IOMMU topology in device-trees irq: r

[virtio-dev] [RFC PATCH kvmtool 01/15] virtio: synchronize virtio-iommu headers with Linux

2017-04-07 Thread Jean-Philippe Brucker
Pull virtio-iommu header (initial proposal) from Linux. Also add virtio_config.h because it defines VIRTIO_F_IOMMU_PLATFORM, which I'm going to need soon, and it's not provided by my toolchain. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> --- include/linux/virtio_co

[virtio-dev] Re: [RFC] virtio-iommu version 0.4

2017-08-14 Thread Jean-Philippe Brucker
On 14/08/17 09:27, Tian, Kevin wrote: >> * First, since the IOMMU is paravirtualized, the device can expose some >> properties of the physical topology to the guest, and let it allocate >> resources more efficiently. For example, when the virtio-iommu manages >> both physical and emulated

Re: [virtio-dev] [RFC] virtio-iommu version 0.4

2017-08-17 Thread Jean-Philippe Brucker
Hi Adam, On 16/08/17 05:08, Adam Tao wrote: >> * There is a working Qemu prototype [3], thanks to Eric Auger and Bharat >> Bhushan. > Hi, Brucker > I read the related spec for virtio IOMMU, > I am wondering if we support both the virtual and physical devices in > the guest to use the virtio

[virtio-dev] Re: [RFC 2/3] virtio-iommu: device probing and operations

2017-04-24 Thread Jean-Philippe Brucker
On 21/04/17 10:02, Tian, Kevin wrote: >> From: Jean-Philippe Brucker [mailto:jean-philippe.bruc...@arm.com] >> Sent: Wednesday, April 19, 2017 2:46 AM >> >> On 18/04/17 11:26, Tian, Kevin wrote: >>>> From: Jean-Philippe Brucker >>>> Sent: Saturday

[virtio-dev] Re: [RFC 1/3] virtio-iommu: firmware description of the virtual topology

2017-04-24 Thread Jean-Philippe Brucker
On 21/04/17 09:43, Tian, Kevin wrote: >> From: Jean-Philippe Brucker [mailto:jean-philippe.bruc...@arm.com] >> Sent: Wednesday, April 19, 2017 2:41 AM >> >> On 18/04/17 10:51, Tian, Kevin wrote: >>>> From: Jean-Philippe Brucker >>>> Sent: Saturd

[virtio-dev] [RFC] virtio-iommu v0.4 - Implementation notes

2017-08-04 Thread Jean-Philippe Brucker
The following is roughly the content of topology.tex and MSI.tex --- \section{Implementation notes}\label{sec:viommu} \subsection{Virtual system topology}\label{sec:viommu / Virtual topology} \subsubsection{Example virtual topology}\label{sec:viommu / Virtual topology / Example}

[virtio-dev] [RFC] virtio-iommu v0.4 - IOMMU Device

2017-08-04 Thread Jean-Philippe Brucker
The following is roughly the content of device-operations.tex --- \section{IOMMU device}\label{sec:Device Types / IOMMU Device} The virtio-iommu device manages Direct Memory Access (DMA) from one or more endpoints. It may act as a proxy for multiple physical IOMMUs managing devices assigned to

[virtio-dev] Re: [RFC 2/3] virtio-iommu: device probing and operations

2017-08-22 Thread Jean-Philippe Brucker
On 22/08/17 07:24, Tian, Kevin wrote: >>> (sorry to pick up this old thread, as the .tex one is not good for review >>> and this thread provides necessary background for IOASID). >>> >>> Hi, Jean, >>> >>> I'd like to hear more clarification regarding the relationship between >>> IOASID and PASID.

[virtio-dev] Re: [RFC PATCH kvmtool 00/15] Add virtio-iommu

2017-05-22 Thread Jean-Philippe Brucker
Hi Bharat, On 22/05/17 09:26, Bharat Bhushan wrote: > Hi Jean, > > I am trying to run and review on my side but I see Linux patches are not with > latest kernel version. > Will it be possible for you to share your Linux and kvmtool git repository > reference? Please find linux and kvmtool

Re: [virtio-dev] [RFC PATCH linux] iommu: Add virtio-iommu driver

2017-06-16 Thread Jean-Philippe Brucker
On 16/06/17 09:48, Bharat Bhushan wrote: > Hi Jean >> +static int viommu_map(struct iommu_domain *domain, unsigned long iova, >> + phys_addr_t paddr, size_t size, int prot) { >> +int ret; >> +struct viommu_domain *vdomain = to_viommu_domain(domain); >> +struct

[virtio-dev] Re: [RFC] virtio-iommu version 0.4

2017-09-19 Thread Jean-Philippe Brucker
Hi Eric, On 12/09/17 18:13, Auger Eric wrote: > 2.6.7 > - As I am currently integrating v0.4 in QEMU here are some other comments: > At the moment struct virtio_iommu_req_probe flags is missing in your > header. As such I understood the ACK protocol was not implemented by the > driver in your

[virtio-dev] Re: [RFC] virtio-iommu version 0.4

2017-09-21 Thread Jean-Philippe Brucker
On 20/09/17 10:37, Auger Eric wrote: > Hi Jean, > On 19/09/2017 12:47, Jean-Philippe Brucker wrote: >> Hi Eric, >> >> On 12/09/17 18:13, Auger Eric wrote: >>> 2.6.7 >>> - As I am currently integrating v0.4 in QEMU here are some other comments: >>>

Re: [virtio-dev] [RFC] virtio-iommu version 0.4

2017-10-09 Thread Jean-Philippe Brucker
d of kmalloc. Thanks, Jean --- 8< --- >From 3fc957560e1e6f070a0468bf75ebc4862d37ff82 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> Date: Mon, 9 Oct 2017 20:13:57 +0100 Subject: [PATCH] iommu/virtio-iommu: Allocate all requests on the heap When

[virtio-dev] Re: [RFC] virtio-iommu version 0.4

2017-09-06 Thread Jean-Philippe Brucker
Hi Kevin, On 28/08/17 08:39, Tian, Kevin wrote: > Here comes some comments: > > 1.1 Motivation > > You describe I/O page faults handling as future work. Seems you considered > only recoverable fault (since "aka. PCI PRI" being used). What about other > unrecoverable faults e.g. what to do if a

Re: [virtio-dev] RE: [RFC] virtio-iommu version 0.4

2017-09-25 Thread Jean-Philippe Brucker
On 21/09/17 07:27, Tian, Kevin wrote: >> From: Jean-Philippe Brucker >> Sent: Wednesday, September 6, 2017 7:55 PM >> >> Hi Kevin, >> >> On 28/08/17 08:39, Tian, Kevin wrote: >>> Here comes some comments: >>> >>> 1.1 Motivation >

[virtio-dev] [RFC] virtio-iommu version 0.5

2017-10-23 Thread Jean-Philippe Brucker
This is version 0.5 of the virtio-iommu specification, the paravirtualized IOMMU. This version addresses feedback from v0.4 and adds an event virtqueue. Please find the specification, LaTeX sources and pdf, at: git://linux-arm.org/virtio-iommu.git viommu/v0.5

[virtio-dev] Re: [RFC] virtio-iommu version 0.5

2017-10-24 Thread Jean-Philippe Brucker
Hi Linu, On 24/10/17 07:27, Linu Cherian wrote: > Hi Jean, > > On Mon Oct 23, 2017 at 10:32:41AM +0100, Jean-Philippe Brucker wrote: >> This is version 0.5 of the virtio-iommu specification, the paravirtualized >> IOMMU. This version addresses feedback from v0.4 and ad

Re: [virtio-dev] [RFC PATCH v2 1/5] iommu: Add virtio-iommu driver

2017-11-29 Thread Jean-Philippe Brucker
On 17/11/17 18:52, Jean-Philippe Brucker wrote: [...] > +struct viommu_domain { > + struct iommu_domain domain; > + struct viommu_dev *viommu; > + struct mutexmutex; > + unsigned intid; > +

[virtio-dev] [RFC PATCH v2 4/5] ACPI/IORT: Support paravirtualized IOMMU

2017-11-17 Thread Jean-Philippe Brucker
s multiple remapping devices -- currently only ARM IOMMUs and MSI controllers, but it is easy to extend. IORT table and drivers are easiest to extend and they do the job, so rather than introducing a fourth solution to solve a generic problem, reuse what exists. Signed-off-by: Jean-Philippe Bru

[virtio-dev] [RFC PATCH v2 3/5] iommu/virtio-iommu: Add event queue

2017-11-17 Thread Jean-Philippe Brucker
The event queue offers a way for the device to report access faults from devices. It is implemented on virtqueue #1, whenever the host needs to signal a fault it fills one of the buffers offered by the guest and interrupts it. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.

[virtio-dev] [RFC PATCH v2 2/5] iommu/virtio-iommu: Add probe request

2017-11-17 Thread Jean-Philippe Brucker
in the virtio-iommu, because MSIs bypass it. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> --- drivers/iommu/virtio-iommu.c | 165 -- include/uapi/linux/virtio_iommu.h | 37 + 2 files changed, 195 insertions(+), 7 deletions(-)

[virtio-dev] [RFC PATCH v2 0/5] Add virtio-iommu driver

2017-11-17 Thread Jean-Philippe Brucker
://lists.gnu.org/archive/html/qemu-arm/2017-09/msg00413.html [4] git://linux-arm.org/kvmtool-jpb.git virtio-iommu/base [5] git://linux-arm.org/linux-jpb.git virtio-iommu/v0.5-dev Jean-Philippe Brucker (5): iommu: Add virtio-iommu driver iommu/virtio-iommu: Add probe request iommu/virtio-iommu: Add event

[virtio-dev] Re: [RFC] virtio-iommu version 0.5

2017-12-01 Thread Jean-Philippe Brucker
used to unmap the whole address space in one go. UNMAP(domain, 0, ~0ULL) should now remove all mappings. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> --- device-operations.tex | 124 +- 1 file changed, 61 insertions(+), 63

[virtio-dev] Re: [RFC] virtio-iommu version 0.5

2017-10-25 Thread Jean-Philippe Brucker
On 25/10/17 08:07, Linu Cherian wrote: > Hi Jean, > > On Tue Oct 24, 2017 at 10:28:59PM +0530, Linu Cherian wrote: >> Hi Jean, >> Thanks for your reply. >> >> On Tue Oct 24, 2017 at 09:37:12AM +0100, Jean-Philippe Brucker wrote: >>> Hi Linu, >>>

[virtio-dev] Re: Status of virtio-iommu

2017-10-30 Thread Jean-Philippe Brucker
On 30/10/17 16:40, Michael S. Tsirkin wrote: > Adding an issue saves me work, if you can do it and list issue > number in the commit log, that's great. Are you still using the JIRA from OASIS, or github instead? It seems like non-TC-members can't create issues on the OASIS one. Thanks, Jean

[virtio-dev] [RFC] virtio-iommu version 0.7

2018-06-13 Thread Jean-Philippe Brucker
This is version 0.7 of the virtio-iommu specification. The diff from 0.6, included below, is fairly small and consists of the following changes: * Address comments from 0.6, rework bits of the implementation notes. * Change resv_mem parameters to be consistent with the rest of the spec. * Add

[virtio-dev] Re: [PATCH v2 1/5] dt-bindings: virtio: Specify #iommu-cells value for a virtio-iommu

2018-06-26 Thread Jean-Philippe Brucker
On 25/06/18 20:27, Rob Herring wrote: > On Thu, Jun 21, 2018 at 08:06:51PM +0100, Jean-Philippe Brucker wrote: >> A virtio-mmio node may represent a virtio-iommu device. This is discovered >> by the virtio driver at probe time, but the DMA topology isn't >> discoverable

Re: [virtio-dev] [PATCH v2 3/5] iommu/virtio: Add probe request

2018-06-26 Thread Jean-Philippe Brucker
On 21/06/18 20:06, Jean-Philippe Brucker wrote: > +static int viommu_add_resv_mem(struct viommu_endpoint *vdev, > +struct virtio_iommu_probe_resv_mem *mem, > +size_t len) > +{ > + struct iommu_resv_region *region = NULL; &

[virtio-dev] Re: [PATCH v2 0/5] Add virtio-iommu driver

2018-06-27 Thread Jean-Philippe Brucker
On 26/06/18 19:07, Michael S. Tsirkin wrote: > So as I pointed out new virtio 0 device isn't really welcome ;) Agreed, virtio-iommu is expected to be implemented on virtio 1 and later. I'll remove the two legacy-related paragraph from the spec and add a check in the driver as you suggested, to

[virtio-dev] Re: [PATCH v2 3/5] iommu/virtio: Add probe request

2018-06-25 Thread Jean-Philippe Brucker
On 22/06/18 01:55, Michael S. Tsirkin wrote: >> +#define VIRTIO_IOMMU_RESV_MEM_T_RESERVED0 >> +#define VIRTIO_IOMMU_RESV_MEM_T_MSI 1 >> + >> +struct virtio_iommu_probe_resv_mem { >> +__u8subtype; >> +__u8

[virtio-dev] Re: [PATCH v2 2/5] iommu: Add virtio-iommu driver

2018-06-25 Thread Jean-Philippe Brucker
On 22/06/18 01:51, Michael S. Tsirkin wrote: >> +VIRTIO IOMMU DRIVER >> +M: Jean-Philippe Brucker >> +S: Maintained >> +F: drivers/iommu/virtio-iommu.c >> +F: include/uapi/linux/virtio_iommu.h >> + >> VIRTUAL BOX GUEST DEVICE DRIVER >> M: H

[virtio-dev] Re: [RFC PATCH v2 2/5] iommu/virtio-iommu: Add probe request

2018-01-16 Thread Jean-Philippe Brucker
On 16/01/18 09:25, Auger Eric wrote: [...] >> +static int viommu_add_resv_mem(struct viommu_endpoint *vdev, >> + struct virtio_iommu_probe_resv_mem *mem, >> + size_t len) >> +{ >> +struct iommu_resv_region *region = NULL; >> +unsigned

[virtio-dev] Re: [RFC PATCH v2 1/5] iommu: Add virtio-iommu driver

2018-01-16 Thread Jean-Philippe Brucker
On 15/01/18 15:12, Auger Eric wrote: [...] >> +/* >> + * viommu_get_req_size - compute request size >> + * >> + * A virtio-iommu request is split into one device-read-only part (top) and >> one >> + * device-write-only part (bottom). Given a request, return the sizes of >> the two >> + * parts

[virtio-dev] Re: [RFC PATCH v2 3/5] iommu/virtio-iommu: Add event queue

2018-01-16 Thread Jean-Philippe Brucker
On 16/01/18 10:10, Auger Eric wrote: > Hi, > > On 17/11/17 19:52, Jean-Philippe Brucker wrote: >> The event queue offers a way for the device to report access faults from >> devices. > end points? Yes [...] >> +static void viommu_event_handler(struct virtqu

[virtio-dev] Re: [RFC PATCH v2 2/5] iommu/virtio-iommu: Add probe request

2018-01-19 Thread Jean-Philippe Brucker
On 16/01/18 23:26, Auger Eric wrote: [...] >> +switch (mem->subtype) { >> +case VIRTIO_IOMMU_RESV_MEM_T_MSI: >> +region = iommu_alloc_resv_region(addr, size, prot, >> + IOMMU_RESV_MSI); > if (!region) > return -ENOMEM; >> +

[virtio-dev] [RFC] virtio-iommu version 0.6

2018-02-06 Thread Jean-Philippe Brucker
Please find version 0.6 of the virtio-iommu specification at the following locations. Document: http://jpbrucker.net/virtio-iommu/spec/virtio-iommu.pdf http://jpbrucker.net/virtio-iommu/spec/virtio-iommu.html Sources: git://linux-arm.org/virtio-iommu.git viommu/v0.6 I didn't receive

[virtio-dev] [PATCH 1/4] iommu: Add virtio-iommu driver

2018-02-14 Thread Jean-Philippe Brucker
into corresponding virtio requests. Mappings are kept in an interval tree instead of page tables. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> --- MAINTAINERS | 6 + drivers/iommu/Kconfig | 11 + drivers/iommu/Makefile| 1 + d

[virtio-dev] [PATCH 3/4] iommu/virtio: Add event queue

2018-02-14 Thread Jean-Philippe Brucker
The event queue offers a way for the device to report access faults from endpoints. It is implemented on virtqueue #1. Whenever the host needs to signal a fault, it fills one of the buffers offered by the guest and interrupts it. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.

[virtio-dev] [PATCH 4/4] vfio: Allow type-1 IOMMU instantiation with a virtio-iommu

2018-02-14 Thread Jean-Philippe Brucker
When enabling both VFIO and VIRTIO_IOMMU modules, automatically select VFIO_IOMMU_TYPE1 as well. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> --- drivers/vfio/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/vfio/Kconfig b/driver

[virtio-dev] [PATCH 2/4] iommu/virtio: Add probe request

2018-02-14 Thread Jean-Philippe Brucker
in the virtio-iommu, because MSIs bypass it. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> --- drivers/iommu/virtio-iommu.c | 163 -- include/uapi/linux/virtio_iommu.h | 37 + 2 files changed, 193 insertions(+), 7 deletions(-)

[virtio-dev] [PATCH 0/4] Add virtio-iommu driver

2018-02-14 Thread Jean-Philippe Brucker
PATCH v2 0/5] Add virtio-iommu driver https://www.spinics.net/lists/kvm/msg159047.html [3] [RFC v6 00/22] VIRTIO-IOMMU device http://lists.gnu.org/archive/html/qemu-arm/2018-02/msg00274.html [4] git://linux-arm.org/kvmtool-jpb.git virtio-iommu/v0.6 Jean-Philippe Brucker (4): iommu: Add

[virtio-dev] Re: [PATCH 4/4] vfio: Allow type-1 IOMMU instantiation with a virtio-iommu

2018-02-15 Thread Jean-Philippe Brucker
On 14/02/18 15:35, Robin Murphy wrote: > On 14/02/18 15:26, Alex Williamson wrote: >> On Wed, 14 Feb 2018 14:53:40 +0000 >> Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> wrote: >> >>> When enabling both VFIO and VIRTIO_IOMMU modules, automatically

[virtio-dev] Re: [PATCH 1/4] iommu: Add virtio-iommu driver

2018-02-22 Thread Jean-Philippe Brucker
On 21/02/18 20:12, kbuild test robot wrote: [...] > config: arm64-allmodconfig (attached as .config) [...] >aarch64-linux-gnu-ld: arch/arm64/kernel/head.o: relocation R_AARCH64_ABS32 > against `_kernel_offset_le_lo32' can not be used when making a shared object >arch/arm64/kernel/head.o:

[virtio-dev] Re: [PATCH 1/4] iommu: Add virtio-iommu driver

2018-02-20 Thread Jean-Philippe Brucker
On 19/02/18 12:23, Tomasz Nowicki wrote: [...] >> +static int viommu_receive_resp(struct viommu_dev *viommu, int nr_sent, >> + struct list_head *sent) >> +{ >> + >> +unsigned int len; >> +int nr_received = 0; >> +struct viommu_request *req, *pending; >> + >> +

[virtio-dev] [PATCH v2 3/5] iommu/virtio: Add probe request

2018-06-21 Thread Jean-Philippe Brucker
in the virtio-iommu, because MSIs bypass it. Signed-off-by: Jean-Philippe Brucker --- drivers/iommu/virtio-iommu.c | 149 -- include/uapi/linux/virtio_iommu.h | 37 2 files changed, 180 insertions(+), 6 deletions(-) diff --git a/drivers/iommu/virtio-iommu.c b

[virtio-dev] [PATCH v2 0/5] Add virtio-iommu driver

2018-06-21 Thread Jean-Philippe Brucker
complication and suggest we tackle one problem at a time. Since it is a luxury that requires changes to the IOMMU core, module support is left as a future improvement. --- Jean-Philippe Brucker (5): dt-bindings: virtio: Specify #iommu-cells value for a virtio-iommu

[virtio-dev] [PATCH v2 4/5] iommu/virtio: Add event queue

2018-06-21 Thread Jean-Philippe Brucker
The event queue offers a way for the device to report access faults from endpoints. It is implemented on virtqueue #1. Whenever the host needs to signal a fault, it fills one of the buffers offered by the guest and interrupts it. Signed-off-by: Jean-Philippe Brucker --- drivers/iommu/virtio

[virtio-dev] [PATCH v2 5/5] vfio: Allow type-1 IOMMU instantiation for ARM

2018-06-21 Thread Jean-Philippe Brucker
ARM platforms may implement several kinds of IOMMUs (various SMMU or SMMUv3 implementations, virtio-iommu). They are all type-1, so automatically select VFIO_IOMMU_TYPE1 on ARM if IOMMU is selected. Signed-off-by: Jean-Philippe Brucker --- drivers/vfio/Kconfig | 2 +- 1 file changed, 1

[virtio-dev] [PATCH v2 2/5] iommu: Add virtio-iommu driver

2018-06-21 Thread Jean-Philippe Brucker
into corresponding virtio requests. Mappings are kept in an interval tree instead of page tables. Signed-off-by: Jean-Philippe Brucker --- MAINTAINERS | 6 + drivers/iommu/Kconfig | 11 + drivers/iommu/Makefile| 1 + drivers/iommu/virtio-iommu.c | 929

[virtio-dev] [PATCH v2 1/5] dt-bindings: virtio: Specify #iommu-cells value for a virtio-iommu

2018-06-21 Thread Jean-Philippe Brucker
-iommu.txt. Like many other IOMMUs, virtio-iommu distinguishes masters by their endpoint IDs, which requires one IOMMU cell in the "iommus" property. Signed-off-by: Jean-Philippe Brucker --- Documentation/devicetree/bindings/virtio/mmio.txt | 8 1 file changed, 8 insertions(+)

[virtio-dev] Re: [PATCH v2 0/5] Add virtio-iommu driver

2018-07-04 Thread Jean-Philippe Brucker
On 27/06/18 20:59, Michael S. Tsirkin wrote: >> Another reason to keep the MMIO transport option is that one >> virtio-iommu can manage DMA from endpoints on multiple PCI domains at >> the same time, as well as platform devices. Some VMMs might want that, >> in which case the IOMMU would be a

Re: [virtio-dev] [RFC] virtio-iommu version 0.6

2018-04-10 Thread Jean-Philippe Brucker
On 22/03/18 09:44, Tian, Kevin wrote: >> From: Jean-Philippe Brucker [mailto:jean-philippe.bruc...@arm.com] >> Sent: Wednesday, March 21, 2018 9:14 PM >> >> Hi Kevin, >> >> Thanks for the comments >> >> On 19/03/18 10:03, Tian, Kevin wrote: >&

[virtio-dev] Re: [PATCH 1/4] iommu: Add virtio-iommu driver

2018-04-11 Thread Jean-Philippe Brucker
On 23/03/18 08:27, Tian, Kevin wrote: >>> The host kernel needs to have *some* MSI region in place before the >>> guest can start configuring interrupts, otherwise it won't know what >>> address to give to the underlying hardware. However, as soon as the host >>> kernel has picked a region, host

[virtio-dev] Re: [PATCH 2/4] iommu/virtio: Add probe request

2018-04-11 Thread Jean-Philippe Brucker
On 23/03/18 15:00, Robin Murphy wrote: [...] >> +/* >> + * Treat unknown subtype as RESERVED, but urge users to update their >> + * driver. >> + */ >> +if (mem->subtype != VIRTIO_IOMMU_RESV_MEM_T_RESERVED && >> +mem->subtype != VIRTIO_IOMMU_RESV_MEM_T_MSI) >> +

Re: [virtio-dev] [RFC] virtio-iommu version 0.6

2018-03-21 Thread Jean-Philippe Brucker
Hi Kevin, Thanks for the comments On 19/03/18 10:03, Tian, Kevin wrote: > BYPASS feature bit is not covered in "2.3.1/2.3.2/2.3.3"". Is it > intended? In my opinion BYPASS is a bit different from the other features: while the others are needed for correctness, this one is optional and even if

[virtio-dev] Re: [PATCH 1/4] iommu: Add virtio-iommu driver

2018-03-21 Thread Jean-Philippe Brucker
On 21/03/18 06:43, Tian, Kevin wrote: [...] >> + >> +#include >> + >> +#define MSI_IOVA_BASE 0x800 >> +#define MSI_IOVA_LENGTH 0x10 > > this is ARM specific, and according to virtio-iommu spec isn't it > better probed on the endpoint instead of

[virtio-dev] [PATCH v4 5/7] iommu: Add virtio-iommu driver

2018-11-15 Thread Jean-Philippe Brucker
into corresponding virtio requests. Mappings are kept in an interval tree instead of page tables. Signed-off-by: Jean-Philippe Brucker --- MAINTAINERS | 7 + drivers/iommu/Kconfig | 11 + drivers/iommu/Makefile| 1 + drivers/iommu/virtio-iommu.c | 918

[virtio-dev] [PATCH v4 4/7] PCI: OF: Initialize dev->fwnode appropriately

2018-11-15 Thread Jean-Philippe Brucker
For PCI devices that have an OF node, set the fwnode as well. This way drivers that rely on fwnode don't need the special case described by commit f94277af03ea ("of/platform: Initialise dev->fwnode appropriately"). Acked-by: Bjorn Helgaas Signed-off-by: Jean-Philippe Brucker ---

[virtio-dev] [PATCH v4 7/7] iommu/virtio: Add event queue

2018-11-15 Thread Jean-Philippe Brucker
The event queue offers a way for the device to report access faults from endpoints. It is implemented on virtqueue #1. Whenever the host needs to signal a fault, it fills one of the buffers offered by the guest and interrupts it. Signed-off-by: Jean-Philippe Brucker --- drivers/iommu/virtio

[virtio-dev] [PATCH v4 6/7] iommu/virtio: Add probe request

2018-11-15 Thread Jean-Philippe Brucker
in the virtio-iommu, because MSIs bypass it. Signed-off-by: Jean-Philippe Brucker --- drivers/iommu/virtio-iommu.c | 156 -- include/uapi/linux/virtio_iommu.h | 38 2 files changed, 188 insertions(+), 6 deletions(-) diff --git a/drivers/iommu/virtio-iommu.c b

[virtio-dev] [PATCH v4 2/7] dt-bindings: virtio: Add virtio-pci-iommu node

2018-11-15 Thread Jean-Philippe Brucker
ewed-by: Rob Herring Reviewed-by: Eric Auger Signed-off-by: Jean-Philippe Brucker --- .../devicetree/bindings/virtio/iommu.txt | 66 +++ 1 file changed, 66 insertions(+) create mode 100644 Documentation/devicetree/bindings/virtio/iommu.txt diff --git a/Documentation/device

[virtio-dev] [PATCH v4 0/7] Add virtio-iommu driver

2018-11-15 Thread Jean-Philippe Brucker
] [RFC v8 00/18] VIRTIO-IOMMU device https://www.mail-archive.com/qemu-devel@nongnu.org/msg572637.html Jean-Philippe Brucker (7): dt-bindings: virtio-mmio: Add IOMMU description dt-bindings: virtio: Add virtio-pci-iommu node of: Allow the iommu-map property to omit untranslated devices PCI

[virtio-dev] [PATCH v4 3/7] of: Allow the iommu-map property to omit untranslated devices

2018-11-15 Thread Jean-Philippe Brucker
-Philippe Brucker --- drivers/of/base.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/of/base.c b/drivers/of/base.c index 09692c9b32a7..99f6bfa9b898 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -2237,8 +2237,12 @@ int of_map_rid(struct

[virtio-dev] [PATCH v4 1/7] dt-bindings: virtio-mmio: Add IOMMU description

2018-11-15 Thread Jean-Philippe Brucker
Otherwise, the virtio-mmio device may perform DMA through an IOMMU, which requires an "iommus" property. Describe these requirements in the device-tree bindings documentation. Reviewed-by: Rob Herring Reviewed-by: Eric Auger Signed-off-by: Jean-Philippe Brucker --- .../devicetree/bind

[virtio-dev] Re: [PATCH v4 5/7] iommu: Add virtio-iommu driver

2018-11-16 Thread Jean-Philippe Brucker
Hi Eric, On 16/11/2018 06:08, Auger Eric wrote: >> +struct viommu_domain { >> +struct iommu_domain domain; >> +struct viommu_dev *viommu; >> +struct mutexmutex; > same naming/comment as in smmu driver may help here > struct mutex

[virtio-dev] [PATCH v7 7/7] iommu/virtio: Add event queue

2019-01-15 Thread Jean-Philippe Brucker
Auger Signed-off-by: Jean-Philippe Brucker --- drivers/iommu/virtio-iommu.c | 115 +++--- include/uapi/linux/virtio_iommu.h | 19 + 2 files changed, 125 insertions(+), 9 deletions(-) diff --git a/drivers/iommu/virtio-iommu.c b/drivers/iommu/virtio-iommu.c index

[virtio-dev] [PATCH v7 6/7] iommu/virtio: Add probe request

2019-01-15 Thread Jean-Philippe Brucker
in the virtio-iommu, because MSIs bypass it. Tested-by: Bharat Bhushan Tested-by: Eric Auger Reviewed-by: Eric Auger Signed-off-by: Jean-Philippe Brucker --- drivers/iommu/virtio-iommu.c | 157 -- include/uapi/linux/virtio_iommu.h | 36 +++ 2 files changed, 187

[virtio-dev] [PATCH v7 5/7] iommu: Add virtio-iommu driver

2019-01-15 Thread Jean-Philippe Brucker
-off-by: Jean-Philippe Brucker --- MAINTAINERS | 7 + drivers/iommu/Kconfig | 11 + drivers/iommu/Makefile| 1 + drivers/iommu/virtio-iommu.c | 916 ++ include/uapi/linux/virtio_ids.h | 1 + include/uapi/linux

[virtio-dev] [PATCH v7 1/7] dt-bindings: virtio-mmio: Add IOMMU description

2019-01-15 Thread Jean-Philippe Brucker
Otherwise, the virtio-mmio device may perform DMA through an IOMMU, which requires an "iommus" property. Describe these requirements in the device-tree bindings documentation. Reviewed-by: Rob Herring Reviewed-by: Eric Auger Signed-off-by: Jean-Philippe Brucker --- .../devicetree/bind

[virtio-dev] [PATCH v7 4/7] PCI: OF: Initialize dev->fwnode appropriately

2019-01-15 Thread Jean-Philippe Brucker
For PCI devices that have an OF node, set the fwnode as well. This way drivers that rely on fwnode don't need the special case described by commit f94277af03ea ("of/platform: Initialise dev->fwnode appropriately"). Acked-by: Bjorn Helgaas Signed-off-by: Jean-Philippe Brucker ---

[virtio-dev] [PATCH v7 3/7] of: Allow the iommu-map property to omit untranslated devices

2019-01-15 Thread Jean-Philippe Brucker
Herring Signed-off-by: Jean-Philippe Brucker --- drivers/of/base.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/of/base.c b/drivers/of/base.c index 5226e898476e..4d12b1cab55f 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -2293,8 +2293,12 @@ int

[virtio-dev] [PATCH v7 2/7] dt-bindings: virtio: Add virtio-pci-iommu node

2019-01-15 Thread Jean-Philippe Brucker
ewed-by: Rob Herring Reviewed-by: Eric Auger Signed-off-by: Jean-Philippe Brucker --- .../devicetree/bindings/virtio/iommu.txt | 66 +++ 1 file changed, 66 insertions(+) create mode 100644 Documentation/devicetree/bindings/virtio/iommu.txt diff --git a/Documentation/device

[virtio-dev] [PATCH v7 0/7] Add virtio-iommu driver

2019-01-15 Thread Jean-Philippe Brucker
tps://www.mail-archive.com/qemu-devel@nongnu.org/msg575578.html [5] [PATCH] iommu/of: Fix probe-deferral https://www.spinics.net/lists/arm-kernel/msg698371.html Jean-Philippe Brucker (7): dt-bindings: virtio-mmio: Add IOMMU description dt-bindings: virtio: Add virtio-pci-iommu n

[virtio-dev] Re: [PATCH v7 0/7] Add virtio-iommu driver

2019-01-21 Thread Jean-Philippe Brucker
Hi, On 18/01/2019 15:51, Michael S. Tsirkin wrote: > > On Tue, Jan 15, 2019 at 12:19:52PM +, Jean-Philippe Brucker wrote: >> Implement the virtio-iommu driver, following specification v0.9 [1]. >> >> This is a simple rebase onto Linux v5.0-rc2. We now use the >>

[virtio-dev] Re: [PATCH v5 5/7] iommu: Add virtio-iommu driver

2018-12-11 Thread Jean-Philippe Brucker
On 10/12/2018 22:53, Michael S. Tsirkin wrote: > On Mon, Dec 10, 2018 at 03:06:47PM +0000, Jean-Philippe Brucker wrote: >> On 27/11/2018 18:53, Michael S. Tsirkin wrote: >>> On Tue, Nov 27, 2018 at 06:10:46PM +0000, Jean-Philippe Brucker wrote: >>>> On 27/11/2018 1

[virtio-dev] Re: [PATCH v6 0/7] Add virtio-iommu driver

2018-12-20 Thread Jean-Philippe Brucker
On 19/12/2018 23:09, Michael S. Tsirkin wrote: > On Thu, Dec 13, 2018 at 12:50:29PM +0000, Jean-Philippe Brucker wrote: >>>> [3] git://linux-arm.org/linux-jpb.git virtio-iommu/v0.9.1 >>>> git://linux-arm.org/kvmtool-jpb.git virtio-iommu/v0.9 >>> >&g

[virtio-dev] Re: [PATCH v6 0/7] Add virtio-iommu driver

2018-12-11 Thread Jean-Philippe Brucker
On 11/12/2018 18:31, Christoph Hellwig wrote: > On Tue, Dec 11, 2018 at 06:20:57PM +0000, Jean-Philippe Brucker wrote: >> Implement the virtio-iommu driver, following specification v0.9 [1]. >> >> Only minor changes since v5 [2]. I fixed issues reported by Michael and &g

[virtio-dev] [PATCH v6 5/7] iommu: Add virtio-iommu driver

2018-12-11 Thread Jean-Philippe Brucker
-off-by: Jean-Philippe Brucker --- MAINTAINERS | 7 + drivers/iommu/Kconfig | 11 + drivers/iommu/Makefile| 1 + drivers/iommu/virtio-iommu.c | 916 ++ include/uapi/linux/virtio_ids.h | 1 + include/uapi/linux

[virtio-dev] [PATCH v6 6/7] iommu/virtio: Add probe request

2018-12-11 Thread Jean-Philippe Brucker
in the virtio-iommu, because MSIs bypass it. Tested-by: Bharat Bhushan Tested-by: Eric Auger Reviewed-by: Eric Auger Signed-off-by: Jean-Philippe Brucker --- drivers/iommu/virtio-iommu.c | 156 -- include/uapi/linux/virtio_iommu.h | 36 +++ 2 files changed, 186

[virtio-dev] [PATCH v6 4/7] PCI: OF: Initialize dev->fwnode appropriately

2018-12-11 Thread Jean-Philippe Brucker
For PCI devices that have an OF node, set the fwnode as well. This way drivers that rely on fwnode don't need the special case described by commit f94277af03ea ("of/platform: Initialise dev->fwnode appropriately"). Acked-by: Bjorn Helgaas Signed-off-by: Jean-Philippe Brucker ---

[virtio-dev] [PATCH v6 2/7] dt-bindings: virtio: Add virtio-pci-iommu node

2018-12-11 Thread Jean-Philippe Brucker
ewed-by: Rob Herring Reviewed-by: Eric Auger Signed-off-by: Jean-Philippe Brucker --- .../devicetree/bindings/virtio/iommu.txt | 66 +++ 1 file changed, 66 insertions(+) create mode 100644 Documentation/devicetree/bindings/virtio/iommu.txt diff --git a/Documentation/device

[virtio-dev] [PATCH v6 3/7] of: Allow the iommu-map property to omit untranslated devices

2018-12-11 Thread Jean-Philippe Brucker
Herring Signed-off-by: Jean-Philippe Brucker --- drivers/of/base.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/of/base.c b/drivers/of/base.c index 09692c9b32a7..99f6bfa9b898 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -2237,8 +2237,12 @@ int

[virtio-dev] [PATCH v6 1/7] dt-bindings: virtio-mmio: Add IOMMU description

2018-12-11 Thread Jean-Philippe Brucker
Otherwise, the virtio-mmio device may perform DMA through an IOMMU, which requires an "iommus" property. Describe these requirements in the device-tree bindings documentation. Reviewed-by: Rob Herring Reviewed-by: Eric Auger Signed-off-by: Jean-Philippe Brucker --- .../devicetree/bind

[virtio-dev] [PATCH v6 0/7] Add virtio-iommu driver

2018-12-11 Thread Jean-Philippe Brucker
/linux-pci/msg78158.html [3] git://linux-arm.org/linux-jpb.git virtio-iommu/v0.9.1 git://linux-arm.org/kvmtool-jpb.git virtio-iommu/v0.9 [4] [RFC v9 00/17] VIRTIO-IOMMU device https://www.mail-archive.com/qemu-devel@nongnu.org/msg575578.html Jean-Philippe Brucker (7): dt-bindings

  1   2   3   >