1. 09 1月, 2006 3 次提交
  2. 07 1月, 2006 4 次提交
    • J
      [PATCH] uml: umid cleanup · 7eebe8a9
      Jeff Dike 提交于
      This patch cleans up the umid code:
      
      - The only_if_set argument to get_umid is gone.
      
      - get_umid returns an empty string rather than NULL if there is no umid.
      
      - umid_is_random is gone since its users went away.
      
      - Some printfs were turned into printks because the code runs late enough
        that printk is working.
      
      - Error paths were cleaned up.
      
      - Some functions now return an error and let the caller print the error
        message rather than printing it themselves.  This eliminates the practice of
        passing a pointer to printf or printk in, depending on where in the boot
        process we are.
      
      - Major tidying of not_dead_yet - mostly error path cleanup, plus a comment
        explaining why it doesn't react to errors the way you might expect.
      
      - Calls to os_* interfaces that were moved under os are changed back to
        their native libc forms.
      
      - snprintf, strlcpy, and their bounds-checking friends are used more often,
        replacing by-hand bounds checking in some places.
      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>
      7eebe8a9
    • 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
    • J
      [PATCH] uml: Simplify console opening/closing and irq registration · 165dc591
      Jeff Dike 提交于
      This patch simplifies the opening and closing of host console devices and the
      registration and deregistration of IRQs.  The intent is to make it obvious
      that an IRQ can't exist without an open file descriptor.
      
      chan_enable will now open the channel, and when both opening and IRQ
      registration are desired, this should be used.  Opening only is done for the
      initial console, so that interface still needs to exist.
      
      The free_irqs_later interface is now gone.  It was intended to avoid freeing
      an IRQ while it was being processed.  It did this, but it didn't eliminate the
      possiblity of free_irq being called from an interrupt, which is bad.  In its
      place is a list of irqs to be freed, which is processed by the signal handler
      just before exiting.  close_one_chan now disables irqs.
      
      When a host device disappears, it is just closed, and that disables IRQs.
      
      The device id registered with the IRQ is now the chan structure, not the tty.
      This is because the interrupt arrives on a descriptor associated with the
      channel.  This caused equivalent changes in the arguments to line_timer_cb.
      line_disable is gone since it is not used any more.
      
      The count field in the line structure is gone.  tty->count is used instead.
      
      The complicated logic in sigio_handler with freeing IRQs when necessary and
      making sure its idea of the next irq is correct is now much simpler.  The irq
      list can't be rearranged underneath it, so it is now a simple list walk.
      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>
      165dc591
    • J
      [PATCH] uml: non-void functions should return something · 1b57e9c2
      Jeff Dike 提交于
      There are a few functions which are declared to return something, but don't.
      These are actually infinite loops which are forced to be declared as non-void.
       This makes them all return 0.
      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>
      1b57e9c2
  3. 19 12月, 2005 1 次提交
    • J
      [PATCH] uml skas0: stop gcc's insanity · 5b7b15af
      Jeff Dike 提交于
      With Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
      
      UML skas0 stub has been miscompiling for many people (incidentally not
      the authors), depending on the used GCC versions.
      
      I think (and testing on some GCC versions shows) this patch avoids the
      fundamental issue which is behind this, namely gcc using the stack when
      we have just replaced it, behind gcc's back.  The remapping and storage
      of the return value is hidden in a blob of asm, hopefully giving gcc no
      room for creativity.
      Signed-off-by: NPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      5b7b15af
  4. 13 12月, 2005 1 次提交
  5. 23 11月, 2005 2 次提交
    • J
      [PATCH] uml: eliminate use of libc PAGE_SIZE · aa1a64ee
      Jeff Dike 提交于
      On some systems, libc PAGE_SIZE calls getpagesize, which can't happen from a
      stub.  So, I use UM_KERN_PAGE_SIZE, which is less variable in its definition,
      instead.
      Signed-off-by: NJeff Dike <jdike@addtoit.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      aa1a64ee
    • J
      [PATCH] uml: eliminate use of local in clone stub · 39d730ab
      Jeff Dike 提交于
      We have a bug in the i386 stub_syscall6 which pushes ebp before the system
      call and pops it afterwards.  Because we use syscall6 to remap the stack, the
      old contents of the stack (and the former value of ebp) are no longer
      available.  Some versions of gcc make from a real local, accessed through ebp,
      despite my efforts to make it obvious that references to from are really
      constants.  This patch attempts to make it even more obvious by eliminating
      from and using a macro to access the stub's data explicitly with constants.
      
      My original thinking on this was to replace syscall6 with a remap_stack
      interface which saved ebp someplace and restored it afterwards.  The problem
      is that there are no registers to put it in, except for esp.  That could work,
      since we can store a constant in esp after the mmap because we just replaced
      the stack.  However, this approach seems a tad cleaner.
      Signed-off-by: NJeff Dike <jdike@addtoit.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      39d730ab
  6. 14 11月, 2005 2 次提交
    • P
      [PATCH] uml: fix access_ok · 7a590611
      Paolo 'Blaisorblade' Giarrusso 提交于
      The access_ok_tt() macro is bogus, in that a read access is unconditionally
      considered valid.
      
      I couldn't find in SCM logs the introduction of this check, but I went back to
      2.4.20-1um and the definition was the same.
      
      Possibly this was done to avoid problems with missing set_fs() calls, but
      there can't be any I think because they would fail with SKAS mode.
      TT-specific code is still to check.
      
      Also, this patch joins common code together, and makes the "address range
      wrapping" check happen for all cases, rather than for only some.
      
      This may, possibly, be reoptimized at some time, but the current code doesn't
      seem clever, just confused.
      
      * Important: I've also had to change references to access_ok_{tt,skas} back to
        access_ok - the kernel wasn't that happy otherwise.
      Signed-off-by: NPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
      Acked-by: NJeff Dike <jdike@addtoit.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      7a590611
    • P
      [PATCH] uml: remove bogus WARN_ON, triggerable harmlessly on a page fault race · cbc24afa
      Paolo 'Blaisorblade' Giarrusso 提交于
      The below warning was added in place of pte_mkyoung(); if (is_write)
      pte_mkdirty();
      
      In fact, if the PTE is not marked young/dirty, our dirty/accessed bit
      emulation would cause the TLB permission not to be changed, and so we'd loop,
      and given we don't support preemption yet, we'd busy-hang here.
      
      However, I've seen this warning trigger without crashes during a loop of
      concurrent kernel builds, at random times (i.e. like a race condition), and I
      realized that two concurrent faults on the same page, one on read and one on
      write, can trigger it. The read fault gets serviced and the PTE gets marked
      writable but clean (it's possible on a shared-writable mapping), while the
      generic code sees the PTE was already installed and returns without action. In
      this case, we'll see another fault and service it normally.
      Signed-off-by: NPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
      Acked-by: NJeff Dike <jdike@addtoit.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      cbc24afa
  7. 07 11月, 2005 9 次提交
  8. 31 10月, 2005 1 次提交
  9. 30 10月, 2005 4 次提交
    • H
      [PATCH] mm: split page table lock · 4c21e2f2
      Hugh Dickins 提交于
      Christoph Lameter demonstrated very poor scalability on the SGI 512-way, with
      a many-threaded application which concurrently initializes different parts of
      a large anonymous area.
      
      This patch corrects that, by using a separate spinlock per page table page, to
      guard the page table entries in that page, instead of using the mm's single
      page_table_lock.  (But even then, page_table_lock is still used to guard page
      table allocation, and anon_vma allocation.)
      
      In this implementation, the spinlock is tucked inside the struct page of the
      page table page: with a BUILD_BUG_ON in case it overflows - which it would in
      the case of 32-bit PA-RISC with spinlock debugging enabled.
      
      Splitting the lock is not quite for free: another cacheline access.  Ideally,
      I suppose we would use split ptlock only for multi-threaded processes on
      multi-cpu machines; but deciding that dynamically would have its own costs.
      So for now enable it by config, at some number of cpus - since the Kconfig
      language doesn't support inequalities, let preprocessor compare that with
      NR_CPUS.  But I don't think it's worth being user-configurable: for good
      testing of both split and unsplit configs, split now at 4 cpus, and perhaps
      change that to 8 later.
      
      There is a benefit even for singly threaded processes: kswapd can be attacking
      one part of the mm while another part is busy faulting.
      Signed-off-by: NHugh Dickins <hugh@veritas.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      4c21e2f2
    • H
      [PATCH] mm: uml kill unused · b38c6845
      Hugh Dickins 提交于
      In worrying over the various pte operations in different architectures, I came
      across some unused functions in UML: remove mprotect_kernel_vm,
      protect_vm_page and addr_pte.
      Signed-off-by: NHugh Dickins <hugh@veritas.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      b38c6845
    • H
      [PATCH] mm: uml pte atomicity · 8f5cd76c
      Hugh Dickins 提交于
      There's usually a good reason when a pte is examined without the lock; but it
      makes me nervous when the pointer is dereferenced more than once.
      Signed-off-by: NHugh Dickins <hugh@veritas.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      8f5cd76c
    • H
      [PATCH] mm: arches skip ptlock · b462705a
      Hugh Dickins 提交于
      Convert those few architectures which are calling pud_alloc, pmd_alloc,
      pte_alloc_map on a user mm, not to take the page_table_lock first, nor drop it
      after.  Each of these can continue to use pte_alloc_map, no need to change
      over to pte_alloc_map_lock, they're neither racy nor swappable.
      
      In the sparc64 io_remap_pfn_range, flush_tlb_range then falls outside of the
      page_table_lock: that's okay, on sparc64 it's like flush_tlb_mm, and that has
      always been called from outside of page_table_lock in dup_mmap.
      Signed-off-by: NHugh Dickins <hugh@veritas.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      b462705a
  10. 28 10月, 2005 1 次提交
  11. 05 10月, 2005 1 次提交
  12. 01 10月, 2005 2 次提交
  13. 30 9月, 2005 1 次提交
  14. 29 9月, 2005 1 次提交
    • A
      [PATCH] uml makefiles sanitized · ecba97d4
      Al Viro 提交于
      UML makefiles sanitized:
       - number of generated headers reduced to 2 (from user-offsets.c and
         kernel-offsets.c resp.).  The rest is made constant and simply
         includes those two.
       - mk_... helpers are gone now that we don't need to generate these
         headers
       - arch/um/include2 removed since everything under arch/um/include/sysdep
         is constant now and symlink can point straight to source tree.
       - dependencies seriously simplified.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      ecba97d4
  15. 23 9月, 2005 7 次提交