Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3521245pxf; Mon, 22 Mar 2021 08:18:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzONFbsMTTyEZm9qwdR+t0H3ilVoRvgR7GLDqq6hkSJVRPXj6fwqKRCriVLvaKveH1FXWm5 X-Received: by 2002:a17:907:6005:: with SMTP id fs5mr307414ejc.184.1616426331848; Mon, 22 Mar 2021 08:18:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616426331; cv=none; d=google.com; s=arc-20160816; b=UpCxw9t+7Y0OCXm8SvETfksOddmAg6KtqV7vzJZ7eFw0EsQrtI79tsBxTw5iwQej0M argfgjgmU1/vlSAe3PiMNbujaj37onIgJceD3k2PfRr7lukJMeGQovDKTQZpuqZZONhA pdxLyi7AAbW97cqVEGDxeRK1f2CUpTQ4cTQdoeYav2SjzKQraExJ38vX9vb6TdyvpoRz RWwIn0Tr+2rzjq9BofxLGkAmrg2xhhefr2FdSoEu+UZ2H1ATs9d7jN1raj6HDbgzukiT g6WuHGLxhp52nEFRp/ihuAXYlSn8LNVrE19Z1KYswh0M6Uq3A8Q67iIbo5QYZEjGQqi4 YdiA== 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=SrAKUzOaqBwovlqKQtlyoUcCMghh986HGolrQZ/Pulc=; b=c5jz0vSS8LC/MxpzMO8Al0sEdFLy7Gk+rLwdJK6IQQdj4Woj4IqyiHNXa4ov+M64KG 1LXZDtQZkcZN6AH80z5857Nk6wZSLuNz2Z+OFLZ4CL473Y4dJ7fVy8V2Jo6vzx3n2YVP pS0/pvAXa/L2WQBzUzuCC5snVHlWLpCRsovF7z5h1SOyKXQ4IIvC6oy5DXIvi2kZ/B82 7KQvjBONlvL5e/7mbR1q3D3dQpD2SjXu9PQ4qkZt8eTL7JhajfnPNvTogVuZu74M1hS2 Ey1ZavQT1ImR4Yr1u8i2OR2SMFg96RBM4lukdwKUm8dx1fV6NjDo0B0X+y3weG+vt4xS ypfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=H6iQmGiY; 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 bt14si10513095edb.466.2021.03.22.08.18.28; Mon, 22 Mar 2021 08:18:51 -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=H6iQmGiY; 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 S231800AbhCVPR3 (ORCPT + 99 others); Mon, 22 Mar 2021 11:17:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231744AbhCVPRM (ORCPT ); Mon, 22 Mar 2021 11:17:12 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D79A9C061574; Mon, 22 Mar 2021 08:17:11 -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=SrAKUzOaqBwovlqKQtlyoUcCMghh986HGolrQZ/Pulc=; b=H6iQmGiYxecjK0gBKShyAKS3yU 4Vr3uIormgfA/pwMm7kawjYoj8mP+ohuzLQFIrHPzgUnXlEOQ/WmlLcIi2vBngEgv0xrf+Mb9Rj7r o8wa1TB5Ebe9wiPHdsvR4MJhUQcCiPTKBM62CqP+eHW5ImMAviZQQ0TwKYKiWiwcofObdt4VUxKMp JWwYv7kLkalXcCh8uortelaHgQZcphXNz8NXsECL7exXVoStPI16T361vCNi4Vu4bUGi0HTBKfWIK MD+ZXNAdtWAkcLD8TPLcCVj8A3ry593S4WOdJkmixRvUkqDXd3eu6xhrSOytnshLR/fzUohXDNe96 0+LMQtPA==; Received: from hch by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lOMHw-008hV5-9d; Mon, 22 Mar 2021 15:16:25 +0000 Date: Mon, 22 Mar 2021 15:16:16 +0000 From: Christoph Hellwig To: Alex Williamson Cc: Christoph Hellwig , cohuck@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, jgg@nvidia.com, peterx@redhat.com Subject: Re: [PATCH v1 07/14] vfio: Add a device notifier interface Message-ID: <20210322151616.GA2072680@infradead.org> References: <161523878883.3480.12103845207889888280.stgit@gimli.home> <161524010999.3480.14282676267275402685.stgit@gimli.home> <20210310075639.GB662265@infradead.org> <20210319162540.0c5fe9dd@omen.home.shazbot.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210319162540.0c5fe9dd@omen.home.shazbot.org> 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 Fri, Mar 19, 2021 at 04:25:40PM -0600, Alex Williamson wrote: > I've been trying to figure out how, but I think not. A user can have > multiple devices, each with entirely separate IOMMU contexts. For each > device, the user can create an mmap of memory to that device and add it > to every other IOMMU context. That enables peer to peer DMA between > all the devices, across all the IOMMU contexts. But each individual > device has no direct reference to any IOMMU context other than its own. > A callback on the IOMMU can't reach those other contexts either, there's > no guarantee those other contexts are necessarily managed via the same > vfio IOMMU backend driver. A notifier is the best I can come up with, > please suggest if you have other ideas. Thanks, Indeed, reviewing the set again it seems like we need the notifier here.