Re: [PATCH 4/7] x86/xstate: Rework xstate_ctxt_size() as xstate_uncompressed_size()

2024-06-14 Thread Andrew Cooper
On 23/05/2024 5:09 pm, Jan Beulich wrote: > On 23.05.2024 13:16, Andrew Cooper wrote: >> @@ -611,6 +587,40 @@ static bool valid_xcr0(uint64_t xcr0) >> return true; >> } >> >> +unsigned int xstate_uncompressed_size(uint64_t xcr0) >> +{ >> +unsigned int size = XSTATE_AREA_MIN_SIZE, i; >>

Re: [PATCH 4/7] x86/xstate: Rework xstate_ctxt_size() as xstate_uncompressed_size()

2024-05-23 Thread Jan Beulich
On 23.05.2024 13:16, Andrew Cooper wrote: > @@ -611,6 +587,40 @@ static bool valid_xcr0(uint64_t xcr0) > return true; > } > > +unsigned int xstate_uncompressed_size(uint64_t xcr0) > +{ > +unsigned int size = XSTATE_AREA_MIN_SIZE, i; > + > +ASSERT((xcr0 & ~X86_XCR0_STATES) == 0);

[PATCH 4/7] x86/xstate: Rework xstate_ctxt_size() as xstate_uncompressed_size()

2024-05-23 Thread Andrew Cooper
We're soon going to need a compressed helper of the same form. The size of the uncompressed image depends on the single element with the largest offset + size. Sadly this isn't always the element with the largest index. Name the per-xstate-component cpu_policy struture, for legibility of the