All of lore.kernel.org
 help / color / mirror / Atom feed
* qemu-system-arm dies on introspection of ast2700-a1 and ast2700-a2
@ 2026-10-21 11:52 Markus Armbruster
  2026-10-21 13:16 ` Philippe Mathieu-Daudé
  2026-10-21 15:01 ` Alex Bennée
  0 siblings, 2 replies; 3+ messages in thread
From: Markus Armbruster @ 2026-10-21 11:52 UTC (permalink / raw)
  To: qemu-devel
  Cc: Cédric Le Goater, Peter Maydell, Jamin Lin, Kane Chen,
	qemu-arm, Philippe Mathieu-Daudé

Watch this:

    $ qemu-system-arm -S -nodefaults -display none -M none -qmp stdio
    {"QMP": {"version": {"qemu": {"micro": 50, "minor": 1, "major": 11}, "package": "v11.1.0-2545-g2d150b99ce"}, "capabilities": ["oob"]}}
    {"execute": "qmp_capabilities", "arguments": {"enable": ["oob"]}}
    {"return": {}}
    {"execute": "qom-list-properties", "arguments": {"typename": "ast2700-a1"}}
    qemu-system-arm: unknown type 'cortex-a35-arm-cpu'
    [Exit 1 ]

Same for ast2700-a2.

I found the folllowing in their .instance_init() method
aspeed_soc_ast2700_init():

    for (i = 0; i < sc->num_cpus; i++) {
        if (qtest_enabled() && !target_aarch64()) {
            /*
             * Introspection qtest just want to create this object
             * without realizing it. ARM_CPU_TYPE_NAME("cortex-a35")
             * is not available on 32-bit binary: skip it since we
             * won't even realize it.
             */
            continue;
        }
        object_initialize_child(obj, "cpu[*]", &a->cpu[i],
                                aspeed_soc_cpu_type(sc->valid_cpu_types));
    }

This seems to paper over the bug so make the tests pass.  That's wrong.

.instance_init() must not fail and must not exit(), regardless of
context.

object_initialize_child() exit()s when the type doesn't exist, because
&error_fatal gets passed to in type_get_or_load_by_name() in
object_initialize_child().

The narrow fix is to make type "cortex-a35-arm-cpu" exist, or to make
the two bad types "ast2700-a1" and "ast2700-a2" not exist.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: qemu-system-arm dies on introspection of ast2700-a1 and ast2700-a2
  2026-10-21 11:52 qemu-system-arm dies on introspection of ast2700-a1 and ast2700-a2 Markus Armbruster
@ 2026-10-21 13:16 ` Philippe Mathieu-Daudé
  2026-10-21 15:01 ` Alex Bennée
  1 sibling, 0 replies; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-10-21 13:16 UTC (permalink / raw)
  To: Markus Armbruster, qemu-devel, Pierrick Bouvier
  Cc: Cédric Le Goater, Peter Maydell, Jamin Lin, Kane Chen,
	qemu-arm, Philippe Mathieu-Daudé, Anton Johansson,
	Yonggang Luo

On 21/10/26 13:52, Markus Armbruster wrote:
> Watch this:
> 
>      $ qemu-system-arm -S -nodefaults -display none -M none -qmp stdio
>      {"QMP": {"version": {"qemu": {"micro": 50, "minor": 1, "major": 11}, "package": "v11.1.0-2545-g2d150b99ce"}, "capabilities": ["oob"]}}
>      {"execute": "qmp_capabilities", "arguments": {"enable": ["oob"]}}
>      {"return": {}}
>      {"execute": "qom-list-properties", "arguments": {"typename": "ast2700-a1"}}
>      qemu-system-arm: unknown type 'cortex-a35-arm-cpu'
>      [Exit 1 ]
> 
> Same for ast2700-a2.
> 
> I found the folllowing in their .instance_init() method
> aspeed_soc_ast2700_init():
> 
>      for (i = 0; i < sc->num_cpus; i++) {
>          if (qtest_enabled() && !target_aarch64()) {
>              /*
>               * Introspection qtest just want to create this object
>               * without realizing it. ARM_CPU_TYPE_NAME("cortex-a35")
>               * is not available on 32-bit binary: skip it since we
>               * won't even realize it.
>               */
>              continue;
>          }
>          object_initialize_child(obj, "cpu[*]", &a->cpu[i],
>                                  aspeed_soc_cpu_type(sc->valid_cpu_types));
>      }
> 
> This seems to paper over the bug so make the tests pass.  That's wrong.
> 
> .instance_init() must not fail and must not exit(), regardless of
> context.
> 
> object_initialize_child() exit()s when the type doesn't exist, because
> &error_fatal gets passed to in type_get_or_load_by_name() in
> object_initialize_child().
> 
> The narrow fix is to make type "cortex-a35-arm-cpu" exist, or to make
> the two bad types "ast2700-a1" and "ast2700-a2" not exist.

The ast2700 machines are hidden on 32-bit builds with

   .is_available = target_aarch64,

but the SoC types they use are not (see commit 89b5f1ed43f
"hw/arm: filter minimal set of machines" following earlier
attempt a2239a87339 "hw/arm/aspeed: Do not realize 64-bit
CPU types under QTest").

Pierrick, I thought this pattern was solved, can you have a
look please?

Thanks,

Phil.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: qemu-system-arm dies on introspection of ast2700-a1 and ast2700-a2
  2026-10-21 11:52 qemu-system-arm dies on introspection of ast2700-a1 and ast2700-a2 Markus Armbruster
  2026-10-21 13:16 ` Philippe Mathieu-Daudé
@ 2026-10-21 15:01 ` Alex Bennée
  1 sibling, 0 replies; 3+ messages in thread
From: Alex Bennée @ 2026-10-21 15:01 UTC (permalink / raw)
  To: Markus Armbruster
  Cc: qemu-devel, Cédric Le Goater, Peter Maydell, Jamin Lin,
	Kane Chen, qemu-arm, Philippe Mathieu-Daudé

Markus Armbruster <armbru@redhat.com> writes:

> Watch this:
>
>     $ qemu-system-arm -S -nodefaults -display none -M none -qmp stdio
>     {"QMP": {"version": {"qemu": {"micro": 50, "minor": 1, "major": 11}, "package": "v11.1.0-2545-g2d150b99ce"}, "capabilities": ["oob"]}}
>     {"execute": "qmp_capabilities", "arguments": {"enable": ["oob"]}}
>     {"return": {}}
>     {"execute": "qom-list-properties", "arguments": {"typename": "ast2700-a1"}}
>     qemu-system-arm: unknown type 'cortex-a35-arm-cpu'
>     [Exit 1 ]
>
> Same for ast2700-a2.
>
> I found the folllowing in their .instance_init() method
> aspeed_soc_ast2700_init():
>
>     for (i = 0; i < sc->num_cpus; i++) {
>         if (qtest_enabled() && !target_aarch64()) {
>             /*
>              * Introspection qtest just want to create this object
>              * without realizing it. ARM_CPU_TYPE_NAME("cortex-a35")
>              * is not available on 32-bit binary: skip it since we
>              * won't even realize it.
>              */
>             continue;
>         }
>         object_initialize_child(obj, "cpu[*]", &a->cpu[i],
>                                 aspeed_soc_cpu_type(sc->valid_cpu_types));
>     }
>
> This seems to paper over the bug so make the tests pass.  That's wrong.
>
> .instance_init() must not fail and must not exit(), regardless of
> context.
>
> object_initialize_child() exit()s when the type doesn't exist, because
> &error_fatal gets passed to in type_get_or_load_by_name() in
> object_initialize_child().
>
> The narrow fix is to make type "cortex-a35-arm-cpu" exist, or to make
> the two bad types "ast2700-a1" and "ast2700-a2" not exist.

Is the problem here that DEFINE_TYPES(aspeed_soc_ast27x0_types) doesn't
allow for conditional realisation of the SoCs? Oh but it does:

        .is_available   = target_aarch64,


-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-10-21 15:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-21 11:52 qemu-system-arm dies on introspection of ast2700-a1 and ast2700-a2 Markus Armbruster
2026-10-21 13:16 ` Philippe Mathieu-Daudé
2026-10-21 15:01 ` Alex Bennée

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.