From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: fsincos emulation on AMD CPUs Date: Thu, 15 Dec 2011 09:54:22 +0100 Message-ID: References: <4EE9C01902000078000680CD@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4EE9C01902000078000680CD@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On 12/15/2011 09:38 AM, Jan Beulich wrote: > All, > > in the light of erratum #573 I'm wondering if we need to tweak or > conditionally suppress fsincos emulation. The question is whether there > is any possibility for getting the emulator to hit this instruction on AMD > (as no real mode emulation ought to be taking place there), i.e. > whether there are places where emulation gets continued eagerly > in anticipation of the need for emulation on a nearby instruction. This can happen with PAE + shadow pagetables. There's also the case when a user process issues an instruction to an MMIO region, and another thread replaces the instruction with another (fsincos in this case), racing with the emulator until the emulator sees fsincos instead of the MMIO instruction. If you really cared, perhaps fsincos can be replaced by this sequence in the emulator: ; x fld %st ; x x fsin ; x sin(x) fxch %st(1) ; sin(x) x fcos ; sin(x) cos(x) Paolo