From patchwork Wed Oct 26 20:16:37 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 121997 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 22C871007DA for ; Thu, 27 Oct 2011 07:33:18 +1100 (EST) Received: from localhost ([::1]:53542 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RJA9x-0005Sq-7R for incoming@patchwork.ozlabs.org; Wed, 26 Oct 2011 16:33:13 -0400 Received: from eggs.gnu.org ([140.186.70.92]:60475) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RJA9p-0005SV-J2 for qemu-devel@nongnu.org; Wed, 26 Oct 2011 16:33:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RJA9o-0003NS-Fy for qemu-devel@nongnu.org; Wed, 26 Oct 2011 16:33:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50280) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RJA9o-0003NM-7n for qemu-devel@nongnu.org; Wed, 26 Oct 2011 16:33:04 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p9QKWmnL026619 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 26 Oct 2011 16:32:48 -0400 Received: from neno.neno (ovpn-116-28.ams2.redhat.com [10.36.116.28]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p9QKHull018327; Wed, 26 Oct 2011 16:32:19 -0400 From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 26 Oct 2011 22:16:37 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 209.132.183.28 Cc: Huacai Chen , Peter Maydell , Alexander Graf , Blue Swirl , Max Filippov , Michael Walle , Paul Brook , "Edgar E. Iglesias" , Aurelien Jarno , Richard Henderson Subject: [Qemu-devel] [PATCH 23/28] arm: save always 32 fpu registers 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 This way, we fix a bug (we were overwritten the 16 first registers on load), and we don't need to check for ARM_FEATUR_VPF3, we always send the 32 registers. Signed-off-by: Juan Quintela --- target-arm/cpu.h | 2 +- target-arm/machine.c | 22 ++-------------------- 2 files changed, 3 insertions(+), 21 deletions(-) diff --git a/target-arm/cpu.h b/target-arm/cpu.h index 6ab780d..f6d9436 100644 --- a/target-arm/cpu.h +++ b/target-arm/cpu.h @@ -446,7 +446,7 @@ void cpu_arm_set_cp_io(CPUARMState *env, int cpnum, #define cpu_signal_handler cpu_arm_signal_handler #define cpu_list arm_cpu_list -#define CPU_SAVE_VERSION 4 +#define CPU_SAVE_VERSION 5 /* MMU modes definitions */ #define MMU_MODE0_SUFFIX _kernel diff --git a/target-arm/machine.c b/target-arm/machine.c index 7d4fc54..3a3b325 100644 --- a/target-arm/machine.c +++ b/target-arm/machine.c @@ -60,7 +60,7 @@ void cpu_save(QEMUFile *f, void *opaque) qemu_put_be32(f, env->features); if (arm_feature(env, ARM_FEATURE_VFP)) { - for (i = 0; i < 16; i++) { + for (i = 0; i < 32; i++) { CPU_DoubleU u; u.d = env->vfp.regs[i]; qemu_put_be32(f, u.l.upper); @@ -73,15 +73,6 @@ void cpu_save(QEMUFile *f, void *opaque) /* TODO: Should use proper FPSCR access functions. */ qemu_put_be32(f, env->vfp.vec_len); qemu_put_be32(f, env->vfp.vec_stride); - - if (arm_feature(env, ARM_FEATURE_VFP3)) { - for (i = 16; i < 32; i++) { - CPU_DoubleU u; - u.d = env->vfp.regs[i]; - qemu_put_be32(f, u.l.upper); - qemu_put_be32(f, u.l.lower); - } - } } if (arm_feature(env, ARM_FEATURE_IWMMXT)) { @@ -174,7 +165,7 @@ int cpu_load(QEMUFile *f, void *opaque, int version_id) env->features = qemu_get_be32(f); if (arm_feature(env, ARM_FEATURE_VFP)) { - for (i = 0; i < 16; i++) { + for (i = 0; i < 32; i++) { CPU_DoubleU u; u.l.upper = qemu_get_be32(f); u.l.lower = qemu_get_be32(f); @@ -187,15 +178,6 @@ int cpu_load(QEMUFile *f, void *opaque, int version_id) /* TODO: Should use proper FPSCR access functions. */ env->vfp.vec_len = qemu_get_be32(f); env->vfp.vec_stride = qemu_get_be32(f); - - if (arm_feature(env, ARM_FEATURE_VFP3)) { - for (i = 0; i < 16; i++) { - CPU_DoubleU u; - u.l.upper = qemu_get_be32(f); - u.l.lower = qemu_get_be32(f); - env->vfp.regs[i] = u.d; - } - } } if (arm_feature(env, ARM_FEATURE_IWMMXT)) {