Skip to content

Commit 27eb26b

Browse files
Quentin PerretMarc Zyngier
authored andcommitted
KVM: arm64: Explicitly map 'kvm_vgic_global_state' at EL2
The pkvm hypervisor at EL2 may need to read the 'kvm_vgic_global_state' variable from the host, for example when saving and restoring the state of the virtual GIC. Explicitly map 'kvm_vgic_global_state' in the stage-1 page-table of the pKVM hypervisor rather than relying on mapping all of the host '.rodata' section. Tested-by: Vincent Donnefort <[email protected]> Signed-off-by: Quentin Perret <[email protected]> Signed-off-by: Will Deacon <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 73f38ef commit 27eb26b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

arch/arm64/kvm/hyp/nvhe/setup.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,11 @@ static int recreate_hyp_mappings(phys_addr_t phys, unsigned long size,
161161
if (ret)
162162
return ret;
163163

164+
ret = pkvm_create_mappings(&kvm_vgic_global_state,
165+
&kvm_vgic_global_state + 1, prot);
166+
if (ret)
167+
return ret;
168+
164169
return 0;
165170
}
166171

0 commit comments

Comments
 (0)