1 /* SPDX-License-Identifier: MIT */
3 * Copyright (c) 2015, Roger Pau Monne <roger.pau@citrix.com>
6 #ifndef __XEN_PUBLIC_HVM_HVM_VCPU_H__
7 #define __XEN_PUBLIC_HVM_HVM_VCPU_H__
11 struct vcpu_hvm_x86_32
{
30 * EFER should only be used to set the NXE bit (if required)
31 * when starting a vCPU in 32bit mode with paging enabled or
32 * to set the LME/LMA bits in order to start the vCPU in
57 * The layout of the _ar fields of the segment registers is the
60 * Bits [0,3]: type (bits 40-43).
61 * Bit 4: s (descriptor type, bit 44).
62 * Bit [5,6]: dpl (descriptor privilege level, bits 45-46).
63 * Bit 7: p (segment-present, bit 47).
64 * Bit 8: avl (available for system software, bit 52).
65 * Bit 9: l (64-bit code segment, bit 53).
66 * Bit 10: db (meaning depends on the segment, bit 54).
67 * Bit 11: g (granularity, bit 55)
68 * Bits [12,15]: unused, must be blank.
70 * A more complete description of the meaning of this fields can be
71 * obtained from the Intel SDM, Volume 3, section 3.4.5.
74 struct vcpu_hvm_x86_64
{
92 * Using VCPU_HVM_MODE_64B implies that the vCPU is launched
93 * directly in long mode, so the cached parts of the segment
94 * registers get set to match that environment.
96 * If the user wants to launch the vCPU in compatibility mode
97 * the 32-bit structure should be used instead.
101 struct vcpu_hvm_context
{
102 #define VCPU_HVM_MODE_32B 0 /* 32bit fields of the structure will be used. */
103 #define VCPU_HVM_MODE_64B 1 /* 64bit fields of the structure will be used. */
110 struct vcpu_hvm_x86_32 x86_32
;
111 struct vcpu_hvm_x86_64 x86_64
;
114 typedef struct vcpu_hvm_context vcpu_hvm_context_t
;
116 #endif /* __XEN_PUBLIC_HVM_HVM_VCPU_H__ */