[PATCH for-6.2 0/8] softmmu: Clean up arch_init.c

Peter Maydell posted 8 patches 2 years, 9 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20210730105947.28215-1-peter.maydell@linaro.org
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, "Philippe Mathieu-Daudé" <f4bug@amsat.org>, Aurelien Jarno <aurelien@aurel32.net>, Eduardo Habkost <ehabkost@redhat.com>, Markus Armbruster <armbru@redhat.com>, "Hervé Poussineau" <hpoussin@reactos.org>, Kevin Wolf <kwolf@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, "Daniel P. Berrangé" <berrange@redhat.com>, Jiaxun Yang <jiaxun.yang@flygoat.com>, Bin Meng <bin.meng@windriver.com>, Greg Kurz <groug@kaod.org>, "Michael S. Tsirkin" <mst@redhat.com>, David Hildenbrand <david@redhat.com>, David Gibson <david@gibson.dropbear.id.au>, Cornelia Huck <cohuck@redhat.com>, Aleksandar Rikalo <aleksandar.rikalo@syrmia.com>, Alistair Francis <Alistair.Francis@wdc.com>, Palmer Dabbelt <palmer@dabbelt.com>, Thomas Huth <thuth@redhat.com>, Hanna Reitz <hreitz@redhat.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
meson.build                |  2 ++
include/sysemu/arch_init.h | 15 +--------
blockdev.c                 |  1 -
hw/i386/pc.c               |  1 -
hw/i386/pc_piix.c          |  1 -
hw/i386/pc_q35.c           |  1 -
hw/mips/jazz.c             |  1 -
hw/mips/malta.c            |  1 -
hw/ppc/prep.c              |  1 -
hw/riscv/sifive_e.c        |  1 -
hw/riscv/sifive_u.c        |  1 -
hw/riscv/spike.c           |  1 -
hw/riscv/virt.c            |  1 -
monitor/qmp-cmds.c         |  3 +-
softmmu/arch_init.c        | 66 --------------------------------------
softmmu/qdev-monitor.c     |  9 ++++++
softmmu/vl.c               |  6 ++--
stubs/arch_type.c          |  4 ---
target/ppc/cpu_init.c      |  1 -
target/s390x/cpu-sysemu.c  |  1 -
stubs/meson.build          |  1 -
21 files changed, 16 insertions(+), 103 deletions(-)
delete mode 100644 stubs/arch_type.c
[PATCH for-6.2 0/8] softmmu: Clean up arch_init.c
Posted by Peter Maydell 2 years, 9 months ago
This patchset does some cleanups of arch_init.c.  The bit I started
out caring about was getting rid of the TARGET_* ifdef ladder (in
patch 4 we make meson.build define QEMU_ARCH in config-target.h
instead) -- this kind of ifdef ladder is nasty because it's always
another place in the code that needs updating when we add or remove a
target.  I think this was one of the last remaining "every single
arch touches this" ones.  The rest of the patchset is stuff I noticed
when I started looking at what else arch_init.c was doing.

The graphic_width/height/depth target-specific defaults that
arch_init.c does also look like they could use cleanup.  My guess is
that we should instead have a per-machine default graphics
width/height/depth.  But that's a separate thing and more work than I
felt like doing this morning :-)

-- PMM

Peter Maydell (8):
  softmmu: Use accel_find("xen") instead of xen_available()
  monitor: Use accel_find("kvm") instead of kvm_available()
  softmmu/arch_init.c: Trim down include list
  meson.build: Define QEMU_ARCH in config-target.h
  arch_init.h: Add QEMU_ARCH_HEXAGON
  arch_init.h: Move QEMU_ARCH_VIRTIO_* to qdev-monitor.c
  arch_init.h: Don't include arch_init.h unnecessarily
  stubs: Remove unused arch_type.c stub

 meson.build                |  2 ++
 include/sysemu/arch_init.h | 15 +--------
 blockdev.c                 |  1 -
 hw/i386/pc.c               |  1 -
 hw/i386/pc_piix.c          |  1 -
 hw/i386/pc_q35.c           |  1 -
 hw/mips/jazz.c             |  1 -
 hw/mips/malta.c            |  1 -
 hw/ppc/prep.c              |  1 -
 hw/riscv/sifive_e.c        |  1 -
 hw/riscv/sifive_u.c        |  1 -
 hw/riscv/spike.c           |  1 -
 hw/riscv/virt.c            |  1 -
 monitor/qmp-cmds.c         |  3 +-
 softmmu/arch_init.c        | 66 --------------------------------------
 softmmu/qdev-monitor.c     |  9 ++++++
 softmmu/vl.c               |  6 ++--
 stubs/arch_type.c          |  4 ---
 target/ppc/cpu_init.c      |  1 -
 target/s390x/cpu-sysemu.c  |  1 -
 stubs/meson.build          |  1 -
 21 files changed, 16 insertions(+), 103 deletions(-)
 delete mode 100644 stubs/arch_type.c

-- 
2.20.1


Re: [PATCH for-6.2 0/8] softmmu: Clean up arch_init.c
Posted by Peter Maydell 2 years, 8 months ago
On Fri, 30 Jul 2021 at 11:59, Peter Maydell <peter.maydell@linaro.org> wrote:
>
> This patchset does some cleanups of arch_init.c.  The bit I started
> out caring about was getting rid of the TARGET_* ifdef ladder (in
> patch 4 we make meson.build define QEMU_ARCH in config-target.h
> instead) -- this kind of ifdef ladder is nasty because it's always
> another place in the code that needs updating when we add or remove a
> target.  I think this was one of the last remaining "every single
> arch touches this" ones.  The rest of the patchset is stuff I noticed
> when I started looking at what else arch_init.c was doing.
>
> The graphic_width/height/depth target-specific defaults that
> arch_init.c does also look like they could use cleanup.  My guess is
> that we should instead have a per-machine default graphics
> width/height/depth.  But that's a separate thing and more work than I
> felt like doing this morning :-)

I'll take this via target-arm.next unless anybody objects.

thanks
-- PMM