hv-24x7.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. #ifndef LINUX_POWERPC_PERF_HV_24X7_H_
  2. #define LINUX_POWERPC_PERF_HV_24X7_H_
  3. #include <linux/types.h>
  4. enum hv_perf_domains {
  5. #define DOMAIN(n, v, x, c) HV_PERF_DOMAIN_##n = v,
  6. #include "hv-24x7-domains.h"
  7. #undef DOMAIN
  8. HV_PERF_DOMAIN_MAX,
  9. };
  10. struct hv_24x7_request {
  11. /* PHYSICAL domains require enabling via phyp/hmc. */
  12. __u8 performance_domain;
  13. __u8 reserved[0x1];
  14. /* bytes to read starting at @data_offset. must be a multiple of 8 */
  15. __be16 data_size;
  16. /*
  17. * byte offset within the perf domain to read from. must be 8 byte
  18. * aligned
  19. */
  20. __be32 data_offset;
  21. /*
  22. * only valid for VIRTUAL_PROCESSOR domains, ignored for others.
  23. * -1 means "current partition only"
  24. * Enabling via phyp/hmc required for non-"-1" values. 0 forbidden
  25. * unless requestor is 0.
  26. */
  27. __be16 starting_lpar_ix;
  28. /*
  29. * Ignored when @starting_lpar_ix == -1
  30. * Ignored when @performance_domain is not VIRTUAL_PROCESSOR_*
  31. * -1 means "infinite" or all
  32. */
  33. __be16 max_num_lpars;
  34. /* chip, core, or virtual processor based on @performance_domain */
  35. __be16 starting_ix;
  36. __be16 max_ix;
  37. } __packed;
  38. struct hv_24x7_request_buffer {
  39. /* 0 - ? */
  40. /* 1 - ? */
  41. #define HV_24X7_IF_VERSION_CURRENT 0x01
  42. __u8 interface_version;
  43. __u8 num_requests;
  44. __u8 reserved[0xE];
  45. struct hv_24x7_request requests[1];
  46. } __packed;
  47. struct hv_24x7_result_element {
  48. __be16 lpar_ix;
  49. /*
  50. * represents the core, chip, or virtual processor based on the
  51. * request's @performance_domain
  52. */
  53. __be16 domain_ix;
  54. /* -1 if @performance_domain does not refer to a virtual processor */
  55. __be32 lpar_cfg_instance_id;
  56. /* size = @result_element_data_size of containing result. */
  57. __u64 element_data[1];
  58. } __packed;
  59. struct hv_24x7_result {
  60. __u8 result_ix;
  61. /*
  62. * 0 = not all result elements fit into the buffer, additional requests
  63. * required
  64. * 1 = all result elements were returned
  65. */
  66. __u8 results_complete;
  67. __be16 num_elements_returned;
  68. /* This is a copy of @data_size from the corresponding hv_24x7_request */
  69. __be16 result_element_data_size;
  70. __u8 reserved[0x2];
  71. /* WARNING: only valid for first result element due to variable sizes
  72. * of result elements */
  73. /* struct hv_24x7_result_element[@num_elements_returned] */
  74. struct hv_24x7_result_element elements[1];
  75. } __packed;
  76. struct hv_24x7_data_result_buffer {
  77. /* See versioning for request buffer */
  78. __u8 interface_version;
  79. __u8 num_results;
  80. __u8 reserved[0x1];
  81. __u8 failing_request_ix;
  82. __be32 detailed_rc;
  83. __be64 cec_cfg_instance_id;
  84. __be64 catalog_version_num;
  85. __u8 reserved2[0x8];
  86. /* WARNING: only valid for the first result due to variable sizes of
  87. * results */
  88. struct hv_24x7_result results[1]; /* [@num_results] */
  89. } __packed;
  90. #endif