Skip to contentSkip to conversation

semihosting: Restrict to TCG

PATCH Applied Philippe Mathieu-Daudé 4 participants 9 messages Jun 10, 2024 – Jun 11, 2024 RISC-V

v3 of 4 Applied Latest is v4 →

lore
Share & tools
lore
#1 lore raw

PATCH v3 1/5 target/m68k: Restrict semihosting to TCG

In reply to Philippe Mathieu-Daudé

The semihosting feature depends on TCG (due to the probe_access API access). Although TCG is the single accelerator currently available for the m68k target, use the Kconfig "imply" directive which is more correct (if we were to support a different accel).

---
 target/m68k/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target/m68k/Kconfig +1 -1
index 9eae71486f..23aae24ebe 100644
@@ -1,3 +1,3 @@
 config M68K
     bool
-    select SEMIHOSTING
+    imply SEMIHOSTING if TCG
Signature · 1 line
2.41.0
#0 lore raw

v3 cover semihosting: Restrict to TCG

v3: Address Anton's comment
v2: Address Paolo's comment

Semihosting currently uses the TCG probe_access API, so it is pointless to have it in the binary when TCG isn't.

It could be implemented for other accelerators, but work need to be done. Meanwhile, do not enable it unless TCG is available.

Philippe Mathieu-Daudé (5):
target/m68k: Restrict semihosting to TCG target/xtensa: Restrict semihosting to TCG target/mips: Restrict semihosting to TCG target/riscv: Restrict semihosting to TCG
semihosting: Restrict to TCG

 semihosting/Kconfig   | 1 +
 target/m68k/Kconfig   | 2 +-
 target/mips/Kconfig   | 2 +-
 target/riscv/Kconfig  | 4 ++--
 target/xtensa/Kconfig | 2 +-
 5 files changed, 6 insertions(+), 5 deletions(-)
Signature · 1 line
2.41.0
#5 lore raw

PATCH v3 4/5 target/riscv: Restrict semihosting to TCG

Semihosting currently uses the TCG probe_access API. To prepare for encoding the TCG dependency in Kconfig, do not enable it unless TCG is available.

---
 target/riscv/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
target/riscv/Kconfig +2 -2
index 5f30df22f2..c332616d36 100644
@@ -1,9 +1,9 @@
 config RISCV32
     bool
-    select ARM_COMPATIBLE_SEMIHOSTING # for do_common_semihosting()
+    imply ARM_COMPATIBLE_SEMIHOSTING if TCG
     select DEVICE_TREE # needed by boot.c
 
 config RISCV64
     bool
-    select ARM_COMPATIBLE_SEMIHOSTING # for do_common_semihosting()
+    imply ARM_COMPATIBLE_SEMIHOSTING if TCG
     select DEVICE_TREE # needed by boot.c
Signature · 1 line
2.41.0
#2 lore raw

PATCH v3 2/5 target/xtensa: Restrict semihosting to TCG

In reply to Philippe Mathieu-Daudé

The semihosting feature depends on TCG (due to the probe_access API access). Although TCG is the single accelerator currently available for the xtensa target, use the Kconfig "imply" directive which is more correct (if we were to support a different accel).

---
 target/xtensa/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target/xtensa/Kconfig +1 -1
index 5e46049262..e8c2598c4d 100644
@@ -1,3 +1,3 @@
 config XTENSA
     bool
-    select SEMIHOSTING
+    imply SEMIHOSTING if TCG
Signature · 1 line
2.41.0
#7 lore raw

PATCH v3 5/5 semihosting: Restrict to TCG

In reply to Philippe Mathieu-Daudé

Semihosting currently uses the TCG probe_access API. It is pointless to have it in the binary when TCG isn't.

---
 semihosting/Kconfig | 1 +
 1 file changed, 1 insertion(+)
semihosting/Kconfig +1 -0
index eaf3a20ef5..fbe6ac87f9 100644
@@ -1,6 +1,7 @@
 
 config SEMIHOSTING
        bool
+       depends on TCG
 
 config ARM_COMPATIBLE_SEMIHOSTING
        bool
Signature · 1 line
2.41.0
#4 lore raw

PATCH v3 3/5 target/mips: Restrict semihosting to TCG

In reply to Philippe Mathieu-Daudé

Semihosting currently uses the TCG probe_access API. To prepare for encoding the TCG dependency in Kconfig, do not enable it unless TCG is available.

---
 target/mips/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target/mips/Kconfig +1 -1
index eb19c94c7d..876048b150 100644
@@ -1,6 +1,6 @@
 config MIPS
     bool
-    select SEMIHOSTING
+    imply SEMIHOSTING if TCG
 
 config MIPS64
     bool
Signature · 1 line
2.41.0
Acked-by on v3 2/5
#3 lore raw

Re: [PATCH v3 2/5] target/xtensa: Restrict semihosting to TCG

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

The semihosting feature depends on TCG (due to the probe_access API access). Although TCG is the single accelerator currently available for the xtensa target, use the Kconfig "imply" directive which is more correct (if we were to support a different accel).

---
 target/xtensa/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 2 lines
Thanks.
-- Max
Acked-by on v3 4/5
#6 lore raw

Re: [PATCH v3 4/5] target/riscv: Restrict semihosting to TCG

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

Semihosting currently uses the TCG probe_access API. To prepare for encoding the TCG dependency in Kconfig, do not enable it unless TCG is available.

Alistair

Quoted 24 lines
---
 target/riscv/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
target/riscv/Kconfig +2 -3
index 5f30df22f2..c332616d36 100644
@@ -1,9 +1,9 @@
 config RISCV32
     bool
-    select ARM_COMPATIBLE_SEMIHOSTING # for do_common_semihosting()
+    imply ARM_COMPATIBLE_SEMIHOSTING if TCG
     select DEVICE_TREE # needed by boot.c
 
 config RISCV64
     bool
-    select ARM_COMPATIBLE_SEMIHOSTING # for do_common_semihosting()
+    imply ARM_COMPATIBLE_SEMIHOSTING if TCG
     select DEVICE_TREE # needed by boot.c
--

2.41.0

Applied
#8 lore raw
In reply to Philippe Mathieu-Daudé
Quoted 10 lines · Philippe Mathieu-Daudé

v3: Address Anton's comment
v2: Address Paolo's comment

Semihosting currently uses the TCG probe_access API, so it is pointless to have it in the binary when TCG isn't.

It could be implemented for other accelerators, but work need to be done. Meanwhile, do not enable it unless TCG is available.

Queued to semihosting/next, thanks.

Signature · 2 lines
Alex Bennée
Virtualisation Tech Lead @ Linaro