Skip to content

Commit

Permalink
Merge branch 'forcedeth'
Browse files Browse the repository at this point in the history
  • Loading branch information
jgarzik committed Feb 20, 2006
2 parents b04a92e + d33a73c commit c5580a7
Show file tree
Hide file tree
Showing 32 changed files with 753 additions and 133 deletions.
16 changes: 11 additions & 5 deletions Documentation/cpu-hotplug.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
Joel Schopp <[email protected]>
ia64/x86_64:
Ashok Raj <[email protected]>
s390:
Heiko Carstens <[email protected]>

Authors: Ashok Raj <[email protected]>
Lots of feedback: Nathan Lynch <[email protected]>,
Expand Down Expand Up @@ -44,11 +46,9 @@ maxcpus=n Restrict boot time cpus to n. Say if you have 4 cpus, using
maxcpus=2 will only boot 2. You can choose to bring the
other cpus later online, read FAQ's for more info.

additional_cpus*=n Use this to limit hotpluggable cpus. This option sets
cpu_possible_map = cpu_present_map + additional_cpus

(*) Option valid only for following architectures
- x86_64, ia64
additional_cpus=n [x86_64, s390 only] use this to limit hotpluggable cpus.
This option sets
cpu_possible_map = cpu_present_map + additional_cpus

ia64 and x86_64 use the number of disabled local apics in ACPI tables MADT
to determine the number of potentially hot-pluggable cpus. The implementation
Expand All @@ -58,6 +58,12 @@ mark such hot-pluggable cpus as disabled entries, one could use this
parameter "additional_cpus=x" to represent those cpus in the cpu_possible_map.


possible_cpus=n [s390 only] use this to set hotpluggable cpus.
This option sets possible_cpus bits in
cpu_possible_map. Thus keeping the numbers of bits set
constant even if the machine gets rebooted.
This option overrides additional_cpus.

CPU maps and such
-----------------
[More on cpumaps and primitive to manipulate, please check
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
VERSION = 2
PATCHLEVEL = 6
SUBLEVEL = 16
EXTRAVERSION =-rc3
EXTRAVERSION =-rc4
NAME=Sliding Snow Leopard

# *DOCUMENTATION*
Expand Down
4 changes: 4 additions & 0 deletions arch/s390/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ config HOTPLUG_CPU
can be controlled through /sys/devices/system/cpu/cpu#.
Say N if you want to disable CPU hotplug.

config DEFAULT_MIGRATION_COST
int
default "1000000"

config MATHEMU
bool "IEEE FPU emulation"
depends on MARCH_G5
Expand Down
4 changes: 2 additions & 2 deletions arch/s390/kernel/compat_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -905,8 +905,8 @@ asmlinkage long sys32_fstat64(unsigned long fd, struct stat64_emu31 __user * sta
return ret;
}

asmlinkage long sys32_fstatat(unsigned int dfd, char __user *filename,
struct stat64_emu31 __user* statbuf, int flag)
asmlinkage long sys32_fstatat64(unsigned int dfd, char __user *filename,
struct stat64_emu31 __user* statbuf, int flag)
{
struct kstat stat;
int error = -EINVAL;
Expand Down
6 changes: 3 additions & 3 deletions arch/s390/kernel/compat_wrapper.S
Original file line number Diff line number Diff line change
Expand Up @@ -1523,13 +1523,13 @@ compat_sys_futimesat_wrapper:
llgtr %r4,%r4 # struct timeval *
jg compat_sys_futimesat

.globl sys32_fstatat_wrapper
sys32_fstatat_wrapper:
.globl sys32_fstatat64_wrapper
sys32_fstatat64_wrapper:
llgfr %r2,%r2 # unsigned int
llgtr %r3,%r3 # char *
llgtr %r4,%r4 # struct stat64 *
lgfr %r5,%r5 # int
jg sys32_fstatat
jg sys32_fstatat64

.globl sys_unlinkat_wrapper
sys_unlinkat_wrapper:
Expand Down
4 changes: 3 additions & 1 deletion arch/s390/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,10 @@ void default_idle(void)
__ctl_set_bit(8, 15);

#ifdef CONFIG_HOTPLUG_CPU
if (cpu_is_offline(cpu))
if (cpu_is_offline(cpu)) {
preempt_enable_no_resched();
cpu_die();
}
#endif

local_mcck_disable();
Expand Down
2 changes: 2 additions & 0 deletions arch/s390/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -600,13 +600,15 @@ setup_arch(char **cmdline_p)
init_mm.brk = (unsigned long) &_end;

parse_cmdline_early(cmdline_p);
parse_early_param();

setup_memory();
setup_resources();
setup_lowcore();

cpu_init();
__cpu_logical_map[0] = S390_lowcore.cpu_data.cpu_addr;
smp_setup_cpu_possible_map();

/*
* Create kernel page tables and switch to virtual addressing.
Expand Down
69 changes: 52 additions & 17 deletions arch/s390/kernel/smp.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
/*
* arch/s390/kernel/smp.c
*
* S390 version
* Copyright (C) 1999,2000 IBM Deutschland Entwicklung GmbH, IBM Corporation
* Copyright (C) IBM Corp. 1999,2006
* Author(s): Denis Joseph Barrow ([email protected],[email protected]),
* Martin Schwidefsky ([email protected])
* Heiko Carstens ([email protected])
Expand Down Expand Up @@ -41,8 +40,6 @@
#include <asm/cpcmd.h>
#include <asm/tlbflush.h>

/* prototypes */

extern volatile int __cpu_logical_map[];

/*
Expand All @@ -51,13 +48,11 @@ extern volatile int __cpu_logical_map[];

struct _lowcore *lowcore_ptr[NR_CPUS];

cpumask_t cpu_online_map;
cpumask_t cpu_possible_map = CPU_MASK_ALL;
cpumask_t cpu_online_map = CPU_MASK_NONE;
cpumask_t cpu_possible_map = CPU_MASK_NONE;

static struct task_struct *current_set[NR_CPUS];

EXPORT_SYMBOL(cpu_online_map);

/*
* Reboot, halt and power_off routines for SMP.
*/
Expand Down Expand Up @@ -490,10 +485,10 @@ void smp_ctl_clear_bit(int cr, int bit) {
* Lets check how many CPUs we have.
*/

void
__init smp_check_cpus(unsigned int max_cpus)
static unsigned int
__init smp_count_cpus(void)
{
int cpu, num_cpus;
unsigned int cpu, num_cpus;
__u16 boot_cpu_addr;

/*
Expand All @@ -503,19 +498,20 @@ __init smp_check_cpus(unsigned int max_cpus)
boot_cpu_addr = S390_lowcore.cpu_data.cpu_addr;
current_thread_info()->cpu = 0;
num_cpus = 1;
for (cpu = 0; cpu <= 65535 && num_cpus < max_cpus; cpu++) {
for (cpu = 0; cpu <= 65535; cpu++) {
if ((__u16) cpu == boot_cpu_addr)
continue;
__cpu_logical_map[num_cpus] = (__u16) cpu;
if (signal_processor(num_cpus, sigp_sense) ==
__cpu_logical_map[1] = (__u16) cpu;
if (signal_processor(1, sigp_sense) ==
sigp_not_operational)
continue;
cpu_set(num_cpus, cpu_present_map);
num_cpus++;
}

printk("Detected %d CPU's\n",(int) num_cpus);
printk("Boot cpu address %2X\n", boot_cpu_addr);

return num_cpus;
}

/*
Expand Down Expand Up @@ -676,6 +672,44 @@ __cpu_up(unsigned int cpu)
return 0;
}

static unsigned int __initdata additional_cpus;
static unsigned int __initdata possible_cpus;

void __init smp_setup_cpu_possible_map(void)
{
unsigned int phy_cpus, pos_cpus, cpu;

phy_cpus = smp_count_cpus();
pos_cpus = min(phy_cpus + additional_cpus, (unsigned int) NR_CPUS);

if (possible_cpus)
pos_cpus = min(possible_cpus, (unsigned int) NR_CPUS);

for (cpu = 0; cpu < pos_cpus; cpu++)
cpu_set(cpu, cpu_possible_map);

phy_cpus = min(phy_cpus, pos_cpus);

for (cpu = 0; cpu < phy_cpus; cpu++)
cpu_set(cpu, cpu_present_map);
}

#ifdef CONFIG_HOTPLUG_CPU

static int __init setup_additional_cpus(char *s)
{
additional_cpus = simple_strtoul(s, NULL, 0);
return 0;
}
early_param("additional_cpus", setup_additional_cpus);

static int __init setup_possible_cpus(char *s)
{
possible_cpus = simple_strtoul(s, NULL, 0);
return 0;
}
early_param("possible_cpus", setup_possible_cpus);

int
__cpu_disable(void)
{
Expand Down Expand Up @@ -744,6 +778,8 @@ cpu_die(void)
for(;;);
}

#endif /* CONFIG_HOTPLUG_CPU */

/*
* Cycle through the processors and setup structures.
*/
Expand All @@ -757,7 +793,6 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
/* request the 0x1201 emergency signal external interrupt */
if (register_external_interrupt(0x1201, do_ext_call_interrupt) != 0)
panic("Couldn't request external interrupt 0x1201");
smp_check_cpus(max_cpus);
memset(lowcore_ptr,0,sizeof(lowcore_ptr));
/*
* Initialize prefix pages and stacks for all possible cpus
Expand Down Expand Up @@ -806,7 +841,6 @@ void __devinit smp_prepare_boot_cpu(void)
BUG_ON(smp_processor_id() != 0);

cpu_set(0, cpu_online_map);
cpu_set(0, cpu_present_map);
S390_lowcore.percpu_offset = __per_cpu_offset[0];
current_set[0] = current;
}
Expand Down Expand Up @@ -845,6 +879,7 @@ static int __init topology_init(void)

subsys_initcall(topology_init);

EXPORT_SYMBOL(cpu_online_map);
EXPORT_SYMBOL(cpu_possible_map);
EXPORT_SYMBOL(lowcore_ptr);
EXPORT_SYMBOL(smp_ctl_set_bit);
Expand Down
2 changes: 1 addition & 1 deletion arch/s390/kernel/syscalls.S
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ SYSCALL(sys_mkdirat,sys_mkdirat,sys_mkdirat_wrapper)
SYSCALL(sys_mknodat,sys_mknodat,sys_mknodat_wrapper) /* 290 */
SYSCALL(sys_fchownat,sys_fchownat,sys_fchownat_wrapper)
SYSCALL(sys_futimesat,sys_futimesat,compat_sys_futimesat_wrapper)
SYSCALL(sys_fstatat64,sys_newfstatat,sys32_fstatat_wrapper)
SYSCALL(sys_fstatat64,sys_newfstatat,sys32_fstatat64_wrapper)
SYSCALL(sys_unlinkat,sys_unlinkat,sys_unlinkat_wrapper)
SYSCALL(sys_renameat,sys_renameat,sys_renameat_wrapper) /* 295 */
SYSCALL(sys_linkat,sys_linkat,sys_linkat_wrapper)
Expand Down
2 changes: 1 addition & 1 deletion arch/sh/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ endmenu

config ISA_DMA_API
bool
depends on MPC1211
depends on SH_MPC1211
default y

menu "Kernel features"
Expand Down
4 changes: 2 additions & 2 deletions arch/x86_64/kernel/mpparse.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,9 +288,9 @@ static int __init smp_read_mpc(struct mp_config_table *mpc)

memcpy(str,mpc->mpc_productid,12);
str[12]=0;
printk(KERN_INFO "Product ID: %s ",str);
printk("Product ID: %s ",str);

printk(KERN_INFO "APIC at: 0x%X\n",mpc->mpc_lapic);
printk("APIC at: 0x%X\n",mpc->mpc_lapic);

/* save the local APIC address, it might be non-default */
if (!acpi_lapic)
Expand Down
6 changes: 2 additions & 4 deletions drivers/acpi/resources/rscalc.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,8 +391,7 @@ acpi_rs_get_list_length(u8 * aml_buffer,
* Ensure a 32-bit boundary for the structure
*/
extra_struct_bytes =
ACPI_ROUND_UP_to_32_bITS(resource_length) -
resource_length;
ACPI_ROUND_UP_to_32_bITS(resource_length);
break;

case ACPI_RESOURCE_NAME_END_TAG:
Expand All @@ -408,8 +407,7 @@ acpi_rs_get_list_length(u8 * aml_buffer,
* Add vendor data and ensure a 32-bit boundary for the structure
*/
extra_struct_bytes =
ACPI_ROUND_UP_to_32_bITS(resource_length) -
resource_length;
ACPI_ROUND_UP_to_32_bITS(resource_length);
break;

case ACPI_RESOURCE_NAME_ADDRESS32:
Expand Down
Loading

0 comments on commit c5580a7

Please sign in to comment.