From: Fuad Tabba <fuad.tabba@linux.dev>
To: kvm@vger.kernel.org
Cc: kvmarm@lists.linux.dev, Will Deacon <will@kernel.org>,
Julien Thierry <julien.thierry.kdev@gmail.com>,
Alexandru Elisei <alexandru.elisei@arm.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Andre Przywara <andre.przywara@arm.com>,
Oliver Upton <oliver.upton@linux.dev>,
Marc Zyngier <maz@kernel.org>, Fuad Tabba <tabba@google.com>
Subject: [PATCH kvmtool 3/5] kvm: Name every exit reason the UAPI header defines
Date: Mon, 31 Aug 2026 20:24:04 +0100 [thread overview]
Message-ID: <20260831192406.1341841-4-fuad.tabba@linux.dev> (raw)
In-Reply-To: <20260831192406.1341841-1-fuad.tabba@linux.dev>
kvm_exit_reasons[] stops at KVM_EXIT_INTERNAL_ERROR, so the panic path
prints "UNKNOWN" for every reason KVM has gained since. On arm64 that
covers KVM_EXIT_SYSTEM_EVENT and KVM_EXIT_ARM_NISV, and the newer
KVM_EXIT_MEMORY_FAULT, KVM_EXIT_ARM_SEA and KVM_EXIT_ARM_LDST64B.
Name the rest of the reasons the synced uapi header defines, up to
KVM_EXIT_SNP_REQ_CERTS. KVM_EXIT_PAPR_HCALL also loses its CONFIG_PPC64
guard, which the build never defines, so that entry was missing from
every configuration. The neighbouring PPC reasons are unconditional
already.
Signed-off-by: Fuad Tabba <fuad.tabba@linux.dev>
---
kvm.c | 27 +++++++++++++++++++++++++--
1 file changed, 25 insertions(+), 2 deletions(-)
diff --git a/kvm.c b/kvm.c
index b416f6f..828da64 100644
--- a/kvm.c
+++ b/kvm.c
@@ -52,9 +52,32 @@ static const char * const kvm_exit_reasons[] = {
DEFINE_KVM_EXIT_REASON(KVM_EXIT_DCR),
DEFINE_KVM_EXIT_REASON(KVM_EXIT_NMI),
DEFINE_KVM_EXIT_REASON(KVM_EXIT_INTERNAL_ERROR),
-#ifdef CONFIG_PPC64
+ DEFINE_KVM_EXIT_REASON(KVM_EXIT_OSI),
DEFINE_KVM_EXIT_REASON(KVM_EXIT_PAPR_HCALL),
-#endif
+ DEFINE_KVM_EXIT_REASON(KVM_EXIT_S390_UCONTROL),
+ DEFINE_KVM_EXIT_REASON(KVM_EXIT_WATCHDOG),
+ DEFINE_KVM_EXIT_REASON(KVM_EXIT_S390_TSCH),
+ DEFINE_KVM_EXIT_REASON(KVM_EXIT_EPR),
+ DEFINE_KVM_EXIT_REASON(KVM_EXIT_SYSTEM_EVENT),
+ DEFINE_KVM_EXIT_REASON(KVM_EXIT_S390_STSI),
+ DEFINE_KVM_EXIT_REASON(KVM_EXIT_IOAPIC_EOI),
+ DEFINE_KVM_EXIT_REASON(KVM_EXIT_HYPERV),
+ DEFINE_KVM_EXIT_REASON(KVM_EXIT_ARM_NISV),
+ DEFINE_KVM_EXIT_REASON(KVM_EXIT_X86_RDMSR),
+ DEFINE_KVM_EXIT_REASON(KVM_EXIT_X86_WRMSR),
+ DEFINE_KVM_EXIT_REASON(KVM_EXIT_DIRTY_RING_FULL),
+ DEFINE_KVM_EXIT_REASON(KVM_EXIT_AP_RESET_HOLD),
+ DEFINE_KVM_EXIT_REASON(KVM_EXIT_X86_BUS_LOCK),
+ DEFINE_KVM_EXIT_REASON(KVM_EXIT_XEN),
+ DEFINE_KVM_EXIT_REASON(KVM_EXIT_RISCV_SBI),
+ DEFINE_KVM_EXIT_REASON(KVM_EXIT_RISCV_CSR),
+ DEFINE_KVM_EXIT_REASON(KVM_EXIT_NOTIFY),
+ DEFINE_KVM_EXIT_REASON(KVM_EXIT_LOONGARCH_IOCSR),
+ DEFINE_KVM_EXIT_REASON(KVM_EXIT_MEMORY_FAULT),
+ DEFINE_KVM_EXIT_REASON(KVM_EXIT_TDX),
+ DEFINE_KVM_EXIT_REASON(KVM_EXIT_ARM_SEA),
+ DEFINE_KVM_EXIT_REASON(KVM_EXIT_ARM_LDST64B),
+ DEFINE_KVM_EXIT_REASON(KVM_EXIT_SNP_REQ_CERTS),
};
const char *kvm__exit_reason_str(__u32 exit_reason)
--
2.39.5
next prev parent reply other threads:[~2026-08-31 19:24 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-31 19:24 [PATCH kvmtool 0/5] Fix diagnostics and capability probes for protected VMs Fuad Tabba
2026-08-31 19:24 ` [PATCH kvmtool 1/5] arm64: Do not abort on register-dump failures Fuad Tabba
2026-09-12 7:33 ` Suzuki K Poulose
2026-09-12 13:54 ` Fuad Tabba
2026-09-12 14:02 ` Fuad Tabba
2026-09-12 19:36 ` Suzuki K Poulose
2026-08-31 19:24 ` [PATCH kvmtool 2/5] kvm: Bound-check the exit-reason string lookup Fuad Tabba
2026-09-12 7:35 ` Suzuki K Poulose
2026-08-31 19:24 ` Fuad Tabba [this message]
2026-09-12 7:35 ` [PATCH kvmtool 3/5] kvm: Name every exit reason the UAPI header defines Suzuki K Poulose
2026-08-31 19:24 ` [PATCH kvmtool 4/5] arm64: Query steal-time support on the VM fd Fuad Tabba
2026-09-12 7:28 ` Suzuki K Poulose
2026-08-31 19:24 ` [PATCH kvmtool 5/5] arm64: Query counter-offset " Fuad Tabba
2026-09-12 7:29 ` Suzuki K Poulose
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=20260831192406.1341841-4-fuad.tabba@linux.dev \
--to=fuad.tabba@linux.dev \
--cc=alexandru.elisei@arm.com \
--cc=andre.przywara@arm.com \
--cc=julien.thierry.kdev@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.linux.dev \
--cc=maz@kernel.org \
--cc=oliver.upton@linux.dev \
--cc=suzuki.poulose@arm.com \
--cc=tabba@google.com \
--cc=will@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 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.