Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2292018ybc; Wed, 20 Nov 2019 11:48:38 -0800 (PST) X-Google-Smtp-Source: APXvYqwgRWjVEf2NZqdPnBxzcAO0nDndjex2xT7/4xtx1KKgzd53+G+sAEiiOkkrIHfmJfBoSlPO X-Received: by 2002:adf:81e5:: with SMTP id 92mr5756927wra.41.1574279317863; Wed, 20 Nov 2019 11:48:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574279317; cv=none; d=google.com; s=arc-20160816; b=rd/YYupU2vAz9GpBwWz2BdFSg6tPbEW7ljyVGQmSUxg+hAsMbHsZtnwIUrTGxslxDG nMODZWgt2r1XViUbvur3afnOi0BEfRAQuMuonS/mglm8h8LHP39Bf00GCMunGleBRePM aHXXC5BhXmn1P6STz2Fq8ka1voBuYSluaNWfOb42a74LJ4nCAUcJXxesaxVsyK5zAe/l eIS8oApFR5YJT07I6QI3Yh4fSt0gm/RKtwXJHG7d3YVmhv9/Ydb4l0Poga4VqN/8TCpn i12tXGoV6+baaUceWvDC1GCYCj4th/xBG2R75LYT0Y8fNpxb+dqdwvGP+ch+iKD2rk4j POkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=JWQRhlesp4rx0iZXH5RDESHA9Y4raAckzn7wyOlg0PU=; b=p3z5Stv3FqLlv6yM6FV6RdGEpmkMIVMcBqIZLpw/lTgaQJs+EupCo7zR7TQptphoFX ZRyf6tCwgH6D/cflYni+qItz1ZZ5s3g0LaZw10SV5LQylyLBhSDUsO1YZeskiiOiuAUj mREdWAe/vPQZ5XGLmU60IHffoKuzabYZesxkAmDX40NuRKzU9OmaWZP0WSCeIL/KHCAO InqkRAw0cWp5AE6p34VdD8iRH6DQAhR9OplSv60uCEoDKP925JpbAGkXcbz/YZcBTJyS QrqNN3Y2iSffGTD2l76M/cWPQBEvIdTMd5iDEP6m76hyHoFRQvJ4KPvUJYQ9UhagRqOD 2Zeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@networkplumber-org.20150623.gappssmtp.com header.s=20150623 header.b=TTS7k6dF; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f22si373985eds.54.2019.11.20.11.48.14; Wed, 20 Nov 2019 11:48:37 -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=@networkplumber-org.20150623.gappssmtp.com header.s=20150623 header.b=TTS7k6dF; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727724AbfKTTqY (ORCPT + 99 others); Wed, 20 Nov 2019 14:46:24 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:40908 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727702AbfKTTqX (ORCPT ); Wed, 20 Nov 2019 14:46:23 -0500 Received: by mail-pl1-f195.google.com with SMTP id f9so263039plr.7 for ; Wed, 20 Nov 2019 11:46:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JWQRhlesp4rx0iZXH5RDESHA9Y4raAckzn7wyOlg0PU=; b=TTS7k6dF12So4K2AiukGmARNAC4VPjnprfAYa19cmr3RY5ZetQcSPvqI9EJNJ3RSyC /BYijGBylA+7sWQwS/uv1yxPc02Jotnzc8QQYb8jpfRI3R12JElsHUFRiIy/S09TI3G2 5wwjzNXqVumFvmybfxosuM3JdjpquE4qzekkvPGqF3Rq9+TmPBcgquR2cbv85e0XtKRv Df4+IvP+gfZzRbxsVk6VRDoQvI5gucc6jdm7p0gVYn9BAkNQmx84fxdFnmo7+njK9L1F 1mmzZSHKcHZLq9iuG4fWT3TOdCM8a+e48EgWESaYYOen18+Z810kNGxk0FOi0TfIS4FN 0WSA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=JWQRhlesp4rx0iZXH5RDESHA9Y4raAckzn7wyOlg0PU=; b=TkYdzoP2RF1IgRtcSvASBOXT/gCxFaWY2zEKez1kiXw91h3Pjz91YFHIhrcJqzr+zv t82zD+aPa2yU6vYinIzqFcbDjqUn4iJP09PzPW8RsikVJabsgJB9b33EjuRsVPybYark /veq+ZgeXM9NJnSFyRbwsBHSjdGDWbTZvL9SXmHL4zeGp6iUKRvGr0PKV0CH4+thrGw+ b3ZYOqhry3PPb9ZNz+7OUdEDCem+oVKi4JRjQp+s3BzbRxiSkG+9opyTSvVdUuvYy9ed aaISSz4j029+BzkBhUGHUbC0KYcWMKR12lwCIMA7s7TEDXkE2k3SMi91Ck1D0o7g4tHK BaZQ== X-Gm-Message-State: APjAAAVqZ1ze75JkG6Owf4OBTRk9OuumAW8VXsoWd++VSqi8RRFv5QqN MvbS2F6jjUNVHBz0aXDYueHvcw== X-Received: by 2002:a17:90a:98d:: with SMTP id 13mr6167964pjo.98.1574279182414; Wed, 20 Nov 2019 11:46:22 -0800 (PST) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id o23sm26553pgj.90.2019.11.20.11.46.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Nov 2019 11:46:22 -0800 (PST) Date: Wed, 20 Nov 2019 11:46:11 -0800 From: Stephen Hemminger To: Alex Williamson Cc: , , "KY Srinivasan" , "Haiyang Zhang" , "Stephen Hemminger" , , , , , , , , "Michael Kelley" , "Tianyu Lan" , , , , "vkuznets" Subject: Re: [PATCH] VFIO/VMBUS: Add VFIO VMBUS driver support Message-ID: <20191120114611.4721a7e9@hermes.lan> In-Reply-To: <20191120120715.0cecf5ea@x1.home> References: <20191111084507.9286-1-Tianyu.Lan@microsoft.com> <20191119165620.0f42e5ba@x1.home> <20191120103503.5f7bd7c4@hermes.lan> <20191120120715.0cecf5ea@x1.home> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 20 Nov 2019 12:07:15 -0700 Alex Williamson wrote: > On Wed, 20 Nov 2019 10:35:03 -0800 > Stephen Hemminger wrote: > > > On Tue, 19 Nov 2019 15:56:20 -0800 > > "Alex Williamson" wrote: > > > > > On Mon, 11 Nov 2019 16:45:07 +0800 > > > lantianyu1986@gmail.com wrote: > > > > > > > From: Tianyu Lan > > > > > > > > This patch is to add VFIO VMBUS driver support in order to expose > > > > VMBUS devices to user space drivers(Reference Hyper-V UIO driver). > > > > DPDK now has netvsc PMD driver support and it may get VMBUS resources > > > > via VFIO interface with new driver support. > > > > > > > > So far, Hyper-V doesn't provide virtual IOMMU support and so this > > > > driver needs to be used with VFIO noiommu mode. > > > > > > Let's be clear here, vfio no-iommu mode taints the kernel and was a > > > compromise that we can re-use vfio-pci in its entirety, so it had a > > > high code reuse value for minimal code and maintenance investment. It > > > was certainly not intended to provoke new drivers that rely on this mode > > > of operation. In fact, no-iommu should be discouraged as it provides > > > absolutely no isolation. I'd therefore ask, why should this be in the > > > kernel versus any other unsupportable out of tree driver? It appears > > > almost entirely self contained. Thanks, > > > > > > Alex > > > > The current VMBUS access from userspace is from uio_hv_generic > > there is (and will not be) any out of tree driver for this. > > I'm talking about the driver proposed here. It can only be used in a > mode that taints the kernel that its running on, so why would we sign > up to support 400 lines of code that has no safe way to use it? > > > The new driver from Tianyu is to make VMBUS behave like PCI. > > This simplifies the code for DPDK and other usermode device drivers > > because it can use the same API's for VMBus as is done for PCI. > > But this doesn't re-use the vfio-pci API at all, it explicitly defines > a new vfio-vmbus API over the vfio interfaces. So a user mode driver > might be able to reuse some vfio support, but I don't see how this has > anything to do with PCI. > > > Unfortunately, since Hyper-V does not support virtual IOMMU yet, > > the only usage modle is with no-iommu taint. > > Which is what makes it unsupportable and prompts the question why it > should be included in the mainline kernel as it introduces a > maintenance burden and normalizes a usage model that's unsafe. Thanks, Many existing userspace drivers are unsafe: - out of tree DPDK igb_uio is unsafe. - VFIO with noiommu is unsafe. - hv_uio_generic is unsafe. This new driver is not any better or worse. This sounds like a complete repeat of the discussion that occurred before introducing VFIO noiommu mode. Shouldn't vmbus vfio taint the kernel in the same way as vfio noiommu does?