From patchwork Thu Apr 1 00:12:35 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Lyon X-Patchwork-Id: 90034 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o310FhIw004858 for ; Thu, 1 Apr 2010 00:15:44 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755630Ab0DAAPQ (ORCPT ); Wed, 31 Mar 2010 20:15:16 -0400 Received: from sj-iport-6.cisco.com ([171.71.176.117]:28779 "EHLO sj-iport-6.cisco.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753187Ab0DAAPO (ORCPT ); Wed, 31 Mar 2010 20:15:14 -0400 Authentication-Results: sj-iport-6.cisco.com; dkim=neutral (message not signed) header.i=none X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Am8IAGOCs0urR7Hu/2dsb2JhbACDEpgocRwBm3+IQ5BUgSuBKhIIgSdqBIMj X-IronPort-AV: E=Sophos;i="4.51,344,1267401600"; d="scan'208";a="506393640" Received: from sj-core-5.cisco.com ([171.71.177.238]) by sj-iport-6.cisco.com with ESMTP; 01 Apr 2010 00:15:13 +0000 Received: from sjc-vpn7-598.cisco.com (sjc-vpn7-598.cisco.com [10.21.146.86]) by sj-core-5.cisco.com (8.13.8/8.14.3) with ESMTP id o310FD04008942; Thu, 1 Apr 2010 00:15:13 GMT From: Tom Lyon To: kvm@vger.kernel.org Subject: [PATCH 1/1] uio_pci_generic: extensions to allow access for non-privileged processes Date: Wed, 31 Mar 2010 17:12:35 -0700 User-Agent: KMail/1.9.9 Cc: linux-kernel@vger.kernel.org, mst@redhat.com References: <201003311708.38961.pugs@lyon-about.com> In-Reply-To: <201003311708.38961.pugs@lyon-about.com> MIME-Version: 1.0 Content-Disposition: inline Message-Id: <201003311712.36105.pugs@lyon-about.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 01 Apr 2010 00:15:44 +0000 (UTC) diff -rupN linux-2.6.33/drivers/uio/uio.c uio-2.6.33/drivers/uio/uio.c --- linux-2.6.33/drivers/uio/uio.c 2010-02-24 10:52:17.000000000 -0800 +++ uio-2.6.33/drivers/uio/uio.c 2010-03-31 12:26:24.000000000 -0700 @@ -730,12 +730,24 @@ static int uio_mmap(struct file *filep, } } +static int uio_ioctl(struct inode *inode, struct file *filep, + unsigned int cmd, unsigned long arg) +{ + struct uio_listener *listener = filep->private_data; + struct uio_device *idev = listener->dev; + + if (idev == NULL || idev->info == NULL || idev->info->ioctl == NULL) + return -EINVAL; + return idev->info->ioctl(idev->info, cmd, arg); +} + static const struct file_operations uio_fops = { .owner = THIS_MODULE, .open = uio_open, .release = uio_release, .read = uio_read, .write = uio_write, + .ioctl = uio_ioctl, .mmap = uio_mmap, .poll = uio_poll, .fasync = uio_fasync,