Thank you for your contribution! Sashiko AI review found 1 potential issue(s) 
to consider:
- [Medium] selftests: KVM accelerator preference breaks arm64 vmtest on GICv3 
hosts
--

commit 5b52122d5a64c0b3471d0fed69b32ec99d464203
Author: David Matlack <[email protected]>

selftests/liveupdate: Prefer KVM and HVF over TCG in vmtest.sh

This commit reorders the QEMU accelerator options to prefer KVM and HVF over
TCG. It aims to utilize hardware acceleration when available instead of always
defaulting to TCG.

> Tested by running run-vmtests.sh and then observed that arm64 correctly
> fell back to using TCG after trying to use KVM and HVF, and that x86
> reported no warnings.

Will the arm64 test actually fall back to TCG when run natively on modern arm64
hardware?

In get_arch_conf(), the arm64 QEMU command is defined without specifying a GIC
version:

QEMU_CMD="qemu-system-aarch64 -M virt -cpu max"

Because the virt machine type defaults to GICv2 for backward compatibility,
running this natively on modern arm64 hardware (which typically only supports
GICv3) will cause the KVM accelerator to successfully initialize, preventing
the fallback to TCG. However, KVM will then fail to create the default GICv2
in-kernel interrupt controller and QEMU will abort with a fatal error.

Was the observation of falling back to TCG made on a cross-compilation host
where the KVM accelerator itself failed to initialize?

> diff --git a/tools/testing/selftests/liveupdate/vmtest.sh 
> b/tools/testing/selftests/liveupdate/vmtest.sh
> index 64fd2ab55b765..69beda6c961d7 100755
> --- a/tools/testing/selftests/liveupdate/vmtest.sh
> +++ b/tools/testing/selftests/liveupdate/vmtest.sh
> @@ -180,7 +180,7 @@ function run_qemu() {
>       echo "# Serial Log: $serial"
>       timeout 30s \
>       $qemu_cmd -m 1G -smp 2 -no-reboot -nographic -nodefaults \
> -               -accel tcg -accel hvf -accel kvm \
> +               -accel kvm -accel hvf -accel tcg \

[Severity: Medium]
Does this change break native arm64 execution on modern hardware?

Since get_arch_conf() lacks the gic-version=max parameter for arm64, QEMU will
default to GICv2. On modern arm64 hosts, KVM won't be able to emulate GICv2,
causing a hard failure during machine initialization rather than a fallback to
TCG.

Should gic-version=max be added to the arm64 QEMU_CMD to safely enable KVM
acceleration on modern hosts?

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=1

Reply via email to