From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lu Baolu Subject: Re: [PATCH v1 4/9] iommu/vt-d: Add bounce buffer API for domain map/unmap Date: Thu, 14 Mar 2019 09:01:16 +0800 Message-ID: References: <20190312060005.12189-1-baolu.lu@linux.intel.com> <20190312060005.12189-5-baolu.lu@linux.intel.com> <20190312163845.GA13141@infradead.org> <20190313161029.GA23513@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20190313161029.GA23513-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org> Content-Language: en-US List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Christoph Hellwig Cc: kevin.tian-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, mika.westerberg-VuQAYsv1563Yd54FQh9/CA@public.gmane.org, ashok.raj-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, alan.cox-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, pengfei.xu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, jacob.jun.pan-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, David Woodhouse List-Id: iommu@lists.linux-foundation.org Hi, On 3/14/19 12:10 AM, Christoph Hellwig wrote: > On Wed, Mar 13, 2019 at 10:31:52AM +0800, Lu Baolu wrote: >> Hi again, >> >> On 3/13/19 10:04 AM, Lu Baolu wrote: >>> Hi, >>> >>> On 3/13/19 12:38 AM, Christoph Hellwig wrote: >>>> On Tue, Mar 12, 2019 at 02:00:00PM +0800, Lu Baolu wrote: >>>>> This adds the APIs for bounce buffer specified domain >>>>> map() and unmap(). The start and end partial pages will >>>>> be mapped with bounce buffered pages instead. This will >>>>> enhance the security of DMA buffer by isolating the DMA >>>>> attacks from malicious devices. >>>> >>>> Please reuse the swiotlb code instead of reinventing it. >>>> >> >> Just looked into the code again. At least we could reuse below >> functions: >> >> swiotlb_tbl_map_single() >> swiotlb_tbl_unmap_single() >> swiotlb_tbl_sync_single() >> >> Anything else? > > Yes, that is probably about the level you want to reuse, given that the > next higher layer already has hooks into the direct mapping code. > Okay. Thank you! I will try to make this happen in v2. Best regards, Lu Baolu