[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v4 20/27] ARM: vITS: handle MAPTI command
Hi Andre, On 03/04/17 21:28, Andre Przywara wrote: The MAPTI commands associates a DeviceID/EventID pair with a LPI/CPU pair and actually instantiates LPI interrupts. We connect the already allocated host LPI to this virtual LPI, so that any triggering IRQ on the host can be quickly forwarded to a guest. Beside entering the VCPU and the virtual LPI number in the respective host LPI entry, we also initialize and add the already allocated struct pending_irq to our radix tree, so that we can now easily find it by its virtual LPI number. This exports the vgic_init_pending_irq() function for that purpose. As write_itte() is now eventually used, we can now add the static tag. Signed-off-by: Andre Przywara <andre.przywara@xxxxxxx> --- xen/arch/arm/gic-v3-its.c | 70 ++++++++++++++++++++++++++++++++++++++++ xen/arch/arm/gic-v3-lpi.c | 18 +++++++++++ xen/arch/arm/vgic-v3-its.c | 36 +++++++++++++++++++-- xen/arch/arm/vgic.c | 2 +- xen/include/asm-arm/gic_v3_its.h | 6 ++++ xen/include/asm-arm/vgic.h | 1 + 6 files changed, 130 insertions(+), 3 deletions(-) diff --git a/xen/arch/arm/gic-v3-its.c b/xen/arch/arm/gic-v3-its.c index 880c7fc..3bc1e58 100644 --- a/xen/arch/arm/gic-v3-its.c +++ b/xen/arch/arm/gic-v3-its.c @@ -765,6 +765,76 @@ void gicv3_its_unmap_all_devices(struct domain *d) spin_unlock(&d->arch.vgic.its_devices_lock); } +/* Must be called with the its_device_lock held. */ This is a call for adding an ASSERT. +static struct its_devices *get_its_device(struct domain *d, paddr_t doorbell, + uint32_t devid) +{ + struct rb_node *node = d->arch.vgic.its_devices.rb_node; + struct its_devices *dev; [...] +/* + * Connects the event ID for an already assigned device to the given VCPU/vLPI + * pair. The corresponding physical LPI is already mapped on the host side + * (when assigning the physical device to the guest), so we just connect the + * target VCPU/vLPI pair to that interrupt to inject it properly if it fires. + */ +struct pending_irq *gicv3_assign_guest_event(struct domain *d, + paddr_t doorbell_address, This is the guest ITS doorbell. Right? So please prefix with v. + uint32_t vdevid, uint32_t veventid, + struct vcpu *v, uint32_t virt_lpi) +{ + struct its_devices *dev; + struct pending_irq *pirq = NULL; + uint32_t host_lpi = 0; + + spin_lock(&d->arch.vgic.its_devices_lock); + dev = get_its_device(d, doorbell_address, vdevid); + if ( dev ) + { + host_lpi = get_host_lpi(dev, veventid); + pirq = &dev->pend_irqs[veventid]; + } + spin_unlock(&d->arch.vgic.its_devices_lock); + + if ( !host_lpi || !pirq ) + return NULL; + + gicv3_lpi_update_host_entry(host_lpi, d->domain_id, + v ? v->vcpu_id : -1, virt_lpi); s/-1/INVALID_VCPU_ID/ Cheers, -- Julien Grall _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |