thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone

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

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