Wei Huang
2011-Apr-14 20:38 UTC
[Xen-devel] [PATCH][RFC] FPU LWP 3/5: define new FPU interface functions: fpu_save, fpu_restore, fpu_reload
Current Xen implementation only support lazy FPU reload via CR0.TS. But new FPU state isn''t always tracked by CR0.TS bit. One example is AMD''s lightweight profiling. With this patch, Xen calls fpu_save() on vcpu which is being scheduled out and fpu_restore() on vcpu which is being scheduled in. The nonlazy FPU state is saved and restored in these two functions. This patch also defines fpu_reload() to handle lazy FPU state when #NM is triggered. Signed-off-by: Wei Huang <wei.huang2@amd.com> _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Jan Beulich
2011-Apr-15 09:11 UTC
Re: [Xen-devel] [PATCH][RFC] FPU LWP 3/5: define new FPU interface functions: fpu_save, fpu_restore, fpu_reload
>>> On 14.04.11 at 22:38, Wei Huang <wei.huang2@amd.com> wrote: > Current Xen implementation only support lazy FPU reload via CR0.TS. But > new FPU state isn''t always tracked by CR0.TS bit. One example is AMD''s > lightweight profiling. With this patch, Xen calls fpu_save() on vcpu > which is being scheduled out and fpu_restore() on vcpu which is being > scheduled in. The nonlazy FPU state is saved and restored in these two > 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 > is triggered. > > Signed-off-by: Wei Huang <wei.huang2@amd.com> >... >+/* 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 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Wei Huang
2011-Apr-15 15:50 UTC
Re: [Xen-devel] [PATCH][RFC] FPU LWP 3/5: define new FPU interface functions: fpu_save, fpu_restore, fpu_reload
Will fix. -Wei On 04/15/2011 04:11 AM, Jan Beulich wrote:>>>> On 14.04.11 at 22:38, Wei Huang<wei.huang2@amd.com> wrote: >> Current Xen implementation only support lazy FPU reload via CR0.TS. But >> new FPU state isn''t always tracked by CR0.TS bit. One example is AMD''s >> lightweight profiling. With this patch, Xen calls fpu_save() on vcpu >> which is being scheduled out and fpu_restore() on vcpu which is being >> scheduled in. The nonlazy FPU state is saved and restored in these two >> 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 >> is triggered. >> >> Signed-off-by: Wei Huang<wei.huang2@amd.com> >> ... >> +/* 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 > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel