summaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/vsmp_64.c
diff options
context:
space:
mode:
authorIdo Yariv <ido@wizery.com>2012-06-03 00:11:34 +0200
committerIngo Molnar <mingo@kernel.org>2012-06-06 09:06:19 +0200
commit7db971b235480849aa5b9209b67b62e987b3181b (patch)
treedbb69fb414c6de564bbbc079ae8038a4925a78a2 /arch/x86/kernel/vsmp_64.c
parentMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/msz... (diff)
downloadlinux-7db971b235480849aa5b9209b67b62e987b3181b.tar.xz
linux-7db971b235480849aa5b9209b67b62e987b3181b.zip
x86/platform: Introduce APIC post-initialization callback
Some subarchitectures (such as vSMP) need to slightly adjust the underlying APIC structure. Add an APIC post-initialization callback to 'struct x86_platform_ops' for this purpose and use it for adjusting the APIC structure on vSMP systems. Signed-off-by: Ido Yariv <ido@wizery.com> Acked-by: Shai Fultheim <shai@scalemp.com> Link: http://lkml.kernel.org/r/1338675095-27260-1-git-send-email-ido@wizery.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/kernel/vsmp_64.c')
-rw-r--r--arch/x86/kernel/vsmp_64.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/x86/kernel/vsmp_64.c b/arch/x86/kernel/vsmp_64.c
index 8eeb55a551b4..59eea855f451 100644
--- a/arch/x86/kernel/vsmp_64.c
+++ b/arch/x86/kernel/vsmp_64.c
@@ -187,12 +187,25 @@ static void __init vsmp_cap_cpus(void)
#endif
}
+static int apicid_phys_pkg_id(int initial_apic_id, int index_msb)
+{
+ return hard_smp_processor_id() >> index_msb;
+}
+
+static void vsmp_apic_post_init(void)
+{
+ /* need to update phys_pkg_id */
+ apic->phys_pkg_id = apicid_phys_pkg_id;
+}
+
void __init vsmp_init(void)
{
detect_vsmp_box();
if (!is_vsmp_box())
return;
+ x86_platform.apic_post_init = vsmp_apic_post_init;
+
vsmp_cap_cpus();
set_vsmp_pv_ops();