Skip to content

Commit

Permalink
s390/sysinfo: add missing SYSIB 1.2.2 multithreading fields
Browse files Browse the repository at this point in the history
Add missing multithreading fields of SYSIB 1.2.2 (Basic-Machine CPUs)
to the output of /proc/sysinfo.

Also use bitfields for SYSIB 2.2.2 to simplify the C code a bit.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
Heiko Carstens authored and Martin Schwidefsky committed Jan 11, 2016
1 parent 9236b4d commit 7022ec4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
17 changes: 13 additions & 4 deletions arch/s390/include/asm/sysinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,12 @@ struct sysinfo_1_2_2 {
char format;
char reserved_0[1];
unsigned short acc_offset;
char reserved_1[20];
unsigned char mt_installed :1;
unsigned char :2;
unsigned char mt_stid :5;
unsigned char :3;
unsigned char mt_gtid :5;
char reserved_1[18];
unsigned int nominal_cap;
unsigned int secondary_cap;
unsigned int capability;
Expand Down Expand Up @@ -92,9 +97,13 @@ struct sysinfo_2_2_2 {
char name[8];
unsigned int caf;
char reserved_2[8];
unsigned char mt_installed;
unsigned char mt_general;
unsigned char mt_psmtid;
unsigned char mt_installed :1;
unsigned char :2;
unsigned char mt_stid :5;
unsigned char :3;
unsigned char mt_gtid :5;
unsigned char :3;
unsigned char mt_psmtid :5;
char reserved_3[5];
unsigned short cpus_dedicated;
unsigned short cpus_shared;
Expand Down
15 changes: 8 additions & 7 deletions arch/s390/kernel/sysinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ static void stsi_1_2_2(struct seq_file *m, struct sysinfo_1_2_2 *info)
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
Expand Down Expand Up @@ -193,13 +197,10 @@ static void stsi_2_2_2(struct seq_file *m, struct sysinfo_2_2_2 *info)
seq_printf(m, "LPAR CPUs Reserved: %d\n", info->cpus_reserved);
seq_printf(m, "LPAR CPUs Dedicated: %d\n", info->cpus_dedicated);
seq_printf(m, "LPAR CPUs Shared: %d\n", info->cpus_shared);
if (info->mt_installed & 0x80) {
seq_printf(m, "LPAR CPUs G-MTID: %d\n",
info->mt_general & 0x1f);
seq_printf(m, "LPAR CPUs S-MTID: %d\n",
info->mt_installed & 0x1f);
seq_printf(m, "LPAR CPUs PS-MTID: %d\n",
info->mt_psmtid & 0x1f);
if (info->mt_installed) {
seq_printf(m, "LPAR CPUs G-MTID: %d\n", info->mt_gtid);
seq_printf(m, "LPAR CPUs S-MTID: %d\n", info->mt_stid);
seq_printf(m, "LPAR CPUs PS-MTID: %d\n", info->mt_psmtid);
}
}

Expand Down

0 comments on commit 7022ec4

Please sign in to comment.