From mboxrd@z Thu Jan 1 00:00:00 1970 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) From: Alexey Kardashevskiy Date: Tue, 10 Jul 2012 23:46:11 +1000 Message-Id: <1341927973-5615-4-git-send-email-aik@ozlabs.ru> In-Reply-To: <1341927973-5615-1-git-send-email-aik@ozlabs.ru> References: <1341927973-5615-1-git-send-email-aik@ozlabs.ru> Subject: [Qemu-devel] [PATCH] pseries pci: enable debugging with disabled emulated PCI bus List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexey Kardashevskiy , qemu-devel@nongnu.org, Alexander Graf , qemu-ppc@nongnu.org, David Gibson 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__ */ -- 1.7.10