Skip to contentSkip to conversation

MIPS queue for January 28th, 2020

GIT PULL Aleksandar Markovic 3 participants 10 messages Jan 28, 2020 – Jan 29, 2020 RISC-V

lore
Share & tools
lore
#0 lore raw

From: Aleksandar Markovic <[email protected]>

The following changes since commit 4c60e3289875ae6c516a37523bcecb87f68ce67c:

Merge remote-tracking branch 'remotes/rth/tags/pull-pa-20200127' into staging (2020-01-28 15:11:04 +0000)

are available in the git repository at:

https://github.com/AMarkovic/qemu tags/mips-queue-jan-28-2020

for you to fetch changes up to 370bf3a4196ebef247752a68b89d497522168ebb:

target/mips: Add implementation of GINVT instruction (2020-01-28 20:52:20 +0100)

----------------------------------------------------------------

MIPS queue for January 28th, 2020

A diverse set of fixes and improvements:

- finalize documentation on deprecating r4k machine
- enable disassembler to receive target-specific data
- enable kernel loader to get e_flags from ELF header
- improve code flow in helper_do_semihosting()
- amend CP0 WatchHi register implementation
- add GINVT instruction emulation

----------------------------------------------------------------

Aleksandar Markovic (2):
target/mips: Rectify documentation on deprecating r4k machine
disas: Add a field for target-dependant data

Daniel Henrique Barboza (1):
mips-semi.c: remove 'uhi_done' label in helper_do_semihosting()

Philippe Mathieu-Daudé (1):
hw/core/loader: Let load_elf() populate the processor-specific flags

Yongbok Kim (2):
target/mips: Amend CP0 WatchHi register implementation target/mips: Add implementation of GINVT instruction

 disas/mips.c                   |  10 +++
 hw/alpha/dp264.c               |   4 +-
 hw/arm/armv7m.c                |   2 +-
 hw/arm/boot.c                  |   2 +-
 hw/core/generic-loader.c       |   2 +-
 hw/core/loader.c               |  37 +++++-----
 hw/cris/boot.c                 |   2 +-
 hw/hppa/machine.c              |   4 +-
 hw/i386/multiboot.c            |   2 +-
 hw/i386/x86.c                  |   2 +-
 hw/lm32/lm32_boards.c          |   4 +-
 hw/lm32/milkymist.c            |   2 +-
 hw/m68k/an5206.c               |   2 +-
 hw/m68k/mcf5208.c              |   2 +-
 hw/m68k/q800.c                 |   2 +-
 hw/microblaze/boot.c           |   4 +-
 hw/mips/mips_fulong2e.c        |   2 +-
 hw/mips/mips_malta.c           |   3 +-
 hw/mips/mips_mipssim.c         |   2 +-
 hw/mips/mips_r4k.c             |   2 +-
 hw/moxie/moxiesim.c            |   2 +-
 hw/nios2/boot.c                |   4 +-
 hw/openrisc/openrisc_sim.c     |   2 +-
 hw/pci-host/prep.c             |   3 +-
 hw/ppc/e500.c                  |   2 +-
 hw/ppc/mac_newworld.c          |   4 +-
 hw/ppc/mac_oldworld.c          |   4 +-
 hw/ppc/ppc440_bamboo.c         |   2 +-
 hw/ppc/sam460ex.c              |   3 +-
 hw/ppc/spapr.c                 |   6 +-
 hw/ppc/virtex_ml507.c          |   2 +-
 hw/riscv/boot.c                |   4 +-
 hw/s390x/ipl.c                 |   7 +-
 hw/sparc/leon3.c               |   2 +-
 hw/sparc/sun4m.c               |   4 +-
 hw/sparc64/sun4u.c             |   5 +-
 hw/tricore/tricore_testboard.c |   2 +-
 hw/xtensa/sim.c                |   2 +-
 hw/xtensa/xtfpga.c             |   2 +-
 include/disas/dis-asm.h        |   3 +
 include/hw/elf_ops.h           |   6 +-
 include/hw/loader.h            |  21 +++---
 qemu-deprecated.texi           |   2 +-
 target/mips/cpu.h              |   4 +-
 target/mips/helper.c           |  20 ++++--
 target/mips/helper.h           |   5 ++
 target/mips/internal.h         |   1 +
 target/mips/machine.c          |   6 +-
 target/mips/mips-semi.c        |  15 ++--
 target/mips/op_helper.c        | 152 +++++++++++++++++++++++++++++++++++------
 target/mips/translate.c        |  88 +++++++++++++++++++++++-
 51 files changed, 356 insertions(+), 121 deletions(-)
Signature · 1 line
2.7.4
#1 lore raw

[PULL 1/6] target/mips: Rectify documentation on deprecating r4k machine

From: Aleksandar Markovic <[email protected]>

Change the documented (in file qemu-deprecated.texi) release since r4k machine is deprecated from 4.2 to 5.0.

Fixes d32dc61421b

Message-Id: <[email protected]>

---
 qemu-deprecated.texi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
qemu-deprecated.texi +1 -1
index 0968d37..3d2a8ff 100644
@@ -260,7 +260,7 @@ The 'scsi-disk' device is deprecated. Users should use 'scsi-hd' or
 
 @section System emulator machines
 
-@subsection mips r4k platform (since 4.2)
+@subsection mips r4k platform (since 5.0)
 
 This machine type is very old and unmaintained. Users should use the 'malta'
 machine type instead.
Signature · 1 line
2.7.4
#2 lore raw

[PULL 6/6] target/mips: Add implementation of GINVT instruction

In reply to Aleksandar Markovic

From: Yongbok Kim <[email protected]>

Implement emulation of GINVT instruction. As QEMU doesn't support caches and virtualization, this implementation covers only one instruction (GINVT - Global Invalidate TLB) among all TLB-related MIPS instructions.

Message-Id: <[email protected]>

---
 disas/mips.c            |  10 ++++
 target/mips/cpu.h       |   2 +-
 target/mips/helper.c    |  20 ++++++--
 target/mips/helper.h    |   2 +
 target/mips/internal.h  |   1 +
 target/mips/op_helper.c | 129 +++++++++++++++++++++++++++++++++++++++++-------
 target/mips/translate.c |  46 ++++++++++++++++-
 7 files changed, 184 insertions(+), 26 deletions(-)
disas/mips.c +10 -0
index dfefe5e..b9a5204 100644
@@ -1409,6 +1409,16 @@ const struct mips_opcode mips_builtin_opcodes[] =
 {"dvp",        "t",     0x41600024, 0xffe0ffff, TRAP|WR_t,            0, I32R6},
 {"evp",        "",      0x41600004, 0xffffffff, TRAP,                 0, I32R6},
 {"evp",        "t",     0x41600004, 0xffe0ffff, TRAP|WR_t,            0, I32R6},
+{"ginvi",      "v",     0x7c00003d, 0xfc1ffcff, TRAP | INSN_TLB,      0, I32R6},
+{"ginvt",      "v",     0x7c0000bd, 0xfc1ffcff, TRAP | INSN_TLB,      0, I32R6},
+{"crc32b",     "t,v,t", 0x7c00000f, 0xfc00ff3f, WR_d | RD_s | RD_t,   0, I32R6},
+{"crc32h",     "t,v,t", 0x7c00004f, 0xfc00ff3f, WR_d | RD_s | RD_t,   0, I32R6},
+{"crc32w",     "t,v,t", 0x7c00008f, 0xfc00ff3f, WR_d | RD_s | RD_t,   0, I32R6},
+{"crc32d",     "t,v,t", 0x7c0000cf, 0xfc00ff3f, WR_d | RD_s | RD_t,   0, I64R6},
+{"crc32cb",    "t,v,t", 0x7c00010f, 0xfc00ff3f, WR_d | RD_s | RD_t,   0, I32R6},
+{"crc32ch",    "t,v,t", 0x7c00014f, 0xfc00ff3f, WR_d | RD_s | RD_t,   0, I32R6},
+{"crc32cw",    "t,v,t", 0x7c00018f, 0xfc00ff3f, WR_d | RD_s | RD_t,   0, I32R6},
+{"crc32cd",    "t,v,t", 0x7c0001cf, 0xfc00ff3f, WR_d | RD_s | RD_t,   0, I64R6},
 
 /* MSA */
 {"sll.b",   "+d,+e,+f", 0x7800000d, 0xffe0003f, WR_VD|RD_VS|RD_VT,  0, MSA},
target/mips/cpu.h +1 -1
index 7cf1b49..94d01ea 100644
@@ -309,7 +309,7 @@ typedef struct mips_def_t mips_def_t;
 #define CP0_REG04__USERLOCAL       2
 #define CP0_REG04__XCONTEXTCONFIG  3
 #define CP0_REG04__DBGCONTEXTID    4
-#define CP0_REG00__MMID            5
+#define CP0_REG04__MMID            5
 /* CP0 Register 05 */
 #define CP0_REG05__PAGEMASK        0
 #define CP0_REG05__PAGEGRAIN       1
target/mips/helper.c +16 -4
index 781930a..afd78b1 100644
@@ -72,8 +72,13 @@ int r4k_map_address(CPUMIPSState *env, hwaddr *physical, int *prot,
                     target_ulong address, int rw, int access_type)
 {
     uint16_t ASID = env->CP0_EntryHi & env->CP0_EntryHi_ASID_mask;
+    uint32_t MMID = env->CP0_MemoryMapID;
+    bool mi = !!((env->CP0_Config5 >> CP0C5_MI) & 1);
+    uint32_t tlb_mmid;
     int i;
 
+    MMID = mi ? MMID : (uint32_t) ASID;
+
     for (i = 0; i < env->tlb->tlb_in_use; i++) {
         r4k_tlb_t *tlb = &env->tlb->mmu.r4k.tlb[i];
         /* 1k pages are not supported. */
@@ -84,8 +89,9 @@ int r4k_map_address(CPUMIPSState *env, hwaddr *physical, int *prot,
         tag &= env->SEGMask;
 #endif
 
-        /* Check ASID, virtual page number & size */
-        if ((tlb->G == 1 || tlb->ASID == ASID) && VPN == tag && !tlb->EHINV) {
+        /* Check ASID/MMID, virtual page number & size */
+        tlb_mmid = mi ? tlb->MMID : (uint32_t) tlb->ASID;
+        if ((tlb->G == 1 || tlb_mmid == MMID) && VPN == tag && !tlb->EHINV) {
             /* TLB match */
             int n = !!(address & mask & ~(mask >> 1));
             /* Check access rights */
@@ -1418,14 +1424,20 @@ void r4k_invalidate_tlb(CPUMIPSState *env, int idx, int use_extra)
     target_ulong addr;
     target_ulong end;
     uint16_t ASID = env->CP0_EntryHi & env->CP0_EntryHi_ASID_mask;
+    uint32_t MMID = env->CP0_MemoryMapID;
+    bool mi = !!((env->CP0_Config5 >> CP0C5_MI) & 1);
+    uint32_t tlb_mmid;
     target_ulong mask;
 
+    MMID = mi ? MMID : (uint32_t) ASID;
+
     tlb = &env->tlb->mmu.r4k.tlb[idx];
     /*
-     * The qemu TLB is flushed when the ASID changes, so no need to
+     * The qemu TLB is flushed when the ASID/MMID changes, so no need to
      * flush these entries again.
      */
-    if (tlb->G == 0 && tlb->ASID != ASID) {
+    tlb_mmid = mi ? tlb->MMID : (uint32_t) tlb->ASID;
+    if (tlb->G == 0 && tlb_mmid != MMID) {
         return;
     }
 
target/mips/helper.h +2 -0
index 5b1f8bb..84fdd9f 100644
@@ -120,6 +120,7 @@ DEF_HELPER_2(mtc0_tcschefback, void, env, tl)
 DEF_HELPER_2(mttc0_tcschefback, void, env, tl)
 DEF_HELPER_2(mtc0_entrylo1, void, env, tl)
 DEF_HELPER_2(mtc0_context, void, env, tl)
+DEF_HELPER_2(mtc0_memorymapid, void, env, tl)
 DEF_HELPER_2(mtc0_pagemask, void, env, tl)
 DEF_HELPER_2(mtc0_pagegrain, void, env, tl)
 DEF_HELPER_2(mtc0_segctl0, void, env, tl)
@@ -376,6 +377,7 @@ DEF_HELPER_1(ei, tl, env)
 DEF_HELPER_1(eret, void, env)
 DEF_HELPER_1(eretnc, void, env)
 DEF_HELPER_1(deret, void, env)
+DEF_HELPER_3(ginvt, void, env, tl, i32)
 #endif /* !CONFIG_USER_ONLY */
 DEF_HELPER_1(rdhwr_cpunum, tl, env)
 DEF_HELPER_1(rdhwr_synci_step, tl, env)
target/mips/internal.h +1 -0
index 3f435b5..df55f84 100644
@@ -95,6 +95,7 @@ struct r4k_tlb_t {
     target_ulong VPN;
     uint32_t PageMask;
     uint16_t ASID;
+    uint32_t MMID;
     unsigned int G:1;
     unsigned int C0:3;
     unsigned int C1:3;
target/mips/op_helper.c +110 -19

229 lines not on this page · raw message

target/mips/translate.c +44 -2

100 lines not on this page · raw message

Signature · 1 line
2.7.4
#3 lore raw

[PULL 3/6] mips-semi.c: remove 'uhi_done' label in helper_do_semihosting()

In reply to Aleksandar Markovic

From: Daniel Henrique Barboza <[email protected]>

The label 'uhi_done' is a simple 'return' call and can be removed for a bit more clarity in the code.

Message-Id: <[email protected]>

---
 target/mips/mips-semi.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)
target/mips/mips-semi.c +7 -8
index 35bdfd7..10a710c 100644
@@ -218,7 +218,7 @@ static int copy_argn_to_target(CPUMIPSState *env, int arg_num,
         if (!p) {                               \
             gpr[2] = -1;                        \
             gpr[3] = EFAULT;                    \
-            goto uhi_done;                      \
+            return;                             \
         }                                       \
     } while (0)
 
@@ -228,14 +228,14 @@ static int copy_argn_to_target(CPUMIPSState *env, int arg_num,
         if (!p) {                                       \
             gpr[2] = -1;                                \
             gpr[3] = EFAULT;                            \
-            goto uhi_done;                              \
+            return;                                     \
         }                                               \
         p2 = lock_user_string(addr2);                   \
         if (!p2) {                                      \
             unlock_user(p, addr, 0);                    \
             gpr[2] = -1;                                \
             gpr[3] = EFAULT;                            \
-            goto uhi_done;                              \
+            return;                                     \
         }                                               \
     } while (0)
 
@@ -272,7 +272,7 @@ void helper_do_semihosting(CPUMIPSState *env)
         if (gpr[4] < 3) {
             /* ignore closing stdin/stdout/stderr */
             gpr[2] = 0;
-            goto uhi_done;
+            return;
         }
         gpr[2] = close(gpr[4]);
         gpr[3] = errno_mips(errno);
@@ -302,7 +302,7 @@ void helper_do_semihosting(CPUMIPSState *env)
             gpr[2] = fstat(gpr[4], &sbuf);
             gpr[3] = errno_mips(errno);
             if (gpr[2]) {
-                goto uhi_done;
+                return;
             }
             gpr[2] = copy_stat_to_target(env, &sbuf, gpr[5]);
             gpr[3] = errno_mips(errno);
@@ -314,14 +314,14 @@ void helper_do_semihosting(CPUMIPSState *env)
     case UHI_argnlen:
         if (gpr[4] >= semihosting_get_argc()) {
             gpr[2] = -1;
-            goto uhi_done;
+            return;
         }
         gpr[2] = strlen(semihosting_get_arg(gpr[4]));
         break;
     case UHI_argn:
         if (gpr[4] >= semihosting_get_argc()) {
             gpr[2] = -1;
-            goto uhi_done;
+            return;
         }
         gpr[2] = copy_argn_to_target(env, gpr[4], gpr[5]);
         break;
@@ -369,6 +369,5 @@ void helper_do_semihosting(CPUMIPSState *env)
         fprintf(stderr, "Unknown UHI operation %d\n", op);
         abort();
     }
-uhi_done:
     return;
 }
Signature · 1 line
2.7.4
#4 lore raw

[PULL 5/6] target/mips: Amend CP0 WatchHi register implementation

In reply to Aleksandar Markovic

From: Yongbok Kim <[email protected]>

WatchHi is extended by the field MemoryMapID with the GINVT instruction. The field is accessible by MTHC0/MFHC0 in 32-bit architectures and DMTC0/ DMFC0 in 64-bit architectures.

Message-Id: <[email protected]>

---
 target/mips/cpu.h       |  2 +-
 target/mips/helper.h    |  3 +++
 target/mips/machine.c   |  6 +++---
 target/mips/op_helper.c | 23 +++++++++++++++++++++--
 target/mips/translate.c | 42 +++++++++++++++++++++++++++++++++++++++++-
 5 files changed, 69 insertions(+), 7 deletions(-)
target/mips/cpu.h +1 -1
index c218ccc..7cf1b49 100644
@@ -961,7 +961,7 @@ struct CPUMIPSState {
 /*
  * CP0 Register 19
  */
-    int32_t CP0_WatchHi[8];
+    uint64_t CP0_WatchHi[8];
 #define CP0WH_ASID 16
 /*
  * CP0 Register 20
target/mips/helper.h +3 -0
index 7b8ad74..5b1f8bb 100644
@@ -78,6 +78,7 @@ DEF_HELPER_1(mfc0_maar, tl, env)
 DEF_HELPER_1(mfhc0_maar, tl, env)
 DEF_HELPER_2(mfc0_watchlo, tl, env, i32)
 DEF_HELPER_2(mfc0_watchhi, tl, env, i32)
+DEF_HELPER_2(mfhc0_watchhi, tl, env, i32)
 DEF_HELPER_1(mfc0_debug, tl, env)
 DEF_HELPER_1(mftc0_debug, tl, env)
 #ifdef TARGET_MIPS64
@@ -89,6 +90,7 @@ DEF_HELPER_1(dmfc0_tcschefback, tl, env)
 DEF_HELPER_1(dmfc0_lladdr, tl, env)
 DEF_HELPER_1(dmfc0_maar, tl, env)
 DEF_HELPER_2(dmfc0_watchlo, tl, env, i32)
+DEF_HELPER_2(dmfc0_watchhi, tl, env, i32)
 DEF_HELPER_1(dmfc0_saar, tl, env)
 #endif /* TARGET_MIPS64 */
 
@@ -159,6 +161,7 @@ DEF_HELPER_2(mthc0_maar, void, env, tl)
 DEF_HELPER_2(mtc0_maari, void, env, tl)
 DEF_HELPER_3(mtc0_watchlo, void, env, tl, i32)
 DEF_HELPER_3(mtc0_watchhi, void, env, tl, i32)
+DEF_HELPER_3(mthc0_watchhi, void, env, tl, i32)
 DEF_HELPER_2(mtc0_xcontext, void, env, tl)
 DEF_HELPER_2(mtc0_framemask, void, env, tl)
 DEF_HELPER_2(mtc0_debug, void, env, tl)
target/mips/machine.c +3 -3
index c139239..8d5b18b 100644
@@ -212,8 +212,8 @@ const VMStateDescription vmstate_tlb = {
 
 const VMStateDescription vmstate_mips_cpu = {
     .name = "cpu",
-    .version_id = 18,
-    .minimum_version_id = 18,
+    .version_id = 19,
+    .minimum_version_id = 19,
     .post_load = cpu_post_load,
     .fields = (VMStateField[]) {
         /* Active TC */
@@ -296,7 +296,7 @@ const VMStateDescription vmstate_mips_cpu = {
         VMSTATE_INT32(env.CP0_MAARI, MIPSCPU),
         VMSTATE_UINTTL(env.lladdr, MIPSCPU),
         VMSTATE_UINTTL_ARRAY(env.CP0_WatchLo, MIPSCPU, 8),
-        VMSTATE_INT32_ARRAY(env.CP0_WatchHi, MIPSCPU, 8),
+        VMSTATE_UINT64_ARRAY(env.CP0_WatchHi, MIPSCPU, 8),
         VMSTATE_UINTTL(env.CP0_XContext, MIPSCPU),
         VMSTATE_INT32(env.CP0_Framemask, MIPSCPU),
         VMSTATE_INT32(env.CP0_Debug, MIPSCPU),
target/mips/op_helper.c +21 -2
index 79d44da..7425a88 100644
@@ -945,7 +945,12 @@ target_ulong helper_mfc0_watchlo(CPUMIPSState *env, uint32_t sel)
 
 target_ulong helper_mfc0_watchhi(CPUMIPSState *env, uint32_t sel)
 {
-    return env->CP0_WatchHi[sel];
+    return (int32_t) env->CP0_WatchHi[sel];
+}
+
+target_ulong helper_mfhc0_watchhi(CPUMIPSState *env, uint32_t sel)
+{
+    return env->CP0_WatchHi[sel] >> 32;
 }
 
 target_ulong helper_mfc0_debug(CPUMIPSState *env)
@@ -1016,6 +1021,11 @@ target_ulong helper_dmfc0_watchlo(CPUMIPSState *env, uint32_t sel)
     return env->CP0_WatchLo[sel];
 }
 
+target_ulong helper_dmfc0_watchhi(CPUMIPSState *env, uint32_t sel)
+{
+    return env->CP0_WatchHi[sel];
+}
+
 target_ulong helper_dmfc0_saar(CPUMIPSState *env)
 {
     if ((env->CP0_SAARI & 0x3f) < 2) {
@@ -1869,11 +1879,20 @@ void helper_mtc0_watchlo(CPUMIPSState *env, target_ulong arg1, uint32_t sel)
 
 void helper_mtc0_watchhi(CPUMIPSState *env, target_ulong arg1, uint32_t sel)
 {
-    int mask = 0x40000FF8 | (env->CP0_EntryHi_ASID_mask << CP0WH_ASID);
+    uint64_t mask = 0x40000FF8 | (env->CP0_EntryHi_ASID_mask << CP0WH_ASID);
+    if ((env->CP0_Config5 >> CP0C5_MI) & 1) {
+        mask |= 0xFFFFFFFF00000000ULL; /* MMID */
+    }
     env->CP0_WatchHi[sel] = arg1 & mask;
     env->CP0_WatchHi[sel] &= ~(env->CP0_WatchHi[sel] & arg1 & 0x7);
 }
 
+void helper_mthc0_watchhi(CPUMIPSState *env, target_ulong arg1, uint32_t sel)
+{
+    env->CP0_WatchHi[sel] = ((uint64_t) (arg1) << 32) |
+                            (env->CP0_WatchHi[sel] & 0x00000000ffffffffULL);
+}
+
 void helper_mtc0_xcontext(CPUMIPSState *env, target_ulong arg1)
 {
     target_ulong mask = (1ULL << (env->SEGBITS - 7)) - 1;
target/mips/translate.c +41 -1

72 lines not on this page · raw message

Signature · 1 line
2.7.4
#5 lore raw

[PULL 2/6] disas: Add a field for target-dependant data

In reply to Aleksandar Markovic

From: Aleksandar Markovic <[email protected]>

This patch adds a field "target_info" to the structure disassemble_info. The purpose of this field is to enable targets to pass to disassembler code any additional data thet deem suitable.

Message-Id: <[email protected]>

---
 include/disas/dis-asm.h | 3 +++
 1 file changed, 3 insertions(+)
include/disas/dis-asm.h +3 -0
index e9c7dd8..f87f468 100644
@@ -372,6 +372,9 @@ typedef struct disassemble_info {
   /* Command line options specific to the target disassembler.  */
   char * disassembler_options;
 
+  /* Field intended to be used by targets in any way they deem suitable.  */
+  int64_t target_info;
+
   /* Options for Capstone disassembly.  */
   int cap_arch;
   int cap_mode;
Signature · 1 line
2.7.4
#6 lore raw

[PULL 4/6] hw/core/loader: Let load_elf() populate the processor-specific flags

In reply to Aleksandar Markovic

From: Philippe Mathieu-Daudé <[email protected]>

While loading the executable, some platforms (like AVR) need to determine CPU type that executable is built for by reading the field 'e_flags' of the ELF header of tha executable.

This patch enables such discovery of that field while using any of the following functions:

- load_elf()
- load_elf_as()
- load_elf_ram()
- load_elf_ram_sym()

The argument added to these functions is called 'pflags' and is of type 'uint32_t*' (that matches the the pointer to the 'elf_word' - the type of the field 'e_flags' in both 32-bit and 64-bit variants of ELF header). Callers are allowed to pass NULL as that argument, and in such case no lookup to the field 'e_flags' will happen, and no information will be returned, of course.

CC Richard Henderson <[email protected]>
CC Peter Maydell <[email protected]>
CC Edgar E. Iglesias <[email protected]>
CC Michael Walle <[email protected]>
CC Thomas Huth <[email protected]>
CC Laurent Vivier <[email protected]>
CC Philippe Mathieu-Daudé <[email protected]>
CC Aleksandar Rikalo <[email protected]>
CC Aurelien Jarno <[email protected]>
CC Jia Liu <[email protected]>
CC David Gibson <[email protected]>
CC Mark Cave-Ayland <[email protected]>
CC BALATON Zoltan <[email protected]>
CC Christian Borntraeger <[email protected]>
CC Thomas Huth <[email protected]>
CC Artyom Tarasenko <[email protected]>
CC Fabien Chouteau <[email protected]>
CC KONRAD Frederic <[email protected]>
CC Max Filippov <[email protected]>

Message-Id: <[email protected]>

---
 hw/alpha/dp264.c               |  4 ++--
 hw/arm/armv7m.c                |  2 +-
 hw/arm/boot.c                  |  2 +-
 hw/core/generic-loader.c       |  2 +-
 hw/core/loader.c               | 37 +++++++++++++++++++------------------
 hw/cris/boot.c                 |  2 +-
 hw/hppa/machine.c              |  4 ++--
 hw/i386/multiboot.c            |  2 +-
 hw/i386/x86.c                  |  2 +-
 hw/lm32/lm32_boards.c          |  4 ++--
 hw/lm32/milkymist.c            |  2 +-
 hw/m68k/an5206.c               |  2 +-
 hw/m68k/mcf5208.c              |  2 +-
 hw/m68k/q800.c                 |  2 +-
 hw/microblaze/boot.c           |  4 ++--
 hw/mips/mips_fulong2e.c        |  2 +-
 hw/mips/mips_malta.c           |  3 ++-
 hw/mips/mips_mipssim.c         |  2 +-
 hw/mips/mips_r4k.c             |  2 +-
 hw/moxie/moxiesim.c            |  2 +-
 hw/nios2/boot.c                |  4 ++--
 hw/openrisc/openrisc_sim.c     |  2 +-
 hw/pci-host/prep.c             |  3 ++-
 hw/ppc/e500.c                  |  2 +-
 hw/ppc/mac_newworld.c          |  4 ++--
 hw/ppc/mac_oldworld.c          |  4 ++--
 hw/ppc/ppc440_bamboo.c         |  2 +-
 hw/ppc/sam460ex.c              |  3 ++-
 hw/ppc/spapr.c                 |  6 +++---
 hw/ppc/virtex_ml507.c          |  2 +-
 hw/riscv/boot.c                |  4 ++--
 hw/s390x/ipl.c                 |  7 ++++---
 hw/sparc/leon3.c               |  2 +-
 hw/sparc/sun4m.c               |  4 ++--
 hw/sparc64/sun4u.c             |  5 +++--
 hw/tricore/tricore_testboard.c |  2 +-
 hw/xtensa/sim.c                |  2 +-
 hw/xtensa/xtfpga.c             |  2 +-
 include/hw/elf_ops.h           |  6 +++++-
 include/hw/loader.h            | 21 ++++++++++++---------
 40 files changed, 92 insertions(+), 79 deletions(-)
hw/alpha/dp264.c +2 -2
index f2026fd..a8f9a89 100644
@@ -115,7 +115,7 @@ static void clipper_init(MachineState *machine)
         exit(1);
     }
     size = load_elf(palcode_filename, NULL, cpu_alpha_superpage_to_phys,
-                    NULL, &palcode_entry, &palcode_low, &palcode_high,
+                    NULL, &palcode_entry, &palcode_low, &palcode_high, NULL,
                     0, EM_ALPHA, 0, 0);
     if (size < 0) {
         error_report("could not load palcode '%s'", palcode_filename);
@@ -134,7 +134,7 @@ static void clipper_init(MachineState *machine)
         uint64_t param_offset;
 
         size = load_elf(kernel_filename, NULL, cpu_alpha_superpage_to_phys,
-                        NULL, &kernel_entry, &kernel_low, &kernel_high,
+                        NULL, &kernel_entry, &kernel_low, &kernel_high, NULL,
                         0, EM_ALPHA, 0, 0);
         if (size < 0) {
             error_report("could not load kernel '%s'", kernel_filename);
hw/arm/armv7m.c +1 -1
index 5d4a581..7531b97 100644
@@ -331,7 +331,7 @@ void armv7m_load_kernel(ARMCPU *cpu, const char *kernel_filename, int mem_size)
 
     if (kernel_filename) {
         image_size = load_elf_as(kernel_filename, NULL, NULL, NULL,
-                                 &entry, &lowaddr,
+                                 &entry, &lowaddr, NULL,
                                  NULL, big_endian, EM_ARM, 1, 0, as);
         if (image_size < 0) {
             image_size = load_image_targphys_as(kernel_filename, 0,
hw/arm/boot.c +1 -1
index 8fb4a63..0c213ca 100644
@@ -903,7 +903,7 @@ static int64_t arm_load_elf(struct arm_boot_info *info, uint64_t *pentry,
     }
 
     ret = load_elf_as(info->kernel_filename, NULL, NULL, NULL,
-                      pentry, lowaddr, highaddr, big_endian, elf_machine,
+                      pentry, lowaddr, highaddr, NULL, big_endian, elf_machine,
                       1, data_swab, as);
     if (ret <= 0) {
         /* The header loaded but the image didn't */
hw/core/generic-loader.c +1 -1
index e7eb57e..b9aaa52 100644
@@ -140,7 +140,7 @@ static void generic_loader_realize(DeviceState *dev, Error **errp)
 
         if (!s->force_raw) {
             size = load_elf_as(s->file, NULL, NULL, NULL, &entry, NULL, NULL,
-                               big_endian, 0, 0, 0, as);
+                               NULL, big_endian, 0, 0, 0, as);
 
             if (size < 0) {
                 size = load_uimage_as(s->file, &entry, NULL, NULL, NULL, NULL,
hw/core/loader.c +19 -18
index 5099f27..d1b78f6 100644
@@ -406,12 +406,12 @@ int load_elf(const char *filename,
              uint64_t (*elf_note_fn)(void *, void *, bool),
              uint64_t (*translate_fn)(void *, uint64_t),
              void *translate_opaque, uint64_t *pentry, uint64_t *lowaddr,
-             uint64_t *highaddr, int big_endian, int elf_machine,
-             int clear_lsb, int data_swab)
+             uint64_t *highaddr, uint32_t *pflags, int big_endian,
+             int elf_machine, int clear_lsb, int data_swab)
 {
     return load_elf_as(filename, elf_note_fn, translate_fn, translate_opaque,
-                       pentry, lowaddr, highaddr, big_endian, elf_machine,
-                       clear_lsb, data_swab, NULL);
+                       pentry, lowaddr, highaddr, pflags, big_endian,
+                       elf_machine, clear_lsb, data_swab, NULL);
 }
 
 /* return < 0 if error, otherwise the number of bytes loaded in memory */
@@ -419,12 +419,12 @@ int load_elf_as(const char *filename,
                 uint64_t (*elf_note_fn)(void *, void *, bool),
                 uint64_t (*translate_fn)(void *, uint64_t),
                 void *translate_opaque, uint64_t *pentry, uint64_t *lowaddr,
-                uint64_t *highaddr, int big_endian, int elf_machine,
-                int clear_lsb, int data_swab, AddressSpace *as)
+                uint64_t *highaddr, uint32_t *pflags, int big_endian,
+                int elf_machine, int clear_lsb, int data_swab, AddressSpace *as)
 {
     return load_elf_ram(filename, elf_note_fn, translate_fn, translate_opaque,
-                        pentry, lowaddr, highaddr, big_endian, elf_machine,
-                        clear_lsb, data_swab, as, true);
+                        pentry, lowaddr, highaddr, pflags, big_endian,
+                        elf_machine, clear_lsb, data_swab, as, true);
 }
 
 /* return < 0 if error, otherwise the number of bytes loaded in memory */
@@ -432,13 +432,13 @@ int load_elf_ram(const char *filename,
                  uint64_t (*elf_note_fn)(void *, void *, bool),
                  uint64_t (*translate_fn)(void *, uint64_t),
                  void *translate_opaque, uint64_t *pentry, uint64_t *lowaddr,
-                 uint64_t *highaddr, int big_endian, int elf_machine,
-                 int clear_lsb, int data_swab, AddressSpace *as,
-                 bool load_rom)
+                 uint64_t *highaddr, uint32_t *pflags, int big_endian,
+                 int elf_machine, int clear_lsb, int data_swab,
+                 AddressSpace *as, bool load_rom)
 {
     return load_elf_ram_sym(filename, elf_note_fn,
                             translate_fn, translate_opaque,
-                            pentry, lowaddr, highaddr, big_endian,
+                            pentry, lowaddr, highaddr, pflags, big_endian,
                             elf_machine, clear_lsb, data_swab, as,
                             load_rom, NULL);
 }
@@ -448,8 +448,9 @@ int load_elf_ram_sym(const char *filename,
                      uint64_t (*elf_note_fn)(void *, void *, bool),
                      uint64_t (*translate_fn)(void *, uint64_t),
                      void *translate_opaque, uint64_t *pentry,
-                     uint64_t *lowaddr, uint64_t *highaddr, int big_endian,
-                     int elf_machine, int clear_lsb, int data_swab,
+                     uint64_t *lowaddr, uint64_t *highaddr, uint32_t *pflags,
+                     int big_endian, int elf_machine,
+                     int clear_lsb, int data_swab,
                      AddressSpace *as, bool load_rom, symbol_fn_t sym_cb)
 {
     int fd, data_order, target_data_order, must_swab, ret = ELF_LOAD_FAILED;
@@ -490,13 +491,13 @@ int load_elf_ram_sym(const char *filename,
     if (e_ident[EI_CLASS] == ELFCLASS64) {
         ret = load_elf64(filename, fd, elf_note_fn,
                          translate_fn, translate_opaque, must_swab,
-                         pentry, lowaddr, highaddr, elf_machine, clear_lsb,
-                         data_swab, as, load_rom, sym_cb);
+                         pentry, lowaddr, highaddr, pflags, elf_machine,
+                         clear_lsb, data_swab, as, load_rom, sym_cb);
     } else {
         ret = load_elf32(filename, fd, elf_note_fn,
                          translate_fn, translate_opaque, must_swab,
-                         pentry, lowaddr, highaddr, elf_machine, clear_lsb,
-                         data_swab, as, load_rom, sym_cb);
+                         pentry, lowaddr, highaddr, pflags, elf_machine,
+                         clear_lsb, data_swab, as, load_rom, sym_cb);
     }
 
  fail:
hw/cris/boot.c +1 -1
index 2d2cc0c..b8947bc 100644
@@ -76,7 +76,7 @@ void cris_load_image(CRISCPU *cpu, struct cris_load_info *li)
        devboard SDK.  */
     image_size = load_elf(li->image_filename, NULL,
                           translate_kernel_address, NULL,
-                          &entry, NULL, &high, 0, EM_CRIS, 0, 0);
+                          &entry, NULL, &high, NULL, 0, EM_CRIS, 0, 0);
     li->entry = entry;
     if (image_size < 0) {
         /* Takes a kimage from the axis devboard SDK.  */
hw/hppa/machine.c +2 -2
index 2d62a24..d8755ec 100644
@@ -155,7 +155,7 @@ static void machine_hppa_init(MachineState *machine)
     }
 
     size = load_elf(firmware_filename, NULL, NULL, NULL,
-                    &firmware_entry, &firmware_low, &firmware_high,
+                    &firmware_entry, &firmware_low, &firmware_high, NULL,
                     true, EM_PARISC, 0, 0);
 
     /* Unfortunately, load_elf sign-extends reading elf32.  */
@@ -184,7 +184,7 @@ static void machine_hppa_init(MachineState *machine)
     /* Load kernel */
     if (kernel_filename) {
         size = load_elf(kernel_filename, NULL, &cpu_hppa_to_phys,
-                        NULL, &kernel_entry, &kernel_low, &kernel_high,
+                        NULL, &kernel_entry, &kernel_low, &kernel_high, NULL,
                         true, EM_PARISC, 0, 0);
 
         /* Unfortunately, load_elf sign-extends reading elf32.  */
hw/i386/multiboot.c +1 -1
index 9a59f95..9e7d69d 100644
@@ -199,7 +199,7 @@ int load_multiboot(FWCfgState *fw_cfg,
         }
 
         kernel_size = load_elf(kernel_filename, NULL, NULL, NULL, &elf_entry,
-                               &elf_low, &elf_high, 0, I386_ELF_MACHINE,
+                               &elf_low, &elf_high, NULL, 0, I386_ELF_MACHINE,
                                0, 0);
         if (kernel_size < 0) {
             error_report("Error while loading elf kernel");
hw/i386/x86.c +1 -1
index 9b9a4d5..7f38e6b 100644
@@ -413,7 +413,7 @@ static bool load_elfboot(const char *kernel_filename,
     uint64_t elf_note_type = XEN_ELFNOTE_PHYS32_ENTRY;
     kernel_size = load_elf(kernel_filename, read_pvh_start_addr,
                            NULL, &elf_note_type, &elf_entry,
-                           &elf_low, &elf_high, 0, I386_ELF_MACHINE,
+                           &elf_low, &elf_high, NULL, 0, I386_ELF_MACHINE,
                            0, 0);
 
     if (kernel_size < 0) {
hw/lm32/lm32_boards.c +2 -2
index 5ae308b..d1894ad 100644
@@ -138,7 +138,7 @@ static void lm32_evr_init(MachineState *machine)
         int kernel_size;
 
         kernel_size = load_elf(kernel_filename, NULL, NULL, NULL,
-                               &entry, NULL, NULL,
+                               &entry, NULL, NULL, NULL,
                                1, EM_LATTICEMICO32, 0, 0);
         reset_info->bootstrap_pc = entry;
 
@@ -232,7 +232,7 @@ static void lm32_uclinux_init(MachineState *machine)
         int kernel_size;
 
         kernel_size = load_elf(kernel_filename, NULL, NULL, NULL,
-                               &entry, NULL, NULL,
+                               &entry, NULL, NULL, NULL,
                                1, EM_LATTICEMICO32, 0, 0);
         reset_info->bootstrap_pc = entry;
 
hw/lm32/milkymist.c +1 -1
index 460d322..6d46134 100644
@@ -177,7 +177,7 @@ milkymist_init(MachineState *machine)
 
         /* Boots a kernel elf binary.  */
         kernel_size = load_elf(kernel_filename, NULL, NULL, NULL,
-                               &entry, NULL, NULL,
+                               &entry, NULL, NULL, NULL,
                                1, EM_LATTICEMICO32, 0, 0);
         reset_info->bootstrap_pc = entry;
 
hw/m68k/an5206.c +1 -1
index 54ccbe1..bed43a9 100644
@@ -65,7 +65,7 @@ static void an5206_init(MachineState *machine)
     }
 
     kernel_size = load_elf(kernel_filename, NULL, NULL, NULL, &elf_entry,
-                           NULL, NULL, 1, EM_68K, 0, 0);
+                           NULL, NULL, NULL, 1, EM_68K, 0, 0);
     entry = elf_entry;
     if (kernel_size < 0) {
         kernel_size = load_uimage(kernel_filename, &entry, NULL, NULL,
hw/m68k/mcf5208.c +1 -1
index 158c5e4..a999c21 100644
@@ -329,7 +329,7 @@ static void mcf5208evb_init(MachineState *machine)
     }
 
     kernel_size = load_elf(kernel_filename, NULL, NULL, NULL, &elf_entry,
-                           NULL, NULL, 1, EM_68K, 0, 0);
+                           NULL, NULL, NULL, 1, EM_68K, 0, 0);
     entry = elf_entry;
     if (kernel_size < 0) {
         kernel_size = load_uimage(kernel_filename, &entry, NULL, NULL,
hw/m68k/q800.c +1 -1
index 12491ec..1e32363 100644
@@ -342,7 +342,7 @@ static void q800_init(MachineState *machine)
     if (linux_boot) {
         uint64_t high;
         kernel_size = load_elf(kernel_filename, NULL, NULL, NULL,
-                               &elf_entry, NULL, &high, 1,
+                               &elf_entry, NULL, &high, NULL, 1,
                                EM_68K, 0, 0);
         if (kernel_size < 0) {
             error_report("could not load kernel '%s'", kernel_filename);
hw/microblaze/boot.c +2 -2
index d1d7dfb..925e3f7 100644
@@ -145,13 +145,13 @@ void microblaze_load_kernel(MicroBlazeCPU *cpu, hwaddr ddr_base,
 
         /* Boots a kernel elf binary.  */
         kernel_size = load_elf(kernel_filename, NULL, NULL, NULL,
-                               &entry, &low, &high,
+                               &entry, &low, &high, NULL,
                                big_endian, EM_MICROBLAZE, 0, 0);
         base32 = entry;
         if (base32 == 0xc0000000) {
             kernel_size = load_elf(kernel_filename, NULL,
                                    translate_kernel_address, NULL,
-                                   &entry, NULL, NULL,
+                                   &entry, NULL, NULL, NULL,
                                    big_endian, EM_MICROBLAZE, 0, 0);
         }
         /* Always boot into physical ram.  */
hw/mips/mips_fulong2e.c +1 -1
index 9eaa6e2..2e043cb 100644
@@ -119,7 +119,7 @@ static int64_t load_kernel(CPUMIPSState *env)
                            cpu_mips_kseg0_to_phys, NULL,
                            (uint64_t *)&kernel_entry,
                            (uint64_t *)&kernel_low, (uint64_t *)&kernel_high,
-                           0, EM_MIPS, 1, 0);
+                           NULL, 0, EM_MIPS, 1, 0);
     if (kernel_size < 0) {
         error_report("could not load kernel '%s': %s",
                      loaderparams.kernel_filename,
hw/mips/mips_malta.c +2 -1
index 5aaeaa8..34b76bb 100644
@@ -1039,7 +1039,8 @@ static int64_t load_kernel(void)
     kernel_size = load_elf(loaderparams.kernel_filename, NULL,
                            cpu_mips_kseg0_to_phys, NULL,
                            (uint64_t *)&kernel_entry, NULL,
-                           (uint64_t *)&kernel_high, big_endian, EM_MIPS, 1, 0);
+                           (uint64_t *)&kernel_high, NULL, big_endian, EM_MIPS,
+                           1, 0);
     if (kernel_size < 0) {
         error_report("could not load kernel '%s': %s",
                      loaderparams.kernel_filename,
hw/mips/mips_mipssim.c +1 -1
index 84c03dd..b934ca9 100644
@@ -74,7 +74,7 @@ static int64_t load_kernel(void)
     kernel_size = load_elf(loaderparams.kernel_filename, NULL,
                            cpu_mips_kseg0_to_phys, NULL,
                            (uint64_t *)&entry, NULL,
-                           (uint64_t *)&kernel_high, big_endian,
+                           (uint64_t *)&kernel_high, NULL, big_endian,
                            EM_MIPS, 1, 0);
     if (kernel_size >= 0) {
         if ((entry & ~0x7fffffffULL) == 0x80000000) {
hw/mips/mips_r4k.c +1 -1
index fd926a3..b2aec43 100644
@@ -98,7 +98,7 @@ static int64_t load_kernel(void)
     kernel_size = load_elf(loaderparams.kernel_filename, NULL,
                            cpu_mips_kseg0_to_phys, NULL,
                            (uint64_t *)&entry, NULL,
-                           (uint64_t *)&kernel_high, big_endian,
+                           (uint64_t *)&kernel_high, NULL, big_endian,
                            EM_MIPS, 1, 0);
     if (kernel_size >= 0) {
         if ((entry & ~0x7fffffffULL) == 0x80000000) {
hw/moxie/moxiesim.c +1 -1
index 57af1b4..1d06e39 100644
@@ -58,7 +58,7 @@ static void load_kernel(MoxieCPU *cpu, LoaderParams *loader_params)
     ram_addr_t initrd_offset;
 
     kernel_size = load_elf(loader_params->kernel_filename,  NULL, NULL, NULL,
-                           &entry, &kernel_low, &kernel_high, 1, EM_MOXIE,
+                           &entry, &kernel_low, &kernel_high, NULL, 1, EM_MOXIE,
                            0, 0);
 
     if (kernel_size <= 0) {
hw/nios2/boot.c +2 -2
index d78bc9e..46b8349 100644
@@ -147,7 +147,7 @@ void nios2_load_kernel(Nios2CPU *cpu, hwaddr ddr_base,
 
         /* Boots a kernel elf binary. */
         kernel_size = load_elf(kernel_filename, NULL, NULL, NULL,
-                               &entry, &low, &high,
+                               &entry, &low, &high, NULL,
                                big_endian, EM_ALTERA_NIOS2, 0, 0);
         if ((uint32_t)entry == 0xc0000000) {
             /*
@@ -158,7 +158,7 @@ void nios2_load_kernel(Nios2CPU *cpu, hwaddr ddr_base,
              */
             kernel_size = load_elf(kernel_filename, NULL,
                                    translate_kernel_address, NULL,
-                                   &entry, NULL, NULL,
+                                   &entry, NULL, NULL, NULL,
                                    big_endian, EM_ALTERA_NIOS2, 0, 0);
             boot_info.bootstrap_pc = ddr_base + 0xc0000000 +
                 (entry & 0x07ffffff);
hw/openrisc/openrisc_sim.c +1 -1
index 79e7049..ad53712 100644
@@ -98,7 +98,7 @@ static void openrisc_load_kernel(ram_addr_t ram_size,
 
     if (kernel_filename && !qtest_enabled()) {
         kernel_size = load_elf(kernel_filename, NULL, NULL, NULL,
-                               &elf_entry, NULL, NULL, 1, EM_OPENRISC,
+                               &elf_entry, NULL, NULL, NULL, 1, EM_OPENRISC,
                                1, 0);
         entry = elf_entry;
         if (kernel_size < 0) {
hw/pci-host/prep.c +2 -1
index f2f8821..1aff72b 100644
@@ -335,7 +335,8 @@ static void raven_realize(PCIDevice *d, Error **errp)
         if (filename) {
             if (s->elf_machine != EM_NONE) {
                 bios_size = load_elf(filename, NULL, NULL, NULL, NULL,
-                                     NULL, NULL, 1, s->elf_machine, 0, 0);
+                                     NULL, NULL, NULL, 1, s->elf_machine,
+                                     0, 0);
             }
             if (bios_size < 0) {
                 bios_size = get_image_size(filename);
hw/ppc/e500.c +1 -1
index 12b6a5b..886442e 100644
@@ -1049,7 +1049,7 @@ void ppce500_init(MachineState *machine)
     filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, payload_name);
 
     payload_size = load_elf(filename, NULL, NULL, NULL,
-                            &bios_entry, &loadaddr, NULL,
+                            &bios_entry, &loadaddr, NULL, NULL,
                             1, PPC_ELF_MACHINE, 0, 0);
     if (payload_size < 0) {
         /*
hw/ppc/mac_newworld.c +2 -2
index 3594517..464d012 100644
@@ -168,7 +168,7 @@ static void ppc_core99_init(MachineState *machine)
     /* Load OpenBIOS (ELF) */
     if (filename) {
         bios_size = load_elf(filename, NULL, NULL, NULL, NULL,
-                             NULL, NULL, 1, PPC_ELF_MACHINE, 0, 0);
+                             NULL, NULL, NULL, 1, PPC_ELF_MACHINE, 0, 0);
 
         g_free(filename);
     } else {
@@ -192,7 +192,7 @@ static void ppc_core99_init(MachineState *machine)
 
         kernel_size = load_elf(kernel_filename, NULL,
                                translate_kernel_address, NULL,
-                               NULL, &lowaddr, NULL, 1, PPC_ELF_MACHINE,
+                               NULL, &lowaddr, NULL, NULL, 1, PPC_ELF_MACHINE,
                                0, 0);
         if (kernel_size < 0)
             kernel_size = load_aout(kernel_filename, kernel_base,
hw/ppc/mac_oldworld.c +2 -2
index 0fa680b..7318d7e 100644
@@ -143,7 +143,7 @@ static void ppc_heathrow_init(MachineState *machine)
 
     /* Load OpenBIOS (ELF) */
     if (filename) {
-        bios_size = load_elf(filename, NULL, 0, NULL, NULL, NULL, NULL,
+        bios_size = load_elf(filename, NULL, 0, NULL, NULL, NULL, NULL, NULL,
                              1, PPC_ELF_MACHINE, 0, 0);
         g_free(filename);
     } else {
@@ -166,7 +166,7 @@ static void ppc_heathrow_init(MachineState *machine)
         kernel_base = KERNEL_LOAD_ADDR;
         kernel_size = load_elf(kernel_filename, NULL,
                                translate_kernel_address, NULL,
-                               NULL, &lowaddr, NULL, 1, PPC_ELF_MACHINE,
+                               NULL, &lowaddr, NULL, NULL, 1, PPC_ELF_MACHINE,
                                0, 0);
         if (kernel_size < 0)
             kernel_size = load_aout(kernel_filename, kernel_base,
hw/ppc/ppc440_bamboo.c +1 -1
index b782641..da777ef 100644
@@ -253,7 +253,7 @@ static void bamboo_init(MachineState *machine)
                               NULL, NULL);
         if (success < 0) {
             success = load_elf(kernel_filename, NULL, NULL, NULL, &elf_entry,
-                               &elf_lowaddr, NULL, 1, PPC_ELF_MACHINE,
+                               &elf_lowaddr, NULL, NULL, 1, PPC_ELF_MACHINE,
                                0, 0);
             entry = elf_entry;
             loadaddr = elf_lowaddr;
hw/ppc/sam460ex.c +2 -1
index 437e214..89bc70e 100644
@@ -439,7 +439,8 @@ static void sam460ex_init(MachineState *machine)
 
             success = load_elf(machine->kernel_filename, NULL,
                                NULL, NULL, &elf_entry,
-                               &elf_lowaddr, NULL, 1, PPC_ELF_MACHINE, 0, 0);
+                               &elf_lowaddr, NULL, NULL, 1, PPC_ELF_MACHINE, 0,
+                               0);
             entry = elf_entry;
             loadaddr = elf_lowaddr;
         }
hw/ppc/spapr.c +3 -3
index 02cf53f..a0076e5 100644
@@ -2895,13 +2895,13 @@ static void spapr_machine_init(MachineState *machine)
 
         spapr->kernel_size = load_elf(kernel_filename, NULL,
                                       translate_kernel_address, NULL,
-                                      NULL, &lowaddr, NULL, 1,
+                                      NULL, &lowaddr, NULL, NULL, 1,
                                       PPC_ELF_MACHINE, 0, 0);
         if (spapr->kernel_size == ELF_LOAD_WRONG_ENDIAN) {
             spapr->kernel_size = load_elf(kernel_filename, NULL,
                                           translate_kernel_address, NULL, NULL,
-                                          &lowaddr, NULL, 0, PPC_ELF_MACHINE,
-                                          0, 0);
+                                          &lowaddr, NULL, NULL, 0,
+                                          PPC_ELF_MACHINE, 0, 0);
             spapr->kernel_le = spapr->kernel_size > 0;
         }
         if (spapr->kernel_size < 0) {
hw/ppc/virtex_ml507.c +1 -1
index 6862552..7526947 100644
@@ -259,7 +259,7 @@ static void virtex_init(MachineState *machine)
 
         /* Boots a kernel elf binary.  */
         kernel_size = load_elf(kernel_filename, NULL, NULL, NULL,
-                               &entry, &low, &high, 1, PPC_ELF_MACHINE,
+                               &entry, &low, &high, NULL, 1, PPC_ELF_MACHINE,
                                0, 0);
         boot_info.bootstrap_pc = entry & 0x00ffffff;
 
hw/riscv/boot.c +2 -2
index 027303d..b8e7652 100644
@@ -101,7 +101,7 @@ target_ulong riscv_load_firmware(const char *firmware_filename,
     uint64_t firmware_entry, firmware_start, firmware_end;
 
     if (load_elf(firmware_filename, NULL, NULL, NULL, &firmware_entry,
-                 &firmware_start, &firmware_end, 0, EM_RISCV, 1, 0) > 0) {
+                 &firmware_start, &firmware_end, NULL, 0, EM_RISCV, 1, 0) > 0) {
         return firmware_entry;
     }
 
@@ -119,7 +119,7 @@ target_ulong riscv_load_kernel(const char *kernel_filename, symbol_fn_t sym_cb)
     uint64_t kernel_entry, kernel_high;
 
     if (load_elf_ram_sym(kernel_filename, NULL, NULL, NULL,
-                         &kernel_entry, NULL, &kernel_high, 0,
+                         &kernel_entry, NULL, &kernel_high, NULL, 0,
                          EM_RISCV, 1, 0, NULL, true, sym_cb) > 0) {
         return kernel_entry;
     }
hw/s390x/ipl.c +4 -3
index b3ae901..ca8e7db 100644
@@ -139,7 +139,7 @@ static void s390_ipl_realize(DeviceState *dev, Error **errp)
 
         bios_size = load_elf(bios_filename, NULL,
                              bios_translate_addr, &fwbase,
-                             &ipl->bios_start_addr, NULL, NULL, 1,
+                             &ipl->bios_start_addr, NULL, NULL, NULL, 1,
                              EM_S390, 0, 0);
         if (bios_size > 0) {
             /* Adjust ELF start address to final location */
@@ -164,7 +164,7 @@ static void s390_ipl_realize(DeviceState *dev, Error **errp)
     if (ipl->kernel) {
         kernel_size = load_elf(ipl->kernel, NULL, NULL, NULL,
                                &pentry, NULL,
-                               NULL, 1, EM_S390, 0, 0);
+                               NULL, NULL, 1, EM_S390, 0, 0);
         if (kernel_size < 0) {
             kernel_size = load_image_targphys(ipl->kernel, 0, ram_size);
             if (kernel_size < 0) {
@@ -473,7 +473,8 @@ static int load_netboot_image(Error **errp)
 
     img_size = load_elf_ram(netboot_filename, NULL, NULL, NULL,
                             &ipl->start_addr,
-                            NULL, NULL, 1, EM_S390, 0, 0, NULL, false);
+                            NULL, NULL, NULL, 1, EM_S390, 0, 0, NULL,
+                            false);
 
     if (img_size < 0) {
         img_size = load_image_size(netboot_filename, ram_ptr, ram_size);
hw/sparc/leon3.c +1 -1
index 8038887..f5a087d 100644
@@ -297,7 +297,7 @@ static void leon3_generic_hw_init(MachineState *machine)
         uint64_t entry;
 
         kernel_size = load_elf(kernel_filename, NULL, NULL, NULL,
-                               &entry, NULL, NULL,
+                               &entry, NULL, NULL, NULL,
                                1 /* big endian */, EM_SPARC, 0, 0);
         if (kernel_size < 0) {
             kernel_size = load_uimage(kernel_filename, NULL, &entry,
hw/sparc/sun4m.c +2 -2
index df33b32..25e96db 100644
@@ -270,7 +270,7 @@ static unsigned long sun4m_load_kernel(const char *kernel_filename,
 #endif
         kernel_size = load_elf(kernel_filename, NULL,
                                translate_kernel_address, NULL,
-                               NULL, NULL, NULL, 1, EM_SPARC, 0, 0);
+                               NULL, NULL, NULL, NULL, 1, EM_SPARC, 0, 0);
         if (kernel_size < 0)
             kernel_size = load_aout(kernel_filename, KERNEL_LOAD_ADDR,
                                     RAM_size - KERNEL_LOAD_ADDR, bswap_needed,
@@ -721,7 +721,7 @@ static void prom_init(hwaddr addr, const char *bios_name)
     if (filename) {
         ret = load_elf(filename, NULL,
                        translate_prom_address, &addr, NULL,
-                       NULL, NULL, 1, EM_SPARC, 0, 0);
+                       NULL, NULL, NULL, 1, EM_SPARC, 0, 0);
         if (ret < 0 || ret > PROM_SIZE_MAX) {
             ret = load_image_targphys(filename, addr, PROM_SIZE_MAX);
         }
hw/sparc64/sun4u.c +3 -2
index 5d710d6..b7ac42f 100644
@@ -175,7 +175,8 @@ static uint64_t sun4u_load_kernel(const char *kernel_filename,
         bswap_needed = 0;
 #endif
         kernel_size = load_elf(kernel_filename, NULL, NULL, NULL, kernel_entry,
-                               kernel_addr, &kernel_top, 1, EM_SPARCV9, 0, 0);
+                               kernel_addr, &kernel_top, NULL, 1, EM_SPARCV9, 0,
+                               0);
         if (kernel_size < 0) {
             *kernel_addr = KERNEL_LOAD_ADDR;
             *kernel_entry = KERNEL_LOAD_ADDR;
@@ -439,7 +440,7 @@ static void prom_init(hwaddr addr, const char *bios_name)
     filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
     if (filename) {
         ret = load_elf(filename, NULL, translate_prom_address, &addr,
-                       NULL, NULL, NULL, 1, EM_SPARCV9, 0, 0);
+                       NULL, NULL, NULL, NULL, 1, EM_SPARCV9, 0, 0);
         if (ret < 0 || ret > PROM_SIZE_MAX) {
             ret = load_image_targphys(filename, addr, PROM_SIZE_MAX);
         }
hw/tricore/tricore_testboard.c +1 -1
index aef3289..20c9ccb 100644
@@ -42,7 +42,7 @@ static void tricore_load_kernel(CPUTriCoreState *env)
 
     kernel_size = load_elf(tricoretb_binfo.kernel_filename, NULL,
                            NULL, NULL, &entry, NULL,
-                           NULL, 0,
+                           NULL, NULL, 0,
                            EM_TRICORE, 1, 0);
     if (kernel_size <= 0) {
         error_report("no kernel file '%s'",
hw/xtensa/sim.c +1 -1
index a22743a..aeb46d8 100644
@@ -108,7 +108,7 @@ void xtensa_sim_load_kernel(XtensaCPU *cpu, MachineState *machine)
         uint64_t elf_entry;
         uint64_t elf_lowaddr;
         int success = load_elf(kernel_filename, NULL, translate_phys_addr, cpu,
-                               &elf_entry, &elf_lowaddr, NULL, big_endian,
+                               &elf_entry, &elf_lowaddr, NULL, NULL, big_endian,
                                EM_XTENSA, 0, 0);
 
         if (success > 0) {
hw/xtensa/xtfpga.c +1 -1
index 8220c7a..8e2dd13 100644
@@ -415,7 +415,7 @@ static void xtfpga_init(const XtfpgaBoardDesc *board, MachineState *machine)
         uint64_t elf_entry;
         uint64_t elf_lowaddr;
         int success = load_elf(kernel_filename, NULL, translate_phys_addr, cpu,
-                &elf_entry, &elf_lowaddr, NULL, be, EM_XTENSA, 0, 0);
+                &elf_entry, &elf_lowaddr, NULL, NULL, be, EM_XTENSA, 0, 0);
         if (success > 0) {
             entry_point = elf_entry;
         } else {
include/hw/elf_ops.h +5 -1
index e07d276..a1411bf 100644
@@ -316,7 +316,8 @@ static int glue(load_elf, SZ)(const char *name, int fd,
                               void *translate_opaque,
                               int must_swab, uint64_t *pentry,
                               uint64_t *lowaddr, uint64_t *highaddr,
-                              int elf_machine, int clear_lsb, int data_swab,
+                              uint32_t *pflags, int elf_machine,
+                              int clear_lsb, int data_swab,
                               AddressSpace *as, bool load_rom,
                               symbol_fn_t sym_cb)
 {
@@ -389,6 +390,9 @@ static int glue(load_elf, SZ)(const char *name, int fd,
             }
     }
 
+    if (pflags) {
+        *pflags = (elf_word)ehdr.e_flags;
+    }
     if (pentry)
         *pentry = (uint64_t)(elf_sword)ehdr.e_entry;
 
include/hw/loader.h +12 -9
index 48a96cd..a9eeea3 100644
@@ -101,6 +101,7 @@ const char *load_elf_strerror(int error);
  * @pentry: Populated with program entry point. Ignored if NULL.
  * @lowaddr: Populated with lowest loaded address. Ignored if NULL.
  * @highaddr: Populated with highest loaded address. Ignored if NULL.
+ * @pflags: Populated with ELF processor-specific flags. Ignore if NULL.
  * @bigendian: Expected ELF endianness. 0 for LE otherwise BE
  * @elf_machine: Expected ELF machine type
  * @clear_lsb: Set to mask off LSB of addresses (Some architectures use
@@ -131,8 +132,9 @@ int load_elf_ram_sym(const char *filename,
                      uint64_t (*elf_note_fn)(void *, void *, bool),
                      uint64_t (*translate_fn)(void *, uint64_t),
                      void *translate_opaque, uint64_t *pentry,
-                     uint64_t *lowaddr, uint64_t *highaddr, int big_endian,
-                     int elf_machine, int clear_lsb, int data_swab,
+                     uint64_t *lowaddr, uint64_t *highaddr, uint32_t *pflags,
+                     int big_endian, int elf_machine,
+                     int clear_lsb, int data_swab,
                      AddressSpace *as, bool load_rom, symbol_fn_t sym_cb);
 
 /** load_elf_ram:
@@ -143,9 +145,9 @@ int load_elf_ram(const char *filename,
                  uint64_t (*elf_note_fn)(void *, void *, bool),
                  uint64_t (*translate_fn)(void *, uint64_t),
                  void *translate_opaque, uint64_t *pentry, uint64_t *lowaddr,
-                 uint64_t *highaddr, int big_endian, int elf_machine,
-                 int clear_lsb, int data_swab, AddressSpace *as,
-                 bool load_rom);
+                 uint64_t *highaddr, uint32_t *pflags, int big_endian,
+                 int elf_machine, int clear_lsb, int data_swab,
+                 AddressSpace *as, bool load_rom);
 
 /** load_elf_as:
  * Same as load_elf_ram(), but always loads the elf as ROM
@@ -154,8 +156,9 @@ int load_elf_as(const char *filename,
                 uint64_t (*elf_note_fn)(void *, void *, bool),
                 uint64_t (*translate_fn)(void *, uint64_t),
                 void *translate_opaque, uint64_t *pentry, uint64_t *lowaddr,
-                uint64_t *highaddr, int big_endian, int elf_machine,
-                int clear_lsb, int data_swab, AddressSpace *as);
+                uint64_t *highaddr, uint32_t *pflags, int big_endian,
+                int elf_machine, int clear_lsb, int data_swab,
+                AddressSpace *as);
 
 /** load_elf:
  * Same as load_elf_as(), but doesn't allow the caller to specify an
@@ -165,8 +168,8 @@ int load_elf(const char *filename,
              uint64_t (*elf_note_fn)(void *, void *, bool),
              uint64_t (*translate_fn)(void *, uint64_t),
              void *translate_opaque, uint64_t *pentry, uint64_t *lowaddr,
-             uint64_t *highaddr, int big_endian, int elf_machine,
-             int clear_lsb, int data_swab);
+             uint64_t *highaddr, uint32_t *pflags, int big_endian,
+             int elf_machine, int clear_lsb, int data_swab);
 
 /** load_elf_hdr:
  * @filename: Path of ELF file
Signature · 1 line
2.7.4
#7 lore raw

Re: [PULL 4/6] hw/core/loader: Let load_elf() populate the processor-specific flags

21:10 Uto, 28.01.2020. Aleksandar Markovic <[email protected]> је написао/ла:

Quoted 3 lines

From: Philippe Mathieu-Daudé <[email protected]>

Unfortunately, some spelling errors of mine slipped through the cracks:

Quoted 4 lines

While loading the executable, some platforms (like AVR) need to determine CPU type that executable is built for by reading the field 'e_flags' of the ELF header of tha executable.

s/tha/the

Quoted 10 lines

This patch enables such discovery of that field while using any of the following functions:

- load_elf()
- load_elf_as()
- load_elf_ram()
- load_elf_ram_sym()

The argument added to these functions is called 'pflags' and is of type 'uint32_t*' (that matches the the pointer to the 'elf_word' -

s/the the/the

May I ask you, Peter, to fix them while applying?

Regards,
Aleksandar

Quoted 25 lines

the type of the field 'e_flags' in both 32-bit and 64-bit variants of ELF header). Callers are allowed to pass NULL as that argument, and in such case no lookup to the field 'e_flags' will happen, and no information will be returned, of course.

CC Richard Henderson <[email protected]>
CC Peter Maydell <[email protected]>
CC Edgar E. Iglesias <[email protected]>
CC Michael Walle <[email protected]>
CC Thomas Huth <[email protected]>
CC Laurent Vivier <[email protected]>
CC Philippe Mathieu-Daudé <[email protected]>
CC Aleksandar Rikalo <[email protected]>
CC Aurelien Jarno <[email protected]>
CC Jia Liu <[email protected]>
CC David Gibson <[email protected]>
CC Mark Cave-Ayland <[email protected]>
CC BALATON Zoltan <[email protected]>
CC Christian Borntraeger <[email protected]>
CC Thomas Huth <[email protected]>
CC Artyom Tarasenko <[email protected]>
CC Fabien Chouteau <[email protected]>
CC KONRAD Frederic <[email protected]>
CC Max Filippov <[email protected]>
Quoted 5 lines

Message-Id: <

[email protected]>

Quoted 48 lines
---
 hw/alpha/dp264.c               |  4 ++--
 hw/arm/armv7m.c                |  2 +-
 hw/arm/boot.c                  |  2 +-
 hw/core/generic-loader.c       |  2 +-
 hw/core/loader.c               | 37 +++++++++++++++++++------------------
 hw/cris/boot.c                 |  2 +-
 hw/hppa/machine.c              |  4 ++--
 hw/i386/multiboot.c            |  2 +-
 hw/i386/x86.c                  |  2 +-
 hw/lm32/lm32_boards.c          |  4 ++--
 hw/lm32/milkymist.c            |  2 +-
 hw/m68k/an5206.c               |  2 +-
 hw/m68k/mcf5208.c              |  2 +-
 hw/m68k/q800.c                 |  2 +-
 hw/microblaze/boot.c           |  4 ++--
 hw/mips/mips_fulong2e.c        |  2 +-
 hw/mips/mips_malta.c           |  3 ++-
 hw/mips/mips_mipssim.c         |  2 +-
 hw/mips/mips_r4k.c             |  2 +-
 hw/moxie/moxiesim.c            |  2 +-
 hw/nios2/boot.c                |  4 ++--
 hw/openrisc/openrisc_sim.c     |  2 +-
 hw/pci-host/prep.c             |  3 ++-
 hw/ppc/e500.c                  |  2 +-
 hw/ppc/mac_newworld.c          |  4 ++--
 hw/ppc/mac_oldworld.c          |  4 ++--
 hw/ppc/ppc440_bamboo.c         |  2 +-
 hw/ppc/sam460ex.c              |  3 ++-
 hw/ppc/spapr.c                 |  6 +++---
 hw/ppc/virtex_ml507.c          |  2 +-
 hw/riscv/boot.c                |  4 ++--
 hw/s390x/ipl.c                 |  7 ++++---
 hw/sparc/leon3.c               |  2 +-
 hw/sparc/sun4m.c               |  4 ++--
 hw/sparc64/sun4u.c             |  5 +++--
 hw/tricore/tricore_testboard.c |  2 +-
 hw/xtensa/sim.c                |  2 +-
 hw/xtensa/xtfpga.c             |  2 +-
 include/hw/elf_ops.h           |  6 +++++-
 include/hw/loader.h            | 21 ++++++++++++---------
 40 files changed, 92 insertions(+), 79 deletions(-)
hw/alpha/dp264.c +0 -0
index f2026fd..a8f9a89 100644

hw/alpha/dp264.c static void clipper_init(MachineState *machine) · line 118

Quoted 5 lines
hw/alpha/dp264.c +1 -1
@@ -115,7 +115,7 @@ static void clipper_init(MachineState *machine)
         exit(1);
     }
     size = load_elf(palcode_filename, NULL, cpu_alpha_superpage_to_phys,
-                    NULL, &palcode_entry, &palcode_low, &palcode_high,
+                    NULL, &palcode_entry, &palcode_low, &palcode_high,

NULL,

hw/alpha/dp264.c static void clipper_init(MachineState *machine) · line 136

Quoted 7 lines
hw/alpha/dp264.c +0 -0
                     0, EM_ALPHA, 0, 0);
     if (size < 0) {
         error_report("could not load palcode '%s'", palcode_filename);
@@ -134,7 +134,7 @@ static void clipper_init(MachineState *machine)
         uint64_t param_offset;
 
         size = load_elf(kernel_filename, NULL,

cpu_alpha_superpage_to_phys,

hw/alpha/dp264.c static void clipper_init(MachineState *machine) · line 137

Quoted 2 lines
hw/alpha/dp264.c +1 -1
-                        NULL, &kernel_entry, &kernel_low, &kernel_high,
+                        NULL, &kernel_entry, &kernel_low, &kernel_high,

NULL,

hw/arm/armv7m.c void armv7m_load_kernel(ARMCPU *cpu, const char

Quoted 8 lines
hw/alpha/dp264.c +0 -0
                         0, EM_ALPHA, 0, 0);
         if (size < 0) {
             error_report("could not load kernel '%s'", kernel_filename);
hw/arm/armv7m.c +0 -0
index 5d4a581..7531b97 100644
@@ -331,7 +331,7 @@ void armv7m_load_kernel(ARMCPU *cpu, const char

*kernel_filename, int mem_size)

hw/arm/boot.c static int64_t arm_load_elf(struct arm_boot_info

Quoted 13 lines
hw/arm/armv7m.c +1 -1
     if (kernel_filename) {
         image_size = load_elf_as(kernel_filename, NULL, NULL, NULL,
-                                 &entry, &lowaddr,
+                                 &entry, &lowaddr, NULL,
                                  NULL, big_endian, EM_ARM, 1, 0, as);
         if (image_size < 0) {
             image_size = load_image_targphys_as(kernel_filename, 0,
hw/arm/boot.c +0 -0
index 8fb4a63..0c213ca 100644
@@ -903,7 +903,7 @@ static int64_t arm_load_elf(struct arm_boot_info

*info, uint64_t *pentry,

hw/arm/boot.c static int64_t arm_load_elf(struct arm_boot_info *info, uint64_t *pentry,

Quoted 5 lines
hw/arm/boot.c +1 -1
     }
 
     ret = load_elf_as(info->kernel_filename, NULL, NULL, NULL,
-                      pentry, lowaddr, highaddr, big_endian, elf_machine,
+                      pentry, lowaddr, highaddr, NULL, big_endian,

elf_machine,

hw/core/generic-loader.c static void generic_loader_realize(DeviceState *dev,

Quoted 8 lines
hw/arm/boot.c +0 -0
                       1, data_swab, as);
     if (ret <= 0) {
         /* The header loaded but the image didn't */
hw/core/generic-loader.c +0 -0
index e7eb57e..b9aaa52 100644
@@ -140,7 +140,7 @@ static void generic_loader_realize(DeviceState *dev,

Error **errp)

hw/core/generic-loader.c static void generic_loader_realize(DeviceState *dev, · line 141

Quoted 3 lines
hw/core/generic-loader.c +0 -0
         if (!s->force_raw) {
             size = load_elf_as(s->file, NULL, NULL, NULL, &entry, NULL,

NULL,

hw/core/generic-loader.c static void generic_loader_realize(DeviceState *dev, Error **errp)

Quoted 5 lines
hw/core/generic-loader.c +1 -1
-                               big_endian, 0, 0, 0, as);
+                               NULL, big_endian, 0, 0, 0, as);
 
             if (size < 0) {
                 size = load_uimage_as(s->file, &entry, NULL, NULL, NULL,

NULL,

Quoted 5 lines
hw/core/loader.c +0 -0
index 5099f27..d1b78f6 100644

hw/core/loader.c int load_elf(const char *filename, · line 412

Quoted 9 lines
hw/core/loader.c +2 -2
@@ -406,12 +406,12 @@ int load_elf(const char *filename,
              uint64_t (*elf_note_fn)(void *, void *, bool),
              uint64_t (*translate_fn)(void *, uint64_t),
              void *translate_opaque, uint64_t *pentry, uint64_t *lowaddr,
-             uint64_t *highaddr, int big_endian, int elf_machine,
-             int clear_lsb, int data_swab)
+             uint64_t *highaddr, uint32_t *pflags, int big_endian,
+             int elf_machine, int clear_lsb, int data_swab)
 {
     return load_elf_as(filename, elf_note_fn, translate_fn,

translate_opaque,

hw/core/loader.c int load_elf_ram(const char *filename, · line 441

Quoted 1 line
hw/core/loader.c +0 -1
-                       pentry, lowaddr, highaddr, big_endian,

elf_machine,

hw/core/loader.c int load_elf_as(const char *filename, · line 421

Quoted 10 lines
hw/core/loader.c +2 -1
-                       clear_lsb, data_swab, NULL);
+                       pentry, lowaddr, highaddr, pflags, big_endian,
+                       elf_machine, clear_lsb, data_swab, NULL);
 }
 
 /* return < 0 if error, otherwise the number of bytes loaded in memory */
@@ -419,12 +419,12 @@ int load_elf_as(const char *filename,
                 uint64_t (*elf_note_fn)(void *, void *, bool),
                 uint64_t (*translate_fn)(void *, uint64_t),
                 void *translate_opaque, uint64_t *pentry, uint64_t

*lowaddr,

hw/core/loader.c int load_elf_as(const char *filename,

Quoted 4 lines
hw/core/loader.c +2 -2
-                uint64_t *highaddr, int big_endian, int elf_machine,
-                int clear_lsb, int data_swab, AddressSpace *as)
+                uint64_t *highaddr, uint32_t *pflags, int big_endian,
+                int elf_machine, int clear_lsb, int data_swab,

AddressSpace *as)

hw/core/loader.c int load_elf_as(const char *filename, · line 425

Quoted 2 lines
hw/core/loader.c +0 -0
 {
     return load_elf_ram(filename, elf_note_fn, translate_fn,

translate_opaque,

hw/core/loader.c int load_elf_ram(const char *filename, · line 441

Quoted 1 line
hw/core/loader.c +0 -1
-                        pentry, lowaddr, highaddr, big_endian,

elf_machine,

hw/core/loader.c int load_elf_ram(const char *filename, · line 434

Quoted 10 lines
hw/core/loader.c +2 -1
-                        clear_lsb, data_swab, as, true);
+                        pentry, lowaddr, highaddr, pflags, big_endian,
+                        elf_machine, clear_lsb, data_swab, as, true);
 }
 
 /* return < 0 if error, otherwise the number of bytes loaded in memory */
@@ -432,13 +432,13 @@ int load_elf_ram(const char *filename,
                  uint64_t (*elf_note_fn)(void *, void *, bool),
                  uint64_t (*translate_fn)(void *, uint64_t),
                  void *translate_opaque, uint64_t *pentry, uint64_t

*lowaddr,

hw/core/loader.c int load_elf_ram(const char *filename,

Quoted 11 lines
hw/core/loader.c +4 -4
-                 uint64_t *highaddr, int big_endian, int elf_machine,
-                 int clear_lsb, int data_swab, AddressSpace *as,
-                 bool load_rom)
+                 uint64_t *highaddr, uint32_t *pflags, int big_endian,
+                 int elf_machine, int clear_lsb, int data_swab,
+                 AddressSpace *as, bool load_rom)
 {
     return load_elf_ram_sym(filename, elf_note_fn,
                             translate_fn, translate_opaque,
-                            pentry, lowaddr, highaddr, big_endian,
+                            pentry, lowaddr, highaddr, pflags,

big_endian,

hw/core/loader.c int load_elf_ram_sym(const char *filename, · line 451

Quoted 8 lines
hw/core/loader.c +0 -1
                             elf_machine, clear_lsb, data_swab, as,
                             load_rom, NULL);
 }
@@ -448,8 +448,9 @@ int load_elf_ram_sym(const char *filename,
                      uint64_t (*elf_note_fn)(void *, void *, bool),
                      uint64_t (*translate_fn)(void *, uint64_t),
                      void *translate_opaque, uint64_t *pentry,
-                     uint64_t *lowaddr, uint64_t *highaddr, int

big_endian,

hw/core/loader.c int load_elf_ram_sym(const char *filename, · line 451

Quoted 2 lines
hw/core/loader.c +1 -1
-                     int elf_machine, int clear_lsb, int data_swab,
+                     uint64_t *lowaddr, uint64_t *highaddr, uint32_t

*pflags,

hw/core/loader.c int load_elf_ram_sym(const char *filename,

Quoted 5 lines
hw/core/loader.c +2 -0
+                     int big_endian, int elf_machine,
+                     int clear_lsb, int data_swab,
                      AddressSpace *as, bool load_rom, symbol_fn_t sym_cb)
 {
     int fd, data_order, target_data_order, must_swab, ret =

ELF_LOAD_FAILED;

hw/core/loader.c int load_elf_ram_sym(const char *filename, · line 493

Quoted 5 lines
hw/core/loader.c +0 -1
@@ -490,13 +491,13 @@ int load_elf_ram_sym(const char *filename,
     if (e_ident[EI_CLASS] == ELFCLASS64) {
         ret = load_elf64(filename, fd, elf_note_fn,
                          translate_fn, translate_opaque, must_swab,
-                         pentry, lowaddr, highaddr, elf_machine,

clear_lsb,

hw/core/loader.c int load_elf_ram_sym(const char *filename,

Quoted 7 lines
hw/core/loader.c +2 -2
-                         data_swab, as, load_rom, sym_cb);
+                         pentry, lowaddr, highaddr, pflags, elf_machine,
+                         clear_lsb, data_swab, as, load_rom, sym_cb);
     } else {
         ret = load_elf32(filename, fd, elf_note_fn,
                          translate_fn, translate_opaque, must_swab,
-                         pentry, lowaddr, highaddr, elf_machine,

clear_lsb,

hw/cris/boot.c void cris_load_image(CRISCPU *cpu, struct

Quoted 11 lines
hw/core/loader.c +2 -1
-                         data_swab, as, load_rom, sym_cb);
+                         pentry, lowaddr, highaddr, pflags, elf_machine,
+                         clear_lsb, data_swab, as, load_rom, sym_cb);
     }
 
  fail:
hw/cris/boot.c +0 -0
index 2d2cc0c..b8947bc 100644
@@ -76,7 +76,7 @@ void cris_load_image(CRISCPU *cpu, struct

cris_load_info *li)

Quoted 22 lines
hw/cris/boot.c +1 -1
        devboard SDK.  */
     image_size = load_elf(li->image_filename, NULL,
                           translate_kernel_address, NULL,
-                          &entry, NULL, &high, 0, EM_CRIS, 0, 0);
+                          &entry, NULL, &high, NULL, 0, EM_CRIS, 0, 0);
     li->entry = entry;
     if (image_size < 0) {
         /* Takes a kimage from the axis devboard SDK.  */
hw/hppa/machine.c +1 -1
index 2d62a24..d8755ec 100644
@@ -155,7 +155,7 @@ static void machine_hppa_init(MachineState *machine)
     }
 
     size = load_elf(firmware_filename, NULL, NULL, NULL,
-                    &firmware_entry, &firmware_low, &firmware_high,
+                    &firmware_entry, &firmware_low, &firmware_high, NULL,
                     true, EM_PARISC, 0, 0);
 
     /* Unfortunately, load_elf sign-extends reading elf32.  */

hw/hppa/machine.c static void machine_hppa_init(MachineState *machine) · line 187

Quoted 5 lines
hw/hppa/machine.c +1 -1
@@ -184,7 +184,7 @@ static void machine_hppa_init(MachineState *machine)
     /* Load kernel */
     if (kernel_filename) {
         size = load_elf(kernel_filename, NULL, &cpu_hppa_to_phys,
-                        NULL, &kernel_entry, &kernel_low, &kernel_high,
+                        NULL, &kernel_entry, &kernel_low, &kernel_high,

NULL,

hw/i386/multiboot.c int load_multiboot(FWCfgState *fw_cfg, · line 201

Quoted 11 lines
hw/hppa/machine.c +0 -0
                         true, EM_PARISC, 0, 0);
 
         /* Unfortunately, load_elf sign-extends reading elf32.  */
hw/i386/multiboot.c +0 -0
index 9a59f95..9e7d69d 100644
@@ -199,7 +199,7 @@ int load_multiboot(FWCfgState *fw_cfg,
         }
 
         kernel_size = load_elf(kernel_filename, NULL, NULL, NULL,

&elf_entry,

hw/i386/multiboot.c int load_multiboot(FWCfgState *fw_cfg, · line 202

Quoted 2 lines
hw/i386/multiboot.c +1 -1
-                               &elf_low, &elf_high, 0, I386_ELF_MACHINE,
+                               &elf_low, &elf_high, NULL, 0,

I386_ELF_MACHINE,

hw/i386/x86.c static bool load_elfboot(const char *kernel_filename, · line 416

Quoted 13 lines
hw/i386/multiboot.c +0 -0
                                0, 0);
         if (kernel_size < 0) {
             error_report("Error while loading elf kernel");
hw/i386/x86.c +1 -1
index 9b9a4d5..7f38e6b 100644
@@ -413,7 +413,7 @@ static bool load_elfboot(const char *kernel_filename,
     uint64_t elf_note_type = XEN_ELFNOTE_PHYS32_ENTRY;
     kernel_size = load_elf(kernel_filename, read_pvh_start_addr,
                            NULL, &elf_note_type, &elf_entry,
-                           &elf_low, &elf_high, 0, I386_ELF_MACHINE,
+                           &elf_low, &elf_high, NULL, 0,

I386_ELF_MACHINE,

hw/microblaze/boot.c void microblaze_load_kernel(MicroBlazeCPU *cpu,

Quoted 82 lines
hw/i386/x86.c +0 -0
                            0, 0);
 
     if (kernel_size < 0) {
hw/lm32/lm32_boards.c +2 -2
index 5ae308b..d1894ad 100644
@@ -138,7 +138,7 @@ static void lm32_evr_init(MachineState *machine)
         int kernel_size;
 
         kernel_size = load_elf(kernel_filename, NULL, NULL, NULL,
-                               &entry, NULL, NULL,
+                               &entry, NULL, NULL, NULL,
                                1, EM_LATTICEMICO32, 0, 0);
         reset_info->bootstrap_pc = entry;
 
@@ -232,7 +232,7 @@ static void lm32_uclinux_init(MachineState *machine)
         int kernel_size;
 
         kernel_size = load_elf(kernel_filename, NULL, NULL, NULL,
-                               &entry, NULL, NULL,
+                               &entry, NULL, NULL, NULL,
                                1, EM_LATTICEMICO32, 0, 0);
         reset_info->bootstrap_pc = entry;
 
hw/lm32/milkymist.c +1 -1
index 460d322..6d46134 100644
@@ -177,7 +177,7 @@ milkymist_init(MachineState *machine)
 
         /* Boots a kernel elf binary.  */
         kernel_size = load_elf(kernel_filename, NULL, NULL, NULL,
-                               &entry, NULL, NULL,
+                               &entry, NULL, NULL, NULL,
                                1, EM_LATTICEMICO32, 0, 0);
         reset_info->bootstrap_pc = entry;
 
hw/m68k/an5206.c +1 -1
index 54ccbe1..bed43a9 100644
@@ -65,7 +65,7 @@ static void an5206_init(MachineState *machine)
     }
 
     kernel_size = load_elf(kernel_filename, NULL, NULL, NULL, &elf_entry,
-                           NULL, NULL, 1, EM_68K, 0, 0);
+                           NULL, NULL, NULL, 1, EM_68K, 0, 0);
     entry = elf_entry;
     if (kernel_size < 0) {
         kernel_size = load_uimage(kernel_filename, &entry, NULL, NULL,
hw/m68k/mcf5208.c +1 -1
index 158c5e4..a999c21 100644
@@ -329,7 +329,7 @@ static void mcf5208evb_init(MachineState *machine)
     }
 
     kernel_size = load_elf(kernel_filename, NULL, NULL, NULL, &elf_entry,
-                           NULL, NULL, 1, EM_68K, 0, 0);
+                           NULL, NULL, NULL, 1, EM_68K, 0, 0);
     entry = elf_entry;
     if (kernel_size < 0) {
         kernel_size = load_uimage(kernel_filename, &entry, NULL, NULL,
hw/m68k/q800.c +1 -1
index 12491ec..1e32363 100644
@@ -342,7 +342,7 @@ static void q800_init(MachineState *machine)
     if (linux_boot) {
         uint64_t high;
         kernel_size = load_elf(kernel_filename, NULL, NULL, NULL,
-                               &elf_entry, NULL, &high, 1,
+                               &elf_entry, NULL, &high, NULL, 1,
                                EM_68K, 0, 0);
         if (kernel_size < 0) {
             error_report("could not load kernel '%s'", kernel_filename);
hw/microblaze/boot.c +0 -0
index d1d7dfb..925e3f7 100644
@@ -145,13 +145,13 @@ void microblaze_load_kernel(MicroBlazeCPU *cpu,

hwaddr ddr_base,

Quoted 20 lines
hw/microblaze/boot.c +2 -2
         /* Boots a kernel elf binary.  */
         kernel_size = load_elf(kernel_filename, NULL, NULL, NULL,
-                               &entry, &low, &high,
+                               &entry, &low, &high, NULL,
                                big_endian, EM_MICROBLAZE, 0, 0);
         base32 = entry;
         if (base32 == 0xc0000000) {
             kernel_size = load_elf(kernel_filename, NULL,
                                    translate_kernel_address, NULL,
-                                   &entry, NULL, NULL,
+                                   &entry, NULL, NULL, NULL,
                                    big_endian, EM_MICROBLAZE, 0, 0);
         }
         /* Always boot into physical ram.  */
hw/mips/mips_fulong2e.c +0 -0
index 9eaa6e2..2e043cb 100644

hw/mips/mips_fulong2e.c static int64_t load_kernel(CPUMIPSState *env) · line 121

Quoted 3 lines
hw/mips/mips_fulong2e.c +0 -0
@@ -119,7 +119,7 @@ static int64_t load_kernel(CPUMIPSState *env)
                            cpu_mips_kseg0_to_phys, NULL,
                            (uint64_t *)&kernel_entry,
                            (uint64_t *)&kernel_low, (uint64_t

*)&kernel_high,

Quoted 10 lines
hw/mips/mips_fulong2e.c +1 -1
-                           0, EM_MIPS, 1, 0);
+                           NULL, 0, EM_MIPS, 1, 0);
     if (kernel_size < 0) {
         error_report("could not load kernel '%s': %s",
                      loaderparams.kernel_filename,
hw/mips/mips_malta.c +0 -0
index 5aaeaa8..34b76bb 100644

hw/mips/mips_malta.c static int64_t load_kernel(void) · line 1042

Quoted 4 lines
hw/mips/mips_malta.c +0 -1
@@ -1039,7 +1039,8 @@ static int64_t load_kernel(void)
     kernel_size = load_elf(loaderparams.kernel_filename, NULL,
                            cpu_mips_kseg0_to_phys, NULL,
                            (uint64_t *)&kernel_entry, NULL,
-                           (uint64_t *)&kernel_high, big_endian,

EM_MIPS, 1, 0);

hw/mips/mips_malta.c static int64_t load_kernel(void) · line 1042

Quoted 1 line
hw/mips/mips_malta.c +1 -0
+                           (uint64_t *)&kernel_high, NULL, big_endian,

EM_MIPS,

hw/moxie/moxiesim.c static void load_kernel(MoxieCPU *cpu, LoaderParams

Quoted 35 lines
hw/mips/mips_malta.c +1 -0
+                           1, 0);
     if (kernel_size < 0) {
         error_report("could not load kernel '%s': %s",
                      loaderparams.kernel_filename,
hw/mips/mips_mipssim.c +1 -1
index 84c03dd..b934ca9 100644
@@ -74,7 +74,7 @@ static int64_t load_kernel(void)
     kernel_size = load_elf(loaderparams.kernel_filename, NULL,
                            cpu_mips_kseg0_to_phys, NULL,
                            (uint64_t *)&entry, NULL,
-                           (uint64_t *)&kernel_high, big_endian,
+                           (uint64_t *)&kernel_high, NULL, big_endian,
                            EM_MIPS, 1, 0);
     if (kernel_size >= 0) {
         if ((entry & ~0x7fffffffULL) == 0x80000000) {
hw/mips/mips_r4k.c +1 -1
index fd926a3..b2aec43 100644
@@ -98,7 +98,7 @@ static int64_t load_kernel(void)
     kernel_size = load_elf(loaderparams.kernel_filename, NULL,
                            cpu_mips_kseg0_to_phys, NULL,
                            (uint64_t *)&entry, NULL,
-                           (uint64_t *)&kernel_high, big_endian,
+                           (uint64_t *)&kernel_high, NULL, big_endian,
                            EM_MIPS, 1, 0);
     if (kernel_size >= 0) {
         if ((entry & ~0x7fffffffULL) == 0x80000000) {
hw/moxie/moxiesim.c +0 -0
index 57af1b4..1d06e39 100644
@@ -58,7 +58,7 @@ static void load_kernel(MoxieCPU *cpu, LoaderParams

*loader_params)

hw/moxie/moxiesim.c static void load_kernel(MoxieCPU *cpu, LoaderParams *loader_params)

Quoted 3 lines
hw/moxie/moxiesim.c +0 -0
     ram_addr_t initrd_offset;
 
     kernel_size = load_elf(loader_params->kernel_filename,  NULL, NULL,

NULL,

hw/moxie/moxiesim.c static void load_kernel(MoxieCPU *cpu, LoaderParams · line 61

Quoted 1 line
hw/moxie/moxiesim.c +0 -1
-                           &entry, &kernel_low, &kernel_high, 1,

EM_MOXIE,

hw/moxie/moxiesim.c static void load_kernel(MoxieCPU *cpu, LoaderParams · line 61

Quoted 1 line
hw/moxie/moxiesim.c +1 -0
+                           &entry, &kernel_low, &kernel_high, NULL, 1,

EM_MOXIE,

Quoted 30 lines
hw/moxie/moxiesim.c +0 -0
                            0, 0);
 
     if (kernel_size <= 0) {
hw/nios2/boot.c +2 -2
index d78bc9e..46b8349 100644
@@ -147,7 +147,7 @@ void nios2_load_kernel(Nios2CPU *cpu, hwaddr ddr_base,
 
         /* Boots a kernel elf binary. */
         kernel_size = load_elf(kernel_filename, NULL, NULL, NULL,
-                               &entry, &low, &high,
+                               &entry, &low, &high, NULL,
                                big_endian, EM_ALTERA_NIOS2, 0, 0);
         if ((uint32_t)entry == 0xc0000000) {
             /*
@@ -158,7 +158,7 @@ void nios2_load_kernel(Nios2CPU *cpu, hwaddr ddr_base,
              */
             kernel_size = load_elf(kernel_filename, NULL,
                                    translate_kernel_address, NULL,
-                                   &entry, NULL, NULL,
+                                   &entry, NULL, NULL, NULL,
                                    big_endian, EM_ALTERA_NIOS2, 0, 0);
             boot_info.bootstrap_pc = ddr_base + 0xc0000000 +
                 (entry & 0x07ffffff);
hw/openrisc/openrisc_sim.c +0 -0
index 79e7049..ad53712 100644

hw/openrisc/openrisc_sim.c static void openrisc_load_kernel(ram_addr_t ram_size, · line 101

Quoted 5 lines
hw/openrisc/openrisc_sim.c +1 -1
@@ -98,7 +98,7 @@ static void openrisc_load_kernel(ram_addr_t ram_size,
 
     if (kernel_filename && !qtest_enabled()) {
         kernel_size = load_elf(kernel_filename, NULL, NULL, NULL,
-                               &elf_entry, NULL, NULL, 1, EM_OPENRISC,
+                               &elf_entry, NULL, NULL, NULL, 1,

EM_OPENRISC,

hw/pci-host/prep.c static void raven_realize(PCIDevice *d, Error **errp) · line 338

Quoted 12 lines
hw/openrisc/openrisc_sim.c +0 -0
                                1, 0);
         entry = elf_entry;
         if (kernel_size < 0) {
hw/pci-host/prep.c +0 -1
index f2f8821..1aff72b 100644
@@ -335,7 +335,8 @@ static void raven_realize(PCIDevice *d, Error **errp)
         if (filename) {
             if (s->elf_machine != EM_NONE) {
                 bios_size = load_elf(filename, NULL, NULL, NULL, NULL,
-                                     NULL, NULL, 1, s->elf_machine, 0,

0);

Quoted 32 lines
hw/pci-host/prep.c +2 -0
+                                     NULL, NULL, NULL, 1, s->elf_machine,
+                                     0, 0);
             }
             if (bios_size < 0) {
                 bios_size = get_image_size(filename);
hw/ppc/e500.c +1 -1
index 12b6a5b..886442e 100644
@@ -1049,7 +1049,7 @@ void ppce500_init(MachineState *machine)
     filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, payload_name);
 
     payload_size = load_elf(filename, NULL, NULL, NULL,
-                            &bios_entry, &loadaddr, NULL,
+                            &bios_entry, &loadaddr, NULL, NULL,
                             1, PPC_ELF_MACHINE, 0, 0);
     if (payload_size < 0) {
         /*
hw/ppc/mac_newworld.c +1 -1
index 3594517..464d012 100644
@@ -168,7 +168,7 @@ static void ppc_core99_init(MachineState *machine)
     /* Load OpenBIOS (ELF) */
     if (filename) {
         bios_size = load_elf(filename, NULL, NULL, NULL, NULL,
-                             NULL, NULL, 1, PPC_ELF_MACHINE, 0, 0);
+                             NULL, NULL, NULL, 1, PPC_ELF_MACHINE, 0, 0);
 
         g_free(filename);
     } else {

hw/ppc/mac_newworld.c static void ppc_core99_init(MachineState *machine) · line 195

Quoted 5 lines
hw/ppc/mac_newworld.c +1 -1
@@ -192,7 +192,7 @@ static void ppc_core99_init(MachineState *machine)
 
         kernel_size = load_elf(kernel_filename, NULL,
                                translate_kernel_address, NULL,
-                               NULL, &lowaddr, NULL, 1, PPC_ELF_MACHINE,
+                               NULL, &lowaddr, NULL, NULL, 1,

PPC_ELF_MACHINE,

hw/ppc/mac_oldworld.c static void ppc_heathrow_init(MachineState *machine) · line 146

Quoted 13 lines
hw/ppc/mac_newworld.c +0 -0
                                0, 0);
         if (kernel_size < 0)
             kernel_size = load_aout(kernel_filename, kernel_base,
hw/ppc/mac_oldworld.c +1 -1
index 0fa680b..7318d7e 100644
@@ -143,7 +143,7 @@ static void ppc_heathrow_init(MachineState *machine)
 
     /* Load OpenBIOS (ELF) */
     if (filename) {
-        bios_size = load_elf(filename, NULL, 0, NULL, NULL, NULL, NULL,
+        bios_size = load_elf(filename, NULL, 0, NULL, NULL, NULL, NULL,

NULL,

hw/ppc/mac_oldworld.c static void ppc_heathrow_init(MachineState *machine) · line 169

Quoted 9 lines
hw/ppc/mac_oldworld.c +1 -1
                              1, PPC_ELF_MACHINE, 0, 0);
         g_free(filename);
     } else {
@@ -166,7 +166,7 @@ static void ppc_heathrow_init(MachineState *machine)
         kernel_base = KERNEL_LOAD_ADDR;
         kernel_size = load_elf(kernel_filename, NULL,
                                translate_kernel_address, NULL,
-                               NULL, &lowaddr, NULL, 1, PPC_ELF_MACHINE,
+                               NULL, &lowaddr, NULL, NULL, 1,

PPC_ELF_MACHINE,

hw/ppc/ppc440_bamboo.c static void bamboo_init(MachineState *machine) · line 255

Quoted 11 lines
hw/ppc/mac_oldworld.c +0 -0
                                0, 0);
         if (kernel_size < 0)
             kernel_size = load_aout(kernel_filename, kernel_base,
hw/ppc/ppc440_bamboo.c +0 -0
index b782641..da777ef 100644
@@ -253,7 +253,7 @@ static void bamboo_init(MachineState *machine)
                               NULL, NULL);
         if (success < 0) {
             success = load_elf(kernel_filename, NULL, NULL, NULL,

&elf_entry,

hw/ppc/ppc440_bamboo.c static void bamboo_init(MachineState *machine) · line 256

Quoted 2 lines
hw/ppc/ppc440_bamboo.c +1 -1
-                               &elf_lowaddr, NULL, 1, PPC_ELF_MACHINE,
+                               &elf_lowaddr, NULL, NULL, 1,

PPC_ELF_MACHINE,

hw/ppc/sam460ex.c static void sam460ex_init(MachineState *machine) · line 442

Quoted 12 lines
hw/ppc/ppc440_bamboo.c +0 -0
                                0, 0);
             entry = elf_entry;
             loadaddr = elf_lowaddr;
hw/ppc/sam460ex.c +0 -1
index 437e214..89bc70e 100644
@@ -439,7 +439,8 @@ static void sam460ex_init(MachineState *machine)
 
             success = load_elf(machine->kernel_filename, NULL,
                                NULL, NULL, &elf_entry,
-                               &elf_lowaddr, NULL, 1, PPC_ELF_MACHINE,

0, 0);

hw/ppc/sam460ex.c static void sam460ex_init(MachineState *machine) · line 442

Quoted 1 line
hw/ppc/sam460ex.c +1 -0
+                               &elf_lowaddr, NULL, NULL, 1,

PPC_ELF_MACHINE, 0,

hw/ppc/spapr.c static void spapr_machine_init(MachineState

Quoted 9 lines
hw/ppc/sam460ex.c +1 -0
+                               0);
             entry = elf_entry;
             loadaddr = elf_lowaddr;
         }
hw/ppc/spapr.c +0 -0
index 02cf53f..a0076e5 100644
@@ -2895,13 +2895,13 @@ static void spapr_machine_init(MachineState

*machine)

hw/ppc/spapr.c static void spapr_machine_init(MachineState *machine)

Quoted 9 lines
hw/ppc/spapr.c +1 -1
         spapr->kernel_size = load_elf(kernel_filename, NULL,
                                       translate_kernel_address, NULL,
-                                      NULL, &lowaddr, NULL, 1,
+                                      NULL, &lowaddr, NULL, NULL, 1,
                                       PPC_ELF_MACHINE, 0, 0);
         if (spapr->kernel_size == ELF_LOAD_WRONG_ENDIAN) {
             spapr->kernel_size = load_elf(kernel_filename, NULL,
                                           translate_kernel_address,

NULL, NULL,

hw/ppc/spapr.c static void spapr_machine_init(MachineState · line 2902

Quoted 1 line
hw/ppc/spapr.c +0 -1
-                                          &lowaddr, NULL, 0,

PPC_ELF_MACHINE,

Quoted 11 lines
hw/ppc/spapr.c +2 -1
-                                          0, 0);
+                                          &lowaddr, NULL, NULL, 0,
+                                          PPC_ELF_MACHINE, 0, 0);
             spapr->kernel_le = spapr->kernel_size > 0;
         }
         if (spapr->kernel_size < 0) {
hw/ppc/virtex_ml507.c +0 -0
index 6862552..7526947 100644

hw/ppc/virtex_ml507.c static void virtex_init(MachineState *machine) · line 262

Quoted 5 lines
hw/ppc/virtex_ml507.c +1 -1
@@ -259,7 +259,7 @@ static void virtex_init(MachineState *machine)
 
         /* Boots a kernel elf binary.  */
         kernel_size = load_elf(kernel_filename, NULL, NULL, NULL,
-                               &entry, &low, &high, 1, PPC_ELF_MACHINE,
+                               &entry, &low, &high, NULL, 1,

PPC_ELF_MACHINE,

hw/riscv/boot.c target_ulong riscv_load_firmware(const char

Quoted 8 lines
hw/ppc/virtex_ml507.c +0 -0
                                0, 0);
         boot_info.bootstrap_pc = entry & 0x00ffffff;
 
hw/riscv/boot.c +0 -0
index 027303d..b8e7652 100644
@@ -101,7 +101,7 @@ target_ulong riscv_load_firmware(const char

*firmware_filename,

hw/riscv/boot.c target_ulong riscv_load_firmware(const char *firmware_filename,

Quoted 4 lines
hw/riscv/boot.c +0 -1
     uint64_t firmware_entry, firmware_start, firmware_end;
 
     if (load_elf(firmware_filename, NULL, NULL, NULL, &firmware_entry,
-                 &firmware_start, &firmware_end, 0, EM_RISCV, 1, 0) > 0)

{

hw/riscv/boot.c target_ulong riscv_load_firmware(const char · line 104

Quoted 1 line
hw/riscv/boot.c +1 -0
+                 &firmware_start, &firmware_end, NULL, 0, EM_RISCV, 1,

0) > 0) {

hw/riscv/boot.c target_ulong riscv_load_kernel(const char

Quoted 4 lines
hw/riscv/boot.c +0 -0
         return firmware_entry;
     }
 
@@ -119,7 +119,7 @@ target_ulong riscv_load_kernel(const char

*kernel_filename, symbol_fn_t sym_cb)

hw/s390x/ipl.c static void s390_ipl_realize(DeviceState *dev, Error

Quoted 13 lines
hw/riscv/boot.c +1 -1
     uint64_t kernel_entry, kernel_high;
 
     if (load_elf_ram_sym(kernel_filename, NULL, NULL, NULL,
-                         &kernel_entry, NULL, &kernel_high, 0,
+                         &kernel_entry, NULL, &kernel_high, NULL, 0,
                          EM_RISCV, 1, 0, NULL, true, sym_cb) > 0) {
         return kernel_entry;
     }
hw/s390x/ipl.c +0 -0
index b3ae901..ca8e7db 100644
@@ -139,7 +139,7 @@ static void s390_ipl_realize(DeviceState *dev, Error

**errp)

hw/s390x/ipl.c static void s390_ipl_realize(DeviceState *dev, Error

Quoted 9 lines
hw/s390x/ipl.c +1 -1
         bios_size = load_elf(bios_filename, NULL,
                              bios_translate_addr, &fwbase,
-                             &ipl->bios_start_addr, NULL, NULL, 1,
+                             &ipl->bios_start_addr, NULL, NULL, NULL, 1,
                              EM_S390, 0, 0);
         if (bios_size > 0) {
             /* Adjust ELF start address to final location */
@@ -164,7 +164,7 @@ static void s390_ipl_realize(DeviceState *dev, Error

**errp)

hw/sparc/leon3.c static void leon3_generic_hw_init(MachineState

Quoted 23 lines
hw/s390x/ipl.c +3 -2
     if (ipl->kernel) {
         kernel_size = load_elf(ipl->kernel, NULL, NULL, NULL,
                                &pentry, NULL,
-                               NULL, 1, EM_S390, 0, 0);
+                               NULL, NULL, 1, EM_S390, 0, 0);
         if (kernel_size < 0) {
             kernel_size = load_image_targphys(ipl->kernel, 0, ram_size);
             if (kernel_size < 0) {
@@ -473,7 +473,8 @@ static int load_netboot_image(Error **errp)
 
     img_size = load_elf_ram(netboot_filename, NULL, NULL, NULL,
                             &ipl->start_addr,
-                            NULL, NULL, 1, EM_S390, 0, 0, NULL, false);
+                            NULL, NULL, NULL, 1, EM_S390, 0, 0, NULL,
+                            false);
 
     if (img_size < 0) {
         img_size = load_image_size(netboot_filename, ram_ptr, ram_size);
hw/sparc/leon3.c +0 -0
index 8038887..f5a087d 100644
@@ -297,7 +297,7 @@ static void leon3_generic_hw_init(MachineState

*machine)

hw/sparc/sun4m.c static unsigned long sun4m_load_kernel(const char

Quoted 13 lines
hw/sparc/leon3.c +1 -1
         uint64_t entry;
 
         kernel_size = load_elf(kernel_filename, NULL, NULL, NULL,
-                               &entry, NULL, NULL,
+                               &entry, NULL, NULL, NULL,
                                1 /* big endian */, EM_SPARC, 0, 0);
         if (kernel_size < 0) {
             kernel_size = load_uimage(kernel_filename, NULL, &entry,
hw/sparc/sun4m.c +0 -0
index df33b32..25e96db 100644
@@ -270,7 +270,7 @@ static unsigned long sun4m_load_kernel(const char

*kernel_filename,

hw/sparc/sun4m.c static unsigned long sun4m_load_kernel(const char *kernel_filename,

Quoted 5 lines
hw/sparc/sun4m.c +1 -1
 #endif
         kernel_size = load_elf(kernel_filename, NULL,
                                translate_kernel_address, NULL,
-                               NULL, NULL, NULL, 1, EM_SPARC, 0, 0);
+                               NULL, NULL, NULL, NULL, 1, EM_SPARC, 0,

0);

hw/sparc/sun4m.c static unsigned long sun4m_load_kernel(const char *kernel_filename,

Quoted 3 lines
hw/sparc/sun4m.c +0 -0
         if (kernel_size < 0)
             kernel_size = load_aout(kernel_filename, KERNEL_LOAD_ADDR,
                                     RAM_size - KERNEL_LOAD_ADDR,

bswap_needed,

hw/sparc/sun4m.c static void prom_init(hwaddr addr, const char

Quoted 1 line
hw/sparc/sun4m.c +0 -0
@@ -721,7 +721,7 @@ static void prom_init(hwaddr addr, const char

*bios_name)

hw/sparc64/sun4u.c static uint64_t sun4u_load_kernel(const char

Quoted 13 lines
hw/sparc/sun4m.c +1 -1
     if (filename) {
         ret = load_elf(filename, NULL,
                        translate_prom_address, &addr, NULL,
-                       NULL, NULL, 1, EM_SPARC, 0, 0);
+                       NULL, NULL, NULL, 1, EM_SPARC, 0, 0);
         if (ret < 0 || ret > PROM_SIZE_MAX) {
             ret = load_image_targphys(filename, addr, PROM_SIZE_MAX);
         }
hw/sparc64/sun4u.c +0 -0
index 5d710d6..b7ac42f 100644
@@ -175,7 +175,8 @@ static uint64_t sun4u_load_kernel(const char

*kernel_filename,

hw/sparc64/sun4u.c static uint64_t sun4u_load_kernel(const char *kernel_filename,

Quoted 3 lines
hw/sparc64/sun4u.c +0 -0
         bswap_needed = 0;
 #endif
         kernel_size = load_elf(kernel_filename, NULL, NULL, NULL,

kernel_entry,

hw/sparc64/sun4u.c static uint64_t sun4u_load_kernel(const char · line 178

Quoted 1 line
hw/sparc64/sun4u.c +0 -1
-                               kernel_addr, &kernel_top, 1, EM_SPARCV9,

0, 0);

hw/sparc64/sun4u.c static uint64_t sun4u_load_kernel(const char · line 178

Quoted 1 line
hw/sparc64/sun4u.c +1 -0
+                               kernel_addr, &kernel_top, NULL, 1,

EM_SPARCV9, 0,

hw/sparc64/sun4u.c static void prom_init(hwaddr addr, const char

Quoted 5 lines
hw/sparc64/sun4u.c +1 -0
+                               0);
         if (kernel_size < 0) {
             *kernel_addr = KERNEL_LOAD_ADDR;
             *kernel_entry = KERNEL_LOAD_ADDR;
@@ -439,7 +440,7 @@ static void prom_init(hwaddr addr, const char

*bios_name)

Review

Quoted 9 lines
hw/sparc64/sun4u.c +1 -1
     filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
     if (filename) {
         ret = load_elf(filename, NULL, translate_prom_address, &addr,
-                       NULL, NULL, NULL, 1, EM_SPARCV9, 0, 0);
+                       NULL, NULL, NULL, NULL, 1, EM_SPARCV9, 0, 0);
         if (ret < 0 || ret > PROM_SIZE_MAX) {
             ret = load_image_targphys(filename, addr, PROM_SIZE_MAX);
         }
(quoted diff) +0 -0

b/hw/tricore/tricore_testboard.c

hw/xtensa/sim.c void xtensa_sim_load_kernel(XtensaCPU *cpu,

Quoted 17 lines

index aef3289..20c9ccb 100644

hw/tricore/tricore_testboard.c +1 -1
@@ -42,7 +42,7 @@ static void tricore_load_kernel(CPUTriCoreState *env)
 
     kernel_size = load_elf(tricoretb_binfo.kernel_filename, NULL,
                            NULL, NULL, &entry, NULL,
-                           NULL, 0,
+                           NULL, NULL, 0,
                            EM_TRICORE, 1, 0);
     if (kernel_size <= 0) {
         error_report("no kernel file '%s'",
hw/xtensa/sim.c +0 -0
index a22743a..aeb46d8 100644
@@ -108,7 +108,7 @@ void xtensa_sim_load_kernel(XtensaCPU *cpu,

MachineState *machine)

hw/xtensa/sim.c void xtensa_sim_load_kernel(XtensaCPU *cpu, MachineState *machine)

Quoted 3 lines
hw/xtensa/sim.c +0 -0
         uint64_t elf_entry;
         uint64_t elf_lowaddr;
         int success = load_elf(kernel_filename, NULL,

translate_phys_addr, cpu,

hw/xtensa/sim.c void xtensa_sim_load_kernel(XtensaCPU *cpu, · line 111

Quoted 1 line
hw/xtensa/sim.c +0 -1
-                               &elf_entry, &elf_lowaddr, NULL,

big_endian,

hw/xtensa/sim.c void xtensa_sim_load_kernel(XtensaCPU *cpu, · line 111

Quoted 1 line
hw/xtensa/sim.c +1 -0
+                               &elf_entry, &elf_lowaddr, NULL, NULL,

big_endian,

hw/xtensa/xtfpga.c static void xtfpga_init(const XtfpgaBoardDesc *board,

Quoted 8 lines
hw/xtensa/sim.c +0 -0
                                EM_XTENSA, 0, 0);
 
         if (success > 0) {
hw/xtensa/xtfpga.c +0 -0
index 8220c7a..8e2dd13 100644
@@ -415,7 +415,7 @@ static void xtfpga_init(const XtfpgaBoardDesc *board,

MachineState *machine)

hw/xtensa/xtfpga.c static void xtfpga_init(const XtfpgaBoardDesc *board, · line 417

Quoted 3 lines
hw/xtensa/xtfpga.c +0 -0
         uint64_t elf_entry;
         uint64_t elf_lowaddr;
         int success = load_elf(kernel_filename, NULL,

translate_phys_addr, cpu,

hw/xtensa/xtfpga.c static void xtfpga_init(const XtfpgaBoardDesc *board, · line 418

Quoted 2 lines
hw/xtensa/xtfpga.c +1 -1
-                &elf_entry, &elf_lowaddr, NULL, be, EM_XTENSA, 0, 0);
+                &elf_entry, &elf_lowaddr, NULL, NULL, be, EM_XTENSA, 0,

0);

include/hw/elf_ops.h static int glue(load_elf, SZ)(const char *name, int

Quoted 8 lines
hw/xtensa/xtfpga.c +0 -0
         if (success > 0) {
             entry_point = elf_entry;
         } else {
include/hw/elf_ops.h +0 -0
index e07d276..a1411bf 100644
@@ -316,7 +316,8 @@ static int glue(load_elf, SZ)(const char *name, int

fd,

include/hw/elf_ops.h static int glue(load_elf, SZ)(const char *name, int fd,

Quoted 4 lines
include/hw/elf_ops.h +0 -1
                               void *translate_opaque,
                               int must_swab, uint64_t *pentry,
                               uint64_t *lowaddr, uint64_t *highaddr,
-                              int elf_machine, int clear_lsb, int

data_swab,

include/hw/elf_ops.h static int glue(load_elf, SZ)(const char *name, int

Quoted 6 lines
include/hw/elf_ops.h +2 -0
+                              uint32_t *pflags, int elf_machine,
+                              int clear_lsb, int data_swab,
                               AddressSpace *as, bool load_rom,
                               symbol_fn_t sym_cb)
 {
@@ -389,6 +390,9 @@ static int glue(load_elf, SZ)(const char *name, int

fd,

Quoted 22 lines
include/hw/elf_ops.h +3 -0
             }
     }
 
+    if (pflags) {
+        *pflags = (elf_word)ehdr.e_flags;
+    }
     if (pentry)
         *pentry = (uint64_t)(elf_sword)ehdr.e_entry;
 
include/hw/loader.h +1 -0
index 48a96cd..a9eeea3 100644
@@ -101,6 +101,7 @@ const char *load_elf_strerror(int error);
  * @pentry: Populated with program entry point. Ignored if NULL.
  * @lowaddr: Populated with lowest loaded address. Ignored if NULL.
  * @highaddr: Populated with highest loaded address. Ignored if NULL.
+ * @pflags: Populated with ELF processor-specific flags. Ignore if NULL.
  * @bigendian: Expected ELF endianness. 0 for LE otherwise BE
  * @elf_machine: Expected ELF machine type
  * @clear_lsb: Set to mask off LSB of addresses (Some architectures use

include/hw/loader.h int load_elf_ram_sym(const char *filename, · line 134

Quoted 4 lines
include/hw/loader.h +0 -1
@@ -131,8 +132,9 @@ int load_elf_ram_sym(const char *filename,
                      uint64_t (*elf_note_fn)(void *, void *, bool),
                      uint64_t (*translate_fn)(void *, uint64_t),
                      void *translate_opaque, uint64_t *pentry,
-                     uint64_t *lowaddr, uint64_t *highaddr, int

big_endian,

include/hw/loader.h int load_elf_ram_sym(const char *filename, · line 135

Quoted 2 lines
include/hw/loader.h +1 -1
-                     int elf_machine, int clear_lsb, int data_swab,
+                     uint64_t *lowaddr, uint64_t *highaddr, uint32_t

*pflags,

include/hw/loader.h int load_elf_ram_sym(const char *filename, · line 138

Quoted 3 lines
include/hw/loader.h +2 -0
+                     int big_endian, int elf_machine,
+                     int clear_lsb, int data_swab,
                      AddressSpace *as, bool load_rom, symbol_fn_t

sym_cb);

include/hw/loader.h int load_elf_ram(const char *filename, · line 147

Quoted 6 lines
include/hw/loader.h +0 -0
 /** load_elf_ram:
@@ -143,9 +145,9 @@ int load_elf_ram(const char *filename,
                  uint64_t (*elf_note_fn)(void *, void *, bool),
                  uint64_t (*translate_fn)(void *, uint64_t),
                  void *translate_opaque, uint64_t *pentry, uint64_t

*lowaddr,

include/hw/loader.h int load_elf_as(const char *filename, · line 158

Quoted 13 lines
include/hw/loader.h +3 -3
-                 uint64_t *highaddr, int big_endian, int elf_machine,
-                 int clear_lsb, int data_swab, AddressSpace *as,
-                 bool load_rom);
+                 uint64_t *highaddr, uint32_t *pflags, int big_endian,
+                 int elf_machine, int clear_lsb, int data_swab,
+                 AddressSpace *as, bool load_rom);
 
 /** load_elf_as:
  * Same as load_elf_ram(), but always loads the elf as ROM
@@ -154,8 +156,9 @@ int load_elf_as(const char *filename,
                 uint64_t (*elf_note_fn)(void *, void *, bool),
                 uint64_t (*translate_fn)(void *, uint64_t),
                 void *translate_opaque, uint64_t *pentry, uint64_t

*lowaddr,

Quoted 23 lines
include/hw/loader.h +5 -5
-                uint64_t *highaddr, int big_endian, int elf_machine,
-                int clear_lsb, int data_swab, AddressSpace *as);
+                uint64_t *highaddr, uint32_t *pflags, int big_endian,
+                int elf_machine, int clear_lsb, int data_swab,
+                AddressSpace *as);
 
 /** load_elf:
  * Same as load_elf_as(), but doesn't allow the caller to specify an
@@ -165,8 +168,8 @@ int load_elf(const char *filename,
              uint64_t (*elf_note_fn)(void *, void *, bool),
              uint64_t (*translate_fn)(void *, uint64_t),
              void *translate_opaque, uint64_t *pentry, uint64_t *lowaddr,
-             uint64_t *highaddr, int big_endian, int elf_machine,
-             int clear_lsb, int data_swab);
+             uint64_t *highaddr, uint32_t *pflags, int big_endian,
+             int elf_machine, int clear_lsb, int data_swab);
 
 /** load_elf_hdr:
  * @filename: Path of ELF file
--

2.7.4

#8 lore raw
In reply to Aleksandar Markovic

Hi Peter,

Quoted 33 lines · Aleksandar Markovic

From: Aleksandar Markovic <[email protected]>

The following changes since commit 4c60e3289875ae6c516a37523bcecb87f68ce67c:

   Merge remote-tracking branch 'remotes/rth/tags/pull-pa-20200127' into staging (2020-01-28 15:11:04 +0000)

are available in the git repository at:

   https://github.com/AMarkovic/qemu tags/mips-queue-jan-28-2020

for you to fetch changes up to 370bf3a4196ebef247752a68b89d497522168ebb:

   target/mips: Add implementation of GINVT instruction (2020-01-28 20:52:20 +0100)

----------------------------------------------------------------

MIPS queue for January 28th, 2020

A diverse set of fixes and improvements:

- finalize documentation on deprecating r4k machine
- enable disassembler to receive target-specific data
- enable kernel loader to get e_flags from ELF header
- improve code flow in helper_do_semihosting()
- amend CP0 WatchHi register implementation
- add GINVT instruction emulation

----------------------------------------------------------------

Aleksandar Markovic (2):
target/mips: Rectify documentation on deprecating r4k machine
disas: Add a field for target-dependant data

Quoted 5 lines

Daniel Henrique Barboza (1):
mips-semi.c: remove 'uhi_done' label in helper_do_semihosting()

Philippe Mathieu-Daudé (1):
hw/core/loader: Let load_elf() populate the processor-specific flags

Do you mind holding this pull request? I don't feel comfortable being listed as the author of this patch. I'll discuss it on the patch thread with Aleksandar.

Quoted 4 lines

Yongbok Kim (2):
target/mips: Amend CP0 WatchHi register implementation target/mips: Add implementation of GINVT instruction

#9 lore raw
In reply to Aleksandar Markovic
Quoted 9 lines · Aleksandar Markovic

From: Aleksandar Markovic <[email protected]>

The following changes since commit 4c60e3289875ae6c516a37523bcecb87f68ce67c:

Merge remote-tracking branch 'remotes/rth/tags/pull-pa-20200127' into staging (2020-01-28 15:11:04 +0000)

are available in the git repository at:

Quoted 8 lines

https://github.com/AMarkovic/qemu tags/mips-queue-jan-28-2020

for you to fetch changes up to 370bf3a4196ebef247752a68b89d497522168ebb:

target/mips: Add implementation of GINVT instruction (2020-01-28 20:52:20 +0100)

----------------------------------------------------------------

Hello, Peter,

Please discard this pull request entirely.

I will shortly send a new one. This will have some non-trivial fixes and improvements of commit messages, but code-wise will be equivalent to this one.

Sorry for any inconvenience.

Yours,
Aleksandar

Quoted 84 lines

MIPS queue for January 28th, 2020

A diverse set of fixes and improvements:

- finalize documentation on deprecating r4k machine
- enable disassembler to receive target-specific data
- enable kernel loader to get e_flags from ELF header
- improve code flow in helper_do_semihosting()
- amend CP0 WatchHi register implementation
- add GINVT instruction emulation

----------------------------------------------------------------

Aleksandar Markovic (2):
target/mips: Rectify documentation on deprecating r4k machine
disas: Add a field for target-dependant data

Daniel Henrique Barboza (1):
mips-semi.c: remove 'uhi_done' label in helper_do_semihosting()

Philippe Mathieu-Daudé (1):
hw/core/loader: Let load_elf() populate the processor-specific flags

Yongbok Kim (2):
target/mips: Amend CP0 WatchHi register implementation target/mips: Add implementation of GINVT instruction

 disas/mips.c                   |  10 +++
 hw/alpha/dp264.c               |   4 +-
 hw/arm/armv7m.c                |   2 +-
 hw/arm/boot.c                  |   2 +-
 hw/core/generic-loader.c       |   2 +-
 hw/core/loader.c               |  37 +++++-----
 hw/cris/boot.c                 |   2 +-
 hw/hppa/machine.c              |   4 +-
 hw/i386/multiboot.c            |   2 +-
 hw/i386/x86.c                  |   2 +-
 hw/lm32/lm32_boards.c          |   4 +-
 hw/lm32/milkymist.c            |   2 +-
 hw/m68k/an5206.c               |   2 +-
 hw/m68k/mcf5208.c              |   2 +-
 hw/m68k/q800.c                 |   2 +-
 hw/microblaze/boot.c           |   4 +-
 hw/mips/mips_fulong2e.c        |   2 +-
 hw/mips/mips_malta.c           |   3 +-
 hw/mips/mips_mipssim.c         |   2 +-
 hw/mips/mips_r4k.c             |   2 +-
 hw/moxie/moxiesim.c            |   2 +-
 hw/nios2/boot.c                |   4 +-
 hw/openrisc/openrisc_sim.c     |   2 +-
 hw/pci-host/prep.c             |   3 +-
 hw/ppc/e500.c                  |   2 +-
 hw/ppc/mac_newworld.c          |   4 +-
 hw/ppc/mac_oldworld.c          |   4 +-
 hw/ppc/ppc440_bamboo.c         |   2 +-
 hw/ppc/sam460ex.c              |   3 +-
 hw/ppc/spapr.c                 |   6 +-
 hw/ppc/virtex_ml507.c          |   2 +-
 hw/riscv/boot.c                |   4 +-
 hw/s390x/ipl.c                 |   7 +-
 hw/sparc/leon3.c               |   2 +-
 hw/sparc/sun4m.c               |   4 +-
 hw/sparc64/sun4u.c             |   5 +-
 hw/tricore/tricore_testboard.c |   2 +-
 hw/xtensa/sim.c                |   2 +-
 hw/xtensa/xtfpga.c             |   2 +-
 include/disas/dis-asm.h        |   3 +
 include/hw/elf_ops.h           |   6 +-
 include/hw/loader.h            |  21 +++---
 qemu-deprecated.texi           |   2 +-
 target/mips/cpu.h              |   4 +-
 target/mips/helper.c           |  20 ++++--
 target/mips/helper.h           |   5 ++
 target/mips/internal.h         |   1 +
 target/mips/machine.c          |   6 +-
 target/mips/mips-semi.c        |  15 ++--
 target/mips/op_helper.c        | 152 +++++++++++++++++++++++++++++++++++------
 target/mips/translate.c        |  88 +++++++++++++++++++++++-
 51 files changed, 356 insertions(+), 121 deletions(-)

--
2.7.4