Received: from eggs.gnu.org ([2001:4830:134:3::10]:45673) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VnrGf-0005k0-VI for qemu-devel@nongnu.org; Tue, 03 Dec 2013 09:48:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VnrGZ-0007xN-VI for qemu-devel@nongnu.org; Tue, 03 Dec 2013 09:48:05 -0500 Date: Tue, 3 Dec 2013 12:47:40 -0200 From: Eduardo Habkost Message-ID: <20131203144740.GL22837@otherpad.lan.raisama.net> References: <1385350750-21468-1-git-send-email-aik@ozlabs.ru> <529CBE15.8010206@msgid.tls.msk.ru> <529D0533.7090402@suse.de> <529D11C5.2080505@ozlabs.ru> <529DDD08.4030206@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <529DDD08.4030206@suse.de> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [Qemu-trivial] [PATCH] vl: remove (max_cpus > 255) check from smp_parse List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andreas =?iso-8859-1?Q?F=E4rber?= Cc: Alexey Kardashevskiy , qemu-trivial@nongnu.org, Michael Tokarev , qemu-devel@nongnu.org, Igor Mammedov On Tue, Dec 03, 2013 at 02:30:48PM +0100, Andreas F=E4rber wrote: > Am 03.12.2013 00:03, schrieb Alexey Kardashevskiy: > > On 12/03/2013 09:09 AM, Andreas F=E4rber wrote: > >> Am 02.12.2013 18:06, schrieb Michael Tokarev: > >>> 25.11.2013 07:39, Alexey Kardashevskiy wrote: > >>>> Since modern POWER7/POWER8 chips can have more that 256 CPU thread= s > >>>> (>2000 actually), remove this check from smp_parse. > >>>> > >>>> The CPUs number is still checked against machine->max_cpus and thi= s check > >>>> should be enough not to break other archs. > >> > >> "should be" is not exactly the highest level of confidence for a > >> "trivial" patch... :/ > [...] > >> Alexey, did you actually check that, e.g., x86 machines don't break = with > >> 256 or 257 CPUs now? > >=20 > > PC_DEFAULT_MACHINE_OPTIONS sets it to 255. And I cannot find any mach= ine > > which would not define max_cpus, have I missed any? >=20 > If you've actually *checked* the other machines' code then fine with me= , > just say so in the commit message. :) I just grepped for "max_cpus" and checked every match. The largest values I found were: hw/ppc/spapr.c: 256 s390: 255 pc: 255 All the rest had values <=3D 32. Machines with missing max_cpus value shouldn't be a problem, as max_cpus=3D=3D0 is interpreted as 1 by the vl.c code. But we still need to add a check for max_cpus > machine->max_cpus to vl.c, before we eliminate the smp_parse() check. There's also this, at main(): if (i =3D=3D nb_numa_nodes) { for (i =3D 0; i < max_cpus; i++) { set_bit(i, node_cpumask[i % nb_numa_nodes]); } } node_cpumask[] is initialized using bitmap_new(MAX_CPUMASK_BITS), and MAX_CPUMASK_BITS is 255. To fix this, we can initialize node_cpumask[] us= ing max_cpus instead, if we initialize it after smp_parse(). --=20 Eduardo