* [Qemu-devel] Questions regarding ITS implementation
@ 2015-05-27 7:24 Pavel Fedin
0 siblings, 0 replies; only message in thread
From: Pavel Fedin @ 2015-05-27 7:24 UTC (permalink / raw)
To: 'QEMU Developers'
Hello! I am working on GICv3 ITS implementation for qemu and i ran into a (big) problem.
I need some advice.
As far as i can understand from the documentation i have and Linux source code, ITS uses
per-device logical IDs as MSI data. These IDs are not global, they are actually a relative
IRQ number in IRQ space allocated for the device:
--- cut ---
static inline u32 its_get_event_id(struct irq_data *d)
{
struct its_device *its_dev = irq_data_get_irq_chip_data(d);
return d->hwirq - its_dev->lpi_base;
}
--- cut ---
Here d->hwirq is a raw GIC LPI number (they start from 8192) and its_dev->lpi_base is a
base LPI number for this device. So, for example, if we have two devices, and one of them
uses 4 IRQs and another uses 3 IRQs, we'll have:
For first device: hwirq = 8192, lpi_base = 8192 (INT IDs 0 - 3)
For second device: hwirq = 8196, lpi_base = 8196. (INT IDs 0 - 2)
So for every device IDs restart from 0, and appear to be duplicated between devices. In
order to distinguish between them ITS gets also a thing called device ID, which is somehow
hardwired from the PCI bus. Device ID is basically PCI_ID(bus, devfn).
The first question is: how do i get device ID in qemu ? MSI-X sending function in qemu
does only a generic memory write:
--- cut ---
/* Send an MSI-X message */
void msix_notify(PCIDevice *dev, unsigned vector)
{
MSIMessage msg;
if (vector >= dev->msix_entries_nr || !dev->msix_entry_used[vector])
return;
if (msix_is_masked(dev, vector)) {
msix_set_pending(dev, vector);
return;
}
msg = msix_get_message(dev, vector);
address_space_stl_le(&dev->bus_master_as, msg.address, msg.data,
MEMTXATTRS_UNSPECIFIED, NULL);
}
--- cut ---
I do not see anything extra from PCIDevice * going through. I studied APIC code, looks
like they encode all the stuff into MSI data.
Does this mean that qemu currently lacks support for device identifiers in MSI ?
Kind regards,
Pavel Fedin
Expert Engineer
Samsung Electronics Research center Russia
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-05-27 7:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-27 7:24 [Qemu-devel] Questions regarding ITS implementation Pavel Fedin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).