s390-cpumsf-kernel.h 2.5 KB

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