Summary: Can't obtain dma address for granted page in dom0
After granting a page (using xenbus_grant_ring()) allocated in domU and mapping
it into dom0 (using xenbus_map_ring_valloc()). I expect to be able to get a
dma address (using something like pci_map_single()) for the page in dom0.
However, the dma address returned is always the same value, regardless of the
actual page provided. Related functionality such as find_vma(), follow_page(),
virt_to_mfn(), page_to_bus(), dma_map_page(), etc. doesn't seem to work either.
They all tend to return either obviously wrong values (wildly out of range) or
just repeatedly return the same value for different arguments. Performing a
walk of the page tables in dom0 finds a valid entry for that address, but the
struct page given for that entry is always the same for the valid addresses
The "struct vm_struct" returned by xenbus_map_ring_valloc() has a pages array
field, but this is blank when the function returns, so no struct page is
available from there.
Modifying xenbus_map_ring_valloc to use the GNTMAP_contains_pte flag, and
giving it a valid page table entry to use instead of a virtual address, results
in the same behaviour. i.e. after the call, a walk of the page tables in dom0
gives the same struct page for all the different virtual addresses that have
I wonder if the call to HYPERVISOR_grant_table_op updates the page tables in
the hypervisor, but doesn't properly update the page tables in dom0, and so the
information required isn't available there.
This is blocking our development of accelerated backend drivers as the only
simple workaround requires dom0 to trust domU to provide the bus address of the
grant, which is clearly not a good idea.
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
Xen-bugs mailing list