diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2022-09-16 14:36:03 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2022-09-19 15:35:50 +0200 |
commit | 8ca302e86d685fa05b16e2b208888243da319941 (patch) | |
tree | 042c4f9c557dc21cd33a2cb434f4cb617d214bea /linuxboot.c | |
parent | a5300c4949b8d4de2d34bedfaed66793f48ec948 (diff) | |
download | qboot-8ca302e86d685fa05b16e2b208888243da319941.zip qboot-8ca302e86d685fa05b16e2b208888243da319941.tar.gz qboot-8ca302e86d685fa05b16e2b208888243da319941.tar.bz2 |
QEMU places setup_data at a particular location, which cannot be
relocated due to it containing self references in absolute address
terms. For this reason, it supplies the intended location in
FW_CFG_SETUP_ADDR. That is what is used in the option ROMs provided
by QEMU, use this too in qboot.
This also has the effect of removing the 8k limit on the copied size,
since the header is copied to the right location from the beginning.
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Message-Id: <20220916133603.693135-1-Jason@zx2c4.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'linuxboot.c')
-rw-r--r-- | linuxboot.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/linuxboot.c b/linuxboot.c index 251bcb6..bdb01ee 100644 --- a/linuxboot.c +++ b/linuxboot.c @@ -11,7 +11,7 @@ struct hvm_start_info start_info = {0}; bool parse_bzimage(struct linuxboot_args *args) { - uint8_t *header = args->header; + uint8_t *header = args->setup_addr; uint32_t real_addr, cmdline_addr, prot_addr, initrd_addr; uint32_t setup_size; @@ -84,7 +84,6 @@ bool parse_bzimage(struct linuxboot_args *args) args->setup_size = (setup_size+1)*512; args->kernel_size = args->vmlinuz_size - setup_size; args->initrd_addr = (void *)initrd_addr; - args->setup_addr = (void *)real_addr; args->kernel_addr = (void *)prot_addr; args->cmdline_addr = (void *)cmdline_addr; return true; @@ -92,7 +91,6 @@ bool parse_bzimage(struct linuxboot_args *args) void boot_bzimage(struct linuxboot_args *args) { - memcpy(args->setup_addr, args->header, sizeof(args->header)); #ifdef BENCHMARK_HACK /* Exit just before getting to vmlinuz, so that it is easy * to time/profile the firmware. |