Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1426816pxb; Mon, 11 Oct 2021 05:54:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxOJtR6qeGSTW9dOAFcALxyOxOOdzHA6n81fUEI27az0Ge94TKIYcHDaMUMj5+ait3pwSSq X-Received: by 2002:a17:907:7804:: with SMTP id la4mr24612385ejc.359.1633956862055; Mon, 11 Oct 2021 05:54:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633956862; cv=none; d=google.com; s=arc-20160816; b=YtROMk32IWnn7uyTz4hyvD9GHe5Q6GKAeVEigPGXu7iKw7J2sZZT3U8+H8MH5jYOXw DxiplEcy9fI5tntO4Mc2+D1UWJiMrxuqQmjIVHzu1LNOtD/xSR94QIDofRiU4pKLhIGX mPLN2NnH1hxo6fgoyCxMyCc2axtFAT5sjF1BDXdhfXfuqiTsgYNK7DfAouSwO0nXooEC +YtLcCKvGG08xs17+KguzZdL+4hg5mR0RARr7Bal7bv5VIIHlulK78JzD4Se7MBBSygq OnfuAM18QNzqrNyQEa7Wl3wtffW9kib9PC9D86n5oO2/+sk1d6yEhgLzhsxdmtmcMz4t cBUA== 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=sk2vwHpDMapSB20kMOT3PpeVWQ3nV2u+hdesFvlhlXY=; b=LTkotcBBRczH5mjJpz0KYnduWQdYFWi6N0ecgYZpIhvUE50XvMw7EyJdbJPALGXjiG w1b3WUt6sUn9/XertcxTbAHaeWhoo8f4bOHfYKsnkH0dex6fTEOdkBfdwowVcbHluj7F OOXeN6j4TaxVyzQfyEuWlLJqYe3i9t5Gpo0CABE4crrDOYrtzYY1wSYiLUKcPmgmzSwV 28V/I457pTF2+x31tYB/M+niIRKlu3dKcgdlfj40q6WpkgcBbzi7u9N6qNNslUapoIy7 UbtCHrHsvkOIqATl84AXWbRBV9YUCWMmnuDMgfXSx513xHkIBOrd8Q85D9XNc8UZD0/L IyWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sQAx9Y55; 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 a28si10728346edb.26.2021.10.11.05.53.58; Mon, 11 Oct 2021 05:54:22 -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=sQAx9Y55; 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 S235313AbhJKIwb (ORCPT + 99 others); Mon, 11 Oct 2021 04:52:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235301AbhJKIwV (ORCPT ); Mon, 11 Oct 2021 04:52:21 -0400 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5DC3C06161C for ; Mon, 11 Oct 2021 01:50:21 -0700 (PDT) Received: by mail-wr1-x42f.google.com with SMTP id e3so20073694wrc.11 for ; Mon, 11 Oct 2021 01:50:21 -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=sk2vwHpDMapSB20kMOT3PpeVWQ3nV2u+hdesFvlhlXY=; b=sQAx9Y55PmndkkUA9JgbLSEHf3wecXknr9PmN8XlAGjxLyHPxu+BHmo1eXm9nYNm8H EhgZTCAikbV4yKa5OEEV9/sNqub8qLpMgx07yHaMbB1MwZSFwO7vMTjTBIbYDcJRTC4D uHh5ZHWqw7gnMN9popQqddpv4yE+SKKA+mjSlefLb2ZOC25Agj+2S+SoJqdENxlkELTN js52PoywEeVWqdQz836ClJ6+Q6wdubCG8sQYQYCJYXPD80YePUXmkgJAvArP0gEQaa5o flZ8DHcxIkiQVesPqVbKEaWwo480lb2JwDOSVFwNfhTqQpQL6qtj+2PypAO0EtgGDBWo ivPw== 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=sk2vwHpDMapSB20kMOT3PpeVWQ3nV2u+hdesFvlhlXY=; b=pYIc1GFY0G5EOGfmgH6L4CxKuqYybYs8G3RYzRwXN27CuCkxyRZBt9y8L+cN+J6Lom 1HoTLoOZcpjyjxqmJ6qBJEKCeMjzhmcRzOPm5+kS3znMbtu2GnmK0yxhyICgJrYif0Jx bpm4WTJePxOWx56ZRs4Jz8hkzjJwnFoVLDIMm9eAP8w7unKBcgz5Y4m4yd0qgbIUVkot hmT0MS8UqUcmbXhJW9oCHhxUW3i8j+J8hbSnIvdvOvSa1tf5SaOLOqqjretx3kd/Sl6M PzanaxWLvLsdGf9d+fqggvgEE8f2r/A+MQtfRYAKVk/n9+2SZZD63YjUMpjhAcpV7XoT gQqQ== X-Gm-Message-State: AOAM533XDzO9pBiczP5Dr95W07iOj2eDh1E85Kfp3AtLV6dAX5vexDMC 6+PW9MUm33dutlNJGgs7smUo+w== X-Received: by 2002:a05:600c:2109:: with SMTP id u9mr13026461wml.68.1633942220114; Mon, 11 Oct 2021 01:50:20 -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 g188sm7226525wmg.46.2021.10.11.01.50.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Oct 2021 01:50:19 -0700 (PDT) Date: Mon, 11 Oct 2021 09:49:57 +0100 From: Jean-Philippe Brucker To: David Gibson Cc: Jason Gunthorpe , Liu Yi L , alex.williamson@redhat.com, hch@lst.de, jasowang@redhat.com, joro@8bytes.org, kevin.tian@intel.com, parav@mellanox.com, lkml@metux.net, pbonzini@redhat.com, lushenming@huawei.com, eric.auger@redhat.com, corbet@lwn.net, ashok.raj@intel.com, yi.l.liu@linux.intel.com, jun.j.tian@intel.com, hao.wu@intel.com, dave.jiang@intel.com, 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, nicolinc@nvidia.com Subject: Re: [RFC 11/20] iommu/iommufd: Add IOMMU_IOASID_ALLOC/FREE Message-ID: References: <20210919063848.1476776-1-yi.l.liu@intel.com> <20210919063848.1476776-12-yi.l.liu@intel.com> <20210921174438.GW327412@nvidia.com> <20211001122225.GK964074@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 Mon, Oct 11, 2021 at 05:02:01PM +1100, David Gibson wrote: > qemu wants to emulate a PAPR vIOMMU, so it says (via interfaces yet to > be determined) that it needs an IOAS where things can be mapped in the > range 0..2GiB (for the 32-bit window) and 2^59..2^59+1TiB (for the > 64-bit window). > > Ideally the host /dev/iommu will say "ok!", since both those ranges > are within the 0..2^60 translated range of the host IOMMU, and don't > touch the IO hole. When the guest calls the IO mapping hypercalls, > qemu translates those into DMA_MAP operations, and since they're all > within the previously verified windows, they should work fine. Seems like we don't need the negotiation part? The host kernel communicates available IOVA ranges to userspace including holes (patch 17), and userspace can check that the ranges it needs are within the IOVA space boundaries. That part is necessary for DPDK as well since it needs to know about holes in the IOVA space where DMA wouldn't work as expected (MSI doorbells for example). And there already is a negotiation happening, when the host kernel rejects MAP ioctl outside the advertised area. Thanks, Jean