Re: [PATCH v4 2/7] x86/xstate: Cross-check dynamic XSTATE sizes at boot

2024-06-18 Thread Jan Beulich
On 18.06.2024 17:21, Andrew Cooper wrote: > On 18/06/2024 11:05 am, Jan Beulich wrote: >> On 17.06.2024 19:39, Andrew Cooper wrote: >>> --- a/xen/arch/x86/xstate.c >>> +++ b/xen/arch/x86/xstate.c >>> @@ -604,9 +604,164 @@ static bool valid_xcr0(uint64_t xcr0) >>> if ( !(xcr0 & X86_XCR0_BNDREGS

Re: [PATCH v4 2/7] x86/xstate: Cross-check dynamic XSTATE sizes at boot

2024-06-18 Thread Andrew Cooper
On 18/06/2024 11:05 am, Jan Beulich wrote: > On 17.06.2024 19:39, Andrew Cooper wrote: >> Right now, xstate_ctxt_size() performs a cross-check of size with CPUID in >> for >> every call. This is expensive, being used for domain create/migrate, as well >> as to service certain guest CPUID instruct

Re: [PATCH v4 2/7] x86/xstate: Cross-check dynamic XSTATE sizes at boot

2024-06-18 Thread Jan Beulich
On 17.06.2024 19:39, Andrew Cooper wrote: > Right now, xstate_ctxt_size() performs a cross-check of size with CPUID in for > every call. This is expensive, being used for domain create/migrate, as well > as to service certain guest CPUID instructions. > > Instead, arrange to check the sizes once

[PATCH v4 2/7] x86/xstate: Cross-check dynamic XSTATE sizes at boot

2024-06-17 Thread Andrew Cooper
Right now, xstate_ctxt_size() performs a cross-check of size with CPUID in for every call. This is expensive, being used for domain create/migrate, as well as to service certain guest CPUID instructions. Instead, arrange to check the sizes once at boot. See the code comments for details. Right