Christian Borntraeger | aa24f7f | 2008-04-17 07:46:09 +0200 | [diff] [blame] | 1 | /* |
| 2 | * definition for store system information stsi |
| 3 | * |
Heiko Carstens | a53c8fa | 2012-07-20 11:15:04 +0200 | [diff] [blame] | 4 | * Copyright IBM Corp. 2001, 2008 |
Christian Borntraeger | aa24f7f | 2008-04-17 07:46:09 +0200 | [diff] [blame] | 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 | |
Heiko Carstens | f291e17 | 2008-04-30 13:38:35 +0200 | [diff] [blame] | 14 | #ifndef __ASM_S390_SYSINFO_H |
| 15 | #define __ASM_S390_SYSINFO_H |
| 16 | |
Heiko Carstens | c30f91b | 2010-10-25 16:10:53 +0200 | [diff] [blame] | 17 | #include <asm/bitsperlong.h> |
Ekaterina Tumanova | f3d0bd6 | 2014-10-20 15:24:31 +0200 | [diff] [blame] | 18 | #include <linux/uuid.h> |
Heiko Carstens | c30f91b | 2010-10-25 16:10:53 +0200 | [diff] [blame] | 19 | |
Christian Borntraeger | aa24f7f | 2008-04-17 07:46:09 +0200 | [diff] [blame] | 20 | struct sysinfo_1_1_1 { |
Heiko Carstens | 25502f0 | 2012-09-03 14:05:05 +0200 | [diff] [blame] | 21 | unsigned char p:1; |
| 22 | unsigned char :6; |
| 23 | unsigned char t:1; |
| 24 | unsigned char :8; |
Heiko Carstens | 7aca2ed | 2010-10-25 16:10:16 +0200 | [diff] [blame] | 25 | unsigned char ccr; |
| 26 | unsigned char cai; |
| 27 | char reserved_0[28]; |
Christian Borntraeger | aa24f7f | 2008-04-17 07:46:09 +0200 | [diff] [blame] | 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]; |
Martin Schwidefsky | cbce70e | 2008-04-17 07:46:10 +0200 | [diff] [blame] | 35 | char model_perm_cap[16]; |
| 36 | char model_temp_cap[16]; |
Heiko Carstens | 25502f0 | 2012-09-03 14:05:05 +0200 | [diff] [blame] | 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; |
Christian Borntraeger | aa24f7f | 2008-04-17 07:46:09 +0200 | [diff] [blame] | 45 | }; |
| 46 | |
| 47 | struct 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 | |
| 55 | struct sysinfo_1_2_2 { |
| 56 | char format; |
| 57 | char reserved_0[1]; |
| 58 | unsigned short acc_offset; |
Heiko Carstens | 7022ec4 | 2015-12-30 13:42:37 +0100 | [diff] [blame] | 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]; |
Heiko Carstens | 25502f0 | 2012-09-03 14:05:05 +0200 | [diff] [blame] | 65 | unsigned int nominal_cap; |
| 66 | unsigned int secondary_cap; |
Christian Borntraeger | aa24f7f | 2008-04-17 07:46:09 +0200 | [diff] [blame] | 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 | |
| 75 | struct sysinfo_1_2_2_extension { |
| 76 | unsigned int alt_capability; |
| 77 | unsigned short alt_adjustment[0]; |
| 78 | }; |
| 79 | |
| 80 | struct 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 | |
| 88 | struct 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; |
Martin Schwidefsky | 10ad34b | 2015-01-14 17:52:10 +0100 | [diff] [blame] | 99 | char reserved_2[8]; |
Heiko Carstens | 7022ec4 | 2015-12-30 13:42:37 +0100 | [diff] [blame] | 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; |
Martin Schwidefsky | 10ad34b | 2015-01-14 17:52:10 +0100 | [diff] [blame] | 107 | char reserved_3[5]; |
Christian Borntraeger | aa24f7f | 2008-04-17 07:46:09 +0200 | [diff] [blame] | 108 | unsigned short cpus_dedicated; |
| 109 | unsigned short cpus_shared; |
Viktor Mihajlovski | e32eae1 | 2016-11-10 14:32:59 +0100 | [diff] [blame] | 110 | char reserved_4[3]; |
| 111 | unsigned char vsne; |
Christoph Hellwig | e64e17a | 2017-05-11 14:00:57 +0200 | [diff] [blame] | 112 | uuid_t uuid; |
Viktor Mihajlovski | e32eae1 | 2016-11-10 14:32:59 +0100 | [diff] [blame] | 113 | char reserved_5[160]; |
| 114 | char ext_name[256]; |
Christian Borntraeger | aa24f7f | 2008-04-17 07:46:09 +0200 | [diff] [blame] | 115 | }; |
| 116 | |
| 117 | #define LPAR_CHAR_DEDICATED (1 << 7) |
| 118 | #define LPAR_CHAR_SHARED (1 << 6) |
| 119 | #define LPAR_CHAR_LIMITED (1 << 5) |
| 120 | |
| 121 | struct sysinfo_3_2_2 { |
| 122 | char reserved_0[31]; |
Heiko Carstens | 8387c73 | 2010-02-26 22:37:39 +0100 | [diff] [blame] | 123 | unsigned char :4; |
| 124 | unsigned char count:4; |
Christian Borntraeger | aa24f7f | 2008-04-17 07:46:09 +0200 | [diff] [blame] | 125 | struct { |
| 126 | char reserved_0[4]; |
| 127 | unsigned short cpus_total; |
| 128 | unsigned short cpus_configured; |
| 129 | unsigned short cpus_standby; |
| 130 | unsigned short cpus_reserved; |
| 131 | char name[8]; |
| 132 | unsigned int caf; |
| 133 | char cpi[16]; |
Ekaterina Tumanova | f3d0bd6 | 2014-10-20 15:24:31 +0200 | [diff] [blame] | 134 | char reserved_1[3]; |
Viktor Mihajlovski | e32eae1 | 2016-11-10 14:32:59 +0100 | [diff] [blame] | 135 | unsigned char evmne; |
Ekaterina Tumanova | f3d0bd6 | 2014-10-20 15:24:31 +0200 | [diff] [blame] | 136 | unsigned int reserved_2; |
Christoph Hellwig | e64e17a | 2017-05-11 14:00:57 +0200 | [diff] [blame] | 137 | uuid_t uuid; |
Christian Borntraeger | aa24f7f | 2008-04-17 07:46:09 +0200 | [diff] [blame] | 138 | } vm[8]; |
Ekaterina Tumanova | f3d0bd6 | 2014-10-20 15:24:31 +0200 | [diff] [blame] | 139 | char reserved_3[1504]; |
| 140 | char ext_names[8][256]; |
Christian Borntraeger | aa24f7f | 2008-04-17 07:46:09 +0200 | [diff] [blame] | 141 | }; |
| 142 | |
Heiko Carstens | fade4dc | 2012-09-04 14:26:03 +0200 | [diff] [blame] | 143 | extern int topology_max_mnest; |
| 144 | |
Heiko Carstens | ae5ca67 | 2017-03-13 15:58:59 +0100 | [diff] [blame] | 145 | /* |
| 146 | * Returns the maximum nesting level supported by the cpu topology code. |
| 147 | * The current maximum level is 4 which is the drawer level. |
| 148 | */ |
Heiko Carstens | 80ba384 | 2017-05-04 13:06:58 +0200 | [diff] [blame] | 149 | static inline unsigned char topology_mnest_limit(void) |
Heiko Carstens | ae5ca67 | 2017-03-13 15:58:59 +0100 | [diff] [blame] | 150 | { |
| 151 | return min(topology_max_mnest, 4); |
| 152 | } |
| 153 | |
Heiko Carstens | c30f91b | 2010-10-25 16:10:53 +0200 | [diff] [blame] | 154 | #define TOPOLOGY_NR_MAG 6 |
| 155 | |
Martin Schwidefsky | 10ad34b | 2015-01-14 17:52:10 +0100 | [diff] [blame] | 156 | struct topology_core { |
| 157 | unsigned char nl; |
| 158 | unsigned char reserved0[3]; |
Martin Schwidefsky | 1887aa07 | 2017-09-22 14:17:41 +0200 | [diff] [blame] | 159 | unsigned char :5; |
| 160 | unsigned char d:1; |
Heiko Carstens | c30f91b | 2010-10-25 16:10:53 +0200 | [diff] [blame] | 161 | unsigned char pp:2; |
| 162 | unsigned char reserved1; |
| 163 | unsigned short origin; |
Heiko Carstens | 251ea0c | 2017-03-09 10:02:28 +0100 | [diff] [blame] | 164 | unsigned long mask; |
Heiko Carstens | c30f91b | 2010-10-25 16:10:53 +0200 | [diff] [blame] | 165 | }; |
| 166 | |
| 167 | struct topology_container { |
Martin Schwidefsky | 10ad34b | 2015-01-14 17:52:10 +0100 | [diff] [blame] | 168 | unsigned char nl; |
| 169 | unsigned char reserved[6]; |
Heiko Carstens | c30f91b | 2010-10-25 16:10:53 +0200 | [diff] [blame] | 170 | unsigned char id; |
| 171 | }; |
| 172 | |
| 173 | union topology_entry { |
| 174 | unsigned char nl; |
Martin Schwidefsky | 10ad34b | 2015-01-14 17:52:10 +0100 | [diff] [blame] | 175 | struct topology_core cpu; |
Heiko Carstens | c30f91b | 2010-10-25 16:10:53 +0200 | [diff] [blame] | 176 | struct topology_container container; |
| 177 | }; |
| 178 | |
| 179 | struct sysinfo_15_1_x { |
| 180 | unsigned char reserved0[2]; |
| 181 | unsigned short length; |
| 182 | unsigned char mag[TOPOLOGY_NR_MAG]; |
| 183 | unsigned char reserved1; |
| 184 | unsigned char mnest; |
| 185 | unsigned char reserved2[4]; |
| 186 | union topology_entry tle[0]; |
| 187 | }; |
| 188 | |
Heiko Carstens | caf757c | 2012-09-06 14:42:13 +0200 | [diff] [blame] | 189 | int stsi(void *sysinfo, int fc, int sel1, int sel2); |
Heiko Carstens | f291e17 | 2008-04-30 13:38:35 +0200 | [diff] [blame] | 190 | |
Martin Schwidefsky | 6bcac50 | 2008-12-25 13:38:49 +0100 | [diff] [blame] | 191 | /* |
| 192 | * Service level reporting interface. |
| 193 | */ |
| 194 | struct service_level { |
| 195 | struct list_head list; |
| 196 | void (*seq_print)(struct seq_file *, struct service_level *); |
| 197 | }; |
| 198 | |
| 199 | int register_service_level(struct service_level *); |
| 200 | int unregister_service_level(struct service_level *); |
| 201 | |
QingFeng Hao | b7c92f1 | 2017-09-29 12:41:50 +0200 | [diff] [blame] | 202 | int sthyi_fill(void *dst, u64 *rc); |
Heiko Carstens | f291e17 | 2008-04-30 13:38:35 +0200 | [diff] [blame] | 203 | #endif /* __ASM_S390_SYSINFO_H */ |