1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-18 02:19:39 +00:00

bhyve/aarch64: Handle unknown exceptions

When an exception class is unhandled by the kernel we handle it in
userspace by exiting the process. Rather than exiting raise an unknown
reason exception in the guest. The guest can then handle the exception
as it wishes.

Reviewed by:	markj
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D46511
This commit is contained in:
Andrew Turner 2024-10-14 15:39:29 +01:00
parent 8803e78939
commit e51ed89897

View File

@ -263,15 +263,15 @@ vmexit_smccc(struct vmctx *ctx, struct vcpu *vcpu, struct vm_run *vmrun)
}
static int
vmexit_hyp(struct vmctx *ctx __unused, struct vcpu *vcpu __unused,
struct vm_run *vmrun)
vmexit_hyp(struct vmctx *ctx __unused, struct vcpu *vcpu, struct vm_run *vmrun)
{
struct vm_exit *vme;
/* Raise an unknown reason exception */
if (vm_inject_exception(vcpu,
(EXCP_UNKNOWN << ESR_ELx_EC_SHIFT) | ESR_ELx_IL,
vmrun->vm_exit->u.hyp.far_el2) != 0)
return (VMEXIT_ABORT);
vme = vmrun->vm_exit;
printf("unhandled exception: esr %#lx, far %#lx\n",
vme->u.hyp.esr_el2, vme->u.hyp.far_el2);
return (VMEXIT_ABORT);
return (VMEXIT_CONTINUE);
}
static int