13 Mar, 2015

1 commit


20 Jan, 2015

2 commits

  • Nothing needs the module pointer any more, and the next patch will
    call it from RCU, where the module itself might no longer exist.
    Removing the arg is the safest approach.

    This just codifies the use of the module_alloc/module_free pattern
    which ftrace and bpf use.

    Signed-off-by: Rusty Russell
    Acked-by: Alexei Starovoitov
    Cc: Mikael Starvik
    Cc: Jesper Nilsson
    Cc: Ralf Baechle
    Cc: Ley Foon Tan
    Cc: Benjamin Herrenschmidt
    Cc: Chris Metcalf
    Cc: Steven Rostedt
    Cc: x86@kernel.org
    Cc: Ananth N Mavinakayanahalli
    Cc: Anil S Keshavamurthy
    Cc: Masami Hiramatsu
    Cc: linux-cris-kernel@axis.com
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-mips@linux-mips.org
    Cc: nios2-dev@lists.rocketboards.org
    Cc: linuxppc-dev@lists.ozlabs.org
    Cc: sparclinux@vger.kernel.org
    Cc: netdev@vger.kernel.org

    Rusty Russell
     
  • Archs have been abusing module_free() to clean up their arch-specific
    allocations. Since module_free() is also (ab)used by BPF and trace code,
    let's keep it to simple allocations, and provide a hook called before
    that.

    This means that avr32, ia64, parisc and s390 no longer need to implement
    their own module_free() at all. avr32 doesn't need module_finalize()
    either.

    Signed-off-by: Rusty Russell
    Cc: Chris Metcalf
    Cc: Haavard Skinnemoen
    Cc: Hans-Christian Egtvedt
    Cc: Tony Luck
    Cc: Fenghua Yu
    Cc: "James E.J. Bottomley"
    Cc: Helge Deller
    Cc: Martin Schwidefsky
    Cc: Heiko Carstens
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-ia64@vger.kernel.org
    Cc: linux-parisc@vger.kernel.org
    Cc: linux-s390@vger.kernel.org

    Rusty Russell
     

27 Jul, 2014

1 commit

  • Fengguang Wu's build bot detected that if moduleloader.h is included in
    a C file (used by ftrace and kprobes to access module_alloc() when
    available), that it can fail to build if CONFIG_MODULES and
    CONFIG_MODULES_USE_ELF_REL is not defined.

    This is because there's a printk() that dereferences struct module to
    print the name of the module. But as struct module does not exist when
    CONFIG_MODULES is not defined we get this error:

    include/linux/moduleloader.h: In function 'apply_relocate':
    >> include/linux/moduleloader.h:48:63: error: dereferencing pointer to
    >> incomplete type
    printk(KERN_ERR "module %s: REL relocation unsupported\n", me->name);
    ^
    Reported-by: kbuild test robot
    Based-on-the-true-story-by: Steven Rostedt
    Confirms-rustys-story-ends-the-same-by: Steven Rostedt
    Signed-off-by: Rusty Russell

    Rusty Russell
     

28 Sep, 2012

1 commit

  • Use the mapping of Elf_[SPE]hdr, Elf_Addr, Elf_Sym, Elf_Dyn, Elf_Rel/Rela,
    ELF_R_TYPE() and ELF_R_SYM() to either the 32-bit version or the 64-bit version
    into asm-generic/module.h for all arches bar MIPS.

    Also, use the generic definition mod_arch_specific where possible.

    To this end, I've defined three new config bools:

    (*) HAVE_MOD_ARCH_SPECIFIC

    Arches define this if they don't want to use the empty generic
    mod_arch_specific struct.

    (*) MODULES_USE_ELF_RELA

    Arches define this if their modules can contain RELA records. This causes
    the Elf_Rela mapping to be emitted and allows apply_relocate_add() to be
    defined by the arch rather than have the core emit an error message.

    (*) MODULES_USE_ELF_REL

    Arches define this if their modules can contain REL records. This causes
    the Elf_Rel mapping to be emitted and allows apply_relocate() to be
    defined by the arch rather than have the core emit an error message.

    Note that it is possible to allow both REL and RELA records: m68k and mips are
    two arches that do this.

    With this, some arch asm/module.h files can be deleted entirely and replaced
    with a generic-y marker in the arch Kbuild file.

    Additionally, I have removed the bits from m32r and score that handle the
    unsupported type of relocation record as that's now handled centrally.

    Signed-off-by: David Howells
    Acked-by: Sam Ravnborg
    Signed-off-by: Rusty Russell

    David Howells
     

24 Jul, 2011

1 commit

  • The module loader code allows architectures to hook into the code by
    providing a small number of entry points that each arch must implement.
    This patch provides __weakly linked generic implementations of these
    entry points for architectures that don't need to do anything special.

    Signed-off-by: Jonas Bonn
    Signed-off-by: Rusty Russell

    Jonas Bonn
     

05 Jan, 2009

1 commit

  • 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: Helge Deller
    Signed-off-by: Rusty Russell (renamed fn)

    Helge Deller
     

17 Apr, 2005

1 commit

  • Initial git repository build. I'm not bothering with the full history,
    even though we have it. We can create a separate "historical" git
    archive of that later if we want to, and in the meantime it's about
    3.2GB when imported into git - space that would just make the early
    git days unnecessarily complicated, when we don't have a lot of good
    infrastructure for it.

    Let it rip!

    Linus Torvalds