Skip to contentSkip to conversation

ppc: Fix PReP emulation

PATCH In review Andreas Färber 4 participants 37 messages Dec 14, 2010 – Jan 16, 2011

lore
Share & tools
lore
#0 lore raw

cover ppc: Fix PReP emulation

Hello,

Based on an earlier attempt of mine to make OpenBIOS work with -M prep, with kind support from Hervé Poussineau here's an initial stab at fixing the long-broken PReP emulation and preparing migration from abandoned OpenHack'Ware to OpenBIOS as default FOSS firmware.

In particular a number of hw_error()s are resolved, so that the BIOS can be entered at all. It is not yet working in terms of serial and VGA support etc.

This series is also available from:

git://repo.or.cz/qemu/afaerber.git prep-queue

Some more work-in-progress for the curious is on my prep branch [2]. The corresponding work-in-progress OpenBIOS changes are at [3].

Unfortunately the prep machine is lacking documentation what exactly it tries to emulate. The plan thus is to merge emulation of a second, real IBM 40p machine based on Hervé's work at [1], for use with original binary firmware.

Also upcoming are new ppc_chrp machines, forked from ppc_newworld, emulating the 970-based IBM JS20 (using Apple U3) [4] and possibly the POWER5-based IntelliStation 285. These depend on the ongoing ppc64 port of OpenBIOS to be completed though. This relates to PReP in that the machine IDs will need to be coordinated.

Have fun,
Andreas

[1] git://repo.or.cz/qemu/hpoussin.git ppc
http://repo.or.cz/w/qemu/hpoussin.git/shortlog/refs/heads/ppc
[2] http://repo.or.cz/w/qemu/afaerber.git/shortlog/refs/heads/prep
[3] http://repo.or.cz/w/openbios/afaerber.git/shortlog/refs/heads/prep
[4] http://repo.or.cz/w/qemu/afaerber.git/shortlog/refs/heads/aix

Andreas Färber (4):
prep: Remove bogus BIOS size check
prep: Add ELF support
prep: Fix duplicate ISA IDE IRQ
prep: Quickfix for ioport

 hw/ppc_prep.c |   31 ++++++++++++++++++-------------
 1 files changed, 18 insertions(+), 13 deletions(-)
Signature · 1 line
1.7.3
#1 lore raw

PATCH 1/4 prep: Remove bogus BIOS size check

r3480 added this check to account for the entry vector 0xfff00100 to be available for CPUs that need it. Today however, the NIP is not yet initialized at this point (zero), so the check always triggers.

Cc Hervé Poussineau <[email protected]>
Cc Alexander Graf <[email protected]>
---
 hw/ppc_prep.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
hw/ppc_prep.c +0 -3
index 1492266..6b22122 100644
@@ -600,9 +600,6 @@ static void ppc_prep_init (ram_addr_t ram_size,
     if (filename) {
         qemu_free(filename);
     }
-    if (env->nip < 0xFFF80000 && bios_size < 0x00100000) {
-        hw_error("PowerPC 601 / 620 / 970 need a 1MB BIOS\n");
-    }
 
     if (linux_boot) {
         kernel_base = KERNEL_LOAD_ADDR;
Signature · 1 line
1.7.3
#2 lore raw

PATCH 2/4 prep: Add ELF support

In order to switch from abondoned OpenHack'Ware to OpenBIOS firmware, the PReP machine needs to be able to load an ELF BIOS.

ELF loading is adapted from ppc_newworld, the fallback mechanism from sun4m.

Note that since we must register the maximum amount of ROM before attempting to load an ELF BIOS and since there is no cpu_unregister_physical_memory(), raw BIOS files such as OHW may now be preceded by unused ROM memory.

Cc Alexander Graf <[email protected]>
Cc Hervé Poussineau <[email protected]>
---
 hw/ppc_prep.c |   24 +++++++++++++++---------
 1 files changed, 15 insertions(+), 9 deletions(-)
hw/ppc_prep.c +15 -9
index 6b22122..3575dee 100644
@@ -36,6 +36,7 @@
 #include "qemu-log.h"
 #include "ide.h"
 #include "loader.h"
+#include "elf.h"
 #include "mc146818rtc.h"
 #include "blockdev.h"
 
@@ -582,18 +583,23 @@ static void ppc_prep_init (ram_addr_t ram_size,
         bios_name = BIOS_FILENAME;
     filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
     if (filename) {
-        bios_size = get_image_size(filename);
+        cpu_register_physical_memory(0xfff00000, BIOS_SIZE,
+                                     bios_offset | IO_MEM_ROM);
+        bios_size = load_elf(filename, NULL, NULL, NULL,
+                             NULL, NULL, 1, ELF_MACHINE, 0);
+        if (bios_size < 0 || bios_size > BIOS_SIZE) {
+            bios_size = get_image_size(filename);
+            if (bios_size > 0 && bios_size <= BIOS_SIZE) {
+                target_phys_addr_t bios_addr;
+                bios_size = (bios_size + 0xfff) & ~0xfff;
+                bios_addr = (uint32_t)(-bios_size);
+                bios_size = load_image_targphys(filename, bios_addr,
+                                                bios_size);
+            }
+        }
     } else {
         bios_size = -1;
     }
-    if (bios_size > 0 && bios_size <= BIOS_SIZE) {
-        target_phys_addr_t bios_addr;
-        bios_size = (bios_size + 0xfff) & ~0xfff;
-        bios_addr = (uint32_t)(-bios_size);
-        cpu_register_physical_memory(bios_addr, bios_size,
-                                     bios_offset | IO_MEM_ROM);
-        bios_size = load_image_targphys(filename, bios_addr, bios_size);
-    }
     if (bios_size < 0 || bios_size > BIOS_SIZE) {
         hw_error("qemu: could not load PPC PREP bios '%s'\n", bios_name);
     }
Signature · 1 line
1.7.3
#3 lore raw

RFC PATCH 3/4 prep: Fix duplicate ISA IDE IRQ

Calling isa_ide_init() twice with the same IRQ 13 fails:

qemu: hardware error: isa irq 13 already assigned

Use a different IRQ (14) for the second one to avoid this.

---
 hw/ppc_prep.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
hw/ppc_prep.c +1 -1
index 3575dee..3073870 100644
@@ -76,7 +76,7 @@ qemu_log_mask(CPU_LOG_IOPORT, fmt, ## __VA_ARGS__)
 /* Constants for devices init */
 static const int ide_iobase[2] = { 0x1f0, 0x170 };
 static const int ide_iobase2[2] = { 0x3f6, 0x376 };
-static const int ide_irq[2] = { 13, 13 };
+static const int ide_irq[2] = { 13, 14 };
 
 #define NE2000_NB_MAX 6
 
Signature · 1 line
1.7.3
#4 lore raw

PATCH 4/4 prep: Quickfix for ioport

Workaround the following error:

qemu: hardware error: register_ioport_read: invalid opaque

---
 hw/ppc_prep.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
hw/ppc_prep.c +2 -0
index 3073870..0c9183e 100644
@@ -721,8 +721,10 @@ static void ppc_prep_init (ram_addr_t ram_size,
     register_ioport_read(0x398, 2, 1, &PREP_io_read, sysctrl);
     register_ioport_write(0x398, 2, 1, &PREP_io_write, sysctrl);
     /* System control ports */
+#if 0
     register_ioport_read(0x0092, 0x01, 1, &PREP_io_800_readb, sysctrl);
     register_ioport_write(0x0092, 0x01, 1, &PREP_io_800_writeb, sysctrl);
+#endif
     register_ioport_read(0x0800, 0x52, 1, &PREP_io_800_readb, sysctrl);
     register_ioport_write(0x0800, 0x52, 1, &PREP_io_800_writeb, sysctrl);
     /* PCI intack location */
Signature · 1 line
1.7.3
#5 lore raw

Re: [Qemu-devel] [FYI 4/4] prep: Quickfix for ioport

Am 14.12.2010 um 01:49 schrieb Andreas Färber:

Quoted 3 lines

Workaround the following error:

qemu: hardware error: register_ioport_read: invalid opaque

I found out that this is a conflict with i8042 registering I/O port 0x0092 in pckbd.c, too. Not sure what the proper fix should look like - add some qdev property to ISAKBDState to disable the port?

Andreas

Quoted 27 lines

---
hw/ppc_prep.c | 2 ++

1 files changed, 2 insertions(+), 0 deletions(-)
hw/ppc_prep.c +2 -0
index 3073870..0c9183e 100644
@@ -721,8 +721,10 @@ static void ppc_prep_init (ram_addr_t ram_size,
  register_ioport_read(0x398, 2, 1, &PREP_io_read, sysctrl);
  register_ioport_write(0x398, 2, 1, &PREP_io_write, sysctrl);
  /* System control ports */
+#if 0
  register_ioport_read(0x0092, 0x01, 1, &PREP_io_800_readb, sysctrl);
  register_ioport_write(0x0092, 0x01, 1, &PREP_io_800_writeb,  
 sysctrl);
+#endif
  register_ioport_read(0x0800, 0x52, 1, &PREP_io_800_readb, sysctrl);
  register_ioport_write(0x0800, 0x52, 1, &PREP_io_800_writeb,  

sysctrl);
/* PCI intack location */

Signature · 1 line
1.7.3
#6 lore raw

Re: [Qemu-devel] [FYI 4/4] prep: Quickfix for ioport

Am 27.12.2010 um 00:28 schrieb Andreas Färber <[email protected]>:

Quoted 8 lines

Am 14.12.2010 um 01:49 schrieb Andreas Färber:

Quoted 3 lines

Workaround the following error:

qemu: hardware error: register_ioport_read: invalid opaque

I found out that this is a conflict with i8042 registering I/O port 0x0092 in pckbd.c, too. Not sure what the proper fix should look like - add some qdev property to ISAKBDState to disable the port?

Well, why does the PREP board have its own mapping there in the first place? It should be the same as a PC from a port pov, no?

Alex

Quoted 29 lines

Andreas

Quoted 25 lines

---
hw/ppc_prep.c | 2 ++

1 files changed, 2 insertions(+), 0 deletions(-)
hw/ppc_prep.c +2 -0
index 3073870..0c9183e 100644
@@ -721,8 +721,10 @@ static void ppc_prep_init (ram_addr_t ram_size,
 register_ioport_read(0x398, 2, 1, &PREP_io_read, sysctrl);
 register_ioport_write(0x398, 2, 1, &PREP_io_write, sysctrl);
 /* System control ports */
+#if 0
 register_ioport_read(0x0092, 0x01, 1, &PREP_io_800_readb, sysctrl);
 register_ioport_write(0x0092, 0x01, 1, &PREP_io_800_writeb, sysctrl);
+#endif
 register_ioport_read(0x0800, 0x52, 1, &PREP_io_800_readb, sysctrl);
 register_ioport_write(0x0800, 0x52, 1, &PREP_io_800_writeb, sysctrl);
 /* PCI intack location */
Signature · 1 line
1.7.3
#7 lore raw

Re: [Qemu-devel] [FYI 4/4] prep: Quickfix for ioport

Am 27.12.2010 um 01:11 schrieb Alexander Graf:

Quoted 4 lines

Am 27.12.2010 um 00:28 schrieb Andreas Färber <[email protected]>:

Quoted 2 lines

Am 14.12.2010 um 01:49 schrieb Andreas Färber:

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

Workaround the following error:

qemu: hardware error: register_ioport_read: invalid opaque

I found out that this is a conflict with i8042 registering I/O port 0x0092 in pckbd.c, too. Not sure what the proper fix should look like - add some qdev property to ISAKBDState to disable the port?

Well, why does the PREP board have its own mapping there in the first place? It should be the same as a PC from a port pov, no?

Why does the i8042 controller have a System Control Port in the first place rather than the 'pc' machine? :)

The PReP spec v1.1 has a Special Port 0x0092 that includes two bits of significence - softreset and endian mode. So wherever the port is registered, the latter behavior is board-specific and does not match pckbd.c (A20 gate or HDD activity depending on bit numbering).

A similar issue arises between PReP machines: The ioport currently does not allow using a different opaque for reads and writes to the same address. So either we need to change ioport or create some inheritence/override mechanism for port behavior.

Andreas

#8 lore raw

Re: [Qemu-devel] [FYI 4/4] prep: Quickfix for ioport

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 13 lines · Andreas Färber

Am 27.12.2010 um 01:11 schrieb Alexander Graf:

Quoted 11 lines

Am 27.12.2010 um 00:28 schrieb Andreas Färber <[email protected]>:

Quoted 8 lines

Am 14.12.2010 um 01:49 schrieb Andreas Färber:

Quoted 3 lines

Workaround the following error:

qemu: hardware error: register_ioport_read: invalid opaque

I found out that this is a conflict with i8042 registering I/O port 0x0092 in pckbd.c, too. Not sure what the proper fix should look like - add some qdev property to ISAKBDState to disable the port?

Quoted 7 lines
Quoted 1 line

Well, why does the PREP board have its own mapping there in the first place? It should be the same as a PC from a port pov, no?

Why does the i8042 controller have a System Control Port in the first place rather than the 'pc' machine? :)

The PReP spec v1.1 has a Special Port 0x0092 that includes two bits of significence - softreset and endian mode. So wherever the port is registered, the latter behavior is board-specific and does not match pckbd.c (A20 gate or HDD activity depending on bit numbering).

A similar issue arises between PReP machines: The ioport currently does not allow using a different opaque for reads and writes to the same address. So either we need to change ioport or create some inheritence/override mechanism for port behavior.

Hmm - sounds to me like that register simply doesn't belong there then, so a split would be the correct solution. The alternative would be to have the keyboard controller create a bus that those bits send signals to. An x86 system could then implement its A20 gate in x86 specific code while PREP could do its specific stuff.

Alex

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.16 (Darwin)

iEYEARECAAYFAk0jibgACgkQq7Wi27wfN1PtUACfdx6L4Sk/aR5/sC3QEg1Hciyy Zm0AnAxaD2jguRq+RcaI8TLsaWGE1gN7
=VioX
-----END PGP SIGNATURE-----

#9 lore raw

Re: [Qemu-devel] [FYI 4/4] prep: Quickfix for ioport

Am 04.01.2011 um 21:57 schrieb Alexander Graf:

Quoted 18 lines · Andreas Färber
Quoted 17 lines

Am 27.12.2010 um 01:11 schrieb Alexander Graf:

Quoted 13 lines

Am 27.12.2010 um 00:28 schrieb Andreas Färber <[email protected]

Quoted 10 lines

:

Am 14.12.2010 um 01:49 schrieb Andreas Färber:

Quoted 3 lines

Workaround the following error:

qemu: hardware error: register_ioport_read: invalid opaque

I found out that this is a conflict with i8042 registering I/O port 0x0092 in pckbd.c, too. Not sure what the proper fix should look like - add some qdev property to ISAKBDState to disable the port?

Well, why does the PREP board have its own mapping there in the first place? It should be the same as a PC from a port pov, no?

Quoted 7 lines
Quoted 5 lines

Why does the i8042 controller have a System Control Port in the first place rather than the 'pc' machine? :)

The PReP spec v1.1 has a Special Port 0x0092 that includes two bits of significence - softreset and endian mode. So wherever the port is registered, the latter behavior is board-specific and does not match pckbd.c (A20 gate or HDD activity depending on bit numbering).

A similar issue arises between PReP machines: The ioport currently does not allow using a different opaque for reads and writes to the same address. So either we need to change ioport or create some inheritence/override mechanism for port behavior.

Hmm - sounds to me like that register simply doesn't belong there then, so a split would be the correct solution. The alternative would be to have the keyboard controller create a bus that those bits send signals to. An x86 system could then implement its A20 gate in x86 specific code while PREP could do its specific stuff.

Coincidentally there's a recent pckbd patch from Blue that resolves the conflict. Feel free to review. :)

Any thoughts on the read vs. write port issue? Do we need to register both ports in the base device and add hooks to the device state? Sounds problematic VMState-wise, just like some of the qemu_irq constructs in the ppc devices. (My prep_pci changes are still far from perfect, UniNorth has similar issues I noticed.)

Andreas

#10 lore raw

Re: [Qemu-devel] [FYI 4/4] prep: Quickfix for ioport

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 21 lines · Andreas Färber

Am 04.01.2011 um 21:57 schrieb Alexander Graf:

Quoted 19 lines · Andreas Färber
Quoted 18 lines

Am 27.12.2010 um 01:11 schrieb Alexander Graf:

Quoted 4 lines

Am 27.12.2010 um 00:28 schrieb Andreas Färber <[email protected]>:

Quoted 2 lines

Am 14.12.2010 um 01:49 schrieb Andreas Färber:

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

Workaround the following error:

qemu: hardware error: register_ioport_read: invalid opaque

I found out that this is a conflict with i8042 registering I/O port 0x0092 in pckbd.c, too. Not sure what the proper fix should look like - add some qdev property to ISAKBDState to disable the port?

Well, why does the PREP board have its own mapping there in the first place? It should be the same as a PC from a port pov, no?

Why does the i8042 controller have a System Control Port in the first place rather than the 'pc' machine? :)

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

The PReP spec v1.1 has a Special Port 0x0092 that includes two bits of significence - softreset and endian mode. So wherever the port is registered, the latter behavior is board-specific and does not match pckbd.c (A20 gate or HDD activity depending on bit numbering).

A similar issue arises between PReP machines: The ioport currently does not allow using a different opaque for reads and writes to the same address. So either we need to change ioport or create some inheritence/override mechanism for port behavior.

Hmm - sounds to me like that register simply doesn't belong there then, so a split would be the correct solution. The alternative would be to have the keyboard controller create a bus that those bits send signals to. An x86 system could then implement its A20 gate in x86 specific code while PREP could do its specific stuff.

Coincidentally there's a recent pckbd patch from Blue that resolves the conflict. Feel free to review. :)

Ah, sorry :). Still catching up. Just now finished to watch news of the last 1 1/2 weeks :).

Quoted 1 line

Any thoughts on the read vs. write port issue? Do we need to register both ports in the base device and add hooks to the device state? Sounds problematic VMState-wise, just like some of the qemu_irq constructs in the ppc devices. (My prep_pci changes are still far from perfect, UniNorth has similar issues I noticed.)

Well, the general idea is that a single IO always gets routed to the same device. I don't fully understand why you need separate handlers there tbh. Mind to explain this?

Alex

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.16 (Darwin)

iEYEARECAAYFAk0jlJcACgkQq7Wi27wfN1N/agCeL6hOC6c+DHjLQ7Q3uXsp1Clo x94An0lSzs/kvXGynRy1y2UMmLwpltp1
=NkaJ
-----END PGP SIGNATURE-----

#11 lore raw

Re: [Qemu-devel] [FYI 4/4] prep: Quickfix for ioport

Am 04.01.2011 um 22:43 schrieb Alexander Graf:

Quoted 26 lines · Andreas Färber
Quoted 25 lines

Am 04.01.2011 um 21:57 schrieb Alexander Graf:

Quoted 22 lines · Andreas Färber
Quoted 21 lines

Am 27.12.2010 um 01:11 schrieb Alexander Graf:

Quoted 5 lines

Am 27.12.2010 um 00:28 schrieb Andreas Färber <[email protected]

Quoted 4 lines

:

Am 14.12.2010 um 01:49 schrieb Andreas Färber:

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

Workaround the following error:

qemu: hardware error: register_ioport_read: invalid opaque

I found out that this is a conflict with i8042 registering I/O port 0x0092 in pckbd.c, too. Not sure what the proper fix should look like - add some qdev property to ISAKBDState to disable the port?

Well, why does the PREP board have its own mapping there in the first place? It should be the same as a PC from a port pov, no?

Why does the i8042 controller have a System Control Port in the first place rather than the 'pc' machine? :)

The PReP spec v1.1 has a Special Port 0x0092 that includes two bits of significence - softreset and endian mode. So wherever the port is registered, the latter behavior is board-specific and does not match pckbd.c (A20 gate or HDD activity depending on bit numbering).

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line

A similar issue arises between PReP machines: The ioport currently does not allow using a different opaque for reads and writes to the same address. So either we need to change ioport or create some inheritence/override mechanism for port behavior.

Hmm - sounds to me like that register simply doesn't belong there then, so a split would be the correct solution. The alternative would be to have the keyboard controller create a bus that those bits send signals to. An x86 system could then implement its A20 gate in x86 specific code while PREP could do its specific stuff.

Coincidentally there's a recent pckbd patch from Blue that resolves the conflict. Feel free to review. :)

Ah, sorry :). Still catching up. Just now finished to watch news of the last 1 1/2 weeks :).

Welcome back. Did they have to pay much? ;)

Quoted 3 lines
Quoted 1 line

Any thoughts on the read vs. write port issue? Do we need to register both ports in the base device and add hooks to the device state? Sounds problematic VMState-wise, just like some of the qemu_irq constructs in the ppc devices. (My prep_pci changes are still far from perfect, UniNorth has similar issues I noticed.)

Well, the general idea is that a single IO always gets routed to the same device. I don't fully understand why you need separate handlers there tbh. Mind to explain this?

In short: Inheritance.

The actual issue appears to be snip'ed above, it's about apparent subtle machine differences concerning non-standard register uses (here, "Motorola ... register" in -M prep vs. nothing in PReP 1.1 spec).

Andreas

#12 lore raw

Re: [Qemu-devel] [FYI 4/4] prep: Quickfix for ioport

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 29 lines · Andreas Färber

Am 04.01.2011 um 22:43 schrieb Alexander Graf:

Quoted 27 lines · Andreas Färber
Quoted 26 lines

Am 04.01.2011 um 21:57 schrieb Alexander Graf:

Quoted 23 lines · Andreas Färber
Quoted 21 lines

Am 27.12.2010 um 01:11 schrieb Alexander Graf:

Quoted 4 lines

Am 27.12.2010 um 00:28 schrieb Andreas Färber <[email protected]>:

Quoted 2 lines

Am 14.12.2010 um 01:49 schrieb Andreas Färber:

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

Workaround the following error:

qemu: hardware error: register_ioport_read: invalid opaque

I found out that this is a conflict with i8042 registering I/O port 0x0092 in pckbd.c, too. Not sure what the proper fix should look like - add some qdev property to ISAKBDState to disable the port?

Well, why does the PREP board have its own mapping there in the first place? It should be the same as a PC from a port pov, no?

Why does the i8042 controller have a System Control Port in the first place rather than the 'pc' machine? :)

The PReP spec v1.1 has a Special Port 0x0092 that includes two bits of significence - softreset and endian mode. So wherever the port is registered, the latter behavior is board-specific and does not match pckbd.c (A20 gate or HDD activity depending on bit numbering).

A similar issue arises between PReP machines: The ioport currently does not allow using a different opaque for reads and writes to the same address. So either we need to change ioport or create some inheritence/override mechanism for port behavior.

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Hmm - sounds to me like that register simply doesn't belong there then, so a split would be the correct solution. The alternative would be to have the keyboard controller create a bus that those bits send signals to. An x86 system could then implement its A20 gate in x86 specific code while PREP could do its specific stuff.

Coincidentally there's a recent pckbd patch from Blue that resolves the conflict. Feel free to review. :)

Ah, sorry :). Still catching up. Just now finished to watch news of the last 1 1/2 weeks :).

Welcome back. Did they have to pay much? ;)

The only one ending up paying was me to get in for the 27c3 ;).

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Any thoughts on the read vs. write port issue? Do we need to register both ports in the base device and add hooks to the device state? Sounds problematic VMState-wise, just like some of the qemu_irq constructs in the ppc devices. (My prep_pci changes are still far from perfect, UniNorth has similar issues I noticed.)

Well, the general idea is that a single IO always gets routed to the same device. I don't fully understand why you need separate handlers there tbh. Mind to explain this?

In short: Inheritance.

The actual issue appears to be snip'ed above, it's about apparent subtle machine differences concerning non-standard register uses (here, "Motorola ... register" in -M prep vs. nothing in PReP 1.1 spec).

Hrm. So the port belongs to machine specific code then and should only call helper functions for other generic bits, no?

Alex

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.16 (Darwin)

iEYEARECAAYFAk0jmOYACgkQq7Wi27wfN1Pp2ACdFf7aa8y/tNC7fx9Z4zFheNnU 1RQAnjGNJqAGhYNvEOKuNihLVJKsVeG9
=QdiF
-----END PGP SIGNATURE-----

#13 lore raw

Re: [Qemu-devel] [PATCH, RFC 3/4] prep: Fix duplicate ISA IDE IRQ

In reply to Andreas Färber

Am 14.12.2010 um 01:49 schrieb Andreas Färber:

Quoted 9 lines

Calling isa_ide_init() twice with the same IRQ 13 fails:

qemu: hardware error: isa irq 13 already assigned

Use a different IRQ (14) for the second one to avoid this.

The implied question behind "RFC" is, has this been a dormant bug in ppc_prep.c or would this need to be fixed at ISA level (allowing two devices to share the same IRQ) in isa-bus.c where the above error message is raised?

Andreas

Quoted 14 lines

---
hw/ppc_prep.c | 2 +-

1 files changed, 1 insertions(+), 1 deletions(-)
hw/ppc_prep.c +1 -1
index 3575dee..3073870 100644
@@ -76,7 +76,7 @@ qemu_log_mask(CPU_LOG_IOPORT, fmt, ## __VA_ARGS__)
 /* Constants for devices init */
 static const int ide_iobase[2] = { 0x1f0, 0x170 };
 static const int ide_iobase2[2] = { 0x3f6, 0x376 };
-static const int ide_irq[2] = { 13, 13 };
+static const int ide_irq[2] = { 13, 14 };
#14 lore raw

Re: [Qemu-devel] [PATCH, RFC 3/4] prep: Fix duplicate ISA IDE IRQ

Quoted 6 lines · Andreas Färber

Am 14.12.2010 um 01:49 schrieb Andreas Färber:

Quoted 4 lines

Calling isa_ide_init() twice with the same IRQ 13 fails:

qemu: hardware error: isa irq 13 already assigned

Quoted 7 lines
Quoted 5 lines

Use a different IRQ (14) for the second one to avoid this.

The implied question behind "RFC" is, has this been a dormant bug in ppc_prep.c or would this need to be fixed at ISA level (allowing two devices to share the same IRQ) in isa-bus.c where the above error message is raised?

That depends on the hardware. Usually ISA can't share IRQs. There are some exceptions though, where ISA controllers have some built in magic to enable sharing along identical devices. Not sure which case we're looking at here, but having them separate is certainly the safe choice.

Alex

#15 lore raw

Re: [Qemu-devel] [PATCH, RFC 3/4] prep: Fix duplicate ISA IDE IRQ

In reply to Andreas Färber
Quoted 5 lines · Andreas Färber

Calling isa_ide_init() twice with the same IRQ 13 fails:

qemu: hardware error: isa irq 13 already assigned

Use a different IRQ (14) for the second one to avoid this.

I am not sure it is actually a good idea. While it fixes the QEMU error, it breaks the kernel boot which waits for both IDE channels on IRQ 13. This causes an endless boot, so the machine never finishes to boot:

| ide0 at 0x1f0-0x1f7,0x3f6 on irq 13
| ide1 at 0x170-0x177,0x376 on irq 13 (shared with ide0)
| hda: max request size: 512KiB
| hda: 20971520 sectors (10737 MB) w/256KiB Cache, CHS=16383/255/63
| hda: cache flushes supported
| hda: hda1 hda2
| ide-cd: cmd 0x5a timed out
| hdc: lost interrupt
| ide-cd: cmd 0x5a timed out
| hdc: lost interrupt
| hdc: ATAPI 4X CD-ROM drive, 512kB Cache
| Uniform CD-ROM driver Revision: 3.20
| hdc: lost interrupt
| ide-cd: cmd 0x3 timed out
| hdc: lost interrupt
| ide-cd: cmd 0x3 timed out
| hdc: lost interrupt
| hdc: lost interrupt
| ...

As a temporary workaround it seems better to disable the second IDE channel, this solution works.

Signature · 2 lines
Aurelien Jarno	                        GPG: 1024D/F1BCDB73
[email protected]                 http://www.aurel32.net
#16 lore raw

[Qemu-devel] Re: [PATCH 1/4] prep: Remove bogus BIOS size check

In reply to Andreas Färber
Quoted 16 lines · Andreas Färber

r3480 added this check to account for the entry vector 0xfff00100 to be available for CPUs that need it. Today however, the NIP is not yet initialized at this point (zero), so the check always triggers.

Cc Hervé Poussineau <[email protected]>
Cc Alexander Graf <[email protected]>

---
hw/ppc_prep.c | 3 ---

1 files changed, 0 insertions(+), 3 deletions(-)
hw/ppc_prep.c +0 -0
index 1492266..6b22122 100644

hw/ppc_prep.c static void ppc_prep_init (ram_addr_t ram_size, · line 603

Quoted 7 lines
hw/ppc_prep.c +0 -3
@@ -600,9 +600,6 @@ static void ppc_prep_init (ram_addr_t ram_size,
    if (filename) {
        qemu_free(filename);
    }
-    if (env->nip < 0xFFF80000 && bios_size < 0x00100000) {
-        hw_error("PowerPC 601 / 620 / 970 need a 1MB BIOS\n");
-    }
 

The bios gets mapped to 0xfff00000, so it can at most be 0x100000 bytes long which is 1MB. The bogus part of the check is the first, the nip part.

Alex

#17 lore raw

[Qemu-devel] Re: [PATCH 1/4] prep: Remove bogus BIOS size check

Am 19.12.2010 um 10:52 schrieb Alexander Graf:

Quoted 13 lines · Andreas Färber
Quoted 12 lines

r3480 added this check to account for the entry vector 0xfff00100 to be available for CPUs that need it. Today however, the NIP is not yet initialized at this point (zero), so the check always triggers.

Cc Hervé Poussineau <[email protected]>
Cc Alexander Graf <[email protected]>

---
hw/ppc_prep.c | 3 ---

1 files changed, 0 insertions(+), 3 deletions(-)
Quoted 14 lines

hw/ppc_prep.c static void ppc_prep_init (ram_addr_t ram_size, · line 603

Quoted 12 lines
hw/ppc_prep.c +0 -3
index 1492266..6b22122 100644
@@ -600,9 +600,6 @@ static void ppc_prep_init (ram_addr_t ram_size,
   if (filename) {
       qemu_free(filename);
   }
-    if (env->nip < 0xFFF80000 && bios_size < 0x00100000) {
-        hw_error("PowerPC 601 / 620 / 970 need a 1MB BIOS\n");
-    }
 

The bios gets mapped to 0xfff00000, so it can at most be 0x100000 bytes long which is 1MB. The bogus part of the check is the first, the nip part.

If you look at 2/4, it is checked using BIOS_SIZE define (1024 * 1024) further down in the more correct place. :)

At this time - 1/4 - the BIOS gets mapped to 0xffffffff minus BIOS size. If the entry is at 0xfffffffc, the BIOS is allowed to be smaller than 1 MB. So marking BIOS sizes smaller as 1 MB as error would break both the OHW ppc_rom.bin and the IBM 40p BIOS. Therefore it must simply go away.

Unless you happen to know a better place for this NIP-dependent check, that is. I believe the reset handling was changed at some point?

Andreas

#18 lore raw

[Qemu-devel] Re: [PATCH 1/4] prep: Remove bogus BIOS size check

Quoted 30 lines · Andreas Färber

Am 19.12.2010 um 10:52 schrieb Alexander Graf:

Quoted 13 lines · Andreas Färber
Quoted 12 lines

r3480 added this check to account for the entry vector 0xfff00100 to be available for CPUs that need it. Today however, the NIP is not yet initialized at this point (zero), so the check always triggers.

Cc Hervé Poussineau <[email protected]>
Cc Alexander Graf <[email protected]>

---
hw/ppc_prep.c | 3 ---

1 files changed, 0 insertions(+), 3 deletions(-)
Quoted 14 lines

hw/ppc_prep.c static void ppc_prep_init (ram_addr_t ram_size, · line 603

Quoted 12 lines
hw/ppc_prep.c +0 -3
index 1492266..6b22122 100644
@@ -600,9 +600,6 @@ static void ppc_prep_init (ram_addr_t ram_size,
  if (filename) {
      qemu_free(filename);
  }
-    if (env->nip < 0xFFF80000 && bios_size < 0x00100000) {
-        hw_error("PowerPC 601 / 620 / 970 need a 1MB BIOS\n");
-    }
 

The bios gets mapped to 0xfff00000, so it can at most be 0x100000 bytes long which is 1MB. The bogus part of the check is the first, the nip part.

Quoted 5 lines

If you look at 2/4, it is checked using BIOS_SIZE define (1024 * 1024) further down in the more correct place. :)

At this time - 1/4 - the BIOS gets mapped to 0xffffffff minus BIOS size. If the entry is at 0xfffffffc, the BIOS is allowed to be smaller than 1 MB. So marking BIOS sizes smaller as 1 MB as error would break both the OHW ppc_rom.bin and the IBM 40p BIOS. Therefore it must simply go away.

Unless you happen to know a better place for this NIP-dependent check, that is. I believe the reset handling was changed at some point?

Hrm, maybe. The reset vector is board dependent and different CPU typed recommend different default values. So I agree - just get rid of this check.

Alex

#19 lore raw
In reply to Andreas Färber
Quoted 23 lines · Andreas Färber

Hello,

Based on an earlier attempt of mine to make OpenBIOS work with -M prep, with kind support from Hervé Poussineau here's an initial stab at fixing the long-broken PReP emulation and preparing migration from abandoned OpenHack'Ware to OpenBIOS as default FOSS firmware.

In particular a number of hw_error()s are resolved, so that the BIOS can be entered at all. It is not yet working in terms of serial and VGA support etc.

This series is also available from:

git://repo.or.cz/qemu/afaerber.git prep-queue

Some more work-in-progress for the curious is on my prep branch [2]. The corresponding work-in-progress OpenBIOS changes are at [3].

Unfortunately the prep machine is lacking documentation what exactly it tries to emulate. The plan thus is to merge emulation of a second, real IBM 40p machine based on Hervé's work at [1], for use with original binary firmware.

Quoted 5 lines

Also upcoming are new ppc_chrp machines, forked from ppc_newworld, emulating the 970-based IBM JS20 (using Apple U3) [4] and possibly the POWER5-based IntelliStation 285. These depend on the ongoing ppc64 port of OpenBIOS to be completed though. This relates to PReP in that the machine IDs will need to be coordinated.

Does this series actually make anything work, or is it just a first step set to get your development rolling? IOW, would users benefit from having the patches upstream yet?

Alex

#20 lore raw

Am 19.12.2010 um 10:54 schrieb Alexander Graf:

Quoted 25 lines · Andreas Färber
Quoted 24 lines

Hello,

Based on an earlier attempt of mine to make OpenBIOS work with -M prep, with kind support from Hervé Poussineau here's an initial stab at fixing the long-broken PReP emulation and preparing migration from abandoned OpenHack'Ware to OpenBIOS as default FOSS firmware.

In particular a number of hw_error()s are resolved, so that the BIOS can be entered at all. It is not yet working in terms of serial and VGA support etc.

This series is also available from:

git://repo.or.cz/qemu/afaerber.git prep-queue

Some more work-in-progress for the curious is on my prep branch [2]. The corresponding work-in-progress OpenBIOS changes are at [3].

Unfortunately the prep machine is lacking documentation what exactly it tries to emulate. The plan thus is to merge emulation of a second, real IBM 40p machine based on Hervé's work at [1], for use with original binary firmware.

Quoted 7 lines
Quoted 5 lines

Also upcoming are new ppc_chrp machines, forked from ppc_newworld, emulating the 970-based IBM JS20 (using Apple U3) [4] and possibly the POWER5-based IntelliStation 285. These depend on the ongoing ppc64 port of OpenBIOS to be completed though. This relates to PReP in that the machine IDs will need to be coordinated.

Does this series actually make anything work, or is it just a first step set to get your development rolling? IOW, would users benefit from having the patches upstream yet?

As indicated above, it lets you enter a BIOS, which is a user-visible improvement. User-supplied binary firmware works with 1 + 3-4, ELF firmware with 1-4. Patch 3 depends on review comments. Patch 4 was just an FYI for testing the preceding patches and still needs investigation.

For OpenBIOS to work, we need fw_cfg in ppc_prep.c and, independently, patches to OpenBIOS. Unless of course we want to use another firmware like OFW from the start. The main interest in PReP nowadays will be proprietary firmware anyway. I thought Rob (cc'ed) had PReP Linux kernel patches for QEMU at some point but I couldn't locate them in the Aboriginal Linux tree.

I am planning to queue reviewed patches for upstream on a new branch. Then we can either pull them into your ppc queue or directly into master.

Andreas

#21 lore raw
Quoted 33 lines · Andreas Färber

Am 19.12.2010 um 10:54 schrieb Alexander Graf:

Quoted 31 lines · Andreas Färber
Quoted 29 lines

Hello,

Based on an earlier attempt of mine to make OpenBIOS work with -M prep, with kind support from Hervé Poussineau here's an initial stab at fixing the long-broken PReP emulation and preparing migration from abandoned OpenHack'Ware to OpenBIOS as default FOSS firmware.

In particular a number of hw_error()s are resolved, so that the BIOS can be entered at all. It is not yet working in terms of serial and VGA support etc.

This series is also available from:

git://repo.or.cz/qemu/afaerber.git prep-queue

Some more work-in-progress for the curious is on my prep branch [2]. The corresponding work-in-progress OpenBIOS changes are at [3].

Unfortunately the prep machine is lacking documentation what exactly it tries to emulate. The plan thus is to merge emulation of a second, real IBM 40p machine based on Hervé's work at [1], for use with original binary firmware.

Also upcoming are new ppc_chrp machines, forked from ppc_newworld, emulating the 970-based IBM JS20 (using Apple U3) [4] and possibly the POWER5-based IntelliStation 285. These depend on the ongoing ppc64 port of OpenBIOS to be completed though. This relates to PReP in that the machine IDs will need to be coordinated.

Quoted 5 lines
Quoted 1 line

Does this series actually make anything work, or is it just a first step set to get your development rolling? IOW, would users benefit from having the patches upstream yet?

As indicated above, it lets you enter a BIOS, which is a user-visible improvement. User-supplied binary firmware works with 1 + 3-4, ELF firmware with 1-4. Patch 3 depends on review comments. Patch 4 was just an FYI for testing the preceding patches and still needs investigation.

For OpenBIOS to work, we need fw_cfg in ppc_prep.c and, independently, patches to OpenBIOS. Unless of course we want to use another firmware like OFW from the start. The main interest in PReP nowadays will be proprietary firmware anyway. I thought Rob (cc'ed) had PReP Linux kernel patches for QEMU at some point but I couldn't locate them in the Aboriginal Linux tree.

I'm not sure on the copyright problems we might run into when delivering binary firmware. So we certainly do need some open source firmware solution for prep to at least have Linux running. For other guests, I don't see a reason why users shouldn't try to fetch a real firmware blob separately :).

Quoted 2 lines

I am planning to queue reviewed patches for upstream on a new branch. Then we can either pull them into your ppc queue or directly into master.

I'd say let's wait until we get to a point where we can boot any (really, any) guest. As soon as we're there, let's pull the whole thing in to qemu. Until then, I'm sure little enough code changes upstream that it's fine to keep it in a separate tree.

If it gets too cumbersome to keep it separate, just nag me and I'll reconsider :).

Alex

#22 lore raw

Am 19.12.2010 um 16:34 schrieb Alexander Graf:

Quoted 35 lines · Andreas Färber
Quoted 34 lines

Am 19.12.2010 um 10:54 schrieb Alexander Graf:

Quoted 31 lines · Andreas Färber
Quoted 29 lines

Hello,

Based on an earlier attempt of mine to make OpenBIOS work with -M prep, with kind support from Hervé Poussineau here's an initial stab at fixing the long-broken PReP emulation and preparing migration from abandoned OpenHack'Ware to OpenBIOS as default FOSS firmware.

In particular a number of hw_error()s are resolved, so that the BIOS can be entered at all. It is not yet working in terms of serial and VGA support etc.

This series is also available from:

git://repo.or.cz/qemu/afaerber.git prep-queue

Some more work-in-progress for the curious is on my prep branch [2]. The corresponding work-in-progress OpenBIOS changes are at [3].

Unfortunately the prep machine is lacking documentation what exactly it tries to emulate. The plan thus is to merge emulation of a second, real IBM 40p machine based on Hervé's work at [1], for use with original binary firmware.

Also upcoming are new ppc_chrp machines, forked from ppc_newworld, emulating the 970-based IBM JS20 (using Apple U3) [4] and possibly the POWER5-based IntelliStation 285. These depend on the ongoing ppc64 port of OpenBIOS to be completed though. This relates to PReP in that the machine IDs will need to be coordinated.

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

Does this series actually make anything work, or is it just a first step set to get your development rolling? IOW, would users benefit from having the patches upstream yet?

As indicated above, it lets you enter a BIOS, which is a user-visible improvement. User-supplied binary firmware works with 1 + 3-4, ELF firmware with 1-4. Patch 3 depends on review comments. Patch 4 was just an FYI for testing the preceding patches and still needs investigation.

For OpenBIOS to work, we need fw_cfg in ppc_prep.c and, independently, patches to OpenBIOS. Unless of course we want to use another firmware like OFW from the start. The main interest in PReP nowadays will be proprietary firmware anyway. I thought Rob (cc'ed) had PReP Linux kernel patches for QEMU at some point but I couldn't locate them in the Aboriginal Linux tree.

I'm not sure on the copyright problems we might run into when delivering binary firmware.

No one suggested shipping proprietary firmware.

I was advocating enabling users to use the available firmware rather than holding fixes back just because there is no fully-working FOSS alternative firmware yet.

Quoted 1 line

So we certainly do need some open source firmware solution for prep to at least have Linux running. For other guests, I don't see a reason why users shouldn't try to fetch a real firmware blob separately :).

We're not shipping any firmware for ppcemb either, so that argument seems moot. OpenBIOS, SeaBIOS and ZIPL are the only ones currently. Feel free to supply additional blobs for U-Boot etc.

Recent vanilla Linux kernels wouldn't run on PReP. So what Linux do you want to run using open source firmware?
I certainly do not intend to write firmware for the upcoming 40p machine. If Linux runs on real 40p hardware then it should run with real firmware under emulation, too. QEMU is an emulation project, not a Linux testing framework.

Andreas

#23 lore raw
Quoted 41 lines · Andreas Färber

Am 19.12.2010 um 16:34 schrieb Alexander Graf:

Quoted 39 lines · Andreas Färber
Quoted 38 lines

Am 19.12.2010 um 10:54 schrieb Alexander Graf:

Quoted 25 lines · Andreas Färber
Quoted 24 lines

Hello,

Based on an earlier attempt of mine to make OpenBIOS work with -M prep, with kind support from Hervé Poussineau here's an initial stab at fixing the long-broken PReP emulation and preparing migration from abandoned OpenHack'Ware to OpenBIOS as default FOSS firmware.

In particular a number of hw_error()s are resolved, so that the BIOS can be entered at all. It is not yet working in terms of serial and VGA support etc.

This series is also available from:

git://repo.or.cz/qemu/afaerber.git prep-queue

Some more work-in-progress for the curious is on my prep branch [2]. The corresponding work-in-progress OpenBIOS changes are at [3].

Unfortunately the prep machine is lacking documentation what exactly it tries to emulate. The plan thus is to merge emulation of a second, real IBM 40p machine based on Hervé's work at [1], for use with original binary firmware.

Quoted 7 lines
Quoted 5 lines

Also upcoming are new ppc_chrp machines, forked from ppc_newworld, emulating the 970-based IBM JS20 (using Apple U3) [4] and possibly the POWER5-based IntelliStation 285. These depend on the ongoing ppc64 port of OpenBIOS to be completed though. This relates to PReP in that the machine IDs will need to be coordinated.

Does this series actually make anything work, or is it just a first step set to get your development rolling? IOW, would users benefit from having the patches upstream yet?

As indicated above, it lets you enter a BIOS, which is a user-visible improvement. User-supplied binary firmware works with 1 + 3-4, ELF firmware with 1-4. Patch 3 depends on review comments. Patch 4 was just an FYI for testing the preceding patches and still needs investigation.

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

For OpenBIOS to work, we need fw_cfg in ppc_prep.c and, independently, patches to OpenBIOS. Unless of course we want to use another firmware like OFW from the start. The main interest in PReP nowadays will be proprietary firmware anyway. I thought Rob (cc'ed) had PReP Linux kernel patches for QEMU at some point but I couldn't locate them in the Aboriginal Linux tree.

I'm not sure on the copyright problems we might run into when delivering binary firmware.

No one suggested shipping proprietary firmware.

I was advocating enabling users to use the available firmware rather than holding fixes back just because there is no fully-working FOSS alternative firmware yet.

Hrm, I only partially agree. If you ship a target in qemu that people can't test out of the box, it won't receive testing from contributers. I doubt that RH people will go in and download proprietary firmware just to check that prep didn't break. I do hope however, that they test targets that "just work".

I have this very issue with s390. The only host to run (and compile) this on is an s390. And few people have those. So it breaks from time to time.

Since prep would at least get built for everyone, there's less of an issue, yes.

Quoted 4 lines
Quoted 2 lines

So we certainly do need some open source firmware solution for prep to at least have Linux running. For other guests, I don't see a reason why users shouldn't try to fetch a real firmware blob separately :).

We're not shipping any firmware for ppcemb either, so that argument seems moot. OpenBIOS, SeaBIOS and ZIPL are the only ones currently. Feel free to supply additional blobs for U-Boot etc.

IIUC you don't need u-boot for the embedded targets. You just pass in a kernel and the rest is magic.

Quoted 2 lines

Recent vanilla Linux kernels wouldn't run on PReP. So what Linux do you want to run using open source firmware?
I certainly do not intend to write firmware for the upcoming 40p machine. If Linux runs on real 40p hardware then it should run with real firmware under emulation, too. QEMU is an emulation project, not a Linux testing framework.

I completely agree. Linux is usually easy because it's fully open source and supports a lot of targets. If you feel like running NetBSD or Haiku instead, feel free to do so.

I'd even be willing to say that running any OS with a proprietary firmware blob is enough to pull stuff in. And really, I mean _any_ OS. I just really want to see some value for users, so in case the whole system just doesn't work at all, we can rather apply a big bunch of removal commits instead of fixes that won't end up in anything working either.

Having said that, I have faith in your skills to get this working. So I assume you'll have something that meets the "something runs" criteria in at most a couple of weeks. Shouldn't be too bad, no? :)

Alex

#24 lore raw

Am 20.12.2010 um 10:04 schrieb Alexander Graf:

Quoted 64 lines · Andreas Färber
Quoted 42 lines

Am 19.12.2010 um 16:34 schrieb Alexander Graf:

Quoted 39 lines · Andreas Färber
Quoted 38 lines

Am 19.12.2010 um 10:54 schrieb Alexander Graf:

Quoted 25 lines · Andreas Färber
Quoted 24 lines

Hello,

Based on an earlier attempt of mine to make OpenBIOS work with -M prep, with kind support from Hervé Poussineau here's an initial stab at fixing the long-broken PReP emulation and preparing migration from abandoned OpenHack'Ware to OpenBIOS as default FOSS firmware.

In particular a number of hw_error()s are resolved, so that the BIOS can be entered at all. It is not yet working in terms of serial and VGA support etc.

This series is also available from:

git://repo.or.cz/qemu/afaerber.git prep-queue

Some more work-in-progress for the curious is on my prep branch [2]. The corresponding work-in-progress OpenBIOS changes are at [3].

Unfortunately the prep machine is lacking documentation what exactly it tries to emulate. The plan thus is to merge emulation of a second, real IBM 40p machine based on Hervé's work at [1], for use with original binary firmware.

Quoted 7 lines
Quoted 5 lines

Also upcoming are new ppc_chrp machines, forked from ppc_newworld, emulating the 970-based IBM JS20 (using Apple U3) [4] and possibly the POWER5-based IntelliStation 285. These depend on the ongoing ppc64 port of OpenBIOS to be completed though. This relates to PReP in that the machine IDs will need to be coordinated.

Does this series actually make anything work, or is it just a first step set to get your development rolling? IOW, would users benefit from having the patches upstream yet?

As indicated above, it lets you enter a BIOS, which is a user-visible improvement. User-supplied binary firmware works with 1 + 3-4, ELF firmware with 1-4. Patch 3 depends on review comments. Patch 4 was just an FYI for testing the preceding patches and still needs investigation.

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

For OpenBIOS to work, we need fw_cfg in ppc_prep.c and, independently, patches to OpenBIOS. Unless of course we want to use another firmware like OFW from the start. The main interest in PReP nowadays will be proprietary firmware anyway. I thought Rob (cc'ed) had PReP Linux kernel patches for QEMU at some point but I couldn't locate them in the Aboriginal Linux tree.

I'm not sure on the copyright problems we might run into when delivering binary firmware.

No one suggested shipping proprietary firmware.

I was advocating enabling users to use the available firmware rather than holding fixes back just because there is no fully-working FOSS alternative firmware yet.

Hrm, I only partially agree. If you ship a target in qemu that people can't test out of the box, it won't receive testing from contributers. I doubt that RH people will go in and download proprietary firmware just to check that prep didn't break. I do hope however, that they test targets that "just work".

I have this very issue with s390. The only host to run (and compile) this on is an s390. And few people have those. So it breaks from time to time.

Since prep would at least get built for everyone, there's less of an issue, yes.

Quoted 4 lines
Quoted 2 lines

So we certainly do need some open source firmware solution for prep to at least have Linux running. For other guests, I don't see a reason why users shouldn't try to fetch a real firmware blob separately :).

We're not shipping any firmware for ppcemb either, so that argument seems moot. OpenBIOS, SeaBIOS and ZIPL are the only ones currently. Feel free to supply additional blobs for U-Boot etc.

IIUC you don't need u-boot for the embedded targets. You just pass in a kernel and the rest is magic.

Quoted 8 lines
Quoted 2 lines

Recent vanilla Linux kernels wouldn't run on PReP. So what Linux do you want to run using open source firmware?
I certainly do not intend to write firmware for the upcoming 40p machine. If Linux runs on real 40p hardware then it should run with real firmware under emulation, too. QEMU is an emulation project, not a Linux testing framework.

I completely agree. Linux is usually easy because it's fully open source and supports a lot of targets. If you feel like running NetBSD or Haiku instead, feel free to do so.

I'd even be willing to say that running any OS with a proprietary firmware blob is enough to pull stuff in. And really, I mean _any_ OS. I just really want to see some value for users, so in case the whole system just doesn't work at all, we can rather apply a big bunch of removal commits instead of fixes that won't end up in anything working either.

Having said that, I have faith in your skills to get this working. So I assume you'll have something that meets the "something runs" criteria in at most a couple of weeks. Shouldn't be too bad, no? :)

Listen, I won't spend a couple of weeks on a firmware that I don't need just because you want me to.
I can't work on QEMU all day nor am I getting paid for it, so I'd rather spend my time on getting ppc/ppc64 Mac emulation working for my needs! :)

My interest in PReP is of historical nature only - it would be 'cool' to see BeOS/ppc emulated (and - if feasible - extend Haiku/ppc to run on it, too).

The three QEMU PReP projects we're talking about here - 'prep', '40p' and BeBox share a common core like some memory-mapped registers but use different devices and different firmware. The IBM 40p works with a binary firmware - got it to show some graphics on OpenSolaris/amd64 host yesterday (hinting towards endianness issues on Darwin/ppc64 host). The BeBox BootROM however uses a custom format with Be-specific headers and some PE stuff as it seems [1]. Writing firmware for the 'prep' machine buys us nothing there... Fixing it is not even strictly needed, but it seems a good deed while we're at it.

Andreas

[1] http://www.bebox.nu/tech.php?s=tech/bootROM

#25 lore raw
Quoted 69 lines · Andreas Färber

Am 20.12.2010 um 10:04 schrieb Alexander Graf:

Quoted 67 lines · Andreas Färber
Quoted 42 lines

Am 19.12.2010 um 16:34 schrieb Alexander Graf:

Quoted 39 lines · Andreas Färber
Quoted 38 lines

Am 19.12.2010 um 10:54 schrieb Alexander Graf:

Quoted 25 lines · Andreas Färber
Quoted 24 lines

Hello,

Based on an earlier attempt of mine to make OpenBIOS work with -M prep, with kind support from Hervé Poussineau here's an initial stab at fixing the long-broken PReP emulation and preparing migration from abandoned OpenHack'Ware to OpenBIOS as default FOSS firmware.

In particular a number of hw_error()s are resolved, so that the BIOS can be entered at all. It is not yet working in terms of serial and VGA support etc.

This series is also available from:

git://repo.or.cz/qemu/afaerber.git prep-queue

Some more work-in-progress for the curious is on my prep branch [2]. The corresponding work-in-progress OpenBIOS changes are at [3].

Unfortunately the prep machine is lacking documentation what exactly it tries to emulate. The plan thus is to merge emulation of a second, real IBM 40p machine based on Hervé's work at [1], for use with original binary firmware.

Quoted 7 lines
Quoted 5 lines

Also upcoming are new ppc_chrp machines, forked from ppc_newworld, emulating the 970-based IBM JS20 (using Apple U3) [4] and possibly the POWER5-based IntelliStation 285. These depend on the ongoing ppc64 port of OpenBIOS to be completed though. This relates to PReP in that the machine IDs will need to be coordinated.

Does this series actually make anything work, or is it just a first step set to get your development rolling? IOW, would users benefit from having the patches upstream yet?

As indicated above, it lets you enter a BIOS, which is a user-visible improvement. User-supplied binary firmware works with 1 + 3-4, ELF firmware with 1-4. Patch 3 depends on review comments. Patch 4 was just an FYI for testing the preceding patches and still needs investigation.

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

For OpenBIOS to work, we need fw_cfg in ppc_prep.c and, independently, patches to OpenBIOS. Unless of course we want to use another firmware like OFW from the start. The main interest in PReP nowadays will be proprietary firmware anyway. I thought Rob (cc'ed) had PReP Linux kernel patches for QEMU at some point but I couldn't locate them in the Aboriginal Linux tree.

I'm not sure on the copyright problems we might run into when delivering binary firmware.

No one suggested shipping proprietary firmware.

I was advocating enabling users to use the available firmware rather than holding fixes back just because there is no fully-working FOSS alternative firmware yet.

Hrm, I only partially agree. If you ship a target in qemu that people can't test out of the box, it won't receive testing from contributers. I doubt that RH people will go in and download proprietary firmware just to check that prep didn't break. I do hope however, that they test targets that "just work".

I have this very issue with s390. The only host to run (and compile) this on is an s390. And few people have those. So it breaks from time to time.

Since prep would at least get built for everyone, there's less of an issue, yes.

Quoted 4 lines
Quoted 2 lines

So we certainly do need some open source firmware solution for prep to at least have Linux running. For other guests, I don't see a reason why users shouldn't try to fetch a real firmware blob separately :).

We're not shipping any firmware for ppcemb either, so that argument seems moot. OpenBIOS, SeaBIOS and ZIPL are the only ones currently. Feel free to supply additional blobs for U-Boot etc.

IIUC you don't need u-boot for the embedded targets. You just pass in a kernel and the rest is magic.

Quoted 2 lines

Recent vanilla Linux kernels wouldn't run on PReP. So what Linux do you want to run using open source firmware?
I certainly do not intend to write firmware for the upcoming 40p machine. If Linux runs on real 40p hardware then it should run with real firmware under emulation, too. QEMU is an emulation project, not a Linux testing framework.

Quoted 8 lines
Quoted 5 lines

I completely agree. Linux is usually easy because it's fully open source and supports a lot of targets. If you feel like running NetBSD or Haiku instead, feel free to do so.

I'd even be willing to say that running any OS with a proprietary firmware blob is enough to pull stuff in. And really, I mean _any_ OS. I just really want to see some value for users, so in case the whole system just doesn't work at all, we can rather apply a big bunch of removal commits instead of fixes that won't end up in anything working either.

Having said that, I have faith in your skills to get this working. So I assume you'll have something that meets the "something runs" criteria in at most a couple of weeks. Shouldn't be too bad, no? :)

Listen, I won't spend a couple of weeks on a firmware that I don't need just because you want me to.
I can't work on QEMU all day nor am I getting paid for it, so I'd rather spend my time on getting ppc/ppc64 Mac emulation working for my needs! :)

Yup. I thought you were the incredible Hulk and would manage to get everything working nevertheless :). No, seriously - is it really too much work left to do? The target did work at one point in time already, right?

Quoted 2 lines

My interest in PReP is of historical nature only - it would be 'cool' to see BeOS/ppc emulated (and - if feasible - extend Haiku/ppc to run on it, too).

I fully agree!

Quoted 2 lines

The three QEMU PReP projects we're talking about here - 'prep', '40p' and BeBox share a common core like some memory-mapped registers but use different devices and different firmware. The IBM 40p works with a binary firmware - got it to show some graphics on OpenSolaris/amd64 host yesterday (hinting towards endianness issues on Darwin/ppc64 host). The BeBox BootROM however uses a custom format with Be-specific headers and some PE stuff as it seems [1]. Writing firmware for the 'prep' machine buys us nothing there... Fixing it is not even strictly needed, but it seems a good deed while we're at it.

I see. Well, don't do it then. Just get something proprietary running and be good. I merely wanted to save you from the troubles I go through with S/390 where people simply don't test that target since they can't run it...

Alex

#26 lore raw

Am 21.12.2010 um 00:07 schrieb Alexander Graf:

Quoted 75 lines · Andreas Färber
Quoted 74 lines

Am 20.12.2010 um 10:04 schrieb Alexander Graf:

Quoted 71 lines · Andreas Färber
Quoted 44 lines

Am 19.12.2010 um 16:34 schrieb Alexander Graf:

Quoted 41 lines · Andreas Färber
Quoted 40 lines

Am 19.12.2010 um 10:54 schrieb Alexander Graf:

Quoted 25 lines · Andreas Färber
Quoted 24 lines

Hello,

Based on an earlier attempt of mine to make OpenBIOS work with -M prep, with kind support from Hervé Poussineau here's an initial stab at fixing the long-broken PReP emulation and preparing migration from abandoned OpenHack'Ware to OpenBIOS as default FOSS firmware.

In particular a number of hw_error()s are resolved, so that the BIOS can be entered at all. It is not yet working in terms of serial and VGA support etc.

This series is also available from:

git://repo.or.cz/qemu/afaerber.git prep-queue

Some more work-in-progress for the curious is on my prep branch [2]. The corresponding work-in-progress OpenBIOS changes are at [3].

Unfortunately the prep machine is lacking documentation what exactly it tries to emulate. The plan thus is to merge emulation of a second, real IBM 40p machine based on Hervé's work at [1], for use with original binary firmware.

Quoted 7 lines
Quoted 5 lines

Also upcoming are new ppc_chrp machines, forked from ppc_newworld, emulating the 970-based IBM JS20 (using Apple U3) [4] and possibly the POWER5-based IntelliStation 285. These depend on the ongoing ppc64 port of OpenBIOS to be completed though. This relates to PReP in that the machine IDs will need to be coordinated.

Does this series actually make anything work, or is it just a first step set to get your development rolling? IOW, would users benefit from having the patches upstream yet?

As indicated above, it lets you enter a BIOS, which is a user-visible improvement. User-supplied binary firmware works with 1
+ 3-4, ELF firmware with 1-4. Patch 3 depends on review
comments. Patch 4 was just an FYI for testing the preceding patches and still needs investigation.

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

For OpenBIOS to work, we need fw_cfg in ppc_prep.c and, independently, patches to OpenBIOS. Unless of course we want to use another firmware like OFW from the start. The main interest in PReP nowadays will be proprietary firmware anyway. I thought Rob (cc'ed) had PReP Linux kernel patches for QEMU at some point but I couldn't locate them in the Aboriginal Linux tree.

I'm not sure on the copyright problems we might run into when delivering binary firmware.

No one suggested shipping proprietary firmware.

I was advocating enabling users to use the available firmware rather than holding fixes back just because there is no fully-working FOSS alternative firmware yet.

Hrm, I only partially agree. If you ship a target in qemu that people can't test out of the box, it won't receive testing from contributers. I doubt that RH people will go in and download proprietary firmware just to check that prep didn't break. I do hope however, that they test targets that "just work".

I have this very issue with s390. The only host to run (and compile) this on is an s390. And few people have those. So it breaks from time to time.

Since prep would at least get built for everyone, there's less of an issue, yes.

Quoted 4 lines
Quoted 2 lines

So we certainly do need some open source firmware solution for prep to at least have Linux running. For other guests, I don't see a reason why users shouldn't try to fetch a real firmware blob separately :).

We're not shipping any firmware for ppcemb either, so that argument seems moot. OpenBIOS, SeaBIOS and ZIPL are the only ones currently. Feel free to supply additional blobs for U-Boot etc.

IIUC you don't need u-boot for the embedded targets. You just pass in a kernel and the rest is magic.

Quoted 2 lines

Recent vanilla Linux kernels wouldn't run on PReP. So what Linux do you want to run using open source firmware?
I certainly do not intend to write firmware for the upcoming 40p machine. If Linux runs on real 40p hardware then it should run with real firmware under emulation, too. QEMU is an emulation project, not a Linux testing framework.

I completely agree. Linux is usually easy because it's fully open source and supports a lot of targets. If you feel like running NetBSD or Haiku instead, feel free to do so.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

I'd even be willing to say that running any OS with a proprietary firmware blob is enough to pull stuff in. And really, I mean _any_ OS. I just really want to see some value for users, so in case the whole system just doesn't work at all, we can rather apply a big bunch of removal commits instead of fixes that won't end up in anything working either.

Having said that, I have faith in your skills to get this working. So I assume you'll have something that meets the "something runs" criteria in at most a couple of weeks. Shouldn't be too bad, no? :)

Listen, I won't spend a couple of weeks on a firmware that I don't need just because you want me to.
I can't work on QEMU all day nor am I getting paid for it, so I'd rather spend my time on getting ppc/ppc64 Mac emulation working for my needs! :)

[...] seriously - is it really too much work left to do? The target did work at one point in time already, right?

Not with OpenBIOS, no. It's a nightmare, since we don't even get serial output because PReP doesn't use ESCC or not in the locations it expects. This is hardcoded in the config file and thus not fw_cfg-dependent.

The switch to OpenBIOS really marked the beginning of my being able to use qemu-system-ppc. OpenHack'Ware never worked for me before. Supposedly patched Linux kernels loaded via -kernel, still searching for a working one though...

$ qemu-system-ppc -M prep -nographic
ERROR: BUG caught...
BIOS execution exception
nip=0x05800000 msr=0x00002000 dar=0x00000000 dsisr=0x00000000
Stopping execution
$ qemu-system-ppc -M prep -kernel .../vmlinuz-2.4.25 -nographic # http://www.olifantasia.com/qemu/
ERROR: BUG caught...
BIOS execution exception
nip=0x05800000 msr=0x00002000 dar=0x00000000 dsisr=0x00000000
Stopping execution
$ qemu-system-ppc -M prep -kernel .../vmlinuz-2.4.25 -append 'ide0=0x1f0,0x3f6,13 ide1=0x170,0x376,13 netdev=9,0x300,eth0 console=ttyS0 console=tty0 root=/dev/hda' -nographic
ERROR: BUG caught...
BIOS execution exception
nip=0x05800000 msr=0x00002000 dar=0x00000000 dsisr=0x00000000
Stopping execution
#27 lore raw
Quoted 100 lines · Andreas Färber

Am 21.12.2010 um 00:07 schrieb Alexander Graf:

Quoted 73 lines · Andreas Färber
Quoted 72 lines

Am 20.12.2010 um 10:04 schrieb Alexander Graf:

Quoted 69 lines · Andreas Färber
Quoted 42 lines

Am 19.12.2010 um 16:34 schrieb Alexander Graf:

Quoted 39 lines · Andreas Färber
Quoted 38 lines

Am 19.12.2010 um 10:54 schrieb Alexander Graf:

Quoted 25 lines · Andreas Färber
Quoted 24 lines

Hello,

Based on an earlier attempt of mine to make OpenBIOS work with -M prep, with kind support from Hervé Poussineau here's an initial stab at fixing the long-broken PReP emulation and preparing migration from abandoned OpenHack'Ware to OpenBIOS as default FOSS firmware.

In particular a number of hw_error()s are resolved, so that the BIOS can be entered at all. It is not yet working in terms of serial and VGA support etc.

This series is also available from:

git://repo.or.cz/qemu/afaerber.git prep-queue

Some more work-in-progress for the curious is on my prep branch [2]. The corresponding work-in-progress OpenBIOS changes are at [3].

Unfortunately the prep machine is lacking documentation what exactly it tries to emulate. The plan thus is to merge emulation of a second, real IBM 40p machine based on Hervé's work at [1], for use with original binary firmware.

Quoted 7 lines
Quoted 5 lines

Also upcoming are new ppc_chrp machines, forked from ppc_newworld, emulating the 970-based IBM JS20 (using Apple U3) [4] and possibly the POWER5-based IntelliStation 285. These depend on the ongoing ppc64 port of OpenBIOS to be completed though. This relates to PReP in that the machine IDs will need to be coordinated.

Does this series actually make anything work, or is it just a first step set to get your development rolling? IOW, would users benefit from having the patches upstream yet?

As indicated above, it lets you enter a BIOS, which is a user-visible improvement. User-supplied binary firmware works with 1 + 3-4, ELF firmware with 1-4. Patch 3 depends on review comments. Patch 4 was just an FYI for testing the preceding patches and still needs investigation.

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

For OpenBIOS to work, we need fw_cfg in ppc_prep.c and, independently, patches to OpenBIOS. Unless of course we want to use another firmware like OFW from the start. The main interest in PReP nowadays will be proprietary firmware anyway. I thought Rob (cc'ed) had PReP Linux kernel patches for QEMU at some point but I couldn't locate them in the Aboriginal Linux tree.

I'm not sure on the copyright problems we might run into when delivering binary firmware.

No one suggested shipping proprietary firmware.

I was advocating enabling users to use the available firmware rather than holding fixes back just because there is no fully-working FOSS alternative firmware yet.

Hrm, I only partially agree. If you ship a target in qemu that people can't test out of the box, it won't receive testing from contributers. I doubt that RH people will go in and download proprietary firmware just to check that prep didn't break. I do hope however, that they test targets that "just work".

I have this very issue with s390. The only host to run (and compile) this on is an s390. And few people have those. So it breaks from time to time.

Since prep would at least get built for everyone, there's less of an issue, yes.

Quoted 4 lines
Quoted 2 lines

So we certainly do need some open source firmware solution for prep to at least have Linux running. For other guests, I don't see a reason why users shouldn't try to fetch a real firmware blob separately :).

We're not shipping any firmware for ppcemb either, so that argument seems moot. OpenBIOS, SeaBIOS and ZIPL are the only ones currently. Feel free to supply additional blobs for U-Boot etc.

IIUC you don't need u-boot for the embedded targets. You just pass in a kernel and the rest is magic.

Quoted 2 lines

Recent vanilla Linux kernels wouldn't run on PReP. So what Linux do you want to run using open source firmware?
I certainly do not intend to write firmware for the upcoming 40p machine. If Linux runs on real 40p hardware then it should run with real firmware under emulation, too. QEMU is an emulation project, not a Linux testing framework.

I completely agree. Linux is usually easy because it's fully open source and supports a lot of targets. If you feel like running NetBSD or Haiku instead, feel free to do so.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

I'd even be willing to say that running any OS with a proprietary firmware blob is enough to pull stuff in. And really, I mean _any_ OS. I just really want to see some value for users, so in case the whole system just doesn't work at all, we can rather apply a big bunch of removal commits instead of fixes that won't end up in anything working either.

Having said that, I have faith in your skills to get this working. So I assume you'll have something that meets the "something runs" criteria in at most a couple of weeks. Shouldn't be too bad, no? :)

Listen, I won't spend a couple of weeks on a firmware that I don't need just because you want me to.
I can't work on QEMU all day nor am I getting paid for it, so I'd rather spend my time on getting ppc/ppc64 Mac emulation working for my needs! :)

[...] seriously - is it really too much work left to do? The target did work at one point in time already, right?

Not with OpenBIOS, no. It's a nightmare, since we don't even get serial output because PReP doesn't use ESCC or not in the locations it expects. This is hardcoded in the config file and thus not fw_cfg-dependent.

The switch to OpenBIOS really marked the beginning of my being able to use qemu-system-ppc. OpenHack'Ware never worked for me before. Supposedly patched Linux kernels loaded via -kernel, still searching for a working one though...

$ qemu-system-ppc -M prep -nographic
ERROR: BUG caught...
BIOS execution exception
nip=0x05800000 msr=0x00002000 dar=0x00000000 dsisr=0x00000000
Stopping execution
$ qemu-system-ppc -M prep -kernel .../vmlinuz-2.4.25 -nographic # http://www.olifantasia.com/qemu/
ERROR: BUG caught...
BIOS execution exception
nip=0x05800000 msr=0x00002000 dar=0x00000000 dsisr=0x00000000
Stopping execution
Quoted 6 lines
$ qemu-system-ppc -M prep -kernel .../vmlinuz-2.4.25 -append 'ide0=0x1f0,0x3f6,13 ide1=0x170,0x376,13 netdev=9,0x300,eth0 console=ttyS0 console=tty0 root=/dev/hda' -nographic
ERROR: BUG caught...
BIOS execution exception
nip=0x05800000 msr=0x00002000 dar=0x00000000 dsisr=0x00000000
Stopping execution

This one boots for me on qemu from SLES10SP3 (0.8.2):

http://www.oszoo.org/wiki/index.php/Debian_Etch_ppc_(PowerPC)_-_Qemu_Ready

Alex

#28 lore raw

Am 21.12.2010 um 01:46 schrieb Alexander Graf:

Quoted 23 lines · Andreas Färber
Quoted 15 lines

OpenHack'Ware never worked for me before. Supposedly patched Linux kernels loaded via -kernel, still searching for a working one though...

$ qemu-system-ppc -M prep -nographic
ERROR: BUG caught...
BIOS execution exception
nip=0x05800000 msr=0x00002000 dar=0x00000000 dsisr=0x00000000
Stopping execution
$ qemu-system-ppc -M prep -kernel .../vmlinuz-2.4.25 -nographic # http://www.olifantasia.com/qemu/
ERROR: BUG caught...
BIOS execution exception
nip=0x05800000 msr=0x00002000 dar=0x00000000 dsisr=0x00000000
Stopping execution
Quoted 6 lines
$ qemu-system-ppc -M prep -kernel .../vmlinuz-2.4.25 -append 'ide0=0x1f0,0x3f6,13 ide1=0x170,0x376,13 netdev=9,0x300,eth0 console=ttyS0 console=tty0 root=/dev/hda' -nographic
ERROR: BUG caught...
BIOS execution exception
nip=0x05800000 msr=0x00002000 dar=0x00000000 dsisr=0x00000000
Stopping execution
Quoted 3 lines

This one boots for me on qemu from SLES10SP3 (0.8.2):

http://www.oszoo.org/wiki/index.php/Debian_Etch_ppc_(PowerPC)_-_Qemu_Ready

$ qemu-system-ppc -m 256 -M prep -kernel .../zImage.prep -hda .../debian-ppc-qemu.qcow -nographic

shows same error as above.

Could this be due to the IRQ issue? The older kernel did expect IRQ 13 twice. I would expect it to get a little further before running into such an error...

Andreas

#29 lore raw
Quoted 27 lines · Andreas Färber

Am 21.12.2010 um 01:46 schrieb Alexander Graf:

Quoted 25 lines · Andreas Färber
Quoted 15 lines

OpenHack'Ware never worked for me before. Supposedly patched Linux kernels loaded via -kernel, still searching for a working one though...

$ qemu-system-ppc -M prep -nographic
ERROR: BUG caught...
BIOS execution exception
nip=0x05800000 msr=0x00002000 dar=0x00000000 dsisr=0x00000000
Stopping execution
$ qemu-system-ppc -M prep -kernel .../vmlinuz-2.4.25 -nographic # http://www.olifantasia.com/qemu/
ERROR: BUG caught...
BIOS execution exception
nip=0x05800000 msr=0x00002000 dar=0x00000000 dsisr=0x00000000
Stopping execution
Quoted 6 lines
$ qemu-system-ppc -M prep -kernel .../vmlinuz-2.4.25 -append 'ide0=0x1f0,0x3f6,13 ide1=0x170,0x376,13 netdev=9,0x300,eth0 console=ttyS0 console=tty0 root=/dev/hda' -nographic
ERROR: BUG caught...
BIOS execution exception
nip=0x05800000 msr=0x00002000 dar=0x00000000 dsisr=0x00000000
Stopping execution

This one boots for me on qemu from SLES10SP3 (0.8.2):

Quoted 8 lines
Quoted 1 line

http://www.oszoo.org/wiki/index.php/Debian_Etch_ppc_(PowerPC)_-_Qemu_Ready

$ qemu-system-ppc -m 256 -M prep -kernel .../zImage.prep -hda .../debian-ppc-qemu.qcow -nographic

shows same error as above.

Could this be due to the IRQ issue? The older kernel did expect IRQ 13 twice. I would expect it to get a little further before running into such an error...

Phew - I doubt it too. There have been quite some changes since it last worked I guess ;). First thing that sounds reasonable now would be to find a known good version and check when the interpreted code paths start to differ.

Alex

Quoted 1 line
#30 lore raw
In reply to Alexander Graf
Quoted 59 lines · On Monday 20 December 2010 03:04:38 Alexander Graf wrote:
Quoted 49 lines · Andreas Färber

Am 19.12.2010 um 16:34 schrieb Alexander Graf:

Quoted 48 lines · Andreas Färber
Quoted 46 lines

Am 19.12.2010 um 10:54 schrieb Alexander Graf:

Quoted 30 lines · Andreas Färber
Quoted 23 lines

Hello,

Based on an earlier attempt of mine to make OpenBIOS work with -M prep, with kind support from Hervé Poussineau here's an initial stab at fixing the long-broken PReP emulation and preparing migration from abandoned OpenHack'Ware to OpenBIOS as default FOSS firmware.

In particular a number of hw_error()s are resolved, so that the BIOS can be entered at all. It is not yet working in terms of serial and VGA support etc.

This series is also available from:

git://repo.or.cz/qemu/afaerber.git prep-queue

Some more work-in-progress for the curious is on my prep branch [2]. The corresponding work-in-progress OpenBIOS changes are at [3].

Unfortunately the prep machine is lacking documentation what exactly it tries to emulate. The plan thus is to merge emulation of a second, real IBM 40p machine based on Hervé's work at [1], for use with original binary firmware.

Quoted 5 lines

Also upcoming are new ppc_chrp machines, forked from ppc_newworld, emulating the 970-based IBM JS20 (using Apple U3) [4] and possibly the POWER5-based IntelliStation 285. These depend on the ongoing ppc64 port of OpenBIOS to be completed though. This relates to PReP in that the machine IDs will need to be coordinated.

Quoted 3 lines

Does this series actually make anything work, or is it just a first step set to get your development rolling? IOW, would users benefit from having the patches upstream yet?

As indicated above, it lets you enter a BIOS, which is a user-visible improvement. User-supplied binary firmware works with 1 + 3-4, ELF firmware with 1-4. Patch 3 depends on review comments. Patch 4 was just an FYI for testing the preceding patches and still needs investigation.

For OpenBIOS to work, we need fw_cfg in ppc_prep.c and, independently, patches to OpenBIOS. Unless of course we want to use another firmware like OFW from the start. The main interest in PReP nowadays will be proprietary firmware anyway. I thought Rob (cc'ed) had PReP Linux kernel patches for QEMU at some point but I couldn't locate them in the Aboriginal Linux tree.

Quoted 8 lines
Quoted 2 lines

I'm not sure on the copyright problems we might run into when delivering binary firmware.

No one suggested shipping proprietary firmware.

I was advocating enabling users to use the available firmware rather than holding fixes back just because there is no fully-working FOSS alternative firmware yet.

Quoted 5 lines

Hrm, I only partially agree. If you ship a target in qemu that people can't test out of the box, it won't receive testing from contributers. I doubt that RH people will go in and download proprietary firmware just to check that prep didn't break. I do hope however, that they test targets that "just work".

I have prebuilt binaries for a bunch of different targets at
http://landley.net/aboriginal/downloads/binaries (grab the system-image tarballs and run the "run-emulator.sh" or "dev-environment.sh" scripts out of them). (I'm actually working on a new release now, should be out by new year's.)

However, my goal is to provide native development environments (optionally calling out to the cross compiler on the host via distcc), so I switched from prep to mac99 a few years back because it was better supported and the architecture (compiler config) and userspace were identical. I can dig up prep again, but last I checked qemu -kernel didn't work and I was using a custom boot sector from Milton Miller to make it boot.

Quoted 2 lines

I have this very issue with s390. The only host to run (and compile) this on is an s390. And few people have those. So it breaks from time to time.

I have some pages bookmarked hinting how to get S390 Linux to boot under hercules, the same way I have instructions for running m68k under Aranym. But in general, if QEMU doesn't support it I have a hard time making myself care...

I have been know to test out of tree architecture patches, though. I only ever got sh4 to work by patching qemu, for example.

Rob

Signature · 2 lines
GPLv3: as worthy a successor as The Phantom Menace, as timely as Duke Nukem 
Forever, and as welcome as New Coke.
#31 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 79 lines · Rob Landley
Quoted 59 lines · On Monday 20 December 2010 03:04:38 Alexander Graf wrote:
Quoted 49 lines · Andreas Färber

Am 19.12.2010 um 16:34 schrieb Alexander Graf:

Quoted 48 lines · Andreas Färber
Quoted 46 lines

Am 19.12.2010 um 10:54 schrieb Alexander Graf:

Quoted 30 lines · Andreas Färber
Quoted 23 lines

Hello,

Based on an earlier attempt of mine to make OpenBIOS work with -M prep, with kind support from Hervé Poussineau here's an initial stab at fixing the long-broken PReP emulation and preparing migration from abandoned OpenHack'Ware to OpenBIOS as default FOSS firmware.

In particular a number of hw_error()s are resolved, so that the BIOS can be entered at all. It is not yet working in terms of serial and VGA support etc.

This series is also available from:

git://repo.or.cz/qemu/afaerber.git prep-queue

Some more work-in-progress for the curious is on my prep branch [2]. The corresponding work-in-progress OpenBIOS changes are at [3].

Unfortunately the prep machine is lacking documentation what exactly it tries to emulate. The plan thus is to merge emulation of a second, real IBM 40p machine based on Hervé's work at [1], for use with original binary firmware.

Quoted 5 lines

Also upcoming are new ppc_chrp machines, forked from ppc_newworld, emulating the 970-based IBM JS20 (using Apple U3) [4] and possibly the POWER5-based IntelliStation 285. These depend on the ongoing ppc64 port of OpenBIOS to be completed though. This relates to PReP in that the machine IDs will need to be coordinated.

Quoted 3 lines

Does this series actually make anything work, or is it just a first step set to get your development rolling? IOW, would users benefit from having the patches upstream yet?

As indicated above, it lets you enter a BIOS, which is a user-visible improvement. User-supplied binary firmware works with 1 + 3-4, ELF firmware with 1-4. Patch 3 depends on review comments. Patch 4 was just an FYI for testing the preceding patches and still needs investigation.

For OpenBIOS to work, we need fw_cfg in ppc_prep.c and, independently, patches to OpenBIOS. Unless of course we want to use another firmware like OFW from the start. The main interest in PReP nowadays will be proprietary firmware anyway. I thought Rob (cc'ed) had PReP Linux kernel patches for QEMU at some point but I couldn't locate them in the Aboriginal Linux tree.

Quoted 8 lines
Quoted 2 lines

I'm not sure on the copyright problems we might run into when delivering binary firmware.

No one suggested shipping proprietary firmware.

I was advocating enabling users to use the available firmware rather than holding fixes back just because there is no fully-working FOSS alternative firmware yet.

Quoted 5 lines

Hrm, I only partially agree. If you ship a target in qemu that people can't test out of the box, it won't receive testing from contributers. I doubt that RH people will go in and download proprietary firmware just to check that prep didn't break. I do hope however, that they test targets that "just work".

I have prebuilt binaries for a bunch of different targets at
http://landley.net/aboriginal/downloads/binaries (grab the system-image tarballs and run the "run-emulator.sh" or "dev-environment.sh" scripts out of them). (I'm actually working on a new release now, should be out by new year's.)

However, my goal is to provide native development environments (optionally calling out to the cross compiler on the host via distcc), so I switched from prep to mac99 a few years back because it was better supported and the architecture (compiler config) and userspace were identical. I can dig up prep again, but last I checked qemu -kernel didn't work and I was using a custom boot sector from Milton Miller to make it boot.

Quoted 7 lines
Quoted 2 lines

I have this very issue with s390. The only host to run (and compile) this on is an s390. And few people have those. So it breaks from time to time.

I have some pages bookmarked hinting how to get S390 Linux to boot under hercules, the same way I have instructions for running m68k under Aranym. But in general, if QEMU doesn't support it I have a hard time making myself care...

Few people jump through the hoops to run an emulator to compile and run qemu inside then when they only want to verify if their patches break something. The general philosophy I've seen is that the best we can expect is a "does ./configure && make break on your x86_64 box?".

Quoted 2 lines

I have been know to test out of tree architecture patches, though. I only ever got sh4 to work by patching qemu, for example.

I really dislike out-of-tree. As soon as an architecture runs publicly available code, it should get upstream, so others can benefit from it.

Alex

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.16 (Darwin)

iEUEARECAAYFAk0jilwACgkQq7Wi27wfN1P+ggCWKSPiYeZJnEEaSoFWsroBx7rL 5ACfVxQlUZAY+jZSRTvHRF+EKQh9W84=
=1JOQ
-----END PGP SIGNATURE-----

#32 lore raw
Quoted 9 lines · On Tuesday 04 January 2011 15:00:12 Alexander Graf wrote:
Quoted 8 lines
Quoted 3 lines

I have this very issue with s390. The only host to run (and compile) this on is an s390. And few people have those. So it breaks from time to time.

I have some pages bookmarked hinting how to get S390 Linux to boot under hercules, the same way I have instructions for running m68k under Aranym.
But in general, if QEMU doesn't support it I have a hard time making
myself care...

Quoted 4 lines

Few people jump through the hoops to run an emulator to compile and run qemu inside then when they only want to verify if their patches break something. The general philosophy I've seen is that the best we can expect is a "does ./configure && make break on your x86_64 box?".

If you're talking about running qemu on a non-x86 host, I don't do that. But if you're talking about running non-x86 code on qemu, my project's motto is "we cross compile so you don't have to". The thing is designed so you grab a tarball and go "./run-emulator.sh" to get a shell prompt in your emulated environment, with full development tools. If you go "./dev-environment.sh" instead you get a 2 gigabyte pesistent ext2 image mounted on /home so you can wget and build fairly large packages.

I've built the whole of Linux From Scratch 6.7 inside this this, on a couple different platforms. (Still debugging powerpc and mips, probably uClibc issues. Less spare time than I used to have...)

In theory I could do the same with qemu itself, just like any other software package. If you feed it just one architecture in a --target-list it shouldn't take _too_ long to build. But in practice running the result would be too slow to do more than boot to a shell prompt and demonstrate that it worked.

Quoted 4 lines
Quoted 2 lines

I have been know to test out of tree architecture patches, though. I only ever got sh4 to work by patching qemu, for example.

I really dislike out-of-tree.

I can't stand 'em, but I don't control what gets merged into most projects.

Quoted 2 lines

As soon as an architecture runs publicly
available code, it should get upstream, so others can benefit from it.

Entirely agreed. I've been waiting for any of the m68k improvements to QEMU (to run more than just coldfire) work to get merged for a long time. And I have a todo item to look at https://github.com/uli/qemu-s390 also...

Quoted 1 line

Alex

Rob

Signature · 2 lines
GPLv3: as worthy a successor as The Phantom Menace, as timely as Duke Nukem 
Forever, and as welcome as New Coke.
#33 lore raw
Quoted 23 lines · Rob Landley
Quoted 9 lines · On Tuesday 04 January 2011 15:00:12 Alexander Graf wrote:
Quoted 8 lines
Quoted 3 lines

I have this very issue with s390. The only host to run (and compile) this on is an s390. And few people have those. So it breaks from time to time.

I have some pages bookmarked hinting how to get S390 Linux to boot under hercules, the same way I have instructions for running m68k under Aranym. But in general, if QEMU doesn't support it I have a hard time making myself care...

Quoted 4 lines

Few people jump through the hoops to run an emulator to compile and run qemu inside then when they only want to verify if their patches break something. The general philosophy I've seen is that the best we can expect is a "does ./configure && make break on your x86_64 box?".

If you're talking about running qemu on a non-x86 host, I don't do that. But if you're talking about running non-x86 code on qemu, my project's motto is "we cross compile so you don't have to". The thing is designed so you grab a tarball and go "./run-emulator.sh" to get a shell prompt in your emulated environment, with full development tools. If you go "./dev-environment.sh" instead you get a 2 gigabyte pesistent ext2 image mounted on /home so you can wget and build fairly large packages.

Quoted 8 lines

I've built the whole of Linux From Scratch 6.7 inside this this, on a couple different platforms. (Still debugging powerpc and mips, probably uClibc issues. Less spare time than I used to have...)

In theory I could do the same with qemu itself, just like any other software package. If you feed it just one architecture in a --target-list it shouldn't take _too_ long to build. But in practice running the result would be too slow to do more than boot to a shell prompt and demonstrate that it worked.

Yeah, don't worry. My point was that anything that doesn't build and run on x86 hosts has little chance of getting test coverage.

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

I have been know to test out of tree architecture patches, though. I only ever got sh4 to work by patching qemu, for example.

I really dislike out-of-tree.

I can't stand 'em, but I don't control what gets merged into most projects.

The main issue is that it takes time and effort to get stuff upstream - and it's good that way. There are people out there who are great programmers, but unfortunately don't have the patience to go through an upstream merging cleanup process.

Quoted 7 lines
Quoted 3 lines

As soon as an architecture runs publicly
available code, it should get upstream, so others can benefit from it.

Entirely agreed. I've been waiting for any of the m68k improvements to QEMU (to run more than just coldfire) work to get merged for a long time. And I have a todo item to look at https://github.com/uli/qemu-s390 also...

I'm currently working on the s390 parts, so no worries. I have a cleaned up tree and partially working system emulation already.

Alex

#34 lore raw
Quoted 28 lines · On Wednesday 05 January 2011 06:31:01 Alexander Graf wrote:
Quoted 27 lines · Rob Landley
Quoted 9 lines · On Tuesday 04 January 2011 15:00:12 Alexander Graf wrote:
Quoted 8 lines
Quoted 3 lines

I have this very issue with s390. The only host to run (and compile) this on is an s390. And few people have those. So it breaks from time to time.

I have some pages bookmarked hinting how to get S390 Linux to boot under hercules, the same way I have instructions for running m68k under Aranym. But in general, if QEMU doesn't support it I have a hard time making myself care...

Quoted 4 lines

Few people jump through the hoops to run an emulator to compile and run qemu inside then when they only want to verify if their patches break something. The general philosophy I've seen is that the best we can expect is a "does ./configure && make break on your x86_64 box?".

If you're talking about running qemu on a non-x86 host, I don't do that. But if you're talking about running non-x86 code on qemu, my project's motto is "we cross compile so you don't have to". The thing is designed so you grab a tarball and go "./run-emulator.sh" to get a shell prompt in your emulated environment, with full development tools. If you go "./dev-environment.sh" instead you get a 2 gigabyte pesistent ext2 image mounted on /home so you can wget and build fairly large packages.

I've built the whole of Linux From Scratch 6.7 inside this this, on a couple different platforms. (Still debugging powerpc and mips, probably uClibc issues. Less spare time than I used to have...)

Quoted 8 lines
Quoted 5 lines

In theory I could do the same with qemu itself, just like any other software package. If you feed it just one architecture in a --target-list it shouldn't take _too_ long to build. But in practice running the result would be too slow to do more than boot to a shell prompt and demonstrate that it worked.

Yeah, don't worry. My point was that anything that doesn't build and run on x86 hosts has little chance of getting test coverage.

Which is half the reason I did Aboriginal Linux.

Download one of the prebuilt system images, use ./dev-environment.sh to get a shell prompt in the emulator with full development tools, wget your source code, ./configure, make, run test suite.

That means people who don't own this hardware can still test it on their laptop, or from a cron job. It means you can package up a test environment with your bug report so a package maintainer (who hasn't got the hardware either) can reproduce your non-x86 bug and test their fixes.

I did a giant evil presentation on this once upon a time, over 200 slides. (An 8 hour, day-long course to actually cover all that, but everybody kept wanting 1 hour summaries... Oh well.)

http://landley.net/aboriginal/downloads/presentation.pdf

Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 2 lines

I have been know to test out of tree architecture patches, though. I only ever got sh4 to work by patching qemu, for example.

I really dislike out-of-tree.

Quoted 7 lines
Quoted 2 lines

I can't stand 'em, but I don't control what gets merged into most projects.

The main issue is that it takes time and effort to get stuff upstream - and it's good that way. There are people out there who are great programmers, but unfortunately don't have the patience to go through an upstream merging cleanup process.

Sometimes it's not a question of cleanup, sometimes it's a question of the upstream developers simply not wanting to do something you want to do. It's possible to disagree on _goals_.

If the then-kconfig maintainer thinks miniconfig is simply a bad idea, you can't exactly work around him by rewriting the implementation.

I've been submitting perl removal patches to the linux kernel build on and off since Peter Anvin went crazy and simultaneously introduced perl as a build prerequisite to the 2.6.25 kernel (and every other project he contributed to, ala klibc and syslinux and such, all at the same time). He resists the removal on principle because he thinks it's GOOD that the kernel depends on perl to build. I have no idea why.

Is sysfs an ABI the kernel exports to userspace that should be stable and documented, or is it a private channel that Greg KH and Kay Sievers made for their userspace udev package that nobody else should ever use? When Linus believes one thing and Greg and Kay clearly believe another but won't _admit_ it, you can get some (hilarious or frustrating, depending on your point of view) squirming out of them:

http://lkml.org/lkml/2007/7/20/487

Technical issues I'll engage with ad nauseam, but irreconcilable differences of _opinion_ you can't always work around.

The squashfs maintainer's efforts to get his patch merged upstream were positively _heroic_, but really: by the time EVERY SINGLE DISTRO is shipping an out of tree patch, the vanilla kernel not including it is a problem with the vanilla kernel. (And yes a year or so before it was merged I checked, and couldn't find a non-toy distro (I.E. one with a package management system and a reasonably current kernel) that _didn't_ include squashfs. Which didn't get merged for another 4 releases after that, and when it _did_ the file format was incompatible with what was already out there.)

I'm not sure the _twelve_year_ saga of union mounts (at least since I first saw an out of tree implementation) is really a "patience and cleanup" issue either. Yes it's a hard problem to get right, but so is virtual memory. The linux kernel has spent its entire history with a series of sucky VM it's ripped out and replaced at least twice (anybody remember 2.4.10?), and that's not counting token based thrashing control and /proc/sys/vm/swappiness and the OOM killer and so on. But it worked all that out in-tree, and union mounts are still out of tree. But NFS is in-tree. Sometimes, it seems a bit arbitrary to me. Oh well.

Quoted 10 lines
Quoted 7 lines
Quoted 2 lines

As soon as an architecture runs publicly
available code, it should get upstream, so others can benefit from it.

Entirely agreed. I've been waiting for any of the m68k improvements to QEMU (to run more than just coldfire) work to get merged for a long time.
And I have a todo item to look at https://github.com/uli/qemu-s390
also...

I'm currently working on the s390 parts, so no worries. I have a cleaned up tree and partially working system emulation already.

Ooh, I'm very interested in adding support for this to aboriginal linux. Please keep me posted...

Rob

Signature · 2 lines
GPLv3: as worthy a successor as The Phantom Menace, as timely as Duke Nukem 
Forever, and as welcome as New Coke.
#35 lore raw
In reply to Alexander Graf
Quoted 48 lines · On Sunday 19 December 2010 09:34:24 Alexander Graf wrote:
Quoted 40 lines · Andreas Färber

Am 19.12.2010 um 10:54 schrieb Alexander Graf:

Quoted 30 lines · Andreas Färber
Quoted 23 lines

Hello,

Based on an earlier attempt of mine to make OpenBIOS work with -M prep, with kind support from Hervé Poussineau here's an initial stab at fixing the long-broken PReP emulation and preparing migration from abandoned OpenHack'Ware to OpenBIOS as default FOSS firmware.

In particular a number of hw_error()s are resolved, so that the BIOS can be entered at all. It is not yet working in terms of serial and VGA support etc.

This series is also available from:

git://repo.or.cz/qemu/afaerber.git prep-queue

Some more work-in-progress for the curious is on my prep branch [2]. The corresponding work-in-progress OpenBIOS changes are at [3].

Unfortunately the prep machine is lacking documentation what exactly it tries to emulate. The plan thus is to merge emulation of a second, real IBM 40p machine based on Hervé's work at [1], for use with original binary firmware.

Quoted 5 lines

Also upcoming are new ppc_chrp machines, forked from ppc_newworld, emulating the 970-based IBM JS20 (using Apple U3) [4] and possibly the POWER5-based IntelliStation 285. These depend on the ongoing ppc64 port of OpenBIOS to be completed though. This relates to PReP in that the machine IDs will need to be coordinated.

Quoted 3 lines

Does this series actually make anything work, or is it just a first step set to get your development rolling? IOW, would users benefit from having the patches upstream yet?

As indicated above, it lets you enter a BIOS, which is a user-visible improvement. User-supplied binary firmware works with 1 + 3-4, ELF firmware with 1-4. Patch 3 depends on review comments. Patch 4 was just an FYI for testing the preceding patches and still needs investigation.

Quoted 6 lines

For OpenBIOS to work, we need fw_cfg in ppc_prep.c and, independently, patches to OpenBIOS. Unless of course we want to use another firmware like OFW from the start. The main interest in PReP nowadays will be proprietary firmware anyway. I thought Rob (cc'ed) had PReP Linux kernel patches for QEMU at some point but I couldn't locate them in the Aboriginal Linux tree.

Quoted 4 lines

I'm not sure on the copyright problems we might run into when delivering binary firmware. So we certainly do need some open source firmware solution for prep to at least have Linux running. For other guests, I don't see a reason why users shouldn't try to fetch a real firmware blob separately :).

Milton Miller wrote the ppc_bin in the last message from scratch, and made it available to me under GPLv2. The tarball is the source (which includes a snapshot of dtc, which these days you can suck out of the linux kernel) and the .bin file is the output. I used my own powerpc toolchain (built by the build scripts in the same source tree) to compile it.

Rob

Signature · 2 lines
GPLv3: as worthy a successor as The Phantom Menace, as timely as Duke Nukem 
Forever, and as welcome as New Coke.
#36 lore raw
In reply to Andreas Färber
Quoted 6 lines · On Sunday 19 December 2010 09:04:00 Andreas Färber wrote:

For OpenBIOS to work, we need fw_cfg in ppc_prep.c and, independently, patches to OpenBIOS. Unless of course we want to use another firmware like OFW from the start. The main interest in PReP nowadays will be proprietary firmware anyway. I thought Rob (cc'ed) had PReP Linux kernel patches for QEMU at some point but I couldn't locate them in the Aboriginal Linux tree.

I switched from prep to c99 over a year ago, but the old file is still buried in the archives circa 2008 or so:

http://landley.net/hg/hgwebdir.cgi/aboriginal/file/ad65353ad01c/sources/toys

Look for ppc_rom.bin and make-ppc_rom.tar.bz2 both more or less from Milton Miller. The corresponding ppc configuration is in sources/targets/powerpc and it worked at the time. (I just switched to something I could do a normal -kernel with like all the other targets.)

Rob

Signature · 2 lines
GPLv3: as worthy a successor as The Phantom Menace, as timely as Duke Nukem 
Forever, and as welcome as New Coke.