From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44796) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1asKlm-0000D3-U6 for qemu-devel@nongnu.org; Mon, 18 Apr 2016 21:48:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1asKll-0005fR-RJ for qemu-devel@nongnu.org; Mon, 18 Apr 2016 21:48:02 -0400 Date: Tue, 19 Apr 2016 11:41:50 +1000 From: David Gibson Message-ID: <20160419014150.GC1133@voom> References: <1460966865-14537-1-git-send-email-aurelien@aurel32.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="lCAWRPmW1mITcIfM" Content-Disposition: inline In-Reply-To: <1460966865-14537-1-git-send-email-aurelien@aurel32.net> Subject: Re: [Qemu-devel] [PATCH] cuda: fix off-by-one error in SET_TIME command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Aurelien Jarno Cc: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, =?iso-8859-1?Q?Herv=E9?= Poussineau --lCAWRPmW1mITcIfM Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Apr 18, 2016 at 10:07:45AM +0200, Aurelien Jarno wrote: > With the new framework the cuda_cmd_set_time command directly receive > the data, without the command byte. Therefore the time is stored at > in_data[0], not at in_data[1]. >=20 > This fixes the "hwclock --systohc" command in a guest. >=20 > Cc: Herv=E9 Poussineau > Cc: David Gibson > Signed-off-by: Aurelien Jarno Applied to ppc-for-2.6. I'll send a pull request shortly. > --- > hw/misc/macio/cuda.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/hw/misc/macio/cuda.c b/hw/misc/macio/cuda.c > index c7472aa..f15f301 100644 > --- a/hw/misc/macio/cuda.c > +++ b/hw/misc/macio/cuda.c > @@ -685,8 +685,8 @@ static bool cuda_cmd_set_time(CUDAState *s, > return false; > } > =20 > - ti =3D (((uint32_t)in_data[1]) << 24) + (((uint32_t)in_data[2]) << 1= 6) > - + (((uint32_t)in_data[3]) << 8) + in_data[4]; > + ti =3D (((uint32_t)in_data[0]) << 24) + (((uint32_t)in_data[1]) << 1= 6) > + + (((uint32_t)in_data[2]) << 8) + in_data[3]; > s->tick_offset =3D ti - (qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) > / NANOSECONDS_PER_SECOND); > return true; --=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 --lCAWRPmW1mITcIfM Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXFYzdAAoJEGw4ysog2bOStkYQAJURjU/bJBaHPRsdEIpZCoHt h62Gwz34rTDIDbQw+7gPIevcmL6MyXP/AMlawNhduQvsrLAMFLHw/DAGQf507v3C bO5ceRxj0sjWF7qEDzo6sY9p82OVrSHaoBiUfGJfuOYTG2LDhmcHIR3HL0L8nRR3 xpehpseLT6SX7+JPrCaigckXQOnZLzT4s1YbzA/+j5NPjKBTpC4srBpIeJl3ANbM zaI4k+wN1OWjotnAmBOHQDTOrma/28vtLUF3QY/9VlEhe8GusMu/z03pv0IaJ61y 7P415ja4gRGBhG8Dh+TeiCRygGaULDKXgU6eaLwMkBwv0TTa2jdbQ8ih3XNGgUc4 VIU1UhPJadHx0hYZQNk1qqaMqcKyKbo01zbyhCRgX4/ANf3D297bov15LnH+E1/K pOdsSKi0qWhvLwj+kn8VS9tmztKCzcuTZtsyy7wotMWQ9LIbSz2LYp2T6H18gUi9 HaeDaAg/fwaSRWUGpIwQptPW969VuHoEyP5qbJ+M3BjdUmwYZOXXs7jcvcyGWrFr btPhMzqQEfgovMX9OqtkPWg3CY9Ghi4vH1LW1MRTAcO2d1s46UJQa3AcLNAUfxqy xY+oh+Hzc9lifBrcW722JmYuW5Mh726A2VGFFt6v5Hp21aTVBM9QoJMxSAuadG2J 7mjRJeHE+KPVMGfME1rW =POlT -----END PGP SIGNATURE----- --lCAWRPmW1mITcIfM--