From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Wright Subject: Re: [PATCH corrected RFC] uio: add generic driver for PCI 2.3 devices Date: Thu, 9 Jul 2009 19:22:29 -0700 Message-ID: <20090710022229.GF30379@sequoia.sous-sol.org> References: <20090709114834.GB26479@redhat.com> <4A5604B3.2090508@codemonkey.ws> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "Michael S. Tsirkin" , kvm@vger.kernel.org, avi@redhat.com To: Anthony Liguori Return-path: Received: from sous-sol.org ([216.99.217.87]:37568 "EHLO sequoia.sous-sol.org" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751075AbZGJCWr (ORCPT ); Thu, 9 Jul 2009 22:22:47 -0400 Content-Disposition: inline In-Reply-To: <4A5604B3.2090508@codemonkey.ws> Sender: kvm-owner@vger.kernel.org List-ID: * Anthony Liguori (anthony@codemonkey.ws) wrote: > I didn't know this was possible... so we could also use this driver for > vm-channel. With MSI things are much nicer (which we could define for vm-channel). This is for shared legacy INTx. >> + >> + err = pci_request_regions(pdev, "uio_pci_generic"); >> + if (err) { >> + dev_err(&pdev->dev, "%s: pci_request_regions failed: %d\n", >> + __func__, err); >> + goto err_verify; >> + } >> + >> + dev = kzalloc(sizeof(struct generic_dev), GFP_KERNEL); >> + if (!dev) { >> + err = -ENOMEM; >> + goto err_alloc; >> + } >> + >> + dev->info.name = "uio_pci_generic"; >> + dev->info.version = "0.01"; >> + dev->info.irq = pdev->irq; >> + dev->info.irq_flags = IRQF_SHARED; >> + dev->info.handler = irqhandler; >> + dev->info.irqcontrol = irqcontrol; >> + dev->pdev = pdev; >> + spin_lock_init(&dev->lock) >> > > I know it's not strictly needed for PCI pass through, but it would be > useful to register the IO regions via UIO. The userspace implementation > would then use UIO strictly instead of poking the sysfs pci info > directly. I think that ends up being cleaner. I don't see what the advantage is? thanks, -chris