if (stsi(info, 1, 2, 2)) return;
ext = (struct sysinfo_1_2_2_extension *)
((unsignedlong) info + info->acc_offset);
seq_printf(m, "CPUs Total: %d\n", info->cpus_total);
seq_printf(m, "CPUs Configured: %d\n", info->cpus_configured);
seq_printf(m, "CPUs Standby: %d\n", info->cpus_standby);
seq_printf(m, "CPUs Reserved: %d\n", info->cpus_reserved); if (info->mt_installed) {
seq_printf(m, "CPUs G-MTID: %d\n", info->mt_gtid);
seq_printf(m, "CPUs S-MTID: %d\n", info->mt_stid);
} /* * Sigh 2. According to the specification the alternate * capability field is a 32 bit floating point number * if the higher order 8 bits are not zero. Printing * a floating point number in the kernel is a no-no, * always print the number as 32 bit unsigned integer. * The user-space needs to know about the strange * encoding of the alternate cpu capability.
*/
seq_printf(m, "Capability: %u", info->capability); if (info->format == 1)
seq_printf(m, " %u", ext->alt_capability);
seq_putc(m, '\n'); if (info->nominal_cap)
seq_printf(m, "Nominal Capability: %d\n", info->nominal_cap); if (info->secondary_cap)
seq_printf(m, "Secondary Capability: %d\n", info->secondary_cap); for (i = 2; i <= info->cpus_total; i++) {
seq_printf(m, "Adjustment %02d-way: %u",
i, info->adjustment[i-2]); if (info->format == 1)
seq_printf(m, " %u", ext->alt_adjustment[i-2]);
seq_putc(m, '\n');
}
}
staticvoid print_uuid(struct seq_file *m, int i, struct sysinfo_3_2_2 *info)
{ if (uuid_is_null(&info->vm[i].uuid)) return;
seq_printf(m, "VM%02d UUID: %pUb\n", i, &info->vm[i].uuid);
}
staticvoid stsi_3_2_2(struct seq_file *m, struct sysinfo_3_2_2 *info)
{ int i;
if (stsi(info, 3, 2, 2)) return; for (i = 0; i < info->count; i++) {
EBCASC(info->vm[i].name, sizeof(info->vm[i].name));
EBCASC(info->vm[i].cpi, sizeof(info->vm[i].cpi));
seq_putc(m, '\n');
seq_printf(m, "VM%02d Name: %-8.8s\n", i, info->vm[i].name);
seq_printf(m, "VM%02d Control Program: %-16.16s\n", i, info->vm[i].cpi);
seq_printf(m, "VM%02d Adjustment: %d\n", i, info->vm[i].caf);
seq_printf(m, "VM%02d CPUs Total: %d\n", i, info->vm[i].cpus_total);
seq_printf(m, "VM%02d CPUs Configured: %d\n", i, info->vm[i].cpus_configured);
seq_printf(m, "VM%02d CPUs Standby: %d\n", i, info->vm[i].cpus_standby);
seq_printf(m, "VM%02d CPUs Reserved: %d\n", i, info->vm[i].cpus_reserved);
print_ext_name(m, i, info);
print_uuid(m, i, info);
}
}
static __init int create_proc_service_level(void)
{
proc_create_seq("service_levels", 0, NULL, &service_level_seq_ops); if (machine_is_vm())
register_service_level(&service_level_vm); return 0;
}
subsys_initcall(create_proc_service_level);
/* * CPU capability might have changed. Therefore recalculate loops_per_jiffy.
*/ void s390_adjust_jiffies(void)
{
DECLARE_KERNEL_FPU_ONSTACK16(fpu); struct sysinfo_1_2_2 *info; unsignedlong capability;
info = (void *) get_zeroed_page(GFP_KERNEL); if (!info) return;
if (stsi(info, 1, 2, 2) == 0) { /* * Major sigh. The cpu capability encoding is "special". * If the first 9 bits of info->capability are 0 then it * is a 32 bit unsigned integer in the range 0 .. 2^23. * If the first 9 bits are != 0 then it is a 32 bit float. * In addition a lower value indicates a proportionally * higher cpu capacity. Bogomips are the other way round. * To get to a halfway suitable number we divide 1e7 * by the cpu capability number. Yes, that means a floating * point division ..
*/
kernel_fpu_begin(&fpu, KERNEL_FPR);
fpu_sfpc(0); if (info->capability & 0xff800000)
fpu_ldgr(2, info->capability); else
fpu_cefbr(2, info->capability);
fpu_cefbr(0, 10000000);
fpu_debr(0, 2);
capability = fpu_cgebr(0, 5);
kernel_fpu_end(&fpu, KERNEL_FPR);
} else /* * Really old machine without stsi block for basic * cpu information. Report 42.0 bogomips.
*/
capability = 42;
loops_per_jiffy = capability * (500000/HZ);
free_page((unsignedlong) info);
}
/* * calibrate the delay loop
*/ void calibrate_delay(void)
{
s390_adjust_jiffies(); /* Print the good old Bogomips line .. */
printk(KERN_DEBUG "Calibrating delay loop (skipped)... " "%lu.%02lu BogoMIPS preset\n", loops_per_jiffy/(500000/HZ),
(loops_per_jiffy/(5000/HZ)) % 100);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.