Received: by 10.192.165.148 with SMTP id m20csp315708imm; Fri, 20 Apr 2018 07:14:54 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+Oxsk120eiw7PyLbkA79Y/XkeHenY13NnOKM295apwYVy0Kmmnd6Iw0Nq3Q/jZ7eZ7hQx4 X-Received: by 2002:a17:902:8505:: with SMTP id bj5-v6mr10208169plb.231.1524233694602; Fri, 20 Apr 2018 07:14:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524233694; cv=none; d=google.com; s=arc-20160816; b=w700MYS+r9LX8UY/ixDwxwTfmo5eiXSyAxuCeVGKWxF3A9OTaajKjSVknk2NCGE/QA +Bx9nVorfne/qnH0s3iPOkUl2ZrFpUY6Ic0tzhGHOcGjbu4K9hFZMtkP7PnpFwztk69G uKY7/x0qHCnFEygm1A8HQrGmJx8gvYrt5Suwlh837bTXjStljkupKFUzeKVcTxR+hfqn iBKJ39ctj7bn/mHYy9Ts09AKzchpW+tLlDlWecnM5Hp4xPCAGn2XqaWajW5Me/6CFRiU QhDBp1bSJqGr/4ZTj0KMCW+zCmH9XJq54CKh5TlFj7+aQxTd6PMgwyY5MgL2aM9aHDZF NPew== 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 :arc-authentication-results; bh=tQGa37mLq6SlGkfagzDas5d86VHOg4a291ifFgkcDVs=; b=VK/Q6ZAafnSBosFbYqLANDqFyreWgtaPDXGqnPRbutoJ7oJ0QqH5WaD4s0u476ipL2 kXivUWnwA04QkT5QznylK/AwecLXCrfFAXQoLsSSTcEfF4butoamXEZtDVYapOUIM6+u lyG/4PgCoB7f0IuMYv9h/iz6Mdgbgbx2yYX1bg/7JHUfUqqnzF9vTIZAJMqbaji0e2Kx h/apIl5S5FID+tDt6k5KBQEvfkqwbVfdQUiFSYJ3O4iRTpro+4o7yJaztAp/xG9mc5QN DiZTlI7HZVx5N2OuVPWs5CHBMTagWRaZbI1po1dxLLsjaQg/Lsrrd7yaY4ONLC+PolAK H0IA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (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 x12-v6si5611064pll.207.2018.04.20.07.14.40; Fri, 20 Apr 2018 07:14:54 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755176AbeDTOMa (ORCPT + 99 others); Fri, 20 Apr 2018 10:12:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:31256 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754902AbeDTOM3 (ORCPT ); Fri, 20 Apr 2018 10:12:29 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E3FD23004404; Fri, 20 Apr 2018 14:12:28 +0000 (UTC) Received: from redhat.com (ovpn-126-37.rdu2.redhat.com [10.10.126.37]) by smtp.corp.redhat.com (Postfix) with SMTP id 303938545E; Fri, 20 Apr 2018 14:12:26 +0000 (UTC) Date: Fri, 20 Apr 2018 17:12:21 +0300 From: "Michael S. Tsirkin" To: Jason Wang Cc: Tiwei Bie , alex.williamson@redhat.com, ddutile@redhat.com, alexander.h.duyck@intel.com, virtio-dev@lists.oasis-open.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, dan.daly@intel.com, cunming.liang@intel.com, zhihong.wang@intel.com, jianfeng.tan@intel.com, xiao.w.wang@intel.com Subject: Re: [RFC] vhost: introduce mdev based hardware vhost backend Message-ID: <20180420165302-mutt-send-email-mst@kernel.org> References: <20180402152330.4158-1-tiwei.bie@intel.com> <622f4bd7-1249-5545-dc5a-5a92b64f5c26@redhat.com> <20180410045723.rftsb7l4l3ip2ioi@debian> <30a63fff-7599-640a-361f-a27e5783012a@redhat.com> <20180419212911-mutt-send-email-mst@kernel.org> <060e2b5f-2e93-c53f-387b-5baaa33e87cd@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <060e2b5f-2e93-c53f-387b-5baaa33e87cd@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Fri, 20 Apr 2018 14:12:29 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 20, 2018 at 11:52:47AM +0800, Jason Wang wrote: > > The biggest issue is that you let userspace poke at the > > device which is also allowed by the IOMMU to poke at > > kernel memory (needed for kernel driver to work). > > I don't quite get. The userspace driver could be built on top of VFIO for > sure. So kernel memory were perfectly isolated in this case. VFIO does what it can but it mostly just has the IOMMU to play with. So don't overestimate what it can do - it assumes a high level of spec compliance for protections to work. For example, ATS is enabled by default if device has it, and that treats translated requests are trusted. FLS is assumed to reset the device for when VFIO is unbound from the device. etc. > > > > Yes, maybe if device is not buggy it's all fine, but > > it's better if we do not have to trust the device > > otherwise the security picture becomes more murky. > > > > I suggested attaching a PASID to (some) queues - see my old post "using > > PASIDs to enable a safe variant of direct ring access". > > > > Then using IOMMU with VFIO to limit access through queue to corrent > > ranges of memory. > > Well userspace driver could benefit from this too. And we can even go > further by using nested IO page tables to share IOVA address space between > devices and a VM. > > Thanks Yes I suggested this separately. -- MST