An error occurred fetching the project authors.
  1. 27 Jun, 2004 1 commit
  2. 18 Jun, 2004 2 commits
  3. 04 Jun, 2004 1 commit
    • Jonathan Corbet's avatar
      [PATCH] Module section offsets in /sys/module · 3f7b0672
      Jonathan Corbet authored
      So here I am trying to write about how one can apply gdb to a running
      kernel, and I'd like to tell people how to debug loadable modules.  Only
      with the 2.6 module loader, there's no way to find out where the various
      sections in the module image ended up, so you can't do much.  This patch
      attempts to fix that by adding a "sections" subdirectory to every module's
      entry in /sys/module; each attribute in that directory associates a
      beginning address with the section name.  Those attributes can be used by a
      a simple script to generate an add-symbol-file command for gdb, something
      like:
      
      #!/bin/bash
      #
      # gdbline module image
      #
      # Outputs an add-symbol-file line suitable for pasting into gdb to examine
      # a loaded module.
      #
      cd /sys/module/$1/sections
      echo -n add-symbol-file $2 `/bin/cat .text`
      
      for section in .[a-z]* *; do
          if [ $section != ".text" ]; then
      	echo  " \\"
      	echo -n "	-s" $section `/bin/cat $section`
          fi
      done
      echo
      
      Currently, this feature is absent if CONFIG_KALLSYMS is not set.  I do
      wonder if CONFIG_DEBUG_INFO might not be a better choice, now that I think
      about it.  Section names are unmunged, so "ls -a" is needed to see most of
      them.
      Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
      3f7b0672
  4. 15 May, 2004 1 commit
    • Andrew Morton's avatar
      [PATCH] implement print_modules() · 22e1c5c4
      Andrew Morton authored
      From: Arjan van de Ven <arjanv@redhat.com>,
            Rusty Russell <rusty@rustcorp.com.au>
      
      The patch below resolves the "Not Yet Implemented" print_modules() thing.
      This is a really useful feature for distros; it allows us to do statistical
      analysis on which modules are present how often in oopses compared to how
      often they are used normally.  In addition it helps to spot candidates for
      certain bugs without having to go back to the customer asking for this
      information.
      22e1c5c4
  5. 11 May, 2004 1 commit
  6. 10 May, 2004 1 commit
    • Andrew Morton's avatar
      [PATCH] Only Print Taint Message Once · d137ab48
      Andrew Morton authored
      From: Rusty Russell <rusty@rustcorp.com.au>
      
      Only print the tainted message the first time.  Its purpose is to warn
      users that we can't support them, not to fill their logs.
      d137ab48
  7. 07 May, 2004 1 commit
    • Greg Kroah-Hartman's avatar
      Add modules to sysfs · b863a25d
      Greg Kroah-Hartman authored
      This patch adds basic kobject support to struct module, and it creates a 
      /sys/module directory which contains all of the individual modules.  Each
      module currently exports the refcount (if they are unloadable) and any
      module paramaters that are marked exportable in sysfs.
      
      Was written by me and Rusty over and over many times during the past 6 months.
      b863a25d
  8. 19 Apr, 2004 1 commit
  9. 18 Apr, 2004 1 commit
  10. 12 Apr, 2004 1 commit
  11. 15 Mar, 2004 1 commit
    • Andrew Morton's avatar
      [PATCH] fix for kallsyms module symbol resolution problem · a8b9e8d7
      Andrew Morton authored
      From:  Rusty Russell <rusty@rustcorp.com.au>
      
      Fix a problem with kallsyms being unable to look up symbols which are in
      modules.
      
      add_kallsyms should be above module_finalize, which means you can just use
      the mod->symtab and mod->strtab members.
      a8b9e8d7
  12. 14 Mar, 2004 1 commit
    • Andrew Morton's avatar
      [PATCH] module unload deadlock fix · 3e4ea6c8
      Andrew Morton authored
      From: Rusty Russell <rusty@rustcorp.com.au>
      
      From: Andrea Arcangeli <andrea@suse.de>
      
      We should drop module sem before calling mod->exit, for practical reasons:
      too many module exit functions oops or hang, resulting in a permenantly held
      module sem, which blocks all module ops including lsmod.
      3e4ea6c8
  13. 08 Mar, 2004 1 commit
  14. 26 Feb, 2004 1 commit
    • Andrew Morton's avatar
      [PATCH] Add kallsyms_lookupname() · f46981b2
      Andrew Morton authored
      From: Rusty Russell <rusty@au1.ibm.com>
      
      Attached patch adds a kallsyms_lookupname() function for lookups of a
      symbol name to an address.  Debuggers such as ppc[64] xmon can use this.
      
      It's intentionally not exported as a symbol for module use, since it
      can be used to circumvent other symbol export restrictions.
      f46981b2
  15. 25 Feb, 2004 1 commit
    • Andrew Morton's avatar
      [PATCH] add syscalls.h · 0bab0642
      Andrew Morton authored
      From: "Randy.Dunlap" <rddunlap@osdl.org>
      
      Add syscalls.h, which contains prototypes for the kernel's system calls.
      Replace open-coded declarations all over the place.  This patch found a
      couple of prior bugs.  It appears to be more important with -mregparm=3 as we
      discover more asmlinkage mismatches.
      
      Some syscalls have arch-dependent arguments, so their prototypes are in the
      arch-specific unistd.h.  Maybe it should have been asm/syscalls.h, but there
      were already arch-specific syscall prototypes in asm/unistd.h...
      
      Tested on x86, ia64, x86_64, ppc64, s390 and sparc64.  May cause
      trivial-to-fix build breakage on other architectures.
      0bab0642
  16. 18 Feb, 2004 1 commit
    • Andrew Morton's avatar
      [PATCH] kthread primitive · 933ba102
      Andrew Morton authored
      From: Rusty Russell <rusty@rustcorp.com.au>
      
      These two patches provide the framework for stopping kernel threads to
      allow hotplug CPU.  This one just adds kthread.c and kthread.h, next
      one uses it.
      
      Most importantly, adds a Monty Python quote to the kernel.
      
      Details:
      
      The hotplug CPU code introduces two major problems:
      
      1) Threads which previously never stopped (migration thread,
         ksoftirqd, keventd) have to be stopped cleanly as CPUs go offline.
      2) Threads which previously never had to be created now have
         to be created when a CPU goes online.
      
      Unfortunately, stopping a thread is fairly baroque, involving memory
      barriers, a completion and spinning until the task is actually dead
      (for example, complete_and_exit() must be used if inside a module).
      
      There are also three problems in starting a thread:
      1) Doing it from a random process context risks environment contamination:
         better to do it from keventd to guarantee a clean environment, a-la
         call_usermodehelper.
      2) Getting the task struct without races is a hard: see kernel/sched.c
         migration_call(), kernel/workqueue.c create_workqueue_thread().
      3) There are races in starting a thread for a CPU which is not yet
         online: migration thread does a complex dance at the moment for
         a similar reason (there may be no migration thread to migrate us).
      
      Place all this logic in some primitives to make life easier:
      kthread_create() and kthread_stop().  These primitives require no
      extra data-structures in the caller: they operate on normal "struct
      task_struct"s.
      
      Other changes:
      
      - Expose keventd_up(), as keventd and migration threads will use kthread to
        launch, and kthread normally uses workqueues and must recognize this case.
      
      - Kthreads created at boot before "keventd" are spawned directly.  However,
        this means that they don't have all signals blocked, and hence can be
        killed.  The simplest solution is to always explicitly block all signals in
        the kthread.
      
      - Change over the migration threads, the workqueue threads and the
        ksoftirqd threads to use kthread.
      
      - module.c currently spawns threads directly to stop the machine, so a
        module can be atomically tested for removal.
      
      - Unfortunately, this means that the current task is manipulated (which
        races with set_cpus_allowed, for example), and it can't set its priority
        artificially high.  Using a kernel thread can solve this cleanly, and with
        kthread_run, it's simple.
      
      - kthreads use keventd, so they inherit its cpus_allowed mask.  Unset it.
        All current users set it explicity anyway, but it's nice to fix.
      
      - call_usermode_helper uses keventd, so the process created inherits its
        cpus_allowed mask.  Unset it.
      
      - Prevent errors in boot when cpus_possible() contains a cpu which is not
        online (ie.  a cpu didn't come up).  This doesn't happen on x86, since a
        boot failure makes that CPU no longer possible (hacky, but it works).
      
      - When the cpu fails to come up, some callbacks do kthread_stop(), which
        doesn't work without keventd (which hasn't started yet).  Call it directly,
        and take care that it restores signal state (note: do_sigaction does a
        flush on blocked signals, so we don't need to repeat it).
      933ba102
  17. 04 Feb, 2004 1 commit
    • Andrew Morton's avatar
      [PATCH] lock_cpu_hotplug only if CONFIG_CPU_HOTPLUG · 5d790751
      Andrew Morton authored
      From: Rusty Russell <rusty@rustcorp.com.au>
      
      The cpucontrol mutex is not required when no cpus can go up and down.
      Andrew wrote a wrapper for it to avoid #ifdefs, this expands that to only
      be defined for CONFIG_HOTPLUG_CPU, and uses it everywhere.
      
      The only downside is that the cpucontrol lock was overloaded by my recent
      patch to net/core/flow.c to protect it from reentrance, so this
      reintroduces the local flow_flush_sem.  This code isn't speed critical, so
      taking two locks when CONFIG_HOTPLUG_CPU=y is not really an issue.
      5d790751
  18. 20 Jan, 2004 1 commit
    • Andrew Morton's avatar
      [PATCH] check for truncated modules · 8413db43
      Andrew Morton authored
      From: Rusty Russell <rusty@rustcorp.com.au>
      
      I *do* want to add a check for a truncated module, since that's probably
      the most common case (^C on "make modules_install").  But I don't want to
      double the size of module.c with every check I can think of.
      
      tested with:
      # bs=0; while [ $bs -lt 3764 ]; do
         dd if=dummy.ko bs=$bs count=1 2>/dev/null | insmod -;
         bs=`expr $bs + 1`;
        done
      8413db43
  19. 19 Jan, 2004 2 commits
    • Paul Mackerras's avatar
      [PATCH] sort exception tables · 35b93751
      Paul Mackerras authored
      This patch arranges for the exception tables to be sorted on most
      architectures.  It sorts the main kernel exception table on startup
      and the module exception tables when they get loaded.  The main table
      is sorted reasonably early - just after kmem_cache_init - but that
      could be moved even earlier if necessary.
      
      There is now a lib/extable.c which includes the sort_extable()
      function from arch/ppc/mm/extable.c and the search_extable() function
      from arch/i386/mm/extable.c, which had been copied to many
      architectures.  On many architectures, arch/$(ARCH)/mm/extable.c
      became empty and so I have removed it.
      
      There are four architectures which do things differently from i386:
      alpha, ia64, sparc and sparc64.  Alpha and ia64 store the offset from
      the offset from the exception table entry to the instruction, and
      sparc and sparc64 have range entries in the table.  For those
      architectures I have added empty sort_extable functions.  The
      maintainers for those architectures can implement something better if
      they care to.  As it is they are no worse off than before.
      
      Although it is a moderately sizable patch, it ends up with a net
      reduction of 377 lines in the size of the kernel source. :)
      
      I have tested this on x86 and ppc with a module that uses __get_user
      in an init function, deliberately laid out to get the exception table
      out of order, and it works (whereas it oopsed without this patch).
      35b93751
    • Andrew Morton's avatar
      [PATCH] module removal race fix · 52db2a96
      Andrew Morton authored
      From: Rusty Russell <rusty@au1.ibm.com>
      
      Vatsa spotted this: you can remove a module while it's being initialized,
      and that will be bad.  Hole was opened when I dropped the sem around the
      init routine (which can probe for other modules).
      52db2a96
  20. 07 Jan, 2004 1 commit
  21. 29 Oct, 2003 1 commit
    • Rusty Russell's avatar
      [PATCH] Fix for module initialization failure · a8f97595
      Rusty Russell authored
      Bug reported by Paul Mackerras: if a module parameter fails, we didn't
      call module_arch_cleanup().
      
      On x86 this was harmless (module_arch_cleanup() is a no-op), but on
      other architectures like PPC this causes inconsistent data structures
      and subsequent oopses.
      a8f97595
  22. 09 Oct, 2003 1 commit
    • Rusty Russell's avatar
      [PATCH] More barriers in module code. · fe3f6208
      Rusty Russell authored
      Paul McKenney convinced me that there's no *guarantee* that all archs
      will refuse the speculate the atomic ops above the state test, eg:
      
      CPU0 (stopref_set_state)		CPU1 (stopref)
      
       atomic_set(&ack, 0);			if (state == XXX)
       wmb();						atomic_inc(&ack);
       state = XXX;
      
      Certainly Alpha needs a rmb() inside stopref to guarantee it sees
      the same ordering.
      fe3f6208
  23. 01 Oct, 2003 1 commit
    • Andrew Morton's avatar
      [PATCH] module parameter array fixes · 206a70f2
      Andrew Morton authored
      From: Rusty Russell <rusty@rustcorp.com.au>
      
      Found this while converting netfilter modules to use the new
      parameters.  Also fixes an out-by-one error in maximum elements you
      can put in array.
      
      The current "intarray" module params were never tested, and um, suck.
      Only one person uses them, and it looks painful.
      
      Since noone uses them, replace them with tested versions.
      206a70f2
  24. 07 Sep, 2003 1 commit
  25. 18 Aug, 2003 1 commit
    • Andrew Morton's avatar
      [PATCH] cpumask_t: allow more than BITS_PER_LONG CPUs · bf8cb61f
      Andrew Morton authored
      From: William Lee Irwin III <wli@holomorphy.com>
      
      Contributions from:
      	Jan Dittmer <jdittmer@sfhq.hn.org>
      	Arnd Bergmann <arnd@arndb.de>
      	"Bryan O'Sullivan" <bos@serpentine.com>
      	"David S. Miller" <davem@redhat.com>
      	Badari Pulavarty <pbadari@us.ibm.com>
      	"Martin J. Bligh" <mbligh@aracnet.com>
      	Zwane Mwaikambo <zwane@linuxpower.ca>
      
      It has ben tested on x86, sparc64, x86_64, ia64 (I think), ppc and ppc64.
      
      cpumask_t enables systems with NR_CPUS > BITS_PER_LONG to utilize all their
      cpus by creating an abstract data type dedicated to representing cpu
      bitmasks, similar to fd sets from userspace, and sweeping the appropriate
      code to update callers to the access API.  The fd set-like structure is
      according to Linus' own suggestion; the macro calling convention to ambiguate
      representations with minimal code impact is my own invention.
      
      Specifically, a new set of inline functions for manipulating arbitrary-width
      bitmaps is introduced with a relatively simple implementation, in tandem with
      a new data type representing bitmaps of width NR_CPUS, cpumask_t, whose
      accessor functions are defined in terms of the bitmap manipulation inlines.
      This bitmap ADT found an additional use in i386 arch code handling sparse
      physical APIC ID's, which was convenient to use in this case as the
      accounting structure was required to be wider to accommodate the physids
      consumed by larger numbers of cpus.
      
      For the sake of simplicity and low code impact, these cpu bitmasks are passed
      primarily by value; however, an additional set of accessors along with an
      auxiliary data type with const call-by-reference semantics is provided to
      address performance concerns raised in connection with very large systems,
      such as SGI's larger models, where copying and call-by-value overhead would
      be prohibitive.  Few (if any) users of the call-by-reference API are
      immediately introduced.
      
      Also, in order to avoid calling convention overhead on architectures where
      structures are required to be passed by value, NR_CPUS <= BITS_PER_LONG is
      special-cased so that cpumask_t falls back to an unsigned long and the
      accessors perform the usual bit twiddling on unsigned longs as opposed to
      arrays thereof.  Audits were done with the structure overhead in-place,
      restoring this special-casing only afterward so as to ensure a more complete
      API conversion while undergoing the majority of its end-user exposure in -mm.
       More -mm's were shipped after its restoration to be sure that was tested,
      too.
      
      The immediate users of this functionality are Sun sparc64 systems, SGI mips64
      and ia64 systems, and IBM ia32, ppc64, and s390 systems.  Of these, only the
      ppc64 machines needing the functionality have yet to be released; all others
      have had systems requiring it for full functionality for at least 6 months,
      and in some cases, since the initial Linux port to the affected architecture.
      bf8cb61f
  26. 18 Jul, 2003 3 commits
    • Rusty Russell's avatar
      [PATCH] module_put_and_exit · f965803d
      Rusty Russell authored
      Author: Neil Brown
      
      Define module_put_and_exit() and use it for nfsd/lockd
      
      Both nfsd and lockd have threads which expect to hold a reference
      to the module while the thread is running.  In order for the thread
      to be able to put_module() the module before exiting, the
      put_module code must be call from outside the module.
      
      This patch provides module_put_and_exit in non-modular code which a
      thread-in-a-module can call.  It also gets nfsd and lockd to use it
      as appropriate.
      
      Note that in lockd, we can __get_module in the thread itself as the
      creator of the thread is waiting for the thread to startup.
      
      In nfsd and for the 'reclaimer' threaded started by locked, we
      __get_module first and put_module if the thread failed to start.
      f965803d
    • Rusty Russell's avatar
      [PATCH] Make rmmod -f taint kernel. · dc33faea
      Rusty Russell authored
      Somehow, the code which taints the kernel when rmmod -f is used got
      lost.  Restore it.
      dc33faea
    • Rusty Russell's avatar
      [PATCH] Resolve module local_t conflict · 518538b3
      Rusty Russell authored
      Uses local_t for module reference counts.
      518538b3
  27. 01 Jul, 2003 1 commit
  28. 10 Jun, 2003 1 commit
    • Rusty Russell's avatar
      [PATCH] Fix module load failure case · 2c435ad4
      Rusty Russell authored
      Milton Miller noticed a free-after-use problem in the cleanup path of a
      failed module load.
      
      The problem is that mod is moved to point from the sucked-in file
      (always freed last) to the module core, after which time the
      "free(mod->core), reference mod->percpu" sequence is bogus, eg.  when
      the module_init function fails.
      
      This is fixed by keeping the pointer in a local variable, which solves
      the problem. We no longer need to reference the free'd data structure.
      2c435ad4
  29. 07 Jun, 2003 1 commit
  30. 06 Jun, 2003 2 commits
    • Rusty Russell's avatar
      [PATCH] kallsyms in proc · 51726557
      Rusty Russell authored
       This adds a /proc/kallsyms if you have CONFIG_KALLSYMS in your
      kernel.  The output is nm-like, with symbols in caps (global) if
      exported using EXPORT_SYMBOL, rather than the normal static
      vs. non-static differentiation.
      
      This is useful for things like performance monitoring tools (profiling
      etc) that want to match addresses to names in user space.
      51726557
    • Andrew Morton's avatar
      [PATCH] per-cpu support inside modules (minimal) · 21af2f02
      Andrew Morton authored
      From: Rusty Russell <rusty@rustcorp.com.au>
      
      OK, this does the *minimum* required to support DEFINE_PER_CPU inside
      modules.  If we decide to change kmalloc_percpu later, great, we can turf
      this out.
      
      Basically, overallocates the amount of per-cpu data at boot to at least
      PERCPU_ENOUGH_ROOM if CONFIG_MODULES=y (arch-specific by default 32k: I have
      only 7744 bytes of percpu data in my kernel here, so makes sense), and a
      special allocator in module.c dishes it out.
      21af2f02
  31. 12 May, 2003 2 commits
    • Andrew Morton's avatar
      [PATCH] Bump module ref during init. · db378f4d
      Andrew Morton authored
      From: Rusty Russell <rusty@rustcorp.com.au>
      
      __module_get is theoretically allowed on module inside init, since we
      already hold an implicit reference.  Currently this BUG()s: make the
      reference count explicit, which also simplifies delete path.  Also cleans
      up unload path, such that it only drops semaphore when it's actually
      sleeping for rmmod --wait.
      db378f4d
    • Andrew Morton's avatar
      [PATCH] implement module_arch_cleanup() in all architectures · b7df5197
      Andrew Morton authored
      From: Rusty Russell <rusty@rustcorp.com.au>, David Mosberger
      
      The patch below updates the other platforms with module_arch_cleanup().
      Also, I added more debug output to kernel/module.c since I found it useful
      to be able to see the final section layout.
      b7df5197
  32. 30 Apr, 2003 2 commits
    • Rusty Russell's avatar
      [PATCH] __module_get · fbf7eda6
      Rusty Russell authored
      Introduces __module_get for places where we know we already hold
      a reference and ignoring the fact that the module is being "rmmod --wait"ed
      is simpler.
      fbf7eda6
    • Rusty Russell's avatar
      [PATCH] complete modinfo section · 67ac5b86
      Rusty Russell authored
      Restores .modinfo section, and uses it to store license and vermagic.
      67ac5b86
  33. 15 Apr, 2003 1 commit
    • David Mosberger's avatar
      [PATCH] module symbol fix · f5d27787
      David Mosberger authored
      Fix for trivial typo.  Without it, you can't insert anything on top of
      agpgart.ko because the agp_register_driver() will erroneously pick up
      the symbol version from agp_backend_acquire().
      f5d27787