Re: [RFC 02/13] iommu: Introduce tlb_invalidate API

2018-09-03 Thread Auger Eric
Hi Jean-Philippe, On 09/03/2018 02:28 PM, Jean-Philippe Brucker wrote: > On 31/08/2018 15:07, Auger Eric wrote: >>> Since the ioctl will be used to combine invalidations (invalidate both >>> ATC and TLB with a single call), we need an additional ASID field for >>>

Re: [RFC 09/13] iommu/smmuv3: Get prepared for nested stage support

2018-09-03 Thread Auger Eric
Hi Jean-Philippe, On 09/03/2018 02:29 PM, Jean-Philippe Brucker wrote: > On 31/08/2018 15:11, Auger Eric wrote: >> Yep this works with my setup but I was waiting for such kind of comments >> to turn this prototype into something more "production level" ;-) Did >

Re: GICv3 stride issue with many VCPUs

2018-09-03 Thread Auger Eric
Hi Christoffer, On 09/03/2018 01:11 PM, Christoffer Dall wrote: > Hi, > > I recently ran kvm-unit-tests on TX2, and I got an error from gicv3-ipi, > with this in the log: > > % cat logs/gicv3-ipi.log > timeout -k 1s --foreground 90s > ../src/qemu/build/aarch64-softmmu/qemu-system-aarch64

Re: [RFC 01/13] iommu: Introduce bind_guest_stage API

2018-09-04 Thread Auger Eric
Hi Kevin, On 09/04/2018 09:57 AM, Tian, Kevin wrote: >> From: Auger Eric >> Sent: Friday, August 31, 2018 9:52 PM >> >> Hi Jean-Philippe, >> >> On 08/31/2018 03:11 PM, Jean-Philippe Brucker wrote: >>> Hi Eric, >>> >>> On 23/08/18 16

Re: [RFC 01/13] iommu: Introduce bind_guest_stage API

2018-09-04 Thread Auger Eric
Hi Kevin, On 09/04/2018 10:34 AM, Tian, Kevin wrote: >> From: Auger Eric >> Sent: Tuesday, September 4, 2018 4:11 PM >> >> Hi Kevin, >> On 09/04/2018 09:57 AM, Tian, Kevin wrote: >>>> From: Auger Eric >>>> Sent: Friday, August 31, 2018 9:52

Re: [RFC v2 01/20] iommu: Introduce bind_pasid_table API

2018-09-21 Thread Auger Eric
Hi Jacob, On 9/20/18 7:21 PM, Jacob Pan wrote: > On Tue, 18 Sep 2018 16:24:38 +0200 > Eric Auger wrote: > >> From: Jacob Pan >> >> In virtualization use case, when a guest is assigned >> a PCI host device, protected by a virtual IOMMU on a guest, >> the physical IOMMU must be programmed to be

Re: [RFC v2 14/20] iommu: introduce device fault data

2018-09-21 Thread Auger Eric
Hi Jacob, On 9/21/18 12:06 AM, Jacob Pan wrote: > On Tue, 18 Sep 2018 16:24:51 +0200 > Eric Auger wrote: > >> From: Jacob Pan >> >> Device faults detected by IOMMU can be reported outside IOMMU >> subsystem for further processing. This patch intends to provide >> a generic device fault data

Re: [PATCH v5 14/18] vgic: Add support for 52bit guest physical address

2018-09-21 Thread Auger Eric
Hi Suzuki, On 9/17/18 12:41 PM, Suzuki K Poulose wrote: > From: Kristina Martsenko > > Add support for handling 52bit guest physical address to the > VGIC layer. So far we have limited the guest physical address > to 48bits, by explicitly masking the upper bits. This patch > removes the

Re: [PATCH v5 18/18] kvm: arm64: Allow tuning the physical address size for VM

2018-09-25 Thread Auger Eric
Hi Suzuki, On 9/17/18 12:41 PM, Suzuki K Poulose wrote: > Allow specifying the physical address size limit for a new > VM via the kvm_type argument for the KVM_CREATE_VM ioctl. This > allows us to finalise the stage2 page table as early as possible > and hence perform the right checks on the

Re: [PATCH v5 17/18] kvm: arm64: Limit the minimum number of page table levels

2018-09-25 Thread Auger Eric
Hi Suzuki, On 9/17/18 12:41 PM, Suzuki K Poulose wrote: > Since we are about to remove the lower limit on the IPA size, > make sure that we do not go to 1 level page table (e.g, with > 32bit IPA on 64K host with concatenation) to avoid splitting > the host PMD huge pages at stage2. > > Cc: Marc

Re: [PATCH v5 11/18] kvm: arm64: Dynamic configuration of VTTBR mask

2018-09-25 Thread Auger Eric
Hi Suzuki, On 9/20/18 5:22 PM, Suzuki K Poulose wrote: > > > On 20/09/18 15:07, Auger Eric wrote: >> Hi Suzuki, >> On 9/17/18 12:41 PM, Suzuki K Poulose wrote: >>> On arm64 VTTBR_EL2:BADDR holds the base address for the stage2 >>> translation table. The A

Re: [PATCH v5 16/18] kvm: arm64: Set a limit on the IPA size

2018-09-25 Thread Auger Eric
Hi Suzuki, On 9/17/18 12:41 PM, Suzuki K Poulose wrote: > So far we have restricted the IPA size of the VM to the default > value (40bits). Now that we can manage the IPA size per VM and > support dynamic stage2 page tables, we can allow VMs to have > larger IPA. This patch introduces a the

Re: [PATCH v5 15/18] kvm: arm64: Add 52bit support for PAR to HPFAR conversoin

2018-09-25 Thread Auger Eric
Hi Suzuki, On 9/17/18 12:41 PM, Suzuki K Poulose wrote: > Add support for handling 52bit addresses in PAR to HPFAR > conversion. Instead of hardcoding the address limits, we > now use PHYS_MASK_SHIFT. > > Cc: Marc Zyngier > Cc: Christoffer Dall > Signed-off-by: Suzuki K Poulose Reviewed-by:

Re: [PATCH v5 06/18] kvm: arm/arm64: Allow arch specific configurations for VM

2018-09-20 Thread Auger Eric
Hi Suzuki, On 9/17/18 12:41 PM, Suzuki K Poulose wrote: > Allow the arch backends to perform VM specific initialisation. > This will be later used to handle IPA size configuration and per-VM > VTCR configuration on arm64. > > Cc: Marc Zyngier > Cc: Christoffer Dall > Signed-off-by: Suzuki K

Re: [PATCH v5 07/18] kvm: arm64: Configure VTCR_EL2 per VM

2018-09-20 Thread Auger Eric
Hi Suzuki, On 9/17/18 12:41 PM, Suzuki K Poulose wrote: > Add support for setting the VTCR_EL2 per VM, rather than hard > coding a value at boot time per CPU. This would allow us to tune > the stage2 page table parameters per VM in the later changes. > > We compute the VTCR fields based on the

Re: [PATCH v5 11/18] kvm: arm64: Dynamic configuration of VTTBR mask

2018-09-20 Thread Auger Eric
Hi Suzuki, On 9/17/18 12:41 PM, Suzuki K Poulose wrote: > On arm64 VTTBR_EL2:BADDR holds the base address for the stage2 > translation table. The Arm ARM mandates that the bits BADDR[x-1:0] > should be 0, where 'x' is defined for a given IPA Size and the > number of levels for a translation

Re: [PATCH v5 10/18] kvm: arm64: Make stage2 page table layout dynamic

2018-09-20 Thread Auger Eric
Hi Suzuki, On 9/17/18 12:41 PM, Suzuki K Poulose wrote: > Switch to dynamic stage2 page table layout based on the given > VM. So far we had a common stage2 table layout determined at > compile time. Make decision based on the VM instance depending > on the IPA limit for the VM. Adds helpers to

Re: [PATCH v5 08/18] kvm: arm/arm64: Prepare for VM specific stage2 translations

2018-09-20 Thread Auger Eric
Hi Suzuki, On 9/17/18 12:41 PM, Suzuki K Poulose wrote: > Right now the stage2 page table for a VM is hard coded, assuming > an IPA of 40bits. As we are about to add support for per VM IPA, > prepare the stage2 page table helpers to accept the kvm instance > to make the right decision for the VM.

Re: [PATCH v5 12/18] kvm: arm64: Configure VTCR_EL2.SL0 per VM

2018-09-20 Thread Auger Eric
Hi Suzuki, On 9/17/18 12:41 PM, Suzuki K Poulose wrote: > VTCR_EL2 holds the following key stage2 translation table > parameters: > SL0 - Entry level in the page table lookup. > T0SZ - Denotes the size of the memory addressed by the table. > > We have been using fixed values for the SL0

Re: [RFC v3 17/21] iommu/smmuv3: Report non recoverable faults

2019-01-16 Thread Auger Eric
Hi Jean, On 1/16/19 1:25 PM, Jean-Philippe Brucker wrote: > On 15/01/2019 21:06, Auger Eric wrote: >>>> + iommu_report_device_fault(master->dev, ); >>> >>> We should return here if the fault is successfully injected >> >> Even if the fa

Re: [RFC v3 14/21] iommu: introduce device fault data

2019-01-16 Thread Auger Eric
Hi Jean, On 1/16/19 4:52 PM, Jean-Philippe Brucker wrote: > On 14/01/2019 22:32, Jacob Pan wrote: >>> [...] > +/** > + * struct iommu_fault - Generic fault data > + * > + * @type contains fault type > + * @reason fault reasons if relevant outside IOMMU driver. > + * IOMMU

Re: [RFC v3 00/21] SMMUv3 Nested Stage Setup

2019-01-18 Thread Auger Eric
Hi, On 1/8/19 11:26 AM, Eric Auger wrote: > This series allows a virtualizer to program the nested stage mode. > This is useful when both the host and the guest are exposed with > an SMMUv3 and a PCI device is assigned to the guest using VFIO. > > In this mode, the physical IOMMU must be

Re: [RFC v3 18/21] vfio-pci: Add a new VFIO_REGION_TYPE_NESTED region type

2019-01-14 Thread Auger Eric
Hi Alex, On 1/12/19 12:58 AM, Alex Williamson wrote: > On Tue, 8 Jan 2019 11:26:30 +0100 > Eric Auger wrote: > >> This patch adds a new 64kB region aiming to report nested mode >> translation faults. >> >> The region contains a header with the size of the queue, >> the producer and consumer

Re: [RFC v3 14/21] iommu: introduce device fault data

2019-01-15 Thread Auger Eric
Hi Jean, On 1/11/19 12:06 PM, Jean-Philippe Brucker wrote: > On 10/01/2019 18:45, Jacob Pan wrote: >> On Tue, 8 Jan 2019 11:26:26 +0100 >> Eric Auger wrote: >> >>> From: Jacob Pan >>> >>> Device faults detected by IOMMU can be reported outside IOMMU >>> subsystem for further processing. This

Re: [RFC v3 04/21] vfio: VFIO_IOMMU_SET_PASID_TABLE

2019-01-15 Thread Auger Eric
Hi Alex, On 1/11/19 11:50 PM, Alex Williamson wrote: > On Tue, 8 Jan 2019 11:26:16 +0100 > Eric Auger wrote: > >> From: "Liu, Yi L" >> >> This patch adds VFIO_IOMMU_SET_PASID_TABLE ioctl which aims at >> passing the virtual iommu guest configuration to the VFIO driver >> downto to the iommu

Re: [RFC v3 18/21] vfio-pci: Add a new VFIO_REGION_TYPE_NESTED region type

2019-01-15 Thread Auger Eric
Hi Alex, On 1/15/19 12:04 AM, Alex Williamson wrote: > On Mon, 14 Jan 2019 21:48:06 +0100 > Auger Eric wrote: > >> Hi Alex, >> >> On 1/12/19 12:58 AM, Alex Williamson wrote: >>> On Tue, 8 Jan 2019 11:26:30 +0100 >>> Eric Auger wrote: >>

Re: [RFC v3 17/21] iommu/smmuv3: Report non recoverable faults

2019-01-15 Thread Auger Eric
Hi Jean, On 1/11/19 6:46 PM, Jean-Philippe Brucker wrote: > On 08/01/2019 10:26, Eric Auger wrote: >> When a stage 1 related fault event is read from the event queue, >> let's propagate it to potential external fault listeners, ie. users >> who registered a fault handler. >> >> Signed-off-by:

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

2018-12-12 Thread Auger Eric
Hi, On 12/12/18 3:56 PM, Michael S. Tsirkin wrote: > On Fri, Dec 07, 2018 at 06:52:31PM +, Jean-Philippe Brucker wrote: >> Sorry for the delay, I wanted to do a little more performance analysis >> before continuing. >> >> On 27/11/2018 18:10, Michael S. Tsirkin wrote: >>> On Tue, Nov 27, 2018

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

2018-12-13 Thread Auger Eric
Hi Robin On 12/13/18 1:37 PM, Robin Murphy wrote: > On 2018-12-12 3:27 pm, Auger Eric wrote: >> Hi, >> >> On 12/12/18 3:56 PM, Michael S. Tsirkin wrote: >>> On Fri, Dec 07, 2018 at 06:52:31PM +, Jean-Philippe Brucker wrote: >>>> Sorry for the delay

Re: [RFC v2 14/20] iommu: introduce device fault data

2018-12-12 Thread Auger Eric
Hi Jacob, On 9/21/18 12:06 AM, Jacob Pan wrote: > On Tue, 18 Sep 2018 16:24:51 +0200 > Eric Auger wrote: > >> From: Jacob Pan >> >> Device faults detected by IOMMU can be reported outside IOMMU >> subsystem for further processing. This patch intends to provide >> a generic device fault data

Re: [RFC v2 14/20] iommu: introduce device fault data

2018-12-17 Thread Auger Eric
Hi Jacob, On 12/15/18 1:30 AM, Jacob Pan wrote: > On Wed, 12 Dec 2018 09:21:43 +0100 > Auger Eric wrote: > >> Hi Jacob, >> >> On 9/21/18 12:06 AM, Jacob Pan wrote: >>> On Tue, 18 Sep 2018 16:24:51 +0200 >>> Eric Auger wrote: >>>

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

2018-12-03 Thread Auger Eric
Hi Michael, On 11/27/18 6:16 PM, Michael S. Tsirkin wrote: > On Tue, Nov 27, 2018 at 06:09:25PM +0100, Auger Eric wrote: >> Hi Michael, >> >> On 11/27/18 5:53 PM, Michael S. Tsirkin wrote: >>> On Thu, Nov 22, 2018 at 07:37:54PM +, Jean-Philippe Brucker wrote: &

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

2018-11-23 Thread Auger Eric
Hi Jean, On 11/22/18 8:37 PM, Jean-Philippe Brucker wrote: > The virtio IOMMU is a para-virtualized device, allowing to send IOMMU > requests such as map/unmap over virtio transport without emulating page > tables. This implementation handles ATTACH, DETACH, MAP and UNMAP > requests. > > The

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

2018-11-23 Thread Auger Eric
Hi Jean, On 11/22/18 8:37 PM, Jean-Philippe Brucker wrote: > Implement the virtio-iommu driver, following specification v0.9 [1]. > > Since v4 [2] I fixed the issues reported by Eric, and added Reviewed-by > from Eric and Rob. Thanks! > > I changed the specification to fix one inconsistency

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

2018-11-21 Thread Auger Eric
Hi jean, On 11/20/18 6:30 PM, Jean-Philippe Brucker wrote: > On 16/11/2018 18:46, Jean-Philippe Brucker wrote: +/* + * __viommu_sync_req - Complete all in-flight requests + * + * Wait for all added requests to complete. When this function returns, all + * requests

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

2018-11-27 Thread Auger Eric
Hi Michael, On 11/27/18 5:53 PM, Michael S. Tsirkin wrote: > On Thu, Nov 22, 2018 at 07:37:54PM +, Jean-Philippe Brucker wrote: >> Implement the virtio-iommu driver, following specification v0.9 [1]. >> >> Since v4 [2] I fixed the issues reported by Eric, and added Reviewed-by >> from Eric

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

2018-11-27 Thread Auger Eric
Hi Michael, On 11/27/18 6:16 PM, Michael S. Tsirkin wrote: > On Tue, Nov 27, 2018 at 06:09:25PM +0100, Auger Eric wrote: >> Hi Michael, >> >> On 11/27/18 5:53 PM, Michael S. Tsirkin wrote: >>> On Thu, Nov 22, 2018 at 07:37:54PM +, Jean-Philippe Brucker wrote: &

Re: [PATCH] KVM: arm/arm64: vgic-v3: Retire pending interrupts on disabling LPIs

2019-04-02 Thread Auger Eric
Hi Marc, On 4/2/19 9:24 AM, Marc Zyngier wrote: > When disabling LPIs (for example on reset) at the redistributor > level, it is expected that LPIs that was pending in the CPU > interface are eventually retired. > > Currently, this is not what is happening, and these LPIs will > stay in the

Re: [PATCH 5/8] KVM: arm/arm64: Enforce PTE mappings at stage2 when needed

2019-04-02 Thread Auger Eric
Hi Suzuki, On 4/2/19 11:47 AM, Suzuki K Poulose wrote: > On Mon, Apr 01, 2019 at 07:10:37PM +0200, Auger Eric wrote: >> Hi Suzuki, >> >> On 3/28/19 2:36 PM, Marc Zyngier wrote: >>> From: Suzuki K Poulose >>> >>> commit 6794ad5443a2118 ("KVM

Re: [PATCH] KVM: arm/arm64: vgic-v3: Retire pending interrupts on disabling LPIs

2019-04-02 Thread Auger Eric
Hi Marc, On 4/2/19 10:48 AM, Marc Zyngier wrote: > On Tue, 02 Apr 2019 09:22:29 +0100, > Auger Eric wrote: >> >> Hi Marc, >> >> On 4/2/19 9:24 AM, Marc Zyngier wrote: >>> When disabling LPIs (for example on reset) at the redistributor >>>

Re: [PATCH v4 2/2] KVM: doc: add API documentation on the KVM_REG_ARM_WORKAROUNDS register

2019-03-21 Thread Auger Eric
Hi Andre, On 3/1/19 12:43 AM, Andre Przywara wrote: > Add documentation for the newly defined firmware registers to save and > restore any vulnerability migitation status. s/migitation/mitigation > > Signed-off-by: Andre Przywara > --- > Documentation/virtual/kvm/arm/psci.txt | 25

Re: [PATCH v4 1/2] KVM: arm/arm64: Add save/restore support for firmware workaround state

2019-03-21 Thread Auger Eric
Hi Andre, On 3/1/19 12:43 AM, Andre Przywara wrote: > KVM implements the firmware interface for mitigating cache speculation > vulnerabilities. Guests may use this interface to ensure mitigation is > active. > If we want to migrate such a guest to a host with a different support > level for those

Re: [PATCH v6 09/22] vfio: VFIO_IOMMU_BIND/UNBIND_MSI

2019-04-03 Thread Auger Eric
Hi Alex, On 3/22/19 11:09 PM, Alex Williamson wrote: > On Fri, 22 Mar 2019 10:30:02 +0100 > Auger Eric wrote: > >> Hi Alex, >> On 3/22/19 12:01 AM, Alex Williamson wrote: >>> On Sun, 17 Mar 2019 18:22:19 +0100 >>> Eric Auger wrote: >>> >

Re: [PATCH v6 09/22] vfio: VFIO_IOMMU_BIND/UNBIND_MSI

2019-04-04 Thread Auger Eric
Hi Marc, Robin, Alex, On 4/3/19 7:38 PM, Alex Williamson wrote: > On Wed, 3 Apr 2019 16:30:15 +0200 > Auger Eric wrote: > >> Hi Alex, >> >> On 3/22/19 11:09 PM, Alex Williamson wrote: >>> On Fri, 22 Mar 2019 10:30:02 +0100 >>> Auger Eric wrote:

Re: [PATCH 5/8] KVM: arm/arm64: Enforce PTE mappings at stage2 when needed

2019-04-01 Thread Auger Eric
Hi Suzuki, On 3/28/19 2:36 PM, Marc Zyngier wrote: > From: Suzuki K Poulose > > commit 6794ad5443a2118 ("KVM: arm/arm64: Fix unintended stage 2 PMD mappings") > made the checks to skip huge mappings, stricter. However it introduced > a bug where we still use huge mappings, ignoring the flag to

Re: [PATCH v4 19/22] vfio-pci: Register an iommu fault handler

2019-02-25 Thread Auger Eric
Hi Vincent, On 2/25/19 3:22 PM, Vincent Stehlé wrote: > Hi Eric, > > On Mon, Feb 18, 2019 at 02:55:00PM +0100, Eric Auger wrote: >> This patch registers a fault handler which records faults in >> a circular buffer and then signals an eventfd. This buffer is >> exposed within the fault region. >>

Re: [PATCH v4 02/22] iommu: introduce device fault data

2019-03-06 Thread Auger Eric
Hi Jean, On 3/5/19 3:56 PM, Jean-Philippe Brucker wrote: > On 18/02/2019 13:54, Eric Auger wrote: >> From: Jacob Pan >> >> Device faults detected by IOMMU can be reported outside the IOMMU >> subsystem for further processing. This patch introduces >> a generic device fault data structure. >> >>

Re: [PATCH v4 02/22] iommu: introduce device fault data

2019-03-06 Thread Auger Eric
Hi Jean, On 3/5/19 3:56 PM, Jean-Philippe Brucker wrote: > On 18/02/2019 13:54, Eric Auger wrote: >> From: Jacob Pan >> >> Device faults detected by IOMMU can be reported outside the IOMMU >> subsystem for further processing. This patch introduces >> a generic device fault data structure. >> >>

Re: [PATCH v4 02/22] iommu: introduce device fault data

2019-03-06 Thread Auger Eric
Hi Jean, On 3/6/19 5:07 PM, Jean-Philippe Brucker wrote: > On 06/03/2019 14:30, Auger Eric wrote: >>>> +#define IOMMU_FAULT_PAGE_REQUEST_LAST_PAGE(1 << 1) >>>> +#define IOMMU_FAULT_PAGE_REQUEST_PRIV_DATA(1 << 2) >>>> + __u32

Re: [PATCH v4 00/22] SMMUv3 Nested Stage Setup

2019-03-05 Thread Auger Eric
Hi, On 2/18/19 2:54 PM, Eric Auger wrote: > This series allows a virtualizer to program the nested stage mode. > This is useful when both the host and the guest are exposed with > an SMMUv3 and a PCI device is assigned to the guest using VFIO. > > In this mode, the physical IOMMU must be

Re: [PATCH v4 04/22] iommu: Introduce attach/detach_pasid_table API

2019-03-05 Thread Auger Eric
Hi Jean, On 3/5/19 4:23 PM, Jean-Philippe Brucker wrote: > On 18/02/2019 13:54, Eric Auger wrote: >> From: Jacob Pan >> >> In virtualization use case, when a guest is assigned >> a PCI host device, protected by a virtual IOMMU on the guest, >> the physical IOMMU must be programmed to be

Re: [PATCH v4 05/22] iommu: Introduce cache_invalidate API

2019-03-05 Thread Auger Eric
Hi Kevin, Yi, On 3/5/19 4:28 PM, Jean-Philippe Brucker wrote: > On 18/02/2019 13:54, Eric Auger wrote: >> From: "Liu, Yi L" >> >> In any virtualization use case, when the first translation stage >> is "owned" by the guest OS, the host IOMMU driver has no knowledge >> of caching structure updates

Re: [PATCH v4 00/22] SMMUv3 Nested Stage Setup

2019-03-05 Thread Auger Eric
Hi, On 2/18/19 2:54 PM, Eric Auger wrote: > This series allows a virtualizer to program the nested stage mode. > This is useful when both the host and the guest are exposed with > an SMMUv3 and a PCI device is assigned to the guest using VFIO. > > In this mode, the physical IOMMU must be

Re: [PATCH v5 05/22] iommu: Introduce cache_invalidate API

2019-03-17 Thread Auger Eric
Hi Jacob, On 3/15/19 7:37 PM, Jacob Pan wrote: > On Fri, 15 Mar 2019 17:08:49 +0100 > Eric Auger wrote: > >> From: "Liu, Yi L" >> >> In any virtualization use case, when the first translation stage >> is "owned" by the guest OS, the host IOMMU driver has no knowledge >> of caching structure

Re: [RFC PATCH] KVM: arm/arm64: Enable direct irqfd MSI injection

2019-03-17 Thread Auger Eric
Hi, On 3/17/19 3:50 PM, Raslan, KarimAllah wrote: > On Sun, 2019-03-17 at 14:36 +, Zenghui Yu wrote: >> Currently, IRQFD on arm still uses the deferred workqueue mechanism >> to inject interrupts into guest, which will likely lead to a busy >> context-switching from/to the kworker thread.

Re: Question: KVM: Failed to bind vfio with PCI-e / SMMU on Juno-r2

2019-03-13 Thread Auger Eric
Hi Leo, + Robin On 3/13/19 9:00 AM, Leo Yan wrote: > Hi Eric & all, > > On Mon, Mar 11, 2019 at 10:35:01PM +0800, Leo Yan wrote: > > [...] > >> So now I made some progress and can see the networking card is >> pass-through to guest OS, though the networking card reports errors >> now. Below

Re: Question: KVM: Failed to bind vfio with PCI-e / SMMU on Juno-r2

2019-03-13 Thread Auger Eric
Hi, On 3/13/19 11:01 AM, Auger Eric wrote: > Hi Leo, > > + Robin > > On 3/13/19 9:00 AM, Leo Yan wrote: >> Hi Eric & all, >> >> On Mon, Mar 11, 2019 at 10:35:01PM +0800, Leo Yan wrote: >> >> [...] >> >>> So now I made some progress

Re: Question: KVM: Failed to bind vfio with PCI-e / SMMU on Juno-r2

2019-03-13 Thread Auger Eric
Hi Leo, On 3/13/19 11:01 AM, Leo Yan wrote: > On Wed, Mar 13, 2019 at 04:00:48PM +0800, Leo Yan wrote: > > [...] > >> - The second question is for GICv2m. If I understand correctly, when >> passthrough PCI-e device to guest OS, in the guest OS we should >> create below data path for PCI-e

Re: Question: KVM: Failed to bind vfio with PCI-e / SMMU on Juno-r2

2019-03-11 Thread Auger Eric
Hi Leo, On 3/11/19 7:42 AM, Leo Yan wrote: > Hi all, > > I am trying to enable PCI-e device pass-through mode with KVM, since > Juno-r2 board has PCI-e bus so I firstly try to use vfio to > passthrough the network card on PCI-e bus. > > According to Juno-r2 board TRM [1], there has a CoreLink

Re: Question: KVM: Failed to bind vfio with PCI-e / SMMU on Juno-r2

2019-03-11 Thread Auger Eric
Hi Leo, On 3/11/19 10:39 AM, Leo Yan wrote: > Hi Auger, > > On Mon, Mar 11, 2019 at 09:23:20AM +0100, Auger Eric wrote: > > [...] > >>> P.s. I also checked the sysfs node and found it doesn't contain node >>> 'iommu_group': >>> >>> # ls

Re: [PATCH 2/2] KVM: arm/arm64: vgic-its: Take the srcu lock when parsing the memslots

2019-03-19 Thread Auger Eric
Hi Marc, On 3/19/19 2:30 PM, Marc Zyngier wrote: > Calling kvm_is_visible_gfn() implies that we're parsing the memslots, > and doing this without the srcu lock is frown upon: > > [12704.164532] = > [12704.164544] WARNING: suspicious RCU usage > [12704.164560]

Re: [PATCH 1/2] KVM: arm/arm64: vgic-its: Take the srcu lock when writing to guest memory

2019-03-19 Thread Auger Eric
Hi Marc, On 3/19/19 2:30 PM, Marc Zyngier wrote: > When halting a guest, QEMU flushes the virtual ITS caches, which > amounts to writing to the various tables that the guest has allocated. > > When doing this, we fail to take the srcu lock, and the kernel > shouts loudly if running a lockdep

Re: [PATCH v5 05/22] iommu: Introduce cache_invalidate API

2019-03-18 Thread Auger Eric
Hi Jean, On 3/18/19 12:01 PM, Jean-Philippe Brucker wrote: > On 17/03/2019 16:43, Auger Eric wrote: >>>> diff --git a/include/uapi/linux/iommu.h b/include/uapi/linux/iommu.h >>>> index 532a64075f23..e4c6a447e85a 100644 >>>> --- a/include/uapi/linux/iommu.

Re: [PATCH v6 05/22] iommu: Introduce cache_invalidate API

2019-03-21 Thread Auger Eric
Hi jean, Jacob, On 3/21/19 3:13 PM, Jean-Philippe Brucker wrote: > On 21/03/2019 13:54, Auger Eric wrote: >> Hi Jacob, Jean-Philippe, >> >> On 3/20/19 5:50 PM, Jean-Philippe Brucker wrote: >>> On 20/03/2019 16:37, Jacob Pan wrote: >>> [...] >>>

Re: [PATCH v6 05/22] iommu: Introduce cache_invalidate API

2019-03-21 Thread Auger Eric
Hi Jacob, Jean-Philippe, On 3/20/19 5:50 PM, Jean-Philippe Brucker wrote: > On 20/03/2019 16:37, Jacob Pan wrote: > [...] >>> +struct iommu_inv_addr_info { >>> +#define IOMMU_INV_ADDR_FLAGS_PASID (1 << 0) >>> +#define IOMMU_INV_ADDR_FLAGS_ARCHID(1 << 1) >>> +#define

Re: [PATCH v4 1/2] KVM: arm/arm64: Add save/restore support for firmware workaround state

2019-03-21 Thread Auger Eric
Hi Andre, On 3/21/19 6:35 PM, Andre Przywara wrote: > On Thu, 21 Mar 2019 13:54:07 +0100 > Auger Eric wrote: > > Hi Eric, > > many thanks for looking at this! > I was about to prepare a new revision. > >> Hi Andre, >> >> On 3/1/19 12:43 AM

Re: [PATCH v6 00/22] SMMUv3 Nested Stage Setup

2019-03-22 Thread Auger Eric
Hi, On 3/17/19 6:22 PM, Eric Auger wrote: > This series allows a virtualizer to program the nested stage mode. > This is useful when both the host and the guest are exposed with > an SMMUv3 and a PCI device is assigned to the guest using VFIO. > > In this mode, the physical IOMMU must be

Re: [PATCH v6 05/22] iommu: Introduce cache_invalidate API

2019-03-22 Thread Auger Eric
Hi Jacob, On 3/21/19 11:10 PM, Jacob Pan wrote: > On Thu, 21 Mar 2019 15:32:45 +0100 > Auger Eric wrote: > >> Hi jean, Jacob, >> >> On 3/21/19 3:13 PM, Jean-Philippe Brucker wrote: >>> On 21/03/2019 13:54, Auger Eric wrote: >>>> Hi Jacob, J

Re: [PATCH v6 07/22] vfio: VFIO_IOMMU_ATTACH/DETACH_PASID_TABLE

2019-03-22 Thread Auger Eric
Hi Alex, On 3/21/19 11:19 PM, Alex Williamson wrote: > On Sun, 17 Mar 2019 18:22:17 +0100 > Eric Auger wrote: > >> From: "Liu, Yi L" >> >> This patch adds VFIO_IOMMU_ATTACH/DETACH_PASID_TABLE ioctl >> which aims to pass/withdraw the virtual iommu guest configuration >> to/from the VFIO driver

Re: [PATCH v6 02/22] iommu: introduce device fault data

2019-03-22 Thread Auger Eric
Hi Jacob, On 3/21/19 11:04 PM, Jacob Pan wrote: > On Sun, 17 Mar 2019 18:22:12 +0100 > Eric Auger wrote: > >> From: Jacob Pan >> >> Device faults detected by IOMMU can be reported outside the IOMMU >> subsystem for further processing. This patch introduces >> a generic device fault data

Re: [PATCH v6 09/22] vfio: VFIO_IOMMU_BIND/UNBIND_MSI

2019-03-22 Thread Auger Eric
Hi Alex, On 3/22/19 12:01 AM, Alex Williamson wrote: > On Sun, 17 Mar 2019 18:22:19 +0100 > Eric Auger wrote: > >> This patch adds the VFIO_IOMMU_BIND/UNBIND_MSI ioctl which aim >> to pass/withdraw the guest MSI binding to/from the host. >> >> Signed-off-by: Eric Auger >> >> --- >> v3 -> v4: >>

Re: [RFC v3 02/21] iommu: Introduce cache_invalidate API

2019-01-29 Thread Auger Eric
Hi Jean-Philippe, On 1/28/19 6:32 PM, Jean-Philippe Brucker wrote: > Hi Eric, > > On 25/01/2019 16:49, Auger Eric wrote: > [...] >>>> diff --git a/include/uapi/linux/iommu.h b/include/uapi/linux/iommu.h >>>> index 7a7cf7a3de7c..4605f5cfac84 100644 >>>

Re: [RFC v3 02/21] iommu: Introduce cache_invalidate API

2019-01-30 Thread Auger Eric
Hi Alex, On 1/30/19 12:16 AM, Alex Williamson wrote: > On Fri, 25 Jan 2019 17:49:20 +0100 > Auger Eric wrote: > >> Hi Alex, >> >> On 1/11/19 10:30 PM, Alex Williamson wrote: >>> On Tue, 8 Jan 2019 11:26:14 +0100 >>> Eric Auger wrote: &g

Re: [RFC v3 01/21] iommu: Introduce set_pasid_table API

2019-01-25 Thread Auger Eric
Hi Jean-Philippe, On 1/11/19 7:16 PM, Jean-Philippe Brucker wrote: > On 08/01/2019 10:26, Eric Auger wrote: >> From: Jacob Pan >> >> In virtualization use case, when a guest is assigned >> a PCI host device, protected by a virtual IOMMU on a guest, >> the physical IOMMU must be programmed to be

Re: [RFC v3 01/21] iommu: Introduce set_pasid_table API

2019-01-25 Thread Auger Eric
Hi Jean-Philippe, On 1/25/19 9:39 AM, Auger Eric wrote: > Hi Jean-Philippe, > > On 1/11/19 7:16 PM, Jean-Philippe Brucker wrote: >> On 08/01/2019 10:26, Eric Auger wrote: >>> From: Jacob Pan >>> >>> In virtualization use case, when a guest is

Re: [RFC v3 01/21] iommu: Introduce set_pasid_table API

2019-01-25 Thread Auger Eric
Hi Alex, On 1/11/19 7:43 PM, Alex Williamson wrote: > On Tue, 8 Jan 2019 11:26:13 +0100 > Eric Auger wrote: > >> From: Jacob Pan >> >> In virtualization use case, when a guest is assigned >> a PCI host device, protected by a virtual IOMMU on a guest, >> the physical IOMMU must be programmed

Re: [RFC v3 02/21] iommu: Introduce cache_invalidate API

2019-01-25 Thread Auger Eric
Hi Alex, On 1/11/19 10:30 PM, Alex Williamson wrote: > On Tue, 8 Jan 2019 11:26:14 +0100 > Eric Auger wrote: > >> From: "Liu, Yi L" >> >> In any virtualization use case, when the first translation stage >> is "owned" by the guest OS, the host IOMMU driver has no knowledge >> of caching

Re: [RFC v3 03/21] iommu: Introduce bind_guest_msi

2019-01-25 Thread Auger Eric
Hi Alex, On 1/11/19 11:44 PM, Alex Williamson wrote: > On Tue, 8 Jan 2019 11:26:15 +0100 > Eric Auger wrote: > >> On ARM, MSI are translated by the SMMU. An IOVA is allocated >> for each MSI doorbell. If both the host and the guest are exposed >> with SMMUs, we end up with 2 different IOVAs

Re: [RFC v3 03/21] iommu: Introduce bind_guest_msi

2019-01-25 Thread Auger Eric
Hi Alex, On 1/11/19 11:44 PM, Alex Williamson wrote: > On Tue, 8 Jan 2019 11:26:15 +0100 > Eric Auger wrote: > >> On ARM, MSI are translated by the SMMU. An IOVA is allocated >> for each MSI doorbell. If both the host and the guest are exposed >> with SMMUs, we end up with 2 different IOVAs

Re: Question: KVM: Failed to bind vfio with PCI-e / SMMU on Juno-r2

2019-03-15 Thread Auger Eric
Hi Leo, + Jean-Philippe On 3/15/19 10:37 AM, Leo Yan wrote: > Hi Eric, Robin, > > On Wed, Mar 13, 2019 at 11:24:25AM +0100, Auger Eric wrote: > > [...] > >>> If the NIC supports MSIs they logically are used. This can be easily >>> checked on host by issui

Re: [PATCH v7 18/23] iommu/smmuv3: Report non recoverable faults

2019-05-13 Thread Auger Eric
Hi Robin, On 5/8/19 7:20 PM, Robin Murphy wrote: > On 08/04/2019 13:19, Eric Auger wrote: >> When a stage 1 related fault event is read from the event queue, >> let's propagate it to potential external fault listeners, ie. users >> who registered a fault handler. >> >> Signed-off-by: Eric Auger

Re: [PATCH v8 28/29] vfio-pci: Add VFIO_PCI_DMA_FAULT_IRQ_INDEX

2019-06-04 Thread Auger Eric
Hi Alex, On 6/4/19 12:31 AM, Alex Williamson wrote: > On Sun, 26 May 2019 18:10:03 +0200 > Eric Auger wrote: > >> Add a new VFIO_PCI_DMA_FAULT_IRQ_INDEX index. This allows to >> set/unset an eventfd that will be triggered when DMA translation >> faults are detected at physical level when the

Re: [PATCH v8 26/29] vfio-pci: Register an iommu fault handler

2019-06-04 Thread Auger Eric
Hi Alex, On 6/4/19 12:31 AM, Alex Williamson wrote: > On Sun, 26 May 2019 18:10:01 +0200 > Eric Auger wrote: > >> This patch registers a fault handler which records faults in >> a circular buffer and then signals an eventfd. This buffer is >> exposed within the fault region. >> >>

Re: [PATCH v8 24/29] vfio: VFIO_IOMMU_BIND/UNBIND_MSI

2019-06-07 Thread Auger Eric
Hi Alex, On 6/4/19 12:32 AM, Alex Williamson wrote: > On Sun, 26 May 2019 18:09:59 +0200 > Eric Auger wrote: > >> This patch adds the VFIO_IOMMU_BIND/UNBIND_MSI ioctl which aim >> to pass/withdraw the guest MSI binding to/from the host. >> >> Signed-off-by: Eric Auger >> >> --- >> v6 -> v7: >>

Re: [PATCH v8 25/29] vfio-pci: Add a new VFIO_REGION_TYPE_NESTED region type

2019-06-07 Thread Auger Eric
Hi Alex, On 6/4/19 12:31 AM, Alex Williamson wrote: > On Sun, 26 May 2019 18:10:00 +0200 > Eric Auger wrote: > >> This patch adds two new regions aiming to handle nested mode >> translation faults. >> >> The first region (two host kernel pages) is read-only from the >> user-space perspective.

Re: [PATCH 2/8] KVM: arm/arm64: vgic: Add __vgic_put_lpi_locked primitive

2019-06-07 Thread Auger Eric
Hi Marc, On 6/6/19 6:54 PM, Marc Zyngier wrote: > Our LPI translation cache needs to be able to drop the refcount > on an LPI whilst already holding the lpi_list_lock. > > Let's add a new primitive for this. > > Signed-off-by: Marc Zyngier Reviewed-by: Eric Auger Thanks Eric > --- >

Re: [PATCH 1/8] KVM: arm/arm64: vgic: Add LPI translation cache definition

2019-06-07 Thread Auger Eric
Hi Marc, On 6/6/19 6:54 PM, Marc Zyngier wrote: > Add the basic data structure that expresses an MSI to LPI > translation as well as the allocation/release hooks. > > THe size of the cache is arbitrarily defined as 4*nr_vcpus. > > Signed-off-by: Marc Zyngier > --- > include/kvm/arm_vgic.h

Re: [PATCH v8 26/29] vfio-pci: Register an iommu fault handler

2019-06-07 Thread Auger Eric
Hi Jean, On 6/7/19 2:48 PM, Jean-Philippe Brucker wrote: > On 26/05/2019 17:10, Eric Auger wrote: >> +int vfio_pci_iommu_dev_fault_handler(struct iommu_fault_event *evt, void >> *data) >> +{ >> +struct vfio_pci_device *vdev = (struct vfio_pci_device *) data; >> +struct

Re: [PATCH 4/8] KVM: arm/arm64: vgic-its: Add kvm parameter to vgic_its_free_collection

2019-06-07 Thread Auger Eric
Hi Marc, On 6/6/19 6:54 PM, Marc Zyngier wrote: > As we are going to perform some VM-wide operations when freeing > a collection, add the kvm pointer to vgic_its_free_collection. > > Signed-off-by: Marc Zyngier Eventually do you use that commit in subsequent patches? Thanks Eric > --- >

Re: [PATCH 3/8] KVM: arm/arm64: vgic-its: Cache successful MSI->LPI translation

2019-06-07 Thread Auger Eric
Hi Marc, On 6/6/19 6:54 PM, Marc Zyngier wrote: > On a successful translation, preserve the parameters in the LPI > translation cache. Each translation is reusing the last slot > in the list, naturally evincting the least recently used entry. evicting > > Signed-off-by: Marc Zyngier > --- >

Re: [PATCH v8 23/29] vfio: VFIO_IOMMU_CACHE_INVALIDATE

2019-06-14 Thread Auger Eric
Hi Liu, On 6/14/19 2:38 PM, Liu, Yi L wrote: > Hi Eric, > >> From: Eric Auger [mailto:eric.au...@redhat.com] >> Sent: Monday, May 27, 2019 12:10 AM >> Subject: [PATCH v8 23/29] vfio: VFIO_IOMMU_CACHE_INVALIDATE >> >> From: "Liu, Yi L" >> >> When the guest "owns" the stage 1 translation

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

2019-06-13 Thread Auger Eric
Hi, On 5/30/19 7:09 PM, Jean-Philippe Brucker wrote: > Implement the virtio-iommu driver, following specification v0.12 [1]. > Since last version [2] we've worked on improving the specification, > which resulted in the following changes to the interface: > * Remove the EXEC flag. > * Add feature

Re: [PATCH v7 18/23] iommu/smmuv3: Report non recoverable faults

2019-05-13 Thread Auger Eric
Hi Robin, On 5/13/19 1:54 PM, Robin Murphy wrote: > On 13/05/2019 08:46, Auger Eric wrote: >> Hi Robin, >> >> On 5/8/19 7:20 PM, Robin Murphy wrote: >>> On 08/04/2019 13:19, Eric Auger wrote: >>>> When a stage 1 related fault event is read from the event q

Re: [PATCH v7 14/23] iommu/smmuv3: Implement cache_invalidate

2019-05-13 Thread Auger Eric
Hi Robin, On 5/8/19 5:01 PM, Robin Murphy wrote: > On 08/04/2019 13:19, Eric Auger wrote: >> Implement domain-selective and page-selective IOTLB invalidations. >> >> Signed-off-by: Eric Auger >> >> --- >> v6 -> v7 >> - check the uapi version >> >> v3 -> v4: >> - adapt to changes in the uapi >> -

Re: [PATCH v7 12/23] iommu/smmuv3: Get prepared for nested stage support

2019-05-13 Thread Auger Eric
Hi Robin, On 5/13/19 1:43 PM, Robin Murphy wrote: > On 10/05/2019 15:34, Auger Eric wrote: >> Hi Robin, >> >> On 5/8/19 4:24 PM, Robin Murphy wrote: >>> On 08/04/2019 13:19, Eric Auger wrote: >>>> To allow nested stage support, we need to store bo

Re: [PATCH v7 14/23] iommu/smmuv3: Implement cache_invalidate

2019-05-13 Thread Auger Eric
Hi Robin, On 5/13/19 4:01 PM, Robin Murphy wrote: > On 13/05/2019 13:16, Auger Eric wrote: >> Hi Robin, >> On 5/8/19 5:01 PM, Robin Murphy wrote: >>> On 08/04/2019 13:19, Eric Auger wrote: >>>> Implement domain-selective and page-selective IOTLB invalidations.

Re: [PATCH v7 12/23] iommu/smmuv3: Get prepared for nested stage support

2019-05-10 Thread Auger Eric
Hi Robin, On 5/8/19 4:24 PM, Robin Murphy wrote: > On 08/04/2019 13:19, Eric Auger wrote: >> To allow nested stage support, we need to store both >> stage 1 and stage 2 configurations (and remove the former >> union). >> >> A nested setup is characterized by both s1_cfg and s2_cfg >> set. >> >>

Re: [PATCH v7 13/23] iommu/smmuv3: Implement attach/detach_pasid_table

2019-05-10 Thread Auger Eric
Hi Robin, On 5/8/19 4:38 PM, Robin Murphy wrote: > On 08/04/2019 13:19, Eric Auger wrote: >> On attach_pasid_table() we program STE S1 related info set >> by the guest into the actual physical STEs. At minimum >> we need to program the context descriptor GPA and compute >> whether the stage1 is

Re: [PATCH v7 06/23] iommu: Introduce bind/unbind_guest_msi

2019-05-10 Thread Auger Eric
Hi Robin, On 5/8/19 3:59 PM, Robin Murphy wrote: > On 08/04/2019 13:18, Eric Auger wrote: >> On ARM, MSI are translated by the SMMU. An IOVA is allocated >> for each MSI doorbell. If both the host and the guest are exposed >> with SMMUs, we end up with 2 different IOVAs allocated by each. >> guest

Re: [PATCH v7 04/23] iommu: Introduce attach/detach_pasid_table API

2019-05-15 Thread Auger Eric
Hi Jean-Philippe, On 5/15/19 2:09 PM, Jean-Philippe Brucker wrote: > On 08/04/2019 13:18, Eric Auger wrote: >> diff --git a/include/uapi/linux/iommu.h b/include/uapi/linux/iommu.h >> index edcc0dda7993..532a64075f23 100644 >> --- a/include/uapi/linux/iommu.h >> +++ b/include/uapi/linux/iommu.h >>

<    1   2   3   4   5   6   7   8   9   >