From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46368) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZC58e-0006mc-5Y for qemu-devel@nongnu.org; Mon, 06 Jul 2015 08:04:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZC58Z-0005GV-Kb for qemu-devel@nongnu.org; Mon, 06 Jul 2015 08:04:43 -0400 Received: from mail-qk0-x236.google.com ([2607:f8b0:400d:c09::236]:33781) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZC58Z-0005GB-Fj for qemu-devel@nongnu.org; Mon, 06 Jul 2015 08:04:39 -0400 Received: by qkhu186 with SMTP id u186so115116411qkh.0 for ; Mon, 06 Jul 2015 05:04:39 -0700 (PDT) Sender: Richard Henderson References: <20150706082535.11980.88013.stgit@PASHA-ISP> <20150706082605.11980.53159.stgit@PASHA-ISP> From: Richard Henderson Message-ID: <559A6EB9.5050005@twiddle.net> Date: Mon, 6 Jul 2015 13:04:09 +0100 MIME-Version: 1.0 In-Reply-To: <20150706082605.11980.53159.stgit@PASHA-ISP> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v5 05/11] target-i386: exception handling for FPU instructions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pavel Dovgalyuk , qemu-devel@nongnu.org Cc: pbonzini@redhat.com, rth7680@gmail.com, leon.alrae@imgtec.com, agraf@suse.de, aurelien@aurel32.net On 07/06/2015 09:26 AM, Pavel Dovgalyuk wrote: > @@ -1117,33 +1131,33 @@ void helper_fxsave(CPUX86State *env, target_ulong ptr, int data64) > for (i = 0; i < 8; i++) { > fptag |= (env->fptags[i] << i); > } > - cpu_stw_data(env, ptr, env->fpuc); > - cpu_stw_data(env, ptr + 2, fpus); > - cpu_stw_data(env, ptr + 4, fptag ^ 0xff); > + cpu_stw_data_ra(env, ptr, env->fpuc, GETPC()); > + cpu_stw_data_ra(env, ptr + 2, fpus, GETPC()); > + cpu_stw_data_ra(env, ptr + 4, fptag ^ 0xff, GETPC()); helper_fxsave and helper_fxrstor ought to have do_* versions just like you did for fstenv/fldenv. (I'm working on a patch set that adds xsave/xrstor support and I'll need to re-use these functions.) r~