2017-11-24 17:00:38 +03:00
/* SPDX-License-Identifier: GPL-2.0 */
2008-04-17 09:46:09 +04:00
/*
* definition for store system information stsi
*
2012-07-20 13:15:04 +04:00
* Copyright IBM Corp . 2001 , 2008
2008-04-17 09:46:09 +04:00
*
* Author ( s ) : Ulrich Weigand < weigand @ de . ibm . com >
* Christian Borntraeger < borntraeger @ de . ibm . com >
*/
2008-04-30 15:38:35 +04:00
# ifndef __ASM_S390_SYSINFO_H
# define __ASM_S390_SYSINFO_H
2010-10-25 18:10:53 +04:00
# include <asm/bitsperlong.h>
2014-10-20 17:24:31 +04:00
# include <linux/uuid.h>
2010-10-25 18:10:53 +04:00
2008-04-17 09:46:09 +04:00
struct sysinfo_1_1_1 {
2012-09-03 16:05:05 +04:00
unsigned char p : 1 ;
unsigned char : 6 ;
unsigned char t : 1 ;
unsigned char : 8 ;
2010-10-25 18:10:16 +04:00
unsigned char ccr ;
unsigned char cai ;
2018-01-24 18:19:53 +03:00
char reserved_0 [ 20 ] ;
unsigned long lic ;
2008-04-17 09:46:09 +04:00
char manufacturer [ 16 ] ;
char type [ 4 ] ;
char reserved_1 [ 12 ] ;
char model_capacity [ 16 ] ;
char sequence [ 16 ] ;
char plant [ 4 ] ;
char model [ 16 ] ;
2008-04-17 09:46:10 +04:00
char model_perm_cap [ 16 ] ;
char model_temp_cap [ 16 ] ;
2012-09-03 16:05:05 +04:00
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 ;
2008-04-17 09:46:09 +04:00
} ;
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 ;
2015-12-30 15:42:37 +03:00
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 ] ;
2012-09-03 16:05:05 +04:00
unsigned int nominal_cap ;
unsigned int secondary_cap ;
2008-04-17 09:46:09 +04:00
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 ;
2015-01-14 19:52:10 +03:00
char reserved_2 [ 8 ] ;
2015-12-30 15:42:37 +03:00
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 ;
2015-01-14 19:52:10 +03:00
char reserved_3 [ 5 ] ;
2008-04-17 09:46:09 +04:00
unsigned short cpus_dedicated ;
unsigned short cpus_shared ;
2016-11-10 16:32:59 +03:00
char reserved_4 [ 3 ] ;
unsigned char vsne ;
2017-05-11 15:00:57 +03:00
uuid_t uuid ;
2016-11-10 16:32:59 +03:00
char reserved_5 [ 160 ] ;
char ext_name [ 256 ] ;
2008-04-17 09:46:09 +04:00
} ;
# 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 ] ;
2010-02-27 00:37:39 +03:00
unsigned char : 4 ;
unsigned char count : 4 ;
2008-04-17 09:46:09 +04:00
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 ] ;
2014-10-20 17:24:31 +04:00
char reserved_1 [ 3 ] ;
2016-11-10 16:32:59 +03:00
unsigned char evmne ;
2014-10-20 17:24:31 +04:00
unsigned int reserved_2 ;
2017-05-11 15:00:57 +03:00
uuid_t uuid ;
2008-04-17 09:46:09 +04:00
} vm [ 8 ] ;
2014-10-20 17:24:31 +04:00
char reserved_3 [ 1504 ] ;
char ext_names [ 8 ] [ 256 ] ;
2008-04-17 09:46:09 +04:00
} ;
2012-09-04 16:26:03 +04:00
extern int topology_max_mnest ;
2017-03-13 17:58:59 +03:00
/*
* Returns the maximum nesting level supported by the cpu topology code .
* The current maximum level is 4 which is the drawer level .
*/
2017-05-04 14:06:58 +03:00
static inline unsigned char topology_mnest_limit ( void )
2017-03-13 17:58:59 +03:00
{
return min ( topology_max_mnest , 4 ) ;
}
2010-10-25 18:10:53 +04:00
# define TOPOLOGY_NR_MAG 6
2015-01-14 19:52:10 +03:00
struct topology_core {
unsigned char nl ;
unsigned char reserved0 [ 3 ] ;
2017-09-22 15:17:41 +03:00
unsigned char : 5 ;
unsigned char d : 1 ;
2010-10-25 18:10:53 +04:00
unsigned char pp : 2 ;
unsigned char reserved1 ;
unsigned short origin ;
2017-03-09 12:02:28 +03:00
unsigned long mask ;
2010-10-25 18:10:53 +04:00
} ;
struct topology_container {
2015-01-14 19:52:10 +03:00
unsigned char nl ;
unsigned char reserved [ 6 ] ;
2010-10-25 18:10:53 +04:00
unsigned char id ;
} ;
union topology_entry {
unsigned char nl ;
2015-01-14 19:52:10 +03:00
struct topology_core cpu ;
2010-10-25 18:10:53 +04:00
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 ] ;
} ;
2012-09-06 16:42:13 +04:00
int stsi ( void * sysinfo , int fc , int sel1 , int sel2 ) ;
2008-04-30 15:38:35 +04:00
2008-12-25 15:38:49 +03:00
/*
* 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 * ) ;
2017-09-29 13:41:50 +03:00
int sthyi_fill ( void * dst , u64 * rc ) ;
2008-04-30 15:38:35 +04:00
# endif /* __ASM_S390_SYSINFO_H */