Markus Armbruster <[email protected]> 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

Reply via email to