Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 64EB0C433EF for ; Wed, 8 Dec 2021 19:51:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239866AbhLHTyd (ORCPT ); Wed, 8 Dec 2021 14:54:33 -0500 Received: from mga07.intel.com ([134.134.136.100]:45916 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229750AbhLHTyc (ORCPT ); Wed, 8 Dec 2021 14:54:32 -0500 X-IronPort-AV: E=McAfee;i="6200,9189,10192"; a="301307888" X-IronPort-AV: E=Sophos;i="5.88,190,1635231600"; d="scan'208";a="301307888" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Dec 2021 11:50:59 -0800 X-IronPort-AV: E=Sophos;i="5.88,190,1635231600"; d="scan'208";a="612215503" Received: from jacob-builder.jf.intel.com (HELO jacob-builder) ([10.7.199.155]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Dec 2021 11:50:59 -0800 Date: Wed, 8 Dec 2021 11:55:16 -0800 From: Jacob Pan To: Jason Gunthorpe Cc: , LKML , Joerg Roedel , Christoph Hellwig , "Greg Kroah-Hartman" , Jean-Philippe Brucker , Jacob Pan , Lu Baolu , Raj Ashok , "Kumar, Sanjay K" , Dave Jiang , Tony Luck , Yi Liu , "Tian, Kevin" , Barry Song <21cnbao@gmail.com>, "Zanussi, Tom" , Dan Williams , jacob.jun.pan@linux.intel.com Subject: Re: [PATCH 4/4] dmaengine: idxd: Use DMA API for in-kernel DMA with PASID Message-ID: <20211208115516.1d36fed9@jacob-builder> In-Reply-To: <20211208131358.GR6385@nvidia.com> References: <1638884834-83028-1-git-send-email-jacob.jun.pan@linux.intel.com> <1638884834-83028-5-git-send-email-jacob.jun.pan@linux.intel.com> <20211208131358.GR6385@nvidia.com> Organization: OTC X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jason, On Wed, 8 Dec 2021 09:13:58 -0400, Jason Gunthorpe wrote: > > This patch utilizes iommu_enable_pasid_dma() to enable DSA to perform > > DMA requests with PASID under the same mapping managed by DMA mapping > > API. In addition, SVA-related bits for kernel DMA are removed. As a > > result, DSA users shall use DMA mapping API to obtain DMA handles > > instead of using kernel virtual addresses. > > Er, shouldn't this be adding dma_map/etc type calls? > > You can't really say a driver is using the DMA API without actually > calling the DMA API.. The IDXD driver is not aware of addressing mode, it is up to the user of dmaengine API to prepare the buffer mappings. Here we only set up the PASID such that it can be picked up during DMA work submission. I tested with /drivers/dma/dmatest.c which does dma_map_page(), map_single etc. also tested with other pieces under development. Thanks, Jacob