From: Deepak Gupta <deepagupta@nvidia.com>
To: qemu-devel@nongnu.org
Cc: qemu-arm@nongnu.org, kvm@vger.kernel.org, kvmarm@lists.linux.dev,
peter.maydell@linaro.org, pbonzini@redhat.com,
mchehab+huawei@kernel.org, jiaqiyan@google.com,
oliver.upton@linux.dev
Subject: [PATCH 0/1] target/arm/kvm: handle KVM_EXIT_ARM_SEA
Date: Fri, 16 Oct 2026 23:05:40 +0000 [thread overview]
Message-ID: <cover.1792191544.git.deepagupta@nvidia.com> (raw)
Hi,
Linux 6.19 added KVM_CAP_ARM_SEA_TO_USER [1]: with the capability
enabled, KVM returns a guest synchronous external abort that the host
could not claim through APEI to userspace as KVM_EXIT_ARM_SEA, instead
of injecting a virtual SError. QEMU does not consume the exit yet, so on
a host whose HEST has no SEA-notified GHES source every guest-consumed
memory error still ends in a guest "Asynchronous SError Interrupt"
panic.
This patch enables the capability, handles the exit by recording a GHES
memory error (when the exit carries an address backed by guest RAM) and
injecting a synchronous external abort that mirrors the original one,
and wires up the BUS_MCEERR_AO SIGBUS case so the guest learns about the
poisoned page asynchronously when the exit itself carried no address.
Points I would like feedback on:
* Injection: I reuse the existing kvm_inject_arm_sea() route
(arm_cpu_do_interrupt() after kvm_cpu_synchronize_state()) and let it
pass the sanitised ESR fields (EC, IL, FnV, EA, CM, WnR, xFSC, SET)
and the FAR through to the guest. KVM_SET_VCPU_EVENTS with
ext_dabt_pending can only produce a data abort with FAR taken from
the last exit, and the documentation restricts it to MMIO/NISV/
LDST64B exits, so it did not seem a good fit; happy to switch if that
is preferred.
* The BUS_MCEERR_AO record goes on ACPI_HEST_SRC_ID_QMP, which ghes.h
documents as being for QMP-injected errors, because it is the only
GED-notified source the virt machine has. If a dedicated source id
for host-originated asynchronous records is preferred I can add one.
* With the pre-10.1 single-block HEST layout (no GED-notified source)
the AO record is dropped with a warning rather than written into the
synchronous source's block.
Testing: arm64 host whose HEST has only GSIV/SDEI-notified sources,
EINJ uncorrectable memory error into a page mapped by a guest, consumed
by a guest process (-machine virt,ras=on). Before: guest panic. After:
SIGBUS to the process, GHES record and hwpoison in the guest, guest
stays up. Also checked: the pre-existing BUS_MCEERR_AR SIGBUS path still
works (it is taken when the host's memory_failure() wins the race),
ras=off (bare external abort to the guest, no record), -machine
virt-10.0 (the AR path still delivers the synchronous record, the AO
record is dropped with the warning),
check-unit and check-qtest-aarch64 on the host.
[1] https://lore.kernel.org/r/20251013185903.1372553-1-jiaqiyan@google.com
Deepak Gupta (1):
target/arm/kvm: handle KVM_EXIT_ARM_SEA and report BUS_MCEERR_AO
target/arm/kvm.c | 164 +++++++++++++++++++++++++++++++++++-----
target/arm/trace-events | 1 +
2 files changed, 146 insertions(+), 19 deletions(-)
--
2.53.0
next reply other threads:[~2026-10-16 23:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-16 23:05 Deepak Gupta [this message]
2026-10-16 23:05 ` [PATCH 1/1] target/arm/kvm: handle KVM_EXIT_ARM_SEA and report BUS_MCEERR_AO Deepak Gupta
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=cover.1792191544.git.deepagupta@nvidia.com \
--to=deepagupta@nvidia.com \
--cc=jiaqiyan@google.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.linux.dev \
--cc=mchehab+huawei@kernel.org \
--cc=oliver.upton@linux.dev \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.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 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.