]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Sep 2015 17:33:20 +0000 (19:33 +0200)
commitabdd6db9eb923a5ef64f910441d0d1fd510e64f9
treee54542e546136d267cf069882b5087ce81fbe70f
parentbf0cdf4bfb785129798bc42d6ee8e2558f0934da
arm/arm64: KVM: vgic: Check for !irqchip_in_kernel() when mapping resources

commit c2f58514cfb374d5368c9da945f1765cd48eb0da upstream.

Until b26e5fdac43c ("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: b26e5fdac43c ("arm/arm64: KVM: introduce per-VM ops")
Signed-off-by: Pavel Fedin <p.fedin@samsung.com>
[maz: reworked commit message]
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm/kvm/arm.c