From: Borislav Petkov <bp@amd64.org>
To: "H. Peter Anvin" <hpa@zytor.com>, Ingo Molnar <mingo@elte.hu>,
Thomas Gleixner <tglx@linutronix.de>,
Linus Torvalds <torvalds@linux-foundation.org>,
Andrew Morton <akpm@linux-foundation.org>
Cc: Avi Kivity <avi@redhat.com>,
Andre Przywara <Andre.Przywara@amd.com>,
Martin Pohlack <Martin.Pohlack@amd.com>,
LKML <linux-kernel@vger.kernel.org>,
Borislav Petkov <borislav.petkov@amd.com>
Subject: [PATCH -v3 2/3] x86: Add a BSP cpuinit helper
Date: Thu, 4 Aug 2011 16:58:37 +0200 [thread overview]
Message-ID: <1312469918-6641-3-git-send-email-bp@amd64.org> (raw)
In-Reply-To: <1312469918-6641-1-git-send-email-bp@amd64.org>
From: Borislav Petkov <borislav.petkov@amd.com>
Add a function ptr to struct x86_cpuinit_ops which is destined to be run
only once on the BSP during boot.
Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
---
arch/x86/include/asm/x86_init.h | 1 +
arch/x86/kernel/cpu/common.c | 2 ++
arch/x86/kernel/x86_init.c | 1 +
3 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h
index d3d8590..08994a0 100644
--- a/arch/x86/include/asm/x86_init.h
+++ b/arch/x86/include/asm/x86_init.h
@@ -147,6 +147,7 @@ struct x86_init_ops {
*/
struct x86_cpuinit_ops {
void (*setup_percpu_clockev)(void);
+ void (*run_on_bsp)(void);
};
/**
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 22a073d..465e633 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -681,6 +681,8 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)
filter_cpuid_features(c, false);
setup_smep(c);
+
+ x86_cpuinit.run_on_bsp();
}
void __init early_cpu_init(void)
diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c
index 6f164bd..76b37ed 100644
--- a/arch/x86/kernel/x86_init.c
+++ b/arch/x86/kernel/x86_init.c
@@ -90,6 +90,7 @@ struct x86_init_ops x86_init __initdata = {
struct x86_cpuinit_ops x86_cpuinit __cpuinitdata = {
.setup_percpu_clockev = setup_secondary_APIC_clock,
+ .run_on_bsp = x86_init_noop,
};
static void default_nmi_init(void) { };
--
1.7.4.rc2
next prev parent reply other threads:[~2011-08-04 14:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-04 14:58 [PATCH -v3 0/3] x86, AMD: Correct F15h IC aliasing issue Borislav Petkov
2011-08-04 14:58 ` [PATCH -v3 1/3] " Borislav Petkov
2011-08-04 14:58 ` Borislav Petkov [this message]
2011-08-04 14:58 ` [PATCH -v3 3/3] x86, AMD: Move BSP code to cpuinit helper Borislav Petkov
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=1312469918-6641-3-git-send-email-bp@amd64.org \
--to=bp@amd64.org \
--cc=Andre.Przywara@amd.com \
--cc=Martin.Pohlack@amd.com \
--cc=akpm@linux-foundation.org \
--cc=avi@redhat.com \
--cc=borislav.petkov@amd.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.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
Powered by JetHome