On Fri, Jan 29, 2016 at 02:52:30PM +1100, David Gibson wrote: > On Thu, Jan 28, 2016 at 11:19:43AM +0530, Bharata B Rao wrote: > > Prevent guests from booting with CPU topologies that have partially > > filled CPU cores or can result in partially filled CPU cores after > > CPU hotplug like > > > > -smp 15,sockets=1,cores=4,threads=4,maxcpus=16 or > > -smp 15,sockets=1,cores=4,threads=4,maxcpus=17. > > > > This is enforced by introducing MachineClass::validate_smp_config() > > that gets called from generic SMP parsing code. Machine type versions > > that want to enforce this can define this to the generic version > > provided. > > > > Only sPAPR and PC machine types starting from version 2.6 enforce this in > > this patch. > > > > Signed-off-by: Bharata B Rao <bhar...@linux.vnet.ibm.com> > > I've been kind of lost in the back and forth about > threads/cores/sockets. > > What, in the end, is the rationale for allowing partially filled > sockets, but not partially filled cores?
I don't think there's a good reason for that (at least for PC). It's easier to relax the requirements later if necessary, than dealing with compatibility issues again when making the code more strict. So I suggest we make validate_smp_config_generic() also check if smp_cpus % (smp_threads * smp_cores) == 0. -- Eduardo