[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1494582935-22758-1-git-send-email-douly.fnst@cn.fujitsu.com>
Date: Fri, 12 May 2017 17:55:35 +0800
From: Dou Liyang <douly.fnst@...fujitsu.com>
To: <x86@...nel.org>, <linux-kernel@...r.kernel.org>
CC: <tglx@...utronix.de>, <mingo@...nel.org>, <hpa@...or.com>,
<ebiederm@...ssion.com>, <bhe@...hat.com>,
<izumi.taku@...fujitsu.com>, Dou Liyang <douly.fnst@...fujitsu.com>
Subject: [RFC PATCH v4 09/12] x86/apic: Setup interrupt mode earlier in case of no SMP motherboard
Kernel falls back to non SMP mode and sets up interrupt delivery mode
in APIC_init_uniprocessor() in case of no SMP motherboard.
Setting up interrupt delivery mode as soon as possible should wraps
this case for SMP-capable system too.
Wrap this case, make it consistent with SMP-capable systems.
Incidentally,
-Extract apic_bsp_setup() and Refine apic_interrupt_mode_init().
Signed-off-by: Dou Liyang <douly.fnst@...fujitsu.com>
---
Sorry to trouble again, I tested a bug, update the patch to fix it.
V3 --> V4:
- Replace "return" with "break" in case of APIC_SYMMETRIC_IO_NO_ROUTING
V2 --> V3:
- Replace APIC_SYMMETRIC_IO_NO_CONFIG with APIC_VIRTUAL_WIRE_NO_CONFIG
- Do some cleanup.
arch/x86/kernel/apic/apic.c | 25 +++++++++++++++++--------
arch/x86/kernel/smpboot.c | 2 --
2 files changed, 17 insertions(+), 10 deletions(-)
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 941ae1e..1c93c65 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -1160,12 +1160,13 @@ void __init sync_Arb_IDs(void)
enum apic_interrupt_mode {
APIC_PIC = 0,
APIC_VIRTUAL_WIRE,
+ APIC_VIRTUAL_WIRE_NO_CONFIG,
APIC_SYMMETRIC_IO,
APIC_SYMMETRIC_IO_NO_ROUTING,
APIC_MODE_COUNT
};
-static int __init apic_interrupt_mode_select(void)
+static int __init apic_interrupt_mode_select(int *upmode)
{
/* Check kernel option */
if (disable_apic) {
@@ -1208,8 +1209,12 @@ static int __init apic_interrupt_mode_select(void)
if (!smp_found_config) {
disable_ioapic_support();
- if (!acpi_lapic)
+ if (!acpi_lapic) {
pr_info("ACPI MADT or MP table not detected\n");
+ *upmode = true;
+
+ return APIC_VIRTUAL_WIRE_NO_CONFIG;
+ }
return APIC_VIRTUAL_WIRE;
}
@@ -1285,23 +1290,27 @@ void __init apic_virtual_wire_mode_setup(void)
/* Init the interrupt delivery mode for the BSP */
void __init apic_interrupt_mode_init(void)
{
- switch (apic_interrupt_mode_select()) {
+ int upmode = false;
+
+ switch (apic_interrupt_mode_select(&upmode)) {
case APIC_PIC:
pr_info("Keep in PIC mode(8259)\n");
return;
case APIC_VIRTUAL_WIRE:
+ case APIC_VIRTUAL_WIRE_NO_CONFIG:
pr_info("Switch to virtual wire mode\n");
- return;
+ default_setup_apic_routing();
+ break;
case APIC_SYMMETRIC_IO:
pr_info("Switch to symmectic I/O mode\n");
default_setup_apic_routing();
- apic_bsp_setup(false);
- return;
+ break;
case APIC_SYMMETRIC_IO_NO_ROUTING:
pr_info("Switch to symmectic I/O mode with no APIC routing\n");
- apic_bsp_setup(false);
- return;
+ break;
}
+
+ apic_bsp_setup(upmode);
}
static void lapic_setup_esr(void)
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 2101d5c..6e8c39b 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -1324,8 +1324,6 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus)
switch (smp_sanity_check(max_cpus)) {
case SMP_NO_CONFIG:
disable_smp();
- if (APIC_init_uniprocessor())
- pr_notice("Local APIC not detected. Using dummy APIC emulation.\n");
return;
case SMP_NO_APIC:
disable_smp();
--
2.5.5
Powered by blists - more mailing lists