diff options
author | Marcelo Tosatti <marcelo@kvack.org> | 2008-02-15 00:21:43 +0100 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-03-04 14:19:46 +0100 |
commit | 5e4a0b3c1b899bb0ba28bde6edf95c5ddeb48b5c (patch) | |
tree | 616190ac85c14ba58d738612d9465221193cb38a /arch/x86 | |
parent | KVM: SVM: fix Windows XP 64 bit installation crash (diff) | |
download | linux-5e4a0b3c1b899bb0ba28bde6edf95c5ddeb48b5c.tar.xz linux-5e4a0b3c1b899bb0ba28bde6edf95c5ddeb48b5c.zip |
KVM: move alloc_apic_access_page() outside of non-preemptable region
alloc_apic_access_page() can sleep, while vmx_vcpu_setup is called
inside a non preemptable region. Move it after put_cpu().
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kvm/vmx.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 86f5bf121838..61c2a3a8d20a 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -1605,9 +1605,6 @@ static int vmx_vcpu_setup(struct vcpu_vmx *vmx) vmcs_writel(CR0_GUEST_HOST_MASK, ~0UL); vmcs_writel(CR4_GUEST_HOST_MASK, KVM_GUEST_CR4_MASK); - if (vm_need_virtualize_apic_accesses(vmx->vcpu.kvm)) - if (alloc_apic_access_page(vmx->vcpu.kvm) != 0) - return -ENOMEM; return 0; } @@ -2537,6 +2534,9 @@ static struct kvm_vcpu *vmx_create_vcpu(struct kvm *kvm, unsigned int id) put_cpu(); if (err) goto free_vmcs; + if (vm_need_virtualize_apic_accesses(kvm)) + if (alloc_apic_access_page(kvm) != 0) + goto free_vmcs; return &vmx->vcpu; |