diff options
author | 2018-07-11 12:45:01 +0000 | |
---|---|---|
committer | 2018-07-11 12:45:01 +0000 | |
commit | fb5430e03c911b50c5122a2f4179fdb00dc41c39 (patch) | |
tree | da9eaf89f1764f676b84d249f1ff71435f4d751e | |
parent | Drop a const-bomb on regexec. It's probably not a good idea to remove a (diff) | |
download | wireguard-openbsd-fb5430e03c911b50c5122a2f4179fdb00dc41c39.tar.xz wireguard-openbsd-fb5430e03c911b50c5122a2f4179fdb00dc41c39.zip |
vmm(4): small cleanup in vm_rwregs.
Clarify error values and change a panic into a debug printf (which will
in turn just kill the VM).
-rw-r--r-- | sys/arch/amd64/amd64/vmm.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/sys/arch/amd64/amd64/vmm.c b/sys/arch/amd64/amd64/vmm.c index 6cbad01f200..c405ade5a4f 100644 --- a/sys/arch/amd64/amd64/vmm.c +++ b/sys/arch/amd64/amd64/vmm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vmm.c,v 1.210 2018/07/10 09:04:22 mlarkin Exp $ */ +/* $OpenBSD: vmm.c,v 1.211 2018/07/11 12:45:01 mlarkin Exp $ */ /* * Copyright (c) 2014 Mike Larkin <mlarkin@openbsd.org> * @@ -653,13 +653,14 @@ vm_intr_pending(struct vm_intr_params *vip) * * Parameters: * vrwp: Describes the VM and VCPU to get/set the registers from. The - * register values are returned here as well. + * register values are returned here as well. * dir: 0 for reading, 1 for writing * * Return values: * 0: if successful - * ENOENT: if the VM/VCPU defined by 'vgp' cannot be found - * EINVAL: if an error occured reading the registers of the guest + * ENOENT: if the VM/VCPU defined by 'vrwp' cannot be found + * EINVAL: if an error occured accessing the registers of the guest + * EPERM: if the vm cannot be accessed from the calling process */ int vm_rwregs(struct vm_rwregs_params *vrwp, int dir) @@ -700,8 +701,10 @@ vm_rwregs(struct vm_rwregs_params *vrwp, int dir) return (dir == 0) ? vcpu_readregs_svm(vcpu, vrwp->vrwp_mask, vrs) : vcpu_writeregs_svm(vcpu, vrwp->vrwp_mask, vrs); - else - panic("unknown vmm mode"); + else { + DPRINTF("%s: unknown vmm mode", __func__); + return (EINVAL); + } } /* |