From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48183) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9OWr-0002Wf-RF for qemu-devel@nongnu.org; Fri, 20 Apr 2018 01:24:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9OWo-0003xw-1X for qemu-devel@nongnu.org; Fri, 20 Apr 2018 01:24:13 -0400 Received: from ozlabs.org ([203.11.71.1]:42125) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f9OWn-0003w1-4s for qemu-devel@nongnu.org; Fri, 20 Apr 2018 01:24:09 -0400 Date: Fri, 20 Apr 2018 15:23:57 +1000 From: David Gibson Message-ID: <20180420052357.GE2434@umbus.fritz.box> References: <1520860275-101576-1-git-send-email-imammedo@redhat.com> <87zi21apkh.fsf@dusky.pond.sub.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Rgf3q3z9SdmXC6oT" Content-Disposition: inline In-Reply-To: <87zi21apkh.fsf@dusky.pond.sub.org> Subject: Re: [Qemu-devel] [PATCH v4 0/9] enable numa configuration before machine_init() from QMP List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: Igor Mammedov , qemu-devel@nongnu.org, peter.maydell@linaro.org, pkrempa@redhat.com, ehabkost@redhat.com, cohuck@redhat.com, pbonzini@redhat.com --Rgf3q3z9SdmXC6oT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 17, 2018 at 04:13:34PM +0200, Markus Armbruster wrote: > Igor Mammedov writes: >=20 > [...] > > Series allows to configure NUMA mapping at runtime using QMP > > interface. For that to happen it introduces a new '-preconfig' CLI opti= on > > which allows to pause QEMU before machine_init() is run and > > adds new set-numa-node QMP command which in conjunction with > > query-hotpluggable-cpus allows to configure NUMA mapping for cpus. > > > > Later we can modify other commands to run early, for example device_add. > > I recall SPAPR had problem when libvirt started QEMU with -S and, while= it's > > paused, added CPUs with device_add. Intent was to coldplug CPUs (but at= that > > stage it's considered hotplug already), so SPAPR had to work around the= issue. >=20 > That instance is just stupidity / laziness, I think: we consider any > plug after machine creation a hot plug. Real machines remain cold until > you press the power button. Our virtual machines should remain cold > until they start running, i.e. with -S until the first "cont". Makes sense to me. As I recall, the chief problem I had here with PAPR hotplug was that -S stopped *after* the machine_reset, which meant the only mechanisms we really had to inform the guest of the hardware were the hotplug mechanisms. Sort of. It got complicated because of the feature negotiation system that PAPR guests have. At present -S doesn't really operate like a "stop before hitting the power", it instead acts more like a breakpoint on the first instruction of the firmware. If we were to move the -S stop to before the machine_reset, I believe that might simplify several things in our hotplug handling code for papr. > I vaguely remember me asking this before, but your answer didn't make it > into this cover letter, which gives me a pretext to ask again instead of > looking it up in the archives: what exactly prevents us from keeping the > machine cold enough for numa configuration until the first "cont"? >=20 > > > > Example of configuration session: > > $QEMU -smp 2 -preconfig ... > > > > QMP: > > # get CPUs layout for current target/machine/CLI > > -> {'execute': 'query-hotpluggable-cpus' } =20 > > <- {'return': [ > > {'props': {'core-id': 0, 'thread-id': 0, 'socket-id': 1}, ... }, > > {'props': {'core-id': 0, 'thread-id': 0, 'socket-id': 0}, ... } > > ]} > > > > # configure 1st node > > -> {'execute': 'set-numa-node', 'arguments': { 'type': 'node', 'nodeid'= : 0 } } =20 > > <- {'return': {}} > > -> {'execute': 'set-numa-node', 'arguments': { 'type': 'cpu', =20 > > 'node-id': 0, 'core-id': 0, 'thread-id': 0, 'socket-id': 1, } > > } > > <- {'return': {}} > > > > # configure 2nd node > > -> {'execute': 'set-numa-node', 'arguments': { 'type': 'node', 'nodeid'= : 1 } } > > -> {'execute': 'set-numa-node', 'arguments': { 'type': 'cpu', =20 > > 'node-id': 1, 'core-id': 0, 'thread-id': 0, 'socket-id': 0 } > > } > > <- {'return': {}} > > > > # [optional] verify configuration > > -> {'execute': 'query-hotpluggable-cpus' } =20 > > <- {'return': [ > > {'props': {'core-id': 0, 'thread-id': 0, 'node-id': 0, 'socket-i= d': 1}, ... }, > > {'props': {'core-id': 0, 'thread-id': 0, 'node-id': 1, 'socket-i= d': 0}, ... } > > ]} > > > > > > Git tree: > > https://github.com/imammedo/qemu.git qmp_preconfig_v3 > > > > Ref to v1: > > https://lists.gnu.org/archive/html/qemu-devel/2017-10/msg03583.html > > Message-Id: <1508170976-96869-1-git-send-email-imammedo@redhat.com> >=20 --=20 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 --Rgf3q3z9SdmXC6oT Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEdfRlhq5hpmzETofcbDjKyiDZs5IFAlrZeWgACgkQbDjKyiDZ s5Ly8hAA1WGJqfxEm5Ara6giAVPYPXN/DwIBLG3vhl3v6KFxETHYBP2Ui8kCLrjw iFpDMap+y7p5QD8SDP3Q71gBGqX1vxQ4GmTuyQVftLaTcUlihoUAR54GjSklJwNa TjX301wTDx58/2J9ZAR7jdrjlgXcb+y+eE6wyYDOkkIdCcogDOaYs0DIwIVLJfwH CQHKdBRHBTV4cQpzbF6vRhpqku7j8uLXOuQnzQRmI+zcn+i8Qrupb76swyuWyl2q vRHnNWTcdtUY+fFaRRRsTFDh2SaGI09BBQUUfZji//eCYxlhA7XzZzy07w8QbnjP oyPPGHZ14lA82ca8BF6BKCf8XEKY0kI+Jc3VNK36DBb36BAgecfcnxCPW1BuePji zXhX3dEOc7wfJfbTuQFlgOLn/dJX6nTQT/psTMCYB2XelrmFiioHVfI2Pc7ydSX0 PES/EBx4N2YjjzXFpSxdmgS6VyQ98L9pSsVMGF4ryi3SH8c0WjgULC5H8WoU03JK Pf94At/k9wviqWno+VhNaLRbJyRKiO1vetHDH7TRkHGNyiMYaZVwBzNb7VefHj8P m2Nf5jLzTGYKEwH7I8zviqyxCtJzsOX3ARGzbtXaqWf+B7JhXdBLtZuhX+i07m5g f8z74mbnhl7zGx7yIz4VvEWe45Ez9UVF52Rgx0nA1ZZZAC8F1wc= =wGqQ -----END PGP SIGNATURE----- --Rgf3q3z9SdmXC6oT--