diff options
author | Peter Maydell | 2022-01-20 12:43:28 +0100 |
---|---|---|
committer | Peter Maydell | 2022-01-20 12:43:28 +0100 |
commit | 47fa1ad5349bee5c2b47f8b1dc3be13f180c89ba (patch) | |
tree | 7ef4edd2caa8a8bd72d97c1101081e76dc1afde9 /include/hw | |
parent | Merge remote-tracking branch 'remotes/kraxel/tags/seabios-20220118-pull-reque... (diff) | |
parent | m68k: virt: correctly set the initial PC (diff) | |
download | qemu-47fa1ad5349bee5c2b47f8b1dc3be13f180c89ba.tar.gz qemu-47fa1ad5349bee5c2b47f8b1dc3be13f180c89ba.tar.xz qemu-47fa1ad5349bee5c2b47f8b1dc3be13f180c89ba.zip |
Merge remote-tracking branch 'remotes/vivier/tags/m68k-for-7.0-pull-request' into staging
m68k pull request 20220120
Fix virt-m68k reboot
# gpg: Signature made Thu 20 Jan 2022 08:35:50 GMT
# gpg: using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C
# gpg: issuer "laurent@vivier.eu"
# gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [full]
# gpg: aka "Laurent Vivier <laurent@vivier.eu>" [full]
# gpg: aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" [full]
# Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F 5173 F30C 38BD 3F2F BE3C
* remotes/vivier/tags/m68k-for-7.0-pull-request:
m68k: virt: correctly set the initial PC
hw/elf_ops: clear uninitialized segment space
exec/memory: Extract address_space_set() from dma_memory_set()
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include/hw')
-rw-r--r-- | include/hw/elf_ops.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/hw/elf_ops.h b/include/hw/elf_ops.h index 995de8495c..7c3b1d0f6c 100644 --- a/include/hw/elf_ops.h +++ b/include/hw/elf_ops.h @@ -555,6 +555,19 @@ static ssize_t glue(load_elf, SZ)(const char *name, int fd, if (res != MEMTX_OK) { goto fail; } + /* + * We need to zero'ify the space that is not copied + * from file + */ + if (file_size < mem_size) { + res = address_space_set(as ? as : &address_space_memory, + addr + file_size, 0, + mem_size - file_size, + MEMTXATTRS_UNSPECIFIED); + if (res != MEMTX_OK) { + goto fail; + } + } } } |