[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] Re: [XEN-IOMMU] Proposal of DMA protection/isolation support

On 16/1/08 17:15, "Wei Wang2" <wei.wang2@xxxxxxx> wrote:

>> Local pages could always be mapped into the iommu, and only remote pages
>> would need to be temporarily mapped via the gnttab hooks.
> I remembered that vtd patch used to hook page assignment to for this,
> but it was soon replaced with statical 1:1 mapping. Could you suggest me
> how to trace local page changes instead of mapping whole the physical
> ram?

alloc_domheap_pages() if you want to map MFNs. populate_physmap() if you
want to map PFNs. There might be a few other places to hook also but I
expect they're the main ones.

>> 2) When dma layer is invoked to prepare a bus address for native block
>>> device driver. It would be better to have a "hypervisor-aware" dma layer
>>> which always maps virtual address to bus address via hypercall.
>>> __gnttab_dma_map_page() might be a good place to trigger this new
>>> hypercall. Both remote and local pages can be mapped by this way.
>> An extra hypercall here will likely hurt performance.
> I have implemented a prototype for this which removes 1:1 mapping and invoke a
> hypercall for 
> dma mapping. Since block driver uses dma_map_sg heavily which is easy to
> batch, I have not seen dramatic performance loss.

It's hard to slow down block-device accesses. What does it do to CPU usage
and max bandwidth on a multi-gigabit NIC?

 -- Keir

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.