From 092a580916f8b9db7936a88d6b1963a77de29959 Mon Sep 17 00:00:00 2001 From: Sebastian Ene Date: Tue, 7 Jan 2025 16:33:28 +0000 Subject: [PATCH] ANDROID: KVM: arm64: Present the 16Kb granule support to the guest VMs Extend the allow mask for the ID_AA64MMFR0_EL1 register to add support for the 16Kb protected guest VMs. When the guest reads this register the hypervisor traps the access and returns its configuration derived from the host. Bug: 376870129 Bug: 278749606 Test: boot a 16Kb protected guest VM on a 16Kb host Change-Id: If7d50c7345fc4d9db9dbcca04f19b8bbbc70925e Signed-off-by: Sebastian Ene --- arch/arm64/include/asm/kvm_pkvm.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/kvm_pkvm.h b/arch/arm64/include/asm/kvm_pkvm.h index 3077c2514a6d..54d71f3d4f7c 100644 --- a/arch/arm64/include/asm/kvm_pkvm.h +++ b/arch/arm64/include/asm/kvm_pkvm.h @@ -110,12 +110,14 @@ void pkvm_host_reclaim_page(struct kvm *host_kvm, phys_addr_t ipa); * - Distinction between Secure and Non-secure Memory * - Mixed-endian at EL0 only * - Non-context synchronizing exception entry and exit + * - 16Kb stage-1 granule support */ #define PVM_ID_AA64MMFR0_ALLOW (\ ARM64_FEATURE_MASK(ID_AA64MMFR0_EL1_BIGEND) | \ ARM64_FEATURE_MASK(ID_AA64MMFR0_EL1_SNSMEM) | \ ARM64_FEATURE_MASK(ID_AA64MMFR0_EL1_BIGENDEL0) | \ - ARM64_FEATURE_MASK(ID_AA64MMFR0_EL1_EXS) \ + ARM64_FEATURE_MASK(ID_AA64MMFR0_EL1_EXS) | \ + ARM64_FEATURE_MASK(ID_AA64MMFR0_EL1_TGRAN16) \ ) /*