[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 12/12] pseries: Generate unique LIOBNs for PCI h
From: |
Alexander Graf |
Subject: |
Re: [Qemu-devel] [PATCH 12/12] pseries: Generate unique LIOBNs for PCI host bridges |
Date: |
Mon, 19 Nov 2012 17:34:12 +0100 |
On 13.11.2012, at 03:47, David Gibson wrote:
> 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>
I don't really like the idea of having a global variable just because our
domain ID generation seems to not work as expected. Michael, any comments here?
Alex
> ---
> 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
>
- Re: [Qemu-devel] [Qemu-ppc] [PATCH 08/12] target-ppc: Convert ppcemb_tlb_t to use fixed 64-bit RPN, (continued)
- Re: [Qemu-devel] [Qemu-ppc] [PATCH 08/12] target-ppc: Convert ppcemb_tlb_t to use fixed 64-bit RPN, Peter Maydell, 2012/11/20
- Re: [Qemu-devel] [Qemu-ppc] [PATCH 08/12] target-ppc: Convert ppcemb_tlb_t to use fixed 64-bit RPN, Alexander Graf, 2012/11/20
- Re: [Qemu-devel] [Qemu-ppc] [PATCH 08/12] target-ppc: Convert ppcemb_tlb_t to use fixed 64-bit RPN, David Gibson, 2012/11/20
- Re: [Qemu-devel] [Qemu-ppc] [PATCH 08/12] target-ppc: Convert ppcemb_tlb_t to use fixed 64-bit RPN, Alexander Graf, 2012/11/20
- Re: [Qemu-devel] [Qemu-ppc] [PATCH 08/12] target-ppc: Convert ppcemb_tlb_t to use fixed 64-bit RPN, David Gibson, 2012/11/20
- Re: [Qemu-devel] [Qemu-ppc] [PATCH 08/12] target-ppc: Convert ppcemb_tlb_t to use fixed 64-bit RPN, Alexander Graf, 2012/11/21
[Qemu-devel] [PATCH 06/12] pseries: Add tracepoints to the XICS interrupt controller, David Gibson, 2012/11/12
[Qemu-devel] [PATCH 07/12] pseries: Split xics irq configuration from state information, David Gibson, 2012/11/12
[Qemu-devel] [PATCH 11/12] pseries: Fix bug in PCI MSI allocation, David Gibson, 2012/11/12
[Qemu-devel] [PATCH 12/12] pseries: Generate unique LIOBNs for PCI host bridges, David Gibson, 2012/11/12
- Re: [Qemu-devel] [PATCH 12/12] pseries: Generate unique LIOBNs for PCI host bridges,
Alexander Graf <=
- Re: [Qemu-devel] [Qemu-ppc] [PATCH 12/12] pseries: Generate unique LIOBNs for PCI host bridges, David Gibson, 2012/11/19
- Re: [Qemu-devel] [Qemu-ppc] [PATCH 12/12] pseries: Generate unique LIOBNs for PCI host bridges, Alexander Graf, 2012/11/20
- Re: [Qemu-devel] [Qemu-ppc] [PATCH 12/12] pseries: Generate unique LIOBNs for PCI host bridges, Michael S. Tsirkin, 2012/11/20
- Re: [Qemu-devel] [Qemu-ppc] [PATCH 12/12] pseries: Generate unique LIOBNs for PCI host bridges, David Gibson, 2012/11/20
- Re: [Qemu-devel] [Qemu-ppc] [PATCH 12/12] pseries: Generate unique LIOBNs for PCI host bridges, Michael S. Tsirkin, 2012/11/21
- Re: [Qemu-devel] [Qemu-ppc] [PATCH 12/12] pseries: Generate unique LIOBNs for PCI host bridges, David Gibson, 2012/11/21
- Re: [Qemu-devel] [Qemu-ppc] [PATCH 12/12] pseries: Generate unique LIOBNs for PCI host bridges, Michael S. Tsirkin, 2012/11/21
- Re: [Qemu-devel] [Qemu-ppc] [PATCH 12/12] pseries: Generate unique LIOBNs for PCI host bridges, David Gibson, 2012/11/21
- Re: [Qemu-devel] [Qemu-ppc] [PATCH 12/12] pseries: Generate unique LIOBNs for PCI host bridges, Alexander Graf, 2012/11/21
- Re: [Qemu-devel] [Qemu-ppc] [PATCH 12/12] pseries: Generate unique LIOBNs for PCI host bridges, Michael S. Tsirkin, 2012/11/21