Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1625961

[RFC PATCH v2 10/12] x86/apic: Make the interrupt mode setup earlier for UP system

From Dou Liyang <douly.fnst@cn.fujitsu.com>
Newsgroups linux.kernel
Subject [RFC PATCH v2 10/12] x86/apic: Make the interrupt mode setup earlier for UP system
Date 2017-04-19 11:10 +0200
Message-ID <txTMD-1zl-51@gated-at.bofh.it> (permalink)
References <txTMB-1zl-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


In UniProcessor kernel with UP_LATE_INIT=y, enable and setup the
interrupt delivery mode in smp_init() which almost be called at the
end of start_kernel().

But, calibrate delay needs the timer interrupt which may be disabled
in dump-capture kernel.

Due to the MP table or ACPI has been read earlier, setup the interrupt
mode as soon as possible to cleanup the disabled situation for UP
kernel and remove the original setup code.

Signed-off-by: Dou Liyang <douly.fnst@cn.fujitsu.com>
---
 arch/x86/kernel/apic/apic.c | 49 ++++++---------------------------------------
 1 file changed, 6 insertions(+), 43 deletions(-)

diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index a915f09..5d27a24 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -1224,9 +1224,12 @@ static int __init apic_bsp_mode_check(int *upmode)
 		pr_info("SMP mode deactivated\n");
 		return APIC_SYMMETRIC_IO_NO_ROUTING;
 	}
+#else
+	/* UP_LATE_INIT is true */
+	*upmode = true;
 #endif
-
 	return APIC_SYMMETRIC_IO;
+
 }
 
 /*
@@ -2375,51 +2378,11 @@ void __init apic_bsp_setup(bool upmode)
 	setup_IO_APIC();
 }
 
-/*
- * 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 (!boot_cpu_has(X86_FEATURE_APIC)) {
-		disable_apic = 1;
-		pr_info("Apic disabled by BIOS\n");
-		return -1;
-	}
-#else
-	if (!smp_found_config && !boot_cpu_has(X86_FEATURE_APIC))
-		return -1;
-
-	/*
-	 * Complain if the BIOS pretends there is one.
-	 */
-	if (!boot_cpu_has(X86_FEATURE_APIC) &&
-	    APIC_INTEGRATED(boot_cpu_apic_version)) {
-		pr_err("BIOS bug, local APIC 0x%x not detected!...\n",
-			boot_cpu_physical_apicid);
-		return -1;
-	}
-#endif
-
-	if (!smp_found_config)
-		disable_ioapic_support();
-
-	default_setup_apic_routing();
-	apic_bsp_setup(true);
-	/* Setup local timer */
-	x86_init.timers.setup_percpu_clockev();
-	return 0;
-}
-
 #ifdef CONFIG_UP_LATE_INIT
 void __init up_late_init(void)
 {
-	APIC_init_uniprocessor();
+	/* Setup local APIC timer */
+	x86_init.timers.setup_percpu_clockev();
 }
 #endif
 
-- 
2.5.5

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC PATCH v2 00/12] Unify interrupt mode and setup it as soon as possible Dou Liyang <douly.fnst@cn.fujitsu.com> - 2017-04-19 11:10 +0200
  [RFC PATCH v2 05/12] x86/ioapic: Refactor the delay logic in timer_irq_works() Dou Liyang <douly.fnst@cn.fujitsu.com> - 2017-04-19 11:10 +0200
  [RFC PATCH v2 02/12] x86/apic: Construct a selector for the interrupt delivery mode Dou Liyang <douly.fnst@cn.fujitsu.com> - 2017-04-19 11:10 +0200
  [RFC PATCH v2 10/12] x86/apic: Make the interrupt mode setup earlier for UP system Dou Liyang <douly.fnst@cn.fujitsu.com> - 2017-04-19 11:10 +0200
  [RFC PATCH v2 07/12] x86/apic: Move the logical APIC ID setup from apic_bsp_setup() Dou Liyang <douly.fnst@cn.fujitsu.com> - 2017-04-19 11:10 +0200
  [RFC PATCH v2 12/12] x86/apic: Remove the apic_virtual_wire_mode_setup() Dou Liyang <douly.fnst@cn.fujitsu.com> - 2017-04-19 11:10 +0200
  [RFC PATCH v2 11/12] x86/apic: Mark the apic_interrupt_mode extern for refining code Dou Liyang <douly.fnst@cn.fujitsu.com> - 2017-04-19 11:10 +0200

csiph-web