Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp3548035ioo; Wed, 25 May 2022 03:11:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJylbwwq3S8Wj5UKe4BMadWqn4qMqJn7wvSyLB1F63+Ha3Mm8ypZJqpMVoKaV4ezbfx7Xz4/ X-Received: by 2002:a17:907:c0a:b0:6fe:e21c:f5b with SMTP id ga10-20020a1709070c0a00b006fee21c0f5bmr13966343ejc.554.1653473477149; Wed, 25 May 2022 03:11:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653473477; cv=none; d=google.com; s=arc-20160816; b=H2rNYi0QiyRg9iVHya7aGmZWcJkcX+nUhHw0MTlNXXYzyB2Jw2xchUQTyI8257MafD 0FfwuoTuIb0aXjux2gNnGOOFaq9Cg0o7jnq+0bVoe6s/hPotGPQVIkoI0STSaStCJu5V ganHoZCE1ejr3tC7o2vc8aI4sMu72Htj14RIsNfvJPzSTIJuVaBifqtPazTUKJEAhZXC LOeRdun0AunAVYWOa+Izw4eCShZuVaOHvcMe9p2dJpPsYQtiVkDEBW4QoiJ9Jd+JFTgT fIxEAtDrWNYBbUa0bOzasQLZqLLfCRkbd8YEqzHpn0G7soZwl1wPdTEZ2ASNBdZMjjNd RrQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:cc:user-agent:mime-version :date:message-id:dkim-signature; bh=N4iIngHDdWUOCtVuOct834MtuDvgGlDdzC51EYz1XGo=; b=qesDMoizVHNwBULKUPe18naOIGvabwV9KD2Nlgmsuw7KMVec3bAr10naiZmQVtFohP ZvM4GzbGEnbap/PHu1LuBHz4vGEaXAvKk2G5QfpgWUsHzb75sh4NuSh39MPjo5CC1TRc 4akWtdXBLXqHf3zQGZPygG7jto+2odd57zRz/c6yPnttPzMamK3XImmW3ltGA2MyNS8q G4GlCgl2GyZUTNyhPwlR4LJeJ+I2oCsJj3yaIO42DZATRhOrbNXj/Y9G+WJGxeZaKcuT +ujuUlyBdMgOC5PeomFKXjF7me3/73a1MqBXF0KoA1Dq0IFw/v69mfMKPu7MoKByh6cU z7QQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=TNmedrve; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ga12-20020a1709070c0c00b006fe94f69841si20134714ejc.692.2022.05.25.03.10.50; Wed, 25 May 2022 03:11:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=TNmedrve; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243915AbiEYFTT (ORCPT + 99 others); Wed, 25 May 2022 01:19:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237251AbiEYFTP (ORCPT ); Wed, 25 May 2022 01:19:15 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A66981D337 for ; Tue, 24 May 2022 22:19:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653455954; x=1684991954; h=message-id:date:mime-version:cc:subject:to:references: from:in-reply-to:content-transfer-encoding; bh=cjXO8vVlpxnhMYVXhRqJDGd35rZJ3LD3EJ/zDC/ghbU=; b=TNmedrveP5bET7DjkilBoynbfxBthHPTr1Ptmm+JhEiqZuAoRn/RJad+ qIG8UkOWnLIrIiI/bdp9xqfCqNHxfvImV20Uj99HDJ27T2jzvdwN7fibg 4LCiF/J8ffMVfqgXLoyHGCDSpI1Uz6ShQV373VhNdbWou+GE7VArjavkG wJ/ZdjHbM2XnWEKYQ/MY7Prnd8elkPM7KuEiAXY5JyhFa2JmaPXY5g3b2 9BIKJtJd7IMPSDhGAPsBKy9JyyTnhIJsj2z6DabwAg11kvpj1KEiV5JhZ thJSD3Nnxs7ZFaxGQUdHbphsJQZO/caEdPkG60NtyV9zCT2FYKI8BlMtP w==; X-IronPort-AV: E=McAfee;i="6400,9594,10357"; a="273715916" X-IronPort-AV: E=Sophos;i="5.91,250,1647327600"; d="scan'208";a="273715916" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 May 2022 22:19:14 -0700 X-IronPort-AV: E=Sophos;i="5.91,250,1647327600"; d="scan'208";a="601660650" Received: from jwang96-mobl.ccr.corp.intel.com (HELO [10.255.29.139]) ([10.255.29.139]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 May 2022 22:19:10 -0700 Message-ID: <3ce2f162-7b0c-391d-7978-d1703fbe9b79@linux.intel.com> Date: Wed, 25 May 2022 13:19:08 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Cc: baolu.lu@linux.intel.com, Joerg Roedel , Christoph Hellwig , Kevin Tian , Ashok Raj , Will Deacon , Robin Murphy , Jean-Philippe Brucker , Dave Jiang , Vinod Koul , Eric Auger , Liu Yi L , Jacob jun Pan , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Jean-Philippe Brucker Subject: Re: [PATCH v7 03/10] iommu/sva: Add iommu_sva_domain support Content-Language: en-US To: Jason Gunthorpe References: <20220519072047.2996983-1-baolu.lu@linux.intel.com> <20220519072047.2996983-4-baolu.lu@linux.intel.com> <20220524134440.GT1343366@nvidia.com> From: Baolu Lu In-Reply-To: <20220524134440.GT1343366@nvidia.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,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 Hi Jason, On 2022/5/24 21:44, Jason Gunthorpe wrote: >> diff --git a/drivers/iommu/iommu-sva-lib.c b/drivers/iommu/iommu-sva-lib.c >> index 106506143896..210c376f6043 100644 >> +++ b/drivers/iommu/iommu-sva-lib.c >> @@ -69,3 +69,51 @@ struct mm_struct *iommu_sva_find(ioasid_t pasid) >> return ioasid_find(&iommu_sva_pasid, pasid, __mmget_not_zero); >> } >> EXPORT_SYMBOL_GPL(iommu_sva_find); >> + >> +/* >> + * IOMMU SVA driver-oriented interfaces >> + */ >> +struct iommu_domain * >> +iommu_sva_alloc_domain(struct bus_type *bus, struct mm_struct *mm) > This should return the proper type > Can you please elaborate a bit on "return the proper type"? Did you mean return iommu_sva_domain instead? That's a wrapper of iommu_domain and only for iommu internal usage. Best regards, baolu