diff mbox series

[v2,27/42] target/mips: Restrict semihosting tests to system mode

Message ID 20250318213209.2579218-28-richard.henderson@linaro.org
State New
Headers show
Series accel/tcg, codebase: Build once patches | expand

Commit Message

Richard Henderson March 18, 2025, 9:31 p.m. UTC
We do not set CONFIG_SEMIHOSTING in
configs/targets/mips*-linux-user.mak.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/mips/cpu.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Pierrick Bouvier March 19, 2025, 12:26 a.m. UTC | #1
On 3/18/25 14:31, Richard Henderson wrote:
> We do not set CONFIG_SEMIHOSTING in
> configs/targets/mips*-linux-user.mak.
> 
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>   target/mips/cpu.c | 7 ++++---
>   1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/target/mips/cpu.c b/target/mips/cpu.c
> index b207106dd7..47df563e12 100644
> --- a/target/mips/cpu.c
> +++ b/target/mips/cpu.c
> @@ -32,8 +32,10 @@
>   #include "exec/exec-all.h"
>   #include "hw/qdev-properties.h"
>   #include "hw/qdev-clock.h"
> -#include "semihosting/semihost.h"
>   #include "fpu_helper.h"
> +#ifndef CONFIG_USER_ONLY
> +#include "semihosting/semihost.h"
> +#endif
>   
>   const char regnames[32][3] = {
>       "r0", "at", "v0", "v1", "a0", "a1", "a2", "a3",
> @@ -415,12 +417,11 @@ static void mips_cpu_reset_hold(Object *obj, ResetType type)
>       restore_pamask(env);
>       cs->exception_index = EXCP_NONE;
>   
> +#ifndef CONFIG_USER_ONLY
>       if (semihosting_get_argc()) {
>           /* UHI interface can be used to obtain argc and argv */
>           env->active_tc.gpr[4] = -1;
>       }
> -
> -#ifndef CONFIG_USER_ONLY
>       if (kvm_enabled()) {
>           kvm_mips_reset_vcpu(cpu);
>       }

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
diff mbox series

Patch

diff --git a/target/mips/cpu.c b/target/mips/cpu.c
index b207106dd7..47df563e12 100644
--- a/target/mips/cpu.c
+++ b/target/mips/cpu.c
@@ -32,8 +32,10 @@ 
 #include "exec/exec-all.h"
 #include "hw/qdev-properties.h"
 #include "hw/qdev-clock.h"
-#include "semihosting/semihost.h"
 #include "fpu_helper.h"
+#ifndef CONFIG_USER_ONLY
+#include "semihosting/semihost.h"
+#endif
 
 const char regnames[32][3] = {
     "r0", "at", "v0", "v1", "a0", "a1", "a2", "a3",
@@ -415,12 +417,11 @@  static void mips_cpu_reset_hold(Object *obj, ResetType type)
     restore_pamask(env);
     cs->exception_index = EXCP_NONE;
 
+#ifndef CONFIG_USER_ONLY
     if (semihosting_get_argc()) {
         /* UHI interface can be used to obtain argc and argv */
         env->active_tc.gpr[4] = -1;
     }
-
-#ifndef CONFIG_USER_ONLY
     if (kvm_enabled()) {
         kvm_mips_reset_vcpu(cpu);
     }