Skip to contentSkip to conversation

Don't load options roms intended to be loaded by the bios in qemu

PATCH Superseded Avi Kivity 2 participants 3 messages Dec 22, 2009

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Avi Kivity

author
#0 lore raw

PATCH 1/1 Don't load options roms intended to be loaded by the bios in qemu

The first such option rom will load at address 0, which isn't very nice, and the second will report a conflict and abort, which is horrible.

---
 hw/loader.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
hw/loader.c +3 -0
index 2ceb8eb..c6bf0f1 100644
@@ -654,6 +654,9 @@ int rom_load_all(void)
     Rom *rom;
 
     QTAILQ_FOREACH(rom, &roms, next) {
+        if (!rom->addr) {
+            continue;
+        }
         if (addr > rom->addr) {
             fprintf(stderr, "rom: requested regions overlap "
                     "(rom %s. free=0x" TARGET_FMT_plx
Signature · 1 line
1.6.5.3
#1 lore raw
Quoted 13 lines · Avi Kivity

The first such option rom will load at address 0, which isn't very nice, and the second will report a conflict and abort, which is horrible.

---
 hw/loader.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
hw/loader.c +0 -0
index 2ceb8eb..c6bf0f1 100644

hw/loader.c int rom_load_all(void) · line 659

Quoted 6 lines
hw/loader.c +3 -0
@@ -654,6 +654,9 @@ int rom_load_all(void)
     Rom *rom;
 
     QTAILQ_FOREACH(rom, &roms, next) {
+        if (!rom->addr) {
+            continue;
+        }

Some roms needs to be loaded at address 0, it's the case for example of the arm versatile bootloader. Adding this code will break the board emulation.

Quoted 9 lines
hw/loader.c +0 -0
         if (addr > rom->addr) {
             fprintf(stderr, "rom: requested regions overlap "
                     "(rom %s. free=0x" TARGET_FMT_plx
Signature · 1 line
1.6.5.3
Signature · 2 lines
Aurelien Jarno	                        GPG: 1024D/F1BCDB73
[email protected]                 http://www.aurel32.net
author
#2 lore raw
Quoted 17 lines · Aurelien Jarno
Quoted 15 lines · Avi Kivity

The first such option rom will load at address 0, which isn't very nice, and the second will report a conflict and abort, which is horrible.

---
  hw/loader.c |    3 +++
  1 files changed, 3 insertions(+), 0 deletions(-)
hw/loader.c +0 -0
index 2ceb8eb..c6bf0f1 100644
@@ -654,6 +654,9 @@ int rom_load_all(void)
      Rom *rom;
 
Quoted 9 lines

hw/loader.c int rom_load_all(void)

Quoted 5 lines
hw/loader.c +3 -0
      QTAILQ_FOREACH(rom,&roms, next) {
+        if (!rom->addr) {
+            continue;
+        }
 

Some roms needs to be loaded at address 0, it's the case for example of the arm versatile bootloader. Adding this code will break the board emulation.

The idea of keying bios-loading or host-loading on address is broken (another instance of mixing control and data). We need a separate control for this. I'll leave this to the authors of the code as I can't make heads or tails of it.

Signature · 1 line
error compiling committee.c: too many arguments to function