svn commit: r344497 - stable/12/sys/contrib/ncsw/user/env

Justin Hibbits jhibbits at
Sun Feb 24 20:29:12 UTC 2019

Author: jhibbits
Date: Sun Feb 24 20:29:11 2019
New Revision: 344497

  MFC r342811, r343168-r343169
  dtsec: Fix formatting of addresses in translation error messages
  Don't clamp addresses to 8 hex digits, particularly since this is primarily
  used now on a 64-bit platform.
  powerpc/dpaa: Handle DMAP virtual addresses in DPAA
  sendfile(2) appears to now use DMAP wherever possible.  These addresses are not
  managed by pmap, so pmap_kextract() returns a 0 physical address, causing
  This change fixes nginx running on P5020 SoC.
  dpaa: fix 32-bit build
  Book-E powerpc uses 64-bit vm_paddr_t, and 32-bit powerpc has 32-bit pointers,
  so gcc errors with cast to pointer from integer of different size.  As this will
  not actually be used in reality anyway, simply quiet the warning by casting
  through uintptr_t.

Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/contrib/ncsw/user/env/xx.c
--- stable/12/sys/contrib/ncsw/user/env/xx.c	Sun Feb 24 20:15:16 2019	(r344496)
+++ stable/12/sys/contrib/ncsw/user/env/xx.c	Sun Feb 24 20:29:11 2019	(r344497)
@@ -701,10 +701,15 @@ XX_VirtToPhys(void *addr)
 		return (XX_PInfo.portal_ci_pa[QM_PORTAL][cpu] +
 		    (vm_offset_t)addr - XX_PInfo.portal_ci_va[QM_PORTAL]);
-	paddr = pmap_kextract((vm_offset_t)addr);
+	if (PMAP_HAS_DMAP && (vm_offset_t)addr >= DMAP_BASE_ADDRESS &&
+	    (vm_offset_t)addr <= DMAP_MAX_ADDRESS)
+		return (DMAP_TO_PHYS((vm_offset_t)addr));
+	else
+		paddr = pmap_kextract((vm_offset_t)addr);
 	if (paddr == 0)
 		printf("NetCommSW: "
-		    "Unable to translate virtual address 0x%08X!\n", addr);
+		    "Unable to translate virtual address %p!\n", addr);
 		pmap_track_page(kernel_pmap, (vm_offset_t)addr);
@@ -757,8 +762,11 @@ XX_PhysToVirt(physAddress_t addr)
 	if (pv != NULL)
 		return ((void *)(pv->pv_va + ((vm_offset_t)addr & PAGE_MASK)));
+		return ((void *)(uintptr_t)PHYS_TO_DMAP(addr));
 	printf("NetCommSW: "
-	    "Unable to translate physical address 0x%08llX!\n", addr);
+	    "Unable to translate physical address 0x%09jx!\n", (uintmax_t)addr);
 	return (NULL);

More information about the svn-src-all mailing list