diff options
author | 2015-12-24 09:40:27 +0000 | |
---|---|---|
committer | 2015-12-24 09:40:27 +0000 | |
commit | 4e64ccfbf6bbc12a6ed06a2c95a7c6dd826163f9 (patch) | |
tree | cb6888b28a6695ed0b86ee57f3b5d5078ffde807 | |
parent | Make sure we don't overflow a page during vm_readpage/vm_writepage. (diff) | |
download | wireguard-openbsd-4e64ccfbf6bbc12a6ed06a2c95a7c6dd826163f9.tar.xz wireguard-openbsd-4e64ccfbf6bbc12a6ed06a2c95a7c6dd826163f9.zip |
Normalize return values from various exit functions.
Another diff from Stefan Kempf <sn.kempf at t-online.de>.
-rw-r--r-- | sys/arch/amd64/amd64/vmm.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/arch/amd64/amd64/vmm.c b/sys/arch/amd64/amd64/vmm.c index cfdd4ecfe68..e4d52b863dd 100644 --- a/sys/arch/amd64/amd64/vmm.c +++ b/sys/arch/amd64/amd64/vmm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vmm.c,v 1.27 2015/12/24 09:26:45 mlarkin Exp $ */ +/* $OpenBSD: vmm.c,v 1.28 2015/12/24 09:40:27 mlarkin Exp $ */ /* * Copyright (c) 2014 Mike Larkin <mlarkin@openbsd.org> * @@ -2763,7 +2763,7 @@ vmx_handle_hlt(struct vcpu *vcpu) if (vmread(VMCS_INSTRUCTION_LENGTH, &insn_length)) { printf("vmx_handle_hlt: can't obtain instruction length\n"); - return (1); + return (EINVAL); } vcpu->vc_gueststate.vg_rip += insn_length; @@ -3034,12 +3034,12 @@ vmx_handle_inout(struct vcpu *vcpu) if (vmread(VMCS_INSTRUCTION_LENGTH, &insn_length)) { printf("vmx_handle_inout: can't obtain instruction length\n"); - return (1); + return (EINVAL); } if (vmx_get_exit_qualification(&exit_qual)) { printf("vmx_handle_inout: can't get exit qual\n"); - return (1); + return (EINVAL); } /* Bits 0:2 - size of exit */ @@ -3108,12 +3108,12 @@ vmx_handle_cr(struct vcpu *vcpu) if (vmread(VMCS_INSTRUCTION_LENGTH, &insn_length)) { printf("vmx_handle_cr: can't obtain instruction length\n"); - return (1); + return (EINVAL); } if (vmx_get_exit_qualification(&exit_qual)) { printf("vmx_handle_cr: can't get exit qual\n"); - return (1); + return (EINVAL); } /* Low 4 bits of exit_qual represent the CR number */ @@ -3161,7 +3161,7 @@ vmx_handle_cpuid(struct vcpu *vcpu) if (vmread(VMCS_INSTRUCTION_LENGTH, &insn_length)) { printf("vmx_handle_cpuid: can't obtain instruction length\n"); - return (1); + return (EINVAL); } /* All CPUID instructions are 0x0F 0xA2 */ |