mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yinghai Lu <yinghai@kernel.org>
To: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: mingo@elte.hu, tglx@linutronix.de, hpa@zytor.com,
	steiner@sgi.com, linux-kernel@vger.kernel.org,
	gorcunov@openvz.org
Subject: Re: [patch 6/6] x86, apic: use .apicdrivers section to find the list of apic drivers
Date: Fri, 20 May 2011 07:26:00 -0700	[thread overview]
Message-ID: <4DD679F8.10002@kernel.org> (raw)
In-Reply-To: <20110519234637.671736436@sbsiddha-MOBL3.sc.intel.com>

On 05/19/2011 04:45 PM, Suresh Siddha wrote:
> --- linux-2.6-tip.orig/arch/x86/kernel/apic/apic_flat_64.c
> +++ linux-2.6-tip/arch/x86/kernel/apic/apic_flat_64.c
> @@ -24,6 +24,8 @@
>  #include <acpi/acpi_bus.h>
>  #endif
>  
> +static struct apic apic_physflat;
> +
>  static int flat_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
>  {
>  	return 1;
> @@ -164,7 +166,7 @@ static int flat_phys_pkg_id(int initial_
>  	return initial_apic_id >> index_msb;
>  }
>  
> -struct apic apic_flat =  {
> +static struct apic apic_flat =  {
>  	.name				= "flat",
>  	.probe				= NULL,
>  	.acpi_madt_oem_check		= flat_acpi_madt_oem_check,
> @@ -320,7 +322,7 @@ static int physflat_probe(void)
>  	return 0;
>  }
>  
> -struct apic apic_physflat =  {
> +static struct apic apic_physflat =  {
>  
>  	.name				= "physical flat",
>  	.probe				= physflat_probe,
> @@ -377,3 +379,8 @@ struct apic apic_physflat =  {
>  	.wait_icr_idle			= native_apic_wait_icr_idle,
>  	.safe_wait_icr_idle		= native_safe_apic_wait_icr_idle,
>  };
> +
> +/*
> + * We need to check for physflat first, so this order is important.
> + */
> +apic_drivers(apic_physflat, apic_flat);
> Index: linux-2.6-tip/arch/x86/kernel/apic/probe_64.c
> ===================================================================
> --- linux-2.6-tip.orig/arch/x86/kernel/apic/probe_64.c
> +++ linux-2.6-tip/arch/x86/kernel/apic/probe_64.c
> @@ -23,27 +23,9 @@
>  #include <asm/ipi.h>
>  #include <asm/setup.h>
>  
> -extern struct apic apic_flat;
> -extern struct apic apic_physflat;
> -extern struct apic apic_x2xpic_uv_x;
> -extern struct apic apic_x2apic_phys;
> -extern struct apic apic_x2apic_cluster;
> -
> -struct apic __read_mostly *apic = &apic_flat;
> +struct apic __read_mostly *apic;
>  EXPORT_SYMBOL_GPL(apic);
>  
> -static struct apic *apic_probe[] __initdata = {
> -#ifdef CONFIG_X86_UV
> -	&apic_x2apic_uv_x,
> -#endif
> -#ifdef CONFIG_X86_X2APIC
> -	&apic_x2apic_phys,
> -	&apic_x2apic_cluster,
> -#endif
> -	&apic_physflat,
> -	NULL,
> -};
> -
>  static int apicid_phys_pkg_id(int initial_apic_id, int index_msb)
>  {
>  	return hard_smp_processor_id() >> index_msb;
> @@ -54,19 +36,19 @@ static int apicid_phys_pkg_id(int initia
>   */
>  void __init default_setup_apic_routing(void)
>  {
> -	int i;
> +	struct apic **drv;
>  
>  	enable_IR_x2apic();
>  
> -	for (i = 0; apic_probe[i]; ++i) {
> -		if (apic_probe[i]->probe()) {
> -			apic = apic_probe[i];
> +	for (drv = __apicdrivers; drv < __apicdrivers_end; drv++) {
> +		if ((*drv)->probe()) {
> +			apic = *drv;
> +			printk(KERN_INFO "APIC routing finalized to %s.\n",
> +			       apic->name);
>  			break;
>  		}
>  	}

can you change to:

+	for (drv = __apicdrivers; drv < __apicdrivers_end; drv++) {
+		if ((*drv)->probe()) {
+			if (apic != *drv) {
+				apic = *drv;				
+				printk(KERN_INFO "Changing APIC routing to %s.\n",
+				       apic->name);
+			}
 			break;
 		}
 	}

Thanks

Yinghai

  parent reply	other threads:[~2011-05-20 14:26 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-19 23:45 [patch 0/6] x86: x2apic cluster optimizations and apic probe cleanups Suresh Siddha
2011-05-19 23:45 ` [patch 1/6] x84_64, apic: use probe routines to simplify apic selection Suresh Siddha
2011-05-20 13:40   ` [tip:x86/apic] x86, apic: Use " tip-bot for Suresh Siddha
2011-05-19 23:45 ` [patch 2/6] x86, x2apic: remove duplicate code for IPI mask routines Suresh Siddha
2011-05-20 13:41   ` [tip:x86/apic] x86, x2apic: Remove " tip-bot for Suresh Siddha
2011-05-19 23:45 ` [patch 3/6] x86, x2apic: track the x2apic cluster sibling map Suresh Siddha
2011-05-20 13:41   ` [tip:x86/apic] x86, x2apic: Track " tip-bot for Cyrill Gorcunov
2011-05-19 23:45 ` [patch 4/6] x86, x2apic: minimize IPI register writes using cluster groups Suresh Siddha
2011-05-20 13:42   ` [tip:x86/apic] x86, x2apic: Minimize " tip-bot for Cyrill Gorcunov
2011-05-19 23:45 ` [patch 5/6] x86, x2apic: move the common bits to x2apic.h Suresh Siddha
2011-05-20 13:42   ` [tip:x86/apic] x86, x2apic: Move " tip-bot for Cyrill Gorcunov
2011-05-19 23:45 ` [patch 6/6] x86, apic: use .apicdrivers section to find the list of apic drivers Suresh Siddha
2011-05-20 13:01   ` Ingo Molnar
2011-05-20 17:41     ` Suresh Siddha
2011-05-20 14:26   ` Yinghai Lu [this message]
2011-05-20 14:35   ` Cyrill Gorcunov

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=4DD679F8.10002@kernel.org \
    --to=yinghai@kernel.org \
    --cc=gorcunov@openvz.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=steiner@sgi.com \
    --cc=suresh.b.siddha@intel.com \
    --cc=tglx@linutronix.de \
    /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

Powered by JetHome