Skip to contentSkip to conversation

semihosting: Restrict to TCG

PATCH Superseded Philippe Mathieu-Daudé 3 participants 11 messages May 30, 2024 – Jun 10, 2024 RISC-V

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v2 cover semihosting: Restrict to TCG

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é (3):
target/mips: Restrict semihosting to TCG target/riscv: Restrict semihosting to TCG
semihosting: Restrict to TCG

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

PATCH v2 1/3 target/mips: 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/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
Reviewed-by Anton Johansson on v2 1/3
#2 lore raw

Re: [PATCH v2 1/3] target/mips: Restrict semihosting to TCG

Quoted 9 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.

---
 target/mips/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

xtensa and m68k also select SEMIHOSTING, were these missed?

Otherwise for patch 1 & 2:

#3 lore raw

Re: [PATCH v2 1/3] target/mips: Restrict semihosting to TCG

Quoted 5 lines · Anton Johansson
Quoted 4 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.

Quoted 7 lines
Quoted 5 lines
---
  target/mips/Kconfig | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

xtensa and m68k also select SEMIHOSTING, were these missed?

TCG is the only accelerator they use, so it is kinda implicit, but you are right, I'll update for completeness.

Quoted 2 lines

Otherwise for patch 1 & 2:

Thanks!

#4 lore raw

Re: [PATCH v2 1/3] target/mips: Restrict semihosting to TCG

Quoted 11 lines · Philippe Mathieu-Daudé
Quoted 10 lines · Anton Johansson
Quoted 9 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.

---
  target/mips/Kconfig | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 4 lines
Quoted 1 line

xtensa and m68k also select SEMIHOSTING, were these missed?

TCG is the only accelerator they use, so it is kinda implicit, but you are right, I'll update for completeness.

So I'll wait for a v3?

Quoted 5 lines
Quoted 3 lines

Otherwise for patch 1 & 2:

Thanks!

Signature · 2 lines
Alex Bennée
Virtualisation Tech Lead @ Linaro
#5 lore raw

Re: [PATCH v2 1/3] target/mips: Restrict semihosting to TCG

Quoted 13 lines · Alex Bennée
Quoted 11 lines · Philippe Mathieu-Daudé
Quoted 10 lines · Anton Johansson
Quoted 9 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.

---
   target/mips/Kconfig | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 6 lines
Quoted 4 lines
Quoted 1 line

xtensa and m68k also select SEMIHOSTING, were these missed?

TCG is the only accelerator they use, so it is kinda implicit, but you are right, I'll update for completeness.

So I'll wait for a v3?

Yes, on the way...

#6 lore raw

PATCH v2 2/3 target/riscv: 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/riscv/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
target/riscv/Kconfig +2 -2
index 5f30df22f2..cbafbedaeb 100644
@@ -1,9 +1,9 @@
 config RISCV32
     bool
-    select ARM_COMPATIBLE_SEMIHOSTING # for do_common_semihosting()
+    imply ARM_COMPATIBLE_SEMIHOSTING if TCG # for do_common_semihosting()
     select DEVICE_TREE # needed by boot.c
 
 config RISCV64
     bool
-    select ARM_COMPATIBLE_SEMIHOSTING # for do_common_semihosting()
+    imply ARM_COMPATIBLE_SEMIHOSTING if TCG # for do_common_semihosting()
     select DEVICE_TREE # needed by boot.c
Signature · 1 line
2.41.0
#7 lore raw

PATCH v2 3/3 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
#8 lore raw
In reply to Philippe Mathieu-Daudé
Quoted 1 line · Philippe Mathieu-Daudé

v2: Address Paolo's comment

Missing review: 1 & 2

Quoted 18 lines

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é (3):
target/mips: Restrict semihosting to TCG target/riscv: Restrict semihosting to TCG
semihosting: Restrict to TCG

  semihosting/Kconfig  | 1 +
  target/mips/Kconfig  | 2 +-
  target/riscv/Kconfig | 4 ++--
  3 files changed, 4 insertions(+), 3 deletions(-)
#9 lore raw

Kind ping :)

Quoted 24 lines · Philippe Mathieu-Daudé
Quoted 1 line · Philippe Mathieu-Daudé

v2: Address Paolo's comment

Missing review: 1 & 2

Quoted 18 lines

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é (3):
   target/mips: Restrict semihosting to TCG target/riscv: Restrict semihosting to TCG
   semihosting: Restrict to TCG

  semihosting/Kconfig  | 1 +
  target/mips/Kconfig  | 2 +-
  target/riscv/Kconfig | 4 ++--

  3 files changed, 4 insertions(+), 3 deletions(-)
#10 lore raw
Quoted 1 line · Philippe Mathieu-Daudé

Kind ping :)

I'm off today, I'll take a look tomorrow morning!:) //Anton