From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57123) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtozF-0004M6-1m for qemu-devel@nongnu.org; Tue, 03 Nov 2015 22:43:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZtozD-0002OV-ML for qemu-devel@nongnu.org; Tue, 03 Nov 2015 22:43:48 -0500 Date: Wed, 4 Nov 2015 14:15:22 +1100 From: David Gibson Message-ID: <20151104031522.GF21954@voom.redhat.com> References: <1445608598-24485-1-git-send-email-mark.cave-ayland@ilande.co.uk> <1445608598-24485-6-git-send-email-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="AH+kv8CCoFf6qPuz" Content-Disposition: inline In-Reply-To: <1445608598-24485-6-git-send-email-mark.cave-ayland@ilande.co.uk> Subject: Re: [Qemu-devel] [PATCH 05/13] cuda.c: fix CUDA_PACKET response packet format List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Mark Cave-Ayland Cc: cormac@c-obrien.org, qemu-ppc@nongnu.org, qemu-devel@nongnu.org, agraf@suse.de --AH+kv8CCoFf6qPuz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 23, 2015 at 02:56:30PM +0100, Mark Cave-Ayland wrote: > According to comments in MOL, the response to a CUDA_PACKET should be one= of > the following: >=20 > Reply: CUDA_PACKET, status, cmd > Error: ERROR_PACKET, status, CUDA_PACKET, cmd >=20 > Update cuda_receive_packet() accordingly to reflect this. >=20 > Signed-off-by: Mark Cave-Ayland Code seems to match the description, but I don't have another source to check what the right thing to do is for CUDA. > --- > hw/misc/macio/cuda.c | 24 +++++------------------- > 1 file changed, 5 insertions(+), 19 deletions(-) >=20 > diff --git a/hw/misc/macio/cuda.c b/hw/misc/macio/cuda.c > index 9ec19af..88a0999 100644 > --- a/hw/misc/macio/cuda.c > +++ b/hw/misc/macio/cuda.c > @@ -480,7 +480,7 @@ static void cuda_adb_poll(void *opaque) > static void cuda_receive_packet(CUDAState *s, > const uint8_t *data, int len) > { > - uint8_t obuf[16]; > + uint8_t obuf[16] =3D { CUDA_PACKET, 0, data[0] }; > int autopoll; > uint32_t ti; > =20 > @@ -497,23 +497,15 @@ static void cuda_receive_packet(CUDAState *s, > timer_del(s->adb_poll_timer); > } > } > - obuf[0] =3D CUDA_PACKET; > - obuf[1] =3D data[1]; > - cuda_send_packet_to_host(s, obuf, 2); > + cuda_send_packet_to_host(s, obuf, 3); > break; > case CUDA_SET_TIME: > ti =3D (((uint32_t)data[1]) << 24) + (((uint32_t)data[2]) << 16)= + (((uint32_t)data[3]) << 8) + data[4]; > s->tick_offset =3D ti - (qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) /= get_ticks_per_sec()); > - obuf[0] =3D CUDA_PACKET; > - obuf[1] =3D 0; > - obuf[2] =3D 0; > cuda_send_packet_to_host(s, obuf, 3); > break; > case CUDA_GET_TIME: > ti =3D s->tick_offset + (qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) /= get_ticks_per_sec()); > - obuf[0] =3D CUDA_PACKET; > - obuf[1] =3D 0; > - obuf[2] =3D 0; > obuf[3] =3D ti >> 24; > obuf[4] =3D ti >> 16; > obuf[5] =3D ti >> 8; > @@ -524,20 +516,14 @@ static void cuda_receive_packet(CUDAState *s, > case CUDA_SET_DEVICE_LIST: > case CUDA_SET_AUTO_RATE: > case CUDA_SET_POWER_MESSAGES: > - obuf[0] =3D CUDA_PACKET; > - obuf[1] =3D 0; > - cuda_send_packet_to_host(s, obuf, 2); > + cuda_send_packet_to_host(s, obuf, 3); > break; > case CUDA_POWERDOWN: > - obuf[0] =3D CUDA_PACKET; > - obuf[1] =3D 0; > - cuda_send_packet_to_host(s, obuf, 2); > + cuda_send_packet_to_host(s, obuf, 3); > qemu_system_shutdown_request(); > break; > case CUDA_RESET_SYSTEM: > - obuf[0] =3D CUDA_PACKET; > - obuf[1] =3D 0; > - cuda_send_packet_to_host(s, obuf, 2); > + cuda_send_packet_to_host(s, obuf, 3); > qemu_system_reset_request(); > break; > default: --=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 --AH+kv8CCoFf6qPuz Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJWOXhKAAoJEGw4ysog2bOSNcEP/RVtdwxrPIUX4saX/ahPJUfO Jlt/ss/EInRZ5i759wVca3wJ3XOWU0ebg+MTMVAdMZ5hQ4z6nb5pRRaUhUYoDCMX boFaTp9GJSJ1fbJtnjsMPXaO3ByOPzrSptvw4w9yqQ1WmryUso+5omADkKUrV/x9 ySUwcx9CzfpVEJkfedpIZzSZ0mGJw+XVFPEHEEDWcACZl2XS/aVHUc5KBybpCUPG URKF1OYS95vzGJLpuL+uO824iRWZzSUoEM0hi7iiqCig2w08ZzpWbgl6966By+4n oLVIjITvw6ZEjUXIJ24rs5cNJJ2jSruPzBZQeEWY1evL9A799yJtIUK1g4N9y1sQ l8vOov1BUgROZNrxahITjK35ges0lIs9QJ9Kgmdu4VJstnLWm77TWfQrd6P8mlrU zWDL8pCNKcDkHVd9CdaDBmaU/tAiEnml/ixD4+15zCDeqQLTcLije3wH8IQ0fvpx GvQ2ASOLT+2MHHWMmEZmc7cZczqiBgIqqmql0H2+KJ94M11t/Gogm/gzQewChsN/ 10v7+7GUFGVUGHVyYLiVilzeOmZfyWAzMevBFAvj9PZXAdXOjn6g4h0WaulwEnuj PsLW5o2Ug3JySs/3hnD4njXjeLu/seoQJOzSOEJ98OOdQh8lrC2Oioo2xmWl/atB 7mBkTrU5OI7gBXhQgJtV =Hu/o -----END PGP SIGNATURE----- --AH+kv8CCoFf6qPuz--