All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch 01/10] x86: use BUILD_BUG_ON() for the size of struct intel_mp_floating
       [not found] <20080419145510.150338641@gmail.com>
@ 2008-04-19 14:55 ` Akinobu Mita
  2008-04-19 14:55 ` [patch 02/10] x86: use MP_intsrc_info() Akinobu Mita
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 10+ messages in thread
From: Akinobu Mita @ 2008-04-19 14:55 UTC (permalink / raw)
  To: linux-kernel; +Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin

[-- Attachment #1: x86-use-build-bug-on.patch --]
[-- Type: text/plain, Size: 917 bytes --]

Use BUILD_BUG_ON() instead of compile-time error technique with
extern non-exsistent function.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
---
 arch/x86/kernel/mpparse.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Index: 2.6-git/arch/x86/kernel/mpparse.c
===================================================================
--- 2.6-git.orig/arch/x86/kernel/mpparse.c
+++ 2.6-git/arch/x86/kernel/mpparse.c
@@ -686,13 +686,11 @@ void __init get_smp_config(void)
 static int __init smp_scan_config(unsigned long base, unsigned long length,
 				  unsigned reserve)
 {
-	extern void __bad_mpf_size(void);
 	unsigned int *bp = phys_to_virt(base);
 	struct intel_mp_floating *mpf;
 
 	Dprintk("Scan SMP from %p for %ld bytes.\n", bp, length);
-	if (sizeof(*mpf) != 16)
-		__bad_mpf_size();
+	BUILD_BUG_ON(sizeof(*mpf) != 16);
 
 	while (length > 0) {
 		mpf = (struct intel_mp_floating *)bp;

-- 

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

* [patch 02/10] x86: use MP_intsrc_info()
       [not found] <20080419145510.150338641@gmail.com>
  2008-04-19 14:55 ` [patch 01/10] x86: use BUILD_BUG_ON() for the size of struct intel_mp_floating Akinobu Mita
@ 2008-04-19 14:55 ` Akinobu Mita
  2008-04-19 14:55 ` [patch 03/10] x86: use bitmap library for pin_programmed Akinobu Mita
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 10+ messages in thread
From: Akinobu Mita @ 2008-04-19 14:55 UTC (permalink / raw)
  To: linux-kernel; +Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin

[-- Attachment #1: x86-use-MP_intsrc_info.patch --]
[-- Type: text/plain, Size: 1553 bytes --]

Remove duplicate code by using MP_intsrc_info() in mpparse.c

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
---
 arch/x86/kernel/mpparse.c |   19 ++-----------------
 1 file changed, 2 insertions(+), 17 deletions(-)

Index: 2.6-git/arch/x86/kernel/mpparse.c
===================================================================
--- 2.6-git.orig/arch/x86/kernel/mpparse.c
+++ 2.6-git/arch/x86/kernel/mpparse.c
@@ -907,14 +907,7 @@ void __init mp_override_legacy_irq(u8 bu
 	intsrc.mpc_dstapic = mp_ioapics[ioapic].mpc_apicid;	/* APIC ID */
 	intsrc.mpc_dstirq = pin;	/* INTIN# */
 
-	Dprintk("Int: type %d, pol %d, trig %d, bus %d, irq %d, %d-%d\n",
-		intsrc.mpc_irqtype, intsrc.mpc_irqflag & 3,
-		(intsrc.mpc_irqflag >> 2) & 3, intsrc.mpc_srcbus,
-		intsrc.mpc_srcbusirq, intsrc.mpc_dstapic, intsrc.mpc_dstirq);
-
-	mp_irqs[mp_irq_entries] = intsrc;
-	if (++mp_irq_entries == MAX_IRQ_SOURCES)
-		panic("Max # of irq sources exceeded!\n");
+	MP_intsrc_info(&intsrc);
 }
 
 int es7000_plat;
@@ -983,15 +976,7 @@ void __init mp_config_acpi_legacy_irqs(v
 		intsrc.mpc_srcbusirq = i;	/* Identity mapped */
 		intsrc.mpc_dstirq = i;
 
-		Dprintk("Int: type %d, pol %d, trig %d, bus %d, irq %d, "
-			"%d-%d\n", intsrc.mpc_irqtype, intsrc.mpc_irqflag & 3,
-			(intsrc.mpc_irqflag >> 2) & 3, intsrc.mpc_srcbus,
-			intsrc.mpc_srcbusirq, intsrc.mpc_dstapic,
-			intsrc.mpc_dstirq);
-
-		mp_irqs[mp_irq_entries] = intsrc;
-		if (++mp_irq_entries == MAX_IRQ_SOURCES)
-			panic("Max # of irq sources exceeded!\n");
+		MP_intsrc_info(&intsrc);
 	}
 }
 

-- 

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

* [patch 03/10] x86: use bitmap library for pin_programmed
       [not found] <20080419145510.150338641@gmail.com>
  2008-04-19 14:55 ` [patch 01/10] x86: use BUILD_BUG_ON() for the size of struct intel_mp_floating Akinobu Mita
  2008-04-19 14:55 ` [patch 02/10] x86: use MP_intsrc_info() Akinobu Mita
@ 2008-04-19 14:55 ` Akinobu Mita
  2008-04-19 14:55 ` [patch 04/10] x86: remove unnecessary memset and NULL check after alloc_bootmem() Akinobu Mita
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 10+ messages in thread
From: Akinobu Mita @ 2008-04-19 14:55 UTC (permalink / raw)
  To: linux-kernel; +Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin

[-- Attachment #1: x86-mpparse-use-bitmap.patch --]
[-- Type: text/plain, Size: 2677 bytes --]

Use bitmap library for pin_programmed rather than reinvent
bitmaps.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
---
 arch/x86/kernel/mpparse.c |   14 +++++---------
 include/asm-x86/io_apic.h |    6 ++++--
 2 files changed, 9 insertions(+), 11 deletions(-)

Index: 2.6-git/arch/x86/kernel/mpparse.c
===================================================================
--- 2.6-git.orig/arch/x86/kernel/mpparse.c
+++ 2.6-git/arch/x86/kernel/mpparse.c
@@ -799,7 +799,6 @@ void __init find_smp_config(void)
 #ifdef	CONFIG_X86_IO_APIC
 
 #define MP_ISA_BUS		0
-#define MP_MAX_IOAPIC_PIN	127
 
 extern struct mp_ioapic_routing mp_ioapic_routing[MAX_IO_APICS];
 
@@ -982,9 +981,8 @@ void __init mp_config_acpi_legacy_irqs(v
 
 int mp_register_gsi(u32 gsi, int triggering, int polarity)
 {
-	int ioapic = -1;
-	int ioapic_pin = 0;
-	int idx, bit = 0;
+	int ioapic;
+	int ioapic_pin;
 #ifdef CONFIG_X86_32
 #define MAX_GSI_NUM	4096
 #define IRQ_COMPRESSION_START	64
@@ -1024,15 +1022,13 @@ int mp_register_gsi(u32 gsi, int trigger
 	 * with redundant pin->gsi mappings (but unique PCI devices);
 	 * we only program the IOAPIC on the first.
 	 */
-	bit = ioapic_pin % 32;
-	idx = (ioapic_pin < 32) ? 0 : (ioapic_pin / 32);
-	if (idx > 3) {
+	if (ioapic_pin > MP_MAX_IOAPIC_PIN) {
 		printk(KERN_ERR "Invalid reference to IOAPIC pin "
 		       "%d-%d\n", mp_ioapic_routing[ioapic].apic_id,
 		       ioapic_pin);
 		return gsi;
 	}
-	if ((1 << bit) & mp_ioapic_routing[ioapic].pin_programmed[idx]) {
+	if (test_bit(ioapic_pin, mp_ioapic_routing[ioapic].pin_programmed)) {
 		Dprintk(KERN_DEBUG "Pin %d-%d already programmed\n",
 			mp_ioapic_routing[ioapic].apic_id, ioapic_pin);
 #ifdef CONFIG_X86_32
@@ -1042,7 +1038,7 @@ int mp_register_gsi(u32 gsi, int trigger
 #endif
 	}
 
-	mp_ioapic_routing[ioapic].pin_programmed[idx] |= (1 << bit);
+	set_bit(ioapic_pin, mp_ioapic_routing[ioapic].pin_programmed);
 #ifdef CONFIG_X86_32
 	/*
 	 * For GSI >= 64, use IRQ compression
Index: 2.6-git/include/asm-x86/io_apic.h
===================================================================
--- 2.6-git.orig/include/asm-x86/io_apic.h
+++ 2.6-git/include/asm-x86/io_apic.h
@@ -1,7 +1,7 @@
 #ifndef __ASM_IO_APIC_H
 #define __ASM_IO_APIC_H
 
-#include <asm/types.h>
+#include <linux/types.h>
 #include <asm/mpspec.h>
 #include <asm/apicdef.h>
 
@@ -110,11 +110,13 @@ extern int nr_ioapic_registers[MAX_IO_AP
  * MP-BIOS irq configuration table structures:
  */
 
+#define MP_MAX_IOAPIC_PIN 127
+
 struct mp_ioapic_routing {
 	int apic_id;
 	int gsi_base;
 	int gsi_end;
-	u32 pin_programmed[4];
+	DECLARE_BITMAP(pin_programmed, MP_MAX_IOAPIC_PIN + 1);
 };
 
 /* I/O APIC entries */

-- 

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

* [patch 04/10] x86: remove unnecessary memset and NULL check after alloc_bootmem()
       [not found] <20080419145510.150338641@gmail.com>
                   ` (2 preceding siblings ...)
  2008-04-19 14:55 ` [patch 03/10] x86: use bitmap library for pin_programmed Akinobu Mita
@ 2008-04-19 14:55 ` Akinobu Mita
  2008-04-19 14:55 ` [patch 05/10] x86: cleanup clocksource_hz2mult usage Akinobu Mita
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 10+ messages in thread
From: Akinobu Mita @ 2008-04-19 14:55 UTC (permalink / raw)
  To: linux-kernel; +Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin

[-- Attachment #1: x86-hpet-res-alloc_bootmem-cleanup.patch --]
[-- Type: text/plain, Size: 847 bytes --]

memset and NULL check after alloc_bootmem() are unnecessary.
Because it returns zeroed memory and it never return NULL.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
---
 arch/x86/kernel/acpi/boot.c |    4 ----
 1 file changed, 4 deletions(-)

Index: 2.6-git/arch/x86/kernel/acpi/boot.c
===================================================================
--- 2.6-git.orig/arch/x86/kernel/acpi/boot.c
+++ 2.6-git/arch/x86/kernel/acpi/boot.c
@@ -697,10 +697,6 @@ static int __init acpi_parse_hpet(struct
 #define HPET_RESOURCE_NAME_SIZE 9
 	hpet_res = alloc_bootmem(sizeof(*hpet_res) + HPET_RESOURCE_NAME_SIZE);
 
-	if (!hpet_res)
-		return 0;
-
-	memset(hpet_res, 0, sizeof(*hpet_res));
 	hpet_res->name = (void *)&hpet_res[1];
 	hpet_res->flags = IORESOURCE_MEM;
 	snprintf((char *)hpet_res->name, HPET_RESOURCE_NAME_SIZE, "HPET %u",

-- 

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

* [patch 05/10] x86: cleanup clocksource_hz2mult usage
       [not found] <20080419145510.150338641@gmail.com>
                   ` (3 preceding siblings ...)
  2008-04-19 14:55 ` [patch 04/10] x86: remove unnecessary memset and NULL check after alloc_bootmem() Akinobu Mita
@ 2008-04-19 14:55 ` Akinobu Mita
  2008-04-19 14:55 ` [patch 06/10] x86: cleanup div_sc() usage Akinobu Mita
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 10+ messages in thread
From: Akinobu Mita @ 2008-04-19 14:55 UTC (permalink / raw)
  To: linux-kernel; +Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin

[-- Attachment #1: x86-clocksource-hz2multi-cleanup.patch --]
[-- Type: text/plain, Size: 788 bytes --]

Remove the magic number in the second argument of clocksource_hz2mult() 

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
---
 arch/x86/kernel/i8253.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: 2.6-git/arch/x86/kernel/i8253.c
===================================================================
--- 2.6-git.orig/arch/x86/kernel/i8253.c
+++ 2.6-git/arch/x86/kernel/i8253.c
@@ -224,7 +224,8 @@ static int __init init_pit_clocksource(v
 	    pit_clockevent.mode != CLOCK_EVT_MODE_PERIODIC)
 		return 0;
 
-	clocksource_pit.mult = clocksource_hz2mult(CLOCK_TICK_RATE, 20);
+	clocksource_pit.mult = clocksource_hz2mult(CLOCK_TICK_RATE,
+						   clocksource_pit.shift);
 	return clocksource_register(&clocksource_pit);
 }
 arch_initcall(init_pit_clocksource);

-- 

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

* [patch 06/10] x86: cleanup div_sc() usage
       [not found] <20080419145510.150338641@gmail.com>
                   ` (4 preceding siblings ...)
  2008-04-19 14:55 ` [patch 05/10] x86: cleanup clocksource_hz2mult usage Akinobu Mita
@ 2008-04-19 14:55 ` Akinobu Mita
  2008-04-19 14:55 ` [patch 07/10] x86: use cpumask function for present, possible, and online cpus Akinobu Mita
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 10+ messages in thread
From: Akinobu Mita @ 2008-04-19 14:55 UTC (permalink / raw)
  To: linux-kernel; +Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin

[-- Attachment #1: x86-clock-event-div-sc-cleanup.patch --]
[-- Type: text/plain, Size: 3452 bytes --]

Remove the magic number in the third argment of div_sc().

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
---
 arch/x86/kernel/apic_32.c  |    3 ++-
 arch/x86/kernel/apic_64.c  |    3 ++-
 arch/x86/kernel/hpet.c     |    2 +-
 arch/x86/kernel/i8253.c    |    3 ++-
 arch/x86/kernel/mfgpt_32.c |    3 ++-
 5 files changed, 9 insertions(+), 5 deletions(-)

Index: 2.6-git/arch/x86/kernel/apic_32.c
===================================================================
--- 2.6-git.orig/arch/x86/kernel/apic_32.c
+++ 2.6-git/arch/x86/kernel/apic_32.c
@@ -451,7 +451,8 @@ void __init setup_boot_APIC_clock(void)
 	}
 
 	/* Calculate the scaled math multiplication factor */
-	lapic_clockevent.mult = div_sc(delta, TICK_NSEC * LAPIC_CAL_LOOPS, 32);
+	lapic_clockevent.mult = div_sc(delta, TICK_NSEC * LAPIC_CAL_LOOPS,
+				       lapic_clockevent.shift);
 	lapic_clockevent.max_delta_ns =
 		clockevent_delta2ns(0x7FFFFF, &lapic_clockevent);
 	lapic_clockevent.min_delta_ns =
Index: 2.6-git/arch/x86/kernel/apic_64.c
===================================================================
--- 2.6-git.orig/arch/x86/kernel/apic_64.c
+++ 2.6-git/arch/x86/kernel/apic_64.c
@@ -360,7 +360,8 @@ static void __init calibrate_APIC_clock(
 		result / 1000 / 1000, result / 1000 % 1000);
 
 	/* Calculate the scaled math multiplication factor */
-	lapic_clockevent.mult = div_sc(result, NSEC_PER_SEC, 32);
+	lapic_clockevent.mult = div_sc(result, NSEC_PER_SEC,
+				       lapic_clockevent.shift);
 	lapic_clockevent.max_delta_ns =
 		clockevent_delta2ns(0x7FFFFF, &lapic_clockevent);
 	lapic_clockevent.min_delta_ns =
Index: 2.6-git/arch/x86/kernel/hpet.c
===================================================================
--- 2.6-git.orig/arch/x86/kernel/hpet.c
+++ 2.6-git/arch/x86/kernel/hpet.c
@@ -218,7 +218,7 @@ static void hpet_legacy_clockevent_regis
 	hpet_freq = 1000000000000000ULL;
 	do_div(hpet_freq, hpet_period);
 	hpet_clockevent.mult = div_sc((unsigned long) hpet_freq,
-				      NSEC_PER_SEC, 32);
+				      NSEC_PER_SEC, hpet_clockevent.shift);
 	/* Calculate the min / max delta */
 	hpet_clockevent.max_delta_ns = clockevent_delta2ns(0x7FFFFFFF,
 							   &hpet_clockevent);
Index: 2.6-git/arch/x86/kernel/i8253.c
===================================================================
--- 2.6-git.orig/arch/x86/kernel/i8253.c
+++ 2.6-git/arch/x86/kernel/i8253.c
@@ -115,7 +115,8 @@ void __init setup_pit_timer(void)
 	 * IO_APIC has been initialized.
 	 */
 	pit_clockevent.cpumask = cpumask_of_cpu(smp_processor_id());
-	pit_clockevent.mult = div_sc(CLOCK_TICK_RATE, NSEC_PER_SEC, 32);
+	pit_clockevent.mult = div_sc(CLOCK_TICK_RATE, NSEC_PER_SEC,
+				     pit_clockevent.shift);
 	pit_clockevent.max_delta_ns =
 		clockevent_delta2ns(0x7FFF, &pit_clockevent);
 	pit_clockevent.min_delta_ns =
Index: 2.6-git/arch/x86/kernel/mfgpt_32.c
===================================================================
--- 2.6-git.orig/arch/x86/kernel/mfgpt_32.c
+++ 2.6-git/arch/x86/kernel/mfgpt_32.c
@@ -364,7 +364,8 @@ int __init mfgpt_timer_setup(void)
 	geode_mfgpt_write(mfgpt_event_clock, MFGPT_REG_SETUP, val);
 
 	/* Set up the clock event */
-	mfgpt_clockevent.mult = div_sc(MFGPT_HZ, NSEC_PER_SEC, 32);
+	mfgpt_clockevent.mult = div_sc(MFGPT_HZ, NSEC_PER_SEC,
+				       mfgpt_clockevent.shift);
 	mfgpt_clockevent.min_delta_ns = clockevent_delta2ns(0xF,
 			&mfgpt_clockevent);
 	mfgpt_clockevent.max_delta_ns = clockevent_delta2ns(0xFFFE,

-- 

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

* [patch 07/10] x86: use cpumask function for present, possible, and online cpus
       [not found] <20080419145510.150338641@gmail.com>
                   ` (5 preceding siblings ...)
  2008-04-19 14:55 ` [patch 06/10] x86: cleanup div_sc() usage Akinobu Mita
@ 2008-04-19 14:55 ` Akinobu Mita
  2008-04-19 14:55 ` [patch 08/10] x86: get_bios_ebda() requires asm/io.h Akinobu Mita
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 10+ messages in thread
From: Akinobu Mita @ 2008-04-19 14:55 UTC (permalink / raw)
  To: linux-kernel; +Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin

[-- Attachment #1: x86-use-cpumask-functions.patch --]
[-- Type: text/plain, Size: 3733 bytes --]

cpu_online(), cpu_present(), for_each_possible_cpu(), num_possible_cpus()

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
---
 arch/x86/kernel/genapic_64.c        |    2 +-
 arch/x86/kernel/smpboot.c           |    4 ++--
 arch/x86/kernel/tlb_64.c            |    4 ++--
 arch/x86/mach-voyager/voyager_smp.c |   10 +++++-----
 arch/x86/xen/smp.c                  |    2 +-
 5 files changed, 11 insertions(+), 11 deletions(-)

Index: 2.6-git/arch/x86/mach-voyager/voyager_smp.c
===================================================================
--- 2.6-git.orig/arch/x86/mach-voyager/voyager_smp.c
+++ 2.6-git/arch/x86/mach-voyager/voyager_smp.c
@@ -115,7 +115,7 @@ static inline void send_QIC_CPI(__u32 cp
 	for_each_online_cpu(cpu) {
 		if (cpuset & (1 << cpu)) {
 #ifdef VOYAGER_DEBUG
-			if (!cpu_isset(cpu, cpu_online_map))
+			if (!cpu_online(cpu))
 				VDEBUG(("CPU%d sending cpi %d to CPU%d not in "
 					"cpu_online_map\n",
 					hard_smp_processor_id(), cpi, cpu));
@@ -702,9 +702,9 @@ void __init smp_boot_cpus(void)
 	 * Code added from smpboot.c */
 	{
 		unsigned long bogosum = 0;
-		for (i = 0; i < NR_CPUS; i++)
-			if (cpu_isset(i, cpu_online_map))
-				bogosum += cpu_data(i).loops_per_jiffy;
+
+		for_each_online_cpu(i)
+			bogosum += cpu_data(i).loops_per_jiffy;
 		printk(KERN_INFO "Total of %d processors activated "
 		       "(%lu.%02lu BogoMIPS).\n",
 		       cpucount + 1, bogosum / (500000 / HZ),
@@ -1857,7 +1857,7 @@ static int __cpuinit voyager_cpu_up(unsi
 		return -EIO;
 	/* Unleash the CPU! */
 	cpu_set(cpu, smp_commenced_mask);
-	while (!cpu_isset(cpu, cpu_online_map))
+	while (!cpu_online(cpu))
 		mb();
 	return 0;
 }
Index: 2.6-git/arch/x86/kernel/smpboot.c
===================================================================
--- 2.6-git.orig/arch/x86/kernel/smpboot.c
+++ 2.6-git/arch/x86/kernel/smpboot.c
@@ -1047,7 +1047,7 @@ int __cpuinit native_cpu_up(unsigned int
 	check_tsc_sync_source(cpu);
 	local_irq_restore(flags);
 
-	while (!cpu_isset(cpu, cpu_online_map)) {
+	while (!cpu_online(cpu)) {
 		cpu_relax();
 		touch_nmi_watchdog();
 	}
@@ -1157,7 +1157,7 @@ static void __init smp_cpu_index_default
 	int i;
 	struct cpuinfo_x86 *c;
 
-	for_each_cpu_mask(i, cpu_possible_map) {
+	for_each_possible_cpu(i) {
 		c = &cpu_data(i);
 		/* mark all to hotplug */
 		c->cpu_index = NR_CPUS;
Index: 2.6-git/arch/x86/kernel/genapic_64.c
===================================================================
--- 2.6-git.orig/arch/x86/kernel/genapic_64.c
+++ 2.6-git/arch/x86/kernel/genapic_64.c
@@ -51,7 +51,7 @@ void __init setup_apic_routing(void)
 	else
 #endif
 
-	if (cpus_weight(cpu_possible_map) <= 8)
+	if (num_possible_cpus() <= 8)
 		genapic = &apic_flat;
 	else
 		genapic = &apic_physflat;
Index: 2.6-git/arch/x86/kernel/tlb_64.c
===================================================================
--- 2.6-git.orig/arch/x86/kernel/tlb_64.c
+++ 2.6-git/arch/x86/kernel/tlb_64.c
@@ -195,9 +195,9 @@ int __cpuinit init_smp_flush(void)
 {
 	int i;
 
-	for_each_cpu_mask(i, cpu_possible_map) {
+	for_each_possible_cpu(i)
 		spin_lock_init(&per_cpu(flush_state, i).tlbstate_lock);
-	}
+
 	return 0;
 }
 core_initcall(init_smp_flush);
Index: 2.6-git/arch/x86/xen/smp.c
===================================================================
--- 2.6-git.orig/arch/x86/xen/smp.c
+++ 2.6-git/arch/x86/xen/smp.c
@@ -183,7 +183,7 @@ void __init xen_smp_prepare_cpus(unsigne
 
 	/* Restrict the possible_map according to max_cpus. */
 	while ((num_possible_cpus() > 1) && (num_possible_cpus() > max_cpus)) {
-		for (cpu = NR_CPUS-1; !cpu_isset(cpu, cpu_possible_map); cpu--)
+		for (cpu = NR_CPUS - 1; !cpu_possible(cpu); cpu--)
 			continue;
 		cpu_clear(cpu, cpu_possible_map);
 	}

-- 

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

* [patch 08/10] x86: get_bios_ebda() requires asm/io.h
       [not found] <20080419145510.150338641@gmail.com>
                   ` (6 preceding siblings ...)
  2008-04-19 14:55 ` [patch 07/10] x86: use cpumask function for present, possible, and online cpus Akinobu Mita
@ 2008-04-19 14:55 ` Akinobu Mita
  2008-04-19 14:55 ` [patch 09/10] x86: remove duplicate get_bios_ebda() from rio.h Akinobu Mita
  2008-04-19 14:55 ` [patch 10/10] x86: use get_bios_ebda() Akinobu Mita
  9 siblings, 0 replies; 10+ messages in thread
From: Akinobu Mita @ 2008-04-19 14:55 UTC (permalink / raw)
  To: linux-kernel; +Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin

[-- Attachment #1: x86-use-get-bios-ebda-1.patch --]
[-- Type: text/plain, Size: 555 bytes --]

include <asm/io.h> for phys_to_virt()

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
---
 include/asm-x86/bios_ebda.h |    2 ++
 1 file changed, 2 insertions(+)

Index: 2.6-git/include/asm-x86/bios_ebda.h
===================================================================
--- 2.6-git.orig/include/asm-x86/bios_ebda.h
+++ 2.6-git/include/asm-x86/bios_ebda.h
@@ -1,6 +1,8 @@
 #ifndef _MACH_BIOS_EBDA_H
 #define _MACH_BIOS_EBDA_H
 
+#include <asm/io.h>
+
 /*
  * there is a real-mode segmented pointer pointing to the
  * 4K EBDA area at 0x40E.

-- 

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

* [patch 09/10] x86: remove duplicate get_bios_ebda() from rio.h
       [not found] <20080419145510.150338641@gmail.com>
                   ` (7 preceding siblings ...)
  2008-04-19 14:55 ` [patch 08/10] x86: get_bios_ebda() requires asm/io.h Akinobu Mita
@ 2008-04-19 14:55 ` Akinobu Mita
  2008-04-19 14:55 ` [patch 10/10] x86: use get_bios_ebda() Akinobu Mita
  9 siblings, 0 replies; 10+ messages in thread
From: Akinobu Mita @ 2008-04-19 14:55 UTC (permalink / raw)
  To: linux-kernel; +Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin

[-- Attachment #1: x86-use-get-bios-ebda-2.patch --]
[-- Type: text/plain, Size: 1263 bytes --]

get_bios_ebda() exists in asm/rio.h and asm/bios_ebda.h.
This patch removes the one in asm/rio.h.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
---
 arch/x86/kernel/pci-calgary_64.c |    1 +
 include/asm-x86/rio.h            |   11 -----------
 2 files changed, 1 insertion(+), 11 deletions(-)

Index: 2.6-git/arch/x86/kernel/pci-calgary_64.c
===================================================================
--- 2.6-git.orig/arch/x86/kernel/pci-calgary_64.c
+++ 2.6-git/arch/x86/kernel/pci-calgary_64.c
@@ -43,6 +43,7 @@
 #include <asm/system.h>
 #include <asm/dma.h>
 #include <asm/rio.h>
+#include <asm/bios_ebda.h>
 
 #ifdef CONFIG_CALGARY_IOMMU_ENABLED_BY_DEFAULT
 int use_calgary __read_mostly = 1;
Index: 2.6-git/include/asm-x86/rio.h
===================================================================
--- 2.6-git.orig/include/asm-x86/rio.h
+++ 2.6-git/include/asm-x86/rio.h
@@ -60,15 +60,4 @@ enum {
 	ALT_CALGARY	= 5,	/* Second Planar Calgary      */
 };
 
-/*
- * there is a real-mode segmented pointer pointing to the
- * 4K EBDA area at 0x40E.
- */
-static inline unsigned long get_bios_ebda(void)
-{
-	unsigned long address = *(unsigned short *)phys_to_virt(0x40EUL);
-	address <<= 4;
-	return address;
-}
-
 #endif /* __ASM_RIO_H */

-- 

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

* [patch 10/10] x86: use get_bios_ebda()
       [not found] <20080419145510.150338641@gmail.com>
                   ` (8 preceding siblings ...)
  2008-04-19 14:55 ` [patch 09/10] x86: remove duplicate get_bios_ebda() from rio.h Akinobu Mita
@ 2008-04-19 14:55 ` Akinobu Mita
  9 siblings, 0 replies; 10+ messages in thread
From: Akinobu Mita @ 2008-04-19 14:55 UTC (permalink / raw)
  To: linux-kernel; +Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin

[-- Attachment #1: x86-use-get-bios-ebda-3.patch --]
[-- Type: text/plain, Size: 2569 bytes --]

Use get_bios_ebda().

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
---
 arch/x86/kernel/head64.c    |    5 ++---
 arch/x86/kernel/setup_32.c  |    4 +---
 arch/x86/kernel/summit_32.c |    5 +++--
 3 files changed, 6 insertions(+), 8 deletions(-)

Index: 2.6-git/arch/x86/kernel/summit_32.c
===================================================================
--- 2.6-git.orig/arch/x86/kernel/summit_32.c
+++ 2.6-git/arch/x86/kernel/summit_32.c
@@ -29,6 +29,7 @@
 #include <linux/mm.h>
 #include <linux/init.h>
 #include <asm/io.h>
+#include <asm/bios_ebda.h>
 #include <asm/mach-summit/mach_mpparse.h>
 
 static struct rio_table_hdr *rio_table_hdr __initdata;
@@ -140,8 +141,8 @@ void __init setup_summit(void)
 	int			i, next_wpeg, next_bus = 0;
 
 	/* The pointer to the EBDA is stored in the word @ phys 0x40E(40:0E) */
-	ptr = *(unsigned short *)phys_to_virt(0x40Eul);
-	ptr = (unsigned long)phys_to_virt(ptr << 4);
+	ptr = get_bios_ebda();
+	ptr = (unsigned long)phys_to_virt(ptr);
 
 	rio_table_hdr = NULL;
 	offset = 0x180;
Index: 2.6-git/arch/x86/kernel/head64.c
===================================================================
--- 2.6-git.orig/arch/x86/kernel/head64.c
+++ 2.6-git/arch/x86/kernel/head64.c
@@ -22,6 +22,7 @@
 #include <asm/sections.h>
 #include <asm/kdebug.h>
 #include <asm/e820.h>
+#include <asm/bios_ebda.h>
 
 static void __init zap_identity_mappings(void)
 {
@@ -49,7 +50,6 @@ static void __init copy_bootdata(char *r
 	}
 }
 
-#define BIOS_EBDA_SEGMENT 0x40E
 #define BIOS_LOWMEM_KILOBYTES 0x413
 
 /*
@@ -80,8 +80,7 @@ static void __init reserve_ebda_region(v
 	lowmem <<= 10;
 
 	/* start of EBDA area */
-	ebda_addr = *(unsigned short *)__va(BIOS_EBDA_SEGMENT);
-	ebda_addr <<= 4;
+	ebda_addr = get_bios_ebda();
 
 	/* Fixup: bios puts an EBDA in the top 64K segment */
 	/* of conventional memory, but does not adjust lowmem. */
Index: 2.6-git/arch/x86/kernel/setup_32.c
===================================================================
--- 2.6-git.orig/arch/x86/kernel/setup_32.c
+++ 2.6-git/arch/x86/kernel/setup_32.c
@@ -388,7 +388,6 @@ unsigned long __init find_max_low_pfn(vo
 	return max_low_pfn;
 }
 
-#define BIOS_EBDA_SEGMENT 0x40E
 #define BIOS_LOWMEM_KILOBYTES 0x413
 
 /*
@@ -419,8 +418,7 @@ static void __init reserve_ebda_region(v
 	lowmem <<= 10;
 
 	/* start of EBDA area */
-	ebda_addr = *(unsigned short *)__va(BIOS_EBDA_SEGMENT);
-	ebda_addr <<= 4;
+	ebda_addr = get_bios_ebda();
 
 	/* Fixup: bios puts an EBDA in the top 64K segment */
 	/* of conventional memory, but does not adjust lowmem. */

-- 

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

end of thread, other threads:[~2008-04-19 15:09 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20080419145510.150338641@gmail.com>
2008-04-19 14:55 ` [patch 01/10] x86: use BUILD_BUG_ON() for the size of struct intel_mp_floating Akinobu Mita
2008-04-19 14:55 ` [patch 02/10] x86: use MP_intsrc_info() Akinobu Mita
2008-04-19 14:55 ` [patch 03/10] x86: use bitmap library for pin_programmed Akinobu Mita
2008-04-19 14:55 ` [patch 04/10] x86: remove unnecessary memset and NULL check after alloc_bootmem() Akinobu Mita
2008-04-19 14:55 ` [patch 05/10] x86: cleanup clocksource_hz2mult usage Akinobu Mita
2008-04-19 14:55 ` [patch 06/10] x86: cleanup div_sc() usage Akinobu Mita
2008-04-19 14:55 ` [patch 07/10] x86: use cpumask function for present, possible, and online cpus Akinobu Mita
2008-04-19 14:55 ` [patch 08/10] x86: get_bios_ebda() requires asm/io.h Akinobu Mita
2008-04-19 14:55 ` [patch 09/10] x86: remove duplicate get_bios_ebda() from rio.h Akinobu Mita
2008-04-19 14:55 ` [patch 10/10] x86: use get_bios_ebda() Akinobu Mita

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.