Deleted Added
full compact
bhyverun.c (268894) bhyverun.c (268934)
1/*-
2 * Copyright (c) 2011 NetApp, Inc.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
1/*-
2 * Copyright (c) 2011 NetApp, Inc.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $FreeBSD: stable/10/usr.sbin/bhyve/bhyverun.c 268894 2014-07-19 22:24:29Z jhb $
26 * $FreeBSD: stable/10/usr.sbin/bhyve/bhyverun.c 268934 2014-07-21 02:17:28Z jhb $
27 */
28
29#include <sys/cdefs.h>
27 */
28
29#include <sys/cdefs.h>
30__FBSDID("$FreeBSD: stable/10/usr.sbin/bhyve/bhyverun.c 268894 2014-07-19 22:24:29Z jhb $");
30__FBSDID("$FreeBSD: stable/10/usr.sbin/bhyve/bhyverun.c 268934 2014-07-21 02:17:28Z jhb $");
31
32#include <sys/types.h>
33#include <sys/mman.h>
34#include <sys/time.h>
35
36#include <machine/atomic.h>
37#include <machine/segments.h>
38

--- 271 unchanged lines hidden (view full) ---

310 eax = vme->u.inout.eax;
311 in = vme->u.inout.in;
312 out = !in;
313
314 /* We don't deal with these */
315 if (vme->u.inout.string || vme->u.inout.rep)
316 return (VMEXIT_ABORT);
317
31
32#include <sys/types.h>
33#include <sys/mman.h>
34#include <sys/time.h>
35
36#include <machine/atomic.h>
37#include <machine/segments.h>
38

--- 271 unchanged lines hidden (view full) ---

310 eax = vme->u.inout.eax;
311 in = vme->u.inout.in;
312 out = !in;
313
314 /* We don't deal with these */
315 if (vme->u.inout.string || vme->u.inout.rep)
316 return (VMEXIT_ABORT);
317
318 /* Special case of guest reset */
319 if (out && port == 0x64 && (uint8_t)eax == 0xFE)
320 return (vmexit_catch_reset());
321
322 /* Extra-special case of host notifications */
323 if (out && port == GUEST_NIO_PORT)
324 return (vmexit_handle_notify(ctx, vme, pvcpu, eax));
325
326 error = emulate_inout(ctx, vcpu, in, port, bytes, &eax, strictio);
327 if (error == INOUT_OK && in)
328 error = vm_set_register(ctx, vcpu, VM_REG_GUEST_RAX, eax);
329

--- 465 unchanged lines hidden ---
318 /* Extra-special case of host notifications */
319 if (out && port == GUEST_NIO_PORT)
320 return (vmexit_handle_notify(ctx, vme, pvcpu, eax));
321
322 error = emulate_inout(ctx, vcpu, in, port, bytes, &eax, strictio);
323 if (error == INOUT_OK && in)
324 error = vm_set_register(ctx, vcpu, VM_REG_GUEST_RAX, eax);
325

--- 465 unchanged lines hidden ---