Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4204390pxj; Tue, 11 May 2021 23:42:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwyL+EpkuI/iSt4gr1x9MT2KUujntxrZItArFXFQPqlNvzlFgAyh8xiLtt0Ikzr3os9RDxM X-Received: by 2002:a17:906:b1cc:: with SMTP id bv12mr35539463ejb.407.1620801746924; Tue, 11 May 2021 23:42:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620801746; cv=none; d=google.com; s=arc-20160816; b=eNAPiXCqFa/ZhuvbQV7W8f4GR2fapFwwA504NzdOkJ4KZvVOxNyuUC0dulRTPtY4gp +oa90P7C8JKz9k6aoqz6ilHxKbLBzjmhGg4soTJiTzK+/aRCy8lfuJMWKse5BffNg1Sn UHL/nvt1jzvobX58pDhBh2mV/ztSP3dm4we52Man9lQL9yFSk3AiGzCWpztvqxv+ceTE Ng+naIGesxU77ynZp/G+eGeD+thrZhJLWKgT37ViCE6rEHlxxrwVmsX5SRBGPLFwTU0K YCPezc3SMrxY7HdPhwUg0Q9vJ9O/2AQ4ML5faiugTF2itMCmlk8/4qWHKcWRrjdhMPHZ DVrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=qT8iDHBtgV77fF8gHSSRJsweWuoLwMxssud1SQ+sMFw=; b=dZRM35Kql4k1q0dh/TSqR2rKAJBa8a5C0mE7y+nLvJ6p5LhtOa7dRimBH4ML36+vtz 87o1qGQLQrdZKswRZtqYF0KTb9fezawamvgyk9WX2SO+WRuI2OjdcZ6/HFh3uKrE0Xpq 5K4A8jTJYDBQZSVZCPOY4wqolF8kp2RtrUwqThIUcupBt3aZGPVJmZg2PCg08/XR5P+g GjgKbARQZL56uUb8CCRIHeBX8/FmGh1b//bF6GvK0uEoMkzfL+4/aLUpISG+s1mVgHLe 66yWh84DwSmNrG2To0YQ4Mf1uXESe+3ysNUy6ZJOLcTnqWXJLlO+EsWwxURYRrtQI1iQ GVrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=ekg1E450; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k19si17870996edx.68.2021.05.11.23.42.03; Tue, 11 May 2021 23:42:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=ekg1E450; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230188AbhELGkS (ORCPT + 99 others); Wed, 12 May 2021 02:40:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229626AbhELGkR (ORCPT ); Wed, 12 May 2021 02:40:17 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0726C061574 for ; Tue, 11 May 2021 23:39:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=qT8iDHBtgV77fF8gHSSRJsweWuoLwMxssud1SQ+sMFw=; b=ekg1E450CgRxJwrigDD4HIGXvy qTLJcWMI7uNPCzwaWsYYZF/KX0n2Euqn1nzZ8/r3VogDq44psgbEO5tjSxh25+ixKgYQqfeO1nHb8 hNsnEjGZyXAWFndfUAd/TDMgtXwovpIXfh1ahU9khrB8jQ/bQlEXYRkiQNMXWk41ULbwH1hjsBQUV X4a9KsTuYG/ix1dW2e7d+x9efrRhnwZd1yyzfTRSyXa+3BfvYk3DBa0FDiS849nDIE/JEdiCD0ctD 3Eg1wbBhKB1LxgX3bphe3vXT+rykAg0mfG5Qc5xG5C6lHZkAuoYgqn5sVobKMp2bSZ1Oi8K0fDshc 0WfcCPuQ==; Received: from hch by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lgiV2-0081QQ-2F; Wed, 12 May 2021 06:37:54 +0000 Date: Wed, 12 May 2021 07:37:40 +0100 From: Christoph Hellwig To: Jason Gunthorpe Cc: Jacob Pan , LKML , iommu@lists.linux-foundation.org, Joerg Roedel , Lu Baolu , Jean-Philippe Brucker , Christoph Hellwig , Yi Liu , Raj Ashok , "Tian, Kevin" , Dave Jiang , wangzhou1@hisilicon.com, zhangfei.gao@linaro.org, vkoul@kernel.org, David Woodhouse Subject: Re: [PATCH v4 1/2] iommu/sva: Tighten SVA bind API with explicit flags Message-ID: References: <1620653108-44901-1-git-send-email-jacob.jun.pan@linux.intel.com> <1620653108-44901-2-git-send-email-jacob.jun.pan@linux.intel.com> <20210510233749.GG1002214@nvidia.com> <20210510203145.086835cc@jacob-builder> <20210511114848.GK1002214@nvidia.com> <20210511091452.721e9a03@jacob-builder> <20210511163521.GN1002214@nvidia.com> <20210511110550.477a434f@jacob-builder> <20210511194726.GP1002214@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210511194726.GP1002214@nvidia.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 11, 2021 at 04:47:26PM -0300, Jason Gunthorpe wrote: > > Let me try to break down your concerns: > > 1. portability - driver uses DMA APIs can function w/ and w/o IOMMU. is > > that your concern? But PASID is intrinsically tied with IOMMU and if > > the drivers are using a generic sva-lib API, why they are not portable? > > SVA by its definition is to avoid map/unmap every time. > > Kernel explicitly does not support this programming model. All DMA is > explicit and the DMA API hides platform details like IOMMU and CPU > cache coherences. Just because x86 doesn't care about this doesn't > make any of it optional. Exactly. > If you want to do SVA PASID then it also must come with DMA APIs to > manage the CPU cache coherence that are all NOP's on x86. Yes. And we have plenty of precende where an IOMMU is in "bypass" mode to allow access to all memory and then uses the simple dma-direct case.