KVM: arm64: Add guard pages for KVM nVHE hypervisor stack
authorKalesh Singh <kaleshsingh@google.com>
Wed, 20 Apr 2022 21:42:54 +0000 (14:42 -0700)
committerMarc Zyngier <maz@kernel.org>
Thu, 28 Apr 2022 19:53:13 +0000 (20:53 +0100)
commitce3354318a57875dc59f4bb841662e95bfba03db
tree5b9676a2923ce4b733a1536df84eacd6ea2e2600
parentf922c13e778d6d5343d4576be785a8204c595113
KVM: arm64: Add guard pages for KVM nVHE hypervisor stack

Map the stack pages in the flexible private VA range and allocate
guard pages below the stack as unbacked VA space. The stack is aligned
so that any valid stack address has PAGE_SHIFT bit as 1 - this is used
for overflow detection (implemented in a subsequent patch in the series).

Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
Tested-by: Fuad Tabba <tabba@google.com>
Reviewed-by: Fuad Tabba <tabba@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20220420214317.3303360-4-kaleshsingh@google.com
arch/arm64/include/asm/kvm_asm.h
arch/arm64/include/asm/kvm_mmu.h
arch/arm64/kvm/arm.c
arch/arm64/kvm/mmu.c