From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>,
jbeulich@suse.com, andrew.cooper3@citrix.com
Cc: keir@xen.org, Suravee.Suthikulpanit@amd.com, xen-devel@lists.xen.org
Subject: Re: [PATCH] x86, amd_ucode: Skip microcode updates for final levels
Date: Thu, 30 Jul 2015 12:41:28 -0400 [thread overview]
Message-ID: <55BA53B8.3080109@oracle.com> (raw)
In-Reply-To: <1438273386-4733-1-git-send-email-aravind.gopalakrishnan@amd.com>
On 07/30/2015 12:23 PM, Aravind Gopalakrishnan wrote:
> Some of older[Fam10h] systems require that the microcode versions
> that it comes up with should not be updated by the microcode driver.
> Otherwise, system hangs are known to occur.
>
> In this patch, we check for those microcode versions and abort the
> update process if existing microcode level is already applied by
> the BIOS.
>
> A linux version of the patch has already made it into tip-
> http://marc.info/?l=linux-kernel&m=143703405627170
>
> Signed-off-by: Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
> ---
> xen/arch/x86/microcode_amd.c | 31 +++++++++++++++++++++++++++++++
> 1 file changed, 31 insertions(+)
>
> diff --git a/xen/arch/x86/microcode_amd.c b/xen/arch/x86/microcode_amd.c
> index f79b397..c958a47 100644
> --- a/xen/arch/x86/microcode_amd.c
> +++ b/xen/arch/x86/microcode_amd.c
> @@ -347,6 +347,30 @@ static int container_fast_forward(const void *data, size_t size_left, size_t *of
> return 0;
> }
>
> +static unsigned int final_levels[] = {
> + 0x01000098,
> + 0x0100009f,
> + 0x010000af,
> + 0
> +};
Are these values documented somewhere?
-boris
> +
> +static bool_t check_final_patch_levels(int cpu)
> +{
> + /*
> + * Check the current patch levels on the cpu. If they are equal to
> + * any of the 'final_levels', then we should not update the microcode
> + * patch on the cpu as system will hang otherwise.
> + */
> + struct ucode_cpu_info *uci = &per_cpu(ucode_cpu_info, cpu);
> + int i;
> +
> + for ( i = 0; final_levels[i]; i++ )
> + if ( uci->cpu_sig.rev == final_levels[i] )
> + return 1;
> +
> + return 0;
> +}
> +
> static int cpu_request_microcode(int cpu, const void *buf, size_t bufsize)
> {
> struct microcode_amd *mc_amd, *mc_old;
> @@ -369,6 +393,13 @@ static int cpu_request_microcode(int cpu, const void *buf, size_t bufsize)
> goto out;
> }
>
> + if ( check_final_patch_levels(cpu) )
> + {
> + pr_debug("microcode: Cannot update microcode patch on the cpu as we hit a final level\n");
> + error = -EPERM;
> + goto out;
> + }
> +
> mc_amd = xmalloc(struct microcode_amd);
> if ( !mc_amd )
> {
next prev parent reply other threads:[~2015-07-30 16:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-30 16:23 [PATCH] x86, amd_ucode: Skip microcode updates for final levels Aravind Gopalakrishnan
2015-07-30 16:41 ` Boris Ostrovsky [this message]
2015-07-30 17:01 ` Andrew Cooper
2015-07-31 20:45 ` Aravind Gopalakrishnan
2015-07-31 20:48 ` Andrew Cooper
2015-07-31 20:51 ` Aravind Gopalakrishnan
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=55BA53B8.3080109@oracle.com \
--to=boris.ostrovsky@oracle.com \
--cc=Suravee.Suthikulpanit@amd.com \
--cc=andrew.cooper3@citrix.com \
--cc=aravind.gopalakrishnan@amd.com \
--cc=jbeulich@suse.com \
--cc=keir@xen.org \
--cc=xen-devel@lists.xen.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.