From nobody Tue Feb 10 23:01:06 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1516622733777262.83772713148244; Mon, 22 Jan 2018 04:05:33 -0800 (PST) Received: from localhost ([::1]:38042 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edaqz-0004dj-31 for importer@patchew.org; Mon, 22 Jan 2018 07:05:33 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51476) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edamc-0001Zt-4c for qemu-devel@nongnu.org; Mon, 22 Jan 2018 07:01:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edamb-0005sK-Ce for qemu-devel@nongnu.org; Mon, 22 Jan 2018 07:01:02 -0500 Received: from mx1.redhat.com ([209.132.183.28]:30367) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1edamb-0005ru-6u; Mon, 22 Jan 2018 07:01:01 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3E8115587A; Mon, 22 Jan 2018 12:01:00 +0000 (UTC) Received: from localhost (dhcp-192-222.str.redhat.com [10.33.192.222]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DB6DF9065; Mon, 22 Jan 2018 12:00:59 +0000 (UTC) From: Cornelia Huck To: peter.maydell@linaro.org Date: Mon, 22 Jan 2018 13:00:39 +0100 Message-Id: <20180122120045.13538-4-cohuck@redhat.com> In-Reply-To: <20180122120045.13538-1-cohuck@redhat.com> References: <20180122120045.13538-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 22 Jan 2018 12:01:00 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 3/9] s390x/sclp: fix missing be conversion 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: thuth@redhat.com, david@redhat.com, Cornelia Huck , agraf@suse.de, qemu-devel@nongnu.org, borntraeger@de.ibm.com, qemu-s390x@nongnu.org, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: David Hildenbrand Linux crashes right now if maxmem > mem is specified on the command line. On s390x, the guest can hotplug memory itself right now - very weird - and e.g. Fedora 27 will simply add all memory it can when booting. So now, we have at least the same behavior on TCG and KVM. Signed-off-by: David Hildenbrand Message-Id: <20171218224616.21030-3-david@redhat.com> Reviewed-by: Thomas Huth Signed-off-by: Cornelia Huck --- hw/s390x/sclp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/s390x/sclp.c b/hw/s390x/sclp.c index 21351ffffc..276972b59f 100644 --- a/hw/s390x/sclp.c +++ b/hw/s390x/sclp.c @@ -233,7 +233,7 @@ static void assign_storage(SCLPDevice *sclp, SCCB *sccb) sccb->h.response_code =3D cpu_to_be16(SCLP_RC_INVALID_SCLP_COMMAND= ); return; } - assign_addr =3D (assign_info->rn - 1) * mhd->rzm; + assign_addr =3D (be16_to_cpu(assign_info->rn) - 1) * mhd->rzm; =20 if ((assign_addr % MEM_SECTION_SIZE =3D=3D 0) && (assign_addr >=3D mhd->padded_ram_size)) { @@ -292,7 +292,7 @@ static void unassign_storage(SCLPDevice *sclp, SCCB *sc= cb) sccb->h.response_code =3D cpu_to_be16(SCLP_RC_INVALID_SCLP_COMMAND= ); return; } - unassign_addr =3D (assign_info->rn - 1) * mhd->rzm; + unassign_addr =3D (be16_to_cpu(assign_info->rn) - 1) * mhd->rzm; =20 /* if the addr is a multiple of 256 MB */ if ((unassign_addr % MEM_SECTION_SIZE =3D=3D 0) && --=20 2.13.6