Re: [PATCH v2] of: check previous kernel's ima-kexec-buffer against memory bounds

2022-05-30 Thread Vaibhav Jain
Thanks for looking into this patch Rob, I have addressed your review comment in v3 of the patch posted at https://lore.kernel.org/all/20220531041446.3334259-1-vaib...@linux.ibm.com/ -- Cheers ~ Vaibhav

[PATCH v3] of: check previous kernel's ima-kexec-buffer against memory bounds

2022-05-30 Thread Vaibhav Jain
: 467d27824920 ("powerpc: ima: get the kexec buffer passed by the previous kernel") Cc: Frank Rowand Cc: Prakhar Srivastava Cc: Lakshmi Ramasubramanian Cc: Thiago Jung Bauermann Cc: Rob Herring Cc: Ritesh Harjani Cc: Robin Murphy Signed-off-by: Vaibhav Jain --- Changelog == v3

Re: [PATCH v2] of: check previous kernel's ima-kexec-buffer against memory bounds

2022-05-25 Thread Vaibhav Jain
Hi Ritesh, thanks for looking into this patch, Ritesh Harjani writes: > Just a minor nit which I noticed. > > On 22/05/24 11:20AM, Vaibhav Jain wrote: >> Presently ima_get_kexec_buffer() doesn't check if the previous kernel's >> ima-kexec-buffer lies outside the add

Re: [powerpc] linux-next 20220520 boot failure (drc_pmem_query_stats)

2022-05-24 Thread Vaibhav Jain
Thanks for reporting this Sachin, I have posted a fix for this at https://lore.kernel.org/nvdimm/20220524112353.1718454-1-vaib...@linux.ibm.com Sachin Sant writes: > While booting linux-next (5.18.0-rc7-next-20220520) on a Power10 LPAR > configure with pmem following oops is seen. The LPAR

[PATCH] powerpc/papr_scm: don't requests stats with '0' sized stats buffer

2022-05-24 Thread Vaibhav Jain
er_len' at the beginning of papr_scm_pmu_check_events(). [1] https://lore.kernel.org/all/6b3a522a-6a5f-4cc9-b268-0c63aa6e0...@linux.ibm.com Fixes: 0e0946e22f3665d2732 ("powerpc/papr_scm: Fix leaking nvdimm_events_map elements") Reported-by: Sachin Sant Signed-off-by: Vaibhav Jain --- arch/powerpc/p

Re: [PATCH] powerpc: check previous kernel's ima-kexec-buffer against memory bounds

2022-05-23 Thread Vaibhav Jain
Michael Ellerman writes: > > Rob's point is that commit fee3ff99bc67 only moved existing code, the > bug already existed. > > The function was introduced in: > > 467d27824920 ("powerpc: ima: get the kexec buffer passed by the previous > kernel") > > So that's where the Fixes tag should

[PATCH v2] of: check previous kernel's ima-kexec-buffer against memory bounds

2022-05-23 Thread Vaibhav Jain
: 467d27824920 ("powerpc: ima: get the kexec buffer passed by the previous kernel") Cc: Frank Rowand Cc: Prakhar Srivastava Cc: Lakshmi Ramasubramanian Cc: Thiago Jung Bauermann Cc: Rob Herring Signed-off-by: Vaibhav Jain --- Changelog == v2: * Instead of using memblock to

Re: [PATCH] powerpc: check previous kernel's ima-kexec-buffer against memory bounds

2022-05-22 Thread Vaibhav Jain
Rob Herring writes: > On Thu, May 19, 2022 at 01:35:47AM +0530, Vaibhav Jain wrote: >> Presently ima_get_kexec_buffer() doesn't check if the previous kernel's >> ima-kexec-buffer lies outside the addressable memory range. This can result >> in a kernel panic if the new kerne

[PATCH] powerpc: check previous kernel's ima-kexec-buffer against memory bounds

2022-05-18 Thread Vaibhav Jain
("powerpc: Move arch independent ima kexec functions to drivers/of/kexec.c") Cc: Frank Rowand Cc: Prakhar Srivastava Cc: Lakshmi Ramasubramanian Cc: Thiago Jung Bauermann Cc: Rob Herring Signed-off-by: Vaibhav Jain --- drivers/of/kexec.c | 7 +++ 1 file changed, 7 insertions(+)

[PATCH v2] powerpc/papr_scm: Fix leaking nvdimm_events_map elements

2022-05-11 Thread Vaibhav Jain
(papr_scm_priv.nvdimm_events_map)' without needing to iterate over the array and free up individual elements. Fixes: 4c08d4bbc089 ("powerpc/papr_scm: Add perf interface support") Signed-off-by: Vaibhav Jain --- Change-log: v2: * Removed the typedef 'stat_id_t' which will be introduced in a later patch [Aneesh]

Re: [PATCH] powerpc/papr_scm: Fix leaking nvdimm_events_map elements

2022-05-11 Thread Vaibhav Jain
Thanks for reviewing this patch Aneesh, "Aneesh Kumar K.V" writes: > Vaibhav Jain writes: > >> Right now 'char *' elements allocated individual 'stat_id' in >> 'papr_scm_priv.nvdimm_events_map' during papr_scm_pmu_check_events() leak in >> papr_scm_

[PATCH] powerpc/papr_scm: Fix leaking nvdimm_events_map elements

2022-05-09 Thread Vaibhav Jain
)' without needing to iterate over the array and free up individual elements. Also introduce a new typedef called 'state_id_t' thats a 'u8[8]' and can be used across papr_scm to deal with stat_ids. Fixes: 4c08d4bbc089 ("powerpc/papr_scm: Add perf interface support") Signed-off-by: Vaibhav Jain

Re: [PATCH] powerpc/papr_scm: Fix buffer overflow issue with CONFIG_FORTIFY_SOURCE

2022-05-06 Thread Vaibhav Jain
Hi Kajol, Thanks for the patch. Minor review comment below: Kajol Jain writes: > With CONFIG_FORTIFY_SOURCE enabled, string functions will also perform > dynamic checks for string size which can panic the kernel, > like incase of overflow detection. > > In papr_scm, papr_scm_pmu_check_events

Re: [PATCH 2/2] powerpc/papr_scm: Fix build failure when CONFIG_PERF_EVENTS is not set

2022-03-23 Thread Vaibhav Jain
Dan Williams writes: > On Tue, Mar 22, 2022 at 7:30 AM kajoljain wrote: >> >> >> >> On 3/22/22 03:09, Dan Williams wrote: >> > On Fri, Mar 18, 2022 at 4:42 AM Kajol Jain wrote: >> >> >> >> The following build failure occures when CONFIG_PERF_EVENTS is not set >> >> as generic pmu functions are

Re: linux-next: manual merge of the nvdimm tree with the powerpc tree

2022-03-15 Thread Vaibhav Jain
Stephen Rothwell writes: > Hi all, > > Today's linux-next merge of the nvdimm tree got a conflict in: > > arch/powerpc/platforms/pseries/papr_scm.c > > between commit: > > bbbca72352bb ("powerpc/papr_scm: Implement initial support for injecting > smart errors") > > from the powerpc tree and

[PATCH v4] powerpc/papr_scm: Implement initial support for injecting smart errors

2022-01-24 Thread Vaibhav Jain
cate the requested smart-error states. When the processing the PDSM 'SMART_INJECT', papr_pdsm_smart_inject() constructs a pair or 'inject_mask' and 'clear_mask' bitmaps from the payload and bit-blt it to the 'health_bitmap_inject_mask'. This ensures the after being fetched from the hypervisor,

Re: [PATCH v3] powerpc/papr_scm: Implement initial support for injecting smart errors

2022-01-19 Thread Vaibhav Jain
Hi Ira, Thanks for reviewing this patch. Ira Weiny writes: > On Thu, Jan 13, 2022 at 05:32:52PM +0530, Vaibhav Jain wrote: > [snip] > >> >> +/* Inject a smart error Add the dirty-shutdown-counter value to the pdsm */ >> +static int papr_pdsm_smart_inj

Re: [PATCH v3] powerpc/papr_scm: Implement initial support for injecting smart errors

2022-01-17 Thread Vaibhav Jain
Thanks for reviewing this patch Aneesh. My responses to your comments below: "Aneesh Kumar K.V" writes: > Vaibhav Jain writes: > >> Presently PAPR doesn't support injecting smart errors on an >> NVDIMM. This makes testing the NVDIMM health reporting functionalit

[PATCH v3] powerpc/papr_scm: Implement initial support for injecting smart errors

2022-01-13 Thread Vaibhav Jain
and bit-blt it to the 'health_bitmap_{mask, override}' members. This ensures the after being fetched from the hypervisor, the health_bitmap reflects requested smart-error states. Signed-off-by: Vaibhav Jain Signed-off-by: Shivaprasad G Bhat --- Changelog: Since v2: * Rebased the patch to ppc-

Re: [RFC PATCH v2] powerpc/papr_scm: Move duplicate definitions to common header files

2021-09-08 Thread Vaibhav Jain
d papr_scm via >> newly >> introduced include/linux/papr_scm.h. >> >> Signed-off-by: Shivaprasad G Bhat >> Signed-off-by: Vaibhav Jain >> Suggested-by: "Aneesh Kumar K.V" >> --- >> Changelog: >> >> Since v1: >> Link: >

[PATCH] powerpc/papr_scm: Implement initial support for injecting smart errors

2021-07-12 Thread Vaibhav Jain
s://en.wikipedia.org/wiki/Bit_blit [2] : https://lore.kernel.org/nvdimm/162505488483.72147.12741153746322191381.stgit@56e104a48989 Signed-off-by: Vaibhav Jain Signed-off-by: Shivaprasad G Bhat --- arch/powerpc/platforms/pseries/papr_scm.c | 94 ++- include/uapi/linux/papr_pdsm.h

[RESEND-PATCH v2] powerpc/papr_scm: Add support for reporting dirty-shutdown-count

2021-06-24 Thread Vaibhav Jain
lled 'dimm_dsc' presence of which is indicated by the newly introduced PDSM_DIMM_DSC_VALID flag. References: [1] https://pmem.io/documents/Dirty_Shutdown_Handling-V1.0.pdf Signed-off-by: Vaibhav Jain Reviewed-by: Aneesh Kumar K.V --- Changelog: Resend: * Added ack by Aneesh. * Minor fix to changelog o

Re: [PATCH] powerpc/papr_scm: Add support for reporting dirty-shutdown-count

2021-05-27 Thread Vaibhav Jain
Thanks for catching this Santosh. Have fixed this in v2 version of this patch -- Cheers ~ Vaibhav Santosh Sivaraj writes: > Hi Vaibhav, > > Vaibhav Jain writes: > >> Persistent memory devices like NVDIMMs can loose cached writes in case >> something prev

[PATCH v2] powerpc/papr_scm: Add support for reporting dirty-shutdown-count

2021-05-27 Thread Vaibhav Jain
lled 'dimm_dsc' presence of which is indicated by the newly introduced PDSM_DIMM_DSC_VALID flag. References: [1] https://pmem.io/documents/Dirty_Shutdown_Handling-V1.0.pdf Signed-off-by: Vaibhav Jain --- Changelog: v2: * Rebased the patch on latest ppc-next tree * s/psdm/psdm/g [ Santosh ] --- arch/p

[PATCH] powerpc/papr_scm: Add support for reporting dirty-shutdown-count

2021-05-21 Thread Vaibhav Jain
lled 'dimm_dsc' presence of which is indicated by the newly introduced PDSM_DIMM_DSC_VALID flag. References: [1] https://pmem.io/documents/Dirty_Shutdown_Handling-V1.0.pdf Signed-off-by: Vaibhav Jain --- arch/powerpc/include/uapi/asm/papr_pdsm.h | 6 + arch/powerpc/platforms/pseries/p

Re: [PATCH v2] powerpc/papr_scm: Make 'perf_stats' invisible if perf-stats unavailable

2021-05-13 Thread Vaibhav Jain
Thanks for looking into this patch Dan, Dan Williams writes: > On Fri, May 7, 2021 at 4:40 AM Vaibhav Jain wrote: >> >> In case performance stats for an nvdimm are not available, reading the >> 'perf_stats' sysfs file returns an -ENOENT error. A better approach is >&

[PATCH v3] powerpc/papr_scm: Make 'perf_stats' invisible if perf-stats unavailable

2021-05-13 Thread Vaibhav Jain
user-space breakage with this patch. Fixes: 2d02bf835e57('powerpc/papr_scm: Fetch nvdimm performance stats from PHYP') Reviewed-by: Dan Williams Signed-off-by: Vaibhav Jain --- Changelog: v3: * Minor spell corrections [ Dan Williams ] * Switched to kobj_to_dev() helper in papr_nd_attribute_visible

[PATCH v3] powerpc/papr_scm: Reduce error severity if nvdimm stats inaccessible

2021-05-07 Thread Vaibhav Jain
formance stats-query operation is not supported on this nvdimm. Fixes: 2d02bf835e57('powerpc/papr_scm: Fetch nvdimm performance stats from PHYP') Signed-off-by: Vaibhav Jain --- Changelog v3: * Return EOPNOTSUPP error in case of H_UNSUPPORTED [ Ira ] * Return EPERM in case of H_AUTHORITY [ I

Re: [PATCH v2] powerpc/papr_scm: Reduce error severity if nvdimm stats inaccessible

2021-05-07 Thread Vaibhav Jain
Hi Ira, Thanks for looking into this patch Ira Weiny writes: > On Thu, May 06, 2021 at 12:46:06AM +0530, Vaibhav Jain wrote: >> Currently drc_pmem_qeury_stats() generates a dev_err in case >> "Enable Performance Information Collection" feature is disabled from &g

Re: [PATCH] powerpc/papr_scm: Make 'perf_stats' invisible if perf-stats unavailable

2021-05-07 Thread Vaibhav Jain
"Aneesh Kumar K.V" writes: > Vaibhav Jain writes: > >> In case performance stats for an nvdimm are not available, reading the >> 'perf_stats' sysfs file returns an -ENOENT error. A better approach is >> to make the 'perf_stats' file entirely invisible to

[PATCH v2] powerpc/papr_scm: Make 'perf_stats' invisible if perf-stats unavailable

2021-05-07 Thread Vaibhav Jain
() to papr_scm_probe() so that it value is available when 'papr_nd_attribute_visible()' is called during nvdimm initialization. Fixes: 2d02bf835e57('powerpc/papr_scm: Fetch nvdimm performance stats from PHYP') Signed-off-by: Vaibhav Jain --- Changelog: v2: * Removed a redundant dev_info() from

[PATCH] powerpc/papr_scm: Make 'perf_stats' invisible if perf-stats unavailable

2021-05-05 Thread Vaibhav Jain
() to papr_scm_probe() so that it value is available when 'papr_nd_attribute_visible()' is called during nvdimm initialization. Fixes: 2d02bf835e57('powerpc/papr_scm: Fetch nvdimm performance stats from PHYP') Signed-off-by: Vaibhav Jain --- arch/powerpc/platforms/pseries/papr_scm.c | 37

[PATCH v2] powerpc/papr_scm: Reduce error severity if nvdimm stats inaccessible

2021-05-05 Thread Vaibhav Jain
at performance stats-query operation is not supported on this nvdimm. Fixes: 2d02bf835e57('powerpc/papr_scm: Fetch nvdimm performance stats from PHYP') Signed-off-by: Vaibhav Jain --- Changelog v2: * Updated the message logged in case of H_AUTHORITY error [ Ira ] * Switched from dev_warn

Re: [PATCH v1 1/1] powerpc/papr_scm: Properly handle UUID types and API

2021-04-16 Thread Vaibhav Jain
Andy Shevchenko writes: > On Thu, Apr 15, 2021 at 8:10 PM Vaibhav Jain wrote: >> >> >> Thanks for the patch Andy, >> >> Unfortunately ran into a compilation issue due to missing "#include >> " that provides definition for >> get_unal

Re: [PATCH v1 1/1] powerpc/papr_scm: Properly handle UUID types and API

2021-04-15 Thread Vaibhav Jain
Thanks for the patch Andy, Unfortunately ran into a compilation issue due to missing "#include " that provides definition for get_unaligned_le64(). Gcc reported following error: error: implicit declaration of function ‘get_unaligned_le64’ After including the necessary header file, kernel

Re: [PATCH] powerpc/papr_scm: Reduce error severity if nvdimm stats inaccessible

2021-04-15 Thread Vaibhav Jain
Ira Weiny writes: > On Wed, Apr 14, 2021 at 09:51:40PM +0530, Vaibhav Jain wrote: >> Thanks for looking into this patch Ira, >> >> Ira Weiny writes: >> >> > On Wed, Apr 14, 2021 at 06:10:26PM +0530, Vaibhav Jain wrote: >> >> Currently dr

Re: [PATCH] powerpc/papr_scm: Reduce error severity if nvdimm stats inaccessible

2021-04-15 Thread Vaibhav Jain
Thanks for looking into this Dan, Dan Williams writes: > On Wed, Apr 14, 2021 at 5:40 AM Vaibhav Jain wrote: >> >> Currently drc_pmem_qeury_stats() generates a dev_err in case >> "Enable Performance Information Collection" feature is disabled from >>

Re: [PATCH] powerpc/papr_scm: Reduce error severity if nvdimm stats inaccessible

2021-04-14 Thread Vaibhav Jain
Thanks for looking into this patch Ira, Ira Weiny writes: > On Wed, Apr 14, 2021 at 06:10:26PM +0530, Vaibhav Jain wrote: >> Currently drc_pmem_qeury_stats() generates a dev_err in case >> "Enable Performance Information Collection" feature is disabled from >>

[PATCH] powerpc/papr_scm: Reduce error severity if nvdimm stats inaccessible

2021-04-14 Thread Vaibhav Jain
s in-accessible". Fixes: 2d02bf835e57('powerpc/papr_scm: Fetch nvdimm performance stats from PHYP') Signed-off-by: Vaibhav Jain --- arch/powerpc/platforms/pseries/papr_scm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/powerpc/platforms/pseries/papr_scm.c b/arch/powerpc/platform

Re: [PATCH v3] powerpc/papr_scm: Implement support for H_SCM_FLUSH hcall

2021-04-14 Thread Vaibhav Jain
"Aneesh Kumar K.V" writes: > Vaibhav Jain writes: > >> Hi Shiva, >> >> Apologies for a late review but something just caught my eye while >> working on a different patch. >> >> Shivaprasad G Bhat writes: >> >>> Add support f

Re: [PATCH v3] powerpc/papr_scm: Implement support for H_SCM_FLUSH hcall

2021-04-13 Thread Vaibhav Jain
Hi Shiva, Apologies for a late review but something just caught my eye while working on a different patch. Shivaprasad G Bhat writes: > Add support for ND_REGION_ASYNC capability if the device tree > indicates 'ibm,hcall-flush-required' property in the NVDIMM node. > Flush is done by issuing

Re: [PATCH] powerpc/mm: Add cond_resched() while removing hpte mappings

2021-04-05 Thread Vaibhav Jain
Hi Mpe, Thanks for looking into this patch. Michael Ellerman writes: > Vaibhav Jain writes: >> While removing large number of mappings from hash page tables for >> large memory systems as soft-lockup is reported because of the time >> spent inside htap_remove_map

[PATCH v2] powerpc/mm: Add cond_resched() while removing hpte mappings

2021-04-04 Thread Vaibhav Jain
() to the loop in htap_remove_mapping() that issues hcall to remove hpte mapping. The call to cond_resched() is issued every HZ jiffies which should prevent the soft-lockup from being reported. Suggested-by: Aneesh Kumar K.V Signed-off-by: Vaibhav Jain --- Changelog: v2: Issue cond_resched

[PATCH] powerpc/papr_scm: Mark nvdimm as unarmed if needed during probe

2021-03-29 Thread Vaibhav Jain
() to force query of nvdimm health via __drc_pmem_query_health() and if nvdimm is found to be unarmed then set the nvdimm flag ND_UNARMED for nvdimm_create(). Signed-off-by: Vaibhav Jain --- arch/powerpc/platforms/pseries/papr_scm.c | 9 + 1 file changed, 9 insertions(+) diff --git a/arch

Re: [PATCH v2] powerpc/papr_scm: Implement support for H_SCM_FLUSH hcall

2021-03-24 Thread Vaibhav Jain
Hi Shiva, Thanks for the patch. Few minor review comments: Shivaprasad G Bhat writes: > Add support for ND_REGION_ASYNC capability if the device tree > indicates 'ibm,hcall-flush-required' property in the NVDIMM node. > Flush is done by issuing H_SCM_FLUSH hcall to the hypervisor. > > If the

[PATCH] powerpc/mm: Add cond_resched() while removing hpte mappings

2021-03-10 Thread Vaibhav Jain
() to the loop in htap_remove_mapping() that issues hcall to remove hpte mapping. This should prevent the soft-lockup from being reported. Suggested-by: Aneesh Kumar K.V Signed-off-by: Vaibhav Jain --- arch/powerpc/mm/book3s64/hash_utils.c | 2 ++ 1 file changed, 2 insertions(+) diff --git

[RFC][PATCH 2/2] powerpc/papr_scm: Implement support for reporting generic nvdimm stats

2020-11-08 Thread Vaibhav Jain
by newly introduced 'papr_scm_get_stat()' that verifies if the requested nvdimm-stat is supported and if yes does an hcall via 'drc_pmem_query_stat()' to request the performance-stat and return it back to libnvdimm. Signed-off-by: Vaibhav Jain --- arch/powerpc/platforms/pseries/papr_scm.c | 66

[RFC][PATCH 1/2] libnvdimm: Introduce ND_CMD_GET_STAT to retrieve nvdimm statistics

2020-11-08 Thread Vaibhav Jain
t to read that nvdimm-statistic. The value for a specific nvdimm-stat is exchanged via newly introduced 'struct nd_cmd_get_dimm_stat' that hold a single statistics and a union of possible values types. Presently only '__s64' type of generic attributes are supported. These attributes are defined in 'ndvi

Re: [PATCH 30/33] docs: ABI: cleanup several ABI documents

2020-10-30 Thread Vaibhav Jain
* "MedWDur " : Media Write Duration > * "CchRHCnt" : Cache Read Hit Count > * "CchWHCnt" : Cache Write Hit Count > - * "FastWCnt" : Fast Write Count > \ No newline at end of file > + * "FastWCnt" : Fast Write Count Thanks, I am fine with proposed changes to sysfs-bus-papr-pmem. Acked-by: Vaibhav Jain # for sysfs-bus-papr-pmem

Re: [PATCH] powerpc/papr_scm: Add PAPR command family to pass-through command-set

2020-09-28 Thread Vaibhav Jain
Hi Dan, Ira and Vishal, Can you please take a look at this patch. Without it the functionality to report nvdimm health via ndctl breaks on 5.9 Thanks, ~ Vaibhav Vaibhav Jain writes: > Add NVDIMM_FAMILY_PAPR to the list of valid 'dimm_family_mask' > acceptable by papr_scm. This is

Re: [PATCH -next] powerpc/papr_scm: Fix warnings about undeclared variable

2020-09-24 Thread Vaibhav Jain
Thanks for the patch. This looks good to me. Wang Wensheng writes: > Build the kernel with 'make C=2': > arch/powerpc/platforms/pseries/papr_scm.c:825:1: warning: symbol > 'dev_attr_perf_stats' was not declared. Should it be static? > Signed-off-by: Wang Wensheng Reviewed-by:

Re: [PATCH v2] powerpc/papr_scm: Fix warning triggered by perf_stats_show()

2020-09-15 Thread Vaibhav Jain
Michael Ellerman writes: > Vaibhav Jain writes: >> A warning is reported by the kernel in case perf_stats_show() returns >> an error code. The warning is of the form below: >> >> papr_scm ibm,persistent-memory:ibm,pmemory@4411: >>Failed to

[PATCH] powerpc/papr_scm: Support dynamic enable/disable of performance statistics

2020-09-13 Thread Vaibhav Jain
, various functions that depended on it are updated. Specifically perf_stats_show() is updated to query the PHYP first for the size of buffer needed to hold all performance statistics instead of relying on 'stat_buffer_len' Signed-off-by: Vaibhav Jain --- arch/powerpc/platforms/pseries/papr_scm.c

[PATCH] powerpc/papr_scm: Add PAPR command family to pass-through command-set

2020-09-13 Thread Vaibhav Jain
nsure only known command families can use the general ND_CMD_CALL pass-through functionality. Without this change the ND_CMD_CALL pass-through targeting NVDIMM_FAMILY_PAPR error out with -EINVAL. Fixes: 92fe2aa859f5 ("libnvdimm: Validate command family indices") Signed-off-by: Vaibhav Jai

Re: [PATCH] powerpc/papr_scm: Fix warning triggered by perf_stats_show()

2020-09-12 Thread Vaibhav Jain
Ira Weiny writes: > On Sat, Sep 12, 2020 at 01:36:46AM +0530, Vaibhav Jain wrote: >> Thanks for reviewing this patch Ira, >> >> >> Ira Weiny writes: >> >> > On Thu, Sep 10, 2020 at 02:52:12PM +0530, Vaibhav Jain wrote: >> >> A war

[PATCH v2] powerpc/papr_scm: Fix warning triggered by perf_stats_show()

2020-09-12 Thread Vaibhav Jain
of drc_pmem_query_stats() and returning correct signed value back from perf_stats_show(). Fixes: 2d02bf835e573 ('powerpc/papr_scm: Fetch nvdimm performance stats from PHYP') Signed-off-by: Vaibhav Jain --- Changelog: v2: Added an explicit cast to the expression calling 'seq_buf_used()' and triggering

Re: [PATCH] powerpc/papr_scm: Fix warning triggered by perf_stats_show()

2020-09-11 Thread Vaibhav Jain
Thanks for reviewing this patch Ira, Ira Weiny writes: > On Thu, Sep 10, 2020 at 02:52:12PM +0530, Vaibhav Jain wrote: >> A warning is reported by the kernel in case perf_stats_show() returns >> an error code. The warning is of the form below: >> >> papr_scm ibm,pe

[PATCH] powerpc/papr_scm: Fix warning triggered by perf_stats_show()

2020-09-10 Thread Vaibhav Jain
of drc_pmem_query_stats() and returning correct signed value back from perf_stats_show(). Fixes: 2d02bf835e573 ('powerpc/papr_scm: Fetch nvdimm performance stats from PHYP') Signed-off-by: Vaibhav Jain --- arch/powerpc/platforms/pseries/papr_scm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff

[PATCH v2] powerpc/papr_scm: Limit the readability of 'perf_stats' sysfs attribute

2020-09-07 Thread Vaibhav Jain
') Reported-by: Aneesh Kumar K.V Signed-off-by: Vaibhav Jain --- Change-log: v2: * Instead of checking for perfmon_capable() inside show_perf_stats() set the attribute as DEVICE_ATTR_ADMIN_RO [ Aneesh ] * Update patch description --- arch/powerpc/platforms/pseries/papr_scm.c | 2 +- 1 file changed, 1

Re: [PATCH] powerpc/papr_scm: Limit the readability of 'perf_stats' sysfs attribute

2020-08-19 Thread Vaibhav Jain
Thanks Aneesh and Mpe for reviewing this patch. Michael Ellerman writes: > "Aneesh Kumar K.V" writes: [snip] >>> >>> + /* Allow access only to perfmon capable users */ >>> + if (!perfmon_capable()) >>> + return -EACCES; >>> + >> >> An access check is usually done in open().

[PATCH] libnvdimm: Add a NULL entry to 'nvdimm_firmware_attributes'

2020-08-14 Thread Vaibhav Jain
eate_files()' to read garbage beyond bounds of 'nvdimm_firmware_attributes' and trigger the oops. Fixes: 48001ea50d17f ("PM, libnvdimm: Add runtime firmware activation support") Reported-by: Sandipan Das Signed-off-by: Vaibhav Jain --- drivers/nvdimm/dimm_devs.c | 1 + 1 file changed,

[PATCH] powerpc/papr_scm: Limit the readability of 'perf_stats' sysfs attribute

2020-08-12 Thread Vaibhav Jain
nvdimm performance stats from PHYP') Reported-by: Aneesh Kumar K.V Signed-off-by: Vaibhav Jain --- arch/powerpc/platforms/pseries/papr_scm.c | 4 1 file changed, 4 insertions(+) diff --git a/arch/powerpc/platforms/pseries/papr_scm.c b/arch/powerpc/platforms/pseries/papr_scm.c index

Re: [PATCH] powerpc/papr_scm: Make access mode of 'perf_stats' attribute file to '0400'

2020-08-12 Thread Vaibhav Jain
Hi Mpe, Thanks for reviewing this patch. My responses below: Michael Ellerman writes: > Vaibhav Jain writes: >> The newly introduced 'perf_stats' attribute uses the default access >> mode of 0444 letting non-root users access performance stats of an >> nvdimm and potenti

[PATCH] powerpc/papr_scm: Make access mode of 'perf_stats' attribute file to '0400'

2020-08-07 Thread Vaibhav Jain
better to ward of access to this attribute from non-root users. Hence this patch updates the access-mode of 'perf_stats' sysfs attribute file to 0400 to make it only readable to root-users. Reported-by: Aneesh Kumar K.V Signed-off-by: Vaibhav Jain --- arch/powerpc/platforms/pseries/papr_scm.c

[PATCH v4 2/2] powerpc/papr_scm: Add support for fetching nvdimm 'fuel-gauge' metric

2020-07-31 Thread Vaibhav Jain
of the stat is then populated in the 'struct nd_papr_pdsm_health.dimm_fuel_gauge' field with extension flag 'PDSM_DIMM_HEALTH_RUN_GAUGE_VALID' set in 'struct nd_papr_pdsm_health.extension_flags' Signed-off-by: Vaibhav Jain --- Changelog: v4: * Moved a hunk from this patch to previous patch

[PATCH v4 1/2] powerpc/papr_scm: Fetch nvdimm performance stats from PHYP

2020-07-31 Thread Vaibhav Jain
function output buffer. Signed-off-by: Vaibhav Jain --- Changelog: v4: * Fixed a build issue with this patch by moving a hunk from second patch in series to this patch. [ Aneesh ] v3: * Updated drc_pmem_query_stats() to not require 'buff_size' and 'out' args to the function. Instead

[PATCH v4 0/2] powerpc/papr_scm: add support for reporting NVDIMM 'life_used_percentage' metric

2020-07-31 Thread Vaibhav Jain
implements support for 'perf_stats' sysfs attribute to report the full catalogue of supported performance stats by PHYP. Second and final patch implements support for sending this value to libndctl by extending the PAPR_PDSM_HEALTH pdsm payload to add a new field named 'dimm_fuel_gauge' to it. Vaibhav

[PATCH v3 2/2] powerpc/papr_scm: Add support for fetching nvdimm 'fuel-gauge' metric

2020-07-30 Thread Vaibhav Jain
of the stat is then populated in the 'struct nd_papr_pdsm_health.dimm_fuel_gauge' field with extension flag 'PDSM_DIMM_HEALTH_RUN_GAUGE_VALID' set in 'struct nd_papr_pdsm_health.extension_flags' Signed-off-by: Vaibhav Jain --- Changelog: v3: * Updated papr_pdsm_fuel_guage() to use the updated

[PATCH v3 0/2] powerpc/papr_scm: add support for reporting NVDIMM 'life_used_percentage' metric

2020-07-30 Thread Vaibhav Jain
rmance stats catalogue. The patch also implements support for 'perf_stats' sysfs attribute to report the full catalogue of supported performance stats by PHYP. Second and final patch implements support for sending this value to libndctl by extending the PAPR_PDSM_HEALTH pdsm payload to add a new field na

[PATCH v3 1/2] powerpc/papr_scm: Fetch nvdimm performance stats from PHYP

2020-07-30 Thread Vaibhav Jain
function output buffer. Signed-off-by: Vaibhav Jain --- Changelog: v3: * Updated drc_pmem_query_stats() to not require 'buff_size' and 'out' args to the function. Instead 'buff_size' is calculated from 'num_stats' and instead of populating 'R4' in arg 'out' the value is returned from

[RESEND PATCH v2 2/2] powerpc/papr_scm: Add support for fetching nvdimm 'fuel-gauge' metric

2020-07-26 Thread Vaibhav Jain
of the stat is then populated in the 'struct nd_papr_pdsm_health.dimm_fuel_gauge' field with extension flag 'PDSM_DIMM_HEALTH_RUN_GAUGE_VALID' set in 'struct nd_papr_pdsm_health.extension_flags' Signed-off-by: Vaibhav Jain --- Changelog: Resend: None v2: * Restructure code in papr_pdsm_fuel_gauge

[RESEND PATCH v2 1/2] powerpc/papr_scm: Fetch nvdimm performance stats from PHYP

2020-07-26 Thread Vaibhav Jain
function output buffer. Signed-off-by: Vaibhav Jain --- Changelog: Resend: None v2: * Updated 'struct papr_scm_perf_stats' and 'struct papr_scm_perf_stat' to use big-endian types. [ Aneesh ] * s/len_stat_buffer/stat_buffer_len/ [ Aneesh ] * s/statistics_id/stat_id/ , s/statistics_val/stat_val

[RESEND PATCH v2 0/2] powerpc/papr_scm: add support for reporting NVDIMM 'life_used_percentage' metric

2020-07-26 Thread Vaibhav Jain
S hcall and fetch performance stats catalogue. The patch also implements support for 'perf_stats' sysfs attribute to report the full catalogue of supported performance stats by PHYP. Second and final patch implements support for sending this value to libndctl by extending the PAPR_PDSM_HEALTH pdsm payload to add

[PATCH v2 2/2] powerpc/papr_scm: Add support for fetching nvdimm 'fuel-gauge' metric

2020-07-01 Thread Vaibhav Jain
of the stat is then populated in the 'struct nd_papr_pdsm_health.dimm_fuel_gauge' field with extension flag 'PDSM_DIMM_HEALTH_RUN_GAUGE_VALID' set in 'struct nd_papr_pdsm_health.extension_flags' Signed-off-by: Vaibhav Jain --- Changelog: v2: * Restructure code in papr_pdsm_fuel_gauge() to handle error

[PATCH v2 1/2] powerpc/papr_scm: Fetch nvdimm performance stats from PHYP

2020-07-01 Thread Vaibhav Jain
function output buffer. Signed-off-by: Vaibhav Jain --- Changelog: v2: * Fixed a bug in drc_pmem_query_stats() that was passing a NULL pointer to virt_to_pfn() [ Ira ] * Updated 'struct papr_scm_perf_stats' and 'struct papr_scm_perf_stat' to use big-endian types. [ Aneesh ] * s/len_stat_buffer

[PATCH v2 0/2] powerpc/papr_scm: add support for reporting NVDIMM 'life_used_percentage' metric

2020-07-01 Thread Vaibhav Jain
ats' sysfs attribute to report the full catalogue of supported performance stats by PHYP. Second and final patch implements support for sending this value to libndctl by extending the PAPR_PDSM_HEALTH pdsm payload to add a new field named 'dimm_fuel_gauge' to it. References == [2] https:

Re: [PATCH 2/2] powerpc/papr_scm: Add support for fetching nvdimm 'fuel-gauge' metric

2020-06-24 Thread Vaibhav Jain
Thanks for reviewing this patch Ira, My responses below: Ira Weiny writes: [snip] >> +static int papr_pdsm_fuel_gauge(struct papr_scm_priv *p, >> +union nd_pdsm_payload *payload) >> +{ >> +int rc, size; >> +struct papr_scm_perf_stat *stat; >> +struct

[PATCH 2/2] powerpc/papr_scm: Add support for fetching nvdimm 'fuel-gauge' metric

2020-06-21 Thread Vaibhav Jain
of the stat is then populated in the 'struct nd_papr_pdsm_health.dimm_fuel_gauge' field with extension flag 'PDSM_DIMM_HEALTH_RUN_GAUGE_VALID' set in 'struct nd_papr_pdsm_health.extension_flags' Signed-off-by: Vaibhav Jain --- arch/powerpc/include/uapi/asm/papr_pdsm.h | 9 + arch/powerpc/platforms

[PATCH 1/2] powerpc/papr_scm: Fetch nvdimm performance stats from PHYP

2020-06-21 Thread Vaibhav Jain
function output buffer. Signed-off-by: Vaibhav Jain --- Documentation/ABI/testing/sysfs-bus-papr-pmem | 27 arch/powerpc/platforms/pseries/papr_scm.c | 139 ++ 2 files changed, 166 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-bus-papr-pmem b/Documentation

[PATCH 0/2] powerpc/papr_scm: add support for reporting NVDIMM 'life_used_percentage' metric

2020-06-21 Thread Vaibhav Jain
libndctl by extending the PAPR_PDSM_HEALTH pdsm payload to add a new field named 'dimm_fuel_gauge' to it. References == [1] https://github.com/vaibhav92/ndctl/tree/papr_scm_health_v13_run_guage Vaibhav Jain (2): powerpc/papr_scm: Fetch nvdimm performance stats from PHYP powerpc/papr_scm:

Re: [PATCH v12 0/6] powerpc/papr_scm: Add support for reporting nvdimm health

2020-06-15 Thread Vaibhav Jain
This accidently got reposted. Please ignore. v13 version of the patch series located at https://lore.kernel.org/linux-nvdimm/20200615124407.32596-1-vaib...@linux.ibm.com Vaibhav Jain writes: > Changes since v11 [1]: > * Minor update to 'papr_pdsm.h' fixing a misleading comment

Re: [PATCH v12 1/6] powerpc: Document details on H_SCM_HEALTH hcall

2020-06-15 Thread Vaibhav Jain
This accidently got reposted. Please ignore. Vaibhav Jain writes: > Add documentation to 'papr_hcalls.rst' describing the bitmap flags > that are returned from H_SCM_HEALTH hcall as per the PAPR-SCM > specification. > > Cc: "Aneesh Kumar K . V" > Cc: Dan Will

[PATCH v13 5/6] ndctl/papr_scm, uapi: Add support for PAPR nvdimm specific methods

2020-06-15 Thread Vaibhav Jain
pdcm_cmd_desc.service' function to service the PDSM. Cc: "Aneesh Kumar K . V" Cc: Dan Williams Cc: Michael Ellerman Cc: Ira Weiny Signed-off-by: Vaibhav Jain --- Changelog: v12..v13: * s/struct nd_pdsm_cmd_pkg/struct nd_pkg_pdsm/ * Removed instance of 'struct nd_cmd_pkg hdr' from 'struct nd_pd

[PATCH v13 2/6] seq_buf: Export seq_buf_printf

2020-06-15 Thread Vaibhav Jain
: Steven Rostedt Cc: Borislav Petkov Acked-by: Steven Rostedt (VMware) Signed-off-by: Vaibhav Jain --- Changelog: v12..v13: * None v11..v12: * None v10..v11: * None v9..v10: * None Resend: * Added ack from Steven Rostedt v8..v9: * None v7..v8: * Updated the patch title [ Christoph Hellwig

[PATCH v13 4/6] powerpc/papr_scm: Improve error logging and handling papr_scm_ndctl()

2020-06-15 Thread Vaibhav Jain
also updates the 'default' add a debug log unknown 'cmd' values. Cc: "Aneesh Kumar K . V" Cc: Dan Williams Cc: Michael Ellerman Cc: Ira Weiny Reviewed-by: Ira Weiny Signed-off-by: Vaibhav Jain --- Changelog: v12..v13: * None v11..v12: * Added ack from Ira v10..v11: * Instead of

[PATCH v13 6/6] powerpc/papr_scm: Implement support for PAPR_PDSM_HEALTH

2020-06-15 Thread Vaibhav Jain
() that queries the nvdimm health information and then copies this information to the package payload whose layout is defined by 'struct nd_papr_pdsm_health'. Cc: "Aneesh Kumar K . V" Cc: Dan Williams Cc: Michael Ellerman Cc: Ira Weiny Signed-off-by: Vaibhav Jain --- Changelog: v12..v1

[PATCH v13 3/6] powerpc/papr_scm: Fetch nvdimm health information from PHYP

2020-06-15 Thread Vaibhav Jain
/testing/sysfs-bus-papr-pmem. [1] commit 58b278f568f0 ("powerpc: Provide initial documentation for PAPR hcalls") Cc: "Aneesh Kumar K . V" Cc: Dan Williams Cc: Michael Ellerman Cc: Ira Weiny Signed-off-by: Vaibhav Jain --- Changelog: v12..v13: * None v11..v12: * None v10..

[PATCH v13 1/6] powerpc: Document details on H_SCM_HEALTH hcall

2020-06-15 Thread Vaibhav Jain
Add documentation to 'papr_hcalls.rst' describing the bitmap flags that are returned from H_SCM_HEALTH hcall as per the PAPR-SCM specification. Cc: "Aneesh Kumar K . V" Cc: Dan Williams Cc: Michael Ellerman Cc: Ira Weiny Acked-by: Ira Weiny Signed-off-by: Vaibhav Jain --- Chang

[PATCH v13 0/6] powerpc/papr_scm: Add support for reporting nvdimm health

2020-06-15 Thread Vaibhav Jain
3] commit 58b278f568f0 ("powerpc: Provide initial documentation for PAPR hcalls") [4] "Linux on Power Architecture Platform Reference" https://members.openpowerfoundation.org/document/dl/469 [5] https://github.com/vaibhav92/ndctl/tree/papr_scm_health_v13 --- Vaibhav Jai

[PATCH v12 6/6] powerpc/papr_scm: Implement support for PAPR_PDSM_HEALTH

2020-06-15 Thread Vaibhav Jain
() that queries the nvdimm health information and then copies this information to the package payload whose layout is defined by 'struct nd_papr_pdsm_health'. Cc: "Aneesh Kumar K . V" Cc: Dan Williams Cc: Michael Ellerman Cc: Ira Weiny Reviewed-by: Ira Weiny Signed-off-by: Vaibhav Jain ---

[PATCH v12 5/6] ndctl/papr_scm, uapi: Add support for PAPR nvdimm specific methods

2020-06-15 Thread Vaibhav Jain
() in case of a PDSM request is received via ND_CMD_CALL command from libnvdimm. Cc: "Aneesh Kumar K . V" Cc: Dan Williams Cc: Michael Ellerman Cc: Ira Weiny Signed-off-by: Vaibhav Jain --- Changelog: v11..v12: * Updated a misleading comment in 'papr_pdsm.h' regarding payload size. [

[PATCH v12 4/6] powerpc/papr_scm: Improve error logging and handling papr_scm_ndctl()

2020-06-15 Thread Vaibhav Jain
also updates the 'default' add a debug log unknown 'cmd' values. Cc: "Aneesh Kumar K . V" Cc: Dan Williams Cc: Michael Ellerman Cc: Ira Weiny Reviewed-by: Ira Weiny Signed-off-by: Vaibhav Jain --- Changelog: v11..v12: * Added ack from Ira v10..v11: * Instead of returning *c

[PATCH v12 2/6] seq_buf: Export seq_buf_printf

2020-06-15 Thread Vaibhav Jain
: Steven Rostedt Cc: Borislav Petkov Acked-by: Steven Rostedt (VMware) Signed-off-by: Vaibhav Jain --- Changelog: v11..v12: * None v10..v11: * None v9..v10: * None Resend: * Added ack from Steven Rostedt v8..v9: * None v7..v8: * Updated the patch title [ Christoph Hellwig ] * Updated patch

[PATCH v12 3/6] powerpc/papr_scm: Fetch nvdimm health information from PHYP

2020-06-15 Thread Vaibhav Jain
/testing/sysfs-bus-papr-pmem. [1] commit 58b278f568f0 ("powerpc: Provide initial documentation for PAPR hcalls") Cc: "Aneesh Kumar K . V" Cc: Dan Williams Cc: Michael Ellerman Cc: Ira Weiny Signed-off-by: Vaibhav Jain --- Changelog: v11..v12: * None v10..v11: * None

[PATCH v12 1/6] powerpc: Document details on H_SCM_HEALTH hcall

2020-06-15 Thread Vaibhav Jain
Add documentation to 'papr_hcalls.rst' describing the bitmap flags that are returned from H_SCM_HEALTH hcall as per the PAPR-SCM specification. Cc: "Aneesh Kumar K . V" Cc: Dan Williams Cc: Michael Ellerman Cc: Ira Weiny Acked-by: Ira Weiny Signed-off-by: Vaibhav Jain --- Chang

[PATCH v12 0/6] powerpc/papr_scm: Add support for reporting nvdimm health

2020-06-15 Thread Vaibhav Jain
form Reference" https://en.wikipedia.org/wiki/Power_Architecture_Platform_Reference [3] commit 58b278f568f0 ("powerpc: Provide initial documentation for PAPR hcalls") [4] "Linux on Power Architecture Platform Reference" https://members.openpowerfoundation.org/d

Re: [PATCH v11 5/6] ndctl/papr_scm, uapi: Add support for PAPR nvdimm specific methods

2020-06-11 Thread Vaibhav Jain
Dan Williams writes: > On Wed, Jun 10, 2020 at 5:10 AM Vaibhav Jain wrote: >> >> Dan Williams writes: >> >> > On Tue, Jun 9, 2020 at 10:54 AM Vaibhav Jain wrote: >> >> >> >> Thanks Dan for the consideration and taking time to look into

Re: [PATCH v11 5/6] ndctl/papr_scm, uapi: Add support for PAPR nvdimm specific methods

2020-06-10 Thread Vaibhav Jain
Dan Williams writes: > On Tue, Jun 9, 2020 at 10:54 AM Vaibhav Jain wrote: >> >> Thanks Dan for the consideration and taking time to look into this. >> >> My responses below: >> >> Dan Williams writes: >> >> > On Mon, Jun 8, 2020 at 5:

Re: [PATCH v11 5/6] ndctl/papr_scm, uapi: Add support for PAPR nvdimm specific methods

2020-06-09 Thread Vaibhav Jain
ve the system. BTW, we also suggest to use '--base' option to specify >> the >> base tree in git format-patch, please see >> https://stackoverflow.com/a/37406982] >> >> url: >> https://github.com/0day-ci/linux/commits/Vaibhav-Jain/powerpc-papr_scm-Add-suppo

[PATCH v12 2/6] seq_buf: Export seq_buf_printf

2020-06-08 Thread Vaibhav Jain
: Steven Rostedt Cc: Borislav Petkov Acked-by: Steven Rostedt (VMware) Signed-off-by: Vaibhav Jain --- Changelog: v11..v12: * None v10..v11: * None v9..v10: * None Resend: * Added ack from Steven Rostedt v8..v9: * None v7..v8: * Updated the patch title [ Christoph Hellwig ] * Updated patch

  1   2   3   4   5   >