Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp746666yba; Fri, 26 Apr 2019 08:07:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqxKSiTsRiQpFQoD4MNwp+xh8WG/ZW948767MuWuu9V3/aeVeNkWrnipVK3R0YWfD3OlJHxN X-Received: by 2002:a65:6644:: with SMTP id z4mr11767557pgv.300.1556291242893; Fri, 26 Apr 2019 08:07:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556291242; cv=none; d=google.com; s=arc-20160816; b=nOSfDrELeUJXezlVV1D7p3qqD6xK7pML2LLTcvQMbYTwRf0Sef2sBJWcqpuHtXvRdf M26Ee38/oNwoudextuM5/0Z70SvqI67Bj1+jIhgMQ8u84FTnZ6RRsi3MDfuzttwcwMR8 yW4DnRZkI5cRcNFSWNKIYW9nSOV1Wsd08RQFwIIJwvaLRwYXZKkzItON9nmJk3Vcm3Tl a0qTA7TzbRdhLk2DByoMmkskk0DQLU+jWF5QYjViUQtGsE71MCgFIknTx8T8m46f5lbR sIbrrRY6SBtVPDIBCLuxeDLBQzKJzTjrx7IpFHQQ3KF9LU44I7glL8tlMG6c/Ew2E//W NzqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=mr7CE62vBQPxw7RNVSMW5xgkrs50tcGMWgB0E/a0to0=; b=LET6NlAbwACyRnDXG+1jb6P0cNATxgs8qnAEJ4bE/hnFdT6k4utET6p3bpVHbgYvVw Vxykv0CwStSewc5oeUxxTcp5pRrpUj0yRS1HRzL2JjDuQAooANNDZPneqjxwLXj8nQHD O/vFNXSzEqxSl76zpSIJElZqIog4V3SR9/yvQkn7mSz+Txwjs0T/JXhnxGKPu/UfVXOg 0KKRZ6i7XAmfsUv+3g/qzPb/nIth7bI9E0hVrN/E0aVNBnIouP9FeU50WIxjNL2ADSMu vprppvPErPe0N0KWxM9hR4kFKEUgI+iwMFPz+wx0chrDv//Xb+9DySOeTrJ4N/G5tXlv 4hWw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z127si27178616pfb.254.2019.04.26.08.07.06; Fri, 26 Apr 2019 08:07:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726522AbfDZPEw (ORCPT + 99 others); Fri, 26 Apr 2019 11:04:52 -0400 Received: from verein.lst.de ([213.95.11.211]:46540 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726169AbfDZPEw (ORCPT ); Fri, 26 Apr 2019 11:04:52 -0400 Received: by newverein.lst.de (Postfix, from userid 2407) id BF769227A81; Fri, 26 Apr 2019 17:04:34 +0200 (CEST) Date: Fri, 26 Apr 2019 17:04:33 +0200 From: Christoph Hellwig To: Lu Baolu Cc: Christoph Hellwig , David Woodhouse , Joerg Roedel , ashok.raj@intel.com, jacob.jun.pan@intel.com, alan.cox@intel.com, kevin.tian@intel.com, mika.westerberg@linux.intel.com, pengfei.xu@intel.com, Konrad Rzeszutek Wilk , Marek Szyprowski , Robin Murphy , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 02/10] swiotlb: Factor out slot allocation and free Message-ID: <20190426150433.GA19930@lst.de> References: <20190421011719.14909-1-baolu.lu@linux.intel.com> <20190421011719.14909-3-baolu.lu@linux.intel.com> <20190422164555.GA31181@lst.de> <0c6e5983-312b-0d6b-92f5-64861cd6804d@linux.intel.com> <20190423061232.GB12762@lst.de> <20190424144532.GA21480@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 25, 2019 at 10:07:19AM +0800, Lu Baolu wrote: > This is not VT-d specific. It's just how generic IOMMU works. > > Normally, IOMMU works in paging mode. So if a driver issues DMA with > IOVA 0xAAAA0123, IOMMU can remap it with a physical address 0xBBBB0123. > But we should never expect IOMMU to remap 0xAAAA0123 with physical > address of 0xBBBB0000. That's the reason why I said that IOMMU will not > work there. Well, with the iommu it doesn't happen. With swiotlb it obviosuly can happen, so drivers are fine with it. Why would that suddenly become an issue when swiotlb is called from the iommu code?