diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-13 13:14:24 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-13 13:14:24 -0500 |
commit | 55065bc52795faae549abfb912aacc622dd63876 (patch) | |
tree | 63683547e41ed459a2a8747eeafb5e969633d54f /arch/ia64 | |
parent | 008d23e4852d78bb2618f2035f8b2110b6a6b968 (diff) | |
parent | e5c301428294cb8925667c9ee39f817c4ab1c2c9 (diff) |
Merge branch 'kvm-updates/2.6.38' of git://git.kernel.org/pub/scm/virt/kvm/kvm
* 'kvm-updates/2.6.38' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (142 commits)
KVM: Initialize fpu state in preemptible context
KVM: VMX: when entering real mode align segment base to 16 bytes
KVM: MMU: handle 'map_writable' in set_spte() function
KVM: MMU: audit: allow audit more guests at the same time
KVM: Fetch guest cr3 from hardware on demand
KVM: Replace reads of vcpu->arch.cr3 by an accessor
KVM: MMU: only write protect mappings at pagetable level
KVM: VMX: Correct asm constraint in vmcs_load()/vmcs_clear()
KVM: MMU: Initialize base_role for tdp mmus
KVM: VMX: Optimize atomic EFER load
KVM: VMX: Add definitions for more vm entry/exit control bits
KVM: SVM: copy instruction bytes from VMCB
KVM: SVM: implement enhanced INVLPG intercept
KVM: SVM: enhance mov DR intercept handler
KVM: SVM: enhance MOV CR intercept handler
KVM: SVM: add new SVM feature bit names
KVM: cleanup emulate_instruction
KVM: move complete_insn_gp() into x86.c
KVM: x86: fix CR8 handling
KVM guest: Fix kvm clock initialization when it's configured out
...
Diffstat (limited to 'arch/ia64')
-rw-r--r-- | arch/ia64/include/asm/kvm_host.h | 4 | ||||
-rw-r--r-- | arch/ia64/kvm/kvm-ia64.c | 30 |
2 files changed, 13 insertions, 21 deletions
diff --git a/arch/ia64/include/asm/kvm_host.h b/arch/ia64/include/asm/kvm_host.h index 2f229e5de498..2689ee54a1c9 100644 --- a/arch/ia64/include/asm/kvm_host.h +++ b/arch/ia64/include/asm/kvm_host.h | |||
@@ -590,6 +590,10 @@ int kvm_emulate_halt(struct kvm_vcpu *vcpu); | |||
590 | int kvm_pal_emul(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run); | 590 | int kvm_pal_emul(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run); |
591 | void kvm_sal_emul(struct kvm_vcpu *vcpu); | 591 | void kvm_sal_emul(struct kvm_vcpu *vcpu); |
592 | 592 | ||
593 | #define __KVM_HAVE_ARCH_VM_ALLOC 1 | ||
594 | struct kvm *kvm_arch_alloc_vm(void); | ||
595 | void kvm_arch_free_vm(struct kvm *kvm); | ||
596 | |||
593 | #endif /* __ASSEMBLY__*/ | 597 | #endif /* __ASSEMBLY__*/ |
594 | 598 | ||
595 | #endif | 599 | #endif |
diff --git a/arch/ia64/kvm/kvm-ia64.c b/arch/ia64/kvm/kvm-ia64.c index f56a6316e134..70d224d4264c 100644 --- a/arch/ia64/kvm/kvm-ia64.c +++ b/arch/ia64/kvm/kvm-ia64.c | |||
@@ -749,7 +749,7 @@ out: | |||
749 | return r; | 749 | return r; |
750 | } | 750 | } |
751 | 751 | ||
752 | static struct kvm *kvm_alloc_kvm(void) | 752 | struct kvm *kvm_arch_alloc_vm(void) |
753 | { | 753 | { |
754 | 754 | ||
755 | struct kvm *kvm; | 755 | struct kvm *kvm; |
@@ -760,7 +760,7 @@ static struct kvm *kvm_alloc_kvm(void) | |||
760 | vm_base = __get_free_pages(GFP_KERNEL, get_order(KVM_VM_DATA_SIZE)); | 760 | vm_base = __get_free_pages(GFP_KERNEL, get_order(KVM_VM_DATA_SIZE)); |
761 | 761 | ||
762 | if (!vm_base) | 762 | if (!vm_base) |
763 | return ERR_PTR(-ENOMEM); | 763 | return NULL; |
764 | 764 | ||
765 | memset((void *)vm_base, 0, KVM_VM_DATA_SIZE); | 765 | memset((void *)vm_base, 0, KVM_VM_DATA_SIZE); |
766 | kvm = (struct kvm *)(vm_base + | 766 | kvm = (struct kvm *)(vm_base + |
@@ -806,10 +806,12 @@ static void kvm_build_io_pmt(struct kvm *kvm) | |||
806 | #define GUEST_PHYSICAL_RR4 0x2739 | 806 | #define GUEST_PHYSICAL_RR4 0x2739 |
807 | #define VMM_INIT_RR 0x1660 | 807 | #define VMM_INIT_RR 0x1660 |
808 | 808 | ||
809 | static void kvm_init_vm(struct kvm *kvm) | 809 | int kvm_arch_init_vm(struct kvm *kvm) |
810 | { | 810 | { |
811 | BUG_ON(!kvm); | 811 | BUG_ON(!kvm); |
812 | 812 | ||
813 | kvm->arch.is_sn2 = ia64_platform_is("sn2"); | ||
814 | |||
813 | kvm->arch.metaphysical_rr0 = GUEST_PHYSICAL_RR0; | 815 | kvm->arch.metaphysical_rr0 = GUEST_PHYSICAL_RR0; |
814 | kvm->arch.metaphysical_rr4 = GUEST_PHYSICAL_RR4; | 816 | kvm->arch.metaphysical_rr4 = GUEST_PHYSICAL_RR4; |
815 | kvm->arch.vmm_init_rr = VMM_INIT_RR; | 817 | kvm->arch.vmm_init_rr = VMM_INIT_RR; |
@@ -823,21 +825,8 @@ static void kvm_init_vm(struct kvm *kvm) | |||
823 | 825 | ||
824 | /* Reserve bit 0 of irq_sources_bitmap for userspace irq source */ | 826 | /* Reserve bit 0 of irq_sources_bitmap for userspace irq source */ |
825 | set_bit(KVM_USERSPACE_IRQ_SOURCE_ID, &kvm->arch.irq_sources_bitmap); | 827 | set_bit(KVM_USERSPACE_IRQ_SOURCE_ID, &kvm->arch.irq_sources_bitmap); |
826 | } | ||
827 | |||
828 | struct kvm *kvm_arch_create_vm(void) | ||
829 | { | ||
830 | struct kvm *kvm = kvm_alloc_kvm(); | ||
831 | |||
832 | if (IS_ERR(kvm)) | ||
833 | return ERR_PTR(-ENOMEM); | ||
834 | |||
835 | kvm->arch.is_sn2 = ia64_platform_is("sn2"); | ||
836 | |||
837 | kvm_init_vm(kvm); | ||
838 | |||
839 | return kvm; | ||
840 | 828 | ||
829 | return 0; | ||
841 | } | 830 | } |
842 | 831 | ||
843 | static int kvm_vm_ioctl_get_irqchip(struct kvm *kvm, | 832 | static int kvm_vm_ioctl_get_irqchip(struct kvm *kvm, |
@@ -962,7 +951,9 @@ long kvm_arch_vm_ioctl(struct file *filp, | |||
962 | goto out; | 951 | goto out; |
963 | r = kvm_setup_default_irq_routing(kvm); | 952 | r = kvm_setup_default_irq_routing(kvm); |
964 | if (r) { | 953 | if (r) { |
954 | mutex_lock(&kvm->slots_lock); | ||
965 | kvm_ioapic_destroy(kvm); | 955 | kvm_ioapic_destroy(kvm); |
956 | mutex_unlock(&kvm->slots_lock); | ||
966 | goto out; | 957 | goto out; |
967 | } | 958 | } |
968 | break; | 959 | break; |
@@ -1357,7 +1348,7 @@ int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu, | |||
1357 | return -EINVAL; | 1348 | return -EINVAL; |
1358 | } | 1349 | } |
1359 | 1350 | ||
1360 | static void free_kvm(struct kvm *kvm) | 1351 | void kvm_arch_free_vm(struct kvm *kvm) |
1361 | { | 1352 | { |
1362 | unsigned long vm_base = kvm->arch.vm_base; | 1353 | unsigned long vm_base = kvm->arch.vm_base; |
1363 | 1354 | ||
@@ -1399,9 +1390,6 @@ void kvm_arch_destroy_vm(struct kvm *kvm) | |||
1399 | #endif | 1390 | #endif |
1400 | kfree(kvm->arch.vioapic); | 1391 | kfree(kvm->arch.vioapic); |
1401 | kvm_release_vm_pages(kvm); | 1392 | kvm_release_vm_pages(kvm); |
1402 | kvm_free_physmem(kvm); | ||
1403 | cleanup_srcu_struct(&kvm->srcu); | ||
1404 | free_kvm(kvm); | ||
1405 | } | 1393 | } |
1406 | 1394 | ||
1407 | void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu) | 1395 | void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu) |