qemu-patch-raspberry4/hw/core
Peter Maydell 1228c4596a hw/core/loader: Add new function rom_ptr_for_as()
For accesses to rom blob data before or during reset, we have a
function rom_ptr() which looks for a rom blob that would be loaded to
the specified address, and returns a pointer into the rom blob data
corresponding to that address.  This allows board or CPU code to say
"what is the data that is going to be loaded to this address?".

However, this function does not take account of memory region
aliases.  If for instance a machine model has RAM at address
0x0000_0000 which is aliased to also appear at 0x1000_0000, a
rom_ptr() query for address 0x0000_0000 will only return a match if
the guest image provided by the user was loaded at 0x0000_0000 and
not if it was loaded at 0x1000_0000, even though they are the same
RAM and a run-time guest CPU read of 0x0000_0000 will read the data
loaded to 0x1000_0000.

Provide a new function rom_ptr_for_as() which takes an AddressSpace
argument, so that it can check whether the MemoryRegion corresponding
to the address is also mapped anywhere else in the AddressSpace and
look for rom blobs that loaded to that alias.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20210318174823.18066-5-peter.maydell@linaro.org
2021-03-23 11:47:31 +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 clock: Add ClockPreUpdate callback event type 2021-03-08 17:20:01 +00:00
cpu.c cpu: move debug_check_watchpoint to tcg_ops 2021-02-05 10:24:14 -10: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
guest-loader.c hw/core: implement a guest-loader to support static hypervisor guests 2021-03-10 15:34:11 +00:00
guest-loader.h hw/core: implement a guest-loader to support static hypervisor guests 2021-03-10 15:34:11 +00: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: Only build guest-loader if libfdt is available 2021-03-17 07:17:46 +00: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: Add new function rom_ptr_for_as() 2021-03-23 11:47:31 +00:00
machine-hmp-cmds.c machine: remove 'query-cpus' QMP command 2021-03-18 09:22:55 +00:00
machine-qmp-cmds.c machine: remove 'arch' field from 'query-cpus-fast' QMP command 2021-03-18 09:22:55 +00:00
machine.c hw/arm/virt: Disable pl011 clock migration if needed 2021-03-23 11:47:31 +00:00
meson.build hw/core: Only build guest-loader if libfdt is available 2021-03-17 07:17:46 +00: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 ptimer: Add new ptimer_set_period_from_clock() function 2021-01-29 15:54:42 +00:00
qdev-clock.c clock: Add ClockEvent parameter to callbacks 2021-03-08 17:20:01 +00:00
qdev-fw.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
qdev-prop-internal.h qdev: Make qdev_propinfo_get_uint16() static 2020-12-15 10:02:07 -05:00
qdev-properties-system.c qdev: Rename qdev_get_prop_ptr() to object_field_prop_ptr() 2020-12-18 15:20:18 -05:00
qdev-properties.c qdev: Avoid unnecessary DeviceState* variable at set_prop_arraylen() 2020-12-18 15:20:18 -05:00
qdev.c machine: introduce MachineInitPhase 2020-12-15 12:51:52 -05:00
register.c hw/core/register.c: Don't use '#' flag of printf format 2020-12-17 21:56:43 -08: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