How I can get phycial address from virtual memory address

Now I need to get phycial address from virtual memory address,I know
I can get virtual memory address from phycial address by using mmap_device_memory(),but from the opposite direction,how to do?

posix_mem_offset/offset64.

Be sure to read all the docs on it. And if you are looking to get memory to give to a device, be sure to use mmap() to get it so you can ensure it is phyiscally contiguous.