Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp153606rdh; Wed, 25 Oct 2023 20:28:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFMLDUoPTQfxdYCLmn7i/dlnSmEQ081+oO7+apOgJgBFkhxuBHnmjPS7HpkUAfrau0c6pcT X-Received: by 2002:a05:620a:b10:b0:778:910b:1f55 with SMTP id t16-20020a05620a0b1000b00778910b1f55mr16661666qkg.70.1698290891149; Wed, 25 Oct 2023 20:28:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698290891; cv=none; d=google.com; s=arc-20160816; b=xvnBuxg8pLYDRqZYEGL0jHGYowZoscAkpj86T0ojoIVoionxzMGWlrff4rmzx0A7ds ddVHZnuwEDcTgarNF6WJzhFBtX9TPzoyfjyAXsrIvyf0Kf9Zl86aT8faAuJVWq3LxScW koL+mxeLB+83wsoQuguE115CJHHONnTJp1ADY4s+rOGEU8/Uszq8W0hu/BsgZd+Ujfzt y2JvMPj9duvzxp25RJQ/jEd+fkUB4mJNml1r52mqptZG/37Jhv4C4zydeD8/Cls1Y3A+ CyF5LgWvV7HGVkoFHAPq/XaAbp9opLg7z5gT/S5cWyWu/SlTXJ7l/COrBT0DQ9R/J5af FpfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:subject:cc:to:from:date :dkim-signature; bh=uZcN/okWIB4ryLnAV48yQVnuFynysUqMSeAVPBsSjyQ=; fh=/CDMt74qtvcyArOqu6AkNlTgBaLiBhjtncGhAHGQJHI=; b=moLhwYyKGIh5QZh3zNS0ejlNcyYWd0FIjOpdjzwW57QmXZLdCEiwv7iR0MS2pRn5RV e19GHoKm0r+3rvIzGZcRlDdApyAIbWBS2WHSWRNnaStBxagNJF4jHGpuud0REtJfGWkY yWw8+HWhYS4LfHUyLsNuvOVDzscTpcsdHylZdWMYlkr5JN0VjKcNo6c+xUT4rMM8bsnT Rw2/8+RnG8PIDZ3EvhSrKAUwEOO4gWBFNJp+Au5SoJW3+kcqm1KuW3fZHFt8wjRriVNI kKVrUEWbC5Ugseaps7kgU8JpBAAnnVrqpccgGZPP/l6YuheqpSfwjA5M5OAh0shGo+Zv KjLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canb.auug.org.au header.s=201702 header.b=Ot91u8+x; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canb.auug.org.au Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id c184-20020a254ec1000000b00d9a680da562si12929340ybb.706.2023.10.25.20.28.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 20:28:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@canb.auug.org.au header.s=201702 header.b=Ot91u8+x; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canb.auug.org.au Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 4601F8215782; Wed, 25 Oct 2023 20:28:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229954AbjJZD1q (ORCPT + 99 others); Wed, 25 Oct 2023 23:27:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229554AbjJZD1p (ORCPT ); Wed, 25 Oct 2023 23:27:45 -0400 Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DAE3187; Wed, 25 Oct 2023 20:27:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canb.auug.org.au; s=201702; t=1698290857; bh=uZcN/okWIB4ryLnAV48yQVnuFynysUqMSeAVPBsSjyQ=; h=Date:From:To:Cc:Subject:From; b=Ot91u8+xZEFcqWqJa7UCNIL9yrkGxXKkBU7HrPkQcjr6b9yzqpwP8kEk/sl2y9Fmv 4mH4HEpFBzPNl4gm8i+0gEmY2cNd45awjgCi+UZEXl1JyUHQy5L3HbmgVggRqtUKsP 8x2SXzXE1d+DDW4UvhIZgIT4zuOpbAHi6TXvDQverWs76pdWIJbdwlqU0fuXWycxRL eRgxGgwcEo9WSxSruQ2Mf2eoEDdtiU76z6CoBK3Me8vWaEeGCN704n18asYQwNaRQ0 twjbbRIq8vgzYsmZxqSvT5ljR7WyYLj7H8fT4dNQYKkS8EFm9fmyahFJLVs4rR1ej6 yQRUuQ5JhUXKg== Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4SGB7X1qtdz4wcZ; Thu, 26 Oct 2023 14:27:36 +1100 (AEDT) Date: Thu, 26 Oct 2023 14:27:33 +1100 From: Stephen Rothwell To: Jason Gunthorpe , Joerg Roedel Cc: Jason Gunthorpe , Linux Kernel Mailing List , Linux Next Mailing List , Michael Shavit , Tina Zhang , Will Deacon Subject: linux-next: manual merge of the iommufd tree with the iommu tree Message-ID: <20231026142733.442e18a5@canb.auug.org.au> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/tK7kIIiHSe7r3YfzFGS6Mxb"; protocol="application/pgp-signature"; micalg=pgp-sha256 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 25 Oct 2023 20:28:08 -0700 (PDT) --Sig_/tK7kIIiHSe7r3YfzFGS6Mxb Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hi all, Today's linux-next merge of the iommufd tree got a conflict in: drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-sva.c between commit: 24503148c545 ("iommu/arm-smmu-v3: Refactor write_ctx_desc") from the iommu tree and commit: a247f322787d ("iommu: Add mm_get_enqcmd_pasid() helper function") from the iommufd tree. I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts. --=20 Cheers, Stephen Rothwell diff --cc drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-sva.c index 353248ab18e7,08fac84c1804..000000000000 --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-sva.c +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-sva.c @@@ -264,10 -233,10 +264,10 @@@ static void arm_smmu_mm_release(struct=20 * DMA may still be running. Keep the cd valid to avoid C_BAD_CD events, * but disable translation. */ - arm_smmu_update_ctx_desc_devices(smmu_domain, mm->pasid, &quiet_cd); - arm_smmu_write_ctx_desc(smmu_domain, mm_get_enqcmd_pasid(mm), &quiet_cd); ++ arm_smmu_update_ctx_desc_devices(smmu_domain, mm_get_enqcmd_pasid(mm), &= quiet_cd); =20 arm_smmu_tlb_inv_asid(smmu_domain->smmu, smmu_mn->cd->asid); - arm_smmu_atc_inv_domain(smmu_domain, mm->pasid, 0, 0); + arm_smmu_atc_inv_domain(smmu_domain, mm_get_enqcmd_pasid(mm), 0, 0); =20 smmu_mn->cleared =3D true; mutex_unlock(&sva_lock); @@@ -323,16 -290,7 +323,16 @@@ arm_smmu_mmu_notifier_get(struct arm_sm goto err_free_cd; } =20 - ret =3D arm_smmu_write_ctx_desc(smmu_domain, mm_get_enqcmd_pasid(mm), cd= ); + spin_lock_irqsave(&smmu_domain->devices_lock, flags); + list_for_each_entry(master, &smmu_domain->devices, domain_head) { - ret =3D arm_smmu_write_ctx_desc(master, mm->pasid, cd); ++ ret =3D arm_smmu_write_ctx_desc(master, mm_get_enqcmd_pasid(mm), cd); + if (ret) { + list_for_each_entry_from_reverse(master, &smmu_domain->devices, domain= _head) - arm_smmu_write_ctx_desc(master, mm->pasid, NULL); ++ arm_smmu_write_ctx_desc(master, mm_get_enqcmd_pasid(mm), NULL); + break; + } + } + spin_unlock_irqrestore(&smmu_domain->devices_lock, flags); if (ret) goto err_put_notifier; =20 @@@ -357,8 -315,7 +357,8 @@@ static void arm_smmu_mmu_notifier_put(s return; =20 list_del(&smmu_mn->list); - arm_smmu_write_ctx_desc(smmu_domain, mm_get_enqcmd_pasid(mm), NULL); + - arm_smmu_update_ctx_desc_devices(smmu_domain, mm->pasid, NULL); ++ arm_smmu_update_ctx_desc_devices(smmu_domain, mm_get_enqcmd_pasid(mm), N= ULL); =20 /* * If we went through clear(), we've already invalidated, and no --Sig_/tK7kIIiHSe7r3YfzFGS6Mxb Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEENIC96giZ81tWdLgKAVBC80lX0GwFAmU53KUACgkQAVBC80lX 0Gzndgf/S2pw71j8Idqieqy7PiH0BlPDqksLsRxL1VReKjDDKJqqEajoThQJpAtX /4Tny4aCjMB5IBC09THAkV9DSlmf2uW4Cz0iL8WJXVHWuh/VL6f1zfxsuAzsq0mV D8zRV02K4HuY+w5XYqFq71XLnLwQy0fD9Lzz4zyrSZdnEDX0AGxVfVTrklNXarjh cY61KFOy/qp4uL+SP17uucO87pUvmvGt68jVajEAy/ekyRP77zqFyi2xLxUXRSm6 q2IYKRPize7MzqO5qyXQQ78VjTLw18fD9USp/FtlrRWknSNWKc2V6w6gOEprAfoE ZiKUKBeesymdODmxZfCZ3YPfojKtEg== =8UMB -----END PGP SIGNATURE----- --Sig_/tK7kIIiHSe7r3YfzFGS6Mxb--