mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Jacob Shin <jacob.shin@amd.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>, Ingo Molnar <mingo@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	x86@kernel.org, Fenghua Yu <fenghua.yu@intel.com>,
	Andreas Herrmann <herrmann.der.user@googlemail.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH V2 3/3] x86/microcode: early microcode patch loading support on AMD
Date: Wed, 29 May 2013 13:06:43 +0200	[thread overview]
Message-ID: <20130529110643.GB16556@pd.tnic> (raw)
In-Reply-To: <20130528234307.GA20622@jshin-Toonie>

On Tue, May 28, 2013 at 06:43:07PM -0500, Jacob Shin wrote:
> > Anyway, this whole Kconfig microcode section could use a simplification
> > but this is not the subject of this patchset - I'll try to address it
> > after this, as stated in another mail.
> 
> Yes, I'll simplify the Kconfig as you suggested in your ealier email.

You don't necessarily have to - as I explained in the other mail,
distros end up enabling both anyway so we probably don't need the vendor
split. Instead, simply having microcode loading and early microcode
loading functionality seems like enough to me.

But this is another conversation so you don't have to address it now.

> > At least I can't seem to trigger any build failures when I comment them
> > out.
> 
> Hm.. I couldn't build without it at some point, I'll take them out but they
> might be indrectly included anyways.

Yes, let's leave them out. I'll run randconfig builds when your patches
are ready and we'll see.

...

> > Why do we even need this? Hotplug should take care of reappying
> > microcode on all cores.
> 
> It is needed because otherwise BSP does not reapply microcode on resume, see
> microcode_core.c BSP resume code path.

Ah, we don't hotplug the BSP, sure - I was looking at the the
mc_cpu_notifier...

...

> > Right, come to think of it, we don't use this uci->mc thing anywhere
> > except in mc_bp_resume. But even there, we call ->apply_microcode()
> > which on AMD searches the patch in the patch cache so no need for this
> > assignment at all.
> 
> Right, but at least we need a non-zero value, I can stick "1" in there I guess.
> Whatever you prefer.

That's for the BSP, right? Yeah, ok, then please just leave it like it
is but add a nice comment why we're doing it.

...


> > This comment needs a bit of scrubbing, spell- and readability check.
> > 
> > And it says we cannot traverse the pcache and yet we traverse it with
> > find_patch().
> > 
> > ???
> 
> What I meant was that we can traverse it now, but on 32 bits, later when we
> go into suspend and resume, we since we load before paging is turned on, we
> cannot traverse through equiv_cpu_table and pcache.

Ok, I get it now.

...

> BSP cannot vmalloc() for both 32 and 64 bits, so we cannot "install"
> equiv_cpu_table, also cannot create pcache yet.

But we can use the one in the initrd, extract the information and save
it locally like you do with the bsp_mpb. Then, when later another
microcode blob gets loaded, we simply not use the initial one.

I don't know whether that is a more favourable approach, though - I'm
just conjecturing here.

> On 32 bits, APs cannot vmalloc(), so we take the same code path as the BSPs
> loading from initrd memory, and not installing equiv_cpu_table and not creating
> pcache.

... which sounds to me like this functionality needs to be extracted in
a function callable by BSP and AP path.

> Okay I'll just rewrite the the whole thing tomorrow,
>
> I'll separate out the early stuff by itself into microcode_amd_early.c
>
> And try and word the comments clearer.

Thanks.

-- 
Regards/Gruss,
    Boris.

Sent from a fat crate under my desk. Formatting is fine.
--

  reply	other threads:[~2013-05-29 11:06 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-23 15:40 [PATCH V2 0/3] " Jacob Shin
2013-05-23 15:40 ` [PATCH V2 1/3] x86/microcode: vendor abstract out save_microcode_in_initrd() Jacob Shin
2013-05-28 14:28   ` Borislav Petkov
2013-05-23 15:40 ` [PATCH V2 2/3] x86, microcode, intel: Correct typo in printk Jacob Shin
2013-05-23 18:12   ` Joe Perches
2013-05-24  8:43   ` Borislav Petkov
2013-05-24 14:11     ` Jacob Shin
2013-05-23 15:40 ` [PATCH V2 3/3] x86/microcode: early microcode patch loading support on AMD Jacob Shin
2013-05-24 15:33   ` Yu, Fenghua
2013-05-24 19:50     ` Jacob Shin
2013-05-28  8:13   ` Borislav Petkov
2013-05-28 22:45   ` Borislav Petkov
2013-05-28 23:43     ` Jacob Shin
2013-05-29 11:06       ` Borislav Petkov [this message]
2013-05-23 21:01 ` [PATCH V2 0/3] " Yu, Fenghua
2013-05-23 21:23   ` Jacob Shin
2013-05-24  8:29     ` Borislav Petkov
2013-05-24 14:12       ` Jacob Shin

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=20130529110643.GB16556@pd.tnic \
    --to=bp@alien8.de \
    --cc=fenghua.yu@intel.com \
    --cc=herrmann.der.user@googlemail.com \
    --cc=hpa@zytor.com \
    --cc=jacob.shin@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.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

all inboxes | Powered by JetHome®