Skip to contentSkip to conversation

Support disabling TCG on ARM (part 2)

PATCH Superseded Philippe Mathieu-Daudé 3 participants 14 messages Aug 23, 2019 – Aug 30, 2019

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

cover Support disabling TCG on ARM (part 2)

Cover from Samuel Ortiz from (part 1) [1]:

This patchset allows for building and running ARM targets with TCG disabled. [...]

The rationale behind this work comes from the NEMU project where we're trying to only support x86 and ARM 64-bit architectures, without including the TCG code base. We can only do so if we can build and run ARM binaries with TCG disabled.

The first 2 patches disable non-KVM compatible cpus to the KVM build, then the last 2 remove the boards using these cpus from this build.

This is a resend (no changes) of patches from part 1 v4 from [2].

Regards,

Phil.

[1]: https://lists.gnu.org/archive/html/qemu-devel/2018-11/msg02451.html
[2]: https://lists.gnu.org/archive/html/qemu-devel/2019-07/msg00312.html

Philippe Mathieu-Daudé (4):
target/arm: Restrict pre-ARMv7 cpus to TCG target/arm: Restrict R and M profiles to TCG
RFC target/arm: Do not build pre-ARMv7 cpus when using KVM RFC target/arm: Do not build A/M-profile cpus when using KVM

 default-configs/arm-softmmu.mak | 47 +++++++++++++++------------------
 hw/arm/Kconfig                  | 42 ++++++++++++++++++++++++++---
 target/arm/cpu.c                | 16 ++++++++++-
 3 files changed, 76 insertions(+), 29 deletions(-)
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/4 target/arm: Restrict pre-ARMv7 cpus to TCG

KVM requires at least a ARMv7 cpu.

---
 target/arm/cpu.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
target/arm/cpu.c +12 -0
index 2399c14471..522485a2de 100644
@@ -1678,6 +1678,8 @@ static ObjectClass *arm_cpu_class_by_name(const char *cpu_model)
 /* CPU models. These are not needed for the AArch64 linux-user build. */
 #if !defined(CONFIG_USER_ONLY) || !defined(TARGET_AARCH64)
 
+#ifdef CONFIG_TCG
+
 static void arm926_initfn(Object *obj)
 {
     ARMCPU *cpu = ARM_CPU(obj);
@@ -1900,6 +1902,8 @@ static void cortex_m0_initfn(Object *obj)
     cpu->midr = 0x410cc200;
 }
 
+#endif
+
 static void cortex_m3_initfn(Object *obj)
 {
     ARMCPU *cpu = ARM_CPU(obj);
@@ -2283,6 +2287,8 @@ static void cortex_a15_initfn(Object *obj)
     define_arm_cp_regs(cpu, cortexa15_cp_reginfo);
 }
 
+#ifdef CONFIG_TCG
+
 static void ti925t_initfn(Object *obj)
 {
     ARMCPU *cpu = ARM_CPU(obj);
@@ -2451,6 +2457,8 @@ static void pxa270c5_initfn(Object *obj)
     cpu->reset_sctlr = 0x00000078;
 }
 
+#endif
+
 #ifndef TARGET_AARCH64
 /* -cpu max: if KVM is enabled, like -cpu host (best possible with this host);
  * otherwise, a CPU with as many features enabled as our emulation supports.
@@ -2523,6 +2531,7 @@ struct ARMCPUInfo {
 
 static const ARMCPUInfo arm_cpus[] = {
 #if !defined(CONFIG_USER_ONLY) || !defined(TARGET_AARCH64)
+#ifdef CONFIG_TCG
     { .name = "arm926",      .initfn = arm926_initfn },
     { .name = "arm946",      .initfn = arm946_initfn },
     { .name = "arm1026",     .initfn = arm1026_initfn },
@@ -2535,6 +2544,7 @@ static const ARMCPUInfo arm_cpus[] = {
     { .name = "arm1176",     .initfn = arm1176_initfn },
     { .name = "arm11mpcore", .initfn = arm11mpcore_initfn },
     { .name = "cortex-m0",   .initfn = cortex_m0_initfn,
+#endif
                              .class_init = arm_v7m_class_init },
     { .name = "cortex-m3",   .initfn = cortex_m3_initfn,
                              .class_init = arm_v7m_class_init },
@@ -2548,6 +2558,7 @@ static const ARMCPUInfo arm_cpus[] = {
     { .name = "cortex-a8",   .initfn = cortex_a8_initfn },
     { .name = "cortex-a9",   .initfn = cortex_a9_initfn },
     { .name = "cortex-a15",  .initfn = cortex_a15_initfn },
+#ifdef CONFIG_TCG
     { .name = "ti925t",      .initfn = ti925t_initfn },
     { .name = "sa1100",      .initfn = sa1100_initfn },
     { .name = "sa1110",      .initfn = sa1110_initfn },
@@ -2564,6 +2575,7 @@ static const ARMCPUInfo arm_cpus[] = {
     { .name = "pxa270-b1",   .initfn = pxa270b1_initfn },
     { .name = "pxa270-c0",   .initfn = pxa270c0_initfn },
     { .name = "pxa270-c5",   .initfn = pxa270c5_initfn },
+#endif
 #ifndef TARGET_AARCH64
     { .name = "max",         .initfn = arm_max_initfn },
 #endif
Signature · 1 line
2.20.1
#2 lore raw

Re: [Qemu-arm] [Qemu-devel] [PATCH 1/4] target/arm: Restrict pre-ARMv7 cpus to TCG

target/arm/cpu.c static const ARMCPUInfo arm_cpus[] = { · line 2550

Quoted 8 lines · Philippe Mathieu-Daudé
target/arm/cpu.c +1 -0
@@ -2535,6 +2544,7 @@ static const ARMCPUInfo arm_cpus[] = {
     { .name = "arm1176",     .initfn = arm1176_initfn },
     { .name = "arm11mpcore", .initfn = arm11mpcore_initfn },
     { .name = "cortex-m0",   .initfn = cortex_m0_initfn,
+#endif
                              .class_init = arm_v7m_class_init },
     { .name = "cortex-m3",   .initfn = cortex_m3_initfn,
                              .class_init = arm_v7m_class_init },

Ifdef is misplaced. This shouldn't even compile without CONFIG_TCG.

Also, m-profile shouldn't work with kvm either, so I think the endif should go below cortex-m33.

r~

#3 lore raw

Re: [Qemu-arm] [Qemu-devel] [PATCH 1/4] target/arm: Restrict pre-ARMv7 cpus to TCG

Quoted 11 lines · Richard Henderson

target/arm/cpu.c static const ARMCPUInfo arm_cpus[] = { · line 2550

Quoted 8 lines · Philippe Mathieu-Daudé
target/arm/cpu.c +1 -0
@@ -2535,6 +2544,7 @@ static const ARMCPUInfo arm_cpus[] = {
     { .name = "arm1176",     .initfn = arm1176_initfn },
     { .name = "arm11mpcore", .initfn = arm11mpcore_initfn },
     { .name = "cortex-m0",   .initfn = cortex_m0_initfn,
+#endif
                              .class_init = arm_v7m_class_init },
     { .name = "cortex-m3",   .initfn = cortex_m3_initfn,
                              .class_init = arm_v7m_class_init },

Ifdef is misplaced. This shouldn't even compile without CONFIG_TCG.

What a shame... I hope I messed this due to a failed rebase...

Quoted 2 lines

Also, m-profile shouldn't work with kvm either, so I think the endif should go below cortex-m33.

Obviously.

#4 lore raw

PATCH 2/4 target/arm: Restrict R and M profiles to TCG

In reply to Philippe Mathieu-Daudé

KVM is only able to run A profile cpus.

---
 target/arm/cpu.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
target/arm/cpu.c +6 -4
index 522485a2de..299c59fde4 100644
@@ -462,7 +462,9 @@ bool arm_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
     return ret;
 }
 
-#if !defined(CONFIG_USER_ONLY) || !defined(TARGET_AARCH64)
+/* CPU models. These are not needed for the AArch64 linux-user build. */
+#if (!defined(CONFIG_USER_ONLY) || !defined(TARGET_AARCH64)) \
+    && defined(CONFIG_TCG)
 static bool arm_v7m_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
 {
     CPUClass *cc = CPU_GET_CLASS(cs);
@@ -1902,8 +1904,6 @@ static void cortex_m0_initfn(Object *obj)
     cpu->midr = 0x410cc200;
 }
 
-#endif
-
 static void cortex_m3_initfn(Object *obj)
 {
     ARMCPU *cpu = ARM_CPU(obj);
@@ -2057,6 +2057,8 @@ static void cortex_r5f_initfn(Object *obj)
     cpu->isar.mvfr1 = 0x00000011;
 }
 
+#endif
+
 static const ARMCPRegInfo cortexa8_cp_reginfo[] = {
     { .name = "L2LOCKDOWN", .cp = 15, .crn = 9, .crm = 0, .opc1 = 1, .opc2 = 0,
       .access = PL1_RW, .type = ARM_CP_CONST, .resetvalue = 0 },
@@ -2544,7 +2546,6 @@ static const ARMCPUInfo arm_cpus[] = {
     { .name = "arm1176",     .initfn = arm1176_initfn },
     { .name = "arm11mpcore", .initfn = arm11mpcore_initfn },
     { .name = "cortex-m0",   .initfn = cortex_m0_initfn,
-#endif
                              .class_init = arm_v7m_class_init },
     { .name = "cortex-m3",   .initfn = cortex_m3_initfn,
                              .class_init = arm_v7m_class_init },
@@ -2554,6 +2555,7 @@ static const ARMCPUInfo arm_cpus[] = {
                              .class_init = arm_v7m_class_init },
     { .name = "cortex-r5",   .initfn = cortex_r5_initfn },
     { .name = "cortex-r5f",  .initfn = cortex_r5f_initfn },
+#endif
     { .name = "cortex-a7",   .initfn = cortex_a7_initfn },
     { .name = "cortex-a8",   .initfn = cortex_a8_initfn },
     { .name = "cortex-a9",   .initfn = cortex_a9_initfn },
Signature · 1 line
2.20.1
#5 lore raw

Re: [Qemu-devel] [PATCH 2/4] target/arm: Restrict R and M profiles to TCG

Quoted 9 lines · Philippe Mathieu-Daudé
target/arm/cpu.c +0 -1
@@ -2544,7 +2546,6 @@ static const ARMCPUInfo arm_cpus[] = {
     { .name = "arm1176",     .initfn = arm1176_initfn },
     { .name = "arm11mpcore", .initfn = arm11mpcore_initfn },
     { .name = "cortex-m0",   .initfn = cortex_m0_initfn,
-#endif
                              .class_init = arm_v7m_class_init },
     { .name = "cortex-m3",   .initfn = cortex_m3_initfn,
                              .class_init = arm_v7m_class_init },

target/arm/cpu.c static const ARMCPUInfo arm_cpus[] = { · line 2561

Quoted 7 lines
target/arm/cpu.c +1 -0
@@ -2554,6 +2555,7 @@ static const ARMCPUInfo arm_cpus[] = {
                              .class_init = arm_v7m_class_init },
     { .name = "cortex-r5",   .initfn = cortex_r5_initfn },
     { .name = "cortex-r5f",  .initfn = cortex_r5f_initfn },
+#endif
     { .name = "cortex-a7",   .initfn = cortex_a7_initfn },
     { .name = "cortex-a8",   .initfn = cortex_a8_initfn },
     { .name = "cortex-a9",   .initfn = cortex_a9_initfn },

Ah, patch 1 fixed here. I think these should be squashed.

r~

#6 lore raw

PATCH 3/4 RFC target/arm: Do not build pre-ARMv7 cpus when using KVM

In reply to Philippe Mathieu-Daudé

A KVM-only build won't be able to run pre-ARMv7 cpus, disable them.

If KVM is not enabled, they are enabled by default.

---
Sadly this does not work with --enable-tcg --enable-kvm dual config.

---
 default-configs/arm-softmmu.mak | 33 ++++++++++++++++-----------------
 hw/arm/Kconfig                  | 26 ++++++++++++++++++++++++++
 2 files changed, 42 insertions(+), 17 deletions(-)
default-configs/arm-softmmu.mak +16 -17
index 1f2e0e7fde..081d507c87 100644
@@ -9,34 +9,33 @@ CONFIG_ARM_V7M=y
 CONFIG_ARM_VIRT=y
 CONFIG_CUBIEBOARD=y
 CONFIG_EXYNOS4=y
-CONFIG_HIGHBANK=y
-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
-CONFIG_VERSATILE=y
 CONFIG_VEXPRESS=y
 CONFIG_ZYNQ=y
-CONFIG_MAINSTONE=y
-CONFIG_GUMSTIX=y
-CONFIG_SPITZ=y
-CONFIG_TOSA=y
-CONFIG_Z2=y
-CONFIG_COLLIE=y
-CONFIG_ASPEED_SOC=y
 CONFIG_NETDUINO2=y
 CONFIG_MPS2=y
 CONFIG_RASPI=y
-CONFIG_DIGIC=y
 CONFIG_SABRELITE=y
 CONFIG_EMCRAFT_SF2=y
-CONFIG_MICROBIT=y
-CONFIG_FSL_IMX25=y
 CONFIG_FSL_IMX7=y
 CONFIG_FSL_IMX6UL=y
 CONFIG_SEMIHOSTING=y
+#CONFIG_CHEETAH=y
+#CONFIG_SX1=y
+#CONFIG_DIGIC=y
+#CONFIG_INTEGRATOR=y
+#CONFIG_MUSICPAL=y
+#CONFIG_MAINSTONE=y
+#CONFIG_GUMSTIX=y
+#CONFIG_SPITZ=y
+#CONFIG_TOSA=y
+#CONFIG_COLLIE=y
+#CONFIG_VERSATILE=y
+#CONFIG_FSL_IMX25=y
+#CONFIG_ASPEED_SOC=y
+#CONFIG_NSERIES=y
+#CONFIG_HIGHBANK=n
+#CONFIG_MICROBIT=n
hw/arm/Kconfig +26 -0
index 76a2a6bcbf..902cceca7e 100644
@@ -1,3 +1,18 @@
+config ARM_V4
+    default y
+    depends on !KVM
+    bool
+
+config ARM_V5
+    default y
+    depends on !KVM
+    bool
+
+config ARM_V6
+    default y
+    depends on !KVM
+    bool
+
 config ARM_VIRT
     bool
     imply PCI_DEVICES
@@ -23,6 +38,7 @@ config ARM_VIRT
 
 config CHEETAH
     bool
+    select ARM_V4
     select OMAP
     select TSC210X
 
@@ -32,6 +48,7 @@ config CUBIEBOARD
 
 config DIGIC
     bool
+    select ARM_V5
     select PTIMER
     select PFLASH_CFI02
 
@@ -61,6 +78,7 @@ config HIGHBANK
 
 config INTEGRATOR
     bool
+    select ARM_V5
     select ARM_TIMER
     select INTEGRATOR_DEBUG
     select PL011 # UART
@@ -86,6 +104,7 @@ config MUSCA
 
 config MUSICPAL
     bool
+    select ARM_V5
     select BITBANG_I2C
     select MARVELL_88W8618
     select PTIMER
@@ -99,6 +118,7 @@ config NETDUINO2
 
 config NSERIES
     bool
+    select ARM_V6
     select OMAP
     select TMP105   # tempature sensor
     select BLIZZARD # LCD/TV controller
@@ -121,6 +141,7 @@ config OMAP
 
 config PXA2XX
     bool
+    select ARM_V5
     select FRAMEBUFFER
     select I2C
     select SERIAL
@@ -232,10 +253,12 @@ config COLLIE
 
 config SX1
     bool
+    select ARM_V4
     select OMAP
 
 config VERSATILE
     bool
+    select ARM_V5
     select ARM_TIMER # sp804
     select PFLASH_CFI01
     select LSI_SCSI_PCI
@@ -327,6 +350,7 @@ config XLNX_VERSAL
 
 config FSL_IMX25
     bool
+    select ARM_V5
     select IMX
     select IMX_FEC
     select IMX_I2C
@@ -334,6 +358,7 @@ config FSL_IMX25
 
 config FSL_IMX31
     bool
+    select ARM_V6
     select SERIAL
     select IMX
     select IMX_I2C
@@ -349,6 +374,7 @@ config FSL_IMX6
 
 config ASPEED_SOC
     bool
+    select ARM_V5
     select DS1338
     select FTGMAC100
     select I2C
Signature · 1 line
2.20.1
#7 lore raw

Re: [Qemu-arm] [PATCH 3/4] RFC target/arm: Do not build pre-ARMv7 cpus when using KVM

Quoted 3 lines · Philippe Mathieu-Daudé

A KVM-only build won't be able to run pre-ARMv7 cpus, disable them.

If KVM is not enabled, they are enabled by default.

[...]

Quoted 5 lines

config CHEETAH
bool
+ select ARM_V4
select OMAP
select TSC210X

Are you sure about the "enabled by default" ? There is not "default y" here, is it?

Also I'm not sure whether it's such a good idea to always disable the config switches in default-configs/arm-softmmu.mak ... if somebody wants to build such a restricted QEMU, don't they have to maintain their own set of config files anyway?

I think we should maybe rather rework the default-configs directory:
Rename the default to "config/default/" instead and then we can add other subfolders with such special configurations, e.g. config/nemu/ or config/lean-kvm/ or however you want to call it. Then add a new switch to the configure script to be able to use the configs from such a different folder.

Thomas

#8 lore raw

Re: [Qemu-arm] [PATCH 3/4] RFC target/arm: Do not build pre-ARMv7 cpus when using KVM

Hi Thomas,

Quoted 5 lines · Thomas Huth
Quoted 3 lines · Philippe Mathieu-Daudé

A KVM-only build won't be able to run pre-ARMv7 cpus, disable them.

If KVM is not enabled, they are enabled by default.

[...]

Quoted 8 lines
Quoted 5 lines

config CHEETAH
bool
+ select ARM_V4
select OMAP
select TSC210X

Are you sure about the "enabled by default" ? There is not "default y" here, is it?

What I mean is if you build with --disable-kvm, this selects --enable-tcg which provides the pre-ARMv7 cpus. So to make no changes, I also added:

config ARM_V4
default y

Which include the "default y".

Quoted 5 lines

Also I'm not sure whether it's such a good idea to always disable the config switches in default-configs/arm-softmmu.mak ... if somebody wants to build such a restricted QEMU, don't they have to maintain their own set of config files anyway?

Ah... I followed your example:

$ git show 9e5c2056d1e
commit 9e5c2056d1e80f344a0c412d7a3d847db1f4e034
Author: Thomas Huth <[email protected]>
Date:   Tue Jan 29 10:42:14 2019 +0100

s390x: express dependencies with Kconfig

Instead of hard-coding all config switches in the config file default-configs/s390x-softmmu.mak, let's use the new Kconfig files to express the necessary dependencies: The S390_CCW_VIRTIO config switch for the "s390-ccw-virtio" machine now selects all non-optional devices.

And since we already have the VIRTIO_PCI and VIRTIO_MMIO config switches for the other two virtio transports, this patch also introduces a new config switch VIRTIO_CCW for the third, s390x-specific virtio transport, so that all three virtio transports are now handled in the same way.

(quoted diff) +0 -0

b/default-configs/s390x-softmmu.mak
@@ -1,9 +1,13 @@
-CONFIG_PCI=y
-CONFIG_VIRTIO_PCI=y
-CONFIG_SCLPCONSOLE=y
-CONFIG_TERMINAL3270=y
-CONFIG_S390_FLIC=y
-CONFIG_WDT_DIAG288=y
+# Default configuration for s390x-softmmu
+
+# Uncomment the following lines to disable these optional devices:
+#
+#CONFIG_TERMINAL3270=n
+#CONFIG_VFIO_AP=n
+#CONFIG_VFIO_CCW=n
+#CONFIG_VIRTIO_PCI=n
+#CONFIG_WDT_DIAG288=n
+
+# Boards:
+#
CONFIG_S390_CCW_VIRTIO=y
-CONFIG_VFIO_CCW=y
-CONFIG_VFIO_AP=y

OK now I see, I should have added your comment and use the opposite form (because now these boards are all enabled) so 's/=y/=n' in my patch.

Quoted 6 lines

I think we should maybe rather rework the default-configs directory:
Rename the default to "config/default/" instead and then we can add other subfolders with such special configurations, e.g. config/nemu/ or config/lean-kvm/ or however you want to call it. Then add a new switch to the configure script to be able to use the configs from such a different folder.

OK so if someone wants a special config, he'd know the config values to select, so it is pointless/confusing to keep them commented. Are you suggesting to simply remove the default entries? Such:

-- >8 --
@@ -9,34 +9,33 @@ CONFIG_ARM_V7M=y
CONFIG_ARM_VIRT=y
CONFIG_CUBIEBOARD=y
CONFIG_EXYNOS4=y
-CONFIG_HIGHBANK=y
-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
-CONFIG_VERSATILE=y
CONFIG_VEXPRESS=y
CONFIG_ZYNQ=y
-CONFIG_MAINSTONE=y
-CONFIG_GUMSTIX=y
-CONFIG_SPITZ=y
-CONFIG_TOSA=y
-CONFIG_Z2=y
-CONFIG_COLLIE=y
-CONFIG_ASPEED_SOC=y
CONFIG_NETDUINO2=y
CONFIG_MPS2=y
CONFIG_RASPI=y
-CONFIG_DIGIC=y
CONFIG_SABRELITE=y
CONFIG_EMCRAFT_SF2=y
-CONFIG_MICROBIT=y
-CONFIG_FSL_IMX25=y
CONFIG_FSL_IMX7=y
CONFIG_FSL_IMX6UL=y
CONFIG_SEMIHOSTING=y
---

Thanks,

Phil.

#9 lore raw

Re: [Qemu-arm] [PATCH 3/4] RFC target/arm: Do not build pre-ARMv7 cpus when using KVM

Quoted 17 lines · Philippe Mathieu-Daudé

Hi Thomas,

Quoted 5 lines · Thomas Huth
Quoted 3 lines · Philippe Mathieu-Daudé

A KVM-only build won't be able to run pre-ARMv7 cpus, disable them.

If KVM is not enabled, they are enabled by default.

[...]

Quoted 8 lines
Quoted 5 lines

config CHEETAH
bool
+ select ARM_V4
select OMAP
select TSC210X

Are you sure about the "enabled by default" ? There is not "default y" here, is it?

Quoted 8 lines

What I mean is if you build with --disable-kvm, this selects --enable-tcg which provides the pre-ARMv7 cpus. So to make no changes, I also added:

config ARM_V4
default y

Which include the "default y".

Well, so the ARM_V4 config switch is enabled by default. But where is the CHEETAH config switch enabled now?

Quoted 10 lines
Quoted 6 lines

I think we should maybe rather rework the default-configs directory:
Rename the default to "config/default/" instead and then we can add other subfolders with such special configurations, e.g. config/nemu/ or config/lean-kvm/ or however you want to call it. Then add a new switch to the configure script to be able to use the configs from such a different folder.

OK so if someone wants a special config, he'd know the config values to select, so it is pointless/confusing to keep them commented. Are you suggesting to simply remove the default entries?

Certainly not! I meant to keep the current file (with everything enabled) in config/default/, and to add another config file to config/lean-kvm/ where the TCG-only boards are disabled. Then the user can easily run "./configure --build-config-dir=config/lean-kvm/" to enable these settings.

Thomas

#10 lore raw

Re: [Qemu-devel] [PATCH 3/4] RFC target/arm: Do not build pre-ARMv7 cpus when using KVM

In reply to Philippe Mathieu-Daudé
Quoted 8 lines · Philippe Mathieu-Daudé

A KVM-only build won't be able to run pre-ARMv7 cpus, disable them.

If KVM is not enabled, they are enabled by default.

---
Sadly this does not work with --enable-tcg --enable-kvm dual config.
---

Huh? --enable-kvm does not imply --disable-tcg.

hw/arm/Kconfig line 4

Quoted 4 lines
hw/arm/Kconfig +4 -0
+config ARM_V4
+    default y
+    depends on !KVM
+    bool

This should surely be "depends on TCG".

r~

#11 lore raw

Re: [Qemu-arm] [Qemu-devel] [PATCH 3/4] RFC target/arm: Do not build pre-ARMv7 cpus when using KVM

Quoted 11 lines · Richard Henderson
Quoted 8 lines · Philippe Mathieu-Daudé

A KVM-only build won't be able to run pre-ARMv7 cpus, disable them.

If KVM is not enabled, they are enabled by default.

---
Sadly this does not work with --enable-tcg --enable-kvm dual config.
---

Huh? --enable-kvm does not imply --disable-tcg.

That would have made my life easier ;)

Quoted 6 lines

hw/arm/Kconfig line 4

Quoted 4 lines
hw/arm/Kconfig +4 -0
+config ARM_V4
+    default y
+    depends on !KVM
+    bool

This should surely be "depends on TCG".

I restricted this to KVM because this is the only one I know and got confirmation by Peter. I don't know about other accelerators but I'll happily take your suggestion!

Thanks,

Phil.

#12 lore raw

PATCH 4/4 RFC target/arm: Do not build A/M-profile cpus when using KVM

In reply to Philippe Mathieu-Daudé

A KVM-only build won't be able to run A or M-profile cpus, disable them.

If KVM is not enabled, they are enabled by default.

---
Sadly this does not work with --enable-tcg --enable-kvm dual config.

---
 default-configs/arm-softmmu.mak | 14 ++++++--------
 hw/arm/Kconfig                  | 16 +++++++++++++---
 2 files changed, 19 insertions(+), 11 deletions(-)
default-configs/arm-softmmu.mak +6 -8
index 081d507c87..3995c4bb65 100644
@@ -1,25 +1,18 @@
 # Default configuration for arm-softmmu
 
-# TODO: ARM_V7M is currently always required - make this more flexible!
-CONFIG_ARM_V7M=y
-
 # CONFIG_PCI_DEVICES=n
 # CONFIG_TEST_DEVICES=n
+CONFIG_ARM_V7M=n
 
 CONFIG_ARM_VIRT=y
 CONFIG_CUBIEBOARD=y
 CONFIG_EXYNOS4=y
 CONFIG_FSL_IMX31=y
-CONFIG_MUSCA=y
-CONFIG_STELLARIS=y
 CONFIG_REALVIEW=y
 CONFIG_VEXPRESS=y
 CONFIG_ZYNQ=y
-CONFIG_NETDUINO2=y
-CONFIG_MPS2=y
 CONFIG_RASPI=y
 CONFIG_SABRELITE=y
-CONFIG_EMCRAFT_SF2=y
 CONFIG_FSL_IMX7=y
 CONFIG_FSL_IMX6UL=y
 CONFIG_SEMIHOSTING=y
@@ -38,4 +31,9 @@ CONFIG_SEMIHOSTING=y
 #CONFIG_ASPEED_SOC=y
 #CONFIG_NSERIES=y
 #CONFIG_HIGHBANK=n
+#CONFIG_MUSCA=n
+#CONFIG_STELLARIS=n
+#CONFIG_NETDUINO2=n
+#CONFIG_MPS2=n
+#CONFIG_EMCRAFT_SF2=n
 #CONFIG_MICROBIT=n
hw/arm/Kconfig +13 -3
index 902cceca7e..9b16dfaa5f 100644
@@ -13,6 +13,18 @@ config ARM_V6
     depends on !KVM
     bool
 
+# ARM Microcontroller profile
+config ARM_V7M
+    default y
+    depends on !KVM
+    bool
+
+# ARM Realtime profile
+config ARM_V7R
+    default y
+    depends on !KVM
+    bool
+
 config ARM_VIRT
     bool
     imply PCI_DEVICES
@@ -298,9 +310,6 @@ config ZYNQ
     select XILINX_SPIPS
     select ZYNQ_DEVCFG
 
-config ARM_V7M
-    bool
-
 config ALLWINNER_A10
     bool
     select AHCI
@@ -328,6 +337,7 @@ config STM32F205_SOC
 
 config XLNX_ZYNQMP_ARM
     bool
+    select ARM_V7R
     select AHCI
     select ARM_GIC
     select CADENCE
Signature · 1 line
2.20.1
#13 lore raw

Re: [Qemu-arm] [Qemu-devel] [PATCH 4/4] RFC target/arm: Do not build A/M-profile cpus when using KVM

hw/arm/Kconfig config ARM_V6 · line 20

Quoted 5 lines · Philippe Mathieu-Daudé
hw/arm/Kconfig +5 -0
+# ARM Microcontroller profile
+config ARM_V7M
+    default y
+    depends on !KVM
+    bool

Likewise as for the previous patch, "depends on TCG".

r~