On 24/4/25 10:56, Zhang Chen wrote:
On Thu, Apr 3, 2025 at 10:23 AM Zhang Chen <zhangc...@gmail.com> wrote:

On Thu, Apr 3, 2025 at 2:43 AM Richard Henderson
<richard.hender...@linaro.org> wrote:

On 4/2/25 06:54, Zhang Chen wrote:
Because of the CONFIG_TCG auto enabled, the cpu type "cortex-a15"
is mistakenly set to the default AARCH64 target.

This is the correct backward compatible setting.
In essence, it means that you *must* supply a -cpu argument.



If the "-cpu" is required, the VM should not be started without this argument.
If yes, I will skip this patch and submit another one to make QEMU
refuse to start without this parameter.


Ping... and let me explain this status, it is not just for the default value.
1. The cpu type "cortex-a15" is not the correct backward compatible
setting for AARCH64 target.

IIUC it was meant to be backward compatible for KVM (as in "not TCG"),
HVF was not a thing for ARM at this time.

The ARM cortex-a15 is a 32 bit CPU based on ARMv7-A architecture. It
can not boot for AARCH64 target.
For example, the Apple M silicon can not boot with the default -cpu value.

A respin of this series might help you, I'll try to remember to Cc you:
https://lore.kernel.org/qemu-devel/b883f0ef-6131-4335-b273-90fd3d8cc...@linaro.org/

2. Most of QEMU docs does not said user *must* supply a -cpu argument.
https://www.qemu.org/docs/master/system/qemu-manpage.html

Thanks
Chen

Thanks
Chen

r~


Signed-off-by: Zhang Chen <zhangc...@gmail.com>
---
   hw/arm/virt.c | 5 +++--
   1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index a96452f17a..63649e9543 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -3178,9 +3178,10 @@ static void virt_machine_class_init(ObjectClass *oc, 
void *data)
       mc->cpu_index_to_instance_props = virt_cpu_index_to_props;
   #ifdef CONFIG_TCG
       mc->default_cpu_type = ARM_CPU_TYPE_NAME("cortex-a15");
-#else
+#ifdef TARGET_AARCH64
       mc->default_cpu_type = ARM_CPU_TYPE_NAME("max");
-#endif
+#endif /* TARGET_AARCH64 */
+#endif /* CONFIG_TCG */
       mc->valid_cpu_types = valid_cpu_types;
       mc->get_default_cpu_node_id = virt_get_default_cpu_node_id;
       mc->kvm_type = virt_kvm_type;





Reply via email to