From: tip-bot for Thomas Gleixner <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: jiang.liu@linux.intel.com, hpa@zytor.com, joro@8bytes.org,
mingo@kernel.org, bp@alien8.de, tglx@linutronix.de,
tony.luck@intel.com, linux-kernel@vger.kernel.org
Subject: [tip:x86/apic] x86/apic: Move apic_init_uniprocessor code
Date: Thu, 22 Jan 2015 06:30:29 -0800 [thread overview]
Message-ID: <tip-e714a91f92ca59f7e71e7332b8ec2aa2944f629e@git.kernel.org> (raw)
In-Reply-To: <20150115211703.731329006@linutronix.de>
Commit-ID: e714a91f92ca59f7e71e7332b8ec2aa2944f629e
Gitweb: http://git.kernel.org/tip/e714a91f92ca59f7e71e7332b8ec2aa2944f629e
Author: Thomas Gleixner <tglx@linutronix.de>
AuthorDate: Thu, 15 Jan 2015 21:22:37 +0000
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 22 Jan 2015 15:10:56 +0100
x86/apic: Move apic_init_uniprocessor code
Move the code to a different place so we can make other functions
inline. Preparatory patch for further cleanups. No change.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Borislav Petkov <bp@alien8.de>
Cc: Jiang Liu <jiang.liu@linux.intel.com>
Cc: Joerg Roedel <joro@8bytes.org>
Cc: Tony Luck <tony.luck@intel.com>
Link: http://lkml.kernel.org/r/20150115211703.731329006@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
arch/x86/kernel/apic/apic.c | 125 ++++++++++++++++++++++----------------------
1 file changed, 62 insertions(+), 63 deletions(-)
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 3b4bdd5..c681e9b 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -1852,71 +1852,8 @@ void __init register_lapic_address(unsigned long address)
}
}
-/*
- * This initializes the IO-APIC and APIC hardware if this is
- * a UP kernel.
- */
int apic_version[MAX_LOCAL_APIC];
-int __init APIC_init_uniprocessor(void)
-{
- if (disable_apic) {
- pr_info("Apic disabled\n");
- return -1;
- }
-#ifdef CONFIG_X86_64
- if (!cpu_has_apic) {
- disable_apic = 1;
- pr_info("Apic disabled by BIOS\n");
- return -1;
- }
-#else
- if (!smp_found_config && !cpu_has_apic)
- return -1;
-
- /*
- * Complain if the BIOS pretends there is one.
- */
- if (!cpu_has_apic &&
- APIC_INTEGRATED(apic_version[boot_cpu_physical_apicid])) {
- pr_err("BIOS bug, local APIC 0x%x not detected!...\n",
- boot_cpu_physical_apicid);
- return -1;
- }
-#endif
-
- default_setup_apic_routing();
-
- verify_local_APIC();
- connect_bsp_APIC();
-
-#ifdef CONFIG_X86_64
- apic_write(APIC_ID, SET_APIC_ID(boot_cpu_physical_apicid));
-#else
- /*
- * Hack: In case of kdump, after a crash, kernel might be booting
- * on a cpu with non-zero lapic id. But boot_cpu_physical_apicid
- * might be zero if read from MP tables. Get it from LAPIC.
- */
-# ifdef CONFIG_CRASH_DUMP
- boot_cpu_physical_apicid = read_apic_id();
-# endif
-#endif
- physid_set_mask_of_physid(boot_cpu_physical_apicid, &phys_cpu_present_map);
- setup_local_APIC();
-
- /* Enable IO-APICs before enabling error vector */
- enable_IO_APIC();
-
- bsp_end_local_APIC_setup();
-
- if (smp_found_config)
- setup_IO_APIC();
-
- x86_init.timers.setup_percpu_clockev();
- return 0;
-}
-
/*
* Local APIC interrupts
*/
@@ -2269,6 +2206,68 @@ void __init apic_set_eoi_write(void (*eoi_write)(u32 reg, u32 v))
}
/*
+ * This initializes the IO-APIC and APIC hardware if this is
+ * a UP kernel.
+ */
+int __init APIC_init_uniprocessor(void)
+{
+ if (disable_apic) {
+ pr_info("Apic disabled\n");
+ return -1;
+ }
+#ifdef CONFIG_X86_64
+ if (!cpu_has_apic) {
+ disable_apic = 1;
+ pr_info("Apic disabled by BIOS\n");
+ return -1;
+ }
+#else
+ if (!smp_found_config && !cpu_has_apic)
+ return -1;
+
+ /*
+ * Complain if the BIOS pretends there is one.
+ */
+ if (!cpu_has_apic &&
+ APIC_INTEGRATED(apic_version[boot_cpu_physical_apicid])) {
+ pr_err("BIOS bug, local APIC 0x%x not detected!...\n",
+ boot_cpu_physical_apicid);
+ return -1;
+ }
+#endif
+
+ default_setup_apic_routing();
+
+ verify_local_APIC();
+ connect_bsp_APIC();
+
+#ifdef CONFIG_X86_64
+ apic_write(APIC_ID, SET_APIC_ID(boot_cpu_physical_apicid));
+#else
+ /*
+ * Hack: In case of kdump, after a crash, kernel might be booting
+ * on a cpu with non-zero lapic id. But boot_cpu_physical_apicid
+ * might be zero if read from MP tables. Get it from LAPIC.
+ */
+# ifdef CONFIG_CRASH_DUMP
+ boot_cpu_physical_apicid = read_apic_id();
+# endif
+#endif
+ physid_set_mask_of_physid(boot_cpu_physical_apicid, &phys_cpu_present_map);
+ setup_local_APIC();
+
+ if (smp_found_config)
+ enable_IO_APIC();
+
+ bsp_end_local_APIC_setup();
+
+ setup_IO_APIC();
+
+ x86_init.timers.setup_percpu_clockev();
+ return 0;
+}
+
+/*
* Power management
*/
#ifdef CONFIG_PM
next prev parent reply other threads:[~2015-01-22 14:31 UTC|newest]
Thread overview: 80+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-15 21:22 [patch 00/23] x86: Cleanup apic/ioapic/x2apic setup code Thomas Gleixner
2015-01-15 21:22 ` [patch 01/23] x86/apic: Avoid open coded x2apic detection Thomas Gleixner
2015-01-16 9:59 ` Borislav Petkov
2015-01-22 11:39 ` Thomas Gleixner
2015-01-23 16:13 ` Thomas Gleixner
2015-01-22 14:24 ` [tip:x86/apic] " tip-bot for Thomas Gleixner
2015-01-15 21:22 ` [patch 02/23] x86/apic: Make x2apic_mode depend on CONFIG_X86_X2APIC Thomas Gleixner
2015-01-16 10:50 ` Borislav Petkov
2015-01-22 14:24 ` [tip:x86/apic] " tip-bot for Thomas Gleixner
2015-01-15 21:22 ` [patch 03/23] x86/apic: Move x2apic code to one place Thomas Gleixner
2015-01-16 10:55 ` Borislav Petkov
2015-01-22 14:25 ` [tip:x86/apic] " tip-bot for Thomas Gleixner
2015-01-15 21:22 ` [patch 04/23] x86/ioapic: Check x2apic really Thomas Gleixner
2015-01-16 11:10 ` Borislav Petkov
2015-01-16 11:15 ` Borislav Petkov
2015-01-22 14:25 ` [tip:x86/apic] " tip-bot for Thomas Gleixner
2015-01-15 21:22 ` [patch 05/23] x86/apic: Make disable x2apic work really Thomas Gleixner
2015-01-16 11:17 ` Borislav Petkov
2015-01-22 14:25 ` [tip:x86/apic] " tip-bot for Thomas Gleixner
2015-01-15 21:22 ` [patch 06/23] x86/apic: Check x2apic early Thomas Gleixner
2015-01-16 8:07 ` Jiang Liu
2015-01-22 14:26 ` [tip:x86/apic] " tip-bot for Thomas Gleixner
2015-01-15 21:22 ` [patch 07/23] x86/x2apic: Move code in conditional region Thomas Gleixner
2015-01-16 11:56 ` Borislav Petkov
2015-01-22 14:26 ` [tip:x86/apic] " tip-bot for Thomas Gleixner
2015-01-15 21:22 ` [patch 08/23] x86/x2apic: Clarify remapping mode for x2apic enablement Thomas Gleixner
2015-01-16 14:19 ` Borislav Petkov
2015-01-22 14:26 ` [tip:x86/apic] " tip-bot for Thomas Gleixner
2015-01-15 21:22 ` [patch 09/23] x86/x2apic: Add proper state tracking Thomas Gleixner
2015-01-16 18:58 ` Borislav Petkov
2015-01-22 14:27 ` [tip:x86/apic] " tip-bot for Thomas Gleixner
2015-01-15 21:22 ` [patch 10/23] x86/x2apic: Disable x2apic from nox2apic setup Thomas Gleixner
2015-01-16 19:01 ` Borislav Petkov
2015-01-22 14:27 ` [tip:x86/apic] " tip-bot for Thomas Gleixner
2015-01-15 21:22 ` [patch 11/23] x86/x2apic: Split enable and setup function Thomas Gleixner
2015-01-16 19:00 ` Borislav Petkov
2015-01-22 13:08 ` Thomas Gleixner
2015-01-22 14:28 ` [tip:x86/apic] " tip-bot for Thomas Gleixner
2015-01-15 21:22 ` [patch 12/23] x86/x2apic: Use state information for disable Thomas Gleixner
2015-01-16 19:01 ` Borislav Petkov
2015-01-22 14:28 ` [tip:x86/apic] " tip-bot for Thomas Gleixner
2015-01-15 21:22 ` [patch 13/23] x86/smpboot: Move smpboot inlines to code Thomas Gleixner
2015-01-16 19:01 ` Borislav Petkov
2015-01-22 14:28 ` [tip:x86/apic] " tip-bot for Thomas Gleixner
2015-01-15 21:22 ` [patch 14/23] x86/ioapic: Provide stub functions for IOAPIC=n Thomas Gleixner
2015-01-16 19:02 ` Borislav Petkov
2015-01-22 14:29 ` [tip:x86/apic] x86/ioapic: Provide stub functions for IOAPIC%3Dn tip-bot for Thomas Gleixner
2015-01-15 21:22 ` [patch 15/23] x86/ioapic: Add proper checks to setp/enable_IO_APIC() Thomas Gleixner
2015-01-16 19:02 ` Borislav Petkov
2015-01-22 14:29 ` [tip:x86/apic] x86/ioapic: Add proper checks to setp/ enable_IO_APIC() tip-bot for Thomas Gleixner
2015-01-15 21:22 ` [patch 16/23] x86/apic: Sanitize ioapic handling Thomas Gleixner
2015-01-16 19:02 ` Borislav Petkov
2015-01-22 14:29 ` [tip:x86/apic] " tip-bot for Thomas Gleixner
2015-01-15 21:22 ` [patch 17/23] x86/smpboot: Cleanup " Thomas Gleixner
2015-01-16 19:03 ` Borislav Petkov
2015-01-22 14:30 ` [tip:x86/apic] " tip-bot for Thomas Gleixner
2015-01-15 21:22 ` [patch 18/23] x86/apic: Move apic_init_uniprocessor code Thomas Gleixner
2015-01-16 19:03 ` Borislav Petkov
2015-01-22 14:30 ` tip-bot for Thomas Gleixner [this message]
2015-01-15 21:22 ` [patch 19/23] init: Get rid of x86isms Thomas Gleixner
2015-01-22 14:30 ` [tip:x86/apic] " tip-bot for Thomas Gleixner
2015-01-15 21:22 ` [patch 20/23] x86/smpboot: Move apic init code to apic.c Thomas Gleixner
2015-01-16 19:04 ` Borislav Petkov
2015-01-22 14:31 ` [tip:x86/apic] " tip-bot for Thomas Gleixner
2015-01-15 21:22 ` [patch 21/23] x86/smpboot: Sanitize uniprocessor init Thomas Gleixner
2015-01-16 19:04 ` Borislav Petkov
2015-01-22 14:31 ` [tip:x86/apic] " tip-bot for Thomas Gleixner
2015-01-15 21:22 ` [patch 22/23] x86/apic: Reuse apic_bsp_setup() for UP APIC setup Thomas Gleixner
2015-01-16 19:04 ` Borislav Petkov
2015-01-22 14:31 ` [tip:x86/apic] " tip-bot for Thomas Gleixner
2015-01-15 21:22 ` [patch 23/23] x86: Consolidate boot cpu timer setup Thomas Gleixner
2015-01-16 19:04 ` Borislav Petkov
2015-01-22 14:32 ` [tip:x86/apic] " tip-bot for Thomas Gleixner
2015-01-16 9:37 ` [patch 00/23] x86: Cleanup apic/ioapic/x2apic setup code Jiang Liu
2015-01-16 10:21 ` Thomas Gleixner
2015-01-16 10:35 ` Jiang Liu
2015-01-16 11:05 ` Thomas Gleixner
2015-01-16 19:03 ` Borislav Petkov
2015-01-21 1:50 ` Jiang Liu
2015-01-21 9:33 ` Thomas Gleixner
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=tip-e714a91f92ca59f7e71e7332b8ec2aa2944f629e@git.kernel.org \
--to=tipbot@zytor.com \
--cc=bp@alien8.de \
--cc=hpa@zytor.com \
--cc=jiang.liu@linux.intel.com \
--cc=joro@8bytes.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=tglx@linutronix.de \
--cc=tony.luck@intel.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;
as well as URLs for NNTP newsgroup(s).