Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3004754ybl; Mon, 20 Jan 2020 13:51:18 -0800 (PST) X-Google-Smtp-Source: APXvYqzqe0MaPn4sqmov13M/J/HIpnRhX1/WmHATLDGX6oBO9hLzUCx+EyuWgatlRERyMFKp1Tn3 X-Received: by 2002:a05:6808:8f5:: with SMTP id d21mr731707oic.58.1579557078564; Mon, 20 Jan 2020 13:51:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579557078; cv=none; d=google.com; s=arc-20160816; b=jb1gkc4uZ/qAMcLkUuyeQs143oUVqoSPf5tI08M0IQlViSvjUqaBgT+bviqwZR8HLc a1CaTSuA2GZXeTojEXgLtiNrMChuF1ab47QLQarmHqJo32GKFLm9s7Ach5oSk6L5jsfz AcYA/nAJgCNN29z3wC5zoThhgsaPao5ZOE/MYzSic/WtCpSZ5+pLYQAuuX08ss9xML4h Ld/O8fVbyRZZi6la7E0xz2l/autFdN60xBv9DiCYG0oLFi79wBcZ9xrKwwPqOJOK4Ai4 36ipHljOQKVGLIfEF/7OlaRAeB5EVLxUd/Dy/ElhsB3ETzrHmf00GTFZf9q/ZXMQgczi f25g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=7XraG6j1N/y3xLCXP92Th/VKfxmhRZrdg4uwGLI/Vm4=; b=0gMw87ViBUKwPGotRGjYaB2cfxdxjptmu4wAtLLdjFU78gWXRqU7UcgVVht7yfseJO 8U+LWOyUpAcfxPaELedOD0bIjU/k/fQaxd7A7IgiAH/DpvbE8Sdg2ry0Gds/cuObL29X OBEVRT8JcO9jH+jAmkcB4VMkJRUGJh7YHQZhs0UmLpYdkLPNZOgUgkOzEcgkqJGFD6ia vmP1+xWpLYd0p/M+U09C8ZMUrBjS5cPFn/NTALvaU2ljHrOmGYjvpciPOC9nmWx1XNfj JOEBp1eQ04iBOaBfJnWw9p5bF2b0J0Gaz3Qk2sqLqevHlxbG77GSvbYRKTnyRjcuu4Lo P/EA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="b/oGc94I"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h9si19988503otb.49.2020.01.20.13.51.06; Mon, 20 Jan 2020 13:51:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="b/oGc94I"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728139AbgATVtI (ORCPT + 99 others); Mon, 20 Jan 2020 16:49:08 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:32880 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727372AbgATVtI (ORCPT ); Mon, 20 Jan 2020 16:49:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579556947; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=7XraG6j1N/y3xLCXP92Th/VKfxmhRZrdg4uwGLI/Vm4=; b=b/oGc94Ifz3dnXu4d137Zl7ENNiYvuU4emeQUlY3tMmRediIJqph43VyGgpQheQ7O2WUve 2+BIvmKqb1SMDRfyLPEVzUmgC12oUxdqkKx0/SCyLTRKbNNcP4LI9pabEQuZ0UScWdrO+b 20jI9Fa3fINNxj5I53n2Y+isZpXdVqY= Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-375-VSGUkzxpMsu-4xC-fdLuig-1; Mon, 20 Jan 2020 16:49:06 -0500 X-MC-Unique: VSGUkzxpMsu-4xC-fdLuig-1 Received: by mail-qt1-f197.google.com with SMTP id c8so624547qte.22 for ; Mon, 20 Jan 2020 13:49:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=7XraG6j1N/y3xLCXP92Th/VKfxmhRZrdg4uwGLI/Vm4=; b=GLx6P0Bpvynf+Elg1Oq8IBZMaal2tcarMEsVwLFwObCBhmIGxC4Q1tBPW53XGQzcyH OfyRG4IRSzPPb1Qr0rzOYZCXZeKIhksImZ0K9etEVu1oSTLcKmxLYhAjc7/CEDCpq4xP bAjNRZRltJeKfzkoBoi+9MVz5L+BEFoQWV3Ap9AtQO6ghzqdTCAyD2CB7UI8VRpsybx8 cyz0ZOgS1kHrWMTBJEi99N+wKm19IU16czPhdbiTbB8HohWW2p5WBpbt+y7+xlp83TSH ObuT/WKJyGOsn0SfGs/lNlzs9RWcyoSQ7zPOs5H0YRJ1xvrERlb+igxBCS9oYPnw+yon jCnw== X-Gm-Message-State: APjAAAXpzzewv++H5V2MLmTad/NRPPiGQhXZZ2MjoEnkqpbDtYjXDtKu NEkskyDkt58sqB8EnID/Bh9VXT2lbx1rNSJxKvysO+yys8YhmcuqtAuyc8GLiOT9aoE8U4/GFyp j81sYo3d5pPpEkit9XkEIhMI8 X-Received: by 2002:ad4:478b:: with SMTP id z11mr1807806qvy.185.1579556945805; Mon, 20 Jan 2020 13:49:05 -0800 (PST) X-Received: by 2002:ad4:478b:: with SMTP id z11mr1807796qvy.185.1579556945609; Mon, 20 Jan 2020 13:49:05 -0800 (PST) Received: from redhat.com (bzq-79-179-85-180.red.bezeqint.net. [79.179.85.180]) by smtp.gmail.com with ESMTPSA id g18sm18570113qtc.83.2020.01.20.13.48.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jan 2020 13:49:04 -0800 (PST) Date: Mon, 20 Jan 2020 16:48:55 -0500 From: "Michael S. Tsirkin" To: Jason Gunthorpe Cc: Jason Wang , Shahaf Shuler , Rob Miller , "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" , "virtualization@lists.linux-foundation.org" , Netdev , "Bie, Tiwei" , "maxime.coquelin@redhat.com" , "Liang, Cunming" , "Wang, Zhihong" , "Wang, Xiao W" , "haotian.wang@sifive.com" , "Zhu, Lingshan" , "eperezma@redhat.com" , "lulu@redhat.com" , Parav Pandit , "Tian, Kevin" , "stefanha@redhat.com" , "rdunlap@infradead.org" , "hch@infradead.org" , Ariel Adam , "jakub.kicinski@netronome.com" , Jiri Pirko , "hanand@xilinx.com" , "mhabets@solarflare.com" Subject: Re: [PATCH 3/5] vDPA: introduce vDPA bus Message-ID: <20200120164756-mutt-send-email-mst@kernel.org> References: <20200116124231.20253-1-jasowang@redhat.com> <20200116124231.20253-4-jasowang@redhat.com> <20200117070324-mutt-send-email-mst@kernel.org> <239b042c-2d9e-0eec-a1ef-b03b7e2c5419@redhat.com> <20200120174933.GB3891@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200120174933.GB3891@mellanox.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 20, 2020 at 05:49:39PM +0000, Jason Gunthorpe wrote: > On Mon, Jan 20, 2020 at 04:43:53PM +0800, Jason Wang wrote: > > This is similar to the design of platform IOMMU part of vhost-vdpa. We > > decide to send diffs to platform IOMMU there. If it's ok to do that in > > driver, we can replace set_map with incremental API like map()/unmap(). > > > > Then driver need to maintain rbtree itself. > > I think we really need to see two modes, one where there is a fixed > translation without dynamic vIOMMU driven changes and one that > supports vIOMMU. > > There are different optimization goals in the drivers for these two > configurations. > > > > If the first one, then I think memory hotplug is a heavy flow > > > regardless. Do you think the extra cycles for the tree traverse > > > will be visible in any way? > > > > I think if the driver can pause the DMA during the time for setting up new > > mapping, it should be fine. > > This is very tricky for any driver if the mapping change hits the > virtio rings. :( > > Even a IOMMU using driver is going to have problems with that.. > > Jason I think for starters we can assume this doesn't happen, so any change doesn't affect any buffers in use. Certainly true e.g. for memory hotplug. -- MST