From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f172.google.com (mail-wi0-f172.google.com [209.85.212.172]) by dpdk.org (Postfix) with ESMTP id 961B48D9F for ; Thu, 1 Oct 2015 11:38:54 +0200 (CEST) Received: by wicfx3 with SMTP id fx3so19703223wic.0 for ; Thu, 01 Oct 2015 02:38:54 -0700 (PDT) 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=SmvhQHRU3EROWTxvjd549NFXxJ/KOUmbJxDIbKY2j3s=; b=IlxQ4a/77Rf6BpU4hpG43JlcYadyaDJL8vz1auh0hZ9VaQItROs6GuajscdqcZrjSe lwBlj38sl39AQ175/YyIwaINTBFMDCLFVFvakLoivjxCp02wjy6qMwn5UI9zlGM19SUp Oz3sIKZPSIQbZ/reS0P+gydbRMY+5AqTGX469RJ83oz8QCbXFvJVx+MrJPolVTX7UInT TbJgh2QcLTYbQFOX0I0l6hEAYAG/kGTef2FEZA8t3qrFwgeAhJ5twYX2EQbx4sMGLx4V Jthn8/a1a/i8fS92fZ32jl/oQPlCrtXib1YxK3K3ZphQV7/W6cQWSvlRV0ptdmVtF++/ fYdg== X-Gm-Message-State: ALoCoQkgrPKIM6USzRR4Wx2Jh5kviS1M1EBX5pyOEweI/u2nj7hrZftQ7M3LGAt377JDK9JH5EGk X-Received: by 10.194.235.6 with SMTP id ui6mr11000191wjc.92.1443692334356; Thu, 01 Oct 2015 02:38:54 -0700 (PDT) Received: from avi.cloudius ([37.142.229.250]) by smtp.googlemail.com with ESMTPSA id p4sm2222124wia.15.2015.10.01.02.38.52 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Oct 2015 02:38:52 -0700 (PDT) To: "Michael S. Tsirkin" References: <20150930151632-mutt-send-email-mst@redhat.com> <560BDE24.8000308@scylladb.com> <20150930165359-mutt-send-email-mst@redhat.com> <560BF782.4070308@scylladb.com> <20150930175848-mutt-send-email-mst@redhat.com> <560C0171.7080507@scylladb.com> <20150930204016.GA29975@redhat.com> <20151001113828-mutt-send-email-mst@redhat.com> <560CF44A.60102@scylladb.com> <560CF9C5.8050901@scylladb.com> <20151001121638-mutt-send-email-mst@redhat.com> From: Avi Kivity Message-ID: <560CFF2B.3090407@scylladb.com> Date: Thu, 1 Oct 2015 12:38:51 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <20151001121638-mutt-send-email-mst@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] Having troubles binding an SR-IOV VF to uio_pci_generic on Amazon instance 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: Thu, 01 Oct 2015 09:38:54 -0000 On 10/01/2015 12:29 PM, Michael S. Tsirkin wrote: > On Thu, Oct 01, 2015 at 12:15:49PM +0300, Avi Kivity wrote: >> What userspace can't be allowed to do: >> >> access BAR >> write rings >> >> >> >> >> It can access the BAR by mmap()ing the resourceN files under sysfs. You're not >> denying userspace the ability to oops the kernel, just the ability to do useful >> things with hardware. > > This interface has to stay there to support existing applications. A > variety of measures (selinux, secureboot) can be used to make sure > modern ones to not get to touch it. By all means, secure the driver with selinux as well. > Most distributions enable > some or all of these by default. There is no problem accessing the BARs on the most modern and secure enterprise distribution I am aware of (CentOS 7.1). > > And it doesn't mean modern drivers can do this kind of thing. > > Look, without an IOMMU, sysfs can not be used securely: > you need some other interface. This is what this driver is missing. What is this magical missing interface? It simply cannot be done. You either have an iommu, or you accept that userspace can access anything via DMA. The sad thing is that you can do this since forever on a non-virtualized system, or on a virtualized system if you don't need interrupt support. All you're doing is blocking interrupt support on virtualized systems.