Skip to content

Commit

Permalink
bhyve: Add a stub VM_EXITCODE_REG_EMUL handler
Browse files Browse the repository at this point in the history
This lets us print a few fields of interest before aborting the VM loop.

No functional change intended.

Reviewed by:	corvink, andrew
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D44741
  • Loading branch information
markjdb committed Jun 4, 2024
1 parent a0ca4af commit 0570440
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions usr.sbin/bhyve/aarch64/vmexit.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,21 @@ vmexit_inst_emul(struct vmctx *ctx __unused, struct vcpu *vcpu,
return (VMEXIT_ABORT);
}

static int
vmexit_reg_emul(struct vmctx *ctx __unused, struct vcpu *vcpu __unused,
struct vm_run *vmrun)
{
struct vm_exit *vme;
struct vre *vre;

vme = vmrun->vm_exit;
vre = &vme->u.reg_emul.vre;

EPRINTLN("Unhandled register access: pc %#lx syndrome %#x reg %d\n",
vme->pc, vre->inst_syndrome, vre->reg);
return (VMEXIT_ABORT);
}

static int
vmexit_suspend(struct vmctx *ctx, struct vcpu *vcpu, struct vm_run *vmrun)
{
Expand Down Expand Up @@ -269,6 +284,7 @@ vmexit_ss(struct vmctx *ctx __unused, struct vcpu *vcpu, struct vm_run *vmrun)
const vmexit_handler_t vmexit_handlers[VM_EXITCODE_MAX] = {
[VM_EXITCODE_BOGUS] = vmexit_bogus,
[VM_EXITCODE_INST_EMUL] = vmexit_inst_emul,
[VM_EXITCODE_REG_EMUL] = vmexit_reg_emul,
[VM_EXITCODE_SUSPENDED] = vmexit_suspend,
[VM_EXITCODE_DEBUG] = vmexit_debug,
[VM_EXITCODE_SMCCC] = vmexit_smccc,
Expand Down

0 comments on commit 0570440

Please sign in to comment.