Re: [Xen-devel] [PATCH v10 12/16] x86/microcode: Synchronize late microcode loading

2019-09-13 Thread Jan Beulich
On 13.09.2019 09:01, Chao Gao wrote: > On Thu, Sep 12, 2019 at 05:32:22PM +0200, Jan Beulich wrote: >> On 12.09.2019 09:22, Chao Gao wrote: >>> +static int secondary_thread_fn(void) >>> +{ >>> +unsigned int primary = cpumask_first(this_cpu(cpu_sibling_mask)); >>> + >>> +if ( !wait_for_state

Re: [Xen-devel] [PATCH v10 12/16] x86/microcode: Synchronize late microcode loading

2019-09-12 Thread Chao Gao
On Thu, Sep 12, 2019 at 05:32:22PM +0200, Jan Beulich wrote: >On 12.09.2019 09:22, Chao Gao wrote: >> @@ -264,38 +336,158 @@ static int microcode_update_cpu(const struct >> microcode_patch *patch) >> return err; >> } >> >> -static long do_microcode_update(void *patch) >> +static bool wait_

Re: [Xen-devel] [PATCH v10 12/16] x86/microcode: Synchronize late microcode loading

2019-09-12 Thread Jan Beulich
On 12.09.2019 09:22, Chao Gao wrote: > @@ -264,38 +336,158 @@ static int microcode_update_cpu(const struct > microcode_patch *patch) > return err; > } > > -static long do_microcode_update(void *patch) > +static bool wait_for_state(unsigned int state) > +{ > +while ( loading_state != st

[Xen-devel] [PATCH v10 12/16] x86/microcode: Synchronize late microcode loading

2019-09-12 Thread Chao Gao
This patch ports microcode improvement patches from linux kernel. Before you read any further: the early loading method is still the preferred one and you should always do that. The following patch is improving the late loading mechanism for long running jobs and cloud use cases. Gather all cores