Skip to contentSkip to conversation

isapc: give system address space when pci is disabled

PATCH Applied Hervé Poussineau 6 participants 9 messages Sep 18, 2011 – Oct 10, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 isapc: give system address space when pci is disabled

---
 hw/pc_piix.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
hw/pc_piix.c +1 -1
index da6fa55..c0b8a3a 100644
@@ -121,7 +121,7 @@ static void pc_init1(MemoryRegion *system_memory,
         pc_memory_init(system_memory,
                        kernel_filename, kernel_cmdline, initrd_filename,
                        below_4g_mem_size, above_4g_mem_size,
-                       pci_memory, &ram_memory);
+                       pci_enabled ? pci_memory : system_memory, &ram_memory);
     }
 
     if (!xen_enabled()) {
Signature · 1 line
1.7.5.4
#1 lore raw
Quoted 11 lines · Hervé Poussineau
---
 hw/pc_piix.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
hw/pc_piix.c +0 -0
index da6fa55..c0b8a3a 100644

hw/pc_piix.c static void pc_init1(MemoryRegion *system_memory, · line 127

Quoted 8 lines
hw/pc_piix.c +1 -1
@@ -121,7 +121,7 @@ static void pc_init1(MemoryRegion *system_memory,
         pc_memory_init(system_memory,
                        kernel_filename, kernel_cmdline, initrd_filename,
                        below_4g_mem_size, above_4g_mem_size,
-                       pci_memory, &ram_memory);
+                       pci_enabled ? pci_memory : system_memory, &ram_memory);
     }
 
     if (!xen_enabled()) {

Makes sense. I guess we should rename 'pci_memory' inside pc_memory_init to reflect this - 'rom_memory'?

But -M isapc still only gives me a black screen. Are there further fixes required?

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
#2 lore raw
Quoted 18 lines · Jan Kiszka
Quoted 17 lines · Hervé Poussineau
---
 hw/pc_piix.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
hw/pc_piix.c +1 -1
index da6fa55..c0b8a3a 100644
@@ -121,7 +121,7 @@ static void pc_init1(MemoryRegion *system_memory,
         pc_memory_init(system_memory,
                        kernel_filename, kernel_cmdline, initrd_filename,
                        below_4g_mem_size, above_4g_mem_size,
-                       pci_memory, &ram_memory);
+                       pci_enabled ? pci_memory : system_memory, &ram_memory);
     }
 
Quoted 8 lines

hw/pc_piix.c static void pc_init1(MemoryRegion *system_memory, · line 127

Quoted 1 line
hw/pc_piix.c +0 -0
     if (!xen_enabled()) {

Makes sense. I guess we should rename 'pci_memory' inside pc_memory_init to reflect this - 'rom_memory'?

But -M isapc still only gives me a black screen. Are there further fixes required?

Yes, you also need to rollback pc-bios/bios.bin to previous version (ie 8b06c62ae48b67b320f7420dcd4854c5559e1532)

Hervé

#3 lore raw
Quoted 24 lines · Hervé Poussineau
Quoted 23 lines · Jan Kiszka
Quoted 10 lines · Hervé Poussineau
---
 hw/pc_piix.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
hw/pc_piix.c +0 -0
index da6fa55..c0b8a3a 100644

hw/pc_piix.c static void pc_init1(MemoryRegion *system_memory, · line 127

Quoted 8 lines
hw/pc_piix.c +1 -1
@@ -121,7 +121,7 @@ static void pc_init1(MemoryRegion *system_memory,
         pc_memory_init(system_memory,
                        kernel_filename, kernel_cmdline, initrd_filename,
                        below_4g_mem_size, above_4g_mem_size,
-                       pci_memory, &ram_memory);
+                       pci_enabled ? pci_memory : system_memory, &ram_memory);
     }
 
     if (!xen_enabled()) {

Makes sense. I guess we should rename 'pci_memory' inside pc_memory_init to reflect this - 'rom_memory'?

Quoted 6 lines
Quoted 3 lines

But -M isapc still only gives me a black screen. Are there further fixes required?

Yes, you also need to rollback pc-bios/bios.bin to previous version (ie 8b06c62ae48b67b320f7420dcd4854c5559e1532)

Did you already try to bisect that probable regression in SeaBIOS?

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
#4 lore raw
Quoted 24 lines · Jan Kiszka
Quoted 23 lines · Hervé Poussineau
Quoted 22 lines · Jan Kiszka
Quoted 10 lines · Hervé Poussineau
---
 hw/pc_piix.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
hw/pc_piix.c +0 -0
index da6fa55..c0b8a3a 100644

hw/pc_piix.c static void pc_init1(MemoryRegion *system_memory, · line 127

Quoted 8 lines
hw/pc_piix.c +1 -1
@@ -121,7 +121,7 @@ static void pc_init1(MemoryRegion *system_memory,
         pc_memory_init(system_memory,
                        kernel_filename, kernel_cmdline, initrd_filename,
                        below_4g_mem_size, above_4g_mem_size,
-                       pci_memory, &ram_memory);
+                       pci_enabled ? pci_memory : system_memory, &ram_memory);
     }
 
     if (!xen_enabled()) {

Makes sense. I guess we should rename 'pci_memory' inside pc_memory_init to reflect this - 'rom_memory'?

Quoted 7 lines
Quoted 4 lines
Quoted 3 lines

But -M isapc still only gives me a black screen. Are there further fixes required?

Yes, you also need to rollback pc-bios/bios.bin to previous version (ie 8b06c62ae48b67b320f7420dcd4854c5559e1532)

Did you already try to bisect that probable regression in SeaBIOS?

Yes, I regtested the problem to this SeaBIOS commit:

01a5c8813b2e709809c07c5d7fab9d1c3ddb4989 is the first bad commit commit 01a5c8813b2e709809c07c5d7fab9d1c3ddb4989

Author: Gerd Hoffmann <[email protected]>
Date:   Mon Jul 11 09:20:29 2011 +0200

pci: activate two-pass pci initialization code

This patch actually enables the two-pass pci initialization and deactivates the old pci initialization bits.

Binary is current qemu + this patch
Command line is: qemu-system-i386 -M isapc -vga std

Hervé

#5 lore raw

PATCH 1/1 Probe PCI existence

From: Jan Kiszka <[email protected]>

This prevents lockups when trying to allocate PCI resources on an ISA-only system like QEMU can emulate.

---
 src/pci.c     |   14 +++++++++++++-
 src/pci.h     |    3 ++-
 src/pciinit.c |    7 +++++--
 3 files changed, 20 insertions(+), 4 deletions(-)
src/pci.c +13 -1
index 49698ac..6031c9f 100644
@@ -88,9 +88,21 @@ pci_next(int bdf, int bus)
 struct pci_device *PCIDevices;
 int MaxPCIBus VAR16VISIBLE;
 
+// Check if PCI is available at all
+int
+pci_probe_host(void)
+{
+    outl(0x80000000, PORT_PCI_CMD);
+    if (inl(PORT_PCI_CMD) != 0x80000000) {
+        dprintf(1, "Detected non-PCI system\n");
+        return -1;
+    }
+    return 0;
+}
+
 // Find all PCI devices and populate PCIDevices linked list.
 void
-pci_probe(void)
+pci_probe_devices(void)
 {
     dprintf(3, "PCI probe\n");
     struct pci_device *busdevs[256];
src/pci.h +2 -1
index 3e28af2..a2a5a4c 100644
@@ -62,7 +62,8 @@ struct pci_device {
 };
 extern struct pci_device *PCIDevices;
 extern int MaxPCIBus;
-void pci_probe(void);
+int pci_probe_host(void);
+void pci_probe_devices(void);
 static inline u32 pci_classprog(struct pci_device *pci) {
     return (pci->class << 8) | pci->prog_if;
 }
src/pciinit.c +5 -2
index 597c8ea..a857da0 100644
@@ -577,7 +577,7 @@ pci_setup(void)
 {
     if (CONFIG_COREBOOT || usingXen()) {
         // PCI setup already done by coreboot or Xen - just do probe.
-        pci_probe();
+        pci_probe_devices();
         return;
     }
 
@@ -587,10 +587,13 @@ pci_setup(void)
     u32 end   = BUILD_PCIMEM_END;
 
     dprintf(1, "=== PCI bus & bridge init ===\n");
+    if (pci_probe_host() != 0) {
+        return;
+    }
     pci_bios_init_bus();
 
     dprintf(1, "=== PCI device probing ===\n");
-    pci_probe();
+    pci_probe_devices();
 
     dprintf(1, "=== PCI new allocation pass #1 ===\n");
     busses = malloc_tmp(sizeof(*busses) * busses_count);
Signature · 1 line
1.7.3.4
#8 lore raw
In reply to Hervé Poussineau
Quoted 2 lines · Hervé Poussineau

Applied. Thanks.

Regards,

Anthony Liguori

Quoted 17 lines
---
  hw/pc_piix.c |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
hw/pc_piix.c +1 -1
index da6fa55..c0b8a3a 100644
@@ -121,7 +121,7 @@ static void pc_init1(MemoryRegion *system_memory,
          pc_memory_init(system_memory,
                         kernel_filename, kernel_cmdline, initrd_filename,
                         below_4g_mem_size, above_4g_mem_size,
-                       pci_memory,&ram_memory);
+                       pci_enabled ? pci_memory : system_memory,&ram_memory);
      }
 
      if (!xen_enabled()) {