Coupling between KVM_IRQFD and KVM_SET_GSI_ROUTING?

2014-06-17 Thread Eric Auger
Hello, I have a question related to KVM_IRQFD and KVM_SET_GSI_ROUTING ioctl relationship. When reading the KVM API documentation I do not understand there is any dependency between KVM_IRQFD and KVM_SET_GSI_ROUTING. According to the text it seems only the gsi field is used and interpreted as the

Re: [PATCH v2] ARM: KVM: add irqfd and irq routing support

2014-06-17 Thread Eric Auger
On 06/06/2014 02:16 PM, Christoffer Dall wrote: > On Mon, Jun 02, 2014 at 02:54:12PM +0100, Marc Zyngier wrote: >> Hi Eric, >> >> On Mon, Jun 02 2014 at 8:29:56 am BST, Eric Auger >> wrote: >>> This patch enables irqfd and irq routing on ARM. >>>

Re: [RFC PATCH 4/6] arm/arm64: KVM: vgic: Improve handling of GICD_I{CS}PENDRn

2014-06-18 Thread Eric Auger
On 06/14/2014 10:51 PM, Christoffer Dall wrote: > The handling of writes to the GICD_ISPENDRn and GICD_ICPENDRn is > currently not handled correctly for level-triggered interrupts. Hi Christoffer, Thanks for this patch serie. I can confirm it fixes my QEMU/VFIO issue where all IRQs were pending cl

Re: [RFC PATCH 1/6] arm/arm64: KVM: Rename irq_state to irq_pending

2014-06-18 Thread Eric Auger
On 06/14/2014 10:51 PM, Christoffer Dall wrote: > The irq_state field on the distributor struct is ambiguous in its > meaning; the comment says it's the level of the input put, but that > doesn't make much sense for edge-triggered interrupts. The code > actually uses this state variable to check i

Re: [RFC PATCH 6/6] arm/arm64: KVM: vgic: Clarify and correct vgic documentation

2014-06-18 Thread Eric Auger
On 06/14/2014 10:51 PM, Christoffer Dall wrote: > The VGIC virtual distributor implementation documentation was written a > very long time ago, before the true nature of the beast had been > partially absorbed into my bloodstream. I think this amalgamates the > two evil beings (myself and the code

Re: Coupling between KVM_IRQFD and KVM_SET_GSI_ROUTING?

2014-06-19 Thread Eric Auger
Hi, If I am not wrong I did not get any reply to this question. Can anyone share his/her experience/knowledge on this gsi routing/irqfd use case? Thank you in advance Best Regards Eric On 06/17/2014 01:39 PM, Eric Auger wrote: > Hello, > > I have a question related to KVM_

Re: [PATCH v2] ARM: KVM: add irqfd and irq routing support

2014-06-19 Thread Eric Auger
> start to stabilise, I can help with testing. Hi Will, sure I will CC you. > > On Thu, Jun 05, 2014 at 03:39:50PM +0100, Christoffer Dall wrote: >> On Thu, Jun 05, 2014 at 03:15:15PM +0200, Eric Auger wrote: >>> On 06/05/2014 12:28 PM, Christoffer Dall wrote: >>>

[RFC v3] ARM: KVM: add irqfd and irq routing support

2014-06-20 Thread Eric Auger
on top of https://lists.cs.columbia.edu/pipermail/kvmarm/2014-June/009979.html All pieces can be found on git://git.linaro.org/people/eric.auger/linux.git branch irqfd_integ_v3 Signed-off-by: Eric Auger --- GSI routing mostly is implemented in generic irqchip.c. The tiny ARM specific part is

Re: Coupling between KVM_IRQFD and KVM_SET_GSI_ROUTING?

2014-06-24 Thread Eric Auger
On 06/24/2014 12:40 PM, Alexander Graf wrote: > > On 24.06.14 11:47, Paul Mackerras wrote: >> On Mon, Jun 23, 2014 at 06:47:51PM +0200, Alexander Graf wrote: >>> On 17.06.14 13:39, Eric Auger wrote: >>>> Hello, >>>> >>>> I have a qu

Re: Coupling between KVM_IRQFD and KVM_SET_GSI_ROUTING?

2014-06-24 Thread Eric Auger
On 06/24/2014 05:47 PM, Alexander Graf wrote: > > On 24.06.14 17:05, Eric Auger wrote: >> On 06/24/2014 12:40 PM, Alexander Graf wrote: >>> On 24.06.14 11:47, Paul Mackerras wrote: >>>> On Mon, Jun 23, 2014 at 06:47:51PM +0200, Alexander Graf wrote: >>

Re: [PATCH 0/6] IRQFD without IRQ routing, enabled for XICS

2014-07-24 Thread Eric Auger
Hi Paul, I also confirm your patch works fine on my ARM test environment. I was able to run - with irqchip without regression - without irqchip (ie removing routing totally), just implementing identity kvm_irq_map_gsi and kvm_irq_map_chip_pin and proper kvm_set_irq. The overall integration becomes

[RFC PATCH] ARM: KVM: add irqfd support

2014-08-04 Thread Eric Auger
thanks to Paul Mackerras' patch serie: "IRQFD without IRQ routing, enabled for XICS" (https://www.mail-archive.com/kvm@vger.kernel.org/msg104478.html) Signed-off-by: Eric Auger --- This patch would deprecate the previous patch featuring GSI routing (https://patches.linaro.org/322

Re: The status about vhost-net on kvm-arm?

2014-08-12 Thread Eric Auger
On 08/12/2014 04:41 AM, Li Liu wrote: > Hi all, > > Is anyone there can tell the current status of vhost-net on kvm-arm? > > Half a year has passed from Isa Ansharullah asked this question: > http://www.spinics.net/lists/kvm-arm/msg08152.html > > I have found two patches which have provided the

Re: [RFC PATCH] ARM: KVM: add irqfd support

2014-08-19 Thread Eric Auger
On 08/13/2014 04:55 PM, Christoffer Dall wrote: > On Mon, Aug 04, 2014 at 02:08:22PM +0200, Eric Auger wrote: >> This patch enables irqfd on ARM. >> >> irqfd framework enables to inject a virtual IRQ into a guest upon an >> eventfd trigger. User-side uses KVM_IRQFD V

Re: [RFC PATCH] ARM: KVM: add irqfd support

2014-08-19 Thread Eric Auger
On 08/13/2014 04:55 PM, Christoffer Dall wrote: > On Mon, Aug 04, 2014 at 02:08:22PM +0200, Eric Auger wrote: >> This patch enables irqfd on ARM. >> >> irqfd framework enables to inject a virtual IRQ into a guest upon an >> eventfd trigger. User-side uses KVM_IRQFD V

[PATCH v2 0/2] irqfd support for ARM

2014-08-25 Thread Eric Auger
ck in __kvm_vgic_sync_hwstate - remove irq.h Eric Auger (2): KVM: EVENTFD: remove inclusion of irq.h KVM: ARM: add irqfd support Documentation/virtual/kvm/api.txt | 5 +++- arch/arm/include/uapi/asm/kvm.h | 3 +++ arch/arm/kvm/Kconfig | 3 ++- arch/arm/kvm/Makefile

[PATCH v2 2/2] KVM: ARM: add irqfd support

2014-08-25 Thread Eric Auger
must correspond to a shared peripheral interrupt (SPI), ie the GIC interrupt ID is gsi+32. this patch enables CONFIG_HAVE_KVM_EVENTFD and CONFIG_HAVE_KVM_IRQFD. No IRQ routing table is used. Signed-off-by: Eric Auger --- This patch deprecates the previous patch featuring GSI routing (https

[PATCH v2 1/2] KVM: EVENTFD: remove inclusion of irq.h

2014-08-25 Thread Eric Auger
No more needed. Also irq.h is not used on ARM. Signed-off-by: Eric Auger --- virt/kvm/eventfd.c | 1 - 1 file changed, 1 deletion(-) diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c index 3c5981c..0c712a7 100644 --- a/virt/kvm/eventfd.c +++ b/virt/kvm/eventfd.c @@ -36,7 +36,6 @@ #include

[RFC 9/9] KVM: KVM_VFIO: ARM: implement irq forwarding control

2014-08-25 Thread Eric Auger
re of this. Signed-off-by: Eric Auger --- arch/arm/include/asm/kvm_host.h | 2 + arch/arm/kvm/Makefile | 2 +- arch/arm/kvm/kvm_vfio_arm.c | 599 3 files changed, 602 insertions(+), 1 deletion(-) create mode 100644 arch/arm/kvm/kvm_vfio_a

[RFC 3/9] VFIO: platform: handler tests whether the IRQ is forwarded

2014-08-25 Thread Eric Auger
a new physical IRQ to hit. In virtualization use case, the physical IRQ is automatically completed by the interrupt controller when the guest completes the corresponding virtual IRQ. Signed-off-by: Eric Auger --- drivers/vfio/platform/vfio_platform_irq.c | 7 ++- 1 file changed, 6

[RFC 2/9] KVM: ARM: VGIC: add forwarded irq rbtree lock

2014-08-25 Thread Eric Auger
add a lock related to the rb tree manipulation. The rb tree can be searched in one thread (irqfd handler for instance) and map/unmap happen in another. Signed-off-by: Eric Auger --- virt/kvm/arm/vgic.c | 46 +- 1 file changed, 37 insertions(+), 9

[RFC 0/9] KVM-VFIO IRQ forward control

2014-08-25 Thread Eric Auger
eric.auger/linux.git on branch 3.17rc1_forward_integ_v0 This was was tested on Calxeda Miday, assigning the xgmac main IRQ. Eric Auger (9): KVM: ARM: VGIC: fix multiple injection of level sensitive forwarded IRQ KVM: ARM: VGIC: add forwarded irq rbtree lock VFIO: platform: handler tests whet

[RFC 8/9] KVM: KVM-VFIO: add kvm_vfio_arch_data and accessors

2014-08-25 Thread Eric Auger
add a pointer to architecture specific data in kvm_vfio struct add accessors to keep kvm_vfio private Signed-off-by: Eric Auger --- arch/arm/include/asm/kvm_host.h | 8 virt/kvm/vfio.c | 21 + 2 files changed, 29 insertions(+) diff --git a/arch/arm

[RFC 1/9] KVM: ARM: VGIC: fix multiple injection of level sensitive forwarded IRQ

2014-08-25 Thread Eric Auger
forwarded IRQ injection is observed while the LR of the previous instance was not observed as empty. Signed-off-by: Eric Auger --- include/kvm/arm_vgic.h | 1 + virt/kvm/arm/vgic.c| 9 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/include/kvm/arm_vgic.h b/include/kvm

[RFC 7/9] KVM: KVM-VFIO: add new VFIO external API hooks

2014-08-25 Thread Eric Auger
add functions that implement the gateway to the extended external VFIO API: - kvm_vfio_device_get_external_user - kvm_vfio_device_put_external_user - kvm_vfio_external_get_type - kvm_vfio_external_get_base_device Signed-off-by: Eric Auger --- arch/arm/include/asm/kvm_host.h | 6 virt/kvm

[RFC 5/9] VFIO: Extend external user API

2014-08-25 Thread Eric Auger
) - vfio_external_get_base_device enables to get the struct device*, useful to access the platform_device Signed-off-by: Eric Auger --- drivers/vfio/vfio.c | 35 +++ include/linux/vfio.h | 4 2 files changed, 39 insertions(+) diff --git a/drivers/vfio/vfio.c b/drivers/vfio

[RFC 6/9] KVM: KVM-VFIO: allow arch specific implementation

2014-08-25 Thread Eric Auger
introduce a new option __KVM_HAVE_ARCH_KVM_VFIO option. When set the generic KVM-VFIO code calls architecture dependent code. the architecture dependent hooks are - kvm_arch_vfio_has_attr - kvm_arch_vfio_set_attr - kvm_arch_vfio_init - kvm_arch_vfio_destroy Signed-off-by: Eric Auger

[RFC 4/9] KVM: KVM-VFIO: update user API to program forwarded IRQ

2014-08-25 Thread Eric Auger
add new device group commands: - KVM_DEV_VFIO_DEVICE_ASSIGN_IRQ and KVM_DEV_VFIO_DEVICE_DEASSIGN_IRQ which enable to turn forwarded IRQ mode on/off. Signed-off-by: Eric Auger --- Documentation/virtual/kvm/devices/vfio.txt | 25 + arch/arm/include/uapi/asm/kvm.h

Re: [RFC 0/9] KVM-VFIO IRQ forward control

2014-08-27 Thread Eric Auger
On 08/26/2014 07:49 PM, Alex Williamson wrote: > On Mon, 2014-08-25 at 15:27 +0200, Eric Auger wrote: >> This RFC proposes an integration of "ARM: Forwarding physical >> interrupts to a guest VM" (http://lwn.net/Articles/603514/) in >> KVM. >> >> It enab

Re: [RFC 9/9] KVM: KVM_VFIO: ARM: implement irq forwarding control

2014-08-27 Thread Eric Auger
On 08/26/2014 09:02 PM, Alex Williamson wrote: > On Mon, 2014-08-25 at 15:27 +0200, Eric Auger wrote: >> Implements ARM specific KVM-VFIO device group commands: >> - KVM_DEV_VFIO_DEVICE_ASSIGN_IRQ >> - KVM_DEV_VFIO_DEVICE_DEASSIGN_IRQ >> capability can be querie

Re: [RFC 4/9] KVM: KVM-VFIO: update user API to program forwarded IRQ

2014-08-27 Thread Eric Auger
On 08/26/2014 09:01 PM, Alex Williamson wrote: > On Mon, 2014-08-25 at 15:27 +0200, Eric Auger wrote: >> add new device group commands: >> - KVM_DEV_VFIO_DEVICE_ASSIGN_IRQ and >> KVM_DEV_VFIO_DEVICE_DEASSIGN_IRQ >> >> which enable to turn forwarded IRQ mode

Re: [RFC 8/9] KVM: KVM-VFIO: add kvm_vfio_arch_data and accessors

2014-08-27 Thread Eric Auger
On 08/26/2014 09:02 PM, Alex Williamson wrote: > On Mon, 2014-08-25 at 15:27 +0200, Eric Auger wrote: >> add a pointer to architecture specific data in kvm_vfio struct >> add accessors to keep kvm_vfio private >> >> Signed-off-by: Eric Auger >> --- >>

Re: [RFC 5/9] VFIO: Extend external user API

2014-08-27 Thread Eric Auger
On 08/26/2014 09:02 PM, Alex Williamson wrote: > On Mon, 2014-08-25 at 15:27 +0200, Eric Auger wrote: >> New functions are added to be called from ARM KVM-VFIO device. >> >> - vfio_device_get_external_user enables to get a vfio device from >> its fd >> - vfio_

Re: [RFC 8/9] KVM: KVM-VFIO: add kvm_vfio_arch_data and accessors

2014-08-27 Thread Eric Auger
On 08/27/2014 05:37 PM, Alex Williamson wrote: > On Wed, 2014-08-27 at 17:22 +0200, Eric Auger wrote: >> On 08/26/2014 09:02 PM, Alex Williamson wrote: >>> On Mon, 2014-08-25 at 15:27 +0200, Eric Auger wrote: >>>> add a pointer to architecture specific data in kvm_vfi

[PATCH] KVM: EVENTFD: remove inclusion of irq.h

2014-09-01 Thread Eric Auger
No more needed. irq.h would be void on ARM. Signed-off-by: Eric Auger --- I don't think irq.h is needed anymore since Paul Mackerras' work. However I did not compile for all architectures. --- virt/kvm/eventfd.c | 1 - 1 file changed, 1 deletion(-) diff --git a/virt/kvm/eventfd.c

[PATCH v3] ARM: KVM: add irqfd support

2014-09-01 Thread Eric Auger
& KVM_CAP_IRQFD_RESAMPLE capabilities are exposed Signed-off-by: Eric Auger --- This patch serie deprecates the previous serie featuring GSI routing (https://patches.linaro.org/32261/) The patch serie has the following dependencies: - arm/arm64: KVM: Various VGIC cleanups and improvements h

[RFC v2 9/9] KVM: KVM-VFIO: ARM forwarding control

2014-09-01 Thread Eric Auger
, kvm_vfio_arm.c Signed-off-by: Eric Auger --- arch/arm/include/asm/kvm_host.h | 2 + arch/arm/kvm/Makefile | 2 +- arch/arm/kvm/kvm_vfio_arm.c | 85 + 3 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 arch/arm/kvm

[RFC v2 8/9] KVM: KVM-VFIO: generic KVM_DEV_VFIO_DEVICE command and IRQ forwarding control

2014-09-01 Thread Eric Auger
, embodied by the kvm_arch_set_fwd_state function. Its implementation is given in a separate patch file. The forwarding control modality is enabled by the __KVM_HAVE_ARCH_KVM_VFIO_FORWARD define. Signed-off-by: Eric Auger --- v1 -> v2: - __KVM_HAVE_ARCH_KVM_VFIO renamed i

[RFC v2 7/9] KVM: KVM-VFIO: add new VFIO external API hooks

2014-09-01 Thread Eric Auger
add functions that implement the gateway to the extended external VFIO API: - kvm_vfio_device_get_external_user - kvm_vfio_device_put_external_user - kvm_vfio_external_base_device Signed-off-by: Eric Auger --- v1 -> v2: - kvm_vfio_external_get_base_device renamed i

[RFC v2 1/9] KVM: ARM: VGIC: fix multiple injection of level sensitive forwarded IRQ

2014-09-01 Thread Eric Auger
in vgic_update_irq_pending). This obviously assumes the forwarded IRQ is injected from kernel side. Signed-off-by: Eric Auger --- It was attempted to reset the states in __kvm_vgic_sync_hwstate, checking the emptied LR of forwarded IRQ. However surprisingly this solution does not seem to work

[RFC v2 3/9] ARM: KVM: Enable the KVM-VFIO device

2014-09-01 Thread Eric Auger
From: Kim Phillips Used by KVM-enabled VFIO-based device passthrough support in QEMU. Signed-off-by: Kim Phillips --- arch/arm/kvm/Kconfig | 1 + arch/arm/kvm/Makefile | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm/kvm/Kconfig b/arch/arm/kvm/Kconfig index e519a

[RFC v2 2/9] KVM: ARM: VGIC: add forwarded irq rbtree lock

2014-09-01 Thread Eric Auger
add a lock related to the rb tree manipulation. The rb tree can be searched in one thread (irqfd handler for instance) and map/unmap happen in another. Signed-off-by: Eric Auger --- include/kvm/arm_vgic.h | 1 + virt/kvm/arm/vgic.c| 46 +- 2

[RFC v2 6/9] VFIO: Extend external user API

2014-09-01 Thread Eric Auger
-by: Eric Auger --- v1 -> v2: - vfio_external_get_base_device renamed into vfio_external_base_device - vfio_external_get_type removed --- drivers/vfio/vfio.c | 24 include/linux/vfio.h | 3 +++ 2 files changed, 27 insertions(+) diff --git a/drivers/vfio/vfio.

[RFC v2 5/9] KVM: KVM-VFIO: update user API to program forwarded IRQ

2014-09-01 Thread Eric Auger
add new device group commands: - KVM_DEV_VFIO_DEVICE_FORWARD_IRQ and KVM_DEV_VFIO_DEVICE_UNFORWARD_IRQ which enable to turn forwarded IRQ mode on/off. the kvm_arch_forwarded_irq struct embodies a forwarded IRQ Signed-off-by: Eric Auger --- v1 -> v2: - struct kvm_arch_forwarded_irq mo

[RFC v2 0/9] KVM-VFIO IRQ forward control

2014-09-01 Thread Eric Auger
_external_get_base_device renamed into kvm_vfio_external_base_device - __KVM_HAVE_ARCH_KVM_VFIO renamed into __KVM_HAVE_ARCH_KVM_VFIO_FORWARD Eric Auger (8): KVM: ARM: VGIC: fix multiple injection of level sensitive forwarded IRQ KVM: ARM: VGIC: add forwarded irq rbtree lock VFIO: platform: hand

[RFC v2 4/9] VFIO: platform: handler tests whether the IRQ is forwarded

2014-09-01 Thread Eric Auger
a new physical IRQ to hit. In virtualization use case, the physical IRQ is automatically completed by the interrupt controller when the guest completes the corresponding virtual IRQ. Signed-off-by: Eric Auger --- drivers/vfio/platform/vfio_platform_irq.c | 7 ++- 1 file changed, 6

Re: [RFC v2 0/9] KVM-VFIO IRQ forward control

2014-09-05 Thread Eric Auger
On 09/02/2014 11:05 PM, Alex Williamson wrote: > On Mon, 2014-09-01 at 14:52 +0200, Eric Auger wrote: >> This RFC proposes an integration of "ARM: Forwarding physical >> interrupts to a guest VM" (http://lwn.net/Articles/603514/) in >> KVM. >> >> It enab

Re: [PATCH v3] ARM: KVM: add irqfd support

2014-09-11 Thread Eric Auger
On 09/11/2014 05:09 AM, Christoffer Dall wrote: > On Mon, Sep 01, 2014 at 10:53:04AM +0200, Eric Auger wrote: >> This patch enables irqfd on ARM. >> >> irqfd framework enables to inject a virtual IRQ into a guest upon an >> eventfd trigger. User-side uses KVM_IRQFD V

Re: [RFC v2 4/9] VFIO: platform: handler tests whether the IRQ is forwarded

2014-09-11 Thread Eric Auger
On 09/11/2014 05:10 AM, Christoffer Dall wrote: > On Mon, Sep 01, 2014 at 02:52:43PM +0200, Eric Auger wrote: >> In case the IRQ is forwarded, the VFIO platform IRQ handler does not >> need to disable the IRQ anymore. In that mode, when the handler completes > > add a com

Re: [RFC v2 5/9] KVM: KVM-VFIO: update user API to program forwarded IRQ

2014-09-11 Thread Eric Auger
On 09/11/2014 05:10 AM, Christoffer Dall wrote: > On Mon, Sep 01, 2014 at 02:52:44PM +0200, Eric Auger wrote: >> add new device group commands: >> - KVM_DEV_VFIO_DEVICE_FORWARD_IRQ and >> KVM_DEV_VFIO_DEVICE_UNFORWARD_IRQ >> >> which enable to turn for

Re: [RFC v2 6/9] VFIO: Extend external user API

2014-09-11 Thread Eric Auger
On 09/11/2014 05:10 AM, Christoffer Dall wrote: > On Mon, Sep 01, 2014 at 02:52:45PM +0200, Eric Auger wrote: >> New functions are added to be called from ARM KVM-VFIO device. > > This commit message seems somewhat random. This patch doesn't deal with > anything ARM speci

Re: [RFC v2 7/9] KVM: KVM-VFIO: add new VFIO external API hooks

2014-09-11 Thread Eric Auger
On 09/11/2014 05:10 AM, Christoffer Dall wrote: > On Mon, Sep 01, 2014 at 02:52:46PM +0200, Eric Auger wrote: >> add functions that implement the gateway to the extended > > Capital letter when beginning a new sentence. Also the reference to > 'the extended VFIO API

Re: [RFC v2 8/9] KVM: KVM-VFIO: generic KVM_DEV_VFIO_DEVICE command and IRQ forwarding control

2014-09-11 Thread Eric Auger
On 09/11/2014 05:10 AM, Christoffer Dall wrote: > On Mon, Sep 01, 2014 at 02:52:47PM +0200, Eric Auger wrote: >> This patch introduces a new KVM_DEV_VFIO_DEVICE attribute. >> >> This is a new control channel which enables KVM to cooperate with >> viable VFIO devices. &g

Re: [RFC v2 8/9] KVM: KVM-VFIO: generic KVM_DEV_VFIO_DEVICE command and IRQ forwarding control

2014-09-11 Thread Eric Auger
On 09/11/2014 07:05 AM, Alex Williamson wrote: > On Thu, 2014-09-11 at 05:10 +0200, Christoffer Dall wrote: >> On Mon, Sep 01, 2014 at 02:52:47PM +0200, Eric Auger wrote: >>> This patch introduces a new KVM_DEV_VFIO_DEVICE attribute. >>> >>> This is a new

Re: [RFC v2 2/9] KVM: ARM: VGIC: add forwarded irq rbtree lock

2014-09-11 Thread Eric Auger
On 09/11/2014 05:09 AM, Christoffer Dall wrote: > On Mon, Sep 01, 2014 at 02:52:41PM +0200, Eric Auger wrote: >> add a lock related to the rb tree manipulation. The rb tree can be > > Ok, I can't hold myself back any longer. Please begin sentences with a > capital lette

Re: [RFC v2 1/9] KVM: ARM: VGIC: fix multiple injection of level sensitive forwarded IRQ

2014-09-11 Thread Eric Auger
On 09/11/2014 05:09 AM, Christoffer Dall wrote: > On Mon, Sep 01, 2014 at 02:52:40PM +0200, Eric Auger wrote: >> Fix multiple injection of level sensitive forwarded IRQs. >> With current code, the second injection fails since the state bitmaps >> are not reset (process_main

Re: [RFC PATCH 1/4] ARM: KVM: on unhandled IO mem abort, route the call to the KVM MMIO bus

2014-11-13 Thread Eric Auger
On 11/13/2014 04:31 PM, Andre Przywara wrote: > > > On 13/11/14 15:02, Nikolay Nikolaev wrote: >> On Thu, Nov 13, 2014 at 4:23 PM, Eric Auger wrote: >>> On 11/13/2014 03:16 PM, Eric Auger wrote: >>>> On 11/13/2014 11:45 AM, Nikolay Nikolaev wrote: &

Re: [RFC v2 0/9] KVM-VFIO IRQ forward control

2014-11-17 Thread Eric Auger
iamson >> Sent: Thursday, September 11, 2014 1:10 PM >> To: Christoffer Dall >> Cc: Eric Auger; eric.au...@st.com; marc.zyng...@arm.com; >> linux-arm-ker...@lists.infradead.org; kvm...@lists.cs.columbia.edu; >> kvm@vger.kernel.org; joel.sch...@amd.com; kim.phill...@free

Re: [PATCH v9 06/19] vfio/platform: return info for bound device

2014-11-20 Thread Eric Auger
On 11/20/2014 03:10 PM, Antonios Motakis wrote: > On Wed, Nov 12, 2014 at 5:36 PM, Alex Williamson > wrote: >> On Wed, 2014-11-12 at 11:32 +0100, Eric Auger wrote: >>> On 10/27/2014 07:07 PM, Antonios Motakis wrote: >>>> A VFIO userspace driver will start by

Re: [RFC PATCH v1 1/2] vfio: Add new interrupt group for VFIO

2014-11-20 Thread Eric Auger
On 11/20/2014 04:53 PM, Alex Williamson wrote: > On Thu, 2014-11-20 at 17:05 +0800, Feng Wu wrote: >> Add new group KVM_DEV_VFIO_INTERRUPT and command >> KVM_DEV_VFIO_DEVIE_POSTING_IRQ related to it. >> >> This is used for VT-d Posted-Interrupts setup. > > Eric proposed an interface for ARM forwar

Re: [RFC PATCH v1 2/2] vfio: Add VFIO API vfio_msi_get_irq

2014-11-20 Thread Eric Auger
On 11/20/2014 05:05 PM, Alex Williamson wrote: > On Thu, 2014-11-20 at 17:05 +0800, Feng Wu wrote: >> This API returns the host irq for the MSI/MSI-X interrrupts. >> >> Signed-off-by: Feng Wu >> --- >> drivers/vfio/pci/vfio_pci.c | 10 ++ >> include/linux/vfio.h|2 ++ >> 2 f

Re: [PATCH v1] ARM/ARM64: support KVM_IOEVENTFD

2014-11-21 Thread Eric Auger
Hi Ming, for your information there is a series written by Antonios (added in CC) https://lists.cs.columbia.edu/pipermail/kvmarm/2014-March/008416.html exactly on the same topic. The thread was reactivated by Nikolay latterly on Nov (see http://www.gossamer-threads.com/lists/linux/kernel/1886716?

[PATCH v4 0/3] irqfd support for arm/arm64

2014-11-23 Thread Eric Auger
reference) - remove irq.h Eric Auger (2): KVM: arm/arm64: unset CONFIG_HAVE_KVM_IRQCHIP KVM: arm: add irqfd support Joel Schopp (1): KVM: arm64: add irqfd support Documentation/virtual/kvm/api.txt | 5 ++- arch/arm/include/uapi/asm/kvm.h | 3 ++ arch/arm/kvm/Kconfig | 4 +--

[PATCH v4 3/3] KVM: arm64: add irqfd support

2014-11-23 Thread Eric Auger
From: Joel Schopp This patch enables irqfd for arm64. Signed-off-by: Joel Schopp Signed-off-by: Eric Auger --- [Eric Auger] - originates from Joel's [RFC PATCH] arm64: KVM: add irqfd support http://www.spinics.net/lists/kvm-arm/msg10798.html - isolates modifications really relat

[PATCH v4 2/3] KVM: arm: add irqfd support

2014-11-23 Thread Eric Auger
soon as CONFIG_HAVE_KVM_IRQFD is set. Signed-off-by: Eric Auger --- v3 -> v4: - reword commit message - explain why we unlock the distributor before calling kvm_notify_acked_irq - rename is_assigned_irq into has_notifier - change EOI and injection kvm_debug format string - remove error lo

[PATCH v4 1/3] KVM: arm/arm64: unset CONFIG_HAVE_KVM_IRQCHIP

2014-11-23 Thread Eric Auger
CONFIG_HAVE_KVM_IRQCHIP is needed to support IRQ routing (along with irq_comm.c and irqchip.c usage). This is not the case for arm/arm64 currently. This patch unsets the flag for both arm and arm64. Signed-off-by: Eric Auger --- arch/arm/kvm/Kconfig | 2 -- arch/arm64/kvm/Kconfig | 1 - 2

[RFC 4/4] KVM: arm: vgic: handle irqfd forwarded IRQ injection before vgic readiness

2014-11-23 Thread Eric Auger
the host must deactivate it. Signed-off-by: Eric Auger --- virt/kvm/arm/vgic.c | 20 1 file changed, 20 insertions(+) diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c index 21419ac..27394b0 100644 --- a/virt/kvm/arm/vgic.c +++ b/virt/kvm/arm/vgic.c @@ -2672,6 +2672,13

[RFC 1/4] KVM: arm: vgic: fix state machine for forwarded IRQ

2014-11-23 Thread Eric Auger
queueing the IRQ (programming the LR), the pending state is removed as for edge sensitive IRQs - an injection of a forwarded IRQ is considered always valid since coming from the HW and level always is 1. Signed-off-by: Eric Auger --- v2 -> v3: - integration in new vgic_can_sample_irq - rem

[RFC 3/4] KVM: arm: vgic: cleanup forwarded IRQs on destroy

2014-11-23 Thread Eric Auger
When the VGIC is destroyed it must take care of - restoring the forwarded IRQs in non forwarded state, - deactivating the IRQ in case the guest left without doing it - cleaning nodes of the phys_map rbtree Signed-off-by: Eric Auger --- virt/kvm/arm/vgic.c | 36

[RFC 2/4] KVM: arm: vgic: add forwarded irq rbtree lock

2014-11-23 Thread Eric Auger
Add a lock related to the rb tree manipulation. The rb tree can be searched in one thread (irqfd handler for instance) and map/unmap may happen in another. Signed-off-by: Eric Auger --- v2 -> v3: re-arrange lock sequence in vgic_map_phys_irq --- include/kvm/arm_vgic.h | 1 + virt/kvm/

[RFC 0/4] vgic additions for forwarded irq

2014-11-23 Thread Eric Auger
nux.git on branch irqfd_integ_v8 The first 2 patch files were previously part of [RFC v2 0/9] KVM-VFIO IRQ forward control (https://lkml.org/lkml/2014/9/1/347). Eric Auger (4): KVM: arm: vgic: fix state machine for forwarded IRQ KVM: arm: vgic: add forwarded irq rbtree lock KVM: arm: vgi

[PATCH v3 2/8] KVM: arm64: Enable the KVM-VFIO device

2014-11-23 Thread Eric Auger
Used by KVM-enabled VFIO-based device passthrough support in QEMU. Signed-off-by: Joel Schopp Signed-off-by: Eric Auger --- Extracted from [RFC PATCH] arm64: KVM: add irqfd support http://www.spinics.net/lists/kvm-arm/msg10798.html --- arch/arm64/kvm/Kconfig | 1 + arch/arm64/kvm/Makefile

[PATCH v3 4/8] KVM: kvm-vfio: User API for IRQ forwarding

2014-11-23 Thread Eric Auger
kvm_arch_forwarded_irq. Signed-off-by: Eric Auger --- v2 -> v3: - rework vfio kvm device documentation - reword commit message and title - add subindex in kvm_arch_forwarded_irq to be closer to VFIO API - forwarding state can only be changed with VFIO IRQ signaling is off v1 -> v2: -

[PATCH v3 8/8] KVM: arm: kvm-vfio: forwarding control

2014-11-23 Thread Eric Auger
is initiated. - forwarded case: deactivation is initiated by the guest; when it completes the virtual IRQ, the GIC automatically deactivates the physical IRQ. - not forwarded case: the physical IRQ deactivation is handled by the host Signed-off-by: Eric Auger --- v2 -> v3: - renaming

[PATCH v3 6/8] KVM: kvm-vfio: wrapper to VFIO external API device helpers

2014-11-23 Thread Eric Auger
reference counter to a vfio device, - kvm_vfio_external_base_device returns a handle to the struct device of the vfio device. The KVM-VFIO device uses the VFIO external API device functions. Signed-off-by: Eric Auger --- v2 -> v3: reword the commit message and title v1 -&

[PATCH v3 7/8] KVM: kvm-vfio: generic forwarding control

2014-11-23 Thread Eric Auger
__KVM_HAVE_ARCH_KVM_VFIO_FORWARD is set. When not set those functions are void. Signed-off-by: Eric Auger --- v2 -> v3: - add API comments in kvm_host.h - improve the commit message - create a private kvm_vfio_fwd_irq struct - fwd_irq_action replaced by a bool and removal of VFIO_IRQ_CLEANUP. This lat

[PATCH v3 5/8] VFIO: External user API device helpers

2014-11-23 Thread Eric Auger
decrements the reference counter - vfio_external_base_device returns a handle to the struct device Signed-off-by: Eric Auger --- v2 -> v3: - reword the commit message v1 -> v2: - vfio_external_get_base_device renamed into vfio_external_base_device - vfio_external_get_type removed --- d

[PATCH v3 3/8] VFIO: platform: forwarded state tested when selecting IRQ handler

2014-11-23 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 edge handler (no automaske). Signed-off-by: Eric Auger --- v2 -> v3: - forwar

[PATCH v3 1/8] KVM: arm: Enable the KVM-VFIO device

2014-11-23 Thread Eric Auger
From: Kim Phillips Used by KVM-enabled VFIO-based device passthrough support in QEMU. Signed-off-by: Kim Phillips --- arch/arm/kvm/Kconfig | 1 + arch/arm/kvm/Makefile | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm/kvm/Kconfig b/arch/arm/kvm/Kconfig index e519a

[PATCH v3 0/8] KVM-VFIO IRQ forward control

2014-11-23 Thread Eric Auger
fio_external_get_base_device renamed into kvm_vfio_external_base_device - __KVM_HAVE_ARCH_KVM_VFIO renamed into __KVM_HAVE_ARCH_KVM_VFIO_FORWARD Eric Auger (7): KVM: arm64: Enable the KVM-VFIO device VFIO: platform: forwarded state tested when selecting IRQ handler KVM: kvm-vfio: User API for IRQ forwarding

Re: [PATCH v3 0/8] KVM-VFIO IRQ forward control

2014-11-24 Thread Eric Auger
On 11/24/2014 09:14 AM, Wu, Feng wrote: > > >> -Original Message----- >> From: Eric Auger [mailto:eric.au...@linaro.org] >> Sent: Monday, November 24, 2014 2:36 AM >> To: eric.au...@st.com; eric.au...@linaro.org; christoffer.d...@linaro.org; >>

Re: [PATCH v4 0/3] irqfd support for arm/arm64

2014-11-24 Thread Eric Auger
On 11/24/2014 10:47 AM, Christoffer Dall wrote: > On Sun, Nov 23, 2014 at 06:56:57PM +0100, Eric Auger wrote: >> This patch series enables irqfd on arm and arm64. >> >> Irqfd framework enables to inject a virtual IRQ into a guest upon an >> eventfd trigger. User-side

Re: [PATCH v4 2/3] KVM: arm: add irqfd support

2014-11-24 Thread Eric Auger
On 11/24/2014 11:00 AM, Christoffer Dall wrote: > On Sun, Nov 23, 2014 at 06:56:59PM +0100, Eric Auger wrote: >> This patch enables irqfd on arm. >> >> Both irqfd and resamplefd are supported. Injection is implemented >> in vgic.c without routing. >> >> Thi

Re: [RFC 0/4] vgic additions for forwarded irq

2014-11-24 Thread Eric Auger
On 11/24/2014 11:54 AM, Marc Zyngier wrote: > On 24/11/14 10:50, Christoffer Dall wrote: >> On Sun, Nov 23, 2014 at 07:12:49PM +0100, Eric Auger wrote: >>> This series applies on top of "ARM: Forwarding physical >>> interrupts to a guest VM" (http://lwn.net/Art

Re: [PATCH] kvm: x86: move ioapic.c and irq_comm.c back to arch/x86/

2014-11-24 Thread Eric Auger
On 11/20/2014 02:42 PM, Paolo Bonzini wrote: > ia64 does not need them anymore. > > Signed-off-by: Paolo Bonzini > --- > arch/x86/include/asm/kvm_host.h | 16 > arch/x86/kvm/Makefile | 5 ++--- > {virt => arch/x86}/kvm/ioapic.c | 0 > {virt => arch/x86}/kvm/ioa

Re: [PATCH v4 2/3] KVM: arm: add irqfd support

2014-11-25 Thread Eric Auger
On 11/25/2014 11:19 AM, Christoffer Dall wrote: > [Re-adding cc list] > > On Mon, Nov 24, 2014 at 05:42:30PM +0100, Eric Auger wrote: >> On 11/24/2014 04:47 PM, Christoffer Dall wrote: >>> On Mon, Nov 24, 2014 at 12:02 PM, Eric Auger wrote: >>>> On 11/24/2

Re: [PATCH v4 2/3] KVM: arm: add irqfd support

2014-11-25 Thread Eric Auger
On 11/25/2014 02:12 PM, Eric Auger wrote: > On 11/25/2014 11:19 AM, Christoffer Dall wrote: >> [Re-adding cc list] >> >> On Mon, Nov 24, 2014 at 05:42:30PM +0100, Eric Auger wrote: >>> On 11/24/2014 04:47 PM, Christoffer Dall wrote: >>>> On Mon, N

Re: [PATCH v3 7/8] KVM: kvm-vfio: generic forwarding control

2014-11-25 Thread Eric Auger
On 11/25/2014 05:33 AM, Wu, Feng wrote: > > >> -Original Message----- >> From: Eric Auger [mailto:eric.au...@linaro.org] >> Sent: Monday, November 24, 2014 2:36 AM >> To: eric.au...@st.com; eric.au...@linaro.org; christoffer.d...@linaro.org; >>

Re: [RFC PATCH v2 1/2] KVM: kvm-vfio: User API for VT-d Posted-Interrupts

2014-11-25 Thread Eric Auger
On 11/25/2014 01:23 PM, Feng Wu wrote: > This patch adds and documents a new attribute > KVM_DEV_VFIO_DEVICE_POSTING_IRQ in KVM_DEV_VFIO_DEVICE group. > This new attribute is used for VT-d Posted-Interrupts. > > When guest OS changes the interrupt configuration for an > assigned device, such as, M

Re: [PATCH v3 7/8] KVM: kvm-vfio: generic forwarding control

2014-11-25 Thread Eric Auger
On 11/24/2014 09:56 PM, Alex Williamson wrote: > On Sun, 2014-11-23 at 19:35 +0100, Eric Auger wrote: >> 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. >> >

Re: [PATCH v4 2/3] KVM: arm: add irqfd support

2014-11-26 Thread Eric Auger
On 11/26/2014 12:31 PM, Christoffer Dall wrote: > On Tue, Nov 25, 2014 at 02:12:31PM +0100, Eric Auger wrote: >> On 11/25/2014 11:19 AM, Christoffer Dall wrote: >>> [Re-adding cc list] >>> >>> On Mon, Nov 24, 2014 at 05:42:30PM +0100, Eric Auger wrote: >>&

Re: [RFC PATCH 4/5] ARM: enable linking against eventfd and irqchip

2014-11-26 Thread Eric Auger
On 11/24/2014 10:27 PM, Nikolay Nikolaev wrote: > This enables compilation of the eventfd feature on ARM. Hi Nikolay, why irqchip in the title? Best Regards Eric > > Signed-off-by: Nikolay Nikolaev > --- > arch/arm/kvm/Kconfig |1 + > arch/arm/kvm/Makefile |2 +- > 2 files changed, 2

Re: [RFC PATCH 1/5] KVM: redesing kvm_io_bus_ API to pass VCPU structure to the callbacks.

2014-11-26 Thread Eric Auger
Hi Nikolay, typo in the title, On 11/24/2014 10:26 PM, Nikolay Nikolaev wrote: > This is needed in e.g. ARM vGIC emulation, where the MMIO handling > depends on the VCPU that does the access. > > Signed-off-by: Nikolay Nikolaev > --- > arch/ia64/kvm/kvm-ia64.c |4 ++-- > arch/powerpc/kvm

Re: [RFC PATCH 2/5] ARM: on IO mem abort - route the call to KVM MMIO bus

2014-11-27 Thread Eric Auger
On 11/24/2014 10:26 PM, Nikolay Nikolaev wrote: > On IO memory abort, try to handle the MMIO access thorugh the KVM typo > registered read/write callbacks. This is done by invoking the relevant > kvm_io_bus_* API. > > Signed-off-by: Nikolay Nikolaev > --- > arch/arm/kvm/mmio.c | 33 +++

Re: [RFC PATCH 3/5] KVM: ARM VGIC add kvm_io_bus_ frontend

2014-11-27 Thread Eric Auger
On 11/24/2014 10:26 PM, Nikolay Nikolaev wrote: > In io_mem_abort remove the call to vgic_handle_mmio. The target is to have > a single MMIO handling path - that is through the kvm_io_bus_ API. > > Register a kvm_io_device in kvm_vgic_init on the whole vGIC MMIO region. > Both read and write calls

Re: [RFC PATCH 0/5] ARM: KVM: Enable the ioeventfd capability of KVM on ARM

2014-11-27 Thread Eric Auger
On 11/24/2014 10:26 PM, Nikolay Nikolaev wrote: > The IOEVENTFD KVM capability is a prerequisite for vhost support, > and is also used to implement improved interrupt handling in VFIO drivers. Hi Nikolay As far as I am aware, irqfd currently is used in vfio context, not ioeventfd, although they bo

Re: [RFC PATCH v2 1/2] KVM: kvm-vfio: User API for VT-d Posted-Interrupts

2014-12-01 Thread Eric Auger
On 11/25/2014 05:10 PM, Alex Williamson wrote: > On Tue, 2014-11-25 at 16:01 +0100, Eric Auger wrote: >> On 11/25/2014 01:23 PM, Feng Wu wrote: >>> This patch adds and documents a new attribute >>> KVM_DEV_VFIO_DEVICE_POSTING_IRQ in KVM_DEV_VFIO_DEVICE group. >>&g

Re: [PATCH v3 3/8] VFIO: platform: forwarded state tested when selecting IRQ handler

2014-12-01 Thread Eric Auger
Hi Christoffer, On 11/30/2014 01:47 PM, Christoffer Dall wrote: > The subject reads strangely, perhaps just: > > VFIO: platform: test forward state when selecting IRQ handler OK > > On Sun, Nov 23, 2014 at 07:35:55PM +0100, Eric Auger wrote: >> In case the IRQ is forwarded,

Re: [PATCH v3 4/8] KVM: kvm-vfio: User API for IRQ forwarding

2014-12-01 Thread Eric Auger
On 11/30/2014 01:53 PM, Christoffer Dall wrote: > On Sun, Nov 23, 2014 at 07:35:56PM +0100, Eric Auger wrote: >> This patch adds and document a new KVM_DEV_VFIO_DEVICE group > > documents OK > >> and 2 device attributes: KVM_DEV_VFIO_DEVICE_FORWARD_IRQ, >> KVM_DEV_

Re: [PATCH v3 2/8] KVM: arm64: Enable the KVM-VFIO device

2014-12-01 Thread Eric Auger
On 11/30/2014 01:14 PM, Christoffer Dall wrote: > On Sun, Nov 23, 2014 at 07:35:54PM +0100, Eric Auger wrote: >> Used by KVM-enabled VFIO-based device passthrough support in QEMU. >> >> Signed-off-by: Joel Schopp >> Signed-off-by: Eric Auger >> >> --- >

  1   2   3   4   5   6   7   >