diff mbox series

[RFC,v3,27/28] arm/Kconfig: Always select SEMIHOSTING when TCG is present

Message ID 20230113140419.4013-28-farosas@suse.de
State New
Headers show
Series target/arm: Allow CONFIG_TCG=n builds | expand

Commit Message

Fabiano Rosas Jan. 13, 2023, 2:04 p.m. UTC
We are about to enable the build without TCG, so CONFIG_SEMIHOSTING
and CONFIG_ARM_COMPATIBLE_SEMIHOSTING cannot be unconditionally set in
default.mak anymore. So reflect the change in a Kconfig.

Instead of using semihosting/Kconfig, use a target-specific file, so
that the change doesn't affect other architectures which might
implement semihosting in a way compatible with KVM.

The selection from ARM_v7M needs to be removed to avoid a cycle during
parsing.

Signed-off-by: Fabiano Rosas <farosas@suse.de>
---
 configs/devices/arm-softmmu/default.mak | 2 --
 hw/arm/Kconfig                          | 1 -
 target/arm/Kconfig                      | 7 +++++++
 3 files changed, 7 insertions(+), 3 deletions(-)

Comments

Richard Henderson Jan. 13, 2023, 10:39 p.m. UTC | #1
On 1/13/23 06:04, Fabiano Rosas wrote:
> We are about to enable the build without TCG, so CONFIG_SEMIHOSTING
> and CONFIG_ARM_COMPATIBLE_SEMIHOSTING cannot be unconditionally set in
> default.mak anymore. So reflect the change in a Kconfig.
> 
> Instead of using semihosting/Kconfig, use a target-specific file, so
> that the change doesn't affect other architectures which might
> implement semihosting in a way compatible with KVM.
> 
> The selection from ARM_v7M needs to be removed to avoid a cycle during
> parsing.
> 
> Signed-off-by: Fabiano Rosas <farosas@suse.de>
> ---
>   configs/devices/arm-softmmu/default.mak | 2 --
>   hw/arm/Kconfig                          | 1 -
>   target/arm/Kconfig                      | 7 +++++++
>   3 files changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/configs/devices/arm-softmmu/default.mak b/configs/devices/arm-softmmu/default.mak
> index 6985a25377..24fb5f0366 100644
> --- a/configs/devices/arm-softmmu/default.mak
> +++ b/configs/devices/arm-softmmu/default.mak
> @@ -39,6 +39,4 @@ CONFIG_MICROBIT=y
>   CONFIG_FSL_IMX25=y
>   CONFIG_FSL_IMX7=y
>   CONFIG_FSL_IMX6UL=y
> -CONFIG_SEMIHOSTING=y
> -CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y

All of the arm linux-user configs need updating too.

>   CONFIG_ALLWINNER_H3=y
> diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
> index 17fcde8e1c..e6f984fea8 100644
> --- a/hw/arm/Kconfig
> +++ b/hw/arm/Kconfig
> @@ -312,7 +312,6 @@ config ARM_V7M
>       # currently v7M must be included in a TCG build due to translate.c
>       default y if TCG && (ARM || AARCH64)
>       select PTIMER
> -    select ARM_COMPATIBLE_SEMIHOSTING
>   
>   config ALLWINNER_A10
>       bool
> diff --git a/target/arm/Kconfig b/target/arm/Kconfig
> index 3f3394a22b..60278ea9f7 100644
> --- a/target/arm/Kconfig
> +++ b/target/arm/Kconfig
> @@ -4,3 +4,10 @@ config ARM
>   config AARCH64
>       bool
>       select ARM
> +
> +# This config exists just so we can make SEMIHOSTING default when TCG
> +# is selected without also changing it for other architectures.
> +config ARM_SEMIHOSTING
> +    bool
> +    default y if TCG && (ARM || AARCH64)
> +    select ARM_COMPATIBLE_SEMIHOSTING

AARCH64 implies ARM, so shouldn't have to check for both.

It would be even better if there were another way to do this, like

config SEMIHOSTING
	depends on TCG

but I suppose that winds up with a conflict.
It's just that we're eventually going to have the same issue with riscv.


r~
diff mbox series

Patch

diff --git a/configs/devices/arm-softmmu/default.mak b/configs/devices/arm-softmmu/default.mak
index 6985a25377..24fb5f0366 100644
--- a/configs/devices/arm-softmmu/default.mak
+++ b/configs/devices/arm-softmmu/default.mak
@@ -39,6 +39,4 @@  CONFIG_MICROBIT=y
 CONFIG_FSL_IMX25=y
 CONFIG_FSL_IMX7=y
 CONFIG_FSL_IMX6UL=y
-CONFIG_SEMIHOSTING=y
-CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y
 CONFIG_ALLWINNER_H3=y
diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
index 17fcde8e1c..e6f984fea8 100644
--- a/hw/arm/Kconfig
+++ b/hw/arm/Kconfig
@@ -312,7 +312,6 @@  config ARM_V7M
     # currently v7M must be included in a TCG build due to translate.c
     default y if TCG && (ARM || AARCH64)
     select PTIMER
-    select ARM_COMPATIBLE_SEMIHOSTING
 
 config ALLWINNER_A10
     bool
diff --git a/target/arm/Kconfig b/target/arm/Kconfig
index 3f3394a22b..60278ea9f7 100644
--- a/target/arm/Kconfig
+++ b/target/arm/Kconfig
@@ -4,3 +4,10 @@  config ARM
 config AARCH64
     bool
     select ARM
+
+# This config exists just so we can make SEMIHOSTING default when TCG
+# is selected without also changing it for other architectures.
+config ARM_SEMIHOSTING
+    bool
+    default y if TCG && (ARM || AARCH64)
+    select ARM_COMPATIBLE_SEMIHOSTING