aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2016-12-08 19:07:35 -0500
committerMichael Ellerman <mpe@ellerman.id.au>2017-02-09 05:45:48 -0500
commit64b40ffbc83029f035571cad9727e34e69dbf6d0 (patch)
treee0d64048d66813b0c053f61b9c637c66955cbd5b
parentde55ce0de94b5daa804f69aa6ede793928900614 (diff)
powerpc/pseries: Add hypercall wrappers for hash page table resizing
This adds the hypercall numbers and wrapper functions for the hash page table resizing hypercalls. These hypercall numbers are defined in the PAPR ACR "HPT resizing option". It also adds a new firmware feature flag to track the presence of the HPT resizing calls. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
-rw-r--r--arch/powerpc/include/asm/firmware.h5
-rw-r--r--arch/powerpc/include/asm/hvcall.h2
-rw-r--r--arch/powerpc/include/asm/plpar_wrappers.h12
-rw-r--r--arch/powerpc/platforms/pseries/firmware.c1
4 files changed, 18 insertions, 2 deletions
diff --git a/arch/powerpc/include/asm/firmware.h b/arch/powerpc/include/asm/firmware.h
index 1e0b5a5d660a..8645897472b1 100644
--- a/arch/powerpc/include/asm/firmware.h
+++ b/arch/powerpc/include/asm/firmware.h
@@ -42,7 +42,7 @@
42#define FW_FEATURE_SPLPAR ASM_CONST(0x0000000000100000) 42#define FW_FEATURE_SPLPAR ASM_CONST(0x0000000000100000)
43#define FW_FEATURE_LPAR ASM_CONST(0x0000000000400000) 43#define FW_FEATURE_LPAR ASM_CONST(0x0000000000400000)
44#define FW_FEATURE_PS3_LV1 ASM_CONST(0x0000000000800000) 44#define FW_FEATURE_PS3_LV1 ASM_CONST(0x0000000000800000)
45/* Free ASM_CONST(0x0000000001000000) */ 45#define FW_FEATURE_HPT_RESIZE ASM_CONST(0x0000000001000000)
46#define FW_FEATURE_CMO ASM_CONST(0x0000000002000000) 46#define FW_FEATURE_CMO ASM_CONST(0x0000000002000000)
47#define FW_FEATURE_VPHN ASM_CONST(0x0000000004000000) 47#define FW_FEATURE_VPHN ASM_CONST(0x0000000004000000)
48#define FW_FEATURE_XCMO ASM_CONST(0x0000000008000000) 48#define FW_FEATURE_XCMO ASM_CONST(0x0000000008000000)
@@ -66,7 +66,8 @@ enum {
66 FW_FEATURE_MULTITCE | FW_FEATURE_SPLPAR | FW_FEATURE_LPAR | 66 FW_FEATURE_MULTITCE | FW_FEATURE_SPLPAR | FW_FEATURE_LPAR |
67 FW_FEATURE_CMO | FW_FEATURE_VPHN | FW_FEATURE_XCMO | 67 FW_FEATURE_CMO | FW_FEATURE_VPHN | FW_FEATURE_XCMO |
68 FW_FEATURE_SET_MODE | FW_FEATURE_BEST_ENERGY | 68 FW_FEATURE_SET_MODE | FW_FEATURE_BEST_ENERGY |
69 FW_FEATURE_TYPE1_AFFINITY | FW_FEATURE_PRRN, 69 FW_FEATURE_TYPE1_AFFINITY | FW_FEATURE_PRRN |
70 FW_FEATURE_HPT_RESIZE,
70 FW_FEATURE_PSERIES_ALWAYS = 0, 71 FW_FEATURE_PSERIES_ALWAYS = 0,
71 FW_FEATURE_POWERNV_POSSIBLE = FW_FEATURE_OPAL, 72 FW_FEATURE_POWERNV_POSSIBLE = FW_FEATURE_OPAL,
72 FW_FEATURE_POWERNV_ALWAYS = 0, 73 FW_FEATURE_POWERNV_ALWAYS = 0,
diff --git a/arch/powerpc/include/asm/hvcall.h b/arch/powerpc/include/asm/hvcall.h
index 77ff1ba99d1f..490c4b9f4e3a 100644
--- a/arch/powerpc/include/asm/hvcall.h
+++ b/arch/powerpc/include/asm/hvcall.h
@@ -276,6 +276,8 @@
276#define H_GET_MPP_X 0x314 276#define H_GET_MPP_X 0x314
277#define H_SET_MODE 0x31C 277#define H_SET_MODE 0x31C
278#define H_CLEAR_HPT 0x358 278#define H_CLEAR_HPT 0x358
279#define H_RESIZE_HPT_PREPARE 0x36C
280#define H_RESIZE_HPT_COMMIT 0x370
279#define H_SIGNAL_SYS_RESET 0x380 281#define H_SIGNAL_SYS_RESET 0x380
280#define MAX_HCALL_OPCODE H_SIGNAL_SYS_RESET 282#define MAX_HCALL_OPCODE H_SIGNAL_SYS_RESET
281 283
diff --git a/arch/powerpc/include/asm/plpar_wrappers.h b/arch/powerpc/include/asm/plpar_wrappers.h
index 0bcc75e295e3..c7b164836bc3 100644
--- a/arch/powerpc/include/asm/plpar_wrappers.h
+++ b/arch/powerpc/include/asm/plpar_wrappers.h
@@ -210,6 +210,18 @@ static inline long plpar_pte_protect(unsigned long flags, unsigned long ptex,
210 return plpar_hcall_norets(H_PROTECT, flags, ptex, avpn); 210 return plpar_hcall_norets(H_PROTECT, flags, ptex, avpn);
211} 211}
212 212
213static inline long plpar_resize_hpt_prepare(unsigned long flags,
214 unsigned long shift)
215{
216 return plpar_hcall_norets(H_RESIZE_HPT_PREPARE, flags, shift);
217}
218
219static inline long plpar_resize_hpt_commit(unsigned long flags,
220 unsigned long shift)
221{
222 return plpar_hcall_norets(H_RESIZE_HPT_COMMIT, flags, shift);
223}
224
213static inline long plpar_tce_get(unsigned long liobn, unsigned long ioba, 225static inline long plpar_tce_get(unsigned long liobn, unsigned long ioba,
214 unsigned long *tce_ret) 226 unsigned long *tce_ret)
215{ 227{
diff --git a/arch/powerpc/platforms/pseries/firmware.c b/arch/powerpc/platforms/pseries/firmware.c
index ea7f09bd73b1..658c02df2f36 100644
--- a/arch/powerpc/platforms/pseries/firmware.c
+++ b/arch/powerpc/platforms/pseries/firmware.c
@@ -64,6 +64,7 @@ hypertas_fw_features_table[] = {
64 {FW_FEATURE_VPHN, "hcall-vphn"}, 64 {FW_FEATURE_VPHN, "hcall-vphn"},
65 {FW_FEATURE_SET_MODE, "hcall-set-mode"}, 65 {FW_FEATURE_SET_MODE, "hcall-set-mode"},
66 {FW_FEATURE_BEST_ENERGY, "hcall-best-energy-1*"}, 66 {FW_FEATURE_BEST_ENERGY, "hcall-best-energy-1*"},
67 {FW_FEATURE_HPT_RESIZE, "hcall-hpt-resize"},
67}; 68};
68 69
69/* Build up the firmware features bitmask using the contents of 70/* Build up the firmware features bitmask using the contents of