lpar.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627
  1. /*
  2. * pSeries_lpar.c
  3. * Copyright (C) 2001 Todd Inglett, IBM Corporation
  4. *
  5. * pSeries LPAR support.
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  20. */
  21. /* Enables debugging of low-level hash table routines - careful! */
  22. #undef DEBUG
  23. #include <linux/kernel.h>
  24. #include <linux/dma-mapping.h>
  25. #include <linux/console.h>
  26. #include <asm/processor.h>
  27. #include <asm/mmu.h>
  28. #include <asm/page.h>
  29. #include <asm/pgtable.h>
  30. #include <asm/machdep.h>
  31. #include <asm/abs_addr.h>
  32. #include <asm/mmu_context.h>
  33. #include <asm/iommu.h>
  34. #include <asm/tlbflush.h>
  35. #include <asm/tlb.h>
  36. #include <asm/prom.h>
  37. #include <asm/cputable.h>
  38. #include <asm/udbg.h>
  39. #include <asm/smp.h>
  40. #include <asm/trace.h>
  41. #include "plpar_wrappers.h"
  42. #include "pseries.h"
  43. /* in hvCall.S */
  44. EXPORT_SYMBOL(plpar_hcall);
  45. EXPORT_SYMBOL(plpar_hcall9);
  46. EXPORT_SYMBOL(plpar_hcall_norets);
  47. extern void pSeries_find_serial_port(void);
  48. void vpa_init(int cpu)
  49. {
  50. int hwcpu = get_hard_smp_processor_id(cpu);
  51. unsigned long addr;
  52. long ret;
  53. struct paca_struct *pp;
  54. struct dtl_entry *dtl;
  55. if (cpu_has_feature(CPU_FTR_ALTIVEC))
  56. lppaca_of(cpu).vmxregs_in_use = 1;
  57. addr = __pa(&lppaca_of(cpu));
  58. ret = register_vpa(hwcpu, addr);
  59. if (ret) {
  60. pr_err("WARNING: VPA registration for cpu %d (hw %d) of area "
  61. "%lx failed with %ld\n", cpu, hwcpu, addr, ret);
  62. return;
  63. }
  64. /*
  65. * PAPR says this feature is SLB-Buffer but firmware never
  66. * reports that. All SPLPAR support SLB shadow buffer.
  67. */
  68. addr = __pa(&slb_shadow[cpu]);
  69. if (firmware_has_feature(FW_FEATURE_SPLPAR)) {
  70. ret = register_slb_shadow(hwcpu, addr);
  71. if (ret)
  72. pr_err("WARNING: SLB shadow buffer registration for "
  73. "cpu %d (hw %d) of area %lx failed with %ld\n",
  74. cpu, hwcpu, addr, ret);
  75. }
  76. /*
  77. * Register dispatch trace log, if one has been allocated.
  78. */
  79. pp = &paca[cpu];
  80. dtl = pp->dispatch_log;
  81. if (dtl) {
  82. pp->dtl_ridx = 0;
  83. pp->dtl_curr = dtl;
  84. lppaca_of(cpu).dtl_idx = 0;
  85. /* hypervisor reads buffer length from this field */
  86. dtl->enqueue_to_dispatch_time = DISPATCH_LOG_BYTES;
  87. ret = register_dtl(hwcpu, __pa(dtl));
  88. if (ret)
  89. pr_err("WARNING: DTL registration of cpu %d (hw %d) "
  90. "failed with %ld\n", smp_processor_id(),
  91. hwcpu, ret);
  92. lppaca_of(cpu).dtl_enable_mask = 2;
  93. }
  94. }
  95. static long pSeries_lpar_hpte_insert(unsigned long hpte_group,
  96. unsigned long va, unsigned long pa,
  97. unsigned long rflags, unsigned long vflags,
  98. int psize, int ssize)
  99. {
  100. unsigned long lpar_rc;
  101. unsigned long flags;
  102. unsigned long slot;
  103. unsigned long hpte_v, hpte_r;
  104. if (!(vflags & HPTE_V_BOLTED))
  105. pr_devel("hpte_insert(group=%lx, va=%016lx, pa=%016lx, "
  106. "rflags=%lx, vflags=%lx, psize=%d)\n",
  107. hpte_group, va, pa, rflags, vflags, psize);
  108. hpte_v = hpte_encode_v(va, psize, ssize) | vflags | HPTE_V_VALID;
  109. hpte_r = hpte_encode_r(pa, psize) | rflags;
  110. if (!(vflags & HPTE_V_BOLTED))
  111. pr_devel(" hpte_v=%016lx, hpte_r=%016lx\n", hpte_v, hpte_r);
  112. /* Now fill in the actual HPTE */
  113. /* Set CEC cookie to 0 */
  114. /* Zero page = 0 */
  115. /* I-cache Invalidate = 0 */
  116. /* I-cache synchronize = 0 */
  117. /* Exact = 0 */
  118. flags = 0;
  119. /* Make pHyp happy */
  120. if ((rflags & _PAGE_NO_CACHE) & !(rflags & _PAGE_WRITETHRU))
  121. hpte_r &= ~_PAGE_COHERENT;
  122. if (firmware_has_feature(FW_FEATURE_XCMO) && !(hpte_r & HPTE_R_N))
  123. flags |= H_COALESCE_CAND;
  124. lpar_rc = plpar_pte_enter(flags, hpte_group, hpte_v, hpte_r, &slot);
  125. if (unlikely(lpar_rc == H_PTEG_FULL)) {
  126. if (!(vflags & HPTE_V_BOLTED))
  127. pr_devel(" full\n");
  128. return -1;
  129. }
  130. /*
  131. * Since we try and ioremap PHBs we don't own, the pte insert
  132. * will fail. However we must catch the failure in hash_page
  133. * or we will loop forever, so return -2 in this case.
  134. */
  135. if (unlikely(lpar_rc != H_SUCCESS)) {
  136. if (!(vflags & HPTE_V_BOLTED))
  137. pr_devel(" lpar err %lu\n", lpar_rc);
  138. return -2;
  139. }
  140. if (!(vflags & HPTE_V_BOLTED))
  141. pr_devel(" -> slot: %lu\n", slot & 7);
  142. /* Because of iSeries, we have to pass down the secondary
  143. * bucket bit here as well
  144. */
  145. return (slot & 7) | (!!(vflags & HPTE_V_SECONDARY) << 3);
  146. }
  147. static DEFINE_SPINLOCK(pSeries_lpar_tlbie_lock);
  148. static long pSeries_lpar_hpte_remove(unsigned long hpte_group)
  149. {
  150. unsigned long slot_offset;
  151. unsigned long lpar_rc;
  152. int i;
  153. unsigned long dummy1, dummy2;
  154. /* pick a random slot to start at */
  155. slot_offset = mftb() & 0x7;
  156. for (i = 0; i < HPTES_PER_GROUP; i++) {
  157. /* don't remove a bolted entry */
  158. lpar_rc = plpar_pte_remove(H_ANDCOND, hpte_group + slot_offset,
  159. (0x1UL << 4), &dummy1, &dummy2);
  160. if (lpar_rc == H_SUCCESS)
  161. return i;
  162. BUG_ON(lpar_rc != H_NOT_FOUND);
  163. slot_offset++;
  164. slot_offset &= 0x7;
  165. }
  166. return -1;
  167. }
  168. static void pSeries_lpar_hptab_clear(void)
  169. {
  170. unsigned long size_bytes = 1UL << ppc64_pft_size;
  171. unsigned long hpte_count = size_bytes >> 4;
  172. struct {
  173. unsigned long pteh;
  174. unsigned long ptel;
  175. } ptes[4];
  176. long lpar_rc;
  177. unsigned long i, j;
  178. /* Read in batches of 4,
  179. * invalidate only valid entries not in the VRMA
  180. * hpte_count will be a multiple of 4
  181. */
  182. for (i = 0; i < hpte_count; i += 4) {
  183. lpar_rc = plpar_pte_read_4_raw(0, i, (void *)ptes);
  184. if (lpar_rc != H_SUCCESS)
  185. continue;
  186. for (j = 0; j < 4; j++){
  187. if ((ptes[j].pteh & HPTE_V_VRMA_MASK) ==
  188. HPTE_V_VRMA_MASK)
  189. continue;
  190. if (ptes[j].pteh & HPTE_V_VALID)
  191. plpar_pte_remove_raw(0, i + j, 0,
  192. &(ptes[j].pteh), &(ptes[j].ptel));
  193. }
  194. }
  195. }
  196. /*
  197. * This computes the AVPN and B fields of the first dword of a HPTE,
  198. * for use when we want to match an existing PTE. The bottom 7 bits
  199. * of the returned value are zero.
  200. */
  201. static inline unsigned long hpte_encode_avpn(unsigned long va, int psize,
  202. int ssize)
  203. {
  204. unsigned long v;
  205. v = (va >> 23) & ~(mmu_psize_defs[psize].avpnm);
  206. v <<= HPTE_V_AVPN_SHIFT;
  207. v |= ((unsigned long) ssize) << HPTE_V_SSIZE_SHIFT;
  208. return v;
  209. }
  210. /*
  211. * NOTE: for updatepp ops we are fortunate that the linux "newpp" bits and
  212. * the low 3 bits of flags happen to line up. So no transform is needed.
  213. * We can probably optimize here and assume the high bits of newpp are
  214. * already zero. For now I am paranoid.
  215. */
  216. static long pSeries_lpar_hpte_updatepp(unsigned long slot,
  217. unsigned long newpp,
  218. unsigned long va,
  219. int psize, int ssize, int local)
  220. {
  221. unsigned long lpar_rc;
  222. unsigned long flags = (newpp & 7) | H_AVPN;
  223. unsigned long want_v;
  224. want_v = hpte_encode_avpn(va, psize, ssize);
  225. pr_devel(" update: avpnv=%016lx, hash=%016lx, f=%lx, psize: %d ...",
  226. want_v, slot, flags, psize);
  227. lpar_rc = plpar_pte_protect(flags, slot, want_v);
  228. if (lpar_rc == H_NOT_FOUND) {
  229. pr_devel("not found !\n");
  230. return -1;
  231. }
  232. pr_devel("ok\n");
  233. BUG_ON(lpar_rc != H_SUCCESS);
  234. return 0;
  235. }
  236. static unsigned long pSeries_lpar_hpte_getword0(unsigned long slot)
  237. {
  238. unsigned long dword0;
  239. unsigned long lpar_rc;
  240. unsigned long dummy_word1;
  241. unsigned long flags;
  242. /* Read 1 pte at a time */
  243. /* Do not need RPN to logical page translation */
  244. /* No cross CEC PFT access */
  245. flags = 0;
  246. lpar_rc = plpar_pte_read(flags, slot, &dword0, &dummy_word1);
  247. BUG_ON(lpar_rc != H_SUCCESS);
  248. return dword0;
  249. }
  250. static long pSeries_lpar_hpte_find(unsigned long va, int psize, int ssize)
  251. {
  252. unsigned long hash;
  253. unsigned long i;
  254. long slot;
  255. unsigned long want_v, hpte_v;
  256. hash = hpt_hash(va, mmu_psize_defs[psize].shift, ssize);
  257. want_v = hpte_encode_avpn(va, psize, ssize);
  258. /* Bolted entries are always in the primary group */
  259. slot = (hash & htab_hash_mask) * HPTES_PER_GROUP;
  260. for (i = 0; i < HPTES_PER_GROUP; i++) {
  261. hpte_v = pSeries_lpar_hpte_getword0(slot);
  262. if (HPTE_V_COMPARE(hpte_v, want_v) && (hpte_v & HPTE_V_VALID))
  263. /* HPTE matches */
  264. return slot;
  265. ++slot;
  266. }
  267. return -1;
  268. }
  269. static void pSeries_lpar_hpte_updateboltedpp(unsigned long newpp,
  270. unsigned long ea,
  271. int psize, int ssize)
  272. {
  273. unsigned long lpar_rc, slot, vsid, va, flags;
  274. vsid = get_kernel_vsid(ea, ssize);
  275. va = hpt_va(ea, vsid, ssize);
  276. slot = pSeries_lpar_hpte_find(va, psize, ssize);
  277. BUG_ON(slot == -1);
  278. flags = newpp & 7;
  279. lpar_rc = plpar_pte_protect(flags, slot, 0);
  280. BUG_ON(lpar_rc != H_SUCCESS);
  281. }
  282. static void pSeries_lpar_hpte_invalidate(unsigned long slot, unsigned long va,
  283. int psize, int ssize, int local)
  284. {
  285. unsigned long want_v;
  286. unsigned long lpar_rc;
  287. unsigned long dummy1, dummy2;
  288. pr_devel(" inval : slot=%lx, va=%016lx, psize: %d, local: %d\n",
  289. slot, va, psize, local);
  290. want_v = hpte_encode_avpn(va, psize, ssize);
  291. lpar_rc = plpar_pte_remove(H_AVPN, slot, want_v, &dummy1, &dummy2);
  292. if (lpar_rc == H_NOT_FOUND)
  293. return;
  294. BUG_ON(lpar_rc != H_SUCCESS);
  295. }
  296. static void pSeries_lpar_hpte_removebolted(unsigned long ea,
  297. int psize, int ssize)
  298. {
  299. unsigned long slot, vsid, va;
  300. vsid = get_kernel_vsid(ea, ssize);
  301. va = hpt_va(ea, vsid, ssize);
  302. slot = pSeries_lpar_hpte_find(va, psize, ssize);
  303. BUG_ON(slot == -1);
  304. pSeries_lpar_hpte_invalidate(slot, va, psize, ssize, 0);
  305. }
  306. /* Flag bits for H_BULK_REMOVE */
  307. #define HBR_REQUEST 0x4000000000000000UL
  308. #define HBR_RESPONSE 0x8000000000000000UL
  309. #define HBR_END 0xc000000000000000UL
  310. #define HBR_AVPN 0x0200000000000000UL
  311. #define HBR_ANDCOND 0x0100000000000000UL
  312. /*
  313. * Take a spinlock around flushes to avoid bouncing the hypervisor tlbie
  314. * lock.
  315. */
  316. static void pSeries_lpar_flush_hash_range(unsigned long number, int local)
  317. {
  318. unsigned long i, pix, rc;
  319. unsigned long flags = 0;
  320. struct ppc64_tlb_batch *batch = &__get_cpu_var(ppc64_tlb_batch);
  321. int lock_tlbie = !mmu_has_feature(MMU_FTR_LOCKLESS_TLBIE);
  322. unsigned long param[9];
  323. unsigned long va;
  324. unsigned long hash, index, shift, hidx, slot;
  325. real_pte_t pte;
  326. int psize, ssize;
  327. if (lock_tlbie)
  328. spin_lock_irqsave(&pSeries_lpar_tlbie_lock, flags);
  329. psize = batch->psize;
  330. ssize = batch->ssize;
  331. pix = 0;
  332. for (i = 0; i < number; i++) {
  333. va = batch->vaddr[i];
  334. pte = batch->pte[i];
  335. pte_iterate_hashed_subpages(pte, psize, va, index, shift) {
  336. hash = hpt_hash(va, shift, ssize);
  337. hidx = __rpte_to_hidx(pte, index);
  338. if (hidx & _PTEIDX_SECONDARY)
  339. hash = ~hash;
  340. slot = (hash & htab_hash_mask) * HPTES_PER_GROUP;
  341. slot += hidx & _PTEIDX_GROUP_IX;
  342. if (!firmware_has_feature(FW_FEATURE_BULK_REMOVE)) {
  343. pSeries_lpar_hpte_invalidate(slot, va, psize,
  344. ssize, local);
  345. } else {
  346. param[pix] = HBR_REQUEST | HBR_AVPN | slot;
  347. param[pix+1] = hpte_encode_avpn(va, psize,
  348. ssize);
  349. pix += 2;
  350. if (pix == 8) {
  351. rc = plpar_hcall9(H_BULK_REMOVE, param,
  352. param[0], param[1], param[2],
  353. param[3], param[4], param[5],
  354. param[6], param[7]);
  355. BUG_ON(rc != H_SUCCESS);
  356. pix = 0;
  357. }
  358. }
  359. } pte_iterate_hashed_end();
  360. }
  361. if (pix) {
  362. param[pix] = HBR_END;
  363. rc = plpar_hcall9(H_BULK_REMOVE, param, param[0], param[1],
  364. param[2], param[3], param[4], param[5],
  365. param[6], param[7]);
  366. BUG_ON(rc != H_SUCCESS);
  367. }
  368. if (lock_tlbie)
  369. spin_unlock_irqrestore(&pSeries_lpar_tlbie_lock, flags);
  370. }
  371. static int __init disable_bulk_remove(char *str)
  372. {
  373. if (strcmp(str, "off") == 0 &&
  374. firmware_has_feature(FW_FEATURE_BULK_REMOVE)) {
  375. printk(KERN_INFO "Disabling BULK_REMOVE firmware feature");
  376. powerpc_firmware_features &= ~FW_FEATURE_BULK_REMOVE;
  377. }
  378. return 1;
  379. }
  380. __setup("bulk_remove=", disable_bulk_remove);
  381. void __init hpte_init_lpar(void)
  382. {
  383. ppc_md.hpte_invalidate = pSeries_lpar_hpte_invalidate;
  384. ppc_md.hpte_updatepp = pSeries_lpar_hpte_updatepp;
  385. ppc_md.hpte_updateboltedpp = pSeries_lpar_hpte_updateboltedpp;
  386. ppc_md.hpte_insert = pSeries_lpar_hpte_insert;
  387. ppc_md.hpte_remove = pSeries_lpar_hpte_remove;
  388. ppc_md.hpte_removebolted = pSeries_lpar_hpte_removebolted;
  389. ppc_md.flush_hash_range = pSeries_lpar_flush_hash_range;
  390. ppc_md.hpte_clear_all = pSeries_lpar_hptab_clear;
  391. }
  392. #ifdef CONFIG_PPC_SMLPAR
  393. #define CMO_FREE_HINT_DEFAULT 1
  394. static int cmo_free_hint_flag = CMO_FREE_HINT_DEFAULT;
  395. static int __init cmo_free_hint(char *str)
  396. {
  397. char *parm;
  398. parm = strstrip(str);
  399. if (strcasecmp(parm, "no") == 0 || strcasecmp(parm, "off") == 0) {
  400. printk(KERN_INFO "cmo_free_hint: CMO free page hinting is not active.\n");
  401. cmo_free_hint_flag = 0;
  402. return 1;
  403. }
  404. cmo_free_hint_flag = 1;
  405. printk(KERN_INFO "cmo_free_hint: CMO free page hinting is active.\n");
  406. if (strcasecmp(parm, "yes") == 0 || strcasecmp(parm, "on") == 0)
  407. return 1;
  408. return 0;
  409. }
  410. __setup("cmo_free_hint=", cmo_free_hint);
  411. static void pSeries_set_page_state(struct page *page, int order,
  412. unsigned long state)
  413. {
  414. int i, j;
  415. unsigned long cmo_page_sz, addr;
  416. cmo_page_sz = cmo_get_page_size();
  417. addr = __pa((unsigned long)page_address(page));
  418. for (i = 0; i < (1 << order); i++, addr += PAGE_SIZE) {
  419. for (j = 0; j < PAGE_SIZE; j += cmo_page_sz)
  420. plpar_hcall_norets(H_PAGE_INIT, state, addr + j, 0);
  421. }
  422. }
  423. void arch_free_page(struct page *page, int order)
  424. {
  425. if (!cmo_free_hint_flag || !firmware_has_feature(FW_FEATURE_CMO))
  426. return;
  427. pSeries_set_page_state(page, order, H_PAGE_SET_UNUSED);
  428. }
  429. EXPORT_SYMBOL(arch_free_page);
  430. #endif
  431. #ifdef CONFIG_TRACEPOINTS
  432. /*
  433. * We optimise our hcall path by placing hcall_tracepoint_refcount
  434. * directly in the TOC so we can check if the hcall tracepoints are
  435. * enabled via a single load.
  436. */
  437. /* NB: reg/unreg are called while guarded with the tracepoints_mutex */
  438. extern long hcall_tracepoint_refcount;
  439. /*
  440. * Since the tracing code might execute hcalls we need to guard against
  441. * recursion. One example of this are spinlocks calling H_YIELD on
  442. * shared processor partitions.
  443. */
  444. static DEFINE_PER_CPU(unsigned int, hcall_trace_depth);
  445. void hcall_tracepoint_regfunc(void)
  446. {
  447. hcall_tracepoint_refcount++;
  448. }
  449. void hcall_tracepoint_unregfunc(void)
  450. {
  451. hcall_tracepoint_refcount--;
  452. }
  453. void __trace_hcall_entry(unsigned long opcode, unsigned long *args)
  454. {
  455. unsigned long flags;
  456. unsigned int *depth;
  457. local_irq_save(flags);
  458. depth = &__get_cpu_var(hcall_trace_depth);
  459. if (*depth)
  460. goto out;
  461. (*depth)++;
  462. trace_hcall_entry(opcode, args);
  463. (*depth)--;
  464. out:
  465. local_irq_restore(flags);
  466. }
  467. void __trace_hcall_exit(long opcode, unsigned long retval,
  468. unsigned long *retbuf)
  469. {
  470. unsigned long flags;
  471. unsigned int *depth;
  472. local_irq_save(flags);
  473. depth = &__get_cpu_var(hcall_trace_depth);
  474. if (*depth)
  475. goto out;
  476. (*depth)++;
  477. trace_hcall_exit(opcode, retval, retbuf);
  478. (*depth)--;
  479. out:
  480. local_irq_restore(flags);
  481. }
  482. #endif
  483. /**
  484. * h_get_mpp
  485. * H_GET_MPP hcall returns info in 7 parms
  486. */
  487. int h_get_mpp(struct hvcall_mpp_data *mpp_data)
  488. {
  489. int rc;
  490. unsigned long retbuf[PLPAR_HCALL9_BUFSIZE];
  491. rc = plpar_hcall9(H_GET_MPP, retbuf);
  492. mpp_data->entitled_mem = retbuf[0];
  493. mpp_data->mapped_mem = retbuf[1];
  494. mpp_data->group_num = (retbuf[2] >> 2 * 8) & 0xffff;
  495. mpp_data->pool_num = retbuf[2] & 0xffff;
  496. mpp_data->mem_weight = (retbuf[3] >> 7 * 8) & 0xff;
  497. mpp_data->unallocated_mem_weight = (retbuf[3] >> 6 * 8) & 0xff;
  498. mpp_data->unallocated_entitlement = retbuf[3] & 0xffffffffffff;
  499. mpp_data->pool_size = retbuf[4];
  500. mpp_data->loan_request = retbuf[5];
  501. mpp_data->backing_mem = retbuf[6];
  502. return rc;
  503. }
  504. EXPORT_SYMBOL(h_get_mpp);
  505. int h_get_mpp_x(struct hvcall_mpp_x_data *mpp_x_data)
  506. {
  507. int rc;
  508. unsigned long retbuf[PLPAR_HCALL9_BUFSIZE] = { 0 };
  509. rc = plpar_hcall9(H_GET_MPP_X, retbuf);
  510. mpp_x_data->coalesced_bytes = retbuf[0];
  511. mpp_x_data->pool_coalesced_bytes = retbuf[1];
  512. mpp_x_data->pool_purr_cycles = retbuf[2];
  513. mpp_x_data->pool_spurr_cycles = retbuf[3];
  514. return rc;
  515. }