summaryrefslogtreecommitdiffstats
path: root/hw/spapr_pci.h
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2012-04-25 17:55:42 +0000
committerAlexander Graf <agraf@suse.de>2012-05-01 21:47:00 +0200
commit7fb0bd3473dfb2bb1768072ebbfa5771e8c8af4a (patch)
tree6e6c8ed3865a0208b3abb277b610ed4d101f41d2 /hw/spapr_pci.h
parentd601fac478eee7391f3e7005a9321fbf38d74809 (diff)
downloadhqemu-7fb0bd3473dfb2bb1768072ebbfa5771e8c8af4a.zip
hqemu-7fb0bd3473dfb2bb1768072ebbfa5771e8c8af4a.tar.gz
pseries: Use the same interrupt swizzling for host bridges as p2p bridges
Currently the pseries PCI code uses a somewhat strange scheme of PCI irq allocation - one per slot up to a maximum that's greater than the usual 4. This scheme more or less worked, because we were able to tell the guest the irq mapping in the device tree, however it's a bit odd and may break assumptions in the future. Worse, the array used to construct the dev tree interrupt map was mis-sized, we got away with it only because it happened that our SPAPR_PCI_NUM_LSI value was greater than 7. This patch changes the pseries PCI code to use the same interrupt swizzling scheme as is standardized for PCI to PCI bridges. This makes for better consistency, deals better with any devices which use multiple interrupt pins and will make life easier in the future when we add passthrough of what may be either a host bridge or a PCI to PCI bridge. This won't break existing guests, because they don't assume a particular mapping scheme for host bridges, but just follow what we tell them in the device tree (also updated to match, of course). This patch also fixes the allocation of the irq map. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'hw/spapr_pci.h')
-rw-r--r--hw/spapr_pci.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/hw/spapr_pci.h b/hw/spapr_pci.h
index 039f85b..f54c2e8 100644
--- a/hw/spapr_pci.h
+++ b/hw/spapr_pci.h
@@ -23,11 +23,10 @@
#if !defined(__HW_SPAPR_PCI_H__)
#define __HW_SPAPR_PCI_H__
+#include "hw/pci.h"
#include "hw/pci_host.h"
#include "hw/xics.h"
-#define SPAPR_PCI_NUM_LSI 16
-
typedef struct sPAPRPHBState {
SysBusDevice busdev;
PCIHostState host_state;
@@ -43,7 +42,7 @@ typedef struct sPAPRPHBState {
struct {
uint32_t dt_irq;
qemu_irq qirq;
- } lsi_table[SPAPR_PCI_NUM_LSI];
+ } lsi_table[PCI_NUM_PINS];
QLIST_ENTRY(sPAPRPHBState) list;
} sPAPRPHBState;
OpenPOWER on IntegriCloud