Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp707372pxb; Thu, 21 Oct 2021 08:02:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxWSE0dU5nZrjpnufH7TP5OltuYwg9585oXutOvipHEMexwyDrK1cd3azUJvPVmu6/zcyjp X-Received: by 2002:aa7:d54e:: with SMTP id u14mr8356107edr.2.1634828523114; Thu, 21 Oct 2021 08:02:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634828523; cv=none; d=google.com; s=arc-20160816; b=uXm369J53/cnx5rjU0K+ZGrby2muwOVNqUeDvJLf+qAIMqHUeuAQZDqugR77UU5+ou 0f+V/LsczXrrXETQGd90iPZvhnVID1MfDfg3n3gyjcUA9cb1GW/i6JUnWLin9STDjcyU r07ydmIuxo4RVR9sKvKMlw3SY60tY17RpxrBHRoa0O7OIrosHQenrZDoYzh02jyVMQWA hkVrU19QsgR8xJ4woY4QvulsR9NGUclUicg3gD3bV7vNZJeUN+HCZmPoihEOqaJn/vei 4hGhqDLjC/dXkvCGI0RIJkRo818N7ux94/Y3AVqoxyJgXBWcTwvxn2fReX6TXHDNLStH hE5A== 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=9NBqHjMa3wMvruHtwVGUR1gd7leMzib5uaeU+3Io4Fg=; b=FxPrKhVgVZXCpkEkralAtVZeAsdRtOC1BaUNCSsUflmZpw0wIZM6YvdsnQFJorRvzg m1pKdgxcSFhjMSpd/9qQcOgekasGZKa09ZU3kELirUH53s8b0AGWt0FizizpmUXaXi7/ KZnjqmJpFmptep7d3YMgmYGj0hnAOblaN/RPoZ1cw13ie9Mheyv5LT+La2hxl+emR+BK S05ukLgpRIVI7OOYdVd/DF+x/4i+3trTk1d0X1wLMZ0ypGk8Zksk+/jv/7uCz5M0cCuk GlFB2xJBQBQHmbK/a5u4VJGfX/A1tIgmydJkHKY25OGQdOIheQfemNSs9ni9P1GD5o6t 2J3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qBP2L8NV; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z17si10334534edc.377.2021.10.21.08.01.38; Thu, 21 Oct 2021 08:02:03 -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=@linaro.org header.s=google header.b=qBP2L8NV; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231575AbhJUPAo (ORCPT + 99 others); Thu, 21 Oct 2021 11:00:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230280AbhJUPAn (ORCPT ); Thu, 21 Oct 2021 11:00:43 -0400 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E785BC0613B9 for ; Thu, 21 Oct 2021 07:58:26 -0700 (PDT) Received: by mail-wr1-x42a.google.com with SMTP id y3so1627720wrl.1 for ; Thu, 21 Oct 2021 07:58:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=9NBqHjMa3wMvruHtwVGUR1gd7leMzib5uaeU+3Io4Fg=; b=qBP2L8NVoLfZGeQzfQjTFTNz0gG7byHV4/NfKy7g3ACmXnfyTURs/kJuCENa0ErjIS 9gMeeYKQSF1EERRPA76Ma8B/Z6HgB6SfFqm9Il709BrqR/YoDXAldgU5CKMlgADTSnN2 +xWx7oJkoq0MVJEHZ5Q30hgftm1JS1Tc3a1bbSPvAJb5xXVPzI2AcsY9t8VjUaYhnSP6 TWAeS06C5u3UV5FCNmiy9Xh37uKHLLnkG2a0XPDHvr/phujaMvRMutXBnYx4hChmpAKu +6yYVvun+7Oh3nH135puLcVD82OOGl5Hh8iajWjPrmyw7VlXzrBoqR+P+P9nNKdBh9FR 6ezQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=9NBqHjMa3wMvruHtwVGUR1gd7leMzib5uaeU+3Io4Fg=; b=ikr4Hs4SwWv8APYmGUYEE354WEuEmiIZWhu2l0VdgaFwvk2svvCEAZAm2zwonbuHmV Oy13v7LZwknBYCloK/X4VadjYn3j0yxo3bDUtdic0XfVin32ouai5C+lvJAZCyVcI+rW tcgF8Y8YSb82D9Az7YeIlsVcZaAmB0rRjJ82NhATS8wfdk+5EzG445fe8+1FVklcG2QJ lBsPBscE/a4iSrLLEBUvGRmsEtI605D1mrKiNy/QfXFopiZaavKU994sRkGWOF0CAzkg hFBcdb7HuYahi4U+mX1oLCmK7lQnt//h24DVAYxbtfjFRYZo60wbaDyaFXP90mg+ukHg RvKQ== X-Gm-Message-State: AOAM533AbgngUX8vkijgw3LLReL7TQ+qcTl/npe2/yzv3tmc4YSA4BAZ zVBiv7kRPQpnqJOv/EY6TEuF2g== X-Received: by 2002:a5d:55cd:: with SMTP id i13mr8018641wrw.410.1634828305512; Thu, 21 Oct 2021 07:58:25 -0700 (PDT) Received: from myrica (cpc92880-cmbg19-2-0-cust679.5-4.cable.virginm.net. [82.27.106.168]) by smtp.gmail.com with ESMTPSA id d24sm4977061wmb.35.2021.10.21.07.58.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Oct 2021 07:58:24 -0700 (PDT) Date: Thu, 21 Oct 2021 15:58:02 +0100 From: Jean-Philippe Brucker To: "Tian, Kevin" Cc: Jason Gunthorpe , 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" , "baolu.lu@linux.intel.com" , "david@gibson.dropbear.id.au" , "nicolinc@nvidia.com" Subject: Re: [RFC 10/20] iommu/iommufd: Add IOMMU_DEVICE_GET_INFO Message-ID: References: <20210922234954.GB964074@nvidia.com> <20210923114219.GG964074@nvidia.com> <20210930222355.GH964074@nvidia.com> <20211014154259.GT2744544@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 21, 2021 at 02:26:00AM +0000, Tian, Kevin wrote: > > I'll leave it to Jean to confirm. If only coherent DMA can be used in > > the guest on other platforms, suppose VFIO should not blindly set > > IOMMU_CACHE and in concept it should deny assigning a non-coherent > > device since no co-ordination with guest exists today. > > Jean, what's your opinion? Yes a sanity check to prevent assigning non-coherent devices would be good, though I'm not particularly worried about non-coherent devices. PCIe on Arm should be coherent (according to the Base System Architecture). So vfio-pci devices should be coherent, but vfio-platform and mdev are case-by-case (hopefully all coherent since it concerns newer platforms). More worrying, I thought we disabled No-Snoop for VFIO but I was wrong, it's left enabled. On Arm I don't think userspace can perform the right cache maintenance operations to maintain coherency with a device that issues No-Snoop writes. Userspace can issue clean+invalidate but not invalidate alone, so there is no equivalent to arch_sync_dma_for_cpu(). I think the worse that can happen is the device owner shooting itself in the foot by using No-Snoop, but would it hurt to disable it? Thanks, Jean