cregit-Linux how code gets into the kernel

Release 4.14 arch/s390/kernel/smp.c

Directory: arch/s390/kernel
// SPDX-License-Identifier: GPL-2.0
/*
 *  SMP related functions
 *
 *    Copyright IBM Corp. 1999, 2012
 *    Author(s): Denis Joseph Barrow,
 *               Martin Schwidefsky <schwidefsky@de.ibm.com>,
 *               Heiko Carstens <heiko.carstens@de.ibm.com>,
 *
 *  based on other smp stuff by
 *    (c) 1995 Alan Cox, CymruNET Ltd  <alan@cymru.net>
 *    (c) 1998 Ingo Molnar
 *
 * The code outside of smp.c uses logical cpu numbers, only smp.c does
 * the translation of logical to physical cpu ids. All new code that
 * operates on physical cpu numbers needs to go into smp.c.
 */


#define KMSG_COMPONENT "cpu"

#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt

#include <linux/workqueue.h>
#include <linux/bootmem.h>
#include <linux/export.h>
#include <linux/init.h>
#include <linux/mm.h>
#include <linux/err.h>
#include <linux/spinlock.h>
#include <linux/kernel_stat.h>
#include <linux/kmemleak.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/irqflags.h>
#include <linux/cpu.h>
#include <linux/slab.h>
#include <linux/sched/hotplug.h>
#include <linux/sched/task_stack.h>
#include <linux/crash_dump.h>
#include <linux/memblock.h>
#include <asm/asm-offsets.h>
#include <asm/diag.h>
#include <asm/switch_to.h>
#include <asm/facility.h>
#include <asm/ipl.h>
#include <asm/setup.h>
#include <asm/irq.h>
#include <asm/tlbflush.h>
#include <asm/vtimer.h>
#include <asm/lowcore.h>
#include <asm/sclp.h>
#include <asm/vdso.h>
#include <asm/debug.h>
#include <asm/os_info.h>
#include <asm/sigp.h>
#include <asm/idle.h>
#include <asm/nmi.h>
#include "entry.h"

enum {
	
ec_schedule = 0,
	
ec_call_function_single,
	
ec_stop_cpu,
};

enum {
	
CPU_STATE_STANDBY,
	
CPU_STATE_CONFIGURED,
};

static DEFINE_PER_CPU(struct cpu *, cpu_device);


struct pcpu {
	
struct lowcore *lowcore;	/* lowcore page(s) for the cpu */
	
unsigned long ec_mask;		/* bit mask for ec_xxx functions */
	
unsigned long ec_clk;		/* sigp timestamp for ec_xxx */
	
signed char state;		/* physical cpu state */
	
signed char polarization;	/* physical polarization */
	
u16 address;			/* physical cpu address */
};


static u8 boot_core_type;

static struct pcpu pcpu_devices[NR_CPUS];


static struct kmem_cache *pcpu_mcesa_cache;


unsigned int smp_cpu_mt_shift;

EXPORT_SYMBOL(smp_cpu_mt_shift);


unsigned int smp_cpu_mtid;

EXPORT_SYMBOL(smp_cpu_mtid);

#ifdef CONFIG_CRASH_DUMP

__vector128 __initdata boot_cpu_vector_save_area[__NUM_VXRS];
#endif


static unsigned int smp_max_threads __initdata = -1U;


static int __init early_nosmt(char *s) { smp_max_threads = 1; return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Martin Schwidefsky18100.00%1100.00%
Total18100.00%1100.00%

early_param("nosmt", early_nosmt);
static int __init early_smt(char *s) { get_option(&s, &smp_max_threads); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Martin Schwidefsky23100.00%1100.00%
Total23100.00%1100.00%

early_param("smt", early_smt); /* * The smp_cpu_state_mutex must be held when changing the state or polarization * member of a pcpu data structure within the pcpu_devices arreay. */ DEFINE_MUTEX(smp_cpu_state_mutex); /* * Signal processor helper functions. */
static inline int __pcpu_sigp_relax(u16 addr, u8 order, unsigned long parm) { int cc; while (1) { cc = __pcpu_sigp(addr, order, parm, NULL); if (cc != SIGP_CC_BUSY) return cc; cpu_relax(); } }

Contributors

PersonTokensPropCommitsCommitProp
Martin Schwidefsky3772.55%120.00%
Heiko Carstens1223.53%360.00%
Michael Holzheu23.92%120.00%
Total51100.00%5100.00%


static int pcpu_sigp_retry(struct pcpu *pcpu, u8 order, u32 parm) { int cc, retry; for (retry = 0; ; retry++) { cc = __pcpu_sigp(pcpu->address, order, parm, NULL); if (cc != SIGP_CC_BUSY) break; if (retry >= 3) udelay(10); } return cc; }

Contributors

PersonTokensPropCommitsCommitProp
Martin Schwidefsky5375.71%125.00%
Michael Holzheu1521.43%125.00%
Heiko Carstens22.86%250.00%
Total70100.00%4100.00%


static inline int pcpu_stopped(struct pcpu *pcpu) { u32 uninitialized_var(status); if (__pcpu_sigp(pcpu->address, SIGP_SENSE, 0, &status) != SIGP_CC_STATUS_STORED) return 0; return !!(status & (SIGP_STATUS_CHECK_STOP|SIGP_STATUS_STOPPED)); }

Contributors

PersonTokensPropCommitsCommitProp
Martin Schwidefsky3261.54%116.67%
Heiko Carstens1325.00%466.67%
Michael Holzheu713.46%116.67%
Total52100.00%6100.00%


static inline int pcpu_running(struct pcpu *pcpu) { if (__pcpu_sigp(pcpu->address, SIGP_SENSE_RUNNING, 0, NULL) != SIGP_CC_STATUS_STORED) return 1; /* Status stored condition code is equivalent to cpu not running. */ return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Martin Schwidefsky2158.33%120.00%
Heiko Carstens1541.67%480.00%
Total36100.00%5100.00%

/* * Find struct pcpu by cpu address. */
static struct pcpu *pcpu_find_address(const struct cpumask *mask, u16 address) { int cpu; for_each_cpu(cpu, mask) if (pcpu_devices[cpu].address == address) return pcpu_devices + cpu; return NULL; }

Contributors

PersonTokensPropCommitsCommitProp
Martin Schwidefsky4088.89%266.67%
Heiko Carstens511.11%133.33%
Total45100.00%3100.00%


static void pcpu_ec_call(struct pcpu *pcpu, int ec_bit) { int order; if (test_and_set_bit(ec_bit, &pcpu->ec_mask)) return; order = pcpu_running(pcpu) ? SIGP_EXTERNAL_CALL : SIGP_EMERGENCY_SIGNAL; pcpu->ec_clk = get_tod_clock_fast(); pcpu_sigp_retry(pcpu, order, 0); }

Contributors

PersonTokensPropCommitsCommitProp
Martin Schwidefsky3052.63%120.00%
Heiko Carstens2747.37%480.00%
Total57100.00%5100.00%

#define ASYNC_FRAME_OFFSET (ASYNC_SIZE - STACK_FRAME_OVERHEAD - __PT_SIZE) #define PANIC_FRAME_OFFSET (PAGE_SIZE - STACK_FRAME_OVERHEAD - __PT_SIZE)
static int pcpu_alloc_lowcore(struct pcpu *pcpu, int cpu) { unsigned long async_stack, panic_stack; unsigned long mcesa_origin, mcesa_bits; struct lowcore *lc; mcesa_origin = mcesa_bits = 0; if (pcpu != &pcpu_devices[0]) { pcpu->lowcore = (struct lowcore *) __get_free_pages(GFP_KERNEL | GFP_DMA, LC_ORDER); async_stack = __get_free_pages(GFP_KERNEL, ASYNC_ORDER); panic_stack = __get_free_page(GFP_KERNEL); if (!pcpu->lowcore || !panic_stack || !async_stack) goto out; if (MACHINE_HAS_VX || MACHINE_HAS_GS) { mcesa_origin = (unsigned long) kmem_cache_alloc(pcpu_mcesa_cache, GFP_KERNEL); if (!mcesa_origin) goto out; /* The pointer is stored with mcesa_bits ORed in */ kmemleak_not_leak((void *) mcesa_origin); mcesa_bits = MACHINE_HAS_GS ? 11 : 0; } } else { async_stack = pcpu->lowcore->async_stack - ASYNC_FRAME_OFFSET; panic_stack = pcpu->lowcore->panic_stack - PANIC_FRAME_OFFSET; mcesa_origin = pcpu->lowcore->mcesad & MCESA_ORIGIN_MASK; mcesa_bits = pcpu->lowcore->mcesad & MCESA_LC_MASK; } lc = pcpu->lowcore; memcpy(lc, &S390_lowcore, 512); memset((char *) lc + 512, 0, sizeof(*lc) - 512); lc->async_stack = async_stack + ASYNC_FRAME_OFFSET; lc->panic_stack = panic_stack + PANIC_FRAME_OFFSET; lc->mcesad = mcesa_origin | mcesa_bits; lc->cpu_nr = cpu; lc->spinlock_lockval = arch_spin_lockval(cpu); if (vdso_alloc_per_cpu(lc)) goto out; lowcore_ptr[cpu] = lc; pcpu_sigp_retry(pcpu, SIGP_SET_PREFIX, (u32)(unsigned long) lc); return 0; out: if (pcpu != &pcpu_devices[0]) { if (mcesa_origin) kmem_cache_free(pcpu_mcesa_cache, (void *) mcesa_origin); free_page(panic_stack); free_pages(async_stack, ASYNC_ORDER); free_pages((unsigned long) pcpu->lowcore, LC_ORDER); } return -ENOMEM; }

Contributors

PersonTokensPropCommitsCommitProp
Martin Schwidefsky25671.31%330.00%
Heiko Carstens8423.40%550.00%
Christian Bornträger102.79%110.00%
Philipp Hachtmann92.51%110.00%
Total359100.00%10100.00%

#ifdef CONFIG_HOTPLUG_CPU
static void pcpu_free_lowcore(struct pcpu *pcpu) { unsigned long mcesa_origin; pcpu_sigp_retry(pcpu, SIGP_SET_PREFIX, 0); lowcore_ptr[pcpu - pcpu_devices] = NULL; vdso_free_per_cpu(pcpu->lowcore); if (pcpu == &pcpu_devices[0]) return; if (MACHINE_HAS_VX || MACHINE_HAS_GS) { mcesa_origin = pcpu->lowcore->mcesad & MCESA_ORIGIN_MASK; kmem_cache_free(pcpu_mcesa_cache, (void *) mcesa_origin); } free_page(pcpu->lowcore->panic_stack-PANIC_FRAME_OFFSET); free_pages(pcpu->lowcore->async_stack-ASYNC_FRAME_OFFSET, ASYNC_ORDER); free_pages((unsigned long) pcpu->lowcore, LC_ORDER); }

Contributors

PersonTokensPropCommitsCommitProp
Martin Schwidefsky9984.62%545.45%
Heiko Carstens1210.26%327.27%
Linus Torvalds43.42%19.09%
Andrew Morton10.85%19.09%
Christian Bornträger10.85%19.09%
Total117100.00%11100.00%

#endif /* CONFIG_HOTPLUG_CPU */
static void pcpu_prepare_secondary(struct pcpu *pcpu, int cpu) { struct lowcore *lc = pcpu->lowcore; cpumask_set_cpu(cpu, &init_mm.context.cpu_attach_mask); cpumask_set_cpu(cpu, mm_cpumask(&init_mm)); lc->cpu_nr = cpu; lc->spinlock_lockval = arch_spin_lockval(cpu); lc->percpu_offset = __per_cpu_offset[cpu]; lc->kernel_asce = S390_lowcore.kernel_asce; lc->machine_flags = S390_lowcore.machine_flags; lc->user_timer = lc->system_timer = lc->steal_timer = 0; __ctl_store(lc->cregs_save_area, 0, 15); save_access_regs((unsigned int *) lc->access_regs_save_area); memcpy(lc->stfle_fac_list, S390_lowcore.stfle_fac_list, MAX_FACILITY_BIT/8); }

Contributors

PersonTokensPropCommitsCommitProp
Martin Schwidefsky10475.36%533.33%
Linus Torvalds (pre-git)107.25%16.67%
Philipp Hachtmann96.52%16.67%
Heiko Carstens85.80%533.33%
Linus Torvalds42.90%213.33%
Peter Zijlstra32.17%16.67%
Total138100.00%15100.00%


static void pcpu_attach_task(struct pcpu *pcpu, struct task_struct *tsk) { struct lowcore *lc = pcpu->lowcore; lc->kernel_stack = (unsigned long) task_stack_page(tsk) + THREAD_SIZE - STACK_FRAME_OVERHEAD - sizeof(struct pt_regs); lc->current_task = (unsigned long) tsk; lc->lpp = LPP_MAGIC; lc->current_pid = tsk->pid; lc->user_timer = tsk->thread.user_timer; lc->guest_timer = tsk->thread.guest_timer; lc->system_timer = tsk->thread.system_timer; lc->hardirq_timer = tsk->thread.hardirq_timer; lc->softirq_timer = tsk->thread.softirq_timer; lc->steal_timer = 0; }

Contributors

PersonTokensPropCommitsCommitProp
Martin Schwidefsky7457.81%541.67%
Christian Bornträger4434.38%216.67%
Linus Torvalds64.69%216.67%
Linus Torvalds (pre-git)21.56%18.33%
Andrew Morton10.78%18.33%
Heiko Carstens10.78%18.33%
Total128100.00%12100.00%


static void pcpu_start_fn(struct pcpu *pcpu, void (*func)(void *), void *data) { struct lowcore *lc = pcpu->lowcore; lc->restart_stack = lc->kernel_stack; lc->restart_fn = (unsigned long) func; lc->restart_data = (unsigned long) data; lc->restart_source = -1UL; pcpu_sigp_retry(pcpu, SIGP_RESTART, 0); }

Contributors

PersonTokensPropCommitsCommitProp
Martin Schwidefsky6380.77%120.00%
Heiko Carstens1316.67%360.00%
Rusty Russell22.56%120.00%
Total78100.00%5100.00%

/* * Call function via PSW restart on pcpu and stop the current cpu. */
static void pcpu_delegate(struct pcpu *pcpu, void (*func)(void *), void *data, unsigned long stack) { struct lowcore *lc = lowcore_ptr[pcpu - pcpu_devices]; unsigned long source_cpu = stap(); __load_psw_mask(PSW_KERNEL_BITS); if (pcpu->address == source_cpu) func(data); /* should not return */ /* Stop target cpu (if func returns this stops the current cpu). */ pcpu_sigp_retry(pcpu, SIGP_STOP, 0); /* Restart func on the target cpu and stop the current cpu. */ mem_assign_absolute(lc->restart_stack, stack); mem_assign_absolute(lc->restart_fn, (unsigned long) func); mem_assign_absolute(lc->restart_data, (unsigned long) data); mem_assign_absolute(lc->restart_source, source_cpu); asm volatile( "0: sigp 0,%0,%2 # sigp restart to target cpu\n" " brc 2,0b # busy, try again\n" "1: sigp 0,%1,%3 # sigp stop to current cpu\n" " brc 2,1b # busy, try again\n" : : "d" (pcpu->address), "d" (source_cpu), "K" (SIGP_RESTART), "K" (SIGP_STOP) : "0", "1", "cc"); for (;;) ; }

Contributors

PersonTokensPropCommitsCommitProp
Martin Schwidefsky5441.22%220.00%
Heiko Carstens4131.30%440.00%
Michael Holzheu1712.98%110.00%
Linus Torvalds1511.45%110.00%
Andrew Morton32.29%110.00%
Linus Torvalds (pre-git)10.76%110.00%
Total131100.00%10100.00%

/* * Enable additional logical cpus for multi-threading. */
static int pcpu_set_smt(unsigned int mtid) { int cc; if (smp_cpu_mtid == mtid) return 0; cc = __pcpu_sigp(0, SIGP_SET_MULTI_THREADING, mtid, NULL); if (cc == 0) { smp_cpu_mtid = mtid; smp_cpu_mt_shift = 0; while (smp_cpu_mtid >= (1U << smp_cpu_mt_shift)) smp_cpu_mt_shift++; pcpu_devices[0].address = stap(); } return cc; }

Contributors

PersonTokensPropCommitsCommitProp
Martin Schwidefsky6483.12%150.00%
Heiko Carstens1316.88%150.00%
Total77100.00%2100.00%

/* * Call function on an online CPU. */
void smp_call_online_cpu(void (*func)(void *), void *data) { struct pcpu *pcpu; /* Use the current cpu if it is online. */ pcpu = pcpu_find_address(cpu_online_mask, stap()); if (!pcpu) /* Use the first online cpu. */ pcpu = pcpu_devices + cpumask_first(cpu_online_mask); pcpu_delegate(pcpu, func, data, (unsigned long) restart_stack); }

Contributors

PersonTokensPropCommitsCommitProp
Martin Schwidefsky5483.08%360.00%
Linus Torvalds (pre-git)69.23%120.00%
Linus Torvalds57.69%120.00%
Total65100.00%5100.00%

/* * Call function on the ipl CPU. */
void smp_call_ipl_cpu(void (*func)(void *), void *data) { pcpu_delegate(&pcpu_devices[0], func, data, pcpu_devices->lowcore->panic_stack - PANIC_FRAME_OFFSET + PAGE_SIZE); }

Contributors

PersonTokensPropCommitsCommitProp
Martin Schwidefsky2866.67%240.00%
Linus Torvalds (pre-git)819.05%120.00%
Heiko Carstens49.52%120.00%
Michael Holzheu24.76%120.00%
Total42100.00%5100.00%


int smp_find_processor_id(u16 address) { int cpu; for_each_present_cpu(cpu) if (pcpu_devices[cpu].address == address) return cpu; return -1; }

Contributors

PersonTokensPropCommitsCommitProp
Martin Schwidefsky2575.76%250.00%
Linus Torvalds (pre-git)721.21%125.00%
Linus Torvalds13.03%125.00%
Total33100.00%4100.00%


bool arch_vcpu_is_preempted(int cpu) { if (test_cpu_flag_of(CIF_ENABLED_WAIT, cpu)) return false; if (pcpu_running(pcpu_devices + cpu)) return false; return true; }

Contributors

PersonTokensPropCommitsCommitProp
Christian Bornträger2160.00%133.33%
Martin Schwidefsky1234.29%133.33%
Michael Holzheu25.71%133.33%
Total35100.00%3100.00%

EXPORT_SYMBOL(arch_vcpu_is_preempted);
void smp_yield_cpu(int cpu) { if (MACHINE_HAS_DIAG9C) { diag_stat_inc_norecursion(DIAG_STAT_X09C); asm volatile("diag %0,0,0x9c" : : "d" (pcpu_devices[cpu].address)); } else if (MACHINE_HAS_DIAG44) { diag_stat_inc_norecursion(DIAG_STAT_X044); asm volatile("diag 0,0,0x44"); } }

Contributors

PersonTokensPropCommitsCommitProp
Martin Schwidefsky3183.78%360.00%
Michael Holzheu616.22%240.00%
Total37100.00%5100.00%

/* * Send cpus emergency shutdown signal. This gives the cpus the * opportunity to complete outstanding interrupts. */
static void smp_emergency_stop(cpumask_t *cpumask) { u64 end; int cpu; end = get_tod_clock() + (1000000UL << 12); for_each_cpu(cpu, cpumask) { struct pcpu *pcpu = pcpu_devices + cpu; set_bit(ec_stop_cpu, &pcpu->ec_mask); while (__pcpu_sigp(pcpu->address, SIGP_EMERGENCY_SIGNAL, 0, NULL) == SIGP_CC_BUSY && get_tod_clock() < end) cpu_relax(); } while (get_tod_clock() < end) { for_each_cpu(cpu, cpumask) if (pcpu_stopped(pcpu_devices + cpu)) cpumask_clear_cpu(cpu, cpumask); if (cpumask_empty(cpumask)) break; cpu_relax(); } }

Contributors

PersonTokensPropCommitsCommitProp
Martin Schwidefsky8570.25%112.50%
Michael Holzheu2218.18%112.50%
Heiko Carstens1411.57%675.00%
Total121100.00%8100.00%

/* * Stop all cpus but the current one. */
void smp_send_stop(void) { cpumask_t cpumask; int cpu; /* Disable all interrupts/machine checks */ __load_psw_mask(PSW_KERNEL_BITS | PSW_MASK_DAT); trace_hardirqs_off(); debug_set_critical(); cpumask_copy(&cpumask, cpu_online_mask); cpumask_clear_cpu(smp_processor_id(), &cpumask); if (oops_in_progress) smp_emergency_stop(&cpumask); /* stop all processors */ for_each_cpu(cpu, &cpumask) { struct pcpu *pcpu = pcpu_devices + cpu; pcpu_sigp_retry(pcpu, SIGP_STOP, 0); while (!pcpu_stopped(pcpu)) cpu_relax(); } }

Contributors

PersonTokensPropCommitsCommitProp
Martin Schwidefsky5559.78%327.27%
Heiko Carstens2628.26%545.45%
Linus Torvalds (pre-git)77.61%19.09%
Michael Holzheu33.26%19.09%
Rusty Russell11.09%19.09%
Total92100.00%11100.00%

/* * This is the main routine where commands issued by other * cpus are handled. */
static void smp_handle_ext_call(void) { unsigned long bits; /* handle bit signal external calls */ bits = xchg(&pcpu_devices[smp_processor_id()].ec_mask, 0); if (test_bit(ec_stop_cpu, &bits)) smp_stop_cpu(); if (test_bit(ec_schedule, &bits)) scheduler_ipi(); if (test_bit(ec_call_function_single, &bits)) generic_smp_call_function_single_interrupt(); }

Contributors

PersonTokensPropCommitsCommitProp
Martin Schwidefsky3754.41%116.67%
Heiko Carstens3145.59%583.33%
Total68100.00%6100.00%


static void do_ext_call_interrupt(struct ext_code ext_code, unsigned int param32, unsigned long param64) { inc_irq_stat(ext_code.code == 0x1202 ? IRQEXT_EXC : IRQEXT_EMS); smp_handle_ext_call(); }

Contributors

PersonTokensPropCommitsCommitProp
Heiko Carstens34100.00%1100.00%
Total34100.00%1100.00%


void arch_send_call_function_ipi_mask(const struct cpumask *mask) { int cpu; for_each_cpu(cpu, mask) pcpu_ec_call(pcpu_devices + cpu, ec_call_function_single); }

Contributors

PersonTokensPropCommitsCommitProp
Martin Schwidefsky1965.52%125.00%
Heiko Carstens1034.48%375.00%
Total29100.00%4100.00%


void arch_send_call_function_single_ipi(int cpu) { pcpu_ec_call(pcpu_devices + cpu, ec_call_function_single); }

Contributors

PersonTokensPropCommitsCommitProp
Martin Schwidefsky1482.35%133.33%
Heiko Carstens317.65%266.67%
Total17100.00%3100.00%

/* * this function sends a 'reschedule' IPI to another CPU. * it goes straight through and wastes no time serializing * anything. Worst case is that we lose a reschedule ... */
void smp_send_reschedule(int cpu) { pcpu_ec_call(pcpu_devices + cpu, ec_schedule); }

Contributors

PersonTokensPropCommitsCommitProp
Martin Schwidefsky1588.24%133.33%
Heiko Carstens211.76%266.67%
Total17100.00%3100.00%

/* * parameter area for the set/clear control bit callbacks */ struct ec_creg_mask_parms { unsigned long orval; unsigned long andval; int cr; }; /* * callback for setting/clearing control bits */
static void smp_ctl_bit_callback(void *info) { struct ec_creg_mask_parms *pp = info; unsigned long cregs[16]; __ctl_store(cregs, 0, 15); cregs[pp->cr] = (cregs[pp->cr] & pp->andval) | pp->orval; __ctl_load(cregs, 0, 15); }

Contributors

PersonTokensPropCommitsCommitProp
Martin Schwidefsky5380.30%250.00%
Heiko Carstens1319.70%250.00%
Total66100.00%4100.00%

/* * Set a bit in a control register of all cpus */
void smp_ctl_set_bit(int cr, int bit) { struct ec_creg_mask_parms parms = { 1UL << bit, -1UL, cr }; on_each_cpu(smp_ctl_bit_callback, &parms, 1); }

Contributors

PersonTokensPropCommitsCommitProp
Martin Schwidefsky3494.44%150.00%
Heiko Carstens25.56%150.00%
Total36100.00%2100.00%

EXPORT_SYMBOL(smp_ctl_set_bit); /* * Clear a bit in a control register of all cpus */
void smp_ctl_clear_bit(int cr, int bit) { struct ec_creg_mask_parms parms = { 0, ~(1UL << bit), cr }; on_each_cpu(smp_ctl_bit_callback, &parms, 1); }

Contributors

PersonTokensPropCommitsCommitProp
Martin Schwidefsky3694.74%150.00%
Heiko Carstens25.26%150.00%
Total38100.00%2100.00%

EXPORT_SYMBOL(smp_ctl_clear_bit); #ifdef CONFIG_CRASH_DUMP
int smp_store_status(int cpu) { struct pcpu *pcpu = pcpu_devices + cpu; unsigned long pa; pa = __pa(&pcpu->lowcore->floating_pt_save_area); if (__pcpu_sigp_relax(pcpu->address, SIGP_STORE_STATUS_AT_ADDRESS, pa) != SIGP_CC_ORDER_CODE_ACCEPTED) return -EIO; if (!MACHINE_HAS_VX && !MACHINE_HAS_GS) return 0; pa = __pa(pcpu->lowcore->mcesad & MCESA_ORIGIN_MASK); if (MACHINE_HAS_GS) pa |= pcpu->lowcore->mcesad & MCESA_LC_MASK; if (__pcpu_sigp_relax(pcpu->address, SIGP_STORE_ADDITIONAL_STATUS, pa) != SIGP_CC_ORDER_CODE_ACCEPTED) return -EIO; return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Martin Schwidefsky8374.11%562.50%
Michael Holzheu2421.43%225.00%
Heiko Carstens54.46%112.50%
Total112100.00%8100.00%

/* * Collect CPU state of the previous, crashed system. * There are four cases: * 1) standard zfcp dump * condition: OLDMEM_BASE == NULL && ipl_info.type == IPL_TYPE_FCP_DUMP * The state for all CPUs except the boot CPU needs to be collected * with sigp stop-and-store-status. The boot CPU state is located in * the absolute lowcore of the memory stored in the HSA. The zcore code * will copy the boot CPU state from the HSA. * 2) stand-alone kdump for SCSI (zfcp dump with swapped memory) * condition: OLDMEM_BASE != NULL && ipl_info.type == IPL_TYPE_FCP_DUMP * The state for all CPUs except the boot CPU needs to be collected * with sigp stop-and-store-status. The firmware or the boot-loader * stored the registers of the boot CPU in the absolute lowcore in the * memory of the old system. * 3) kdump and the old kernel did not store the CPU state, * or stand-alone kdump for DASD * condition: OLDMEM_BASE != NULL && !is_kdump_kernel() * The state for all CPUs except the boot CPU needs to be collected * with sigp stop-and-store-status. The kexec code or the boot-loader * stored the registers of the boot CPU in the memory of the old system. * 4) kdump and the old kernel stored the CPU state * condition: OLDMEM_BASE != NULL && is_kdump_kernel() * This case does not exist for s390 anymore, setup_arch explicitly * deactivates the elfcorehdr= kernel parameter */
static __init void smp_save_cpu_vxrs(struct save_area *sa, u16 addr, bool is_boot_cpu, unsigned long page) { __vector128 *vxrs = (__vector128 *) page; if (is_boot_cpu) vxrs = boot_cpu_vector_save_area; else __pcpu_sigp_relax(addr, SIGP_STORE_ADDITIONAL_STATUS, page); save_area_add_vxrs(sa, vxrs); }

Contributors

PersonTokensPropCommitsCommitProp
Martin Schwidefsky4680.70%375.00%
Michael Holzheu1119.30%125.00%
Total57100.00%4100.00%


static __init void smp_save_cpu_regs(struct save_area *sa, u16 addr, bool is_boot_cpu, unsigned long page) { void *regs = (void *) page; if (is_boot_cpu) copy_oldmem_kernel(regs, (void *) __LC_FPREGS_SAVE_AREA, 512); else __pcpu_sigp_relax(addr, SIGP_STORE_STATUS_AT_ADDRESS, page); save_area_add_regs(sa, regs); }

Contributors

PersonTokensPropCommitsCommitProp
Martin Schwidefsky4771.21%266.67%
Heiko Carstens1928.79%133.33%
Total66100.00%3100.00%


void __init smp_save_dump_cpus(void) { int addr, boot_cpu_addr, max_cpu_addr; struct save_area *sa; unsigned long page; bool is_boot_cpu; if (!(OLDMEM_BASE || ipl_info.type == IPL_TYPE_FCP_DUMP)) /* No previous system present, normal boot. */ return; /* Allocate a page as dumping area for the store status sigps */ page = memblock_alloc_base(PAGE_SIZE, PAGE_SIZE, 1UL << 31); /* Set multi-threading state to the previous system. */ pcpu_set_smt(sclp.mtid_prev); boot_cpu_addr = stap(); max_cpu_addr = SCLP_MAX_CORES << sclp.mtid_prev; for (addr = 0; addr <= max_cpu_addr; addr++) { if (__pcpu_sigp_relax(addr, SIGP_SENSE, 0) == SIGP_CC_NOT_OPERATIONAL) continue; is_boot_cpu = (addr == boot_cpu_addr); /* Allocate save area */ sa = save_area_alloc(is_boot_cpu); if (!sa) panic("could not allocate memory for save area\n"); if (MACHINE_HAS_VX) /* Get the vector registers */ smp_save_cpu_vxrs(sa, addr, is_boot_cpu, page); /* * For a zfcp dump OLDMEM_BASE == NULL and the registers * of the boot CPU are stored in the HSA. To retrieve * these registers an SCLP request is required which is * done by drivers/s390/char/zcore.c:init_cpu_info() */ if (!is_boot_cpu || OLDMEM_BASE) /* Get the CPU registers */ smp_save_cpu_regs(sa, addr, is_boot_cpu, page); } memblock_free(page, PAGE_SIZE); diag308_reset(); pcpu_set_smt(0); }

Contributors

PersonTokensPropCommitsCommitProp
Martin Schwidefsky12065.57%450.00%
Michael Holzheu5731.15%225.00%
Heiko Carstens31.64%112.50%
David Hildenbrand31.64%112.50%
Total183100.00%8100.00%

#endif /* CONFIG_CRASH_DUMP */
void smp_cpu_set_polarization(int cpu, int val) { pcpu_devices[cpu].polarization = val; }

Contributors

PersonTokensPropCommitsCommitProp
Heiko Carstens20100.00%1100.00%
Total20100.00%1100.00%


int smp_cpu_get_polarization(int cpu) { return pcpu_devices[cpu].polarization; }

Contributors

PersonTokensPropCommitsCommitProp
Heiko Carstens16100.00%1100.00%
Total16100.00%1100.00%


static void __ref smp_get_core_info(struct sclp_core_info *info, int early) { static int use_sigp_detection; int address; if (use_sigp_detection || sclp_get_core_info(info, early)) { use_sigp_detection = 1; for (address = 0; address < (SCLP_MAX_CORES << smp_cpu_mt_shift); address += (1U << smp_cpu_mt_shift)) { if (__pcpu_sigp_relax(address, SIGP_SENSE, 0) == SIGP_CC_NOT_OPERATIONAL) continue; info->core[info->configured].core_id = address >> smp_cpu_mt_shift; info->configured++; } info->combined = info->configured; } }

Contributors

PersonTokensPropCommitsCommitProp
Martin Schwidefsky4946.67%436.36%
Heiko Carstens4542.86%436.36%
Michael Holzheu98.57%19.09%
Oleg Nesterov10.95%19.09%
Linus Torvalds (pre-git)10.95%19.09%
Total105100.00%11100.00%

static int smp_add_present_cpu(int cpu);
static int __smp_rescan_cpus(struct sclp_core_info *info, int sysfs_add) { struct pcpu *pcpu; cpumask_t avail; int cpu, nr, i, j; u16 address; nr = 0; cpumask_xor(&avail, cpu_possible_mask, cpu_present_mask); cpu = cpumask_first(&avail); for (i = 0; (i < info->combined) && (cpu < nr_cpu_ids); i++) { if (sclp.has_core_type && info->core[i].type != boot_core_type) continue; address = info->core[i].core_id << smp_cpu_mt_shift; for (j = 0; j <= smp_cpu_mtid; j++) { if (pcpu_find_address(cpu_present_mask, address + j)) continue; pcpu = pcpu_devices + cpu; pcpu->address = address + j; pcpu->state = (cpu >= info->configured*(smp_cpu_mtid + 1)) ? CPU_STATE_STANDBY : CPU_STATE_CONFIGURED; smp_cpu_set_polarization(cpu, POLARIZATION_UNKNOWN); set_cpu_present(cpu, true); if (sysfs_add && smp_add_present_cpu(cpu) != 0) set_cpu_present(cpu, false); else nr++; cpu = cpumask_next(cpu, &avail); if (cpu >= nr_cpu_ids) break; } } return nr; }

Contributors

PersonTokensPropCommitsCommitProp
Martin Schwidefsky18881.39%538.46%
Heiko Carstens177.36%538.46%
Michael Holzheu135.63%17.69%
Linus Torvalds (pre-git)125.19%17.69%
Oleg Nesterov10.43%17.69%
Total231100.00%13100.00%


void __init smp_detect_cpus(void) { unsigned int cpu, mtid, c_cpus, s_cpus; struct sclp_core_info *info; u16 address; /* Get CPU information */ info = memblock_virt_alloc(sizeof(*info), 8); smp_get_core_info(info, 1); /* Find boot CPU type */ if (sclp.has_core_type) { address = stap(); for (cpu = 0; cpu < info->combined; cpu++) if (info->core[cpu].core_id == address) { /* The boot cpu dictates the cpu type. */ boot_core_type = info->core[cpu].type; break; } if (cpu >= info->combined) panic("Could not find boot CPU type"); } /* Set multi-threading state for the current system */ mtid = boot_core_type ? sclp.mtid : sclp.mtid_cp; mtid = (mtid < smp_max_threads) ? mtid : smp_max_threads - 1; pcpu_set_smt(mtid); /* Print number of CPUs */ c_cpus = s_cpus = 0; for (cpu = 0; cpu < info->combined; cpu++) { if (sclp.has_core_type && info->core[cpu].type != boot_core_type) continue; if (cpu < info->configured) c_cpus += smp_cpu_mtid + 1; else s_cpus += smp_cpu_mtid + 1; } pr_info("%d configured CPUs, %d standby CPUs\n", c_cpus, s_cpus); /* Add CPUs present at boot */ get_online_cpus(); __smp_rescan_cpus(info, 0); put_online_cpus(); memblock_free_early((unsigned long)info, sizeof(*info)); }

Contributors

PersonTokensPropCommitsCommitProp
Martin Schwidefsky17469.60%337.50%
Heiko Carstens5622.40%225.00%
Michael Holzheu114.40%112.50%
David Hildenbrand83.20%112.50%
Linus Torvalds (pre-git)10.40%112.50%
Total250100.00%8100.00%

/* * Activate a secondary processor. */
static void smp_start_secondary(void *cpuvoid) { S390_lowcore.last_update_clock = get_tod_clock(); S390_lowcore.restart_stack = (unsigned long) restart_stack; S390_lowcore.restart_fn = (unsigned long) do_restart; S390_lowcore.restart_data = 0; S390_lowcore.restart_source = -1UL; restore_access_regs(S390_lowcore.access_regs_save_area); __ctl_load(S390_lowcore.cregs_save_area, 0, 15); __load_psw_mask(PSW_KERNEL_BITS | PSW_MASK_DAT); cpu_init(); preempt_disable(); init_cpu_timer(); vtime_init(); pfault_init(); notify_cpu_starting(smp_processor_id()); set_cpu_online(smp_processor_id(), true); inc_irq_stat(CPU_RST); local_irq_enable(); cpu_startup_entry(CPUHP_AP_ONLINE_IDLE); }

Contributors

PersonTokensPropCommitsCommitProp
Martin Schwidefsky6555.56%436.36%
Heiko Carstens4538.46%436.36%
Thomas Gleixner43.42%218.18%
Michael Holzheu32.56%19.09%
Total117100.00%11100.00%

/* Upping and downing of CPUs */
int __cpu_up(unsigned int cpu, struct task_struct *tidle) { struct pcpu *pcpu; int base, i, rc; pcpu = pcpu_devices + cpu; if (pcpu->state != CPU_STATE_CONFIGURED) return -EIO; base = smp_get_base_cpu(cpu); for (i = 0; i <= smp_cpu_mtid; i++) { if (base + i < nr_cpu_ids) if (cpu_online(base + i)) break; } /* * If this is the first CPU of the core to get online * do an initial CPU reset. */ if (i > smp_cpu_mtid && pcpu_sigp_retry(pcpu_devices + base, SIGP_INITIAL_CPU_RESET, 0) != SIGP_CC_ORDER_CODE_ACCEPTED) return -EIO; rc = pcpu_alloc_lowcore(pcpu, cpu); if (rc) return rc; pcpu_prepare_secondary(pcpu, cpu); pcpu_attach_task(pcpu, tidle); pcpu_start_fn(pcpu, smp_start_secondary, NULL); /* Wait until cpu puts itself in the online & active maps */ while (!cpu_online(cpu)) cpu_relax(); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Martin Schwidefsky12375.93%422.22%
Heiko Carstens3018.52%1161.11%
Thomas Gleixner63.70%211.11%
Michael Ryan31.85%15.56%
Total162100.00%18100.00%

static unsigned int setup_possible_cpus __initdata;
static int __init _setup_possible_cpus(char *s) { get_option(&s, &setup_possible_cpus); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Heiko Carstens2295.65%685.71%
Martin Schwidefsky14.35%114.29%
Total23100.00%7100.00%

early_param("possible_cpus", _setup_possible_cpus); #ifdef CONFIG_HOTPLUG_CPU
int __cpu_disable(void) { unsigned long cregs[16]; /* Handle possible pending IPIs */ smp_handle_ext_call(); set_cpu_online(smp_processor_id(), false); /* Disable pseudo page faults on this cpu. */ pfault_fini(); /* Disable interrupt sources via control register. */ __ctl_store(cregs, 0, 15); cregs[0] &= ~0x0000ee70UL; /* disable all external interrupts */ cregs[6] &= ~0xff000000UL; /* disable all I/O interrupts */ cregs[14] &= ~0x1f000000UL; /* disable most machine checks */ __ctl_load(cregs, 0, 15); clear_cpu_flag(CIF_NOHZ_DELAY); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Martin Schwidefsky6678.57%650.00%
Heiko Carstens89.52%325.00%
Zwane Mwaikambo55.95%18.33%
Linus Torvalds (pre-git)33.57%18.33%
Motohiro Kosaki22.38%18.33%
Total84100.00%12100.00%


void __cpu_die(unsigned int cpu) { struct pcpu *pcpu; /* Wait until target cpu is down */ pcpu = pcpu_devices + cpu; while (!pcpu_stopped(pcpu)) cpu_relax(); pcpu_free_lowcore(pcpu); cpumask_clear_cpu(cpu, mm_cpumask(&init_mm)); cpumask_clear_cpu(cpu, &init_mm.context.cpu_attach_mask); }

Contributors

PersonTokensPropCommitsCommitProp
Martin Schwidefsky5185.00%450.00%
Heiko Carstens711.67%337.50%
Linus Torvalds (pre-git)23.33%112.50%
Total60100.00%8100.00%


void __noreturn cpu_die(void) { idle_task_exit(); pcpu_sigp_retry(pcpu_devices + smp_processor_id(), SIGP_STOP, 0); for (;;) ; }

Contributors

PersonTokensPropCommitsCommitProp
Martin Schwidefsky2275.86%228.57%
Heiko Carstens620.69%457.14%
Linus Torvalds (pre-git)13.45%114.29%
Total29100.00%7100.00%

#endif /* CONFIG_HOTPLUG_CPU */
void __init smp_fill_possible_mask(void) { unsigned int possible, sclp_max, cpu; sclp_max = max(sclp.mtid, sclp.mtid_cp) + 1; sclp_max = min(smp_max_threads, sclp_max); sclp_max = (sclp.max_cores * sclp_max) ?: nr_cpu_ids; possible = setup_possible_cpus ?: nr_cpu_ids; possible = min(possible, sclp_max); for (cpu = 0; cpu < possible && cpu < nr_cpu_ids; cpu++) set_cpu_possible(cpu, true); }

Contributors

PersonTokensPropCommitsCommitProp
Heiko Carstens5963.44%225.00%
David Hildenbrand2324.73%337.50%
Martin Schwidefsky99.68%225.00%
Dan Carpenter22.15%112.50%
Total93100.00%8100.00%


void __init smp_prepare_cpus(unsigned int max_cpus) { unsigned long size; /* request the 0x1201 emergency signal external interrupt */ if (register_external_irq(EXT_IRQ_EMERGENCY_SIG, do_ext_call_interrupt)) panic("Couldn't request external interrupt 0x1201"); /* request the 0x1202 external call external interrupt */ if (register_external_irq(EXT_IRQ_EXTERNAL_CALL, do_ext_call_interrupt)) panic("Couldn't request external interrupt 0x1202"); /* create slab cache for the machine-check-extended-save-areas */ if (MACHINE_HAS_VX || MACHINE_HAS_GS) { size = 1UL << (MACHINE_HAS_GS ? 11 : 10); pcpu_mcesa_cache = kmem_cache_create("nmi_save_areas", size, size, 0, NULL); if (!pcpu_mcesa_cache) panic("Couldn't create nmi save area cache"); } }

Contributors

PersonTokensPropCommitsCommitProp
Martin Schwidefsky6471.11%545.45%
Heiko Carstens1213.33%327.27%
Linus Torvalds66.67%19.09%
Thomas Huth44.44%19.09%
Linus Torvalds (pre-git)44.44%19.09%
Total90100.00%11100.00%


void __init smp_prepare_boot_cpu(void) { struct pcpu *pcpu = pcpu_devices; WARN_ON(!cpu_present(0) || !cpu_online(0)); pcpu->state = CPU_STATE_CONFIGURED; pcpu->lowcore = (struct lowcore *)(unsigned long) store_prefix(); S390_lowcore.percpu_offset = __per_cpu_offset[0]; smp_cpu_set_polarization(0, POLARIZATION_UNKNOWN); }

Contributors

PersonTokensPropCommitsCommitProp
Martin Schwidefsky3247.06%430.77%
Heiko Carstens2942.65%753.85%
Andrew Morton68.82%17.69%
Linus Torvalds (pre-git)11.47%17.69%
Total68100.00%13100.00%


void __init smp_cpus_done(unsigned int max_cpus) { }

Contributors

PersonTokensPropCommitsCommitProp
Heiko Carstens9100.00%1100.00%
Total9100.00%1100.00%


void __init smp_setup_processor_id(void) { pcpu_devices[0].address = stap(); S390_lowcore.cpu_nr = 0; S390_lowcore.spinlock_lockval = arch_spin_lockval(0); }

Contributors

PersonTokensPropCommitsCommitProp
Heiko Carstens2472.73%266.67%
Philipp Hachtmann927.27%133.33%
Total33100.00%3100.00%

/* * the frequency of the profiling timer can be changed * by writing a multiplier value into /proc/profile. * * usually you want to run this on all CPUs ;) */
int setup_profiling_timer(unsigned int multiplier) { return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Heiko Carstens12100.00%1100.00%
Total12100.00%1100.00%

#ifdef CONFIG_HOTPLUG_CPU
static ssize_t cpu_configure_show(struct device *dev, struct device_attribute *attr, char *buf) { ssize_t count; mutex_lock(&smp_cpu_state_mutex); count = sprintf(buf, "%d\n", pcpu_devices[dev->id].state); mutex_unlock(&smp_cpu_state_mutex); return count; }

Contributors

PersonTokensPropCommitsCommitProp
Heiko Carstens4783.93%125.00%
Andi Kleen47.14%125.00%
Martin Schwidefsky35.36%125.00%
Kay Sievers23.57%125.00%
Total56100.00%4100.00%


static ssize_t cpu_configure_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct pcpu *pcpu; int cpu, val, rc, i; char delim; if (sscanf(buf, "%d %c", &val, &delim) != 1) return -EINVAL; if (val != 0 && val != 1) return -EINVAL; get_online_cpus(); mutex_lock(&smp_cpu_state_mutex); rc = -EBUSY; /* disallow configuration changes of online cpus and cpu 0 */ cpu = dev->id; cpu = smp_get_base_cpu(cpu); if (cpu == 0) goto out; for (i = 0; i <= smp_cpu_mtid; i++) if (cpu_online(cpu + i)) goto out; pcpu = pcpu_devices + cpu; rc = 0; switch (val) { case 0: if (pcpu->state != CPU_STATE_CONFIGURED) break; rc = sclp_core_deconfigure(pcpu->address >> smp_cpu_mt_shift); if (rc) break; for (i = 0; i <= smp_cpu_mtid; i++) { if (cpu + i >= nr_cpu_ids || !cpu_present(cpu + i)) continue; pcpu[i].state = CPU_STATE_STANDBY; smp_cpu_set_polarization(cpu + i, POLARIZATION_UNKNOWN); } topology_expect_change(); break; case 1: if (pcpu->state != CPU_STATE_STANDBY) break; rc = sclp_core_configure(pcpu->address >> smp_cpu_mt_shift); if (rc) break; for (i = 0; i <= smp_cpu_mtid; i++) { if (cpu + i >= nr_cpu_ids || !cpu_present(cpu + i)) continue; pcpu[i].state = CPU_STATE_CONFIGURED; smp_cpu_set_polarization(cpu + i, POLARIZATION_UNKNOWN); } topology_expect_change(); break; default: break; } out: mutex_unlock(&smp_cpu_state_mutex); put_online_cpus(); return rc ? rc : count; }

Contributors

PersonTokensPropCommitsCommitProp
Heiko Carstens17852.66%952.94%
Martin Schwidefsky15345.27%529.41%
Andi Kleen41.18%15.88%
Kay Sievers20.59%15.88%
Andrew Morton10.30%15.88%
Total338100.00%17100.00%

static DEVICE_ATTR(configure, 0644, cpu_configure_show, cpu_configure_store); #endif /* CONFIG_HOTPLUG_CPU */
static ssize_t show_cpu_address(struct device *dev, struct device_attribute *attr, char *buf) { return sprintf(buf, "%d\n", pcpu_devices[dev->id].address); }

Contributors

PersonTokensPropCommitsCommitProp
Heiko Carstens2567.57%233.33%
Andi Kleen410.81%116.67%
Martin Schwidefsky38.11%116.67%
Linus Torvalds (pre-git)38.11%116.67%
Kay Sievers25.41%116.67%
Total37100.00%6100.00%

static DEVICE_ATTR(address, 0444, show_cpu_address, NULL); static struct attribute *cpu_common_attrs[] = { #ifdef CONFIG_HOTPLUG_CPU &dev_attr_configure.attr, #endif &dev_attr_address.attr, NULL, }; static struct attribute_group cpu_common_attr_group = { .attrs = cpu_common_attrs, }; static struct attribute *cpu_online_attrs[] = { &dev_attr_idle_count.attr, &dev_attr_idle_time_us.attr, NULL, }; static struct attribute_group cpu_online_attr_group = { .attrs = cpu_online_attrs, };
static int smp_cpu_online(unsigned int cpu) { struct device *s = &per_cpu(cpu_device, cpu)->dev; return sysfs_create_group(&s->kobj, &cpu_online_attr_group); }

Contributors

PersonTokensPropCommitsCommitProp
Heiko Carstens2978.38%360.00%
Sebastian Andrzej Siewior616.22%120.00%
Kay Sievers25.41%120.00%
Total37100.00%5100.00%


static int smp_cpu_pre_down(unsigned int cpu) { struct device *s = &per_cpu(cpu_device, cpu)->dev; sysfs_remove_group(&s->kobj, &cpu_online_attr_group); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Sebastian Andrzej Siewior2564.10%150.00%
Heiko Carstens1435.90%150.00%
Total39100.00%2100.00%


static int smp_add_present_cpu(int cpu) { struct device *s; struct cpu *c; int rc; c = kzalloc(sizeof(*c), GFP_KERNEL); if (!c) return -ENOMEM; per_cpu(cpu_device, cpu) = c; s = &c->dev; c->hotpluggable = 1; rc = register_cpu(c, cpu); if (rc) goto out; rc = sysfs_create_group(&s->kobj, &cpu_common_attr_group); if (rc) goto out_cpu; rc = topology_cpu_init(c); if (rc) goto out_topology; return 0; out_topology: sysfs_remove_group(&s->kobj, &cpu_common_attr_group); out_cpu: #ifdef CONFIG_HOTPLUG_CPU unregister_cpu(c); #endif out: return rc; }

Contributors

PersonTokensPropCommitsCommitProp
Heiko Carstens14899.33%685.71%
Kay Sievers10.67%114.29%
Total149100.00%7100.00%

#ifdef CONFIG_HOTPLUG_CPU
int __ref smp_rescan_cpus(void) { struct sclp_core_info *info; int nr; info = kzalloc(sizeof(*info), GFP_KERNEL); if (!info) return -ENOMEM; smp_get_core_info(info, 0); get_online_cpus(); mutex_lock(&smp_cpu_state_mutex); nr = __smp_rescan_cpus(info, 1); mutex_unlock(&smp_cpu_state_mutex); put_online_cpus(); kfree(info); if (nr) topology_schedule_update(); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Heiko Carstens5158.62%969.23%
Martin Schwidefsky2832.18%215.38%
Andrew Morton78.05%17.69%
Motohiro Kosaki11.15%17.69%
Total87100.00%13100.00%


static ssize_t __ref rescan_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { int rc; rc = smp_rescan_cpus(); return rc ? rc : count; }

Contributors

PersonTokensPropCommitsCommitProp
Heiko Carstens3177.50%240.00%
Andi Kleen615.00%240.00%
Kay Sievers37.50%120.00%
Total40100.00%5100.00%

static DEVICE_ATTR(rescan, 0200, NULL, rescan_store); #endif /* CONFIG_HOTPLUG_CPU */
static int __init s390_smp_init(void) { int cpu, rc = 0; #ifdef CONFIG_HOTPLUG_CPU rc = device_create_file(cpu_subsys.dev_root, &dev_attr_rescan); if (rc) return rc; #endif for_each_present_cpu(cpu) { rc = smp_add_present_cpu(cpu); if (rc) goto out; } rc = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "s390/smp:online", smp_cpu_online, smp_cpu_pre_down); rc = rc <= 0 ? rc : 0; out: return rc; }

Contributors

PersonTokensPropCommitsCommitProp
Heiko Carstens5562.50%660.00%
Srivatsa S. Bhat1314.77%110.00%
Sebastian Andrzej Siewior910.23%110.00%
Andrew Morton66.82%110.00%
Kay Sievers55.68%110.00%
Total88100.00%10100.00%

subsys_initcall(s390_smp_init);

Overall Contributors

PersonTokensPropCommitsCommitProp
Martin Schwidefsky297356.29%3220.38%
Heiko Carstens162430.75%7145.22%
Michael Holzheu2214.18%127.64%
Linus Torvalds (pre-git)891.68%10.64%
Christian Bornträger871.65%53.18%
Linus Torvalds430.81%31.91%
Andrew Morton400.76%53.18%
Sebastian Andrzej Siewior400.76%10.64%
David Hildenbrand340.64%31.91%
Philipp Hachtmann270.51%10.64%
Kay Sievers240.45%10.64%
Andi Kleen180.34%21.27%
Srivatsa S. Bhat130.25%10.64%
Thomas Gleixner100.19%42.55%
Ingo Molnar60.11%21.27%
Zwane Mwaikambo50.09%10.64%
Thomas Huth40.08%10.64%
Motohiro Kosaki30.06%10.64%
Alexey Dobriyan30.06%10.64%
Rusty Russell30.06%21.27%
Michael Ryan30.06%10.64%
Tejun Heo30.06%10.64%
Peter Zijlstra30.06%10.64%
Oleg Nesterov20.04%10.64%
Dan Carpenter20.04%10.64%
Greg Kroah-Hartman10.02%10.64%
Paul Gortmaker10.02%10.64%
Total5282100.00%157100.00%
Directory: arch/s390/kernel
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.