Re: [Xen-devel] [PATCH 2/3 v2] x86emul: conditionally clear BNDn for branches

2017-01-06 Thread Jan Beulich
>>> On 06.01.17 at 16:35, wrote: On 05.01.17 at 19:59, wrote: >> On 05/01/17 09:13, Jan Beulich wrote: >> On 04.01.17 at 22:11, wrote: On 12/12/16 10:00, Jan Beulich wrote: > --- a/xen/arch/x86/xstate.c > +++ b/xen/arch/x86/xstate.c > @@ -723,6 +741,66 @@ int handle_xse

Re: [Xen-devel] [PATCH 2/3 v2] x86emul: conditionally clear BNDn for branches

2017-01-06 Thread Jan Beulich
>>> On 05.01.17 at 19:59, wrote: > On 05/01/17 09:13, Jan Beulich wrote: > On 04.01.17 at 22:11, wrote: >>> On 12/12/16 10:00, Jan Beulich wrote: @@ -1791,6 +1795,34 @@ static int inject_swint(enum x86_swint_t generate_exception(fault_type, error_code); } +sta

Re: [Xen-devel] [PATCH 2/3 v2] x86emul: conditionally clear BNDn for branches

2017-01-05 Thread Andrew Cooper
On 05/01/17 09:13, Jan Beulich wrote: On 04.01.17 at 22:11, wrote: >> On 12/12/16 10:00, Jan Beulich wrote: >>> @@ -1791,6 +1795,34 @@ static int inject_swint(enum x86_swint_t >>> generate_exception(fault_type, error_code); >>> } >>> >>> +static void clear_bnd(struct x86_emulate_ctxt

Re: [Xen-devel] [PATCH 2/3 v2] x86emul: conditionally clear BNDn for branches

2017-01-05 Thread Jan Beulich
>>> On 04.01.17 at 22:11, wrote: > On 12/12/16 10:00, Jan Beulich wrote: >> @@ -1791,6 +1795,34 @@ static int inject_swint(enum x86_swint_t >> generate_exception(fault_type, error_code); >> } >> >> +static void clear_bnd(struct x86_emulate_ctxt *ctxt, >> + const struct

Re: [Xen-devel] [PATCH 2/3 v2] x86emul: conditionally clear BNDn for branches

2017-01-04 Thread Andrew Cooper
On 12/12/16 10:00, Jan Beulich wrote: > @@ -1791,6 +1795,34 @@ static int inject_swint(enum x86_swint_t > generate_exception(fault_type, error_code); > } > > +static void clear_bnd(struct x86_emulate_ctxt *ctxt, > + const struct x86_emulate_ops *ops, enum vex_pfx pfx)

[Xen-devel] [PATCH 2/3 v2] x86emul: conditionally clear BNDn for branches

2016-12-12 Thread Jan Beulich
Considering that we surface MPX to HVM guests, instructions we emulate should also correctly deal with MPX state. While for now BND* instructions don't get emulated, the effect of branches (which we do emulate) without BND prefix should be taken care of. No need to alter XABORT behavior: While not