Re: [PATCH v5 0/4] vfio: type1: support for ARM SMMUS with VFIO_IOMMU_TYPE1

2015-03-05 Thread Alex Williamson
On Thu, 2015-03-05 at 18:34 +0100, Eric Auger wrote: > Hi All, > > Ironically, since the correction of the IOMMU_CAP_CACHE_COHERENCY bug > (https://lkml.org/lkml/2015/1/29/514) in vfio_iommu_type1.c, my Calxeda > Midway VFIO use case is not working anymore. This is also observable > when I do not

Re: [RFC/RFT PATCH 0/3] arm64: KVM: work around incoherency with uncached guest mappings

2015-03-05 Thread Ard Biesheuvel
On 5 March 2015 at 15:58, Catalin Marinas wrote: > On Thu, Mar 05, 2015 at 01:26:39PM +0100, Paolo Bonzini wrote: >> On 05/03/2015 13:03, Catalin Marinas wrote: >> >> > I'd hate to have to do that. PCI should be entirely probeable >> >> > given that we tell the guest where the host bridge is, that

Re: [PATCH v5 0/4] vfio: type1: support for ARM SMMUS with VFIO_IOMMU_TYPE1

2015-03-05 Thread Will Deacon
On Thu, Mar 05, 2015 at 05:54:26PM +, Alex Williamson wrote: > On Thu, 2015-03-05 at 18:34 +0100, Eric Auger wrote: > > Ironically, since the correction of the IOMMU_CAP_CACHE_COHERENCY bug > > (https://lkml.org/lkml/2015/1/29/514) in vfio_iommu_type1.c, my Calxeda > > Midway VFIO use case is n

Re: [PATCH v5 0/4] vfio: type1: support for ARM SMMUS with VFIO_IOMMU_TYPE1

2015-03-05 Thread Alex Williamson
On Thu, 2015-03-05 at 18:34 +0100, Eric Auger wrote: > Hi All, > > Ironically, since the correction of the IOMMU_CAP_CACHE_COHERENCY bug > (https://lkml.org/lkml/2015/1/29/514) in vfio_iommu_type1.c, my Calxeda > Midway VFIO use case is not working anymore. This is also observable > when I do not

Re: [RFC/RFT PATCH 0/3] arm64: KVM: work around incoherency with uncached guest mappings

2015-03-05 Thread Paolo Bonzini
On 05/03/2015 15:58, Catalin Marinas wrote: >> It would especially suck if the user has a cluster with different >> machines, some of them coherent and others non-coherent, and then has to >> debug why the same configuration works on some machines and not on others. > > That's a problem indeed,

Re: [PATCH v5 0/4] vfio: type1: support for ARM SMMUS with VFIO_IOMMU_TYPE1

2015-03-05 Thread Eric Auger
Hi All, Ironically, since the correction of the IOMMU_CAP_CACHE_COHERENCY bug (https://lkml.org/lkml/2015/1/29/514) in vfio_iommu_type1.c, my Calxeda Midway VFIO use case is not working anymore. This is also observable when I do not apply at all the whole [PATCH v5 0/4] vfio: type1: support for AR

Re: [PATCH] KVM: vgic: add virt-capable compatible strings

2015-03-05 Thread Laszlo Ersek
On 03/05/15 15:47, Mark Rutland wrote: > Several dts only list "arm,cortex-a7-gic" or "arm,gic-400" in their GIC > compatible list, and while this is correct (and supported by the GIC > driver), KVM will fail to detect that it can support these cases. > > This patch adds the missing strings to the

Re: [RFC/RFT PATCH 0/3] arm64: KVM: work around incoherency with uncached guest mappings

2015-03-05 Thread Catalin Marinas
On Thu, Mar 05, 2015 at 01:26:39PM +0100, Paolo Bonzini wrote: > On 05/03/2015 13:03, Catalin Marinas wrote: > >> > I'd hate to have to do that. PCI should be entirely probeable > >> > given that we tell the guest where the host bridge is, that's > >> > one of its advantages. > > I didn't say a DT

Re: [PATCH] KVM: vgic: add virt-capable compatible strings

2015-03-05 Thread Marc Zyngier
On 05/03/15 14:47, Mark Rutland wrote: > Several dts only list "arm,cortex-a7-gic" or "arm,gic-400" in their GIC > compatible list, and while this is correct (and supported by the GIC > driver), KVM will fail to detect that it can support these cases. > > This patch adds the missing strings to the

[PATCH] KVM: vgic: add virt-capable compatible strings

2015-03-05 Thread Mark Rutland
Several dts only list "arm,cortex-a7-gic" or "arm,gic-400" in their GIC compatible list, and while this is correct (and supported by the GIC driver), KVM will fail to detect that it can support these cases. This patch adds the missing strings to the VGIC code. The of_device_id entries are padded t

Re: [PATCH v9 5/5] KVM: arm/arm64: add irqfd support

2015-03-05 Thread Marc Zyngier
On 05/03/15 14:26, Eric Auger wrote: > On 03/05/2015 03:20 PM, Marc Zyngier wrote: >> On 05/03/15 14:04, Eric Auger wrote: >>> Hi Marc, >>> On 03/05/2015 11:53 AM, Marc Zyngier wrote: On 04/03/15 10:14, Eric Auger wrote: > This patch enables irqfd on arm/arm64. > > Both irqfd and r

Re: [PATCH v9 5/5] KVM: arm/arm64: add irqfd support

2015-03-05 Thread Eric Auger
On 03/05/2015 03:20 PM, Marc Zyngier wrote: > On 05/03/15 14:04, Eric Auger wrote: >> Hi Marc, >> On 03/05/2015 11:53 AM, Marc Zyngier wrote: >>> On 04/03/15 10:14, Eric Auger wrote: This patch enables irqfd on arm/arm64. Both irqfd and resamplefd are supported. Injection is implemen

Re: [PATCH v9 5/5] KVM: arm/arm64: add irqfd support

2015-03-05 Thread Marc Zyngier
On 05/03/15 14:04, Eric Auger wrote: > Hi Marc, > On 03/05/2015 11:53 AM, Marc Zyngier wrote: >> On 04/03/15 10:14, Eric Auger wrote: >>> This patch enables irqfd on arm/arm64. >>> >>> Both irqfd and resamplefd are supported. Injection is implemented >>> in vgic.c without routing. >>> >>> This patc

Re: [PATCH v9 5/5] KVM: arm/arm64: add irqfd support

2015-03-05 Thread Eric Auger
Hi Marc, On 03/05/2015 11:53 AM, Marc Zyngier wrote: > On 04/03/15 10:14, Eric Auger wrote: >> This patch enables irqfd on arm/arm64. >> >> Both irqfd and resamplefd are supported. Injection is implemented >> in vgic.c without routing. >> >> This patch enables CONFIG_HAVE_KVM_EVENTFD and CONFIG_HAV

Re: [PATCH 1/3] arm64: KVM: Fix stage-2 PGD allocation to have per-page refcounting

2015-03-05 Thread Marc Zyngier
On 02/03/15 18:27, Christoffer Dall wrote: > On Wed, Feb 25, 2015 at 04:55:38PM +, Marc Zyngier wrote: >> We're using __get_free_pages with to allocate the guest's stage-2 >> PGD. The standard behaviour of this function is to return a set of >> pages where only the head page has a valid refcoun

Re: [RFC/RFT PATCH 0/3] arm64: KVM: work around incoherency with uncached guest mappings

2015-03-05 Thread Paolo Bonzini
On 05/03/2015 13:03, Catalin Marinas wrote: >> > >> > I'd hate to have to do that. PCI should be entirely probeable >> > given that we tell the guest where the host bridge is, that's >> > one of its advantages. > I didn't say a DT node per device, the DT doesn't know what PCI devices > are avail

Re: [RFC/RFT PATCH 0/3] arm64: KVM: work around incoherency with uncached guest mappings

2015-03-05 Thread Catalin Marinas
On Thu, Mar 05, 2015 at 08:52:49PM +0900, Peter Maydell wrote: > On 5 March 2015 at 20:04, Catalin Marinas wrote: > > On Thu, Mar 05, 2015 at 11:12:22AM +0100, Paolo Bonzini wrote: > >> On 04/03/2015 18:28, Catalin Marinas wrote: > >> >> > Can you add that property to the device tree for PCI devic

Re: [RFC/RFT PATCH 0/3] arm64: KVM: work around incoherency with uncached guest mappings

2015-03-05 Thread Peter Maydell
On 5 March 2015 at 20:04, Catalin Marinas wrote: > On Thu, Mar 05, 2015 at 11:12:22AM +0100, Paolo Bonzini wrote: >> On 04/03/2015 18:28, Catalin Marinas wrote: >> >> > Can you add that property to the device tree for PCI devices too? >> > >> > Yes but not with mainline yet: >> > >> > http://threa

Re: [PATCH v9 5/5] KVM: arm/arm64: add irqfd support

2015-03-05 Thread Marc Zyngier
On 05/03/15 11:27, Paolo Bonzini wrote: > > > On 05/03/2015 11:53, Marc Zyngier wrote: >>> +#ifdef CONFIG_HAVE_KVM_IRQFD >>> + case KVM_CAP_IRQFD: >>> + r = vgic_present; >>> + break; >>> +#endif >> >> Nitpick: we have "select HAVE_KVM_IRQFD", so we can lose the #ifdef-ery.

Re: [PATCH v9 5/5] KVM: arm/arm64: add irqfd support

2015-03-05 Thread Paolo Bonzini
On 05/03/2015 11:53, Marc Zyngier wrote: > > +#ifdef CONFIG_HAVE_KVM_IRQFD > > + case KVM_CAP_IRQFD: > > + r = vgic_present; > > + break; > > +#endif > > Nitpick: we have "select HAVE_KVM_IRQFD", so we can lose the #ifdef-ery. Alternatively, I've just posted a patch to mov

[PATCH] KVM: arm/arm64: prefer IS_ENABLED to a static variable

2015-03-05 Thread Paolo Bonzini
IS_ENABLED gives compile-time checking and keeps the code clearer. The one exception is inside kvm_vm_ioctl_check_extension, where the established idiom is to wrap the case labels with an #ifdef. Signed-off-by: Paolo Bonzini -- Untested... --- arch/arm/kvm/arm.c | 17 +

Re: [RFC/RFT PATCH 0/3] arm64: KVM: work around incoherency with uncached guest mappings

2015-03-05 Thread Catalin Marinas
On Thu, Mar 05, 2015 at 11:12:22AM +0100, Paolo Bonzini wrote: > On 04/03/2015 18:28, Catalin Marinas wrote: > >> > Can you add that property to the device tree for PCI devices too? > > > > Yes but not with mainline yet: > > > > http://thread.gmane.org/gmane.linux.kernel.iommu/8935 > > > > We can

Re: [PATCH v9 5/5] KVM: arm/arm64: add irqfd support

2015-03-05 Thread Marc Zyngier
On 04/03/15 10:14, Eric Auger wrote: > This patch enables irqfd on arm/arm64. > > Both irqfd and resamplefd are supported. Injection is implemented > in vgic.c without routing. > > This patch enables CONFIG_HAVE_KVM_EVENTFD and CONFIG_HAVE_KVM_IRQFD. > > KVM_CAP_IRQFD is now advertised. KVM_CAP_

Re: [PATCH v5 0/4] vfio: type1: support for ARM SMMUS with VFIO_IOMMU_TYPE1

2015-03-05 Thread Baptiste Reynal
On Wed, Mar 4, 2015 at 6:45 PM, Alex Williamson wrote: > On Wed, 2015-03-04 at 17:07 +0100, Baptiste Reynal wrote: >> This patch series makes the VFIO_IOMMU_TYPE1 driver buildable on ARM, so it >> may be used with ARM SMMUs. It also adds support for the IOMMU_NOEXEC flag >> supported by SMMUs adhe

Re: [RFC/RFT PATCH 0/3] arm64: KVM: work around incoherency with uncached guest mappings

2015-03-05 Thread Paolo Bonzini
On 04/03/2015 18:28, Catalin Marinas wrote: >> > >> > Can you add that property to the device tree for PCI devices too? > Yes but not with mainline yet: > > http://thread.gmane.org/gmane.linux.kernel.iommu/8935 > > We can add the property at the PCI host bridge level (with the drawback > that