From: Alexey Kardashevskiy <aik@ozlabs.ru>
Cc: Alexey Kardashevskiy <aik@ozlabs.ru>,
qemu-devel@nongnu.org, Alexander Graf <agraf@suse.de>,
qemu-ppc@nongnu.org, David Gibson <david@gibson.dropbear.id.au>
Subject: [Qemu-devel] [PATCH] pseries pci: enable debugging with disabled emulated PCI bus
Date: Tue, 10 Jul 2012 23:46:11 +1000 [thread overview]
Message-ID: <1341927973-5615-4-git-send-email-aik@ozlabs.ru> (raw)
In-Reply-To: <1341927973-5615-1-git-send-email-aik@ozlabs.ru>
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 <aik@ozlabs.ru>
---
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
next prev parent reply other threads:[~2012-07-10 13:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <no>
2012-07-10 13:46 ` [Qemu-devel] [PATCH] pseries iommu: h_put_tce split to support more IOMMUs Alexey Kardashevskiy
2012-07-10 13:46 ` [Qemu-devel] [PATCH] pseries pci: removed cached qemu_irq from PCI host bus Alexey Kardashevskiy
2012-07-10 13:46 ` [Qemu-devel] [PATCH] pseries: added allocator for a block of IRQs Alexey Kardashevskiy
2012-07-10 13:46 ` Alexey Kardashevskiy [this message]
2012-07-10 13:46 ` [Qemu-devel] [PATCH] xics: added end-of-interrupt (EOI) handlers Alexey Kardashevskiy
2012-07-13 8:04 ` Alexey Kardashevskiy
2012-07-10 13:46 ` [Qemu-devel] [PATCH] pseries dma: DMA window params added to PHB and DT population changed Alexey Kardashevskiy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1341927973-5615-4-git-send-email-aik@ozlabs.ru \
--to=aik@ozlabs.ru \
--cc=agraf@suse.de \
--cc=david@gibson.dropbear.id.au \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).