thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone

Blame SOURCES/kvm-hw-s390x-Use-the-IEC-binary-prefix-definitions.patch

Pablo Greco e6a3ae
From 7b5de347e3786f6c2ade136cb4029344969b34ac Mon Sep 17 00:00:00 2001
Pablo Greco e6a3ae
From: Cornelia Huck <cohuck@redhat.com>
Pablo Greco e6a3ae
Date: Wed, 17 Apr 2019 13:57:20 +0100
Pablo Greco e6a3ae
Subject: [PATCH 03/24] hw/s390x: Use the IEC binary prefix definitions
Pablo Greco e6a3ae
MIME-Version: 1.0
Pablo Greco e6a3ae
Content-Type: text/plain; charset=UTF-8
Pablo Greco e6a3ae
Content-Transfer-Encoding: 8bit
Pablo Greco e6a3ae
Pablo Greco e6a3ae
RH-Author: Cornelia Huck <cohuck@redhat.com>
Pablo Greco e6a3ae
Message-id: <20190417135741.25297-4-cohuck@redhat.com>
Pablo Greco e6a3ae
Patchwork-id: 85782
Pablo Greco e6a3ae
O-Subject: [RHEL-8.1.0 qemu-kvm PATCH v2 03/24] hw/s390x: Use the IEC binary prefix definitions
Pablo Greco e6a3ae
Bugzilla: 1699070
Pablo Greco e6a3ae
RH-Acked-by: David Hildenbrand <david@redhat.com>
Pablo Greco e6a3ae
RH-Acked-by: Thomas Huth <thuth@redhat.com>
Pablo Greco e6a3ae
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Pablo Greco e6a3ae
RH-Acked-by: Jens Freimann <jfreimann@redhat.com>
Pablo Greco e6a3ae
Pablo Greco e6a3ae
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
Pablo Greco e6a3ae
Pablo Greco e6a3ae
It eases code review, unit is explicit.
Pablo Greco e6a3ae
Pablo Greco e6a3ae
Patch generated using:
Pablo Greco e6a3ae
Pablo Greco e6a3ae
  $ git grep -E '(1024|2048|4096|8192|(<<|>>).?(10|20|30))' hw/ include/hw/
Pablo Greco e6a3ae
Pablo Greco e6a3ae
and modified manually.
Pablo Greco e6a3ae
Pablo Greco e6a3ae
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Pablo Greco e6a3ae
Reviewed-by: Thomas Huth <thuth@redhat.com>
Pablo Greco e6a3ae
Acked-by: Cornelia Huck <cohuck@redhat.com>
Pablo Greco e6a3ae
Message-Id: <20180625124238.25339-20-f4bug@amsat.org>
Pablo Greco e6a3ae
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Pablo Greco e6a3ae
(cherry picked from commit 393fc4c740d8d83d45bdbcd5f6a4cbc6be09b600)
Pablo Greco e6a3ae
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
Pablo Greco e6a3ae
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
Pablo Greco e6a3ae
---
Pablo Greco e6a3ae
 hw/s390x/s390-skeys.c    | 3 ++-
Pablo Greco e6a3ae
 hw/s390x/s390-stattrib.c | 3 ++-
Pablo Greco e6a3ae
 hw/s390x/sclp.c          | 3 ++-
Pablo Greco e6a3ae
 3 files changed, 6 insertions(+), 3 deletions(-)
Pablo Greco e6a3ae
Pablo Greco e6a3ae
diff --git a/hw/s390x/s390-skeys.c b/hw/s390x/s390-skeys.c
Pablo Greco e6a3ae
index 76241c2..15f7ab0 100644
Pablo Greco e6a3ae
--- a/hw/s390x/s390-skeys.c
Pablo Greco e6a3ae
+++ b/hw/s390x/s390-skeys.c
Pablo Greco e6a3ae
@@ -10,6 +10,7 @@
Pablo Greco e6a3ae
  */
Pablo Greco e6a3ae
 
Pablo Greco e6a3ae
 #include "qemu/osdep.h"
Pablo Greco e6a3ae
+#include "qemu/units.h"
Pablo Greco e6a3ae
 #include "hw/boards.h"
Pablo Greco e6a3ae
 #include "hw/s390x/storage-keys.h"
Pablo Greco e6a3ae
 #include "qapi/error.h"
Pablo Greco e6a3ae
@@ -19,7 +20,7 @@
Pablo Greco e6a3ae
 #include "sysemu/kvm.h"
Pablo Greco e6a3ae
 #include "migration/register.h"
Pablo Greco e6a3ae
 
Pablo Greco e6a3ae
-#define S390_SKEYS_BUFFER_SIZE 131072  /* Room for 128k storage keys */
Pablo Greco e6a3ae
+#define S390_SKEYS_BUFFER_SIZE (128 * KiB)  /* Room for 128k storage keys */
Pablo Greco e6a3ae
 #define S390_SKEYS_SAVE_FLAG_EOS 0x01
Pablo Greco e6a3ae
 #define S390_SKEYS_SAVE_FLAG_SKEYS 0x02
Pablo Greco e6a3ae
 #define S390_SKEYS_SAVE_FLAG_ERROR 0x04
Pablo Greco e6a3ae
diff --git a/hw/s390x/s390-stattrib.c b/hw/s390x/s390-stattrib.c
Pablo Greco e6a3ae
index 70b9555..5161a16 100644
Pablo Greco e6a3ae
--- a/hw/s390x/s390-stattrib.c
Pablo Greco e6a3ae
+++ b/hw/s390x/s390-stattrib.c
Pablo Greco e6a3ae
@@ -10,6 +10,7 @@
Pablo Greco e6a3ae
  */
Pablo Greco e6a3ae
 
Pablo Greco e6a3ae
 #include "qemu/osdep.h"
Pablo Greco e6a3ae
+#include "qemu/units.h"
Pablo Greco e6a3ae
 #include "hw/boards.h"
Pablo Greco e6a3ae
 #include "cpu.h"
Pablo Greco e6a3ae
 #include "migration/qemu-file.h"
Pablo Greco e6a3ae
@@ -20,7 +21,7 @@
Pablo Greco e6a3ae
 #include "qapi/error.h"
Pablo Greco e6a3ae
 #include "qapi/qmp/qdict.h"
Pablo Greco e6a3ae
 
Pablo Greco e6a3ae
-#define CMMA_BLOCK_SIZE  (1 << 10)
Pablo Greco e6a3ae
+#define CMMA_BLOCK_SIZE  (1 * KiB)
Pablo Greco e6a3ae
 
Pablo Greco e6a3ae
 #define STATTR_FLAG_EOS     0x01ULL
Pablo Greco e6a3ae
 #define STATTR_FLAG_MORE    0x02ULL
Pablo Greco e6a3ae
diff --git a/hw/s390x/sclp.c b/hw/s390x/sclp.c
Pablo Greco e6a3ae
index 2abdb62..4510a80 100644
Pablo Greco e6a3ae
--- a/hw/s390x/sclp.c
Pablo Greco e6a3ae
+++ b/hw/s390x/sclp.c
Pablo Greco e6a3ae
@@ -13,6 +13,7 @@
Pablo Greco e6a3ae
  */
Pablo Greco e6a3ae
 
Pablo Greco e6a3ae
 #include "qemu/osdep.h"
Pablo Greco e6a3ae
+#include "qemu/units.h"
Pablo Greco e6a3ae
 #include "qapi/error.h"
Pablo Greco e6a3ae
 #include "cpu.h"
Pablo Greco e6a3ae
 #include "sysemu/sysemu.h"
Pablo Greco e6a3ae
@@ -289,7 +290,7 @@ static void sclp_realize(DeviceState *dev, Error **errp)
Pablo Greco e6a3ae
     ret = s390_set_memory_limit(machine->maxram_size, &hw_limit);
Pablo Greco e6a3ae
     if (ret == -E2BIG) {
Pablo Greco e6a3ae
         error_setg(&err, "host supports a maximum of %" PRIu64 " GB",
Pablo Greco e6a3ae
-                   hw_limit >> 30);
Pablo Greco e6a3ae
+                   hw_limit / GiB);
Pablo Greco e6a3ae
     } else if (ret) {
Pablo Greco e6a3ae
         error_setg(&err, "setting the guest size failed");
Pablo Greco e6a3ae
     }
Pablo Greco e6a3ae
-- 
Pablo Greco e6a3ae
1.8.3.1
Pablo Greco e6a3ae