<div class="socmaildefaultfont" style="font-family:Arial, Helvetica, sans-serif;font-size:10pt" dir="ltr" ><div dir="ltr" >I applied the patch on top of the latest upstream kernel. I ran HTX over pmem nodes for several hours and it works.</div>
<div dir="ltr" > </div>
<div dir="ltr" >Tested-by: Wen Xiong<wenxiong@linux.vnet.ibm.com></div>
<div dir="ltr" > </div>
<div dir="ltr" >Thanks,</div>
<div dir="ltr" >Wendy</div>
<blockquote style="border-left:solid #aaaaaa 2px; margin-left:5px; padding-left:5px; direction:ltr; margin-right:0px" dir="ltr" data-history-content-modified="1" >----- Original message -----<br>From: Alexey Kardashevskiy <aik@ozlabs.ru><br>To: linuxppc-dev@lists.ozlabs.org<br>Cc: Alexey Kardashevskiy <aik@ozlabs.ru>, David Gibson <david@gibson.dropbear.id.au>, Michael Ellerman <mpe@ellerman.id.au>, Oliver O'Halloran <oohall@gmail.com>, "Aneesh Kumar K . V" <aneesh.kumar@linux.ibm.com>, Wen Xiong <wenxiong@us.ibm.com>, Brian J King <bjking1@us.ibm.com><br>Subject: [EXTERNAL] [PATCH kernel] powerpc/pseries/ddw: Extend upper limit for huge DMA window for persistent memory<br>Date: Mon, Mar 30, 2020 8:23 PM<br> 
<div><font face="Default Monospace,Courier New,Courier,monospace" size="2" >Unlike normal memory ("memory" compatible type in the FDT),<br>the persistent memory ("ibm,pmemory" in the FDT) can be mapped anywhere<br>in the guest physical space and it can be used for DMA.<br><br>In order to maintain 1:1 mapping via the huge DMA window, we need to<br>know the maximum physical address at the time of the window setup.<br>So far we've been looking at "memory" nodes but "ibm,pmemory" does not<br>have fixed addresses and the persistent memory may be mapped afterwards.<br><br>Since the persistent memory is still backed with page structs,<br>use MAX_PHYSMEM_BITS as the upper limit.<br><br>This effectively disables huge DMA window in LPAR under pHyp if<br>persistent memory is present but this is the best we can do.<br><br>Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru><br>---<br> arch/powerpc/platforms/pseries/iommu.c | 9 +++++++++<br> 1 file changed, 9 insertions(+)<br><br>diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c<br>index 2e0a8eab5588..6d47b4a3ce39 100644<br>--- a/arch/powerpc/platforms/pseries/iommu.c<br>+++ b/arch/powerpc/platforms/pseries/iommu.c<br>@@ -945,6 +945,15 @@ static phys_addr_t ddw_memory_hotplug_max(void)<br>  phys_addr_t max_addr = memory_hotplug_max();<br>  struct device_node *memory;<br> <br>+ /*<br>+ * The "ibm,pmemory" can appear anywhere in the address space.<br>+ * Assuming it is still backed by page structs, set the upper limit<br>+ * for the huge DMA window as MAX_PHYSMEM_BITS.<br>+ */<br>+ if (of_find_node_by_type(NULL, "ibm,pmemory"))<br>+ return (sizeof(phys_addr_t) * 8 <= MAX_PHYSMEM_BITS) ?<br>+ (phys_addr_t) -1 : (1ULL << MAX_PHYSMEM_BITS);<br>+<br>  for_each_node_by_type(memory, "memory") {<br>  unsigned long start, size;<br>  int n_mem_addr_cells, n_mem_size_cells, len;<br>--<br>2.17.1</font><br> </div></blockquote>
<div dir="ltr" > </div></div><BR>