Re: [PATCH 00/10] arm/arm64: KVM: Active interrupt state switching for shared devices

2015-06-10 Thread Eric Auger
Hi Marc, On 06/10/2015 11:03 AM, Marc Zyngier wrote: Hi Eric, On 10/06/15 09:33, Eric Auger wrote: Hi Marc, On 06/08/2015 07:03 PM, Marc Zyngier wrote: From day 1, our timer code has been using a terrible hack: whenever the guest is scheduled with a timer interrupt pending (i.e. the HW

Re: [PATCH V2 0/5] Enable ACPI support for KVM ARM

2015-06-10 Thread Andrew Jones
On Wed, Jun 10, 2015 at 12:16:02AM -0400, Wei Huang wrote: Initial ACPI support for ARM64 has been accepted into Linux kernel recently. Now it is a good time to re-visit ACPI support for KVM. This patchset enables ACPI for both arch_timer and vGIC by probing related ACPI tables and does

Re: [PATCH V2 1/5] kvm: arm64: Enable ACPI support for virt arch timer

2015-06-10 Thread Andrew Jones
On Wed, Jun 10, 2015 at 12:16:03AM -0400, Wei Huang wrote: This patches enables ACPI support for KVM virtual arch timer. It allows KVM to parse ACPI table for arch timer PPI when DT table is not present. Signed-off-by: Alexander Spyridaki a.spyrida...@virtualopensystems.com Signed-off-by:

Re: [PATCH V2 5/5] kvm: arm64: Implement ACPI probing code for GICv3

2015-06-10 Thread Andrew Jones
On Wed, Jun 10, 2015 at 12:16:07AM -0400, Wei Huang wrote: This patches enables ACPI support for KVM virtual GICv3. KVM parses ACPI table for virt GIC related information and initializes resources. Signed-off-by: Wei Huang w...@redhat.com --- virt/kvm/arm/vgic-v3.c | 40

IRQFD support with GICv3 ITS (WAS: RE: [PATCH 00/13] arm64: KVM: GICv3 ITS emulation)

2015-06-10 Thread Pavel Fedin
Hello guys! Currently on ARM, irqfd supports routing an host eventfd towards a virtual SPI: eventfd - vSPI = gsi+32 parameters of irqfd are the eventfd and the gsi. Yes, but this works only with GICv2m, because it actually turns MSI data into SPI number. ITS works in a completely

Re: [PATCH 00/10] arm/arm64: KVM: Active interrupt state switching for shared devices

2015-06-10 Thread Marc Zyngier
Hi Eric, On 10/06/15 09:33, Eric Auger wrote: Hi Marc, On 06/08/2015 07:03 PM, Marc Zyngier wrote: From day 1, our timer code has been using a terrible hack: whenever the guest is scheduled with a timer interrupt pending (i.e. the HW timer has expired), we restore the timer state with the

Re: should KVM or userspace be the one which decides what MIPIDR/affinity values to assign to vcpus?

2015-06-10 Thread Igor Mammedov
On Tue, 09 Jun 2015 15:35:21 +0100 Marc Zyngier marc.zyng...@arm.com wrote: On 09/06/15 15:01, Peter Maydell wrote: On 9 June 2015 at 15:00, Marc Zyngier marc.zyng...@arm.com wrote: Yeah, what I had in mind was something along the lines of: - kernel computes its default MPDIR - kernel

Re: [PATCH 00/10] arm/arm64: KVM: Active interrupt state switching for shared devices

2015-06-10 Thread Eric Auger
Hi Marc, On 06/08/2015 07:03 PM, Marc Zyngier wrote: From day 1, our timer code has been using a terrible hack: whenever the guest is scheduled with a timer interrupt pending (i.e. the HW timer has expired), we restore the timer state with the MASK bit set, in order to avoid the physical

Re: [PATCH v2 05/11] KVM: arm: check ordering of all system register tables

2015-06-10 Thread Alex Bennée
Zhichao Huang zhichao.hu...@linaro.org writes: We now have multiple tables for the various system registers we trap. Make sure we check the order of all of them, as it is critical that we get the order right (been there, done that...). Signed-off-by: Zhichao Huang zhichao.hu...@linaro.org

Re: IRQFD support with GICv3 ITS (WAS: RE: [PATCH 00/13] arm64: KVM: GICv3 ITS emulation)

2015-06-10 Thread Eric Auger
Hi, On 06/10/2015 10:31 AM, Pavel Fedin wrote: Hello guys! Currently on ARM, irqfd supports routing an host eventfd towards a virtual SPI: eventfd - vSPI = gsi+32 parameters of irqfd are the eventfd and the gsi. Yes, but this works only with GICv2m, because it actually turns MSI data

RE: IRQFD support with GICv3 ITS (WAS: RE: [PATCH 00/13] arm64: KVM: GICv3 ITS emulation)

2015-06-10 Thread Pavel Fedin
Hi! indeed in newly added qemu kvm-all.c kvm_arch_msi_data_to_gsi we could call a new ioctl that translates the data + deviceid? into an LPI and program irqfd with that LPI. This is done once when setting irqfd up. This also means extending irqfd support to lpi injection, gsi being the LPI

Re: [PATCH V2 3/5] kvm: arm64: Detect GIC version for proper ACPI vGIC probing

2015-06-10 Thread Marc Zyngier
On 10/06/15 05:16, Wei Huang wrote: There are two GICs (GICv2 and GICv3) supported by KVM. So it is necessary to find out GIC version before calling ACPI probing functions defined in vgic-v2.c and vgic-v3.c. This patch detects GIC version by checking gic_version field of GIC distributor,

RE: IRQFD support with GICv3 ITS (WAS: RE: [PATCH 00/13] arm64: KVM: GICv3 ITS emulation)

2015-06-10 Thread Pavel Fedin
Hello! KVM GSI routing, even if only used for MSI routing then mandates to build entries for non MSI IRQs, using irqchip routing entries. Then you draw the irqchip.c kvm_irq_routing_table chip[KVM_NR_IRQCHIPS][KVM_IRQCHIP_NUM_PINS] static allocation issue. Sorry for this add-on, needed

Re: [PATCH v2 6/8] arm: prepare for instantiating different IRQ chip devices

2015-06-10 Thread Marc Zyngier
On 05/06/15 09:37, Andre Przywara wrote: Extend the vGIC handling code to potentially deal with different IRQ chip devices instead of hard-coding the GICv2 in. We extend most vGIC functions to take a type parameter, but still put GICv2 in at the top for the time being. Signed-off-by: Andre

Re: [PATCH 03/10] KVM: arm/arm64: vgic: Convert struct vgic_lr to use bitfields

2015-06-10 Thread Marc Zyngier
On 10/06/15 18:23, Andre Przywara wrote: Hi Marc, On 06/08/2015 06:03 PM, Marc Zyngier wrote: As we're about to cram more information in the vgic_lr structure (HW interrupt number and additional state information), we switch to a layout similar to the HW's: - use bitfields to save space

Re: [PATCH v2 5/8] arm: finish VGIC initialisation explicitly

2015-06-10 Thread Marc Zyngier
On 05/06/15 09:37, Andre Przywara wrote: Since Linux 3.19-rc1 there is a new API to explicitly initialise the in-kernel GIC emulation by a userland KVM device call. Use that to tell the kernel we are finished with the GIC initialisation, since the automatic GIC init will only be provided as a

Re: [PATCH v2 7/8] arm: add support for supplying GICv3 redistributor addresses

2015-06-10 Thread Marc Zyngier
On 05/06/15 09:37, Andre Przywara wrote: The code currently is assuming fixed sized memory regions for the distributor and CPU interface. GICv3 needs a dynamic allocation of its redistributor region, since its size depends on the number of vCPUs. Also add the necessary code to create a GICv3