Commit ae5a2a39 authored by Haiwei Li's avatar Haiwei Li Committed by Paolo Bonzini

KVM: SVM: use __GFP_ZERO instead of clear_page()

Use __GFP_ZERO while alloc_page().
Signed-off-by: default avatarHaiwei Li <lihaiwei@tencent.com>
Message-Id: <20200916083621.5512-1-lihaiwei.kernel@gmail.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent bddd82d1
...@@ -153,20 +153,18 @@ int avic_vm_init(struct kvm *kvm) ...@@ -153,20 +153,18 @@ int avic_vm_init(struct kvm *kvm)
return 0; return 0;
/* Allocating physical APIC ID table (4KB) */ /* Allocating physical APIC ID table (4KB) */
p_page = alloc_page(GFP_KERNEL_ACCOUNT); p_page = alloc_page(GFP_KERNEL_ACCOUNT | __GFP_ZERO);
if (!p_page) if (!p_page)
goto free_avic; goto free_avic;
kvm_svm->avic_physical_id_table_page = p_page; kvm_svm->avic_physical_id_table_page = p_page;
clear_page(page_address(p_page));
/* Allocating logical APIC ID table (4KB) */ /* Allocating logical APIC ID table (4KB) */
l_page = alloc_page(GFP_KERNEL_ACCOUNT); l_page = alloc_page(GFP_KERNEL_ACCOUNT | __GFP_ZERO);
if (!l_page) if (!l_page)
goto free_avic; goto free_avic;
kvm_svm->avic_logical_id_table_page = l_page; kvm_svm->avic_logical_id_table_page = l_page;
clear_page(page_address(l_page));
spin_lock_irqsave(&svm_vm_data_hash_lock, flags); spin_lock_irqsave(&svm_vm_data_hash_lock, flags);
again: again:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment