1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef LINUX_POWERPC_PERF_HV_24X7_H_
3 #define LINUX_POWERPC_PERF_HV_24X7_H_
5 #include <linux/types.h>
8 #define DOMAIN(n, v, x, c) HV_PERF_DOMAIN_##n = v,
9 #include "hv-24x7-domains.h"
14 #define H24x7_REQUEST_SIZE(iface_version) (iface_version == 1 ? 16 : 32)
16 struct hv_24x7_request
{
17 /* PHYSICAL domains require enabling via phyp/hmc. */
18 __u8 performance_domain
;
21 /* bytes to read starting at @data_offset. must be a multiple of 8 */
25 * byte offset within the perf domain to read from. must be 8 byte
31 * only valid for VIRTUAL_PROCESSOR domains, ignored for others.
32 * -1 means "current partition only"
33 * Enabling via phyp/hmc required for non-"-1" values. 0 forbidden
34 * unless requestor is 0.
36 __be16 starting_lpar_ix
;
39 * Ignored when @starting_lpar_ix == -1
40 * Ignored when @performance_domain is not VIRTUAL_PROCESSOR_*
41 * -1 means "infinite" or all
45 /* chip, core, or virtual processor based on @performance_domain */
49 /* The following fields were added in v2 of the 24x7 interface. */
51 __u8 starting_thread_group_ix
;
53 /* -1 means all thread groups starting at @starting_thread_group_ix */
54 __u8 max_num_thread_groups
;
59 struct hv_24x7_request_buffer
{
62 __u8 interface_version
;
65 struct hv_24x7_request requests
[];
68 struct hv_24x7_result_element_v1
{
72 * represents the core, chip, or virtual processor based on the
73 * request's @performance_domain
77 /* -1 if @performance_domain does not refer to a virtual processor */
78 __be32 lpar_cfg_instance_id
;
80 /* size = @result_element_data_size of containing result. */
85 * We need a separate struct for v2 because the offset of @element_data changed
88 struct hv_24x7_result_element_v2
{
92 * represents the core, chip, or virtual processor based on the
93 * request's @performance_domain
97 /* -1 if @performance_domain does not refer to a virtual processor */
98 __be32 lpar_cfg_instance_id
;
100 __u8 thread_group_ix
;
104 /* size = @result_element_data_size of containing result. */
105 __u64 element_data
[];
108 struct hv_24x7_result
{
110 * The index of the 24x7 Request Structure in the 24x7 Request Buffer
111 * used to request this result.
116 * 0 = not all result elements fit into the buffer, additional requests
118 * 1 = all result elements were returned
120 __u8 results_complete
;
121 __be16 num_elements_returned
;
124 * This is a copy of @data_size from the corresponding hv_24x7_request
126 * Warning: to obtain the size of each element in @elements you have
127 * to add the size of the other members of the result_element struct.
129 __be16 result_element_data_size
;
134 * struct hv_24x7_result_element_v1[@num_elements_returned]
136 * struct hv_24x7_result_element_v2[@num_elements_returned]
138 * depending on the interface_version field of the
139 * struct hv_24x7_data_result_buffer containing this result.
144 struct hv_24x7_data_result_buffer
{
145 /* See versioning for request buffer */
146 __u8 interface_version
;
150 __u8 failing_request_ix
;
152 __be64 cec_cfg_instance_id
;
153 __be64 catalog_version_num
;
155 /* WARNING: only valid for the first result due to variable sizes of
157 struct hv_24x7_result results
[]; /* [@num_results] */