Skip to content

Commit a770ee8

Browse files
Quentin PerretMarc Zyngier
authored andcommitted
KVM: arm64: pkvm: Disable GICv2 support
GICv2 requires having device mappings in guests and the hypervisor, which is incompatible with the current pKVM EL2 page ownership model which only covers memory. While it would be desirable to support pKVM with GICv2, this will require a lot more work, so let's make the current assumption clear until then. Co-developed-by: Marc Zyngier <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Signed-off-by: Quentin Perret <[email protected]> Acked-by: Will Deacon <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 34b43a8 commit a770ee8

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

arch/arm64/kvm/vgic/vgic-v2.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,11 @@ int vgic_v2_probe(const struct gic_kvm_info *info)
345345
int ret;
346346
u32 vtr;
347347

348+
if (is_protected_kvm_enabled()) {
349+
kvm_err("GICv2 not supported in protected mode\n");
350+
return -ENXIO;
351+
}
352+
348353
if (!info->vctrl.start) {
349354
kvm_err("GICH not present in the firmware table\n");
350355
return -ENXIO;

arch/arm64/kvm/vgic/vgic-v3.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@ int vgic_v3_probe(const struct gic_kvm_info *info)
651651
} else if (!PAGE_ALIGNED(info->vcpu.start)) {
652652
pr_warn("GICV physical address 0x%llx not page aligned\n",
653653
(unsigned long long)info->vcpu.start);
654-
} else {
654+
} else if (kvm_get_mode() != KVM_MODE_PROTECTED) {
655655
kvm_vgic_global_state.vcpu_base = info->vcpu.start;
656656
kvm_vgic_global_state.can_emulate_gicv2 = true;
657657
ret = kvm_register_vgic_device(KVM_DEV_TYPE_ARM_VGIC_V2);

0 commit comments

Comments
 (0)