From: Dou Liyang <douly.fnst@cn.fujitsu.com>
To: <x86@kernel.org>, <linux-kernel@vger.kernel.org>
Cc: <tglx@linutronix.de>, <mingo@kernel.org>, <ebiederm@xmission.com>,
<bhe@redhat.com>, <hpa@zytor.com>, <izumi.taku@jp.fujitsu.com>,
Dou Liyang <douly.fnst@cn.fujitsu.com>
Subject: [RFC PATCH 0/6] Unify the Interrupt Mode and setup it as soon as possible
Date: Wed, 29 Mar 2017 22:55:27 +0800 [thread overview]
Message-ID: <1490799333-18242-1-git-send-email-douly.fnst@cn.fujitsu.com> (raw)
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,
1. Setup the Virtual Wire Mode during the IRQ initialization(
step 1 in the following figure).
2. Enable and Setup the Symmetic I/O Mode either during the
SMP-capabe system prepares CPUs(step 2) or during the UP system
initializes itself(step 3).
start_kernel
+---------------+
|
+--> .......
|
| setup_arch
+--> +-------+
|
| init_IRQ
+-> +--+-----+
| | init_ISA_irqs
| +------> +-+--------+
| | +----------------+
+---> +------> | 1.init_bsp_APIC|
| ....... +----------------+
+--->
| rest_init
+--->---+-----+
| | kernel_init
| +> ----+-----+
| | kernel_init_freeable
| +-> ----+-------------+
| | smp_prepare_cpus
| +---> +----+---------+
| | | +-------------------+
| | +-> |2. apic_bsp_setup |
| | +-------------------+
| |
v | smp_init
+---> +---+----+
| +-------------------+
+--> |3. apic_bsp_setup |
+-------------------+
The purpose of this patchset is Unifing these setup steps and executing as
soon as possible as follows:
start_kernel
---------------+
|
|
|
| init_IRQ
+---->---+----+
| |
| | +--------------------+
| +----> | 4. init_bsp_APIC |
| +--------------------+
v
By the way, Also fix a bug about kexec[3].
Some doubts, need help:
1. Patchset has influence on IOMMU in enable_IR_x2apic(). Not sure
it can be in advance?
2. Due to
Commit 8c3ba8d04924 ("x86, apic: ack all pending irqs when crashed/on kexec")
..., patchset also needs TSC and uses the "cpu_khz" in setup_local_APIC().
And a warning[4] will be triggered when crashed/on kexec. Not sure how to
modify?
[1]. https://lkml.org/lkml/2016/8/2/929
[2]. https://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
x86/apic: Extract APIC timer related code from apic_bsp_setup()
x86/apic: Make the APIC mode setup earlier for SMP-capable system
x86/apic: Make the APIC mode setup earlier for UP system
x86/apic: Remove the apic_virture_wire_mode_setup()
arch/x86/include/asm/apic.h | 7 +-
arch/x86/include/asm/io_apic.h | 2 +
arch/x86/kernel/apic/apic.c | 218 ++++++++++++++++++++++++-----------------
arch/x86/kernel/apic/io_apic.c | 4 +-
arch/x86/kernel/irqinit.c | 6 +-
arch/x86/kernel/smpboot.c | 68 ++-----------
6 files changed, 149 insertions(+), 156 deletions(-)
--
2.5.5
next reply other threads:[~2017-03-29 14:55 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-29 14:55 Dou Liyang [this message]
2017-03-29 14:55 ` [RFC PATCH 1/6] x86/apic: Replace init_bsp_APIC() with apic_virture_wire_mode_setup() Dou Liyang
2017-04-05 10:43 ` Thomas Gleixner
2017-04-05 10:50 ` Thomas Gleixner
2017-04-06 1:37 ` Dou Liyang
2017-04-06 1:32 ` Dou Liyang
2017-03-29 14:55 ` [RFC PATCH 2/6] x86/apic: Construct a framework for setuping APIC mode as soon as possible Dou Liyang
2017-04-05 11:46 ` Thomas Gleixner
2017-04-06 2:21 ` Dou Liyang
2017-03-29 14:55 ` [RFC PATCH 3/6] x86/apic: Extract APIC timer related code from apic_bsp_setup() Dou Liyang
2017-04-05 11:56 ` Thomas Gleixner
2017-04-07 7:51 ` Dou Liyang
2017-03-29 14:55 ` [RFC PATCH 4/6] x86/apic: Make the APIC mode setup earlier for SMP-capable system Dou Liyang
2017-03-29 14:55 ` [RFC PATCH 5/6] x86/apic: Make the APIC mode setup earlier for UP system Dou Liyang
2017-03-29 14:55 ` [RFC PATCH 6/6] x86/apic: Remove the apic_virture_wire_mode_setup() Dou Liyang
2017-03-30 2:08 ` [RFC PATCH 0/6] Unify the Interrupt Mode and setup it as soon as possible Baoquan He
2017-03-30 3:03 ` Dou Liyang
2017-03-30 3:09 ` Dou Liyang
2017-03-30 4:10 ` Baoquan He
2017-04-06 8:43 ` Thomas Gleixner
2017-04-07 9:39 ` Dou Liyang
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=1490799333-18242-1-git-send-email-douly.fnst@cn.fujitsu.com \
--to=douly.fnst@cn.fujitsu.com \
--cc=bhe@redhat.com \
--cc=ebiederm@xmission.com \
--cc=hpa@zytor.com \
--cc=izumi.taku@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®