aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/s390/include/asm/sysinfo.h7
-rw-r--r--arch/s390/kernel/sysinfo.c33
2 files changed, 27 insertions, 13 deletions
diff --git a/arch/s390/include/asm/sysinfo.h b/arch/s390/include/asm/sysinfo.h
index 2728114d5484..229326c942c7 100644
--- a/arch/s390/include/asm/sysinfo.h
+++ b/arch/s390/include/asm/sysinfo.h
@@ -107,6 +107,11 @@ struct sysinfo_2_2_2 {
107 char reserved_3[5]; 107 char reserved_3[5];
108 unsigned short cpus_dedicated; 108 unsigned short cpus_dedicated;
109 unsigned short cpus_shared; 109 unsigned short cpus_shared;
110 char reserved_4[3];
111 unsigned char vsne;
112 uuid_be uuid;
113 char reserved_5[160];
114 char ext_name[256];
110}; 115};
111 116
112#define LPAR_CHAR_DEDICATED (1 << 7) 117#define LPAR_CHAR_DEDICATED (1 << 7)
@@ -127,7 +132,7 @@ struct sysinfo_3_2_2 {
127 unsigned int caf; 132 unsigned int caf;
128 char cpi[16]; 133 char cpi[16];
129 char reserved_1[3]; 134 char reserved_1[3];
130 char ext_name_encoding; 135 unsigned char evmne;
131 unsigned int reserved_2; 136 unsigned int reserved_2;
132 uuid_be uuid; 137 uuid_be uuid;
133 } vm[8]; 138 } vm[8];
diff --git a/arch/s390/kernel/sysinfo.c b/arch/s390/kernel/sysinfo.c
index bfda6aa40280..24021c1e3ecb 100644
--- a/arch/s390/kernel/sysinfo.c
+++ b/arch/s390/kernel/sysinfo.c
@@ -56,6 +56,20 @@ int stsi(void *sysinfo, int fc, int sel1, int sel2)
56} 56}
57EXPORT_SYMBOL(stsi); 57EXPORT_SYMBOL(stsi);
58 58
59static bool convert_ext_name(unsigned char encoding, char *name, size_t len)
60{
61 switch (encoding) {
62 case 1: /* EBCDIC */
63 EBCASC(name, len);
64 break;
65 case 2: /* UTF-8 */
66 break;
67 default:
68 return false;
69 }
70 return true;
71}
72
59static void stsi_1_1_1(struct seq_file *m, struct sysinfo_1_1_1 *info) 73static void stsi_1_1_1(struct seq_file *m, struct sysinfo_1_1_1 *info)
60{ 74{
61 int i; 75 int i;
@@ -207,24 +221,19 @@ static void stsi_2_2_2(struct seq_file *m, struct sysinfo_2_2_2 *info)
207 seq_printf(m, "LPAR CPUs S-MTID: %d\n", info->mt_stid); 221 seq_printf(m, "LPAR CPUs S-MTID: %d\n", info->mt_stid);
208 seq_printf(m, "LPAR CPUs PS-MTID: %d\n", info->mt_psmtid); 222 seq_printf(m, "LPAR CPUs PS-MTID: %d\n", info->mt_psmtid);
209 } 223 }
224 if (convert_ext_name(info->vsne, info->ext_name, sizeof(info->ext_name))) {
225 seq_printf(m, "LPAR Extended Name: %-.256s\n", info->ext_name);
226 seq_printf(m, "LPAR UUID: %pUb\n", &info->uuid);
227 }
210} 228}
211 229
212static void print_ext_name(struct seq_file *m, int lvl, 230static void print_ext_name(struct seq_file *m, int lvl,
213 struct sysinfo_3_2_2 *info) 231 struct sysinfo_3_2_2 *info)
214{ 232{
215 if (info->vm[lvl].ext_name_encoding == 0) 233 size_t len = sizeof(info->ext_names[lvl]);
216 return; 234
217 if (info->ext_names[lvl][0] == 0) 235 if (!convert_ext_name(info->vm[lvl].evmne, info->ext_names[lvl], len))
218 return;
219 switch (info->vm[lvl].ext_name_encoding) {
220 case 1: /* EBCDIC */
221 EBCASC(info->ext_names[lvl], sizeof(info->ext_names[lvl]));
222 break;
223 case 2: /* UTF-8 */
224 break;
225 default:
226 return; 236 return;
227 }
228 seq_printf(m, "VM%02d Extended Name: %-.256s\n", lvl, 237 seq_printf(m, "VM%02d Extended Name: %-.256s\n", lvl,
229 info->ext_names[lvl]); 238 info->ext_names[lvl]);
230} 239}