diff options
| author | Dave Airlie <airlied@redhat.com> | 2010-05-18 19:35:51 -0400 |
|---|---|---|
| committer | Dave Airlie <airlied@redhat.com> | 2010-05-18 19:35:51 -0400 |
| commit | 05ea893c46805b2981ea8ba6df881e3d65edd63b (patch) | |
| tree | ea381e22d99f49bd2c95238f88491d48b797a17b /arch/x86/kvm/svm.c | |
| parent | 26481fb15644b5fd85d4cea020f74a234cdf6803 (diff) | |
| parent | a7c542782e92f9487c62a571565637be3d6b0ffd (diff) | |
Merge remote branch 'anholt/drm-intel-next' into drm-next
* anholt/drm-intel-next: (515 commits)
drm/i915: Fix out of tree builds
drm/i915: move fence lru to struct drm_i915_fence_reg
drm/i915: don't allow tiling changes on pinned buffers v2
drm/i915: Be extra careful about A/D matching for multifunction SDVO
drm/i915: Fix DDC bus selection for multifunction SDVO
drm/i915: cleanup mode setting before unmapping registers
drm/i915: Make fbc control wrapper functions
drm/i915: Wait for the GPU whilst shrinking, if truly desperate.
drm/i915: Use spatio-temporal dithering on PCH
[MTD] Remove zero-length files mtdbdi.c and internal.ho
pata_pcmcia / ide-cs: Fix bad hashes for Transcend and kingston IDs
libata: Fix several inaccuracies in developer's guide
slub: Fix bad boundary check in init_kmem_cache_nodes()
raid6: fix recovery performance regression
KEYS: call_sbin_request_key() must write lock keyrings before modifying them
KEYS: Use RCU dereference wrappers in keyring key type code
KEYS: find_keyring_by_name() can gain access to a freed keyring
ALSA: hda: Fix 0 dB for Packard Bell models using Conexant CX20549 (Venice)
ALSA: hda - Add quirk for Dell Inspiron 19T using a Conexant CX20582
ALSA: take tu->qlock with irqs disabled
...
Diffstat (limited to 'arch/x86/kvm/svm.c')
| -rw-r--r-- | arch/x86/kvm/svm.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 445c59411ed0..2ba58206812a 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c | |||
| @@ -706,29 +706,28 @@ static struct kvm_vcpu *svm_create_vcpu(struct kvm *kvm, unsigned int id) | |||
| 706 | if (err) | 706 | if (err) |
| 707 | goto free_svm; | 707 | goto free_svm; |
| 708 | 708 | ||
| 709 | err = -ENOMEM; | ||
| 709 | page = alloc_page(GFP_KERNEL); | 710 | page = alloc_page(GFP_KERNEL); |
| 710 | if (!page) { | 711 | if (!page) |
| 711 | err = -ENOMEM; | ||
| 712 | goto uninit; | 712 | goto uninit; |
| 713 | } | ||
| 714 | 713 | ||
| 715 | err = -ENOMEM; | ||
| 716 | msrpm_pages = alloc_pages(GFP_KERNEL, MSRPM_ALLOC_ORDER); | 714 | msrpm_pages = alloc_pages(GFP_KERNEL, MSRPM_ALLOC_ORDER); |
| 717 | if (!msrpm_pages) | 715 | if (!msrpm_pages) |
| 718 | goto uninit; | 716 | goto free_page1; |
| 719 | 717 | ||
| 720 | nested_msrpm_pages = alloc_pages(GFP_KERNEL, MSRPM_ALLOC_ORDER); | 718 | nested_msrpm_pages = alloc_pages(GFP_KERNEL, MSRPM_ALLOC_ORDER); |
| 721 | if (!nested_msrpm_pages) | 719 | if (!nested_msrpm_pages) |
| 722 | goto uninit; | 720 | goto free_page2; |
| 723 | |||
| 724 | svm->msrpm = page_address(msrpm_pages); | ||
| 725 | svm_vcpu_init_msrpm(svm->msrpm); | ||
| 726 | 721 | ||
| 727 | hsave_page = alloc_page(GFP_KERNEL); | 722 | hsave_page = alloc_page(GFP_KERNEL); |
| 728 | if (!hsave_page) | 723 | if (!hsave_page) |
| 729 | goto uninit; | 724 | goto free_page3; |
| 725 | |||
| 730 | svm->nested.hsave = page_address(hsave_page); | 726 | svm->nested.hsave = page_address(hsave_page); |
| 731 | 727 | ||
| 728 | svm->msrpm = page_address(msrpm_pages); | ||
| 729 | svm_vcpu_init_msrpm(svm->msrpm); | ||
| 730 | |||
| 732 | svm->nested.msrpm = page_address(nested_msrpm_pages); | 731 | svm->nested.msrpm = page_address(nested_msrpm_pages); |
| 733 | 732 | ||
| 734 | svm->vmcb = page_address(page); | 733 | svm->vmcb = page_address(page); |
| @@ -744,6 +743,12 @@ static struct kvm_vcpu *svm_create_vcpu(struct kvm *kvm, unsigned int id) | |||
| 744 | 743 | ||
| 745 | return &svm->vcpu; | 744 | return &svm->vcpu; |
| 746 | 745 | ||
| 746 | free_page3: | ||
| 747 | __free_pages(nested_msrpm_pages, MSRPM_ALLOC_ORDER); | ||
| 748 | free_page2: | ||
| 749 | __free_pages(msrpm_pages, MSRPM_ALLOC_ORDER); | ||
| 750 | free_page1: | ||
| 751 | __free_page(page); | ||
| 747 | uninit: | 752 | uninit: |
| 748 | kvm_vcpu_uninit(&svm->vcpu); | 753 | kvm_vcpu_uninit(&svm->vcpu); |
| 749 | free_svm: | 754 | free_svm: |
