summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMaxim Levitsky <mlevitsk@redhat.com>2020-08-27 19:11:41 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2020-09-28 13:57:11 +0200
commit0681de1b83697bcbc06b843d0c8302da45855205 (patch)
tree4f6160435a09bba94f8d1c7e55d1409e751f2c1f /arch
parentKVM: SVM: refactor msr permission bitmap allocation (diff)
downloadlinux-0681de1b83697bcbc06b843d0c8302da45855205.tar.xz
linux-0681de1b83697bcbc06b843d0c8302da45855205.zip
KVM: SVM: use __GFP_ZERO instead of clear_page
Another small refactoring. Suggested-by: Jim Mattson <jmattson@google.com> Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com> Message-Id: <20200827171145.374620-5-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kvm/svm/svm.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
index 535839cdcb56..22886b1d9af7 100644
--- a/arch/x86/kvm/svm/svm.c
+++ b/arch/x86/kvm/svm/svm.c
@@ -1190,11 +1190,11 @@ static int svm_create_vcpu(struct kvm_vcpu *vcpu)
svm = to_svm(vcpu);
err = -ENOMEM;
- vmcb_page = alloc_page(GFP_KERNEL_ACCOUNT);
+ vmcb_page = alloc_page(GFP_KERNEL_ACCOUNT | __GFP_ZERO);
if (!vmcb_page)
goto out;
- hsave_page = alloc_page(GFP_KERNEL_ACCOUNT);
+ hsave_page = alloc_page(GFP_KERNEL_ACCOUNT | __GFP_ZERO);
if (!hsave_page)
goto free_page1;
@@ -1209,7 +1209,6 @@ static int svm_create_vcpu(struct kvm_vcpu *vcpu)
svm->avic_is_running = true;
svm->nested.hsave = page_address(hsave_page);
- clear_page(svm->nested.hsave);
svm->msrpm = svm_vcpu_init_msrpm();
if (!svm->msrpm)
@@ -1220,7 +1219,6 @@ static int svm_create_vcpu(struct kvm_vcpu *vcpu)
goto free_page3;
svm->vmcb = page_address(vmcb_page);
- clear_page(svm->vmcb);
svm->vmcb_pa = __sme_set(page_to_pfn(vmcb_page) << PAGE_SHIFT);
svm->asid_generation = 0;
init_vmcb(svm);