From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Gibson Date: Thu, 15 Nov 2018 05:38:22 +0000 Subject: Re: [PATCH kernel v3 03/22] powerpc/mm/iommu: Make mm_iommu_new() fail on existing regions Message-Id: <20181115053815.GE2547@umbus.fritz.box> MIME-Version: 1 Content-Type: multipart/mixed; boundary="PPYy/fEw/8QCHSq3" List-Id: References: <20181113082823.2440-1-aik@ozlabs.ru> <20181113082823.2440-4-aik@ozlabs.ru> In-Reply-To: <20181113082823.2440-4-aik@ozlabs.ru> To: Alexey Kardashevskiy Cc: Alex Williamson , Jose Ricardo Ziviani , Sam Bobroff , Alistair Popple , linuxppc-dev@lists.ozlabs.org, kvm-ppc@vger.kernel.org, Piotr Jaroszynski , Oliver O'Halloran , Andrew Donnellan , Leonardo Augusto =?iso-8859-1?Q?Guimar=E3es?= Garcia , Reza Arbab --PPYy/fEw/8QCHSq3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 13, 2018 at 07:28:04PM +1100, Alexey Kardashevskiy wrote: > Since we are going to have 2 different preregistering helpers, let's > make it clear that mm_iommu_new() is only for the normal memory > (i.e.not device memory) and for existing areas mm_iommu_get() should be > used instead. >=20 > This removes the check for exact match as the check for overlap is > enough now. >=20 > Signed-off-by: Alexey Kardashevskiy Reviewed-by: David Gibson It would make sense to fold this into the previous patch, I think, but it's not worth doing a respin just for that. > --- > Changes: > v2: > * remove the exact match check > --- > arch/powerpc/mm/mmu_context_iommu.c | 6 ------ > 1 file changed, 6 deletions(-) >=20 > diff --git a/arch/powerpc/mm/mmu_context_iommu.c b/arch/powerpc/mm/mmu_co= ntext_iommu.c > index babc6ad..580d89e 100644 > --- a/arch/powerpc/mm/mmu_context_iommu.c > +++ b/arch/powerpc/mm/mmu_context_iommu.c > @@ -102,12 +102,6 @@ long mm_iommu_new(struct mm_struct *mm, unsigned lon= g ua, unsigned long entries, > =20 > list_for_each_entry_rcu(mem, &mm->context.iommu_group_mem_list, > next) { > - if ((mem->ua =3D=3D ua) && (mem->entries =3D=3D entries)) { > - ++mem->used; > - *pmem =3D mem; > - goto unlock_exit; > - } > - > /* Overlap? */ > if ((mem->ua < (ua + (entries << PAGE_SHIFT))) && > (ua < (mem->ua + --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --PPYy/fEw/8QCHSq3 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEdfRlhq5hpmzETofcbDjKyiDZs5IFAlvtBkcACgkQbDjKyiDZ s5J09hAAxEOz5ZSIBbXhQ7DR9isrX64HWXmu4yIjZ1oSyIt7ctks7bsZQ5m7DSDH +tDy2G3trOTFtqGaUt4bPDJ+VsCx18uWpUZUiV6Z5OclVFyEHYAsYppA+mYmESnM TnN6LT55FdwoUpkOfF+J5qENPoHNLatM7B4vSFF65jxeDPEeRm+7a4BZ/X8gyFh/ GMmRN5oxkDb26ntgNJEYE/Oqj0kqSTn4/n1/W7LONZfW5EJARuyrRv71EULDKHsF ZAVHn8FAU8u/CS14Ip9ierIJ31Hh3iUyJNcZnd6qbJsxQ28tJHjePWJoa63y9QIy zrcaIjNyqhOst/T06QdTNerEkfF1n8QdDgugOdWVXRuoOQInl7lMwzAlnMGFs212 L1kPdT6FlU4jg3r7V4pvuhtF6qjhAKuQ1Y82wij+lbDKcVC0e70wYHO3YeuxTnTB tGo00nf8I69E3RDeaOGQMcTd/vcQnRKho23/TgtAQGw+G7MK4fu1hFTdVCOva3Ci QZvmSBVx1lEJOqNeUtW7XDMcoConlvBD5EBSvepZiNsx/zVAekOCWjbGhENfanG7 QnbcKZpfwwbKe5ps1IMHFPCBdEar250G18LfFPTUCV3csA7WZtU+Vfjn4QeWefr3 eao0lAHk9sKRq3dLxZdiKrk2GeSCkN1ixmo8+kI/fo4WnW3vo8k= =knbN -----END PGP SIGNATURE----- --PPYy/fEw/8QCHSq3--