diff mbox series

[v2,08/14] target/mips: Protect objects with CONFIG_TCG

Message ID 20250203031821.741477-9-richard.henderson@linaro.org
State New
Headers show
Series meson: Deprecate 32-bit host support | expand

Commit Message

Richard Henderson Feb. 3, 2025, 3:18 a.m. UTC
Hack around mips32 host allowing kvm acceleration
of mips64 guest, but tcg is disabled.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/mips/tcg/meson.build        | 4 ++--
 target/mips/tcg/system/meson.build | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

Comments

Thomas Huth Feb. 3, 2025, 10:24 a.m. UTC | #1
On 03/02/2025 04.18, Richard Henderson wrote:
> Hack around mips32 host allowing kvm acceleration
> of mips64 guest, but tcg is disabled.
> 
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>   target/mips/tcg/meson.build        | 4 ++--
>   target/mips/tcg/system/meson.build | 6 +++---
>   2 files changed, 5 insertions(+), 5 deletions(-)

Reviewed-by: Thomas Huth <thuth@redhat.com>
Philippe Mathieu-Daudé Feb. 3, 2025, 5:25 p.m. UTC | #2
Hi Richard,

On 3/2/25 04:18, Richard Henderson wrote:
> Hack around mips32 host allowing kvm acceleration
> of mips64 guest, but tcg is disabled.

We have in target/mips/meson.build:

if 'CONFIG_TCG' in config_all_accel
   subdir('tcg')
endif

What is the problem you are trying to address here?

> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>   target/mips/tcg/meson.build        | 4 ++--
>   target/mips/tcg/system/meson.build | 6 +++---
>   2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/target/mips/tcg/meson.build b/target/mips/tcg/meson.build
> index fff9cd6c7f..e5574f177b 100644
> --- a/target/mips/tcg/meson.build
> +++ b/target/mips/tcg/meson.build
> @@ -10,7 +10,7 @@ gen = [
>   ]
>   
>   mips_ss.add(gen)
> -mips_ss.add(files(
> +mips_ss.add(when: 'CONFIG_TCG', if_true: files(
>     'dsp_helper.c',
>     'exception.c',
>     'fpu_helper.c',
> @@ -26,7 +26,7 @@ mips_ss.add(files(
>     'vr54xx_helper.c',
>     'vr54xx_translate.c',
>   ))
> -mips_ss.add(when: 'TARGET_MIPS64', if_true: files(
> +mips_ss.add(when: ['CONFIG_TCG', 'TARGET_MIPS64'], if_true: files(
>     'tx79_translate.c',
>     'octeon_translate.c',
>     'lcsr_translate.c',
> diff --git a/target/mips/tcg/system/meson.build b/target/mips/tcg/system/meson.build
> index 911341ac37..606ccacebc 100644
> --- a/target/mips/tcg/system/meson.build
> +++ b/target/mips/tcg/system/meson.build
> @@ -1,12 +1,12 @@
> -mips_system_ss.add(files(
> +mips_system_ss.add(when: 'CONFIG_TCG', if_true: files(
>     'cp0_helper.c',
>     'special_helper.c',
>     'tlb_helper.c',
>   ))
> -mips_system_ss.add(when: ['CONFIG_SEMIHOSTING'],
> +mips_system_ss.add(when: ['CONFIG_TCG', 'CONFIG_SEMIHOSTING'],
>     if_true: files('mips-semi.c'),
>     if_false: files('semihosting-stub.c')
>   )
> -mips_system_ss.add(when: 'TARGET_MIPS64', if_true: files(
> +mips_system_ss.add(when: ['CONFIG_TCG', 'TARGET_MIPS64'], if_true: files(
>     'lcsr_helper.c',
>   ))
Richard Henderson Feb. 3, 2025, 6:01 p.m. UTC | #3
On 2/3/25 09:25, Philippe Mathieu-Daudé wrote:
> Hi Richard,
> 
> On 3/2/25 04:18, Richard Henderson wrote:
>> Hack around mips32 host allowing kvm acceleration
>> of mips64 guest, but tcg is disabled.
> 
> We have in target/mips/meson.build:
> 
> if 'CONFIG_TCG' in config_all_accel
>    subdir('tcg')
> endif
> 
> What is the problem you are trying to address here?

That test is for CONFIG_TCG enabled for *any* target (config_all_accel).

E.g. qemu-system-mips on mipsel host has TCG enabled.

>> +mips_ss.add(when: 'CONFIG_TCG', if_true: files(

This test is for CONFIG_TCG enabled for a specific target (config_target).

E.g. qemu-system-mips64 on mipsel host does not have TCG enabled.
But it does have kvm enabled, so the target isn't entirely disabled.

Paolo's reply to the cover suggests this usage might be killable as well, so that we 
require a mips64el host to spawn mips64el guests, and all of this goes away.


r~
diff mbox series

Patch

diff --git a/target/mips/tcg/meson.build b/target/mips/tcg/meson.build
index fff9cd6c7f..e5574f177b 100644
--- a/target/mips/tcg/meson.build
+++ b/target/mips/tcg/meson.build
@@ -10,7 +10,7 @@  gen = [
 ]
 
 mips_ss.add(gen)
-mips_ss.add(files(
+mips_ss.add(when: 'CONFIG_TCG', if_true: files(
   'dsp_helper.c',
   'exception.c',
   'fpu_helper.c',
@@ -26,7 +26,7 @@  mips_ss.add(files(
   'vr54xx_helper.c',
   'vr54xx_translate.c',
 ))
-mips_ss.add(when: 'TARGET_MIPS64', if_true: files(
+mips_ss.add(when: ['CONFIG_TCG', 'TARGET_MIPS64'], if_true: files(
   'tx79_translate.c',
   'octeon_translate.c',
   'lcsr_translate.c',
diff --git a/target/mips/tcg/system/meson.build b/target/mips/tcg/system/meson.build
index 911341ac37..606ccacebc 100644
--- a/target/mips/tcg/system/meson.build
+++ b/target/mips/tcg/system/meson.build
@@ -1,12 +1,12 @@ 
-mips_system_ss.add(files(
+mips_system_ss.add(when: 'CONFIG_TCG', if_true: files(
   'cp0_helper.c',
   'special_helper.c',
   'tlb_helper.c',
 ))
-mips_system_ss.add(when: ['CONFIG_SEMIHOSTING'],
+mips_system_ss.add(when: ['CONFIG_TCG', 'CONFIG_SEMIHOSTING'],
   if_true: files('mips-semi.c'),
   if_false: files('semihosting-stub.c')
 )
-mips_system_ss.add(when: 'TARGET_MIPS64', if_true: files(
+mips_system_ss.add(when: ['CONFIG_TCG', 'TARGET_MIPS64'], if_true: files(
   'lcsr_helper.c',
 ))