- 03 Jan, 2005 40 commits
-
-
Jeff Dike authored
From: Bodo Stroesser This is the first patch of a series of four. These patches allow the use of sysenter-systemcalls in UML if the host support sysenter. Some facts have to be noted: - the sysenter instruction does not save anything, not even the return address. Thus the host-kernel builds a stackframe with an fixed return address for the backjump to the vsyscall-page. All kernels that support sysenter thus must have a vsyscall-page - The hosts vsyscall-page is visible in all memory-contexts on the host, even in those of the processes running on UML. This cannot be changed. So the best way to implement sysenter is to integrate the host's vsyscall-page into UML, if available. This patch creates a new source file containing an UML initialization function. The function scans the Elf-auxiliary vector that is prepared by the host for relevant information about: - vsyscall elf-header - vsyscall entry - machine type (called "platform", e.g. "i586" or "i686") - hardware capabilities These informations are inserted into the Elf-auxiliary-vector that is generated if an UML process calls "execXX()". If the information from the auxiliray-vector is not complete, UML uses the previos default values, with one exception: if the host has no vsyscall-page, UML now does no longer insert AT_SYSINFO or AT_SYSINFO_EHDR elements. (I think, that's better than writing dummies) Since the host's vsyscall-page is always visible to UML processes, this change is enough to let UML with an i686-compiled glibc use sysenter. what's missing: - is_syscall() in SKAS cannot access the code in the vsyscall-page via copy_from_user(), thus singlesteppers still could break out. (Note: that's not new, if someone jumps willingly to the sysenter-entry in the vsyscall-page, he can do that without the patch, too). - a debugger cannot access the code in the vsyscall-page via ptrace( PEEKTEXT, ...) Risks: could there by any feature of the host's processor, that is indicated in the hardware capabilities, but must not be used in UML? Signed-off-by: Bodo Stroesser <bodo.stroesser@fujitsu-siemens.com> Signed-off-by: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Paolo \'Blaisorblade\' Giarrusso authored
Fix some bugs left in the failure path of run_helper by the previous patch: it was missing one os_close_file(fds[1]) which is conditional. To use the goto handling model, I set the fd to -1 if it's already closed (I don't want to check if keeping one more pipe-end open is no problem). Also do some cosmethic cleanup: * "err" was what we returned even on success, so just use a neutral "ret". * use tabs, not spaces. * a little more comments. Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Paolo \'Blaisorblade\' Giarrusso authored
With Jeff Dike <jdike@addtoit.com>, Fixed a file descriptor leak in the network driver when changing an IP address. Fixed the error handling in run_helper. Paolo notes: Actually, this is part one of the change, the exact one extracted from Jeff Dike's incrementals tree before 2.6.9-rc big UML merge. There is some changes must be done, so I'm also sending a second patch with this one, too. Separated for tracking purposes. Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Gerd Knorr authored
This is a major cleanup of the uml terminal drivers and console handling (console as in "where the kernel messages go to", not as in "linux virtual terminals"). The changes in detail: (1) There is a new console driver calles "stderr" which (as the name implies) simply dumps all kernel messages to stderr. That one is registered very early in the boot process via console_initcall() and will print every almost kernel message instantly: Both very early in the boot process and very late in shutdown. Note that this is not enabled by default, see below for details. (2) Ditched the early-console-init hackery in stdio_console.c (open_console(NULL) + related stuff) into the waste basket, not needed any more as you can use the new stderr console driver to get the kernel messages if your kernel crashes very early in the boot process. (3) Handle console initialitation for the uml stdio console and virtual serial lines the normal way using the console->setup() function. Now all kernel messages appear on your console device once it is initialized without any dirty tricks. (4) The (2) changes allow a number of further cleanups: As we don't open a line without a tty_struct any more we can ... * hook struct line into tty->driver_data * pass around tty_struct instead of struct line everythere * get rid of some trivial wrappers in ssl.c and stdio_console.c because we can get struct line via tty_struct all the time now. (5) Change the ordering in the arch/um/drivers/Makefile and thus the link and initialization order to make sure the stdio console and not the virtual serial line is the default console device. (6) Fixed a number of Documentation/CodingStyle issues within the code (not systematically, but usually just the places I was touching anyway or where it bugged me while browsing the code because it was hard to read). Looks like that cleanup also fixed some strange tty issues I've seen in the past (like console getty not responding to input sometimes, suse's /sbin/blogd causing trouble). Finally some usage notes for using the new stderr console: If the stderr console is enabled, then it is the default console device because it registeres very early in the boot process. But as it isn't linked to a tty device this makes init unhappy, you'll see "can't open initial console" error messages. Because you usually don't want that the stderr console is turned off by default. That also maintains the behavior that /dev/tty0 is the first console device registered and thus the default console. There are basically two useful use cases for the stderr console: (1) Your kernel dies before the normal console device is initialized and thus you don't see any messages. Just enable the stderr console to see them by adding "stderr=1" to the kernel command line. (2) You want to have the kernel messages on both stderr and your console terminal device. Try something like this: $ ./linux stderr=1 console=stderr console=ttyS0 ssl0=xterm This example sets up the console on a virtual serial line and pops up an xterm for that. Signed-off-by: Gerd Knorr <kraxel@bytesex.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Paolo \'Blaisorblade\' Giarrusso authored
This is a follow-up to my previous "hostfs - uml: set .sendfile to generic_file_sendfile" patch. I was asking whether other methods should have been added, and comparing with ext3 I found some more ones. However, I have not specific clues about them: I know they use the pagecache, which relies on *page methods, which are defined by hostfs. So I think it could work. I have a doubt, whether hostfs needs the commented out method below: static struct address_space_operations hostfs_aops = { .writepage = hostfs_writepage, .readpage = hostfs_readpage, /* .set_page_dirty = __set_page_dirty_nobuffers, */ .prepare_write = hostfs_prepare_write, .commit_write = hostfs_commit_write }; Hostfs does not have a underlying device (and I have some rough idea that buffers cache block devices data), so I wonder if that is needed or not. Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Paolo \'Blaisorblade\' Giarrusso authored
Make hostfs use the generic sendfile implementation. Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Jeff Dike authored
From: Bodo Stroesser <bstroesser@fujitsu-siemens.com> In most cases reboot failed on my system. After "Restarting system.", UML exited without further messages. I found an SIGIO being processed by sig_handler() resp. sig_handler_common_skas(). Don't know, why this exits, maybe the context is no longer valid at this time. So, I changed the sequence in the reboot part of main() to stop the timers and disable the fds before unblocking the signals. Since this wasn't enough, I also added set_handler(SIGXXX, SIG_IGN) calls to disable_timer() and deactivate_all_fds(). Now reboot works fine in SKAS and it still works in TT. Signed-off-by: Bodo Stroesser <bstroesser@fujitsu-siemens.com> Signed-off-by: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Jeff Dike authored
This adds a free_irq_by_irq_and_dev call which was accidentally removed when the UML free_irq was replaced by generic code. Signed-off-by: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Jeff Dike authored
This process closes some file descriptors which were left open incorrectly. These are the initrd descriptor, the temporary test file used for testing /tmp for execution permission, and a descriptor used by the netork to connect to the switch. In the network case, we add network devices to the opened list as soon as they are added to UML, rather than when they are configured. This ensures that close_devices will remove the device properly on shutdown. Signed-off-by: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Jeff Dike authored
Fix sys_sigreturn and sys_rt_sigreturn to avoid calling copy_from_user inside a spinlock. We copy the blocked signal mask into a local sigset_t before the spinlock and then just assign from it inside the lock. Signed-off-by: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Jeff Dike authored
This piece appears to have gone in twice. Signed-off-by: Milton Miller <miltonm@bga.com> Signed-off-by: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Jeff Dike authored
From: Chris Wedgewood: this removes unnecessary cruft from unistd.h Signed-off-by: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Jeff Dike authored
From: Bodo Stroesser Signed-off-by: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Jeff Dike authored
This patch rips out the old signal delivery mechanism and replaces it with a sane one. Specifically, UML used to capture a host signal frame and use it as a template for its own signal frames. This was a worthy idea, because it promised a degree of architecture-independence for this part of UML, but impractical. There are some environments, notably 32 bit emulation on a 64 bit box, where you can't use the host signal frame as a template for your own. Plus, this code is as complicated, even to someone who understands what it's doing, as the standard fill-in-a-structure-and-write-it-to-the-stack. For everyone else, it is incomprehensible. So, this reimplements signal handling in the way that everyone else does. It gives up on architecture independence, and moves this code into the x86-specific stuff. Signed-off-by: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Paolo \'Blaisorblade\' Giarrusso authored
From: Jeff Dike <jdike@addtoit.com> This patch adds ptrace_setfpregs and makes these functions return -errno on failure. Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Paolo \'Blaisorblade\' Giarrusso authored
Reworded the comment about __wrap_free detection of the allocator used to allocate the pointer (it can free a pointer created by either the host malloc(), kmalloc() or vmalloc()). Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Paolo \'Blaisorblade\' Giarrusso authored
Remove uses of devfs_mk_symlink(). We didn't do this before to avoid breaking most user setups, but this patch should be quite harmless. I've excluded the hottest part, i.e. the ubd symlink, while removing the other; I released a end-user tree with this patch and there was a good number of people using the symlink rather than the preferred name. That part will be merged later, I think. Since now we have evidence of less and less users using devfs, we think that it will not cause too much problems. Acked-by: Jeff Dike <jdike@addtoit.com> Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Hirokazu Takata authored
This patch updates include/asm-m32r/mmu_context.h. * include/asm-m32r/mmu_context.h: - Add #ifdef __KERNEL__ - Change __inline__ to inline for __KERNEL__ portion. Signed-off-by: Hirokazu Takata <takata@linux-m32r.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Hirokazu Takata authored
This patch updates include/asm-m32r/system.h. * include/asm-m32r/system.h: - Use barrier() as mb(). - Change __inline__ to inline. Signed-off-by: Hirokazu Takata <takata@linux-m32r.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Hirokazu Takata authored
This patch is for employing the generic hardirq framework for m32r. Now CONFIG_GENERIC_HARDIRQS is set to Y by default. - Update to use GENERIC_HARDIRQ framework. - Fix PREEMPT_ACTIVE definition (changeset 1.2000.16.20) Signed-off-by: Hirokazu Takata <takata@linux-m32r.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Hirokazu Takata authored
Here is a patch to update kernel headers for mutual exclusion, atomic.h, bitops.h and semaphore.h of m32r. This patch is for making these headers publishable to userland. * include/asm-m32r/assembler.h (M32R_LOCK, M32R_UNLOCK): Define M32R_LOCK and M32R_UNLOCK macros. For SMP configuration, these macros are expanded to m32r's LOCK and UNLOCK instructions. While, for UP configuration, these are simply expanded to m32r's LD(load) and ST(store) instructions, respectively. * include/asm-m32r/atomic.h, include/asm-m32r/bitops.h, include/asm-m32r/semaphore.h: - Change macros from LOAD and STORE to M32R_LOCK and M32R_UNLOCK, respectively. It is because LOAD and STORE are too generic words. - Change inline to __inline__. Retrieve __inline__ modifiers for functions which are placed outside of __KERNEL__ region in these headers, because those functions might be included and used from ISO C program in userland. Currently, it seems that these headers are allowed to be included from userland. Indeed, they are kernel stuff, but these headers provide useful definitions and functions even for userland applications, I think. Signed-off-by: Hirokazu Takata <takata@linux-m32r.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Hirokazu Takata authored
- Use kmalloc for m32r stacks (cf. changeset 1.1046.533.10) - Update for CONFIG_DEBUG_STACK_USAGE This modification was taken from include/asm-i386/thread_info.h. Signed-off-by: Hirokazu Takata <takata@linux-m32r.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Hirokazu Takata authored
- Use THREAD_SIZE for __ASSEMBLY__ portion. - Update comments. - Fix a typo: user-thead --> user-thread. NOTE: Now there are two THREAD_SIZE definitions in the following patch, one is in C part and the other is in __ASSEMBLY__ part. I'm going to consolidate these THREAD_SIZE definitions. So, I have to change PAGE_SIZE definition of include/asm-m32r/page.h to be includable into asm portion... Signed-off-by: Hirokazu Takata <takata@linux-m32r.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Hirokazu Takata authored
- Add #ifdef __KERNEL__ - Change __inline__ to inline for __KERNEL__ portion. - Remove RCS ID string. Signed-off-by: Hirokazu Takata <takata@linux-m32r.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Hirokazu Takata authored
- Remove _PAGE_USER bit from pte. - The m32r doesn't support _PAGE_USER bit by hardware. Signed-off-by: Hirokazu Takata <takata@linux-m32r.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Hirokazu Takata authored
- Support PAGE_NONE attribute for memory protection. - Add _PAGE_PROTNONE bit to pte (software bit). Signed-off-by: NIIBE Yutaka <gniibe@fsij.org> Signed-off-by: Hirokazu Takata <takata@linux-m32r.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Hirokazu Takata authored
- Change PAGE_*_X to PAGE_*_EXEC for good readability. - Add #include __KERNEL__ - Change __inline__ to inline for the __KERNEL__ portion. Signed-off-by: Hirokazu Takata <takata@linux-m32r.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Hirokazu Takata authored
- Fix a typo: ACE_USEMODE --> ACE_USERMODE. - Update copyright statement, and so on. Signed-off-by: Hirokazu Takata <takata@linux-m32r.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Hirokazu Takata authored
- To be more comprehensive, keep ACE_INSTRUCTION (access exception on instruction execution) information in thread_info->flags, instead of encoding it into address parameter. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org> Signed-off-by: Hirokazu Takata <takata@linux-m32r.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Hirokazu Takata authored
- Cause a segmentation fault for an illegal execution of a code on non-executable memory page. Signed-off-by: Naoto Sugai <sugai@isl.melco.co.jp> Signed-off-by: Hirokazu Takata <takata@linux-m32r.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Hirokazu Takata authored
This patch updates ptrace.c to support multithread debugging. So far, only one breakpoint's location was kept by kernel, however, in the multithreaded application's debug, it is required to kept multi-point breakpoint locations by kernel. In this implementation, maximum number of MAX_TRAPS(=10 (by default)) breakpoint's information will be kept in the "debug_trap" member of the thread_struct for each thread. * include/asm-m32r/processor.h: Modify debug_trap struct to keep multipoint breakpoint locations for multithread debugging. * arch/m32r/kernel/ptrace.c: - Update to support multithread debugging. - Remove unused functions, withdraw_debug_trap_for_signal() and embed_debug_trap_for_signal(). Signed-off-by: Kei Sakamoto <ksakamot@linux-m32r.org> Signed-off-by: Hirokazu Takata <takata@linux-m32r.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Hirokazu Takata authored
This patch updates include/asm-m32r/pgtable.h to add pgprot_noncached(). It is required to fix a problem of an userspace application, which mmaps io registers. This patch also modifies drivers/video/fbmem.c to support noncachable framebuffer access for m32r. In this routine, pgprot_writecombine() is used hopefully, even though the current m32r never does write-combining or write-coalescing... Please apply this. * include/asm-m32r/pgtable.h (pgprot_noncached, pgprot_writecombine): Newly added. * drivers/video/fbmem.c (fb_mmap): Add m32r support. Signed-off-by: Mamoru Sakugawa <sakugawa@linux-m32r.org> Signed-off-by: Hirokazu Takata <takata@linux-m32r.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Hirokazu Takata authored
include/asm-m32r/elf.h: Add relocations R_M32R_GOTOFF_HI_ULO, R_M32R_GOTOFF_HI_SLO, and R_M32R_GOTOFF_LO. These relocations are required to implement GOTOFF support for m32r. Signed-off-by: Hirokazu Takata <takata@linux-m32r.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Andrew Morton authored
In file included from include/linux/ptrace.h:77, from arch/ppc64/lib/sstep.c:12: include/linux/sched.h: In function `freeze_processes': include/linux/sched.h:1189: warning: no return statement in function returning non-void Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Pavel Machek authored
This moves refrigerator changes to sched.h, so that every file user of refrigerator does not have to include suspend.h, and makes refrigerator support easier by introducing try_to_freeze. Adapted from patch by Nigel Cunningham Signed-off-by: Pavel Machek <pavel@suse.cz> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Pavel Machek authored
Some machines are spending minutes of CPU time during suspend in stupid O(n^2) algorithm. This patch replaces it with O(n) algorithm, making swsusp usable to some people. Signed-off-by: Pavel Machek <pavel@suse.cz> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Pavel Machek authored
This adds statics at few places and fixes stale references to pmdisk. Signed-off-by: Pavel Machek <pavel@suse.cz> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Pavel Machek authored
swsusp contains few one-line helpers that only make reading/understanding code more difficult. Also warn the user when something goes wrong, instead of waking machine with corrupt data. Signed-off-by: Pavel Machek <pavel@suse.cz> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Pavel Machek authored
Variable used only for writing is bad idea. Signed-off-by: Pavel Machek <pavel@suse.cz> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Pavel Machek authored
At few points we still reference to swsusp as "pmdisk"... it might confuse someone not knowing full history. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-