Re: [PATCH v5 00/11] KVM: PPC: Nested APIv2 guest support

2024-09-25 Thread Vaibhav Jain
Hi Michal, Michal Suchánek writes: > Hello, > > are there any machines on which this is supposed to work? > > On a 9105-22A with ML1050_fw1050.20 (78) and On 9105-22A you need atleast: Firmware level: FW1060.10 > Linux 6.11.0-lp155.4.gce149d2-default I get: Kernel version is fine. ATM anythi

Re: [PATCH] powerpc/pseries/eeh: move pseries_eeh_err_inject() outside CONFIG_DEBUG_FS block

2024-09-19 Thread Vaibhav Jain
Hi Ritesh, Thanks for looking into this patch. My responses your review inline below: Ritesh Harjani (IBM) writes: > Narayana Murty N writes: > >> Makes pseries_eeh_err_inject() available even when debugfs >> is disabled (CONFIG_DEBUG_FS=n). It moves eeh_debugfs_break_device() >> and eeh_pe_in

Re: [PATCH] powerpc: Switch back to struct platform_driver::remove()

2024-09-11 Thread Vaibhav Jain
f_msi_remove, > + .remove = fsl_of_msi_remove, > }; Dont have any objections to changes in arch/powerpc/platforms/pseries/papr_scm.c Reviewed-by: Vaibhav Jain -- Cheers ~ Vaibhav

Re: [PATCH v2] powerpc/pseries/eeh: Fix pseries_eeh_err_inject

2024-08-26 Thread Vaibhav Jain
e changes LGTM, hence Reviewed-by: Vaibhav Jain > --- > > Testing: > > vfio-test [1] by Alex Willamson, was forked and updated to add > support inject error on pSeries guest and used to test this > patch[2]. > > References: > === > [1] https://git

[PATCH v2] KVM: PPC: Book3S HV nestedv2: Cancel pending DEC exception

2024-04-14 Thread Vaibhav Jain
in an overall ~4% improvement of arithoh[2] throughput. [1] commit 180c6b072bf3 ("KVM: PPC: Book3S HV nestedv2: Do not cancel pending decrementer exception") [2] https://github.com/kdlucas/byte-unixbench/ Fixes: 180c6b072bf3 ("KVM: PPC: Book3S HV nestedv2: Do not cancel pe

[PATCH] KVM: PPC: Book3S HV nestedv2: Cancel pending HDEC exception

2024-03-13 Thread Vaibhav Jain
ap to L1. From there the value of this register is cached, made available in kvmhv_run_single_vcpu() to compare it against host(L1) timebase and cancel the pending hypervisor decrementer exception if needed. Fixes: 180c6b072bf3 ("KVM: PPC: Book3S HV nestedv2: Do not cancel pending decrementer

Re: [PATCH 2/2] powerpc/pseries: Set CPU_FTR_DBELL according to ibm,pi-features

2024-02-07 Thread Vaibhav Jain
u_features` getting cleared. [1] https://lore.kernel.org/all/20240207035220.339726-1-npig...@gmail.com Hence, Tested-by: Vaibhav Jain -- Cheers ~ Vaibhav

Re: [PATCH 1/2] powerpc/pseries: Add a clear modifier to ibm,pa/pi-features parser

2024-02-07 Thread Vaibhav Jain
ier, which is unused since commit > 7d4703455168 ("powerpc/feature: Remove CPU_FTR_NODSISRALIGN"). > > Signed-off-by: Nicholas Piggin > --- Tested this patch on a PP64-LE lpar with the patch[1] and seeing the relevant pi-feature bit CPU_FTR_DBELL getting cleared. [1] https://lore.kernel.org/all/20240207035220.339726-2-npig...@gmail.com Hence, Tested-by: Vaibhav Jain -- Cheers ~ Vaibhav

Re: [PATCH v2] KVM: PPC: Book3S HV: Fix L2 guest reboot failure due to empty 'arch_compat'

2024-02-05 Thread Vaibhav Jain
. However you probably dont want this switch-case to fallthrough so please use a 'break' instead. > + default: > + break; > + } > + > + return cap; > +} > + > With the suggested change above Reviewed-by: Vaibhav Jain -- Cheers ~ Vaibhav

Re: [PATCH] KVM: PPC: Book3S HV nestedv2: Fix an error handling path in gs_msg_ops_kvmhv_nestedv2_config_fill_info()

2024-01-28 Thread Vaibhav Jain
t_buff_info(gsb, KVMPPC_GSID_RUN_OUTPUT, > + cfg->vcpu_run_output_cfg); > if (rc < 0) > return rc; > } > -- Thanks for catching this and the change looks good to me. Reviewed-by: Vaibhav Jain -- Cheers ~ Vaibhav

[PATCH] powerpc/hvcall: Reorder Nestedv2 hcall opcodes

2023-12-19 Thread Vaibhav Jain
("KVM: PPC: Add support for nestedv2 guests") Suggested-by: Michael Ellerman Signed-off-by: Vaibhav Jain --- arch/powerpc/include/asm/hvcall.h | 21 +++-- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/arch/powerpc/include/asm/hvcall.h b/arch/powerpc/includ

Re: [PATCH 09/12] KVM: PPC: Book3S HV nestedv2: Do not call H_COPY_TOFROM_GUEST

2023-12-17 Thread Vaibhav Jain
Hi Aneesh, "Aneesh Kumar K.V" writes: >> Yes, Agreed and thats a nice suggestion. However ATM the hypervisor >> supporting Nestedv2 doesnt have support for this hcall. In future >> once we have support for this hcall for nestedv2 from the hypervisor >> we can replace this branch with a firmwar

Re: [PATCH 01/12] KVM: PPC: Book3S HV nestedv2: Invalidate RPT before deleting a guest

2023-12-17 Thread Vaibhav Jain
"Aneesh Kumar K.V" writes: > Vaibhav Jain writes: > >> Hi Aneesh, >> >> Thanks for looking into this patch. My responses inline below: >> >> "Aneesh Kumar K.V (IBM)" writes: >> >>> Vaibhav Jain writes: >>&g

Re: [PATCH 09/12] KVM: PPC: Book3S HV nestedv2: Do not call H_COPY_TOFROM_GUEST

2023-12-10 Thread Vaibhav Jain
Hi Aneesh, Thanks for looking into this patch. My responses inline: "Aneesh Kumar K.V (IBM)" writes: > May be we should use > firmware_has_feature(FW_FEATURE_H_COPY_TOFROM_GUEST))? > > the nestedv2 can end up using the above hcall if it is supported by the > hypervisor right? In its absence we

Re: [PATCH 01/12] KVM: PPC: Book3S HV nestedv2: Invalidate RPT before deleting a guest

2023-12-08 Thread Vaibhav Jain
Hi Aneesh, Thanks for looking into this patch. My responses inline below: "Aneesh Kumar K.V (IBM)" writes: > Vaibhav Jain writes: > >> From: Jordan Niethe >> >> An L0 must invalidate the L2's RPT during H_GUEST_DELETE if this has not >> alr

[PATCH 11/12] KVM: PPC: Reduce reliance on analyse_instr() in mmio emulation

2023-12-01 Thread Vaibhav Jain
From: Jordan Niethe Commit 709236039964 ("KVM: PPC: Reimplement non-SIMD LOAD/STORE instruction mmio emulation with analyse_instr() input") and commit 2b33cb585f94 ("KVM: PPC: Reimplement LOAD_FP/STORE_FP instruction mmio emulation with analyse_instr() input") made kvmppc_emulate_loadstore() use

[PATCH 09/12] KVM: PPC: Book3S HV nestedv2: Do not call H_COPY_TOFROM_GUEST

2023-12-01 Thread Vaibhav Jain
From: Jordan Niethe H_COPY_TOFROM_GUEST is part of the nestedv1 API and so should not be called by a nestedv2 host. Do not attempt to call it. Signed-off-by: Jordan Niethe --- arch/powerpc/kvm/book3s_64_mmu_radix.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/powerpc/kvm/book3s_

[PATCH 12/12] KVM: PPC: Book3S HV nestedv2: Do not cancel pending decrementer exception

2023-12-01 Thread Vaibhav Jain
From: Jordan Niethe In the nestedv2 case, if there is a pending decrementer exception, the L1 must get the L2's timebase from the L0 to see if the exception should be cancelled. This adds the overhead of a H_GUEST_GET_STATE call to the likely case in which the decrementer should not be cancelled.

[PATCH 03/12] KVM: PPC: Book3S HV nestedv2: Do not check msr on hcalls

2023-12-01 Thread Vaibhav Jain
From: Jordan Niethe The check for a hcall coming from userspace is done for KVM-PR. This is not supported for nestedv2 and the L0 will directly inject the necessary exception to the L2 if userspace performs a hcall. Avoid checking the MSR and thus avoid a H_GUEST_GET_STATE hcall in the L1. Signe

[PATCH 10/12] KVM: PPC: Book3S HV nestedv2: Register the VPA with the L0

2023-12-01 Thread Vaibhav Jain
From: Jordan Niethe In the nestedv2 case, the L1 may register the L2's VPA with the L0. This allows the L0 to manage the L2's dispatch count, as well as enable possible performance optimisations by seeing if certain resources are not being used by the L2 (such as the PMCs). Use the H_GUEST_SET_S

[PATCH 08/12] KVM: PPC: Book3S HV nestedv2: Avoid msr check in kvmppc_handle_exit_hv()

2023-12-01 Thread Vaibhav Jain
From: Jordan Niethe The msr check in kvmppc_handle_exit_hv() is not needed for nestedv2 hosts, skip the check to avoid a H_GUEST_GET_STATE hcall. Signed-off-by: Jordan Niethe --- arch/powerpc/kvm/book3s_hv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kvm/b

[PATCH 04/12] KVM: PPC: Book3S HV nestedv2: Get the PID only if needed to copy tofrom a guest

2023-12-01 Thread Vaibhav Jain
From: Jordan Niethe kvmhv_copy_tofrom_guest_radix() gets the PID at the start of the function. If pid is not used, then this is a wasteful H_GUEST_GET_STATE hcall for nestedv2 hosts. Move the assignment to where pid will be used. Suggested-by: Nicholas Piggin Signed-off-by: Jordan Niethe ---

[PATCH 07/12] KVM: PPC: Book3S HV nestedv2: Do not inject certain interrupts

2023-12-01 Thread Vaibhav Jain
From: Jordan Niethe There is no need to inject an external interrupt in kvmppc_book3s_irqprio_deliver() as the test for BOOK3S_IRQPRIO_EXTERNAL in kvmhv_run_single_vcpu() before guest entry will raise LPCR_MER if needed. There is also no need to inject the decrementer interrupt as this will be ra

[PATCH 00/12] KVM: PPC: Nested APIv2 : Performance improvements

2023-12-01 Thread Vaibhav Jain
From: vaibhav This patch series introduces series of performance improvements to recently added support for Nested APIv2 PPC64 Guests via [1]. Details for Nested APIv2 for PPC64 Guests is available in Documentation/powerpc/kvm-nested.rst. This patch series introduces various optimizations for a

[PATCH 06/12] KVM: PPC: Book3S HV: Handle pending exceptions on guest entry with MSR_EE

2023-12-01 Thread Vaibhav Jain
From: Nicholas Piggin Commit 026728dc5d41 ("KVM: PPC: Book3S HV P9: Inject pending xive interrupts at guest entry") changed guest entry so that if external interrupts are enabled, BOOK3S_IRQPRIO_EXTERNAL is not tested for. Test for this regardless of MSR_EE. For an L1 host, do not inject an inte

[PATCH 05/12] KVM: PPC: Book3S HV nestedv2: Ensure LPCR_MER bit is passed to the L0

2023-12-01 Thread Vaibhav Jain
From: Jordan Niethe LPCR_MER is conditionally set during entry to a guest if there is a pending external interrupt. In the nestedv2 case, this change is not being communicated to the L0, which means it is not being set in the L2. Ensure the updated LPCR value is passed to the L0. Signed-off-by:

[PATCH 01/12] KVM: PPC: Book3S HV nestedv2: Invalidate RPT before deleting a guest

2023-12-01 Thread Vaibhav Jain
From: Jordan Niethe An L0 must invalidate the L2's RPT during H_GUEST_DELETE if this has not already been done. This is a slow operation that means H_GUEST_DELETE must return H_BUSY multiple times before completing. Invalidating the tables before deleting the guest so there is less work for the L

[PATCH 02/12] KVM: PPC: Book3S HV nestedv2: Avoid reloading the tb offset

2023-12-01 Thread Vaibhav Jain
From: Jordan Niethe The kvmppc_get_tb_offset() getter reloads KVMPPC_GSID_TB_OFFSET from the L0 for nestedv2 host. This is unnecessary as the value does not change. KVMPPC_GSID_TB_OFFSET also need not be reloaded in kvmppc_{s,g}et_dec_expires(). Signed-off-by: Jordan Niethe --- arch/powerpc/in

Re: [PATCH] powerpc: Enable generic cpu idle-loop

2023-08-20 Thread Vaibhav Jain
Thanks for looking at this patch Mpe. Michael Ellerman writes: > Vaibhav Jain writes: >> This minor patch enables config option GENERIC_IDLE_POLL_SETUP for arch >> powerpc. This should add support for kernel param 'nohlt'. > > Which is named after an 8086 instru

[PATCH v2] powerpc: Enable generic cpu idle-loop

2023-08-20 Thread Vaibhav Jain
CPU to an idle-loop similar to what cpu_idle_poll() does. Hence this patch also updates the handling of 'powersave=off' kernel param to enable generic cpu idle-loop if its enabled. Signed-off-by: Vaibhav Jain --- Changelog: Since v1: https://lore.kernel.org/all/20230818050739.827851-1-v

[PATCH] powerpc: Enable generic cpu idle-loop

2023-08-17 Thread Vaibhav Jain
CPU to an idle-loop similar to what cpu_idle_poll() does. This patch however makes powerpc kernel-parameters better aligned to the generic boot-time parameters. Signed-off-by: Vaibhav Jain --- Documentation/admin-guide/kernel-parameters.txt | 2 +- arch/powerpc/Kconfig|

Re: [PATCH v3] powerpc/papr_scm: Fix nvdimm event mappings

2022-08-04 Thread Vaibhav Jain
Remove function papr_scm_pmu_check_events() and replace the > event checks in papr_scm_pmu_register() function with p->stat_buffer_len > as suggested by Vaibhav Jain > Link to the patch v2: > https://lore.kernel.org/all/20220711034605.212683-1-kj...@linux.ibm.com/ V3 patch looks good to me. Reviewed-by: Vaibhav Jain -- Cheers ~ Vaibhav

Re: [PATCH v2] powerpc/papr_scm: Fix nvdimm event mappings

2022-07-11 Thread Vaibhav Jain
Hi Kajol, Thanks for the patch. Minor review comment below: Kajol Jain writes: > Commit 4c08d4bbc089 ("powerpc/papr_scm: Add perf interface support") > added performance monitoring support for papr-scm nvdimm devices via > perf interface. Commit also added an array in papr_scm_priv > structure

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
nsure correct memory bounds. Fixes: 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: Vaibha

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

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 fai

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

2022-05-24 Thread Vaibhav Jain
introducing the check for 'p->stat_buffer_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: S

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 poin

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

2022-05-23 Thread Vaibhav Jain
nsure correct memory bounds. Fixes: 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:

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

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

2022-05-18 Thread Vaibhav Jain
27;s memory bounds. Fixes: fee3ff99bc67("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

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

2022-05-11 Thread Vaibhav Jain
27;nvdimm_events_map' to 'stat_id'. Also rest of the code can continue to call 'kfree(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 Jai

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_event

[PATCH] powerpc/papr_scm: Fix leaking nvdimm_events_map elements

2022-05-08 Thread Vaibhav Jain
x27;stat_id'. Also rest of the code can continue to call 'kfree(papr_scm_priv.nvdimm_events_map)' 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 t

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 fu

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
ject' as payload thats exchanged between libndctl and papr_scm to indicate 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

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 functio

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

2022-01-13 Thread Vaibhav Jain
r_pdsm_smart_inject() constructs a pair or 'mask' and 'override' bitmaps from the payload 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

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

2021-09-08 Thread Vaibhav Jain
ndtest and 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: >>

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

2021-07-12 Thread Vaibhav Jain
The patch is based on [2] "powerpc/papr_scm: Move duplicate definitions to common header files". [1] : https://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: Shivapr

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

2021-06-24 Thread Vaibhav Jain
add a new member called '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 Anee

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 prevents f

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

2021-05-27 Thread Vaibhav Jain
add a new member called '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/ps

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

2021-05-21 Thread Vaibhav Jain
add a new member called '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 + ar

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 approac

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

2021-05-13 Thread Vaibhav Jain
ols/scripts that are dependent on presence of its sysfs file. Hence I dont expect any 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 spe

[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_AUT

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 entire

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

2021-05-07 Thread Vaibhav Jain
riv.stat_buffer_len' is moved from papr_scm_nvdimm_init() 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') S

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

2021-05-05 Thread Vaibhav Jain
riv.stat_buffer_len' is moved from papr_scm_nvdimm_init() 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&#x

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

2021-05-05 Thread Vaibhav Jain
icating that 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 ] * Switc

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 comp

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/powerp

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 H_

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
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 a

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

2020-11-08 Thread Vaibhav Jain
y is queried 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/powerp

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

2020-11-08 Thread Vaibhav Jain
-ENOENT) for request 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 supporte

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

2020-10-29 Thread Vaibhav Jain
@ Description: > * "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. T

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 Wen

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
t struct member gone, 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/powerp

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

2020-09-13 Thread Vaibhav Jain
CALL processing to ensure 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

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
x27; to 'ssize_t' that prevents the compiler from truncating the return value 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 ---

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
x27; to 'ssize_t' that prevents the compiler from truncating the return value 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 --- arc

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

2020-09-07 Thread Vaibhav Jain
m performance stats from PHYP') 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/p

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(). Thi

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

2020-08-14 Thread Vaibhav Jain
s causes a loop in sysfs's 'create_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

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

2020-08-12 Thread Vaibhav Jain
('powerpc/papr_scm: Fetch 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

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 a

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

2020-08-07 Thread Vaibhav Jain
hence its 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/platform

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

2020-07-30 Thread Vaibhav Jain
issues the HCALL to PHYP. The return value 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 J

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

2020-07-30 Thread Vaibhav Jain
in the buffer are formatted into the sysfs access 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 &#x

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

2020-07-30 Thread Vaibhav Jain
ch 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

  1   2   3   4   5   >