Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp143463rdf; Thu, 2 Nov 2023 16:54:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHOyJ8nY37io4tyqJuQzoYjnYiOWNWiKEmfbrvk83TUS1BqjXJHdRvFk5FPXkttHo2xrgr7 X-Received: by 2002:a05:6a00:b55:b0:690:d4f5:c664 with SMTP id p21-20020a056a000b5500b00690d4f5c664mr17624553pfo.11.1698969249065; Thu, 02 Nov 2023 16:54:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698969249; cv=none; d=google.com; s=arc-20160816; b=hcw727ekPQRGeTR/EZahViEqryKr0p6yfM2KOcDiIbbYNohzOxkNZcp3mNdseyt1sL MZ/Vr+qspUdRlYzxR4dCzPwyINzqIZKeYR/2dk7Tf0LOVNC9FOQO1mTH/sxfWJuOWjEa L4+yPio2KZOj/CMbiSjCLRBGLlXdFLWeXEBBcYXGfk3xofbOIfqBNaVHM83nMqAcG9sg W3qdEUnzidiEMHnAcBIEgaQUO0YdR/W1bbMJ9JJILDePxSNhzUhjclNvb04jGcmuZBDX dMyOJl6M46LO7zv+YaWL3XVWbIBesmJCHNZ2+e8RIO4KW/gGK+eW9ghU0jaFQIKLdmZO kViw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=JQBJ6xDHHKFcC4YoQlU9mDR0r7uubIawaPypa/2vXq4=; fh=Yq9NgPdPNJ3f/a3H+WZ8kcj6ghWN4WvEK/lYOs8bYXI=; b=mOXocujGJ3T+PeXHeJp9iTLrNN8HPDlmtNqmHJ/O6wxj2zdUSXe/GqAgD7rXs2gvvX Lgws4HQ3YNUaOR2vXxGDBYYwNnB2p0WyyVkpPeXEncZ31GSn/+BVP8ggxdAk15ZDikjO Sa52bICOuE59SCnQi9smDRIa2G1b0AlU8KJgcB7vy0mBbaLHIU0P6Vr35BZOYeytW/m1 Wjp89XSFBP0YLwzKIHjvMbsnl8VEfgbtExvBti7p+5+4tnyULxUXVynixXKOWPTMHBdH GpIEyHhbqOC+ff++CuWcy+zk04dds8rEdy+m0m8R9Ob9ukhxte8DHi0DzTQPVWAlJm/y 02/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canb.auug.org.au header.s=201702 header.b=WuVHTR89; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id o9-20020a056a001bc900b006bc3f09ea03si465962pfw.301.2023.11.02.16.54.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 16:54:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@canb.auug.org.au header.s=201702 header.b=WuVHTR89; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id AAF4B82CB52A; Thu, 2 Nov 2023 16:54:06 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230102AbjKBXyF (ORCPT + 99 others); Thu, 2 Nov 2023 19:54:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229597AbjKBXyE (ORCPT ); Thu, 2 Nov 2023 19:54:04 -0400 Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0312196; Thu, 2 Nov 2023 16:53:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canb.auug.org.au; s=201702; t=1698969237; bh=JQBJ6xDHHKFcC4YoQlU9mDR0r7uubIawaPypa/2vXq4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=WuVHTR89mHR1EIOk5U6NtHK/iH06BhsVlBcBVu/qc9TA0MPgIllCUgcZeZP/nU7Lr lCTRYBrKc9LEklR0+X2fx6bxC5cYovKdgnLwqgPpcTOIC3iFqc/Z3cvDGilgeJFATw mdsAA4AOSVwYJcz82y0K6g/Pmqv/z0vv5sVUAxTBakqK+x0YjMxYKF4k3PU4SDbTyL mvaxnrnsOTIWuy9gBc84yx2tbrUNdox8AvQSBMQWU+15bu6JLF4PnG5hLAvjOgk5N+ CRRY0MvP9Zy4479Rx5HVsuZgyJE4Gy7fY5gcQg3B+/sjgaKEOU+Zr50/buBZMHMZQd bBrwoRpIu5PSw== 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 4SM11J4nDPz4x5j; Fri, 3 Nov 2023 10:53:56 +1100 (AEDT) Date: Fri, 3 Nov 2023 10:53:55 +1100 From: Stephen Rothwell To: Jason Gunthorpe , Joerg Roedel Cc: Jason Gunthorpe , Joerg Roedel , Linux Kernel Mailing List , Linux Next Mailing List , Lu Baolu , Nicolin Chen , Yi Liu Subject: Re: linux-next: manual merge of the iommufd tree with the iommu tree Message-ID: <20231103105355.71575cf6@canb.auug.org.au> In-Reply-To: <20231025154420.718e27af@canb.auug.org.au> References: <20231025154420.718e27af@canb.auug.org.au> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/m7W_noYGPzxMdC8Ku2q84/g"; protocol="application/pgp-signature"; micalg=pgp-sha256 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Thu, 02 Nov 2023 16:54:06 -0700 (PDT) --Sig_/m7W_noYGPzxMdC8Ku2q84/g Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hi all, On Wed, 25 Oct 2023 15:44:20 +1100 Stephen Rothwell = wrote: > > Today's linux-next merge of the iommufd tree got a conflict in: >=20 > include/linux/iommu.h >=20 > between commits: >=20 > 1c68cbc64fe6 ("iommu: Add IOMMU_DOMAIN_PLATFORM") > 4601cd2d7c4c ("iommu: Add ops->domain_alloc_paging()") >=20 > from the iommu tree and commits: >=20 > 1621aef1fbfe ("iommu: Add IOMMU_DOMAIN_NESTED") > 909f4abd1097 ("iommu: Add new iommu op to create domains owned by users= pace") > 17dd7701a2e7 ("iommu: Pass in parent domain with user_data to domain_al= loc_user op") >=20 > from the iommufd tree. >=20 > 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 > --=20 > Cheers, > Stephen Rothwell >=20 > diff --cc include/linux/iommu.h > index b5b254e205c6,f347bf31761f..000000000000 > --- a/include/linux/iommu.h > +++ b/include/linux/iommu.h > @@@ -64,8 -66,10 +66,11 @@@ struct iommu_domain_geometry=20 > #define __IOMMU_DOMAIN_DMA_FQ (1U << 3) /* DMA-API uses flush queue = */ > =20 > #define __IOMMU_DOMAIN_SVA (1U << 4) /* Shared process address space */ > +#define __IOMMU_DOMAIN_PLATFORM (1U << 5) > =20 > + #define __IOMMU_DOMAIN_NESTED (1U << 5) /* User-managed address space = nested > + on a stage-2 translation */ > +=20 > #define IOMMU_DOMAIN_ALLOC_FLAGS ~__IOMMU_DOMAIN_DMA_FQ > /* > * This are the possible domain-types > @@@ -94,7 -96,7 +99,8 @@@ > __IOMMU_DOMAIN_DMA_API | \ > __IOMMU_DOMAIN_DMA_FQ) > #define IOMMU_DOMAIN_SVA (__IOMMU_DOMAIN_SVA) > +#define IOMMU_DOMAIN_PLATFORM (__IOMMU_DOMAIN_PLATFORM) > + #define IOMMU_DOMAIN_NESTED (__IOMMU_DOMAIN_NESTED) > =20 > struct iommu_domain { > unsigned type; > @@@ -238,9 -327,19 +331,21 @@@ static inline int __iommu_copy_struct_f > * op is allocated in the iommu driver and freed by the calle= r after > * use. The information type is one of enum iommu_hw_info_typ= e defined > * in include/uapi/linux/iommufd.h. > - * @domain_alloc: allocate iommu domain > + * @domain_alloc: allocate and return an iommu domain if success. Other= wise > + * NULL is returned. The domain is not fully initialized= until > + * the caller iommu_domain_alloc() returns. > + * @domain_alloc_paging: Allocate an iommu_domain that can be used for > + * UNMANAGED, DMA, and DMA_FQ domain types. > + * @domain_alloc_user: Allocate an iommu domain corresponding to the in= put > + * parameters as defined in include/uapi/linux/iomm= ufd.h. > + * Unlike @domain_alloc, it is called only by IOMMU= FD and > + * must fully initialize the new domain before retu= rn. > + * Upon success, if the @user_data is valid and the= @parent > + * points to a kernel-managed domain, the new domai= n must be > + * IOMMU_DOMAIN_NESTED type; otherwise, the @parent= must be > + * NULL while the @user_data can be optionally prov= ided, the > + * new domain must support __IOMMU_DOMAIN_PAGING. > + * Upon failure, ERR_PTR must be returned. > * @probe_device: Add device to iommu driver handling > * @release_device: Remove device from iommu driver handling > * @probe_finalize: Do final setup work after the device is added to an= IOMMU > @@@ -275,7 -372,9 +380,10 @@@ struct iommu_ops=20 > =20 > /* Domain allocation and freeing by the iommu driver */ > struct iommu_domain *(*domain_alloc)(unsigned iommu_domain_type); > + struct iommu_domain *(*domain_alloc_paging)(struct device *dev); > + struct iommu_domain *(*domain_alloc_user)( > + struct device *dev, u32 flags, struct iommu_domain *parent, > + const struct iommu_user_data *user_data); > =20 > struct iommu_device *(*probe_device)(struct device *dev); > void (*release_device)(struct device *dev); This is now a conflict between the iommu tree and Linus' tree. --=20 Cheers, Stephen Rothwell --Sig_/m7W_noYGPzxMdC8Ku2q84/g Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEENIC96giZ81tWdLgKAVBC80lX0GwFAmVENpQACgkQAVBC80lX 0Gy/jgf+OLhq6Xi7fJ3xXJxNBplLh5qPb+0iKdaKEbGuri2+GgTtajO05uO1/f4k YzDv1N144ksyEkx6Knh6P3M0O2Ggwt2vR4w/+zh/BwAsXNz6KLlf0N5e/5vXG4g4 ACHjIXttJvidxnZUiqJaddAY8lz0Oet16E9Z7/f+9lCI4KtR6UYj+ixyS3+e5K2e 9gPc473GfkDJfnhIY0dWUr/xYj4en9KbCb3ClYsQdU8ux8LVzNGa6FkNdVM7ZJPy cyPlPuuCDcjB8Dq/2Q4G85933hCl8JDGXFMsOrAdyoUcu+gUz1EP45pGoMVcJQFx pm6jC5O7blWAjPD1Zw3QNUXcFmbzdA== =ypI6 -----END PGP SIGNATURE----- --Sig_/m7W_noYGPzxMdC8Ku2q84/g--