Am 30. Juni 2025 08:58:22 UTC schrieb "Philippe Mathieu-Daudé"
<phi...@linaro.org>:
>Hi,
>
>On 29/6/25 22:48, Bernhard Beschow wrote:
>> Allows the imx8mp-evk machine to be run with KVM acceleration as a guest.
>>
>> Signed-off-by: Bernhard Beschow <shen...@gmail.com>
>> ---
>> docs/system/arm/imx8mp-evk.rst | 7 +++++++
>> hw/arm/fsl-imx8mp.c | 33 ++++++++++++++++++++++++++++-----
>> hw/arm/imx8mp-evk.c | 11 +++++++++++
>> hw/arm/Kconfig | 3 ++-
>> hw/arm/meson.build | 2 +-
>> 5 files changed, 49 insertions(+), 7 deletions(-)
>
>
>> diff --git a/hw/arm/imx8mp-evk.c b/hw/arm/imx8mp-evk.c
>> index b3082fa60d..30eb57318d 100644
>> --- a/hw/arm/imx8mp-evk.c
>> +++ b/hw/arm/imx8mp-evk.c
>> @@ -95,9 +95,20 @@ static void imx8mp_evk_init(MachineState *machine)
>> static void imx8mp_evk_machine_init(MachineClass *mc)
>> {
>> + static const char *const valid_cpu_types[] = {
>> + ARM_CPU_TYPE_NAME("cortex-a53"),
>> +#ifdef CONFIG_KVM
>> + ARM_CPU_TYPE_NAME("host"),
>
>IMO 'host' should be kept for 'virt' machines where we want the cpu
>type with the maximum features possible.
>
>For this case where a real SoC is virtualized with KVM, I'd keep the
>SoC CPU type. If the host misses Cortex-A53 features, KVM will fail,
>otherwise it will disable the extra features and only expose a A53
>to the guest.
I tried `-cpu cortex-a53` inside the `-M virt -cpu cortex-a72` machine and this
resulted in an illegal argument. This happened even though the virt machine was
using the 6.15.3 kernel which is pretty much the latest. Given that this very
recent setup didn't work I added the 'host' CPU option as a fallback while
cortex-a53 is of course the default. What about adjusting the DTB with
ARMCPU::dtb_compatible?
Best regards,
Bernhard
>
>> +#endif /* CONFIG_KVM */
>> + NULL
>> + };
>