aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm/kvm.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/kvm.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/kvm.h')
-rw-r--r--drivers/kvm/kvm.h84
1 files changed, 0 insertions, 84 deletions
diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h
index 41f6ee2134de..19014564ddbb 100644
--- a/drivers/kvm/kvm.h
+++ b/drivers/kvm/kvm.h
@@ -375,19 +375,6 @@ int kvm_init(void *opaque, unsigned int vcpu_size,
375 struct module *module); 375 struct module *module);
376void kvm_exit(void); 376void kvm_exit(void);
377 377
378int kvm_mmu_module_init(void);
379void kvm_mmu_module_exit(void);
380
381void kvm_mmu_destroy(struct kvm_vcpu *vcpu);
382int kvm_mmu_create(struct kvm_vcpu *vcpu);
383int kvm_mmu_setup(struct kvm_vcpu *vcpu);
384void kvm_mmu_set_nonpresent_ptes(u64 trap_pte, u64 notrap_pte);
385
386int kvm_mmu_reset_context(struct kvm_vcpu *vcpu);
387void kvm_mmu_slot_remove_write_access(struct kvm *kvm, int slot);
388void kvm_mmu_zap_all(struct kvm *kvm);
389void kvm_mmu_change_mmu_pages(struct kvm *kvm, unsigned int kvm_nr_mmu_pages);
390
391hpa_t gpa_to_hpa(struct kvm *kvm, gpa_t gpa); 378hpa_t gpa_to_hpa(struct kvm *kvm, gpa_t gpa);
392#define HPA_MSB ((sizeof(hpa_t) * 8) - 1) 379#define HPA_MSB ((sizeof(hpa_t) * 8) - 1)
393#define HPA_ERR_MASK ((hpa_t)1 << HPA_MSB) 380#define HPA_ERR_MASK ((hpa_t)1 << HPA_MSB)
@@ -421,83 +408,12 @@ struct kvm_memory_slot *gfn_to_memslot(struct kvm *kvm, gfn_t gfn);
421int kvm_is_visible_gfn(struct kvm *kvm, gfn_t gfn); 408int kvm_is_visible_gfn(struct kvm *kvm, gfn_t gfn);
422void mark_page_dirty(struct kvm *kvm, gfn_t gfn); 409void mark_page_dirty(struct kvm *kvm, gfn_t gfn);
423 410
424enum emulation_result {
425 EMULATE_DONE, /* no further processing */
426 EMULATE_DO_MMIO, /* kvm_run filled with mmio request */
427 EMULATE_FAIL, /* can't emulate this instruction */
428};
429
430int emulate_instruction(struct kvm_vcpu *vcpu, struct kvm_run *run,
431 unsigned long cr2, u16 error_code, int no_decode);
432void kvm_report_emulation_failure(struct kvm_vcpu *cvpu, const char *context);
433void realmode_lgdt(struct kvm_vcpu *vcpu, u16 size, unsigned long address);
434void realmode_lidt(struct kvm_vcpu *vcpu, u16 size, unsigned long address);
435void realmode_lmsw(struct kvm_vcpu *vcpu, unsigned long msw,
436 unsigned long *rflags);
437
438unsigned long realmode_get_cr(struct kvm_vcpu *vcpu, int cr);
439void realmode_set_cr(struct kvm_vcpu *vcpu, int cr, unsigned long value,
440 unsigned long *rflags);
441int kvm_get_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 *data);
442int kvm_set_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 data);
443
444struct x86_emulate_ctxt;
445
446int kvm_emulate_pio(struct kvm_vcpu *vcpu, struct kvm_run *run, int in,
447 int size, unsigned port);
448int kvm_emulate_pio_string(struct kvm_vcpu *vcpu, struct kvm_run *run, int in,
449 int size, unsigned long count, int down,
450 gva_t address, int rep, unsigned port);
451void kvm_emulate_cpuid(struct kvm_vcpu *vcpu);
452int kvm_emulate_halt(struct kvm_vcpu *vcpu);
453int emulate_invlpg(struct kvm_vcpu *vcpu, gva_t address);
454int emulate_clts(struct kvm_vcpu *vcpu);
455int emulator_get_dr(struct x86_emulate_ctxt *ctxt, int dr,
456 unsigned long *dest);
457int emulator_set_dr(struct x86_emulate_ctxt *ctxt, int dr,
458 unsigned long value);
459
460void set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0);
461void set_cr3(struct kvm_vcpu *vcpu, unsigned long cr0);
462void set_cr4(struct kvm_vcpu *vcpu, unsigned long cr0);
463void set_cr8(struct kvm_vcpu *vcpu, unsigned long cr0);
464unsigned long get_cr8(struct kvm_vcpu *vcpu);
465void lmsw(struct kvm_vcpu *vcpu, unsigned long msw);
466void kvm_get_cs_db_l_bits(struct kvm_vcpu *vcpu, int *db, int *l);
467
468int kvm_get_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 *pdata);
469int kvm_set_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 data);
470
471void fx_init(struct kvm_vcpu *vcpu);
472
473void kvm_vcpu_block(struct kvm_vcpu *vcpu); 411void kvm_vcpu_block(struct kvm_vcpu *vcpu);
474void kvm_resched(struct kvm_vcpu *vcpu); 412void kvm_resched(struct kvm_vcpu *vcpu);
475void kvm_load_guest_fpu(struct kvm_vcpu *vcpu); 413void kvm_load_guest_fpu(struct kvm_vcpu *vcpu);
476void kvm_put_guest_fpu(struct kvm_vcpu *vcpu); 414void kvm_put_guest_fpu(struct kvm_vcpu *vcpu);
477void kvm_flush_remote_tlbs(struct kvm *kvm); 415void kvm_flush_remote_tlbs(struct kvm *kvm);
478 416
479int emulator_read_std(unsigned long addr,
480 void *val,
481 unsigned int bytes,
482 struct kvm_vcpu *vcpu);
483int emulator_write_emulated(unsigned long addr,
484 const void *val,
485 unsigned int bytes,
486 struct kvm_vcpu *vcpu);
487
488unsigned long segment_base(u16 selector);
489
490void kvm_mmu_pte_write(struct kvm_vcpu *vcpu, gpa_t gpa,
491 const u8 *new, int bytes);
492int kvm_mmu_unprotect_page_virt(struct kvm_vcpu *vcpu, gva_t gva);
493void __kvm_mmu_free_some_pages(struct kvm_vcpu *vcpu);
494int kvm_mmu_load(struct kvm_vcpu *vcpu);
495void kvm_mmu_unload(struct kvm_vcpu *vcpu);
496
497int kvm_emulate_hypercall(struct kvm_vcpu *vcpu);
498
499int kvm_fix_hypercall(struct kvm_vcpu *vcpu);
500
501long kvm_arch_dev_ioctl(struct file *filp, 417long kvm_arch_dev_ioctl(struct file *filp,
502 unsigned int ioctl, unsigned long arg); 418 unsigned int ioctl, unsigned long arg);
503long kvm_arch_vcpu_ioctl(struct file *filp, 419long kvm_arch_vcpu_ioctl(struct file *filp,