Commit a770ee80 authored by Quentin Perret's avatar Quentin Perret Committed by Marc Zyngier
Browse files

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: default avatarMarc Zyngier <maz@kernel.org>
Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
Signed-off-by: default avatarQuentin Perret <qperret@google.com>
Acked-by: default avatarWill Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20211208152300.2478542-3-qperret@google.com
parent 34b43a88
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -345,6 +345,11 @@ int vgic_v2_probe(const struct gic_kvm_info *info)
	int ret;
	int ret;
	u32 vtr;
	u32 vtr;


	if (is_protected_kvm_enabled()) {
		kvm_err("GICv2 not supported in protected mode\n");
		return -ENXIO;
	}

	if (!info->vctrl.start) {
	if (!info->vctrl.start) {
		kvm_err("GICH not present in the firmware table\n");
		kvm_err("GICH not present in the firmware table\n");
		return -ENXIO;
		return -ENXIO;
+1 −1
Original line number Original line Diff line number Diff line
@@ -651,7 +651,7 @@ int vgic_v3_probe(const struct gic_kvm_info *info)
	} else if (!PAGE_ALIGNED(info->vcpu.start)) {
	} else if (!PAGE_ALIGNED(info->vcpu.start)) {
		pr_warn("GICV physical address 0x%llx not page aligned\n",
		pr_warn("GICV physical address 0x%llx not page aligned\n",
			(unsigned long long)info->vcpu.start);
			(unsigned long long)info->vcpu.start);
	} else {
	} else if (kvm_get_mode() != KVM_MODE_PROTECTED) {
		kvm_vgic_global_state.vcpu_base = info->vcpu.start;
		kvm_vgic_global_state.vcpu_base = info->vcpu.start;
		kvm_vgic_global_state.can_emulate_gicv2 = true;
		kvm_vgic_global_state.can_emulate_gicv2 = true;
		ret = kvm_register_vgic_device(KVM_DEV_TYPE_ARM_VGIC_V2);
		ret = kvm_register_vgic_device(KVM_DEV_TYPE_ARM_VGIC_V2);