ARM: KVM: Check KVM_CAP_ARM_IRQ_LINE_LAYOUT_2 for smp_cpus > 256
commitfff9f5558d0e0813d4f80bfe1602acf225eca4fd
authorEric Auger <eric.auger@redhat.com>
Thu, 3 Oct 2019 15:46:40 +0000 (3 17:46 +0200)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 15 Oct 2019 17:09:02 +0000 (15 18:09 +0100)
treecee5237ae0bc5bbfada5bd53667ae2d96b8514e0
parentf6530926e2310147a7844a3e663230d47b3d7333
ARM: KVM: Check KVM_CAP_ARM_IRQ_LINE_LAYOUT_2 for smp_cpus > 256

Host kernel within [4.18, 5.3] report an erroneous KVM_MAX_VCPUS=512
for ARM. The actual capability to instantiate more than 256 vcpus
was fixed in 5.4 with the upgrade of the KVM_IRQ_LINE ABI to support
vcpu id encoded on 12 bits instead of 8 and a redistributor consuming
a single KVM IO device instead of 2.

So let's check this capability when attempting to use more than 256
vcpus within any ARM kvm accelerated machine.

Signed-off-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Acked-by: Marc Zyngier <maz@kernel.org>
Message-id: 20191003154640.22451-4-eric.auger@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
target/arm/kvm.c