From patchwork Tue Jul 10 13:46:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kardashevskiy X-Patchwork-Id: 170184 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 3D5E92C020A for ; Tue, 10 Jul 2012 23:47:25 +1000 (EST) Received: from localhost ([::1]:41735 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Soamg-0001UH-P6 for incoming@patchwork.ozlabs.org; Tue, 10 Jul 2012 09:47:22 -0400 Received: from eggs.gnu.org ([208.118.235.92]:52951) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Soam3-0008FQ-6h for qemu-devel@nongnu.org; Tue, 10 Jul 2012 09:46:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Soalu-00015J-Bo for qemu-devel@nongnu.org; Tue, 10 Jul 2012 09:46:42 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:38986) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Soalu-00013i-5k for qemu-devel@nongnu.org; Tue, 10 Jul 2012 09:46:34 -0400 Received: by mail-pb0-f45.google.com with SMTP id ro12so335087pbb.4 for ; Tue, 10 Jul 2012 06:46:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=ue+VfFO1eV0i/i77oNBMEaJ5gr6SDdoXKtUkPW1GZIQ=; b=UCh7b64RsZaeBsdJDh5urUSnYQKqiX/xhnjagNVbwniOFXi8wZjMgLIINc+eT+mgYW tLEv0rnoE/EWSnUfUv53EkMtlRj2iRIHV8eDDXh+AzjpzRG0GLvVg9xSx1UVZqF51bXf hB2Uiem0fS2bI7zijqAyoZsQiFMUBrYC5xWJRM3ixTjQySeQvdD1LQRxlRouAkOHO9EN 28zedwHxBQRlQzSpVz95sv+GIkaBGUkIpnTJoeDN6/bFyQdpuzpZpTl56EcFpaim4JV7 SpvJrFX6HaYJGWXzq4WxCI6mnqsqQzDloDvUZv8c0ES1nVuHMrIebD/B19RyeP4cahm6 MArg== Received: by 10.68.233.201 with SMTP id ty9mr4861690pbc.34.1341927993135; Tue, 10 Jul 2012 06:46:33 -0700 (PDT) Received: from ka1.ozlabs.ibm.com (ibmaus65.lnk.telstra.net. [165.228.126.9]) by mx.google.com with ESMTPS id pz9sm8349748pbb.61.2012.07.10.06.46.30 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 10 Jul 2012 06:46:32 -0700 (PDT) From: Alexey Kardashevskiy To: Date: Tue, 10 Jul 2012 23:46:11 +1000 Message-Id: <1341927973-5615-4-git-send-email-aik@ozlabs.ru> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1341927973-5615-1-git-send-email-aik@ozlabs.ru> References: <1341927973-5615-1-git-send-email-aik@ozlabs.ru> X-Gm-Message-State: ALoCoQllc4Ii8gVHmPIPKWUcM7XVHloP0UPqy+QFKV+Zs7VOTlaYYx/GUA8FMMCqdXcsGLwwqHkx X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.160.45 Cc: Alexey Kardashevskiy , qemu-devel@nongnu.org, Alexander Graf , qemu-ppc@nongnu.org, David Gibson Subject: [Qemu-devel] [PATCH] pseries pci: enable debugging with disabled emulated PCI bus 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 Sometime when debugging PCI buses other than default emulated bus it helps to disable emulated PCI. To disable it by commenting out spapr_create_phb(SPAPR_PCI_BUID) call, this patch is submitted. The patch does 2 things: 1. adds a check to init the emulated VGA only if the emulated PCI bus has been created. 2. moves RTAS PCI config space access hooks out of the emulated PCI bus init code. Signed-off-by: Alexey Kardashevskiy --- hw/spapr.c | 4 +++- hw/spapr_pci.c | 13 ++++++++----- hw/spapr_pci.h | 2 ++ 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/hw/spapr.c b/hw/spapr.c index f47c109..af3f479 100644 --- a/hw/spapr.c +++ b/hw/spapr.c @@ -764,6 +764,7 @@ static void ppc_spapr_init(ram_addr_t ram_size, } /* Set up PCI */ + pci_common_init(); spapr_create_phb(spapr, "pci", SPAPR_PCI_BUID, SPAPR_PCI_MEM_WIN_ADDR, SPAPR_PCI_MEM_WIN_SIZE, @@ -788,7 +789,8 @@ static void ppc_spapr_init(ram_addr_t ram_size, } /* Graphics */ - if (spapr_vga_init(QLIST_FIRST(&spapr->phbs)->host_state.bus)) { + if (QLIST_FIRST(&spapr->phbs) && + spapr_vga_init(QLIST_FIRST(&spapr->phbs)->host_state.bus)) { spapr_has_graphics = 1; usb_enabled = 1; } diff --git a/hw/spapr_pci.c b/hw/spapr_pci.c index 1318390..7a17d54 100644 --- a/hw/spapr_pci.c +++ b/hw/spapr_pci.c @@ -357,11 +357,6 @@ static void spapr_phb_class_init(ObjectClass *klass, void *data) sdc->init = spapr_phb_init; dc->props = spapr_phb_properties; - - spapr_rtas_register("read-pci-config", rtas_read_pci_config); - spapr_rtas_register("write-pci-config", rtas_write_pci_config); - spapr_rtas_register("ibm,read-pci-config", rtas_ibm_read_pci_config); - spapr_rtas_register("ibm,write-pci-config", rtas_ibm_write_pci_config); } static TypeInfo spapr_phb_info = { @@ -486,6 +481,14 @@ int spapr_populate_pci_dt(sPAPRPHBState *phb, return 0; } +void pci_common_init(void) +{ + spapr_rtas_register("read-pci-config", rtas_read_pci_config); + spapr_rtas_register("write-pci-config", rtas_write_pci_config); + spapr_rtas_register("ibm,read-pci-config", rtas_ibm_read_pci_config); + spapr_rtas_register("ibm,write-pci-config", rtas_ibm_write_pci_config); +} + static void register_types(void) { type_register_static(&spapr_phb_info); diff --git a/hw/spapr_pci.h b/hw/spapr_pci.h index 11c3ee1..05447b4 100644 --- a/hw/spapr_pci.h +++ b/hw/spapr_pci.h @@ -58,4 +58,6 @@ int spapr_populate_pci_dt(sPAPRPHBState *phb, uint32_t xics_phandle, void *fdt); +void pci_common_init(void); + #endif /* __HW_SPAPR_PCI_H__ */