All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 00/19] multi-arch+linux-user: Cleanup ELF_MACHINE
@ 2015-08-15 23:28 Peter Crosthwaite
  2015-08-15 23:28 ` [Qemu-devel] [PATCH 01/19] linux_user: elfload: Default ELF_MACHINE to ELF_ARCH Peter Crosthwaite
                   ` (21 more replies)
  0 siblings, 22 replies; 40+ messages in thread
From: Peter Crosthwaite @ 2015-08-15 23:28 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, riku.voipio, Peter Crosthwaite

Every arch defines ELF_MACHINE in cpu.h to an arch-specific value. This
definition is rarely needed by core code (only in a few cases). It
conflicts with the multi-arch effort where cpu.h cannot export cpu
specifics via macros like this. So remove ELF_MACHINE completely from
all the cpu.h's.

Linux-user defines both ELF_ARCH and ELF_MACHINE, but for most cases
they are the same. So provide a default of ELF_MACHINE == ELF_ARCH to
handle most cases and just minimally define ELF_MACHINE locally in
linux-user where there is a genuine difference.

While touching the code cleanup elf_check_arch in linux-user with
a similar default-based system to minimise the boiler-plate for arch
EM_ code.

Then go arch-by-arch to remove ELF_MACHINE from cpu.h. For many arches
this causes the ELF_MACHINE == ELF_ARCH default to kick in. Some arches
need their bootloader usages of ELF_MACHINE converted to use EM_FOO
directly.

Alpha is unique, in that ELF_MACHINE is completely unused by existing
code.

i386 and ppc are the most complex, where there is a genuine need to
switch ELF_MACHINE depending on the target sub-arch. In these cases
ELF_MACHINE if prefixed to be target specific. This will need further
rethinking to get multi-arch support for those two arches.

There is an argument for keeping the per-arch definitions of the EM,
but the correct place for this would be as virtual field in the QOM
CPU class. Given the refactorings of the series this new field would
be initially unused until we have the notion of a generic system mode
bootloader or refactor linux-user boot to be more QOMified. So leaving
the defs deleted for the moment for later revival.

Regards,
Peter

Peter Crosthwaite (19):
  linux_user: elfload: Default ELF_MACHINE to ELF_ARCH
  linux-user: elfload: Provide default for elf_check_arch
  arm: Remove ELF_MACHINE from cpu.h
  mb: Remove ELF_MACHINE from cpu.h
  m68k: Remove ELF_MACHINE from cpu.h
  cris: Remove ELF_MACHINE from cpu.h
  moxie: Remove ELF_MACHINE from cpu.h
  unicore: Remove ELF_MACHINE from cpu.h
  lm32: Remove ELF_MACHINE from cpu.h
  or32: Remove ELF_MACHINE from cpu.h
  tricore: Remove ELF_MACHINE from cpu.h
  xtensa: Remove ELF_MACHINE from cpu.h
  sh4: Remove ELF_MACHINE from cpu.h
  s390: Remove ELF_MACHINE from cpu.h
  sparc: Remove ELF_MACHINE from cpu.h
  mips: Remove ELF_MACHINE from cpu.h
  alpha: Remove ELF_MACHINE from cpu.h
  i386: Rename ELF_MACHINE to be x86 specific
  ppc: Rename ELF_MACHINE to be PPC specific

 hw/arm/armv7m.c                |  2 +-
 hw/cris/boot.c                 |  2 +-
 hw/i386/multiboot.c            |  2 +-
 hw/lm32/lm32_boards.c          |  4 ++--
 hw/lm32/milkymist.c            |  2 +-
 hw/m68k/an5206.c               |  2 +-
 hw/m68k/dummy_m68k.c           |  2 +-
 hw/m68k/mcf5208.c              |  2 +-
 hw/microblaze/boot.c           |  4 ++--
 hw/mips/mips_fulong2e.c        |  2 +-
 hw/mips/mips_malta.c           |  2 +-
 hw/mips/mips_mipssim.c         |  2 +-
 hw/mips/mips_r4k.c             |  2 +-
 hw/moxie/moxiesim.c            |  2 +-
 hw/openrisc/openrisc_sim.c     |  2 +-
 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/prep.c                  |  2 +-
 hw/ppc/spapr.c                 |  4 ++--
 hw/ppc/virtex_ml507.c          |  2 +-
 hw/s390x/ipl.c                 |  4 ++--
 hw/sparc/leon3.c               |  2 +-
 hw/sparc/sun4m.c               |  4 ++--
 hw/sparc64/sun4u.c             |  4 ++--
 hw/tricore/tricore_testboard.c |  2 +-
 hw/xtensa/sim.c                |  4 ++--
 hw/xtensa/xtfpga.c             |  2 +-
 linux-user/elfload.c           | 37 +++++++++++--------------------------
 target-alpha/cpu.h             |  2 --
 target-arm/cpu.h               |  2 --
 target-cris/cpu.h              |  2 --
 target-i386/cpu.h              |  4 ++--
 target-lm32/cpu.h              |  2 --
 target-m68k/cpu.h              |  2 --
 target-microblaze/cpu.h        |  2 --
 target-mips/cpu.h              |  2 --
 target-moxie/cpu.h             |  2 --
 target-openrisc/cpu.h          |  1 -
 target-ppc/cpu.h               |  4 ++--
 target-s390x/cpu.h             |  1 -
 target-sh4/cpu.h               |  2 --
 target-sparc/cpu.h             |  6 ------
 target-tricore/cpu.h           |  2 --
 target-unicore32/cpu.h         |  2 --
 target-xtensa/cpu.h            |  1 -
 47 files changed, 53 insertions(+), 99 deletions(-)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 40+ messages in thread

* [Qemu-devel] [PATCH 01/19] linux_user: elfload: Default ELF_MACHINE to ELF_ARCH
  2015-08-15 23:28 [Qemu-devel] [PATCH 00/19] multi-arch+linux-user: Cleanup ELF_MACHINE Peter Crosthwaite
@ 2015-08-15 23:28 ` Peter Crosthwaite
  2015-08-15 23:28 ` [Qemu-devel] [PATCH 02/19] linux-user: elfload: Provide default for elf_check_arch Peter Crosthwaite
                   ` (20 subsequent siblings)
  21 siblings, 0 replies; 40+ messages in thread
From: Peter Crosthwaite @ 2015-08-15 23:28 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, riku.voipio, Peter Crosthwaite

In most (but not all) cases, ELF_MACHINE and ELF_ARCH are safely the
same. Default ELF_MACHINE to ELF_ARCH. This makes defining ELF_MACHINE
optional for target-*/cpu.h when they are known to match.

Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
---
 linux-user/elfload.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 1788368..7f4bb8c 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -1222,6 +1222,10 @@ static inline void init_thread(struct target_pt_regs *regs, struct image_info *i
 #define ELF_PLATFORM (NULL)
 #endif
 
+#ifndef ELF_MACHINE
+#define ELF_MACHINE ELF_ARCH
+#endif
+
 #ifndef ELF_HWCAP
 #define ELF_HWCAP 0
 #endif
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [Qemu-devel] [PATCH 02/19] linux-user: elfload: Provide default for elf_check_arch
  2015-08-15 23:28 [Qemu-devel] [PATCH 00/19] multi-arch+linux-user: Cleanup ELF_MACHINE Peter Crosthwaite
  2015-08-15 23:28 ` [Qemu-devel] [PATCH 01/19] linux_user: elfload: Default ELF_MACHINE to ELF_ARCH Peter Crosthwaite
@ 2015-08-15 23:28 ` Peter Crosthwaite
  2015-08-15 23:28 ` [Qemu-devel] [PATCH 03/19] arm: Remove ELF_MACHINE from cpu.h Peter Crosthwaite
                   ` (19 subsequent siblings)
  21 siblings, 0 replies; 40+ messages in thread
From: Peter Crosthwaite @ 2015-08-15 23:28 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, riku.voipio, Peter Crosthwaite

For many arch's this macro is defined as the predicatable behaviour
of checking the argument for eqaulity against ELF_ARCH. Provide a
default define as such, so only archs with special handling (usually
allowing multiple EM values) need to provide a def.

Arches that do any of:

1: provide this def exactly the same way as the new default
        (alpha, x86_64)
2: check against ELF_MACHINE while defining ELF_ARCH == ELF_MACHINE
        (arm, aarch64)
3: check against EM_FOO directly while defining ELF_ARCH == EM_FOO
        (unicore32, sparc32, ppc32, mips, openrisc, sh4, cris, m86k)

have their elf_check_arch removed as the default will provide the
correct behaviour.

Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
---
 linux-user/elfload.c | 28 ++++------------------------
 1 file changed, 4 insertions(+), 24 deletions(-)

diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 7f4bb8c..f84e760 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -145,7 +145,6 @@ static uint32_t get_elf_hwcap(void)
 
 #ifdef TARGET_X86_64
 #define ELF_START_MMAP 0x2aaaaab000ULL
-#define elf_check_arch(x) ( ((x) == ELF_ARCH) )
 
 #define ELF_CLASS      ELFCLASS64
 #define ELF_ARCH       EM_X86_64
@@ -273,8 +272,6 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUX86State *en
 
 #define ELF_START_MMAP 0x80000000
 
-#define elf_check_arch(x) ((x) == ELF_MACHINE)
-
 #define ELF_ARCH        ELF_MACHINE
 #define ELF_CLASS       ELFCLASS32
 
@@ -481,8 +478,6 @@ static uint32_t get_elf_hwcap2(void)
 /* 64 bit ARM definitions */
 #define ELF_START_MMAP 0x80000000
 
-#define elf_check_arch(x) ((x) == ELF_MACHINE)
-
 #define ELF_ARCH        ELF_MACHINE
 #define ELF_CLASS       ELFCLASS64
 #define ELF_PLATFORM    "aarch64"
@@ -556,8 +551,6 @@ static uint32_t get_elf_hwcap(void)
 
 #define ELF_START_MMAP          0x80000000
 
-#define elf_check_arch(x)       ((x) == EM_UNICORE32)
-
 #define ELF_CLASS               ELFCLASS32
 #define ELF_DATA                ELFDATA2LSB
 #define ELF_ARCH                EM_UNICORE32
@@ -666,7 +659,6 @@ static inline void init_thread(struct target_pt_regs *regs,
 #define ELF_START_MMAP 0x80000000
 #define ELF_HWCAP  (HWCAP_SPARC_FLUSH | HWCAP_SPARC_STBAR | HWCAP_SPARC_SWAP \
                     | HWCAP_SPARC_MULDIV)
-#define elf_check_arch(x) ( (x) == EM_SPARC )
 
 #define ELF_CLASS   ELFCLASS32
 #define ELF_ARCH    EM_SPARC
@@ -696,8 +688,6 @@ static inline void init_thread(struct target_pt_regs *regs,
 
 #else
 
-#define elf_check_arch(x) ( (x) == EM_PPC )
-
 #define ELF_CLASS       ELFCLASS32
 
 #endif
@@ -875,8 +865,6 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUPPCState *en
 
 #define ELF_START_MMAP 0x80000000
 
-#define elf_check_arch(x) ( (x) == EM_MIPS )
-
 #ifdef TARGET_MIPS64
 #define ELF_CLASS   ELFCLASS64
 #else
@@ -985,8 +973,6 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUMBState *env
 
 #define ELF_START_MMAP 0x08000000
 
-#define elf_check_arch(x) ((x) == EM_OPENRISC)
-
 #define ELF_ARCH EM_OPENRISC
 #define ELF_CLASS ELFCLASS32
 #define ELF_DATA  ELFDATA2MSB
@@ -1026,8 +1012,6 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs,
 
 #define ELF_START_MMAP 0x80000000
 
-#define elf_check_arch(x) ( (x) == EM_SH )
-
 #define ELF_CLASS ELFCLASS32
 #define ELF_ARCH  EM_SH
 
@@ -1110,8 +1094,6 @@ static uint32_t get_elf_hwcap(void)
 
 #define ELF_START_MMAP 0x80000000
 
-#define elf_check_arch(x) ( (x) == EM_CRIS )
-
 #define ELF_CLASS ELFCLASS32
 #define ELF_ARCH  EM_CRIS
 
@@ -1129,8 +1111,6 @@ static inline void init_thread(struct target_pt_regs *regs,
 
 #define ELF_START_MMAP 0x80000000
 
-#define elf_check_arch(x) ( (x) == EM_68K )
-
 #define ELF_CLASS       ELFCLASS32
 #define ELF_ARCH        EM_68K
 
@@ -1182,8 +1162,6 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUM68KState *e
 
 #define ELF_START_MMAP (0x30000000000ULL)
 
-#define elf_check_arch(x) ( (x) == ELF_ARCH )
-
 #define ELF_CLASS      ELFCLASS64
 #define ELF_ARCH       EM_ALPHA
 
@@ -1203,8 +1181,6 @@ static inline void init_thread(struct target_pt_regs *regs,
 
 #define ELF_START_MMAP (0x20000000000ULL)
 
-#define elf_check_arch(x) ( (x) == ELF_ARCH )
-
 #define ELF_CLASS	ELFCLASS64
 #define ELF_DATA	ELFDATA2MSB
 #define ELF_ARCH	EM_S390
@@ -1226,6 +1202,10 @@ static inline void init_thread(struct target_pt_regs *regs, struct image_info *i
 #define ELF_MACHINE ELF_ARCH
 #endif
 
+#ifndef elf_check_arch
+#define elf_check_arch(x) ((x) == ELF_ARCH)
+#endif
+
 #ifndef ELF_HWCAP
 #define ELF_HWCAP 0
 #endif
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [Qemu-devel] [PATCH 03/19] arm: Remove ELF_MACHINE from cpu.h
  2015-08-15 23:28 [Qemu-devel] [PATCH 00/19] multi-arch+linux-user: Cleanup ELF_MACHINE Peter Crosthwaite
  2015-08-15 23:28 ` [Qemu-devel] [PATCH 01/19] linux_user: elfload: Default ELF_MACHINE to ELF_ARCH Peter Crosthwaite
  2015-08-15 23:28 ` [Qemu-devel] [PATCH 02/19] linux-user: elfload: Provide default for elf_check_arch Peter Crosthwaite
@ 2015-08-15 23:28 ` Peter Crosthwaite
  2015-08-15 23:28 ` [Qemu-devel] [PATCH 04/19] mb: " Peter Crosthwaite
                   ` (18 subsequent siblings)
  21 siblings, 0 replies; 40+ messages in thread
From: Peter Crosthwaite @ 2015-08-15 23:28 UTC (permalink / raw)
  To: qemu-devel
  Cc: pbonzini, Peter Crosthwaite, riku.voipio, Peter Crosthwaite,
	Peter Maydell

From: Peter Crosthwaite <crosthwaitepeter@gmail.com>

The only generic code relying on this is linux-user. Linux user
already has a lot of #ifdef TARGET_ customisation so instead, define
ELF_ARCH as either EM_ARM or EM_AARCH64 appropriately.

The armv7m bootloader can just pass EM_ARM directly, as that
is architecture specific code. Note that arm_boot already has its own
logic selecting an arm specific elf machine so this makes V7M more
consistent with arm_boot.

This removes another architecture specific definition from the global
namespace.

Cc: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
---
 hw/arm/armv7m.c      | 2 +-
 linux-user/elfload.c | 4 ++--
 target-arm/cpu.h     | 2 --
 3 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c
index c6eab6d..ad89073 100644
--- a/hw/arm/armv7m.c
+++ b/hw/arm/armv7m.c
@@ -215,7 +215,7 @@ qemu_irq *armv7m_init(MemoryRegion *system_memory, int mem_size, int num_irq,
 
     if (kernel_filename) {
         image_size = load_elf(kernel_filename, NULL, NULL, &entry, &lowaddr,
-                              NULL, big_endian, ELF_MACHINE, 1);
+                              NULL, big_endian, EM_ARM, 1);
         if (image_size < 0) {
             image_size = load_image_targphys(kernel_filename, 0, mem_size);
             lowaddr = 0;
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index f84e760..09e1e6a 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -272,7 +272,7 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUX86State *en
 
 #define ELF_START_MMAP 0x80000000
 
-#define ELF_ARCH        ELF_MACHINE
+#define ELF_ARCH        EM_ARM
 #define ELF_CLASS       ELFCLASS32
 
 static inline void init_thread(struct target_pt_regs *regs,
@@ -478,7 +478,7 @@ static uint32_t get_elf_hwcap2(void)
 /* 64 bit ARM definitions */
 #define ELF_START_MMAP 0x80000000
 
-#define ELF_ARCH        ELF_MACHINE
+#define ELF_ARCH        EM_AARCH64
 #define ELF_CLASS       ELFCLASS64
 #define ELF_PLATFORM    "aarch64"
 
diff --git a/target-arm/cpu.h b/target-arm/cpu.h
index 2e680da..a8ac799 100644
--- a/target-arm/cpu.h
+++ b/target-arm/cpu.h
@@ -26,10 +26,8 @@
 #if defined(TARGET_AARCH64)
   /* AArch64 definitions */
 #  define TARGET_LONG_BITS 64
-#  define ELF_MACHINE EM_AARCH64
 #else
 #  define TARGET_LONG_BITS 32
-#  define ELF_MACHINE EM_ARM
 #endif
 
 #define TARGET_IS_BIENDIAN 1
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [Qemu-devel] [PATCH 04/19] mb: Remove ELF_MACHINE from cpu.h
  2015-08-15 23:28 [Qemu-devel] [PATCH 00/19] multi-arch+linux-user: Cleanup ELF_MACHINE Peter Crosthwaite
                   ` (2 preceding siblings ...)
  2015-08-15 23:28 ` [Qemu-devel] [PATCH 03/19] arm: Remove ELF_MACHINE from cpu.h Peter Crosthwaite
@ 2015-08-15 23:28 ` Peter Crosthwaite
  2015-08-15 23:28 ` [Qemu-devel] [PATCH 05/19] m68k: " Peter Crosthwaite
                   ` (17 subsequent siblings)
  21 siblings, 0 replies; 40+ messages in thread
From: Peter Crosthwaite @ 2015-08-15 23:28 UTC (permalink / raw)
  To: qemu-devel
  Cc: pbonzini, Peter Crosthwaite, riku.voipio, Peter Crosthwaite,
	Edgar E. Iglesias

From: Peter Crosthwaite <crosthwaitepeter@gmail.com>

The only generic code relying on this is linux-user, but linux-users'
default behaviour or setting ELF_MACHINE to ELF_ARCH will handle this.

The microblaze bootloader can just pass EM_MICROBLAZE directly, as that
is architecture specific code.

This removes another architecture specific definition from the global
namespace.

Cc: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
---
 hw/microblaze/boot.c    | 4 ++--
 target-microblaze/cpu.h | 2 --
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/hw/microblaze/boot.c b/hw/microblaze/boot.c
index 3e8820f..d7eaa1f 100644
--- a/hw/microblaze/boot.c
+++ b/hw/microblaze/boot.c
@@ -141,12 +141,12 @@ void microblaze_load_kernel(MicroBlazeCPU *cpu, hwaddr ddr_base,
         /* Boots a kernel elf binary.  */
         kernel_size = load_elf(kernel_filename, NULL, NULL,
                                &entry, &low, &high,
-                               big_endian, ELF_MACHINE, 0);
+                               big_endian, EM_MICROBLAZE, 0);
         base32 = entry;
         if (base32 == 0xc0000000) {
             kernel_size = load_elf(kernel_filename, translate_kernel_address,
                                    NULL, &entry, NULL, NULL,
-                                   big_endian, ELF_MACHINE, 0);
+                                   big_endian, EM_MICROBLAZE, 0);
         }
         /* Always boot into physical ram.  */
         boot_info.bootstrap_pc = (uint32_t)entry;
diff --git a/target-microblaze/cpu.h b/target-microblaze/cpu.h
index 7e20e59..b49dcf4 100644
--- a/target-microblaze/cpu.h
+++ b/target-microblaze/cpu.h
@@ -34,8 +34,6 @@ typedef struct CPUMBState CPUMBState;
 #include "mmu.h"
 #endif
 
-#define ELF_MACHINE	EM_MICROBLAZE
-
 #define EXCP_MMU        1
 #define EXCP_IRQ        2
 #define EXCP_BREAK      3
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [Qemu-devel] [PATCH 05/19] m68k: Remove ELF_MACHINE from cpu.h
  2015-08-15 23:28 [Qemu-devel] [PATCH 00/19] multi-arch+linux-user: Cleanup ELF_MACHINE Peter Crosthwaite
                   ` (3 preceding siblings ...)
  2015-08-15 23:28 ` [Qemu-devel] [PATCH 04/19] mb: " Peter Crosthwaite
@ 2015-08-15 23:28 ` Peter Crosthwaite
  2015-08-17  0:15   ` Greg Ungerer
  2015-08-18 22:47   ` Laurent Vivier
  2015-08-15 23:28 ` [Qemu-devel] [PATCH 06/19] cris: " Peter Crosthwaite
                   ` (16 subsequent siblings)
  21 siblings, 2 replies; 40+ messages in thread
From: Peter Crosthwaite @ 2015-08-15 23:28 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Crosthwaite, riku.voipio, Laurent Vivier,
	Peter Crosthwaite, Greg Ungerer, pbonzini

From: Peter Crosthwaite <crosthwaitepeter@gmail.com>

The only generic code relying on this is linux-user, but linux users'
default behaviour of defaulting ELF_MACHINE to ELF_ARCH will handle
this.

The machine model bootloaders can just pass EM_68K directly, as that
is architecture specific code.

This removes another architecture specific definition from the global
namespace.

Cc: Laurent Vivier <laurent@vivier.eu>
Cc: Greg Ungerer <gerg@uclinux.org>
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
---
 hw/m68k/an5206.c     | 2 +-
 hw/m68k/dummy_m68k.c | 2 +-
 hw/m68k/mcf5208.c    | 2 +-
 target-m68k/cpu.h    | 2 --
 4 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/hw/m68k/an5206.c b/hw/m68k/an5206.c
index f63ab2b..59e89fe 100644
--- a/hw/m68k/an5206.c
+++ b/hw/m68k/an5206.c
@@ -70,7 +70,7 @@ static void an5206_init(MachineState *machine)
     }
 
     kernel_size = load_elf(kernel_filename, NULL, NULL, &elf_entry,
-                           NULL, NULL, 1, ELF_MACHINE, 0);
+                           NULL, NULL, 1, EM_68K, 0);
     entry = elf_entry;
     if (kernel_size < 0) {
         kernel_size = load_uimage(kernel_filename, &entry, NULL, NULL,
diff --git a/hw/m68k/dummy_m68k.c b/hw/m68k/dummy_m68k.c
index 5b77d93..3463913 100644
--- a/hw/m68k/dummy_m68k.c
+++ b/hw/m68k/dummy_m68k.c
@@ -49,7 +49,7 @@ static void dummy_m68k_init(MachineState *machine)
     /* Load kernel.  */
     if (kernel_filename) {
         kernel_size = load_elf(kernel_filename, NULL, NULL, &elf_entry,
-                               NULL, NULL, 1, ELF_MACHINE, 0);
+                               NULL, NULL, 1, EM_68K, 0);
         entry = elf_entry;
         if (kernel_size < 0) {
             kernel_size = load_uimage(kernel_filename, &entry, NULL, NULL,
diff --git a/hw/m68k/mcf5208.c b/hw/m68k/mcf5208.c
index 326a42d..cb57cf9 100644
--- a/hw/m68k/mcf5208.c
+++ b/hw/m68k/mcf5208.c
@@ -275,7 +275,7 @@ static void mcf5208evb_init(MachineState *machine)
     }
 
     kernel_size = load_elf(kernel_filename, NULL, NULL, &elf_entry,
-                           NULL, NULL, 1, ELF_MACHINE, 0);
+                           NULL, NULL, 1, EM_68K, 0);
     entry = elf_entry;
     if (kernel_size < 0) {
         kernel_size = load_uimage(kernel_filename, &entry, NULL, NULL,
diff --git a/target-m68k/cpu.h b/target-m68k/cpu.h
index 9a62f6c..ebbbeef 100644
--- a/target-m68k/cpu.h
+++ b/target-m68k/cpu.h
@@ -32,8 +32,6 @@
 
 #define MAX_QREGS 32
 
-#define ELF_MACHINE	EM_68K
-
 #define EXCP_ACCESS         2   /* Access (MMU) error.  */
 #define EXCP_ADDRESS        3   /* Address error.  */
 #define EXCP_ILLEGAL        4   /* Illegal instruction.  */
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [Qemu-devel] [PATCH 06/19] cris: Remove ELF_MACHINE from cpu.h
  2015-08-15 23:28 [Qemu-devel] [PATCH 00/19] multi-arch+linux-user: Cleanup ELF_MACHINE Peter Crosthwaite
                   ` (4 preceding siblings ...)
  2015-08-15 23:28 ` [Qemu-devel] [PATCH 05/19] m68k: " Peter Crosthwaite
@ 2015-08-15 23:28 ` Peter Crosthwaite
  2015-08-15 23:28 ` [Qemu-devel] [PATCH 07/19] moxie: " Peter Crosthwaite
                   ` (15 subsequent siblings)
  21 siblings, 0 replies; 40+ messages in thread
From: Peter Crosthwaite @ 2015-08-15 23:28 UTC (permalink / raw)
  To: qemu-devel
  Cc: pbonzini, Peter Crosthwaite, riku.voipio, Peter Crosthwaite,
	Edgar E. Iglesias

From: Peter Crosthwaite <crosthwaitepeter@gmail.com>

The only generic code relying on this is linux-user, but linux users'
default behaviour of defaulting ELF_MACHINE to ELF_ARCH will handle
this.

The bootloader can just pass EM_CRIS directly, as that is architecture
specific code.

This removes another architecture specific definition from the global
namespace.

Cc: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
---
 hw/cris/boot.c    | 2 +-
 target-cris/cpu.h | 2 --
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/hw/cris/boot.c b/hw/cris/boot.c
index 622f353..1cfa339 100644
--- a/hw/cris/boot.c
+++ b/hw/cris/boot.c
@@ -72,7 +72,7 @@ void cris_load_image(CRISCPU *cpu, struct cris_load_info *li)
     /* Boots a kernel elf binary, os/linux-2.6/vmlinux from the axis 
        devboard SDK.  */
     image_size = load_elf(li->image_filename, translate_kernel_address, NULL,
-                          &entry, NULL, &high, 0, ELF_MACHINE, 0);
+                          &entry, NULL, &high, 0, EM_CRIS, 0);
     li->entry = entry;
     if (image_size < 0) {
         /* Takes a kimage from the axis devboard SDK.  */
diff --git a/target-cris/cpu.h b/target-cris/cpu.h
index d422e35..c22d16c 100644
--- a/target-cris/cpu.h
+++ b/target-cris/cpu.h
@@ -29,8 +29,6 @@
 
 #include "exec/cpu-defs.h"
 
-#define ELF_MACHINE	EM_CRIS
-
 #define EXCP_NMI        1
 #define EXCP_GURU       2
 #define EXCP_BUSFAULT   3
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [Qemu-devel] [PATCH 07/19] moxie: Remove ELF_MACHINE from cpu.h
  2015-08-15 23:28 [Qemu-devel] [PATCH 00/19] multi-arch+linux-user: Cleanup ELF_MACHINE Peter Crosthwaite
                   ` (5 preceding siblings ...)
  2015-08-15 23:28 ` [Qemu-devel] [PATCH 06/19] cris: " Peter Crosthwaite
@ 2015-08-15 23:28 ` Peter Crosthwaite
  2015-08-17 18:39   ` Richard Henderson
  2015-08-15 23:28 ` [Qemu-devel] [PATCH 08/19] unicore: " Peter Crosthwaite
                   ` (14 subsequent siblings)
  21 siblings, 1 reply; 40+ messages in thread
From: Peter Crosthwaite @ 2015-08-15 23:28 UTC (permalink / raw)
  To: qemu-devel
  Cc: pbonzini, Peter Crosthwaite, riku.voipio, Anthony Green,
	Peter Crosthwaite

From: Peter Crosthwaite <crosthwaitepeter@gmail.com>

The bootloader can just pass EM_MOXIE directly, as that is architecture
specific code.

This removes another architecture specific definition from the global
namespace.

Cc: Anthony Green <green@moxielogic.com>
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
---
 hw/moxie/moxiesim.c | 2 +-
 target-moxie/cpu.h  | 2 --
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/hw/moxie/moxiesim.c b/hw/moxie/moxiesim.c
index 80bcc5b..c3697c6 100644
--- a/hw/moxie/moxiesim.c
+++ b/hw/moxie/moxiesim.c
@@ -53,7 +53,7 @@ static void load_kernel(MoxieCPU *cpu, LoaderParams *loader_params)
 
     kernel_size = load_elf(loader_params->kernel_filename,  NULL, NULL,
                            &entry, &kernel_low, &kernel_high, 1,
-                           ELF_MACHINE, 0);
+                           0xFEED /* EM_MOXIE */, 0);
 
     if (kernel_size <= 0) {
         fprintf(stderr, "qemu: could not load kernel '%s'\n",
diff --git a/target-moxie/cpu.h b/target-moxie/cpu.h
index 29572aa..e27a6a3 100644
--- a/target-moxie/cpu.h
+++ b/target-moxie/cpu.h
@@ -26,8 +26,6 @@
 
 #define CPUArchState struct CPUMoxieState
 
-#define ELF_MACHINE     0xFEED /* EM_MOXIE */
-
 #define MOXIE_EX_DIV0        0
 #define MOXIE_EX_BAD         1
 #define MOXIE_EX_IRQ         2
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [Qemu-devel] [PATCH 08/19] unicore: Remove ELF_MACHINE from cpu.h
  2015-08-15 23:28 [Qemu-devel] [PATCH 00/19] multi-arch+linux-user: Cleanup ELF_MACHINE Peter Crosthwaite
                   ` (6 preceding siblings ...)
  2015-08-15 23:28 ` [Qemu-devel] [PATCH 07/19] moxie: " Peter Crosthwaite
@ 2015-08-15 23:28 ` Peter Crosthwaite
  2015-08-15 23:28 ` [Qemu-devel] [PATCH 10/19] or32: " Peter Crosthwaite
                   ` (13 subsequent siblings)
  21 siblings, 0 replies; 40+ messages in thread
From: Peter Crosthwaite @ 2015-08-15 23:28 UTC (permalink / raw)
  To: qemu-devel
  Cc: Guan Xuetao, pbonzini, Peter Crosthwaite, riku.voipio, Peter Crosthwaite

From: Peter Crosthwaite <crosthwaitepeter@gmail.com>

The only generic code relying on this is linux-user, but linux users'
default behaviour of defaulting ELF_MACHINE to ELF_ARCH will handle
this.

This removes another architecture specific definition from the global
namespace.

Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
---
 target-unicore32/cpu.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/target-unicore32/cpu.h b/target-unicore32/cpu.h
index 45e31e5..3c06996 100644
--- a/target-unicore32/cpu.h
+++ b/target-unicore32/cpu.h
@@ -17,8 +17,6 @@
 #define TARGET_PHYS_ADDR_SPACE_BITS     32
 #define TARGET_VIRT_ADDR_SPACE_BITS     32
 
-#define ELF_MACHINE             EM_UNICORE32
-
 #define CPUArchState                struct CPUUniCore32State
 
 #include "config.h"
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [Qemu-devel] [PATCH 10/19] or32: Remove ELF_MACHINE from cpu.h
  2015-08-15 23:28 [Qemu-devel] [PATCH 00/19] multi-arch+linux-user: Cleanup ELF_MACHINE Peter Crosthwaite
                   ` (7 preceding siblings ...)
  2015-08-15 23:28 ` [Qemu-devel] [PATCH 08/19] unicore: " Peter Crosthwaite
@ 2015-08-15 23:28 ` Peter Crosthwaite
  2015-08-15 23:28 ` [Qemu-devel] [PATCH 11/19] tricore: " Peter Crosthwaite
                   ` (12 subsequent siblings)
  21 siblings, 0 replies; 40+ messages in thread
From: Peter Crosthwaite @ 2015-08-15 23:28 UTC (permalink / raw)
  To: qemu-devel
  Cc: pbonzini, Peter Crosthwaite, riku.voipio, Jia Liu, Peter Crosthwaite

From: Peter Crosthwaite <crosthwaitepeter@gmail.com>

The only generic code relying on this is linux-user, but linux users'
default behaviour of defaulting ELF_MACHINE to ELF_ARCH will handle
this.

The bootloader can just pass EM_OPENRISC directly, as that is
architecture specific code.

This removes another architecture specific definition from the global
namespace.

Cc: Jia Liu <proljc@gmail.com>
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
---
 hw/openrisc/openrisc_sim.c | 2 +-
 target-openrisc/cpu.h      | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/hw/openrisc/openrisc_sim.c b/hw/openrisc/openrisc_sim.c
index 1da0657..fb6d8ea 100644
--- a/hw/openrisc/openrisc_sim.c
+++ b/hw/openrisc/openrisc_sim.c
@@ -68,7 +68,7 @@ static void cpu_openrisc_load_kernel(ram_addr_t ram_size,
 
     if (kernel_filename && !qtest_enabled()) {
         kernel_size = load_elf(kernel_filename, NULL, NULL,
-                               &elf_entry, NULL, NULL, 1, ELF_MACHINE, 1);
+                               &elf_entry, NULL, NULL, 1, EM_OPENRISC, 1);
         entry = elf_entry;
         if (kernel_size < 0) {
             kernel_size = load_uimage(kernel_filename,
diff --git a/target-openrisc/cpu.h b/target-openrisc/cpu.h
index 36c4f20..ac8b969 100644
--- a/target-openrisc/cpu.h
+++ b/target-openrisc/cpu.h
@@ -21,7 +21,6 @@
 #define CPU_OPENRISC_H
 
 #define TARGET_LONG_BITS 32
-#define ELF_MACHINE    EM_OPENRISC
 
 #define CPUArchState struct CPUOpenRISCState
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [Qemu-devel] [PATCH 11/19] tricore: Remove ELF_MACHINE from cpu.h
  2015-08-15 23:28 [Qemu-devel] [PATCH 00/19] multi-arch+linux-user: Cleanup ELF_MACHINE Peter Crosthwaite
                   ` (8 preceding siblings ...)
  2015-08-15 23:28 ` [Qemu-devel] [PATCH 10/19] or32: " Peter Crosthwaite
@ 2015-08-15 23:28 ` Peter Crosthwaite
  2015-08-18 18:01   ` Bastian Koppelmann
  2015-08-15 23:28 ` [Qemu-devel] [PATCH 12/19] xtensa: " Peter Crosthwaite
                   ` (11 subsequent siblings)
  21 siblings, 1 reply; 40+ messages in thread
From: Peter Crosthwaite @ 2015-08-15 23:28 UTC (permalink / raw)
  To: qemu-devel
  Cc: pbonzini, Peter Crosthwaite, riku.voipio, Peter Crosthwaite,
	Bastian Koppelmann

From: Peter Crosthwaite <crosthwaitepeter@gmail.com>

The bootloader can just pass EM_TRICORE directly, as that
is architecture specific code.

This removes another architecture specific definition from the global
namespace.

Cc: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
---
 hw/tricore/tricore_testboard.c | 2 +-
 target-tricore/cpu.h           | 2 --
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/hw/tricore/tricore_testboard.c b/hw/tricore/tricore_testboard.c
index a059a20..62b406b 100644
--- a/hw/tricore/tricore_testboard.c
+++ b/hw/tricore/tricore_testboard.c
@@ -44,7 +44,7 @@ static void tricore_load_kernel(CPUTriCoreState *env)
     kernel_size = load_elf(tricoretb_binfo.kernel_filename, NULL,
                            NULL, (uint64_t *)&entry, NULL,
                            NULL, 0,
-                           ELF_MACHINE, 1);
+                           EM_TRICORE, 1);
     if (kernel_size <= 0) {
         error_report("qemu: no kernel file '%s'",
                 tricoretb_binfo.kernel_filename);
diff --git a/target-tricore/cpu.h b/target-tricore/cpu.h
index 916ee27..a72a7d8 100644
--- a/target-tricore/cpu.h
+++ b/target-tricore/cpu.h
@@ -25,8 +25,6 @@
 #include "exec/cpu-defs.h"
 #include "fpu/softfloat.h"
 
-#define ELF_MACHINE     EM_TRICORE
-
 #define CPUArchState struct CPUTriCoreState
 
 struct CPUTriCoreState;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [Qemu-devel] [PATCH 12/19] xtensa: Remove ELF_MACHINE from cpu.h
  2015-08-15 23:28 [Qemu-devel] [PATCH 00/19] multi-arch+linux-user: Cleanup ELF_MACHINE Peter Crosthwaite
                   ` (9 preceding siblings ...)
  2015-08-15 23:28 ` [Qemu-devel] [PATCH 11/19] tricore: " Peter Crosthwaite
@ 2015-08-15 23:28 ` Peter Crosthwaite
  2015-08-15 23:28 ` [Qemu-devel] [PATCH 13/19] sh4: " Peter Crosthwaite
                   ` (10 subsequent siblings)
  21 siblings, 0 replies; 40+ messages in thread
From: Peter Crosthwaite @ 2015-08-15 23:28 UTC (permalink / raw)
  To: qemu-devel
  Cc: pbonzini, Peter Crosthwaite, riku.voipio, Peter Crosthwaite,
	Max Filippov

From: Peter Crosthwaite <crosthwaitepeter@gmail.com>

The bootloaders can just pass EM_XTENSA directly, as that
is architecture specific code.

This removes another architecture specific definition from the global
namespace.

Cc: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
---
 hw/xtensa/sim.c     | 4 ++--
 hw/xtensa/xtfpga.c  | 2 +-
 target-xtensa/cpu.h | 1 -
 3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/hw/xtensa/sim.c b/hw/xtensa/sim.c
index 328d209..8bd0c22 100644
--- a/hw/xtensa/sim.c
+++ b/hw/xtensa/sim.c
@@ -93,10 +93,10 @@ static void xtensa_sim_init(MachineState *machine)
         uint64_t elf_lowaddr;
 #ifdef TARGET_WORDS_BIGENDIAN
         int success = load_elf(kernel_filename, translate_phys_addr, cpu,
-                &elf_entry, &elf_lowaddr, NULL, 1, ELF_MACHINE, 0);
+                &elf_entry, &elf_lowaddr, NULL, 1, EM_XTENSA, 0);
 #else
         int success = load_elf(kernel_filename, translate_phys_addr, cpu,
-                &elf_entry, &elf_lowaddr, NULL, 0, ELF_MACHINE, 0);
+                &elf_entry, &elf_lowaddr, NULL, 0, EM_XTENSA, 0);
 #endif
         if (success > 0) {
             env->pc = elf_entry;
diff --git a/hw/xtensa/xtfpga.c b/hw/xtensa/xtfpga.c
index ab4d0e4..ba67035 100644
--- a/hw/xtensa/xtfpga.c
+++ b/hw/xtensa/xtfpga.c
@@ -340,7 +340,7 @@ static void lx_init(const LxBoardDesc *board, MachineState *machine)
         uint64_t elf_entry;
         uint64_t elf_lowaddr;
         int success = load_elf(kernel_filename, translate_phys_addr, cpu,
-                &elf_entry, &elf_lowaddr, NULL, be, ELF_MACHINE, 0);
+                &elf_entry, &elf_lowaddr, NULL, be, EM_XTENSA, 0);
         if (success > 0) {
             entry_point = elf_entry;
         } else {
diff --git a/target-xtensa/cpu.h b/target-xtensa/cpu.h
index 96bfc82..4ec005e 100644
--- a/target-xtensa/cpu.h
+++ b/target-xtensa/cpu.h
@@ -30,7 +30,6 @@
 
 #define ALIGNED_ONLY
 #define TARGET_LONG_BITS 32
-#define ELF_MACHINE EM_XTENSA
 
 #define CPUArchState struct CPUXtensaState
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [Qemu-devel] [PATCH 13/19] sh4: Remove ELF_MACHINE from cpu.h
  2015-08-15 23:28 [Qemu-devel] [PATCH 00/19] multi-arch+linux-user: Cleanup ELF_MACHINE Peter Crosthwaite
                   ` (10 preceding siblings ...)
  2015-08-15 23:28 ` [Qemu-devel] [PATCH 12/19] xtensa: " Peter Crosthwaite
@ 2015-08-15 23:28 ` Peter Crosthwaite
  2015-08-17 20:40   ` Aurelien Jarno
  2015-08-15 23:28 ` [Qemu-devel] [PATCH 14/19] s390: " Peter Crosthwaite
                   ` (9 subsequent siblings)
  21 siblings, 1 reply; 40+ messages in thread
From: Peter Crosthwaite @ 2015-08-15 23:28 UTC (permalink / raw)
  To: qemu-devel
  Cc: pbonzini, Peter Crosthwaite, riku.voipio, Aurelien Jarno,
	Peter Crosthwaite

From: Peter Crosthwaite <crosthwaitepeter@gmail.com>

The only generic code relying on this is linux-user, but linux users'
default behaviour of defaulting ELF_MACHINE to ELF_ARCH will handle
this.

This removes another architecture specific definition from the global
namespace.

Cc: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
---
 target-sh4/cpu.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/target-sh4/cpu.h b/target-sh4/cpu.h
index 34bb3d7..e2913b8 100644
--- a/target-sh4/cpu.h
+++ b/target-sh4/cpu.h
@@ -24,8 +24,6 @@
 
 #define TARGET_LONG_BITS 32
 
-#define ELF_MACHINE	EM_SH
-
 /* CPU Subtypes */
 #define SH_CPU_SH7750  (1 << 0)
 #define SH_CPU_SH7750S (1 << 1)
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [Qemu-devel] [PATCH 14/19] s390: Remove ELF_MACHINE from cpu.h
  2015-08-15 23:28 [Qemu-devel] [PATCH 00/19] multi-arch+linux-user: Cleanup ELF_MACHINE Peter Crosthwaite
                   ` (11 preceding siblings ...)
  2015-08-15 23:28 ` [Qemu-devel] [PATCH 13/19] sh4: " Peter Crosthwaite
@ 2015-08-15 23:28 ` Peter Crosthwaite
  2015-08-15 23:28 ` [Qemu-devel] [PATCH 15/19] sparc: " Peter Crosthwaite
                   ` (8 subsequent siblings)
  21 siblings, 0 replies; 40+ messages in thread
From: Peter Crosthwaite @ 2015-08-15 23:28 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Crosthwaite, riku.voipio, Alexander Graf,
	Peter Crosthwaite, pbonzini, Richard Henderson

From: Peter Crosthwaite <crosthwaitepeter@gmail.com>

The bootloader can just pass EM_S390 directly, as that
is architecture specific code.

This removes another architecture specific definition from the global
namespace.

Cc: Richard Henderson <rth@twiddle.net>
Cc: Alexander Graf <agraf@suse.de>
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
---
 hw/s390x/ipl.c     | 4 ++--
 target-s390x/cpu.h | 1 -
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
index 2e0a8b6..31473e7 100644
--- a/hw/s390x/ipl.c
+++ b/hw/s390x/ipl.c
@@ -132,7 +132,7 @@ static int s390_ipl_init(SysBusDevice *dev)
 
         bios_size = load_elf(bios_filename, bios_translate_addr, &fwbase,
                              &ipl->bios_start_addr, NULL, NULL, 1,
-                             ELF_MACHINE, 0);
+                             EM_S390, 0);
         if (bios_size > 0) {
             /* Adjust ELF start address to final location */
             ipl->bios_start_addr += fwbase;
@@ -154,7 +154,7 @@ static int s390_ipl_init(SysBusDevice *dev)
 
     if (ipl->kernel) {
         kernel_size = load_elf(ipl->kernel, NULL, NULL, &pentry, NULL,
-                               NULL, 1, ELF_MACHINE, 0);
+                               NULL, 1, EM_S390, 0);
         if (kernel_size < 0) {
             kernel_size = load_image_targphys(ipl->kernel, 0, ram_size);
         }
diff --git a/target-s390x/cpu.h b/target-s390x/cpu.h
index 63aebf4..3b4d4e5 100644
--- a/target-s390x/cpu.h
+++ b/target-s390x/cpu.h
@@ -27,7 +27,6 @@
 
 #define TARGET_LONG_BITS 64
 
-#define ELF_MACHINE	EM_S390
 #define ELF_MACHINE_UNAME "S390X"
 
 #define CPUArchState struct CPUS390XState
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [Qemu-devel] [PATCH 15/19] sparc: Remove ELF_MACHINE from cpu.h
  2015-08-15 23:28 [Qemu-devel] [PATCH 00/19] multi-arch+linux-user: Cleanup ELF_MACHINE Peter Crosthwaite
                   ` (12 preceding siblings ...)
  2015-08-15 23:28 ` [Qemu-devel] [PATCH 14/19] s390: " Peter Crosthwaite
@ 2015-08-15 23:28 ` Peter Crosthwaite
  2015-08-15 23:28 ` [Qemu-devel] [PATCH 16/19] mips: " Peter Crosthwaite
                   ` (7 subsequent siblings)
  21 siblings, 0 replies; 40+ messages in thread
From: Peter Crosthwaite @ 2015-08-15 23:28 UTC (permalink / raw)
  To: qemu-devel
  Cc: pbonzini, Peter Crosthwaite, riku.voipio, Mark Cave-Ayland,
	Peter Crosthwaite

From: Peter Crosthwaite <crosthwaitepeter@gmail.com>

The bootloaders can just pass EM_SPARC or EM_SPARCV9 directly, as
they are architecture specific code (to one or the other).

This removes another architecture specific definition from the global
namespace.

Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
---
 hw/sparc/leon3.c   | 2 +-
 hw/sparc/sun4m.c   | 4 ++--
 hw/sparc64/sun4u.c | 4 ++--
 target-sparc/cpu.h | 6 ------
 4 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c
index 7f5dcd6..2d7ec76 100644
--- a/hw/sparc/leon3.c
+++ b/hw/sparc/leon3.c
@@ -193,7 +193,7 @@ static void leon3_generic_hw_init(MachineState *machine)
         uint64_t entry;
 
         kernel_size = load_elf(kernel_filename, NULL, NULL, &entry, NULL, NULL,
-                               1 /* big endian */, ELF_MACHINE, 0);
+                               1 /* big endian */, EM_SPARC, 0);
         if (kernel_size < 0) {
             fprintf(stderr, "qemu: could not load kernel '%s'\n",
                     kernel_filename);
diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c
index 68ac4d8..6eb7ef8 100644
--- a/hw/sparc/sun4m.c
+++ b/hw/sparc/sun4m.c
@@ -300,7 +300,7 @@ static unsigned long sun4m_load_kernel(const char *kernel_filename,
         bswap_needed = 0;
 #endif
         kernel_size = load_elf(kernel_filename, translate_kernel_address, NULL,
-                               NULL, NULL, NULL, 1, ELF_MACHINE, 0);
+                               NULL, NULL, NULL, 1, EM_SPARC, 0);
         if (kernel_size < 0)
             kernel_size = load_aout(kernel_filename, KERNEL_LOAD_ADDR,
                                     RAM_size - KERNEL_LOAD_ADDR, bswap_needed,
@@ -744,7 +744,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, translate_prom_address, &addr, NULL,
-                       NULL, NULL, 1, ELF_MACHINE, 0);
+                       NULL, NULL, 1, EM_SPARC, 0);
         if (ret < 0 || ret > PROM_SIZE_MAX) {
             ret = load_image_targphys(filename, addr, PROM_SIZE_MAX);
         }
diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
index 30cfa0e..d359cb8 100644
--- a/hw/sparc64/sun4u.c
+++ b/hw/sparc64/sun4u.c
@@ -208,7 +208,7 @@ static uint64_t sun4u_load_kernel(const char *kernel_filename,
         bswap_needed = 0;
 #endif
         kernel_size = load_elf(kernel_filename, NULL, NULL, kernel_entry,
-                               kernel_addr, &kernel_top, 1, ELF_MACHINE, 0);
+                               kernel_addr, &kernel_top, 1, EM_SPARCV9, 0);
         if (kernel_size < 0) {
             *kernel_addr = KERNEL_LOAD_ADDR;
             *kernel_entry = KERNEL_LOAD_ADDR;
@@ -671,7 +671,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, translate_prom_address, &addr,
-                       NULL, NULL, NULL, 1, ELF_MACHINE, 0);
+                       NULL, NULL, NULL, 1, EM_SPARCV9, 0);
         if (ret < 0 || ret > PROM_SIZE_MAX) {
             ret = load_image_targphys(filename, addr, PROM_SIZE_MAX);
         }
diff --git a/target-sparc/cpu.h b/target-sparc/cpu.h
index 0522b65..b5ff644 100644
--- a/target-sparc/cpu.h
+++ b/target-sparc/cpu.h
@@ -31,12 +31,6 @@
 
 #include "fpu/softfloat.h"
 
-#if !defined(TARGET_SPARC64)
-#define ELF_MACHINE     EM_SPARC
-#else
-#define ELF_MACHINE     EM_SPARCV9
-#endif
-
 /*#define EXCP_INTERRUPT 0x100*/
 
 /* trap definitions */
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [Qemu-devel] [PATCH 16/19] mips: Remove ELF_MACHINE from cpu.h
  2015-08-15 23:28 [Qemu-devel] [PATCH 00/19] multi-arch+linux-user: Cleanup ELF_MACHINE Peter Crosthwaite
                   ` (13 preceding siblings ...)
  2015-08-15 23:28 ` [Qemu-devel] [PATCH 15/19] sparc: " Peter Crosthwaite
@ 2015-08-15 23:28 ` Peter Crosthwaite
  2015-08-17 20:40   ` Aurelien Jarno
  2015-08-15 23:28 ` [Qemu-devel] [PATCH 17/19] alpha: " Peter Crosthwaite
                   ` (6 subsequent siblings)
  21 siblings, 1 reply; 40+ messages in thread
From: Peter Crosthwaite @ 2015-08-15 23:28 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Crosthwaite, riku.voipio, Peter Crosthwaite, pbonzini,
	Leon Alrae, Aurelien Jarno

From: Peter Crosthwaite <crosthwaitepeter@gmail.com>

The only generic code relying on this is linux-user, but linux users'
default behaviour of defaulting ELF_MACHINE to ELF_ARCH will handle
this.

The bootloaders can just pass EM_MIPS directly, as that is
architecture specific code.

This removes another architecture specific definition from the global
namespace.

Cc: Aurelien Jarno <aurelien@aurel32.net>
Cc: Leon Alrae <leon.alrae@imgtec.com>
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
---
 hw/mips/mips_fulong2e.c | 2 +-
 hw/mips/mips_malta.c    | 2 +-
 hw/mips/mips_mipssim.c  | 2 +-
 hw/mips/mips_r4k.c      | 2 +-
 target-mips/cpu.h       | 2 --
 5 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c
index dea941a..a6c746a 100644
--- a/hw/mips/mips_fulong2e.c
+++ b/hw/mips/mips_fulong2e.c
@@ -116,7 +116,7 @@ static int64_t load_kernel (CPUMIPSState *env)
 
     if (load_elf(loaderparams.kernel_filename, cpu_mips_kseg0_to_phys, NULL,
                  (uint64_t *)&kernel_entry, (uint64_t *)&kernel_low,
-                 (uint64_t *)&kernel_high, 0, ELF_MACHINE, 1) < 0) {
+                 (uint64_t *)&kernel_high, 0, EM_MIPS, 1) < 0) {
         fprintf(stderr, "qemu: could not load kernel '%s'\n",
                 loaderparams.kernel_filename);
         exit(1);
diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c
index 3082e75..bf477b6 100644
--- a/hw/mips/mips_malta.c
+++ b/hw/mips/mips_malta.c
@@ -795,7 +795,7 @@ static int64_t load_kernel (void)
 
     if (load_elf(loaderparams.kernel_filename, cpu_mips_kseg0_to_phys, NULL,
                  (uint64_t *)&kernel_entry, NULL, (uint64_t *)&kernel_high,
-                 big_endian, ELF_MACHINE, 1) < 0) {
+                 big_endian, EM_MIPS, 1) < 0) {
         fprintf(stderr, "qemu: could not load kernel '%s'\n",
                 loaderparams.kernel_filename);
         exit(1);
diff --git a/hw/mips/mips_mipssim.c b/hw/mips/mips_mipssim.c
index 61f74a6..b08667d 100644
--- a/hw/mips/mips_mipssim.c
+++ b/hw/mips/mips_mipssim.c
@@ -69,7 +69,7 @@ static int64_t load_kernel(void)
     kernel_size = load_elf(loaderparams.kernel_filename, cpu_mips_kseg0_to_phys,
                            NULL, (uint64_t *)&entry, NULL,
                            (uint64_t *)&kernel_high, big_endian,
-                           ELF_MACHINE, 1);
+                           EM_MIPS, 1);
     if (kernel_size >= 0) {
         if ((entry & ~0x7fffffffULL) == 0x80000000)
             entry = (int32_t)entry;
diff --git a/hw/mips/mips_r4k.c b/hw/mips/mips_r4k.c
index f4dcacd..239a9fd 100644
--- a/hw/mips/mips_r4k.c
+++ b/hw/mips/mips_r4k.c
@@ -87,7 +87,7 @@ static int64_t load_kernel(void)
     kernel_size = load_elf(loaderparams.kernel_filename, cpu_mips_kseg0_to_phys,
                            NULL, (uint64_t *)&entry, NULL,
                            (uint64_t *)&kernel_high, big_endian,
-                           ELF_MACHINE, 1);
+                           EM_MIPS, 1);
     if (kernel_size >= 0) {
         if ((entry & ~0x7fffffffULL) == 0x80000000)
             entry = (int32_t)entry;
diff --git a/target-mips/cpu.h b/target-mips/cpu.h
index c91883d..258cccd 100644
--- a/target-mips/cpu.h
+++ b/target-mips/cpu.h
@@ -5,8 +5,6 @@
 
 #define ALIGNED_ONLY
 
-#define ELF_MACHINE	EM_MIPS
-
 #define CPUArchState struct CPUMIPSState
 
 #include "config.h"
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [Qemu-devel] [PATCH 17/19] alpha: Remove ELF_MACHINE from cpu.h
  2015-08-15 23:28 [Qemu-devel] [PATCH 00/19] multi-arch+linux-user: Cleanup ELF_MACHINE Peter Crosthwaite
                   ` (14 preceding siblings ...)
  2015-08-15 23:28 ` [Qemu-devel] [PATCH 16/19] mips: " Peter Crosthwaite
@ 2015-08-15 23:28 ` Peter Crosthwaite
  2015-08-15 23:28 ` [Qemu-devel] [PATCH 18/19] i386: Rename ELF_MACHINE to be x86 specific Peter Crosthwaite
                   ` (5 subsequent siblings)
  21 siblings, 0 replies; 40+ messages in thread
From: Peter Crosthwaite @ 2015-08-15 23:28 UTC (permalink / raw)
  To: qemu-devel
  Cc: pbonzini, Peter Crosthwaite, riku.voipio, Peter Crosthwaite,
	Richard Henderson

From: Peter Crosthwaite <crosthwaitepeter@gmail.com>

ELF_MACHINE is unused by target alpha.

Cc: Richard Henderson <rth@twiddle.net>
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
---
 target-alpha/cpu.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/target-alpha/cpu.h b/target-alpha/cpu.h
index 91c56d6..2ca8dbe 100644
--- a/target-alpha/cpu.h
+++ b/target-alpha/cpu.h
@@ -32,8 +32,6 @@
 
 #include "fpu/softfloat.h"
 
-#define ELF_MACHINE     EM_ALPHA
-
 #define ICACHE_LINE_SIZE 32
 #define DCACHE_LINE_SIZE 32
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [Qemu-devel] [PATCH 18/19] i386: Rename ELF_MACHINE to be x86 specific
  2015-08-15 23:28 [Qemu-devel] [PATCH 00/19] multi-arch+linux-user: Cleanup ELF_MACHINE Peter Crosthwaite
                   ` (15 preceding siblings ...)
  2015-08-15 23:28 ` [Qemu-devel] [PATCH 17/19] alpha: " Peter Crosthwaite
@ 2015-08-15 23:28 ` Peter Crosthwaite
  2015-08-17 19:13   ` Eduardo Habkost
  2015-08-15 23:28 ` [Qemu-devel] [PATCH 19/19] ppc: Rename ELF_MACHINE to be PPC specific Peter Crosthwaite
                   ` (4 subsequent siblings)
  21 siblings, 1 reply; 40+ messages in thread
From: Peter Crosthwaite @ 2015-08-15 23:28 UTC (permalink / raw)
  To: qemu-devel
  Cc: Eduardo Habkost, Peter Crosthwaite, riku.voipio,
	Peter Crosthwaite, pbonzini, Richard Henderson

From: Peter Crosthwaite <crosthwaitepeter@gmail.com>

Rename ELF_MACHINE to be I386 specific. This is used as-is by the
multiboot loader.

Linux-user previously used this definition but will not anymore,
falling back to the default bahaviour of using ELF_ARCH as ELF_MACHINE.

This removes another architecture specific definition from the global
namespace.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
---
 hw/i386/multiboot.c | 2 +-
 target-i386/cpu.h   | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/hw/i386/multiboot.c b/hw/i386/multiboot.c
index 1adbe9e..6774a19 100644
--- a/hw/i386/multiboot.c
+++ b/hw/i386/multiboot.c
@@ -195,7 +195,7 @@ int load_multiboot(FWCfgState *fw_cfg,
         }
 
         kernel_size = load_elf(kernel_filename, NULL, NULL, &elf_entry,
-                               &elf_low, &elf_high, 0, ELF_MACHINE, 0);
+                               &elf_low, &elf_high, 0, I386_ELF_MACHINE, 0);
         if (kernel_size < 0) {
             fprintf(stderr, "Error while loading elf kernel\n");
             exit(1);
diff --git a/target-i386/cpu.h b/target-i386/cpu.h
index 74b674d..bec5e72 100644
--- a/target-i386/cpu.h
+++ b/target-i386/cpu.h
@@ -36,10 +36,10 @@
 #define TARGET_HAS_PRECISE_SMC
 
 #ifdef TARGET_X86_64
-#define ELF_MACHINE     EM_X86_64
+#define I386_ELF_MACHINE  EM_X86_64
 #define ELF_MACHINE_UNAME "x86_64"
 #else
-#define ELF_MACHINE     EM_386
+#define I386_ELF_MACHINE  EM_386
 #define ELF_MACHINE_UNAME "i686"
 #endif
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [Qemu-devel] [PATCH 19/19] ppc: Rename ELF_MACHINE to be PPC specific
  2015-08-15 23:28 [Qemu-devel] [PATCH 00/19] multi-arch+linux-user: Cleanup ELF_MACHINE Peter Crosthwaite
                   ` (16 preceding siblings ...)
  2015-08-15 23:28 ` [Qemu-devel] [PATCH 18/19] i386: Rename ELF_MACHINE to be x86 specific Peter Crosthwaite
@ 2015-08-15 23:28 ` Peter Crosthwaite
  2015-08-19  1:04   ` [Qemu-devel] [Qemu-ppc] " Laurent Vivier
       [not found] ` <9f0ea9969cdc869442178780fa35d6ac700bcd79.1439679104.git.crosthwaite.peter@gmail.com>
                   ` (3 subsequent siblings)
  21 siblings, 1 reply; 40+ messages in thread
From: Peter Crosthwaite @ 2015-08-15 23:28 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Crosthwaite, riku.voipio, Alexander Graf,
	Peter Crosthwaite, qemu-ppc, pbonzini

From: Peter Crosthwaite <crosthwaitepeter@gmail.com>

Rename ELF_MACHINE to be PPC specific. This is used as-is by the
various PPC bootloaders and is locally defined to ELF_MACHINE in linux
user in PPC specific ifdeffery.

This removes another architecture specific definition from the global
namespace (as desired by multi-arch).

Cc: Alexander Graf <agraf@suse.de>
Cc: qemu-ppc@nongnu.org
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
---
 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/prep.c          | 2 +-
 hw/ppc/spapr.c         | 4 ++--
 hw/ppc/virtex_ml507.c  | 2 +-
 linux-user/elfload.c   | 1 +
 target-ppc/cpu.h       | 4 ++--
 9 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
index d300846..8b45bf6 100644
--- a/hw/ppc/e500.c
+++ b/hw/ppc/e500.c
@@ -1017,7 +1017,7 @@ void ppce500_init(MachineState *machine, PPCE500Params *params)
     filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
 
     bios_size = load_elf(filename, NULL, NULL, &bios_entry, &loadaddr, NULL,
-                         1, ELF_MACHINE, 0);
+                         1, PPC_ELF_MACHINE, 0);
     if (bios_size < 0) {
         /*
          * Hrm. No ELF image? Try a uImage, maybe someone is giving us an
diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c
index 77d5c81..81d744c 100644
--- a/hw/ppc/mac_newworld.c
+++ b/hw/ppc/mac_newworld.c
@@ -219,7 +219,7 @@ static void ppc_core99_init(MachineState *machine)
     /* Load OpenBIOS (ELF) */
     if (filename) {
         bios_size = load_elf(filename, NULL, NULL, NULL,
-                             NULL, NULL, 1, ELF_MACHINE, 0);
+                             NULL, NULL, 1, PPC_ELF_MACHINE, 0);
 
         g_free(filename);
     } else {
@@ -242,7 +242,7 @@ static void ppc_core99_init(MachineState *machine)
         kernel_base = KERNEL_LOAD_ADDR;
 
         kernel_size = load_elf(kernel_filename, translate_kernel_address, NULL,
-                               NULL, &lowaddr, NULL, 1, ELF_MACHINE, 0);
+                               NULL, &lowaddr, NULL, 1, PPC_ELF_MACHINE, 0);
         if (kernel_size < 0)
             kernel_size = load_aout(kernel_filename, kernel_base,
                                     ram_size - kernel_base, bswap_needed,
diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c
index 06fdbaf..00cb080 100644
--- a/hw/ppc/mac_oldworld.c
+++ b/hw/ppc/mac_oldworld.c
@@ -147,7 +147,7 @@ static void ppc_heathrow_init(MachineState *machine)
     /* Load OpenBIOS (ELF) */
     if (filename) {
         bios_size = load_elf(filename, 0, NULL, NULL, NULL, NULL,
-                             1, ELF_MACHINE, 0);
+                             1, PPC_ELF_MACHINE, 0);
         g_free(filename);
     } else {
         bios_size = -1;
@@ -168,7 +168,7 @@ static void ppc_heathrow_init(MachineState *machine)
 #endif
         kernel_base = KERNEL_LOAD_ADDR;
         kernel_size = load_elf(kernel_filename, translate_kernel_address, NULL,
-                               NULL, &lowaddr, NULL, 1, ELF_MACHINE, 0);
+                               NULL, &lowaddr, NULL, 1, PPC_ELF_MACHINE, 0);
         if (kernel_size < 0)
             kernel_size = load_aout(kernel_filename, kernel_base,
                                     ram_size - kernel_base, bswap_needed,
diff --git a/hw/ppc/ppc440_bamboo.c b/hw/ppc/ppc440_bamboo.c
index 032fa80..c54f79d 100644
--- a/hw/ppc/ppc440_bamboo.c
+++ b/hw/ppc/ppc440_bamboo.c
@@ -256,7 +256,7 @@ static void bamboo_init(MachineState *machine)
                               NULL, NULL);
         if (success < 0) {
             success = load_elf(kernel_filename, NULL, NULL, &elf_entry,
-                               &elf_lowaddr, NULL, 1, ELF_MACHINE, 0);
+                               &elf_lowaddr, NULL, 1, PPC_ELF_MACHINE, 0);
             entry = elf_entry;
             loadaddr = elf_lowaddr;
         }
diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c
index 45b5f62..b421bff 100644
--- a/hw/ppc/prep.c
+++ b/hw/ppc/prep.c
@@ -610,7 +610,7 @@ static void ppc_prep_init(MachineState *machine)
         bios_name = BIOS_FILENAME;
     }
     qdev_prop_set_string(dev, "bios-name", bios_name);
-    qdev_prop_set_uint32(dev, "elf-machine", ELF_MACHINE);
+    qdev_prop_set_uint32(dev, "elf-machine", PPC_ELF_MACHINE);
     pcihost = PCI_HOST_BRIDGE(dev);
     object_property_add_child(qdev_get_machine(), "raven", OBJECT(dev), NULL);
     qdev_init_nofail(dev);
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index bf0c64f..4500497 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -1636,11 +1636,11 @@ static void ppc_spapr_init(MachineState *machine)
         uint64_t lowaddr = 0;
 
         kernel_size = load_elf(kernel_filename, translate_kernel_address, NULL,
-                               NULL, &lowaddr, NULL, 1, ELF_MACHINE, 0);
+                               NULL, &lowaddr, NULL, 1, PPC_ELF_MACHINE, 0);
         if (kernel_size == ELF_LOAD_WRONG_ENDIAN) {
             kernel_size = load_elf(kernel_filename,
                                    translate_kernel_address, NULL,
-                                   NULL, &lowaddr, NULL, 0, ELF_MACHINE, 0);
+                                   NULL, &lowaddr, NULL, 0, PPC_ELF_MACHINE, 0);
             kernel_le = kernel_size > 0;
         }
         if (kernel_size < 0) {
diff --git a/hw/ppc/virtex_ml507.c b/hw/ppc/virtex_ml507.c
index de86f7c..d3cf437 100644
--- a/hw/ppc/virtex_ml507.c
+++ b/hw/ppc/virtex_ml507.c
@@ -257,7 +257,7 @@ static void virtex_init(MachineState *machine)
 
         /* Boots a kernel elf binary.  */
         kernel_size = load_elf(kernel_filename, NULL, NULL,
-                               &entry, &low, &high, 1, ELF_MACHINE, 0);
+                               &entry, &low, &high, 1, PPC_ELF_MACHINE, 0);
         boot_info.bootstrap_pc = entry & 0x00ffffff;
 
         if (kernel_size < 0) {
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 09e1e6a..4ade8e9 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -678,6 +678,7 @@ static inline void init_thread(struct target_pt_regs *regs,
 
 #ifdef TARGET_PPC
 
+#define ELF_MACHINE    PPC_ELF_MACHINE
 #define ELF_START_MMAP 0x80000000
 
 #if defined(TARGET_PPC64) && !defined(TARGET_ABI32)
diff --git a/target-ppc/cpu.h b/target-ppc/cpu.h
index 6f76674..2bb3934 100644
--- a/target-ppc/cpu.h
+++ b/target-ppc/cpu.h
@@ -81,9 +81,9 @@
 #include "fpu/softfloat.h"
 
 #if defined (TARGET_PPC64)
-#define ELF_MACHINE     EM_PPC64
+#define PPC_ELF_MACHINE     EM_PPC64
 #else
-#define ELF_MACHINE     EM_PPC
+#define PPC_ELF_MACHINE     EM_PPC
 #endif
 
 /*****************************************************************************/
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [PATCH 09/19] lm32: Remove ELF_MACHINE from cpu.h
       [not found] ` <9f0ea9969cdc869442178780fa35d6ac700bcd79.1439679104.git.crosthwaite.peter@gmail.com>
@ 2015-08-16 22:47   ` Michael Walle
  0 siblings, 0 replies; 40+ messages in thread
From: Michael Walle @ 2015-08-16 22:47 UTC (permalink / raw)
  To: Peter Crosthwaite; +Cc: pbonzini, riku.voipio, qemu-devel, Peter Crosthwaite

Am 2015-08-16 01:28, schrieb Peter Crosthwaite:
> From: Peter Crosthwaite <crosthwaitepeter@gmail.com>
> 
> The bootloaders can just pass EM_LATTICEMICO32 directly, as that is
> architecture specific code.
> 
> This removes another architecture specific definition from the global
> namespace.
> 
> Cc: Michael Walle <michael@walle.cc>
> Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>

Acked-By: Michael Walle <michael@walle.cc>

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [PATCH 05/19] m68k: Remove ELF_MACHINE from cpu.h
  2015-08-15 23:28 ` [Qemu-devel] [PATCH 05/19] m68k: " Peter Crosthwaite
@ 2015-08-17  0:15   ` Greg Ungerer
  2015-08-18 22:47   ` Laurent Vivier
  1 sibling, 0 replies; 40+ messages in thread
From: Greg Ungerer @ 2015-08-17  0:15 UTC (permalink / raw)
  To: Peter Crosthwaite, qemu-devel
  Cc: pbonzini, riku.voipio, Laurent Vivier, Peter Crosthwaite

On 16/08/15 09:28, Peter Crosthwaite wrote:
> From: Peter Crosthwaite <crosthwaitepeter@gmail.com>
> 
> The only generic code relying on this is linux-user, but linux users'
> default behaviour of defaulting ELF_MACHINE to ELF_ARCH will handle
> this.
> 
> The machine model bootloaders can just pass EM_68K directly, as that
> is architecture specific code.
> 
> This removes another architecture specific definition from the global
> namespace.
> 
> Cc: Laurent Vivier <laurent@vivier.eu>
> Cc: Greg Ungerer <gerg@uclinux.org>

Reviewed-by: Greg Ungerer <gerg@uclinux.org>


> Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
> ---
>  hw/m68k/an5206.c     | 2 +-
>  hw/m68k/dummy_m68k.c | 2 +-
>  hw/m68k/mcf5208.c    | 2 +-
>  target-m68k/cpu.h    | 2 --
>  4 files changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/hw/m68k/an5206.c b/hw/m68k/an5206.c
> index f63ab2b..59e89fe 100644
> --- a/hw/m68k/an5206.c
> +++ b/hw/m68k/an5206.c
> @@ -70,7 +70,7 @@ static void an5206_init(MachineState *machine)
>      }
>  
>      kernel_size = load_elf(kernel_filename, NULL, NULL, &elf_entry,
> -                           NULL, NULL, 1, ELF_MACHINE, 0);
> +                           NULL, NULL, 1, EM_68K, 0);
>      entry = elf_entry;
>      if (kernel_size < 0) {
>          kernel_size = load_uimage(kernel_filename, &entry, NULL, NULL,
> diff --git a/hw/m68k/dummy_m68k.c b/hw/m68k/dummy_m68k.c
> index 5b77d93..3463913 100644
> --- a/hw/m68k/dummy_m68k.c
> +++ b/hw/m68k/dummy_m68k.c
> @@ -49,7 +49,7 @@ static void dummy_m68k_init(MachineState *machine)
>      /* Load kernel.  */
>      if (kernel_filename) {
>          kernel_size = load_elf(kernel_filename, NULL, NULL, &elf_entry,
> -                               NULL, NULL, 1, ELF_MACHINE, 0);
> +                               NULL, NULL, 1, EM_68K, 0);
>          entry = elf_entry;
>          if (kernel_size < 0) {
>              kernel_size = load_uimage(kernel_filename, &entry, NULL, NULL,
> diff --git a/hw/m68k/mcf5208.c b/hw/m68k/mcf5208.c
> index 326a42d..cb57cf9 100644
> --- a/hw/m68k/mcf5208.c
> +++ b/hw/m68k/mcf5208.c
> @@ -275,7 +275,7 @@ static void mcf5208evb_init(MachineState *machine)
>      }
>  
>      kernel_size = load_elf(kernel_filename, NULL, NULL, &elf_entry,
> -                           NULL, NULL, 1, ELF_MACHINE, 0);
> +                           NULL, NULL, 1, EM_68K, 0);
>      entry = elf_entry;
>      if (kernel_size < 0) {
>          kernel_size = load_uimage(kernel_filename, &entry, NULL, NULL,
> diff --git a/target-m68k/cpu.h b/target-m68k/cpu.h
> index 9a62f6c..ebbbeef 100644
> --- a/target-m68k/cpu.h
> +++ b/target-m68k/cpu.h
> @@ -32,8 +32,6 @@
>  
>  #define MAX_QREGS 32
>  
> -#define ELF_MACHINE	EM_68K
> -
>  #define EXCP_ACCESS         2   /* Access (MMU) error.  */
>  #define EXCP_ADDRESS        3   /* Address error.  */
>  #define EXCP_ILLEGAL        4   /* Illegal instruction.  */
> 

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [PATCH 07/19] moxie: Remove ELF_MACHINE from cpu.h
  2015-08-15 23:28 ` [Qemu-devel] [PATCH 07/19] moxie: " Peter Crosthwaite
@ 2015-08-17 18:39   ` Richard Henderson
  2015-08-18  3:36     ` Peter Crosthwaite
  0 siblings, 1 reply; 40+ messages in thread
From: Richard Henderson @ 2015-08-17 18:39 UTC (permalink / raw)
  To: Peter Crosthwaite, qemu-devel
  Cc: pbonzini, Anthony Green, riku.voipio, Peter Crosthwaite

On 08/15/2015 04:28 PM, Peter Crosthwaite wrote:
> -                           ELF_MACHINE, 0);
> +                           0xFEED /* EM_MOXIE */, 0);

Please add EM_MOXIE to include/elf.h.


r~

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [PATCH 00/19] multi-arch+linux-user: Cleanup ELF_MACHINE
  2015-08-15 23:28 [Qemu-devel] [PATCH 00/19] multi-arch+linux-user: Cleanup ELF_MACHINE Peter Crosthwaite
                   ` (18 preceding siblings ...)
       [not found] ` <9f0ea9969cdc869442178780fa35d6ac700bcd79.1439679104.git.crosthwaite.peter@gmail.com>
@ 2015-08-17 18:44 ` Richard Henderson
  2015-08-20  7:50 ` Riku Voipio
  2015-09-07  9:54 ` Paolo Bonzini
  21 siblings, 0 replies; 40+ messages in thread
From: Richard Henderson @ 2015-08-17 18:44 UTC (permalink / raw)
  To: Peter Crosthwaite, qemu-devel; +Cc: pbonzini, riku.voipio, Peter Crosthwaite

On 08/15/2015 04:28 PM, Peter Crosthwaite wrote:
> Peter Crosthwaite (19):
>   linux_user: elfload: Default ELF_MACHINE to ELF_ARCH
>   linux-user: elfload: Provide default for elf_check_arch
>   arm: Remove ELF_MACHINE from cpu.h
>   mb: Remove ELF_MACHINE from cpu.h
>   m68k: Remove ELF_MACHINE from cpu.h
>   cris: Remove ELF_MACHINE from cpu.h
>   moxie: Remove ELF_MACHINE from cpu.h
>   unicore: Remove ELF_MACHINE from cpu.h
>   lm32: Remove ELF_MACHINE from cpu.h
>   or32: Remove ELF_MACHINE from cpu.h
>   tricore: Remove ELF_MACHINE from cpu.h
>   xtensa: Remove ELF_MACHINE from cpu.h
>   sh4: Remove ELF_MACHINE from cpu.h
>   s390: Remove ELF_MACHINE from cpu.h
>   sparc: Remove ELF_MACHINE from cpu.h
>   mips: Remove ELF_MACHINE from cpu.h
>   alpha: Remove ELF_MACHINE from cpu.h
>   i386: Rename ELF_MACHINE to be x86 specific
>   ppc: Rename ELF_MACHINE to be PPC specific

Modulo the one nit for moxie,

Reviewed-by: Richard Henderson <rth@twiddle.net>


r~

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [PATCH 18/19] i386: Rename ELF_MACHINE to be x86 specific
  2015-08-15 23:28 ` [Qemu-devel] [PATCH 18/19] i386: Rename ELF_MACHINE to be x86 specific Peter Crosthwaite
@ 2015-08-17 19:13   ` Eduardo Habkost
  0 siblings, 0 replies; 40+ messages in thread
From: Eduardo Habkost @ 2015-08-17 19:13 UTC (permalink / raw)
  To: Peter Crosthwaite
  Cc: pbonzini, Richard Henderson, riku.voipio, qemu-devel, Peter Crosthwaite

On Sat, Aug 15, 2015 at 04:28:28PM -0700, Peter Crosthwaite wrote:
> From: Peter Crosthwaite <crosthwaitepeter@gmail.com>
> 
> Rename ELF_MACHINE to be I386 specific. This is used as-is by the
> multiboot loader.
> 
> Linux-user previously used this definition but will not anymore,
> falling back to the default bahaviour of using ELF_ARCH as ELF_MACHINE.
> 
> This removes another architecture specific definition from the global
> namespace.
> 
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Richard Henderson <rth@twiddle.net>
> Cc: Eduardo Habkost <ehabkost@redhat.com>
> Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>

Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>

If somebody is going to pull the whole series through another tree:

Acked-by: Eduardo Habkost <ehabkost@redhat.com>

(It looks like I can't apply this to the x86 tree without patches 1/19
and 2/19)

-- 
Eduardo

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [PATCH 13/19] sh4: Remove ELF_MACHINE from cpu.h
  2015-08-15 23:28 ` [Qemu-devel] [PATCH 13/19] sh4: " Peter Crosthwaite
@ 2015-08-17 20:40   ` Aurelien Jarno
  0 siblings, 0 replies; 40+ messages in thread
From: Aurelien Jarno @ 2015-08-17 20:40 UTC (permalink / raw)
  To: Peter Crosthwaite; +Cc: pbonzini, riku.voipio, qemu-devel, Peter Crosthwaite

On 2015-08-15 16:28, Peter Crosthwaite wrote:
> From: Peter Crosthwaite <crosthwaitepeter@gmail.com>
> 
> The only generic code relying on this is linux-user, but linux users'
> default behaviour of defaulting ELF_MACHINE to ELF_ARCH will handle
> this.
> 
> This removes another architecture specific definition from the global
> namespace.
> 
> Cc: Aurelien Jarno <aurelien@aurel32.net>
> Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
> ---
>  target-sh4/cpu.h | 2 --
>  1 file changed, 2 deletions(-)

Acked-by: Aurelien Jarno <aurelien@aurel32.net>


-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
aurelien@aurel32.net                 http://www.aurel32.net

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [PATCH 16/19] mips: Remove ELF_MACHINE from cpu.h
  2015-08-15 23:28 ` [Qemu-devel] [PATCH 16/19] mips: " Peter Crosthwaite
@ 2015-08-17 20:40   ` Aurelien Jarno
  0 siblings, 0 replies; 40+ messages in thread
From: Aurelien Jarno @ 2015-08-17 20:40 UTC (permalink / raw)
  To: Peter Crosthwaite
  Cc: pbonzini, riku.voipio, Leon Alrae, qemu-devel, Peter Crosthwaite

On 2015-08-15 16:28, Peter Crosthwaite wrote:
> From: Peter Crosthwaite <crosthwaitepeter@gmail.com>
> 
> The only generic code relying on this is linux-user, but linux users'
> default behaviour of defaulting ELF_MACHINE to ELF_ARCH will handle
> this.
> 
> The bootloaders can just pass EM_MIPS directly, as that is
> architecture specific code.
> 
> This removes another architecture specific definition from the global
> namespace.
> 
> Cc: Aurelien Jarno <aurelien@aurel32.net>
> Cc: Leon Alrae <leon.alrae@imgtec.com>
> Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
> ---
>  hw/mips/mips_fulong2e.c | 2 +-
>  hw/mips/mips_malta.c    | 2 +-
>  hw/mips/mips_mipssim.c  | 2 +-
>  hw/mips/mips_r4k.c      | 2 +-
>  target-mips/cpu.h       | 2 --
>  5 files changed, 4 insertions(+), 6 deletions(-)

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
aurelien@aurel32.net                 http://www.aurel32.net

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [PATCH 07/19] moxie: Remove ELF_MACHINE from cpu.h
  2015-08-17 18:39   ` Richard Henderson
@ 2015-08-18  3:36     ` Peter Crosthwaite
  2015-08-18  3:48       ` Richard Henderson
  0 siblings, 1 reply; 40+ messages in thread
From: Peter Crosthwaite @ 2015-08-18  3:36 UTC (permalink / raw)
  To: Richard Henderson
  Cc: Paolo Bonzini, Anthony Green, Riku Voipio,
	qemu-devel@nongnu.org Developers, Peter Crosthwaite

On Mon, Aug 17, 2015 at 11:39 AM, Richard Henderson <rth@twiddle.net> wrote:
> On 08/15/2015 04:28 PM, Peter Crosthwaite wrote:
>> -                           ELF_MACHINE, 0);
>> +                           0xFEED /* EM_MOXIE */, 0);
>
> Please add EM_MOXIE to include/elf.h.
>

So according to this blog, Moxie actually now has a legit EM:

http://moxielogic.org/blog/ (2nd post from top)
http://www.sco.com/developers/gabi/latest/ch4.eheader.html

Should this 0xFEED be handled the same way as we do for MICROBLAZE_OLD?

#define EM_MICROBLAZE      189
#define EM_MICROBLAZE_OLD  0xBAAB

Regards,
Peter

>
> r~

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [PATCH 07/19] moxie: Remove ELF_MACHINE from cpu.h
  2015-08-18  3:36     ` Peter Crosthwaite
@ 2015-08-18  3:48       ` Richard Henderson
  2015-08-23  6:49         ` Peter Crosthwaite
  2015-08-29 19:41         ` Peter Crosthwaite
  0 siblings, 2 replies; 40+ messages in thread
From: Richard Henderson @ 2015-08-18  3:48 UTC (permalink / raw)
  To: Peter Crosthwaite
  Cc: Paolo Bonzini, Anthony Green, Riku Voipio,
	qemu-devel@nongnu.org Developers, Peter Crosthwaite

On 08/17/2015 08:36 PM, Peter Crosthwaite wrote:
> On Mon, Aug 17, 2015 at 11:39 AM, Richard Henderson <rth@twiddle.net> wrote:
>> On 08/15/2015 04:28 PM, Peter Crosthwaite wrote:
>>> -                           ELF_MACHINE, 0);
>>> +                           0xFEED /* EM_MOXIE */, 0);
>>
>> Please add EM_MOXIE to include/elf.h.
>>
>
> So according to this blog, Moxie actually now has a legit EM:
>
> http://moxielogic.org/blog/ (2nd post from top)
> http://www.sco.com/developers/gabi/latest/ch4.eheader.html
>
> Should this 0xFEED be handled the same way as we do for MICROBLAZE_OLD?
>
> #define EM_MICROBLAZE      189
> #define EM_MICROBLAZE_OLD  0xBAAB

Yes.  It seems to have been updated in binutils on 2015-01-09.


r~

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [PATCH 11/19] tricore: Remove ELF_MACHINE from cpu.h
  2015-08-15 23:28 ` [Qemu-devel] [PATCH 11/19] tricore: " Peter Crosthwaite
@ 2015-08-18 18:01   ` Bastian Koppelmann
  0 siblings, 0 replies; 40+ messages in thread
From: Bastian Koppelmann @ 2015-08-18 18:01 UTC (permalink / raw)
  To: Peter Crosthwaite, qemu-devel; +Cc: pbonzini, riku.voipio, Peter Crosthwaite

Am 15.08.2015 um 16:28 schrieb Peter Crosthwaite:
> From: Peter Crosthwaite <crosthwaitepeter@gmail.com>
>
> The bootloader can just pass EM_TRICORE directly, as that
> is architecture specific code.
>
> This removes another architecture specific definition from the global
> namespace.
>
> Cc: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
> Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
> ---
>
Acked-By: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [PATCH 05/19] m68k: Remove ELF_MACHINE from cpu.h
  2015-08-15 23:28 ` [Qemu-devel] [PATCH 05/19] m68k: " Peter Crosthwaite
  2015-08-17  0:15   ` Greg Ungerer
@ 2015-08-18 22:47   ` Laurent Vivier
  1 sibling, 0 replies; 40+ messages in thread
From: Laurent Vivier @ 2015-08-18 22:47 UTC (permalink / raw)
  To: Peter Crosthwaite, qemu-devel
  Cc: pbonzini, riku.voipio, Greg Ungerer, Peter Crosthwaite



On 15/08/2015 16:28, Peter Crosthwaite wrote:
> From: Peter Crosthwaite <crosthwaitepeter@gmail.com>
> 
> The only generic code relying on this is linux-user, but linux users'
> default behaviour of defaulting ELF_MACHINE to ELF_ARCH will handle
> this.
> 
> The machine model bootloaders can just pass EM_68K directly, as that
> is architecture specific code.
> 
> This removes another architecture specific definition from the global
> namespace.
> 
> Cc: Laurent Vivier <laurent@vivier.eu>
> Cc: Greg Ungerer <gerg@uclinux.org>
> Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
> ---
>  hw/m68k/an5206.c     | 2 +-
>  hw/m68k/dummy_m68k.c | 2 +-
>  hw/m68k/mcf5208.c    | 2 +-
>  target-m68k/cpu.h    | 2 --
>  4 files changed, 3 insertions(+), 5 deletions(-)

Reviewed-by: Laurent Vivier <laurent@vivier.eu>

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [Qemu-ppc] [PATCH 19/19] ppc: Rename ELF_MACHINE to be PPC specific
  2015-08-15 23:28 ` [Qemu-devel] [PATCH 19/19] ppc: Rename ELF_MACHINE to be PPC specific Peter Crosthwaite
@ 2015-08-19  1:04   ` Laurent Vivier
  2015-09-07  5:04     ` Peter Crosthwaite
  0 siblings, 1 reply; 40+ messages in thread
From: Laurent Vivier @ 2015-08-19  1:04 UTC (permalink / raw)
  To: Peter Crosthwaite, qemu-devel
  Cc: pbonzini, riku.voipio, qemu-ppc, Peter Crosthwaite

I'm wondering if the existing behavior is good:

what I have understood is we define ppc32 guests in ppc64 target to be
able to run 32bit guest with 64bit qemu, but I don't think it means an
oldworld mac is able to run a ppc64 kernel.

So I think we could use directly EM_PPC with e500, ppc440, virtex_ml507,
prep and oldworld, and EM_PPC64 with pseries/spapr. Newworld mac should
be able to run EM_PPC and EM_PPC64 kernel (G3/G4 <-> G5), according to
the machine type and not to the target.

Laurent

On 15/08/2015 16:28, Peter Crosthwaite wrote:
> From: Peter Crosthwaite <crosthwaitepeter@gmail.com>
> 
> Rename ELF_MACHINE to be PPC specific. This is used as-is by the
> various PPC bootloaders and is locally defined to ELF_MACHINE in linux
> user in PPC specific ifdeffery.
> 
> This removes another architecture specific definition from the global
> namespace (as desired by multi-arch).
> 
> Cc: Alexander Graf <agraf@suse.de>
> Cc: qemu-ppc@nongnu.org
> Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
> ---
>  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/prep.c          | 2 +-
>  hw/ppc/spapr.c         | 4 ++--
>  hw/ppc/virtex_ml507.c  | 2 +-
>  linux-user/elfload.c   | 1 +
>  target-ppc/cpu.h       | 4 ++--
>  9 files changed, 13 insertions(+), 12 deletions(-)
> 
> diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
> index d300846..8b45bf6 100644
> --- a/hw/ppc/e500.c
> +++ b/hw/ppc/e500.c
> @@ -1017,7 +1017,7 @@ void ppce500_init(MachineState *machine, PPCE500Params *params)
>      filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
>  
>      bios_size = load_elf(filename, NULL, NULL, &bios_entry, &loadaddr, NULL,
> -                         1, ELF_MACHINE, 0);
> +                         1, PPC_ELF_MACHINE, 0);
>      if (bios_size < 0) {
>          /*
>           * Hrm. No ELF image? Try a uImage, maybe someone is giving us an
> diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c
> index 77d5c81..81d744c 100644
> --- a/hw/ppc/mac_newworld.c
> +++ b/hw/ppc/mac_newworld.c
> @@ -219,7 +219,7 @@ static void ppc_core99_init(MachineState *machine)
>      /* Load OpenBIOS (ELF) */
>      if (filename) {
>          bios_size = load_elf(filename, NULL, NULL, NULL,
> -                             NULL, NULL, 1, ELF_MACHINE, 0);
> +                             NULL, NULL, 1, PPC_ELF_MACHINE, 0);
>  
>          g_free(filename);
>      } else {
> @@ -242,7 +242,7 @@ static void ppc_core99_init(MachineState *machine)
>          kernel_base = KERNEL_LOAD_ADDR;
>  
>          kernel_size = load_elf(kernel_filename, translate_kernel_address, NULL,
> -                               NULL, &lowaddr, NULL, 1, ELF_MACHINE, 0);
> +                               NULL, &lowaddr, NULL, 1, PPC_ELF_MACHINE, 0);
>          if (kernel_size < 0)
>              kernel_size = load_aout(kernel_filename, kernel_base,
>                                      ram_size - kernel_base, bswap_needed,
> diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c
> index 06fdbaf..00cb080 100644
> --- a/hw/ppc/mac_oldworld.c
> +++ b/hw/ppc/mac_oldworld.c
> @@ -147,7 +147,7 @@ static void ppc_heathrow_init(MachineState *machine)
>      /* Load OpenBIOS (ELF) */
>      if (filename) {
>          bios_size = load_elf(filename, 0, NULL, NULL, NULL, NULL,
> -                             1, ELF_MACHINE, 0);
> +                             1, PPC_ELF_MACHINE, 0);
>          g_free(filename);
>      } else {
>          bios_size = -1;
> @@ -168,7 +168,7 @@ static void ppc_heathrow_init(MachineState *machine)
>  #endif
>          kernel_base = KERNEL_LOAD_ADDR;
>          kernel_size = load_elf(kernel_filename, translate_kernel_address, NULL,
> -                               NULL, &lowaddr, NULL, 1, ELF_MACHINE, 0);
> +                               NULL, &lowaddr, NULL, 1, PPC_ELF_MACHINE, 0);
>          if (kernel_size < 0)
>              kernel_size = load_aout(kernel_filename, kernel_base,
>                                      ram_size - kernel_base, bswap_needed,
> diff --git a/hw/ppc/ppc440_bamboo.c b/hw/ppc/ppc440_bamboo.c
> index 032fa80..c54f79d 100644
> --- a/hw/ppc/ppc440_bamboo.c
> +++ b/hw/ppc/ppc440_bamboo.c
> @@ -256,7 +256,7 @@ static void bamboo_init(MachineState *machine)
>                                NULL, NULL);
>          if (success < 0) {
>              success = load_elf(kernel_filename, NULL, NULL, &elf_entry,
> -                               &elf_lowaddr, NULL, 1, ELF_MACHINE, 0);
> +                               &elf_lowaddr, NULL, 1, PPC_ELF_MACHINE, 0);
>              entry = elf_entry;
>              loadaddr = elf_lowaddr;
>          }
> diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c
> index 45b5f62..b421bff 100644
> --- a/hw/ppc/prep.c
> +++ b/hw/ppc/prep.c
> @@ -610,7 +610,7 @@ static void ppc_prep_init(MachineState *machine)
>          bios_name = BIOS_FILENAME;
>      }
>      qdev_prop_set_string(dev, "bios-name", bios_name);
> -    qdev_prop_set_uint32(dev, "elf-machine", ELF_MACHINE);
> +    qdev_prop_set_uint32(dev, "elf-machine", PPC_ELF_MACHINE);
>      pcihost = PCI_HOST_BRIDGE(dev);
>      object_property_add_child(qdev_get_machine(), "raven", OBJECT(dev), NULL);
>      qdev_init_nofail(dev);
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index bf0c64f..4500497 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -1636,11 +1636,11 @@ static void ppc_spapr_init(MachineState *machine)
>          uint64_t lowaddr = 0;
>  
>          kernel_size = load_elf(kernel_filename, translate_kernel_address, NULL,
> -                               NULL, &lowaddr, NULL, 1, ELF_MACHINE, 0);
> +                               NULL, &lowaddr, NULL, 1, PPC_ELF_MACHINE, 0);
>          if (kernel_size == ELF_LOAD_WRONG_ENDIAN) {
>              kernel_size = load_elf(kernel_filename,
>                                     translate_kernel_address, NULL,
> -                                   NULL, &lowaddr, NULL, 0, ELF_MACHINE, 0);
> +                                   NULL, &lowaddr, NULL, 0, PPC_ELF_MACHINE, 0);
>              kernel_le = kernel_size > 0;
>          }
>          if (kernel_size < 0) {
> diff --git a/hw/ppc/virtex_ml507.c b/hw/ppc/virtex_ml507.c
> index de86f7c..d3cf437 100644
> --- a/hw/ppc/virtex_ml507.c
> +++ b/hw/ppc/virtex_ml507.c
> @@ -257,7 +257,7 @@ static void virtex_init(MachineState *machine)
>  
>          /* Boots a kernel elf binary.  */
>          kernel_size = load_elf(kernel_filename, NULL, NULL,
> -                               &entry, &low, &high, 1, ELF_MACHINE, 0);
> +                               &entry, &low, &high, 1, PPC_ELF_MACHINE, 0);
>          boot_info.bootstrap_pc = entry & 0x00ffffff;
>  
>          if (kernel_size < 0) {
> diff --git a/linux-user/elfload.c b/linux-user/elfload.c
> index 09e1e6a..4ade8e9 100644
> --- a/linux-user/elfload.c
> +++ b/linux-user/elfload.c
> @@ -678,6 +678,7 @@ static inline void init_thread(struct target_pt_regs *regs,
>  
>  #ifdef TARGET_PPC
>  
> +#define ELF_MACHINE    PPC_ELF_MACHINE
>  #define ELF_START_MMAP 0x80000000
>  
>  #if defined(TARGET_PPC64) && !defined(TARGET_ABI32)
> diff --git a/target-ppc/cpu.h b/target-ppc/cpu.h
> index 6f76674..2bb3934 100644
> --- a/target-ppc/cpu.h
> +++ b/target-ppc/cpu.h
> @@ -81,9 +81,9 @@
>  #include "fpu/softfloat.h"
>  
>  #if defined (TARGET_PPC64)
> -#define ELF_MACHINE     EM_PPC64
> +#define PPC_ELF_MACHINE     EM_PPC64
>  #else
> -#define ELF_MACHINE     EM_PPC
> +#define PPC_ELF_MACHINE     EM_PPC
>  #endif
>  
>  /*****************************************************************************/
> 

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [PATCH 00/19] multi-arch+linux-user: Cleanup ELF_MACHINE
  2015-08-15 23:28 [Qemu-devel] [PATCH 00/19] multi-arch+linux-user: Cleanup ELF_MACHINE Peter Crosthwaite
                   ` (19 preceding siblings ...)
  2015-08-17 18:44 ` [Qemu-devel] [PATCH 00/19] multi-arch+linux-user: Cleanup ELF_MACHINE Richard Henderson
@ 2015-08-20  7:50 ` Riku Voipio
  2015-08-22  7:03   ` Paolo Bonzini
  2015-09-07  9:54 ` Paolo Bonzini
  21 siblings, 1 reply; 40+ messages in thread
From: Riku Voipio @ 2015-08-20  7:50 UTC (permalink / raw)
  To: Peter Crosthwaite; +Cc: pbonzini, qemu-devel, Peter Crosthwaite

On Sat, Aug 15, 2015 at 04:28:10PM -0700, Peter Crosthwaite wrote:
> Peter Crosthwaite (19):
>   linux_user: elfload: Default ELF_MACHINE to ELF_ARCH
>   linux-user: elfload: Provide default for elf_check_arch
>   arm: Remove ELF_MACHINE from cpu.h
>   mb: Remove ELF_MACHINE from cpu.h
>   m68k: Remove ELF_MACHINE from cpu.h
>   cris: Remove ELF_MACHINE from cpu.h
>   moxie: Remove ELF_MACHINE from cpu.h
>   unicore: Remove ELF_MACHINE from cpu.h
>   lm32: Remove ELF_MACHINE from cpu.h
>   or32: Remove ELF_MACHINE from cpu.h
>   tricore: Remove ELF_MACHINE from cpu.h
>   xtensa: Remove ELF_MACHINE from cpu.h
>   sh4: Remove ELF_MACHINE from cpu.h
>   s390: Remove ELF_MACHINE from cpu.h
>   sparc: Remove ELF_MACHINE from cpu.h
>   mips: Remove ELF_MACHINE from cpu.h
>   alpha: Remove ELF_MACHINE from cpu.h
>   i386: Rename ELF_MACHINE to be x86 specific
>   ppc: Rename ELF_MACHINE to be PPC specific
> 
>  hw/arm/armv7m.c                |  2 +-
>  hw/cris/boot.c                 |  2 +-
>  hw/i386/multiboot.c            |  2 +-
>  hw/lm32/lm32_boards.c          |  4 ++--
>  hw/lm32/milkymist.c            |  2 +-
>  hw/m68k/an5206.c               |  2 +-
>  hw/m68k/dummy_m68k.c           |  2 +-
>  hw/m68k/mcf5208.c              |  2 +-
>  hw/microblaze/boot.c           |  4 ++--
>  hw/mips/mips_fulong2e.c        |  2 +-
>  hw/mips/mips_malta.c           |  2 +-
>  hw/mips/mips_mipssim.c         |  2 +-
>  hw/mips/mips_r4k.c             |  2 +-
>  hw/moxie/moxiesim.c            |  2 +-
>  hw/openrisc/openrisc_sim.c     |  2 +-
>  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/prep.c                  |  2 +-
>  hw/ppc/spapr.c                 |  4 ++--
>  hw/ppc/virtex_ml507.c          |  2 +-
>  hw/s390x/ipl.c                 |  4 ++--
>  hw/sparc/leon3.c               |  2 +-
>  hw/sparc/sun4m.c               |  4 ++--
>  hw/sparc64/sun4u.c             |  4 ++--
>  hw/tricore/tricore_testboard.c |  2 +-
>  hw/xtensa/sim.c                |  4 ++--
>  hw/xtensa/xtfpga.c             |  2 +-
>  linux-user/elfload.c           | 37 +++++++++++--------------------------
>  target-alpha/cpu.h             |  2 --
>  target-arm/cpu.h               |  2 --
>  target-cris/cpu.h              |  2 --
>  target-i386/cpu.h              |  4 ++--
>  target-lm32/cpu.h              |  2 --
>  target-m68k/cpu.h              |  2 --
>  target-microblaze/cpu.h        |  2 --
>  target-mips/cpu.h              |  2 --
>  target-moxie/cpu.h             |  2 --
>  target-openrisc/cpu.h          |  1 -
>  target-ppc/cpu.h               |  4 ++--
>  target-s390x/cpu.h             |  1 -
>  target-sh4/cpu.h               |  2 --
>  target-sparc/cpu.h             |  6 ------
>  target-tricore/cpu.h           |  2 --
>  target-unicore32/cpu.h         |  2 --
>  target-xtensa/cpu.h            |  1 -
>  47 files changed, 53 insertions(+), 99 deletions(-)

Acked-By: Riku Voipio <riku.voipio@linaro.org>

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [PATCH 00/19] multi-arch+linux-user: Cleanup ELF_MACHINE
  2015-08-20  7:50 ` Riku Voipio
@ 2015-08-22  7:03   ` Paolo Bonzini
  0 siblings, 0 replies; 40+ messages in thread
From: Paolo Bonzini @ 2015-08-22  7:03 UTC (permalink / raw)
  To: Riku Voipio, Peter Crosthwaite; +Cc: qemu-devel, Peter Crosthwaite



On 20/08/2015 00:50, Riku Voipio wrote:
> On Sat, Aug 15, 2015 at 04:28:10PM -0700, Peter Crosthwaite wrote:
>> Peter Crosthwaite (19):
>>   linux_user: elfload: Default ELF_MACHINE to ELF_ARCH
>>   linux-user: elfload: Provide default for elf_check_arch
>>   arm: Remove ELF_MACHINE from cpu.h
>>   mb: Remove ELF_MACHINE from cpu.h
>>   m68k: Remove ELF_MACHINE from cpu.h
>>   cris: Remove ELF_MACHINE from cpu.h
>>   moxie: Remove ELF_MACHINE from cpu.h
>>   unicore: Remove ELF_MACHINE from cpu.h
>>   lm32: Remove ELF_MACHINE from cpu.h
>>   or32: Remove ELF_MACHINE from cpu.h
>>   tricore: Remove ELF_MACHINE from cpu.h
>>   xtensa: Remove ELF_MACHINE from cpu.h
>>   sh4: Remove ELF_MACHINE from cpu.h
>>   s390: Remove ELF_MACHINE from cpu.h
>>   sparc: Remove ELF_MACHINE from cpu.h
>>   mips: Remove ELF_MACHINE from cpu.h
>>   alpha: Remove ELF_MACHINE from cpu.h
>>   i386: Rename ELF_MACHINE to be x86 specific
>>   ppc: Rename ELF_MACHINE to be PPC specific
>>
>>  hw/arm/armv7m.c                |  2 +-
>>  hw/cris/boot.c                 |  2 +-
>>  hw/i386/multiboot.c            |  2 +-
>>  hw/lm32/lm32_boards.c          |  4 ++--
>>  hw/lm32/milkymist.c            |  2 +-
>>  hw/m68k/an5206.c               |  2 +-
>>  hw/m68k/dummy_m68k.c           |  2 +-
>>  hw/m68k/mcf5208.c              |  2 +-
>>  hw/microblaze/boot.c           |  4 ++--
>>  hw/mips/mips_fulong2e.c        |  2 +-
>>  hw/mips/mips_malta.c           |  2 +-
>>  hw/mips/mips_mipssim.c         |  2 +-
>>  hw/mips/mips_r4k.c             |  2 +-
>>  hw/moxie/moxiesim.c            |  2 +-
>>  hw/openrisc/openrisc_sim.c     |  2 +-
>>  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/prep.c                  |  2 +-
>>  hw/ppc/spapr.c                 |  4 ++--
>>  hw/ppc/virtex_ml507.c          |  2 +-
>>  hw/s390x/ipl.c                 |  4 ++--
>>  hw/sparc/leon3.c               |  2 +-
>>  hw/sparc/sun4m.c               |  4 ++--
>>  hw/sparc64/sun4u.c             |  4 ++--
>>  hw/tricore/tricore_testboard.c |  2 +-
>>  hw/xtensa/sim.c                |  4 ++--
>>  hw/xtensa/xtfpga.c             |  2 +-
>>  linux-user/elfload.c           | 37 +++++++++++--------------------------
>>  target-alpha/cpu.h             |  2 --
>>  target-arm/cpu.h               |  2 --
>>  target-cris/cpu.h              |  2 --
>>  target-i386/cpu.h              |  4 ++--
>>  target-lm32/cpu.h              |  2 --
>>  target-m68k/cpu.h              |  2 --
>>  target-microblaze/cpu.h        |  2 --
>>  target-mips/cpu.h              |  2 --
>>  target-moxie/cpu.h             |  2 --
>>  target-openrisc/cpu.h          |  1 -
>>  target-ppc/cpu.h               |  4 ++--
>>  target-s390x/cpu.h             |  1 -
>>  target-sh4/cpu.h               |  2 --
>>  target-sparc/cpu.h             |  6 ------
>>  target-tricore/cpu.h           |  2 --
>>  target-unicore32/cpu.h         |  2 --
>>  target-xtensa/cpu.h            |  1 -
>>  47 files changed, 53 insertions(+), 99 deletions(-)
> 
> Acked-By: Riku Voipio <riku.voipio@linaro.org>
> 

Riku, can you send a pull request yourself?

Thanks,

Paolo

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [PATCH 07/19] moxie: Remove ELF_MACHINE from cpu.h
  2015-08-18  3:48       ` Richard Henderson
@ 2015-08-23  6:49         ` Peter Crosthwaite
  2015-08-23 15:43           ` Peter Maydell
  2015-08-29 19:41         ` Peter Crosthwaite
  1 sibling, 1 reply; 40+ messages in thread
From: Peter Crosthwaite @ 2015-08-23  6:49 UTC (permalink / raw)
  To: Richard Henderson
  Cc: Peter Maydell, Peter Crosthwaite, Anthony Green, Riku Voipio,
	qemu-devel@nongnu.org Developers, Paolo Bonzini

On Mon, Aug 17, 2015 at 8:48 PM, Richard Henderson <rth@twiddle.net> wrote:
> On 08/17/2015 08:36 PM, Peter Crosthwaite wrote:
>>
>> On Mon, Aug 17, 2015 at 11:39 AM, Richard Henderson <rth@twiddle.net>
>> wrote:
>>>
>>> On 08/15/2015 04:28 PM, Peter Crosthwaite wrote:
>>>>
>>>> -                           ELF_MACHINE, 0);
>>>> +                           0xFEED /* EM_MOXIE */, 0);
>>>
>>>
>>> Please add EM_MOXIE to include/elf.h.
>>>
>>
>> So according to this blog, Moxie actually now has a legit EM:
>>
>> http://moxielogic.org/blog/ (2nd post from top)
>> http://www.sco.com/developers/gabi/latest/ch4.eheader.html
>>
>> Should this 0xFEED be handled the same way as we do for MICROBLAZE_OLD?
>>
>> #define EM_MICROBLAZE      189
>> #define EM_MICROBLAZE_OLD  0xBAAB
>
>
> Yes.  It seems to have been updated in binutils on 2015-01-09.
>

So I am comparing elf.h to the binutils common.h and there seems to be
a strong correlation but with two major differences:

1: The QEMU one has a large number of arch specific defs not in
binutils common.h
2: Binutils covers the arches that are not implemented in QEMU

I have started trying to get them a little more synced to aid
maintenance. I have got to a stage where you can do a sane diff with
binutils common.h. I have synced the whitespace and migrated qemu and
arch specifics to a new header. We could however make it like Linux
and just periodically sync the headers from binutils or linux verbatim
rather than letting QEMU drift with incremental patches?

RFC

Regards,
Peter

>
> r~
>

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [PATCH 07/19] moxie: Remove ELF_MACHINE from cpu.h
  2015-08-23  6:49         ` Peter Crosthwaite
@ 2015-08-23 15:43           ` Peter Maydell
  0 siblings, 0 replies; 40+ messages in thread
From: Peter Maydell @ 2015-08-23 15:43 UTC (permalink / raw)
  To: Peter Crosthwaite
  Cc: Peter Crosthwaite, Anthony Green, Riku Voipio,
	qemu-devel@nongnu.org Developers, Paolo Bonzini,
	Richard Henderson

On 23 August 2015 at 07:49, Peter Crosthwaite
<crosthwaitepeter@gmail.com> wrote:
> just periodically sync the headers from binutils

Careful, binutils is GPLv3, which isn't compatible with QEMU's
overall GPLv2 license. It's OK to look at binutils to find the
information to write the relevant QEMU code, but copying it
wholesale isn't possible.

Having our headers not particularly look like the binutils
ones is a good way of demonstrating that we haven't just
copied a pile of GPLv3 code...

thanks
-- PMM

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [PATCH 07/19] moxie: Remove ELF_MACHINE from cpu.h
  2015-08-18  3:48       ` Richard Henderson
  2015-08-23  6:49         ` Peter Crosthwaite
@ 2015-08-29 19:41         ` Peter Crosthwaite
  1 sibling, 0 replies; 40+ messages in thread
From: Peter Crosthwaite @ 2015-08-29 19:41 UTC (permalink / raw)
  To: Richard Henderson
  Cc: Paolo Bonzini, Anthony Green, Riku Voipio,
	qemu-devel@nongnu.org Developers, Peter Crosthwaite

On Mon, Aug 17, 2015 at 8:48 PM, Richard Henderson <rth@twiddle.net> wrote:
> On 08/17/2015 08:36 PM, Peter Crosthwaite wrote:
>>
>> On Mon, Aug 17, 2015 at 11:39 AM, Richard Henderson <rth@twiddle.net>
>> wrote:
>>>
>>> On 08/15/2015 04:28 PM, Peter Crosthwaite wrote:
>>>>
>>>> -                           ELF_MACHINE, 0);
>>>> +                           0xFEED /* EM_MOXIE */, 0);
>>>
>>>
>>> Please add EM_MOXIE to include/elf.h.
>>>
>>
>> So according to this blog, Moxie actually now has a legit EM:
>>
>> http://moxielogic.org/blog/ (2nd post from top)
>> http://www.sco.com/developers/gabi/latest/ch4.eheader.html
>>
>> Should this 0xFEED be handled the same way as we do for MICROBLAZE_OLD?
>>
>> #define EM_MICROBLAZE      189
>> #define EM_MICROBLAZE_OLD  0xBAAB
>
>
> Yes.  It seems to have been updated in binutils on 2015-01-09.
>

Patches on list.

Regards,
Peter

>
> r~
>

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [Qemu-ppc] [PATCH 19/19] ppc: Rename ELF_MACHINE to be PPC specific
  2015-08-19  1:04   ` [Qemu-devel] [Qemu-ppc] " Laurent Vivier
@ 2015-09-07  5:04     ` Peter Crosthwaite
  2015-09-07  9:32       ` Alexander Graf
  0 siblings, 1 reply; 40+ messages in thread
From: Peter Crosthwaite @ 2015-09-07  5:04 UTC (permalink / raw)
  To: Laurent Vivier
  Cc: Paolo Bonzini, Riku Voipio, qemu-ppc,
	qemu-devel@nongnu.org Developers, Peter Crosthwaite

On Tue, Aug 18, 2015 at 6:04 PM, Laurent Vivier <lvivier@redhat.com> wrote:
> I'm wondering if the existing behavior is good:
>
> what I have understood is we define ppc32 guests in ppc64 target to be
> able to run 32bit guest with 64bit qemu, but I don't think it means an
> oldworld mac is able to run a ppc64 kernel.
>
> So I think we could use directly EM_PPC with e500, ppc440, virtex_ml507,

Definitely right for virtex_ml507.

> prep and oldworld, and EM_PPC64 with pseries/spapr. Newworld mac should
> be able to run EM_PPC and EM_PPC64 kernel (G3/G4 <-> G5), according to
> the machine type and not to the target.
>

Sounds good, can the PPC maintainers give a nod to this idea?
Otherwise I'd like to run with the patch as is, as the patch as-is is
non-functional which is the intent of the overall series.

Regards,
Peter

> Laurent
>
> On 15/08/2015 16:28, Peter Crosthwaite wrote:
>> From: Peter Crosthwaite <crosthwaitepeter@gmail.com>
>>
>> Rename ELF_MACHINE to be PPC specific. This is used as-is by the
>> various PPC bootloaders and is locally defined to ELF_MACHINE in linux
>> user in PPC specific ifdeffery.
>>
>> This removes another architecture specific definition from the global
>> namespace (as desired by multi-arch).
>>
>> Cc: Alexander Graf <agraf@suse.de>
>> Cc: qemu-ppc@nongnu.org
>> Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
>> ---
>>  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/prep.c          | 2 +-
>>  hw/ppc/spapr.c         | 4 ++--
>>  hw/ppc/virtex_ml507.c  | 2 +-
>>  linux-user/elfload.c   | 1 +
>>  target-ppc/cpu.h       | 4 ++--
>>  9 files changed, 13 insertions(+), 12 deletions(-)
>>
>> diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
>> index d300846..8b45bf6 100644
>> --- a/hw/ppc/e500.c
>> +++ b/hw/ppc/e500.c
>> @@ -1017,7 +1017,7 @@ void ppce500_init(MachineState *machine, PPCE500Params *params)
>>      filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
>>
>>      bios_size = load_elf(filename, NULL, NULL, &bios_entry, &loadaddr, NULL,
>> -                         1, ELF_MACHINE, 0);
>> +                         1, PPC_ELF_MACHINE, 0);
>>      if (bios_size < 0) {
>>          /*
>>           * Hrm. No ELF image? Try a uImage, maybe someone is giving us an
>> diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c
>> index 77d5c81..81d744c 100644
>> --- a/hw/ppc/mac_newworld.c
>> +++ b/hw/ppc/mac_newworld.c
>> @@ -219,7 +219,7 @@ static void ppc_core99_init(MachineState *machine)
>>      /* Load OpenBIOS (ELF) */
>>      if (filename) {
>>          bios_size = load_elf(filename, NULL, NULL, NULL,
>> -                             NULL, NULL, 1, ELF_MACHINE, 0);
>> +                             NULL, NULL, 1, PPC_ELF_MACHINE, 0);
>>
>>          g_free(filename);
>>      } else {
>> @@ -242,7 +242,7 @@ static void ppc_core99_init(MachineState *machine)
>>          kernel_base = KERNEL_LOAD_ADDR;
>>
>>          kernel_size = load_elf(kernel_filename, translate_kernel_address, NULL,
>> -                               NULL, &lowaddr, NULL, 1, ELF_MACHINE, 0);
>> +                               NULL, &lowaddr, NULL, 1, PPC_ELF_MACHINE, 0);
>>          if (kernel_size < 0)
>>              kernel_size = load_aout(kernel_filename, kernel_base,
>>                                      ram_size - kernel_base, bswap_needed,
>> diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c
>> index 06fdbaf..00cb080 100644
>> --- a/hw/ppc/mac_oldworld.c
>> +++ b/hw/ppc/mac_oldworld.c
>> @@ -147,7 +147,7 @@ static void ppc_heathrow_init(MachineState *machine)
>>      /* Load OpenBIOS (ELF) */
>>      if (filename) {
>>          bios_size = load_elf(filename, 0, NULL, NULL, NULL, NULL,
>> -                             1, ELF_MACHINE, 0);
>> +                             1, PPC_ELF_MACHINE, 0);
>>          g_free(filename);
>>      } else {
>>          bios_size = -1;
>> @@ -168,7 +168,7 @@ static void ppc_heathrow_init(MachineState *machine)
>>  #endif
>>          kernel_base = KERNEL_LOAD_ADDR;
>>          kernel_size = load_elf(kernel_filename, translate_kernel_address, NULL,
>> -                               NULL, &lowaddr, NULL, 1, ELF_MACHINE, 0);
>> +                               NULL, &lowaddr, NULL, 1, PPC_ELF_MACHINE, 0);
>>          if (kernel_size < 0)
>>              kernel_size = load_aout(kernel_filename, kernel_base,
>>                                      ram_size - kernel_base, bswap_needed,
>> diff --git a/hw/ppc/ppc440_bamboo.c b/hw/ppc/ppc440_bamboo.c
>> index 032fa80..c54f79d 100644
>> --- a/hw/ppc/ppc440_bamboo.c
>> +++ b/hw/ppc/ppc440_bamboo.c
>> @@ -256,7 +256,7 @@ static void bamboo_init(MachineState *machine)
>>                                NULL, NULL);
>>          if (success < 0) {
>>              success = load_elf(kernel_filename, NULL, NULL, &elf_entry,
>> -                               &elf_lowaddr, NULL, 1, ELF_MACHINE, 0);
>> +                               &elf_lowaddr, NULL, 1, PPC_ELF_MACHINE, 0);
>>              entry = elf_entry;
>>              loadaddr = elf_lowaddr;
>>          }
>> diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c
>> index 45b5f62..b421bff 100644
>> --- a/hw/ppc/prep.c
>> +++ b/hw/ppc/prep.c
>> @@ -610,7 +610,7 @@ static void ppc_prep_init(MachineState *machine)
>>          bios_name = BIOS_FILENAME;
>>      }
>>      qdev_prop_set_string(dev, "bios-name", bios_name);
>> -    qdev_prop_set_uint32(dev, "elf-machine", ELF_MACHINE);
>> +    qdev_prop_set_uint32(dev, "elf-machine", PPC_ELF_MACHINE);
>>      pcihost = PCI_HOST_BRIDGE(dev);
>>      object_property_add_child(qdev_get_machine(), "raven", OBJECT(dev), NULL);
>>      qdev_init_nofail(dev);
>> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
>> index bf0c64f..4500497 100644
>> --- a/hw/ppc/spapr.c
>> +++ b/hw/ppc/spapr.c
>> @@ -1636,11 +1636,11 @@ static void ppc_spapr_init(MachineState *machine)
>>          uint64_t lowaddr = 0;
>>
>>          kernel_size = load_elf(kernel_filename, translate_kernel_address, NULL,
>> -                               NULL, &lowaddr, NULL, 1, ELF_MACHINE, 0);
>> +                               NULL, &lowaddr, NULL, 1, PPC_ELF_MACHINE, 0);
>>          if (kernel_size == ELF_LOAD_WRONG_ENDIAN) {
>>              kernel_size = load_elf(kernel_filename,
>>                                     translate_kernel_address, NULL,
>> -                                   NULL, &lowaddr, NULL, 0, ELF_MACHINE, 0);
>> +                                   NULL, &lowaddr, NULL, 0, PPC_ELF_MACHINE, 0);
>>              kernel_le = kernel_size > 0;
>>          }
>>          if (kernel_size < 0) {
>> diff --git a/hw/ppc/virtex_ml507.c b/hw/ppc/virtex_ml507.c
>> index de86f7c..d3cf437 100644
>> --- a/hw/ppc/virtex_ml507.c
>> +++ b/hw/ppc/virtex_ml507.c
>> @@ -257,7 +257,7 @@ static void virtex_init(MachineState *machine)
>>
>>          /* Boots a kernel elf binary.  */
>>          kernel_size = load_elf(kernel_filename, NULL, NULL,
>> -                               &entry, &low, &high, 1, ELF_MACHINE, 0);
>> +                               &entry, &low, &high, 1, PPC_ELF_MACHINE, 0);
>>          boot_info.bootstrap_pc = entry & 0x00ffffff;
>>
>>          if (kernel_size < 0) {
>> diff --git a/linux-user/elfload.c b/linux-user/elfload.c
>> index 09e1e6a..4ade8e9 100644
>> --- a/linux-user/elfload.c
>> +++ b/linux-user/elfload.c
>> @@ -678,6 +678,7 @@ static inline void init_thread(struct target_pt_regs *regs,
>>
>>  #ifdef TARGET_PPC
>>
>> +#define ELF_MACHINE    PPC_ELF_MACHINE
>>  #define ELF_START_MMAP 0x80000000
>>
>>  #if defined(TARGET_PPC64) && !defined(TARGET_ABI32)
>> diff --git a/target-ppc/cpu.h b/target-ppc/cpu.h
>> index 6f76674..2bb3934 100644
>> --- a/target-ppc/cpu.h
>> +++ b/target-ppc/cpu.h
>> @@ -81,9 +81,9 @@
>>  #include "fpu/softfloat.h"
>>
>>  #if defined (TARGET_PPC64)
>> -#define ELF_MACHINE     EM_PPC64
>> +#define PPC_ELF_MACHINE     EM_PPC64
>>  #else
>> -#define ELF_MACHINE     EM_PPC
>> +#define PPC_ELF_MACHINE     EM_PPC
>>  #endif
>>
>>  /*****************************************************************************/
>>

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [Qemu-ppc] [PATCH 19/19] ppc: Rename ELF_MACHINE to be PPC specific
  2015-09-07  5:04     ` Peter Crosthwaite
@ 2015-09-07  9:32       ` Alexander Graf
  0 siblings, 0 replies; 40+ messages in thread
From: Alexander Graf @ 2015-09-07  9:32 UTC (permalink / raw)
  To: Peter Crosthwaite, Laurent Vivier
  Cc: Paolo Bonzini, Riku Voipio, qemu-ppc,
	qemu-devel@nongnu.org Developers, Peter Crosthwaite



On 07.09.15 07:04, Peter Crosthwaite wrote:
> On Tue, Aug 18, 2015 at 6:04 PM, Laurent Vivier <lvivier@redhat.com> wrote:
>> I'm wondering if the existing behavior is good:
>>
>> what I have understood is we define ppc32 guests in ppc64 target to be
>> able to run 32bit guest with 64bit qemu, but I don't think it means an
>> oldworld mac is able to run a ppc64 kernel.
>>
>> So I think we could use directly EM_PPC with e500, ppc440, virtex_ml507,
> 
> Definitely right for virtex_ml507.
> 
>> prep and oldworld, and EM_PPC64 with pseries/spapr. Newworld mac should
>> be able to run EM_PPC and EM_PPC64 kernel (G3/G4 <-> G5), according to
>> the machine type and not to the target.
>>
> 
> Sounds good, can the PPC maintainers give a nod to this idea?
> Otherwise I'd like to run with the patch as is, as the patch as-is is
> non-functional which is the intent of the overall series.

I think the idea is sound, but I'd prefer to see it as a follow-up patch
converting each machine individually. That way bisecting things will be
easier and if we have to revert anything, we only revert the functional
change.


Alex

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [PATCH 00/19] multi-arch+linux-user: Cleanup ELF_MACHINE
  2015-08-15 23:28 [Qemu-devel] [PATCH 00/19] multi-arch+linux-user: Cleanup ELF_MACHINE Peter Crosthwaite
                   ` (20 preceding siblings ...)
  2015-08-20  7:50 ` Riku Voipio
@ 2015-09-07  9:54 ` Paolo Bonzini
  2015-09-07 17:22   ` Peter Crosthwaite
  21 siblings, 1 reply; 40+ messages in thread
From: Paolo Bonzini @ 2015-09-07  9:54 UTC (permalink / raw)
  To: Peter Crosthwaite, qemu-devel; +Cc: riku.voipio, Peter Crosthwaite



On 16/08/2015 01:28, Peter Crosthwaite wrote:
> Every arch defines ELF_MACHINE in cpu.h to an arch-specific value. This
> definition is rarely needed by core code (only in a few cases). It
> conflicts with the multi-arch effort where cpu.h cannot export cpu
> specifics via macros like this. So remove ELF_MACHINE completely from
> all the cpu.h's.
> 
> Linux-user defines both ELF_ARCH and ELF_MACHINE, but for most cases
> they are the same. So provide a default of ELF_MACHINE == ELF_ARCH to
> handle most cases and just minimally define ELF_MACHINE locally in
> linux-user where there is a genuine difference.
> 
> While touching the code cleanup elf_check_arch in linux-user with
> a similar default-based system to minimise the boiler-plate for arch
> EM_ code.
> 
> Then go arch-by-arch to remove ELF_MACHINE from cpu.h. For many arches
> this causes the ELF_MACHINE == ELF_ARCH default to kick in. Some arches
> need their bootloader usages of ELF_MACHINE converted to use EM_FOO
> directly.
> 
> Alpha is unique, in that ELF_MACHINE is completely unused by existing
> code.
> 
> i386 and ppc are the most complex, where there is a genuine need to
> switch ELF_MACHINE depending on the target sub-arch. In these cases
> ELF_MACHINE if prefixed to be target specific. This will need further
> rethinking to get multi-arch support for those two arches.
> 
> There is an argument for keeping the per-arch definitions of the EM,
> but the correct place for this would be as virtual field in the QOM
> CPU class. Given the refactorings of the series this new field would
> be initially unused until we have the notion of a generic system mode
> bootloader or refactor linux-user boot to be more QOMified. So leaving
> the defs deleted for the moment for later revival.
> 
> Regards,
> Peter
> 
> Peter Crosthwaite (19):
>   linux_user: elfload: Default ELF_MACHINE to ELF_ARCH
>   linux-user: elfload: Provide default for elf_check_arch
>   arm: Remove ELF_MACHINE from cpu.h
>   mb: Remove ELF_MACHINE from cpu.h
>   m68k: Remove ELF_MACHINE from cpu.h
>   cris: Remove ELF_MACHINE from cpu.h
>   moxie: Remove ELF_MACHINE from cpu.h
>   unicore: Remove ELF_MACHINE from cpu.h
>   lm32: Remove ELF_MACHINE from cpu.h
>   or32: Remove ELF_MACHINE from cpu.h
>   tricore: Remove ELF_MACHINE from cpu.h
>   xtensa: Remove ELF_MACHINE from cpu.h
>   sh4: Remove ELF_MACHINE from cpu.h
>   s390: Remove ELF_MACHINE from cpu.h
>   sparc: Remove ELF_MACHINE from cpu.h
>   mips: Remove ELF_MACHINE from cpu.h
>   alpha: Remove ELF_MACHINE from cpu.h
>   i386: Rename ELF_MACHINE to be x86 specific
>   ppc: Rename ELF_MACHINE to be PPC specific
> 
>  hw/arm/armv7m.c                |  2 +-
>  hw/cris/boot.c                 |  2 +-
>  hw/i386/multiboot.c            |  2 +-
>  hw/lm32/lm32_boards.c          |  4 ++--
>  hw/lm32/milkymist.c            |  2 +-
>  hw/m68k/an5206.c               |  2 +-
>  hw/m68k/dummy_m68k.c           |  2 +-
>  hw/m68k/mcf5208.c              |  2 +-
>  hw/microblaze/boot.c           |  4 ++--
>  hw/mips/mips_fulong2e.c        |  2 +-
>  hw/mips/mips_malta.c           |  2 +-
>  hw/mips/mips_mipssim.c         |  2 +-
>  hw/mips/mips_r4k.c             |  2 +-
>  hw/moxie/moxiesim.c            |  2 +-
>  hw/openrisc/openrisc_sim.c     |  2 +-
>  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/prep.c                  |  2 +-
>  hw/ppc/spapr.c                 |  4 ++--
>  hw/ppc/virtex_ml507.c          |  2 +-
>  hw/s390x/ipl.c                 |  4 ++--
>  hw/sparc/leon3.c               |  2 +-
>  hw/sparc/sun4m.c               |  4 ++--
>  hw/sparc64/sun4u.c             |  4 ++--
>  hw/tricore/tricore_testboard.c |  2 +-
>  hw/xtensa/sim.c                |  4 ++--
>  hw/xtensa/xtfpga.c             |  2 +-
>  linux-user/elfload.c           | 37 +++++++++++--------------------------
>  target-alpha/cpu.h             |  2 --
>  target-arm/cpu.h               |  2 --
>  target-cris/cpu.h              |  2 --
>  target-i386/cpu.h              |  4 ++--
>  target-lm32/cpu.h              |  2 --
>  target-m68k/cpu.h              |  2 --
>  target-microblaze/cpu.h        |  2 --
>  target-mips/cpu.h              |  2 --
>  target-moxie/cpu.h             |  2 --
>  target-openrisc/cpu.h          |  1 -
>  target-ppc/cpu.h               |  4 ++--
>  target-s390x/cpu.h             |  1 -
>  target-sh4/cpu.h               |  2 --
>  target-sparc/cpu.h             |  6 ------
>  target-tricore/cpu.h           |  2 --
>  target-unicore32/cpu.h         |  2 --
>  target-xtensa/cpu.h            |  1 -
>  47 files changed, 53 insertions(+), 99 deletions(-)
> 

Peter, I suggest that you send a pull request yourself for this and the
Moxie change.

Paolo

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [PATCH 00/19] multi-arch+linux-user: Cleanup ELF_MACHINE
  2015-09-07  9:54 ` Paolo Bonzini
@ 2015-09-07 17:22   ` Peter Crosthwaite
  0 siblings, 0 replies; 40+ messages in thread
From: Peter Crosthwaite @ 2015-09-07 17:22 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: Riku Voipio, qemu-devel@nongnu.org Developers, Peter Crosthwaite

On Mon, Sep 7, 2015 at 2:54 AM, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
>
> On 16/08/2015 01:28, Peter Crosthwaite wrote:
>> Every arch defines ELF_MACHINE in cpu.h to an arch-specific value. This
>> definition is rarely needed by core code (only in a few cases). It
>> conflicts with the multi-arch effort where cpu.h cannot export cpu
>> specifics via macros like this. So remove ELF_MACHINE completely from
>> all the cpu.h's.
>>
>> Linux-user defines both ELF_ARCH and ELF_MACHINE, but for most cases
>> they are the same. So provide a default of ELF_MACHINE == ELF_ARCH to
>> handle most cases and just minimally define ELF_MACHINE locally in
>> linux-user where there is a genuine difference.
>>
>> While touching the code cleanup elf_check_arch in linux-user with
>> a similar default-based system to minimise the boiler-plate for arch
>> EM_ code.
>>
>> Then go arch-by-arch to remove ELF_MACHINE from cpu.h. For many arches
>> this causes the ELF_MACHINE == ELF_ARCH default to kick in. Some arches
>> need their bootloader usages of ELF_MACHINE converted to use EM_FOO
>> directly.
>>
>> Alpha is unique, in that ELF_MACHINE is completely unused by existing
>> code.
>>
>> i386 and ppc are the most complex, where there is a genuine need to
>> switch ELF_MACHINE depending on the target sub-arch. In these cases
>> ELF_MACHINE if prefixed to be target specific. This will need further
>> rethinking to get multi-arch support for those two arches.
>>
>> There is an argument for keeping the per-arch definitions of the EM,
>> but the correct place for this would be as virtual field in the QOM
>> CPU class. Given the refactorings of the series this new field would
>> be initially unused until we have the notion of a generic system mode
>> bootloader or refactor linux-user boot to be more QOMified. So leaving
>> the defs deleted for the moment for later revival.
>>
>> Regards,
>> Peter
>>
>> Peter Crosthwaite (19):
>>   linux_user: elfload: Default ELF_MACHINE to ELF_ARCH
>>   linux-user: elfload: Provide default for elf_check_arch
>>   arm: Remove ELF_MACHINE from cpu.h
>>   mb: Remove ELF_MACHINE from cpu.h
>>   m68k: Remove ELF_MACHINE from cpu.h
>>   cris: Remove ELF_MACHINE from cpu.h
>>   moxie: Remove ELF_MACHINE from cpu.h
>>   unicore: Remove ELF_MACHINE from cpu.h
>>   lm32: Remove ELF_MACHINE from cpu.h
>>   or32: Remove ELF_MACHINE from cpu.h
>>   tricore: Remove ELF_MACHINE from cpu.h
>>   xtensa: Remove ELF_MACHINE from cpu.h
>>   sh4: Remove ELF_MACHINE from cpu.h
>>   s390: Remove ELF_MACHINE from cpu.h
>>   sparc: Remove ELF_MACHINE from cpu.h
>>   mips: Remove ELF_MACHINE from cpu.h
>>   alpha: Remove ELF_MACHINE from cpu.h
>>   i386: Rename ELF_MACHINE to be x86 specific
>>   ppc: Rename ELF_MACHINE to be PPC specific
>>
>>  hw/arm/armv7m.c                |  2 +-
>>  hw/cris/boot.c                 |  2 +-
>>  hw/i386/multiboot.c            |  2 +-
>>  hw/lm32/lm32_boards.c          |  4 ++--
>>  hw/lm32/milkymist.c            |  2 +-
>>  hw/m68k/an5206.c               |  2 +-
>>  hw/m68k/dummy_m68k.c           |  2 +-
>>  hw/m68k/mcf5208.c              |  2 +-
>>  hw/microblaze/boot.c           |  4 ++--
>>  hw/mips/mips_fulong2e.c        |  2 +-
>>  hw/mips/mips_malta.c           |  2 +-
>>  hw/mips/mips_mipssim.c         |  2 +-
>>  hw/mips/mips_r4k.c             |  2 +-
>>  hw/moxie/moxiesim.c            |  2 +-
>>  hw/openrisc/openrisc_sim.c     |  2 +-
>>  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/prep.c                  |  2 +-
>>  hw/ppc/spapr.c                 |  4 ++--
>>  hw/ppc/virtex_ml507.c          |  2 +-
>>  hw/s390x/ipl.c                 |  4 ++--
>>  hw/sparc/leon3.c               |  2 +-
>>  hw/sparc/sun4m.c               |  4 ++--
>>  hw/sparc64/sun4u.c             |  4 ++--
>>  hw/tricore/tricore_testboard.c |  2 +-
>>  hw/xtensa/sim.c                |  4 ++--
>>  hw/xtensa/xtfpga.c             |  2 +-
>>  linux-user/elfload.c           | 37 +++++++++++--------------------------
>>  target-alpha/cpu.h             |  2 --
>>  target-arm/cpu.h               |  2 --
>>  target-cris/cpu.h              |  2 --
>>  target-i386/cpu.h              |  4 ++--
>>  target-lm32/cpu.h              |  2 --
>>  target-m68k/cpu.h              |  2 --
>>  target-microblaze/cpu.h        |  2 --
>>  target-mips/cpu.h              |  2 --
>>  target-moxie/cpu.h             |  2 --
>>  target-openrisc/cpu.h          |  1 -
>>  target-ppc/cpu.h               |  4 ++--
>>  target-s390x/cpu.h             |  1 -
>>  target-sh4/cpu.h               |  2 --
>>  target-sparc/cpu.h             |  6 ------
>>  target-tricore/cpu.h           |  2 --
>>  target-unicore32/cpu.h         |  2 --
>>  target-xtensa/cpu.h            |  1 -
>>  47 files changed, 53 insertions(+), 99 deletions(-)
>>
>
> Peter, I suggest that you send a pull request yourself for this and the
> Moxie change.
>

Sure, will do. I don't have PULL scriptage (as I never do them) but
will figure it.

Regards,
Peter

> Paolo

^ permalink raw reply	[flat|nested] 40+ messages in thread

end of thread, other threads:[~2015-09-07 17:22 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-15 23:28 [Qemu-devel] [PATCH 00/19] multi-arch+linux-user: Cleanup ELF_MACHINE Peter Crosthwaite
2015-08-15 23:28 ` [Qemu-devel] [PATCH 01/19] linux_user: elfload: Default ELF_MACHINE to ELF_ARCH Peter Crosthwaite
2015-08-15 23:28 ` [Qemu-devel] [PATCH 02/19] linux-user: elfload: Provide default for elf_check_arch Peter Crosthwaite
2015-08-15 23:28 ` [Qemu-devel] [PATCH 03/19] arm: Remove ELF_MACHINE from cpu.h Peter Crosthwaite
2015-08-15 23:28 ` [Qemu-devel] [PATCH 04/19] mb: " Peter Crosthwaite
2015-08-15 23:28 ` [Qemu-devel] [PATCH 05/19] m68k: " Peter Crosthwaite
2015-08-17  0:15   ` Greg Ungerer
2015-08-18 22:47   ` Laurent Vivier
2015-08-15 23:28 ` [Qemu-devel] [PATCH 06/19] cris: " Peter Crosthwaite
2015-08-15 23:28 ` [Qemu-devel] [PATCH 07/19] moxie: " Peter Crosthwaite
2015-08-17 18:39   ` Richard Henderson
2015-08-18  3:36     ` Peter Crosthwaite
2015-08-18  3:48       ` Richard Henderson
2015-08-23  6:49         ` Peter Crosthwaite
2015-08-23 15:43           ` Peter Maydell
2015-08-29 19:41         ` Peter Crosthwaite
2015-08-15 23:28 ` [Qemu-devel] [PATCH 08/19] unicore: " Peter Crosthwaite
2015-08-15 23:28 ` [Qemu-devel] [PATCH 10/19] or32: " Peter Crosthwaite
2015-08-15 23:28 ` [Qemu-devel] [PATCH 11/19] tricore: " Peter Crosthwaite
2015-08-18 18:01   ` Bastian Koppelmann
2015-08-15 23:28 ` [Qemu-devel] [PATCH 12/19] xtensa: " Peter Crosthwaite
2015-08-15 23:28 ` [Qemu-devel] [PATCH 13/19] sh4: " Peter Crosthwaite
2015-08-17 20:40   ` Aurelien Jarno
2015-08-15 23:28 ` [Qemu-devel] [PATCH 14/19] s390: " Peter Crosthwaite
2015-08-15 23:28 ` [Qemu-devel] [PATCH 15/19] sparc: " Peter Crosthwaite
2015-08-15 23:28 ` [Qemu-devel] [PATCH 16/19] mips: " Peter Crosthwaite
2015-08-17 20:40   ` Aurelien Jarno
2015-08-15 23:28 ` [Qemu-devel] [PATCH 17/19] alpha: " Peter Crosthwaite
2015-08-15 23:28 ` [Qemu-devel] [PATCH 18/19] i386: Rename ELF_MACHINE to be x86 specific Peter Crosthwaite
2015-08-17 19:13   ` Eduardo Habkost
2015-08-15 23:28 ` [Qemu-devel] [PATCH 19/19] ppc: Rename ELF_MACHINE to be PPC specific Peter Crosthwaite
2015-08-19  1:04   ` [Qemu-devel] [Qemu-ppc] " Laurent Vivier
2015-09-07  5:04     ` Peter Crosthwaite
2015-09-07  9:32       ` Alexander Graf
     [not found] ` <9f0ea9969cdc869442178780fa35d6ac700bcd79.1439679104.git.crosthwaite.peter@gmail.com>
2015-08-16 22:47   ` [Qemu-devel] [PATCH 09/19] lm32: Remove ELF_MACHINE from cpu.h Michael Walle
2015-08-17 18:44 ` [Qemu-devel] [PATCH 00/19] multi-arch+linux-user: Cleanup ELF_MACHINE Richard Henderson
2015-08-20  7:50 ` Riku Voipio
2015-08-22  7:03   ` Paolo Bonzini
2015-09-07  9:54 ` Paolo Bonzini
2015-09-07 17:22   ` Peter Crosthwaite

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.