#
e59679d2 |
| 18-Jun-2018 |
Jean-Philippe Brucker <jean-philippe.brucker@arm.com> |
irq: add irqfd helpers
Add helpers to add and remove IRQFD routing for both irqchips and MSIs. We have to make a special case of IRQ lines on ARM where the initialisation order goes like this:
(1)
irq: add irqfd helpers
Add helpers to add and remove IRQFD routing for both irqchips and MSIs. We have to make a special case of IRQ lines on ARM where the initialisation order goes like this:
(1) Devices reserve their IRQ lines (2) VGIC is setup with VGIC_CTRL_INIT (in a late_init call) (3) MSIs are reserved lazily, when the guest needs them
Since we cannot setup IRQFD before (2), store the IRQFD routing for IRQ lines temporarily until we're ready to submit them.
Reviewed-by: Punit Agrawal <punit.agrawal@arm.com> Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
show more ...
|
#
f77d646b |
| 03-Nov-2017 |
Andre Przywara <andre.przywara@arm.com> |
irq.h: fix compilation error due to missing bool type
Commit f6108d72e977 ("Add GICv2m support") introduced a bool return type, but missed to include the respective header (this was probably part of
irq.h: fix compilation error due to missing bool type
Commit f6108d72e977 ("Add GICv2m support") introduced a bool return type, but missed to include the respective header (this was probably part of a former prerequisite series). Fix this by including the header.
Fixes: f6108d72e977cce00e7bc824acd1d73da8cc9729 ("Add GICv2m support") Signed-off-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
show more ...
|
#
f6108d72 |
| 03-Nov-2017 |
Jean-Philippe Brucker <jean-philippe.brucker@arm.com> |
Add GICv2m support
GICv2m is a small extension to the GICv2 architecture, specified in the Server Base System Architecture (SBSA). It adds a set of register to converts MSIs into SPIs, effectively e
Add GICv2m support
GICv2m is a small extension to the GICv2 architecture, specified in the Server Base System Architecture (SBSA). It adds a set of register to converts MSIs into SPIs, effectively enabling MSI support for pre-GICv3 platforms.
Implement a GICv2m emulation entirely in userspace. Add a thin translation layer in irq.c to catch the MSI->SPI routing setup of the guest, and then transform irqfd injection of MSI into the associated SPI. There shouldn't be any significant runtime overhead compared to gicv3-its.
The device can be enabled by passing "--irqchip gicv2m" to kvmtool.
Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
show more ...
|
#
f9ef46f2 |
| 25-Apr-2017 |
Andre Przywara <andre.przywara@arm.com> |
extend GSI IRQ routing to take a device ID
For ITS emulation we need the device ID along with the MSI payload and doorbell address to identify an MSI, so we need to put it in the GSI IRQ routing tab
extend GSI IRQ routing to take a device ID
For ITS emulation we need the device ID along with the MSI payload and doorbell address to identify an MSI, so we need to put it in the GSI IRQ routing table too. There is a per-VM capability by which the kernel signals the need for a device ID, so check this and put the device ID into the routing table if needed. For PCI devices we take the bus/device/function triplet and and that to the routing setup call.
Acked-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
show more ...
|
#
6518065a |
| 25-Apr-2017 |
Andre Przywara <andre.przywara@arm.com> |
MSI-X: update GSI routing after changed MSI-X configuration
When we set up GSI routing to map MSIs to KVM's GSI numbers, we write the current device's MSI setup into the kernel routing table. Howeve
MSI-X: update GSI routing after changed MSI-X configuration
When we set up GSI routing to map MSIs to KVM's GSI numbers, we write the current device's MSI setup into the kernel routing table. However the device driver in the guest can use PCI configuration space accesses to change the MSI configuration (address and/or payload data). Whenever this happens after we have setup the routing table already, we must amend the previously sent data. So when MSI-X PCI config space accesses write address or payload, find the associated GSI number and the matching routing table entry and update the kernel routing table (only if the data has changed).
This fixes vhost-net, where the queue's IRQFD was setup before the MSI vectors.
To avoid issues, we ignore writes to the PBA region. The spec says: "Software should never write, and should only read Pending Bits. If software writes to Pending Bits, the result is undefined."
Acked-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
show more ...
|
#
8ccc8549 |
| 25-Apr-2017 |
Andre Przywara <andre.przywara@arm.com> |
irq: move IRQ routing into irq.c
The current IRQ routing code in x86/irq.c is mostly implementing a generic KVM interface which other architectures may use too. Move the code to set up an MSI route
irq: move IRQ routing into irq.c
The current IRQ routing code in x86/irq.c is mostly implementing a generic KVM interface which other architectures may use too. Move the code to set up an MSI route into the generic irq.c file and guard it with the KVM_CAP_IRQ_ROUTING capability to return an error if the kernel does not support interrupt routing. This also removes the dummy implementations for all other architectures and only leaves the x86 specific code in x86/irq.c.
Acked-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Andre Przywara <andre.przywara@arm.com> Acked-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
show more ...
|
#
cb87229b |
| 03-Jul-2015 |
Marc Zyngier <marc.zyngier@arm.com> |
irq: add irq__get_nr_allocated_lines
The ARM GIC emulation needs to be told the number of interrupts it has to support. As commit 1c262fa1dc7bc ("kvm tools: irq: make irq__alloc_line generic") made
irq: add irq__get_nr_allocated_lines
The ARM GIC emulation needs to be told the number of interrupts it has to support. As commit 1c262fa1dc7bc ("kvm tools: irq: make irq__alloc_line generic") made the interrupt counter private, add a new accessor returning the number of interrupt lines we've allocated so far.
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
show more ...
|
#
1178dd4d |
| 04-Feb-2014 |
Will Deacon <will.deacon@arm.com> |
kvm tools: irq: rename irq__register_device to irq__alloc_line
Since irq__register_device no longer registers a device with anything, rename it to irq__alloc_line, which better describes what is act
kvm tools: irq: rename irq__register_device to irq__alloc_line
Since irq__register_device no longer registers a device with anything, rename it to irq__alloc_line, which better describes what is actually going on.
Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
show more ...
|
#
7f542b0f |
| 04-Feb-2014 |
Will Deacon <will.deacon@arm.com> |
kvm tools: irq: remove remaining parameters to irq__register_device
With the removal of the x86 irq rbtree, the only parameter used by irq__register_device is actually used to return the new line.
kvm tools: irq: remove remaining parameters to irq__register_device
With the removal of the x86 irq rbtree, the only parameter used by irq__register_device is actually used to return the new line.
This patch removes all of the parameters from irq__register_device and returns the allocated line directly.
Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
show more ...
|
#
f83cd161 |
| 04-Feb-2014 |
Will Deacon <will.deacon@arm.com> |
kvm tools: irq: replace the x86 irq rbtree with the PCI device tree
The x86 code keeps its own rbtree of PCI devices in order to allocate interrupts. However, this functionality can be moved into th
kvm tools: irq: replace the x86 irq rbtree with the PCI device tree
The x86 code keeps its own rbtree of PCI devices in order to allocate interrupts. However, this functionality can be moved into the generic PCI device tree and be reused by other architectures.
This patch removes the x86 tree and reworks the ACPI mptable generation to use the PCI device tree for enumerating the bus.
Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
show more ...
|
#
2d6c72df |
| 04-Feb-2014 |
Will Deacon <will.deacon@arm.com> |
kvm tools: irq: remove pin parameter from irq__register_device
In preparation for moving the irq allocation into generic code, remove the pin parameter from irq__register_device and temporarily plac
kvm tools: irq: remove pin parameter from irq__register_device
In preparation for moving the irq allocation into generic code, remove the pin parameter from irq__register_device and temporarily place the onus on the emulation driver to allocate the pin (which is always 1 and only used on PCI anyway).
Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
show more ...
|
#
21ff329d |
| 22-Nov-2012 |
Will Deacon <will.deacon@arm.com> |
kvm tools: add generic device registration mechanism
PCI devices are currently registered into the pci_devices array via the pci__register function, which can then be indexed later by architecture c
kvm tools: add generic device registration mechanism
PCI devices are currently registered into the pci_devices array via the pci__register function, which can then be indexed later by architecture code to construct device tree nodes. For MMIO devices, there is no such utility.
Rather than invent a similar mechanism for MMIO, this patch creates a global device registration mechanism, which allows the device type to be specified when registered or indexing a device. Current users of the pci registration code are migrated to the new infrastructure and virtio MMIO devices are registered at init time.
As part of the device registration, allocation of the device number is moved out of irq__register_device and performed when adding the device header to the relevant bus tree, allowing us to maintain separate device numberspaces for each bus.
Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
show more ...
|
#
f7c17d7c |
| 26-Jan-2012 |
Pekka Enberg <penberg@kernel.org> |
kvm tools: Fix <linux/msi.h> kobject build breakage
Commit b50cac5 ("PCI/sysfs: add per pci device msi[x] irq listing (v5)") added "struct kobject" dependency to <linux/msi.h> which breaks KVM tool
kvm tools: Fix <linux/msi.h> kobject build breakage
Commit b50cac5 ("PCI/sysfs: add per pci device msi[x] irq listing (v5)") added "struct kobject" dependency to <linux/msi.h> which breaks KVM tool build. As the header file is no longer about MSI hardware, make a new header file for "struct msi_ms".
Reported-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Pekka Enberg <penberg@kernel.org>
show more ...
|
#
e3c4f8aa |
| 16-Dec-2011 |
Sasha Levin <levinsasha928@gmail.com> |
kvm tools: Fixes for IRQ module
Fixes include: - Error handling - Cleanup - Standard init/uninit
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
|
#
1de74957 |
| 24-Oct-2011 |
Sasha Levin <levinsasha928@gmail.com> |
kvm tools: Simplify msi message handling
This patch simplifies passing around msi messages by using 'struct kvm_irq_routing_msi' for storing of msi messages instead of passing all msi parameters aro
kvm tools: Simplify msi message handling
This patch simplifies passing around msi messages by using 'struct kvm_irq_routing_msi' for storing of msi messages instead of passing all msi parameters around.
Signed-off-by: Sasha Levin <levinsasha928@gmail.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
show more ...
|
#
5f0a22b7 |
| 28-Jul-2011 |
Sasha Levin <levinsasha928@gmail.com> |
kvm tools: Use GSI routing
Map GSIs manually when starting the guest. This will allow us mapping new GSIs for MSIX in the future.
Signed-off-by: Sasha Levin <levinsasha928@gmail.com> Signed-off-by:
kvm tools: Use GSI routing
Map GSIs manually when starting the guest. This will allow us mapping new GSIs for MSIX in the future.
Signed-off-by: Sasha Levin <levinsasha928@gmail.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
show more ...
|
#
c383fe9c |
| 06-May-2011 |
Sasha Levin <levinsasha928@gmail.com> |
kvm tools: Introduce IRQ registry
Instead of having static definitions of devices, Use a dynamic registry of pci devices.
The structure is a rbtree which holds device types (net, blk, etc). Each de
kvm tools: Introduce IRQ registry
Instead of having static definitions of devices, Use a dynamic registry of pci devices.
The structure is a rbtree which holds device types (net, blk, etc). Each device entry holds a list of IRQ lines associated with that device (pin).
Devices dynamically register upon initialization, and receive a set of: device id, irq pin and irq line.
Signed-off-by: Sasha Levin <levinsasha928@gmail.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
show more ...
|