Lines Matching refs:ctxt

92 	void (*vm_bugged)(struct x86_emulate_ctxt *ctxt);
98 ulong (*read_gpr)(struct x86_emulate_ctxt *ctxt, unsigned reg);
105 void (*write_gpr)(struct x86_emulate_ctxt *ctxt, unsigned reg, ulong val);
114 int (*read_std)(struct x86_emulate_ctxt *ctxt,
127 int (*write_std)(struct x86_emulate_ctxt *ctxt,
137 int (*fetch)(struct x86_emulate_ctxt *ctxt,
147 int (*read_emulated)(struct x86_emulate_ctxt *ctxt,
158 int (*write_emulated)(struct x86_emulate_ctxt *ctxt,
171 int (*cmpxchg_emulated)(struct x86_emulate_ctxt *ctxt,
177 void (*invlpg)(struct x86_emulate_ctxt *ctxt, ulong addr);
179 int (*pio_in_emulated)(struct x86_emulate_ctxt *ctxt,
183 int (*pio_out_emulated)(struct x86_emulate_ctxt *ctxt,
187 bool (*get_segment)(struct x86_emulate_ctxt *ctxt, u16 *selector,
189 void (*set_segment)(struct x86_emulate_ctxt *ctxt, u16 selector,
191 unsigned long (*get_cached_segment_base)(struct x86_emulate_ctxt *ctxt,
193 void (*get_gdt)(struct x86_emulate_ctxt *ctxt, struct desc_ptr *dt);
194 void (*get_idt)(struct x86_emulate_ctxt *ctxt, struct desc_ptr *dt);
195 void (*set_gdt)(struct x86_emulate_ctxt *ctxt, struct desc_ptr *dt);
196 void (*set_idt)(struct x86_emulate_ctxt *ctxt, struct desc_ptr *dt);
197 ulong (*get_cr)(struct x86_emulate_ctxt *ctxt, int cr);
198 int (*set_cr)(struct x86_emulate_ctxt *ctxt, int cr, ulong val);
199 int (*cpl)(struct x86_emulate_ctxt *ctxt);
200 void (*get_dr)(struct x86_emulate_ctxt *ctxt, int dr, ulong *dest);
201 int (*set_dr)(struct x86_emulate_ctxt *ctxt, int dr, ulong value);
202 int (*set_msr_with_filter)(struct x86_emulate_ctxt *ctxt, u32 msr_index, u64 data);
203 int (*get_msr_with_filter)(struct x86_emulate_ctxt *ctxt, u32 msr_index, u64 *pdata);
204 int (*get_msr)(struct x86_emulate_ctxt *ctxt, u32 msr_index, u64 *pdata);
205 int (*check_pmc)(struct x86_emulate_ctxt *ctxt, u32 pmc);
206 int (*read_pmc)(struct x86_emulate_ctxt *ctxt, u32 pmc, u64 *pdata);
207 void (*halt)(struct x86_emulate_ctxt *ctxt);
208 void (*wbinvd)(struct x86_emulate_ctxt *ctxt);
209 int (*fix_hypercall)(struct x86_emulate_ctxt *ctxt);
210 int (*intercept)(struct x86_emulate_ctxt *ctxt,
214 bool (*get_cpuid)(struct x86_emulate_ctxt *ctxt, u32 *eax, u32 *ebx,
216 bool (*guest_has_long_mode)(struct x86_emulate_ctxt *ctxt);
217 bool (*guest_has_movbe)(struct x86_emulate_ctxt *ctxt);
218 bool (*guest_has_fxsr)(struct x86_emulate_ctxt *ctxt);
219 bool (*guest_has_rdpid)(struct x86_emulate_ctxt *ctxt);
221 void (*set_nmi_mask)(struct x86_emulate_ctxt *ctxt, bool masked);
223 bool (*is_smm)(struct x86_emulate_ctxt *ctxt);
224 bool (*is_guest_mode)(struct x86_emulate_ctxt *ctxt);
225 int (*leave_smm)(struct x86_emulate_ctxt *ctxt);
226 void (*triple_fault)(struct x86_emulate_ctxt *ctxt);
227 int (*set_xcr)(struct x86_emulate_ctxt *ctxt, u32 index, u64 xcr);
333 int (*execute)(struct x86_emulate_ctxt *ctxt);
336 int (*check_perm)(struct x86_emulate_ctxt *ctxt);
369 #define KVM_EMULATOR_BUG_ON(cond, ctxt) \ argument
374 ctxt->ops->vm_bugged(ctxt); \
495 int x86_decode_insn(struct x86_emulate_ctxt *ctxt, void *insn, int insn_len, int emulation_type);
496 bool x86_page_table_writing_insn(struct x86_emulate_ctxt *ctxt);
501 void init_decode_cache(struct x86_emulate_ctxt *ctxt);
502 int x86_emulate_insn(struct x86_emulate_ctxt *ctxt);
503 int emulator_task_switch(struct x86_emulate_ctxt *ctxt,
506 int emulate_int_real(struct x86_emulate_ctxt *ctxt, int irq);
507 void emulator_invalidate_register_cache(struct x86_emulate_ctxt *ctxt);
508 void emulator_writeback_register_cache(struct x86_emulate_ctxt *ctxt);
509 bool emulator_can_use_gpa(struct x86_emulate_ctxt *ctxt);
511 static inline ulong reg_read(struct x86_emulate_ctxt *ctxt, unsigned nr) in reg_read() argument
513 if (KVM_EMULATOR_BUG_ON(nr >= NR_EMULATOR_GPRS, ctxt)) in reg_read()
516 if (!(ctxt->regs_valid & (1 << nr))) { in reg_read()
517 ctxt->regs_valid |= 1 << nr; in reg_read()
518 ctxt->_regs[nr] = ctxt->ops->read_gpr(ctxt, nr); in reg_read()
520 return ctxt->_regs[nr]; in reg_read()
523 static inline ulong *reg_write(struct x86_emulate_ctxt *ctxt, unsigned nr) in reg_write() argument
525 if (KVM_EMULATOR_BUG_ON(nr >= NR_EMULATOR_GPRS, ctxt)) in reg_write()
528 BUILD_BUG_ON(sizeof(ctxt->regs_dirty) * BITS_PER_BYTE < NR_EMULATOR_GPRS); in reg_write()
529 BUILD_BUG_ON(sizeof(ctxt->regs_valid) * BITS_PER_BYTE < NR_EMULATOR_GPRS); in reg_write()
531 ctxt->regs_valid |= 1 << nr; in reg_write()
532 ctxt->regs_dirty |= 1 << nr; in reg_write()
533 return &ctxt->_regs[nr]; in reg_write()
536 static inline ulong *reg_rmw(struct x86_emulate_ctxt *ctxt, unsigned nr) in reg_rmw() argument
538 reg_read(ctxt, nr); in reg_rmw()
539 return reg_write(ctxt, nr); in reg_rmw()