KVM: ARM: Remove pgtable page standard functions from stage-2 page tables
authorAnshuman Khandual <anshuman.khandual@arm.com>
Tue, 12 Mar 2019 13:25:45 +0000 (18:55 +0530)
committerWill Deacon <will.deacon@arm.com>
Tue, 9 Apr 2019 10:21:50 +0000 (11:21 +0100)
commit14b94d07572619af896c6d2d83b1196c4041fe19
tree73494f1e7c6ca1a5790a3a7ef1b5dffd913ea3a5
parent369aaab845a65b90ceac2801edd577fae442476c
KVM: ARM: Remove pgtable page standard functions from stage-2 page tables

ARM64 standard pgtable functions are going to use pgtable_page_[ctor|dtor]
or pgtable_pmd_page_[ctor|dtor] constructs. At present KVM guest stage-2
PUD|PMD|PTE level page tabe pages are allocated with __get_free_page()
via mmu_memory_cache_alloc() but released with standard pud|pmd_free() or
pte_free_kernel(). These will fail once they start calling into pgtable_
[pmd]_page_dtor() for pages which never originally went through respective
constructor functions. Hence convert all stage-2 page table page release
functions to call buddy directly while freeing pages.

Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Acked-by: Yu Zhao <yuzhao@google.com>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm/include/asm/stage2_pgtable.h
arch/arm64/include/asm/stage2_pgtable.h
virt/kvm/arm/mmu.c