From: Peter Crosthwaite <crosthwaitepeter@gmail.com>
To: qemu-devel@nongnu.org
Cc: pbonzini@redhat.com, riku.voipio@iki.fi,
Peter Crosthwaite <crosthwaite.peter@gmail.com>
Subject: [Qemu-devel] [PATCH 00/19] multi-arch+linux-user: Cleanup ELF_MACHINE
Date: Sat, 15 Aug 2015 16:28:10 -0700 [thread overview]
Message-ID: <cover.1439679104.git.crosthwaite.peter@gmail.com> (raw)
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
next reply other threads:[~2015-08-15 23:28 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-15 23:28 Peter Crosthwaite [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1439679104.git.crosthwaite.peter@gmail.com \
--to=crosthwaitepeter@gmail.com \
--cc=crosthwaite.peter@gmail.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=riku.voipio@iki.fi \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.