From patchwork Mon Dec 11 13:47:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 847064 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=) 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 3ywQ0j3MxDz9ryk for ; Tue, 12 Dec 2017 01:13:25 +1100 (AEDT) Received: from localhost ([::1]:53325 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eOOpf-0006I2-FJ for incoming@patchwork.ozlabs.org; Mon, 11 Dec 2017 09:13:23 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43886) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eOORb-0004mx-T4 for qemu-devel@nongnu.org; Mon, 11 Dec 2017 08:48:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eOORX-0007r7-22 for qemu-devel@nongnu.org; Mon, 11 Dec 2017 08:48:31 -0500 Received: from mx1.redhat.com ([209.132.183.28]:47404) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eOORW-0007pZ-S0; Mon, 11 Dec 2017 08:48:26 -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 E64F0C00FACC; Mon, 11 Dec 2017 13:48:25 +0000 (UTC) Received: from t460s.redhat.com (ovpn-117-198.ams2.redhat.com [10.36.117.198]) by smtp.corp.redhat.com (Postfix) with ESMTP id AE961600D1; Mon, 11 Dec 2017 13:48:23 +0000 (UTC) From: David Hildenbrand To: qemu-s390x@nongnu.org, qemu-devel@nongnu.org Date: Mon, 11 Dec 2017 14:47:37 +0100 Message-Id: <20171211134740.8235-13-david@redhat.com> In-Reply-To: <20171211134740.8235-1-david@redhat.com> References: <20171211134740.8235-1-david@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.31]); Mon, 11 Dec 2017 13:48:25 +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] [PATCH v1 for-2-12 12/15] s390x/tcg: fix size + content of STSI blocks 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: Thomas Huth , Peter Crosthwaite , Cornelia Huck , David Hildenbrand , Alexander Graf , Christian Borntraeger , Paolo Bonzini , Richard Henderson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" All blocks are 4k in size, which is only true for two of them right now. Also some reserved fields were wrong, fix it and convert all reserved fields to u8. This also fixes the LPAR part output in /proc/sysinfo under TCG. (for now, everything was indicated as 0) Signed-off-by: David Hildenbrand Reviewed-by: Thomas Huth --- target/s390x/cpu.h | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h index b4a88830de..bfe650c46e 100644 --- a/target/s390x/cpu.h +++ b/target/s390x/cpu.h @@ -437,25 +437,27 @@ static inline void setcc(S390CPU *cpu, uint64_t cc) /* Basic Machine Configuration */ struct sysib_111 { - uint32_t res1[8]; + uint8_t res1[32]; uint8_t manuf[16]; uint8_t type[4]; uint8_t res2[12]; uint8_t model[16]; uint8_t sequence[16]; uint8_t plant[4]; - uint8_t res3[156]; + uint8_t res3[3996]; }; +QEMU_BUILD_BUG_ON(sizeof(struct sysib_111) != 4096); /* Basic Machine CPU */ struct sysib_121 { - uint32_t res1[80]; + uint8_t res1[80]; uint8_t sequence[16]; uint8_t plant[4]; uint8_t res2[2]; uint16_t cpu_addr; - uint8_t res3[152]; + uint8_t res3[3992]; }; +QEMU_BUILD_BUG_ON(sizeof(struct sysib_121) != 4096); /* Basic Machine CPUs */ struct sysib_122 { @@ -467,20 +469,22 @@ struct sysib_122 { uint16_t reserved_cpus; uint16_t adjustments[2026]; }; +QEMU_BUILD_BUG_ON(sizeof(struct sysib_122) != 4096); /* LPAR CPU */ struct sysib_221 { - uint32_t res1[80]; + uint8_t res1[80]; uint8_t sequence[16]; uint8_t plant[4]; uint16_t cpu_id; uint16_t cpu_addr; - uint8_t res3[152]; + uint8_t res3[3992]; }; +QEMU_BUILD_BUG_ON(sizeof(struct sysib_221) != 4096); /* LPAR CPUs */ struct sysib_222 { - uint32_t res1[32]; + uint8_t res1[32]; uint16_t lpar_num; uint8_t res2; uint8_t lcpuc; @@ -493,8 +497,9 @@ struct sysib_222 { uint8_t res3[16]; uint16_t dedicated_cpus; uint16_t shared_cpus; - uint8_t res4[180]; + uint8_t res4[4020]; }; +QEMU_BUILD_BUG_ON(sizeof(struct sysib_222) != 4096); /* VM CPUs */ struct sysib_322 { @@ -517,6 +522,7 @@ struct sysib_322 { uint8_t res4[1504]; uint8_t ext_names[8][256]; }; +QEMU_BUILD_BUG_ON(sizeof(struct sysib_322) != 4096); /* MMU defines */ #define _ASCE_ORIGIN ~0xfffULL /* segment table origin */