Re: [patch 19/55] genirq: Provide irq_fixup_move_pending()

2017-06-19 Thread Dou Liyang
Hi Thomas, At 06/20/2017 07:37 AM, Thomas Gleixner wrote: [...] +/** + * irq_fixup_move_pending - Cleanup irq move pending from a dying CPU + * @desc: Interrupt descpriptor to clean up + * @force_clear: If set clear the move pending bit unconditionally. + *

[tip:x86/timers] x86/time: Make setup_default_timer_irq() static

2017-06-13 Thread tip-bot for Dou Liyang
Commit-ID: b1b4f2fe68393f80480545b5e67a50f7bda8e9a7 Gitweb: http://git.kernel.org/tip/b1b4f2fe68393f80480545b5e67a50f7bda8e9a7 Author: Dou Liyang AuthorDate: Tue, 13 Jun 2017 10:30:29 +0800 Committer: Ingo Molnar CommitDate: Tue, 13 Jun 2017 08:42:09 +0200 x86/time: Make

[PATCH] x86/time: Make setup_default_timer_irq() static

2017-06-12 Thread Dou Liyang
This function isn't used outside of time.c, so let's mark it static. Signed-off-by: Dou Liyang --- arch/x86/include/asm/setup.h | 1 - arch/x86/kernel/time.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/x86/include/asm/setup.h b/arch/x86/include/a

[PATCH] mm: Drop useless local parameters of register_one_node()

2017-06-08 Thread Dou Liyang
... initializes local parameters "p_node" & "parent" for register_node(). But, register_node() does not use them. Remove the related code of "parent" node, cleanup register_one_node() and register_node(). [Test in Qemu by 4 hotpluggable nodes in x86-64

Re: [RFC PATCH v3 00/12] Unify interrupt mode and setup it as soon as possible

2017-06-05 Thread Dou Liyang
Hi Thomas, At 05/23/2017 09:29 AM, Dou Liyang wrote: Dear Thomas, At 05/23/2017 04:23 AM, Thomas Gleixner wrote: Dou, On Wed, 10 May 2017, Dou Liyang wrote: According to Ingo's and Eric's advice[1,2], Try my best to optimize the init of interrupt delivery mode for x86. sorry fo

[RFC PATCH v4 04/12] x86/time: Initialize interrupt mode behind timer init

2017-06-05 Thread Dou Liyang
mode should be earlier than calibrating TSC as soon as possible and needs testing whether the timer interrupt works at the same time. Add interrupt_mode_init to x86_init_ops, and call it behind timers init, which meets the above conditions. Signed-off-by: Dou Liyang --- V3 --> V4: -M

[RFC PATCH v4 05/12] x86/ioapic: Refactor the delay logic in timer_irq_works()

2017-05-26 Thread Dou Liyang
f current single CPU. Signed-off-by: Dou Liyang --- V3 --> V4: -Rewrite the changelog -Delete a blank line v2 --> v3: -Find a new way to for waiting. -Reference to the realization of hpet_clocksource_register() by Thomas. arch/x86/kernel/apic/io_apic.c | 45

Re: [RFC PATCH v3 00/12] Unify interrupt mode and setup it as soon as possible

2017-05-22 Thread Dou Liyang
Dear Thomas, At 05/23/2017 04:23 AM, Thomas Gleixner wrote: Dou, On Wed, 10 May 2017, Dou Liyang wrote: According to Ingo's and Eric's advice[1,2], Try my best to optimize the init of interrupt delivery mode for x86. sorry for replying late. The patchset is not forgotten, it&#x

Re: [PATCH v5 2/3] KASLR: Handle memory limit specified by memmap and mem option

2017-05-15 Thread Dou Liyang
At 05/16/2017 09:12 AM, Baoquan He wrote: On 05/16/17 at 08:56am, Dou Liyang wrote: Hi Baoquan, At 05/13/2017 01:46 PM, Baoquan He wrote: Option mem= will limit the max address a system can use and any memory region above the limit will be removed. Furthermore, memmap=nn[KMG] which has no

Re: [PATCH v5 2/3] KASLR: Handle memory limit specified by memmap and mem option

2017-05-15 Thread Dou Liyang
Hi Baoquan, At 05/13/2017 01:46 PM, Baoquan He wrote: Option mem= will limit the max address a system can use and any memory region above the limit will be removed. Furthermore, memmap=nn[KMG] which has no offset specified has the same behaviour as mem=. KASLR needs to consider this when choos

[RFC PATCH v4 09/12] x86/apic: Setup interrupt mode earlier in case of no SMP motherboard

2017-05-12 Thread Dou Liyang
. Incidentally, -Extract apic_bsp_setup() and Refine apic_interrupt_mode_init(). Signed-off-by: Dou Liyang --- 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

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

2017-05-11 Thread Dou Liyang
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 --- V3 --> V4: - Setup upmode earlier for UP system. - Ch

[RFC PATCH v3 02/12] x86/apic: Construct a selector for the interrupt delivery mode

2017-05-10 Thread Dou Liyang
selector to get an interrupt delivery mode directly. Signed-off-by: Dou Liyang --- The selector logic: ++ |disable_apic++ ++ true | |false

[RFC PATCH v3 08/12] x86/apic: Make interrupt mode setup earlier for SMP-capable system

2017-05-10 Thread Dou Liyang
may be failed in dump-capture kernel. The MP table or ACPI has been read earlier, setup the interrupt mode as soon as possible, make the system run in the final mode to avoid the compatibility issues. Core patch for SMP-capable system. Signed-off-by: Dou Liyang --- arch/x86/kernel/apic/apic.c

[RFC PATCH v3 07/12] x86/apic: Move the logical APIC ID setup from apic_bsp_setup()

2017-05-10 Thread Dou Liyang
. Signed-off-by: Dou Liyang --- arch/x86/include/asm/apic.h | 2 +- arch/x86/kernel/apic/apic.c | 10 +- arch/x86/kernel/smpboot.c | 4 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h index e9502e6..13f46e3

[RFC PATCH v3 06/12] x86/apic: Split local APIC timer setup from the APIC setup

2017-05-10 Thread Dou Liyang
calibrating TSC. but the APIC timer setup cannot be run there. Split local APIC timer setup from the APIC setup, keep it in the original position for SMP and UP kernel. Signed-off-by: Dou Liyang --- arch/x86/kernel/apic/apic.c | 4 ++-- arch/x86/kernel/smpboot.c | 4 2 files changed, 6

[RFC PATCH v3 12/12] x86/apic: Remove the apic_virtual_wire_mode_setup()

2017-05-10 Thread Dou Liyang
is redundant. Remove the apic_virtual_wire_mode_setup() function. Signed-off-by: Dou Liyang --- arch/x86/include/asm/apic.h | 2 -- arch/x86/kernel/apic/apic.c | 49 - arch/x86/kernel/irqinit.c | 2 -- 3 files changed, 53 deletions(-) diff --git a

[RFC PATCH v3 09/12] x86/apic: Setup interrupt mode earlier in case of no SMP motherboard

2017-05-10 Thread Dou Liyang
. Incidentally, -Extract apic_bsp_setup() and Refine apic_interrupt_mode_init(). Signed-off-by: Dou Liyang --- v2 --> v3: Replace APIC_SYMMETRIC_IO_NO_CONFIG with APIC_VIRTUAL_WIRE_NO_CONFIG Do some cleanup. arch/x86/kernel/apic/apic.c | 23 --- arch/x86/kernel/smpboo

[RFC PATCH v3 11/12] x86/apic: Mark the apic_interrupt_mode extern for disable_smp()

2017-05-10 Thread Dou Liyang
apic_interrupt_mode extern to refine the switch and remove the redundant sanity check. Signed-off-by: Dou Liyang --- arch/x86/include/asm/apic.h | 9 + arch/x86/kernel/apic/apic.c | 12 +++ arch/x86/kernel/smpboot.c | 49 - 3 files changed, 20

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

2017-05-10 Thread Dou Liyang
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 --- v2 --> v3: remove the APIC_init_uniprocessor() arch/x86/incl

[RFC PATCH v3 04/12] x86/time: Initialize interrupt mode behind timer init

2017-05-10 Thread Dou Liyang
mode should be earlier than calibrating TSC as soon as possible and needs testing whether the timer interrupt works at the same time. Add apic_interrupt_mode_init() just behind timers init, which meet the above conditions. Signed-off-by: Dou Liyang --- arch/x86/kernel/time.c | 8 1 file

[RFC PATCH v3 05/12] x86/ioapic: Refactor the delay logic in timer_irq_works()

2017-05-10 Thread Dou Liyang
thers will call __delay() directly. Signed-off-by: Dou Liyang --- v2 --> v3: Find a new way to for waiting. Reference to the realization of hpet_clocksource_register() by Thomas. arch/x86/kernel/apic/io_apic.c | 46 -- 1 file changed, 44 insertio

[RFC PATCH v3 00/12] Unify interrupt mode and setup it as soon as possible

2017-05-10 Thread Dou Liyang
ck logic in timer_irq_works() - Rename the framework to a selector - Split two patches - Consistently start sentences with upper case letters - Fix some typos - Rewrite the changelog Dou Liyang (12): x86/apic: Replace init_bsp_APIC() with apic_virtual_wire_mode_setup() x86/apic: Constru

[RFC PATCH v3 01/12] x86/apic: Replace init_bsp_APIC() with apic_virtual_wire_mode_setup()

2017-05-10 Thread Dou Liyang
_APIC is y. Rename it with a straightforward name, remove the redundant macros to increase readability by adding an empty stub for X86_LOCAL_APIC = n. Signed-off-by: Dou Liyang --- arch/x86/include/asm/apic.h | 3 ++- arch/x86/kernel/apic/apic.c | 4 ++-- arch/x86/kernel/irqinit.c | 5 ++--- 3

[RFC PATCH v3 03/12] x86/apic: Prepare for unifying the interrupt delivery modes setup

2017-05-10 Thread Dou Liyang
nel option. Preparatory patch to initialize an interrupt mode directly and provide a new function apic_interrupt_mode_init() to unify that three positions and do that setup as soon as possible. Signed-off-by: Dou Liyang --- v2 --> v3: change the function name from init_inte

Re: [PATCH v2 1/3] KASLR: Parse all memmap entries in cmdline

2017-04-24 Thread Dou Liyang
Hi Baoquan, At 04/24/2017 10:40 AM, Baoquan He wrote: In commit: f28442497b5c ("x86/boot: Fix KASLR and memmap= collision") ... the memmap= option is parsed so that KASLR can avoid those reserved regions. It uses cmdline_find_option() to get the value if memmap= is specified, however the pro

Re: [PATCH v2 3/3] Documentation/kernel-parameters.txt: Update 'memmap=' option description

2017-04-23 Thread Dou Liyang
At 04/24/2017 10:40 AM, Baoquan He wrote: In commit: 9710f581bb4c ("x86, mm: Let "memmap=" take more entries one time") ... 'memmap=' was changed to adopt multiple, comma delimited values in a single entry, so update the related description. In the special case of only specifying size valu

[RFC PATCH v2 03/12] x86/apic: Prepare for unifying the interrupt delivery modes setup

2017-04-19 Thread Dou Liyang
vide a new function init_interrupt_mode() to unify that three positions and do that setup as soon as possible. Signed-off-by: Dou Liyang --- arch/x86/include/asm/apic.h | 2 ++ arch/x86/kernel/apic/apic.c | 16 2 files changed, 18 insertions(+) diff --git a/arch/x86/include/as

[RFC PATCH v2 05/12] x86/ioapic: Refactor the delay logic in timer_irq_works()

2017-04-19 Thread Dou Liyang
works(). Refactor the delay logic by replace the mdelay() with __delay() and regard 2**MAX_BAND as the maximum threshold of CPU frequency. Signed-off-by: Dou Liyang --- arch/x86/kernel/apic/io_apic.c | 47 -- 1 file changed, 41 insertions(+), 6 deletions(-)

[RFC PATCH v2 07/12] x86/apic: Move the logical APIC ID setup from apic_bsp_setup()

2017-04-19 Thread Dou Liyang
(). Signed-off-by: Dou Liyang --- arch/x86/include/asm/apic.h | 2 +- arch/x86/kernel/apic/apic.c | 10 +- arch/x86/kernel/smpboot.c | 4 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h index 64f30ee3..9f2bc9c

[RFC PATCH v2 09/12] x86/apic: Setup interrupt mode earlier in case of no SMP motherboard

2017-04-19 Thread Dou Liyang
apic_bsp_setup() and Refine init_interrupt_mode(). Signed-off-by: Dou Liyang --- arch/x86/kernel/apic/apic.c | 26 ++ arch/x86/kernel/smpboot.c | 2 -- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic

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

2017-04-19 Thread Dou Liyang
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 --- arch/x86/kernel/apic/apic.c | 49 ++--- 1 file changed, 6 insertions(+), 43 deletions(-) diff

[RFC PATCH v2 12/12] x86/apic: Remove the apic_virtual_wire_mode_setup()

2017-04-19 Thread Dou Liyang
the virtual wire mode. Signed-off-by: Dou Liyang --- arch/x86/include/asm/apic.h | 2 -- arch/x86/kernel/apic/apic.c | 50 + arch/x86/kernel/irqinit.c | 2 -- 3 files changed, 1 insertion(+), 53 deletions(-) diff --git a/arch/x86/include/asm/apic.h

[RFC PATCH v2 11/12] x86/apic: Mark the apic_interrupt_mode extern for refining code

2017-04-19 Thread Dou Liyang
check. Signed-off-by: Dou Liyang --- arch/x86/include/asm/apic.h | 9 + arch/x86/kernel/apic/apic.c | 12 +++- arch/x86/kernel/smpboot.c | 48 +++-- 3 files changed, 19 insertions(+), 50 deletions(-) diff --git a/arch/x86/include/asm

[RFC PATCH v2 06/12] x86/apic: Split local APIC timer setup from the APIC setup

2017-04-19 Thread Dou Liyang
calibrating TSC. but the APIC timer setup cannot be run there. Split local APIC timer setup from the APIC setup, keep it in the original position for SMP and UP kernel. Signed-off-by: Dou Liyang --- arch/x86/kernel/apic/apic.c | 4 ++-- arch/x86/kernel/smpboot.c | 4 2 files changed, 6

[RFC PATCH v2 08/12] x86/apic: Make the interrupt mode setup earlier for SMP-capable system

2017-04-19 Thread Dou Liyang
, setup the interrupt mode as soon as possible to cleanup the disabled situation for SMP-capable system. Signed-off-by: Dou Liyang --- arch/x86/kernel/apic/apic.c | 21 + arch/x86/kernel/smpboot.c | 10 -- 2 files changed, 21 insertions(+), 10 deletions(-) diff

[RFC PATCH v2 04/12] x86/time: Initialize interrupt mode behind timer init

2017-04-19 Thread Dou Liyang
same time. Add init_interrupt_mode() to the right location in x86_late_time_init(). Signed-off-by: Dou Liyang --- arch/x86/kernel/time.c | 8 1 file changed, 8 insertions(+) diff --git a/arch/x86/kernel/time.c b/arch/x86/kernel/time.c index d39c091..04139c8 100644 --- a/arch/x86/kernel

[RFC PATCH v2 02/12] x86/apic: Construct a selector for the interrupt delivery mode

2017-04-19 Thread Dou Liyang
table: smp_found_config 5) ACPI: acpi_lapic; acpi_ioapic; nr_ioapic These switches are disordered and scattered. Hard to wrap them. Unify them into a single function, select an interrupt delivery mode for BSP through these switches. Signed-off-by: Dou Liyang --- arch/x86/kernel/apic/apic.c | 57

[RFC PATCH v2 01/12] x86/apic: Replace init_bsp_APIC() with apic_virtual_wire_mode_setup()

2017-04-19 Thread Dou Liyang
_APIC is y. Rename it with a straightforward name, remove the redundant macros to increase readability by adding an empty stub for the X86_LOCAL_APIC = n. Signed-off-by: Dou Liyang --- arch/x86/include/asm/apic.h | 3 ++- arch/x86/kernel/apic/apic.c | 4 ++-- arch/x86/kernel/irqinit.c | 5 ++-

[RFC PATCH v2 00/12] Unify interrupt mode and setup it as soon as possible

2017-04-19 Thread Dou Liyang
l.org/lkml/2016/7/25/1118 Changes since V1: - Move the initialization from init_IRQ() to x86_late_time_init() - Use a threshold to refactor the check logic in timer_irq_works() - Rename the framework to a selector - Split two patches - Consistently start sentences with upper case letters - Fix so

[tip:x86/cleanups] x86/irq: Remove a redundant #ifdef directive

2017-04-14 Thread tip-bot for Dou Liyang
Commit-ID: 0ccecd95e797f0c383a43278fcca74d47cd8a785 Gitweb: http://git.kernel.org/tip/0ccecd95e797f0c383a43278fcca74d47cd8a785 Author: Dou Liyang AuthorDate: Mon, 10 Apr 2017 16:05:00 +0800 Committer: Thomas Gleixner CommitDate: Fri, 14 Apr 2017 22:43:01 +0200 x86/irq: Remove a

[tip:x86/cleanups] x86/smp: Remove the redundant #ifdef CONFIG_SMP directive

2017-04-14 Thread tip-bot for Dou Liyang
Commit-ID: 7b6e106276fcc803e397f9b1bd4c272055c7cf5a Gitweb: http://git.kernel.org/tip/7b6e106276fcc803e397f9b1bd4c272055c7cf5a Author: Dou Liyang AuthorDate: Sun, 9 Apr 2017 18:46:46 +0800 Committer: Thomas Gleixner CommitDate: Fri, 14 Apr 2017 22:43:00 +0200 x86/smp: Remove the

[tip:x86/cleanups] x86/smp: Reduce code duplication

2017-04-14 Thread tip-bot for Dou Liyang
Commit-ID: 0f08c3b22996c91cff62c96cf4b3db88902e12a9 Gitweb: http://git.kernel.org/tip/0f08c3b22996c91cff62c96cf4b3db88902e12a9 Author: Dou Liyang AuthorDate: Sun, 9 Apr 2017 18:46:45 +0800 Committer: Thomas Gleixner CommitDate: Fri, 14 Apr 2017 22:43:00 +0200 x86/smp: Reduce code

Re: [patch 02/13] workqueue: Provide work_on_cpu_safe()

2017-04-13 Thread Dou Liyang
At 04/13/2017 04:07 AM, Thomas Gleixner wrote: work_on_cpu() is not protected against CPU hotplug. For code which requires to be either executed on an online CPU or to fail if the CPU is not available the callsite would have to protect against CPU hotplug. Provide a function which does get/put

[PATCH 3/3] x86/irq: Remove a redundant #ifdef directive

2017-04-10 Thread Dou Liyang
The declaration of irq_ctx_init in irq.h has already considered with both X86_32=y and X86_32=n cases. Put '#ifdef CONFIG_X86_32' here is redundant. Remove it for cleanup. Signed-off-by: Dou Liyang --- arch/x86/kernel/irqinit.c | 2 -- 1 file changed, 2 deletions(-) diff --git

[PATCH 2/2] x86/smp: Remove the redundant #ifdef CONFIG_SMP directive

2017-04-09 Thread Dou Liyang
According to: ... config X86_LOCAL_APIC def_bool y depends on X86_64 || SMP || X86_32_NON_STANDARD ... ... in arch/x86/Kconfig If X86_LOCAL_APIC is n, the SMP must be n. So, Remove the redundant #ifdef CONFIG_SMP directive in the case of !X86_LOCAL_APIC. Signed-off-by: Dou

[PATCH 1/2] x86/smp: Refine the code in the case of X86_32_SMP

2017-04-09 Thread Dou Liyang
Current code in CONFIG_X86_32_SMP is redundant. Merge the raw_smp_processor_id() macro and refine the #if directive. Signed-off-by: Dou Liyang --- BTW, what's the purpose of commit 96b89dc6598a ("x86: smp.h move safe_smp_processor_id declartion to cpu.h")? Reduce the impac

Re: [RFC PATCH 0/6] Unify the Interrupt Mode and setup it as soon as possible

2017-04-07 Thread Dou Liyang
Hi Thomas, At 04/06/2017 04:43 PM, Thomas Gleixner wrote: On Wed, 29 Mar 2017, Dou Liyang wrote: The purpose of this patchset is Unifing these setup steps and executing as soon as possible as follows: start_kernel ---+ | | | | init_IRQ

Re: [RFC PATCH 3/6] x86/apic: Extract APIC timer related code from apic_bsp_setup()

2017-04-07 Thread Dou Liyang
Hi Thomas, At 04/05/2017 07:56 PM, Thomas Gleixner wrote: On Wed, 29 Mar 2017, Dou Liyang wrote: +/* Setup local APIC timer and get the Id*/ +static int __init apic_bsp_timer_setup(void) This does not make sense. The id and the timers have nothing to do with each other. Yes, Indeed. Here

Re: [RFC PATCH 2/6] x86/apic: Construct a framework for setuping APIC mode as soon as possible

2017-04-05 Thread Dou Liyang
Hi Thomas, At 04/05/2017 07:46 PM, Thomas Gleixner wrote: On Wed, 29 Mar 2017, Dou Liyang wrote: Now, there are two ways to setup local apic and io-apic in X86 arch: 1. In an SMP-capable system, it will be done when preparing the cpus in native_smp_prepare_boot_cpu(). 2. If UP_LATE_INIT

Re: [RFC PATCH 1/6] x86/apic: Replace init_bsp_APIC() with apic_virture_wire_mode_setup()

2017-04-05 Thread Dou Liyang
Hi Thomas, At 04/05/2017 06:50 PM, Thomas Gleixner wrote: On Wed, 5 Apr 2017, Thomas Gleixner wrote: On Wed, 29 Mar 2017, Dou Liyang wrote: The init_bsp_APIC() setups the virtual wire mode through the local APIC. The function name is unsuitable which might imply that the BSP's APIC wi

Re: [RFC PATCH 1/6] x86/apic: Replace init_bsp_APIC() with apic_virture_wire_mode_setup()

2017-04-05 Thread Dou Liyang
Hi Thomas, Thank you very much! At 04/05/2017 06:43 PM, Thomas Gleixner wrote: On Wed, 29 Mar 2017, Dou Liyang wrote: The init_bsp_APIC() setups the virtual wire mode through the local APIC. The function name is unsuitable which might imply that the BSP's APIC will be initialized

Re: [RFC PATCH 0/6] Unify the Interrupt Mode and setup it as soon as possible

2017-03-29 Thread Dou Liyang
At 03/30/2017 11:03 AM, Dou Liyang wrote: Hi Baoquan, At 03/30/2017 10:08 AM, Baoquan He wrote: Hi Liyang, This is awesome. I planned to do this after kaslr back porting, glad to see your posting. I like below diagram and the idea of patch 2/6 framework. Will review and see what I can do to

Re: [RFC PATCH 0/6] Unify the Interrupt Mode and setup it as soon as possible

2017-03-29 Thread Dou Liyang
10:55pm, Dou Liyang wrote: According to Ingo's and Eric's advice[1,2], Try my best to optimize the init of Interrupt Mode for x86. The MP specification defines three different interrupt modes as follows: 1. PIC Mode 2. Virtual Wire Mode 3. Symmetic I/O Mode Currently, In kernel,

[RFC PATCH 2/6] x86/apic: Construct a framework for setuping APIC mode as soon as possible

2017-03-29 Thread Dou Liyang
is late which cause the dump-capture kernel hangs with 'notsc' option in 1st kernel option. and the use of these switches is messily. Before make the APIC mode setup earlier, construct a framework first to prepare for the work and make the logic clear. Signed-off-by: Dou Liyang ---

[RFC PATCH 3/6] x86/apic: Extract APIC timer related code from apic_bsp_setup()

2017-03-29 Thread Dou Liyang
The apic_bsp_setup() contains the APIC timer related code, which leads to hard reuse the local APIC and I/O APIC setup independently. Extract the related code to a single function for setuping APIC in advance. Signed-off-by: Dou Liyang --- arch/x86/include/asm/io_apic.h | 2 ++ arch/x86

[RFC PATCH 6/6] x86/apic: Remove the apic_virture_wire_mode_setup()

2017-03-29 Thread Dou Liyang
Currently, enable and setup the interrupt mode has been advanced and has already included the virtual wire mode. Remove the apic_virture_wire_mode_setup() which works for the virtual wire mode originally. Signed-off-by: Dou Liyang --- arch/x86/include/asm/apic.h | 2 -- arch/x86/kernel/apic

[RFC PATCH 5/6] x86/apic: Make the APIC mode setup earlier for UP system

2017-03-29 Thread Dou Liyang
The SMP-capable system has already enable and setup the APIC mode as soon as possible. Do it for UP system and make the code clear. Signed-off-by: Dou Liyang --- arch/x86/include/asm/apic.h | 2 ++ arch/x86/kernel/apic/apic.c | 81 + arch/x86/kernel

[RFC PATCH 4/6] x86/apic: Make the APIC mode setup earlier for SMP-capable system

2017-03-29 Thread Dou Liyang
to init_IRQ(). Do it at the end of IRQ initialization for SMP-capable system. Signed-off-by: Dou Liyang --- arch/x86/include/asm/apic.h | 3 ++- arch/x86/kernel/apic/apic.c | 39 --- arch/x86/kernel/smpboot.c | 10 +- 3 files changed, 35 insertions

[RFC PATCH 0/6] Unify the Interrupt Mode and setup it as soon as possible

2017-03-29 Thread Dou Liyang
ttps://lkml.org/lkml/2016/8/1/506 [3]. https://lkml.org/lkml/2016/7/25/1118 [4]. WARN_ON(max_loops <= 0) in setup_local_APIC() Dou Liyang (6): x86/apic: Replace init_bsp_APIC() with apic_virture_wire_mode_setup() x86/apic: Construct a framework for setuping APIC mode as soon as possible

[RFC PATCH 1/6] x86/apic: Replace init_bsp_APIC() with apic_virture_wire_mode_setup()

2017-03-29 Thread Dou Liyang
_APIC is y. Clarify it, also remove the redundant macros to increase readability Signed-off-by: Dou Liyang --- arch/x86/include/asm/apic.h | 2 ++ arch/x86/kernel/apic/apic.c | 4 ++-- arch/x86/kernel/irqinit.c | 5 ++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/arch/x86/in

[tip:x86/apic] x86/apic: Fix a comment in init_apic_mappings()

2017-03-13 Thread tip-bot for Dou Liyang
Commit-ID: 5ba039a55498d78a787edaf8cc915f29a17cecf3 Gitweb: http://git.kernel.org/tip/5ba039a55498d78a787edaf8cc915f29a17cecf3 Author: Dou Liyang AuthorDate: Mon, 6 Mar 2017 21:08:10 +0800 Committer: Thomas Gleixner CommitDate: Mon, 13 Mar 2017 21:42:11 +0100 x86/apic: Fix a comment

[tip:timers/core] x86/apic: Fix a comment in init_apic_mappings()

2017-03-13 Thread tip-bot for Dou Liyang
Commit-ID: ad258524b64756834f5fe23620beedb7c3609dc8 Gitweb: http://git.kernel.org/tip/ad258524b64756834f5fe23620beedb7c3609dc8 Author: Dou Liyang AuthorDate: Mon, 6 Mar 2017 21:08:10 +0800 Committer: Thomas Gleixner CommitDate: Mon, 13 Mar 2017 21:40:14 +0100 x86/apic: Fix a comment

[tip:x86/apic] x86/apic: Remove the SET_APIC_ID(x) macro

2017-03-13 Thread tip-bot for Dou Liyang
Commit-ID: 5d64d209c4f672e221ea304106b30793f10d95a4 Gitweb: http://git.kernel.org/tip/5d64d209c4f672e221ea304106b30793f10d95a4 Author: Dou Liyang AuthorDate: Wed, 8 Mar 2017 19:07:50 +0800 Committer: Thomas Gleixner CommitDate: Mon, 13 Mar 2017 21:28:38 +0100 x86/apic: Remove the

[tip:x86/acpi] acpi/processor: Check for duplicate processor ids at hotplug time

2017-03-11 Thread tip-bot for Dou Liyang
Commit-ID: a77d6cd968497792e072b74dff45b891ba778ddb Gitweb: http://git.kernel.org/tip/a77d6cd968497792e072b74dff45b891ba778ddb Author: Dou Liyang AuthorDate: Fri, 3 Mar 2017 16:02:27 +0800 Committer: Thomas Gleixner CommitDate: Sat, 11 Mar 2017 14:41:20 +0100 acpi/processor: Check for

[tip:x86/acpi] acpi/processor: Implement DEVICE operator for processor enumeration

2017-03-11 Thread tip-bot for Dou Liyang
Commit-ID: 8c8cb30f49b86333d8e036e1945cf1a78c03577e Gitweb: http://git.kernel.org/tip/8c8cb30f49b86333d8e036e1945cf1a78c03577e Author: Dou Liyang AuthorDate: Fri, 3 Mar 2017 16:02:26 +0800 Committer: Thomas Gleixner CommitDate: Sat, 11 Mar 2017 14:41:20 +0100 acpi/processor: Implement

[tip:x86/acpi] Revert"x86/acpi: Enable MADT APIs to return disabled apicids"

2017-03-11 Thread tip-bot for Dou Liyang
Commit-ID: 09c3f2bd5c7e5f18687663acb6adc6b167484ca5 Gitweb: http://git.kernel.org/tip/09c3f2bd5c7e5f18687663acb6adc6b167484ca5 Author: Dou Liyang AuthorDate: Fri, 3 Mar 2017 16:02:24 +0800 Committer: Thomas Gleixner CommitDate: Sat, 11 Mar 2017 14:41:18 +0100 Revert"x86/acpi: E

[tip:x86/acpi] x86/acpi: Restore the order of CPU IDs

2017-03-11 Thread tip-bot for Dou Liyang
Commit-ID: 2b85b3d22920db7473e5fed5719e7955c0ec323e Gitweb: http://git.kernel.org/tip/2b85b3d22920db7473e5fed5719e7955c0ec323e Author: Dou Liyang AuthorDate: Fri, 3 Mar 2017 16:02:25 +0800 Committer: Thomas Gleixner CommitDate: Sat, 11 Mar 2017 14:41:19 +0100 x86/acpi: Restore the

[tip:x86/acpi] Revert "x86/acpi: Set persistent cpuid <-> nodeid mapping when booting"

2017-03-11 Thread tip-bot for Dou Liyang
Commit-ID: c962cff17dfa11f4a8227ac16de2b28aea3312e4 Gitweb: http://git.kernel.org/tip/c962cff17dfa11f4a8227ac16de2b28aea3312e4 Author: Dou Liyang AuthorDate: Fri, 3 Mar 2017 16:02:23 +0800 Committer: Thomas Gleixner CommitDate: Sat, 11 Mar 2017 14:41:18 +0100 Revert "x86/acpi

[PATCH] x86/apic: Remove the SET_APIC_ID(x) macro

2017-03-08 Thread Dou Liyang
-remove the SET_APIC_ID(x) macro -simplify the call flow -add a comment Signed-off-by: Dou Liyang --- arch/x86/include/asm/apic.h | 7 +-- arch/x86/kernel/apic/apic.c | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm

[PATCH] x86/apic: Fix a comment in init_apic_mappings()

2017-03-06 Thread Dou Liyang
t. Remove acpi_register_lapic_address and rewrite the comment. Signed-off-by: Dou Liyang --- arch/x86/kernel/apic/apic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index 4261b32..70b0243 100644 --- a/arch/x86/k

Re: [PATCH v3 0/5] Do repair works for the mapping of cpuid <-> nodeid

2017-03-05 Thread Dou Liyang
At 03/03/2017 04:32 PM, Dou Liyang wrote: Hi All, My Simple Test Result: In our box: Fujitsu PQ2000 with 1 nodes for hot-plug. s/1 nodes/2 nodes in 1 SB which contains CPU, Memory.../ Thanks, Liyang Before the patchset

[PATCH v3 5/5] acpi/processor: Check for duplicate processor ids at hotplug time

2017-03-03 Thread Dou Liyang
processor ids is missing. Add it to the hotplug checks and rename the function so it better reflects its purpose. Signed-off-by: Dou Liyang Tested-by: Xiaolong Ye --- drivers/acpi/acpi_processor.c | 13 ++--- include/linux/acpi.h | 2 +- 2 files changed, 11 insertions(+), 4

[PATCH v3 1/5] Revert"x86/acpi: Set persistent cpuid <-> nodeid mapping when booting"

2017-03-03 Thread Dou Liyang
e the ACPI table and the physical information which is retrieved at actual hotplug is inconsistent. Revert the mapping implementation so it can be replaced with a less error prone approach. Signed-off-by: Dou Liyang Tested-by: Xiaolong Ye --- arch/x86/kernel/acpi/boot.c | 2 +- drivers/acpi/

Re: [PATCH v3 0/5] Do repair works for the mapping of cpuid <-> nodeid

2017-03-03 Thread Dou Liyang
,72-95 +^-+ | | | | +-+ And I also test some cases in VMs with QEmu. And When I get more nodes, I will test the whole function. Thanks, Liyang. At 03/03/2017 04:02 PM, Dou Liyang wrote: [S

[PATCH v3 4/5] acpi/processor: Implement DEVICE operator for processor enumeration

2017-03-03 Thread Dou Liyang
evaluate PROCESSOR and DEVICE types separately. Signed-off-by: Dou Liyang Tested-by: Xiaolong Ye --- drivers/acpi/acpi_processor.c | 39 --- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c

[PATCH v3 3/5] x86/acpi: Restore the order of CPU IDs

2017-03-03 Thread Dou Liyang
nt, The disabled CPUs which take up some logical CPU IDs will also make the order discontinuous. Revert the part of disabled CPUs registration, keep the allocation logic of logical CPU IDs and also keep some code location changes. Signed-off-by: Dou Liyang Tested-by: Xiaolong Ye ---

[PATCH v3 2/5] Revert"x86/acpi: Enable MADT APIs to return disabled apicids"

2017-03-03 Thread Dou Liyang
Remove the leftovers of the boot time 'cpuid <-> nodeid' mapping approach. Signed-off-by: Dou Liyang Tested-by: Xiaolong Ye --- drivers/acpi/processor_core.c | 60 --- 1 file changed, 22 insertions(+), 38 deletions(-) diff --gi

[PATCH v3 0/5] Do repair works for the mapping of cpuid <-> nodeid

2017-03-03 Thread Dou Liyang
d()/acpi_duplicate_processor_id(). by Thomas Gleixner 's advice. 3. modify the error handle in acpi_processor_ids_walk() by Thomas Gleixner 's advice. 4. add a new patch for restoring the order of CPU IDs v1 -> v2: 1. fix some co

Re: [PATCH v2 4/4] acpi: Move the verification of duplicate proc_id from booting time to hot-plug time

2017-03-02 Thread Dou Liyang
Hi tglx, At 03/01/2017 07:26 PM, Thomas Gleixner wrote: On Mon, 20 Feb 2017, Dou Liyang wrote: Please make your subject line short and a precise summary phrase, not an overlong sentence. After we revert the the mapping of "cpuid <-> nodeid" fixed at the booting time. and

Re: [PATCH v2 2/4] Revert"x86/acpi: Enable MADT APIs to return disabled apicids"

2017-03-02 Thread Dou Liyang
Hi tglx, At 03/01/2017 06:52 PM, Thomas Gleixner wrote: On Mon, 20 Feb 2017, Dou Liyang wrote: After we never do the last mapping of "cpuid <-> nodeid" at booting time. we also no need to enable MADT APIs to return disabled apicid. So, The patch work for reverting the commit

Re: [PATCH v2 3/4] acpi: Fix the check handle in case of declaring processors using the Device operator

2017-03-02 Thread Dou Liyang
Hi tglx, At 03/01/2017 07:12 PM, Thomas Gleixner wrote: On Mon, 20 Feb 2017, Dou Liyang wrote: In ACPI spec, we can declare processors using both Processor and Device operator. And before we use the ACPI table, we should check the correctness for all processors in ACPI namespace. But

Re: [PATCH v2 1/4] Revert"x86/acpi: Set persistent cpuid <-> nodeid mapping when booting"

2017-03-02 Thread Dou Liyang
. I love it so much. I will try to improve myself and help others. :) Thanks, Liyang. At 03/01/2017 06:51 PM, Thomas Gleixner wrote: On Mon, 20 Feb 2017, Dou Liyang wrote: Currently, We make the mapping of "cpuid <-> nodeid" fixed at the booting time. It keeps con

Re: [PATCH] x86/apic: Remove the extra judgement of skipped IO APIC setup

2017-03-01 Thread Dou Liyang
Dear Ingo, At 03/01/2017 05:04 PM, Ingo Molnar wrote: [...] + pr_info("Not init interrupt remapping due to skipped IO-APIC setup\n"); So you replaced a perfectly readable kernel message: - pr_info("Not enabling interrupt remapping due to skipped IO-APIC setup\n")

Re: [PATCH] x86/acpi: Fix a warning message in logical CPU IDs allocation

2017-03-01 Thread Dou Liyang
Hi Ingo, At 03/01/2017 05:10 PM, Ingo Molnar wrote: * Dou Liyang wrote: Current warning message regarded the "nr_cpu_ids - 1" as the limit number of the CPUs. It may be confused us, for example: we have two CPUs, nr_cpu_ids = 2, but the warning message may indicate that we just

[tip:x86/urgent] x86/apic: Simplify enable_IR_x2apic(), remove try_to_enable_IR()

2017-03-01 Thread tip-bot for Dou Liyang
Commit-ID: 11277aabcbbe13916151af897d29a5e9f71ca73f Gitweb: http://git.kernel.org/tip/11277aabcbbe13916151af897d29a5e9f71ca73f Author: Dou Liyang AuthorDate: Thu, 23 Feb 2017 17:16:41 +0800 Committer: Ingo Molnar CommitDate: Wed, 1 Mar 2017 10:09:09 +0100 x86/apic: Simplify

[tip:x86/urgent] x86/apic: Fix a warning message in logical CPU IDs allocation

2017-03-01 Thread tip-bot for Dou Liyang
Commit-ID: bb3f0a52630c84807fca9bdd76ac2f5dcec82689 Gitweb: http://git.kernel.org/tip/bb3f0a52630c84807fca9bdd76ac2f5dcec82689 Author: Dou Liyang AuthorDate: Tue, 28 Feb 2017 13:50:52 +0800 Committer: Ingo Molnar CommitDate: Wed, 1 Mar 2017 10:09:08 +0100 x86/apic: Fix a warning

[PATCH] x86/acpi: Fix a warning message in logical CPU IDs allocation

2017-02-27 Thread Dou Liyang
d the rest are ignored. Fix the warning message, replace "nr_cpu_ids - 1" with "nr_cpu_ids". And the warning message can be like that: APIC: NR_CPUS/possible_cpus limit of 2 reached. Processor 2/0x2 and the rest are ignored. Signed-off-by: Dou Liyang --- a

Re: CPU: 0 PID: 0 at arch/x86/kernel/apic/apic.c:2066

2017-02-27 Thread Dou Liyang
Hi Marco, After Linux-4.9, we also mapped the logical CPU IDs for the disabled CPUs. The reason of the warning maybe that: The max number of the CPU in "dl360g5" is 2 (NR_CPUS:2), but, the kernel mapped one of the number to a disabled CPUs, so one of the enable CPUs will never have a cpu_id, so

[PATCH] x86/apic: Remove the extra judgement of skipped IO APIC setup

2017-02-23 Thread Dou Liyang
the one in try_to_enable_IR() and refine them for better readability. Signed-off-by: Dou Liyang --- arch/x86/kernel/apic/apic.c | 17 - 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index 8567c85..86e7bd8 100644 ---

Re: [PATCH v2 0/4] Revert works for the mapping of cpuid <-> nodeid

2017-02-21 Thread Dou Liyang
Hi, Xiaolong At 02/21/2017 03:10 PM, Ye Xiaolong wrote: On 02/21, Ye Xiaolong wrote: On 02/20, Dou Liyang wrote: Currently, We make the mapping of "cpuid <-> nodeid" fixed at the booting time. It keeps consistent with the WorkQueue and avoids some bugs which may be cause

[PATCH v2 2/4] Revert"x86/acpi: Enable MADT APIs to return disabled apicids"

2017-02-20 Thread Dou Liyang
After we never do the last mapping of "cpuid <-> nodeid" at booting time. we also no need to enable MADT APIs to return disabled apicid. So, The patch work for reverting the commit 8ad893faf2: "x86/acpi: Enable MADT APIs to return disabled apicids" Signed-off-by: Dou

[PATCH v2 3/4] acpi: Fix the check handle in case of declaring processors using the Device operator

2017-02-20 Thread Dou Liyang
. It misses the processors declared by Device operator. The patch adds the case of Device operator. Signed-off-by: Dou Liyang --- drivers/acpi/acpi_processor.c | 32 +--- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/drivers/acpi/acpi_processor.c b

[PATCH v2 4/4] acpi: Move the verification of duplicate proc_id from booting time to hot-plug time

2017-02-20 Thread Dou Liyang
After we revert the the mapping of "cpuid <-> nodeid" fixed at the booting time. and do it at the hot-plug time. we should also do the verification of duplicate proc_id at the time. The patch rename the verfication function and move it to drivers/acpi::acpi_processor_get_info. Si

[PATCH v2 0/4] Revert works for the mapping of cpuid <-> nodeid

2017-02-20 Thread Dou Liyang
e, not at booting time where we did some useless work. It also can make the mapping of "cpuid <-> nodeid" fixed and avoid excessive use of the ACPI table. We have tested them in our box: Fujitsu PQ2000 with 2 nodes for hot-plug. To Xiaolong: Please help me to test it in the

[PATCH v2 1/4] Revert"x86/acpi: Set persistent cpuid <-> nodeid mapping when booting"

2017-02-20 Thread Dou Liyang
e use of the ACPI table. The patch revert the commit dc6db24d24: "x86/acpi: Set persistent cpuid <-> nodeid mapping when booting". Signed-off-by: Dou Liyang --- arch/x86/kernel/acpi/boot.c | 2 +- drivers/acpi/acpi_processor.c | 5 --- dri

[PATCH 0/2] Revert works for the mapping of cpuid <-> nodeid

2017-02-19 Thread Dou Liyang
e, not at booting time where we did some useless work. It also can make the mapping of "cpuid <-> nodeid" fixed and avoid excessive use of the ACPI table. We have tested them in our box: Fujitsu PQ2000 with 2 nodes for hot-plug. To Xiaolong: Please help me to test it

[PATCH 1/2] Revert"x86/acpi: Set persistent cpuid <-> nodeid mapping when booting"

2017-02-19 Thread Dou Liyang
e use of the ACPI table. The patch revert the commit dc6db24d24: "x86/acpi: Set persistent cpuid <-> nodeid mapping when booting". Signed-off-by: Dou Liyang --- arch/x86/kernel/acpi/boot.c | 2 +- drivers/acpi/acpi_processor.c | 5 --- dri

[PATCH 2/2] Revert"x86, acpi, cpu-hotplug: Enable MADT APIs to return disabled apicid"

2017-02-19 Thread Dou Liyang
After we never do the last mapping of "cpuid <-> nodeid" at booting time. we also no need to enable MADT APIs to return disabled apicid. So, The patch work for reverting the commit 8ad893faf2: "x86, acpi, cpu-hotplug: Enable MADT APIs to return disabled apicid"

Re: [PATCH 1/2] acpi: Fix the mapping handle in case of declaring processors using the Device operator

2017-02-16 Thread Dou Liyang
At 02/16/2017 09:06 PM, Hanjun Guo wrote: On 2017/2/16 18:38, Dou Liyang wrote: In ACPI spec, we can declare processors using both Processor and Device operator. But now, we just handle the mapping of processors which are declared by Processor operator. It misses the processors declared by

<    1   2   3   4   5   6   >