From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36444) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZhAXI-0001GC-TU for qemu-devel@nongnu.org; Wed, 30 Sep 2015 02:06:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZhAXH-00020D-Ph for qemu-devel@nongnu.org; Wed, 30 Sep 2015 02:06:40 -0400 Date: Wed, 30 Sep 2015 16:03:55 +1000 From: David Gibson Message-ID: <20150930060355.GE23574@voom> References: <1443335476.4610.2.camel@kernel.crashing.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Yb+qhiCg54lqZFXW" Content-Disposition: inline In-Reply-To: <1443335476.4610.2.camel@kernel.crashing.org> Subject: Re: [Qemu-devel] [Qemu-ppc] [RFC/PATCH] monitor/ppc: Access all SPRs from the monitor List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Benjamin Herrenschmidt Cc: peter.maydell@linaro.org, qemu-ppc@nongnu.org, qemu-devel@nongnu.org --Yb+qhiCg54lqZFXW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Sep 27, 2015 at 04:31:16PM +1000, Benjamin Herrenschmidt wrote: > We already have a table with all supported SPRs along with their names, > so let's use that rather than a duplicate table that is perpetually > out of sync in the monitor code. >=20 > This adds a new monitor hook target_extra_monitor_def() which is called > if nothing is found is the normal table. We still use the old mechanism > for anything that isn't an SPR. >=20 > Signed-off-by: Benjamin Herrenschmidt This looks like a good idea, but it seems to be a slightly different approach from the one taken by some rather similar patches Alexey posted recently. Would you care to co-ordinate on which of those approaches to go ahead with? [snip] > @@ -253,3 +180,23 @@ const MonitorDef *target_monitor_defs(void) > { > return monitor_defs; > } > + > +int target_extra_monitor_def(uint64_t *pval, const char *name) > +{ > + /* On ppc, search through the SPRs so we can print any of them */ > + { ^ Also, this appears to be a redundant set of braces. > + CPUArchState *env =3D mon_get_cpu_env(); > + ppc_spr_t *spr_cb =3D env->spr_cb; > + int i; > + > + for (i =3D 0; i < 1024; i++) { > + if (!spr_cb[i].name || strcasecmp(name, spr_cb[i].name)) { > + continue; > + } > + *pval =3D env->spr[i]; > + return 0; > + } > + } > + return -1; > +} > + >=20 >=20 >=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 --Yb+qhiCg54lqZFXW Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJWC3tLAAoJEGw4ysog2bOSWlMQAIoBqsSPVwURpKUL63D1r4us imqpymU8wl+2wnW94rDvb24rGLrAp6A51OYVFnK07lHj6czirOhqZKdhIYK343xY w5We8qnmAEcLe+PThXruJdpbf1eWb5GaA0eKfNC089ROUJIOxXQsvtm9pRuUclCp a5JaG/gLlL0FtutifyF5XOFZxl4lVsESwGwfSlnJAUOsK2Fw1ql9My3HPoDgE/pr 7BIn6DZxLSdctg2SUJK99toFCPq81qyo1QlZWcNYFlfuw0N0rKu+ADDtM3bCyqhf mq038Q0xQfjUuIMl2piLdGeULQiDeTD85RfAFNeUVL5U1YWnCgf1/L9i4mrbHK0G Ho+e7zkDvLWY4XByU64VYLbLIyU5y0HCJchPzLYkaKXfW8JwUrAqSHSvFiek/P8f yDoclkmBANiZiVb4dBm7HyaflfT0mEOMKtHPc02eMtGuSLrm7eWsTVsSwx8rp1os 3qdsObHHGrMAhGN1PboTyO17pekR4HaRvBxTKjpsNEUHMblHGwhkJ7q8EAdlu8Yf tXvdUPBg56VebOPEXWIR0hVtHGFJ8sVFo71J4DetoPYy0wDU7n/2OkotSmql9+7W 6CfBOfdR2YIxwskjjEm0de0YKO4Xm6CFNBtMbcqlyVWUelNw82mpjDOqtovMchMa 6DOUYnh3bbTInUKH6QlZ =oxLA -----END PGP SIGNATURE----- --Yb+qhiCg54lqZFXW--