mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: linux-kernel@vger.kernel.org,
	"David Matlack" <dmatlack@google.com>,
	linux-kselftest@vger.kernel.org
Cc: "Jordan Richards" <jordanrichards@google.com>,
	"Mike Rapoport" <rppt@kernel.org>,
	"Pratyush Yadav" <pratyush@kernel.org>,
	kexec@lists.infradead.org,
	"Pasha Tatashin" <pasha.tatashin@soleen.com>,
	"Shuah Khan" <shuah@kernel.org>
Subject: Re: [PATCH] selftests/liveupdate: Prefer KVM and HVF over TCG in vmtest.sh
Date: Thu, 08 Oct 2026 13:33:58 +0000	[thread overview]
Message-ID: <sashiko-outbox-164218@kernel.org> (raw)
In-Reply-To: <20261008132813.1966023-1-dmatlack@google.com>

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 <dmatlack@google.com>

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/20261008132813.1966023-1-dmatlack@google.com?part=1

      reply	other threads:[~2026-10-08 13:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-08 13:28 David Matlack
2026-10-08 13:33 ` sashiko-bot [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-164218@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dmatlack@google.com \
    --cc=jordanrichards@google.com \
    --cc=kexec@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=pasha.tatashin@soleen.com \
    --cc=pratyush@kernel.org \
    --cc=rppt@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®