summaryrefslogtreecommitdiffstats
path: root/arch/um/drivers/daemon_user.c
Commit message (Collapse)AuthorAgeFilesLines
* uml: Eliminate kernel allocator wrappersJeff Dike2007-07-161-2/+2
| | | | | | | | | | | | | | | | | | UML had two wrapper procedures for kmalloc, um_kmalloc and um_kmalloc_atomic because the flag constants weren't available in userspace code. kern_constants.h had made kernel constants available for a long time, so there is no need for these wrappers any more. Rather, userspace code calls kmalloc directly with the userspace versions of the gfp flags. kmalloc isn't a real procedure, so I had to essentially copy the inline wrapper around __kmalloc. vmalloc also had its own wrapper for no good reason. This is now gone. Signed-off-by: Jeff Dike <jdike@linux.intel.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* uml: rename os_{read_write}_file_k back to os_{read_write}_fileJeff Dike2007-05-071-2/+2
| | | | | | | | | | Rename os_{read_write}_file_k back to os_{read_write}_file, delete the originals and their bogus infrastructure, and fix all the callers. Signed-off-by: Jeff Dike <jdike@linux.intel.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* uml: start fixing os_read_file and os_write_fileJeff Dike2007-05-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch starts the removal of a very old, very broken piece of code. This stems from the problem of passing a userspace buffer into read() or write() on the host. If that buffer had not yet been faulted in, read and write will return -EFAULT. To avoid this problem, the solution was to fault the buffer in before the system call by touching the pages that hold the buffer by doing a copy-user of a byte to each page. This is obviously bogus, but it does usually work, in tt mode, since the kernel and process are in the same address space and userspace addresses can be accessed directly in the kernel. In skas mode, where the kernel and process are in separate address spaces, it is completely bogus because the userspace address, which is invalid in the kernel, is passed into the system call instead of the corresponding physical address, which would be valid. Here, it appears that this code, on every host read() or write(), tries to fault in a random process page. This doesn't seem to cause any correctness problems, but there is a performance impact. This patch, and the ones following, result in a 10-15% performance gain on a kernel build. This code can't be immediately tossed out because when it is, you can't log in. Apparently, there is some code in the console driver which depends on this somehow. However, we can start removing it by switching the code which does I/O using kernel addresses to using plain read() and write(). This patch introduces os_read_file_k and os_write_file_k for use with kernel buffers and converts all call locations which use obvious kernel buffers to use them. These include I/O using buffers which are local variables which are on the stack or kmalloc-ed. Later patches will handle the less obvious cases, followed by a mass conversion back to the original interface. Signed-off-by: Jeff Dike <jdike@linux.intel.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* uml: remove user_util.hJeff Dike2007-05-071-1/+0
| | | | | | | | | user_util.h isn't needed any more, so delete it and remove all includes of it. Signed-off-by: Jeff Dike <jdike@linux.intel.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* uml: network interface hotplug error handlingJeff Dike2007-05-071-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | This fixes a number of problems associated with network interface hotplug. The userspace initialization function can fail in some cases, but the failure was never passed back to eth_configure, which proceeded with the configuration. This results in a zombie device that is present, but can't work. This is fixed by allowing the initialization routines to return an error, which is checked, and the configuration aborted on failure. eth_configure failed to check for many failures. Even when it did check, it didn't undo whatever initializations has already happened, so a present, but partially initialized and non-working device could result. It now checks everything that can fail, and bails out, undoing whatever had been done. The return value of eth_configure was always ignored, so it is now just void. Signed-off-by: Jeff Dike <jdike@linux.intel.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Cc: Jeff Garzik <jeff@garzik.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* uml: driver formatting fixesJeff Dike2007-05-071-18/+7
| | | | | | | | | | | | | | | | | Fix a bunch of formatting violations in the drivers: return(n) -> return n whitespace fixes emacs formatting comment removal breaking if(foo) return(n) into two lines There are also a couple of errno use bugs: using errno in a printk when the failure put errno into a local variable saving errno after a printk, which can change it Signed-off-by: Jeff Dike <jdike@linux.intel.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* [PATCH] um: fix errno usagePaolo 'Blaisorblade' Giarrusso2007-03-081-8/+9
| | | | | | | | | | Avoid reusing userspace errno twice - it can be cleared by libc code everywhere (in particular printk() does clear it in my setup). Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Acked-by: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* [PATCH] uml: split memory allocation prototypes out of user.hPaolo 'Blaisorblade' Giarrusso2006-10-201-0/+1
| | | | | | | | | | user.h is too generic a header name. I've split out allocation routines from it. Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Cc: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] uml: const more dataJeff Dike2006-09-271-1/+1
| | | | | | | | | | Make lots of structures const in order to make it obvious that they need no locking. Signed-off-by: Jeff Dike <jdike@addtoit.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] uml: make daemon transport behave properlyPaolo 'Blaisorblade' Giarrusso2006-01-181-0/+6
| | | | | | | | | | | | Avoid uninitialized data in the daemon_data structure. I used this transport before doing proper setup before-hand, and I got some very nice SLAB corruption due to freeing crap pointers. So just make sure to clear everything when appropriate. Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Cc: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] uml: fix daemon transport exit path bugPaolo 'Blaisorblade' Giarrusso2005-11-131-2/+4
| | | | | | | | | Fix some exit path bugs in the daemon driver. Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Acked-by: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] uml: kfree cleanupJesper Juhl2005-06-251-3/+3
| | | | | | | | | | | Here's a small patch to remove a few unnessesary NULL pointer checks before kfree() in arch/um/drivers/daemon_user.c Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk> Signed-off-by: Jeff Dike <jdike@addtoit.com> Cc: Paolo Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* Linux-2.6.12-rc2Linus Torvalds2005-04-161-0/+197
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!