WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Reversing the DMA handle

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] Reversing the DMA handle
From: Pete Zaitcev <zaitcev@xxxxxxxxxx>
Date: Tue, 9 Jan 2007 17:17:10 -0800
Cc: zaitcev@xxxxxxxxxx
Delivery-date: Tue, 09 Jan 2007 17:18:07 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: Red Hat, Inc.
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Dear Xen developers:

I maintain a component in Linux kernel, called usbmon. It provides for
snooping of USB traffic, analoguously to tcpdump. Due to pequliarities
of USB API in Linux, usbmon has to take a DMA address (coming from
dma_alloc_coherent() typically), find the corresponding PFN and call
pkmap()/memcpy()/pkunmap().

My question is: how to find PFN under Xen if DMA address is known,
on x86_64 and i386?

I see some functions which may be useful (e.g. mfn_to_pfn()), but what
I need the most is some tribal knowledge about what is the proper way
to do it. This includes things like working in both dom0 and domU,
not faulting in machine_to_phys_mapping[] while in hot path, and so on.

Thank you,
-- Pete

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>