arm/arm64: KVM: Detect vGIC presence at runtime
commitc7da6fa43cb1c5e649da0f478a491feb9208cae7
authorPavel Fedin <p.fedin@samsung.com>
Fri, 18 Dec 2015 11:38:43 +0000 (18 14:38 +0300)
committerMarc Zyngier <marc.zyngier@arm.com>
Fri, 18 Dec 2015 12:01:58 +0000 (18 12:01 +0000)
treee3c01e8cba0407717be707a71f7e952454cba706
parent1b1ebe820fcb446146dfb2d04a1f0b7905645f75
arm/arm64: KVM: Detect vGIC presence at runtime

Before commit 662d9715840aef44dcb573b0f9fab9e8319c868a
("arm/arm64: KVM: Kill CONFIG_KVM_ARM_{VGIC,TIMER}") is was possible to
compile the kernel without vGIC and vTimer support. Commit message says
about possibility to detect vGIC support in runtime, but this has never
been implemented.

This patch introduces runtime check, restoring the lost functionality.
It again allows to use KVM on hardware without vGIC. Interrupt
controller has to be emulated in userspace in this case.

-ENODEV return code from probe function means there's no GIC at all.
-ENXIO happens when, for example, there is GIC node in the device tree,
but it does not specify vGIC resources. Any other error code is still
treated as full stop because it might mean some really serious problems.

Signed-off-by: Pavel Fedin <p.fedin@samsung.com>
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
arch/arm/kvm/arm.c