Prefer to use real virtual address over direct map address in the

linux_page_address() function in the LinuxKPI. This solves an issue
where the return value from linux_page_address() is passed to
kmem_free().

MFC after:		1 week
Sponsored by:		Mellanox Technologies
This commit is contained in:
Hans Petter Selasky 2017-04-27 14:29:21 +00:00
parent 007e172d64
commit a8c348db51

View File

@ -71,14 +71,16 @@ __FBSDID("$FreeBSD$");
void *
linux_page_address(struct page *page)
{
if (page->object != kmem_object && page->object != kernel_object) {
#ifdef LINUXKPI_HAVE_DMAP
return ((void *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(page)));
return ((void *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(page)));
#else
if (page->object != kmem_object && page->object != kernel_object)
return (NULL);
#endif
}
return ((void *)(uintptr_t)(VM_MIN_KERNEL_ADDRESS +
IDX_TO_OFF(page->pindex)));
#endif
}
vm_page_t