Commit aba963cb authored by Alexandru Elisei's avatar Alexandru Elisei Committed by Oliver Upton
Browse files

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: default avatarAlexandru Elisei <alexandru.elisei@arm.com>
Reviewed-by: default avatarMarc Zyngier <maz@kernel.org>
Tested-by: default avatarFuad Tabba <tabba@google.com>
Reviewed-by: default avatarFuad Tabba <tabba@google.com>
Link: https://msgid.link/20251216103053.47224-3-alexandru.elisei@arm.com


Signed-off-by: default avatarOliver Upton <oupton@kernel.org>
parent 145cc42f
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -4668,7 +4668,10 @@ static void perform_access(struct kvm_vcpu *vcpu,
	 * that we don't know how to handle. This certainly qualifies
	 * as a gross bug that should be fixed right away.
	 */
	BUG_ON(!r->access);
	if (!r->access) {
		bad_trap(vcpu, params, r, "register access");
		return;
	}

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