From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Ross Lagerwall <ross.lagerwall@citrix.com>,
xen-devel@lists.xenproject.org
Cc: Sergey Dyasli <sergey.dyasli@citrix.com>,
Julien Grall <julien.grall@arm.com>,
Jan Beulich <jbeulich@suse.com>
Subject: Re: [PATCH] x86: Move microcode loading earlier
Date: Wed, 19 Apr 2017 12:12:30 +0100 [thread overview]
Message-ID: <e7e23edb-cc03-0812-79df-e5f7f68a76fe@citrix.com> (raw)
In-Reply-To: <1492530444-3900-1-git-send-email-ross.lagerwall@citrix.com>
On 18/04/17 16:47, Ross Lagerwall wrote:
> Move microcode loading earlier for the boot CPU and secondary CPUs so
> that it takes place before identify_cpu() is called for each CPU.
> Without this, the detected features may be wrong if the new microcode
> loading adjusts the feature bits. That could mean that some fixes (e.g.
> d6e9f8d4f35d ("x86/vmx: fix vmentry failure with TSX bits in LBR"))
> don't work as expected.
>
> Previously during boot, the microcode loader was invoked for each
> secondary CPU started and then again for each CPU as part of an
> initcall. Simplify the code so that it is invoked exactly once for each
> CPU during boot.
>
> Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
CC'ing Julien. This should be taken in 4.9
This also resolves my LBR XTF test, so
Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Also, Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>, with 3
corrections (which I can fix on commit)
> @@ -409,50 +381,55 @@ static struct notifier_block microcode_percpu_nfb = {
> .notifier_call = microcode_percpu_callback,
> };
>
> -static int __init microcode_presmp_init(void)
> +int __init early_microcode_update_cpu(bool_t start_update)
s/bool_t/bool/ throughout.
> diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
> index 82559ed..4e01c7b 100644
> --- a/xen/arch/x86/smpboot.c
> +++ b/xen/arch/x86/smpboot.c
> @@ -83,22 +83,22 @@ static enum cpu_state {
>
> void *stack_base[NR_CPUS];
>
> +void initialize_cpu_data(unsigned int cpu)
> +{
> + *(cpu_data + cpu) = boot_cpu_data;
cpu_data[cpu] = boot_cpu_data;
> +}
> +
> static void smp_store_cpu_info(int id)
> {
> - struct cpuinfo_x86 *c = cpu_data + id;
> unsigned int socket;
>
> - *c = boot_cpu_data;
> - if ( id != 0 )
> - {
> - identify_cpu(c);
> + identify_cpu(cpu_data + id);
&cpu_data[id]
~Andrew
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2017-04-19 11:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-18 15:47 [PATCH] x86: Move microcode loading earlier Ross Lagerwall
2017-04-19 11:12 ` Andrew Cooper [this message]
2017-04-19 11:29 ` Julien Grall
2017-04-19 14:02 ` Jan Beulich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e7e23edb-cc03-0812-79df-e5f7f68a76fe@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=jbeulich@suse.com \
--cc=julien.grall@arm.com \
--cc=ross.lagerwall@citrix.com \
--cc=sergey.dyasli@citrix.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).