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

2021-04-29 Thread Michael Ellerman
On Mon, 29 Mar 2021 17:01:03 +0530, Vaibhav Jain wrote: > In case an nvdimm is found to be unarmed during probe then set its > NDD_UNARMED flag before nvdimm_create(). This would enforce a > read-only access to the ndimm region. Presently even if an nvdimm is > unarmed its not marked as read-only

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

2021-04-18 Thread Michael Ellerman
On Sun, 4 Apr 2021 22:01:48 +0530, Vaibhav Jain wrote: > 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_mapping() like one below: > > watchdog: BUG: soft lockup - CPU#8 stuck for

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

2021-04-18 Thread Michael Ellerman
On Mon, 29 Mar 2021 13:36:43 -0400, Shivaprasad G Bhat wrote: > 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 flush request failed, the

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

2021-03-31 Thread Michael Ellerman
"Aneesh Kumar K.V" writes: > 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 flush request failed, the

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

2020-10-09 Thread Michael Ellerman
On Mon, 14 Sep 2020 02:49:04 +0530, Vaibhav Jain wrote: > Add NVDIMM_FAMILY_PAPR to the list of valid 'dimm_family_mask' > acceptable by papr_scm. This is needed as since commit > 92fe2aa859f5 ("libnvdimm: Validate command family indices") libnvdimm > performs a validation of

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

2020-09-17 Thread Michael Ellerman
On Sat, 12 Sep 2020 13:44:51 +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,persistent-memory:ibm,pmemory@4411: > Failed to query performance stats, Err:-10 >

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

2020-09-15 Thread Michael Ellerman
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 query performance stats, Err:-10 > dev_attr_show:

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

2020-09-10 Thread Michael Ellerman
On Mon, 7 Sep 2020 16:35:40 +0530, Vaibhav Jain wrote: > The newly introduced 'perf_stats' attribute uses the default access > mode of 0444 letting non-root users access performance stats of an > nvdimm and potentially force the kernel into issuing large number of > expensive HCALLs. Since the

Re: [PATCH v2 3/7] mm/memory_hotplug: prepare passing flags to add_memory() and friends

2020-09-09 Thread Michael Ellerman
David Hildenbrand writes: > On 09.09.20 09:17, Greg Kroah-Hartman wrote: >> On Tue, Sep 08, 2020 at 10:10:08PM +0200, David Hildenbrand wrote: >>> We soon want to pass flags, e.g., to mark added System RAM resources. >>> mergeable. Prepare for that. >> >> What are these random "flags", and how

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

2020-08-13 Thread Michael Ellerman
"Aneesh Kumar K.V" writes: > On 8/13/20 10:04 AM, Vaibhav Jain wrote: >> The newly introduced 'perf_stats' attribute uses the default access >> mode of 0444 letting non-root users access performance stats of an >> nvdimm and potentially force the kernel into issuing large number of >> expensive

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

2020-08-10 Thread Michael Ellerman
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 potentially force the kernel into issuing large number of > expensive HCALLs. Since the information exposed by this

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

2020-08-02 Thread Michael Ellerman
On Fri, 31 Jul 2020 12:11:51 +0530, Vaibhav Jain wrote: > Changes since v3[1]: > > * Fixed a rebase issue pointed out by Aneesh in first patch in the series. > > [1] > https://lore.kernel.org/linux-nvdimm/20200730121303.134230-1-vaib...@linux.ibm.com Applied to powerpc/next. [1/2]

Re: [PATCH v7 0/7] Support new pmem flush and sync instructions for POWER

2020-07-16 Thread Michael Ellerman
On Wed, 1 Jul 2020 12:52:28 +0530, Aneesh Kumar K.V wrote: > This patch series enables the usage os new pmem flush and sync instructions > on POWER > architecture. POWER10 introduces two new variants of dcbf instructions > (dcbstps and dcbfps) > that can be used to write modified locations back

Re: [GIT PULL] libnvdimm for v5.8-rc2

2020-06-21 Thread Michael Ellerman
Dan Williams writes: > Hi Linus, please pull from: > > git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm > tags/libnvdimm-for-5.8-rc2 > > ...to receive a feature (papr_scm health retrieval) and a fix (sysfs > attribute visibility) for v5.8. > > Vaibhav explains in the merge commit

Re: [RESEND PATCH v7 4/5] ndctl/papr_scm, uapi: Add support for PAPR nvdimm specific methods

2020-05-26 Thread Michael Ellerman
Vaibhav Jain writes: > Hi Ira, Mpe and Aneesh, > > Vaibhav Jain writes: > >> Michael Ellerman writes: >> >>> Ira Weiny writes: >>>> On Wed, May 20, 2020 at 12:30:57AM +0530, Vaibhav Jain wrote: >>>>> Introduce support for Papr nvDi

Re: [PATCH v4 1/2] x86, powerpc: Rename memcpy_mcsafe() to copy_mc_to_{user, kernel}()

2020-05-23 Thread Michael Ellerman
nore > +++ b/tools/testing/selftests/powerpc/copyloops/.gitignore > @@ -12,4 +12,4 @@ memcpy_p7_t1 > copyuser_64_exc_t0 > copyuser_64_exc_t1 > copyuser_64_exc_t2 > -memcpy_mcsafe_64 > +copy_mc_to_user Should be: +copy_mc_64 Otherwise the powerpc bits look good to me. Ack

Re: [RESEND PATCH v7 3/5] powerpc/papr_scm: Fetch nvdimm health information from PHYP

2020-05-21 Thread Michael Ellerman
Vaibhav Jain writes: > Thanks for reviewing this this patch Ira. My responses below: > Ira Weiny writes: >> On Wed, May 20, 2020 at 12:30:56AM +0530, Vaibhav Jain wrote: >>> Implement support for fetching nvdimm health information via >>> H_SCM_HEALTH hcall as documented in Ref[1]. The hcall

Re: [RESEND PATCH v7 4/5] ndctl/papr_scm,uapi: Add support for PAPR nvdimm specific methods

2020-05-21 Thread Michael Ellerman
Ira Weiny writes: > On Wed, May 20, 2020 at 12:30:57AM +0530, Vaibhav Jain wrote: >> Introduce support for Papr nvDimm Specific Methods (PDSM) in papr_scm >> modules and add the command family to the white list of NVDIMM command >> sets. Also advertise support for ND_CMD_CALL for the dimm >>

Re: [PATCH v3 1/2] x86, powerpc: Rename memcpy_mcsafe() to copy_mc_to_{user, kernel}()

2020-05-20 Thread Michael Ellerman
Hi Dan, Just a couple of minor things ... Dan Williams writes: > In reaction to a proposal to introduce a memcpy_mcsafe_fast() > implementation Linus points out that memcpy_mcsafe() is poorly named > relative to communicating the scope of the interface. Specifically what > addresses are valid

Re: [PATCH v7 2/5] seq_buf: Export seq_buf_printf() to external modules

2020-05-08 Thread Michael Ellerman
Borislav Petkov writes: > On Fri, May 08, 2020 at 04:19:19PM +0530, Vaibhav Jain wrote: >> 'seq_buf' provides a very useful abstraction for writing to a string >> buffer without needing to worry about it over-flowing. However even >> though the API has been stable for couple of years now its

Re: [PATCH v6 3/4] ndctl/papr_scm,uapi: Add support for PAPR nvdimm specific methods

2020-04-30 Thread Michael Ellerman
on them. A new function > papr_scm_service_pdsm() is introduced and is called from > papr_scm_ndctl() in case of a PDSM request is received via ND_CMD_CALL > command from libnvdimm. > > Cc: Dan Williams > Cc: Michael Ellerman > Cc: "Aneesh Kumar K . V" > Signed-off-by:

Re: [PATCH v6 2/4] powerpc/papr_scm: Fetch nvdimm health information from PHYP

2020-04-30 Thread Michael Ellerman
he > interface between PHYP and guest kernel. A documentation text > describing flags reported by the the new sysfs attribute 'papr/flags' > is also introduced at Documentation/ABI/testing/sysfs-bus-papr-scm. > > [1] commit 58b278f568f0 ("powerpc: Provide initial documentation for >

Re: [PATCH v6 1/4] powerpc: Document details on H_SCM_HEALTH hcall

2020-04-30 Thread Michael Ellerman
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: Dan Williams > Cc: Michael Ellerman > Cc: "Aneesh Kumar K . V" > Signed-off-b

Re: [PATCH v4 03/25] powerpc/powernv: Map & release OpenCAPI LPC memory

2020-04-02 Thread Michael Ellerman
Benjamin Herrenschmidt writes: > On Wed, 2020-04-01 at 01:48 -0700, Dan Williams wrote: >> > >> > +u64 pnv_ocxl_platform_lpc_setup(struct pci_dev *pdev, u64 size) >> > +{ >> > + struct pci_controller *hose = pci_bus_to_host(pdev->bus); >> > + struct pnv_phb *phb = hose->private_data;

Re: [PATCH v5 1/4] powerpc/papr_scm: Fetch nvdimm health information from PHYP

2020-04-02 Thread Michael Ellerman
Vaibhav Jain writes: > Thanks for reviewing this patch Mpe, > Michael Ellerman writes: >> Vaibhav Jain writes: ... >> >>> + /* Check for various masks in bitmap and set the buffer */ >>> + if (health & PAPR_SCM_DIMM_UNARMED_MASK) >>> +

Re: [PATCH v5 1/4] powerpc/papr_scm: Fetch nvdimm health information from PHYP

2020-04-02 Thread Michael Ellerman
Vaibhav Jain writes: > Implement support for fetching nvdimm health information via > H_SCM_HEALTH hcall as documented in Ref[1]. The hcall returns a pair > of 64-bit big-endian integers which are then stored in 'struct > papr_scm_priv' and subsequently partially exposed to user-space via >

Re: [PATCH v4 00/25] Add support for OpenCAPI Persistent Memory devices

2020-04-02 Thread Michael Ellerman
"Oliver O'Halloran" writes: > On Thu, Apr 2, 2020 at 2:42 PM Michael Ellerman wrote: >> "Alastair D'Silva" writes: >> >> -Original Message- >> >> From: Dan Williams >> >> >> >> On Sun, Mar 29, 2020 at 10:23

RE: [PATCH v4 00/25] Add support for OpenCAPI Persistent Memory devices

2020-04-01 Thread Michael Ellerman
"Alastair D'Silva" writes: >> -Original Message- >> From: Dan Williams >> >> On Sun, Mar 29, 2020 at 10:23 PM Alastair D'Silva >> wrote: >> > >> > This series adds support for OpenCAPI Persistent Memory devices on >> > bare metal (arch/powernv), exposing them as nvdimms so that we can

Re: [PATCH v4 1/5] mm/memremap_pages: Introduce memremap_compat_align()

2020-03-11 Thread Michael Ellerman
is mapped with just one > + * page size selected by htab_init_page_sizes(). Consult > + * mmu_psize_defs[] to determine the minimum page size alignment. > +*/ > +unsigned long memremap_compat_align(void) > +{ > + unsigned int shift = mmu_psize_defs[mmu_linear_psize].shift; > + &

Re: [PATCH 2/5] mm/memremap_pages: Introduce memremap_compat_align()

2020-02-04 Thread Michael Ellerman
ore.kernel.org/r/capcyv4gbgnp95apyabcsocea50tqj9b5h__83vgngjq3oug...@mail.gmail.com > Reported-by: Aneesh Kumar K.V > Reported-by: Jeff Moyer > Cc: Benjamin Herrenschmidt > Cc: Paul Mackerras > Cc: Michael Ellerman > Signed-off-by: Dan Williams > --- &

Re: [PATCH v2 16/18] powerpc/papr_scm: Switch to numa_map_to_online_node()

2019-11-20 Thread Michael Ellerman
Dan Williams writes: > Now that the core exports numa_map_to_online_node() switch to that > instead of the locally coded duplicate. > > Cc: Benjamin Herrenschmidt > Cc: Paul Mackerras > Cc: Michael Ellerman Acked-by: Michael Ellerman cheers > Cc: "Oliver O'Hallora

Re: [PATCH] mm/nvdimm: Add is_ioremap_addr and use that to check ioremap address

2019-07-04 Thread Michael Ellerman
"Aneesh Kumar K.V" writes: > Andrew Morton writes: > >> On Mon, 1 Jul 2019 19:10:38 +0530 "Aneesh Kumar K.V" >> wrote: >> >>> Architectures like powerpc use different address range to map ioremap >>> and vmalloc range. The memunmap() check used by the nvdimm layer was >>> wrongly using

Re: [PATCH 2/5] mm/resource: move HMM pr_debug() deeper into resource code

2019-01-28 Thread Michael Ellerman
Dave Hansen writes: > On 1/25/19 1:18 PM, Bjorn Helgaas wrote: >> On Thu, Jan 24, 2019 at 5:21 PM Dave Hansen >> wrote: >>> diff -puN kernel/resource.c~move-request_region-check kernel/resource.c >>> --- a/kernel/resource.c~move-request_region-check 2019-01-24 >>> 15:13:14.453199539

Re: [PATCH 1/5] mm/resource: return real error codes from walk failures

2019-01-28 Thread Michael Ellerman
t = -EINVAL; > > I'll also dust off the ol' cross-compiler and make sure I didn't > fat-finger anything. Modern Fedora & Ubuntu have packaged cross toolchains. Otherwise there's the kernel.org ones, or bootlin has versions with libc if you need it. Patch looks fine. That value c

Re: [v3,1/2] powerpc/pseries: PAPR persistent memory support

2018-10-18 Thread Michael Ellerman
On Sun, 2018-10-14 at 23:18:27 UTC, Oliver O'Halloran wrote: > This patch implements support for discovering storage class memory > devices at boot and for handling hotplug of new regions via RTAS > hotplug events. > > Signed-off-by: Oliver O'Halloran Series applied to powerpc next, thanks.

Re: [PATCH 2/2] powerpc/pseries: Add driver for PAPR SCM regions

2018-10-14 Thread Michael Ellerman
Dan Williams writes: > On Sat, Oct 13, 2018 at 5:08 AM Michael Ellerman wrote: >> >> Dan Williams writes: >> > On Tue, Oct 9, 2018 at 11:21 PM Oliver O'Halloran wrote: >> >> >> >> Adds a driver that implements support for enabling and accessing

Re: [PATCH 2/2] powerpc/pseries: Add driver for PAPR SCM regions

2018-10-13 Thread Michael Ellerman
Dan Williams writes: > On Tue, Oct 9, 2018 at 11:21 PM Oliver O'Halloran wrote: >> >> Adds a driver that implements support for enabling and accessing PAPR >> SCM regions. Unfortunately due to how the PAPR interface works we can't >> use the existing of_pmem driver (yet) because: >> ... >> + >>

Re: [PATCH 2/2] powerpc/pseries: Add driver for PAPR SCM regions

2018-10-10 Thread Michael Ellerman
Oliver O'Halloran writes: > Adds a driver that implements support for enabling and accessing PAPR > SCM regions. Unfortunately due to how the PAPR interface works we can't > use the existing of_pmem driver (yet) because: > > a) The guest is required to use the H_SCM_BIND_MEM h-call to add >

Re: [PATCH v3 3/4] doc/devicetree: Persistent memory region bindings

2018-04-07 Thread Michael Ellerman
. > Cleaned up the example binding and fixed the overlapping regions. > Added support for multiple regions in a single reg. > v3: Removed platform bus boilerplate from the example. > Changed description of the volatile and reg properties > to make them more c

Re: [PATCH v3 1/3] mm, powerpc: use vma_kernel_pagesize() in vma_mmu_pagesize()

2018-03-02 Thread Michael Ellerman
size() as a __weak symbol to be overridden by the powerpc > version. > > Cc: Benjamin Herrenschmidt <b...@kernel.crashing.org> > Cc: Paul Mackerras <pau...@samba.org> > Cc: Michael Ellerman <m...@ellerman.id.au> > Signed-off-by: Dan Williams <dan.j.willi...@intel

Re: [PATCH v3 0/3] create sysfs representation of ACPI HMAT

2017-12-21 Thread Michael Ellerman
Matthew Wilcox writes: > On Mon, Dec 18, 2017 at 01:35:47PM -0700, Ross Zwisler wrote: >> What I'm hoping to do with this series is to just provide a sysfs >> representation of the HMAT so that applications can know which NUMA nodes to >> select with existing utilities like

Re: [PATCH 1/2] mm, hugetlbfs: introduce ->pagesize() to vm_operations_struct

2017-12-13 Thread Michael Ellerman
s introduce a new ->pagesize() vm operation. >> >> Cc: Benjamin Herrenschmidt <b...@kernel.crashing.org> >> Cc: Paul Mackerras <pau...@samba.org> >> Cc: Michael Ellerman <m...@ellerman.id.au> >> Reported-by: Jane Chu <jane@oracle.com> >&

Re: [PATCH 2/3] libnvdimm: Add a device-tree interface

2017-11-23 Thread Michael Ellerman
Rob Herring writes: > On Thu, Nov 16, 2017 at 04:51:30AM +1100, Oliver O'Halloran wrote: ... >> diff --git a/drivers/nvdimm/of_nvdimm.c b/drivers/nvdimm/of_nvdimm.c >> new file mode 100644 >> index ..765cbbae8bcb >> --- /dev/null >> +++ b/drivers/nvdimm/of_nvdimm.c >>

Re: [PATCH 02/15] mm, dax: introduce pfn_t_special()

2017-11-02 Thread Michael Ellerman
Dan Williams writes: > In support of removing the VM_MIXEDMAP indication from DAX VMAs, > introduce pfn_t_special() for drivers to indicate that _PAGE_SPECIAL > should be used for DAX ptes. This also helps identify drivers like > dccssblk that only want to use DAX in a

Re: [PATCH 8/9] powerpc/mm: Wire up hpte_removebolted for powernv

2017-04-13 Thread Michael Ellerman
Oliver O'Halloran writes: > On Wed, Apr 12, 2017 at 11:53 AM, Balbir Singh wrote: >> >> The API also does not clear linear_map_hash_slots[] under DEBUG_PAGEALLOC > > I'm not sure what API you're referring to here. The tracking for >

Re: [PATCH 6/9] powerpc, mm: Enable ZONE_DEVICE on powerpc

2017-04-11 Thread Michael Ellerman
Stephen Rothwell writes: > Hi Oliver, > > On Wed, 12 Apr 2017 03:42:30 +1000 Oliver O'Halloran wrote: >> >> Flip the switch. Running around and screaming "IT'S ALIVE" is optional, >> but recommended. >> >> Signed-off-by: Oliver O'Halloran