Loading...
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * definition for store system information stsi
4 *
5 * Copyright IBM Corp. 2001, 2008
6 *
7 * Author(s): Ulrich Weigand <weigand@de.ibm.com>
8 * Christian Borntraeger <borntraeger@de.ibm.com>
9 */
10
11#ifndef __ASM_S390_SYSINFO_H
12#define __ASM_S390_SYSINFO_H
13
14#include <asm/bitsperlong.h>
15#include <linux/uuid.h>
16
17struct sysinfo_1_1_1 {
18 unsigned char p:1;
19 unsigned char :6;
20 unsigned char t:1;
21 unsigned char :8;
22 unsigned char ccr;
23 unsigned char cai;
24 char reserved_0[20];
25 unsigned long lic;
26 char manufacturer[16];
27 char type[4];
28 char reserved_1[12];
29 char model_capacity[16];
30 char sequence[16];
31 char plant[4];
32 char model[16];
33 char model_perm_cap[16];
34 char model_temp_cap[16];
35 unsigned int model_cap_rating;
36 unsigned int model_perm_cap_rating;
37 unsigned int model_temp_cap_rating;
38 unsigned char typepct[5];
39 unsigned char reserved_2[3];
40 unsigned int ncr;
41 unsigned int npr;
42 unsigned int ntr;
43};
44
45struct sysinfo_1_2_1 {
46 char reserved_0[80];
47 char sequence[16];
48 char plant[4];
49 char reserved_1[2];
50 unsigned short cpu_address;
51};
52
53struct sysinfo_1_2_2 {
54 char format;
55 char reserved_0[1];
56 unsigned short acc_offset;
57 unsigned char mt_installed :1;
58 unsigned char :2;
59 unsigned char mt_stid :5;
60 unsigned char :3;
61 unsigned char mt_gtid :5;
62 char reserved_1[18];
63 unsigned int nominal_cap;
64 unsigned int secondary_cap;
65 unsigned int capability;
66 unsigned short cpus_total;
67 unsigned short cpus_configured;
68 unsigned short cpus_standby;
69 unsigned short cpus_reserved;
70 unsigned short adjustment[];
71};
72
73struct sysinfo_1_2_2_extension {
74 unsigned int alt_capability;
75 unsigned short alt_adjustment[];
76};
77
78struct sysinfo_2_2_1 {
79 char reserved_0[80];
80 char sequence[16];
81 char plant[4];
82 unsigned short cpu_id;
83 unsigned short cpu_address;
84};
85
86struct sysinfo_2_2_2 {
87 char reserved_0[32];
88 unsigned short lpar_number;
89 char reserved_1;
90 unsigned char characteristics;
91 unsigned short cpus_total;
92 unsigned short cpus_configured;
93 unsigned short cpus_standby;
94 unsigned short cpus_reserved;
95 char name[8];
96 unsigned int caf;
97 char reserved_2[8];
98 unsigned char mt_installed :1;
99 unsigned char :2;
100 unsigned char mt_stid :5;
101 unsigned char :3;
102 unsigned char mt_gtid :5;
103 unsigned char :3;
104 unsigned char mt_psmtid :5;
105 char reserved_3[5];
106 unsigned short cpus_dedicated;
107 unsigned short cpus_shared;
108 char reserved_4[3];
109 unsigned char vsne;
110 uuid_t uuid;
111 char reserved_5[160];
112 char ext_name[256];
113};
114
115#define LPAR_CHAR_DEDICATED (1 << 7)
116#define LPAR_CHAR_SHARED (1 << 6)
117#define LPAR_CHAR_LIMITED (1 << 5)
118
119struct sysinfo_3_2_2 {
120 char reserved_0[31];
121 unsigned char :4;
122 unsigned char count:4;
123 struct {
124 char reserved_0[4];
125 unsigned short cpus_total;
126 unsigned short cpus_configured;
127 unsigned short cpus_standby;
128 unsigned short cpus_reserved;
129 char name[8];
130 unsigned int caf;
131 char cpi[16];
132 char reserved_1[3];
133 unsigned char evmne;
134 unsigned int reserved_2;
135 uuid_t uuid;
136 } vm[8];
137 char reserved_3[1504];
138 char ext_names[8][256];
139};
140
141extern int topology_max_mnest;
142
143/*
144 * Returns the maximum nesting level supported by the cpu topology code.
145 * The current maximum level is 4 which is the drawer level.
146 */
147static inline unsigned char topology_mnest_limit(void)
148{
149 return min(topology_max_mnest, 4);
150}
151
152#define TOPOLOGY_NR_MAG 6
153
154struct topology_core {
155 unsigned char nl;
156 unsigned char reserved0[3];
157 unsigned char :5;
158 unsigned char d:1;
159 unsigned char pp:2;
160 unsigned char reserved1;
161 unsigned short origin;
162 unsigned long mask;
163};
164
165struct topology_container {
166 unsigned char nl;
167 unsigned char reserved[6];
168 unsigned char id;
169};
170
171union topology_entry {
172 unsigned char nl;
173 struct topology_core cpu;
174 struct topology_container container;
175};
176
177struct sysinfo_15_1_x {
178 unsigned char reserved0[2];
179 unsigned short length;
180 unsigned char mag[TOPOLOGY_NR_MAG];
181 unsigned char reserved1;
182 unsigned char mnest;
183 unsigned char reserved2[4];
184 union topology_entry tle[];
185};
186
187int stsi(void *sysinfo, int fc, int sel1, int sel2);
188
189/*
190 * Service level reporting interface.
191 */
192struct service_level {
193 struct list_head list;
194 void (*seq_print)(struct seq_file *, struct service_level *);
195};
196
197int register_service_level(struct service_level *);
198int unregister_service_level(struct service_level *);
199
200int sthyi_fill(void *dst, u64 *rc);
201#endif /* __ASM_S390_SYSINFO_H */
1/*
2 * definition for store system information stsi
3 *
4 * Copyright IBM Corp. 2001, 2008
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License (version 2 only)
8 * as published by the Free Software Foundation.
9 *
10 * Author(s): Ulrich Weigand <weigand@de.ibm.com>
11 * Christian Borntraeger <borntraeger@de.ibm.com>
12 */
13
14#ifndef __ASM_S390_SYSINFO_H
15#define __ASM_S390_SYSINFO_H
16
17#include <asm/bitsperlong.h>
18#include <linux/uuid.h>
19
20struct sysinfo_1_1_1 {
21 unsigned char p:1;
22 unsigned char :6;
23 unsigned char t:1;
24 unsigned char :8;
25 unsigned char ccr;
26 unsigned char cai;
27 char reserved_0[28];
28 char manufacturer[16];
29 char type[4];
30 char reserved_1[12];
31 char model_capacity[16];
32 char sequence[16];
33 char plant[4];
34 char model[16];
35 char model_perm_cap[16];
36 char model_temp_cap[16];
37 unsigned int model_cap_rating;
38 unsigned int model_perm_cap_rating;
39 unsigned int model_temp_cap_rating;
40 unsigned char typepct[5];
41 unsigned char reserved_2[3];
42 unsigned int ncr;
43 unsigned int npr;
44 unsigned int ntr;
45};
46
47struct sysinfo_1_2_1 {
48 char reserved_0[80];
49 char sequence[16];
50 char plant[4];
51 char reserved_1[2];
52 unsigned short cpu_address;
53};
54
55struct sysinfo_1_2_2 {
56 char format;
57 char reserved_0[1];
58 unsigned short acc_offset;
59 unsigned char mt_installed :1;
60 unsigned char :2;
61 unsigned char mt_stid :5;
62 unsigned char :3;
63 unsigned char mt_gtid :5;
64 char reserved_1[18];
65 unsigned int nominal_cap;
66 unsigned int secondary_cap;
67 unsigned int capability;
68 unsigned short cpus_total;
69 unsigned short cpus_configured;
70 unsigned short cpus_standby;
71 unsigned short cpus_reserved;
72 unsigned short adjustment[0];
73};
74
75struct sysinfo_1_2_2_extension {
76 unsigned int alt_capability;
77 unsigned short alt_adjustment[0];
78};
79
80struct sysinfo_2_2_1 {
81 char reserved_0[80];
82 char sequence[16];
83 char plant[4];
84 unsigned short cpu_id;
85 unsigned short cpu_address;
86};
87
88struct sysinfo_2_2_2 {
89 char reserved_0[32];
90 unsigned short lpar_number;
91 char reserved_1;
92 unsigned char characteristics;
93 unsigned short cpus_total;
94 unsigned short cpus_configured;
95 unsigned short cpus_standby;
96 unsigned short cpus_reserved;
97 char name[8];
98 unsigned int caf;
99 char reserved_2[8];
100 unsigned char mt_installed :1;
101 unsigned char :2;
102 unsigned char mt_stid :5;
103 unsigned char :3;
104 unsigned char mt_gtid :5;
105 unsigned char :3;
106 unsigned char mt_psmtid :5;
107 char reserved_3[5];
108 unsigned short cpus_dedicated;
109 unsigned short cpus_shared;
110};
111
112#define LPAR_CHAR_DEDICATED (1 << 7)
113#define LPAR_CHAR_SHARED (1 << 6)
114#define LPAR_CHAR_LIMITED (1 << 5)
115
116struct sysinfo_3_2_2 {
117 char reserved_0[31];
118 unsigned char :4;
119 unsigned char count:4;
120 struct {
121 char reserved_0[4];
122 unsigned short cpus_total;
123 unsigned short cpus_configured;
124 unsigned short cpus_standby;
125 unsigned short cpus_reserved;
126 char name[8];
127 unsigned int caf;
128 char cpi[16];
129 char reserved_1[3];
130 char ext_name_encoding;
131 unsigned int reserved_2;
132 uuid_be uuid;
133 } vm[8];
134 char reserved_3[1504];
135 char ext_names[8][256];
136};
137
138extern int topology_max_mnest;
139
140#define TOPOLOGY_CORE_BITS 64
141#define TOPOLOGY_NR_MAG 6
142
143struct topology_core {
144 unsigned char nl;
145 unsigned char reserved0[3];
146 unsigned char :6;
147 unsigned char pp:2;
148 unsigned char reserved1;
149 unsigned short origin;
150 unsigned long mask[TOPOLOGY_CORE_BITS / BITS_PER_LONG];
151};
152
153struct topology_container {
154 unsigned char nl;
155 unsigned char reserved[6];
156 unsigned char id;
157};
158
159union topology_entry {
160 unsigned char nl;
161 struct topology_core cpu;
162 struct topology_container container;
163};
164
165struct sysinfo_15_1_x {
166 unsigned char reserved0[2];
167 unsigned short length;
168 unsigned char mag[TOPOLOGY_NR_MAG];
169 unsigned char reserved1;
170 unsigned char mnest;
171 unsigned char reserved2[4];
172 union topology_entry tle[0];
173};
174
175int stsi(void *sysinfo, int fc, int sel1, int sel2);
176
177/*
178 * Service level reporting interface.
179 */
180struct service_level {
181 struct list_head list;
182 void (*seq_print)(struct seq_file *, struct service_level *);
183};
184
185int register_service_level(struct service_level *);
186int unregister_service_level(struct service_level *);
187
188#endif /* __ASM_S390_SYSINFO_H */