Deleted Added
full compact
vmm.h (268428) vmm.h (268701)
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: head/sys/amd64/include/vmm.h 268428 2014-07-08 21:48:57Z neel $
26 * $FreeBSD: head/sys/amd64/include/vmm.h 268701 2014-07-15 17:37:17Z neel $
27 */
28
29#ifndef _VMM_H_
30#define _VMM_H_
31
32enum vm_suspend_how {
33 VM_SUSPEND_NONE,
34 VM_SUSPEND_RESET,

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

317 * XXX The contents of the 'access' field are architecturally defined except
318 * bit 16 - Segment Unusable.
319 */
320struct seg_desc {
321 uint64_t base;
322 uint32_t limit;
323 uint32_t access;
324};
27 */
28
29#ifndef _VMM_H_
30#define _VMM_H_
31
32enum vm_suspend_how {
33 VM_SUSPEND_NONE,
34 VM_SUSPEND_RESET,

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

317 * XXX The contents of the 'access' field are architecturally defined except
318 * bit 16 - Segment Unusable.
319 */
320struct seg_desc {
321 uint64_t base;
322 uint32_t limit;
323 uint32_t access;
324};
325#define SEG_DESC_TYPE(desc) ((desc)->access & 0x001f)
326#define SEG_DESC_PRESENT(desc) ((desc)->access & 0x0080)
327#define SEG_DESC_DEF32(desc) ((desc)->access & 0x4000)
328#define SEG_DESC_GRANULARITY(desc) ((desc)->access & 0x8000)
329#define SEG_DESC_UNUSABLE(desc) ((desc)->access & 0x10000)
325#define SEG_DESC_TYPE(access) ((access) & 0x001f)
326#define SEG_DESC_PRESENT(access) (((access) & 0x0080) ? 1 : 0)
327#define SEG_DESC_DEF32(access) (((access) & 0x4000) ? 1 : 0)
328#define SEG_DESC_GRANULARITY(access) (((access) & 0x8000) ? 1 : 0)
329#define SEG_DESC_UNUSABLE(access) (((access) & 0x10000) ? 1 : 0)
330
331enum vm_cpu_mode {
332 CPU_MODE_REAL,
333 CPU_MODE_PROTECTED,
334 CPU_MODE_COMPATIBILITY, /* IA-32E mode (CS.L = 0) */
335 CPU_MODE_64BIT, /* IA-32E mode (CS.L = 1) */
336};
337

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

361};
362
363#define VIE_INST_SIZE 15
364struct vie {
365 uint8_t inst[VIE_INST_SIZE]; /* instruction bytes */
366 uint8_t num_valid; /* size of the instruction */
367 uint8_t num_processed;
368
330
331enum vm_cpu_mode {
332 CPU_MODE_REAL,
333 CPU_MODE_PROTECTED,
334 CPU_MODE_COMPATIBILITY, /* IA-32E mode (CS.L = 0) */
335 CPU_MODE_64BIT, /* IA-32E mode (CS.L = 1) */
336};
337

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

361};
362
363#define VIE_INST_SIZE 15
364struct vie {
365 uint8_t inst[VIE_INST_SIZE]; /* instruction bytes */
366 uint8_t num_valid; /* size of the instruction */
367 uint8_t num_processed;
368
369 uint8_t addrsize:4, opsize:4; /* address and operand sizes */
369 uint8_t rex_w:1, /* REX prefix */
370 rex_r:1,
371 rex_x:1,
372 rex_b:1,
370 uint8_t rex_w:1, /* REX prefix */
371 rex_r:1,
372 rex_x:1,
373 rex_b:1,
373 rex_present:1;
374 rex_present:1,
375 opsize_override:1, /* Operand size override */
376 addrsize_override:1; /* Address size override */
374
375 uint8_t mod:2, /* ModRM byte */
376 reg:4,
377 rm:4;
378
379 uint8_t ss:2, /* SIB byte */
380 index:4,
381 base:4;

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

445 struct vm_inout_str inout_str;
446 struct {
447 uint64_t gpa;
448 int fault_type;
449 } paging;
450 struct {
451 uint64_t gpa;
452 uint64_t gla;
377
378 uint8_t mod:2, /* ModRM byte */
379 reg:4,
380 rm:4;
381
382 uint8_t ss:2, /* SIB byte */
383 index:4,
384 base:4;

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

448 struct vm_inout_str inout_str;
449 struct {
450 uint64_t gpa;
451 int fault_type;
452 } paging;
453 struct {
454 uint64_t gpa;
455 uint64_t gla;
456 int cs_d; /* CS.D */
453 struct vm_guest_paging paging;
454 struct vie vie;
455 } inst_emul;
456 /*
457 * VMX specific payload. Used when there is no "better"
458 * exitcode to represent the VM-exit.
459 */
460 struct {

--- 35 unchanged lines hidden ---
457 struct vm_guest_paging paging;
458 struct vie vie;
459 } inst_emul;
460 /*
461 * VMX specific payload. Used when there is no "better"
462 * exitcode to represent the VM-exit.
463 */
464 struct {

--- 35 unchanged lines hidden ---