From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A5F59C433DB for ; Thu, 4 Mar 2021 08:45:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 818FD64F11 for ; Thu, 4 Mar 2021 08:45:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236437AbhCDIop (ORCPT ); Thu, 4 Mar 2021 03:44:45 -0500 Received: from jabberwock.ucw.cz ([46.255.230.98]:56162 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236435AbhCDIo3 (ORCPT ); Thu, 4 Mar 2021 03:44:29 -0500 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id A5AFD1C0B87; Thu, 4 Mar 2021 09:43:30 +0100 (CET) Date: Thu, 4 Mar 2021 09:43:29 +0100 From: Pavel Machek To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Yong Wu , Robin Murphy , Will Deacon , Sasha Levin Subject: Re: [PATCH 5.10 337/663] iommu: Move iotlb_sync_map out from __iommu_map Message-ID: <20210304084329.GA25188@amd> References: <20210301161141.760350206@linuxfoundation.org> <20210301161158.520692499@linuxfoundation.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="huq684BweRXVnRxX" Content-Disposition: inline In-Reply-To: <20210301161158.520692499@linuxfoundation.org> User-Agent: Mutt/1.5.23 (2014-03-12) Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org --huq684BweRXVnRxX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > [ Upstream commit d8c1df02ac7f2c802a9b2afc0f5c888c4217f1d5 ] >=20 > In the end of __iommu_map, It alway call iotlb_sync_map. >=20 > This patch moves iotlb_sync_map out from __iommu_map since it is > unnecessary to call this for each sg segment especially iotlb_sync_map > is flush tlb all currently. Add a little helper _iommu_map for this. > Signed-off-by: Sasha Levin AFAICT this is slight performance optimalization, not a bugfix. It actually introduces a bug, fixed by the next patch. I'd preffer not to have it in stable. Best regards, Pavel > @@ -2421,18 +2418,31 @@ static int __iommu_map(struct iommu_domain *domai= n, unsigned long iova, > =20 > +static int _iommu_map(struct iommu_domain *domain, unsigned long iova, > + phys_addr_t paddr, size_t size, int prot, gfp_t gfp) > +{ > + const struct iommu_ops *ops =3D domain->ops; > + int ret; > + > + ret =3D __iommu_map(domain, iova, paddr, size, prot, GFP_KERNEL); > + if (ret =3D=3D 0 && ops->iotlb_sync_map) > + ops->iotlb_sync_map(domain); > + > + return ret; > +} --=20 http://www.livejournal.com/~pavelmachek --huq684BweRXVnRxX Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAmBAnbEACgkQMOfwapXb+vIVvACgshwz5xeQjuPBx5Me4eiCuLPc H2cAn0tp1BDr8V0rf+DIijdLJ4J+w/f+ =5sHE -----END PGP SIGNATURE----- --huq684BweRXVnRxX--