qemu-patch-raspberry4/hw/core
Peter Maydell 837a059516 hw/core/loader.c: Improve reporting of ROM overlap errors
In rom_check_and_register_reset() we report to the user if there is
a "ROM region overlap". This has a couple of problems:
 * the reported information is not very easy to intepret
 * the function just prints the overlap to stderr (and relies on
   its single callsite in vl.c to do an error_report() and exit)
 * only the first overlap encountered is diagnosed

Make this function use error_report() and error_printf() and
report a more user-friendly report with all the overlaps
diagnosed.

Sample old output:

rom: requested regions overlap (rom dtb. free=0x0000000000008000, addr=0x0000000000000000)
qemu-system-aarch64: rom check and register reset failed

Sample new output:

qemu-system-aarch64: Some ROM regions are overlapping
These ROM regions might have been loaded by direct user request or by default.
They could be BIOS/firmware images, a guest kernel, initrd or some other file loaded into guest memory.
Check whether you intended to load all this guest code, and whether it has been built to load to the correct addresses.

The following two regions overlap (in the cpu-memory-0 address space):
  phdr #0: /home/petmay01/linaro/qemu-misc-tests/ldmia-fault.axf (addresses 0x0000000000000000 - 0x0000000000008000)
  dtb (addresses 0x0000000000000000 - 0x0000000000100000)

The following two regions overlap (in the cpu-memory-0 address space):
  phdr #1: /home/petmay01/linaro/qemu-misc-tests/bad-psci-call.axf (addresses 0x0000000040000000 - 0x0000000040000010)
  phdr #0: /home/petmay01/linaro/qemu-misc-tests/bp-test.elf (addresses 0x0000000040000000 - 0x0000000040000020)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20201129203923.10622-3-peter.maydell@linaro.org
2020-12-15 12:04:30 +00:00
..
bus.c nomaintainer: Fix Lesser GPL version number 2020-11-15 17:04:40 +01:00
clock-vmstate.c hw/core/clock-vmstate: define a vmstate entry for clock state 2020-04-30 15:35:40 +01:00
clock.c hw/core/clock: trace clock values in Hz instead of ns 2020-10-27 11:10:44 +00:00
cpu.c machine + QOM queue, 2020-10-06 2020-10-08 11:32:54 +01:00
fw-path-provider.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
generic-loader.c make ram_size local to vl.c 2020-12-10 12:15:10 -05:00
hotplug.c call HotplugHandler->plug() as the last step in device realization 2018-10-19 13:44:12 +02:00
irq.c Use DECLARE_*CHECKER* macros 2020-09-09 09:27:09 -04:00
Kconfig hw/core: Add a config switch for the generic loader device 2019-08-20 09:11:17 +02:00
loader-fit.c hw/mips/boston: Fix Lesser GPL version number 2020-11-03 16:51:13 +01:00
loader.c hw/core/loader.c: Improve reporting of ROM overlap errors 2020-12-15 12:04:30 +00:00
machine-hmp-cmds.c monitor: Add Monitor parameter to monitor_get_cpu_index() 2020-10-09 07:08:19 +02:00
machine-qmp-cmds.c cphp: remove deprecated cpu-add command(s) 2020-09-29 02:14:30 -04:00
machine.c vl: extract machine done notifiers 2020-12-10 12:15:18 -05:00
meson.build hw/core: Move the creation of the library to the main meson.build 2020-10-12 11:50:19 -04:00
nmi.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
null-machine.c hw/core/null-machine: Do not initialize unused chardev backends 2020-07-10 18:02:16 -04:00
numa.c make ram_size local to vl.c 2020-12-10 12:15:10 -05:00
or-irq.c hw/core/or-irq: Fix incorrect assert forbidding num-lines == MAX_OR_LINES 2020-01-30 16:02:01 +00:00
platform-bus.c nomaintainer: Fix Lesser GPL version number 2020-11-15 17:04:40 +01:00
ptimer.c hw/core/ptimer: Support ptimer being disabled by timer callback 2020-10-27 11:15:31 +00:00
qdev-clock.c hw/core/qdev-clock: add a reference on aliased clocks 2020-10-22 11:53:53 -04:00
qdev-fw.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
qdev-prop-internal.h hw/core/qdev-properties: Export some integer-related functions 2020-10-06 11:09:35 -04:00
qdev-properties-system.c Tweak a few "Parameter 'NAME' expects THING" error message 2020-12-10 17:16:44 +01:00
qdev-properties.c hw/core/qdev-properties: Extract system-mode specific properties 2020-10-06 11:09:35 -04:00
qdev.c failover: Rename function to hide_device() 2020-12-08 13:48:57 -05:00
register.c register: Remove unnecessary NULL check 2020-11-17 12:56:32 +00:00
reset.c qemu/queue.h: leave head structs anonymous unless necessary 2019-01-11 15:46:55 +01:00
resettable.c hw/core: deprecate old reset functions and introduce new ones 2020-01-30 16:02:04 +00:00
split-irq.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
stream.c hw/core/stream: Rename StreamSlave as StreamSink 2020-12-10 12:15:04 -05:00
sysbus.c nomaintainer: Fix Lesser GPL version number 2020-11-15 17:04:40 +01:00
trace-events hw/core/clock: trace clock values in Hz instead of ns 2020-10-27 11:10:44 +00:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00
uboot_image.h Support u-boot noload images for arm as used by, NetBSD/evbarm GENERIC kernel. 2019-01-07 15:46:20 +00:00
vm-change-state-handler.c sysemu: Split sysemu/runstate.h off sysemu/sysemu.h 2019-08-16 13:37:36 +02:00
vmstate-if.c vmstate: add qom interface to get id 2020-01-06 18:41:32 +04:00