Statistics
| Branch: | Revision:

root / hw / spapr_pci.c @ a1bc20df

History | View | Annotate | Download (24.8 kB)

# Date Author Comment
a8170e5e 10/23/2012 04:58 pm Avi Kivity

Rename target_phys_addr_t to hwaddr

target_phys_addr_t is unwieldly, violates the C standard (_t suffixes are
reserved) and its purpose doesn't match the name (most target_phys_addr_t
addresses are not target specific). Replace it with a finger-friendly,...

ff9d2afa 10/04/2012 04:54 pm David Gibson

pseries: Remove XICS irq type enum type

Currently the XICS interrupt controller emulation uses a custom enum to
specify whether a given interrupt is level-sensitive or message-triggered.
This enum makes life awkward for saving the state, and isn't particularly...

eddeed26 10/04/2012 04:54 pm David Gibson

pseries: Reset emulated PCI TCE tables on system reset

The emulated PCI host bridge on the pseries machine incorporates an IOMMU
(PAPR TCE table). Currently the mappings in this IOMMU are not cleared
when we reset the system. This patch fixes this bug. To do this it adds...

8c9f64df 08/22/2012 06:47 pm Andreas Färber

spapr_pci: QOM'ify sPAPR PCI host bridge

Introduce type constant. Introduce cast macro to drop bogus busdev field
that would've broken SYS_BUS_DEVICE(). Avoid accessing parent fields
directly.

Free the identifier phb as acronym for PCI_HOST_BRIDGE.

Updated against conflicting merge from branch 'agraf/ppc-for-upstream'...

8558d942 08/22/2012 06:47 pm Andreas Färber

pci: Derive PCI host bridges from TYPE_PCI_HOST_BRIDGE

Use PCIHostState and PCI_HOST_BRIDGE() where appropriate.

Signed-off-by: Andreas Färber <>
Signed-off-by: Anthony Liguori <>

4240abff 08/22/2012 06:47 pm Andreas Färber

pci: Make host bridge TypeInfos const

During the QOM migration they were amended with further info but this is
no longer the case. All static TypeInfos can be const these days.

Signed-off-by: Andreas Färber <>
Acked-by: Michael S. Tsirkin <>...

a307d594 08/15/2012 08:43 pm Alexey Kardashevskiy

pseries: Rework irq assignment to avoid carrying qemu_irqs around

Currently, the interfaces in the pseries machine code for assignment
and setup of interrupts pass around qemu_irq objects. That was done
in an attempt not to be too closely linked to the specific XICS...

fa28f71b 08/15/2012 08:43 pm Alexey Kardashevskiy

pseries: Separate PCI RTAS setup from common from emulation specific PCI setup

Currently the RTAS functions for handling PCI are registered from the
class init code for the PCI host bridge. That sort of makes sense
now, but will break in the future when vfio gives us multiple types of...

9894c5d4 08/15/2012 08:43 pm Alexey Kardashevskiy

pseries: Export find_phb() utility function for PCI code

The pseries PCI code makes use of an internal find_dev() function which
locates a PCIDevice * given a (platform specific) bus ID and device
address. Internally this needs to first locate the host bridge on which...

a2950fb6 08/15/2012 08:43 pm Alexey Kardashevskiy

pseries: Add trace event for PCI irqs

This adds a trace event in the pseries PCI specific set_irq() function to
assist in debugging.

Signed-off-by: Alexey Kardashevskiy <>
Signed-off-by: David Gibson <>
[agraf: add trace.h include]...

0ee2c058 08/15/2012 08:43 pm Alexey Kardashevskiy

pseries: Add PCI MSI/MSI-X support

This patch implements MSI and MSI-X support for the pseries PCI host
bridge. To do this it adds:

  • A "config_space_address to msi_table" map, since the MSI RTAS calls
    take a PCI config space address as an identifier....
5c4cbcf2 08/15/2012 08:43 pm Alexey Kardashevskiy

pseries dma: DMA window params added to PHB and DT population changed

Previously the only PCI bus supported was the emulated PCI bus with
fixed DMA window with start at 0 and size 1GB. As we are going to support
PCI pass through which DMA window properties are set by the host...

231903bf 08/15/2012 08:43 pm Alexey Kardashevskiy

pseries pci: removed redundant busdev

The PCIHostState struct already contains SysBusDevice so
the one in sPAPRPHBState has to go.

Signed-off-by: Alexey Kardashevskiy <>
Signed-off-by: Alexander Graf <>

e0fdbd7c 08/15/2012 08:43 pm Alexey Kardashevskiy

pseries pci: spapr_populate_pci_devices renamed to spapr_populate_pci_dt

spapr_populate_pci_devices() populates the device tree only with bus
properties and has nothing to do with the devices on it as PCI BAR
allocation is done by the system firmware (SLOF)....

c4889f54 07/21/2012 12:54 pm Alexey Kardashevskiy

powerpc pci: fixed packing of ranges[]

By default mingw-gcc is trying to pack structures the way to
preserve binary compatibility with MS Visual C what leads to
incorrect and unexpected padding in the PCI bus ranges property of
the sPAPR PHB.

The patch replaces attribute((packed)) with more strict QEMU_PACKED...

edded454 06/28/2012 12:33 am David Gibson

pseries: Implement IOMMU and DMA for PAPR PCI devices

Currently the pseries machine emulation does not support DMA for emulated
PCI devices, because the PAPR spec always requires a (guest visible,
paravirtualized) IOMMU which was not implemented. Now that we have...

0866aca1 06/18/2012 04:14 pm Anthony Liguori

qbus: Make child devices links

Make qbus children show up as link<> properties. There is no stable
addressing for qbus children so we use an unstable naming convention.

This is okay in QOM though because the composition name is expected to
be what's stable....

7fb0bd34 05/01/2012 10:47 pm David Gibson

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...

92615a5a 04/15/2012 09:02 pm David Gibson

pseries: Fix RTAS based config access

On the pseries platform, access to PCI config space is via RTAS calls(
which go to the hypervisor) rather than MMIO. This means we don't use
the same code path as nearly everyone else which goes through pci_host.c
and we're missing some of the parameter checking along the way....

d07fee7e 03/15/2012 02:12 pm David Gibson

pseries: Add support for level interrupts to XICS

The pseries "xics" interrupt controller, like most interrupt
controllers can support both message (i.e. edge sensitive) interrupts
and level sensitive interrupts, but it needs to know which are which.

When I implemented the xics emulation for qemu, the only devices we...

298a9710 03/15/2012 02:12 pm David Gibson

pseries: Configure PCI bridge using properties

Currently, the function spapr_create_phb() uses its parameters to
initialize the correct memory windows for the new PCI Host Bridge
(PHB). This is not the way things are supposed to be done with qdevs,
and means you can't create extra PHBs easily using -device....

323abebf 03/15/2012 02:12 pm David Gibson

pseries: Remove unused constant from PCI code

The 'bars' constant array was used in experimental device allocation code
which is no longer necessary now that we always run the SLOF firmware.
This patch removes the now redundant variable.

Signed-off-by: Alexey Kardashevskiy <>...

76ab9583 03/15/2012 02:12 pm Alexey Kardashevskiy

pseries: Remove PCI device from PCI host bridge code

The sPAPR PCI code defines a PCI device "spapr-pci-host-bridge-pci" which
is never used. This came over from the earlier bridge driver we used as
a template. Some other bridges appear on their own PCI bus as a device,...

a348f108 03/11/2012 01:40 pm Stefan Weil

Add missing const attributes for MemoryRegionOps

Most MemoryRegionOps already had the const attribute.
This patch adds it to the remaining ones.

Signed-off-by: Stefan Weil <>
Signed-off-by: Blue Swirl <>

83f7d43a 02/15/2012 05:39 pm Andreas Färber

qom: Unify type registration

Replace device_init() with generalized type_init().

While at it, unify naming convention: type_init([$prefix_]register_types)
Also, type_init() is a function, so add preceding blank line where
necessary and don't put a semicolon after the closing brace....

39bffca2 02/03/2012 06:41 pm Anthony Liguori

qdev: register all types natively through QEMU Object Model

This was done in a mostly automated fashion. I did it in three steps and then
rebased it into a single step which avoids repeatedly touching every file in
the tree.

The first step was a sed-based addition of the parent type to the subclass...

73093354 01/27/2012 06:50 pm Anthony Liguori

qdev: change ambiguous qdev names

Reported-by: Blue Swirl <>
Signed-off-by: Anthony Liguori <>

40021f08 01/27/2012 06:50 pm Anthony Liguori

pci: convert to QEMU Object Model

Signed-off-by: Anthony Liguori <>

999e12bb 01/27/2012 06:50 pm Anthony Liguori

sysbus: apic: ioapic: convert to QEMU Object Model

This converts three devices because apic and ioapic are subclasses of sysbus.
Converting subclasses independently of their base class is prohibitively hard.

Signed-off-by: Anthony Liguori <>

3f7565c9 01/21/2012 06:17 am Benjamin Herrenschmidt

pseries: Support PCI extended config space in RTAS calls

On the pseries machine (which expexts a paravirtualized guest), guest
access to PCI config space is via host-provided RTAS functions. This
patch extends these RTAS functions to permit access to PCI extended...

c9c3c80a 01/21/2012 06:17 am David Gibson

pseries: Use correct dispatcher for PCI config space accesses

The pseries machine expects a para-virtualized guest and so supplies RTAS
functions (via a hypercall) for performing PCI config space access.
Currently the implementation of these calls into
pci_default_{read,write}_config(). However this would be incorrect for...

4d8d5467 01/21/2012 06:17 am Benjamin Herrenschmidt

pseries: SLOF PCI flag day

Currently on the pseries machine the SLOF firmware is used normally,
but we bypass it when -kernel is specified. Having these two

different boot paths can cause some confusion.

In particular at present we need to "probe" the (emulated) PCI bus and...

88045ac5 01/21/2012 06:17 am Alexander Graf

PPC: Pseries: Check for PCI boundaries

We call pci_host_config_{read,write}_common() which perform PCI config
accesses. However they don't do all limit checking the way we expect
it to.

So let's introduce a small wrapper around them, making them behave the...

81584fd5 12/05/2011 10:38 pm David Gibson

pseries: Fix array overrun bug in PCI code

spapr_populate_pci_devices() containd a loop with PCI_NUM_REGIONS (7)
iterations. However this overruns the 'bars' global array, which only has
6 elements. In fact we only want to run this loop for things listed in the...

3a26360d 11/01/2011 11:52 pm Anthony Liguori

spapr: fix build

Signed-off-by: Anthony Liguori <>

3384f95c 10/31/2011 05:53 am David Gibson

pseries: Add partial support for PCI

This patch adds a PCI bus to the pseries machine. This instantiates
the qemu generic PCI bus code, advertises a PCI host bridge in the
guest's device tree and implements the RTAS methods specified by PAPR
to access PCI config space. It also sets up the memory regions we...