From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paul Mackerras Date: Fri, 14 Dec 2018 03:18:39 +0000 Subject: Re: [PATCH kernel v5 03/20] powerpc/vfio/iommu/kvm: Do not pin device memory Message-Id: <20181214031839.GA25474@blackberry> List-Id: References: <20181213061734.16651-1-aik@ozlabs.ru> <20181213061734.16651-4-aik@ozlabs.ru> In-Reply-To: <20181213061734.16651-4-aik@ozlabs.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Alexey Kardashevskiy Cc: Alex Williamson , Jose Ricardo Ziviani , Sam Bobroff , Alistair Popple , Daniel Henrique Barboza , linuxppc-dev@lists.ozlabs.org, kvm-ppc@vger.kernel.org, Piotr Jaroszynski , Leonardo Augusto =?iso-8859-1?Q?Guimar=E3es?= Garcia , Reza Arbab , David Gibson On Thu, Dec 13, 2018 at 05:17:17PM +1100, Alexey Kardashevskiy wrote: > This new memory does not have page structs as it is not plugged to > the host so gup() will fail anyway. > > This adds 2 helpers: > - mm_iommu_newdev() to preregister the "memory device" memory so > the rest of API can still be used; > - mm_iommu_is_devmem() to know if the physical address is one of thise > new regions which we must avoid unpinning of. > > This adds @mm to tce_page_is_contained() and iommu_tce_xchg() to test > if the memory is device memory to avoid pfn_to_page(). > > This adds a check for device memory in mm_iommu_ua_mark_dirty_rm() which > does delayed pages dirtying. > > Signed-off-by: Alexey Kardashevskiy Reviewed-by: Paul Mackerras