Skip to content

Commit aba963c

Browse files
Alexandru EliseiOliver Upton
authored andcommitted
KVM: arm64: Inject UNDEF for a register trap without accessor
Configuring a register trap without specifying an accessor function is abviously a bug. Instead of calling die() when that happens, let's be a bit more helpful and print the register encoding. Also inject an undefined instruction exception in the guest, similar to other unhandled register accesses. Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com> Reviewed-by: Marc Zyngier <maz@kernel.org> Tested-by: Fuad Tabba <tabba@google.com> Reviewed-by: Fuad Tabba <tabba@google.com> Link: https://msgid.link/20251216103053.47224-3-alexandru.elisei@arm.com Signed-off-by: Oliver Upton <oupton@kernel.org>
1 parent 145cc42 commit aba963c

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

arch/arm64/kvm/sys_regs.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4668,7 +4668,10 @@ static void perform_access(struct kvm_vcpu *vcpu,
46684668
* that we don't know how to handle. This certainly qualifies
46694669
* as a gross bug that should be fixed right away.
46704670
*/
4671-
BUG_ON(!r->access);
4671+
if (!r->access) {
4672+
bad_trap(vcpu, params, r, "register access");
4673+
return;
4674+
}
46724675

46734676
/* Skip instruction if instructed so */
46744677
if (likely(r->access(vcpu, params, r)))

0 commit comments

Comments
 (0)