From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f41.google.com (mail-wm0-f41.google.com [74.125.82.41]) by dpdk.org (Postfix) with ESMTP id 45E2D2A5B for ; Mon, 16 Nov 2015 18:12:20 +0100 (CET) Received: by wmvv187 with SMTP id v187so187508266wmv.1 for ; Mon, 16 Nov 2015 09:12:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=scylladb_com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=yryYr5XzXkNf/lYRvWnUnpnKyS07KLXBXSCwmUzVRig=; b=di6cNG+H9LLbJhiT92d3cyhPAzSK3QsAo1VI31XByoXlOoSrCtlHr9FCyq1Immof2r jBsVOm95Vodoe3s2r/bSERq34ryCI7K5/44NoHXIddZQ5LG1rmjr1SgXTSGJb1FF4bR9 DaH7cyej7bPjTrxvDP4oFt+Xi33GFnuyryGl8OZRL50EqHJmSycde+Bu48E0RF8usNKC Qisou8TCIPzg6/zvya0Qd97ehK/8tP4xoX7kGoNI/lIl5FVOPJHR/nynNeBSqON+rUhn DkilSeUY09ZyhfumNNnRuNNyolamdAj9E+3onBdgKXBzxcuFMpf1uFzIYyQZQEfL9D5x kdGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=yryYr5XzXkNf/lYRvWnUnpnKyS07KLXBXSCwmUzVRig=; b=ONEa+s/+mMH/7tMFu/mVYPF6YEKX399tck+vwioUjE0Ql7rVuR1bTElFiXoPACmh51 VQOIIh/JkjQX2KnNtw8jtiJCk5Wlbdmbc1L/7WskqJuR60NG/r1Qs1lGLGNeghLAE+8Z ZU3v1IUDnYx7nq2BePQdbhw3STeA17W06/i3JfeBJs/OE5dIchQw0ggQGIaWirEXL8ot lv1FjJ02kFTNo0Os484NFbsUpWmOIQXo7TJKu1tPxzUXhs1ZhbdaS5z53digFQQaLLXc AtgvVJj8+1naEjEgSqcTBJYdGnhEuAZxQ7S/xdKh7eWV7Izzq+GsX8jN+9DXtaNGY7TF vLRg== X-Gm-Message-State: ALoCoQlCDsqy9cuOWEiCeuwbOd/ws6COVlf85Funb6f6EFmkSHGDUJxGXl6TL4U6yoiUFjQ7zfqP X-Received: by 10.28.13.138 with SMTP id 132mr9284649wmn.62.1447693939972; Mon, 16 Nov 2015 09:12:19 -0800 (PST) Received: from avi.cloudius-systems.com ([37.142.229.250]) by smtp.googlemail.com with ESMTPSA id kd8sm35516287wjc.27.2015.11.16.09.12.17 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 16 Nov 2015 09:12:19 -0800 (PST) To: Alex Williamson , "" References: <20151028211309.14155.23867.stgit@gimli.home> <1447693613.3946.258.camel@redhat.com> From: Avi Kivity Message-ID: <564A0E70.4030409@scylladb.com> Date: Mon, 16 Nov 2015 19:12:16 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <1447693613.3946.258.camel@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: gleb@scylladb.com, mst@redhat.com, corbet@lwn.net, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, hjk@hansjkoch.de, gregkh@linuxfoundation.org Subject: Re: [dpdk-dev] [PATCH] vfio: Include No-IOMMU mode X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Nov 2015 17:12:20 -0000 On 11/16/2015 07:06 PM, Alex Williamson wrote: > On Wed, 2015-10-28 at 15:21 -0600, Alex Williamson wrote: >> There is really no way to safely give a user full access to a DMA >> capable device without an IOMMU to protect the host system. There is >> also no way to provide DMA translation, for use cases such as device >> assignment to virtual machines. However, there are still those users >> that want userspace drivers even under those conditions. The UIO >> driver exists for this use case, but does not provide the degree of >> device access and programming that VFIO has. In an effort to avoid >> code duplication, this introduces a No-IOMMU mode for VFIO. >> >> This mode requires building VFIO with CONFIG_VFIO_NOIOMMU and enabling >> the "enable_unsafe_noiommu_mode" option on the vfio driver. This >> should make it very clear that this mode is not safe. Additionally, >> CAP_SYS_RAWIO privileges are necessary to work with groups and >> containers using this mode. Groups making use of this support are >> named /dev/vfio/noiommu-$GROUP and can only make use of the special >> VFIO_NOIOMMU_IOMMU for the container. Use of this mode, specifically >> binding a device without a native IOMMU group to a VFIO bus driver >> will taint the kernel and should therefore not be considered >> supported. This patch includes no-iommu support for the vfio-pci bus >> driver only. >> >> Signed-off-by: Alex Williamson >> --- >> >> This is pretty well the same as RFCv2, I've changed the pr_warn to a >> dev_warn and added another, printing the pid and comm of the task when >> it actually opens the device. If Stephen can port the driver code >> over and prove that this actually works sometime next week, and there >> aren't any objections to this code, I'll include it in a pull request >> for the next merge window. MST, I dropped your ack due to the >> changes, but I'll be happy to add it back if you like. Thanks, >> >> Alex >> >> drivers/vfio/Kconfig | 15 +++ >> drivers/vfio/pci/vfio_pci.c | 8 +- >> drivers/vfio/vfio.c | 186 ++++++++++++++++++++++++++++++++++++++++++- >> include/linux/vfio.h | 3 + >> include/uapi/linux/vfio.h | 7 ++ >> 5 files changed, 209 insertions(+), 10 deletions(-) > FYI, this is now in v4.4-rc1 (the slightly modified v2 version). I want > to give fair warning though that while we seem to agree on this idea, it > hasn't been proven with a userspace driver port. I've opted to include > it in this merge window rather than delaying it until v4.5, but I really > need to see a user for this before the end of the v4.4 cycle or I think > we'll need to revert and revisit for v4.5 anyway. I don't really have > any interest in adding and maintaining code that has no users. Please > keep me informed of progress with a dpdk port. Thanks, > > Thanks Alex. Copying the dpdk mailing list, where the users live. dpdk-ers: vfio-noiommu is a replacement for uio_pci_generic and uio_igb. It supports MSI-X and so can be used on SR/IOV VF devices. The intent is that you can use dpdk without an external module, using vfio, whether you are on bare metal with an iommu, bare metal without an iommu, or virtualized. However, dpdk needs modification to support this.