hv-24x7.h 2.6 KB

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