All of lore.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Thomas Gleixner <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: tglx@linutronix.de, mingo@kernel.org, hpa@zytor.com,
	linux-kernel@vger.kernel.org, jiang.liu@linux.intel.com,
	joro@8bytes.org, tony.luck@intel.com, bp@alien8.de
Subject: [tip:x86/apic] x86/smpboot: Cleanup ioapic handling
Date: Thu, 22 Jan 2015 06:30:07 -0800	[thread overview]
Message-ID: <tip-ef4c59a4b64c62f977187cae444aee25bebb02fe@git.kernel.org> (raw)
In-Reply-To: <20150115211703.650280684@linutronix.de>

Commit-ID:  ef4c59a4b64c62f977187cae444aee25bebb02fe
Gitweb:     http://git.kernel.org/tip/ef4c59a4b64c62f977187cae444aee25bebb02fe
Author:     Thomas Gleixner <tglx@linutronix.de>
AuthorDate: Thu, 15 Jan 2015 21:22:35 +0000
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 22 Jan 2015 15:10:56 +0100

x86/smpboot: Cleanup ioapic handling

smpboot is very creative with the ways to disable ioapic.

smpboot_clear_io_apic() smpboot_clear_io_apic_irqs() and
disable_ioapic_support() serve a similar purpose.

smpboot_clear_io_apic_irqs() is the most useless of all
functions as it clears a variable which has not been setup yet.

Aside of that it has the same ifdef mess and conditionals around the
ioapic related code, which can now be removed.

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.650280684@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 arch/x86/kernel/smpboot.c | 47 +++++++----------------------------------------
 1 file changed, 7 insertions(+), 40 deletions(-)

diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 110ed11..ca7f7b6 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -103,13 +103,6 @@ EXPORT_PER_CPU_SYMBOL(cpu_info);
 
 atomic_t init_deasserted;
 
-static inline void smpboot_clear_io_apic_irqs(void)
-{
-#ifdef CONFIG_X86_IO_APIC
-	io_apic_irqs = 0;
-#endif
-}
-
 static inline void smpboot_setup_warm_reset_vector(unsigned long start_eip)
 {
 	unsigned long flags;
@@ -147,27 +140,6 @@ static inline void smpboot_restore_warm_reset_vector(void)
 	*((volatile u32 *)phys_to_virt(TRAMPOLINE_PHYS_LOW)) = 0;
 }
 
-static inline void __init smpboot_setup_io_apic(void)
-{
-#ifdef CONFIG_X86_IO_APIC
-	/*
-	 * Here we can be sure that there is an IO-APIC in the system. Let's
-	 * go and set it up:
-	 */
-	if (!skip_ioapic_setup && nr_ioapics)
-		setup_IO_APIC();
-	else
-		nr_ioapics = 0;
-#endif
-}
-
-static inline void smpboot_clear_io_apic(void)
-{
-#ifdef CONFIG_X86_IO_APIC
-	nr_ioapics = 0;
-#endif
-}
-
 /*
  * Report back to the Boot Processor during boot time or to the caller processor
  * during CPU online.
@@ -1019,9 +991,10 @@ void arch_disable_smp_support(void)
  */
 static __init void disable_smp(void)
 {
+	disable_ioapic_support();
+
 	init_cpu_present(cpumask_of(0));
 	init_cpu_possible(cpumask_of(0));
-	smpboot_clear_io_apic_irqs();
 
 	if (smp_found_config)
 		physid_set_mask_of_physid(boot_cpu_physical_apicid, &phys_cpu_present_map);
@@ -1105,7 +1078,6 @@ static int __init smp_sanity_check(unsigned max_cpus)
 				boot_cpu_physical_apicid);
 			pr_err("... forcing use of dummy APIC emulation (tell your hw vendor)\n");
 		}
-		smpboot_clear_io_apic();
 		disable_ioapic_support();
 		return -1;
 	}
@@ -1117,7 +1089,7 @@ static int __init smp_sanity_check(unsigned max_cpus)
 	 */
 	if (!max_cpus) {
 		pr_info("SMP mode deactivated\n");
-		smpboot_clear_io_apic();
+		disable_ioapic_support();
 
 		connect_bsp_APIC();
 		setup_local_APIC();
@@ -1191,18 +1163,15 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus)
 	else
 		cpu0_logical_apicid = GET_APIC_LOGICAL_ID(apic_read(APIC_LDR));
 
-	/*
-	 * Enable IO APIC before setting up error vector
-	 */
-	if (!skip_ioapic_setup && nr_ioapics)
-		enable_IO_APIC();
+	/* Enable IO APIC before setting up error vector */
+	enable_IO_APIC();
 
 	bsp_end_local_APIC_setup();
-	smpboot_setup_io_apic();
+	setup_IO_APIC();
+
 	/*
 	 * Set up local APIC timer on boot CPU.
 	 */
-
 	pr_info("CPU%d: ", 0);
 	print_cpu_info(&cpu_data(0));
 	x86_init.timers.setup_percpu_clockev();
@@ -1241,9 +1210,7 @@ void __init native_smp_cpus_done(unsigned int max_cpus)
 
 	nmi_selftest();
 	impress_friends();
-#ifdef CONFIG_X86_IO_APIC
 	setup_ioapic_dest();
-#endif
 	mtrr_aps_init();
 }
 

  parent reply	other threads:[~2015-01-22 14:30 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-bot for Thomas Gleixner [this message]
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:x86/apic] " tip-bot for Thomas Gleixner
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-ef4c59a4b64c62f977187cae444aee25bebb02fe@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.