[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Resend RFC PATCH V4 09/13] x86/Swiotlb/HV: Add Swiotlb bounce buffer remap function for HV IVM
- To: Christoph Hellwig <hch@xxxxxx>
- From: Tianyu Lan <ltykernel@xxxxxxxxx>
- Date: Wed, 21 Jul 2021 23:11:26 +0800
- Cc: kys@xxxxxxxxxxxxx, haiyangz@xxxxxxxxxxxxx, sthemmin@xxxxxxxxxxxxx, wei.liu@xxxxxxxxxx, decui@xxxxxxxxxxxxx, tglx@xxxxxxxxxxxxx, mingo@xxxxxxxxxx, bp@xxxxxxxxx, x86@xxxxxxxxxx, hpa@xxxxxxxxx, dave.hansen@xxxxxxxxxxxxxxx, luto@xxxxxxxxxx, peterz@xxxxxxxxxxxxx, konrad.wilk@xxxxxxxxxx, boris.ostrovsky@xxxxxxxxxx, jgross@xxxxxxxx, sstabellini@xxxxxxxxxx, joro@xxxxxxxxxx, will@xxxxxxxxxx, davem@xxxxxxxxxxxxx, kuba@xxxxxxxxxx, jejb@xxxxxxxxxxxxx, martin.petersen@xxxxxxxxxx, arnd@xxxxxxxx, m.szyprowski@xxxxxxxxxxx, robin.murphy@xxxxxxx, kirill.shutemov@xxxxxxxxxxxxxxx, akpm@xxxxxxxxxxxxxxxxxxxx, rppt@xxxxxxxxxx, Tianyu.Lan@xxxxxxxxxxxxx, thomas.lendacky@xxxxxxx, ardb@xxxxxxxxxx, robh@xxxxxxxxxx, nramas@xxxxxxxxxxxxxxxxxxx, pgonda@xxxxxxxxxx, martin.b.radev@xxxxxxxxx, david@xxxxxxxxxx, krish.sadhukhan@xxxxxxxxxx, saravanand@xxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, keescook@xxxxxxxxxxxx, rientjes@xxxxxxxxxx, hannes@xxxxxxxxxxx, michael.h.kelley@xxxxxxxxxxxxx, iommu@xxxxxxxxxxxxxxxxxxxxxxxxxx, linux-arch@xxxxxxxxxxxxxxx, linux-hyperv@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-scsi@xxxxxxxxxxxxxxx, netdev@xxxxxxxxxxxxxxx, vkuznets@xxxxxxxxxx, brijesh.singh@xxxxxxx, anparri@xxxxxxxxxxxxx
- Delivery-date: Wed, 21 Jul 2021 15:11:58 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 7/21/2021 10:33 PM, Christoph Hellwig wrote:
On Wed, Jul 21, 2021 at 06:28:48PM +0800, Tianyu Lan wrote:
dma_mmap_attrs() and dma_get_sgtable_attrs() get input virtual address
belonging to backing memory with struct page and returns bounce buffer
dma physical address which is below shared_gpa_boundary(vTOM) and passed
to Hyper-V via vmbus protocol.
The new map virtual address is only to access bounce buffer in swiotlb
code and will not be used other places. It's stored in the mem->vstart.
So the new API set_memory_decrypted_map() in this series is only called
in the swiotlb code. Other platforms may replace set_memory_decrypted()
with set_memory_decrypted_map() as requested.
It seems like you are indeed not using these new helpers in
dma_direct_alloc. How is dma_alloc_attrs/dma_alloc_coherent going to
work on these systems?
Current vmbus device drivers don't use dma_alloc_attrs/dma_alloc
_coherent() because vmbus driver allocates ring buffer for all devices.
Ring buffer has been marked decrypted and remapped in vmbus driver.
Netvsc and storvsc drivers just need to use dma_map_single/dma_map_page().
|