All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/10] x86: clean up using smp_register_lapic_address()
@ 2010-08-07  2:15 Yinghai Lu
  2010-08-07  2:15 ` [PATCH 01/10] x86: Fix lapic mapping with construct ISA and visws mptable path Yinghai Lu
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: Yinghai Lu @ 2010-08-07  2:15 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner, H. Peter Anvin
  Cc: Andrew Morton, Eric W. Biederman, linux-kernel, Yinghai Lu

Merge acpi_register_lapic_address, smp_register_lapic_address, sfi_register_lapic_address

Thanks

Yinghai Lu

[PATCH 01/10] x86: Fix lapic mapping with construct ISA and visws mptable path
[PATCH 02/10] x86, acpi: merge two register_lapic_address()
[PATCH 03/10] x86: remove early_init_lapic_mapping
[PATCH 04/10] x86: call smp_register_lapic_address for contruct_default mptable path
[PATCH 05/10] x86, apic: use smp_register_lapic_address in init_apic_mapping
[PATCH 06/10] x86, sfi: used smp_register_lapic_address
[PATCH 07/10] x86,visws: set_fixmap in find_smp_config
[PATCH 08/10] x86: !find_smp_config path use smp_register_lapic_address
[PATCH 09/10] x86, apic: set fixmap only one time
[PATCH 10/10] x86, ioapic: only print mapping for ioapic in right place

 arch/x86/include/asm/apic.h    |    2 +-
 arch/x86/kernel/acpi/boot.c    |   16 +----------
 arch/x86/kernel/apic/apic.c    |   54 +++++++++++++++++----------------------
 arch/x86/kernel/apic/io_apic.c |   11 +++++---
 arch/x86/kernel/mpparse.c      |   24 +++--------------
 arch/x86/kernel/sfi.c          |   13 +---------
 arch/x86/kernel/visws_quirks.c |    1 +
 arch/x86/mm/k8topology_64.c    |    1 -
 8 files changed, 40 insertions(+), 82 deletions(-)

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 01/10] x86: Fix lapic mapping with construct ISA and visws mptable path
  2010-08-07  2:15 [PATCH 00/10] x86: clean up using smp_register_lapic_address() Yinghai Lu
@ 2010-08-07  2:15 ` Yinghai Lu
  2010-08-07  2:15 ` [PATCH 02/10] x86, acpi: merge two register_lapic_address() Yinghai Lu
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Yinghai Lu @ 2010-08-07  2:15 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner, H. Peter Anvin
  Cc: Andrew Morton, Eric W. Biederman, linux-kernel, Yinghai Lu

do need to set lapic mapping for them

in arch/x86/kernel/visws_quirks.c:
we only have visws_find_smp_config() to set mp_lapic_addr to APIC_DEFAULT_PHYS_BASE
visws_get_smp_config() is nop call.
default_get_smp_config/check_physptr/smp_read_mpc is not called in the path.
So smp_register_lapic_address() is not called, and lapic is not mapped.


in arch/x86/kernel/mpparse.c
if mpf->feature1 != 0, it will go through contruct_default_ISA_mptable instead
of check_phystr path, so smp_register_lapic_address is not called.

those two path all have smp_found_config set.

So let remove !smp_found_config checking

Actually set fixmap two times does not hurt.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
---
 arch/x86/kernel/apic/apic.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index e3b534c..980508c 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -1606,7 +1606,7 @@ void __init init_apic_mappings(void)
 		 * acpi lapic path already maps that address in
 		 * acpi_register_lapic_address()
 		 */
-		if (!acpi_lapic && !smp_found_config)
+		if (!acpi_lapic)
 			set_fixmap_nocache(FIX_APIC_BASE, apic_phys);
 
 		apic_printk(APIC_VERBOSE, "mapped APIC to %08lx (%08lx)\n",
-- 
1.6.4.2


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 02/10] x86, acpi: merge two register_lapic_address()
  2010-08-07  2:15 [PATCH 00/10] x86: clean up using smp_register_lapic_address() Yinghai Lu
  2010-08-07  2:15 ` [PATCH 01/10] x86: Fix lapic mapping with construct ISA and visws mptable path Yinghai Lu
@ 2010-08-07  2:15 ` Yinghai Lu
  2010-08-07  2:15 ` [PATCH 03/10] x86: remove early_init_lapic_mapping Yinghai Lu
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Yinghai Lu @ 2010-08-07  2:15 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner, H. Peter Anvin
  Cc: Andrew Morton, Eric W. Biederman, linux-kernel, Yinghai Lu

They are the same, move it to apic.c

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
---
 arch/x86/include/asm/apic.h |    1 +
 arch/x86/kernel/acpi/boot.c |   16 ++--------------
 arch/x86/kernel/apic/apic.c |   12 ++++++++++++
 arch/x86/kernel/mpparse.c   |   12 ------------
 4 files changed, 15 insertions(+), 26 deletions(-)

diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
index 1fa03e0..dd2a9b1 100644
--- a/arch/x86/include/asm/apic.h
+++ b/arch/x86/include/asm/apic.h
@@ -234,6 +234,7 @@ extern void init_bsp_APIC(void);
 extern void setup_local_APIC(void);
 extern void end_local_APIC_setup(void);
 extern void init_apic_mappings(void);
+void smp_register_lapic_address(unsigned long address);
 extern void setup_boot_APIC_clock(void);
 extern void setup_secondary_APIC_clock(void);
 extern int APIC_init_uniprocessor(void);
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index c05872a..f9f1bc5 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -820,18 +820,6 @@ static int __init acpi_parse_fadt(struct acpi_table_header *table)
  * returns 0 on success, < 0 on error
  */
 
-static void __init acpi_register_lapic_address(unsigned long address)
-{
-	mp_lapic_addr = address;
-
-	set_fixmap_nocache(FIX_APIC_BASE, address);
-	if (boot_cpu_physical_apicid == -1U) {
-		boot_cpu_physical_apicid  = read_apic_id();
-		apic_version[boot_cpu_physical_apicid] =
-			 GET_APIC_VERSION(apic_read(APIC_LVR));
-	}
-}
-
 static int __init early_acpi_parse_madt_lapic_addr_ovr(void)
 {
 	int count;
@@ -853,7 +841,7 @@ static int __init early_acpi_parse_madt_lapic_addr_ovr(void)
 		return count;
 	}
 
-	acpi_register_lapic_address(acpi_lapic_addr);
+	smp_register_lapic_address(acpi_lapic_addr);
 
 	return count;
 }
@@ -880,7 +868,7 @@ static int __init acpi_parse_madt_lapic_entries(void)
 		return count;
 	}
 
-	acpi_register_lapic_address(acpi_lapic_addr);
+	smp_register_lapic_address(acpi_lapic_addr);
 
 	count = acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_SAPIC,
 				      acpi_parse_sapic, MAX_APICS);
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 980508c..19a74b7 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -1632,6 +1632,18 @@ void __init init_apic_mappings(void)
 	}
 }
 
+void __init smp_register_lapic_address(unsigned long address)
+{
+	mp_lapic_addr = address;
+
+	set_fixmap_nocache(FIX_APIC_BASE, address);
+	if (boot_cpu_physical_apicid == -1U) {
+		boot_cpu_physical_apicid  = read_apic_id();
+		apic_version[boot_cpu_physical_apicid] =
+			 GET_APIC_VERSION(apic_read(APIC_LVR));
+	}
+}
+
 /*
  * This initializes the IO-APIC and APIC hardware if this is
  * a UP kernel.
diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c
index d7b6f7f..da0353a 100644
--- a/arch/x86/kernel/mpparse.c
+++ b/arch/x86/kernel/mpparse.c
@@ -274,18 +274,6 @@ static void __init smp_dump_mptable(struct mpc_table *mpc, unsigned char *mpt)
 
 void __init default_smp_read_mpc_oem(struct mpc_table *mpc) { }
 
-static void __init smp_register_lapic_address(unsigned long address)
-{
-	mp_lapic_addr = address;
-
-	set_fixmap_nocache(FIX_APIC_BASE, address);
-	if (boot_cpu_physical_apicid == -1U) {
-		boot_cpu_physical_apicid  = read_apic_id();
-		apic_version[boot_cpu_physical_apicid] =
-			 GET_APIC_VERSION(apic_read(APIC_LVR));
-	}
-}
-
 static int __init smp_read_mpc(struct mpc_table *mpc, unsigned early)
 {
 	char str[16];
-- 
1.6.4.2


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 03/10] x86: remove early_init_lapic_mapping
  2010-08-07  2:15 [PATCH 00/10] x86: clean up using smp_register_lapic_address() Yinghai Lu
  2010-08-07  2:15 ` [PATCH 01/10] x86: Fix lapic mapping with construct ISA and visws mptable path Yinghai Lu
  2010-08-07  2:15 ` [PATCH 02/10] x86, acpi: merge two register_lapic_address() Yinghai Lu
@ 2010-08-07  2:15 ` Yinghai Lu
  2010-08-07  2:15 ` [PATCH 04/10] x86: call smp_register_lapic_address for contruct_default mptable path Yinghai Lu
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Yinghai Lu @ 2010-08-07  2:15 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner, H. Peter Anvin
  Cc: Andrew Morton, Eric W. Biederman, linux-kernel, Yinghai Lu

It is almost the same as smp_register_lapic_addr()

Just need to make smp_read_mpc() call smp_register_lapic_addr when early==1.

also add printing out in smp_register_lapic_address()

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
---
 arch/x86/include/asm/apic.h |    1 -
 arch/x86/kernel/apic/apic.c |   24 ++----------------------
 arch/x86/kernel/mpparse.c   |    8 ++------
 arch/x86/mm/k8topology_64.c |    1 -
 4 files changed, 4 insertions(+), 30 deletions(-)

diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
index dd2a9b1..171b6ab 100644
--- a/arch/x86/include/asm/apic.h
+++ b/arch/x86/include/asm/apic.h
@@ -244,7 +244,6 @@ extern void enable_NMI_through_LVT0(void);
  * On 32bit this is mach-xxx local
  */
 #ifdef CONFIG_X86_64
-extern void early_init_lapic_mapping(void);
 extern int apic_is_clustered_box(void);
 #else
 static inline int apic_is_clustered_box(void)
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 19a74b7..95a31b1 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -1560,28 +1560,6 @@ no_apic:
 }
 #endif
 
-#ifdef CONFIG_X86_64
-void __init early_init_lapic_mapping(void)
-{
-	/*
-	 * If no local APIC can be found then go out
-	 * : it means there is no mpatable and MADT
-	 */
-	if (!smp_found_config)
-		return;
-
-	set_fixmap_nocache(FIX_APIC_BASE, mp_lapic_addr);
-	apic_printk(APIC_VERBOSE, "mapped APIC to %16lx (%16lx)\n",
-		    APIC_BASE, mp_lapic_addr);
-
-	/*
-	 * Fetch the APIC ID of the BSP in case we have a
-	 * default configuration (or the MP table is broken).
-	 */
-	boot_cpu_physical_apicid = read_apic_id();
-}
-#endif
-
 /**
  * init_apic_mappings - initialize APIC mappings
  */
@@ -1637,6 +1615,8 @@ void __init smp_register_lapic_address(unsigned long address)
 	mp_lapic_addr = address;
 
 	set_fixmap_nocache(FIX_APIC_BASE, address);
+	apic_printk(APIC_VERBOSE, "mapped APIC to %16lx (%16lx)\n",
+		    APIC_BASE, mp_lapic_addr);
 	if (boot_cpu_physical_apicid == -1U) {
 		boot_cpu_physical_apicid  = read_apic_id();
 		apic_version[boot_cpu_physical_apicid] =
diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c
index da0353a..3e25213 100644
--- a/arch/x86/kernel/mpparse.c
+++ b/arch/x86/kernel/mpparse.c
@@ -288,17 +288,13 @@ static int __init smp_read_mpc(struct mpc_table *mpc, unsigned early)
 #ifdef CONFIG_X86_32
 	generic_mps_oem_check(mpc, oem, str);
 #endif
-	/* save the local APIC address, it might be non-default */
+	/* Initialize the lapic mapping */
 	if (!acpi_lapic)
-		mp_lapic_addr = mpc->lapic;
+		smp_register_lapic_address(mpc->lapic);
 
 	if (early)
 		return 1;
 
-	/* Initialize the lapic mapping */
-	if (!acpi_lapic)
-		smp_register_lapic_address(mpc->lapic);
-
 	if (mpc->oemptr)
 		x86_init.mpparse.smp_read_mpc_oem(mpc);
 
diff --git a/arch/x86/mm/k8topology_64.c b/arch/x86/mm/k8topology_64.c
index 970ed57..ef9b8be 100644
--- a/arch/x86/mm/k8topology_64.c
+++ b/arch/x86/mm/k8topology_64.c
@@ -64,7 +64,6 @@ static __init void early_get_boot_cpu_id(void)
 	if (smp_found_config)
 		early_get_smp_config();
 #endif
-	early_init_lapic_mapping();
 }
 
 int __init k8_get_nodes(struct bootnode *physnodes)
-- 
1.6.4.2


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 04/10] x86: call smp_register_lapic_address for contruct_default mptable path
  2010-08-07  2:15 [PATCH 00/10] x86: clean up using smp_register_lapic_address() Yinghai Lu
                   ` (2 preceding siblings ...)
  2010-08-07  2:15 ` [PATCH 03/10] x86: remove early_init_lapic_mapping Yinghai Lu
@ 2010-08-07  2:15 ` Yinghai Lu
  2010-08-07  2:15 ` [PATCH 05/10] x86, apic: use smp_register_lapic_address in init_apic_mapping Yinghai Lu
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Yinghai Lu @ 2010-08-07  2:15 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner, H. Peter Anvin
  Cc: Andrew Morton, Eric W. Biederman, linux-kernel, Yinghai Lu

because it already finds smp config.

make it like other find_smp_config path

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
---
 arch/x86/kernel/mpparse.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c
index 3e25213..bd63a42 100644
--- a/arch/x86/kernel/mpparse.c
+++ b/arch/x86/kernel/mpparse.c
@@ -480,7 +480,7 @@ static inline void __init construct_default_ISA_mptable(int mpc_default_type)
 	/*
 	 * local APIC has default address
 	 */
-	mp_lapic_addr = APIC_DEFAULT_PHYS_BASE;
+	smp_register_lapic_address(APIC_DEFAULT_PHYS_BASE);
 
 	/*
 	 * 2 CPUs, numbered 0 & 1.
@@ -616,7 +616,7 @@ void __init default_get_smp_config(unsigned int early)
 			/*
 			 * local APIC has default address
 			 */
-			mp_lapic_addr = APIC_DEFAULT_PHYS_BASE;
+			smp_register_lapic_address(APIC_DEFAULT_PHYS_BASE);
 			return;
 		}
 
-- 
1.6.4.2


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 05/10] x86, apic: use smp_register_lapic_address in init_apic_mapping
  2010-08-07  2:15 [PATCH 00/10] x86: clean up using smp_register_lapic_address() Yinghai Lu
                   ` (3 preceding siblings ...)
  2010-08-07  2:15 ` [PATCH 04/10] x86: call smp_register_lapic_address for contruct_default mptable path Yinghai Lu
@ 2010-08-07  2:15 ` Yinghai Lu
  2010-08-07  2:15 ` [PATCH 06/10] x86, sfi: used smp_register_lapic_address Yinghai Lu
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Yinghai Lu @ 2010-08-07  2:15 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner, H. Peter Anvin
  Cc: Andrew Morton, Eric W. Biederman, linux-kernel, Yinghai Lu

so if set_fixmap_nocache is not called, don't print out anything

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
---
 arch/x86/kernel/apic/apic.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 95a31b1..3d3d3da 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -1585,10 +1585,7 @@ void __init init_apic_mappings(void)
 		 * acpi_register_lapic_address()
 		 */
 		if (!acpi_lapic)
-			set_fixmap_nocache(FIX_APIC_BASE, apic_phys);
-
-		apic_printk(APIC_VERBOSE, "mapped APIC to %08lx (%08lx)\n",
-					APIC_BASE, apic_phys);
+			smp_register_lapic_address(apic_phys);
 	}
 
 	/*
-- 
1.6.4.2


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 06/10] x86, sfi: used smp_register_lapic_address
  2010-08-07  2:15 [PATCH 00/10] x86: clean up using smp_register_lapic_address() Yinghai Lu
                   ` (4 preceding siblings ...)
  2010-08-07  2:15 ` [PATCH 05/10] x86, apic: use smp_register_lapic_address in init_apic_mapping Yinghai Lu
@ 2010-08-07  2:15 ` Yinghai Lu
  2010-08-07  2:15 ` [PATCH 07/10] x86,visws: set_fixmap in find_smp_config Yinghai Lu
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Yinghai Lu @ 2010-08-07  2:15 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner, H. Peter Anvin
  Cc: Andrew Morton, Eric W. Biederman, linux-kernel, Yinghai Lu

kill mp_sfi_register_lapic_address, they are the same

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
---
 arch/x86/kernel/sfi.c |   13 +------------
 1 files changed, 1 insertions(+), 12 deletions(-)

diff --git a/arch/x86/kernel/sfi.c b/arch/x86/kernel/sfi.c
index cb22acf..cfcd5b1 100644
--- a/arch/x86/kernel/sfi.c
+++ b/arch/x86/kernel/sfi.c
@@ -34,17 +34,6 @@
 #ifdef CONFIG_X86_LOCAL_APIC
 static unsigned long sfi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE;
 
-void __init mp_sfi_register_lapic_address(unsigned long address)
-{
-	mp_lapic_addr = address;
-
-	set_fixmap_nocache(FIX_APIC_BASE, mp_lapic_addr);
-	if (boot_cpu_physical_apicid == -1U)
-		boot_cpu_physical_apicid = read_apic_id();
-
-	pr_info("Boot CPU = %d\n", boot_cpu_physical_apicid);
-}
-
 /* All CPUs enumerated by SFI must be present and enabled */
 void __cpuinit mp_sfi_register_lapic(u8 id)
 {
@@ -110,7 +99,7 @@ static int __init sfi_parse_ioapic(struct sfi_table_header *table)
 int __init sfi_platform_init(void)
 {
 #ifdef CONFIG_X86_LOCAL_APIC
-	mp_sfi_register_lapic_address(sfi_lapic_addr);
+	smp_register_lapic_address(sfi_lapic_addr);
 	sfi_table_parse(SFI_SIG_CPUS, NULL, NULL, sfi_parse_cpus);
 #endif
 #ifdef CONFIG_X86_IO_APIC
-- 
1.6.4.2


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 07/10] x86,visws: set_fixmap in find_smp_config
  2010-08-07  2:15 [PATCH 00/10] x86: clean up using smp_register_lapic_address() Yinghai Lu
                   ` (5 preceding siblings ...)
  2010-08-07  2:15 ` [PATCH 06/10] x86, sfi: used smp_register_lapic_address Yinghai Lu
@ 2010-08-07  2:15 ` Yinghai Lu
  2010-08-07  2:15 ` [PATCH 08/10] x86: !find_smp_config path use smp_register_lapic_address Yinghai Lu
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Yinghai Lu @ 2010-08-07  2:15 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner, H. Peter Anvin
  Cc: Andrew Morton, Eric W. Biederman, linux-kernel, Yinghai Lu

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
---
 arch/x86/kernel/visws_quirks.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/visws_quirks.c b/arch/x86/kernel/visws_quirks.c
index e680ea5..f8259cd 100644
--- a/arch/x86/kernel/visws_quirks.c
+++ b/arch/x86/kernel/visws_quirks.c
@@ -214,6 +214,7 @@ static void __init visws_find_smp_config(void)
 		MP_processor_info(mp++);
 
 	mp_lapic_addr = APIC_DEFAULT_PHYS_BASE;
+	set_fixmap(FIX_APIC_BASE, APIC_DEFAULT_PHYS_BASE);
 }
 
 static void visws_trap_init(void);
-- 
1.6.4.2


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 08/10] x86: !find_smp_config path use smp_register_lapic_address
  2010-08-07  2:15 [PATCH 00/10] x86: clean up using smp_register_lapic_address() Yinghai Lu
                   ` (6 preceding siblings ...)
  2010-08-07  2:15 ` [PATCH 07/10] x86,visws: set_fixmap in find_smp_config Yinghai Lu
@ 2010-08-07  2:15 ` Yinghai Lu
  2010-08-07  2:15 ` [PATCH 09/10] x86, apic: set fixmap only one time Yinghai Lu
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Yinghai Lu @ 2010-08-07  2:15 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner, H. Peter Anvin
  Cc: Andrew Morton, Eric W. Biederman, linux-kernel, Yinghai Lu

so fixmap will be setup there.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
---
 arch/x86/kernel/apic/apic.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 3d3d3da..2c9aa63 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -1477,7 +1477,7 @@ static int __init detect_init_APIC(void)
 		return -1;
 	}
 
-	mp_lapic_addr = APIC_DEFAULT_PHYS_BASE;
+	smp_register_lapic_addr(APIC_DEFAULT_PHYS_BASE);
 	return 0;
 }
 #else
@@ -1487,6 +1487,7 @@ static int __init detect_init_APIC(void)
 static int __init detect_init_APIC(void)
 {
 	u32 h, l, features;
+	unsigned long lapic_addr;
 
 	/* Disabled by kernel option? */
 	if (disable_apic)
@@ -1541,13 +1542,14 @@ static int __init detect_init_APIC(void)
 		return -1;
 	}
 	set_cpu_cap(&boot_cpu_data, X86_FEATURE_APIC);
-	mp_lapic_addr = APIC_DEFAULT_PHYS_BASE;
+	lapic_addr = APIC_DEFAULT_PHYS_BASE;
 
 	/* The BIOS may have set up the APIC at some other address */
 	rdmsr(MSR_IA32_APICBASE, l, h);
 	if (l & MSR_IA32_APICBASE_ENABLE)
-		mp_lapic_addr = l & MSR_IA32_APICBASE_BASE;
+		lapic_addr = l & MSR_IA32_APICBASE_BASE;
 
+	smp_register_lapic_address(lapic_addr)
 	pr_info("Found and enabled local APIC!\n");
 
 	apic_pm_activate();
-- 
1.6.4.2


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 09/10] x86, apic: set fixmap only one time
  2010-08-07  2:15 [PATCH 00/10] x86: clean up using smp_register_lapic_address() Yinghai Lu
                   ` (7 preceding siblings ...)
  2010-08-07  2:15 ` [PATCH 08/10] x86: !find_smp_config path use smp_register_lapic_address Yinghai Lu
@ 2010-08-07  2:15 ` Yinghai Lu
  2010-08-07  2:15 ` [PATCH 10/10] x86, ioapic: only print mapping for ioapic in right place Yinghai Lu
  2010-08-14 20:35 ` [PATCH -v2 08/10] x86: !find_smp_config path use smp_register_lapic_address Yinghai Lu
  10 siblings, 0 replies; 12+ messages in thread
From: Yinghai Lu @ 2010-08-07  2:15 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner, H. Peter Anvin
  Cc: Andrew Morton, Eric W. Biederman, linux-kernel, Yinghai Lu

check if mp_lapic_addr is assigned or not.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
---
 arch/x86/kernel/apic/apic.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 2c9aa63..198131b 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -1611,6 +1611,9 @@ void __init init_apic_mappings(void)
 
 void __init smp_register_lapic_address(unsigned long address)
 {
+	if (mp_lapic_addr)
+		return;
+
 	mp_lapic_addr = address;
 
 	set_fixmap_nocache(FIX_APIC_BASE, address);
-- 
1.6.4.2


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 10/10] x86, ioapic: only print mapping for ioapic in right place
  2010-08-07  2:15 [PATCH 00/10] x86: clean up using smp_register_lapic_address() Yinghai Lu
                   ` (8 preceding siblings ...)
  2010-08-07  2:15 ` [PATCH 09/10] x86, apic: set fixmap only one time Yinghai Lu
@ 2010-08-07  2:15 ` Yinghai Lu
  2010-08-14 20:35 ` [PATCH -v2 08/10] x86: !find_smp_config path use smp_register_lapic_address Yinghai Lu
  10 siblings, 0 replies; 12+ messages in thread
From: Yinghai Lu @ 2010-08-07  2:15 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner, H. Peter Anvin
  Cc: Andrew Morton, Eric W. Biederman, linux-kernel, Yinghai Lu

when mapping does happen.

And only map ioapic address one time when mp_register_ioapic() is called.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
---
 arch/x86/kernel/apic/io_apic.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 4dc0084..badf10e 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -4192,11 +4192,11 @@ fake_ioapic_page:
 #endif
 			ioapic_phys = (unsigned long)alloc_bootmem_pages(PAGE_SIZE);
 			ioapic_phys = __pa(ioapic_phys);
+			set_fixmap_nocache(idx, ioapic_phys);
+			apic_printk(APIC_VERBOSE, "mapped IOAPIC to %08lx (%08lx)\n",
+				__fix_to_virt(idx) + (ioapic_phys & ~PAGE_MASK),
+				ioapic_phys);
 		}
-		set_fixmap_nocache(idx, ioapic_phys);
-		apic_printk(APIC_VERBOSE, "mapped IOAPIC to %08lx (%08lx)\n",
-			__fix_to_virt(idx) + (ioapic_phys & ~PAGE_MASK),
-			ioapic_phys);
 		idx++;
 
 		ioapic_res->start = ioapic_phys;
@@ -4278,6 +4278,9 @@ void __init mp_register_ioapic(int id, u32 address, u32 gsi_base)
 	mp_ioapics[idx].apicaddr = address;
 
 	set_fixmap_nocache(FIX_IO_APIC_BASE_0 + idx, address);
+	apic_printk(APIC_VERBOSE, "mapped IOAPIC to %08lx (%08x)\n",
+			__fix_to_virt(FIX_IO_APIC_BASE_0 + idx) + (address & ~PAGE_MASK),
+			address);
 	mp_ioapics[idx].apicid = io_apic_unique_id(id);
 	mp_ioapics[idx].apicver = io_apic_get_version(idx);
 
-- 
1.6.4.2


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH -v2 08/10] x86: !find_smp_config path use smp_register_lapic_address
  2010-08-07  2:15 [PATCH 00/10] x86: clean up using smp_register_lapic_address() Yinghai Lu
                   ` (9 preceding siblings ...)
  2010-08-07  2:15 ` [PATCH 10/10] x86, ioapic: only print mapping for ioapic in right place Yinghai Lu
@ 2010-08-14 20:35 ` Yinghai Lu
  10 siblings, 0 replies; 12+ messages in thread
From: Yinghai Lu @ 2010-08-14 20:35 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner, H. Peter Anvin
  Cc: Andrew Morton, Eric W. Biederman, linux-kernel, Yinghai Lu

so fixmap will be setup there.

-v2: fix typo

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
---
 arch/x86/kernel/apic/apic.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 3d3d3da..2c9aa63 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -1477,7 +1477,7 @@ static int __init detect_init_APIC(void)
 		return -1;
 	}
 
-	mp_lapic_addr = APIC_DEFAULT_PHYS_BASE;
+	smp_register_lapic_address(APIC_DEFAULT_PHYS_BASE);
 	return 0;
 }
 #else
@@ -1487,6 +1487,7 @@ static int __init detect_init_APIC(void)
 static int __init detect_init_APIC(void)
 {
 	u32 h, l, features;
+	unsigned long lapic_addr;
 
 	/* Disabled by kernel option? */
 	if (disable_apic)
@@ -1541,13 +1542,14 @@ static int __init detect_init_APIC(void)
 		return -1;
 	}
 	set_cpu_cap(&boot_cpu_data, X86_FEATURE_APIC);
-	mp_lapic_addr = APIC_DEFAULT_PHYS_BASE;
+	lapic_addr = APIC_DEFAULT_PHYS_BASE;
 
 	/* The BIOS may have set up the APIC at some other address */
 	rdmsr(MSR_IA32_APICBASE, l, h);
 	if (l & MSR_IA32_APICBASE_ENABLE)
-		mp_lapic_addr = l & MSR_IA32_APICBASE_BASE;
+		lapic_addr = l & MSR_IA32_APICBASE_BASE;
 
+	smp_register_lapic_address(lapic_addr);
 	pr_info("Found and enabled local APIC!\n");
 
 	apic_pm_activate();
-- 
1.6.4.2

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2010-08-14 20:36 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-07  2:15 [PATCH 00/10] x86: clean up using smp_register_lapic_address() Yinghai Lu
2010-08-07  2:15 ` [PATCH 01/10] x86: Fix lapic mapping with construct ISA and visws mptable path Yinghai Lu
2010-08-07  2:15 ` [PATCH 02/10] x86, acpi: merge two register_lapic_address() Yinghai Lu
2010-08-07  2:15 ` [PATCH 03/10] x86: remove early_init_lapic_mapping Yinghai Lu
2010-08-07  2:15 ` [PATCH 04/10] x86: call smp_register_lapic_address for contruct_default mptable path Yinghai Lu
2010-08-07  2:15 ` [PATCH 05/10] x86, apic: use smp_register_lapic_address in init_apic_mapping Yinghai Lu
2010-08-07  2:15 ` [PATCH 06/10] x86, sfi: used smp_register_lapic_address Yinghai Lu
2010-08-07  2:15 ` [PATCH 07/10] x86,visws: set_fixmap in find_smp_config Yinghai Lu
2010-08-07  2:15 ` [PATCH 08/10] x86: !find_smp_config path use smp_register_lapic_address Yinghai Lu
2010-08-07  2:15 ` [PATCH 09/10] x86, apic: set fixmap only one time Yinghai Lu
2010-08-07  2:15 ` [PATCH 10/10] x86, ioapic: only print mapping for ioapic in right place Yinghai Lu
2010-08-14 20:35 ` [PATCH -v2 08/10] x86: !find_smp_config path use smp_register_lapic_address Yinghai Lu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.