diff options
Diffstat (limited to 'arch/powerpc/kernel/lparcfg.c')
-rw-r--r-- | arch/powerpc/kernel/lparcfg.c | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/lparcfg.c b/arch/powerpc/kernel/lparcfg.c index 78b3f7840ade..2419cc706ff1 100644 --- a/arch/powerpc/kernel/lparcfg.c +++ b/arch/powerpc/kernel/lparcfg.c | |||
@@ -169,6 +169,9 @@ struct hvcall_ppp_data { | |||
169 | u8 unallocated_weight; | 169 | u8 unallocated_weight; |
170 | u16 active_procs_in_pool; | 170 | u16 active_procs_in_pool; |
171 | u16 active_system_procs; | 171 | u16 active_system_procs; |
172 | u16 phys_platform_procs; | ||
173 | u32 max_proc_cap_avail; | ||
174 | u32 entitled_proc_cap_avail; | ||
172 | }; | 175 | }; |
173 | 176 | ||
174 | /* | 177 | /* |
@@ -190,13 +193,18 @@ struct hvcall_ppp_data { | |||
190 | * XX - Unallocated Variable Processor Capacity Weight. | 193 | * XX - Unallocated Variable Processor Capacity Weight. |
191 | * XXXX - Active processors in Physical Processor Pool. | 194 | * XXXX - Active processors in Physical Processor Pool. |
192 | * XXXX - Processors active on platform. | 195 | * XXXX - Processors active on platform. |
196 | * R8 (QQQQRRRRRRSSSSSS). if ibm,partition-performance-parameters-level >= 1 | ||
197 | * XXXX - Physical platform procs allocated to virtualization. | ||
198 | * XXXXXX - Max procs capacity % available to the partitions pool. | ||
199 | * XXXXXX - Entitled procs capacity % available to the | ||
200 | * partitions pool. | ||
193 | */ | 201 | */ |
194 | static unsigned int h_get_ppp(struct hvcall_ppp_data *ppp_data) | 202 | static unsigned int h_get_ppp(struct hvcall_ppp_data *ppp_data) |
195 | { | 203 | { |
196 | unsigned long rc; | 204 | unsigned long rc; |
197 | unsigned long retbuf[PLPAR_HCALL_BUFSIZE]; | 205 | unsigned long retbuf[PLPAR_HCALL9_BUFSIZE]; |
198 | 206 | ||
199 | rc = plpar_hcall(H_GET_PPP, retbuf); | 207 | rc = plpar_hcall9(H_GET_PPP, retbuf); |
200 | 208 | ||
201 | ppp_data->entitlement = retbuf[0]; | 209 | ppp_data->entitlement = retbuf[0]; |
202 | ppp_data->unallocated_entitlement = retbuf[1]; | 210 | ppp_data->unallocated_entitlement = retbuf[1]; |
@@ -210,6 +218,10 @@ static unsigned int h_get_ppp(struct hvcall_ppp_data *ppp_data) | |||
210 | ppp_data->active_procs_in_pool = (retbuf[3] >> 2 * 8) & 0xffff; | 218 | ppp_data->active_procs_in_pool = (retbuf[3] >> 2 * 8) & 0xffff; |
211 | ppp_data->active_system_procs = retbuf[3] & 0xffff; | 219 | ppp_data->active_system_procs = retbuf[3] & 0xffff; |
212 | 220 | ||
221 | ppp_data->phys_platform_procs = retbuf[4] >> 6 * 8; | ||
222 | ppp_data->max_proc_cap_avail = (retbuf[4] >> 3 * 8) & 0xffffff; | ||
223 | ppp_data->entitled_proc_cap_avail = retbuf[4] & 0xffffff; | ||
224 | |||
213 | return rc; | 225 | return rc; |
214 | } | 226 | } |
215 | 227 | ||
@@ -234,6 +246,8 @@ static unsigned h_pic(unsigned long *pool_idle_time, | |||
234 | static void parse_ppp_data(struct seq_file *m) | 246 | static void parse_ppp_data(struct seq_file *m) |
235 | { | 247 | { |
236 | struct hvcall_ppp_data ppp_data; | 248 | struct hvcall_ppp_data ppp_data; |
249 | struct device_node *root; | ||
250 | const int *perf_level; | ||
237 | int rc; | 251 | int rc; |
238 | 252 | ||
239 | rc = h_get_ppp(&ppp_data); | 253 | rc = h_get_ppp(&ppp_data); |
@@ -267,6 +281,28 @@ static void parse_ppp_data(struct seq_file *m) | |||
267 | seq_printf(m, "capped=%d\n", ppp_data.capped); | 281 | seq_printf(m, "capped=%d\n", ppp_data.capped); |
268 | seq_printf(m, "unallocated_capacity=%lld\n", | 282 | seq_printf(m, "unallocated_capacity=%lld\n", |
269 | ppp_data.unallocated_entitlement); | 283 | ppp_data.unallocated_entitlement); |
284 | |||
285 | /* The last bits of information returned from h_get_ppp are only | ||
286 | * valid if the ibm,partition-performance-parameters-level | ||
287 | * property is >= 1. | ||
288 | */ | ||
289 | root = of_find_node_by_path("/"); | ||
290 | if (root) { | ||
291 | perf_level = of_get_property(root, | ||
292 | "ibm,partition-performance-parameters-level", | ||
293 | NULL); | ||
294 | if (perf_level && (*perf_level >= 1)) { | ||
295 | seq_printf(m, | ||
296 | "physical_procs_allocated_to_virtualization=%d\n", | ||
297 | ppp_data.phys_platform_procs); | ||
298 | seq_printf(m, "max_proc_capacity_available=%d\n", | ||
299 | ppp_data.max_proc_cap_avail); | ||
300 | seq_printf(m, "entitled_proc_capacity_available=%d\n", | ||
301 | ppp_data.entitled_proc_cap_avail); | ||
302 | } | ||
303 | |||
304 | of_node_put(root); | ||
305 | } | ||
270 | } | 306 | } |
271 | 307 | ||
272 | /** | 308 | /** |