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