Blame SOURCES/kvm-hw-s390x-Fix-bad-mask-in-time2tod.patch

28c80a
From 6e5f084a9839a417aaea25371af9dfe9c108cf65 Mon Sep 17 00:00:00 2001
28c80a
From: David Hildenbrand <david@redhat.com>
28c80a
Date: Fri, 21 Dec 2018 15:39:57 +0100
28c80a
Subject: [PATCH 13/14] hw/s390x: Fix bad mask in time2tod()
28c80a
28c80a
RH-Author: David Hildenbrand <david@redhat.com>
28c80a
Message-id: <20181221153957.28183-13-david@redhat.com>
28c80a
Patchwork-id: 83766
28c80a
O-Subject: [RHEL-7.6.z qemu-kvm-ma PATCH 12/12] hw/s390x: Fix bad mask in time2tod()
28c80a
Bugzilla: 1672920
28c80a
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
28c80a
RH-Acked-by: Thomas Huth <thuth@redhat.com>
28c80a
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
28c80a
28c80a
Since "s390x/tcg: avoid overflows in time2tod/tod2time", the
28c80a
time2tod() function tries to deal with the 9 uppermost bits in the
28c80a
time value, but uses the wrong mask for this: 0xff80000000000000 should
28c80a
be used instead of 0xff10000000000000 here.
28c80a
28c80a
Fixes: 14055ce53c2d901d826ffad7fb7d6bb8ab46bdfd
28c80a
Cc: qemu-stable@nongnu.org
28c80a
Signed-off-by: Thomas Huth <thuth@redhat.com>
28c80a
Message-Id: <1544792887-14575-1-git-send-email-thuth@redhat.com>
28c80a
Reviewed-by: David Hildenbrand <david@redhat.com>
28c80a
[CH: tweaked commit message]
28c80a
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
28c80a
(cherry picked from commit aba7a5a2de3dba5917024df25441f715b9249e31)
28c80a
Signed-off-by: David Hildenbrand <david@redhat.com>
28c80a
28c80a
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
28c80a
---
28c80a
 include/hw/s390x/tod.h | 2 +-
28c80a
 1 file changed, 1 insertion(+), 1 deletion(-)
28c80a
28c80a
diff --git a/include/hw/s390x/tod.h b/include/hw/s390x/tod.h
28c80a
index cbd7552..47ef9de 100644
28c80a
--- a/include/hw/s390x/tod.h
28c80a
+++ b/include/hw/s390x/tod.h
28c80a
@@ -56,7 +56,7 @@ typedef struct S390TODClass {
28c80a
 /* Converts ns to s390's clock format */
28c80a
 static inline uint64_t time2tod(uint64_t ns)
28c80a
 {
28c80a
-    return (ns << 9) / 125 + (((ns & 0xff10000000000000ull) / 125) << 9);
28c80a
+    return (ns << 9) / 125 + (((ns & 0xff80000000000000ull) / 125) << 9);
28c80a
 }
28c80a
 
28c80a
 /* Converts s390's clock format to ns */
28c80a
-- 
28c80a
1.8.3.1
28c80a