[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v6 24/26] kvm-irqchip: i386: add hook for add/re
From: |
Peter Xu |
Subject: |
Re: [Qemu-devel] [PATCH v6 24/26] kvm-irqchip: i386: add hook for add/remove virq |
Date: |
Tue, 10 May 2016 16:11:08 +0800 |
User-agent: |
Mutt/1.5.24 (2015-08-30) |
On Thu, May 05, 2016 at 11:25:59AM +0800, Peter Xu wrote:
> Adding two hooks to be notified when adding/removing msi routes. On x86
> platform, one list is maintained for all existing msi routes.
>
> Signed-off-by: Peter Xu <address@hidden>
> ---
> include/sysemu/kvm.h | 6 ++++++
> kvm-all.c | 2 ++
> target-arm/kvm.c | 11 +++++++++++
> target-i386/kvm.c | 38 ++++++++++++++++++++++++++++++++++++++
> target-mips/kvm.c | 11 +++++++++++
> target-ppc/kvm.c | 11 +++++++++++
> target-s390x/kvm.c | 11 +++++++++++
> trace-events | 2 ++
> 8 files changed, 92 insertions(+)
[...]
> diff --git a/target-i386/kvm.c b/target-i386/kvm.c
> index d1a4d77..f043e45 100644
> --- a/target-i386/kvm.c
> +++ b/target-i386/kvm.c
> @@ -3355,6 +3355,44 @@ int kvm_arch_fixup_msi_route(struct
> kvm_irq_routing_entry *route,
> return 0;
> }
>
> +typedef struct MSIRouteEntry MSIRouteEntry;
> +
> +struct MSIRouteEntry {
> + PCIDevice *dev; /* Device pointer */
> + int vector; /* MSI/MSIX vector index */
> + int virq; /* Virtual IRQ index */
> + QLIST_ENTRY(MSIRouteEntry) list;
> +};
> +
> +/* List of used GSI routes */
> +static QLIST_HEAD(, MSIRouteEntry) msi_route_list = \
> + QLIST_HEAD_INITIALIZER(msi_route_list);
> +
> +int kvm_arch_add_msi_route_post(struct kvm_irq_routing_entry *route,
> + int vector, PCIDevice *dev)
> +{
> + MSIRouteEntry *entry = g_new0(MSIRouteEntry, 1);
Ah... Here, I should skip all IOAPIC msi routes by checking whether
dev == NULL. We should only care about irqfd users, while IOAPIC has
its own notifier. Will fix this in next version.
-- peterx
- [Qemu-devel] [PATCH v6 20/26] intel_iommu: add SID validation for IR, (continued)
- [Qemu-devel] [PATCH v6 20/26] intel_iommu: add SID validation for IR, Peter Xu, 2016/05/04
- [Qemu-devel] [PATCH v6 21/26] x86-iommu: introduce parent class, Peter Xu, 2016/05/04
- [Qemu-devel] [PATCH v6 22/26] x86-iommu: replace existing VT-d hooks into X86 ones, Peter Xu, 2016/05/04
- [Qemu-devel] [PATCH v6 23/26] kvm-irqchip: simplify kvm_irqchip_add_msi_route, Peter Xu, 2016/05/04
- [Qemu-devel] [PATCH v6 25/26] kvm-irqchip: x86: add msi route notify fn, Peter Xu, 2016/05/04
- [Qemu-devel] [PATCH v6 26/26] kvm-irqchip: do explicit commit when update irq, Peter Xu, 2016/05/04
- [Qemu-devel] [PATCH v6 24/26] kvm-irqchip: i386: add hook for add/remove virq, Peter Xu, 2016/05/04
- Re: [Qemu-devel] [PATCH v6 00/26] IOMMU: Enable interrupt remapping for Intel IOMMU, Peter Xu, 2016/05/05
- Re: [Qemu-devel] [PATCH v6 00/26] IOMMU: Enable interrupt remapping for Intel IOMMU, Radim Krčmář, 2016/05/09