From: alex.williamson@redhat.com (Alex Williamson)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC 9/9] KVM: KVM_VFIO: ARM: implement irq forwarding control
Date: Tue, 26 Aug 2014 13:02:49 -0600 [thread overview]
Message-ID: <1409079769.2906.131.camel@ul30vt.home> (raw)
In-Reply-To: <1408973264-30384-10-git-send-email-eric.auger@linaro.org>
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 queried using KVM_HAS_DEVICE_ATTR.
>
> The new commands enable to set IRQ forwarding on/off for a given
> IRQ index of a VFIO platform device.
>
> as soon as a forwarded irq is set, a reference to the VFIO device
> is taken by the kvm-vfio device.
>
> The kvm-vfio device stores in the kvm_vfio_arch_data the list
> of "assigned" devices (kvm_vfio_device). Each kvm_vfio_device
> stores the list of assigned IRQs (potentially allowed a subset of
> IRQ to be forwarded)
>
> The kvm-vfio device programs both the GIC and vGIC. Also it
> clears the active bit on destruction, in case the guest did not
> do it itself.
>
> Changing the forwarded state is not allowed in the critical
> section starting from VFIO IRQ handler to LR programming. It is
> up to the client to take care of this.
>
> Signed-off-by: Eric Auger <eric.auger@linaro.org>
> ---
> 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_arm.c
I'm really happy that it seems like the kvm-vfio device is going to work
for you, but I think too much stuff is being pushed out to arch code
here. Exporting the interfaces in patches 7 & 8 are setting the stage
for duplicate code for anyone wanting to implement device attributes.
Instead, I think the core code should support the list of
kvm_vfio_devices with proper cleanup, and we should attempt to access
the kvm_vfio_ callbacks as little as possible from arch code. Thanks,
Alex
WARNING: multiple messages have this Message-ID (diff)
From: Alex Williamson <alex.williamson@redhat.com>
To: Eric Auger <eric.auger@linaro.org>
Cc: eric.auger@st.com, christoffer.dall@linaro.org,
marc.zyngier@arm.com, linux-arm-kernel@lists.infradead.org,
kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org,
joel.schopp@amd.com, kim.phillips@freescale.com,
linux-kernel@vger.kernel.org, patches@linaro.org,
will.deacon@arm.com, a.motakis@virtualopensystems.com,
a.rigo@virtualopensystems.com, john.liuli@huawei.com
Subject: Re: [RFC 9/9] KVM: KVM_VFIO: ARM: implement irq forwarding control
Date: Tue, 26 Aug 2014 13:02:49 -0600 [thread overview]
Message-ID: <1409079769.2906.131.camel@ul30vt.home> (raw)
In-Reply-To: <1408973264-30384-10-git-send-email-eric.auger@linaro.org>
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 queried using KVM_HAS_DEVICE_ATTR.
>
> The new commands enable to set IRQ forwarding on/off for a given
> IRQ index of a VFIO platform device.
>
> as soon as a forwarded irq is set, a reference to the VFIO device
> is taken by the kvm-vfio device.
>
> The kvm-vfio device stores in the kvm_vfio_arch_data the list
> of "assigned" devices (kvm_vfio_device). Each kvm_vfio_device
> stores the list of assigned IRQs (potentially allowed a subset of
> IRQ to be forwarded)
>
> The kvm-vfio device programs both the GIC and vGIC. Also it
> clears the active bit on destruction, in case the guest did not
> do it itself.
>
> Changing the forwarded state is not allowed in the critical
> section starting from VFIO IRQ handler to LR programming. It is
> up to the client to take care of this.
>
> Signed-off-by: Eric Auger <eric.auger@linaro.org>
> ---
> 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_arm.c
I'm really happy that it seems like the kvm-vfio device is going to work
for you, but I think too much stuff is being pushed out to arch code
here. Exporting the interfaces in patches 7 & 8 are setting the stage
for duplicate code for anyone wanting to implement device attributes.
Instead, I think the core code should support the list of
kvm_vfio_devices with proper cleanup, and we should attempt to access
the kvm_vfio_ callbacks as little as possible from arch code. Thanks,
Alex
next prev parent reply other threads:[~2014-08-26 19:02 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-25 13:27 [RFC 0/9] KVM-VFIO IRQ forward control Eric Auger
2014-08-25 13:27 ` Eric Auger
2014-08-25 13:27 ` [RFC 1/9] KVM: ARM: VGIC: fix multiple injection of level sensitive forwarded IRQ Eric Auger
2014-08-25 13:27 ` Eric Auger
2014-08-25 13:27 ` Eric Auger
2014-08-25 13:27 ` [RFC 2/9] KVM: ARM: VGIC: add forwarded irq rbtree lock Eric Auger
2014-08-25 13:27 ` Eric Auger
2014-08-25 13:27 ` [RFC 3/9] VFIO: platform: handler tests whether the IRQ is forwarded Eric Auger
2014-08-25 13:27 ` Eric Auger
2014-08-25 13:27 ` Eric Auger
2014-08-25 13:27 ` [RFC 4/9] KVM: KVM-VFIO: update user API to program forwarded IRQ Eric Auger
2014-08-25 13:27 ` Eric Auger
2014-08-25 13:27 ` Eric Auger
2014-08-26 19:01 ` Alex Williamson
2014-08-26 19:01 ` Alex Williamson
2014-08-27 15:19 ` Eric Auger
2014-08-27 15:19 ` Eric Auger
2014-08-25 13:27 ` [RFC 5/9] VFIO: Extend external user API Eric Auger
2014-08-25 13:27 ` Eric Auger
2014-08-26 19:02 ` Alex Williamson
2014-08-26 19:02 ` Alex Williamson
2014-08-27 15:20 ` Eric Auger
2014-08-27 15:20 ` Eric Auger
2014-08-25 13:27 ` [RFC 6/9] KVM: KVM-VFIO: allow arch specific implementation Eric Auger
2014-08-25 13:27 ` Eric Auger
2014-08-25 13:27 ` [RFC 7/9] KVM: KVM-VFIO: add new VFIO external API hooks Eric Auger
2014-08-25 13:27 ` Eric Auger
2014-08-25 13:27 ` [RFC 8/9] KVM: KVM-VFIO: add kvm_vfio_arch_data and accessors Eric Auger
2014-08-25 13:27 ` Eric Auger
2014-08-26 19:02 ` Alex Williamson
2014-08-26 19:02 ` Alex Williamson
2014-08-27 15:22 ` Eric Auger
2014-08-27 15:22 ` Eric Auger
2014-08-27 15:37 ` Alex Williamson
2014-08-27 15:37 ` Alex Williamson
2014-08-27 15:42 ` Eric Auger
2014-08-27 15:42 ` Eric Auger
2014-08-25 13:27 ` [RFC 9/9] KVM: KVM_VFIO: ARM: implement irq forwarding control Eric Auger
2014-08-25 13:27 ` Eric Auger
2014-08-26 19:02 ` Alex Williamson [this message]
2014-08-26 19:02 ` Alex Williamson
2014-08-27 15:24 ` Eric Auger
2014-08-27 15:24 ` Eric Auger
2014-08-26 17:49 ` [RFC 0/9] KVM-VFIO IRQ forward control Alex Williamson
2014-08-26 17:49 ` Alex Williamson
2014-08-27 15:10 ` Eric Auger
2014-08-27 15:10 ` Eric Auger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1409079769.2906.131.camel@ul30vt.home \
--to=alex.williamson@redhat.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.