freebsd-skq/lib/libvmmapi
neel 7776059e98 Deprecate the 3-way return values from vm_gla2gpa() and vm_copy_setup().
Prior to this change both functions returned 0 for success, -1 for failure
and +1 to indicate that an exception was injected into the guest.

The numerical value of ERESTART also happens to be -1 so when these functions
returned -1 it had to be translated to a positive errno value to prevent the
VM_RUN ioctl from being inadvertently restarted. This made it easy to introduce
bugs when writing emulation code.

Fix this by adding an 'int *guest_fault' parameter and setting it to '1' if
an exception was delivered to the guest. The return value is 0 or EFAULT so
no additional translation is needed.

Reviewed by:	tychon
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D2428
2015-05-06 16:25:20 +00:00
..
Makefile Fix overlinking in bhyve: 2015-04-09 21:38:40 +00:00
vmmapi_freebsd.c Add support for FreeBSD/i386 guests under bhyve. 2014-02-05 04:39:03 +00:00
vmmapi.c Deprecate the 3-way return values from vm_gla2gpa() and vm_copy_setup(). 2015-05-06 16:25:20 +00:00
vmmapi.h Deprecate the 3-way return values from vm_gla2gpa() and vm_copy_setup(). 2015-05-06 16:25:20 +00:00