Skip to contentSkip to conversation

accel: Allow targets to use Kconfig, disable semihosting by default

PATCH Superseded Philippe Mathieu-Daudé 4 participants 19 messages May 21, 2020 – Jun 17, 2020

Subsystems (2)

v3 of 9 Superseded Latest is v9 →

lore
Share & tools
lore
#0 lore raw

v3 cover accel: Allow targets to use Kconfig, disable semihosting by default

Missing review: patch #9 'rules.mak: Add base-arch rule' and patch #11 'semihosting: Make the feature depend of TCG'

This series include generic patches I took of the KVM/ARM specific series which will follow.

- List orphan accelerators in MAINTAINERS
- Add accel/Kconfig
- Allow targets to use their how Kconfig
- Enforce semihosting on architecture where required, disable it elsewhere

Since v2:
- Addressed Thomas review comments
- Fixed problem when including TARGET instead of BASE_TARGET

Since v1:
https://www.mail-archive.com/[email protected]/msg689024.html
- Drop HVF MAINTAINERS patch (merged elsewhere)
- Kconfig-select SEMIHOSTING (bonzini)
- Drop user-mode selection patches
- consider m68k/nios2/xtensa/riscv (pm215)
- reword Kconfig SEMIHOSTING description (pm215)
- reset some of rth R-b tags

Previous RFC for semihosting posted earlier:
https://www.mail-archive.com/[email protected]/msg631218.html

$ git backport-diff -u v2 -r v3
Key:
[----] : patches are identical
[####] : number of functional differences between upstream/downstream patch
[down] : patch is downstream-only
The flags [FC] indicate (F)unctional and (C)ontextual differences, respectively

001/11:[----] [--] 'MAINTAINERS: Fix KVM path expansion glob'
002/11:[0002] [FC] 'MAINTAINERS: Add an 'overall' entry for accelerators' 003/11:[----] [-C] 'MAINTAINERS: Add an entry for the HAX accelerator' 004/11:[----] [--] 'accel/tcg: Add stub for probe_access()'
005/11:[----] [--] 'Makefile: Remove dangerous EOL trailing backslash' 006/11:[----] [--] 'Makefile: Write MINIKCONF variables as one entry per line' 007/11:[----] [--] 'accel/Kconfig: Extract accel selectors into their own config' 008/11:[----] [--] 'accel/Kconfig: Add the TCG selector'
009/11:[down] 'rules.mak: Add base-arch() rule'
010/11:[0002] [FC] 'Makefile: Allow target-specific optional Kconfig' 011/11:[0014] [FC] 'hw/semihosting: Make the feature depend of TCG, and allow to disable it'

Philippe Mathieu-Daudé (11):
MAINTAINERS: Fix KVM path expansion glob
MAINTAINERS: Add an 'overall' entry for accelerators
MAINTAINERS: Add an entry for the HAX accelerator accel/tcg: Add stub for probe_access()
Makefile: Remove dangerous EOL trailing backslash
Makefile: Write MINIKCONF variables as one entry per line accel/Kconfig: Extract accel selectors into their own config accel/Kconfig: Add the TCG selector
rules.mak: Add base-arch() rule
Makefile: Allow target-specific optional Kconfig hw/semihosting: Make the feature depend of TCG, and allow to disable
it

 Makefile                                | 15 +++++++++++----
 default-configs/arm-softmmu.mak         |  1 -
 default-configs/lm32-softmmu.mak        |  2 --
 default-configs/m68k-softmmu.mak        |  2 --
 default-configs/mips-softmmu-common.mak |  3 ---
 default-configs/nios2-softmmu.mak       |  2 --
 default-configs/xtensa-softmmu.mak      |  2 --
 rules.mak                               | 16 ++++++++++++++++
 accel/stubs/tcg-stub.c                  |  7 +++++++
 Kconfig.host                            |  7 -------
 MAINTAINERS                             | 19 ++++++++++++++++++-
 accel/Kconfig                           |  9 +++++++++
 hw/semihosting/Kconfig                  |  4 +++-
 target/arm/Kconfig                      |  2 ++
 target/lm32/Kconfig                     |  2 ++
 target/m68k/Kconfig                     |  2 ++
 target/mips/Kconfig                     |  2 ++
 target/nios2/Kconfig                    |  2 ++
 target/riscv/Kconfig                    |  2 ++
 target/xtensa/Kconfig                   |  2 ++
 20 files changed, 78 insertions(+), 25 deletions(-)
 create mode 100644 accel/Kconfig
 create mode 100644 target/arm/Kconfig
 create mode 100644 target/lm32/Kconfig
 create mode 100644 target/m68k/Kconfig
 create mode 100644 target/mips/Kconfig
 create mode 100644 target/nios2/Kconfig
 create mode 100644 target/riscv/Kconfig
 create mode 100644 target/xtensa/Kconfig
Signature · 1 line
2.21.3
#1 lore raw

PATCH v3 1/11 MAINTAINERS: Fix KVM path expansion glob

The KVM files has been moved from target-ARCH to the target/ARCH/ folder in commit fcf5ef2a. Fix the pathname expansion.

Fixes fcf5ef2a ("Move target-* CPU file into a target/ folder")
---
 MAINTAINERS | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
MAINTAINERS +1 -1
index 87a412c229..eebdcc6aa9 100644
@@ -361,7 +361,7 @@ Overall KVM CPUs
 M: Paolo Bonzini <[email protected]>
 L: [email protected]
 S: Supported
-F: */kvm.*
+F: */*/kvm*
 F: accel/kvm/
 F: accel/stubs/kvm-stub.c
 F: include/hw/kvm/
Signature · 1 line
2.21.3
#2 lore raw

PATCH v3 2/11 MAINTAINERS: Add an 'overall' entry for accelerators

In reply to Philippe Mathieu-Daudé

---
Cc: Paolo Bonzini <[email protected]>

v2: Cover accel/accel.c & accel/Makefile.objs (thuth)

---
 MAINTAINERS | 11 +++++++++++
 1 file changed, 11 insertions(+)
MAINTAINERS +11 -0
index eebdcc6aa9..d7b98f9878 100644
@@ -415,6 +415,17 @@ S: Supported
 F: target/i386/kvm.c
 F: scripts/kvm/vmxcap
 
+Guest CPU Cores (other accelerators)
+------------------------------------
+Overall
+M: Richard Henderson <[email protected]>
+R: Paolo Bonzini <[email protected]>
+S: Maintained
+F: include/sysemu/accel.h
+F: accel/accel.c
+F: accel/Makefile.objs
+F: accel/stubs/Makefile.objs
+
 X86 HVF CPUs
 M: Roman Bolshakov <[email protected]>
 S: Maintained
Signature · 1 line
2.21.3
#3 lore raw

PATCH v3 3/11 MAINTAINERS: Add an entry for the HAX accelerator

In reply to Philippe Mathieu-Daudé

---
Cc: Sergio Andres Gomez Del Real <[email protected]>
Cc: Vincent Palatin <[email protected]>
Cc: Yu Ning <[email protected]>
Cc: Tao Wu <[email protected]>
Cc: [email protected]
Cc: Colin Xu <[email protected]>
Cc: Hang Yuan <[email protected]>
Cc: David Chou <[email protected]>
Cc: Wenchao Wang <[email protected]>

---
 MAINTAINERS | 6 ++++++
 1 file changed, 6 insertions(+)
MAINTAINERS +6 -0
index d7b98f9878..0f76dc330b 100644
@@ -426,6 +426,12 @@ F: accel/accel.c
 F: accel/Makefile.objs
 F: accel/stubs/Makefile.objs
 
+HAX Accelerator
+S: Orphan
+F: accel/stubs/hax-stub.c
+F: target/i386/hax-all.c
+F: include/sysemu/hax.h
+
 X86 HVF CPUs
 M: Roman Bolshakov <[email protected]>
 S: Maintained
Signature · 1 line
2.21.3
#4 lore raw

PATCH v3 4/11 accel/tcg: Add stub for probe_access()

In reply to Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <[email protected]>

The TCG helpers where added in b92e5a22ec3 in softmmu_template.h. probe_write() was added in there in 3b4afc9e75a to be moved out to accel/tcg/cputlb.c in 3b08f0a9254, and was later refactored as probe_access() in c25c283df0f.
Since it is a TCG specific helper, add a stub to avoid failures when building without TCG, such:

target/arm/helper.o: In function `probe_read':
include/exec/exec-all.h:362: undefined reference to `probe_access'

---
Cc: Richard Henderson <[email protected]>
Cc: Emilio G. Cota <[email protected]>
Cc: Alex Bennée <[email protected]>
Cc: David Hildenbrand <[email protected]>

---
 accel/stubs/tcg-stub.c | 7 +++++++
 1 file changed, 7 insertions(+)
accel/stubs/tcg-stub.c +7 -0
index 677191a69c..e4bbf997aa 100644
@@ -22,3 +22,10 @@ void tb_flush(CPUState *cpu)
 void tlb_set_dirty(CPUState *cpu, target_ulong vaddr)
 {
 }
+
+void *probe_access(CPUArchState *env, target_ulong addr, int size,
+                   MMUAccessType access_type, int mmu_idx, uintptr_t retaddr)
+{
+     /* Handled by hardware accelerator. */
+     g_assert_not_reached();
+}
Signature · 1 line
2.21.3
#5 lore raw

Re: [PATCH v3 04/11] accel/tcg: Add stub for probe_access()

Quoted 3 lines · Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <[email protected]>

The TCG helpers where added in b92e5a22ec3 in softmmu_template.h.

s/where/were/

#6 lore raw

PATCH v3 5/11 Makefile: Remove dangerous EOL trailing backslash

In reply to Philippe Mathieu-Daudé

One might get caught trying to understand unexpected Makefile behavior. Trailing backslash can help to split very long lines, but are rather dangerous when nothing follow. Preserve other developers debugging time by removing this one.

---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
index 40e4f7677b..6c9d718b2c 100644
@@ -420,7 +420,7 @@ MINIKCONF_ARGS = \
 
 MINIKCONF_INPUTS = $(SRC_PATH)/Kconfig.host $(SRC_PATH)/hw/Kconfig
 MINIKCONF_DEPS = $(MINIKCONF_INPUTS) $(wildcard $(SRC_PATH)/hw/*/Kconfig)
-MINIKCONF = $(PYTHON) $(SRC_PATH)/scripts/minikconf.py \
+MINIKCONF = $(PYTHON) $(SRC_PATH)/scripts/minikconf.py
 
 $(SUBDIR_DEVICES_MAK): %/config-devices.mak: default-configs/%.mak $(MINIKCONF_DEPS) $(BUILD_DIR)/config-host.mak
 	$(call quiet-command, $(MINIKCONF) $(MINIKCONF_ARGS) > [email protected], "GEN", "[email protected]")
Signature · 1 line
2.21.3
#7 lore raw

PATCH v3 6/11 Makefile: Write MINIKCONF variables as one entry per line

In reply to Philippe Mathieu-Daudé

Having one entry per line helps reviews/refactors. As we are going to modify the MINIKCONF variables, split them now to ease further review.

---
 Makefile | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
Makefile +6 -3
index 6c9d718b2c..7666f81e8a 100644
@@ -418,12 +418,15 @@ MINIKCONF_ARGS = \
     CONFIG_LINUX=$(CONFIG_LINUX) \
     CONFIG_PVRDMA=$(CONFIG_PVRDMA)
 
-MINIKCONF_INPUTS = $(SRC_PATH)/Kconfig.host $(SRC_PATH)/hw/Kconfig
-MINIKCONF_DEPS = $(MINIKCONF_INPUTS) $(wildcard $(SRC_PATH)/hw/*/Kconfig)
+MINIKCONF_INPUTS = $(SRC_PATH)/Kconfig.host \
+                   $(SRC_PATH)/hw/Kconfig
+MINIKCONF_DEPS = $(MINIKCONF_INPUTS) \
+                 $(wildcard $(SRC_PATH)/hw/*/Kconfig)
 MINIKCONF = $(PYTHON) $(SRC_PATH)/scripts/minikconf.py
 
 $(SUBDIR_DEVICES_MAK): %/config-devices.mak: default-configs/%.mak $(MINIKCONF_DEPS) $(BUILD_DIR)/config-host.mak
-	$(call quiet-command, $(MINIKCONF) $(MINIKCONF_ARGS) > [email protected], "GEN", "[email protected]")
+	$(call quiet-command, $(MINIKCONF) $(MINIKCONF_ARGS) \
+		> [email protected], "GEN", "[email protected]")
 	$(call quiet-command, if test -f $@; then \
 	  if cmp -s [email protected] $@; then \
 	    mv [email protected] $@; \
Signature · 1 line
2.21.3
#8 lore raw

PATCH v3 7/11 accel/Kconfig: Extract accel selectors into their own config

In reply to Philippe Mathieu-Daudé

Move the accel selectors from the global Kconfig.host to their own Kconfig file.

---
 Makefile      | 1 +
 Kconfig.host  | 7 -------
 accel/Kconfig | 6 ++++++
 3 files changed, 7 insertions(+), 7 deletions(-)
 create mode 100644 accel/Kconfig
Makefile +1 -0
index 7666f81e8a..648757f79a 100644
@@ -419,6 +419,7 @@ MINIKCONF_ARGS = \
     CONFIG_PVRDMA=$(CONFIG_PVRDMA)
 
 MINIKCONF_INPUTS = $(SRC_PATH)/Kconfig.host \
+                   $(SRC_PATH)/accel/Kconfig \
                    $(SRC_PATH)/hw/Kconfig
 MINIKCONF_DEPS = $(MINIKCONF_INPUTS) \
                  $(wildcard $(SRC_PATH)/hw/*/Kconfig)
Kconfig.host +0 -7
index 55136e037d..a6d871c399 100644
@@ -2,9 +2,6 @@
 # down to Kconfig.  See also MINIKCONF_ARGS in the Makefile:
 # these two need to be kept in sync.
 
-config KVM
-    bool
-
 config LINUX
     bool
 
@@ -31,10 +28,6 @@ config VHOST_KERNEL
     bool
     select VHOST
 
-config XEN
-    bool
-    select FSDEV_9P if VIRTFS
-
 config VIRTFS
     bool
 
accel/Kconfig new file +6 -0
new file mode 100644
index 0000000000..c21802bb49
@@ -0,0 +1,6 @@
+config KVM
+    bool
+
+config XEN
+    bool
+    select FSDEV_9P if VIRTFS
Signature · 1 line
2.21.3
#9 lore raw

PATCH v3 8/11 accel/Kconfig: Add the TCG selector

In reply to Philippe Mathieu-Daudé

Expose the CONFIG_TCG selector to let minikconf.py uses it.

When building with --disable-tcg build, this helps to deselect devices that are TCG-dependent.

---
 Makefile      | 1 +
 accel/Kconfig | 3 +++
 2 files changed, 4 insertions(+)
Makefile +1 -0
index 648757f79a..f8a45e1379 100644
@@ -405,6 +405,7 @@ endif
 MINIKCONF_ARGS = \
     $(CONFIG_MINIKCONF_MODE) \
     $@ $*/config-devices.mak.d $< $(MINIKCONF_INPUTS) \
+    CONFIG_TCG=$(CONFIG_TCG) \
     CONFIG_KVM=$(CONFIG_KVM) \
     CONFIG_SPICE=$(CONFIG_SPICE) \
     CONFIG_IVSHMEM=$(CONFIG_IVSHMEM) \
accel/Kconfig +3 -0
index c21802bb49..2ad94a3839 100644
@@ -1,3 +1,6 @@
+config TCG
+    bool
+
 config KVM
     bool
 
Signature · 1 line
2.21.3
#10 lore raw

PATCH v3 9/11 rules.mak: Add base-arch() rule

In reply to Philippe Mathieu-Daudé

Add a rule to return the base architecture for a QEMU target.

The current list of TARGET_BASE_ARCH is:

  $ git grep  TARGET_BASE_ARCH configure
  configure:7785:TARGET_BASE_ARCH=""
  configure:7795:    TARGET_BASE_ARCH=i386
  configure:7813:    TARGET_BASE_ARCH=arm
  configure:7846:    TARGET_BASE_ARCH=mips
  configure:7854:    TARGET_BASE_ARCH=mips
  configure:7864:    TARGET_BASE_ARCH=openrisc
  configure:7871:    TARGET_BASE_ARCH=ppc
  configure:7879:    TARGET_BASE_ARCH=ppc
  configure:7887:    TARGET_BASE_ARCH=ppc
  configure:7894:    TARGET_BASE_ARCH=riscv
  configure:7900:    TARGET_BASE_ARCH=riscv
  configure:7920:    TARGET_BASE_ARCH=sparc
  configure:7925:    TARGET_BASE_ARCH=sparc
---
 rules.mak | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
rules.mak +16 -0
index 694865b63e..55810d0cd6 100644
@@ -438,3 +438,19 @@ atomic = $(eval $1: $(call sentinel,$1) ; @:) \
 
 print-%:
 	@echo '$*=$($*)'
+
+# base-arch
+# Usage: $(call base-arch, target)
+#
+# @target: the target architecture.
+#
+# This macro will return the base architecture for a target.
+#
+# As example, $(call base-arch, aarch64) returns 'arm'.
+base-arch = $(subst $(SPACE),,\
+		$(if $(findstring mips,$1),mips,\
+		$(if $(findstring ppc,$1),ppc,\
+		$(if $(findstring risc,$1),risc,\
+		$(if $(findstring sparc,$1),sparc,\
+		$(if $(findstring x86,$1),i386,\
+		$(if $(findstring aarch64,$1),arm,$1)))))))
Signature · 1 line
2.21.3
#11 lore raw

Re: [PATCH v3 09/11] rules.mak: Add base-arch() rule

rules.mak atomic = $(eval $1: $(call sentinel,$1) ; @:) \ · line 453

Quoted 1 line · Philippe Mathieu-Daudé
rules.mak +1 -0
+		$(if $(findstring risc,$1),risc,\

Eh? riscv{32,64} vs openrisc.

rules.mak atomic = $(eval $1: $(call sentinel,$1) ; @:) \ · line 455

Quoted 1 line
rules.mak +1 -0
+		$(if $(findstring x86,$1),i386,\

Do we really not need an exact match for x86_64?

rules.mak atomic = $(eval $1: $(call sentinel,$1) ; @:) \ · line 456

Quoted 1 line
rules.mak +1 -0
+		$(if $(findstring aarch64,$1),arm,$1)))))))

Exact match?

r~

#12 lore raw

Re: [PATCH v3 09/11] rules.mak: Add base-arch() rule

Quoted 4 lines · Richard Henderson

rules.mak atomic = $(eval $1: $(call sentinel,$1) ; @:) \ · line 453

Quoted 1 line · Philippe Mathieu-Daudé
rules.mak +1 -0
+		$(if $(findstring risc,$1),risc,\

Eh? riscv{32,64} vs openrisc.

Nice catch, because with this patch openrisc builds with a riscv config-devices.h =)

Quoted 4 lines

rules.mak atomic = $(eval $1: $(call sentinel,$1) ; @:) \ · line 455

Quoted 2 lines
rules.mak +1 -0
+		$(if $(findstring x86,$1),i386,\

Do we really not need an exact match for x86_64?

OK.

Quoted 4 lines

rules.mak atomic = $(eval $1: $(call sentinel,$1) ; @:) \ · line 456

Quoted 2 lines
rules.mak +1 -0
+		$(if $(findstring aarch64,$1),arm,$1)))))))

Exact match?

OK.

Quoted 4 lines

r~

#13 lore raw

PATCH v3 10/11 Makefile: Allow target-specific optional Kconfig

In reply to Philippe Mathieu-Daudé

Allow use of target-specific Kconfig file.

---
v3: Use base-arch() to include TARGET_BASE_ARCH/Kconfig

---
 Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Makefile +3 -1
index f8a45e1379..d5009cd304 100644
@@ -423,11 +423,13 @@ MINIKCONF_INPUTS = $(SRC_PATH)/Kconfig.host \
                    $(SRC_PATH)/accel/Kconfig \
                    $(SRC_PATH)/hw/Kconfig
 MINIKCONF_DEPS = $(MINIKCONF_INPUTS) \
-                 $(wildcard $(SRC_PATH)/hw/*/Kconfig)
+                 $(wildcard $(SRC_PATH)/hw/*/Kconfig) \
+                 $(wildcard $(SRC_PATH)/target/*/Kconfig)
 MINIKCONF = $(PYTHON) $(SRC_PATH)/scripts/minikconf.py
 
 $(SUBDIR_DEVICES_MAK): %/config-devices.mak: default-configs/%.mak $(MINIKCONF_DEPS) $(BUILD_DIR)/config-host.mak
 	$(call quiet-command, $(MINIKCONF) $(MINIKCONF_ARGS) \
+		$(wildcard $(SRC_PATH)/target/$(call base-arch, $(firstword $(subst -, ,$@)))/Kconfig) \
 		> [email protected], "GEN", "[email protected]")
 	$(call quiet-command, if test -f $@; then \
 	  if cmp -s [email protected] $@; then \
Signature · 1 line
2.21.3
#14 lore raw

PATCH v3 11/11 hw/semihosting: Make the feature depend of TCG, and allow to disable it

In reply to Philippe Mathieu-Daudé

The semihosting feature is only meaningful when using TCG.

Do not enable it by default, and let the few targets requiring it to manually select it.
The targets restricted to TCG that previously selected it (see commit 16932bb761e52c2 'introduce CONFIG_SEMIHOSTING') are left unmodified; however the selection is moved to the target Kconfig.

---
v3: Fixed odd hidden \xC2 UTF-8 chars:

Traceback (most recent call last):
File "qemu/scripts/minikconf.py", line 355, in parse_file
self.src = fp.read()
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 21: ordinal not in range(128)

---
 default-configs/arm-softmmu.mak         | 1 -
 default-configs/lm32-softmmu.mak        | 2 --
 default-configs/m68k-softmmu.mak        | 2 --
 default-configs/mips-softmmu-common.mak | 3 ---
 default-configs/nios2-softmmu.mak       | 2 --
 default-configs/xtensa-softmmu.mak      | 2 --
 hw/semihosting/Kconfig                  | 4 +++-
 target/arm/Kconfig                      | 2 ++
 target/lm32/Kconfig                     | 2 ++
 target/m68k/Kconfig                     | 2 ++
 target/mips/Kconfig                     | 2 ++
 target/nios2/Kconfig                    | 2 ++
 target/riscv/Kconfig                    | 2 ++
 target/xtensa/Kconfig                   | 2 ++
 14 files changed, 17 insertions(+), 13 deletions(-)
 create mode 100644 target/arm/Kconfig
 create mode 100644 target/lm32/Kconfig
 create mode 100644 target/m68k/Kconfig
 create mode 100644 target/mips/Kconfig
 create mode 100644 target/nios2/Kconfig
 create mode 100644 target/riscv/Kconfig
 create mode 100644 target/xtensa/Kconfig
default-configs/arm-softmmu.mak +0 -1
index 8fc09a4a51..f6044f1121 100644
@@ -40,6 +40,5 @@ CONFIG_MICROBIT=y
 CONFIG_FSL_IMX25=y
 CONFIG_FSL_IMX7=y
 CONFIG_FSL_IMX6UL=y
-CONFIG_SEMIHOSTING=y
 CONFIG_ALLWINNER_H3=y
 CONFIG_ACPI_APEI=y
default-configs/lm32-softmmu.mak +0 -2
index 115b3e34c9..6d259665d6 100644
@@ -4,8 +4,6 @@
 #
 #CONFIG_MILKYMIST_TMU2=n        # disabling it actually causes compile-time failures
 
-CONFIG_SEMIHOSTING=y
-
 # Boards:
 #
 CONFIG_LM32=y
default-configs/m68k-softmmu.mak +0 -2
index 6629fd2aa3..4fef4bd731 100644
@@ -1,7 +1,5 @@
 # Default configuration for m68k-softmmu
 
-CONFIG_SEMIHOSTING=y
-
 # Boards:
 #
 CONFIG_AN5206=y
default-configs/mips-softmmu-common.mak +0 -3
index da29c6c0b2..6c0904b200 100644
@@ -1,8 +1,5 @@
 # Common mips*-softmmu CONFIG defines
 
-# CONFIG_SEMIHOSTING is always required on this architecture
-CONFIG_SEMIHOSTING=y
-
 CONFIG_ISA_BUS=y
 CONFIG_PCI=y
 CONFIG_PCI_DEVICES=y
default-configs/nios2-softmmu.mak +0 -2
index 1bc4082ea9..e130d024e6 100644
@@ -1,7 +1,5 @@
 # Default configuration for nios2-softmmu
 
-CONFIG_SEMIHOSTING=y
-
 # Boards:
 #
 CONFIG_NIOS2_10M50=y
default-configs/xtensa-softmmu.mak +0 -2
index 4fe1bf00c9..49e4c9da88 100644
@@ -1,7 +1,5 @@
 # Default configuration for Xtensa
 
-CONFIG_SEMIHOSTING=y
-
 # Boards:
 #
 CONFIG_XTENSA_SIM=y
hw/semihosting/Kconfig +3 -1
index efe0a30734..30befcdd21 100644
@@ -1,3 +1,5 @@
 
+# default is 'n'
 config SEMIHOSTING
-       bool
+    bool
+    depends on TCG
target/arm/Kconfig new file +2 -0
new file mode 100644
index 0000000000..035592dd86
@@ -0,0 +1,2 @@
+config SEMIHOSTING
+    default y if TCG
target/lm32/Kconfig new file +2 -0
new file mode 100644
index 0000000000..68b946e79b
@@ -0,0 +1,2 @@
+config SEMIHOSTING
+    default y
target/m68k/Kconfig new file +2 -0
new file mode 100644
index 0000000000..68b946e79b
@@ -0,0 +1,2 @@
+config SEMIHOSTING
+    default y
target/mips/Kconfig new file +2 -0
new file mode 100644
index 0000000000..035592dd86
@@ -0,0 +1,2 @@
+config SEMIHOSTING
+    default y if TCG
target/nios2/Kconfig new file +2 -0
new file mode 100644
index 0000000000..68b946e79b
@@ -0,0 +1,2 @@
+config SEMIHOSTING
+    default y
target/riscv/Kconfig new file +2 -0
new file mode 100644
index 0000000000..035592dd86
@@ -0,0 +1,2 @@
+config SEMIHOSTING
+    default y if TCG
target/xtensa/Kconfig new file +2 -0
new file mode 100644
index 0000000000..68b946e79b
@@ -0,0 +1,2 @@
+config SEMIHOSTING
+    default y
Signature · 1 line
2.21.3
#15 lore raw

Re: [PATCH v3 11/11] hw/semihosting: Make the feature depend of TCG, and allow to disable it

Quoted 14 lines · Philippe Mathieu-Daudé

+++ b/hw/semihosting/Kconfig

hw/semihosting/Kconfig +3 -1
@@ -1,3 +1,5 @@
 
+# default is 'n'
 config SEMIHOSTING
-       bool
+    bool
+    depends on TCG
target/arm/Kconfig new file +0 -0
new file mode 100644
index 0000000000..035592dd86

target/arm/Kconfig line 2

Quoted 2 lines
target/arm/Kconfig new file +2 -0
@@ -0,0 +1,2 @@
+config SEMIHOSTING
+    default y if TCG

Did you answer my question about replicating the TCG test? If you did, I missed it...

r~

#16 lore raw

Re: [PATCH v3 11/11] hw/semihosting: Make the feature depend of TCG, and allow to disable it

Quoted 4 lines · Richard Henderson
Quoted 3 lines · Philippe Mathieu-Daudé

+++ b/hw/semihosting/Kconfig

(quoted diff) +0 -0
@@ -1,3 +1,5 @@
 
Quoted 16 lines

target/arm/Kconfig line 2

Quoted 13 lines
hw/semihosting/Kconfig +3 -1
+# default is 'n'
 config SEMIHOSTING
-       bool
+    bool
+    depends on TCG
target/arm/Kconfig new file +2 -0
new file mode 100644
index 0000000000..035592dd86
@@ -0,0 +1,2 @@
+config SEMIHOSTING
+    default y if TCG

Did you answer my question about replicating the TCG test? If you did, I missed it...

Shortly before posting this series:
https://www.mail-archive.com/[email protected]/msg705992.html

There is indeed something wrong with this patch, but I'm not seeing it.

- semihosting only makes sense with TCG accelerator

This is the "depends on TCG"

- some targets (if built with TCG enabled) require semihosting

This would be a per-target "select SEMIHOSTING if TCG"

Another problem is some targets only require semihosting in system-mode; and this approach select it for both system/user modes.

Paolo... help!

#17 lore raw

Re: [PATCH v3 11/11] hw/semihosting: Make the feature depend of TCG, and allow to disable it

In reply to Philippe Mathieu-Daudé
Quoted 131 lines · Philippe Mathieu-Daudé

The semihosting feature is only meaningful when using TCG.

Do not enable it by default, and let the few targets requiring it to manually select it.
The targets restricted to TCG that previously selected it (see commit 16932bb761e52c2 'introduce CONFIG_SEMIHOSTING') are left unmodified; however the selection is moved to the target Kconfig.

---
v3: Fixed odd hidden \xC2 UTF-8 chars:

Traceback (most recent call last):
File "qemu/scripts/minikconf.py", line 355, in parse_file
self.src = fp.read()
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 21: ordinal not in range(128)

---
 default-configs/arm-softmmu.mak         | 1 -
 default-configs/lm32-softmmu.mak        | 2 --
 default-configs/m68k-softmmu.mak        | 2 --
 default-configs/mips-softmmu-common.mak | 3 ---
 default-configs/nios2-softmmu.mak       | 2 --
 default-configs/xtensa-softmmu.mak      | 2 --
 hw/semihosting/Kconfig                  | 4 +++-
 target/arm/Kconfig                      | 2 ++
 target/lm32/Kconfig                     | 2 ++
 target/m68k/Kconfig                     | 2 ++
 target/mips/Kconfig                     | 2 ++
 target/nios2/Kconfig                    | 2 ++
 target/riscv/Kconfig                    | 2 ++
 target/xtensa/Kconfig                   | 2 ++
 14 files changed, 17 insertions(+), 13 deletions(-)
 create mode 100644 target/arm/Kconfig
 create mode 100644 target/lm32/Kconfig
 create mode 100644 target/m68k/Kconfig
 create mode 100644 target/mips/Kconfig
 create mode 100644 target/nios2/Kconfig
 create mode 100644 target/riscv/Kconfig
 create mode 100644 target/xtensa/Kconfig
default-configs/arm-softmmu.mak +0 -1
index 8fc09a4a51..f6044f1121 100644
@@ -40,6 +40,5 @@ CONFIG_MICROBIT=y
 CONFIG_FSL_IMX25=y
 CONFIG_FSL_IMX7=y
 CONFIG_FSL_IMX6UL=y
-CONFIG_SEMIHOSTING=y
 CONFIG_ALLWINNER_H3=y
 CONFIG_ACPI_APEI=y
default-configs/lm32-softmmu.mak +0 -2
index 115b3e34c9..6d259665d6 100644
@@ -4,8 +4,6 @@
 #
 #CONFIG_MILKYMIST_TMU2=n        # disabling it actually causes compile-time failures
 
-CONFIG_SEMIHOSTING=y
-
 # Boards:
 #
 CONFIG_LM32=y
default-configs/m68k-softmmu.mak +0 -2
index 6629fd2aa3..4fef4bd731 100644
@@ -1,7 +1,5 @@
 # Default configuration for m68k-softmmu
 
-CONFIG_SEMIHOSTING=y
-
 # Boards:
 #
 CONFIG_AN5206=y
default-configs/mips-softmmu-common.mak +0 -3
index da29c6c0b2..6c0904b200 100644
@@ -1,8 +1,5 @@
 # Common mips*-softmmu CONFIG defines
 
-# CONFIG_SEMIHOSTING is always required on this architecture
-CONFIG_SEMIHOSTING=y
-
 CONFIG_ISA_BUS=y
 CONFIG_PCI=y
 CONFIG_PCI_DEVICES=y
default-configs/nios2-softmmu.mak +0 -2
index 1bc4082ea9..e130d024e6 100644
@@ -1,7 +1,5 @@
 # Default configuration for nios2-softmmu
 
-CONFIG_SEMIHOSTING=y
-
 # Boards:
 #
 CONFIG_NIOS2_10M50=y
default-configs/xtensa-softmmu.mak +0 -2
index 4fe1bf00c9..49e4c9da88 100644
@@ -1,7 +1,5 @@
 # Default configuration for Xtensa
 
-CONFIG_SEMIHOSTING=y
-
 # Boards:
 #
 CONFIG_XTENSA_SIM=y
hw/semihosting/Kconfig +3 -1
index efe0a30734..30befcdd21 100644
@@ -1,3 +1,5 @@
 
+# default is 'n'
 config SEMIHOSTING
-       bool
+    bool
+    depends on TCG
target/arm/Kconfig new file +0 -0
new file mode 100644
index 0000000000..035592dd86

target/arm/Kconfig line 2

Quoted 2 lines
target/arm/Kconfig new file +2 -0
@@ -0,0 +1,2 @@
+config SEMIHOSTING
+    default y if TCG

This patch is incorrect, because previously the feature was selected for system-mode only, and now it is selected in user-mode too.

[...]

#18 lore raw
In reply to Philippe Mathieu-Daudé
Patchew URL: https://patchew.org/QEMU/[email protected]/

Patchew URL: https://patchew.org/QEMU/[email protected]/

Hi,

This series failed the docker-quick@centos7 build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally.

=== TEST SCRIPT BEGIN ===
#!/bin/bash
make docker-image-centos7 V=1 NETWORK=1
time make docker-test-quick@centos7 SHOW_ENV=1 J=14 NETWORK=1 === TEST SCRIPT END ===

TEST iotest-qcow2: 040
socket_accept failed: Resource temporarily unavailable
**
ERROR:/tmp/qemu-test/src/tests/qtest/libqtest.c:301:qtest_init_without_qmp_handshake: assertion failed: (s->fd >= 0 && s->qmp_fd >= 0)
/tmp/qemu-test/src/tests/qtest/libqtest.c:166: kill_qemu() tried to terminate QEMU process but encountered exit status 1 (expected 0)
ERROR - Bail out! ERROR:/tmp/qemu-test/src/tests/qtest/libqtest.c:301:qtest_init_without_qmp_handshake: assertion failed: (s->fd >= 0 && s->qmp_fd >= 0)
make: *** [check-qtest-x86_64] Error 1
make: *** Waiting for unfinished jobs....
TEST iotest-qcow2: 041
TEST iotest-qcow2: 042
---
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=42446f1cb3d84b08973bc47e5fc241a2', '-u', '1003', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=1', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew2/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-m5v271eo/src/docker-src.2020-05-21-22.14.17.8285:/var/tmp/qemu:z,ro', 'qemu:centos7', '/var/tmp/qemu/run', 'test-quick']' returned non-zero exit status 2. filter=--filter=label=com.qemu.instance.uuid=42446f1cb3d84b08973bc47e5fc241a2
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-m5v271eo/src'
make: *** [docker-run-test-quick@centos7] Error 2

real 15m44.566s
user 0m8.933s

The full log is available at
http://patchew.org/logs/[email protected]/testing.docker-quick@centos7/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]