From patchwork Sat Jun 30 06:10:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 937306 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="qiPU534l"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41Hk6m5Gsmz9s1B for ; Sat, 30 Jun 2018 16:26:08 +1000 (AEST) Received: from localhost ([::1]:45745 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZ9Kg-0000cT-CM for incoming@patchwork.ozlabs.org; Sat, 30 Jun 2018 02:26:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37994) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZ96F-0004JF-1A for qemu-devel@nongnu.org; Sat, 30 Jun 2018 02:11:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fZ969-00028b-Ub for qemu-devel@nongnu.org; Sat, 30 Jun 2018 02:11:10 -0400 Received: from mail-wm0-x236.google.com ([2a00:1450:400c:c09::236]:50481) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fZ969-00027p-OJ for qemu-devel@nongnu.org; Sat, 30 Jun 2018 02:11:05 -0400 Received: by mail-wm0-x236.google.com with SMTP id v25-v6so3127247wmc.0 for ; Fri, 29 Jun 2018 23:11:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=erZCK06C49girT+8OYEXbEAMv0WFhcjjVDp5qPC83T4=; b=qiPU534lglzhlIISYTSpwJPdqfRP7Nc+p+eYp8Kyxzdq2Yxg5vUpGdKpMwxyJdHoTy wGZsJgUsmGvLAILhNN9e94F9HE0f9SxhdSdbuK/ZTtH/cdMgQGVTOKWOIuk15uz3ReGv 4zlCJnhZPsfwMjuA13FCVwrxnbr37juwtBrlJPyS16W3hnY9vf4/GELzuZ0m9Oe61Bhe Ydy40Z2A06gOTEJjVzoqEojHglbc6UvY7tI4hH6QOmT2meOlBctKK8aMwPy3v+M760tg qpr0g6Yvq+laqZ+N7cQxU3ksnnvgxWNkUw8j8U4Dn7W7dcPbTs5M7FK0QuJrXSMcUg4Y J6wQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=erZCK06C49girT+8OYEXbEAMv0WFhcjjVDp5qPC83T4=; b=sCoPO56efYNit+jLhT4tm/GjARmZPIigikXZOaY0AGWUvvxcVEakKS7WAd4ruPc0Ig vUbzUvepJFLY4gziWLI66uK0x60c4z9LzO3uBISZZVXwVTgpgZvOtUAlporOb6ldy4sK IdGCS7wMCv0Iy/+QxG4ShIw6rQaAOXFO6yONxyf+Xf3224ClYeDDWqTs6FXTYkbpBXt8 jUw1gGr76iKjxkhV/arMvE4KugJitPKZOT8cRC062XEFqgADj4QI4VTpce0wxv9mUz/f vY/x5pJvn+Z8vz4M9w+xySPMjnx0dxVYkszxOCTb+Ny3grFZGVDKBKQF7HLzMAijzIH8 ccHw== X-Gm-Message-State: APt69E2zwJTRlZUL3JCmZYnvyaBCGx/d5fnJ6vWkZR00wnNQfh/xgvlZ ddugsu6MyCA41elE/TJq3l9M7y8m X-Google-Smtp-Source: AAOMgpdc3qVDTFq76EzgfawCDAu6iE5yedX5QCkR72jlFWYIOx6NBHNKUIizMEKUUeMv3HCiBg2Mxg== X-Received: by 2002:a1c:5fc1:: with SMTP id t184-v6mr3442614wmb.8.1530339064565; Fri, 29 Jun 2018 23:11:04 -0700 (PDT) Received: from donizetti.lan ([82.84.124.111]) by smtp.gmail.com with ESMTPSA id 24-v6sm563454wrz.94.2018.06.29.23.11.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 29 Jun 2018 23:11:04 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sat, 30 Jun 2018 08:10:14 +0200 Message-Id: <20180630061040.6018-22-pbonzini@redhat.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180630061040.6018-1-pbonzini@redhat.com> References: <20180630061040.6018-1-pbonzini@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::236 Subject: [Qemu-devel] [PULL 21/47] hw/s390x: Use the IEC binary prefix definitions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé It eases code review, unit is explicit. Patch generated using: $ git grep -E '(1024|2048|4096|8192|(<<|>>).?(10|20|30))' hw/ include/hw/ and modified manually. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Acked-by: Cornelia Huck Message-Id: <20180625124238.25339-20-f4bug@amsat.org> Signed-off-by: Paolo Bonzini --- hw/s390x/s390-skeys.c | 3 ++- hw/s390x/s390-stattrib.c | 3 ++- hw/s390x/sclp.c | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/hw/s390x/s390-skeys.c b/hw/s390x/s390-skeys.c index 76241c2..15f7ab0 100644 --- a/hw/s390x/s390-skeys.c +++ b/hw/s390x/s390-skeys.c @@ -10,6 +10,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "hw/boards.h" #include "hw/s390x/storage-keys.h" #include "qapi/error.h" @@ -19,7 +20,7 @@ #include "sysemu/kvm.h" #include "migration/register.h" -#define S390_SKEYS_BUFFER_SIZE 131072 /* Room for 128k storage keys */ +#define S390_SKEYS_BUFFER_SIZE (128 * KiB) /* Room for 128k storage keys */ #define S390_SKEYS_SAVE_FLAG_EOS 0x01 #define S390_SKEYS_SAVE_FLAG_SKEYS 0x02 #define S390_SKEYS_SAVE_FLAG_ERROR 0x04 diff --git a/hw/s390x/s390-stattrib.c b/hw/s390x/s390-stattrib.c index 70b9555..5161a16 100644 --- a/hw/s390x/s390-stattrib.c +++ b/hw/s390x/s390-stattrib.c @@ -10,6 +10,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "hw/boards.h" #include "cpu.h" #include "migration/qemu-file.h" @@ -20,7 +21,7 @@ #include "qapi/error.h" #include "qapi/qmp/qdict.h" -#define CMMA_BLOCK_SIZE (1 << 10) +#define CMMA_BLOCK_SIZE (1 * KiB) #define STATTR_FLAG_EOS 0x01ULL #define STATTR_FLAG_MORE 0x02ULL diff --git a/hw/s390x/sclp.c b/hw/s390x/sclp.c index 047d577..bd2a024 100644 --- a/hw/s390x/sclp.c +++ b/hw/s390x/sclp.c @@ -13,6 +13,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qapi/error.h" #include "cpu.h" #include "sysemu/sysemu.h" @@ -289,7 +290,7 @@ static void sclp_realize(DeviceState *dev, Error **errp) ret = s390_set_memory_limit(machine->maxram_size, &hw_limit); if (ret == -E2BIG) { error_setg(&err, "host supports a maximum of %" PRIu64 " GB", - hw_limit >> 30); + hw_limit / GiB); } else if (ret) { error_setg(&err, "setting the guest size failed"); }