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


Groups > linux.kernel > #1464353 > unrolled thread

[PATCH 1/2] x86/smpboot: Check APIC ID before setting up default routing

Started byWei Jiangang <weijg.fnst@cn.fujitsu.com>
First post2016-08-17 08:50 +0200
Last post2016-08-18 12:20 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/2] x86/smpboot: Check APIC ID before setting up default routing Wei Jiangang <weijg.fnst@cn.fujitsu.com> - 2016-08-17 08:50 +0200
    Re: [PATCH 1/2] x86/smpboot: Check APIC ID before setting up default  routing Ingo Molnar <mingo@kernel.org> - 2016-08-18 11:50 +0200
      Re: [PATCH 1/2] x86/smpboot: Check APIC ID before setting up  default routing "Wei, Jiangang" <weijg.fnst@cn.fujitsu.com> - 2016-08-18 12:20 +0200

#1464353 — [PATCH 1/2] x86/smpboot: Check APIC ID before setting up default routing

FromWei Jiangang <weijg.fnst@cn.fujitsu.com>
Date2016-08-17 08:50 +0200
Subject[PATCH 1/2] x86/smpboot: Check APIC ID before setting up default routing
Message-ID<s72PM-5MN-13@gated-at.bofh.it>
Check the boot APIC ID firstly,
and then setup the default routing of APIC looks better.

And move default_setup_apic_routing() close to apic_bsp_setup(),
which staying in step with the codes in APIC_init_uniprocessor().

Signed-off-by: Wei Jiangang <weijg.fnst@cn.fujitsu.com>
---
 arch/x86/kernel/smpboot.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 2a6e84a30a54..8216b997c1c9 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -1316,14 +1316,13 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus)
 		break;
 	}
 
-	default_setup_apic_routing();
-
 	if (read_apic_id() != boot_cpu_physical_apicid) {
 		panic("Boot APIC ID in local APIC unexpected (%d vs %d)",
 		     read_apic_id(), boot_cpu_physical_apicid);
 		/* Or can we switch back to PIC here? */
 	}
 
+	default_setup_apic_routing();
 	cpu0_logical_apicid = apic_bsp_setup(false);
 
 	pr_info("CPU%d: ", 0);
-- 
1.9.3

[toc] | [next] | [standalone]


#1465054 — Re: [PATCH 1/2] x86/smpboot: Check APIC ID before setting up default routing

FromIngo Molnar <mingo@kernel.org>
Date2016-08-18 11:50 +0200
SubjectRe: [PATCH 1/2] x86/smpboot: Check APIC ID before setting up default routing
Message-ID<s7s7v-6mS-5@gated-at.bofh.it>
In reply to#1464353
* Wei Jiangang <weijg.fnst@cn.fujitsu.com> wrote:

> Check the boot APIC ID firstly,
> and then setup the default routing of APIC looks better.
> 
> And move default_setup_apic_routing() close to apic_bsp_setup(),
> which staying in step with the codes in APIC_init_uniprocessor().
> 
> Signed-off-by: Wei Jiangang <weijg.fnst@cn.fujitsu.com>
> ---
>  arch/x86/kernel/smpboot.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

If it's not a bug then please clearly note so in the changelog and
explain why the change results in better code.

If it's fixing a bug/misfeature then please fix the changelog to
conform to the standard changelog style:

 - first describe the symptoms of the bug - how does a user notice? 

 - then describe how the code behaves today and how that is causing the bug

 - and then only describe how it's fixed.

Thanks,

        Ingo

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


#1465097 — Re: [PATCH 1/2] x86/smpboot: Check APIC ID before setting up default routing

From"Wei, Jiangang" <weijg.fnst@cn.fujitsu.com>
Date2016-08-18 12:20 +0200
SubjectRe: [PATCH 1/2] x86/smpboot: Check APIC ID before setting up default routing
Message-ID<s7sAy-6Nh-37@gated-at.bofh.it>
In reply to#1465054
On Thu, 2016-08-18 at 11:47 +0200, Ingo Molnar wrote:
> * Wei Jiangang <weijg.fnst@cn.fujitsu.com> wrote:
> 
> > Check the boot APIC ID firstly,
> > and then setup the default routing of APIC looks better.
> > 
> > And move default_setup_apic_routing() close to apic_bsp_setup(),
> > which staying in step with the codes in APIC_init_uniprocessor().
> > 
> > Signed-off-by: Wei Jiangang <weijg.fnst@cn.fujitsu.com>
> > ---
> >  arch/x86/kernel/smpboot.c | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> If it's not a bug then please clearly note so in the changelog and
> explain why the change results in better code.

It's not a bug.
The combination of default_setup_apic_routing() and apic_bsp_setup() is
used to enable APIC mode. If the return of read_apic_id() is not equal
to boot_cpu_physical_apicid, it means the APIC ID of current CPU‘s local
APIC  is unexpected and enable APIC mode maybe fail. so no need to set
up the apic routing.  That's why I want to move
default_setup_apic_routing() behind checking the boot APIC ID.

Sorry for obscure commit message. I will improve it in next version.

> 
> If it's fixing a bug/misfeature then please fix the changelog to
> conform to the standard changelog style:
> 
>  - first describe the symptoms of the bug - how does a user notice? 
> 
>  - then describe how the code behaves today and how that is causing the bug
> 
>  - and then only describe how it's fixed.

Thanks for your detailed explanation. I'll keep in my mind.
> 
> Thanks,
> 
>         Ingo
> 
> 



[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web