sysinfo.h 4.2 KB
Newer Older
1
/* SPDX-License-Identifier: GPL-2.0 */
2 3 4
/*
 * definition for store system information stsi
 *
5
 * Copyright IBM Corp. 2001, 2008
6 7 8 9 10
 *
 *    Author(s): Ulrich Weigand <weigand@de.ibm.com>
 *		 Christian Borntraeger <borntraeger@de.ibm.com>
 */

11 12 13
#ifndef __ASM_S390_SYSINFO_H
#define __ASM_S390_SYSINFO_H

14
#include <asm/bitsperlong.h>
15
#include <linux/uuid.h>
16

17
struct sysinfo_1_1_1 {
18 19 20 21
	unsigned char p:1;
	unsigned char :6;
	unsigned char t:1;
	unsigned char :8;
22 23 24
	unsigned char ccr;
	unsigned char cai;
	char reserved_0[28];
25 26 27 28 29 30 31
	char manufacturer[16];
	char type[4];
	char reserved_1[12];
	char model_capacity[16];
	char sequence[16];
	char plant[4];
	char model[16];
32 33
	char model_perm_cap[16];
	char model_temp_cap[16];
34 35 36 37 38 39 40 41
	unsigned int model_cap_rating;
	unsigned int model_perm_cap_rating;
	unsigned int model_temp_cap_rating;
	unsigned char typepct[5];
	unsigned char reserved_2[3];
	unsigned int ncr;
	unsigned int npr;
	unsigned int ntr;
42 43 44 45 46 47 48 49 50 51 52 53 54 55
};

struct sysinfo_1_2_1 {
	char reserved_0[80];
	char sequence[16];
	char plant[4];
	char reserved_1[2];
	unsigned short cpu_address;
};

struct sysinfo_1_2_2 {
	char format;
	char reserved_0[1];
	unsigned short acc_offset;
56 57 58 59 60 61
	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];
62 63
	unsigned int nominal_cap;
	unsigned int secondary_cap;
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
	unsigned int capability;
	unsigned short cpus_total;
	unsigned short cpus_configured;
	unsigned short cpus_standby;
	unsigned short cpus_reserved;
	unsigned short adjustment[0];
};

struct sysinfo_1_2_2_extension {
	unsigned int alt_capability;
	unsigned short alt_adjustment[0];
};

struct sysinfo_2_2_1 {
	char reserved_0[80];
	char sequence[16];
	char plant[4];
	unsigned short cpu_id;
	unsigned short cpu_address;
};

struct sysinfo_2_2_2 {
	char reserved_0[32];
	unsigned short lpar_number;
	char reserved_1;
	unsigned char characteristics;
	unsigned short cpus_total;
	unsigned short cpus_configured;
	unsigned short cpus_standby;
	unsigned short cpus_reserved;
	char name[8];
	unsigned int caf;
M
Martin Schwidefsky 已提交
96
	char reserved_2[8];
97 98 99 100 101 102 103
	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;
M
Martin Schwidefsky 已提交
104
	char reserved_3[5];
105 106
	unsigned short cpus_dedicated;
	unsigned short cpus_shared;
107 108
	char reserved_4[3];
	unsigned char vsne;
109
	uuid_t uuid;
110 111
	char reserved_5[160];
	char ext_name[256];
112 113 114 115 116 117 118 119
};

#define LPAR_CHAR_DEDICATED	(1 << 7)
#define LPAR_CHAR_SHARED	(1 << 6)
#define LPAR_CHAR_LIMITED	(1 << 5)

struct sysinfo_3_2_2 {
	char reserved_0[31];
120 121
	unsigned char :4;
	unsigned char count:4;
122 123 124 125 126 127 128 129 130
	struct {
		char reserved_0[4];
		unsigned short cpus_total;
		unsigned short cpus_configured;
		unsigned short cpus_standby;
		unsigned short cpus_reserved;
		char name[8];
		unsigned int caf;
		char cpi[16];
131
		char reserved_1[3];
132
		unsigned char evmne;
133
		unsigned int reserved_2;
134
		uuid_t uuid;
135
	} vm[8];
136 137
	char reserved_3[1504];
	char ext_names[8][256];
138 139
};

140 141
extern int topology_max_mnest;

142 143 144 145
/*
 * Returns the maximum nesting level supported by the cpu topology code.
 * The current maximum level is 4 which is the drawer level.
 */
146
static inline unsigned char topology_mnest_limit(void)
147 148 149 150
{
	return min(topology_max_mnest, 4);
}

151 152
#define TOPOLOGY_NR_MAG		6

M
Martin Schwidefsky 已提交
153 154 155
struct topology_core {
	unsigned char nl;
	unsigned char reserved0[3];
156 157
	unsigned char :5;
	unsigned char d:1;
158 159 160
	unsigned char pp:2;
	unsigned char reserved1;
	unsigned short origin;
161
	unsigned long mask;
162 163 164
};

struct topology_container {
M
Martin Schwidefsky 已提交
165 166
	unsigned char nl;
	unsigned char reserved[6];
167 168 169 170 171
	unsigned char id;
};

union topology_entry {
	unsigned char nl;
M
Martin Schwidefsky 已提交
172
	struct topology_core cpu;
173 174 175 176 177 178 179 180 181 182 183 184 185
	struct topology_container container;
};

struct sysinfo_15_1_x {
	unsigned char reserved0[2];
	unsigned short length;
	unsigned char mag[TOPOLOGY_NR_MAG];
	unsigned char reserved1;
	unsigned char mnest;
	unsigned char reserved2[4];
	union topology_entry tle[0];
};

186
int stsi(void *sysinfo, int fc, int sel1, int sel2);
187

188 189 190 191 192 193 194 195 196 197 198
/*
 * Service level reporting interface.
 */
struct service_level {
	struct list_head list;
	void (*seq_print)(struct seq_file *, struct service_level *);
};

int register_service_level(struct service_level *);
int unregister_service_level(struct service_level *);

199
int sthyi_fill(void *dst, u64 *rc);
200
#endif /* __ASM_S390_SYSINFO_H */