1. 04 Jan, 2009 7 commits
    • Heiko Carstens's avatar
      module: convert to stop_machine_create/destroy. · 9e01892c
      Heiko Carstens authored
      The module code relies on a non-failing stop_machine call. So we create
      the kstop threads in advance and with that make sure the call won't fail.
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      9e01892c
    • Heiko Carstens's avatar
      stop_machine: introduce stop_machine_create/destroy. · 9ea09af3
      Heiko Carstens authored
      Introduce stop_machine_create/destroy. With this interface subsystems
      that need a non-failing stop_machine environment can create the
      stop_machine machine threads before actually calling stop_machine.
      When the threads aren't needed anymore they can be killed with
      stop_machine_destroy again.
      
      When stop_machine gets called and the threads aren't present they
      will be created and destroyed automatically. This restores the old
      behaviour of stop_machine.
      
      This patch also converts cpu hotplug to the new interface since it
      is special: cpu_down calls __stop_machine instead of stop_machine.
      However the kstop threads will only be created when stop_machine
      gets called.
      
      Changing the code so that the threads would be created automatically
      on __stop_machine is currently not possible: when __stop_machine gets
      called we hold cpu_add_remove_lock, which is the same lock that
      create_rt_workqueue would take. So the workqueue needs to be created
      before the cpu hotplug code locks cpu_add_remove_lock.
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      9ea09af3
    • Helge Deller's avatar
      parisc: fix module loading failure of large kernel modules · c298be74
      Helge Deller authored
      On 32bit (and sometimes 64bit) and with big kernel modules like xfs or
      ipv6 the relocation types R_PARISC_PCREL17F and R_PARISC_PCREL22F may
      fail to reach their PLT stub if we only create one big stub array for
      all sections at the beginning of the core or init section.
      
      With this patch we now instead add individual PLT stub entries
      directly in front of the code sections where the stubs are actually
      called. This reduces the distance between the PCREL location and the
      stub entry so that the relocations can be fulfilled.
      
      While calculating the final layout of the kernel module in memory, the
      kernel module loader calls arch_mod_section_prepend() to request the
      to be reserved amount of memory in front of each individual section.
      
      Tested with 32- and 64bit kernels.
      Signed-off-by: default avatarHelge Deller <deller@gmx.de>
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      c298be74
    • Helge Deller's avatar
      module: fix module loading failure of large kernel modules for parisc · 088af9a6
      Helge Deller authored
      When creating the final layout of a kernel module in memory, allow the
      module loader to reserve some additional memory in front of a given section.
      This is currently only needed for the parisc port which needs to put the
      stub entries there to fulfill the 17/22bit PCREL relocations with large
      kernel modules like xfs.
      Signed-off-by: default avatarHelge Deller <deller@gmx.de>
      Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (renamed fn)
      088af9a6
    • Jianjun Kong's avatar
      module: fix warning of unused function when !CONFIG_PROC_FS · d1e99d7a
      Jianjun Kong authored
      Fix this warning:
      kernel/module.c:824: warning: ‘print_unload_info’ defined but not used
      print_unload_info() just was used when CONFIG_PROC_FS was defined.
      This patch mark print_unload_info() inline to solve the problem.
      Signed-off-by: default avatarJianjun Kong <jianjun@zeuux.org>
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      CC: Ingo Molnar <mingo@elte.hu>
      CC: Américo Wang <xiyou.wangcong@gmail.com>
      d1e99d7a
    • Tim Abbott's avatar
      kernel/module.c: compare symbol values when marking symbols as exported in /proc/kallsyms. · ca4787b7
      Tim Abbott authored
      When there are two symbols in a module with the same name, one of which is
      exported, both will be marked as exported in /proc/kallsyms.  There aren't
      any instances of this in the current kernel, but it is easy to construct a
      simple module with two compilation units that exhibits the problem.
      
      $ objdump -j .text -t testmod.ko | grep foo
      00000000 l     F .text	00000032 foo
      00000080 g     F .text	00000001 foo
      $ sudo insmod testmod.ko
      $ grep "T foo" /proc/kallsyms
      c28e8000 T foo	[testmod]
      c28e8080 T foo	[testmod]
      
      Fix this by comparing the symbol values once we've found the exported
      symbol table entry matching the symbol name.  Tested using Ksplice:
      
      $ ksplice-create --patch=this_commit.patch --id=bar .
      $ sudo ksplice-apply ksplice-bar.tar.gz
      Done!
      $ grep "T foo" /proc/kallsyms
      c28e8080 T foo	[testmod]
      Signed-off-by: default avatarTim Abbott <tabbott@mit.edu>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      ca4787b7
    • Johannes Berg's avatar
      remove CONFIG_KMOD · a327ca2c
      Johannes Berg authored
      Now that nothing depends on it any more, remove CONFIG_KMOD.
      Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      a327ca2c
  2. 03 Jan, 2009 33 commits