From: greg@kroah.com (Greg KH)
To: kernelnewbies@lists.kernelnewbies.org
Subject: UIO Kernel Driver with Buildroot and QEMU
Date: Tue, 20 Oct 2015 17:43:30 -0700 [thread overview]
Message-ID: <20151021004330.GA9366@kroah.com> (raw)
In-Reply-To: <CAK7rcp_SKb0T3YzOPdNxLjhjEmWyXe12z-8nEFQADiBD7KpZWQ@mail.gmail.com>
On Tue, Oct 20, 2015 at 08:28:20PM -0400, Kenneth Adam Miller wrote:
> On Tue, Oct 20, 2015 at 8:17 PM, Greg KH <greg@kroah.com> wrote:
> On Tue, Oct 20, 2015 at 07:40:37PM -0400, Kenneth Adam Miller wrote:
> > I didn't know about that. How do I do that? I'm using buildroot; I guess
> > there's something missing in menuconfig or linux-menuconfig.
>
> Um, no, device tree doesn't have anything to do with buildroot, other
> than the fact that you need such a thing for your platform to work
> properly.
>
> Well, often there are options and relation configurations that are implicitly
> required by the target development objective that have to be enabled by
> buildroot. For instance, right now I'm using devtempfs, and I know that because
> one of the things I considered was that it was possible that it was a silent
> failure on the part of the module insertion that it wasn't creating the current
> /dev entry because it was static. But I followed up in buildroot to make sure
> that I had it.
Again, device tree is not a kernel build "option", it is provided by the
firmware of your platform and handed to the kernel. It describes your
hardware to the kernel for systems that do not have discoverable
hardware (like USB or PCI).
> >? ? ?I would suggest reading the UIO documentation, it should explain all
> of
> >? ? ?this for you already.? If not, specific questions are always gladly
> >? ? ?answered.
> >
> >
> > The one that I linked? I read that repeatedly. What other documentation
> is
> > there to read? I also read from Essential Linux Device Drivers, and none
> of
> > them explained that. There has to be something I'm missing.?
>
> Step back, what exactly are you trying to do here that you think UIO is
> the answer?? Where is the uio driver that you want to run for your
> hardware platform?? UIO is a _very_ hardware-specific solution to a
> _very_ specific problem that people have, are you sure it's what you
> need?
>
> Right now, we are building a security solution that requires that communication
> be fully isolated by subject. We don't have special devices, we actually have
> very special, extra security software that we're trying to support. One of
> those is a permissions capability that can be set beneath the guest that
> determines what memory can be observed or written to. If a violation occurs,
> the guest is killed. We like this model because only the data makes it through.
> The problem with doing it the old way was 1) it was too slow. 2) it was very
> hard to write in a kernel module context, and therefore it was overkill 3) all
> we really wanted was to facilitate the ability to access special limited access
> memory.?
How does that relate to UIO?
The kernel already provides userspace isolation to memory, no need to
add anything else, the hardware of the CPU does this for you
automatically.
> So effectively, we are moving code that is currently in a driver, out of a
> driver. In fact, all we want to do is map memory into user space, and then
> access that memory as though it were an array in the user land code.
You don't need UIO for that, just use /dev/mem/ or other such
functionality for that. UIO is to allow userspace access to physical
hardware that is memory-backed, and interrupts for that hardware. If
you just want access to real memory, no need to use UIO for that at all.
good luck!
greg k-h
next prev parent reply other threads:[~2015-10-21 0:43 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-20 15:58 UIO Kernel Driver with Buildroot and QEMU Kenneth Adam Miller
2015-10-20 20:29 ` Kenneth Adam Miller
2015-10-20 21:56 ` Mandeep Sandhu
2015-10-20 22:55 ` Kenneth Adam Miller
2015-10-20 22:54 ` Greg KH
2015-10-20 23:40 ` Kenneth Adam Miller
2015-10-21 0:17 ` Greg KH
2015-10-21 0:28 ` Kenneth Adam Miller
2015-10-21 0:43 ` Greg KH [this message]
2015-10-21 0:48 ` Kenneth Adam Miller
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=20151021004330.GA9366@kroah.com \
--to=greg@kroah.com \
--cc=kernelnewbies@lists.kernelnewbies.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.