#
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 ...
|
#
9dc5430c |
| 04-Feb-2014 |
Will Deacon <will.deacon@arm.com> |
kvm tools: irq: make irq__alloc_line generic
All architectures are now doing the same thing for irq__alloc_line:
1. Initialise a global counter to some fixed offset 2. Return the current value
kvm tools: irq: make irq__alloc_line generic
All architectures are now doing the same thing for irq__alloc_line:
1. Initialise a global counter to some fixed offset 2. Return the current value of the counter and increment it
This is better off in core code, with each architecture specifying the initial offset, which is specific to the interrupt controller being used by the guest.
Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
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 ...
|
#
49a8afd1 |
| 17-Sep-2012 |
Sasha Levin <levinsasha928@gmail.com> |
kvm tools: use init/exit where possible
Switch to using init/exit calls instead of the repeating call blocks in builtin-run.
Signed-off-by: Sasha Levin <levinsasha928@gmail.com> Signed-off-by: Pekk
kvm tools: use init/exit where possible
Switch to using init/exit calls instead of the repeating call blocks in builtin-run.
Signed-off-by: Sasha Levin <levinsasha928@gmail.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
show more ...
|
#
7f37fa7e |
| 09-May-2012 |
Sasha Levin <levinsasha928@gmail.com> |
kvm tools: fix sigsegv in irq__exit
We free the structure, but never remove them from the tree or list, then we freed them the next time we ran through that structure.
This patch also simplifies ir
kvm tools: fix sigsegv in irq__exit
We free the structure, but never remove them from the tree or list, then we freed them the next time we ran through that structure.
This patch also simplifies irq__exit a bit.
Signed-off-by: Sasha Levin <levinsasha928@gmail.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
show more ...
|
#
f740cfb8 |
| 04-Feb-2012 |
Pekka Enberg <penberg@kernel.org> |
kvm tools, x86: Fix use after free in irq__exit()
Valgrind spotted this issue with KVM tool shutdown:
==1823== Invalid read of size 8 ==1823== at 0x410DD0: rb_next (rbtree.c:390) ==1823==
kvm tools, x86: Fix use after free in irq__exit()
Valgrind spotted this issue with KVM tool shutdown:
==1823== Invalid read of size 8 ==1823== at 0x410DD0: rb_next (rbtree.c:390) ==1823== by 0x417376: irq__exit (irq.c:182) ==1823== by 0x406230: kvm_cmd_run (builtin-run.c:1275) ==1823== by 0x410670: handle_command (kvm-cmd.c:84) ==1823== by 0x3DE682139C: (below main) (in /lib64/libc-2.14.so) ==1823== Address 0x4f7cca0 is 0 bytes inside a block of size 48 free'd ==1823== at 0x4A055FE: free (vg_replace_malloc.c:366) ==1823== by 0x41736E: irq__exit (irq.c:192) ==1823== by 0x406230: kvm_cmd_run (builtin-run.c:1275) ==1823== by 0x410670: handle_command (kvm-cmd.c:84) ==1823== by 0x3DE682139C: (below main) (in /lib64/libc-2.14.so)
Fix it up.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
show more ...
|
#
495fbd4e |
| 19-Dec-2011 |
Sasha Levin <levinsasha928@gmail.com> |
kvm tools: Fixes for virtio module
Fixes include: - Error handling - Cleanup - Standard init/uninit
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
|
#
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>
|
#
beb8f24b |
| 06-Dec-2011 |
Sasha Levin <levinsasha928@gmail.com> |
kvm tools: Initialize irq_routing before using it
Initialize irq_routing, and specifically irq_routing->nr before using it.
Signed-off-by: Sasha Levin <levinsasha928@gmail.com> Signed-off-by: Pekka
kvm tools: Initialize irq_routing before using it
Initialize irq_routing, and specifically irq_routing->nr before using it.
Signed-off-by: Sasha Levin <levinsasha928@gmail.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
show more ...
|
#
af7b0868 |
| 06-Dec-2011 |
Matt Evans <matt@ozlabs.org> |
kvm tools: Split x86 arch-specific bits into x86/
Create a new arch-specific subdirectory to contain architecture-specific code and includes.
The Makefile now adds various arch-specific objects bas
kvm tools: Split x86 arch-specific bits into x86/
Create a new arch-specific subdirectory to contain architecture-specific code and includes.
The Makefile now adds various arch-specific objects based on detected architecture. That aside, this patch should only contain code moves. These include:
- x86-specific kvm_cpu setup, kernel loading, memory setup etc. now in x86/kvm{-cpu}.c - BIOS now lives in x86/bios/ - ioport setup - KVM extensions are asserted in arch-specific kvm.c now, so each architecture can manage its own dependencies. - Various architecture-specific #defines are moved into $(ARCH)/include/kvm{-cpu}.h such as struct kvm_cpu, KVM_NR_CPUS, KVM_32BIT_GAP_SIZE.
Signed-off-by: Matt Evans <matt@ozlabs.org> Signed-off-by: Pekka Enberg <penberg@kernel.org>
show more ...
|
#
99de8863 |
| 15-Nov-2011 |
Sasha Levin <levinsasha928@gmail.com> |
kvm tools: Use IRQ line 5+ for devices
IRQ lines 3 and 4 are used by the serial device, assigning them to other devices as well hurts performance. We should avoid shared IRQs if possible.
Signed-of
kvm tools: Use IRQ line 5+ for devices
IRQ lines 3 and 4 are used by the serial device, assigning them to other devices as well hurts performance. We should avoid shared IRQs if possible.
Signed-off-by: Sasha Levin <levinsasha928@gmail.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
show more ...
|
#
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 ...
|
#
2eb7ffa0 |
| 11-Aug-2011 |
Sasha Levin <levinsasha928@gmail.com> |
kvm tools: Fix IRQ mapping
This thread fixes two issues: - Slave IRQCHIP was mapped wrong, this caused all IRQs which belong to it to be ignored (breaking such things as the mouse). - Line 2 was b
kvm tools: Fix IRQ mapping
This thread fixes two issues: - Slave IRQCHIP was mapped wrong, this caused all IRQs which belong to it to be ignored (breaking such things as the mouse). - Line 2 was being mapped, since it's the link between slave and master IRQCHIPs it shouldn't be.
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 ...
|
#
33348d03 |
| 07-May-2011 |
Cyrill Gorcunov <gorcunov@gmail.com> |
kvm tools: Fix up PCI pin assignment to conform specification
Only 4 pins are allowed for every PCI compilant device as per PCI 2.2 spec Section 2.2.6 ("Interrupt Pins"). Multifunctional devices can
kvm tools: Fix up PCI pin assignment to conform specification
Only 4 pins are allowed for every PCI compilant device as per PCI 2.2 spec Section 2.2.6 ("Interrupt Pins"). Multifunctional devices can use up to all INTA#,B#,C#,D# pins, for our single function devices pin INTA# is enough.
Signed-off-by: Cyrill Gorcunov <gorcunov@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 ...
|