lpar.c 16 KB

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