Re: [Xen-devel] [PATCH 1/6] x86/xstate: Fix array overrun on hardware with LWP

2017-01-16 Thread Jan Beulich
>>> On 16.01.17 at 12:40, wrote: > c/s da62246e4c "x86/xsaves: enable xsaves/xrstors/xsavec in xen" introduced > setup_xstate_features() to allocate and fill xstate_offsets[] and > xstate_sizes[]. > > However, fls() casts xfeature_mask to 32bits which truncates LWP out

[Xen-devel] [PATCH 1/6] x86/xstate: Fix array overrun on hardware with LWP

2017-01-16 Thread Andrew Cooper
c/s da62246e4c "x86/xsaves: enable xsaves/xrstors/xsavec in xen" introduced setup_xstate_features() to allocate and fill xstate_offsets[] and xstate_sizes[]. However, fls() casts xfeature_mask to 32bits which truncates LWP out of the calculation. As a result, the arrays are allocated too short,