Re: [PATCH v3 10/19] target/arm: Restrict ARMv4 cpus to TCG accel

2020-04-23 Thread Philippe Mathieu-Daudé

On 3/16/20 5:06 PM, Philippe Mathieu-Daudé wrote:

KVM requires a cpu based on (at least) the ARMv7 architecture.

Only enable the following ARMv4 CPUs when TCG is available:

   - StrongARM (SA1100/1110)
   - OMAP1510 (TI925T)



I missed to explain, the point of this Kconfig granularity is on a KVM 
only build, the TCG-only CPUs can't be default-selected, so most of 
their devices are not pulled in.


Instead at the end the KVM-only binary only contains the devices 
required to run the Cortex-A machines.



diff --git a/default-configs/arm-softmmu.mak b/default-configs/arm-softmmu.mak
index 8b89d8c4c0..0652396296 100644
--- a/default-configs/arm-softmmu.mak
+++ b/default-configs/arm-softmmu.mak
@@ -17,8 +17,6 @@ CONFIG_INTEGRATOR=y
  CONFIG_FSL_IMX31=y
  CONFIG_MUSICPAL=y
  CONFIG_MUSCA=y
-CONFIG_CHEETAH=y
-CONFIG_SX1=y
  CONFIG_NSERIES=y
  CONFIG_STELLARIS=y
  CONFIG_REALVIEW=y

[...]

diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
index e3d7e7694a..7fc0cff776 100644
--- a/hw/arm/Kconfig
+++ b/hw/arm/Kconfig
@@ -28,6 +28,7 @@ config ARM_VIRT
  
  config CHEETAH

  bool
+select ARM_V4
  select OMAP
  select TSC210X
  
@@ -242,6 +243,7 @@ config COLLIE
  
  config SX1

  bool
+select ARM_V4
  select OMAP
  
  config VERSATILE

diff --git a/target/arm/Kconfig b/target/arm/Kconfig
index e68c71a6ff..0d496d318a 100644
--- a/target/arm/Kconfig
+++ b/target/arm/Kconfig
@@ -1,2 +1,6 @@
+config ARM_V4
+depends on TCG
+bool
+
  config ARM_V7M
  bool





Re: [PATCH v3 10/19] target/arm: Restrict ARMv4 cpus to TCG accel

2020-03-16 Thread Richard Henderson
On 3/16/20 9:06 AM, Philippe Mathieu-Daudé wrote:
> +static const ARMCPUInfo arm_v4_cpus[] = {
> +{ .name = "ti925t",  .initfn = ti925t_initfn },
> +{ .name = "sa1100",  .initfn = sa1100_initfn },
> +{ .name = "sa1110",  .initfn = sa1110_initfn },
> +{ .name = NULL }
> +};
> +
> +static void arm_v4_cpu_register_types(void)
> +{
> +const ARMCPUInfo *info = arm_v4_cpus;
> +
> +while (info->name) {
> +arm_cpu_register(info);
> +info++;
> +}
> +}

I much prefer ARRAY_SIZE() to sentinels.
I know the existing code make much use of them,
but we don't need to replicate that here.


r~



Re: [PATCH v3 10/19] target/arm: Restrict ARMv4 cpus to TCG accel

2020-03-16 Thread Richard Henderson
On 3/16/20 12:50 PM, Richard Henderson wrote:
> I much prefer ARRAY_SIZE() to sentinels.
> I know the existing code make much use of them,
> but we don't need to replicate that here.

... but otherwise,
Reviewed-by: Richard Henderson 


r~