mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dmitry Adamushko <dmitry.adamushko@gmail.com>
To: Andreas Herrmann <herrmann.der.user@googlemail.com>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
	"H. Peter Anvin" <hpa@zytor.com>, Mike Travis <travis@sgi.com>,
	Tigran Aivazian <tigran@aivazian.fsnet.co.uk>,
	Thomas Gleixner <tglx@linutronix.de>,
	Borislav Petkov <borislav.petkov@amd.com>,
	Andreas Mohr <andi@lisas.de>, Jack Steiner <steiner@sgi.com>
Subject: Re: [ RFC, PATCH - 1/2, v2 ] x86-microcode: refactor microcode output  messages
Date: Sat, 7 Nov 2009 13:22:19 +0100	[thread overview]
Message-ID: <b647ffbd0911070422g154c63bbo2fec62ba63c3c106@mail.gmail.com> (raw)
In-Reply-To: <20091106194626.GC18592@alberich.amd.com>

2009/11/6 Andreas Herrmann <herrmann.der.user@googlemail.com>:
> On Fri, Nov 06, 2009 at 01:56:31PM +0100, Dmitry Adamushko wrote:
>> 2009/11/6 Andreas Herrmann <herrmann.der.user@googlemail.com>:
>
>   <snip>
>
>> >> (CPU3 belongs to both sets) unless summarize_cpu_info() is utterly
>> >> broken.
>> >
>> > I didn't check that yet.
>>
>> Yeah, this behavior is likely due to a missing cpumask_clear() in
>> summarize_cpu_info().
>
> Yeah, that fixes the wrong messages.
> The other problem of not-updated CPU microcode after suspend/resume persists.
>
>> should be as follows:
>>
>>       if (!alloc_cpumask_var(&cpulist, GFP_KERNEL))
>>               return;
>>
>> +    cpumask_clear(cpulist);
>
> Better use zalloc_cpumask instead of alloc/clear.

ok.

>
>> >> sure, my test is somewhat limited... anyway, first of all I'd like to
>> >> get a clear understanding of your logs. Thanks for yout test btw. :-))
>> >
>> > I'll send you full logs asap.
>>
>> Thanks. Maybe it's something about a particular sequence of actions
>> that triggers this behavior. Or was it reproducible with the very
>> first pm-suspend invocation after "modprobe microcode.ko"?
>
> The sequence is:
>
> 1. loading microcode.ko
> 2. setting cpu2 offline
> 3. setting cpu2 online
> 4. suspend (pm-suspend)
> 5. resume
>
> microcode of CPU2 is not updated:
>
>  # for i in `seq 0 3`; do lsmsr -c $i PATCH_LEVEL; done
>  PATCH_LEVEL          = 0x0000000001000083
>  PATCH_LEVEL          = 0x0000000001000083
>  PATCH_LEVEL          = 0x0000000001000065
>  PATCH_LEVEL          = 0x0000000001000083
>
> dmesg attached.

It looks like the microcode of CPU2 was not updated at step (3) [ and
not cached in uci->mc so that there was nothing to be loaded at resume
time later on ].

...
platform microcode: firmware: requesting amd-ucode/microcode_amd.bin
microcode: size 1936, total_size 960
microcode: CPU2: patch mismatch (processor_rev_id: 1020, equiv_cpu_id: 1022)
microcode: size 968, total_size 960
PM: Syncing filesystems ... done.
...

These messages are from ->request_microcode_fw() but then there is
nothing from ->apply_microcode(). I'd expect to see "microcode: CPU%d:
updated (new patch_level=0x%x)".

So either request_fw() -> generic_load_microcode() somehow fails to
find/cache a ucode (while it could do this at microcode-load time) or
apply_microcode_on_target() -> smp_call_function_single() fails in
this context. I made a test (some changes to load a cached ->mc at
cpu-online time) to verify the latter hypothesis and it didn't reveal
any problems or it requires some special conditions (also my kernel is
-rc5+).


>
> As I've said, that test used to pass with all CPUs updated to new
> ucode in the past (at least that I think so ;-( -- but in contrast to
> my previous mail this doesn't seem to be related to your patch. I
> tested latest mainline and the test fails as well ... seems that I
> need to do some debugging.

Ok. Then by instrumenting ->request_microcode_fs() and
apply_microcode_on_target() we would get a hint on what's wrong.


>
>
> Regards,
> Andreas
>
> PS1: You should remove the needless newline from the patch level string:
>
>  static int version_snprintf(char *buf, int len, struct cpu_signature *csig)
>  {
> -       return snprintf(buf, len, "patch_level=0x%x\n", csig->rev);
> +       return snprintf(buf, len, "patch_level=0x%x", csig->rev);
>  }

ack.



-- Dmitry

  reply	other threads:[~2009-11-07 12:22 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-02 20:08 dimm
2009-11-04 12:27 ` Ingo Molnar
2009-11-05 15:37 ` Andreas Herrmann
2009-11-05 18:40   ` Dmitry Adamushko
2009-11-06 12:34     ` Andreas Herrmann
2009-11-06 12:56       ` Dmitry Adamushko
2009-11-06 19:46         ` Andreas Herrmann
2009-11-07 12:22           ` Dmitry Adamushko [this message]
2009-11-11 16:07             ` Dmitry Adamushko
2009-11-11 19:38               ` Andreas Herrmann
2009-11-12 11:33                 ` Ingo Molnar
2009-11-12 11:54                   ` Dmitry Adamushko
2009-11-12 12:06                     ` Dmitry Adamushko
2009-11-12 15:20                       ` Andreas Herrmann
2009-11-12 15:48                         ` Dmitry Adamushko
2009-11-12 17:09                           ` Borislav Petkov
2009-11-17  7:06                   ` [PATCH] x86, ucode-amd: Move family check to microcde_amd.c's init function Andreas Herrmann
2009-11-17  9:24                     ` [tip:x86/microcode] x86: " tip-bot for Andreas Herrmann

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=b647ffbd0911070422g154c63bbo2fec62ba63c3c106@mail.gmail.com \
    --to=dmitry.adamushko@gmail.com \
    --cc=andi@lisas.de \
    --cc=borislav.petkov@amd.com \
    --cc=herrmann.der.user@googlemail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=steiner@sgi.com \
    --cc=tglx@linutronix.de \
    --cc=tigran@aivazian.fsnet.co.uk \
    --cc=travis@sgi.com \
    /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

all inboxes | Powered by JetHome®