• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/arch/x86/kvm/

Lines Matching defs:kvm

180 static int init_rmode(struct kvm *kvm);
298 static inline bool vm_need_tpr_shadow(struct kvm *kvm)
300 return (cpu_has_vmx_tpr_shadow()) && (irqchip_in_kernel(kvm));
394 static inline bool vm_need_virtualize_apic_accesses(struct kvm *kvm)
396 return flexpriority_enabled && irqchip_in_kernel(kvm);
482 printk(KERN_ERR "kvm: vmclear fail: %p/%llx\n",
495 printk(KERN_ERR "kvm: vmptrld %p/%llx fail\n",
1689 static gva_t rmode_tss_base(struct kvm *kvm)
1691 if (!kvm->arch.tss_addr) {
1695 slots = kvm_memslots(kvm);
1697 kvm->memslots->memslots[0].npages - 3;
1700 return kvm->arch.tss_addr;
1729 vmcs_writel(GUEST_TR_BASE, rmode_tss_base(vcpu->kvm));
1766 init_rmode(vcpu->kvm);
1967 vcpu->kvm->arch.ept_identity_map_addr;
2093 * kvm hack.
2323 static int init_rmode_tss(struct kvm *kvm)
2325 gfn_t fn = rmode_tss_base(kvm) >> PAGE_SHIFT;
2330 r = kvm_clear_guest_page(kvm, fn, 0, PAGE_SIZE);
2334 r = kvm_write_guest_page(kvm, fn++, &data,
2338 r = kvm_clear_guest_page(kvm, fn++, 0, PAGE_SIZE);
2341 r = kvm_clear_guest_page(kvm, fn, 0, PAGE_SIZE);
2345 r = kvm_write_guest_page(kvm, fn, &data,
2356 static int init_rmode_identity_map(struct kvm *kvm)
2364 if (unlikely(!kvm->arch.ept_identity_pagetable)) {
2369 if (likely(kvm->arch.ept_identity_pagetable_done))
2372 identity_map_pfn = kvm->arch.ept_identity_map_addr >> PAGE_SHIFT;
2373 r = kvm_clear_guest_page(kvm, identity_map_pfn, 0, PAGE_SIZE);
2380 r = kvm_write_guest_page(kvm, identity_map_pfn,
2385 kvm->arch.ept_identity_pagetable_done = true;
2409 static int alloc_apic_access_page(struct kvm *kvm)
2414 mutex_lock(&kvm->slots_lock);
2415 if (kvm->arch.apic_access_page)
2421 r = __kvm_set_memory_region(kvm, &kvm_userspace_mem, 0);
2425 kvm->arch.apic_access_page = gfn_to_page(kvm, 0xfee00);
2427 mutex_unlock(&kvm->slots_lock);
2431 static int alloc_identity_pagetable(struct kvm *kvm)
2436 mutex_lock(&kvm->slots_lock);
2437 if (kvm->arch.ept_identity_pagetable)
2442 kvm->arch.ept_identity_map_addr;
2444 r = __kvm_set_memory_region(kvm, &kvm_userspace_mem, 0);
2448 kvm->arch.ept_identity_pagetable = gfn_to_page(kvm,
2449 kvm->arch.ept_identity_map_addr >> PAGE_SHIFT);
2451 mutex_unlock(&kvm->slots_lock);
2538 if (!vm_need_tpr_shadow(vmx->vcpu.kvm)) {
2553 if (!vm_need_virtualize_apic_accesses(vmx->vcpu.kvm))
2658 tsc_base = vmx->vcpu.kvm->arch.vm_init_tsc;
2660 if (tsc_this < vmx->vcpu.kvm->arch.vm_init_tsc)
2668 static int init_rmode(struct kvm *kvm)
2672 idx = srcu_read_lock(&kvm->srcu);
2673 if (!init_rmode_tss(kvm))
2675 if (!init_rmode_identity_map(kvm))
2680 srcu_read_unlock(&kvm->srcu, idx);
2691 if (!init_rmode(vmx->vcpu.kvm)) {
2772 if (vm_need_tpr_shadow(vmx->vcpu.kvm))
2778 if (vm_need_virtualize_apic_accesses(vmx->vcpu.kvm))
2780 page_to_phys(vmx->vcpu.kvm->arch.apic_access_page));
2933 static int vmx_set_tss_addr(struct kvm *kvm, unsigned int addr)
2943 ret = kvm_set_memory_region(kvm, &tss_mem, 0);
2946 kvm->arch.tss_addr = addr;
3201 if (irqchip_in_kernel(vcpu->kvm))
3360 if (!irqchip_in_kernel(vcpu->kvm) &&
4086 static struct kvm_vcpu *vmx_create_vcpu(struct kvm *kvm, unsigned int id)
4097 err = kvm_vcpu_init(&vmx->vcpu, kvm, id);
4120 if (vm_need_virtualize_apic_accesses(kvm))
4121 if (alloc_apic_access_page(kvm) != 0)
4125 if (!kvm->arch.ept_identity_map_addr)
4126 kvm->arch.ept_identity_map_addr =
4128 if (alloc_identity_pagetable(kvm) != 0)
4154 printk(KERN_ERR "kvm: CPU %d feature inconsistency!\n",
4182 else if (vcpu->kvm->arch.iommu_domain &&
4183 !(vcpu->kvm->arch.iommu_flags & KVM_IOMMU_CACHE_COHERENCY))