From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qg0-f44.google.com (mail-qg0-f44.google.com [209.85.192.44]) by dpdk.org (Postfix) with ESMTP id 16C49926A for ; Tue, 6 Oct 2015 00:09:56 +0200 (CEST) Received: by qgez77 with SMTP id z77so163221558qge.1 for ; Mon, 05 Oct 2015 15:09:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=ByZAFaRo0ck+fA8MHYgik/nh0QpQFLH2j9VYeTwaDLY=; b=dvjynq8sVjlrTl5ZcqYFgGBerlfNH5aSNxdPmCFTBN2wq3JdrRWafPZ6ncO3b/aGMc OA0VZp/I/InggabR+lI5ifQurfvmsCMG5sYJcmLfVMSPZ8HzjRxs0zFyFsdB+ENOnDE/ STdZ4sQbF/8G30SyClaoTeWltS5+glheAdId+bDyl+5mCn4gRP2b6OZjsIAfNsBg2GDs kpb6IjC5DSQXPp/50wLxvjOMyPoyqLUkhprHk5+EoI1ax5qw9daxdjyqg1D2HUaGE62H 927AIXKykBCH1XeKvMHUpfXeWYHE3gadlIc0Y8DXesbwcQlzQKgdg0g/mbnkJHsVRDnm TyYQ== X-Gm-Message-State: ALoCoQn9aQxwnkz630UQoGlXvOFU03tjO42gTyCUTIIwd0EuLFFOH1C6BRjppYX/l8WRR5NC+mGE MIME-Version: 1.0 X-Received: by 10.140.38.167 with SMTP id t36mr42767430qgt.66.1444082995564; Mon, 05 Oct 2015 15:09:55 -0700 (PDT) Received: by 10.55.123.131 with HTTP; Mon, 5 Oct 2015 15:09:55 -0700 (PDT) Received: by 10.55.123.131 with HTTP; Mon, 5 Oct 2015 15:09:55 -0700 (PDT) In-Reply-To: <20151005215455.GA7608@redhat.com> References: <1443652138-31782-1-git-send-email-stephen@networkplumber.org> <1443652138-31782-3-git-send-email-stephen@networkplumber.org> <20151001104505-mutt-send-email-mst@redhat.com> <20151005215455.GA7608@redhat.com> Date: Tue, 6 Oct 2015 01:09:55 +0300 Message-ID: From: Vladislav Zolotarov To: "Michael S. Tsirkin" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Cc: dev@dpdk.org, hjk@hansjkoch.de, gregkh@linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [dpdk-dev] [PATCH 2/2] uio: new driver to support PCI MSI-X 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, 05 Oct 2015 22:09:56 -0000 On Oct 6, 2015 12:55 AM, "Michael S. Tsirkin" wrote: > > On Thu, Oct 01, 2015 at 11:33:06AM +0300, Michael S. Tsirkin wrote: > > Just forwarding events is not enough to make a valid driver. > > What is missing is a way to access the device in a safe way. > > Thinking about it some more, maybe some devices don't do DMA, and merely > signal events with MSI/MSI-X. > > The fact you mention igb_uio in the cover letter seems to hint that this > isn't the case, and that the real intent is to abuse it for DMA-capable > devices, but still ... > > If we assume such a simple device, we need to block userspace from > tweaking at least the MSI control and the MSI-X table. > And changing BARs might make someone else corrupt the MSI-X > table, so we need to block it from changing BARs, too. > > Things like device reset will clear the table. I guess this means we > need to track access to reset, too, make sure we restore the > table to a sane config. > > PM capability can be used to reset things tooI think. Better be > careful about that. > > And a bunch of devices could be doing weird things that need > to be special-cased. > > All of this is what VFIO is already dealing with. > > Maybe extending VFIO for this usecase, or finding another way to share > code might be a better idea than duplicating the code within uio? How about instead of trying to invent the wheel just go and attack the problem directly just like i've proposed already a few times in the last days: instead of limiting the UIO limit the users that are allowed to use UIO to privileged users only (e.g. root). This would solve all clearly unresolvable issues u are raising here all together, wouldn't it? > > -- > MST