Re: [PATCH v8 03/17] KVM: extend struct kvm_msi to hold a 32-bit device ID

2016-07-06 Thread André Przywara
On 06/07/16 22:06, Christoffer Dall wrote: > On Tue, Jul 05, 2016 at 12:22:55PM +0100, Andre Przywara wrote: >> The ARM GICv3 ITS MSI controller requires a device ID to be able to >> assign the proper interrupt vector. On real hardware, this ID is >> sampled from the bus. To be able to emulate an

Re: [PATCH v8 05/17] KVM: kvm_io_bus: add kvm_io_bus_get_dev() call

2016-07-06 Thread André Przywara
Hi Christoffer, On 06/07/16 22:15, Christoffer Dall wrote: > On Tue, Jul 05, 2016 at 12:22:57PM +0100, Andre Przywara wrote: >> The kvm_io_bus framework is a nice place of holding information about >> various MMIO regions for kernel emulated devices. >> Add a call to retrieve the kvm_io_device

Re: [PATCH v8 05/17] KVM: kvm_io_bus: add kvm_io_bus_get_dev() call

2016-07-06 Thread Christoffer Dall
On Tue, Jul 05, 2016 at 12:22:57PM +0100, Andre Przywara wrote: > The kvm_io_bus framework is a nice place of holding information about > various MMIO regions for kernel emulated devices. > Add a call to retrieve the kvm_io_device structure which is associated > with a certain MMIO address. This

Re: [RESEND PATCH v4] KVM: arm/arm64: Add VGICv3 save/restore API documentation

2016-07-06 Thread Peter Maydell
On 6 July 2016 at 12:37, Christoffer Dall wrote: > Factor out the GICv3-specific documentation into a separate > documentation file. Add description for how to access distributor, > redistributor, and CPU interface registers for GICv3 in this new file, > and add a

[RESEND PATCH v4] KVM: arm/arm64: Add VGICv3 save/restore API documentation

2016-07-06 Thread Christoffer Dall
Factor out the GICv3-specific documentation into a separate documentation file. Add description for how to access distributor, redistributor, and CPU interface registers for GICv3 in this new file, and add a group for accessing level triggered IRQ information for GICv3 as well. Signed-off-by:

Re: [PATCH v8 00/17] KVM: arm64: GICv3 ITS emulation

2016-07-06 Thread Auger Eric
Hi Andre, On 05/07/2016 13:22, Andre Przywara wrote: > Hi, > > this series allows those KVM guests that use an emulated GICv3 to use LPIs > as well, though in the moment this is limited to emulated PCI devices. > This is based on kvmarm/queue, which now only features the new VGIC >

[RFC v6 3/6] KVM: irqchip: convey devid to kvm_set_msi

2016-07-06 Thread Eric Auger
on ARM, a devid field is populated in kvm_msi struct in case the flag is set to KVM_MSI_VALID_DEVID. Let's propagate both flags and devid field in kvm_kernel_irq_routing_entry. Signed-off-by: Eric Auger Acked-by: Christoffer Dall --- v4 ->

[RFC v6 6/6] KVM: arm: enable KVM_SIGNAL_MSI and MSI routing

2016-07-06 Thread Eric Auger
If the ITS modality is not available, let's simply support MSI injection by transforming the MSI.data into an SPI ID. This becomes possible to use KVM_SIGNAL_MSI ioctl and MSI routing for arm too. Signed-off-by: Eric Auger --- v4 -> v5: - on vgic_v2m_inject_msi check

[RFC v6 2/6] KVM: kvm_host: add devid in kvm_kernel_irq_routing_entry

2016-07-06 Thread Eric Auger
Extend kvm_kernel_irq_routing_entry to transport the device id field, devid. A new flags field makes possible to indicate the devid is valid. Those additions are used for ARM GICv3 ITS MSI injection. Signed-off-by: Eric Auger Acked-by: Christoffer Dall

[RFC v6 0/6] KVM: arm/arm64: gsi routing support

2016-07-06 Thread Eric Auger
With the advent of GICv3 ITS in-kernel emulation, KVM MSI routing becomes mandated for proper VIRTIO-PCI vhost integration. In QEMU, when the VIRTIO-PCI device is programmed with the MSI message, we previously used direct_mapping trick: this consists in extracting the IRQ ID found in the MSI

[RFC v6 4/6] KVM: arm/arm64: enable irqchip routing

2016-07-06 Thread Eric Auger
This patch adds compilation and link against irqchip. Main motivation behind using irqchip code is to enable MSI routing code. In the future irqchip routing may also be useful when targeting multiple irqchips. Routing standard callbacks now are implemented in vgic-irqfd: - kvm_set_routing_entry

[RFC v6 5/6] KVM: arm/arm64: enable MSI routing

2016-07-06 Thread Eric Auger
Up to now, only irqchip routing entries could be set. This patch adds the capability to insert MSI routing entries. For ARM64, let's also increase KVM_MAX_IRQ_ROUTES to 4096: this include SPI irqchip routes plus MSI routes. In the future this might be extended. Signed-off-by: Eric Auger

[RFC v6 1/6] KVM: api: pass the devid in the msi routing entry

2016-07-06 Thread Eric Auger
On ARM, the MSI msg (address and data) comes along with out-of-band device ID information. The device ID encodes the device that writes the MSI msg. Let's convey the device id in kvm_irq_routing_msi and use KVM_MSI_VALID_DEVID flag value in kvm_irq_routing_entry to indicate the msi devid is