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


Groups > linux.kernel > #1678456 > unrolled thread

[PATCH v5 02/12] x86/apic: Prepare for unifying the interrupt delivery modes setup

Started byDou Liyang <douly.fnst@cn.fujitsu.com>
First post2017-06-30 06:10 +0200
Last post2017-07-03 08:50 +0200
Articles 5 — 2 participants

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.


Contents

  [PATCH v5 02/12] x86/apic: Prepare for unifying the interrupt delivery modes setup Dou Liyang <douly.fnst@cn.fujitsu.com> - 2017-06-30 06:10 +0200
    Re: [PATCH v5 02/12] x86/apic: Prepare for unifying the interrupt  delivery modes setup Thomas Gleixner <tglx@linutronix.de> - 2017-07-02 19:50 +0200
      Re: [PATCH v5 02/12] x86/apic: Prepare for unifying the interrupt  delivery modes setup Dou Liyang <douly.fnst@cn.fujitsu.com> - 2017-07-03 04:00 +0200
        Re: [PATCH v5 02/12] x86/apic: Prepare for unifying the interrupt  delivery modes setup Dou Liyang <douly.fnst@cn.fujitsu.com> - 2017-07-03 08:50 +0200
        Re: [PATCH v5 02/12] x86/apic: Prepare for unifying the interrupt  delivery modes setup Thomas Gleixner <tglx@linutronix.de> - 2017-07-03 08:50 +0200

#1678456 — [PATCH v5 02/12] x86/apic: Prepare for unifying the interrupt delivery modes setup

FromDou Liyang <douly.fnst@cn.fujitsu.com>
Date2017-06-30 06:10 +0200
Subject[PATCH v5 02/12] x86/apic: Prepare for unifying the interrupt delivery modes setup
Message-ID<tXVpN-np-29@gated-at.bofh.it>
There are three positions for initializing the interrupt delivery
modes:

1) In IRQ initial function, may setup the through-local-APIC
   virtual wire mode.

2) In an SMP-capable system, will try to switch to symmetric I/O
   model when preparing the cpus in native_smp_prepare_cpus().

3) In UP system with UP_LATE_INIT=y, will set up local APIC and
   I/O APIC in smp_init().

Switching to symmetric I/O mode is so late, which causes kernel
in an unmatched mode at the beginning of booting time. And it
causes the dump-capture kernel hangs with 'notsc' option inherited
from 1st kernel option.

Provide a new function to unify that three positions. Preparatory
patch to initialize an interrupt mode directly.

Signed-off-by: Dou Liyang <douly.fnst@cn.fujitsu.com>
---
 arch/x86/include/asm/apic.h |  2 ++
 arch/x86/kernel/apic/apic.c | 19 +++++++++++++++++++
 2 files changed, 21 insertions(+)

diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
index bdffcd9..ddc16ff 100644
--- a/arch/x86/include/asm/apic.h
+++ b/arch/x86/include/asm/apic.h
@@ -128,6 +128,7 @@ extern void disable_local_APIC(void);
 extern void lapic_shutdown(void);
 extern void sync_Arb_IDs(void);
 extern void init_bsp_APIC(void);
+extern void apic_intr_mode_init(void);
 extern void setup_local_APIC(void);
 extern void init_apic_mappings(void);
 void register_lapic_address(unsigned long address);
@@ -170,6 +171,7 @@ static inline void disable_local_APIC(void) { }
 # define setup_boot_APIC_clock x86_init_noop
 # define setup_secondary_APIC_clock x86_init_noop
 static inline void lapic_update_tsc_freq(void) { }
+static inline void apic_intr_mode_init(void) { }
 #endif /* !CONFIG_X86_LOCAL_APIC */
 
 #ifdef CONFIG_X86_X2APIC
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 88be65e..00d97f4 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -1266,6 +1266,25 @@ void __init init_bsp_APIC(void)
 	apic_write(APIC_LVT1, value);
 }
 
+/* Init the interrupt delivery mode for the BSP */
+void __init apic_intr_mode_init(void)
+{
+	switch (apic_intr_mode_select()) {
+	case APIC_PIC:
+		apic_printk(APIC_VERBOSE, KERN_INFO
+			"Keep in PIC mode(8259)\n");
+		return;
+	case APIC_VIRTUAL_WIRE:
+		apic_printk(APIC_VERBOSE, KERN_INFO
+			"Switch to virtual wire mode setup\n");
+		return;
+	case APIC_SYMMETRIC_IO:
+		apic_printk(APIC_VERBOSE, KERN_INFO
+			"Switch to symmectic I/O mode setup\n");
+		return;
+	}
+}
+
 static void lapic_setup_esr(void)
 {
 	unsigned int oldvalue, value, maxlvt;
-- 
2.5.5

[toc] | [next] | [standalone]


#1679542 — Re: [PATCH v5 02/12] x86/apic: Prepare for unifying the interrupt delivery modes setup

FromThomas Gleixner <tglx@linutronix.de>
Date2017-07-02 19:50 +0200
SubjectRe: [PATCH v5 02/12] x86/apic: Prepare for unifying the interrupt delivery modes setup
Message-ID<tYRap-5gB-3@gated-at.bofh.it>
In reply to#1678456
On Fri, 30 Jun 2017, Dou Liyang wrote:
> +/* Init the interrupt delivery mode for the BSP */
> +void __init apic_intr_mode_init(void)
> +{
> +	switch (apic_intr_mode_select()) {
> +	case APIC_PIC:
> +		apic_printk(APIC_VERBOSE, KERN_INFO
> +			"Keep in PIC mode(8259)\n");

Please do not proliferate that APIC_VERBOSE, KERN_INFO mess. Clean up the
apic_printk() macro first. Either change printk() to pr_info() or make the
printk level dependent on the APIC verbosity.

Thanks,

	tglx

[toc] | [prev] | [next] | [standalone]


#1679603 — Re: [PATCH v5 02/12] x86/apic: Prepare for unifying the interrupt delivery modes setup

FromDou Liyang <douly.fnst@cn.fujitsu.com>
Date2017-07-03 04:00 +0200
SubjectRe: [PATCH v5 02/12] x86/apic: Prepare for unifying the interrupt delivery modes setup
Message-ID<tYYOC-2vJ-7@gated-at.bofh.it>
In reply to#1679542
Hi Thomas,

At 07/03/2017 01:47 AM, Thomas Gleixner wrote:
> On Fri, 30 Jun 2017, Dou Liyang wrote:
>> +/* Init the interrupt delivery mode for the BSP */
>> +void __init apic_intr_mode_init(void)
>> +{
>> +	switch (apic_intr_mode_select()) {
>> +	case APIC_PIC:
>> +		apic_printk(APIC_VERBOSE, KERN_INFO
>> +			"Keep in PIC mode(8259)\n");
>
> Please do not proliferate that APIC_VERBOSE, KERN_INFO mess. Clean up the
> apic_printk() macro first. Either change printk() to pr_info() or make the
> printk level dependent on the APIC verbosity.

Oops, I understood, How about the following:

pr_info("APIC: keep in PIC mode(8259)\n");


Thanks,

	dou.

>
> Thanks,
>
> 	tglx
>
>
>

[toc] | [prev] | [next] | [standalone]


#1679675 — Re: [PATCH v5 02/12] x86/apic: Prepare for unifying the interrupt delivery modes setup

FromDou Liyang <douly.fnst@cn.fujitsu.com>
Date2017-07-03 08:50 +0200
SubjectRe: [PATCH v5 02/12] x86/apic: Prepare for unifying the interrupt delivery modes setup
Message-ID<tZ3lg-5Nh-11@gated-at.bofh.it>
In reply to#1679603
Hi Thomas,

At 07/03/2017 02:41 PM, Thomas Gleixner wrote:
> On Mon, 3 Jul 2017, Dou Liyang wrote:
>> At 07/03/2017 01:47 AM, Thomas Gleixner wrote:
>>> On Fri, 30 Jun 2017, Dou Liyang wrote:
>>>> +/* Init the interrupt delivery mode for the BSP */
>>>> +void __init apic_intr_mode_init(void)
>>>> +{
>>>> +	switch (apic_intr_mode_select()) {
>>>> +	case APIC_PIC:
>>>> +		apic_printk(APIC_VERBOSE, KERN_INFO
>>>> +			"Keep in PIC mode(8259)\n");
>>>
>>> Please do not proliferate that APIC_VERBOSE, KERN_INFO mess. Clean up the
>>> apic_printk() macro first. Either change printk() to pr_info() or make the
>>> printk level dependent on the APIC verbosity.
>>
>> Oops, I understood, How about the following:
>>
>> pr_info("APIC: keep in PIC mode(8259)\n");
>
> As this is once per boot, it's ok to have that information unconditionally
> printed.

Yes, I see.  will change others in the next version.

Thanks,

	dou.
>
> Thanks,
>
> 	tglx
>
>
>

[toc] | [prev] | [next] | [standalone]


#1679676 — Re: [PATCH v5 02/12] x86/apic: Prepare for unifying the interrupt delivery modes setup

FromThomas Gleixner <tglx@linutronix.de>
Date2017-07-03 08:50 +0200
SubjectRe: [PATCH v5 02/12] x86/apic: Prepare for unifying the interrupt delivery modes setup
Message-ID<tZ3lg-5Nh-13@gated-at.bofh.it>
In reply to#1679603
On Mon, 3 Jul 2017, Dou Liyang wrote:
> At 07/03/2017 01:47 AM, Thomas Gleixner wrote:
> > On Fri, 30 Jun 2017, Dou Liyang wrote:
> > > +/* Init the interrupt delivery mode for the BSP */
> > > +void __init apic_intr_mode_init(void)
> > > +{
> > > +	switch (apic_intr_mode_select()) {
> > > +	case APIC_PIC:
> > > +		apic_printk(APIC_VERBOSE, KERN_INFO
> > > +			"Keep in PIC mode(8259)\n");
> > 
> > Please do not proliferate that APIC_VERBOSE, KERN_INFO mess. Clean up the
> > apic_printk() macro first. Either change printk() to pr_info() or make the
> > printk level dependent on the APIC verbosity.
> 
> Oops, I understood, How about the following:
> 
> pr_info("APIC: keep in PIC mode(8259)\n");

As this is once per boot, it's ok to have that information unconditionally
printed.

Thanks,

	tglx

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web