diff options
author | Vincent Donnefort <vdonnefort@google.com> | 2023-08-11 12:20:37 +0100 |
---|---|---|
committer | Marc Zyngier <maz@kernel.org> | 2023-08-26 12:00:54 +0100 |
commit | f156a7d13fc35d0078cd644b8cf0a6f97cbbe2e2 (patch) | |
tree | ea74d4df33d2d46d968819b918d1973d2cf00161 /arch/arm64/kvm/hyp/include/nvhe/mm.h | |
parent | a6b33d009fc1fe80c935f18b714b36c81e1f1400 (diff) |
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
Diffstat (limited to 'arch/arm64/kvm/hyp/include/nvhe/mm.h')
-rw-r--r-- | arch/arm64/kvm/hyp/include/nvhe/mm.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/arm64/kvm/hyp/include/nvhe/mm.h b/arch/arm64/kvm/hyp/include/nvhe/mm.h index d5ec972b5c1e..230e4f2527de 100644 --- a/arch/arm64/kvm/hyp/include/nvhe/mm.h +++ b/arch/arm64/kvm/hyp/include/nvhe/mm.h @@ -26,6 +26,7 @@ int pkvm_create_mappings_locked(void *from, void *to, enum kvm_pgtable_prot prot int __pkvm_create_private_mapping(phys_addr_t phys, size_t size, enum kvm_pgtable_prot prot, unsigned long *haddr); +int pkvm_create_stack(phys_addr_t phys, unsigned long *haddr); int pkvm_alloc_private_va_range(size_t size, unsigned long *haddr); #endif /* __KVM_HYP_MM_H */ |