From 9d0248fddf86c96efcb16963f0842927cb5c23c0 Mon Sep 17 00:00:00 2001 From: Liu Jinsong <jinsong.liu@intel.com> Date: Tue, 19 Nov 2013 18:48:20 +0800 Subject: [PATCH 5/5] X86: enable MPX feature to HVM guest Signed-off-by: Xudong Hao <xudong.hao@intel.com> Reviewed-by: Liu Jinsong <jinsong.liu@intel.com> --- xen/arch/x86/xstate.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/xen/arch/x86/xstate.c b/xen/arch/x86/xstate.c index 1fd43c9..2bc9b60 100644 --- a/xen/arch/x86/xstate.c +++ b/xen/arch/x86/xstate.c @@ -373,6 +373,7 @@ int handle_xsetbv(u32 index, u64 new_bv) mask = new_bv & ~curr->arch.xcr0_accum; curr->arch.xcr0 = new_bv; curr->arch.xcr0_accum |= new_bv; + curr->arch.nonlazy_xstate_used = !!(curr->arch.xcr0 & XSTATE_NONLAZY); mask &= curr->fpu_dirtied ? ~XSTATE_FP_SSE : XSTATE_NONLAZY; if ( mask ) -- 1.7.1
On 19/11/13 10:54, Liu, Jinsong wrote:> From 9d0248fddf86c96efcb16963f0842927cb5c23c0 Mon Sep 17 00:00:00 2001 > From: Liu Jinsong <jinsong.liu@intel.com> > Date: Tue, 19 Nov 2013 18:48:20 +0800 > Subject: [PATCH 5/5] X86: enable MPX feature to HVM guest > > Signed-off-by: Xudong Hao <xudong.hao@intel.com> > Reviewed-by: Liu Jinsong <jinsong.liu@intel.com> > --- > xen/arch/x86/xstate.c | 1 + > 1 files changed, 1 insertions(+), 0 deletions(-) > > diff --git a/xen/arch/x86/xstate.c b/xen/arch/x86/xstate.c > index 1fd43c9..2bc9b60 100644 > --- a/xen/arch/x86/xstate.c > +++ b/xen/arch/x86/xstate.c > @@ -373,6 +373,7 @@ int handle_xsetbv(u32 index, u64 new_bv) > mask = new_bv & ~curr->arch.xcr0_accum; > curr->arch.xcr0 = new_bv; > curr->arch.xcr0_accum |= new_bv; > + curr->arch.nonlazy_xstate_used = !!(curr->arch.xcr0 & XSTATE_NONLAZY); > > mask &= curr->fpu_dirtied ? ~XSTATE_FP_SSE : XSTATE_NONLAZY; > if ( mask )This looks like a bug, and unrelated to the patch description? ~Andrew
>>> On 19.11.13 at 11:54, "Liu, Jinsong" <jinsong.liu@intel.com> wrote: > From 9d0248fddf86c96efcb16963f0842927cb5c23c0 Mon Sep 17 00:00:00 2001 > From: Liu Jinsong <jinsong.liu@intel.com> > Date: Tue, 19 Nov 2013 18:48:20 +0800 > Subject: [PATCH 5/5] X86: enable MPX feature to HVM guest > > Signed-off-by: Xudong Hao <xudong.hao@intel.com> > Reviewed-by: Liu Jinsong <jinsong.liu@intel.com> > --- > xen/arch/x86/xstate.c | 1 + > 1 files changed, 1 insertions(+), 0 deletions(-) > > diff --git a/xen/arch/x86/xstate.c b/xen/arch/x86/xstate.c > index 1fd43c9..2bc9b60 100644 > --- a/xen/arch/x86/xstate.c > +++ b/xen/arch/x86/xstate.c > @@ -373,6 +373,7 @@ int handle_xsetbv(u32 index, u64 new_bv) > mask = new_bv & ~curr->arch.xcr0_accum; > curr->arch.xcr0 = new_bv; > curr->arch.xcr0_accum |= new_bv; > + curr->arch.nonlazy_xstate_used = !!(curr->arch.xcr0 & XSTATE_NONLAZY);See v2 of patch 2. The patch is wrong this way anyway, and was be mis-ordered (it''s a prereq to patch 4). Jan
Jan Beulich wrote:>>>> On 19.11.13 at 11:54, "Liu, Jinsong" <jinsong.liu@intel.com> wrote: >> From 9d0248fddf86c96efcb16963f0842927cb5c23c0 Mon Sep 17 00:00:00 >> 2001 From: Liu Jinsong <jinsong.liu@intel.com> >> Date: Tue, 19 Nov 2013 18:48:20 +0800 >> Subject: [PATCH 5/5] X86: enable MPX feature to HVM guest >> >> Signed-off-by: Xudong Hao <xudong.hao@intel.com> >> Reviewed-by: Liu Jinsong <jinsong.liu@intel.com> >> --- >> xen/arch/x86/xstate.c | 1 + >> 1 files changed, 1 insertions(+), 0 deletions(-) >> >> diff --git a/xen/arch/x86/xstate.c b/xen/arch/x86/xstate.c >> index 1fd43c9..2bc9b60 100644 >> --- a/xen/arch/x86/xstate.c >> +++ b/xen/arch/x86/xstate.c >> @@ -373,6 +373,7 @@ int handle_xsetbv(u32 index, u64 new_bv) >> mask = new_bv & ~curr->arch.xcr0_accum; >> curr->arch.xcr0 = new_bv; >> curr->arch.xcr0_accum |= new_bv; >> + curr->arch.nonlazy_xstate_used = !!(curr->arch.xcr0 & >> XSTATE_NONLAZY); > > See v2 of patch 2. The patch is wrong this way anyway, and > was be mis-ordered (it''s a prereq to patch 4). >Yes, this patch in fact could be dropped per patch 2 V2. Thanks Jan and Andrew!