diff options
author | Robert Mustacchi <rm@joyent.com> | 2011-08-02 18:13:38 +0000 |
---|---|---|
committer | Robert Mustacchi <rm@joyent.com> | 2011-08-02 18:13:38 +0000 |
commit | 57b2f1208e13b427eea4fc35b01787135ad72625 (patch) | |
tree | eb9b5a94091e985d98ecc0ae7b2bf39f1bb0ea42 | |
parent | 18f7c4f572ba3fd186e15ae3b5afd73d6e4c8f10 (diff) | |
download | illumos-kvm-57b2f1208e13b427eea4fc35b01787135ad72625.tar.gz |
HVM-545 Various XXX cleanup
-rw-r--r-- | kvm_host.h | 3 | ||||
-rw-r--r-- | kvm_paging_tmpl.h | 36 | ||||
-rw-r--r-- | kvm_x86host.h | 7 |
3 files changed, 3 insertions, 43 deletions
@@ -15,9 +15,6 @@ #include "kvm_impl.h" #include "kvm_x86host.h" -/* - * XXX Do these really belong here? - */ #define NSEC_PER_MSEC 1000000L #define NSEC_PER_SEC 1000000000L diff --git a/kvm_paging_tmpl.h b/kvm_paging_tmpl.h index 84a1c85..fe6cab7 100644 --- a/kvm_paging_tmpl.h +++ b/kvm_paging_tmpl.h @@ -300,13 +300,11 @@ FNAME(update_pte)(struct kvm_vcpu *vcpu, struct kvm_mmu_page *page, pte_access = page->role.access & FNAME(gpte_access)(vcpu, gpte); if (gpte_to_gfn(gpte) != vcpu->arch.update_pte.gfn) return; + pfn = vcpu->arch.update_pte.pfn; if (is_error_pfn(pfn)) return; -#ifdef XXX - if (mmu_notifier_retry(vcpu, vcpu->arch.update_pte.mmu_seq)) - return; -#endif + kvm_get_pfn(vcpu, pfn); /* * we call mmu_set_spte() with reset_host_protection = 1 beacuse that @@ -317,19 +315,6 @@ FNAME(update_pte)(struct kvm_vcpu *vcpu, struct kvm_mmu_page *page, gpte_to_gfn(gpte), pfn, 1, 1); } - -extern struct kvm_mmu_page *kvm_mmu_get_page(struct kvm_vcpu *vcpu, - gfn_t gfn, gva_t gaddr, unsigned level, int direct, unsigned access, - uint64_t *parent_pte); -extern int is_shadow_present_pte(uint64_t pte); -extern void kvm_release_pfn_clean(pfn_t pfn); -extern void kvm_mmu_put_page(struct kvm_mmu_page *sp, uint64_t *parent_pte); -extern int set_spte(struct kvm_vcpu *vcpu, uint64_t *sptep, - unsigned pte_access, int user_fault, int write_fault, int dirty, int level, - gfn_t gfn, pfn_t pfn, int speculative, int can_unsync, - int reset_host_protection); - - /* * Fetch a shadow pte for a specific level in the paging hierarchy. */ @@ -437,12 +422,6 @@ FNAME(page_fault)(struct kvm_vcpu *vcpu, gva_t addr, int level = PT_PAGE_TABLE_LEVEL; unsigned long mmu_seq; -#ifdef XXX - /* XXX -this is not needed, we have dtrace! */ - pgprintk("%s: addr %lx err %x\n", __func__, addr, error_code); - kvm_mmu_audit(vcpu, "pre page fault"); -#endif /* XXX */ - r = mmu_topup_memory_caches(vcpu); if (r) return (r); @@ -469,9 +448,6 @@ FNAME(page_fault)(struct kvm_vcpu *vcpu, gva_t addr, level = MIN(walker.level, mapping_level(vcpu, walker.gfn)); walker.gfn = walker.gfn & ~(KVM_PAGES_PER_HPAGE(level) - 1); } -#ifdef XXX - mmu_seq = vcpu->kvm->mmu_notifier_seq; -#endif /* XXX */ smp_rmb(); pfn = gfn_to_pfn(vcpu->kvm, walker.gfn); @@ -485,17 +461,9 @@ FNAME(page_fault)(struct kvm_vcpu *vcpu, gva_t addr, } mutex_enter(&vcpu->kvm->mmu_lock); -#ifdef XXX - if (mmu_notifier_retry(vcpu, mmu_seq)) - goto out_unlock; -#endif /* XXX */ kvm_mmu_free_some_pages(vcpu); sptep = FNAME(fetch)(vcpu, addr, &walker, user_fault, write_fault, level, &write_pt, pfn); -#ifdef DEBUG - cmn_err(CE_NOTE, "%s: shadow pte %p %lx ptwrite %d\n", __func__, - sptep, *sptep, write_pt); -#endif /* DEBUG */ if (!write_pt) vcpu->arch.last_pt_write_count = 0; /* reset fork detector */ diff --git a/kvm_x86host.h b/kvm_x86host.h index 29ea52e..db9fac7 100644 --- a/kvm_x86host.h +++ b/kvm_x86host.h @@ -24,7 +24,7 @@ #define KVM_MAX_VCPUS 64 #define KVM_MEMORY_SLOTS 32 /* memory slots that are not exposted to userspace */ -#define KVM_PRIVATE_MEM_SLOTS 4 /* XXX assumes x86 */ +#define KVM_PRIVATE_MEM_SLOTS 4 /* x86 specific */ #define KVM_PIO_PAGE_OFFSET 1 #define KVM_COALESCED_MMIO_PAGE_OFFSET 2 @@ -784,7 +784,6 @@ extern struct kvm_memory_slot *gfn_to_memslot_unaliased(struct kvm *, gfn_t); extern struct kvm_mmu_page *page_header(struct kvm *, hpa_t); -/* XXX Fold into kvm_subr.c */ extern unsigned short kvm_read_fs(void); extern unsigned short kvm_read_gs(void); extern unsigned short kvm_read_ldt(void); @@ -854,8 +853,6 @@ enum { _ASM_PTR " 666b, 667b \n\t" \ ".popsection \n\t" -#define KVM_ARCH_WANT_MMU_NOTIFIER - int kvm_unmap_hva(struct kvm *kvm, unsigned long hva); int kvm_age_hva(struct kvm *kvm, unsigned long hva); void kvm_set_spte_hva(struct kvm *kvm, unsigned long hva, pte_t pte); @@ -868,8 +865,6 @@ void kvm_define_shared_msr(unsigned index, uint32_t msr); void kvm_set_shared_msr(struct kvm_vcpu *, unsigned index, uint64_t val, uint64_t mask); -/* XXX Readdress after kvm/kvm_x86.c refactor */ -extern int kvm_vm_ioctl_create_vcpu(struct kvm *kvm, uint32_t id, int *rv); #define NMI_VECTOR 0x02 #endif |