On Mon, Sep 11, 2017 at 07:12:15PM +0200, Cédric Le Goater wrote: > Start with a couple of attributes for the XIVE sPAPR controller > model. The number of provisionned IRQ is necessary to size the > different internal XIVE tables, the number of CPUs is also. > > Signed-off-by: Cédric Le Goater <c...@kaod.org>
[snip] > +static void spapr_xive_realize(DeviceState *dev, Error **errp) > +{ > + sPAPRXive *xive = SPAPR_XIVE(dev); > + > + if (!xive->nr_targets) { > + error_setg(errp, "Number of interrupt targets needs to be greater > 0"); > + return; > + } > + /* We need to be able to allocate at least the IPIs */ > + if (!xive->nr_irqs || xive->nr_irqs < xive->nr_targets) { > + error_setg(errp, "Number of interrupts too small"); > + return; > + } > +} > + > +static Property spapr_xive_properties[] = { > + DEFINE_PROP_UINT32("nr-irqs", sPAPRXive, nr_irqs, 0), > + DEFINE_PROP_UINT32("nr-targets", sPAPRXive, nr_targets, 0), I'm a bit uneasy about the number of targets having to be set in advance: this can make life awkward when CPUs are hotplugged. I know there's something similar in xics, but it has caused some hassles, and we're starting to move away from it. Do you really need this? -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
signature.asc
Description: PGP signature