OSDN Git Service

powerpc/pseries: Add hypercall wrappers for hash page table resizing
authorDavid Gibson <david@gibson.dropbear.id.au>
Fri, 9 Dec 2016 00:07:35 +0000 (11:07 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 9 Feb 2017 10:45:48 +0000 (21:45 +1100)
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>
arch/powerpc/include/asm/firmware.h
arch/powerpc/include/asm/hvcall.h
arch/powerpc/include/asm/plpar_wrappers.h
arch/powerpc/platforms/pseries/firmware.c

index 1e0b5a5..8645897 100644 (file)
@@ -42,7 +42,7 @@
 #define FW_FEATURE_SPLPAR      ASM_CONST(0x0000000000100000)
 #define FW_FEATURE_LPAR                ASM_CONST(0x0000000000400000)
 #define FW_FEATURE_PS3_LV1     ASM_CONST(0x0000000000800000)
-/* Free                                ASM_CONST(0x0000000001000000) */
+#define FW_FEATURE_HPT_RESIZE  ASM_CONST(0x0000000001000000)
 #define FW_FEATURE_CMO         ASM_CONST(0x0000000002000000)
 #define FW_FEATURE_VPHN                ASM_CONST(0x0000000004000000)
 #define FW_FEATURE_XCMO                ASM_CONST(0x0000000008000000)
@@ -66,7 +66,8 @@ enum {
                FW_FEATURE_MULTITCE | FW_FEATURE_SPLPAR | FW_FEATURE_LPAR |
                FW_FEATURE_CMO | FW_FEATURE_VPHN | FW_FEATURE_XCMO |
                FW_FEATURE_SET_MODE | FW_FEATURE_BEST_ENERGY |
-               FW_FEATURE_TYPE1_AFFINITY | FW_FEATURE_PRRN,
+               FW_FEATURE_TYPE1_AFFINITY | FW_FEATURE_PRRN |
+               FW_FEATURE_HPT_RESIZE,
        FW_FEATURE_PSERIES_ALWAYS = 0,
        FW_FEATURE_POWERNV_POSSIBLE = FW_FEATURE_OPAL,
        FW_FEATURE_POWERNV_ALWAYS = 0,
index 77ff1ba..490c4b9 100644 (file)
 #define H_GET_MPP_X            0x314
 #define H_SET_MODE             0x31C
 #define H_CLEAR_HPT            0x358
+#define H_RESIZE_HPT_PREPARE   0x36C
+#define H_RESIZE_HPT_COMMIT    0x370
 #define H_SIGNAL_SYS_RESET     0x380
 #define MAX_HCALL_OPCODE       H_SIGNAL_SYS_RESET
 
index 0bcc75e..c7b1648 100644 (file)
@@ -210,6 +210,18 @@ static inline long plpar_pte_protect(unsigned long flags, unsigned long ptex,
        return plpar_hcall_norets(H_PROTECT, flags, ptex, avpn);
 }
 
+static inline long plpar_resize_hpt_prepare(unsigned long flags,
+                                           unsigned long shift)
+{
+       return plpar_hcall_norets(H_RESIZE_HPT_PREPARE, flags, shift);
+}
+
+static inline long plpar_resize_hpt_commit(unsigned long flags,
+                                          unsigned long shift)
+{
+       return plpar_hcall_norets(H_RESIZE_HPT_COMMIT, flags, shift);
+}
+
 static inline long plpar_tce_get(unsigned long liobn, unsigned long ioba,
                unsigned long *tce_ret)
 {
index ea7f09b..658c02d 100644 (file)
@@ -64,6 +64,7 @@ hypertas_fw_features_table[] = {
        {FW_FEATURE_VPHN,               "hcall-vphn"},
        {FW_FEATURE_SET_MODE,           "hcall-set-mode"},
        {FW_FEATURE_BEST_ENERGY,        "hcall-best-energy-1*"},
+       {FW_FEATURE_HPT_RESIZE,         "hcall-hpt-resize"},
 };
 
 /* Build up the firmware features bitmask using the contents of