Message ID | 5C9CFE7102000078002229A1@prv1-mh.provo.novell.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | x86emul: don't read mask register on AVX512F-incapable platforms | expand |
On 3/28/19 5:03 PM, Jan Beulich wrote: > Reported-by: George Dunlap <george.dunlap@citrix.com> > Signed-off-by: Jan Beulich <jbeulich@suse.com> That seems to fix all the ones related to the crashes I was seeing: Tested-by: George Dunlap <george.dunlap@citrix.com> > --- > This is surely a stable tree candidate, unless it could still make it > into 4.12 before the release. > > --- a/xen/arch/x86/x86_emulate/x86_emulate.c > +++ b/xen/arch/x86/x86_emulate/x86_emulate.c > @@ -3511,7 +3511,7 @@ x86_emulate( > } > > /* With a memory operand, fetch the mask register in use (if any). */ > - if ( ea.type == OP_MEM && evex.opmsk ) > + if ( ea.type == OP_MEM && cpu_has_avx512f && evex.opmsk ) > { > uint8_t *stb = get_stub(stub); > > >
On 28/03/2019 17:44, George Dunlap wrote: > On 3/28/19 5:03 PM, Jan Beulich wrote: >> Reported-by: George Dunlap <george.dunlap@citrix.com> >> Signed-off-by: Jan Beulich <jbeulich@suse.com> > That seems to fix all the ones related to the crashes I was seeing: > > Tested-by: George Dunlap <george.dunlap@citrix.com> > >> --- >> This is surely a stable tree candidate, unless it could still make it >> into 4.12 before the release. >> >> --- a/xen/arch/x86/x86_emulate/x86_emulate.c >> +++ b/xen/arch/x86/x86_emulate/x86_emulate.c >> @@ -3511,7 +3511,7 @@ x86_emulate( >> } >> >> /* With a memory operand, fetch the mask register in use (if any). */ >> - if ( ea.type == OP_MEM && evex.opmsk ) >> + if ( ea.type == OP_MEM && cpu_has_avx512f && evex.opmsk ) So, this certainly will fix the crash as reported, you need an %xcr0 check, to prevent other ways of this stub faulting. ~Andrew
>>> On 28.03.19 at 19:03, <andrew.cooper3@citrix.com> wrote: > On 28/03/2019 17:44, George Dunlap wrote: >> On 3/28/19 5:03 PM, Jan Beulich wrote: >>> Reported-by: George Dunlap <george.dunlap@citrix.com> >>> Signed-off-by: Jan Beulich <jbeulich@suse.com> >> That seems to fix all the ones related to the crashes I was seeing: >> >> Tested-by: George Dunlap <george.dunlap@citrix.com> >> >>> --- >>> This is surely a stable tree candidate, unless it could still make it >>> into 4.12 before the release. >>> >>> --- a/xen/arch/x86/x86_emulate/x86_emulate.c >>> +++ b/xen/arch/x86/x86_emulate/x86_emulate.c >>> @@ -3511,7 +3511,7 @@ x86_emulate( >>> } >>> >>> /* With a memory operand, fetch the mask register in use (if any). */ >>> - if ( ea.type == OP_MEM && evex.opmsk ) >>> + if ( ea.type == OP_MEM && cpu_has_avx512f && evex.opmsk ) > > So, this certainly will fix the crash as reported, you need an %xcr0 > check, to prevent other ways of this stub faulting. Oh, of course. Let me see how to best fit this in. Jan
--- a/xen/arch/x86/x86_emulate/x86_emulate.c +++ b/xen/arch/x86/x86_emulate/x86_emulate.c @@ -3511,7 +3511,7 @@ x86_emulate( } /* With a memory operand, fetch the mask register in use (if any). */ - if ( ea.type == OP_MEM && evex.opmsk ) + if ( ea.type == OP_MEM && cpu_has_avx512f && evex.opmsk ) { uint8_t *stb = get_stub(stub);
Reported-by: George Dunlap <george.dunlap@citrix.com> Signed-off-by: Jan Beulich <jbeulich@suse.com> --- This is surely a stable tree candidate, unless it could still make it into 4.12 before the release.