Re: [PATCH v2 3/4] irqchip: GIC: Convert to EOImode == 1

2015-08-17 Thread Eric Auger
On 08/13/2015 10:28 AM, Marc Zyngier wrote: > So far, GICv2 has been used in with EOImode == 0. The effect of this in with? > mode is to perform the priority drop and the deactivation of the > interrupt at the same time. > > While this works perfectly for Linux (we only have a single priority), >

Re: [PATCH v2 2/4] irqchip: GICv3: Don't deactivate interrupts forwarded to a guest

2015-08-17 Thread Eric Auger
Reviewed-by: Eric Auger On 08/13/2015 10:28 AM, Marc Zyngier wrote: > Commit 0a4377de3056 ("genirq: Introduce irq_set_vcpu_affinity() to > target an interrupt to a VCPU") added just what we needed at the > lowest level to allow an interrupt to be deactivated by a guest. > > When such a request re

Re: [PATCH v2 1/4] irqchip: GICv3: Convert to EOImode == 1

2015-08-17 Thread Eric Auger
Hi Marc, On 08/13/2015 10:28 AM, Marc Zyngier wrote: > So far, GICv3 has been used in with EOImode == 0. The effect of this > mode is to perform the priority drop and the deactivation of the > interrupt at the same time. > > While this works perfectly for Linux (we only have a single priority), >

Re: [PATCH v3 06/10] VFIO: platform: add irq bypass producer management

2015-08-17 Thread Eric Auger
Hi Alex, On 08/12/2015 08:56 PM, Alex Williamson wrote: > On Mon, 2015-08-10 at 15:21 +0200, Eric Auger wrote: >> This patch populates the IRQ bypass callacks: >> - stop/start producer simply consist in disabling/enabling the host irq >> - add/del consumer: basically set the automasked flag to fals

Re: [PATCH v3 05/10] VFIO: platform: add vfio_platform_is_active

2015-08-17 Thread Eric Auger
On 08/12/2015 08:56 PM, Alex Williamson wrote: > On Mon, 2015-08-10 at 15:20 +0200, Eric Auger wrote: >> This function returns whether the IRQ is active at irqchip level or >> VFIO masked. If either is true, it is considered the IRQ is active. >> Currently there is no way to differentiate userspace

Re: [PATCH v3 04/10] VFIO: platform: add vfio_platform_set_automasked

2015-08-17 Thread Eric Auger
On 08/12/2015 08:56 PM, Alex Williamson wrote: > On Mon, 2015-08-10 at 15:20 +0200, Eric Auger wrote: >> This function makes possible to change the automasked mode. >> >> Signed-off-by: Eric Auger >> >> --- >> >> v1 -> v2: >> - set forwarded flag >> --- >> drivers/vfio/platform/vfio_platform_irq.

Re: [PATCH v3 03/10] VFIO: platform: single handler using function pointer

2015-08-17 Thread Eric Auger
Alex, On 08/12/2015 08:56 PM, Alex Williamson wrote: > On Mon, 2015-08-10 at 15:20 +0200, Eric Auger wrote: >> A single handler now is registered whatever the use case: automasked >> or not. A function pointer is set according to the wished behavior >> and the handler calls this function. >> >> The

Re: [PATCH v3 01/10] VFIO: platform: registration of a dummy IRQ bypass producer

2015-08-17 Thread Eric Auger
Hi Alex, On 08/12/2015 08:56 PM, Alex Williamson wrote: > On Mon, 2015-08-10 at 15:20 +0200, Eric Auger wrote: >> Register a dummy producer with void callbacks >> >> Signed-off-by: Eric Auger >> >> --- >> >> v2 -> v3: >> - rename vfio_platform_irq_bypass_resume into *_start >> --- >> drivers/vfio

Re: [PATCH v2 14/15] KVM: arm64: implement MSI injection in ITS emulation

2015-08-17 Thread Eric Auger
On 07/10/2015 04:21 PM, Andre Przywara wrote: > When userland wants to inject a MSI into the guest, we have to use > our data structures to find the LPI number and the VCPU to receive > the interrupt. > Use the wrapper functions to iterate the linked lists and find the > proper Interrupt Translatio

Re: [PATCH v2 13/15] KVM: arm64: implement ITS command queue command handlers

2015-08-17 Thread Eric Auger
On 07/10/2015 04:21 PM, Andre Przywara wrote: > The connection between a device, an event ID, the LPI number and the > allocated CPU is stored in in-memory tables in a GICv3, but their > format is not specified by the spec. Instead software uses a command > queue in a ring buffer to let the ITS imp

[PATCH v4 3/3] Make KVM_CAP_IRQFD dependent on KVM_CAP_IRQCHIP

2015-08-17 Thread Pavel Fedin
Now at least ARM is able to determine whether the machine has virtualization support for irqchip or not at runtime. Obviously, irqfd requires irqchip. Signed-off-by: Pavel Fedin --- virt/kvm/kvm_main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/virt/kvm/kvm_main.c b

[PATCH v4 0/3] KVM: arm/arm64: Allow to use KVM without in-kernel irqchip

2015-08-17 Thread Pavel Fedin
This patch set brings back functionality which was broken in v4.0. Unfortunately because of restrictions of such a hardware is is impossible to take advantage of virtual architected timer, therefore guest, running in such restricted mode, has to use some memory-mapped timer. But it is still better

[PATCH v4 1/3] Fix NULL pointer dereference if KVM is used without in-kernel irqchip

2015-08-17 Thread Pavel Fedin
Makes qemu working again with kernel-irqchip=off option, allowing to use GIC emulation in userspace. Previously kvm_vgic_map_resources() used to include irqchip_in_kernel() check, and vgic_v2_map_resources() still has it, but now vm_ops are not initialized before kvm_vgic_create(). Therefore kvm_v

[PATCH v4 2/3] Detect vGIC presence at runtime

2015-08-17 Thread Pavel Fedin
Before commit 662d9715840aef44dcb573b0f9fab9e8319c868a is was possible to compile the kernel without vGIC and vTimer support. Commit message says about possibility to detect vGIC support in runtine, but this has never been implemented. This patch introdices runtime check, restoring the lost functi