diff options
author | neel <neel@FreeBSD.org> | 2014-07-24 01:38:11 +0000 |
---|---|---|
committer | neel <neel@FreeBSD.org> | 2014-07-24 01:38:11 +0000 |
commit | 4535fa67c47e242c2d4c579630ebc12d8153d881 (patch) | |
tree | f10160daba1a9c8df5c059e74db7b03dcae6f007 /lib/libvmmapi/vmmapi.c | |
parent | 57fd2f85267f7e1a29e8cef251c560081842963b (diff) | |
download | FreeBSD-src-4535fa67c47e242c2d4c579630ebc12d8153d881.zip FreeBSD-src-4535fa67c47e242c2d4c579630ebc12d8153d881.tar.gz |
Fix fault injection in bhyve.
The faulting instruction needs to be restarted when the exception handler
is done handling the fault. bhyve now does this correctly by setting
'vmexit[vcpu].inst_length' to zero so the %rip is not advanced.
A minor complication is that the fault injection APIs are used by instruction
emulation code that is shared by vmm.ko and bhyve. Thus the argument that
refers to 'struct vm *' in kernel or 'struct vmctx *' in userspace needs to
be loosely typed as a 'void *'.
Diffstat (limited to 'lib/libvmmapi/vmmapi.c')
-rw-r--r-- | lib/libvmmapi/vmmapi.c | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/lib/libvmmapi/vmmapi.c b/lib/libvmmapi/vmmapi.c index 087d0b7..93955c7 100644 --- a/lib/libvmmapi/vmmapi.c +++ b/lib/libvmmapi/vmmapi.c @@ -1146,30 +1146,3 @@ vm_set_intinfo(struct vmctx *ctx, int vcpu, uint64_t info1) error = ioctl(ctx->fd, VM_SET_INTINFO, &vmii); return (error); } - -void -vm_inject_ss(struct vmctx *ctx, int vcpu, int errcode) -{ - int error; - - error = vm_inject_exception2(ctx, vcpu, IDT_SS, errcode); - assert(error == 0); -} - -void -vm_inject_ac(struct vmctx *ctx, int vcpu, int errcode) -{ - int error; - - error = vm_inject_exception2(ctx, vcpu, IDT_AC, errcode); - assert(error == 0); -} - -void -vm_inject_gp(struct vmctx *ctx, int vcpu, int errcode) -{ - int error; - - error = vm_inject_exception2(ctx, vcpu, IDT_GP, errcode); - assert(error == 0); -} |