]> git.baikalelectronics.ru Git - kernel.git/commit
arm/arm64: KVM: vgic: Check for !irqchip_in_kernel() when mapping resources
authorPavel Fedin <p.fedin@samsung.com>
Wed, 5 Aug 2015 10:53:57 +0000 (11:53 +0100)
committerMarc Zyngier <marc.zyngier@arm.com>
Wed, 16 Sep 2015 17:35:28 +0000 (18:35 +0100)
commit5a59a724239b8255826d59aae2cc54f68d5c8d49
treebb3be06d91183f5dc8ff0dce7040e3b5589bdab1
parenteb17f91db9241391a54e906931cb98a53cef3f32
arm/arm64: KVM: vgic: Check for !irqchip_in_kernel() when mapping resources

Until 0a57f4cee715 ("arm/arm64: KVM: introduce per-VM ops"),
kvm_vgic_map_resources() used to include a check on irqchip_in_kernel(),
and vgic_v2_map_resources() still has it.

But now vm_ops are not initialized until we call kvm_vgic_create().
Therefore kvm_vgic_map_resources() can being called without a VGIC,
and we die because vm_ops.map_resources is NULL.

Fixing this restores QEMU's kernel-irqchip=off option to a working state,
allowing to use GIC emulation in userspace.

Fixes: 0a57f4cee715 ("arm/arm64: KVM: introduce per-VM ops")
Cc: stable@vger.kernel.org
Signed-off-by: Pavel Fedin <p.fedin@samsung.com>
[maz: reworked commit message]
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
arch/arm/kvm/arm.c