Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp886634pxb; Thu, 30 Sep 2021 21:03:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyaRxgYJDYr9DruYXUc+be1P+hN2eDv4+yIb/Ae/Ll4xx3q0ChtWIjaYDE0KS05sb4Z5yRM X-Received: by 2002:a63:a74a:: with SMTP id w10mr7768851pgo.213.1633061028682; Thu, 30 Sep 2021 21:03:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633061028; cv=none; d=google.com; s=arc-20160816; b=amgTi2y7KamVEMDGQ0TrotV4GEp29lwZGy3GlOoQEJvdpg4MbH/sscPuCoaVTFZJ60 jq8bQP/tZaTJxOYVLDmlB4Xg3QJ4RFO1KMmN2eydYUMp0eaudvin3o3nY1vWUzIeosZz GfDKPvUjDqtTFrp6qT6/o9ZVVsTAeCi4BbtL240CB7zK51uyAEnWRApcR5qgCP6p8QUJ 6kn4Mt62oDf6bUTTZZptWiysZeXYB1mdjEC7DmB+umKIO1DLa0T/Sb9hW4RYnVoM2ekn 6hyLa88rTLGZlV27Ux5cpNoidR1n/QSllVQczgucrs27OFXHH84AADKOu3p7LzGShPqD T8nQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=FDBmnP6huFB1320/Mr1gbDz1ttZFe8dQGSHph/D/d60=; b=Cdq5in+DJGO7/oA/fKndBG+dZC7YDEsLTFZaCmRUUNqbPKTA3RiswpokSrXQ9jEnwW k6zXazTAT2b/6mbvGpiJH9IaUx8smlV6949FjVwJM5Ashrk+UlMN2okfA0szcalzAwtE eAGgX7zhJ+WYnOaxxdOsuhLlqpTiDnVUcHzCuvlqniwWpksAQi/XkSZD9/ais/5+Uit9 eyr3rpR1HO+s3uTIuelvYA6VzcwXfulfYjXpLu+Wv/YE07Ijfe/F4K38+GKfLcFvZSY0 7GT563a+XftsKsY75hRrUYJougu7yLrVljBEFDAOpzz0dWRft9nqyeZRumMZ1s1w2fWQ jJCg== ARC-Authentication-Results: i=1; mx.google.com; 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 v12si6201056pjs.87.2021.09.30.21.03.25; Thu, 30 Sep 2021 21:03:48 -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; 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 S1351603AbhJAD0X (ORCPT + 99 others); Thu, 30 Sep 2021 23:26:23 -0400 Received: from verein.lst.de ([213.95.11.211]:33465 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230283AbhJAD0W (ORCPT ); Thu, 30 Sep 2021 23:26:22 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id E0CAA67373; Fri, 1 Oct 2021 05:24:34 +0200 (CEST) Date: Fri, 1 Oct 2021 05:24:34 +0200 From: "hch@lst.de" To: Lu Baolu Cc: "Tian, Kevin" , Jason Gunthorpe , "Lu, Baolu" , Jean-Philippe Brucker , Alex Williamson , "Liu, Yi L" , "hch@lst.de" , "jasowang@redhat.com" , "joro@8bytes.org" , "parav@mellanox.com" , "lkml@metux.net" , "pbonzini@redhat.com" , "lushenming@huawei.com" , "eric.auger@redhat.com" , "corbet@lwn.net" , "Raj, Ashok" , "yi.l.liu@linux.intel.com" , "Tian, Jun J" , "Wu, Hao" , "Jiang, Dave" , "jacob.jun.pan@linux.intel.com" , "kwankhede@nvidia.com" , "robin.murphy@arm.com" , "kvm@vger.kernel.org" , "iommu@lists.linux-foundation.org" , "dwmw2@infradead.org" , "linux-kernel@vger.kernel.org" , "david@gibson.dropbear.id.au" , "nicolinc@nvidia.com" Subject: Re: [RFC 10/20] iommu/iommufd: Add IOMMU_DEVICE_GET_INFO Message-ID: <20211001032434.GB16450@lst.de> References: <20210919063848.1476776-11-yi.l.liu@intel.com> <20210922152407.1bfa6ff7.alex.williamson@redhat.com> <20210922234954.GB964074@nvidia.com> <20210923112716.GE964074@nvidia.com> <20210923122220.GL964074@nvidia.com> <9a04c421-4a25-f1de-a896-321026b3f0ce@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9a04c421-4a25-f1de-a896-321026b3f0ce@linux.intel.com> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 30, 2021 at 09:43:58PM +0800, Lu Baolu wrote: > Here, we are discussing arch_sync_dma_for_cpu() and > arch_sync_dma_for_device(). The x86 arch has clflush to sync dma buffer > for device, but I can't see any instruction to sync dma buffer for cpu > if the device is not cache coherent. Is that the reason why x86 can't > have an implementation for arch_sync_dma_for_cpu(), hence all devices > are marked coherent? arch_sync_dma_for_cpu and arch_sync_dma_for_device are only used if the device is marked non-coherent, that is if Linux knows the device can't be part of the cache coherency protocol. There are no known x86 systems with entirely not cache coherent devices so these helpers won't be useful as-is.