[2/3] pseries: Add partial support for PCI

Message ID 4970C852-8412-410A-B21B-0AFA83E0C95D@suse.de
State New
Headers show

Commit Message

Alexander Graf Oct. 31, 2011, 3:55 a.m.
On 31.10.2011, at 04:16, David Gibson wrote:

> 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
> need to provide windows into the PCI memory and IO space, and
> advertises those to the guest.
> However, because qemu can't yet emulate an IOMMU, which is mandatory on
> pseries, PCI devices which use DMA (i.e. most of them) will not work with
> this code alone.  Still, this is enough to support the virtio_pci device
> (which probably _should_ use emulated PCI DMA, but is specced to use
> direct hypervisor access to guest physical memory instead).
> Signed-off-by: Alexey Kardashevskiy <aik@au1.ibm.com>
> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>

Applied with the following patch folded in:



diff --git a/hw/spapr_pci.h b/hw/spapr_pci.h
index 4bb8dfb..213340c 100644
--- a/hw/spapr_pci.h
+++ b/hw/spapr_pci.h
@@ -16,14 +16,16 @@ 
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+#if !defined(__HW_SPAPR_H__)
+#error Please include spapr.h before this file!
 #if !defined(__HW_SPAPR_PCI_H__)
 #define __HW_SPAPR_PCI_H__
 #include "hw/pci_host.h"
 #include "hw/xics.h"
-typedef struct sPAPREnvironment sPAPREnvironment;
 #define SPAPR_PCI_NUM_LSI   16
 typedef struct sPAPRPHBState {