[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-stable] [PATCH 021/113] loader: don't perform overlapping address
From: |
Michael Roth |
Subject: |
[Qemu-stable] [PATCH 021/113] loader: don't perform overlapping address check for memory region ROM images |
Date: |
Mon, 18 Jun 2018 20:41:47 -0500 |
From: Mark Cave-Ayland <address@hidden>
All memory region ROM images have a base address of 0 which causes the
overlapping
address check to fail if more than one memory region ROM image is present, or an
existing ROM image is loaded at address 0.
Make sure that we ignore the overlapping address check in
rom_check_and_register_reset() if this is a memory region ROM image. In
particular
this fixes the "rom: requested regions overlap" error on startup when trying to
run qemu-system-sparc with a -kernel image since commit 7497638642: "tcx:
switch to
load_image_mr() and remove prom_addr hack".
Suggested-by: Peter Maydell <address@hidden>
Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Mark Cave-Ayland <address@hidden>
(cherry picked from commit ca316c11526a1bc221fb542bdce6bac7238dde69)
Signed-off-by: Michael Roth <address@hidden>
---
hw/core/loader.c | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/hw/core/loader.c b/hw/core/loader.c
index 91669d65aa..c08f130461 100644
--- a/hw/core/loader.c
+++ b/hw/core/loader.c
@@ -1104,20 +1104,22 @@ int rom_check_and_register_reset(void)
if (rom->fw_file) {
continue;
}
- if ((addr > rom->addr) && (as == rom->as)) {
- fprintf(stderr, "rom: requested regions overlap "
- "(rom %s. free=0x" TARGET_FMT_plx
- ", addr=0x" TARGET_FMT_plx ")\n",
- rom->name, addr, rom->addr);
- return -1;
+ if (!rom->mr) {
+ if ((addr > rom->addr) && (as == rom->as)) {
+ fprintf(stderr, "rom: requested regions overlap "
+ "(rom %s. free=0x" TARGET_FMT_plx
+ ", addr=0x" TARGET_FMT_plx ")\n",
+ rom->name, addr, rom->addr);
+ return -1;
+ }
+ addr = rom->addr;
+ addr += rom->romsize;
+ as = rom->as;
}
- addr = rom->addr;
- addr += rom->romsize;
section = memory_region_find(rom->mr ? rom->mr : get_system_memory(),
rom->addr, 1);
rom->isrom = int128_nz(section.size) &&
memory_region_is_rom(section.mr);
memory_region_unref(section.mr);
- as = rom->as;
}
qemu_register_reset(rom_reset, NULL);
roms_loaded = 1;
--
2.11.0
- [Qemu-stable] [PATCH 012/113] spapr: rename spapr_vcpu_id() to spapr_get_vcpu_id(), (continued)
- [Qemu-stable] [PATCH 012/113] spapr: rename spapr_vcpu_id() to spapr_get_vcpu_id(), Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 013/113] spapr: consolidate the VCPU id numbering logic in a single place, Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 015/113] spapr: register dummy ICPs later, Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 014/113] spapr: fix missing CPU core nodes in DT when running with TCG, Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 016/113] spapr: make pseries-2.11 the default machine type, Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 017/113] nbd: Honor server's advertised minimum block size, Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 018/113] specs/qcow2: Fix documentation of the compressed cluster descriptor, Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 019/113] rbd: Fix use after free in qemu_rbd_set_keypairs() error path, Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 020/113] tpm: Set the flags of the CMD_INIT command to 0, Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 001/113] block/ssh: fix possible segmentation fault when .desc is not null-terminated, Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 021/113] loader: don't perform overlapping address check for memory region ROM images,
Michael Roth <=
- [Qemu-stable] [PATCH 022/113] target/xtensa: dump correct physical registers, Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 023/113] linux-user: fix mmap/munmap/mprotect/mremap/shmat, Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 024/113] linux-user: fix assertion in shmdt, Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 025/113] linux-user: fix target_mprotect/target_munmap error return values, Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 027/113] openpic_kvm: drop address_space_to_flatview call, Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 026/113] sparc: fix leon3 casa instruction when MMU is disabled, Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 028/113] memory: inline some performance-sensitive accessors, Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 029/113] address_space_write: address_space_to_flatview needs RCU lock, Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 002/113] pci-bridge/i82801b11: clear bridge registers on platform reset, Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 031/113] address_space_access_valid: address_space_to_flatview needs RCU lock, Michael Roth, 2018/06/18