Re: [Linaro-uefi] UEFI on KVM fails to start on juno on cortex-a57 cluster

2015-04-13 Thread Ard Biesheuvel
On 27 March 2015 at 01:02, Ard Biesheuvel ard.biesheu...@linaro.org wrote: On 26 March 2015 at 09:09, Riku Voipio riku.voi...@linaro.org wrote: On 25 March 2015 at 21:32, Ard Biesheuvel ard.biesheu...@linaro.org wrote: On 25 March 2015 at 17:14, Ard Biesheuvel ard.biesheu...@linaro.org wrote:

Re: [PATCH v2 09/10] KVM: arm64: trap nested debug register access

2015-04-13 Thread Alex Bennée
Andrew Jones drjo...@redhat.com writes: On Tue, Mar 31, 2015 at 04:08:07PM +0100, Alex Bennée wrote: When we are using the hardware registers for guest debug we need to deal with the guests access to them. There is already a mechanism for dealing with these accesses so we build on top of

Re: [PATCH v2 03/10] KVM: arm: guest debug, define API headers

2015-04-13 Thread Christoffer Dall
On Tue, Mar 31, 2015 at 04:08:01PM +0100, Alex Bennée wrote: This commit defines the API headers for guest debugging. There are two architecture specific debug structures: - kvm_guest_debug_arch, allows us to pass in HW debug registers - kvm_debug_exit_arch, signals the exact debug exit

Re: [PATCH] KVM: arm/arm64: check IRQ number on userland injection

2015-04-13 Thread Marc Zyngier
On 13/04/15 11:04, Christoffer Dall wrote: On Fri, Apr 10, 2015 at 05:52:05PM +0100, Andre Przywara wrote: Hi Christopher, On 10/04/15 16:29, Christopher Covington wrote: Hi Andre, On 04/10/2015 11:17 AM, Andre Przywara wrote: When userland injects a SPI via the KVM_IRQ_LINE ioctl we

Re: [PATCH] KVM: arm/arm64: check IRQ number on userland injection

2015-04-13 Thread Christoffer Dall
On Mon, Apr 13, 2015 at 11:21:20AM +0100, Marc Zyngier wrote: On 13/04/15 11:04, Christoffer Dall wrote: On Fri, Apr 10, 2015 at 05:52:05PM +0100, Andre Przywara wrote: Hi Christopher, On 10/04/15 16:29, Christopher Covington wrote: Hi Andre, On 04/10/2015 11:17 AM, Andre Przywara

Re: Advice on HYP interface for AsyncPF

2015-04-13 Thread Andrew Jones
On Mon, Apr 13, 2015 at 11:46:36AM +0100, Mark Rutland wrote: Hi, Otherwise the is_guest() function would be many if-else statements trying to determine the type of guest it is before it even knows that it is a guest. It's worth noting that to some extent this may always be

[PATCH] KVM: arm: irqfd: fix value returned by kvm_irq_map_gsi

2015-04-13 Thread Eric Auger
irqfd/arm curently does not support routing. kvm_irq_map_gsi is supposed to return all the routing entries associated with the provided gsi and return the number of those entries. We should return 0 at this point. Signed-off-by: Eric Auger eric.au...@linaro.org --- virt/kvm/arm/vgic.c | 2 +- 1

Re: [RFC PATCH] arm64: KVM: remove fpsimd save/restore from the world switch

2015-04-13 Thread Marc Zyngier
On 13/04/15 13:57, Christoffer Dall wrote: On Thu, Apr 09, 2015 at 05:53:59PM +0100, Marc Zyngier wrote: The world switch spends quite some time dealing with the FP/SIMD registers, as the state is quite sizeable (32 128bit registers, plus some crumbs on the side). We save/restore them on each

Re: [PATCH v2 05/10] KVM: arm: introduce kvm_arch_setup/clear_debug()

2015-04-13 Thread Christoffer Dall
On Mon, Apr 13, 2015 at 04:36:23PM +0200, Christoffer Dall wrote: [...] + +/** + * kvm_arch_setup_debug - set-up debug related stuff nit: I think you want set up when it's a verb. + * + * @vcpu: the vcpu pointer + * + * This is called before each entry in to the hypervisor to

Re: [RFC PATCH] arm64: KVM: remove fpsimd save/restore from the world switch

2015-04-13 Thread Christoffer Dall
On Thu, Apr 09, 2015 at 05:53:59PM +0100, Marc Zyngier wrote: The world switch spends quite some time dealing with the FP/SIMD registers, as the state is quite sizeable (32 128bit registers, plus some crumbs on the side). We save/restore them on each entry/exit, so that both the host and the

[RFC v6 15/16] KVM: kvm-vfio: generic forwarding control

2015-04-13 Thread Eric Auger
This patch introduces a new KVM_DEV_VFIO_DEVICE group. This is a new control channel which enables KVM to cooperate with viable VFIO devices. The patch introduces 2 attributes for this group: KVM_DEV_VFIO_DEVICE_FORWARD_IRQ, KVM_DEV_VFIO_DEVICE_UNFORWARD_IRQ. Their purpose is to turn a VFIO

[RFC v6 16/16] KVM: arm/arm64: vgic: forwarding control

2015-04-13 Thread Eric Auger
This patch sets __KVM_HAVE_ARCH_KVM_VFIO_FORWARD and implements kvm_arch_set_forward for ARM/ARM64. As a result the KVM-VFIO device now allows to forward/unforward a VFIO device IRQ on ARM. kvm_arch_set_forward and kvm_arch_unset_forward mostly take care of VGIC programming: physical IRQ/guest

[RFC v6 12/16] KVM: arm: rename pause into power_off

2015-04-13 Thread Eric Auger
The kvm_vcpu_arch pause field is renamed into power_off to prepare for the introduction of a new pause field. Signed-off-by: Eric Auger eric.au...@linaro.org v4 - v5: - fix compilation issue on arm64 (add power_off field in kvm_host.h) --- arch/arm/include/asm/kvm_host.h | 4 ++--

[RFC v6 02/16] VFIO: platform: test forwarded state when selecting IRQ handler

2015-04-13 Thread Eric Auger
In case the IRQ is forwarded, the VFIO platform IRQ handler does not need to disable the IRQ anymore. When setting the IRQ handler we now also test the forwarded state. In case the IRQ is forwarded we select the vfio_irq_handler. Signed-off-by: Eric Auger eric.au...@linaro.org --- v3 - v4: -

[RFC v6 05/16] VFIO: external user API for interaction with vfio devices

2015-04-13 Thread Eric Auger
The VFIO external user API is enriched with 3 new functions that allows a kernel user external to VFIO to retrieve some information from a VFIO device. - vfio_device_get_external_user enables to get a vfio device from its fd and increments its reference counter - vfio_device_put_external_user

[RFC v6 03/16] VFIO: platform: single handler using function pointer

2015-04-13 Thread Eric Auger
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 irq lock is taken/released in the root handler. eventfd_signal can be called in regions not allowed to sleep.

[RFC v6 08/16] VFIO: platform: implement vfio_device_external_ops callbacks

2015-04-13 Thread Eric Auger
This patch adds the implementation for the 3 external callbacks of vfio_device_external_ops struct, namely active, is_active, set_automasked. Also vfio_device_ops and vfio_device_external_ops are set accordingly. Signed-off-by: Eric Auger eric.au...@linaro.org --- v6: creation ---

[RFC v6 09/16] VFIO: add vfio_external_{mask|is_active|set_automasked}

2015-04-13 Thread Eric Auger
Introduces 3 new external functions aimed at doing actions on VFIO devices: - mask VFIO IRQ - get the active status of VFIO IRQ (active at interrupt controller level or masked by the level-sensitive automasking). - change the automasked property and switch the IRQ handler (between automasked/

[RFC v6 06/16] VFIO: Introduce vfio_device_external_ops

2015-04-13 Thread Eric Auger
New bus callbacks are introduced. They correspond to external functions. To avoid messing up the main vfio_device_ops struct, a new vfio_device_external_ops struct is introduced. Signed-off-by: Eric Auger eric.au...@linaro.org --- v6: creation --- include/linux/vfio.h | 18 ++

[RFC v6 01/16] KVM: arm/arm64: Enable the KVM-VFIO device

2015-04-13 Thread Eric Auger
From: Kim Phillips kim.phill...@linaro.org The KVM-VFIO device is used by the QEMU VFIO device. It is used to record the list of in-use VFIO groups so that KVM can manipulate them. With this series, it will also be used to record the forwarded IRQs. Signed-off-by: Kim Phillips

[RFC v6 04/16] KVM: kvm-vfio: User API for IRQ forwarding

2015-04-13 Thread Eric Auger
This patch adds and documents a new KVM_DEV_VFIO_DEVICE group and 2 device attributes: KVM_DEV_VFIO_DEVICE_FORWARD_IRQ, KVM_DEV_VFIO_DEVICE_UNFORWARD_IRQ. The purpose is to be able to set a VFIO device IRQ as forwarded or not forwarded. the command takes as argument a handle to a new struct named

[RFC v6 10/16] KVM: kvm-vfio: wrappers to VFIO external API device helpers

2015-04-13 Thread Eric Auger
Provide wrapper functions that allow KVM-VFIO device code to interact with a vfio device: - kvm_vfio_device_get_external_user gets a handle to a struct vfio_device from the vfio device file descriptor and increments its reference counter, - kvm_vfio_device_put_external_user decrements the

[RFC v6 11/16] KVM: kvm-vfio: wrappers for vfio_external_{mask|is_active|set_automasked}

2015-04-13 Thread Eric Auger
Those 3 new wrapper functions call the respective VFIO external functions. Signed-off-by: Eric Auger eric.au...@linaro.org --- - v4: creation - v5 - v6: x vfio.h modifications duly moved in VFIO: platform: add vfio_external_{mask|is_active|set_automasked} x all external functions use

Re: [PATCH v2 05/10] KVM: arm: introduce kvm_arch_setup/clear_debug()

2015-04-13 Thread Alex Bennée
Christoffer Dall christoffer.d...@linaro.org writes: On Tue, Mar 31, 2015 at 04:08:03PM +0100, Alex Bennée wrote: This is a precursor for later patches which will need to do more to setup debug state before entering the hyp.S switch code. The existing functionality for setting mdcr_el2 has