From patchwork Mon Oct 31 03:55:37 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 122716 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 4ECFDB6F72 for ; Mon, 31 Oct 2011 14:55:50 +1100 (EST) Received: from localhost ([::1]:39179 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RKiyR-00074f-CI for incoming@patchwork.ozlabs.org; Sun, 30 Oct 2011 23:55:47 -0400 Received: from eggs.gnu.org ([140.186.70.92]:39288) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RKiyM-00074a-5F for qemu-devel@nongnu.org; Sun, 30 Oct 2011 23:55:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RKiyL-0004DK-0d for qemu-devel@nongnu.org; Sun, 30 Oct 2011 23:55:42 -0400 Received: from cantor2.suse.de ([195.135.220.15]:46924 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RKiyK-0004DE-QN; Sun, 30 Oct 2011 23:55:40 -0400 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 817AC8B013; Mon, 31 Oct 2011 04:55:39 +0100 (CET) Mime-Version: 1.0 (Apple Message framework v1084) From: Alexander Graf In-Reply-To: <1320031007-25884-3-git-send-email-david@gibson.dropbear.id.au> Date: Mon, 31 Oct 2011 04:55:37 +0100 Message-Id: <4970C852-8412-410A-B21B-0AFA83E0C95D@suse.de> References: <1320031007-25884-1-git-send-email-david@gibson.dropbear.id.au> <1320031007-25884-3-git-send-email-david@gibson.dropbear.id.au> To: David Gibson X-Mailer: Apple Mail (2.1084) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 195.135.220.15 Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org Subject: Re: [Qemu-devel] [PATCH 2/3] pseries: Add partial support for PCI X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 > Signed-off-by: David Gibson Applied with the following patch folded in: Alex 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 . */ +#if !defined(__HW_SPAPR_H__) +#error Please include spapr.h before this file! +#endif + #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 {