KVM: arm64: Remove size-order align in the nVHE hyp private VA range
authorVincent Donnefort <vdonnefort@google.com>
Fri, 11 Aug 2023 11:20:37 +0000 (12:20 +0100)
committerMarc Zyngier <maz@kernel.org>
Sat, 26 Aug 2023 11:00:54 +0000 (12:00 +0100)
commitf156a7d13fc35d0078cd644b8cf0a6f97cbbe2e2
treeea74d4df33d2d46d968819b918d1973d2cf00161
parenta6b33d009fc1fe80c935f18b714b36c81e1f1400
KVM: arm64: Remove size-order align in the nVHE hyp private VA range

commit f922c13e778d ("KVM: arm64: Introduce
pkvm_alloc_private_va_range()") and commit 92abe0f81e13 ("KVM: arm64:
Introduce hyp_alloc_private_va_range()") added an alignment for the
start address of any allocation into the nVHE hypervisor private VA
range.

This alignment (order of the size of the allocation) intends to enable
efficient stack verification (if the PAGE_SHIFT bit is zero, the stack
pointer is on the guard page and a stack overflow occurred).

But this is only necessary for stack allocation and can waste a lot of
VA space. So instead make stack-specific functions, handling the guard
page requirements, while other users (e.g.  fixmap) will only get page
alignment.

Reviewed-by: Kalesh Singh <kaleshsingh@google.com>
Signed-off-by: Vincent Donnefort <vdonnefort@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20230811112037.1147863-1-vdonnefort@google.com
arch/arm64/include/asm/kvm_mmu.h
arch/arm64/kvm/arm.c
arch/arm64/kvm/hyp/include/nvhe/mm.h
arch/arm64/kvm/hyp/nvhe/mm.c
arch/arm64/kvm/hyp/nvhe/setup.c
arch/arm64/kvm/mmu.c