From: "Hans J. Koch" <hjk@linutronix.de>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Tom Lyon <pugs@cisco.com>,
hjk@linutronix.de, gregkh@suse.de, chrisw@sous-sol.org,
joro@8bytes.org, avi@redhat.com, kvm@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH V3] drivers/uio/uio_pci_generic.c: allow access for non-privileged processes
Date: Wed, 21 Apr 2010 12:31:50 +0200 [thread overview]
Message-ID: <20100421103148.GB1995@bluebox.local> (raw)
In-Reply-To: <20100421093849.GB30855@redhat.com>
On Wed, Apr 21, 2010 at 12:38:49PM +0300, Michael S. Tsirkin wrote:
>
> > + j++;
> > + }
> > + }
> > + for (i = 0, j = 0; i < PCI_STD_RESOURCE_END &&
> > + j < MAX_UIO_PORT_REGIONS; i++) {
> > + if (pci_resource_flags(pdev, i) & IORESOURCE_IO) {
> > + name = kmalloc(8, GFP_KERNEL);
> > + if (name == NULL)
> > + break;
> > + sprintf(name, "iobar%d", i);
> > + info->port[j].name = name;
> > + info->port[j].start = pci_resource_start(pdev, i);
> > + info->port[j].size = pci_resource_len(pdev, i);
> > + info->port[j].porttype = UIO_PORT_X86;
> > + j++;
>
> At least on x86, I think io bar can not be mmapped.
That's right. porttype == UIO_PORT_X86 is only there for information
purposes. Userspace then knows that it cannot map this but has to use
things like inb(), outb() and friends after getting access rights with
ioperm()/iopl(). "start" and "size" gives userspace the information
needed to do this.
Thanks,
Hans
next prev parent reply other threads:[~2010-04-21 10:32 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-19 22:05 [PATCH V3] drivers/uio/uio_pci_generic.c: allow access for non-privileged processes Tom Lyon
2010-04-21 9:38 ` Michael S. Tsirkin
2010-04-21 10:31 ` Hans J. Koch [this message]
2010-04-21 10:30 ` Michael S. Tsirkin
2010-04-29 19:29 ` Tom Lyon
2010-04-29 19:52 ` Michael S. Tsirkin
2010-05-01 14:28 ` Joerg Roedel
2010-05-03 17:47 ` [LKML] " Konrad Rzeszutek Wilk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100421103148.GB1995@bluebox.local \
--to=hjk@linutronix.de \
--cc=avi@redhat.com \
--cc=chrisw@sous-sol.org \
--cc=gregkh@suse.de \
--cc=joro@8bytes.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=pugs@cisco.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox