Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d8772157 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull KVM fix from Paolo Bonzini:
 "Fix a bug which allows KVM guests to bring down the entire system on
  some 64K enabled ARM64 hosts"

* tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
  kvm: arm64: vgic: fix hyp panic with 64k pages on juno platform
parents 1d8fcba1 63afbe7a
Loading
Loading
Loading
Loading
+20 −4
Original line number Original line Diff line number Diff line
@@ -1526,17 +1526,33 @@ int kvm_vgic_hyp_init(void)
		goto out_unmap;
		goto out_unmap;
	}
	}


	kvm_info("%s@%llx IRQ%d\n", vgic_node->name,
		 vctrl_res.start, vgic_maint_irq);
	on_each_cpu(vgic_init_maintenance_interrupt, NULL, 1);

	if (of_address_to_resource(vgic_node, 3, &vcpu_res)) {
	if (of_address_to_resource(vgic_node, 3, &vcpu_res)) {
		kvm_err("Cannot obtain VCPU resource\n");
		kvm_err("Cannot obtain VCPU resource\n");
		ret = -ENXIO;
		ret = -ENXIO;
		goto out_unmap;
		goto out_unmap;
	}
	}

	if (!PAGE_ALIGNED(vcpu_res.start)) {
		kvm_err("GICV physical address 0x%llx not page aligned\n",
			(unsigned long long)vcpu_res.start);
		ret = -ENXIO;
		goto out_unmap;
	}

	if (!PAGE_ALIGNED(resource_size(&vcpu_res))) {
		kvm_err("GICV size 0x%llx not a multiple of page size 0x%lx\n",
			(unsigned long long)resource_size(&vcpu_res),
			PAGE_SIZE);
		ret = -ENXIO;
		goto out_unmap;
	}

	vgic_vcpu_base = vcpu_res.start;
	vgic_vcpu_base = vcpu_res.start;


	kvm_info("%s@%llx IRQ%d\n", vgic_node->name,
		 vctrl_res.start, vgic_maint_irq);
	on_each_cpu(vgic_init_maintenance_interrupt, NULL, 1);

	goto out;
	goto out;


out_unmap:
out_unmap: