129
148
* @new: [IN ] Value to write to @addr.
130
149
* @bytes: [IN ] Number of bytes to access using CMPXCHG.
132
int (*cmpxchg_emulated)(unsigned long addr,
151
int (*cmpxchg_emulated)(struct x86_emulate_ctxt *ctxt,
135
155
unsigned int bytes,
136
struct x86_exception *fault,
137
struct kvm_vcpu *vcpu);
139
int (*pio_in_emulated)(int size, unsigned short port, void *val,
140
unsigned int count, struct kvm_vcpu *vcpu);
142
int (*pio_out_emulated)(int size, unsigned short port, const void *val,
143
unsigned int count, struct kvm_vcpu *vcpu);
145
bool (*get_cached_descriptor)(struct desc_struct *desc, u32 *base3,
146
int seg, struct kvm_vcpu *vcpu);
147
void (*set_cached_descriptor)(struct desc_struct *desc, u32 base3,
148
int seg, struct kvm_vcpu *vcpu);
149
u16 (*get_segment_selector)(int seg, struct kvm_vcpu *vcpu);
150
void (*set_segment_selector)(u16 sel, int seg, struct kvm_vcpu *vcpu);
151
unsigned long (*get_cached_segment_base)(int seg, struct kvm_vcpu *vcpu);
152
void (*get_gdt)(struct desc_ptr *dt, struct kvm_vcpu *vcpu);
153
void (*get_idt)(struct desc_ptr *dt, struct kvm_vcpu *vcpu);
154
ulong (*get_cr)(int cr, struct kvm_vcpu *vcpu);
155
int (*set_cr)(int cr, ulong val, struct kvm_vcpu *vcpu);
156
int (*cpl)(struct kvm_vcpu *vcpu);
157
int (*get_dr)(int dr, unsigned long *dest, struct kvm_vcpu *vcpu);
158
int (*set_dr)(int dr, unsigned long value, struct kvm_vcpu *vcpu);
159
int (*set_msr)(struct kvm_vcpu *vcpu, u32 msr_index, u64 data);
160
int (*get_msr)(struct kvm_vcpu *vcpu, u32 msr_index, u64 *pdata);
156
struct x86_exception *fault);
157
void (*invlpg)(struct x86_emulate_ctxt *ctxt, ulong addr);
159
int (*pio_in_emulated)(struct x86_emulate_ctxt *ctxt,
160
int size, unsigned short port, void *val,
163
int (*pio_out_emulated)(struct x86_emulate_ctxt *ctxt,
164
int size, unsigned short port, const void *val,
167
bool (*get_segment)(struct x86_emulate_ctxt *ctxt, u16 *selector,
168
struct desc_struct *desc, u32 *base3, int seg);
169
void (*set_segment)(struct x86_emulate_ctxt *ctxt, u16 selector,
170
struct desc_struct *desc, u32 base3, int seg);
171
unsigned long (*get_cached_segment_base)(struct x86_emulate_ctxt *ctxt,
173
void (*get_gdt)(struct x86_emulate_ctxt *ctxt, struct desc_ptr *dt);
174
void (*get_idt)(struct x86_emulate_ctxt *ctxt, struct desc_ptr *dt);
175
void (*set_gdt)(struct x86_emulate_ctxt *ctxt, struct desc_ptr *dt);
176
void (*set_idt)(struct x86_emulate_ctxt *ctxt, struct desc_ptr *dt);
177
ulong (*get_cr)(struct x86_emulate_ctxt *ctxt, int cr);
178
int (*set_cr)(struct x86_emulate_ctxt *ctxt, int cr, ulong val);
179
int (*cpl)(struct x86_emulate_ctxt *ctxt);
180
int (*get_dr)(struct x86_emulate_ctxt *ctxt, int dr, ulong *dest);
181
int (*set_dr)(struct x86_emulate_ctxt *ctxt, int dr, ulong value);
182
int (*set_msr)(struct x86_emulate_ctxt *ctxt, u32 msr_index, u64 data);
183
int (*get_msr)(struct x86_emulate_ctxt *ctxt, u32 msr_index, u64 *pdata);
184
void (*halt)(struct x86_emulate_ctxt *ctxt);
185
void (*wbinvd)(struct x86_emulate_ctxt *ctxt);
186
int (*fix_hypercall)(struct x86_emulate_ctxt *ctxt);
187
void (*get_fpu)(struct x86_emulate_ctxt *ctxt); /* disables preempt */
188
void (*put_fpu)(struct x86_emulate_ctxt *ctxt); /* reenables preempt */
189
int (*intercept)(struct x86_emulate_ctxt *ctxt,
190
struct x86_instruction_info *info,
191
enum x86_intercept_stage stage);
194
typedef u32 __attribute__((vector_size(16))) sse128_t;
163
196
/* Type, address-of, and value of an instruction's operand. */
165
enum { OP_REG, OP_MEM, OP_IMM, OP_NONE } type;
198
enum { OP_REG, OP_MEM, OP_IMM, OP_XMM, OP_NONE } type;
166
199
unsigned int bytes;
168
201
unsigned long orig_val;