From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59688) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOUCg-00023N-BB for qemu-devel@nongnu.org; Thu, 19 Feb 2015 11:43:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YOUCd-0004J0-K1 for qemu-devel@nongnu.org; Thu, 19 Feb 2015 11:43:54 -0500 Received: from mailapp01.imgtec.com ([195.59.15.196]:11878) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOUCd-0004IX-EO for qemu-devel@nongnu.org; Thu, 19 Feb 2015 11:43:51 -0500 Message-ID: <54E612BD.1090607@imgtec.com> Date: Thu, 19 Feb 2015 16:43:41 +0000 From: Leon Alrae MIME-Version: 1.0 References: <1424271115-7885-1-git-send-email-leon.alrae@imgtec.com> <1424271115-7885-3-git-send-email-leon.alrae@imgtec.com> <54E604AD.8070602@twiddle.net> In-Reply-To: <54E604AD.8070602@twiddle.net> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/2] target-mips: add missing MSA and correct FP in VMState List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson , qemu-devel@nongnu.org Cc: amit.shah@redhat.com, macro@linux-mips.org, aurelien@aurel32.net, quintela@redhat.com On 19/02/2015 15:43, Richard Henderson wrote: > On 02/18/2015 06:51 AM, Leon Alrae wrote: >> static VMStateField vmstate_fpu_fields[] = { >> VMSTATE_FPR_ARRAY(fpr, CPUMIPSFPUContext, 32), >> - VMSTATE_INT8(fp_status.float_detect_tininess, CPUMIPSFPUContext), >> + VMSTATE_UINT8(fp_status.flush_to_zero, CPUMIPSFPUContext), >> VMSTATE_INT8(fp_status.float_rounding_mode, CPUMIPSFPUContext), >> VMSTATE_INT8(fp_status.float_exception_flags, CPUMIPSFPUContext), >> VMSTATE_UINT32(fcr0, CPUMIPSFPUContext), >> @@ -70,6 +78,11 @@ static VMStateField vmstate_tc_fields[] = { >> VMSTATE_UINTTL(CP0_TCScheFBack, TCState), >> VMSTATE_INT32(CP0_Debug_tcstatus, TCState), >> VMSTATE_UINTTL(CP0_UserLocal, TCState), >> + VMSTATE_INT32(msacsr, TCState), >> + VMSTATE_INT8(msa_fp_status.float_rounding_mode, TCState), >> + VMSTATE_INT8(msa_fp_status.float_exception_flags, TCState), >> + VMSTATE_UINT8(msa_fp_status.flush_to_zero, TCState), >> + VMSTATE_UINT8(msa_fp_status.flush_inputs_to_zero, TCState), >> VMSTATE_END_OF_LIST() >> }; > > Surely these fp_status fields are simply implementation of the architectural > CSR registers? > > IMO you shouldn't store things related to TCG state, but always how the > architecture represents it. That way you're free to change the TCG > implementation without breaking save/restore. Good point. Saving fp_status and msa_fp_status doesn't seem to be needed at all as they can be restored from FCSR and MSACSR respectively. Presumably I can use vmstate post_load() for that. Thanks, Leon