Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1638835 > unrolled thread
| Started by | Dou Liyang <douly.fnst@cn.fujitsu.com> |
|---|---|
| First post | 2017-05-10 15:50 +0200 |
| Last post | 2017-05-11 13:00 +0200 |
| Articles | 2 — 1 participant |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[RFC PATCH v3 10/12] x86/apic: Make the interrupt mode setup earlier for UP system Dou Liyang <douly.fnst@cn.fujitsu.com> - 2017-05-10 15:50 +0200
[RFC PATCH v4 10/12] x86/apic: Make the interrupt mode setup earlier for UP system Dou Liyang <douly.fnst@cn.fujitsu.com> - 2017-05-11 13:00 +0200
| From | Dou Liyang <douly.fnst@cn.fujitsu.com> |
|---|---|
| Date | 2017-05-10 15:50 +0200 |
| Subject | [RFC PATCH v3 10/12] x86/apic: Make the interrupt mode setup earlier for UP system |
| Message-ID | <tFAa6-1mz-7@gated-at.bofh.it> |
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, system should not make sure the timer IRQs work well for
calibrating delay in dump-capture kernel.
Due to the MP table or ACPI has been read earlier, setup the interrupt
mode as soon as possible, and make the system run in the final mode to
avoid the compatibility issues.
Core patch for UP kernel and remove the original setup code.
Signed-off-by: Dou Liyang <douly.fnst@cn.fujitsu.com>
---
v2 --> v3:
remove the APIC_init_uniprocessor()
arch/x86/include/asm/apic.h | 1 -
arch/x86/kernel/apic/apic.c | 49 ++++++---------------------------------------
2 files changed, 6 insertions(+), 44 deletions(-)
diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
index 13f46e3..78a0c74 100644
--- a/arch/x86/include/asm/apic.h
+++ b/arch/x86/include/asm/apic.h
@@ -135,7 +135,6 @@ void register_lapic_address(unsigned long address);
extern void setup_boot_APIC_clock(void);
extern void setup_secondary_APIC_clock(void);
extern void lapic_update_tsc_freq(void);
-extern int APIC_init_uniprocessor(void);
#ifdef CONFIG_X86_64
static inline int apic_force_enable(unsigned long addr)
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index b09650d..5fe98b9 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -1233,9 +1233,12 @@ static int __init apic_interrupt_mode_select(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;
+
}
/*
@@ -2382,51 +2385,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
[toc] | [next] | [standalone]
| From | Dou Liyang <douly.fnst@cn.fujitsu.com> |
|---|---|
| Date | 2017-05-11 13:00 +0200 |
| Subject | [RFC PATCH v4 10/12] x86/apic: Make the interrupt mode setup earlier for UP system |
| Message-ID | <tFTZ7-5i3-1@gated-at.bofh.it> |
| In reply to | #1638835 |
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, system should not make sure the timer IRQs work well for
calibrating delay in dump-capture kernel.
Due to the MP table or ACPI has been read earlier, setup the interrupt
mode as soon as possible, and make the system run in the final mode to
avoid the compatibility issues.
Core patch for UP kernel and remove the original setup code.
Signed-off-by: Dou Liyang <douly.fnst@cn.fujitsu.com>
---
V3 --> V4:
- Setup upmode earlier for UP system.
- Check interrupt mode before per cpu clock event setup.
arch/x86/include/asm/apic.h | 1 -
arch/x86/kernel/apic/apic.c | 49 ++++++++-------------------------------------
2 files changed, 8 insertions(+), 42 deletions(-)
diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
index 13f46e3..78a0c74 100644
--- a/arch/x86/include/asm/apic.h
+++ b/arch/x86/include/asm/apic.h
@@ -135,7 +135,6 @@ void register_lapic_address(unsigned long address);
extern void setup_boot_APIC_clock(void);
extern void setup_secondary_APIC_clock(void);
extern void lapic_update_tsc_freq(void);
-extern int APIC_init_uniprocessor(void);
#ifdef CONFIG_X86_64
static inline int apic_force_enable(unsigned long addr)
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index b09650d..304b050 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -1205,6 +1205,10 @@ static int __init apic_interrupt_mode_select(int *upmode)
}
#endif
+#ifdef CONFIG_UP_LATE_INIT
+ *upmode = true;
+#endif
+
/* Check MP table or ACPI MADT configuration */
if (!smp_found_config) {
disable_ioapic_support();
@@ -2382,51 +2386,14 @@ 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)
+#ifdef CONFIG_UP_LATE_INIT
+void __init up_late_init(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();
+ if (apic_interrupt_mode == APIC_PIC)
+ return;
- 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();
}
#endif
--
2.5.5
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web