Re: [RFCv2 6/9] pseries: Add hypercall wrappers for hash page table resizing
On Thu, Feb 04, 2016 at 04:41:10PM +0530, Anshuman Khandual wrote: > On 02/02/2016 06:28 AM, David Gibson wrote: > > On Mon, Feb 01, 2016 at 12:41:31PM +0530, Anshuman Khandual wrote: > >> On 01/29/2016 10:54 AM, David Gibson wrote: > >>> This adds the hypercall numbers and wrapper functions for the hash page > >>> table resizing hypercalls. > >>> > >>> These are experimental "platform specific" values for now, until we have a > >>> formal PAPR update. > >>> > >>> It also adds a new firmware feature flat to track the presence of the > >>> HPT resizing calls. > >> > >> Its a flag ... ^^^ here. > > > > Oops, thanks. > > > >> > >>> > >>> Signed-off-by: David Gibson> >>> --- > >>> arch/powerpc/include/asm/firmware.h | 5 +++-- > >>> arch/powerpc/include/asm/hvcall.h | 2 ++ > >>> arch/powerpc/include/asm/plpar_wrappers.h | 12 > >>> arch/powerpc/platforms/pseries/firmware.c | 1 + > >>> 4 files changed, 18 insertions(+), 2 deletions(-) > >>> > >>> diff --git a/arch/powerpc/include/asm/firmware.h > >>> b/arch/powerpc/include/asm/firmware.h > >>> index b062924..32435d2 100644 > >>> --- a/arch/powerpc/include/asm/firmware.h > >>> +++ b/arch/powerpc/include/asm/firmware.h > >>> @@ -42,7 +42,7 @@ > >>> #define FW_FEATURE_SPLPARASM_CONST(0x0010) > >>> #define FW_FEATURE_LPAR ASM_CONST(0x0040) > >>> #define FW_FEATURE_PS3_LV1 ASM_CONST(0x0080) > >>> -/* Free ASM_CONST(0x0100) */ > >>> +#define FW_FEATURE_HPT_RESIZEASM_CONST(0x0100) > >>> #define FW_FEATURE_CMO ASM_CONST(0x0200) > >>> #define FW_FEATURE_VPHN ASM_CONST(0x0400) > >>> #define FW_FEATURE_XCMO ASM_CONST(0x0800) > >>> @@ -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, > >>> diff --git a/arch/powerpc/include/asm/hvcall.h > >>> b/arch/powerpc/include/asm/hvcall.h > >>> index e3b54dd..195e080 100644 > >>> --- a/arch/powerpc/include/asm/hvcall.h > >>> +++ b/arch/powerpc/include/asm/hvcall.h > >>> @@ -293,6 +293,8 @@ > >>> > >>> /* Platform specific hcalls, used by KVM */ > >>> #define H_RTAS 0xf000 > >>> +#define H_RESIZE_HPT_PREPARE 0xf003 > >>> +#define H_RESIZE_HPT_COMMIT 0xf004 > >> > >> This sound better and matches FW_FEATURE_HPT_RESIZE ? > > > > I'm not quite sure what you're suggesting here. > > > >> #define H_HPT_RESIZE_PREPARE 0xf003 > >> #define H_HPT_RESIZE_COMMIT0xf004 > > Just little bit of change of name of the macro like this > > > H_RESIZE_HPT_PREPARE --> H_HPT_RESIZE_PREPARE > H_RESIZE_HPT_COMMIT --> H_HPT_RESIZE_COMMIT Oh, I see. Actually, I'm trying to standardize on "resize hpt" rather than "hpt resize" everywhere. -- David Gibson| I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson signature.asc Description: PGP signature ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [RFCv2 6/9] pseries: Add hypercall wrappers for hash page table resizing
On Fri, Jan 29, 2016 at 04:24:00PM +1100, David Gibson wrote: > This adds the hypercall numbers and wrapper functions for the hash page > table resizing hypercalls. > > These are experimental "platform specific" values for now, until we have a > formal PAPR update. > > It also adds a new firmware feature flat to track the presence of the > HPT resizing calls. > > Signed-off-by: David GibsonReviewed-by: Paul Mackerras ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [RFCv2 6/9] pseries: Add hypercall wrappers for hash page table resizing
On 02/02/2016 06:28 AM, David Gibson wrote: > On Mon, Feb 01, 2016 at 12:41:31PM +0530, Anshuman Khandual wrote: >> On 01/29/2016 10:54 AM, David Gibson wrote: >>> This adds the hypercall numbers and wrapper functions for the hash page >>> table resizing hypercalls. >>> >>> These are experimental "platform specific" values for now, until we have a >>> formal PAPR update. >>> >>> It also adds a new firmware feature flat to track the presence of the >>> HPT resizing calls. >> >> Its a flag ... ^^^ here. > > Oops, thanks. > >> >>> >>> Signed-off-by: David Gibson>>> --- >>> arch/powerpc/include/asm/firmware.h | 5 +++-- >>> arch/powerpc/include/asm/hvcall.h | 2 ++ >>> arch/powerpc/include/asm/plpar_wrappers.h | 12 >>> arch/powerpc/platforms/pseries/firmware.c | 1 + >>> 4 files changed, 18 insertions(+), 2 deletions(-) >>> >>> diff --git a/arch/powerpc/include/asm/firmware.h >>> b/arch/powerpc/include/asm/firmware.h >>> index b062924..32435d2 100644 >>> --- a/arch/powerpc/include/asm/firmware.h >>> +++ b/arch/powerpc/include/asm/firmware.h >>> @@ -42,7 +42,7 @@ >>> #define FW_FEATURE_SPLPAR ASM_CONST(0x0010) >>> #define FW_FEATURE_LPARASM_CONST(0x0040) >>> #define FW_FEATURE_PS3_LV1 ASM_CONST(0x0080) >>> -/* FreeASM_CONST(0x0100) */ >>> +#define FW_FEATURE_HPT_RESIZE ASM_CONST(0x0100) >>> #define FW_FEATURE_CMO ASM_CONST(0x0200) >>> #define FW_FEATURE_VPHNASM_CONST(0x0400) >>> #define FW_FEATURE_XCMOASM_CONST(0x0800) >>> @@ -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, >>> diff --git a/arch/powerpc/include/asm/hvcall.h >>> b/arch/powerpc/include/asm/hvcall.h >>> index e3b54dd..195e080 100644 >>> --- a/arch/powerpc/include/asm/hvcall.h >>> +++ b/arch/powerpc/include/asm/hvcall.h >>> @@ -293,6 +293,8 @@ >>> >>> /* Platform specific hcalls, used by KVM */ >>> #define H_RTAS 0xf000 >>> +#define H_RESIZE_HPT_PREPARE 0xf003 >>> +#define H_RESIZE_HPT_COMMIT0xf004 >> >> This sound better and matches FW_FEATURE_HPT_RESIZE ? > > I'm not quite sure what you're suggesting here. > >> #define H_HPT_RESIZE_PREPARE 0xf003 >> #define H_HPT_RESIZE_COMMIT 0xf004 Just little bit of change of name of the macro like this H_RESIZE_HPT_PREPARE --> H_HPT_RESIZE_PREPARE H_RESIZE_HPT_COMMIT --> H_HPT_RESIZE_COMMIT ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [RFCv2 6/9] pseries: Add hypercall wrappers for hash page table resizing
On Mon, Feb 01, 2016 at 12:41:31PM +0530, Anshuman Khandual wrote: > On 01/29/2016 10:54 AM, David Gibson wrote: > > This adds the hypercall numbers and wrapper functions for the hash page > > table resizing hypercalls. > > > > These are experimental "platform specific" values for now, until we have a > > formal PAPR update. > > > > It also adds a new firmware feature flat to track the presence of the > > HPT resizing calls. > > Its a flag ... ^^^ here. Oops, thanks. > > > > > Signed-off-by: David Gibson> > --- > > arch/powerpc/include/asm/firmware.h | 5 +++-- > > arch/powerpc/include/asm/hvcall.h | 2 ++ > > arch/powerpc/include/asm/plpar_wrappers.h | 12 > > arch/powerpc/platforms/pseries/firmware.c | 1 + > > 4 files changed, 18 insertions(+), 2 deletions(-) > > > > diff --git a/arch/powerpc/include/asm/firmware.h > > b/arch/powerpc/include/asm/firmware.h > > index b062924..32435d2 100644 > > --- a/arch/powerpc/include/asm/firmware.h > > +++ b/arch/powerpc/include/asm/firmware.h > > @@ -42,7 +42,7 @@ > > #define FW_FEATURE_SPLPAR ASM_CONST(0x0010) > > #define FW_FEATURE_LPARASM_CONST(0x0040) > > #define FW_FEATURE_PS3_LV1 ASM_CONST(0x0080) > > -/* FreeASM_CONST(0x0100) */ > > +#define FW_FEATURE_HPT_RESIZE ASM_CONST(0x0100) > > #define FW_FEATURE_CMO ASM_CONST(0x0200) > > #define FW_FEATURE_VPHNASM_CONST(0x0400) > > #define FW_FEATURE_XCMOASM_CONST(0x0800) > > @@ -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, > > diff --git a/arch/powerpc/include/asm/hvcall.h > > b/arch/powerpc/include/asm/hvcall.h > > index e3b54dd..195e080 100644 > > --- a/arch/powerpc/include/asm/hvcall.h > > +++ b/arch/powerpc/include/asm/hvcall.h > > @@ -293,6 +293,8 @@ > > > > /* Platform specific hcalls, used by KVM */ > > #define H_RTAS 0xf000 > > +#define H_RESIZE_HPT_PREPARE 0xf003 > > +#define H_RESIZE_HPT_COMMIT0xf004 > > This sound better and matches FW_FEATURE_HPT_RESIZE ? I'm not quite sure what you're suggesting here. > #define H_HPT_RESIZE_PREPARE 0xf003 > #define H_HPT_RESIZE_COMMIT 0xf004 > > -- David Gibson| I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson signature.asc Description: PGP signature ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [RFCv2 6/9] pseries: Add hypercall wrappers for hash page table resizing
On 01/29/2016 10:54 AM, David Gibson wrote: > This adds the hypercall numbers and wrapper functions for the hash page > table resizing hypercalls. > > These are experimental "platform specific" values for now, until we have a > formal PAPR update. > > It also adds a new firmware feature flat to track the presence of the > HPT resizing calls. Its a flag ... ^^^ here. > > Signed-off-by: David Gibson> --- > arch/powerpc/include/asm/firmware.h | 5 +++-- > arch/powerpc/include/asm/hvcall.h | 2 ++ > arch/powerpc/include/asm/plpar_wrappers.h | 12 > arch/powerpc/platforms/pseries/firmware.c | 1 + > 4 files changed, 18 insertions(+), 2 deletions(-) > > diff --git a/arch/powerpc/include/asm/firmware.h > b/arch/powerpc/include/asm/firmware.h > index b062924..32435d2 100644 > --- a/arch/powerpc/include/asm/firmware.h > +++ b/arch/powerpc/include/asm/firmware.h > @@ -42,7 +42,7 @@ > #define FW_FEATURE_SPLPARASM_CONST(0x0010) > #define FW_FEATURE_LPAR ASM_CONST(0x0040) > #define FW_FEATURE_PS3_LV1 ASM_CONST(0x0080) > -/* Free ASM_CONST(0x0100) */ > +#define FW_FEATURE_HPT_RESIZEASM_CONST(0x0100) > #define FW_FEATURE_CMO ASM_CONST(0x0200) > #define FW_FEATURE_VPHN ASM_CONST(0x0400) > #define FW_FEATURE_XCMO ASM_CONST(0x0800) > @@ -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, > diff --git a/arch/powerpc/include/asm/hvcall.h > b/arch/powerpc/include/asm/hvcall.h > index e3b54dd..195e080 100644 > --- a/arch/powerpc/include/asm/hvcall.h > +++ b/arch/powerpc/include/asm/hvcall.h > @@ -293,6 +293,8 @@ > > /* Platform specific hcalls, used by KVM */ > #define H_RTAS 0xf000 > +#define H_RESIZE_HPT_PREPARE 0xf003 > +#define H_RESIZE_HPT_COMMIT 0xf004 This sound better and matches FW_FEATURE_HPT_RESIZE ? #define H_HPT_RESIZE_PREPARE0xf003 #define H_HPT_RESIZE_COMMIT 0xf004 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[RFCv2 6/9] 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 are experimental "platform specific" values for now, until we have a formal PAPR update. It also adds a new firmware feature flat to track the presence of the HPT resizing calls. Signed-off-by: David Gibson--- arch/powerpc/include/asm/firmware.h | 5 +++-- arch/powerpc/include/asm/hvcall.h | 2 ++ arch/powerpc/include/asm/plpar_wrappers.h | 12 arch/powerpc/platforms/pseries/firmware.c | 1 + 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/include/asm/firmware.h b/arch/powerpc/include/asm/firmware.h index b062924..32435d2 100644 --- a/arch/powerpc/include/asm/firmware.h +++ b/arch/powerpc/include/asm/firmware.h @@ -42,7 +42,7 @@ #define FW_FEATURE_SPLPAR ASM_CONST(0x0010) #define FW_FEATURE_LPARASM_CONST(0x0040) #define FW_FEATURE_PS3_LV1 ASM_CONST(0x0080) -/* FreeASM_CONST(0x0100) */ +#define FW_FEATURE_HPT_RESIZE ASM_CONST(0x0100) #define FW_FEATURE_CMO ASM_CONST(0x0200) #define FW_FEATURE_VPHNASM_CONST(0x0400) #define FW_FEATURE_XCMOASM_CONST(0x0800) @@ -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, diff --git a/arch/powerpc/include/asm/hvcall.h b/arch/powerpc/include/asm/hvcall.h index e3b54dd..195e080 100644 --- a/arch/powerpc/include/asm/hvcall.h +++ b/arch/powerpc/include/asm/hvcall.h @@ -293,6 +293,8 @@ /* Platform specific hcalls, used by KVM */ #define H_RTAS 0xf000 +#define H_RESIZE_HPT_PREPARE 0xf003 +#define H_RESIZE_HPT_COMMIT0xf004 /* "Platform specific hcalls", provided by PHYP */ #define H_GET_24X7_CATALOG_PAGE0xF078 diff --git a/arch/powerpc/include/asm/plpar_wrappers.h b/arch/powerpc/include/asm/plpar_wrappers.h index 1b39424..b7ee6d9 100644 --- a/arch/powerpc/include/asm/plpar_wrappers.h +++ b/arch/powerpc/include/asm/plpar_wrappers.h @@ -242,6 +242,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) { diff --git a/arch/powerpc/platforms/pseries/firmware.c b/arch/powerpc/platforms/pseries/firmware.c index 8c80588..7b287be 100644 --- a/arch/powerpc/platforms/pseries/firmware.c +++ b/arch/powerpc/platforms/pseries/firmware.c @@ -63,6 +63,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 -- 2.5.0 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev