Release 4.7 arch/s390/kernel/processor.c
/*
* Copyright IBM Corp. 2008
* Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com)
*/
#define KMSG_COMPONENT "cpu"
#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
#include <linux/cpufeature.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/seq_file.h>
#include <linux/delay.h>
#include <linux/cpu.h>
#include <asm/diag.h>
#include <asm/elf.h>
#include <asm/lowcore.h>
#include <asm/param.h>
#include <asm/smp.h>
static DEFINE_PER_CPU(struct cpuid, cpu_id);
void notrace cpu_relax(void)
{
if (!smp_cpu_mtid && MACHINE_HAS_DIAG44) {
diag_stat_inc(DIAG_STAT_X044);
asm volatile("diag 0,0,0x44");
}
barrier();
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
| heiko carstens | heiko carstens | 21 | 75.00% | 2 | 66.67% |
| martin schwidefsky | martin schwidefsky | 7 | 25.00% | 1 | 33.33% |
| Total | 28 | 100.00% | 3 | 100.00% |
EXPORT_SYMBOL(cpu_relax);
/*
* cpu_init - initializes state that is per-CPU.
*/
void cpu_init(void)
{
struct cpuid *id = this_cpu_ptr(&cpu_id);
get_cpu_id(id);
atomic_inc(&init_mm.mm_count);
current->active_mm = &init_mm;
BUG_ON(current->mm);
enter_lazy_tlb(&init_mm, current);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
| martin schwidefsky | martin schwidefsky | 43 | 81.13% | 1 | 25.00% |
| heiko carstens | heiko carstens | 8 | 15.09% | 2 | 50.00% |
| christoph lameter | christoph lameter | 2 | 3.77% | 1 | 25.00% |
| Total | 53 | 100.00% | 4 | 100.00% |
/*
* cpu_have_feature - Test CPU features on module initialization
*/
int cpu_have_feature(unsigned int num)
{
return elf_hwcap & (1UL << num);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
| hendrik brueckner | hendrik brueckner | 18 | 100.00% | 1 | 100.00% |
| Total | 18 | 100.00% | 1 | 100.00% |
EXPORT_SYMBOL(cpu_have_feature);
/*
* show_cpuinfo - Get information on one CPU for use by procfs.
*/
static int show_cpuinfo(struct seq_file *m, void *v)
{
static const char *hwcap_str[] = {
"esan3", "zarch", "stfle", "msa", "ldisp", "eimm", "dfp",
"edat", "etf3eh", "highgprs", "te", "vx"
};
static const char * const int_hwcap_str[] = {
"sie"
};
unsigned long n = (unsigned long) v - 1;
int i;
if (!n) {
s390_adjust_jiffies();
seq_printf(m, "vendor_id : IBM/S390\n"
"# processors : %i\n"
"bogomips per cpu: %lu.%02lu\n",
num_online_cpus(), loops_per_jiffy/(500000/HZ),
(loops_per_jiffy/(5000/HZ))%100);
seq_puts(m, "features\t: ");
for (i = 0; i < ARRAY_SIZE(hwcap_str); i++)
if (hwcap_str[i] && (elf_hwcap & (1UL << i)))
seq_printf(m, "%s ", hwcap_str[i]);
for (i = 0; i < ARRAY_SIZE(int_hwcap_str); i++)
if (int_hwcap_str[i] && (int_hwcap & (1UL << i)))
seq_printf(m, "%s ", int_hwcap_str[i]);
seq_puts(m, "\n");
show_cacheinfo(m);
}
if (cpu_online(n)) {
struct cpuid *id = &per_cpu(cpu_id, n);
seq_printf(m, "processor %li: "
"version = %02X, "
"identification = %06X, "
"machine = %04X\n",
n, id->version, id->ident, id->machine);
}
return 0;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
| martin schwidefsky | martin schwidefsky | 201 | 73.09% | 4 | 40.00% |
| david hildenbrand | david hildenbrand | 57 | 20.73% | 1 | 10.00% |
| heiko carstens | heiko carstens | 13 | 4.73% | 3 | 30.00% |
| andreas krebbel | andreas krebbel | 4 | 1.45% | 2 | 20.00% |
| Total | 275 | 100.00% | 10 | 100.00% |
static inline void *c_update(loff_t *pos)
{
if (*pos)
*pos = cpumask_next(*pos - 1, cpu_online_mask);
return *pos < nr_cpu_ids ? (void *)*pos + 1 : NULL;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
| martin schwidefsky | martin schwidefsky | 27 | 57.45% | 2 | 66.67% |
| heiko carstens | heiko carstens | 20 | 42.55% | 1 | 33.33% |
| Total | 47 | 100.00% | 3 | 100.00% |
static void *c_start(struct seq_file *m, loff_t *pos)
{
get_online_cpus();
return c_update(pos);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
| heiko carstens | heiko carstens | 25 | 100.00% | 1 | 100.00% |
| Total | 25 | 100.00% | 1 | 100.00% |
static void *c_next(struct seq_file *m, void *v, loff_t *pos)
{
++*pos;
return c_update(pos);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
| martin schwidefsky | martin schwidefsky | 29 | 96.67% | 1 | 50.00% |
| heiko carstens | heiko carstens | 1 | 3.33% | 1 | 50.00% |
| Total | 30 | 100.00% | 2 | 100.00% |
static void c_stop(struct seq_file *m, void *v)
{
put_online_cpus();
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
| martin schwidefsky | martin schwidefsky | 13 | 72.22% | 1 | 50.00% |
| heiko carstens | heiko carstens | 5 | 27.78% | 1 | 50.00% |
| Total | 18 | 100.00% | 2 | 100.00% |
const struct seq_operations cpuinfo_op = {
.start = c_start,
.next = c_next,
.stop = c_stop,
.show = show_cpuinfo,
};
Overall Contributors
| Person | Tokens | Prop | Commits | CommitProp |
| martin schwidefsky | martin schwidefsky | 393 | 66.84% | 6 | 27.27% |
| heiko carstens | heiko carstens | 108 | 18.37% | 11 | 50.00% |
| david hildenbrand | david hildenbrand | 57 | 9.69% | 1 | 4.55% |
| hendrik brueckner | hendrik brueckner | 24 | 4.08% | 1 | 4.55% |
| andreas krebbel | andreas krebbel | 4 | 0.68% | 2 | 9.09% |
| christoph lameter | christoph lameter | 2 | 0.34% | 1 | 4.55% |
| Total | 588 | 100.00% | 22 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.