summaryrefslogtreecommitdiff
path: root/drivers/virt
diff options
context:
space:
mode:
authorMostafa Saleh <smostafa@google.com>2026-06-03 11:05:22 +0000
committerWill Deacon <will@kernel.org>2026-07-21 22:27:47 +0000
commite62decaf98e7c1385c4a22c61ba8bf94d24713a5 (patch)
tree107182e94051846df0561ca6b670a4f9d6f31e17 /drivers/virt
parent442d366cc1aabc699015a2e10a41bba17fe416ad (diff)
downloadlinux-next-e62decaf98e7c1385c4a22c61ba8bf94d24713a5.tar.gz
linux-next-e62decaf98e7c1385c4a22c61ba8bf94d24713a5.zip
arm64/coco: Add pKVM as a CC platform
pKVM does support memory encryption, expose that to the rest of the kernel through cc_platform_has() At the moment, all devices inside the guest are emulated which requires its memory to be shared back to the host (decrypted), so set force_dma_unencrypted() to always return true. Although, typically pKVM guests rely on restricted-dma-pools to bounce traffic, with this change, it is possible to solely rely on the default SWIOTLB for that (assuming the appropriate size is set from the command line) Signed-off-by: Mostafa Saleh <smostafa@google.com> Reviewed-by: Catalin Marinas <catalin.marinas@arm.com> Tested-by: Aneesh Kumar K.V (Arm) <aneesh.kumar@kernel.org> Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'drivers/virt')
-rw-r--r--drivers/virt/coco/pkvm-guest/arm-pkvm-guest.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/virt/coco/pkvm-guest/arm-pkvm-guest.c b/drivers/virt/coco/pkvm-guest/arm-pkvm-guest.c
index 4230b817a80b..6e966bad5ee1 100644
--- a/drivers/virt/coco/pkvm-guest/arm-pkvm-guest.c
+++ b/drivers/virt/coco/pkvm-guest/arm-pkvm-guest.c
@@ -17,6 +17,7 @@
#include <asm/hypervisor.h>
static size_t pkvm_granule;
+DEFINE_STATIC_KEY_FALSE_RO(pkvm_guest);
static int arm_smccc_do_one_page(u32 func_id, phys_addr_t phys)
{
@@ -120,4 +121,6 @@ void pkvm_init_hyp_services(void)
if (kvm_arm_hyp_service_available(ARM_SMCCC_KVM_FUNC_MMIO_GUARD))
arm64_ioremap_prot_hook_register(&mmio_guard_ioremap_hook);
+
+ static_branch_enable(&pkvm_guest);
}