[PATCH v3 0/9] bulk: Replace CONFIG_SOFTMMU by !CONFIG_USER_ONLY/CONFIG_SYSTEM_ONLY

Philippe Mathieu-Daudé posted 9 patches 10 months, 3 weeks ago
Failed in applying to current master (apply log)
Maintainers: Thomas Huth <thuth@redhat.com>, Laurent Vivier <lvivier@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, Gerd Hoffmann <kraxel@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, Stefan Berger <stefanb@linux.vnet.ibm.com>, Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Jason Wang <jasowang@redhat.com>, Andrew Melnychenko <andrew@daynix.com>, Yuri Benditovich <yuri.benditovich@daynix.com>, Greg Kurz <groug@kaod.org>, Christian Schoenebeck <qemu_oss@crudebyte.com>, "Alex Bennée" <alex.bennee@linaro.org>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, "Michael S. Tsirkin" <mst@redhat.com>, Igor Mammedov <imammedo@redhat.com>, Ani Sinha <anisinha@redhat.com>, Alistair Francis <alistair@alistair23.me>, Peter Maydell <peter.maydell@linaro.org>, Jonathan Cameron <jonathan.cameron@huawei.com>, Fan Ni <fan.ni@samsung.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Eduardo Habkost <eduardo@habkost.net>, John Snow <jsnow@redhat.com>, Alberto Garcia <berto@igalia.com>, Corey Minyard <minyard@acm.org>, Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>, Pavel Pisa <pisa@cmp.felk.cvut.cz>, Vikram Garhwal <fnu.vikram@xilinx.com>, Keith Busch <kbusch@kernel.org>, Klaus Jensen <its@irrelevant.dk>, Yuval Shaia <yuval.shaia.ml@gmail.com>, Fam Zheng <fam@euphon.net>, Stefano Stabellini <sstabellini@kernel.org>, Anthony Perard <anthony.perard@citrix.com>, Paul Durrant <paul@xen.org>, Yanan Wang <wangyanan55@huawei.com>, Juan Quintela <quintela@redhat.com>, Peter Xu <peterx@redhat.com>, Leonardo Bras <leobras@redhat.com>, Markus Armbruster <armbru@redhat.com>, Michael Roth <michael.roth@amd.com>, Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>, Alexander Graf <agraf@csgraf.de>, Michael Rolnik <mrolnik@gmail.com>, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, Cameron Esfahani <dirty@apple.com>, Roman Bolshakov <r.bolshakov@yadro.com>, Marcelo Tosatti <mtosatti@redhat.com>, Reinoud Zandijk <reinoud@netbsd.org>, Sunil Muthuswamy <sunilmut@microsoft.com>, Song Gao <gaosong@loongson.cn>, Xiaojuan Yang <yangxiaojuan@loongson.cn>, Aurelien Jarno <aurelien@aurel32.net>, Jiaxun Yang <jiaxun.yang@flygoat.com>, Aleksandar Rikalo <aleksandar.rikalo@syrmia.com>, Huacai Chen <chenhuacai@kernel.org>, Chris Wulff <crwulff@gmail.com>, Marek Vasut <marex@denx.de>, Stafford Horne <shorne@gmail.com>, Daniel Henrique Barboza <danielhb413@gmail.com>, "Cédric Le Goater" <clg@kaod.org>, David Gibson <david@gibson.dropbear.id.au>, Palmer Dabbelt <palmer@dabbelt.com>, Bin Meng <bin.meng@windriver.com>, Weiwei Li <liweiwei@iscas.ac.cn>, Liu Zhiwei <zhiwei_liu@linux.alibaba.com>, Halil Pasic <pasic@linux.ibm.com>, Christian Borntraeger <borntraeger@linux.ibm.com>, David Hildenbrand <david@redhat.com>, Ilya Leoshkevich <iii@linux.ibm.com>, Yoshinori Sato <ysato@users.sourceforge.jp>, Artyom Tarasenko <atar4qemu@gmail.com>, Bastian Koppelmann <kbastian@mail.uni-paderborn.de>, Max Filippov <jcmvbkbc@gmail.com>, Stefan Hajnoczi <stefanha@redhat.com>
docs/devel/build-system.rst        |  14 +--
meson.build                        |  15 +--
accel/tcg/internal.h               |   6 +-
include/hw/core/cpu.h              |   4 +-
include/hw/core/tcg-cpu-ops.h      | 102 ++++++++++----------
target/m68k/helper.h               |   2 +-
accel/tcg/cpu-exec.c               |   4 +-
target/i386/tcg/translate.c        |   3 -
target/m68k/cpu.c                  |  14 ++-
target/m68k/helper.c               |   4 +-
target/m68k/translate.c            |  28 +++---
target/ppc/cpu_init.c              |  20 ++--
target/ppc/helper_regs.c           |   6 +-
target/tricore/helper.c            |   2 -
accel/meson.build                  |   4 +-
accel/qtest/meson.build            |   2 +-
accel/stubs/meson.build            |   2 +-
accel/tcg/meson.build              |   6 +-
audio/meson.build                  |   8 +-
backends/meson.build               |  20 ++--
backends/tpm/meson.build           |   8 +-
block/meson.build                  |   6 +-
block/monitor/meson.build          |   2 +-
chardev/meson.build                |   2 +-
disas/meson.build                  |   2 +-
dump/meson.build                   |   4 +-
ebpf/meson.build                   |   2 +-
fsdev/meson.build                  |   4 +-
gdbstub/meson.build                |  10 +-
hw/9pfs/meson.build                |   2 +-
hw/acpi/meson.build                |  10 +-
hw/adc/meson.build                 |  10 +-
hw/arm/meson.build                 |   8 +-
hw/audio/meson.build               |  28 +++---
hw/block/meson.build               |  28 +++---
hw/char/meson.build                |  70 +++++++-------
hw/core/meson.build                |  22 ++---
hw/cpu/meson.build                 |   6 +-
hw/cxl/meson.build                 |   4 +-
hw/display/meson.build             |  76 +++++++--------
hw/dma/meson.build                 |  32 +++----
hw/gpio/meson.build                |  26 ++---
hw/i2c/meson.build                 |   2 +-
hw/i386/kvm/meson.build            |   2 +-
hw/ide/meson.build                 |  28 +++---
hw/input/meson.build               |  32 +++----
hw/intc/meson.build                |  44 ++++-----
hw/ipack/meson.build               |   2 +-
hw/ipmi/meson.build                |   2 +-
hw/isa/meson.build                 |  18 ++--
hw/mem/meson.build                 |   8 +-
hw/misc/macio/meson.build          |   2 +-
hw/misc/meson.build                | 148 ++++++++++++++---------------
hw/net/can/meson.build             |  16 ++--
hw/net/meson.build                 |  96 +++++++++----------
hw/nubus/meson.build               |   2 +-
hw/nvme/meson.build                |   2 +-
hw/nvram/meson.build               |  26 ++---
hw/pci-bridge/meson.build          |   4 +-
hw/pci-host/meson.build            |   2 +-
hw/pci/meson.build                 |   8 +-
hw/pcmcia/meson.build              |   4 +-
hw/rdma/meson.build                |   2 +-
hw/remote/meson.build              |   2 +-
hw/rtc/meson.build                 |  28 +++---
hw/scsi/meson.build                |   2 +-
hw/sd/meson.build                  |  24 ++---
hw/sensor/meson.build              |  18 ++--
hw/smbios/meson.build              |   6 +-
hw/ssi/meson.build                 |  26 ++---
hw/timer/meson.build               |  74 +++++++--------
hw/tpm/meson.build                 |  14 +--
hw/usb/meson.build                 |  74 +++++++--------
hw/virtio/meson.build              |  12 +--
hw/watchdog/meson.build            |  18 ++--
hw/xen/meson.build                 |   4 +-
migration/meson.build              |  12 +--
monitor/meson.build                |   6 +-
net/can/meson.build                |   2 +-
net/meson.build                    |  38 ++++----
qapi/meson.build                   |   2 +-
qom/meson.build                    |   2 +-
replay/meson.build                 |   2 +-
semihosting/meson.build            |   2 +-
softmmu/meson.build                |  12 +--
stats/meson.build                  |   2 +-
target/alpha/meson.build           |   6 +-
target/arm/hvf/meson.build         |   2 +-
target/arm/meson.build             |   6 +-
target/arm/tcg/meson.build         |   2 +-
target/avr/meson.build             |   6 +-
target/cris/meson.build            |   6 +-
target/hppa/meson.build            |   6 +-
target/i386/hax/meson.build        |   6 +-
target/i386/hvf/meson.build        |   2 +-
target/i386/kvm/meson.build        |   4 +-
target/i386/meson.build            |   8 +-
target/i386/nvmm/meson.build       |   4 +-
target/i386/tcg/sysemu/meson.build |   2 +-
target/i386/whpx/meson.build       |   2 +-
target/loongarch/meson.build       |   6 +-
target/m68k/meson.build            |   6 +-
target/microblaze/meson.build      |   6 +-
target/mips/meson.build            |   4 +-
target/mips/sysemu/meson.build     |   2 +-
target/mips/tcg/sysemu/meson.build |   2 +-
target/nios2/meson.build           |   6 +-
target/openrisc/meson.build        |   6 +-
target/ppc/meson.build             |  10 +-
target/riscv/meson.build           |   6 +-
target/s390x/kvm/meson.build       |   2 +-
target/s390x/meson.build           |   6 +-
target/sh4/meson.build             |   6 +-
target/sparc/meson.build           |   6 +-
target/tricore/meson.build         |   4 +-
target/xtensa/meson.build          |   6 +-
tcg/meson.build                    |   2 +-
trace/meson.build                  |   2 +-
ui/meson.build                     |  30 +++---
119 files changed, 816 insertions(+), 824 deletions(-)
[PATCH v3 0/9] bulk: Replace CONFIG_SOFTMMU by !CONFIG_USER_ONLY/CONFIG_SYSTEM_ONLY
Posted by Philippe Mathieu-Daudé 10 months, 3 weeks ago
Missing review: 1, 7, 8

Since v2:
- Rebased
- Added R-b tags
- Rework i386_tr_init_disas_context() patch (Richard)
- Dropped RFC prefix

This series aims to clarify the CONFIG_[USER|SYSTEM] vs CONFIG_SOFTMMU
confusion [*] by using explicit definitions, removing mentions of
CONFIG_SOFTMMU in non-TCG code.

We replace CONFIG_SOFTMMU by !CONFIG_USER_ONLY in C code and
by CONFIG_SYSTEM_ONLY in meson config files.

[*] Richard clarified my confusion with CONFIG_SOFTMMU on v1:
https://lore.kernel.org/qemu-devel/7913570a-8bf6-2ac9-6869-fab87273742c@linaro.org/

Philippe Mathieu-Daudé (9):
  target/i386: Simplify i386_tr_init_disas_context()
  target/tricore: Remove pointless CONFIG_SOFTMMU guard
  target/m68k: Check for USER_ONLY definition instead of SOFTMMU one
  target/ppc: Check for USER_ONLY definition instead of SOFTMMU one
  hw/core/cpu: Check for USER_ONLY definition instead of SOFTMMU one
  accel/tcg: Check for USER_ONLY definition instead of SOFTMMU one
  meson: Alias CONFIG_SOFTMMU -> CONFIG_SYSTEM_ONLY
  meson: Replace CONFIG_SOFTMMU -> CONFIG_SYSTEM_ONLY
  meson: Replace softmmu_ss -> system_ss

 docs/devel/build-system.rst        |  14 +--
 meson.build                        |  15 +--
 accel/tcg/internal.h               |   6 +-
 include/hw/core/cpu.h              |   4 +-
 include/hw/core/tcg-cpu-ops.h      | 102 ++++++++++----------
 target/m68k/helper.h               |   2 +-
 accel/tcg/cpu-exec.c               |   4 +-
 target/i386/tcg/translate.c        |   3 -
 target/m68k/cpu.c                  |  14 ++-
 target/m68k/helper.c               |   4 +-
 target/m68k/translate.c            |  28 +++---
 target/ppc/cpu_init.c              |  20 ++--
 target/ppc/helper_regs.c           |   6 +-
 target/tricore/helper.c            |   2 -
 accel/meson.build                  |   4 +-
 accel/qtest/meson.build            |   2 +-
 accel/stubs/meson.build            |   2 +-
 accel/tcg/meson.build              |   6 +-
 audio/meson.build                  |   8 +-
 backends/meson.build               |  20 ++--
 backends/tpm/meson.build           |   8 +-
 block/meson.build                  |   6 +-
 block/monitor/meson.build          |   2 +-
 chardev/meson.build                |   2 +-
 disas/meson.build                  |   2 +-
 dump/meson.build                   |   4 +-
 ebpf/meson.build                   |   2 +-
 fsdev/meson.build                  |   4 +-
 gdbstub/meson.build                |  10 +-
 hw/9pfs/meson.build                |   2 +-
 hw/acpi/meson.build                |  10 +-
 hw/adc/meson.build                 |  10 +-
 hw/arm/meson.build                 |   8 +-
 hw/audio/meson.build               |  28 +++---
 hw/block/meson.build               |  28 +++---
 hw/char/meson.build                |  70 +++++++-------
 hw/core/meson.build                |  22 ++---
 hw/cpu/meson.build                 |   6 +-
 hw/cxl/meson.build                 |   4 +-
 hw/display/meson.build             |  76 +++++++--------
 hw/dma/meson.build                 |  32 +++----
 hw/gpio/meson.build                |  26 ++---
 hw/i2c/meson.build                 |   2 +-
 hw/i386/kvm/meson.build            |   2 +-
 hw/ide/meson.build                 |  28 +++---
 hw/input/meson.build               |  32 +++----
 hw/intc/meson.build                |  44 ++++-----
 hw/ipack/meson.build               |   2 +-
 hw/ipmi/meson.build                |   2 +-
 hw/isa/meson.build                 |  18 ++--
 hw/mem/meson.build                 |   8 +-
 hw/misc/macio/meson.build          |   2 +-
 hw/misc/meson.build                | 148 ++++++++++++++---------------
 hw/net/can/meson.build             |  16 ++--
 hw/net/meson.build                 |  96 +++++++++----------
 hw/nubus/meson.build               |   2 +-
 hw/nvme/meson.build                |   2 +-
 hw/nvram/meson.build               |  26 ++---
 hw/pci-bridge/meson.build          |   4 +-
 hw/pci-host/meson.build            |   2 +-
 hw/pci/meson.build                 |   8 +-
 hw/pcmcia/meson.build              |   4 +-
 hw/rdma/meson.build                |   2 +-
 hw/remote/meson.build              |   2 +-
 hw/rtc/meson.build                 |  28 +++---
 hw/scsi/meson.build                |   2 +-
 hw/sd/meson.build                  |  24 ++---
 hw/sensor/meson.build              |  18 ++--
 hw/smbios/meson.build              |   6 +-
 hw/ssi/meson.build                 |  26 ++---
 hw/timer/meson.build               |  74 +++++++--------
 hw/tpm/meson.build                 |  14 +--
 hw/usb/meson.build                 |  74 +++++++--------
 hw/virtio/meson.build              |  12 +--
 hw/watchdog/meson.build            |  18 ++--
 hw/xen/meson.build                 |   4 +-
 migration/meson.build              |  12 +--
 monitor/meson.build                |   6 +-
 net/can/meson.build                |   2 +-
 net/meson.build                    |  38 ++++----
 qapi/meson.build                   |   2 +-
 qom/meson.build                    |   2 +-
 replay/meson.build                 |   2 +-
 semihosting/meson.build            |   2 +-
 softmmu/meson.build                |  12 +--
 stats/meson.build                  |   2 +-
 target/alpha/meson.build           |   6 +-
 target/arm/hvf/meson.build         |   2 +-
 target/arm/meson.build             |   6 +-
 target/arm/tcg/meson.build         |   2 +-
 target/avr/meson.build             |   6 +-
 target/cris/meson.build            |   6 +-
 target/hppa/meson.build            |   6 +-
 target/i386/hax/meson.build        |   6 +-
 target/i386/hvf/meson.build        |   2 +-
 target/i386/kvm/meson.build        |   4 +-
 target/i386/meson.build            |   8 +-
 target/i386/nvmm/meson.build       |   4 +-
 target/i386/tcg/sysemu/meson.build |   2 +-
 target/i386/whpx/meson.build       |   2 +-
 target/loongarch/meson.build       |   6 +-
 target/m68k/meson.build            |   6 +-
 target/microblaze/meson.build      |   6 +-
 target/mips/meson.build            |   4 +-
 target/mips/sysemu/meson.build     |   2 +-
 target/mips/tcg/sysemu/meson.build |   2 +-
 target/nios2/meson.build           |   6 +-
 target/openrisc/meson.build        |   6 +-
 target/ppc/meson.build             |  10 +-
 target/riscv/meson.build           |   6 +-
 target/s390x/kvm/meson.build       |   2 +-
 target/s390x/meson.build           |   6 +-
 target/sh4/meson.build             |   6 +-
 target/sparc/meson.build           |   6 +-
 target/tricore/meson.build         |   4 +-
 target/xtensa/meson.build          |   6 +-
 tcg/meson.build                    |   2 +-
 trace/meson.build                  |   2 +-
 ui/meson.build                     |  30 +++---
 119 files changed, 816 insertions(+), 824 deletions(-)

-- 
2.38.1


Re: [PATCH v3 0/9] bulk: Replace CONFIG_SOFTMMU by !CONFIG_USER_ONLY/CONFIG_SYSTEM_ONLY
Posted by Nicholas Piggin 10 months, 3 weeks ago
On Tue Jun 13, 2023 at 11:33 PM AEST, Philippe Mathieu-Daudé wrote:
> Missing review: 1, 7, 8
>
> Since v2:
> - Rebased
> - Added R-b tags
> - Rework i386_tr_init_disas_context() patch (Richard)
> - Dropped RFC prefix
>
> This series aims to clarify the CONFIG_[USER|SYSTEM] vs CONFIG_SOFTMMU
> confusion [*] by using explicit definitions, removing mentions of
> CONFIG_SOFTMMU in non-TCG code.
>
> We replace CONFIG_SOFTMMU by !CONFIG_USER_ONLY in C code and
> by CONFIG_SYSTEM_ONLY in meson config files.

I like the change in general, SOFTMMU does not read well (and is
not exactly correct for system code as pointed out).

Sorry for chiming in late and if I missed it, but was there
a reason not to define a complementary CONFIG_SYSTEM so system
code does not have to test !CONFIG_USER_ONLY and invert a bunch
of the tests?

Actually I thought you would have CONFIG_SYSTEM and CONFIG_USER
options and the _ONLY variants could be derivative for convenience,
but I'm probably missing some detail.

Thanks,
Nick