aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm/x86.h
diff options
context:
space:
mode:
authorZhang Xiantao <xiantao.zhang@intel.com>2007-11-19 02:24:28 -0500
committerAvi Kivity <avi@qumranet.com>2008-01-30 10:53:06 -0500
commit54f1585a8d0131bc3993902d4441f4049daed0d5 (patch)
treeeb00bedf26723c4fd583a115106c1a0d35f8a0f1 /drivers/kvm/x86.h
parentec6d273deb56b1607e2acaad3df4bca42f135cd7 (diff)
KVM: Portability: Move some function declarations to x86.h
Signed-off-by: Zhang Xiantao <xiantao.zhang@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/x86.h')
-rw-r--r--drivers/kvm/x86.h84
1 files changed, 84 insertions, 0 deletions
diff --git a/drivers/kvm/x86.h b/drivers/kvm/x86.h
index f1c43cafb0ca..90b791bf6287 100644
--- a/drivers/kvm/x86.h
+++ b/drivers/kvm/x86.h
@@ -225,6 +225,90 @@ struct kvm_x86_ops {
225 225
226extern struct kvm_x86_ops *kvm_x86_ops; 226extern struct kvm_x86_ops *kvm_x86_ops;
227 227
228int kvm_mmu_module_init(void);
229void kvm_mmu_module_exit(void);
230
231void kvm_mmu_destroy(struct kvm_vcpu *vcpu);
232int kvm_mmu_create(struct kvm_vcpu *vcpu);
233int kvm_mmu_setup(struct kvm_vcpu *vcpu);
234void kvm_mmu_set_nonpresent_ptes(u64 trap_pte, u64 notrap_pte);
235
236int kvm_mmu_reset_context(struct kvm_vcpu *vcpu);
237void kvm_mmu_slot_remove_write_access(struct kvm *kvm, int slot);
238void kvm_mmu_zap_all(struct kvm *kvm);
239void kvm_mmu_change_mmu_pages(struct kvm *kvm, unsigned int kvm_nr_mmu_pages);
240
241enum emulation_result {
242 EMULATE_DONE, /* no further processing */
243 EMULATE_DO_MMIO, /* kvm_run filled with mmio request */
244 EMULATE_FAIL, /* can't emulate this instruction */
245};
246
247int emulate_instruction(struct kvm_vcpu *vcpu, struct kvm_run *run,
248 unsigned long cr2, u16 error_code, int no_decode);
249void kvm_report_emulation_failure(struct kvm_vcpu *cvpu, const char *context);
250void realmode_lgdt(struct kvm_vcpu *vcpu, u16 size, unsigned long address);
251void realmode_lidt(struct kvm_vcpu *vcpu, u16 size, unsigned long address);
252void realmode_lmsw(struct kvm_vcpu *vcpu, unsigned long msw,
253 unsigned long *rflags);
254
255unsigned long realmode_get_cr(struct kvm_vcpu *vcpu, int cr);
256void realmode_set_cr(struct kvm_vcpu *vcpu, int cr, unsigned long value,
257 unsigned long *rflags);
258int kvm_get_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 *data);
259int kvm_set_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 data);
260
261struct x86_emulate_ctxt;
262
263int kvm_emulate_pio(struct kvm_vcpu *vcpu, struct kvm_run *run, int in,
264 int size, unsigned port);
265int kvm_emulate_pio_string(struct kvm_vcpu *vcpu, struct kvm_run *run, int in,
266 int size, unsigned long count, int down,
267 gva_t address, int rep, unsigned port);
268void kvm_emulate_cpuid(struct kvm_vcpu *vcpu);
269int kvm_emulate_halt(struct kvm_vcpu *vcpu);
270int emulate_invlpg(struct kvm_vcpu *vcpu, gva_t address);
271int emulate_clts(struct kvm_vcpu *vcpu);
272int emulator_get_dr(struct x86_emulate_ctxt *ctxt, int dr,
273 unsigned long *dest);
274int emulator_set_dr(struct x86_emulate_ctxt *ctxt, int dr,
275 unsigned long value);
276
277void set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0);
278void set_cr3(struct kvm_vcpu *vcpu, unsigned long cr0);
279void set_cr4(struct kvm_vcpu *vcpu, unsigned long cr0);
280void set_cr8(struct kvm_vcpu *vcpu, unsigned long cr0);
281unsigned long get_cr8(struct kvm_vcpu *vcpu);
282void lmsw(struct kvm_vcpu *vcpu, unsigned long msw);
283void kvm_get_cs_db_l_bits(struct kvm_vcpu *vcpu, int *db, int *l);
284
285int kvm_get_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 *pdata);
286int kvm_set_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 data);
287
288void fx_init(struct kvm_vcpu *vcpu);
289
290int emulator_read_std(unsigned long addr,
291 void *val,
292 unsigned int bytes,
293 struct kvm_vcpu *vcpu);
294int emulator_write_emulated(unsigned long addr,
295 const void *val,
296 unsigned int bytes,
297 struct kvm_vcpu *vcpu);
298
299unsigned long segment_base(u16 selector);
300
301void kvm_mmu_pte_write(struct kvm_vcpu *vcpu, gpa_t gpa,
302 const u8 *new, int bytes);
303int kvm_mmu_unprotect_page_virt(struct kvm_vcpu *vcpu, gva_t gva);
304void __kvm_mmu_free_some_pages(struct kvm_vcpu *vcpu);
305int kvm_mmu_load(struct kvm_vcpu *vcpu);
306void kvm_mmu_unload(struct kvm_vcpu *vcpu);
307
308int kvm_emulate_hypercall(struct kvm_vcpu *vcpu);
309
310int kvm_fix_hypercall(struct kvm_vcpu *vcpu);
311
228int kvm_mmu_page_fault(struct kvm_vcpu *vcpu, gva_t gva, u32 error_code); 312int kvm_mmu_page_fault(struct kvm_vcpu *vcpu, gva_t gva, u32 error_code);
229 313
230static inline void kvm_mmu_free_some_pages(struct kvm_vcpu *vcpu) 314static inline void kvm_mmu_free_some_pages(struct kvm_vcpu *vcpu)