All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/14] user-mode: Prune build dependencies (part 1)
@ 2020-03-13 18:36 ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 76+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-03-13 18:36 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, qemu-riscv, Eduardo Habkost, Sagar Karandikar,
	David Hildenbrand, Bastian Koppelmann, Cornelia Huck,
	Laurent Vivier, Philippe Mathieu-Daudé,
	qemu-s390x, qemu-arm, qemu-ppc, Paolo Bonzini, Alistair Francis,
	David Gibson, Alex Bennée, Palmer Dabbelt,
	Richard Henderson

This is the first part of a series reducing user-mode
dependencies. By stripping out unused code, the build
and testing time is reduced (as is space used by objects).

Part 1:
- reduce user-mode object list
- remove some migration code from user-mode
- remove cpu_get_crash_info()

Philippe Mathieu-Daudé (14):
  Makefile: Only build virtiofsd if system-mode is enabled
  configure: Avoid building TCG when not needed
  tests/Makefile: Only display TCG-related tests when TCG is available
  tests/Makefile: Restrict some softmmu-only tests
  stubs/Makefile: Reduce the user-mode object list
  util/Makefile: Reduce the user-mode object list
  target/riscv/cpu: Restrict CPU migration to system-mode
  exec: Assert CPU migration is not used on user-only build
  exec: Drop redundant #ifdeffery
  arch_init: Remove unused 'qapi-commands-misc.h' include
  target: Restrict write_elfXX_note() handlers to system-mode
  target/i386: Restrict CpuClass::get_crash_info() to system-mode
  target/s390x: Restrict CpuClass::get_crash_info() to system-mode
  hw/core: Restrict CpuClass::get_crash_info() to system-mode

 configure                       |  4 +++
 Makefile                        |  4 +--
 include/hw/core/cpu.h           |  7 +++-
 target/arm/cpu.h                | 10 +++---
 target/i386/cpu.h               | 18 +++++-----
 target/ppc/cpu.h                |  2 --
 target/s390x/internal.h         |  3 +-
 arch_init.c                     |  1 -
 exec.c                          |  8 ++---
 hw/core/cpu.c                   |  2 ++
 target/i386/cpu.c               |  6 +++-
 target/ppc/translate_init.inc.c |  2 --
 target/riscv/cpu.c              |  6 ++--
 target/s390x/cpu.c              | 12 +++----
 stubs/Makefile.objs             | 52 +++++++++++++++++------------
 tests/Makefile.include          | 18 +++++-----
 util/Makefile.objs              | 59 +++++++++++++++++++++------------
 17 files changed, 125 insertions(+), 89 deletions(-)

-- 
2.21.1



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

* [PATCH 00/14] user-mode: Prune build dependencies (part 1)
@ 2020-03-13 18:36 ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 76+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-03-13 18:36 UTC (permalink / raw)
  To: qemu-devel
  Cc: David Hildenbrand, Laurent Vivier, Alistair Francis, qemu-ppc,
	Cornelia Huck, Paolo Bonzini, Alex Bennée, qemu-s390x,
	Bastian Koppelmann, Richard Henderson, David Gibson, qemu-riscv,
	Marcel Apfelbaum, Palmer Dabbelt, qemu-arm, Sagar Karandikar,
	Peter Maydell, Eduardo Habkost, Philippe Mathieu-Daudé

This is the first part of a series reducing user-mode
dependencies. By stripping out unused code, the build
and testing time is reduced (as is space used by objects).

Part 1:
- reduce user-mode object list
- remove some migration code from user-mode
- remove cpu_get_crash_info()

Philippe Mathieu-Daudé (14):
  Makefile: Only build virtiofsd if system-mode is enabled
  configure: Avoid building TCG when not needed
  tests/Makefile: Only display TCG-related tests when TCG is available
  tests/Makefile: Restrict some softmmu-only tests
  stubs/Makefile: Reduce the user-mode object list
  util/Makefile: Reduce the user-mode object list
  target/riscv/cpu: Restrict CPU migration to system-mode
  exec: Assert CPU migration is not used on user-only build
  exec: Drop redundant #ifdeffery
  arch_init: Remove unused 'qapi-commands-misc.h' include
  target: Restrict write_elfXX_note() handlers to system-mode
  target/i386: Restrict CpuClass::get_crash_info() to system-mode
  target/s390x: Restrict CpuClass::get_crash_info() to system-mode
  hw/core: Restrict CpuClass::get_crash_info() to system-mode

 configure                       |  4 +++
 Makefile                        |  4 +--
 include/hw/core/cpu.h           |  7 +++-
 target/arm/cpu.h                | 10 +++---
 target/i386/cpu.h               | 18 +++++-----
 target/ppc/cpu.h                |  2 --
 target/s390x/internal.h         |  3 +-
 arch_init.c                     |  1 -
 exec.c                          |  8 ++---
 hw/core/cpu.c                   |  2 ++
 target/i386/cpu.c               |  6 +++-
 target/ppc/translate_init.inc.c |  2 --
 target/riscv/cpu.c              |  6 ++--
 target/s390x/cpu.c              | 12 +++----
 stubs/Makefile.objs             | 52 +++++++++++++++++------------
 tests/Makefile.include          | 18 +++++-----
 util/Makefile.objs              | 59 +++++++++++++++++++++------------
 17 files changed, 125 insertions(+), 89 deletions(-)

-- 
2.21.1



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

* [PATCH 01/14] Makefile: Only build virtiofsd if system-mode is enabled
  2020-03-13 18:36 ` Philippe Mathieu-Daudé
@ 2020-03-13 18:36   ` Philippe Mathieu-Daudé
  -1 siblings, 0 replies; 76+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-03-13 18:36 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, qemu-riscv, Eduardo Habkost, Sagar Karandikar,
	David Hildenbrand, Bastian Koppelmann, Cornelia Huck,
	Laurent Vivier, Philippe Mathieu-Daudé,
	qemu-s390x, qemu-arm, qemu-ppc, Paolo Bonzini, Alistair Francis,
	David Gibson, Alex Bennée, Palmer Dabbelt,
	Richard Henderson

Do not build the virtiofsd helper when configured with
--disable-system.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 7df22fcc5d..ed77b6e50b 100644
--- a/Makefile
+++ b/Makefile
@@ -346,8 +346,8 @@ vhost-user-json-y += contrib/vhost-user-gpu/50-qemu-gpu.json
 endif
 
 ifeq ($(CONFIG_LINUX)$(CONFIG_SECCOMP)$(CONFIG_LIBCAP_NG),yyy)
-HELPERS-y += virtiofsd$(EXESUF)
-vhost-user-json-y += tools/virtiofsd/50-qemu-virtiofsd.json
+HELPERS-$(CONFIG_SOFTMMU) += virtiofsd$(EXESUF)
+vhost-user-json-$(CONFIG_SOFTMMU) += tools/virtiofsd/50-qemu-virtiofsd.json
 endif
 
 # Sphinx does not allow building manuals into the same directory as
-- 
2.21.1



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

* [PATCH 01/14] Makefile: Only build virtiofsd if system-mode is enabled
@ 2020-03-13 18:36   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 76+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-03-13 18:36 UTC (permalink / raw)
  To: qemu-devel
  Cc: David Hildenbrand, Laurent Vivier, Alistair Francis, qemu-ppc,
	Cornelia Huck, Paolo Bonzini, Alex Bennée, qemu-s390x,
	Bastian Koppelmann, Richard Henderson, David Gibson, qemu-riscv,
	Marcel Apfelbaum, Palmer Dabbelt, qemu-arm, Sagar Karandikar,
	Peter Maydell, Eduardo Habkost, Philippe Mathieu-Daudé

Do not build the virtiofsd helper when configured with
--disable-system.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 7df22fcc5d..ed77b6e50b 100644
--- a/Makefile
+++ b/Makefile
@@ -346,8 +346,8 @@ vhost-user-json-y += contrib/vhost-user-gpu/50-qemu-gpu.json
 endif
 
 ifeq ($(CONFIG_LINUX)$(CONFIG_SECCOMP)$(CONFIG_LIBCAP_NG),yyy)
-HELPERS-y += virtiofsd$(EXESUF)
-vhost-user-json-y += tools/virtiofsd/50-qemu-virtiofsd.json
+HELPERS-$(CONFIG_SOFTMMU) += virtiofsd$(EXESUF)
+vhost-user-json-$(CONFIG_SOFTMMU) += tools/virtiofsd/50-qemu-virtiofsd.json
 endif
 
 # Sphinx does not allow building manuals into the same directory as
-- 
2.21.1



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

* [PATCH 02/14] configure: Avoid building TCG when not needed
  2020-03-13 18:36 ` Philippe Mathieu-Daudé
@ 2020-03-13 18:36   ` Philippe Mathieu-Daudé
  -1 siblings, 0 replies; 76+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-03-13 18:36 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, qemu-riscv, Eduardo Habkost, Sagar Karandikar,
	David Hildenbrand, Bastian Koppelmann, Cornelia Huck,
	Laurent Vivier, Philippe Mathieu-Daudé,
	qemu-s390x, qemu-arm, qemu-ppc, Paolo Bonzini, Alistair Francis,
	David Gibson, Alex Bennée, Palmer Dabbelt,
	Richard Henderson

Avoid building TCG when building only tools:

  ./configure --enable-tools --disable-system --disable-user

This saves us from running the soft-float tests enabled since
commit 76170102508.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 configure | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/configure b/configure
index eb49bb6680..c2ffcb0431 100755
--- a/configure
+++ b/configure
@@ -1650,6 +1650,10 @@ if [ "$ARCH" = "unknown" ]; then
   linux_user="no"
 fi
 
+if [ "$bsd_user" = "no" -a "$linux_user" = "no" -a "$softmmu" = "no" ] ; then
+  tcg="no"
+fi
+
 default_target_list=""
 
 mak_wilds=""
-- 
2.21.1



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

* [PATCH 02/14] configure: Avoid building TCG when not needed
@ 2020-03-13 18:36   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 76+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-03-13 18:36 UTC (permalink / raw)
  To: qemu-devel
  Cc: David Hildenbrand, Laurent Vivier, Alistair Francis, qemu-ppc,
	Cornelia Huck, Paolo Bonzini, Alex Bennée, qemu-s390x,
	Bastian Koppelmann, Richard Henderson, David Gibson, qemu-riscv,
	Marcel Apfelbaum, Palmer Dabbelt, qemu-arm, Sagar Karandikar,
	Peter Maydell, Eduardo Habkost, Philippe Mathieu-Daudé

Avoid building TCG when building only tools:

  ./configure --enable-tools --disable-system --disable-user

This saves us from running the soft-float tests enabled since
commit 76170102508.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 configure | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/configure b/configure
index eb49bb6680..c2ffcb0431 100755
--- a/configure
+++ b/configure
@@ -1650,6 +1650,10 @@ if [ "$ARCH" = "unknown" ]; then
   linux_user="no"
 fi
 
+if [ "$bsd_user" = "no" -a "$linux_user" = "no" -a "$softmmu" = "no" ] ; then
+  tcg="no"
+fi
+
 default_target_list=""
 
 mak_wilds=""
-- 
2.21.1



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

* [PATCH 03/14] tests/Makefile: Only display TCG-related tests when TCG is available
  2020-03-13 18:36 ` Philippe Mathieu-Daudé
@ 2020-03-13 18:36   ` Philippe Mathieu-Daudé
  -1 siblings, 0 replies; 76+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-03-13 18:36 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, qemu-riscv, Eduardo Habkost, Sagar Karandikar,
	David Hildenbrand, Bastian Koppelmann, Cornelia Huck,
	Laurent Vivier, Philippe Mathieu-Daudé,
	qemu-s390x, qemu-arm, qemu-ppc, Paolo Bonzini, Alistair Francis,
	David Gibson, Alex Bennée, Palmer Dabbelt,
	Richard Henderson

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 tests/Makefile.include | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/Makefile.include b/tests/Makefile.include
index 67e8fcddda..99db5eb3e0 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -12,8 +12,10 @@ check-help:
 	@echo " $(MAKE) check-speed          Run qobject speed tests"
 	@echo " $(MAKE) check-qapi-schema    Run QAPI schema tests"
 	@echo " $(MAKE) check-block          Run block tests"
+ifeq ($(CONFIG_TCG),y)
 	@echo " $(MAKE) check-tcg            Run TCG tests"
 	@echo " $(MAKE) check-softfloat      Run FPU emulation tests"
+endif
 	@echo " $(MAKE) check-acceptance     Run all acceptance (functional) tests"
 	@echo
 	@echo " $(MAKE) check-report.tap     Generates an aggregated TAP test report"
-- 
2.21.1



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

* [PATCH 03/14] tests/Makefile: Only display TCG-related tests when TCG is available
@ 2020-03-13 18:36   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 76+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-03-13 18:36 UTC (permalink / raw)
  To: qemu-devel
  Cc: David Hildenbrand, Laurent Vivier, Alistair Francis, qemu-ppc,
	Cornelia Huck, Paolo Bonzini, Alex Bennée, qemu-s390x,
	Bastian Koppelmann, Richard Henderson, David Gibson, qemu-riscv,
	Marcel Apfelbaum, Palmer Dabbelt, qemu-arm, Sagar Karandikar,
	Peter Maydell, Eduardo Habkost, Philippe Mathieu-Daudé

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 tests/Makefile.include | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/Makefile.include b/tests/Makefile.include
index 67e8fcddda..99db5eb3e0 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -12,8 +12,10 @@ check-help:
 	@echo " $(MAKE) check-speed          Run qobject speed tests"
 	@echo " $(MAKE) check-qapi-schema    Run QAPI schema tests"
 	@echo " $(MAKE) check-block          Run block tests"
+ifeq ($(CONFIG_TCG),y)
 	@echo " $(MAKE) check-tcg            Run TCG tests"
 	@echo " $(MAKE) check-softfloat      Run FPU emulation tests"
+endif
 	@echo " $(MAKE) check-acceptance     Run all acceptance (functional) tests"
 	@echo
 	@echo " $(MAKE) check-report.tap     Generates an aggregated TAP test report"
-- 
2.21.1



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

* [PATCH 04/14] tests/Makefile: Restrict some softmmu-only tests
  2020-03-13 18:36 ` Philippe Mathieu-Daudé
@ 2020-03-13 18:36   ` Philippe Mathieu-Daudé
  -1 siblings, 0 replies; 76+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-03-13 18:36 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, qemu-riscv, Eduardo Habkost, Sagar Karandikar,
	David Hildenbrand, Bastian Koppelmann, Cornelia Huck,
	Laurent Vivier, Philippe Mathieu-Daudé,
	qemu-s390x, qemu-arm, qemu-ppc, Paolo Bonzini, Alistair Francis,
	David Gibson, Alex Bennée, Palmer Dabbelt,
	Richard Henderson

These tests fails when configured with --disable-system.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 tests/Makefile.include | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/tests/Makefile.include b/tests/Makefile.include
index 99db5eb3e0..bf11f765c3 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -64,14 +64,14 @@ check-unit-y += tests/check-qlit$(EXESUF)
 check-unit-y += tests/test-qobject-output-visitor$(EXESUF)
 check-unit-y += tests/test-clone-visitor$(EXESUF)
 check-unit-y += tests/test-qobject-input-visitor$(EXESUF)
-check-unit-y += tests/test-qmp-cmds$(EXESUF)
+check-unit-$(CONFIG_SOFTMMU) += tests/test-qmp-cmds$(EXESUF)
 check-unit-y += tests/test-string-input-visitor$(EXESUF)
 check-unit-y += tests/test-string-output-visitor$(EXESUF)
 check-unit-y += tests/test-qmp-event$(EXESUF)
 check-unit-y += tests/test-opts-visitor$(EXESUF)
 check-unit-$(CONFIG_BLOCK) += tests/test-coroutine$(EXESUF)
 check-unit-y += tests/test-visitor-serialization$(EXESUF)
-check-unit-y += tests/test-iov$(EXESUF)
+check-unit-$(CONFIG_SOFTMMU) += tests/test-iov$(EXESUF)
 check-unit-y += tests/test-bitmap$(EXESUF)
 check-unit-$(CONFIG_BLOCK) += tests/test-aio$(EXESUF)
 check-unit-$(CONFIG_BLOCK) += tests/test-aio-multithread$(EXESUF)
@@ -106,7 +106,7 @@ check-unit-y += tests/test-qht$(EXESUF)
 check-unit-y += tests/test-qht-par$(EXESUF)
 check-unit-y += tests/test-bitops$(EXESUF)
 check-unit-y += tests/test-bitcnt$(EXESUF)
-check-unit-y += tests/test-qdev-global-props$(EXESUF)
+check-unit-$(CONFIG_SOFTMMU) += tests/test-qdev-global-props$(EXESUF)
 check-unit-y += tests/check-qom-interface$(EXESUF)
 check-unit-y += tests/check-qom-proplist$(EXESUF)
 check-unit-y += tests/test-qemu-opts$(EXESUF)
@@ -124,9 +124,9 @@ check-unit-$(call land,$(CONFIG_BLOCK),$(CONFIG_GNUTLS)) += tests/test-crypto-tl
 ifneq (,$(findstring qemu-ga,$(TOOLS)))
 check-unit-$(call land,$(CONFIG_LINUX),$(CONFIG_VIRTIO_SERIAL)) += tests/test-qga$(EXESUF)
 endif
-check-unit-y += tests/test-timed-average$(EXESUF)
-check-unit-$(CONFIG_INOTIFY1) += tests/test-util-filemonitor$(EXESUF)
-check-unit-y += tests/test-util-sockets$(EXESUF)
+check-unit-$(CONFIG_SOFTMMU) += tests/test-timed-average$(EXESUF)
+check-unit-$(call land,$(CONFIG_SOFTMMU),$(CONFIG_INOTIFY1)) += tests/test-util-filemonitor$(EXESUF)
+check-unit-$(CONFIG_SOFTMMU) += tests/test-util-sockets$(EXESUF)
 check-unit-$(CONFIG_BLOCK) += tests/test-authz-simple$(EXESUF)
 check-unit-$(CONFIG_BLOCK) += tests/test-authz-list$(EXESUF)
 check-unit-$(CONFIG_BLOCK) += tests/test-authz-listfile$(EXESUF)
@@ -137,7 +137,7 @@ check-unit-$(CONFIG_BLOCK) += tests/test-io-channel-file$(EXESUF)
 check-unit-$(call land,$(CONFIG_BLOCK),$(CONFIG_GNUTLS)) += tests/test-io-channel-tls$(EXESUF)
 check-unit-$(CONFIG_BLOCK) += tests/test-io-channel-command$(EXESUF)
 check-unit-$(CONFIG_BLOCK) += tests/test-io-channel-buffer$(EXESUF)
-check-unit-y += tests/test-base64$(EXESUF)
+check-unit-$(CONFIG_SOFTMMU) += tests/test-base64$(EXESUF)
 check-unit-$(call land,$(CONFIG_BLOCK),$(if $(CONFIG_NETTLE),y,$(CONFIG_GCRYPT))) += tests/test-crypto-pbkdf$(EXESUF)
 check-unit-$(CONFIG_BLOCK) += tests/test-crypto-ivgen$(EXESUF)
 check-unit-$(CONFIG_BLOCK)  += tests/test-crypto-afsplit$(EXESUF)
@@ -145,7 +145,7 @@ check-unit-$(call land,$(CONFIG_BLOCK),$(CONFIG_QEMU_PRIVATE_XTS)) += tests/test
 check-unit-$(CONFIG_BLOCK)  += tests/test-crypto-block$(EXESUF)
 check-unit-y += tests/test-logging$(EXESUF)
 check-unit-$(call land,$(CONFIG_BLOCK),$(CONFIG_REPLICATION)) += tests/test-replication$(EXESUF)
-check-unit-y += tests/test-bufferiszero$(EXESUF)
+check-unit-$(CONFIG_SOFTMMU) += tests/test-bufferiszero$(EXESUF)
 check-unit-y += tests/test-uuid$(EXESUF)
 check-unit-y += tests/ptimer-test$(EXESUF)
 check-unit-y += tests/test-qapi-util$(EXESUF)
-- 
2.21.1



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

* [PATCH 04/14] tests/Makefile: Restrict some softmmu-only tests
@ 2020-03-13 18:36   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 76+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-03-13 18:36 UTC (permalink / raw)
  To: qemu-devel
  Cc: David Hildenbrand, Laurent Vivier, Alistair Francis, qemu-ppc,
	Cornelia Huck, Paolo Bonzini, Alex Bennée, qemu-s390x,
	Bastian Koppelmann, Richard Henderson, David Gibson, qemu-riscv,
	Marcel Apfelbaum, Palmer Dabbelt, qemu-arm, Sagar Karandikar,
	Peter Maydell, Eduardo Habkost, Philippe Mathieu-Daudé

These tests fails when configured with --disable-system.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 tests/Makefile.include | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/tests/Makefile.include b/tests/Makefile.include
index 99db5eb3e0..bf11f765c3 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -64,14 +64,14 @@ check-unit-y += tests/check-qlit$(EXESUF)
 check-unit-y += tests/test-qobject-output-visitor$(EXESUF)
 check-unit-y += tests/test-clone-visitor$(EXESUF)
 check-unit-y += tests/test-qobject-input-visitor$(EXESUF)
-check-unit-y += tests/test-qmp-cmds$(EXESUF)
+check-unit-$(CONFIG_SOFTMMU) += tests/test-qmp-cmds$(EXESUF)
 check-unit-y += tests/test-string-input-visitor$(EXESUF)
 check-unit-y += tests/test-string-output-visitor$(EXESUF)
 check-unit-y += tests/test-qmp-event$(EXESUF)
 check-unit-y += tests/test-opts-visitor$(EXESUF)
 check-unit-$(CONFIG_BLOCK) += tests/test-coroutine$(EXESUF)
 check-unit-y += tests/test-visitor-serialization$(EXESUF)
-check-unit-y += tests/test-iov$(EXESUF)
+check-unit-$(CONFIG_SOFTMMU) += tests/test-iov$(EXESUF)
 check-unit-y += tests/test-bitmap$(EXESUF)
 check-unit-$(CONFIG_BLOCK) += tests/test-aio$(EXESUF)
 check-unit-$(CONFIG_BLOCK) += tests/test-aio-multithread$(EXESUF)
@@ -106,7 +106,7 @@ check-unit-y += tests/test-qht$(EXESUF)
 check-unit-y += tests/test-qht-par$(EXESUF)
 check-unit-y += tests/test-bitops$(EXESUF)
 check-unit-y += tests/test-bitcnt$(EXESUF)
-check-unit-y += tests/test-qdev-global-props$(EXESUF)
+check-unit-$(CONFIG_SOFTMMU) += tests/test-qdev-global-props$(EXESUF)
 check-unit-y += tests/check-qom-interface$(EXESUF)
 check-unit-y += tests/check-qom-proplist$(EXESUF)
 check-unit-y += tests/test-qemu-opts$(EXESUF)
@@ -124,9 +124,9 @@ check-unit-$(call land,$(CONFIG_BLOCK),$(CONFIG_GNUTLS)) += tests/test-crypto-tl
 ifneq (,$(findstring qemu-ga,$(TOOLS)))
 check-unit-$(call land,$(CONFIG_LINUX),$(CONFIG_VIRTIO_SERIAL)) += tests/test-qga$(EXESUF)
 endif
-check-unit-y += tests/test-timed-average$(EXESUF)
-check-unit-$(CONFIG_INOTIFY1) += tests/test-util-filemonitor$(EXESUF)
-check-unit-y += tests/test-util-sockets$(EXESUF)
+check-unit-$(CONFIG_SOFTMMU) += tests/test-timed-average$(EXESUF)
+check-unit-$(call land,$(CONFIG_SOFTMMU),$(CONFIG_INOTIFY1)) += tests/test-util-filemonitor$(EXESUF)
+check-unit-$(CONFIG_SOFTMMU) += tests/test-util-sockets$(EXESUF)
 check-unit-$(CONFIG_BLOCK) += tests/test-authz-simple$(EXESUF)
 check-unit-$(CONFIG_BLOCK) += tests/test-authz-list$(EXESUF)
 check-unit-$(CONFIG_BLOCK) += tests/test-authz-listfile$(EXESUF)
@@ -137,7 +137,7 @@ check-unit-$(CONFIG_BLOCK) += tests/test-io-channel-file$(EXESUF)
 check-unit-$(call land,$(CONFIG_BLOCK),$(CONFIG_GNUTLS)) += tests/test-io-channel-tls$(EXESUF)
 check-unit-$(CONFIG_BLOCK) += tests/test-io-channel-command$(EXESUF)
 check-unit-$(CONFIG_BLOCK) += tests/test-io-channel-buffer$(EXESUF)
-check-unit-y += tests/test-base64$(EXESUF)
+check-unit-$(CONFIG_SOFTMMU) += tests/test-base64$(EXESUF)
 check-unit-$(call land,$(CONFIG_BLOCK),$(if $(CONFIG_NETTLE),y,$(CONFIG_GCRYPT))) += tests/test-crypto-pbkdf$(EXESUF)
 check-unit-$(CONFIG_BLOCK) += tests/test-crypto-ivgen$(EXESUF)
 check-unit-$(CONFIG_BLOCK)  += tests/test-crypto-afsplit$(EXESUF)
@@ -145,7 +145,7 @@ check-unit-$(call land,$(CONFIG_BLOCK),$(CONFIG_QEMU_PRIVATE_XTS)) += tests/test
 check-unit-$(CONFIG_BLOCK)  += tests/test-crypto-block$(EXESUF)
 check-unit-y += tests/test-logging$(EXESUF)
 check-unit-$(call land,$(CONFIG_BLOCK),$(CONFIG_REPLICATION)) += tests/test-replication$(EXESUF)
-check-unit-y += tests/test-bufferiszero$(EXESUF)
+check-unit-$(CONFIG_SOFTMMU) += tests/test-bufferiszero$(EXESUF)
 check-unit-y += tests/test-uuid$(EXESUF)
 check-unit-y += tests/ptimer-test$(EXESUF)
 check-unit-y += tests/test-qapi-util$(EXESUF)
-- 
2.21.1



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

* [PATCH 05/14] stubs/Makefile: Reduce the user-mode object list
  2020-03-13 18:36 ` Philippe Mathieu-Daudé
@ 2020-03-13 18:36   ` Philippe Mathieu-Daudé
  -1 siblings, 0 replies; 76+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-03-13 18:36 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, qemu-riscv, Eduardo Habkost, Sagar Karandikar,
	David Hildenbrand, Bastian Koppelmann, Cornelia Huck,
	Laurent Vivier, Philippe Mathieu-Daudé,
	qemu-s390x, qemu-arm, qemu-ppc, Paolo Bonzini, Alistair Francis,
	David Gibson, Alex Bennée, Palmer Dabbelt,
	Richard Henderson

These stubs are not required when configured with --disable-system.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 stubs/Makefile.objs | 52 ++++++++++++++++++++++++++-------------------
 1 file changed, 30 insertions(+), 22 deletions(-)

diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs
index 45be5dc0ed..5ffa085c67 100644
--- a/stubs/Makefile.objs
+++ b/stubs/Makefile.objs
@@ -1,46 +1,54 @@
-stub-obj-y += arch_type.o
-stub-obj-y += bdrv-next-monitor-owned.o
 stub-obj-y += blk-commit-all.o
-stub-obj-y += blockdev-close-all-bdrv-states.o
-stub-obj-y += clock-warp.o
 stub-obj-y += cpu-get-clock.o
 stub-obj-y += cpu-get-icount.o
 stub-obj-y += dump.o
 stub-obj-y += error-printf.o
 stub-obj-y += fdset.o
 stub-obj-y += gdbstub.o
-stub-obj-y += get-vm-name.o
-stub-obj-y += iothread.o
 stub-obj-y += iothread-lock.o
 stub-obj-y += is-daemonized.o
 stub-obj-$(CONFIG_LINUX_AIO) += linux-aio.o
 stub-obj-$(CONFIG_LINUX_IO_URING) += io_uring.o
-stub-obj-y += machine-init-done.o
-stub-obj-y += migr-blocker.o
-stub-obj-y += change-state-handler.o
-stub-obj-y += monitor.o
 stub-obj-y += monitor-core.o
 stub-obj-y += notify-event.o
+stub-obj-y += qmp_memory_device.o
 stub-obj-y += qtest.o
+stub-obj-y += ramfb.o
 stub-obj-y += replay.o
-stub-obj-y += replay-user.o
 stub-obj-y += runstate-check.o
+stub-obj-$(CONFIG_SOFTMMU) += semihost.o
 stub-obj-y += set-fd-handler.o
+stub-obj-y += vmgenid.o
 stub-obj-y += sysbus.o
 stub-obj-y += tpm.o
 stub-obj-y += trace-control.o
-stub-obj-y += uuid.o
-stub-obj-y += vm-stop.o
 stub-obj-y += vmstate.o
+
+#######################################################################
+# code used by both qemu system emulation and qemu-img
+
+ifeq ($(call lor,$(CONFIG_SOFTMMU),$(CONFIG_TOOLS)),y)
+
+stub-obj-y += arch_type.o
+stub-obj-y += bdrv-next-monitor-owned.o
+stub-obj-y += blockdev-close-all-bdrv-states.o
+stub-obj-y += change-state-handler.o
+stub-obj-y += clock-warp.o
 stub-obj-y += fd-register.o
-stub-obj-y += qmp_memory_device.o
-stub-obj-y += target-monitor-defs.o
-stub-obj-y += target-get-monitor-def.o
-stub-obj-y += vmgenid.o
-stub-obj-y += xen-common.o
-stub-obj-y += xen-hvm.o
+stub-obj-y += fw_cfg.o
+stub-obj-y += get-vm-name.o
+stub-obj-y += iothread.o
+stub-obj-y += machine-init-done.o
+stub-obj-y += migr-blocker.o
+stub-obj-y += monitor.o
 stub-obj-y += pci-host-piix.o
 stub-obj-y += ram-block.o
-stub-obj-y += ramfb.o
-stub-obj-y += fw_cfg.o
-stub-obj-$(CONFIG_SOFTMMU) += semihost.o
+stub-obj-y += replay-user.o
+stub-obj-y += target-get-monitor-def.o
+stub-obj-y += target-monitor-defs.o
+stub-obj-y += uuid.o
+stub-obj-y += vm-stop.o
+stub-obj-y += xen-common.o
+stub-obj-y += xen-hvm.o
+
+endif # CONFIG_SOFTMMU || CONFIG_TOOLS
-- 
2.21.1



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

* [PATCH 05/14] stubs/Makefile: Reduce the user-mode object list
@ 2020-03-13 18:36   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 76+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-03-13 18:36 UTC (permalink / raw)
  To: qemu-devel
  Cc: David Hildenbrand, Laurent Vivier, Alistair Francis, qemu-ppc,
	Cornelia Huck, Paolo Bonzini, Alex Bennée, qemu-s390x,
	Bastian Koppelmann, Richard Henderson, David Gibson, qemu-riscv,
	Marcel Apfelbaum, Palmer Dabbelt, qemu-arm, Sagar Karandikar,
	Peter Maydell, Eduardo Habkost, Philippe Mathieu-Daudé

These stubs are not required when configured with --disable-system.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 stubs/Makefile.objs | 52 ++++++++++++++++++++++++++-------------------
 1 file changed, 30 insertions(+), 22 deletions(-)

diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs
index 45be5dc0ed..5ffa085c67 100644
--- a/stubs/Makefile.objs
+++ b/stubs/Makefile.objs
@@ -1,46 +1,54 @@
-stub-obj-y += arch_type.o
-stub-obj-y += bdrv-next-monitor-owned.o
 stub-obj-y += blk-commit-all.o
-stub-obj-y += blockdev-close-all-bdrv-states.o
-stub-obj-y += clock-warp.o
 stub-obj-y += cpu-get-clock.o
 stub-obj-y += cpu-get-icount.o
 stub-obj-y += dump.o
 stub-obj-y += error-printf.o
 stub-obj-y += fdset.o
 stub-obj-y += gdbstub.o
-stub-obj-y += get-vm-name.o
-stub-obj-y += iothread.o
 stub-obj-y += iothread-lock.o
 stub-obj-y += is-daemonized.o
 stub-obj-$(CONFIG_LINUX_AIO) += linux-aio.o
 stub-obj-$(CONFIG_LINUX_IO_URING) += io_uring.o
-stub-obj-y += machine-init-done.o
-stub-obj-y += migr-blocker.o
-stub-obj-y += change-state-handler.o
-stub-obj-y += monitor.o
 stub-obj-y += monitor-core.o
 stub-obj-y += notify-event.o
+stub-obj-y += qmp_memory_device.o
 stub-obj-y += qtest.o
+stub-obj-y += ramfb.o
 stub-obj-y += replay.o
-stub-obj-y += replay-user.o
 stub-obj-y += runstate-check.o
+stub-obj-$(CONFIG_SOFTMMU) += semihost.o
 stub-obj-y += set-fd-handler.o
+stub-obj-y += vmgenid.o
 stub-obj-y += sysbus.o
 stub-obj-y += tpm.o
 stub-obj-y += trace-control.o
-stub-obj-y += uuid.o
-stub-obj-y += vm-stop.o
 stub-obj-y += vmstate.o
+
+#######################################################################
+# code used by both qemu system emulation and qemu-img
+
+ifeq ($(call lor,$(CONFIG_SOFTMMU),$(CONFIG_TOOLS)),y)
+
+stub-obj-y += arch_type.o
+stub-obj-y += bdrv-next-monitor-owned.o
+stub-obj-y += blockdev-close-all-bdrv-states.o
+stub-obj-y += change-state-handler.o
+stub-obj-y += clock-warp.o
 stub-obj-y += fd-register.o
-stub-obj-y += qmp_memory_device.o
-stub-obj-y += target-monitor-defs.o
-stub-obj-y += target-get-monitor-def.o
-stub-obj-y += vmgenid.o
-stub-obj-y += xen-common.o
-stub-obj-y += xen-hvm.o
+stub-obj-y += fw_cfg.o
+stub-obj-y += get-vm-name.o
+stub-obj-y += iothread.o
+stub-obj-y += machine-init-done.o
+stub-obj-y += migr-blocker.o
+stub-obj-y += monitor.o
 stub-obj-y += pci-host-piix.o
 stub-obj-y += ram-block.o
-stub-obj-y += ramfb.o
-stub-obj-y += fw_cfg.o
-stub-obj-$(CONFIG_SOFTMMU) += semihost.o
+stub-obj-y += replay-user.o
+stub-obj-y += target-get-monitor-def.o
+stub-obj-y += target-monitor-defs.o
+stub-obj-y += uuid.o
+stub-obj-y += vm-stop.o
+stub-obj-y += xen-common.o
+stub-obj-y += xen-hvm.o
+
+endif # CONFIG_SOFTMMU || CONFIG_TOOLS
-- 
2.21.1



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

* [PATCH 06/14] util/Makefile: Reduce the user-mode object list
  2020-03-13 18:36 ` Philippe Mathieu-Daudé
@ 2020-03-13 18:36   ` Philippe Mathieu-Daudé
  -1 siblings, 0 replies; 76+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-03-13 18:36 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, qemu-riscv, Eduardo Habkost, Sagar Karandikar,
	David Hildenbrand, Bastian Koppelmann, Cornelia Huck,
	Laurent Vivier, Philippe Mathieu-Daudé,
	qemu-s390x, qemu-arm, qemu-ppc, Paolo Bonzini, Alistair Francis,
	David Gibson, Alex Bennée, Palmer Dabbelt,
	Richard Henderson

These stubs are not required when configured with --disable-system.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 util/Makefile.objs | 59 +++++++++++++++++++++++++++++-----------------
 1 file changed, 38 insertions(+), 21 deletions(-)

diff --git a/util/Makefile.objs b/util/Makefile.objs
index 6718a38b61..24ae2e4dfa 100644
--- a/util/Makefile.objs
+++ b/util/Makefile.objs
@@ -1,8 +1,4 @@
 util-obj-y = osdep.o cutils.o unicode.o qemu-timer-common.o
-util-obj-y += bufferiszero.o
-util-obj-y += lockcnt.o
-util-obj-y += aiocb.o async.o aio-wait.o thread-pool.o qemu-timer.o
-util-obj-y += main-loop.o
 util-obj-$(call lnot,$(CONFIG_ATOMIC64)) += atomic64.o
 util-obj-$(CONFIG_POSIX) += aio-posix.o
 util-obj-$(CONFIG_POSIX) += fdmon-poll.o
@@ -21,31 +17,20 @@ util-obj-$(CONFIG_WIN32) += oslib-win32.o
 util-obj-$(CONFIG_WIN32) += qemu-thread-win32.o
 util-obj-y += envlist.o path.o module.o
 util-obj-y += host-utils.o
-util-obj-y += bitmap.o bitops.o hbitmap.o
+util-obj-y += bitmap.o bitops.o
 util-obj-y += fifo8.o
-util-obj-y += nvdimm-utils.o
 util-obj-y += cacheinfo.o
 util-obj-y += error.o qemu-error.o
 util-obj-y += qemu-print.o
 util-obj-y += id.o
-util-obj-y += iov.o qemu-config.o qemu-sockets.o uri.o notify.o
+util-obj-y += qemu-config.o notify.o
 util-obj-y += qemu-option.o qemu-progress.o
 util-obj-y += keyval.o
-util-obj-y += hexdump.o
 util-obj-y += crc32c.o
 util-obj-y += uuid.o
-util-obj-y += throttle.o
 util-obj-y += getauxval.o
-util-obj-y += readline.o
 util-obj-y += rcu.o
 util-obj-$(CONFIG_MEMBARRIER) += sys_membarrier.o
-util-obj-y += qemu-coroutine.o qemu-coroutine-lock.o qemu-coroutine-io.o
-util-obj-y += qemu-coroutine-sleep.o
-util-obj-y += qemu-co-shared-resource.o
-util-obj-y += coroutine-$(CONFIG_COROUTINE_BACKEND).o
-util-obj-y += buffer.o
-util-obj-y += timed-average.o
-util-obj-y += base64.o
 util-obj-y += log.o
 util-obj-y += pagesize.o
 util-obj-y += qdist.o
@@ -54,12 +39,44 @@ util-obj-y += qsp.o
 util-obj-y += range.o
 util-obj-y += stats64.o
 util-obj-y += systemd.o
-util-obj-y += iova-tree.o
-util-obj-$(CONFIG_INOTIFY1) += filemonitor-inotify.o
-util-obj-$(call lnot,$(CONFIG_INOTIFY1)) += filemonitor-stub.o
-util-obj-$(CONFIG_LINUX) += vfio-helpers.o
 util-obj-$(CONFIG_POSIX) += drm.o
 util-obj-y += guest-random.o
 util-obj-$(CONFIG_GIO) += dbus.o
 dbus.o-cflags = $(GIO_CFLAGS)
 dbus.o-libs = $(GIO_LIBS)
+
+#######################################################################
+# code used by both qemu system emulation and qemu-img
+
+ifeq ($(call lor,$(CONFIG_SOFTMMU),$(CONFIG_TOOLS)),y)
+
+util-obj-y += aio-wait.o
+util-obj-y += aiocb.o
+util-obj-y += async.o
+util-obj-y += base64.o
+util-obj-y += buffer.o
+util-obj-y += bufferiszero.o
+util-obj-y += coroutine-$(CONFIG_COROUTINE_BACKEND).o
+util-obj-y += hexdump.o
+util-obj-y += lockcnt.o
+util-obj-y += iov.o
+util-obj-y += iova-tree.o
+util-obj-y += hbitmap.o
+util-obj-y += main-loop.o
+util-obj-y += nvdimm-utils.o
+util-obj-y += qemu-coroutine.o qemu-coroutine-lock.o qemu-coroutine-io.o
+util-obj-y += qemu-coroutine-sleep.o
+util-obj-y += qemu-co-shared-resource.o
+util-obj-y += qemu-sockets.o
+util-obj-y += qemu-timer.o
+util-obj-y += thread-pool.o
+util-obj-y += throttle.o
+util-obj-y += timed-average.o
+util-obj-y += uri.o
+
+util-obj-$(CONFIG_LINUX) += vfio-helpers.o
+util-obj-$(CONFIG_INOTIFY1) += filemonitor-inotify.o
+util-obj-$(call lnot,$(CONFIG_INOTIFY1)) += filemonitor-stub.o
+util-obj-$(CONFIG_BLOCK) += readline.o
+
+endif # CONFIG_SOFTMMU || CONFIG_TOOLS
-- 
2.21.1



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

* [PATCH 06/14] util/Makefile: Reduce the user-mode object list
@ 2020-03-13 18:36   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 76+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-03-13 18:36 UTC (permalink / raw)
  To: qemu-devel
  Cc: David Hildenbrand, Laurent Vivier, Alistair Francis, qemu-ppc,
	Cornelia Huck, Paolo Bonzini, Alex Bennée, qemu-s390x,
	Bastian Koppelmann, Richard Henderson, David Gibson, qemu-riscv,
	Marcel Apfelbaum, Palmer Dabbelt, qemu-arm, Sagar Karandikar,
	Peter Maydell, Eduardo Habkost, Philippe Mathieu-Daudé

These stubs are not required when configured with --disable-system.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 util/Makefile.objs | 59 +++++++++++++++++++++++++++++-----------------
 1 file changed, 38 insertions(+), 21 deletions(-)

diff --git a/util/Makefile.objs b/util/Makefile.objs
index 6718a38b61..24ae2e4dfa 100644
--- a/util/Makefile.objs
+++ b/util/Makefile.objs
@@ -1,8 +1,4 @@
 util-obj-y = osdep.o cutils.o unicode.o qemu-timer-common.o
-util-obj-y += bufferiszero.o
-util-obj-y += lockcnt.o
-util-obj-y += aiocb.o async.o aio-wait.o thread-pool.o qemu-timer.o
-util-obj-y += main-loop.o
 util-obj-$(call lnot,$(CONFIG_ATOMIC64)) += atomic64.o
 util-obj-$(CONFIG_POSIX) += aio-posix.o
 util-obj-$(CONFIG_POSIX) += fdmon-poll.o
@@ -21,31 +17,20 @@ util-obj-$(CONFIG_WIN32) += oslib-win32.o
 util-obj-$(CONFIG_WIN32) += qemu-thread-win32.o
 util-obj-y += envlist.o path.o module.o
 util-obj-y += host-utils.o
-util-obj-y += bitmap.o bitops.o hbitmap.o
+util-obj-y += bitmap.o bitops.o
 util-obj-y += fifo8.o
-util-obj-y += nvdimm-utils.o
 util-obj-y += cacheinfo.o
 util-obj-y += error.o qemu-error.o
 util-obj-y += qemu-print.o
 util-obj-y += id.o
-util-obj-y += iov.o qemu-config.o qemu-sockets.o uri.o notify.o
+util-obj-y += qemu-config.o notify.o
 util-obj-y += qemu-option.o qemu-progress.o
 util-obj-y += keyval.o
-util-obj-y += hexdump.o
 util-obj-y += crc32c.o
 util-obj-y += uuid.o
-util-obj-y += throttle.o
 util-obj-y += getauxval.o
-util-obj-y += readline.o
 util-obj-y += rcu.o
 util-obj-$(CONFIG_MEMBARRIER) += sys_membarrier.o
-util-obj-y += qemu-coroutine.o qemu-coroutine-lock.o qemu-coroutine-io.o
-util-obj-y += qemu-coroutine-sleep.o
-util-obj-y += qemu-co-shared-resource.o
-util-obj-y += coroutine-$(CONFIG_COROUTINE_BACKEND).o
-util-obj-y += buffer.o
-util-obj-y += timed-average.o
-util-obj-y += base64.o
 util-obj-y += log.o
 util-obj-y += pagesize.o
 util-obj-y += qdist.o
@@ -54,12 +39,44 @@ util-obj-y += qsp.o
 util-obj-y += range.o
 util-obj-y += stats64.o
 util-obj-y += systemd.o
-util-obj-y += iova-tree.o
-util-obj-$(CONFIG_INOTIFY1) += filemonitor-inotify.o
-util-obj-$(call lnot,$(CONFIG_INOTIFY1)) += filemonitor-stub.o
-util-obj-$(CONFIG_LINUX) += vfio-helpers.o
 util-obj-$(CONFIG_POSIX) += drm.o
 util-obj-y += guest-random.o
 util-obj-$(CONFIG_GIO) += dbus.o
 dbus.o-cflags = $(GIO_CFLAGS)
 dbus.o-libs = $(GIO_LIBS)
+
+#######################################################################
+# code used by both qemu system emulation and qemu-img
+
+ifeq ($(call lor,$(CONFIG_SOFTMMU),$(CONFIG_TOOLS)),y)
+
+util-obj-y += aio-wait.o
+util-obj-y += aiocb.o
+util-obj-y += async.o
+util-obj-y += base64.o
+util-obj-y += buffer.o
+util-obj-y += bufferiszero.o
+util-obj-y += coroutine-$(CONFIG_COROUTINE_BACKEND).o
+util-obj-y += hexdump.o
+util-obj-y += lockcnt.o
+util-obj-y += iov.o
+util-obj-y += iova-tree.o
+util-obj-y += hbitmap.o
+util-obj-y += main-loop.o
+util-obj-y += nvdimm-utils.o
+util-obj-y += qemu-coroutine.o qemu-coroutine-lock.o qemu-coroutine-io.o
+util-obj-y += qemu-coroutine-sleep.o
+util-obj-y += qemu-co-shared-resource.o
+util-obj-y += qemu-sockets.o
+util-obj-y += qemu-timer.o
+util-obj-y += thread-pool.o
+util-obj-y += throttle.o
+util-obj-y += timed-average.o
+util-obj-y += uri.o
+
+util-obj-$(CONFIG_LINUX) += vfio-helpers.o
+util-obj-$(CONFIG_INOTIFY1) += filemonitor-inotify.o
+util-obj-$(call lnot,$(CONFIG_INOTIFY1)) += filemonitor-stub.o
+util-obj-$(CONFIG_BLOCK) += readline.o
+
+endif # CONFIG_SOFTMMU || CONFIG_TOOLS
-- 
2.21.1



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

* [PATCH 07/14] target/riscv/cpu: Restrict CPU migration to system-mode
  2020-03-13 18:36 ` Philippe Mathieu-Daudé
@ 2020-03-13 18:36   ` Philippe Mathieu-Daudé
  -1 siblings, 0 replies; 76+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-03-13 18:36 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, qemu-riscv, Eduardo Habkost, Sagar Karandikar,
	David Hildenbrand, Bastian Koppelmann, Cornelia Huck,
	Laurent Vivier, Philippe Mathieu-Daudé,
	qemu-s390x, qemu-arm, qemu-ppc, Paolo Bonzini, Alistair Francis,
	David Gibson, Alex Bennée, Palmer Dabbelt,
	Richard Henderson

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 target/riscv/cpu.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index c0b7023100..b59e09209e 100644
--- a/target/riscv/cpu.c
+++ b/target/riscv/cpu.c
@@ -475,10 +475,12 @@ static void riscv_cpu_init(Object *obj)
     cpu_set_cpustate_pointers(cpu);
 }
 
+#ifndef CONFIG_USER_ONLY
 static const VMStateDescription vmstate_riscv_cpu = {
     .name = "cpu",
     .unmigratable = 1,
 };
+#endif
 
 static Property riscv_cpu_properties[] = {
     DEFINE_PROP_BOOL("i", RISCVCPU, cfg.ext_i, true),
@@ -534,13 +536,13 @@ static void riscv_cpu_class_init(ObjectClass *c, void *data)
     cc->do_transaction_failed = riscv_cpu_do_transaction_failed;
     cc->do_unaligned_access = riscv_cpu_do_unaligned_access;
     cc->get_phys_page_debug = riscv_cpu_get_phys_page_debug;
+    /* For now, mark unmigratable: */
+    cc->vmsd = &vmstate_riscv_cpu;
 #endif
 #ifdef CONFIG_TCG
     cc->tcg_initialize = riscv_translate_init;
     cc->tlb_fill = riscv_cpu_tlb_fill;
 #endif
-    /* For now, mark unmigratable: */
-    cc->vmsd = &vmstate_riscv_cpu;
     device_class_set_props(dc, riscv_cpu_properties);
 }
 
-- 
2.21.1



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

* [PATCH 07/14] target/riscv/cpu: Restrict CPU migration to system-mode
@ 2020-03-13 18:36   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 76+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-03-13 18:36 UTC (permalink / raw)
  To: qemu-devel
  Cc: David Hildenbrand, Laurent Vivier, Alistair Francis, qemu-ppc,
	Cornelia Huck, Paolo Bonzini, Alex Bennée, qemu-s390x,
	Bastian Koppelmann, Richard Henderson, David Gibson, qemu-riscv,
	Marcel Apfelbaum, Palmer Dabbelt, qemu-arm, Sagar Karandikar,
	Peter Maydell, Eduardo Habkost, Philippe Mathieu-Daudé

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 target/riscv/cpu.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index c0b7023100..b59e09209e 100644
--- a/target/riscv/cpu.c
+++ b/target/riscv/cpu.c
@@ -475,10 +475,12 @@ static void riscv_cpu_init(Object *obj)
     cpu_set_cpustate_pointers(cpu);
 }
 
+#ifndef CONFIG_USER_ONLY
 static const VMStateDescription vmstate_riscv_cpu = {
     .name = "cpu",
     .unmigratable = 1,
 };
+#endif
 
 static Property riscv_cpu_properties[] = {
     DEFINE_PROP_BOOL("i", RISCVCPU, cfg.ext_i, true),
@@ -534,13 +536,13 @@ static void riscv_cpu_class_init(ObjectClass *c, void *data)
     cc->do_transaction_failed = riscv_cpu_do_transaction_failed;
     cc->do_unaligned_access = riscv_cpu_do_unaligned_access;
     cc->get_phys_page_debug = riscv_cpu_get_phys_page_debug;
+    /* For now, mark unmigratable: */
+    cc->vmsd = &vmstate_riscv_cpu;
 #endif
 #ifdef CONFIG_TCG
     cc->tcg_initialize = riscv_translate_init;
     cc->tlb_fill = riscv_cpu_tlb_fill;
 #endif
-    /* For now, mark unmigratable: */
-    cc->vmsd = &vmstate_riscv_cpu;
     device_class_set_props(dc, riscv_cpu_properties);
 }
 
-- 
2.21.1



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

* [PATCH 08/14] exec: Assert CPU migration is not used on user-only build
  2020-03-13 18:36 ` Philippe Mathieu-Daudé
@ 2020-03-13 18:36   ` Philippe Mathieu-Daudé
  -1 siblings, 0 replies; 76+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-03-13 18:36 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, qemu-riscv, Eduardo Habkost, Sagar Karandikar,
	David Hildenbrand, Bastian Koppelmann, Cornelia Huck,
	Laurent Vivier, Philippe Mathieu-Daudé,
	qemu-s390x, qemu-arm, qemu-ppc, Paolo Bonzini, Alistair Francis,
	David Gibson, Alex Bennée, Palmer Dabbelt,
	Richard Henderson

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 exec.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/exec.c b/exec.c
index 0cc500d53a..7bc9828c5b 100644
--- a/exec.c
+++ b/exec.c
@@ -946,7 +946,9 @@ void cpu_exec_realizefn(CPUState *cpu, Error **errp)
 
     qemu_plugin_vcpu_init_hook(cpu);
 
-#ifndef CONFIG_USER_ONLY
+#ifdef CONFIG_USER_ONLY
+    assert(cc->vmsd == NULL);
+#else /* !CONFIG_USER_ONLY */
     if (qdev_get_vmsd(DEVICE(cpu)) == NULL) {
         vmstate_register(NULL, cpu->cpu_index, &vmstate_cpu_common, cpu);
     }
-- 
2.21.1



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

* [PATCH 08/14] exec: Assert CPU migration is not used on user-only build
@ 2020-03-13 18:36   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 76+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-03-13 18:36 UTC (permalink / raw)
  To: qemu-devel
  Cc: David Hildenbrand, Laurent Vivier, Alistair Francis, qemu-ppc,
	Cornelia Huck, Paolo Bonzini, Alex Bennée, qemu-s390x,
	Bastian Koppelmann, Richard Henderson, David Gibson, qemu-riscv,
	Marcel Apfelbaum, Palmer Dabbelt, qemu-arm, Sagar Karandikar,
	Peter Maydell, Eduardo Habkost, Philippe Mathieu-Daudé

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 exec.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/exec.c b/exec.c
index 0cc500d53a..7bc9828c5b 100644
--- a/exec.c
+++ b/exec.c
@@ -946,7 +946,9 @@ void cpu_exec_realizefn(CPUState *cpu, Error **errp)
 
     qemu_plugin_vcpu_init_hook(cpu);
 
-#ifndef CONFIG_USER_ONLY
+#ifdef CONFIG_USER_ONLY
+    assert(cc->vmsd == NULL);
+#else /* !CONFIG_USER_ONLY */
     if (qdev_get_vmsd(DEVICE(cpu)) == NULL) {
         vmstate_register(NULL, cpu->cpu_index, &vmstate_cpu_common, cpu);
     }
-- 
2.21.1



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

* [PATCH 09/14] exec: Drop redundant #ifdeffery
  2020-03-13 18:36 ` Philippe Mathieu-Daudé
@ 2020-03-13 18:36   ` Philippe Mathieu-Daudé
  -1 siblings, 0 replies; 76+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-03-13 18:36 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, qemu-riscv, Eduardo Habkost, Sagar Karandikar,
	David Hildenbrand, Bastian Koppelmann, Cornelia Huck,
	Laurent Vivier, Philippe Mathieu-Daudé,
	qemu-s390x, qemu-arm, qemu-ppc, Paolo Bonzini, Alistair Francis,
	David Gibson, Alex Bennée, Palmer Dabbelt,
	Richard Henderson

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 exec.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/exec.c b/exec.c
index 7bc9828c5b..f258502966 100644
--- a/exec.c
+++ b/exec.c
@@ -185,10 +185,6 @@ struct DirtyBitmapSnapshot {
     unsigned long dirty[];
 };
 
-#endif
-
-#if !defined(CONFIG_USER_ONLY)
-
 static void phys_map_node_reserve(PhysPageMap *map, unsigned nodes)
 {
     static unsigned alloc_hint = 16;
-- 
2.21.1



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

* [PATCH 09/14] exec: Drop redundant #ifdeffery
@ 2020-03-13 18:36   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 76+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-03-13 18:36 UTC (permalink / raw)
  To: qemu-devel
  Cc: David Hildenbrand, Laurent Vivier, Alistair Francis, qemu-ppc,
	Cornelia Huck, Paolo Bonzini, Alex Bennée, qemu-s390x,
	Bastian Koppelmann, Richard Henderson, David Gibson, qemu-riscv,
	Marcel Apfelbaum, Palmer Dabbelt, qemu-arm, Sagar Karandikar,
	Peter Maydell, Eduardo Habkost, Philippe Mathieu-Daudé

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 exec.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/exec.c b/exec.c
index 7bc9828c5b..f258502966 100644
--- a/exec.c
+++ b/exec.c
@@ -185,10 +185,6 @@ struct DirtyBitmapSnapshot {
     unsigned long dirty[];
 };
 
-#endif
-
-#if !defined(CONFIG_USER_ONLY)
-
 static void phys_map_node_reserve(PhysPageMap *map, unsigned nodes)
 {
     static unsigned alloc_hint = 16;
-- 
2.21.1



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

* [PATCH 10/14] arch_init: Remove unused 'qapi-commands-misc.h' include
  2020-03-13 18:36 ` Philippe Mathieu-Daudé
@ 2020-03-13 18:36   ` Philippe Mathieu-Daudé
  -1 siblings, 0 replies; 76+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-03-13 18:36 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, qemu-riscv, Eduardo Habkost, Sagar Karandikar,
	David Hildenbrand, Bastian Koppelmann, Cornelia Huck,
	Laurent Vivier, Philippe Mathieu-Daudé,
	qemu-s390x, qemu-arm, qemu-ppc, Paolo Bonzini, Alistair Francis,
	David Gibson, Alex Bennée, Palmer Dabbelt,
	Richard Henderson

Commit ffaee83bcb2 moved qmp_query_target but forgot to remove
this include.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 arch_init.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch_init.c b/arch_init.c
index 705d0b94ad..074fa621b6 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -27,7 +27,6 @@
 #include "sysemu/arch_init.h"
 #include "hw/pci/pci.h"
 #include "hw/audio/soundhw.h"
-#include "qapi/qapi-commands-misc.h"
 #include "qapi/error.h"
 #include "qemu/config-file.h"
 #include "qemu/error-report.h"
-- 
2.21.1



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

* [PATCH 10/14] arch_init: Remove unused 'qapi-commands-misc.h' include
@ 2020-03-13 18:36   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 76+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-03-13 18:36 UTC (permalink / raw)
  To: qemu-devel
  Cc: David Hildenbrand, Laurent Vivier, Alistair Francis, qemu-ppc,
	Cornelia Huck, Paolo Bonzini, Alex Bennée, qemu-s390x,
	Bastian Koppelmann, Richard Henderson, David Gibson, qemu-riscv,
	Marcel Apfelbaum, Palmer Dabbelt, qemu-arm, Sagar Karandikar,
	Peter Maydell, Eduardo Habkost, Philippe Mathieu-Daudé

Commit ffaee83bcb2 moved qmp_query_target but forgot to remove
this include.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 arch_init.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch_init.c b/arch_init.c
index 705d0b94ad..074fa621b6 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -27,7 +27,6 @@
 #include "sysemu/arch_init.h"
 #include "hw/pci/pci.h"
 #include "hw/audio/soundhw.h"
-#include "qapi/qapi-commands-misc.h"
 #include "qapi/error.h"
 #include "qemu/config-file.h"
 #include "qemu/error-report.h"
-- 
2.21.1



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

* [PATCH 11/14] target: Restrict write_elfXX_note() handlers to system-mode
  2020-03-13 18:36 ` Philippe Mathieu-Daudé
@ 2020-03-13 18:36   ` Philippe Mathieu-Daudé
  -1 siblings, 0 replies; 76+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-03-13 18:36 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, qemu-riscv, Eduardo Habkost, Sagar Karandikar,
	David Hildenbrand, Bastian Koppelmann, Cornelia Huck,
	Laurent Vivier, Philippe Mathieu-Daudé,
	qemu-s390x, qemu-arm, qemu-ppc, Paolo Bonzini, Alistair Francis,
	David Gibson, Alex Bennée, Palmer Dabbelt,
	Richard Henderson

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 target/arm/cpu.h                | 10 +++++-----
 target/i386/cpu.h               | 18 +++++++++---------
 target/ppc/cpu.h                |  2 --
 target/s390x/internal.h         |  3 ++-
 target/ppc/translate_init.inc.c |  2 --
 5 files changed, 16 insertions(+), 19 deletions(-)

diff --git a/target/arm/cpu.h b/target/arm/cpu.h
index 4ffd991b6f..8a22212521 100644
--- a/target/arm/cpu.h
+++ b/target/arm/cpu.h
@@ -958,6 +958,11 @@ void arm_cpu_post_init(Object *obj);
 uint64_t arm_cpu_mp_affinity(int idx, uint8_t clustersz);
 
 #ifndef CONFIG_USER_ONLY
+int arm_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs,
+                             int cpuid, void *opaque);
+int arm_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cs,
+                             int cpuid, void *opaque);
+
 extern const VMStateDescription vmstate_arm_cpu;
 #endif
 
@@ -982,11 +987,6 @@ int arm_gen_dynamic_xml(CPUState *cpu);
  */
 const char *arm_gdb_get_dynamic_xml(CPUState *cpu, const char *xmlname);
 
-int arm_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs,
-                             int cpuid, void *opaque);
-int arm_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cs,
-                             int cpuid, void *opaque);
-
 #ifdef TARGET_AARCH64
 int aarch64_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg);
 int aarch64_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index 576f309bbf..f25fe5fc7c 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -1738,6 +1738,15 @@ struct X86CPU {
 
 
 #ifndef CONFIG_USER_ONLY
+int x86_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cpu,
+                             int cpuid, void *opaque);
+int x86_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cpu,
+                             int cpuid, void *opaque);
+int x86_cpu_write_elf64_qemunote(WriteCoreDumpFunction f, CPUState *cpu,
+                                 void *opaque);
+int x86_cpu_write_elf32_qemunote(WriteCoreDumpFunction f, CPUState *cpu,
+                                 void *opaque);
+
 extern VMStateDescription vmstate_x86_cpu;
 #endif
 
@@ -1749,15 +1758,6 @@ void x86_cpu_do_interrupt(CPUState *cpu);
 bool x86_cpu_exec_interrupt(CPUState *cpu, int int_req);
 int x86_cpu_pending_interrupt(CPUState *cs, int interrupt_request);
 
-int x86_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cpu,
-                             int cpuid, void *opaque);
-int x86_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cpu,
-                             int cpuid, void *opaque);
-int x86_cpu_write_elf64_qemunote(WriteCoreDumpFunction f, CPUState *cpu,
-                                 void *opaque);
-int x86_cpu_write_elf32_qemunote(WriteCoreDumpFunction f, CPUState *cpu,
-                                 void *opaque);
-
 void x86_cpu_get_memory_mapping(CPUState *cpu, MemoryMappingList *list,
                                 Error **errp);
 
diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h
index b283042515..b9fb76d0b3 100644
--- a/target/ppc/cpu.h
+++ b/target/ppc/cpu.h
@@ -1225,12 +1225,10 @@ int ppc_cpu_gdb_write_register_apple(CPUState *cpu, uint8_t *buf, int reg);
 #ifndef CONFIG_USER_ONLY
 void ppc_gdb_gen_spr_xml(PowerPCCPU *cpu);
 const char *ppc_gdb_get_dynamic_xml(CPUState *cs, const char *xml_name);
-#endif
 int ppc64_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs,
                                int cpuid, void *opaque);
 int ppc32_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cs,
                                int cpuid, void *opaque);
-#ifndef CONFIG_USER_ONLY
 void ppc_cpu_do_system_reset(CPUState *cs);
 extern const VMStateDescription vmstate_ppc_cpu;
 #endif
diff --git a/target/s390x/internal.h b/target/s390x/internal.h
index d37816104d..dcbd8d2065 100644
--- a/target/s390x/internal.h
+++ b/target/s390x/internal.h
@@ -226,9 +226,10 @@ static inline hwaddr decode_basedisp_s(CPUS390XState *env, uint32_t ipb,
 #define decode_basedisp_rs decode_basedisp_s
 
 /* arch_dump.c */
+#if !defined(CONFIG_USER_ONLY)
 int s390_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs,
                               int cpuid, void *opaque);
-
+#endif
 
 /* cc_helper.c */
 const char *cc_name(enum cc_op cc_op);
diff --git a/target/ppc/translate_init.inc.c b/target/ppc/translate_init.inc.c
index 53995f62ea..768ec18a28 100644
--- a/target/ppc/translate_init.inc.c
+++ b/target/ppc/translate_init.inc.c
@@ -10902,8 +10902,6 @@ static void ppc_cpu_class_init(ObjectClass *oc, void *data)
 #ifndef CONFIG_USER_ONLY
     cc->get_phys_page_debug = ppc_cpu_get_phys_page_debug;
     cc->vmsd = &vmstate_ppc_cpu;
-#endif
-#if defined(CONFIG_SOFTMMU)
     cc->write_elf64_note = ppc64_cpu_write_elf64_note;
     cc->write_elf32_note = ppc32_cpu_write_elf32_note;
 #endif
-- 
2.21.1



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

* [PATCH 11/14] target: Restrict write_elfXX_note() handlers to system-mode
@ 2020-03-13 18:36   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 76+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-03-13 18:36 UTC (permalink / raw)
  To: qemu-devel
  Cc: David Hildenbrand, Laurent Vivier, Alistair Francis, qemu-ppc,
	Cornelia Huck, Paolo Bonzini, Alex Bennée, qemu-s390x,
	Bastian Koppelmann, Richard Henderson, David Gibson, qemu-riscv,
	Marcel Apfelbaum, Palmer Dabbelt, qemu-arm, Sagar Karandikar,
	Peter Maydell, Eduardo Habkost, Philippe Mathieu-Daudé

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 target/arm/cpu.h                | 10 +++++-----
 target/i386/cpu.h               | 18 +++++++++---------
 target/ppc/cpu.h                |  2 --
 target/s390x/internal.h         |  3 ++-
 target/ppc/translate_init.inc.c |  2 --
 5 files changed, 16 insertions(+), 19 deletions(-)

diff --git a/target/arm/cpu.h b/target/arm/cpu.h
index 4ffd991b6f..8a22212521 100644
--- a/target/arm/cpu.h
+++ b/target/arm/cpu.h
@@ -958,6 +958,11 @@ void arm_cpu_post_init(Object *obj);
 uint64_t arm_cpu_mp_affinity(int idx, uint8_t clustersz);
 
 #ifndef CONFIG_USER_ONLY
+int arm_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs,
+                             int cpuid, void *opaque);
+int arm_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cs,
+                             int cpuid, void *opaque);
+
 extern const VMStateDescription vmstate_arm_cpu;
 #endif
 
@@ -982,11 +987,6 @@ int arm_gen_dynamic_xml(CPUState *cpu);
  */
 const char *arm_gdb_get_dynamic_xml(CPUState *cpu, const char *xmlname);
 
-int arm_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs,
-                             int cpuid, void *opaque);
-int arm_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cs,
-                             int cpuid, void *opaque);
-
 #ifdef TARGET_AARCH64
 int aarch64_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg);
 int aarch64_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index 576f309bbf..f25fe5fc7c 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -1738,6 +1738,15 @@ struct X86CPU {
 
 
 #ifndef CONFIG_USER_ONLY
+int x86_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cpu,
+                             int cpuid, void *opaque);
+int x86_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cpu,
+                             int cpuid, void *opaque);
+int x86_cpu_write_elf64_qemunote(WriteCoreDumpFunction f, CPUState *cpu,
+                                 void *opaque);
+int x86_cpu_write_elf32_qemunote(WriteCoreDumpFunction f, CPUState *cpu,
+                                 void *opaque);
+
 extern VMStateDescription vmstate_x86_cpu;
 #endif
 
@@ -1749,15 +1758,6 @@ void x86_cpu_do_interrupt(CPUState *cpu);
 bool x86_cpu_exec_interrupt(CPUState *cpu, int int_req);
 int x86_cpu_pending_interrupt(CPUState *cs, int interrupt_request);
 
-int x86_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cpu,
-                             int cpuid, void *opaque);
-int x86_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cpu,
-                             int cpuid, void *opaque);
-int x86_cpu_write_elf64_qemunote(WriteCoreDumpFunction f, CPUState *cpu,
-                                 void *opaque);
-int x86_cpu_write_elf32_qemunote(WriteCoreDumpFunction f, CPUState *cpu,
-                                 void *opaque);
-
 void x86_cpu_get_memory_mapping(CPUState *cpu, MemoryMappingList *list,
                                 Error **errp);
 
diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h
index b283042515..b9fb76d0b3 100644
--- a/target/ppc/cpu.h
+++ b/target/ppc/cpu.h
@@ -1225,12 +1225,10 @@ int ppc_cpu_gdb_write_register_apple(CPUState *cpu, uint8_t *buf, int reg);
 #ifndef CONFIG_USER_ONLY
 void ppc_gdb_gen_spr_xml(PowerPCCPU *cpu);
 const char *ppc_gdb_get_dynamic_xml(CPUState *cs, const char *xml_name);
-#endif
 int ppc64_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs,
                                int cpuid, void *opaque);
 int ppc32_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cs,
                                int cpuid, void *opaque);
-#ifndef CONFIG_USER_ONLY
 void ppc_cpu_do_system_reset(CPUState *cs);
 extern const VMStateDescription vmstate_ppc_cpu;
 #endif
diff --git a/target/s390x/internal.h b/target/s390x/internal.h
index d37816104d..dcbd8d2065 100644
--- a/target/s390x/internal.h
+++ b/target/s390x/internal.h
@@ -226,9 +226,10 @@ static inline hwaddr decode_basedisp_s(CPUS390XState *env, uint32_t ipb,
 #define decode_basedisp_rs decode_basedisp_s
 
 /* arch_dump.c */
+#if !defined(CONFIG_USER_ONLY)
 int s390_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs,
                               int cpuid, void *opaque);
-
+#endif
 
 /* cc_helper.c */
 const char *cc_name(enum cc_op cc_op);
diff --git a/target/ppc/translate_init.inc.c b/target/ppc/translate_init.inc.c
index 53995f62ea..768ec18a28 100644
--- a/target/ppc/translate_init.inc.c
+++ b/target/ppc/translate_init.inc.c
@@ -10902,8 +10902,6 @@ static void ppc_cpu_class_init(ObjectClass *oc, void *data)
 #ifndef CONFIG_USER_ONLY
     cc->get_phys_page_debug = ppc_cpu_get_phys_page_debug;
     cc->vmsd = &vmstate_ppc_cpu;
-#endif
-#if defined(CONFIG_SOFTMMU)
     cc->write_elf64_note = ppc64_cpu_write_elf64_note;
     cc->write_elf32_note = ppc32_cpu_write_elf32_note;
 #endif
-- 
2.21.1



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

* [PATCH 12/14] target/i386: Restrict CpuClass::get_crash_info() to system-mode
  2020-03-13 18:36 ` Philippe Mathieu-Daudé
@ 2020-03-13 18:36   ` Philippe Mathieu-Daudé
  -1 siblings, 0 replies; 76+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-03-13 18:36 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, qemu-riscv, Eduardo Habkost, Sagar Karandikar,
	David Hildenbrand, Bastian Koppelmann, Cornelia Huck,
	Laurent Vivier, Philippe Mathieu-Daudé,
	qemu-s390x, qemu-arm, qemu-ppc, Paolo Bonzini, Alistair Francis,
	David Gibson, Alex Bennée, Palmer Dabbelt,
	Richard Henderson

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 target/i386/cpu.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 92fafa2659..a84553e50c 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -6778,6 +6778,7 @@ static void x86_cpu_register_feature_bit_props(X86CPU *cpu,
     x86_cpu_register_bit_prop(cpu, name, w, bitnr);
 }
 
+#if !defined(CONFIG_USER_ONLY)
 static GuestPanicInformation *x86_cpu_get_crash_info(CPUState *cs)
 {
     X86CPU *cpu = X86_CPU(cs);
@@ -6821,6 +6822,7 @@ static void x86_cpu_get_crash_info_qom(Object *obj, Visitor *v,
                                      errp);
     qapi_free_GuestPanicInformation(panic_info);
 }
+#endif /* !CONFIG_USER_ONLY */
 
 static void x86_cpu_initfn(Object *obj)
 {
@@ -6866,8 +6868,10 @@ static void x86_cpu_initfn(Object *obj)
                         x86_cpu_get_unavailable_features,
                         NULL, NULL, NULL, &error_abort);
 
+#if !defined(CONFIG_USER_ONLY)
     object_property_add(obj, "crash-information", "GuestPanicInformation",
                         x86_cpu_get_crash_info_qom, NULL, NULL, NULL, NULL);
+#endif
 
     for (w = 0; w < FEATURE_WORDS; w++) {
         int bitnr;
@@ -7180,7 +7184,6 @@ static void x86_cpu_common_class_init(ObjectClass *oc, void *data)
     cc->cpu_exec_interrupt = x86_cpu_exec_interrupt;
 #endif
     cc->dump_state = x86_cpu_dump_state;
-    cc->get_crash_info = x86_cpu_get_crash_info;
     cc->set_pc = x86_cpu_set_pc;
     cc->synchronize_from_tb = x86_cpu_synchronize_from_tb;
     cc->gdb_read_register = x86_cpu_gdb_read_register;
@@ -7191,6 +7194,7 @@ static void x86_cpu_common_class_init(ObjectClass *oc, void *data)
     cc->asidx_from_attrs = x86_asidx_from_attrs;
     cc->get_memory_mapping = x86_cpu_get_memory_mapping;
     cc->get_phys_page_attrs_debug = x86_cpu_get_phys_page_attrs_debug;
+    cc->get_crash_info = x86_cpu_get_crash_info;
     cc->write_elf64_note = x86_cpu_write_elf64_note;
     cc->write_elf64_qemunote = x86_cpu_write_elf64_qemunote;
     cc->write_elf32_note = x86_cpu_write_elf32_note;
-- 
2.21.1



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

* [PATCH 12/14] target/i386: Restrict CpuClass::get_crash_info() to system-mode
@ 2020-03-13 18:36   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 76+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-03-13 18:36 UTC (permalink / raw)
  To: qemu-devel
  Cc: David Hildenbrand, Laurent Vivier, Alistair Francis, qemu-ppc,
	Cornelia Huck, Paolo Bonzini, Alex Bennée, qemu-s390x,
	Bastian Koppelmann, Richard Henderson, David Gibson, qemu-riscv,
	Marcel Apfelbaum, Palmer Dabbelt, qemu-arm, Sagar Karandikar,
	Peter Maydell, Eduardo Habkost, Philippe Mathieu-Daudé

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 target/i386/cpu.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 92fafa2659..a84553e50c 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -6778,6 +6778,7 @@ static void x86_cpu_register_feature_bit_props(X86CPU *cpu,
     x86_cpu_register_bit_prop(cpu, name, w, bitnr);
 }
 
+#if !defined(CONFIG_USER_ONLY)
 static GuestPanicInformation *x86_cpu_get_crash_info(CPUState *cs)
 {
     X86CPU *cpu = X86_CPU(cs);
@@ -6821,6 +6822,7 @@ static void x86_cpu_get_crash_info_qom(Object *obj, Visitor *v,
                                      errp);
     qapi_free_GuestPanicInformation(panic_info);
 }
+#endif /* !CONFIG_USER_ONLY */
 
 static void x86_cpu_initfn(Object *obj)
 {
@@ -6866,8 +6868,10 @@ static void x86_cpu_initfn(Object *obj)
                         x86_cpu_get_unavailable_features,
                         NULL, NULL, NULL, &error_abort);
 
+#if !defined(CONFIG_USER_ONLY)
     object_property_add(obj, "crash-information", "GuestPanicInformation",
                         x86_cpu_get_crash_info_qom, NULL, NULL, NULL, NULL);
+#endif
 
     for (w = 0; w < FEATURE_WORDS; w++) {
         int bitnr;
@@ -7180,7 +7184,6 @@ static void x86_cpu_common_class_init(ObjectClass *oc, void *data)
     cc->cpu_exec_interrupt = x86_cpu_exec_interrupt;
 #endif
     cc->dump_state = x86_cpu_dump_state;
-    cc->get_crash_info = x86_cpu_get_crash_info;
     cc->set_pc = x86_cpu_set_pc;
     cc->synchronize_from_tb = x86_cpu_synchronize_from_tb;
     cc->gdb_read_register = x86_cpu_gdb_read_register;
@@ -7191,6 +7194,7 @@ static void x86_cpu_common_class_init(ObjectClass *oc, void *data)
     cc->asidx_from_attrs = x86_asidx_from_attrs;
     cc->get_memory_mapping = x86_cpu_get_memory_mapping;
     cc->get_phys_page_attrs_debug = x86_cpu_get_phys_page_attrs_debug;
+    cc->get_crash_info = x86_cpu_get_crash_info;
     cc->write_elf64_note = x86_cpu_write_elf64_note;
     cc->write_elf64_qemunote = x86_cpu_write_elf64_qemunote;
     cc->write_elf32_note = x86_cpu_write_elf32_note;
-- 
2.21.1



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

* [PATCH 13/14] target/s390x: Restrict CpuClass::get_crash_info() to system-mode
  2020-03-13 18:36 ` Philippe Mathieu-Daudé
@ 2020-03-13 18:36   ` Philippe Mathieu-Daudé
  -1 siblings, 0 replies; 76+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-03-13 18:36 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, qemu-riscv, Eduardo Habkost, Sagar Karandikar,
	David Hildenbrand, Bastian Koppelmann, Cornelia Huck,
	Laurent Vivier, Philippe Mathieu-Daudé,
	qemu-s390x, qemu-arm, qemu-ppc, Paolo Bonzini, Alistair Francis,
	David Gibson, Alex Bennée, Palmer Dabbelt,
	Richard Henderson

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 target/s390x/cpu.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c
index 3dd396e870..3b1377c20a 100644
--- a/target/s390x/cpu.c
+++ b/target/s390x/cpu.c
@@ -237,6 +237,7 @@ out:
     error_propagate(errp, err);
 }
 
+#if !defined(CONFIG_USER_ONLY)
 static GuestPanicInformation *s390_cpu_get_crash_info(CPUState *cs)
 {
     GuestPanicInformation *panic_info;
@@ -246,11 +247,7 @@ static GuestPanicInformation *s390_cpu_get_crash_info(CPUState *cs)
     panic_info = g_malloc0(sizeof(GuestPanicInformation));
 
     panic_info->type = GUEST_PANIC_INFORMATION_TYPE_S390;
-#if !defined(CONFIG_USER_ONLY)
     panic_info->u.s390.core = cpu->env.core_id;
-#else
-    panic_info->u.s390.core = 0; /* sane default for non system emulation */
-#endif
     panic_info->u.s390.psw_mask = cpu->env.psw.mask;
     panic_info->u.s390.psw_addr = cpu->env.psw.addr;
     panic_info->u.s390.reason = cpu->env.crash_reason;
@@ -276,6 +273,7 @@ static void s390_cpu_get_crash_info_qom(Object *obj, Visitor *v,
                                      errp);
     qapi_free_GuestPanicInformation(panic_info);
 }
+#endif
 
 static void s390_cpu_initfn(Object *obj)
 {
@@ -285,16 +283,16 @@ static void s390_cpu_initfn(Object *obj)
     cpu_set_cpustate_pointers(cpu);
     cs->halted = 1;
     cs->exception_index = EXCP_HLT;
+#if !defined(CONFIG_USER_ONLY)
     object_property_add(obj, "crash-information", "GuestPanicInformation",
                         s390_cpu_get_crash_info_qom, NULL, NULL, NULL, NULL);
-    s390_cpu_model_register_props(obj);
-#if !defined(CONFIG_USER_ONLY)
     cpu->env.tod_timer =
         timer_new_ns(QEMU_CLOCK_VIRTUAL, s390x_tod_timer, cpu);
     cpu->env.cpu_timer =
         timer_new_ns(QEMU_CLOCK_VIRTUAL, s390x_cpu_timer, cpu);
     s390_cpu_set_state(S390_CPU_STATE_STOPPED, cpu);
 #endif
+    s390_cpu_model_register_props(obj);
 }
 
 static void s390_cpu_finalize(Object *obj)
@@ -477,13 +475,13 @@ static void s390_cpu_class_init(ObjectClass *oc, void *data)
     cc->do_interrupt = s390_cpu_do_interrupt;
 #endif
     cc->dump_state = s390_cpu_dump_state;
-    cc->get_crash_info = s390_cpu_get_crash_info;
     cc->set_pc = s390_cpu_set_pc;
     cc->gdb_read_register = s390_cpu_gdb_read_register;
     cc->gdb_write_register = s390_cpu_gdb_write_register;
 #ifndef CONFIG_USER_ONLY
     cc->get_phys_page_debug = s390_cpu_get_phys_page_debug;
     cc->vmsd = &vmstate_s390_cpu;
+    cc->get_crash_info = s390_cpu_get_crash_info;
     cc->write_elf64_note = s390_cpu_write_elf64_note;
 #ifdef CONFIG_TCG
     cc->cpu_exec_interrupt = s390_cpu_exec_interrupt;
-- 
2.21.1



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

* [PATCH 13/14] target/s390x: Restrict CpuClass::get_crash_info() to system-mode
@ 2020-03-13 18:36   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 76+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-03-13 18:36 UTC (permalink / raw)
  To: qemu-devel
  Cc: David Hildenbrand, Laurent Vivier, Alistair Francis, qemu-ppc,
	Cornelia Huck, Paolo Bonzini, Alex Bennée, qemu-s390x,
	Bastian Koppelmann, Richard Henderson, David Gibson, qemu-riscv,
	Marcel Apfelbaum, Palmer Dabbelt, qemu-arm, Sagar Karandikar,
	Peter Maydell, Eduardo Habkost, Philippe Mathieu-Daudé

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 target/s390x/cpu.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c
index 3dd396e870..3b1377c20a 100644
--- a/target/s390x/cpu.c
+++ b/target/s390x/cpu.c
@@ -237,6 +237,7 @@ out:
     error_propagate(errp, err);
 }
 
+#if !defined(CONFIG_USER_ONLY)
 static GuestPanicInformation *s390_cpu_get_crash_info(CPUState *cs)
 {
     GuestPanicInformation *panic_info;
@@ -246,11 +247,7 @@ static GuestPanicInformation *s390_cpu_get_crash_info(CPUState *cs)
     panic_info = g_malloc0(sizeof(GuestPanicInformation));
 
     panic_info->type = GUEST_PANIC_INFORMATION_TYPE_S390;
-#if !defined(CONFIG_USER_ONLY)
     panic_info->u.s390.core = cpu->env.core_id;
-#else
-    panic_info->u.s390.core = 0; /* sane default for non system emulation */
-#endif
     panic_info->u.s390.psw_mask = cpu->env.psw.mask;
     panic_info->u.s390.psw_addr = cpu->env.psw.addr;
     panic_info->u.s390.reason = cpu->env.crash_reason;
@@ -276,6 +273,7 @@ static void s390_cpu_get_crash_info_qom(Object *obj, Visitor *v,
                                      errp);
     qapi_free_GuestPanicInformation(panic_info);
 }
+#endif
 
 static void s390_cpu_initfn(Object *obj)
 {
@@ -285,16 +283,16 @@ static void s390_cpu_initfn(Object *obj)
     cpu_set_cpustate_pointers(cpu);
     cs->halted = 1;
     cs->exception_index = EXCP_HLT;
+#if !defined(CONFIG_USER_ONLY)
     object_property_add(obj, "crash-information", "GuestPanicInformation",
                         s390_cpu_get_crash_info_qom, NULL, NULL, NULL, NULL);
-    s390_cpu_model_register_props(obj);
-#if !defined(CONFIG_USER_ONLY)
     cpu->env.tod_timer =
         timer_new_ns(QEMU_CLOCK_VIRTUAL, s390x_tod_timer, cpu);
     cpu->env.cpu_timer =
         timer_new_ns(QEMU_CLOCK_VIRTUAL, s390x_cpu_timer, cpu);
     s390_cpu_set_state(S390_CPU_STATE_STOPPED, cpu);
 #endif
+    s390_cpu_model_register_props(obj);
 }
 
 static void s390_cpu_finalize(Object *obj)
@@ -477,13 +475,13 @@ static void s390_cpu_class_init(ObjectClass *oc, void *data)
     cc->do_interrupt = s390_cpu_do_interrupt;
 #endif
     cc->dump_state = s390_cpu_dump_state;
-    cc->get_crash_info = s390_cpu_get_crash_info;
     cc->set_pc = s390_cpu_set_pc;
     cc->gdb_read_register = s390_cpu_gdb_read_register;
     cc->gdb_write_register = s390_cpu_gdb_write_register;
 #ifndef CONFIG_USER_ONLY
     cc->get_phys_page_debug = s390_cpu_get_phys_page_debug;
     cc->vmsd = &vmstate_s390_cpu;
+    cc->get_crash_info = s390_cpu_get_crash_info;
     cc->write_elf64_note = s390_cpu_write_elf64_note;
 #ifdef CONFIG_TCG
     cc->cpu_exec_interrupt = s390_cpu_exec_interrupt;
-- 
2.21.1



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

* [PATCH 14/14] hw/core: Restrict CpuClass::get_crash_info() to system-mode
  2020-03-13 18:36 ` Philippe Mathieu-Daudé
@ 2020-03-13 18:36   ` Philippe Mathieu-Daudé
  -1 siblings, 0 replies; 76+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-03-13 18:36 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, qemu-riscv, Eduardo Habkost, Sagar Karandikar,
	David Hildenbrand, Bastian Koppelmann, Cornelia Huck,
	Laurent Vivier, Philippe Mathieu-Daudé,
	qemu-s390x, qemu-arm, qemu-ppc, Paolo Bonzini, Alistair Francis,
	David Gibson, Alex Bennée, Palmer Dabbelt,
	Richard Henderson

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 include/hw/core/cpu.h | 7 ++++++-
 hw/core/cpu.c         | 2 ++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h
index 73e9a869a4..48ab5ec3ed 100644
--- a/include/hw/core/cpu.h
+++ b/include/hw/core/cpu.h
@@ -492,6 +492,8 @@ bool cpu_paging_enabled(const CPUState *cpu);
 void cpu_get_memory_mapping(CPUState *cpu, MemoryMappingList *list,
                             Error **errp);
 
+#if !defined(CONFIG_USER_ONLY)
+
 /**
  * cpu_write_elf64_note:
  * @f: pointer to a function that writes memory to a file
@@ -541,6 +543,8 @@ int cpu_write_elf32_qemunote(WriteCoreDumpFunction f, CPUState *cpu,
  */
 GuestPanicInformation *cpu_get_crash_info(CPUState *cpu);
 
+#endif /* !CONFIG_USER_ONLY */
+
 /**
  * CPUDumpFlags:
  * @CPU_DUMP_CODE:
@@ -634,7 +638,8 @@ static inline int cpu_asidx_from_attrs(CPUState *cpu, MemTxAttrs attrs)
     }
     return ret;
 }
-#endif
+
+#endif /* CONFIG_USER_ONLY */
 
 /**
  * cpu_list_add:
diff --git a/hw/core/cpu.c b/hw/core/cpu.c
index fe65ca62ac..debdd7e670 100644
--- a/hw/core/cpu.c
+++ b/hw/core/cpu.c
@@ -209,6 +209,7 @@ static bool cpu_common_exec_interrupt(CPUState *cpu, int int_req)
     return false;
 }
 
+#if !defined(CONFIG_USER_ONLY)
 GuestPanicInformation *cpu_get_crash_info(CPUState *cpu)
 {
     CPUClass *cc = CPU_GET_CLASS(cpu);
@@ -219,6 +220,7 @@ GuestPanicInformation *cpu_get_crash_info(CPUState *cpu)
     }
     return res;
 }
+#endif
 
 void cpu_dump_state(CPUState *cpu, FILE *f, int flags)
 {
-- 
2.21.1



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

* [PATCH 14/14] hw/core: Restrict CpuClass::get_crash_info() to system-mode
@ 2020-03-13 18:36   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 76+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-03-13 18:36 UTC (permalink / raw)
  To: qemu-devel
  Cc: David Hildenbrand, Laurent Vivier, Alistair Francis, qemu-ppc,
	Cornelia Huck, Paolo Bonzini, Alex Bennée, qemu-s390x,
	Bastian Koppelmann, Richard Henderson, David Gibson, qemu-riscv,
	Marcel Apfelbaum, Palmer Dabbelt, qemu-arm, Sagar Karandikar,
	Peter Maydell, Eduardo Habkost, Philippe Mathieu-Daudé

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 include/hw/core/cpu.h | 7 ++++++-
 hw/core/cpu.c         | 2 ++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h
index 73e9a869a4..48ab5ec3ed 100644
--- a/include/hw/core/cpu.h
+++ b/include/hw/core/cpu.h
@@ -492,6 +492,8 @@ bool cpu_paging_enabled(const CPUState *cpu);
 void cpu_get_memory_mapping(CPUState *cpu, MemoryMappingList *list,
                             Error **errp);
 
+#if !defined(CONFIG_USER_ONLY)
+
 /**
  * cpu_write_elf64_note:
  * @f: pointer to a function that writes memory to a file
@@ -541,6 +543,8 @@ int cpu_write_elf32_qemunote(WriteCoreDumpFunction f, CPUState *cpu,
  */
 GuestPanicInformation *cpu_get_crash_info(CPUState *cpu);
 
+#endif /* !CONFIG_USER_ONLY */
+
 /**
  * CPUDumpFlags:
  * @CPU_DUMP_CODE:
@@ -634,7 +638,8 @@ static inline int cpu_asidx_from_attrs(CPUState *cpu, MemTxAttrs attrs)
     }
     return ret;
 }
-#endif
+
+#endif /* CONFIG_USER_ONLY */
 
 /**
  * cpu_list_add:
diff --git a/hw/core/cpu.c b/hw/core/cpu.c
index fe65ca62ac..debdd7e670 100644
--- a/hw/core/cpu.c
+++ b/hw/core/cpu.c
@@ -209,6 +209,7 @@ static bool cpu_common_exec_interrupt(CPUState *cpu, int int_req)
     return false;
 }
 
+#if !defined(CONFIG_USER_ONLY)
 GuestPanicInformation *cpu_get_crash_info(CPUState *cpu)
 {
     CPUClass *cc = CPU_GET_CLASS(cpu);
@@ -219,6 +220,7 @@ GuestPanicInformation *cpu_get_crash_info(CPUState *cpu)
     }
     return res;
 }
+#endif
 
 void cpu_dump_state(CPUState *cpu, FILE *f, int flags)
 {
-- 
2.21.1



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

* Re: [PATCH 03/14] tests/Makefile: Only display TCG-related tests when TCG is available
  2020-03-13 18:36   ` Philippe Mathieu-Daudé
@ 2020-03-13 19:45     ` Alistair Francis
  -1 siblings, 0 replies; 76+ messages in thread
From: Alistair Francis @ 2020-03-13 19:45 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Peter Maydell, Alistair Francis, open list:RISC-V,
	Eduardo Habkost, Sagar Karandikar, David Hildenbrand,
	Bastian Koppelmann, Cornelia Huck,
	qemu-devel@nongnu.org Developers, Laurent Vivier, qemu-s390x,
	qemu-arm, open list:New World, Paolo Bonzini, Richard Henderson,
	Alex Bennée, Palmer Dabbelt, David Gibson

On Fri, Mar 13, 2020 at 11:39 AM Philippe Mathieu-Daudé
<philmd@redhat.com> wrote:
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  tests/Makefile.include | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/tests/Makefile.include b/tests/Makefile.include
> index 67e8fcddda..99db5eb3e0 100644
> --- a/tests/Makefile.include
> +++ b/tests/Makefile.include
> @@ -12,8 +12,10 @@ check-help:
>         @echo " $(MAKE) check-speed          Run qobject speed tests"
>         @echo " $(MAKE) check-qapi-schema    Run QAPI schema tests"
>         @echo " $(MAKE) check-block          Run block tests"
> +ifeq ($(CONFIG_TCG),y)
>         @echo " $(MAKE) check-tcg            Run TCG tests"
>         @echo " $(MAKE) check-softfloat      Run FPU emulation tests"
> +endif
>         @echo " $(MAKE) check-acceptance     Run all acceptance (functional) tests"
>         @echo
>         @echo " $(MAKE) check-report.tap     Generates an aggregated TAP test report"
> --
> 2.21.1
>
>


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

* Re: [PATCH 03/14] tests/Makefile: Only display TCG-related tests when TCG is available
@ 2020-03-13 19:45     ` Alistair Francis
  0 siblings, 0 replies; 76+ messages in thread
From: Alistair Francis @ 2020-03-13 19:45 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel@nongnu.org Developers, Peter Maydell,
	open list:RISC-V, Eduardo Habkost, Sagar Karandikar,
	David Hildenbrand, Bastian Koppelmann, Cornelia Huck,
	Laurent Vivier, qemu-s390x, qemu-arm, open list:New World,
	Paolo Bonzini, Alistair Francis, David Gibson, Alex Bennée,
	Palmer Dabbelt, Richard Henderson

On Fri, Mar 13, 2020 at 11:39 AM Philippe Mathieu-Daudé
<philmd@redhat.com> wrote:
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  tests/Makefile.include | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/tests/Makefile.include b/tests/Makefile.include
> index 67e8fcddda..99db5eb3e0 100644
> --- a/tests/Makefile.include
> +++ b/tests/Makefile.include
> @@ -12,8 +12,10 @@ check-help:
>         @echo " $(MAKE) check-speed          Run qobject speed tests"
>         @echo " $(MAKE) check-qapi-schema    Run QAPI schema tests"
>         @echo " $(MAKE) check-block          Run block tests"
> +ifeq ($(CONFIG_TCG),y)
>         @echo " $(MAKE) check-tcg            Run TCG tests"
>         @echo " $(MAKE) check-softfloat      Run FPU emulation tests"
> +endif
>         @echo " $(MAKE) check-acceptance     Run all acceptance (functional) tests"
>         @echo
>         @echo " $(MAKE) check-report.tap     Generates an aggregated TAP test report"
> --
> 2.21.1
>
>


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

* Re: [PATCH 07/14] target/riscv/cpu: Restrict CPU migration to system-mode
  2020-03-13 18:36   ` Philippe Mathieu-Daudé
@ 2020-03-13 20:01     ` Alistair Francis
  -1 siblings, 0 replies; 76+ messages in thread
From: Alistair Francis @ 2020-03-13 20:01 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Peter Maydell, Alistair Francis, open list:RISC-V,
	Eduardo Habkost, Sagar Karandikar, David Hildenbrand,
	Bastian Koppelmann, Cornelia Huck,
	qemu-devel@nongnu.org Developers, Laurent Vivier, qemu-s390x,
	qemu-arm, open list:New World, Paolo Bonzini, Richard Henderson,
	Alex Bennée, Palmer Dabbelt, David Gibson

On Fri, Mar 13, 2020 at 11:39 AM Philippe Mathieu-Daudé
<philmd@redhat.com> wrote:
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  target/riscv/cpu.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
> index c0b7023100..b59e09209e 100644
> --- a/target/riscv/cpu.c
> +++ b/target/riscv/cpu.c
> @@ -475,10 +475,12 @@ static void riscv_cpu_init(Object *obj)
>      cpu_set_cpustate_pointers(cpu);
>  }
>
> +#ifndef CONFIG_USER_ONLY
>  static const VMStateDescription vmstate_riscv_cpu = {
>      .name = "cpu",
>      .unmigratable = 1,
>  };
> +#endif
>
>  static Property riscv_cpu_properties[] = {
>      DEFINE_PROP_BOOL("i", RISCVCPU, cfg.ext_i, true),
> @@ -534,13 +536,13 @@ static void riscv_cpu_class_init(ObjectClass *c, void *data)
>      cc->do_transaction_failed = riscv_cpu_do_transaction_failed;
>      cc->do_unaligned_access = riscv_cpu_do_unaligned_access;
>      cc->get_phys_page_debug = riscv_cpu_get_phys_page_debug;
> +    /* For now, mark unmigratable: */
> +    cc->vmsd = &vmstate_riscv_cpu;
>  #endif
>  #ifdef CONFIG_TCG
>      cc->tcg_initialize = riscv_translate_init;
>      cc->tlb_fill = riscv_cpu_tlb_fill;
>  #endif
> -    /* For now, mark unmigratable: */
> -    cc->vmsd = &vmstate_riscv_cpu;
>      device_class_set_props(dc, riscv_cpu_properties);
>  }
>
> --
> 2.21.1
>
>


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

* Re: [PATCH 07/14] target/riscv/cpu: Restrict CPU migration to system-mode
@ 2020-03-13 20:01     ` Alistair Francis
  0 siblings, 0 replies; 76+ messages in thread
From: Alistair Francis @ 2020-03-13 20:01 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel@nongnu.org Developers, Peter Maydell,
	open list:RISC-V, Eduardo Habkost, Sagar Karandikar,
	David Hildenbrand, Bastian Koppelmann, Cornelia Huck,
	Laurent Vivier, qemu-s390x, qemu-arm, open list:New World,
	Paolo Bonzini, Alistair Francis, David Gibson, Alex Bennée,
	Palmer Dabbelt, Richard Henderson

On Fri, Mar 13, 2020 at 11:39 AM Philippe Mathieu-Daudé
<philmd@redhat.com> wrote:
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  target/riscv/cpu.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
> index c0b7023100..b59e09209e 100644
> --- a/target/riscv/cpu.c
> +++ b/target/riscv/cpu.c
> @@ -475,10 +475,12 @@ static void riscv_cpu_init(Object *obj)
>      cpu_set_cpustate_pointers(cpu);
>  }
>
> +#ifndef CONFIG_USER_ONLY
>  static const VMStateDescription vmstate_riscv_cpu = {
>      .name = "cpu",
>      .unmigratable = 1,
>  };
> +#endif
>
>  static Property riscv_cpu_properties[] = {
>      DEFINE_PROP_BOOL("i", RISCVCPU, cfg.ext_i, true),
> @@ -534,13 +536,13 @@ static void riscv_cpu_class_init(ObjectClass *c, void *data)
>      cc->do_transaction_failed = riscv_cpu_do_transaction_failed;
>      cc->do_unaligned_access = riscv_cpu_do_unaligned_access;
>      cc->get_phys_page_debug = riscv_cpu_get_phys_page_debug;
> +    /* For now, mark unmigratable: */
> +    cc->vmsd = &vmstate_riscv_cpu;
>  #endif
>  #ifdef CONFIG_TCG
>      cc->tcg_initialize = riscv_translate_init;
>      cc->tlb_fill = riscv_cpu_tlb_fill;
>  #endif
> -    /* For now, mark unmigratable: */
> -    cc->vmsd = &vmstate_riscv_cpu;
>      device_class_set_props(dc, riscv_cpu_properties);
>  }
>
> --
> 2.21.1
>
>


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

* Re: [PATCH 09/14] exec: Drop redundant #ifdeffery
  2020-03-13 18:36   ` Philippe Mathieu-Daudé
@ 2020-03-13 20:02     ` Alistair Francis
  -1 siblings, 0 replies; 76+ messages in thread
From: Alistair Francis @ 2020-03-13 20:02 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Peter Maydell, Alistair Francis, open list:RISC-V,
	Eduardo Habkost, Sagar Karandikar, David Hildenbrand,
	Bastian Koppelmann, Cornelia Huck,
	qemu-devel@nongnu.org Developers, Laurent Vivier, qemu-s390x,
	qemu-arm, open list:New World, Paolo Bonzini, Richard Henderson,
	Alex Bennée, Palmer Dabbelt, David Gibson

On Fri, Mar 13, 2020 at 11:38 AM Philippe Mathieu-Daudé
<philmd@redhat.com> wrote:
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  exec.c | 4 ----
>  1 file changed, 4 deletions(-)
>
> diff --git a/exec.c b/exec.c
> index 7bc9828c5b..f258502966 100644
> --- a/exec.c
> +++ b/exec.c
> @@ -185,10 +185,6 @@ struct DirtyBitmapSnapshot {
>      unsigned long dirty[];
>  };
>
> -#endif
> -
> -#if !defined(CONFIG_USER_ONLY)
> -
>  static void phys_map_node_reserve(PhysPageMap *map, unsigned nodes)
>  {
>      static unsigned alloc_hint = 16;
> --
> 2.21.1
>
>


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

* Re: [PATCH 09/14] exec: Drop redundant #ifdeffery
@ 2020-03-13 20:02     ` Alistair Francis
  0 siblings, 0 replies; 76+ messages in thread
From: Alistair Francis @ 2020-03-13 20:02 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel@nongnu.org Developers, Peter Maydell,
	open list:RISC-V, Eduardo Habkost, Sagar Karandikar,
	David Hildenbrand, Bastian Koppelmann, Cornelia Huck,
	Laurent Vivier, qemu-s390x, qemu-arm, open list:New World,
	Paolo Bonzini, Alistair Francis, David Gibson, Alex Bennée,
	Palmer Dabbelt, Richard Henderson

On Fri, Mar 13, 2020 at 11:38 AM Philippe Mathieu-Daudé
<philmd@redhat.com> wrote:
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  exec.c | 4 ----
>  1 file changed, 4 deletions(-)
>
> diff --git a/exec.c b/exec.c
> index 7bc9828c5b..f258502966 100644
> --- a/exec.c
> +++ b/exec.c
> @@ -185,10 +185,6 @@ struct DirtyBitmapSnapshot {
>      unsigned long dirty[];
>  };
>
> -#endif
> -
> -#if !defined(CONFIG_USER_ONLY)
> -
>  static void phys_map_node_reserve(PhysPageMap *map, unsigned nodes)
>  {
>      static unsigned alloc_hint = 16;
> --
> 2.21.1
>
>


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

* Re: [PATCH 10/14] arch_init: Remove unused 'qapi-commands-misc.h' include
  2020-03-13 18:36   ` Philippe Mathieu-Daudé
@ 2020-03-13 20:02     ` Alistair Francis
  -1 siblings, 0 replies; 76+ messages in thread
From: Alistair Francis @ 2020-03-13 20:02 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Peter Maydell, Alistair Francis, open list:RISC-V,
	Eduardo Habkost, Sagar Karandikar, David Hildenbrand,
	Bastian Koppelmann, Cornelia Huck,
	qemu-devel@nongnu.org Developers, Laurent Vivier, qemu-s390x,
	qemu-arm, open list:New World, Paolo Bonzini, Richard Henderson,
	Alex Bennée, Palmer Dabbelt, David Gibson

On Fri, Mar 13, 2020 at 11:44 AM Philippe Mathieu-Daudé
<philmd@redhat.com> wrote:
>
> Commit ffaee83bcb2 moved qmp_query_target but forgot to remove
> this include.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  arch_init.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/arch_init.c b/arch_init.c
> index 705d0b94ad..074fa621b6 100644
> --- a/arch_init.c
> +++ b/arch_init.c
> @@ -27,7 +27,6 @@
>  #include "sysemu/arch_init.h"
>  #include "hw/pci/pci.h"
>  #include "hw/audio/soundhw.h"
> -#include "qapi/qapi-commands-misc.h"
>  #include "qapi/error.h"
>  #include "qemu/config-file.h"
>  #include "qemu/error-report.h"
> --
> 2.21.1
>
>


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

* Re: [PATCH 10/14] arch_init: Remove unused 'qapi-commands-misc.h' include
@ 2020-03-13 20:02     ` Alistair Francis
  0 siblings, 0 replies; 76+ messages in thread
From: Alistair Francis @ 2020-03-13 20:02 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel@nongnu.org Developers, Peter Maydell,
	open list:RISC-V, Eduardo Habkost, Sagar Karandikar,
	David Hildenbrand, Bastian Koppelmann, Cornelia Huck,
	Laurent Vivier, qemu-s390x, qemu-arm, open list:New World,
	Paolo Bonzini, Alistair Francis, David Gibson, Alex Bennée,
	Palmer Dabbelt, Richard Henderson

On Fri, Mar 13, 2020 at 11:44 AM Philippe Mathieu-Daudé
<philmd@redhat.com> wrote:
>
> Commit ffaee83bcb2 moved qmp_query_target but forgot to remove
> this include.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  arch_init.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/arch_init.c b/arch_init.c
> index 705d0b94ad..074fa621b6 100644
> --- a/arch_init.c
> +++ b/arch_init.c
> @@ -27,7 +27,6 @@
>  #include "sysemu/arch_init.h"
>  #include "hw/pci/pci.h"
>  #include "hw/audio/soundhw.h"
> -#include "qapi/qapi-commands-misc.h"
>  #include "qapi/error.h"
>  #include "qemu/config-file.h"
>  #include "qemu/error-report.h"
> --
> 2.21.1
>
>


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

* Re: [PATCH 01/14] Makefile: Only build virtiofsd if system-mode is enabled
  2020-03-13 18:36   ` Philippe Mathieu-Daudé
@ 2020-03-13 22:28     ` Laurent Vivier
  -1 siblings, 0 replies; 76+ messages in thread
From: Laurent Vivier @ 2020-03-13 22:28 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Peter Maydell, qemu-riscv, Eduardo Habkost, Sagar Karandikar,
	David Hildenbrand, Bastian Koppelmann, Cornelia Huck, qemu-s390x,
	qemu-arm, qemu-ppc, Paolo Bonzini, Alistair Francis,
	David Gibson, Alex Bennée, Palmer Dabbelt,
	Richard Henderson

Le 13/03/2020 à 19:36, Philippe Mathieu-Daudé a écrit :
> Do not build the virtiofsd helper when configured with
> --disable-system.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  Makefile | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 7df22fcc5d..ed77b6e50b 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -346,8 +346,8 @@ vhost-user-json-y += contrib/vhost-user-gpu/50-qemu-gpu.json
>  endif
>  
>  ifeq ($(CONFIG_LINUX)$(CONFIG_SECCOMP)$(CONFIG_LIBCAP_NG),yyy)
> -HELPERS-y += virtiofsd$(EXESUF)
> -vhost-user-json-y += tools/virtiofsd/50-qemu-virtiofsd.json
> +HELPERS-$(CONFIG_SOFTMMU) += virtiofsd$(EXESUF)
> +vhost-user-json-$(CONFIG_SOFTMMU) += tools/virtiofsd/50-qemu-virtiofsd.json
>  endif
>  
>  # Sphinx does not allow building manuals into the same directory as
> 

Why don't you do that instead?

  ifeq
($(CONFIG_LINUX)$(CONFIG_SECCOMP)$(CONFIG_LIBCAP_NG)$(CONFIG_SOFTMMU),yyyy)

Thanks,
Laurent


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

* Re: [PATCH 01/14] Makefile: Only build virtiofsd if system-mode is enabled
@ 2020-03-13 22:28     ` Laurent Vivier
  0 siblings, 0 replies; 76+ messages in thread
From: Laurent Vivier @ 2020-03-13 22:28 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: David Hildenbrand, Alistair Francis, qemu-ppc, Cornelia Huck,
	Paolo Bonzini, Alex Bennée, qemu-s390x, Bastian Koppelmann,
	Richard Henderson, David Gibson, qemu-riscv, Marcel Apfelbaum,
	Palmer Dabbelt, qemu-arm, Sagar Karandikar, Peter Maydell,
	Eduardo Habkost

Le 13/03/2020 à 19:36, Philippe Mathieu-Daudé a écrit :
> Do not build the virtiofsd helper when configured with
> --disable-system.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  Makefile | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 7df22fcc5d..ed77b6e50b 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -346,8 +346,8 @@ vhost-user-json-y += contrib/vhost-user-gpu/50-qemu-gpu.json
>  endif
>  
>  ifeq ($(CONFIG_LINUX)$(CONFIG_SECCOMP)$(CONFIG_LIBCAP_NG),yyy)
> -HELPERS-y += virtiofsd$(EXESUF)
> -vhost-user-json-y += tools/virtiofsd/50-qemu-virtiofsd.json
> +HELPERS-$(CONFIG_SOFTMMU) += virtiofsd$(EXESUF)
> +vhost-user-json-$(CONFIG_SOFTMMU) += tools/virtiofsd/50-qemu-virtiofsd.json
>  endif
>  
>  # Sphinx does not allow building manuals into the same directory as
> 

Why don't you do that instead?

  ifeq
($(CONFIG_LINUX)$(CONFIG_SECCOMP)$(CONFIG_LIBCAP_NG)$(CONFIG_SOFTMMU),yyyy)

Thanks,
Laurent


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

* Re: [PATCH 02/14] configure: Avoid building TCG when not needed
  2020-03-13 18:36   ` Philippe Mathieu-Daudé
@ 2020-03-15 18:56     ` Richard Henderson
  -1 siblings, 0 replies; 76+ messages in thread
From: Richard Henderson @ 2020-03-15 18:56 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Peter Maydell, Alistair Francis, qemu-riscv, Eduardo Habkost,
	Sagar Karandikar, David Hildenbrand, Bastian Koppelmann,
	Cornelia Huck, Laurent Vivier, qemu-s390x, qemu-arm, qemu-ppc,
	Paolo Bonzini, Richard Henderson, Alex Bennée,
	Palmer Dabbelt, David Gibson

On 3/13/20 11:36 AM, Philippe Mathieu-Daudé wrote:
> Avoid building TCG when building only tools:
> 
>   ./configure --enable-tools --disable-system --disable-user
> 
> This saves us from running the soft-float tests enabled since
> commit 76170102508.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  configure | 4 ++++
>  1 file changed, 4 insertions(+)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~



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

* Re: [PATCH 02/14] configure: Avoid building TCG when not needed
@ 2020-03-15 18:56     ` Richard Henderson
  0 siblings, 0 replies; 76+ messages in thread
From: Richard Henderson @ 2020-03-15 18:56 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Peter Maydell, qemu-riscv, Eduardo Habkost, Sagar Karandikar,
	David Hildenbrand, Bastian Koppelmann, Cornelia Huck,
	Laurent Vivier, qemu-s390x, qemu-arm, qemu-ppc, Paolo Bonzini,
	Alistair Francis, David Gibson, Alex Bennée, Palmer Dabbelt,
	Richard Henderson

On 3/13/20 11:36 AM, Philippe Mathieu-Daudé wrote:
> Avoid building TCG when building only tools:
> 
>   ./configure --enable-tools --disable-system --disable-user
> 
> This saves us from running the soft-float tests enabled since
> commit 76170102508.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  configure | 4 ++++
>  1 file changed, 4 insertions(+)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~



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

* Re: [PATCH 03/14] tests/Makefile: Only display TCG-related tests when TCG is available
  2020-03-13 18:36   ` Philippe Mathieu-Daudé
@ 2020-03-15 18:57     ` Richard Henderson
  -1 siblings, 0 replies; 76+ messages in thread
From: Richard Henderson @ 2020-03-15 18:57 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Peter Maydell, Alistair Francis, qemu-riscv, Eduardo Habkost,
	Sagar Karandikar, David Hildenbrand, Bastian Koppelmann,
	Cornelia Huck, Laurent Vivier, qemu-s390x, qemu-arm, qemu-ppc,
	Paolo Bonzini, Richard Henderson, Alex Bennée,
	Palmer Dabbelt, David Gibson

On 3/13/20 11:36 AM, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  tests/Makefile.include | 2 ++
>  1 file changed, 2 insertions(+)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~



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

* Re: [PATCH 03/14] tests/Makefile: Only display TCG-related tests when TCG is available
@ 2020-03-15 18:57     ` Richard Henderson
  0 siblings, 0 replies; 76+ messages in thread
From: Richard Henderson @ 2020-03-15 18:57 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Peter Maydell, qemu-riscv, Eduardo Habkost, Sagar Karandikar,
	David Hildenbrand, Bastian Koppelmann, Cornelia Huck,
	Laurent Vivier, qemu-s390x, qemu-arm, qemu-ppc, Paolo Bonzini,
	Alistair Francis, David Gibson, Alex Bennée, Palmer Dabbelt,
	Richard Henderson

On 3/13/20 11:36 AM, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  tests/Makefile.include | 2 ++
>  1 file changed, 2 insertions(+)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~



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

* Re: [PATCH 01/14] Makefile: Only build virtiofsd if system-mode is enabled
  2020-03-13 22:28     ` Laurent Vivier
@ 2020-03-15 19:40       ` Richard Henderson
  -1 siblings, 0 replies; 76+ messages in thread
From: Richard Henderson @ 2020-03-15 19:40 UTC (permalink / raw)
  To: Laurent Vivier, Philippe Mathieu-Daudé, qemu-devel
  Cc: Peter Maydell, Alistair Francis, qemu-riscv, Eduardo Habkost,
	Sagar Karandikar, David Hildenbrand, Bastian Koppelmann,
	Cornelia Huck, qemu-s390x, qemu-arm, qemu-ppc, Paolo Bonzini,
	Richard Henderson, Alex Bennée, Palmer Dabbelt,
	David Gibson

On 3/13/20 3:28 PM, Laurent Vivier wrote:
>>  ifeq ($(CONFIG_LINUX)$(CONFIG_SECCOMP)$(CONFIG_LIBCAP_NG),yyy)
>> -HELPERS-y += virtiofsd$(EXESUF)
>> -vhost-user-json-y += tools/virtiofsd/50-qemu-virtiofsd.json
>> +HELPERS-$(CONFIG_SOFTMMU) += virtiofsd$(EXESUF)
>> +vhost-user-json-$(CONFIG_SOFTMMU) += tools/virtiofsd/50-qemu-virtiofsd.json
...
> 
> Why don't you do that instead?
> 
>   ifeq
> ($(CONFIG_LINUX)$(CONFIG_SECCOMP)$(CONFIG_LIBCAP_NG)$(CONFIG_SOFTMMU),yyyy)

Seconded.

r~


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

* Re: [PATCH 01/14] Makefile: Only build virtiofsd if system-mode is enabled
@ 2020-03-15 19:40       ` Richard Henderson
  0 siblings, 0 replies; 76+ messages in thread
From: Richard Henderson @ 2020-03-15 19:40 UTC (permalink / raw)
  To: Laurent Vivier, Philippe Mathieu-Daudé, qemu-devel
  Cc: Peter Maydell, qemu-riscv, Eduardo Habkost, Sagar Karandikar,
	David Hildenbrand, Bastian Koppelmann, Cornelia Huck, qemu-s390x,
	qemu-arm, qemu-ppc, Paolo Bonzini, Alistair Francis,
	David Gibson, Alex Bennée, Palmer Dabbelt,
	Richard Henderson

On 3/13/20 3:28 PM, Laurent Vivier wrote:
>>  ifeq ($(CONFIG_LINUX)$(CONFIG_SECCOMP)$(CONFIG_LIBCAP_NG),yyy)
>> -HELPERS-y += virtiofsd$(EXESUF)
>> -vhost-user-json-y += tools/virtiofsd/50-qemu-virtiofsd.json
>> +HELPERS-$(CONFIG_SOFTMMU) += virtiofsd$(EXESUF)
>> +vhost-user-json-$(CONFIG_SOFTMMU) += tools/virtiofsd/50-qemu-virtiofsd.json
...
> 
> Why don't you do that instead?
> 
>   ifeq
> ($(CONFIG_LINUX)$(CONFIG_SECCOMP)$(CONFIG_LIBCAP_NG)$(CONFIG_SOFTMMU),yyyy)

Seconded.

r~


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

* Re: [PATCH 04/14] tests/Makefile: Restrict some softmmu-only tests
  2020-03-13 18:36   ` Philippe Mathieu-Daudé
@ 2020-03-15 20:07     ` Richard Henderson
  -1 siblings, 0 replies; 76+ messages in thread
From: Richard Henderson @ 2020-03-15 20:07 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Peter Maydell, Alistair Francis, qemu-riscv, Eduardo Habkost,
	Sagar Karandikar, David Hildenbrand, Bastian Koppelmann,
	Cornelia Huck, Laurent Vivier, qemu-s390x, qemu-arm, qemu-ppc,
	Paolo Bonzini, Richard Henderson, Alex Bennée,
	Palmer Dabbelt, David Gibson

On 3/13/20 11:36 AM, Philippe Mathieu-Daudé wrote:
> These tests fails when configured with --disable-system.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  tests/Makefile.include | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)

So... they don't currently fail check-unit.  Did you mean to say that they
*will* fail once other files are disabled?


r~


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

* Re: [PATCH 04/14] tests/Makefile: Restrict some softmmu-only tests
@ 2020-03-15 20:07     ` Richard Henderson
  0 siblings, 0 replies; 76+ messages in thread
From: Richard Henderson @ 2020-03-15 20:07 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Peter Maydell, qemu-riscv, Eduardo Habkost, Sagar Karandikar,
	David Hildenbrand, Bastian Koppelmann, Cornelia Huck,
	Laurent Vivier, qemu-s390x, qemu-arm, qemu-ppc, Paolo Bonzini,
	Alistair Francis, David Gibson, Alex Bennée, Palmer Dabbelt,
	Richard Henderson

On 3/13/20 11:36 AM, Philippe Mathieu-Daudé wrote:
> These tests fails when configured with --disable-system.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  tests/Makefile.include | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)

So... they don't currently fail check-unit.  Did you mean to say that they
*will* fail once other files are disabled?


r~


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

* Re: [PATCH 04/14] tests/Makefile: Restrict some softmmu-only tests
  2020-03-15 20:07     ` Richard Henderson
@ 2020-03-15 20:17       ` Richard Henderson
  -1 siblings, 0 replies; 76+ messages in thread
From: Richard Henderson @ 2020-03-15 20:17 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Peter Maydell, Alistair Francis, qemu-riscv, Eduardo Habkost,
	Sagar Karandikar, David Hildenbrand, Bastian Koppelmann,
	Cornelia Huck, Laurent Vivier, qemu-s390x, qemu-arm, qemu-ppc,
	Paolo Bonzini, Richard Henderson, Alex Bennée,
	Palmer Dabbelt, David Gibson

On 3/15/20 1:07 PM, Richard Henderson wrote:
> On 3/13/20 11:36 AM, Philippe Mathieu-Daudé wrote:
>> These tests fails when configured with --disable-system.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>> ---
>>  tests/Makefile.include | 16 ++++++++--------
>>  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> So... they don't currently fail check-unit.  Did you mean to say that they
> *will* fail once other files are disabled?

Ah yes.  I've rebased your patchset without this one and it does fail.  So with
a re-worded commit message,

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Tested-by: Richard Henderson <richard.henderson@linaro.org>


r~



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

* Re: [PATCH 04/14] tests/Makefile: Restrict some softmmu-only tests
@ 2020-03-15 20:17       ` Richard Henderson
  0 siblings, 0 replies; 76+ messages in thread
From: Richard Henderson @ 2020-03-15 20:17 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Peter Maydell, qemu-riscv, Eduardo Habkost, Sagar Karandikar,
	David Hildenbrand, Bastian Koppelmann, Cornelia Huck,
	Laurent Vivier, qemu-s390x, qemu-arm, qemu-ppc, Paolo Bonzini,
	Alistair Francis, David Gibson, Alex Bennée, Palmer Dabbelt,
	Richard Henderson

On 3/15/20 1:07 PM, Richard Henderson wrote:
> On 3/13/20 11:36 AM, Philippe Mathieu-Daudé wrote:
>> These tests fails when configured with --disable-system.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>> ---
>>  tests/Makefile.include | 16 ++++++++--------
>>  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> So... they don't currently fail check-unit.  Did you mean to say that they
> *will* fail once other files are disabled?

Ah yes.  I've rebased your patchset without this one and it does fail.  So with
a re-worded commit message,

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Tested-by: Richard Henderson <richard.henderson@linaro.org>


r~



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

* Re: [PATCH 05/14] stubs/Makefile: Reduce the user-mode object list
  2020-03-13 18:36   ` Philippe Mathieu-Daudé
@ 2020-03-15 20:17     ` Richard Henderson
  -1 siblings, 0 replies; 76+ messages in thread
From: Richard Henderson @ 2020-03-15 20:17 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Peter Maydell, Alistair Francis, qemu-riscv, Eduardo Habkost,
	Sagar Karandikar, David Hildenbrand, Bastian Koppelmann,
	Cornelia Huck, Laurent Vivier, qemu-s390x, qemu-arm, qemu-ppc,
	Paolo Bonzini, Richard Henderson, Alex Bennée,
	Palmer Dabbelt, David Gibson

On 3/13/20 11:36 AM, Philippe Mathieu-Daudé wrote:
> These stubs are not required when configured with --disable-system.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  stubs/Makefile.objs | 52 ++++++++++++++++++++++++++-------------------
>  1 file changed, 30 insertions(+), 22 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~


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

* Re: [PATCH 05/14] stubs/Makefile: Reduce the user-mode object list
@ 2020-03-15 20:17     ` Richard Henderson
  0 siblings, 0 replies; 76+ messages in thread
From: Richard Henderson @ 2020-03-15 20:17 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Peter Maydell, qemu-riscv, Eduardo Habkost, Sagar Karandikar,
	David Hildenbrand, Bastian Koppelmann, Cornelia Huck,
	Laurent Vivier, qemu-s390x, qemu-arm, qemu-ppc, Paolo Bonzini,
	Alistair Francis, David Gibson, Alex Bennée, Palmer Dabbelt,
	Richard Henderson

On 3/13/20 11:36 AM, Philippe Mathieu-Daudé wrote:
> These stubs are not required when configured with --disable-system.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  stubs/Makefile.objs | 52 ++++++++++++++++++++++++++-------------------
>  1 file changed, 30 insertions(+), 22 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~


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

* Re: [PATCH 06/14] util/Makefile: Reduce the user-mode object list
  2020-03-13 18:36   ` Philippe Mathieu-Daudé
@ 2020-03-15 20:18     ` Richard Henderson
  -1 siblings, 0 replies; 76+ messages in thread
From: Richard Henderson @ 2020-03-15 20:18 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Peter Maydell, Alistair Francis, qemu-riscv, Eduardo Habkost,
	Sagar Karandikar, David Hildenbrand, Bastian Koppelmann,
	Cornelia Huck, Laurent Vivier, qemu-s390x, qemu-arm, qemu-ppc,
	Paolo Bonzini, Richard Henderson, Alex Bennée,
	Palmer Dabbelt, David Gibson

On 3/13/20 11:36 AM, Philippe Mathieu-Daudé wrote:
> These stubs are not required when configured with --disable-system.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  util/Makefile.objs | 59 +++++++++++++++++++++++++++++-----------------
>  1 file changed, 38 insertions(+), 21 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~


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

* Re: [PATCH 06/14] util/Makefile: Reduce the user-mode object list
@ 2020-03-15 20:18     ` Richard Henderson
  0 siblings, 0 replies; 76+ messages in thread
From: Richard Henderson @ 2020-03-15 20:18 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Peter Maydell, qemu-riscv, Eduardo Habkost, Sagar Karandikar,
	David Hildenbrand, Bastian Koppelmann, Cornelia Huck,
	Laurent Vivier, qemu-s390x, qemu-arm, qemu-ppc, Paolo Bonzini,
	Alistair Francis, David Gibson, Alex Bennée, Palmer Dabbelt,
	Richard Henderson

On 3/13/20 11:36 AM, Philippe Mathieu-Daudé wrote:
> These stubs are not required when configured with --disable-system.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  util/Makefile.objs | 59 +++++++++++++++++++++++++++++-----------------
>  1 file changed, 38 insertions(+), 21 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~


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

* Re: [PATCH 07/14] target/riscv/cpu: Restrict CPU migration to system-mode
  2020-03-13 18:36   ` Philippe Mathieu-Daudé
@ 2020-03-15 20:18     ` Richard Henderson
  -1 siblings, 0 replies; 76+ messages in thread
From: Richard Henderson @ 2020-03-15 20:18 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Peter Maydell, Alistair Francis, qemu-riscv, Eduardo Habkost,
	Sagar Karandikar, David Hildenbrand, Bastian Koppelmann,
	Cornelia Huck, Laurent Vivier, qemu-s390x, qemu-arm, qemu-ppc,
	Paolo Bonzini, Richard Henderson, Alex Bennée,
	Palmer Dabbelt, David Gibson

On 3/13/20 11:36 AM, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  target/riscv/cpu.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~


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

* Re: [PATCH 07/14] target/riscv/cpu: Restrict CPU migration to system-mode
@ 2020-03-15 20:18     ` Richard Henderson
  0 siblings, 0 replies; 76+ messages in thread
From: Richard Henderson @ 2020-03-15 20:18 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Peter Maydell, qemu-riscv, Eduardo Habkost, Sagar Karandikar,
	David Hildenbrand, Bastian Koppelmann, Cornelia Huck,
	Laurent Vivier, qemu-s390x, qemu-arm, qemu-ppc, Paolo Bonzini,
	Alistair Francis, David Gibson, Alex Bennée, Palmer Dabbelt,
	Richard Henderson

On 3/13/20 11:36 AM, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  target/riscv/cpu.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~


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

* Re: [PATCH 08/14] exec: Assert CPU migration is not used on user-only build
  2020-03-13 18:36   ` Philippe Mathieu-Daudé
@ 2020-03-15 20:19     ` Richard Henderson
  -1 siblings, 0 replies; 76+ messages in thread
From: Richard Henderson @ 2020-03-15 20:19 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Peter Maydell, Alistair Francis, qemu-riscv, Eduardo Habkost,
	Sagar Karandikar, David Hildenbrand, Bastian Koppelmann,
	Cornelia Huck, Laurent Vivier, qemu-s390x, qemu-arm, qemu-ppc,
	Paolo Bonzini, Richard Henderson, Alex Bennée,
	Palmer Dabbelt, David Gibson

On 3/13/20 11:36 AM, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  exec.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~


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

* Re: [PATCH 08/14] exec: Assert CPU migration is not used on user-only build
@ 2020-03-15 20:19     ` Richard Henderson
  0 siblings, 0 replies; 76+ messages in thread
From: Richard Henderson @ 2020-03-15 20:19 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Peter Maydell, qemu-riscv, Eduardo Habkost, Sagar Karandikar,
	David Hildenbrand, Bastian Koppelmann, Cornelia Huck,
	Laurent Vivier, qemu-s390x, qemu-arm, qemu-ppc, Paolo Bonzini,
	Alistair Francis, David Gibson, Alex Bennée, Palmer Dabbelt,
	Richard Henderson

On 3/13/20 11:36 AM, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  exec.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~


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

* Re: [PATCH 09/14] exec: Drop redundant #ifdeffery
  2020-03-13 18:36   ` Philippe Mathieu-Daudé
@ 2020-03-15 20:39     ` Richard Henderson
  -1 siblings, 0 replies; 76+ messages in thread
From: Richard Henderson @ 2020-03-15 20:39 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Peter Maydell, Alistair Francis, qemu-riscv, Eduardo Habkost,
	Sagar Karandikar, David Hildenbrand, Bastian Koppelmann,
	Cornelia Huck, Laurent Vivier, qemu-s390x, qemu-arm, qemu-ppc,
	Paolo Bonzini, Richard Henderson, Alex Bennée,
	Palmer Dabbelt, David Gibson

On 3/13/20 11:36 AM, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  exec.c | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/exec.c b/exec.c
> index 7bc9828c5b..f258502966 100644
> --- a/exec.c
> +++ b/exec.c
> @@ -185,10 +185,6 @@ struct DirtyBitmapSnapshot {
>      unsigned long dirty[];
>  };
>  
> -#endif
> -
> -#if !defined(CONFIG_USER_ONLY)
> -
>  static void phys_map_node_reserve(PhysPageMap *map, unsigned nodes)
>  {
>      static unsigned alloc_hint = 16;
> 

There's even more than that.  Looking further down,

>     745 #endif
>     746 
>     747 #if !defined(CONFIG_USER_ONLY)

This is the #endif that paired with the one at 190.

Later,

>     988 #if defined(CONFIG_USER_ONLY)
...
>    1000 #else
...
>    1031 #endif
>    1032 
>    1033 #ifndef CONFIG_USER_ONLY

So those three lines are redundant.

Later,

>    1252 #if !defined(CONFIG_USER_ONLY)
...
>    1438 #endif /* defined(CONFIG_USER_ONLY) */
>    1439 
>    1440 #if !defined(CONFIG_USER_ONLY)

Clearly these ifdefs are very hard to follow.  I would thus welcome a split of
this file.

Possibly into exec-common.c (with functions present in both softmmu and
user-only, with ifdefs *inside* functions only), and exec-system.c (with no
/#if.*CONFIG_USER_ONLY/).

But exec.c is over 4000 lines, so if there's another logical split into even
more files, that would be even better.


r~


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

* Re: [PATCH 09/14] exec: Drop redundant #ifdeffery
@ 2020-03-15 20:39     ` Richard Henderson
  0 siblings, 0 replies; 76+ messages in thread
From: Richard Henderson @ 2020-03-15 20:39 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Peter Maydell, qemu-riscv, Eduardo Habkost, Sagar Karandikar,
	David Hildenbrand, Bastian Koppelmann, Cornelia Huck,
	Laurent Vivier, qemu-s390x, qemu-arm, qemu-ppc, Paolo Bonzini,
	Alistair Francis, David Gibson, Alex Bennée, Palmer Dabbelt,
	Richard Henderson

On 3/13/20 11:36 AM, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  exec.c | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/exec.c b/exec.c
> index 7bc9828c5b..f258502966 100644
> --- a/exec.c
> +++ b/exec.c
> @@ -185,10 +185,6 @@ struct DirtyBitmapSnapshot {
>      unsigned long dirty[];
>  };
>  
> -#endif
> -
> -#if !defined(CONFIG_USER_ONLY)
> -
>  static void phys_map_node_reserve(PhysPageMap *map, unsigned nodes)
>  {
>      static unsigned alloc_hint = 16;
> 

There's even more than that.  Looking further down,

>     745 #endif
>     746 
>     747 #if !defined(CONFIG_USER_ONLY)

This is the #endif that paired with the one at 190.

Later,

>     988 #if defined(CONFIG_USER_ONLY)
...
>    1000 #else
...
>    1031 #endif
>    1032 
>    1033 #ifndef CONFIG_USER_ONLY

So those three lines are redundant.

Later,

>    1252 #if !defined(CONFIG_USER_ONLY)
...
>    1438 #endif /* defined(CONFIG_USER_ONLY) */
>    1439 
>    1440 #if !defined(CONFIG_USER_ONLY)

Clearly these ifdefs are very hard to follow.  I would thus welcome a split of
this file.

Possibly into exec-common.c (with functions present in both softmmu and
user-only, with ifdefs *inside* functions only), and exec-system.c (with no
/#if.*CONFIG_USER_ONLY/).

But exec.c is over 4000 lines, so if there's another logical split into even
more files, that would be even better.


r~


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

* Re: [PATCH 10/14] arch_init: Remove unused 'qapi-commands-misc.h' include
  2020-03-13 18:36   ` Philippe Mathieu-Daudé
@ 2020-03-15 20:41     ` Richard Henderson
  -1 siblings, 0 replies; 76+ messages in thread
From: Richard Henderson @ 2020-03-15 20:41 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Peter Maydell, Alistair Francis, qemu-riscv, Eduardo Habkost,
	Sagar Karandikar, David Hildenbrand, Bastian Koppelmann,
	Cornelia Huck, Laurent Vivier, qemu-s390x, qemu-arm, qemu-ppc,
	Paolo Bonzini, Richard Henderson, Alex Bennée,
	Palmer Dabbelt, David Gibson

On 3/13/20 11:36 AM, Philippe Mathieu-Daudé wrote:
> Commit ffaee83bcb2 moved qmp_query_target but forgot to remove
> this include.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  arch_init.c | 1 -
>  1 file changed, 1 deletion(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~



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

* Re: [PATCH 10/14] arch_init: Remove unused 'qapi-commands-misc.h' include
@ 2020-03-15 20:41     ` Richard Henderson
  0 siblings, 0 replies; 76+ messages in thread
From: Richard Henderson @ 2020-03-15 20:41 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Peter Maydell, qemu-riscv, Eduardo Habkost, Sagar Karandikar,
	David Hildenbrand, Bastian Koppelmann, Cornelia Huck,
	Laurent Vivier, qemu-s390x, qemu-arm, qemu-ppc, Paolo Bonzini,
	Alistair Francis, David Gibson, Alex Bennée, Palmer Dabbelt,
	Richard Henderson

On 3/13/20 11:36 AM, Philippe Mathieu-Daudé wrote:
> Commit ffaee83bcb2 moved qmp_query_target but forgot to remove
> this include.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  arch_init.c | 1 -
>  1 file changed, 1 deletion(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~



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

* Re: [PATCH 11/14] target: Restrict write_elfXX_note() handlers to system-mode
  2020-03-13 18:36   ` Philippe Mathieu-Daudé
@ 2020-03-15 20:44     ` Richard Henderson
  -1 siblings, 0 replies; 76+ messages in thread
From: Richard Henderson @ 2020-03-15 20:44 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Peter Maydell, Alistair Francis, qemu-riscv, Eduardo Habkost,
	Sagar Karandikar, David Hildenbrand, Bastian Koppelmann,
	Cornelia Huck, Laurent Vivier, qemu-s390x, qemu-arm, qemu-ppc,
	Paolo Bonzini, Richard Henderson, Alex Bennée,
	Palmer Dabbelt, David Gibson

On 3/13/20 11:36 AM, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  target/arm/cpu.h                | 10 +++++-----
>  target/i386/cpu.h               | 18 +++++++++---------
>  target/ppc/cpu.h                |  2 --
>  target/s390x/internal.h         |  3 ++-
>  target/ppc/translate_init.inc.c |  2 --
>  5 files changed, 16 insertions(+), 19 deletions(-)

Hmm.  Or an suggestion to generate guest core files for user-mode upon a fatal
guest signal?


r~


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

* Re: [PATCH 11/14] target: Restrict write_elfXX_note() handlers to system-mode
@ 2020-03-15 20:44     ` Richard Henderson
  0 siblings, 0 replies; 76+ messages in thread
From: Richard Henderson @ 2020-03-15 20:44 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Peter Maydell, qemu-riscv, Eduardo Habkost, Sagar Karandikar,
	David Hildenbrand, Bastian Koppelmann, Cornelia Huck,
	Laurent Vivier, qemu-s390x, qemu-arm, qemu-ppc, Paolo Bonzini,
	Alistair Francis, David Gibson, Alex Bennée, Palmer Dabbelt,
	Richard Henderson

On 3/13/20 11:36 AM, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  target/arm/cpu.h                | 10 +++++-----
>  target/i386/cpu.h               | 18 +++++++++---------
>  target/ppc/cpu.h                |  2 --
>  target/s390x/internal.h         |  3 ++-
>  target/ppc/translate_init.inc.c |  2 --
>  5 files changed, 16 insertions(+), 19 deletions(-)

Hmm.  Or an suggestion to generate guest core files for user-mode upon a fatal
guest signal?


r~


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

* Re: [PATCH 12/14] target/i386: Restrict CpuClass::get_crash_info() to system-mode
  2020-03-13 18:36   ` Philippe Mathieu-Daudé
@ 2020-03-15 20:46     ` Richard Henderson
  -1 siblings, 0 replies; 76+ messages in thread
From: Richard Henderson @ 2020-03-15 20:46 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Peter Maydell, Alistair Francis, qemu-riscv, Eduardo Habkost,
	Sagar Karandikar, David Hildenbrand, Bastian Koppelmann,
	Cornelia Huck, Laurent Vivier, qemu-s390x, qemu-arm, qemu-ppc,
	Paolo Bonzini, Richard Henderson, Alex Bennée,
	Palmer Dabbelt, David Gibson

On 3/13/20 11:36 AM, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  target/i386/cpu.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~



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

* Re: [PATCH 12/14] target/i386: Restrict CpuClass::get_crash_info() to system-mode
@ 2020-03-15 20:46     ` Richard Henderson
  0 siblings, 0 replies; 76+ messages in thread
From: Richard Henderson @ 2020-03-15 20:46 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Peter Maydell, qemu-riscv, Eduardo Habkost, Sagar Karandikar,
	David Hildenbrand, Bastian Koppelmann, Cornelia Huck,
	Laurent Vivier, qemu-s390x, qemu-arm, qemu-ppc, Paolo Bonzini,
	Alistair Francis, David Gibson, Alex Bennée, Palmer Dabbelt,
	Richard Henderson

On 3/13/20 11:36 AM, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  target/i386/cpu.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~



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

* Re: [PATCH 13/14] target/s390x: Restrict CpuClass::get_crash_info() to system-mode
  2020-03-13 18:36   ` Philippe Mathieu-Daudé
@ 2020-03-15 20:46     ` Richard Henderson
  -1 siblings, 0 replies; 76+ messages in thread
From: Richard Henderson @ 2020-03-15 20:46 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Peter Maydell, Alistair Francis, qemu-riscv, Eduardo Habkost,
	Sagar Karandikar, David Hildenbrand, Bastian Koppelmann,
	Cornelia Huck, Laurent Vivier, qemu-s390x, qemu-arm, qemu-ppc,
	Paolo Bonzini, Richard Henderson, Alex Bennée,
	Palmer Dabbelt, David Gibson

On 3/13/20 11:36 AM, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  target/s390x/cpu.c | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~



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

* Re: [PATCH 13/14] target/s390x: Restrict CpuClass::get_crash_info() to system-mode
@ 2020-03-15 20:46     ` Richard Henderson
  0 siblings, 0 replies; 76+ messages in thread
From: Richard Henderson @ 2020-03-15 20:46 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Peter Maydell, qemu-riscv, Eduardo Habkost, Sagar Karandikar,
	David Hildenbrand, Bastian Koppelmann, Cornelia Huck,
	Laurent Vivier, qemu-s390x, qemu-arm, qemu-ppc, Paolo Bonzini,
	Alistair Francis, David Gibson, Alex Bennée, Palmer Dabbelt,
	Richard Henderson

On 3/13/20 11:36 AM, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  target/s390x/cpu.c | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~



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

* Re: [PATCH 14/14] hw/core: Restrict CpuClass::get_crash_info() to system-mode
  2020-03-13 18:36   ` Philippe Mathieu-Daudé
@ 2020-03-15 21:03     ` Richard Henderson
  -1 siblings, 0 replies; 76+ messages in thread
From: Richard Henderson @ 2020-03-15 21:03 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Peter Maydell, Alistair Francis, qemu-riscv, Eduardo Habkost,
	Sagar Karandikar, David Hildenbrand, Bastian Koppelmann,
	Cornelia Huck, Laurent Vivier, qemu-s390x, qemu-arm, qemu-ppc,
	Paolo Bonzini, Richard Henderson, Alex Bennée,
	Palmer Dabbelt, David Gibson

On 3/13/20 11:36 AM, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  include/hw/core/cpu.h | 7 ++++++-
>  hw/core/cpu.c         | 2 ++
>  2 files changed, 8 insertions(+), 1 deletion(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~



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

* Re: [PATCH 14/14] hw/core: Restrict CpuClass::get_crash_info() to system-mode
@ 2020-03-15 21:03     ` Richard Henderson
  0 siblings, 0 replies; 76+ messages in thread
From: Richard Henderson @ 2020-03-15 21:03 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Peter Maydell, qemu-riscv, Eduardo Habkost, Sagar Karandikar,
	David Hildenbrand, Bastian Koppelmann, Cornelia Huck,
	Laurent Vivier, qemu-s390x, qemu-arm, qemu-ppc, Paolo Bonzini,
	Alistair Francis, David Gibson, Alex Bennée, Palmer Dabbelt,
	Richard Henderson

On 3/13/20 11:36 AM, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  include/hw/core/cpu.h | 7 ++++++-
>  hw/core/cpu.c         | 2 ++
>  2 files changed, 8 insertions(+), 1 deletion(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~



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

* Re: [PATCH 01/14] Makefile: Only build virtiofsd if system-mode is enabled
  2020-03-15 19:40       ` Richard Henderson
@ 2020-03-15 22:16         ` Philippe Mathieu-Daudé
  -1 siblings, 0 replies; 76+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-03-15 22:16 UTC (permalink / raw)
  To: Richard Henderson, Laurent Vivier, qemu-devel
  Cc: Peter Maydell, Alistair Francis, qemu-riscv, Eduardo Habkost,
	Sagar Karandikar, David Hildenbrand, Bastian Koppelmann,
	Cornelia Huck, qemu-s390x, qemu-arm, qemu-ppc, Paolo Bonzini,
	Richard Henderson, Alex Bennée, Palmer Dabbelt,
	David Gibson

On 3/15/20 8:40 PM, Richard Henderson wrote:
> On 3/13/20 3:28 PM, Laurent Vivier wrote:
>>>   ifeq ($(CONFIG_LINUX)$(CONFIG_SECCOMP)$(CONFIG_LIBCAP_NG),yyy)
>>> -HELPERS-y += virtiofsd$(EXESUF)
>>> -vhost-user-json-y += tools/virtiofsd/50-qemu-virtiofsd.json
>>> +HELPERS-$(CONFIG_SOFTMMU) += virtiofsd$(EXESUF)
>>> +vhost-user-json-$(CONFIG_SOFTMMU) += tools/virtiofsd/50-qemu-virtiofsd.json
> ...
>>
>> Why don't you do that instead?
>>
>>    ifeq
>> ($(CONFIG_LINUX)$(CONFIG_SECCOMP)$(CONFIG_LIBCAP_NG)$(CONFIG_SOFTMMU),yyyy)

This was my first option but checkpatch complained because it is 80 
chars long...

I also tried:

ifeq \
($(CONFIG_LINUX)$(CONFIG_SECCOMP)$(CONFIG_LIBCAP_NG)$(CONFIG_SOFTMMU),yyyy)

which is uglier and still too long.

Following qemu-bridge-helper syntax I also tried:

ifeq ($(CONFIG_SECCOMP)$(CONFIG_LIBCAP_NG),yy)
HELPERS-$(call land,$(CONFIG_SOFTMMU),$(CONFIG_LINUX)) += virtiofsd$(EXESUF)

which is also too long ¯\_(ツ)_/¯

If you accept checkpatch complain I can use the form you prefer :)

> 
> Seconded.
> 
> r~
> 



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

* Re: [PATCH 01/14] Makefile: Only build virtiofsd if system-mode is enabled
@ 2020-03-15 22:16         ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 76+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-03-15 22:16 UTC (permalink / raw)
  To: Richard Henderson, Laurent Vivier, qemu-devel
  Cc: Peter Maydell, qemu-riscv, Eduardo Habkost, Sagar Karandikar,
	David Hildenbrand, Bastian Koppelmann, Cornelia Huck, qemu-s390x,
	qemu-arm, qemu-ppc, Paolo Bonzini, Alistair Francis,
	David Gibson, Alex Bennée, Palmer Dabbelt,
	Richard Henderson

On 3/15/20 8:40 PM, Richard Henderson wrote:
> On 3/13/20 3:28 PM, Laurent Vivier wrote:
>>>   ifeq ($(CONFIG_LINUX)$(CONFIG_SECCOMP)$(CONFIG_LIBCAP_NG),yyy)
>>> -HELPERS-y += virtiofsd$(EXESUF)
>>> -vhost-user-json-y += tools/virtiofsd/50-qemu-virtiofsd.json
>>> +HELPERS-$(CONFIG_SOFTMMU) += virtiofsd$(EXESUF)
>>> +vhost-user-json-$(CONFIG_SOFTMMU) += tools/virtiofsd/50-qemu-virtiofsd.json
> ...
>>
>> Why don't you do that instead?
>>
>>    ifeq
>> ($(CONFIG_LINUX)$(CONFIG_SECCOMP)$(CONFIG_LIBCAP_NG)$(CONFIG_SOFTMMU),yyyy)

This was my first option but checkpatch complained because it is 80 
chars long...

I also tried:

ifeq \
($(CONFIG_LINUX)$(CONFIG_SECCOMP)$(CONFIG_LIBCAP_NG)$(CONFIG_SOFTMMU),yyyy)

which is uglier and still too long.

Following qemu-bridge-helper syntax I also tried:

ifeq ($(CONFIG_SECCOMP)$(CONFIG_LIBCAP_NG),yy)
HELPERS-$(call land,$(CONFIG_SOFTMMU),$(CONFIG_LINUX)) += virtiofsd$(EXESUF)

which is also too long ¯\_(ツ)_/¯

If you accept checkpatch complain I can use the form you prefer :)

> 
> Seconded.
> 
> r~
> 



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

* Re: [PATCH 09/14] exec: Drop redundant #ifdeffery
  2020-03-15 20:39     ` Richard Henderson
@ 2020-03-15 22:20       ` Philippe Mathieu-Daudé
  -1 siblings, 0 replies; 76+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-03-15 22:20 UTC (permalink / raw)
  To: Richard Henderson, qemu-devel
  Cc: Peter Maydell, Alistair Francis, qemu-riscv, Eduardo Habkost,
	Sagar Karandikar, David Hildenbrand, Bastian Koppelmann,
	Cornelia Huck, Laurent Vivier, qemu-s390x, qemu-arm, qemu-ppc,
	Paolo Bonzini, Richard Henderson, Alex Bennée,
	Palmer Dabbelt, David Gibson

On 3/15/20 9:39 PM, Richard Henderson wrote:
> On 3/13/20 11:36 AM, Philippe Mathieu-Daudé wrote:
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>> ---
>>   exec.c | 4 ----
>>   1 file changed, 4 deletions(-)
>>
>> diff --git a/exec.c b/exec.c
>> index 7bc9828c5b..f258502966 100644
>> --- a/exec.c
>> +++ b/exec.c
>> @@ -185,10 +185,6 @@ struct DirtyBitmapSnapshot {
>>       unsigned long dirty[];
>>   };
>>   
>> -#endif
>> -
>> -#if !defined(CONFIG_USER_ONLY)
>> -
>>   static void phys_map_node_reserve(PhysPageMap *map, unsigned nodes)
>>   {
>>       static unsigned alloc_hint = 16;
>>
> 
> There's even more than that.  Looking further down,
> 
>>      745 #endif
>>      746
>>      747 #if !defined(CONFIG_USER_ONLY)
> 
> This is the #endif that paired with the one at 190.
> 
> Later,
> 
>>      988 #if defined(CONFIG_USER_ONLY)
> ...
>>     1000 #else
> ...
>>     1031 #endif
>>     1032
>>     1033 #ifndef CONFIG_USER_ONLY
> 
> So those three lines are redundant.
> 
> Later,
> 
>>     1252 #if !defined(CONFIG_USER_ONLY)
> ...
>>     1438 #endif /* defined(CONFIG_USER_ONLY) */
>>     1439
>>     1440 #if !defined(CONFIG_USER_ONLY)
> 
> Clearly these ifdefs are very hard to follow.  I would thus welcome a split of
> this file.
> 
> Possibly into exec-common.c (with functions present in both softmmu and
> user-only, with ifdefs *inside* functions only), and exec-system.c (with no
> /#if.*CONFIG_USER_ONLY/).
> 
> But exec.c is over 4000 lines, so if there's another logical split into even
> more files, that would be even better.

OK, I am taking notes for the 5.0 cycle.

We can drop this patch for this series objective, as it is mostly cosmetic.

> 
> 
> r~
> 



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

* Re: [PATCH 09/14] exec: Drop redundant #ifdeffery
@ 2020-03-15 22:20       ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 76+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-03-15 22:20 UTC (permalink / raw)
  To: Richard Henderson, qemu-devel
  Cc: Peter Maydell, qemu-riscv, Eduardo Habkost, Sagar Karandikar,
	David Hildenbrand, Bastian Koppelmann, Cornelia Huck,
	Laurent Vivier, qemu-s390x, qemu-arm, qemu-ppc, Paolo Bonzini,
	Alistair Francis, David Gibson, Alex Bennée, Palmer Dabbelt,
	Richard Henderson

On 3/15/20 9:39 PM, Richard Henderson wrote:
> On 3/13/20 11:36 AM, Philippe Mathieu-Daudé wrote:
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>> ---
>>   exec.c | 4 ----
>>   1 file changed, 4 deletions(-)
>>
>> diff --git a/exec.c b/exec.c
>> index 7bc9828c5b..f258502966 100644
>> --- a/exec.c
>> +++ b/exec.c
>> @@ -185,10 +185,6 @@ struct DirtyBitmapSnapshot {
>>       unsigned long dirty[];
>>   };
>>   
>> -#endif
>> -
>> -#if !defined(CONFIG_USER_ONLY)
>> -
>>   static void phys_map_node_reserve(PhysPageMap *map, unsigned nodes)
>>   {
>>       static unsigned alloc_hint = 16;
>>
> 
> There's even more than that.  Looking further down,
> 
>>      745 #endif
>>      746
>>      747 #if !defined(CONFIG_USER_ONLY)
> 
> This is the #endif that paired with the one at 190.
> 
> Later,
> 
>>      988 #if defined(CONFIG_USER_ONLY)
> ...
>>     1000 #else
> ...
>>     1031 #endif
>>     1032
>>     1033 #ifndef CONFIG_USER_ONLY
> 
> So those three lines are redundant.
> 
> Later,
> 
>>     1252 #if !defined(CONFIG_USER_ONLY)
> ...
>>     1438 #endif /* defined(CONFIG_USER_ONLY) */
>>     1439
>>     1440 #if !defined(CONFIG_USER_ONLY)
> 
> Clearly these ifdefs are very hard to follow.  I would thus welcome a split of
> this file.
> 
> Possibly into exec-common.c (with functions present in both softmmu and
> user-only, with ifdefs *inside* functions only), and exec-system.c (with no
> /#if.*CONFIG_USER_ONLY/).
> 
> But exec.c is over 4000 lines, so if there's another logical split into even
> more files, that would be even better.

OK, I am taking notes for the 5.0 cycle.

We can drop this patch for this series objective, as it is mostly cosmetic.

> 
> 
> r~
> 



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

* Re: [PATCH 01/14] Makefile: Only build virtiofsd if system-mode is enabled
  2020-03-15 22:16         ` Philippe Mathieu-Daudé
@ 2020-03-15 22:33           ` Richard Henderson
  -1 siblings, 0 replies; 76+ messages in thread
From: Richard Henderson @ 2020-03-15 22:33 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, Laurent Vivier, qemu-devel
  Cc: Peter Maydell, Alistair Francis, qemu-riscv, Eduardo Habkost,
	Sagar Karandikar, David Hildenbrand, Bastian Koppelmann,
	Cornelia Huck, qemu-s390x, qemu-arm, qemu-ppc, Paolo Bonzini,
	Richard Henderson, Alex Bennée, Palmer Dabbelt,
	David Gibson

On 3/15/20 3:16 PM, Philippe Mathieu-Daudé wrote:
> On 3/15/20 8:40 PM, Richard Henderson wrote:
>> On 3/13/20 3:28 PM, Laurent Vivier wrote:
>>>>   ifeq ($(CONFIG_LINUX)$(CONFIG_SECCOMP)$(CONFIG_LIBCAP_NG),yyy)
>>>> -HELPERS-y += virtiofsd$(EXESUF)
>>>> -vhost-user-json-y += tools/virtiofsd/50-qemu-virtiofsd.json
>>>> +HELPERS-$(CONFIG_SOFTMMU) += virtiofsd$(EXESUF)
>>>> +vhost-user-json-$(CONFIG_SOFTMMU) += tools/virtiofsd/50-qemu-virtiofsd.json
>> ...
>>>
>>> Why don't you do that instead?
>>>
>>>    ifeq
>>> ($(CONFIG_LINUX)$(CONFIG_SECCOMP)$(CONFIG_LIBCAP_NG)$(CONFIG_SOFTMMU),yyyy)
> 
> This was my first option but checkpatch complained because it is 80 chars long...
> 
> I also tried:
> 
> ifeq \
> ($(CONFIG_LINUX)$(CONFIG_SECCOMP)$(CONFIG_LIBCAP_NG)$(CONFIG_SOFTMMU),yyyy)
> 
> which is uglier and still too long.
> 
> Following qemu-bridge-helper syntax I also tried:
> 
> ifeq ($(CONFIG_SECCOMP)$(CONFIG_LIBCAP_NG),yy)
> HELPERS-$(call land,$(CONFIG_SOFTMMU),$(CONFIG_LINUX)) += virtiofsd$(EXESUF)
> 
> which is also too long ¯\_(ツ)_/¯
> 
> If you accept checkpatch complain I can use the form you prefer :)

Hmph.  Of the choices, I prefer the 80+ char line.


r~


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

* Re: [PATCH 01/14] Makefile: Only build virtiofsd if system-mode is enabled
@ 2020-03-15 22:33           ` Richard Henderson
  0 siblings, 0 replies; 76+ messages in thread
From: Richard Henderson @ 2020-03-15 22:33 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, Laurent Vivier, qemu-devel
  Cc: Peter Maydell, qemu-riscv, Eduardo Habkost, Sagar Karandikar,
	David Hildenbrand, Bastian Koppelmann, Cornelia Huck, qemu-s390x,
	qemu-arm, qemu-ppc, Paolo Bonzini, Alistair Francis,
	David Gibson, Alex Bennée, Palmer Dabbelt,
	Richard Henderson

On 3/15/20 3:16 PM, Philippe Mathieu-Daudé wrote:
> On 3/15/20 8:40 PM, Richard Henderson wrote:
>> On 3/13/20 3:28 PM, Laurent Vivier wrote:
>>>>   ifeq ($(CONFIG_LINUX)$(CONFIG_SECCOMP)$(CONFIG_LIBCAP_NG),yyy)
>>>> -HELPERS-y += virtiofsd$(EXESUF)
>>>> -vhost-user-json-y += tools/virtiofsd/50-qemu-virtiofsd.json
>>>> +HELPERS-$(CONFIG_SOFTMMU) += virtiofsd$(EXESUF)
>>>> +vhost-user-json-$(CONFIG_SOFTMMU) += tools/virtiofsd/50-qemu-virtiofsd.json
>> ...
>>>
>>> Why don't you do that instead?
>>>
>>>    ifeq
>>> ($(CONFIG_LINUX)$(CONFIG_SECCOMP)$(CONFIG_LIBCAP_NG)$(CONFIG_SOFTMMU),yyyy)
> 
> This was my first option but checkpatch complained because it is 80 chars long...
> 
> I also tried:
> 
> ifeq \
> ($(CONFIG_LINUX)$(CONFIG_SECCOMP)$(CONFIG_LIBCAP_NG)$(CONFIG_SOFTMMU),yyyy)
> 
> which is uglier and still too long.
> 
> Following qemu-bridge-helper syntax I also tried:
> 
> ifeq ($(CONFIG_SECCOMP)$(CONFIG_LIBCAP_NG),yy)
> HELPERS-$(call land,$(CONFIG_SOFTMMU),$(CONFIG_LINUX)) += virtiofsd$(EXESUF)
> 
> which is also too long ¯\_(ツ)_/¯
> 
> If you accept checkpatch complain I can use the form you prefer :)

Hmph.  Of the choices, I prefer the 80+ char line.


r~


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

end of thread, other threads:[~2020-03-15 22:38 UTC | newest]

Thread overview: 76+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-13 18:36 [PATCH 00/14] user-mode: Prune build dependencies (part 1) Philippe Mathieu-Daudé
2020-03-13 18:36 ` Philippe Mathieu-Daudé
2020-03-13 18:36 ` [PATCH 01/14] Makefile: Only build virtiofsd if system-mode is enabled Philippe Mathieu-Daudé
2020-03-13 18:36   ` Philippe Mathieu-Daudé
2020-03-13 22:28   ` Laurent Vivier
2020-03-13 22:28     ` Laurent Vivier
2020-03-15 19:40     ` Richard Henderson
2020-03-15 19:40       ` Richard Henderson
2020-03-15 22:16       ` Philippe Mathieu-Daudé
2020-03-15 22:16         ` Philippe Mathieu-Daudé
2020-03-15 22:33         ` Richard Henderson
2020-03-15 22:33           ` Richard Henderson
2020-03-13 18:36 ` [PATCH 02/14] configure: Avoid building TCG when not needed Philippe Mathieu-Daudé
2020-03-13 18:36   ` Philippe Mathieu-Daudé
2020-03-15 18:56   ` Richard Henderson
2020-03-15 18:56     ` Richard Henderson
2020-03-13 18:36 ` [PATCH 03/14] tests/Makefile: Only display TCG-related tests when TCG is available Philippe Mathieu-Daudé
2020-03-13 18:36   ` Philippe Mathieu-Daudé
2020-03-13 19:45   ` Alistair Francis
2020-03-13 19:45     ` Alistair Francis
2020-03-15 18:57   ` Richard Henderson
2020-03-15 18:57     ` Richard Henderson
2020-03-13 18:36 ` [PATCH 04/14] tests/Makefile: Restrict some softmmu-only tests Philippe Mathieu-Daudé
2020-03-13 18:36   ` Philippe Mathieu-Daudé
2020-03-15 20:07   ` Richard Henderson
2020-03-15 20:07     ` Richard Henderson
2020-03-15 20:17     ` Richard Henderson
2020-03-15 20:17       ` Richard Henderson
2020-03-13 18:36 ` [PATCH 05/14] stubs/Makefile: Reduce the user-mode object list Philippe Mathieu-Daudé
2020-03-13 18:36   ` Philippe Mathieu-Daudé
2020-03-15 20:17   ` Richard Henderson
2020-03-15 20:17     ` Richard Henderson
2020-03-13 18:36 ` [PATCH 06/14] util/Makefile: " Philippe Mathieu-Daudé
2020-03-13 18:36   ` Philippe Mathieu-Daudé
2020-03-15 20:18   ` Richard Henderson
2020-03-15 20:18     ` Richard Henderson
2020-03-13 18:36 ` [PATCH 07/14] target/riscv/cpu: Restrict CPU migration to system-mode Philippe Mathieu-Daudé
2020-03-13 18:36   ` Philippe Mathieu-Daudé
2020-03-13 20:01   ` Alistair Francis
2020-03-13 20:01     ` Alistair Francis
2020-03-15 20:18   ` Richard Henderson
2020-03-15 20:18     ` Richard Henderson
2020-03-13 18:36 ` [PATCH 08/14] exec: Assert CPU migration is not used on user-only build Philippe Mathieu-Daudé
2020-03-13 18:36   ` Philippe Mathieu-Daudé
2020-03-15 20:19   ` Richard Henderson
2020-03-15 20:19     ` Richard Henderson
2020-03-13 18:36 ` [PATCH 09/14] exec: Drop redundant #ifdeffery Philippe Mathieu-Daudé
2020-03-13 18:36   ` Philippe Mathieu-Daudé
2020-03-13 20:02   ` Alistair Francis
2020-03-13 20:02     ` Alistair Francis
2020-03-15 20:39   ` Richard Henderson
2020-03-15 20:39     ` Richard Henderson
2020-03-15 22:20     ` Philippe Mathieu-Daudé
2020-03-15 22:20       ` Philippe Mathieu-Daudé
2020-03-13 18:36 ` [PATCH 10/14] arch_init: Remove unused 'qapi-commands-misc.h' include Philippe Mathieu-Daudé
2020-03-13 18:36   ` Philippe Mathieu-Daudé
2020-03-13 20:02   ` Alistair Francis
2020-03-13 20:02     ` Alistair Francis
2020-03-15 20:41   ` Richard Henderson
2020-03-15 20:41     ` Richard Henderson
2020-03-13 18:36 ` [PATCH 11/14] target: Restrict write_elfXX_note() handlers to system-mode Philippe Mathieu-Daudé
2020-03-13 18:36   ` Philippe Mathieu-Daudé
2020-03-15 20:44   ` Richard Henderson
2020-03-15 20:44     ` Richard Henderson
2020-03-13 18:36 ` [PATCH 12/14] target/i386: Restrict CpuClass::get_crash_info() " Philippe Mathieu-Daudé
2020-03-13 18:36   ` Philippe Mathieu-Daudé
2020-03-15 20:46   ` Richard Henderson
2020-03-15 20:46     ` Richard Henderson
2020-03-13 18:36 ` [PATCH 13/14] target/s390x: " Philippe Mathieu-Daudé
2020-03-13 18:36   ` Philippe Mathieu-Daudé
2020-03-15 20:46   ` Richard Henderson
2020-03-15 20:46     ` Richard Henderson
2020-03-13 18:36 ` [PATCH 14/14] hw/core: " Philippe Mathieu-Daudé
2020-03-13 18:36   ` Philippe Mathieu-Daudé
2020-03-15 21:03   ` Richard Henderson
2020-03-15 21:03     ` Richard Henderson

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.