qemu/include
Jason A. Donenfeld e935b73508 x86: return modified setup_data only if read as memory, not as file
If setup_data is being read into a specific memory location, then
generally the setup_data address parameter is read first, so that the
caller knows where to read it into. In that case, we should return
setup_data containing the absolute addresses that are hard coded and
determined a priori. This is the case when kernels are loaded by BIOS,
for example. In contrast, when setup_data is read as a file, then we
shouldn't modify setup_data, since the absolute address will be wrong by
definition. This is the case when OVMF loads the image.

This allows setup_data to be used like normal, without crashing when EFI
tries to use it.

(As a small development note, strangely, fw_cfg_add_file_callback() was
exported but fw_cfg_add_bytes_callback() wasn't, so this makes that
consistent.)

Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Laurent Vivier <laurent@vivier.eu>
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: Philippe Mathieu-Daudé <f4bug@amsat.org>
Cc: Richard Henderson <richard.henderson@linaro.org>
Suggested-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Message-Id: <20220921093134.2936487-1-Jason@zx2c4.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-09-27 11:30:59 +02:00
..
authz Prefer 'on' | 'off' over 'yes' | 'no' for bool options 2021-01-29 17:07:53 +00:00
block nvme: Fix misleading macro when mixed with ternary operator 2022-07-15 10:40:33 +02:00
chardev Clean up ill-advised or unusual header guards 2022-05-11 16:50:01 +02:00
crypto crypto: Make block callbacks return 0 on success 2022-07-12 12:14:55 +02:00
disas target/loongarch: Add disassembler 2022-06-06 18:09:03 +00:00
exec accel/tcg: Add fast path for translator_ld* 2022-09-06 08:04:26 +01:00
fpu fpu: Add rebias bool, value and operation 2022-08-31 14:08:05 -03:00
hw x86: return modified setup_data only if read as memory, not as file 2022-09-27 11:30:59 +02:00
io io: add a QIOChannelNull equivalent to /dev/null 2022-06-22 18:11:21 +01:00
libdecnumber Replace config-time define HOST_WORDS_BIGENDIAN 2022-04-06 10:50:37 +02:00
migration migration: Remove load_state_old and minimum_version_id_old 2022-03-02 18:20:45 +00:00
monitor softmmu/dirtylimit: Implement dirty page rate limit 2022-07-20 12:15:08 +01:00
net vhost_net: add NetClientState->load() callback 2022-09-02 10:22:39 +08:00
qapi include: move qdict_{crumple,flatten} declarations 2022-04-21 17:03:51 +04:00
qemu util: accept iova_tree_remove_parameter by value 2022-09-02 10:22:39 +08:00
qom qom/object: Remove circular include dependency 2022-06-28 10:53:32 +02:00
scsi scsi-disk: add SCSI_DISK_QUIRK_MODE_PAGE_VENDOR_SPECIFIC_APPLE quirk for Macintosh 2022-07-13 16:58:58 +02:00
semihosting semihosting: Allow optional use of semihosting from userspace 2022-09-13 17:18:21 +01:00
standard-headers hw/i386: pass RNG seed via setup_data entry 2022-07-22 19:26:34 +02:00
sysemu util/qemu-sockets: Enable unix socket support on Windows 2022-09-02 15:54:46 +04:00
tcg tcg: Add tcg_gen_mov_ptr 2022-06-02 08:09:46 -07:00
ui ui/console: allow display device to be labeled with given id 2022-07-01 12:33:51 +02:00
user misc: fix commonly doubled up words 2022-08-01 11:58:02 +02:00
elf.h linux-user: Honor PT_GNU_STACK 2022-09-06 08:04:25 +01:00
glib-compat.h compiler.h: replace QEMU_NORETURN with G_NORETURN 2022-04-21 17:03:51 +04:00
qemu-io.h Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
qemu-main.h Simplify softmmu/main.c 2022-04-21 16:56:55 +04:00