[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH 16/16] pseries: Generate unique LIOBNs for PCI host br
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PATCH 16/16] pseries: Generate unique LIOBNs for PCI host bridges |
Date: |
Tue, 30 Oct 2012 14:25:12 +1100 |
From: Alexey Kardashevskiy <address@hidden>
In future (with VFIO) we will have multiple PCI host bridges on
pseries. Each one needs a unique LIOBN (IOMMU id). At the moment we
derive these from the pci domain number, but the whole notion of
domain numbers on the qemu side is bogus and in any case they're not
actually uniquely allocated at this point.
This patch, therefore uses a simple sequence counter to generate
unique LIOBNs for PCI host bridges.
Signed-off-by: Alexey Kardashevskiy <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/spapr_pci.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/spapr_pci.c b/hw/spapr_pci.c
index 3c5b855..f6544d7 100644
--- a/hw/spapr_pci.c
+++ b/hw/spapr_pci.c
@@ -521,6 +521,7 @@ static int spapr_phb_init(SysBusDevice *s)
char *namebuf;
int i;
PCIBus *bus;
+ static int phbnum;
sphb->dtbusname = g_strdup_printf("address@hidden" PRIx64, sphb->buid);
namebuf = alloca(strlen(sphb->dtbusname) + 32);
@@ -572,7 +573,7 @@ static int spapr_phb_init(SysBusDevice *s)
PCI_DEVFN(0, 0), PCI_NUM_PINS);
phb->bus = bus;
- sphb->dma_liobn = SPAPR_PCI_BASE_LIOBN | (pci_find_domain(bus) << 16);
+ sphb->dma_liobn = SPAPR_PCI_BASE_LIOBN | (++phbnum << 16);
sphb->dma_window_start = 0;
sphb->dma_window_size = 0x40000000;
sphb->dma = spapr_tce_new_dma_context(sphb->dma_liobn,
sphb->dma_window_size);
--
1.7.10.4
- [Qemu-ppc] [0/16] pseries and PPC pending patches, David Gibson, 2012/10/29
- [Qemu-ppc] [PATCH 01/16] Revert "PPC: pseries: Remove hack for PIO window", David Gibson, 2012/10/29
- [Qemu-ppc] [PATCH 09/16] pseries: Allow RTAS tokens without a qemu handler, David Gibson, 2012/10/29
- [Qemu-ppc] [PATCH 04/16] pseries: Clean up inconsistent variable name in xics.c, David Gibson, 2012/10/29
- [Qemu-ppc] [PATCH 06/16] pseries: Cleanup duplications of ics_valid_irq() code, David Gibson, 2012/10/29
- [Qemu-ppc] [PATCH 12/16] target-pcc: Convert ppcemb_tlb_t to use fixed 64-bit RPN, David Gibson, 2012/10/29
- [Qemu-ppc] [PATCH 16/16] pseries: Generate unique LIOBNs for PCI host bridges,
David Gibson <=
- [Qemu-ppc] [PATCH 10/16] pseries: Add tracepoints to the XICS interrupt controller, David Gibson, 2012/10/29
- [Qemu-ppc] [PATCH 07/16] pseries: Move XICS initialization before cpu initialization, David Gibson, 2012/10/29
- [Qemu-ppc] [PATCH 15/16] pseries: Fix bug in PCI MSI allocation, David Gibson, 2012/10/29
- [Qemu-ppc] [PATCH 05/16] pseries: Use #define for XICS base irq number, David Gibson, 2012/10/29
- [Qemu-ppc] [PATCH 03/16] target-ppc: Extend FPU state for newer POWER CPUs, David Gibson, 2012/10/29
- [Qemu-ppc] [PATCH 11/16] pseries: Split xics irq configuration from state information, David Gibson, 2012/10/29
- [Qemu-ppc] [PATCH 02/16] target-ppc: Rework storage of VPA registration state, David Gibson, 2012/10/29
- [Qemu-ppc] [PATCH 13/16] pseries: Implement PAPR NVRAM, David Gibson, 2012/10/29
- [Qemu-ppc] [PATCH 08/16] pseries: Return the token when we register an RTAS call, David Gibson, 2012/10/29
- [Qemu-ppc] [PATCH 14/16] pseries: Update SLOF for NVRAM support, David Gibson, 2012/10/29