qemu/hw
Alexey Kardashevskiy f1c2dc7c86 spapr-pci: rework MSI/MSIX
On the sPAPR platform a guest allocates MSI/MSIX vectors via RTAS
hypercalls which return global IRQ numbers to a guest so it only
operates with those and never touches MSIMessage.

Therefore MSIMessage handling is completely hidden in QEMU.

Previously every sPAPR PCI host bridge implemented its own MSI window
to catch msi_notify()/msix_notify() calls from QEMU devices (virtio-pci
or vfio) and route them to the guest via qemu_pulse_irq().
MSIMessage used to be encoded as:
	.addr - address within the PHB MSI window;
	.data - the device index on PHB plus vector number.
The MSI MR write function translated this MSIMessage to a global IRQ
number and called qemu_pulse_irq().

However the total number of IRQs is not really big (at the moment it is
1024 IRQs starting from 4096) and even 16bit data field of MSIMessage
seems to be enough to store an IRQ number there.

This simplifies MSI handling in sPAPR PHB. Specifically, this does:
1. remove a MSI window from a PHB;
2. add a single memory region for all MSIs to sPAPREnvironment
and spapr_pci_msi_init() to initialize it;
3. encode MSIMessage as:
    * .addr - a fixed address of SPAPR_PCI_MSI_WINDOW==0x40000000000ULL;
    * .data as an IRQ number.
4. change IRQ allocator to align first IRQ number in a block for MSI.
MSI uses lower bits to specify the vector number so the first IRQ has to
be aligned. MSIX does not need any special allocator though.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
2013-09-02 10:06:42 +02:00
..
9pfs virtio-9p-device: Avoid freeing uninitialized memory 2013-08-01 11:18:24 -05:00
acpi aio / timers: Switch entire codebase to the new timer API 2013-08-22 19:14:24 +02:00
alpha aio / timers: Switch entire codebase to the new timer API 2013-08-22 19:14:24 +02:00
arm aio / timers: Switch entire codebase to the new timer API 2013-08-22 19:14:24 +02:00
audio aio / timers: Switch entire codebase to the new timer API 2013-08-22 19:14:24 +02:00
block aio / timers: Switch entire codebase to the new timer API 2013-08-22 19:14:24 +02:00
bt aio / timers: Switch entire codebase to the new timer API 2013-08-22 19:14:24 +02:00
char pseries: Fix stalls on hypervisor virtual console 2013-09-02 10:06:41 +02:00
core pc,pci,virtio fixes and cleanups 2013-08-29 17:19:19 -05:00
cpu default-configs: Fix A9MP and A15MP config names 2013-08-20 14:54:32 +01:00
cris memory: add owner argument to initialization functions 2013-07-04 17:42:44 +02:00
display aio / timers: Switch entire codebase to the new timer API 2013-08-22 19:14:24 +02:00
dma aio / timers: Switch entire codebase to the new timer API 2013-08-22 19:14:24 +02:00
gpio gpio/zaurus: QOM cast cleanup 2013-07-29 21:06:57 +02:00
i2c exynos4210_i2c: QOM cast cleanup 2013-07-29 21:07:02 +02:00
i386 Merge remote-tracking branch 'qemu-kvm/uq/master' into stable-1.5 2013-08-29 17:21:51 -05:00
ide aio / timers: Switch entire codebase to the new timer API 2013-08-22 19:14:24 +02:00
input aio / timers: Switch entire codebase to the new timer API 2013-08-22 19:14:24 +02:00
intc aio / timers: Switch entire codebase to the new timer API 2013-08-22 19:14:24 +02:00
isa i82378: Cleanup implementation 2013-07-31 23:25:41 +02:00
lm32 lm32_juart: QOM cast cleanup 2013-07-29 21:06:28 +02:00
m68k memory: add owner argument to initialization functions 2013-07-04 17:42:44 +02:00
microblaze microblaze: Fix latent bug with default DTB lookup 2013-07-09 13:38:58 -05:00
mips aio / timers: Switch entire codebase to the new timer API 2013-08-22 19:14:24 +02:00
misc Merge remote-tracking branch 'qemu-kvm/uq/master' into stable-1.5 2013-08-29 17:21:51 -05:00
moxie memory: add owner argument to initialization functions 2013-07-04 17:42:44 +02:00
net aio / timers: Switch entire codebase to the new timer API 2013-08-22 19:14:24 +02:00
nvram fw_cfg: the I/O port variant expects little-endian 2013-08-07 12:48:15 -05:00
openrisc Merge remote-tracking branch 'stefanha/block' into staging 2013-08-26 09:19:50 -05:00
pci pcie_port: Turn PCIEPort and PCIESlot into abstract QOM types 2013-07-29 20:45:24 +02:00
pci-bridge i82801b11: Fix i82801b11 PCI host bridge config space 2013-08-12 12:07:12 +03:00
pci-host pci-host/prep: Set isa_mem_base in the PCI host bridge 2013-07-31 23:25:27 +02:00
ppc spapr-pci: rework MSI/MSIX 2013-09-02 10:06:42 +02:00
s390x s390: provide I/O subsystem reset 2013-08-30 12:49:30 +02:00
scsi spapr: Rename 'dprintf' to 'DPRINTF' 2013-07-29 19:56:46 -05:00
sd aio / timers: Switch entire codebase to the new timer API 2013-08-22 19:14:24 +02:00
sh4 sh4: unbreak r2d 2013-07-25 08:12:27 -05:00
sparc sun4: Don't prematurely explode QEMUMachineInitArgs 2013-08-21 23:19:27 +03:00
sparc64 pc,pci,virtio fixes and cleanups 2013-08-29 17:19:19 -05:00
ssi xilinx_spi: QOM cast cleanup 2013-07-29 21:07:01 +02:00
timer aio / timers: Switch entire codebase to the new timer API 2013-08-22 19:14:24 +02:00
tpm aio / timers: Untangle include files 2013-08-22 19:10:27 +02:00
unicore32 memory: add owner argument to initialization functions 2013-07-04 17:42:44 +02:00
usb aio / timers: Switch entire codebase to the new timer API 2013-08-22 19:14:24 +02:00
virtio Merge remote-tracking branch 'qemu-kvm/uq/master' into stable-1.5 2013-08-29 17:21:51 -05:00
watchdog aio / timers: Switch entire codebase to the new timer API 2013-08-22 19:14:24 +02:00
xen devices: Associate devices to their logical category 2013-07-29 10:37:09 -05:00
xtensa aio / timers: Switch entire codebase to the new timer API 2013-08-22 19:14:24 +02:00
Makefile.objs virtio: simplify Makefile conditionals 2013-04-19 16:18:11 +02:00