1*2b1444f2SThomas Richter /* SPDX-License-Identifier: GPL-2.0 */ 2*2b1444f2SThomas Richter /* 3*2b1444f2SThomas Richter * Auxtrace support for s390 CPU measurement sampling facility 4*2b1444f2SThomas Richter * 5*2b1444f2SThomas Richter * Copyright IBM Corp. 2018 6*2b1444f2SThomas Richter * Author(s): Hendrik Brueckner <brueckner@linux.ibm.com> 7*2b1444f2SThomas Richter * Thomas Richter <tmricht@linux.ibm.com> 8*2b1444f2SThomas Richter */ 9*2b1444f2SThomas Richter #ifndef S390_CPUMSF_KERNEL_H 10*2b1444f2SThomas Richter #define S390_CPUMSF_KERNEL_H 11*2b1444f2SThomas Richter 12*2b1444f2SThomas Richter #define S390_CPUMSF_PAGESZ 4096 /* Size of sample block units */ 13*2b1444f2SThomas Richter #define S390_CPUMSF_DIAG_DEF_FIRST 0x8001 /* Diagnostic entry lowest id */ 14*2b1444f2SThomas Richter 15*2b1444f2SThomas Richter struct hws_basic_entry { 16*2b1444f2SThomas Richter unsigned int def:16; /* 0-15 Data Entry Format */ 17*2b1444f2SThomas Richter unsigned int R:4; /* 16-19 reserved */ 18*2b1444f2SThomas Richter unsigned int U:4; /* 20-23 Number of unique instruct. */ 19*2b1444f2SThomas Richter unsigned int z:2; /* zeros */ 20*2b1444f2SThomas Richter unsigned int T:1; /* 26 PSW DAT mode */ 21*2b1444f2SThomas Richter unsigned int W:1; /* 27 PSW wait state */ 22*2b1444f2SThomas Richter unsigned int P:1; /* 28 PSW Problem state */ 23*2b1444f2SThomas Richter unsigned int AS:2; /* 29-30 PSW address-space control */ 24*2b1444f2SThomas Richter unsigned int I:1; /* 31 entry valid or invalid */ 25*2b1444f2SThomas Richter unsigned int CL:2; /* 32-33 Configuration Level */ 26*2b1444f2SThomas Richter unsigned int:14; 27*2b1444f2SThomas Richter unsigned int prim_asn:16; /* primary ASN */ 28*2b1444f2SThomas Richter unsigned long long ia; /* Instruction Address */ 29*2b1444f2SThomas Richter unsigned long long gpp; /* Guest Program Parameter */ 30*2b1444f2SThomas Richter unsigned long long hpp; /* Host Program Parameter */ 31*2b1444f2SThomas Richter }; 32*2b1444f2SThomas Richter 33*2b1444f2SThomas Richter struct hws_diag_entry { 34*2b1444f2SThomas Richter unsigned int def:16; /* 0-15 Data Entry Format */ 35*2b1444f2SThomas Richter unsigned int R:15; /* 16-19 and 20-30 reserved */ 36*2b1444f2SThomas Richter unsigned int I:1; /* 31 entry valid or invalid */ 37*2b1444f2SThomas Richter u8 data[]; /* Machine-dependent sample data */ 38*2b1444f2SThomas Richter }; 39*2b1444f2SThomas Richter 40*2b1444f2SThomas Richter struct hws_combined_entry { 41*2b1444f2SThomas Richter struct hws_basic_entry basic; /* Basic-sampling data entry */ 42*2b1444f2SThomas Richter struct hws_diag_entry diag; /* Diagnostic-sampling data entry */ 43*2b1444f2SThomas Richter }; 44*2b1444f2SThomas Richter 45*2b1444f2SThomas Richter struct hws_trailer_entry { 46*2b1444f2SThomas Richter union { 47*2b1444f2SThomas Richter struct { 48*2b1444f2SThomas Richter unsigned int f:1; /* 0 - Block Full Indicator */ 49*2b1444f2SThomas Richter unsigned int a:1; /* 1 - Alert request control */ 50*2b1444f2SThomas Richter unsigned int t:1; /* 2 - Timestamp format */ 51*2b1444f2SThomas Richter unsigned int:29; /* 3 - 31: Reserved */ 52*2b1444f2SThomas Richter unsigned int bsdes:16; /* 32-47: size of basic SDE */ 53*2b1444f2SThomas Richter unsigned int dsdes:16; /* 48-63: size of diagnostic SDE */ 54*2b1444f2SThomas Richter }; 55*2b1444f2SThomas Richter unsigned long long flags; /* 0 - 64: All indicators */ 56*2b1444f2SThomas Richter }; 57*2b1444f2SThomas Richter unsigned long long overflow; /* 64 - sample Overflow count */ 58*2b1444f2SThomas Richter unsigned char timestamp[16]; /* 16 - 31 timestamp */ 59*2b1444f2SThomas Richter unsigned long long reserved1; /* 32 -Reserved */ 60*2b1444f2SThomas Richter unsigned long long reserved2; /* */ 61*2b1444f2SThomas Richter union { /* 48 - reserved for programming use */ 62*2b1444f2SThomas Richter struct { 63*2b1444f2SThomas Richter unsigned long long clock_base:1; /* in progusage2 */ 64*2b1444f2SThomas Richter unsigned long long progusage1:63; 65*2b1444f2SThomas Richter unsigned long long progusage2; 66*2b1444f2SThomas Richter }; 67*2b1444f2SThomas Richter unsigned long long progusage[2]; 68*2b1444f2SThomas Richter }; 69*2b1444f2SThomas Richter }; 70*2b1444f2SThomas Richter 71*2b1444f2SThomas Richter #endif 72