xemu/include
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
..
block aio / timers: convert block_job_sleep_ns and co_sleep_ns to new API 2013-08-22 19:14:24 +02:00
disas Add moxie disassembler 2013-03-23 14:25:41 +00:00
exec tcg-i386: Remove abort from GETPC_LDST 2013-08-29 20:20:39 +02:00
fpu softfloat: Implement uint64_to_float128 2013-01-05 10:12:50 +00:00
hw spapr-pci: rework MSI/MSIX 2013-09-02 10:06:42 +02:00
migration migration: fix spice migration 2013-07-29 17:19:02 +02:00
monitor monitor: avoid use of global *cur_mon in monitor_find_completion() 2013-08-30 07:41:14 -04:00
net net: add support of mac-programming over macvtap in QEMU side 2013-07-15 21:23:08 +03:00
qapi OptsVisitor: don't try to flatten overlong integer ranges 2013-08-20 11:52:00 -04:00
qemu aio / timers: Remove legacy interface 2013-08-22 19:14:24 +02:00
qom qom: Introduce instance_post_init hook 2013-08-16 18:44:33 +02:00
sysemu Merge remote-tracking branch 'qemu-kvm/uq/master' into stable-1.5 2013-08-29 17:21:51 -05:00
ui spice: fix display initialization 2013-07-30 10:25:47 +02:00
config.h janitor: move remaining public headers to include/ 2012-12-19 08:32:46 +01:00
elf.h s390: Implement dump-guest-memory support for target s390x 2013-07-30 16:12:25 +02:00
glib-compat.h glib: add a compatibility interface for g_timeout_add_seconds 2013-03-25 13:10:40 -05:00
qemu-common.h Introduce async_run_on_cpu() 2013-07-12 19:36:01 +02:00
qemu-io.h qemu-io: Interface cleanup 2013-06-06 11:27:05 +02:00
trace.h build: some simplifications for "trace/Makefile.objs" 2013-01-12 18:42:51 +01:00