提交 80feb89a 编写于 作者: T Takuya Yoshikawa 提交者: Marcelo Tosatti

KVM: MMU: Remove unused parameter from mmu_memory_cache_alloc()

Size is not needed to return one from pre-allocated objects.
Signed-off-by: NTakuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>
Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
上级 25e531a9
...@@ -652,8 +652,7 @@ static void mmu_free_memory_caches(struct kvm_vcpu *vcpu) ...@@ -652,8 +652,7 @@ static void mmu_free_memory_caches(struct kvm_vcpu *vcpu)
mmu_page_header_cache); mmu_page_header_cache);
} }
static void *mmu_memory_cache_alloc(struct kvm_mmu_memory_cache *mc, static void *mmu_memory_cache_alloc(struct kvm_mmu_memory_cache *mc)
size_t size)
{ {
void *p; void *p;
...@@ -664,8 +663,7 @@ static void *mmu_memory_cache_alloc(struct kvm_mmu_memory_cache *mc, ...@@ -664,8 +663,7 @@ static void *mmu_memory_cache_alloc(struct kvm_mmu_memory_cache *mc,
static struct pte_list_desc *mmu_alloc_pte_list_desc(struct kvm_vcpu *vcpu) static struct pte_list_desc *mmu_alloc_pte_list_desc(struct kvm_vcpu *vcpu)
{ {
return mmu_memory_cache_alloc(&vcpu->arch.mmu_pte_list_desc_cache, return mmu_memory_cache_alloc(&vcpu->arch.mmu_pte_list_desc_cache);
sizeof(struct pte_list_desc));
} }
static void mmu_free_pte_list_desc(struct pte_list_desc *pte_list_desc) static void mmu_free_pte_list_desc(struct pte_list_desc *pte_list_desc)
...@@ -1403,12 +1401,10 @@ static struct kvm_mmu_page *kvm_mmu_alloc_page(struct kvm_vcpu *vcpu, ...@@ -1403,12 +1401,10 @@ static struct kvm_mmu_page *kvm_mmu_alloc_page(struct kvm_vcpu *vcpu,
u64 *parent_pte, int direct) u64 *parent_pte, int direct)
{ {
struct kvm_mmu_page *sp; struct kvm_mmu_page *sp;
sp = mmu_memory_cache_alloc(&vcpu->arch.mmu_page_header_cache, sp = mmu_memory_cache_alloc(&vcpu->arch.mmu_page_header_cache);
sizeof *sp); sp->spt = mmu_memory_cache_alloc(&vcpu->arch.mmu_page_cache);
sp->spt = mmu_memory_cache_alloc(&vcpu->arch.mmu_page_cache, PAGE_SIZE);
if (!direct) if (!direct)
sp->gfns = mmu_memory_cache_alloc(&vcpu->arch.mmu_page_cache, sp->gfns = mmu_memory_cache_alloc(&vcpu->arch.mmu_page_cache);
PAGE_SIZE);
set_page_private(virt_to_page(sp->spt), (unsigned long)sp); set_page_private(virt_to_page(sp->spt), (unsigned long)sp);
list_add(&sp->link, &vcpu->kvm->arch.active_mmu_pages); list_add(&sp->link, &vcpu->kvm->arch.active_mmu_pages);
bitmap_zero(sp->slot_bitmap, KVM_MEM_SLOTS_NUM); bitmap_zero(sp->slot_bitmap, KVM_MEM_SLOTS_NUM);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册