From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: Re: [PATCH][RFC] FPU LWP 3/5: define new FPU interface functions: fpu_save, fpu_restore, fpu_reload Date: Fri, 15 Apr 2011 10:11:21 +0100 Message-ID: <4DA827D9020000780003C9BF@vpn.id2.novell.com> References: <4DA75B57.404@amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <4DA75B57.404@amd.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Wei Huang Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org >>> On 14.04.11 at 22:38, Wei Huang wrote: > Current Xen implementation only support lazy FPU reload via CR0.TS. = But=20 > new FPU state isn't always tracked by CR0.TS bit. One example is = AMD's=20 > lightweight profiling. With this patch, Xen calls fpu_save() on vcpu=20 > which is being scheduled out and fpu_restore() on vcpu which is being=20 > scheduled in. The nonlazy FPU state is saved and restored in these = two=20 > functions. This doesn't match the actual patch - only fpu_restore() is being added to the context switch path, fpu_save() was there already, saving both lazy and non-lazy state. > This patch also defines fpu_reload() to handle lazy FPU state when = #NM=20 > is triggered. >=20 > Signed-off-by: Wei Huang >... >+/* Restore VCPU's FPU state when the vcpu is scheduled out */ >+void fpu_restore(struct vcpu *v) The comment ought so say "in" rather than "out". Jan