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 failure. This change fixes nginx running on P5020 SoC. MFC after: 3 weeks
This commit is contained in:
parent
8161ca87dc
commit
c20f3fa6b6
10
sys/contrib/ncsw/user/env/xx.c
vendored
10
sys/contrib/ncsw/user/env/xx.c
vendored
@ -701,7 +701,12 @@ 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 %p!\n", addr);
|
||||
@ -757,6 +762,9 @@ XX_PhysToVirt(physAddress_t addr)
|
||||
if (pv != NULL)
|
||||
return ((void *)(pv->pv_va + ((vm_offset_t)addr & PAGE_MASK)));
|
||||
|
||||
if (PMAP_HAS_DMAP)
|
||||
return ((void *)PHYS_TO_DMAP(addr));
|
||||
|
||||
printf("NetCommSW: "
|
||||
"Unable to translate physical address 0x%09jx!\n", (uintmax_t)addr);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user