qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Aurelien Jarno <aurelien@aurel32.net>
Cc: qemu-devel@nongnu.org, qemu-ppc@nongnu.org,
	"Hervé Poussineau" <hpoussin@reactos.org>
Subject: Re: [Qemu-devel] [PATCH] cuda: fix off-by-one error in SET_TIME command
Date: Tue, 19 Apr 2016 11:41:50 +1000	[thread overview]
Message-ID: <20160419014150.GC1133@voom> (raw)
In-Reply-To: <1460966865-14537-1-git-send-email-aurelien@aurel32.net>

[-- Attachment #1: Type: text/plain, Size: 1500 bytes --]

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].
> 
> This fixes the "hwclock --systohc" command in a guest.
> 
> Cc: Hervé Poussineau <hpoussin@reactos.org>
> Cc: David Gibson <david@gibson.dropbear.id.au>
> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

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(-)
> 
> 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;
>      }
>  
> -    ti = (((uint32_t)in_data[1]) << 24) + (((uint32_t)in_data[2]) << 16)
> -         + (((uint32_t)in_data[3]) << 8) + in_data[4];
> +    ti = (((uint32_t)in_data[0]) << 24) + (((uint32_t)in_data[1]) << 16)
> +         + (((uint32_t)in_data[2]) << 8) + in_data[3];
>      s->tick_offset = ti - (qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL)
>                             / NANOSECONDS_PER_SECOND);
>      return true;

-- 
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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

      parent reply	other threads:[~2016-04-19  1:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-18  8:07 [Qemu-devel] [PATCH] cuda: fix off-by-one error in SET_TIME command Aurelien Jarno
2016-04-18 11:06 ` Hervé Poussineau
2016-04-19  1:41 ` David Gibson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160419014150.GC1133@voom \
    --to=david@gibson.dropbear.id.au \
    --cc=aurelien@aurel32.net \
    --cc=hpoussin@reactos.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).