1. 06 2月, 2008 7 次提交
    • J
      uml: use ptrace directly in libc code · d25f2e12
      Jeff Dike 提交于
      Some register accessor cleanups -
      	userspace() was calling restore_registers and save_registers for no
      reason, since userspace() is on the libc side of the house, and these
      add no value over calling ptrace directly
      	init_thread_registers and get_safe_registers were the same thing,
      so init_thread_registers is gone
      Signed-off-by: NJeff Dike <jdike@linux.intel.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d25f2e12
    • J
      uml: current.h cleanup · a5a678c8
      Jeff Dike 提交于
      Tidy current-related stuff.  There was a comment in current.h saying
      that current_thread was obsolete, so this patch turns all instances of
      current_thread into current_thread_info().  There's some simplifying
      of the result in arch/um/sys-i386/signal.c.
      
      current.h and thread_info also get style cleanups.
      Signed-off-by: NJeff Dike <jdike@linux.intel.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a5a678c8
    • J
      uml: header untangling · 8192ab42
      Jeff Dike 提交于
      Untangle UML headers somewhat and add some includes where they were
      needed explicitly, but gotten accidentally via some other header.
      
      arch/um/include/um_uaccess.h loses asm/fixmap.h because it uses no
      fixmap stuff and gains elf.h, because it needs FIXADDR_USER_*, and
      archsetjmp.h, because it needs jmp_buf.
      
      pmd_alloc_one is uninlined because it needs mm_struct, and that's
      inconvenient to provide in asm-um/pgtable-3level.h.
      
      elf_core_copy_fpregs is also uninlined from elf-i386.h and
      elf-x86_64.h, which duplicated the code anyway, to
      arch/um/kernel/process.c, so that the reference to current_thread
      doesn't pull sched.h or anything related into asm/elf.h.
      
      arch/um/sys-i386/ldt.c, arch/um/kernel/tlb.c and
      arch/um/kernel/skas/uaccess.c got sched.h because they dereference
      task_structs.  Its includes of linux and asm headers got turned from
      "" to <>.
      
      arch/um/sys-i386/bug.c gets asm/errno.h because it needs errno
      constants.
      
      asm/elf-i386 gets asm/user.h because it needs user_regs_struct.
      
      asm/fixmap.h gets page.h because it needs PAGE_SIZE and PAGE_MASK and
      system.h for BUG_ON.
      
      asm/pgtable doesn't need sched.h.
      
      asm/processor-generic.h defined mm_segment_t, but didn't use it.  So,
      that definition is moved to uaccess.h, which defines a bunch of
      mm_segment_t-related stuff.  thread_info.h uses mm_segment_t, and
      includes uaccess.h, which causes a recursion.  So, the definition is
      placed above the include of thread_info. in uaccess.h.  thread_info.h
      also gets page.h because it needs PAGE_SIZE.
      
      ObCheckpatchViolationJustification - I'm not adding a typedef; I'm
      moving mm_segment_t from one place to another.
      Signed-off-by: NJeff Dike <jdike@linux.intel.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8192ab42
    • J
      uml: move um_virt_to_phys · 9157f90f
      Jeff Dike 提交于
      This patchset makes UML build and run with three-level page tables on
      32-bit hosts.  This is an uncommon use case, but the code here needed
      fixing and cleaning up, so 32-bit three-level pages tables were tested
      to make sure the changes are good.
      
      Patch 1 - code movement
      Patch 2 - header untangling
      Patch 3 - style fixups in files affected so far
      Patch 4 - clean up use of current.h
      Patch 5 - fix sizes of types that are different between 2 and 3-level
      	page tables - three-level page table support should build at
      	this point
      Patch 6 - tidy (i.e. eliminate much of) the code that figures out how
      	big the address space is
      Patch 7 - change um_virt_to_phys into virt_to_pte, clean its
      	interface, and clean its (so far) one caller
      Patch 8 - the stub pages are covered with a VMA, allowing some nasty
      	code to be thrown out - three-level page tables now work
      
      This patch:
      
      um_virt_to_phys only has one user, so it can be moved to the same file
      and made static.  Its declarations in pgtable.h and ksyms.c are also
      gone.
      
      current_cmd was another apparent user, but it itself isn't used, so it
      is deleted.
      Signed-off-by: NJeff Dike <jdike@linux.intel.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      9157f90f
    • K
      uml: remove unused variables in the context switcher · 291248fd
      Karol Swietlicki 提交于
      This patch removes a variable which was not used in two functions.  Yet
      another code cleanup, nothing really significant.
      
      Please note that I could not test this on x86_64. I don't have the
      hardware for it.
      
      [ jdike - Bits of tidying around the affected code.  Also, it's fine on
      x86_64 ]
      Signed-off-by: NKarol Swietlicki <magotari@gmail.com>
      Signed-off-by: NJeff Dike <jdike@linux.intel.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      291248fd
    • W
      uml: const and other tidying · c0a9290e
      WANG Cong 提交于
      This patch also does some improvements for uml code.  Improvements include
      dropping unnecessary cast, killing some unnecessary code and still some
      constifying for pointers etc..
      Signed-off-by: NWANG Cong <xiyou.wangcong@gmail.com>
      Signed-off-by: NJeff Dike <jdike@linux.intel.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c0a9290e
    • J
      uml: implement get_wchan · c1127465
      Jeff Dike 提交于
      Implement get_wchan - the algorithm is similar to x86.  It starts with the
      stack pointer of the process in question and looks above that for addresses
      that are kernel text.  The second one which isn't in the scheduler is the one
      that's returned.  The first one is ignored because that will be UML's own
      context switching routine.
      Signed-off-by: NJeff Dike <jdike@linux.intel.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c1127465
  2. 17 10月, 2007 9 次提交
    • J
      uml: eliminate interrupts in the idle loop · b160fb63
      Jeff Dike 提交于
      Now, the idle loop now longer needs SIGALRM firing - it can just sleep for the
      requisite amount of time and fake a timer interrupt when it finishes.
      
      Any use of ITIMER_REAL now goes away.  disable_timer only turns off
      ITIMER_VIRTUAL.  switch_timers is no longer needed, so it, and all calls, goes
      away.
      
      disable_timer now returns the amount of time remaining on the timer.
      default_idle uses this to tell idle_sleep how long to sleep.  idle_sleep will
      call alarm_handler if nanosleep returns 0, which is the case if it didn't
      return early due to an interrupt.  Otherwise, it just returns.
      Signed-off-by: NJeff Dike <jdike@linux.intel.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b160fb63
    • J
      uml: tickless support · d2753a6d
      Jeff Dike 提交于
      Enable tickless support.
      
      CONFIG_TICK_ONESHOT and CONFIG_NO_HZ are enabled.
      
      itimer_clockevent gets CLOCK_EVT_FEAT_ONESHOT and an implementation of
      .set_next_event.
      
      CONFIG_UML_REAL_TIME_CLOCK goes away because it only makes sense when there is
      a clock ticking away all the time.  timer_handler now just calls do_IRQ once
      without trying to figure out how many ticks to emulate.
      
      The idle loop now needs to turn ticking on and off.
      
      Userspace ticks keep happening as usual.  However, the userspace loop keep
      track of when the next wakeup should happen and suppresses process ticks until
      that happens.
      Signed-off-by: NJeff Dike <jdike@linux.intel.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d2753a6d
    • J
      uml: fix timer switching · 181bde80
      Jeff Dike 提交于
      Fix up the switching between virtual and real timers.  The idle loop sleeps,
      so the timer at that point must be real time.  At all other times, the timer
      must be virtual.  Even when userspace is running, and the kernel is asleep,
      the virtual timer is correct because the process timer will be running and the
      process timer will be firing.
      
      The timer switch used to be in the context switch and timer handler code.
      This is moved to the idle loop and the signal handler, making it much more
      clear why it is happening.
      
      switch_timers now returns the old timer type so that it may be restored.  The
      signal handler uses this in order to restore the previous timer type when it
      returns.
      Signed-off-by: NJeff Dike <jdike@linux.intel.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      181bde80
    • J
      uml: rename pt_regs general-purpose register file · 18baddda
      Jeff Dike 提交于
      Before the removal of tt mode, access to a register on the skas-mode side of a
      pt_regs struct looked like pt_regs.regs.skas.regs.regs[FOO].  This was bad
      enough, but it became pt_regs.regs.regs.regs[FOO] with the removal of the
      union from the middle.  To get rid of the run of three "regs", the last field
      is renamed to "gp".
      Signed-off-by: NJeff Dike <jdike@linux.intel.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      18baddda
    • J
      uml: style fixes pass 3 · ba180fd4
      Jeff Dike 提交于
      Formatting changes in the files which have been changed in the course
      of folding foo_skas functions into their callers.  These include:
      	copyright updates
      	header file trimming
      	style fixes
      	adding severity to printks
      
      These changes should be entirely non-functional.
      Signed-off-by: NJeff Dike <jdike@linux.intel.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      ba180fd4
    • J
      uml: remove code made redundant by CHOOSE_MODE removal · 77bf4400
      Jeff Dike 提交于
      This patch makes a number of simplifications enabled by the removal of
      CHOOSE_MODE.  There were lots of functions that looked like
      
      	int foo(args){
      		foo_skas(args);
      	}
      
      The bodies of foo_skas are now folded into foo, and their declarations (and
      sometimes entire header files) are deleted.
      
      In addition, the union uml_pt_regs, which was a union between the tt and skas
      register formats, is now a struct, with the tt-mode arm of the union being
      removed.
      
      It turns out that usr2_handler was unused, so it is gone.
      Signed-off-by: NJeff Dike <jdike@linux.intel.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      77bf4400
    • J
      uml: throw out CHOOSE_MODE · 6aa802ce
      Jeff Dike 提交于
      The next stage after removing code which depends on CONFIG_MODE_TT is removing
      the CHOOSE_MODE abstraction, which provided both compile-time and run-time
      branching to either tt-mode or skas-mode code.
      
      This patch removes choose-mode.h and all inclusions of it, and replaces all
      CHOOSE_MODE invocations with the skas branch.  This leaves a number of trivial
      functions which will be dealt with in a later patch.
      
      There are some changes in the uaccess and tls support which go somewhat beyond
      this and eliminate some of the now-redundant functions.
      Signed-off-by: NJeff Dike <jdike@linux.intel.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      6aa802ce
    • J
      uml: throw out CONFIG_MODE_TT · 42fda663
      Jeff Dike 提交于
      This patchset throws out tt mode, which has been non-functional for a while.
      
      This is done in phases, interspersed with code cleanups on the affected files.
      
      The removal is done as follows:
      	remove all code, config options, and files which depend on
      CONFIG_MODE_TT
      	get rid of the CHOOSE_MODE macro, which decided whether to
      call tt-mode or skas-mode code, and replace invocations with their
      skas portions
      	replace all now-trivial procedures with their skas equivalents
      
      There are now a bunch of now-redundant pieces of data structures, including
      mode-specific pieces of the thread structure, pt_regs, and mm_context.  These
      are all replaced with their skas-specific contents.
      
      As part of the ongoing style compliance project, I made a style pass over all
      files that were changed.  There are three such patches, one for each phase,
      covering the files affected by that phase but no later ones.
      
      I noticed that we weren't freeing the LDT state associated with a process when
      it exited, so that's fixed in one of the later patches.
      
      The last patch is a tidying patch which I've had for a while, but which caused
      inexplicable crashes under tt mode.  Since that is no longer a problem, this
      can now go in.
      
      This patch:
      
      Start getting rid of tt mode support.
      
      This patch throws out CONFIG_MODE_TT and all config options, code, and files
      which depend on it.
      
      CONFIG_MODE_SKAS is gone and everything that depends on it is included
      unconditionally.
      
      The few changed lines are in re-written Kconfig help, lines which needed
      something skas-related removed from them, and a few more which weren't
      strictly deletions.
      Signed-off-by: NJeff Dike <jdike@linux.intel.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      42fda663
    • J
      uml: stop specially protecting kernel stacks · 5c8aacea
      Jeff Dike 提交于
      Map all of physical memory as executable to avoid having to change stack
      protections during fork and exit.
      
      unprotect_stack is now called only from MODE_TT code, so it is marked as such.
      Signed-off-by: NJeff Dike <jdike@linux.intel.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      5c8aacea
  3. 17 7月, 2007 1 次提交
    • J
      uml: Eliminate kernel allocator wrappers · e4c4bf99
      Jeff Dike 提交于
      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: NJeff Dike <jdike@linux.intel.com>
      Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e4c4bf99
  4. 08 5月, 2007 5 次提交
  5. 21 10月, 2006 1 次提交
  6. 27 9月, 2006 1 次提交
  7. 26 9月, 2006 1 次提交
  8. 01 4月, 2006 3 次提交
  9. 19 1月, 2006 2 次提交
  10. 13 1月, 2006 1 次提交
  11. 09 1月, 2006 1 次提交
  12. 07 1月, 2006 1 次提交
    • J
      [PATCH] uml: separate libc-dependent umid code · 2264c475
      Jeff Dike 提交于
      I reworked Gennady's umid OS abstraction patch because the code shouldn't
      be moved entirely to os.  As it turns out, I moved most of it anyway.  This
      patch is the minimal one needed to move the code and have it work.
      It turns out that the concept of the umid is OS-independent, but
      almost everything else about the implementation is OS-dependent.
      
      This is code movement without cleanup - a follow-on patch tidies
      everything up without shuffling code around.
      Signed-off-by: NJeff Dike <jdike@addtoit.com>
      Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      2264c475
  13. 30 10月, 2005 1 次提交
  14. 28 10月, 2005 1 次提交
  15. 23 9月, 2005 1 次提交
  16. 18 9月, 2005 2 次提交
    • J
      [PATCH] uml: breakpoint an arbitrary thread · 3eddddcf
      Jeff Dike 提交于
      This patch implements a stack trace for a thread, not unlike sysrq-t does.
      The advantage to this is that a break point can be placed on showreqs, so that
      upon showing the stack, you jump immediately into the debugger.  While sysrq-t
      does the same thing, sysrq-t shows *all* threads stacks.  It also doesn't work
      right now.  In the future, I thought it might be acceptable to make this show
      all pids stacks, but perhaps leaving well enough alone and just using sysrq-t
      would be okay.  For now, upon receiving the stack command, UML switches
      context to that thread, dumps its registers, and then switches context back to
      the original thread.  Since UML compacts all threads into one of 4 host
      threads, this sort of mechanism could be expanded in the future to include
      other debugging helpers that sysrq does not cover.
      
      Note by jdike - The main benefit to this is that it brings an arbitrary thread
      back into context, where it can be examined by gdb.  The fact that it dumps it
      stack is secondary.  This provides the capability to examine a sleeping
      thread, which has existed in tt mode, but not in skas mode until now.
      
      Also, the other threads, that sysrq doesn't cover, can be gdb-ed directly
      anyway.
      
      Signed-off-by: Allan Graves<allan.graves@gmail.com>
      Signed-off-by: NJeff Dike <jdike@addtoit.com>
      Cc: Paolo Giarrusso <blaisorblade@yahoo.it>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      3eddddcf
    • J
      [PATCH] uml: _switch_to code consolidation · f6e34c6a
      Jeff Dike 提交于
      This patch moves code that is in both switch_to_tt and switch_to_skas to the
      top level _switch_to function, keeping us from duplicating code.  It is
      required for the stack trace patch to work properly.
      Signed-off-by: NAllan Graves <allan.graves@gmail.com>
      Signed-off-by: NJeff Dike <jdike@addtoit.com>
      Cc: Paolo Giarrusso <blaisorblade@yahoo.it>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      f6e34c6a
  17. 29 7月, 2005 1 次提交
  18. 26 6月, 2005 1 次提交