xen/arm: introduce nr_spis
authorStefano Stabellini <sstabellini@kernel.org>
Thu, 3 Oct 2019 17:34:15 +0000 (10:34 -0700)
committerStefano Stabellini <sstabellini@kernel.org>
Fri, 4 Oct 2019 17:16:11 +0000 (10:16 -0700)
commit2a6f8cfb126a1b4ec3d0df8fbe32653cb3cbcb89
treebdb1cfcfbbf45b25396f4a26e2c1efc3fd018961
parent1f08b70159a4f7d06aab44d66037681bf12791a7
xen/arm: introduce nr_spis

We don't have a clear way to know how many virtual SPIs we need for the
dom0-less domains. Introduce a new option under xen,domain to specify
the number of SPIs to allocate for a domain.

The property is optional. When absent, we'll use the physical number of
GIC lines for dom0-less domains, or GUEST_VPL011_SPI+1 if vpl011 is
requested, whichever is greater.

Remove the old setting of nr_spis based on the presence of the vpl011.

The implication of this change is that without nr_spis dom0less domains
get the same amount of SPI allocated as dom0, regardless of how many
physical devices they have assigned, and regardless of whether they have
a virtual pl011 (which also needs an emulated SPI). This is done because
the SPIs allocation needs to be done before parsing any passthrough
information, so we have to account for any potential physical SPI
assigned to the domain.

When nr_spis is present, the domain gets exactly nr_spis allocated SPIs.
If the number is too low, it might not be enough for the devices
assigned it to it. If the number is less than GUEST_VPL011_SPI, the
virtual pl011 won't work.

Signed-off-by: Stefano Stabellini <stefanos@xilinx.com>
Reviewed-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
Acked-by: Julien Grall <julien.grall@arm.com>
xen/arch/arm/domain_build.c