aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>2020-09-27 14:21:11 +0200
committerPhilippe Mathieu-Daudé <f4bug@amsat.org>2020-10-17 13:59:40 +0200
commit9d585eaa87bf1c5f66e12d6c4a8a38c80f69c5da (patch)
treec31d3620d90c1e9198ad5beb375b4d84dd3832b3 /hw
parent8df525a558e85aee7a2c757dd7654173ef369544 (diff)
downloadqemu-9d585eaa87bf1c5f66e12d6c4a8a38c80f69c5da.zip
qemu-9d585eaa87bf1c5f66e12d6c4a8a38c80f69c5da.tar.gz
qemu-9d585eaa87bf1c5f66e12d6c4a8a38c80f69c5da.tar.bz2
hw/mips: Simplify loading 64-bit ELF kernels
Since 82790064116 ("Cast ELF datatypes properly to host 64bit types") we don't need to sign-extend the entry_point address. Remove this unnecessary code. Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20200927163943.614604-2-f4bug@amsat.org>
Diffstat (limited to 'hw')
-rw-r--r--hw/mips/mipssim.c6
-rw-r--r--hw/mips/r4k.c6
2 files changed, 2 insertions, 10 deletions
diff --git a/hw/mips/mipssim.c b/hw/mips/mipssim.c
index f0042f7..afef4f2 100644
--- a/hw/mips/mipssim.c
+++ b/hw/mips/mipssim.c
@@ -77,11 +77,7 @@ static int64_t load_kernel(void)
(uint64_t *)&entry, NULL,
(uint64_t *)&kernel_high, NULL, big_endian,
EM_MIPS, 1, 0);
- if (kernel_size >= 0) {
- if ((entry & ~0x7fffffffULL) == 0x80000000) {
- entry = (int32_t)entry;
- }
- } else {
+ if (kernel_size < 0) {
error_report("could not load kernel '%s': %s",
loaderparams.kernel_filename,
load_elf_strerror(kernel_size));
diff --git a/hw/mips/r4k.c b/hw/mips/r4k.c
index 39bc626..7ee37c4 100644
--- a/hw/mips/r4k.c
+++ b/hw/mips/r4k.c
@@ -102,11 +102,7 @@ static int64_t load_kernel(void)
(uint64_t *)&entry, NULL,
(uint64_t *)&kernel_high, NULL, big_endian,
EM_MIPS, 1, 0);
- if (kernel_size >= 0) {
- if ((entry & ~0x7fffffffULL) == 0x80000000) {
- entry = (int32_t)entry;
- }
- } else {
+ if (kernel_size < 0) {
error_report("could not load kernel '%s': %s",
loaderparams.kernel_filename,
load_elf_strerror(kernel_size));