From patchwork Wed May 6 15:24:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cornelia Huck X-Patchwork-Id: 468996 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 E2DDE1402B5 for ; Thu, 7 May 2015 01:26:50 +1000 (AEST) Received: from localhost ([::1]:45731 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yq1Dl-0006AR-3M for incoming@patchwork.ozlabs.org; Wed, 06 May 2015 11:26:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40178) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yq1Bt-0003ca-HK for qemu-devel@nongnu.org; Wed, 06 May 2015 11:24:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yq1Bq-0006VM-AP for qemu-devel@nongnu.org; Wed, 06 May 2015 11:24:53 -0400 Received: from e06smtp12.uk.ibm.com ([195.75.94.108]:39234) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yq1Bq-0006V1-1K for qemu-devel@nongnu.org; Wed, 06 May 2015 11:24:50 -0400 Received: from /spool/local by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 6 May 2015 16:24:47 +0100 Received: from d06dlp03.portsmouth.uk.ibm.com (9.149.20.15) by e06smtp12.uk.ibm.com (192.168.101.142) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 6 May 2015 16:24:45 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 686FF1B08023 for ; Wed, 6 May 2015 16:25:27 +0100 (BST) Received: from d06av10.portsmouth.uk.ibm.com (d06av10.portsmouth.uk.ibm.com [9.149.37.251]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t46FOiGD2884008 for ; Wed, 6 May 2015 15:24:44 GMT Received: from d06av10.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av10.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t46FOiAW009271 for ; Wed, 6 May 2015 09:24:44 -0600 Received: from gondolin.boeblingen.de.ibm.com (dyn-9-152-224-143.boeblingen.de.ibm.com [9.152.224.143]) by d06av10.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t46FOh4I009202; Wed, 6 May 2015 09:24:44 -0600 From: Cornelia Huck To: qemu-devel@nongnu.org Date: Wed, 6 May 2015 17:24:39 +0200 Message-Id: <1430925880-4539-3-git-send-email-cornelia.huck@de.ibm.com> X-Mailer: git-send-email 2.4.0 In-Reply-To: <1430925880-4539-1-git-send-email-cornelia.huck@de.ibm.com> References: <1430925880-4539-1-git-send-email-cornelia.huck@de.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15050615-0009-0000-0000-0000040FB5D3 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 195.75.94.108 Cc: Cornelia Huck , borntraeger@de.ibm.com, jfrei@linux.vnet.ibm.com, agraf@suse.de, David Hildenbrand Subject: [Qemu-devel] [PATCH 2/3] s390x: move fpu regs into a subsection of the vmstate X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: David Hildenbrand Let's move the floating point registers into a seperate subsection and bump up the version id. This cleans up the current vmstate and will allow for a future extension with vector registers in a compatible way. This patch is based on a patch from Eric Farman. Reviewed-by: Eric Farman Signed-off-by: David Hildenbrand Signed-off-by: Cornelia Huck --- target-s390x/machine.c | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/target-s390x/machine.c b/target-s390x/machine.c index bd4cea7..a034423 100644 --- a/target-s390x/machine.c +++ b/target-s390x/machine.c @@ -33,12 +33,11 @@ static int cpu_post_load(void *opaque, int version_id) return 0; } -const VMStateDescription vmstate_s390_cpu = { - .name = "cpu", - .post_load = cpu_post_load, - .version_id = 2, - .minimum_version_id = 2, - .fields = (VMStateField[]) { +const VMStateDescription vmstate_fpu = { + .name = "cpu/fpu", + .version_id = 1, + .minimum_version_id = 1, + .fields = (VMStateField[]) { VMSTATE_UINT64(env.fregs[0].ll, S390CPU), VMSTATE_UINT64(env.fregs[1].ll, S390CPU), VMSTATE_UINT64(env.fregs[2].ll, S390CPU), @@ -55,11 +54,26 @@ const VMStateDescription vmstate_s390_cpu = { VMSTATE_UINT64(env.fregs[13].ll, S390CPU), VMSTATE_UINT64(env.fregs[14].ll, S390CPU), VMSTATE_UINT64(env.fregs[15].ll, S390CPU), + VMSTATE_UINT32(env.fpc, S390CPU), + VMSTATE_END_OF_LIST() + } +}; + +static inline bool fpu_needed(void *opaque) +{ + return true; +} + +const VMStateDescription vmstate_s390_cpu = { + .name = "cpu", + .post_load = cpu_post_load, + .version_id = 3, + .minimum_version_id = 3, + .fields = (VMStateField[]) { VMSTATE_UINT64_ARRAY(env.regs, S390CPU, 16), VMSTATE_UINT64(env.psw.mask, S390CPU), VMSTATE_UINT64(env.psw.addr, S390CPU), VMSTATE_UINT64(env.psa, S390CPU), - VMSTATE_UINT32(env.fpc, S390CPU), VMSTATE_UINT32(env.todpr, S390CPU), VMSTATE_UINT64(env.pfault_token, S390CPU), VMSTATE_UINT64(env.pfault_compare, S390CPU), @@ -74,4 +88,12 @@ const VMStateDescription vmstate_s390_cpu = { VMSTATE_UINT8(env.sigp_order, S390CPU), VMSTATE_END_OF_LIST() }, + .subsections = (VMStateSubsection[]) { + { + .vmsd = &vmstate_fpu, + .needed = fpu_needed, + } , { + /* empty */ + } + }, };