From: David Hildenbrand <david@redhat.com>
To: Thomas Huth <thuth@redhat.com>,
qemu-s390x@nongnu.org, Cornelia Huck <cohuck@redhat.com>
Cc: qemu-devel@nongnu.org, Halil Pasic <pasic@linux.ibm.com>,
Christian Borntraeger <borntraeger@de.ibm.com>,
qemu-stable@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] hw/s390x: Fix bad mask in time2tod()
Date: Fri, 14 Dec 2018 14:12:17 +0100 [thread overview]
Message-ID: <4c36a841-ac16-8d93-b23f-8df80e79579c@redhat.com> (raw)
In-Reply-To: <1544792887-14575-1-git-send-email-thuth@redhat.com>
On 14.12.18 14:08, Thomas Huth wrote:
> The time2tod() function tries to deal with the 9 uppermost bits in the
> time value, but uses the wrong mask for this: 0xff80000000000000 should
> be used instead of 0xff10000000000000 here.
>
> Fixes: 14055ce53c2d901d826ffad7fb7d6bb8ab46bdfd
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
> include/hw/s390x/tod.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/hw/s390x/tod.h b/include/hw/s390x/tod.h
> index cbd7552..47ef9de 100644
> --- a/include/hw/s390x/tod.h
> +++ b/include/hw/s390x/tod.h
> @@ -56,7 +56,7 @@ typedef struct S390TODClass {
> /* Converts ns to s390's clock format */
> static inline uint64_t time2tod(uint64_t ns)
> {
> - return (ns << 9) / 125 + (((ns & 0xff10000000000000ull) / 125) << 9);
> + return (ns << 9) / 125 + (((ns & 0xff80000000000000ull) / 125) << 9);
> }
>
> /* Converts s390's clock format to ns */
>
Reviewed-by: David Hildenbrand <david@redhat.com>
--
Thanks,
David / dhildenb
next prev parent reply other threads:[~2018-12-14 13:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-14 13:08 [Qemu-devel] [PATCH] hw/s390x: Fix bad mask in time2tod() Thomas Huth
2018-12-14 13:12 ` David Hildenbrand [this message]
2018-12-14 13:15 ` Christian Borntraeger
2018-12-14 13:23 ` Thomas Huth
2018-12-14 13:26 ` Christian Borntraeger
2018-12-14 13:30 ` Thomas Huth
2018-12-14 14:09 ` Philippe Mathieu-Daudé
2018-12-14 13:38 ` Cornelia Huck
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=4c36a841-ac16-8d93-b23f-8df80e79579c@redhat.com \
--to=david@redhat.com \
--cc=borntraeger@de.ibm.com \
--cc=cohuck@redhat.com \
--cc=pasic@linux.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=qemu-stable@nongnu.org \
--cc=thuth@redhat.com \
/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).