From: Jacob Shin <jacob.shin@amd.com>
To: Yinghai Lu <yinghai@kernel.org>
Cc: Ingo Molnar <mingo@kernel.org>, "H. Peter Anvin" <hpa@zytor.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Borislav Petkov <bp@alien8.de>,
Thomas Gleixner <tglx@linutronix.de>,
"H. Peter Anvin" <hpa@linux.intel.com>,
"linux-tip-commits@vger.kernel.org"
<linux-tip-commits@vger.kernel.org>
Subject: Re: [tip:x86/microcode] x86, microcode, amd: Fix warnings and errors on with CONFIG_MICROCODE=m
Date: Tue, 4 Jun 2013 16:55:21 -0500 [thread overview]
Message-ID: <20130604215521.GA5819@jshin-Toonie> (raw)
In-Reply-To: <20130604213600.GA5021@jshin-Toonie>
On Tue, Jun 04, 2013 at 04:36:00PM -0500, Jacob Shin wrote:
> On Tue, Jun 04, 2013 at 02:02:43PM -0700, Yinghai Lu wrote:
> > On Fri, May 31, 2013 at 2:59 PM, tip-bot for Jacob Shin
> > <tipbot@zytor.com> wrote:
> > > Commit-ID: 6b3389ac21b5e557b957f1497d0ff22bf733e8c3
> > > Gitweb: http://git.kernel.org/tip/6b3389ac21b5e557b957f1497d0ff22bf733e8c3
> > > Author: Jacob Shin <jacob.shin@amd.com>
> > > AuthorDate: Fri, 31 May 2013 01:53:24 -0500
> > > Committer: H. Peter Anvin <hpa@linux.intel.com>
> > > CommitDate: Fri, 31 May 2013 13:56:58 -0700
> > >
> > > x86, microcode, amd: Fix warnings and errors on with CONFIG_MICROCODE=m
> > >
> > > Fix section mismatch warnings on microcode_amd_early.
> > > Compile error occurs when CONFIG_MICROCODE=m, change so that early
> > > loading depends on microcode_core.
> > >
> > > Reported-by: Yinghai Lu <yinghai@kernel.org>
> > > Reported-by: Borislav Petkov <bp@alien8.de>
> > > Signed-off-by: Jacob Shin <jacob.shin@amd.com>
> > > Link: http://lkml.kernel.org/r/20130531150241.GA12006@jshin-Toonie
> > > Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
> > > ---
> > > arch/x86/Kconfig | 2 +-
> > > arch/x86/include/asm/microcode_amd.h | 2 +-
> > > arch/x86/kernel/microcode_amd_early.c | 8 ++++----
> > > 3 files changed, 6 insertions(+), 6 deletions(-)
> > >
> > > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> > > index 28dba52..2705532 100644
> > > --- a/arch/x86/Kconfig
> > > +++ b/arch/x86/Kconfig
> > > @@ -1065,7 +1065,7 @@ config MICROCODE_AMD_EARLY
> > >
> > > config MICROCODE_EARLY
> > > bool "Early load microcode"
> > > - depends on (MICROCODE_INTEL || MICROCODE_AMD) && BLK_DEV_INITRD
> > > + depends on MICROCODE=y && BLK_DEV_INITRD
> > > select MICROCODE_INTEL_EARLY if MICROCODE_INTEL
> > > select MICROCODE_AMD_EARLY if MICROCODE_AMD
> > > default y
> > > diff --git a/arch/x86/include/asm/microcode_amd.h b/arch/x86/include/asm/microcode_amd.h
> > > index 24254aa..c6b043f 100644
> > > --- a/arch/x86/include/asm/microcode_amd.h
> > > +++ b/arch/x86/include/asm/microcode_amd.h
> > > @@ -64,7 +64,7 @@ extern enum ucode_state load_microcode_amd(int cpu, const u8 *data, size_t size)
> > > #ifdef CONFIG_MICROCODE_AMD_EARLY
> > > #ifdef CONFIG_X86_32
> > > #define MPB_MAX_SIZE PAGE_SIZE
> > > -extern u8 __cpuinitdata amd_bsp_mpb[MPB_MAX_SIZE];
> > > +extern u8 amd_bsp_mpb[MPB_MAX_SIZE];
> > > #endif
> > > extern void __init load_ucode_amd_bsp(void);
> > > extern void __cpuinit load_ucode_amd_ap(void);
> > > diff --git a/arch/x86/kernel/microcode_amd_early.c b/arch/x86/kernel/microcode_amd_early.c
> > > index 7e54d97..9618805 100644
> > > --- a/arch/x86/kernel/microcode_amd_early.c
> > > +++ b/arch/x86/kernel/microcode_amd_early.c
> > > @@ -21,9 +21,9 @@ static u32 ucode_new_rev;
> > > * Microcode patch container file is prepended to the initrd in cpio format.
> > > * See Documentation/x86/early-microcode.txt
> > > */
> > > -static __initdata char ucode_path[] = "kernel/x86/microcode/AuthenticAMD.bin";
> > > +static __cpuinitdata char ucode_path[] = "kernel/x86/microcode/AuthenticAMD.bin";
> > >
> > > -static struct cpio_data __init find_ucode_in_initrd(void)
> > > +static struct cpio_data __cpuinit find_ucode_in_initrd(void)
> > > {
> > > long offset = 0;
> > > struct cpio_data cd;
> >
> > does not like right fix.
> >
> > find_ucode_in_initrd should be __init.
> >
> > > @@ -62,7 +62,7 @@ static struct cpio_data __init find_ucode_in_initrd(void)
> > > * load_microcode_amd() to save equivalent cpu table and microcode patches in
> > > * kernel heap memory.
> > > */
> > > -static void __init apply_ucode_in_initrd(void)
> > > +static void __cpuinit apply_ucode_in_initrd(void)
> > > {
> > > struct cpio_data cd;
> > > struct equiv_cpu_entry *eq;
> >
> > it should not call find_ucode_in_initrd or
> > it should be __init.
>
> It's because the load_ucode_amd_ap() (which is __cpuinit because it
> can be called during CPU hotplug on).
Sorry, let me clarify. find_ucode_in_initrd() is called by
load_ucode_amd_ap() during cold boot. However, since
load_ucode_amd_ap() is also called during suspend/resume (CPU hotplug)
it has to be __cpuinit. Of course during suspend/resume code path,
find_ucode_in_initrd() is not called, since it is no longer there in memory.
>
> Hm.. but yes, I do agree with you, I'm waiting for feedback on this
> follow up patch to allow multiple concatanated microcode files:
>
> https://lkml.org/lkml/2013/5/31/664
>
> I'll submit multi-patch patchset to address your feedback as well.
>
> Thank you,
next prev parent reply other threads:[~2013-06-04 21:55 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-30 19:09 [PATCH V3 0/4] x86/microcode: early microcode patch loading support on AMD Jacob Shin
2013-05-30 19:09 ` [PATCH V3 1/4] x86, microcode, intel: Correct typo in printk Jacob Shin
2013-05-31 3:26 ` [tip:x86/microcode] " tip-bot for Borislav Petkov
2013-05-30 19:09 ` [PATCH V3 2/4] x86/microcode: vendor abstract out save_microcode_in_initrd() Jacob Shin
2013-05-31 3:27 ` [tip:x86/microcode] x86, microcode: Vendor " tip-bot for Jacob Shin
2013-05-30 19:09 ` [PATCH V3 3/4] x86/microcode/amd: refactor functions to prepare for early loading Jacob Shin
2013-05-31 3:29 ` [tip:x86/microcode] x86, microcode, amd: Refactor " tip-bot for Jacob Shin
2013-05-30 19:09 ` [PATCH V3 4/4] microcode/x86/amd: early microcode patch loading support for AMD Jacob Shin
2013-05-31 3:31 ` [tip:x86/microcode] x86, microcode, amd: Early " tip-bot for Jacob Shin
2013-05-31 6:10 ` Yinghai Lu
2013-05-31 6:59 ` Jacob Shin
2013-05-31 8:41 ` Borislav Petkov
2013-05-31 15:02 ` Jacob Shin
2013-05-31 15:13 ` H. Peter Anvin
2013-05-31 15:17 ` Jacob Shin
2013-05-31 21:59 ` [tip:x86/microcode] x86, microcode, amd: Fix warnings and errors on with CONFIG_MICROCODE=m tip-bot for Jacob Shin
2013-06-01 9:30 ` Borislav Petkov
2013-06-04 21:02 ` Yinghai Lu
2013-06-04 21:36 ` Jacob Shin
2013-06-04 21:55 ` Jacob Shin [this message]
2013-06-04 22:05 ` Yinghai Lu
2013-05-31 4:26 ` [PATCH V3 4/4] microcode/x86/amd: early microcode patch loading support for AMD Henrique de Moraes Holschuh
2013-05-31 15:54 ` Jacob Shin
2013-05-31 19:32 ` Andreas Herrmann
2013-05-31 21:30 ` Henrique de Moraes Holschuh
2013-06-01 1:15 ` Jacob Shin
2013-06-05 22:10 ` Borislav Petkov
2013-06-06 20:06 ` 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=20130604215521.GA5819@jshin-Toonie \
--to=jacob.shin@amd.com \
--cc=bp@alien8.de \
--cc=hpa@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=tglx@linutronix.de \
--cc=yinghai@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®