[PATCH v2 2/5] drivers/virt: pkvm: Make pkvm_granule __ro_after_init
From: Vincent Donnefort
Date: Tue Nov 24 2026 - 11:46:12 EST
pkvm_granule is only written once during init in
pkvm_init_hyp_services(). Mark it as __ro_after_init.
Tested-by: Fuad Tabba <fuad.tabba@xxxxxxxxx>
Reviewed-by: Fuad Tabba <fuad.tabba@xxxxxxxxx>
Signed-off-by: Vincent Donnefort <vdonnefort@xxxxxxxxxx>
---
drivers/virt/coco/pkvm-guest/arm-pkvm-guest.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/virt/coco/pkvm-guest/arm-pkvm-guest.c b/drivers/virt/coco/pkvm-guest/arm-pkvm-guest.c
index e7d7cedf7f6f..fbcb57c31186 100644
--- a/drivers/virt/coco/pkvm-guest/arm-pkvm-guest.c
+++ b/drivers/virt/coco/pkvm-guest/arm-pkvm-guest.c
@@ -17,7 +17,7 @@
#include <asm/hypervisor.h>
-static size_t pkvm_granule;
+static size_t __ro_after_init pkvm_granule;
DEFINE_STATIC_KEY_FALSE_RO(pkvm_guest);
static int arm_smccc_do_one_page(u32 func_id, phys_addr_t phys)
--
2.56.1.809.ga0b61035b5-goog