From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: xen-devel@lists.xenproject.org, david.vrabel@citrix.com,
jbeulich@suse.com
Subject: Re: [PATCH 2/2] microcode: Check whether the microcode is correct.
Date: Wed, 25 Sep 2013 16:39:58 +0100 [thread overview]
Message-ID: <524303CE.2060404@citrix.com> (raw)
In-Reply-To: <1380122984-6555-3-git-send-email-konrad.wilk@oracle.com>
On 25/09/13 16:29, Konrad Rzeszutek Wilk wrote:
> We do the microcode code update in two steps - the presmp:
> 'microcode_presmp_init' and when CPUs are brought up:
> 'microcode_init'. The earlier performs the microcode update
> on the BSP - but unfortunately it does not check whether the
> update failed. Which means that we might try later to update
> a incorrect payload on the rest of CPUs.
>
> This patch handles this odd situation.
>
> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> [v2: Redid it as we are not doing scan and <index> at the same time]
> ---
> xen/arch/x86/microcode.c | 16 +++++++++++++++-
> 1 file changed, 15 insertions(+), 1 deletion(-)
>
> diff --git a/xen/arch/x86/microcode.c b/xen/arch/x86/microcode.c
> index e6344cf..ce2fe50 100644
> --- a/xen/arch/x86/microcode.c
> +++ b/xen/arch/x86/microcode.c
> @@ -418,6 +418,7 @@ static int __init microcode_presmp_init(void)
> {
> void *data;
> size_t len;
> + int rc = 0;
>
> if ( ucode_blob.size )
> {
> @@ -430,10 +431,23 @@ static int __init microcode_presmp_init(void)
> data = ucode_mod_map(&ucode_mod);
> }
> if ( data )
> - microcode_update_cpu(data, len);
> + rc = microcode_update_cpu(data, len);
> + else
> + rc = -ENOMEM;
>
> if ( !ucode_blob.size )
> ucode_mod_map(NULL);
> +
> + if ( rc )
> + {
> + if ( ucode_blob.size )
> + {
> + xfree(ucode_blob.data);
> + ucode_blob.size = 0;
> + ucode_blob.data = NULL;
> + } else
coding style.
Once fixed, Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
> + ucode_mod.mod_end = 0;
> + }
> }
>
> register_cpu_notifier(µcode_percpu_nfb);
next prev parent reply other threads:[~2013-09-25 15:40 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-25 15:29 [PATCH] microcode: Scan the multiboot payloads for cpio format microcode blob. (v3.2) Konrad Rzeszutek Wilk
2013-09-25 15:29 ` [PATCH 1/2] microcode: Scan the initramfs payload for microcode blob Konrad Rzeszutek Wilk
2013-09-25 16:02 ` Jan Beulich
2013-09-25 16:43 ` Konrad Rzeszutek Wilk
2013-09-26 6:31 ` Jan Beulich
2013-09-25 15:29 ` [PATCH 2/2] microcode: Check whether the microcode is correct Konrad Rzeszutek Wilk
2013-09-25 15:39 ` Andrew Cooper [this message]
2013-09-25 15:57 ` Konrad Rzeszutek Wilk
2013-09-26 8:19 ` [PATCH] microcode: Scan the multiboot payloads for cpio format microcode blob. (v3.2) Jan Beulich
2013-09-26 15:04 ` Konrad Rzeszutek Wilk
-- strict thread matches above, loose matches on Subject: below --
2013-09-27 1:09 [PATCH] microcode: Scan the multiboot payloads for cpio format microcode blob. (v3.3) Konrad Rzeszutek Wilk
2013-09-27 1:09 ` [PATCH 2/2] microcode: Check whether the microcode is correct Konrad Rzeszutek Wilk
2013-09-25 12:57 [PATCH] microcode: Scan the multiboot payloads for cpio format microcode blob. (v3) Konrad Rzeszutek Wilk
2013-09-25 12:57 ` [PATCH 2/2] microcode: Check whether the microcode is correct Konrad Rzeszutek Wilk
2013-09-25 13:13 ` Andrew Cooper
2013-09-25 13:59 ` Konrad Rzeszutek Wilk
2013-09-25 14:10 ` Andrew Cooper
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=524303CE.2060404@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=david.vrabel@citrix.com \
--cc=jbeulich@suse.com \
--cc=konrad.wilk@oracle.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).