diff mbox

VMX: relax incoming BNDCFGS check

Message ID 574C2C9802000078000EF9C3@prv-mh.provo.novell.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jan Beulich May 30, 2016, 10:05 a.m. UTC
Accepting zero here even when !cpu_has_mpx makes the restore side
symmetric to the save logic (which avoids saving the value if zero),
i.e. makes either side independent of the logic on the other side.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
VMX: relax incoming BNDCFGS check

Accepting zero here even when !cpu_has_mpx makes the restore side
symmetric to the save logic (which avoids saving the value if zero),
i.e. makes either side independent of the logic on the other side.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -824,7 +824,7 @@ static int vmx_load_msr(struct vcpu *v,
         case MSR_IA32_BNDCFGS:
             if ( cpu_has_mpx )
                 __vmwrite(GUEST_BNDCFGS, ctxt->msr[i].val);
-            else
+            else if ( ctxt->msr[i].val )
                 err = -ENXIO;
             break;
         case MSR_IA32_XSS:

Comments

Andrew Cooper May 31, 2016, 10:12 a.m. UTC | #1
On 30/05/16 11:05, Jan Beulich wrote:
> Accepting zero here even when !cpu_has_mpx makes the restore side
> symmetric to the save logic (which avoids saving the value if zero),
> i.e. makes either side independent of the logic on the other side.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Tian, Kevin June 3, 2016, 2:14 a.m. UTC | #2
> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: Monday, May 30, 2016 6:06 PM
> 
> Accepting zero here even when !cpu_has_mpx makes the restore side
> symmetric to the save logic (which avoids saving the value if zero),
> i.e. makes either side independent of the logic on the other side.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 

Acked-by: Kevin Tian <kevin.tian@intel.com>
Wei Liu June 3, 2016, 1:07 p.m. UTC | #3
On Fri, Jun 03, 2016 at 02:14:06AM +0000, Tian, Kevin wrote:
> > From: Jan Beulich [mailto:JBeulich@suse.com]
> > Sent: Monday, May 30, 2016 6:06 PM
> > 
> > Accepting zero here even when !cpu_has_mpx makes the restore side
> > symmetric to the save logic (which avoids saving the value if zero),
> > i.e. makes either side independent of the logic on the other side.
> > 
> > Signed-off-by: Jan Beulich <jbeulich@suse.com>
> > 
> 
> Acked-by: Kevin Tian <kevin.tian@intel.com>

Release-acked-by: Wei Liu <wei.liu2@citrix.com>
diff mbox

Patch

--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -824,7 +824,7 @@  static int vmx_load_msr(struct vcpu *v,
         case MSR_IA32_BNDCFGS:
             if ( cpu_has_mpx )
                 __vmwrite(GUEST_BNDCFGS, ctxt->msr[i].val);
-            else
+            else if ( ctxt->msr[i].val )
                 err = -ENXIO;
             break;
         case MSR_IA32_XSS: