From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32861) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZS61d-0007nz-Qa for qemu-devel@nongnu.org; Wed, 19 Aug 2015 12:15:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZS61Z-0005si-BT for qemu-devel@nongnu.org; Wed, 19 Aug 2015 12:15:41 -0400 Message-ID: <55D4AB9E.8040603@redhat.com> Date: Wed, 19 Aug 2015 09:15:26 -0700 From: Thomas Huth MIME-Version: 1.0 References: <1439862430-14996-1-git-send-email-gwshan@linux.vnet.ibm.com> <1439862430-14996-4-git-send-email-gwshan@linux.vnet.ibm.com> <55D36C1D.8040608@redhat.com> <20150818235200.GB8064@gwshan> <20150819011535.GK3157@voom> In-Reply-To: <20150819011535.GK3157@voom> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="CB0RrmbHkraMX777bjAHUgUUCgAVf6H4N" Subject: Re: [Qemu-devel] [PATCH v5 3/4] sPAPR: Support RTAS call ibm, {open, close}-errinjct List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson , Gavin Shan Cc: aik@ozlabs.ru, peter.maydell@linaro.org, qemu-ppc@nongnu.org, qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --CB0RrmbHkraMX777bjAHUgUUCgAVf6H4N Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 18/08/15 18:15, David Gibson wrote: > On Wed, Aug 19, 2015 at 09:52:00AM +1000, Gavin Shan wrote: >> On Tue, Aug 18, 2015 at 10:32:13AM -0700, Thomas Huth wrote: >>> On 17/08/15 18:47, Gavin Shan wrote: >>>> The patch supports RTAS calls "ibm,{open,close}-errinjct" to >>>> manupliate the token, which is passed to RTAS call "ibm,errinjct" >>>> to indicate the valid context for error injection. Each VM is >>>> permitted to have only one token at once and we simply have one >>>> random number for that. >>> >>> Looking at the code, you're using a sequence number now instead of a >>> random number? >>> >> >> Yes, it's what Alexey suggested. Then please update the commit message accordingly. >>>> diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c >>>> index e99e25f..8405056 100644 >>>> --- a/hw/ppc/spapr_rtas.c >>>> +++ b/hw/ppc/spapr_rtas.c >>>> @@ -604,6 +604,68 @@ out: >>>> rtas_st(rets, 0, rc); >>>> } >>>> =20 >>>> +static void rtas_ibm_open_errinjct(PowerPCCPU *cpu, >>>> + sPAPRMachineState *spapr, >>>> + uint32_t token, uint32_t nargs, >>>> + target_ulong args, uint32_t nret= , >>>> + target_ulong rets) >>>> +{ >>>> + int32_t ret; >>>> + >>>> + /* Sanity check on number of arguments */ >>>> + if ((nargs !=3D 0) || (nret !=3D 2)) { >>> >>> Uh, did Alexey infect you with paranthesitis? >>> >> >> hehe~, nope. I'll drop those unnecessary paranthesitis :-) >=20 > I'd prefer you didn't. Unlike Thomas, I also don't remember C order > of ops that well and would prefer the clarity. You can always look it up if you're unsure, e.g.: http://en.cppreference.com/w/c/language/operator_precedence And once you've learnt it, the additional paranthesis just look cumbersome. So please remove them! Thomas --CB0RrmbHkraMX777bjAHUgUUCgAVf6H4N Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJV1KuiAAoJEC7Z13T+cC21MTEQAKrHkKWxg8Xofd9HA0brVpt2 krCSYsT2991G+hOcznnXpeVkJ05A+2HZDZeEvHlqtuTbm7n5edKYk0J8YJiH/QHW xjnZPAUzYuS6gRlX2YBtoL54l2tcDenyKQ4fUAnG/Im3TAJfXsBPQ+jX7iOvMAKP nYABGmDIEnTGPrGcVRyYhIX5dkmFx24GmBOJ2deAChouylpa/EzPdZqzwrq05rNp LZ+K2HWVwC/rXtcNJdiAtTrQOmXicMfpwV0uvxtf4ieFKIy30ZfTQLBVC51Nm8Ei lQus2q2laBJOg2h5wbrlGF5u9EMNH+bQA0Dt8tJG4Q9UL6ihD8RYjGkR8HfZwyf9 x1JiHbBMAQQg4UCSpwwPVntRxGQK0NJXpgm9ArS+kxo3PGnb/FYRQEW2L2kGOe28 ShXF+m39gU11FWAveD1EEUNjFokVRpVMIjqowNJCxdNOPz1BL+lDfftCSL5sXhrY JmaV45rButkUjT2d2InZnmDEC9pYN1yH660NN7IdT9sYas9rEjjdnJUnoEwmUwTw o54tubtZXfTyFf7qwr+9cMVnY7P4No3MGL3iMQHcto6m+Jomn+0gomd4Qj8/XQzE e6wvWqLBFsbNDK1SYDtXZDYpVVJN9bZoANdsfv8nbrIuMCsTA13lUuoooL9X5nrP ebpaL/pr1WQFT0kd4+El =nttI -----END PGP SIGNATURE----- --CB0RrmbHkraMX777bjAHUgUUCgAVf6H4N--