yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/0025-s390-ccw-force-diag-308-subcode-to-unsigned-long.patch

26ba25
From 2b09944ad35c48e37801d5abe9069283f8835fb2 Mon Sep 17 00:00:00 2001
26ba25
From: Cornelia Huck <cohuck@redhat.com>
26ba25
Date: Tue, 8 May 2018 09:01:11 +0000
26ba25
Subject: s390-ccw: force diag 308 subcode to unsigned long
26ba25
26ba25
We currently pass an integer as the subcode parameter. However,
26ba25
the upper bits of the register containing the subcode need to
26ba25
be 0, which is not guaranteed unless we explicitly specify the
26ba25
subcode to be an unsigned long value.
26ba25
26ba25
Fixes: d046c51dad3 ("pc-bios/s390-ccw: Get device address via diag 308/6")
26ba25
Cc: qemu-stable@nongnu.org
26ba25
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
26ba25
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
26ba25
Tested-by: Thomas Huth <thuth@redhat.com>
26ba25
Signed-off-by: Thomas Huth <thuth@redhat.com>
26ba25
(cherry picked from commit 63d8b5ace31c1e1f3996fe4cd551d6d377594d5a)
26ba25
---
26ba25
 pc-bios/s390-ccw/iplb.h | 3 ++-
26ba25
 1 file changed, 2 insertions(+), 1 deletion(-)
26ba25
26ba25
diff --git a/pc-bios/s390-ccw/iplb.h b/pc-bios/s390-ccw/iplb.h
26ba25
index 5357a36..ded20c8 100644
26ba25
--- a/pc-bios/s390-ccw/iplb.h
26ba25
+++ b/pc-bios/s390-ccw/iplb.h
26ba25
@@ -101,10 +101,11 @@ static inline bool manage_iplb(IplParameterBlock *iplb, bool store)
26ba25
 {
26ba25
     register unsigned long addr asm("0") = (unsigned long) iplb;
26ba25
     register unsigned long rc asm("1") = 0;
26ba25
+    unsigned long subcode = store ? 6 : 5;
26ba25
 
26ba25
     asm volatile ("diag %0,%2,0x308\n"
26ba25
                   : "+d" (addr), "+d" (rc)
26ba25
-                  : "d" (store ? 6 : 5)
26ba25
+                  : "d" (subcode)
26ba25
                   : "memory", "cc");
26ba25
     return rc == 0x01;
26ba25
 }
26ba25
-- 
26ba25
1.8.3.1
26ba25