11 Jan, 2007

2 commits

  • o MODPOST generates warning on i386 if kernel is compiled with
    CONFIG_RELOCATABLE=y.

    WARNING: vmlinux - Section mismatch: reference to .init.text:__init_begin from .text between 'free_initmem' (at offset 0xc0114fd3) and 'do_test_wp_bit'
    WARNING: vmlinux - Section mismatch: reference to .init.text:_sinittext from .text between 'core_kernel_text' (at offset 0xc012aeae) and 'kernel_text_address'
    WARNING: vmlinux - Section mismatch: reference to .init.text:_einittext from .text between 'core_kernel_text' (at offset 0xc012aeb7) and 'kernel_text_address'
    WARNING: vmlinux - Section mismatch: reference to .init.text:_sinittext from .text between 'get_symbol_pos' (at offset 0xc0135776) and 'reset_iter'
    WARNING: vmlinux - Section mismatch: reference to .init.text:_einittext from .text between 'get_symbol_pos' (at offset 0xc013577d) and 'reset_iter'

    o These symbols (__init_begin, _sinittext, _einittext) belong to init
    section and generally represent a section boundary. These are special
    symbols in the sense that their size is zero and no memory is allocated
    for them in init section. Their addr and value are same. So even if
    we free the init section, it is ok to reference them.

    o Whitelist access to such select symbols in MODPOST.

    Signed-off-by: Vivek Goyal
    Signed-off-by: Andi Kleen
    Cc: "Eric W. Biederman"
    Cc: Andi Kleen
    Signed-off-by: Andrew Morton

    Vivek Goyal
     
  • o MODPOST generates warning for i386 if compiled with CONFIG_RELOCATABLE=y
    and serial console support is enabled.

    o Serial console setup function, serial8250_console_setup(), is a non __init
    function and it calls functions which are of type __init().
    (uart_parse_options() and uart_set_options()). Assuming, setup will
    be called during init time, changing serial8250_console_setup() to __init.

    o Adding one more pattern to modpost whitelist. Console drivers might
    have *_console structures containing references to setup functions which
    can be of __init type. Don't generate warnings for those.

    WARNING: vmlinux - Section mismatch: reference to .init.text: from .data between 'serial8250_console' (at offset 0xc05a33d8) and 'serial8250_reg'

    Signed-off-by: Vivek Goyal
    Signed-off-by: Andi Kleen
    Cc: "Eric W. Biederman"
    Cc: Andi Kleen
    Signed-off-by: Andrew Morton

    Vivek Goyal
     

14 Dec, 2006

1 commit

  • Section .parainstructions should not warn about section mismatches.

    WARNING: drivers/net/hamradio/scc.o - Section mismatch: reference to .exit.text: from .parainstructions after '' (at offset 0x0)
    WARNING: drivers/net/hamradio/scc.o - Section mismatch: reference to .exit.text: from .parainstructions after '' (at offset 0x8)

    Signed-off-by: Randy Dunlap
    Cc: Andi Kleen
    Acked-by: Rusty Russell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     

07 Dec, 2006

1 commit

  • It turns out that the most called ops, by several orders of magnitude,
    are the interrupt manipulation ops. These are obvious candidates for
    patching, so mark them up and create infrastructure for it.

    The method used is that the ops structure has a patch function, which
    is called for each place which needs to be patched: this returns a
    number of instructions (the rest are NOP-padded).

    Usually we can spare a register (%eax) for the binary patched code to
    use, but in a couple of critical places in entry.S we can't: we make
    the clobbers explicit at the call site, and manually clobber the
    allowed registers in debug mode as an extra check.

    And:

    Don't abuse CONFIG_DEBUG_KERNEL, add CONFIG_DEBUG_PARAVIRT.

    And:

    AK: Fix warnings in x86-64 alternative.c build

    And:

    AK: Fix compilation with defconfig

    And:

    ^From: Andrew Morton

    Some binutlises still like to emit references to __stop_parainstructions and
    __start_parainstructions.

    And:

    AK: Fix warnings about unused variables when PARAVIRT is disabled.

    Signed-off-by: Rusty Russell
    Signed-off-by: Jeremy Fitzhardinge
    Signed-off-by: Chris Wright
    Signed-off-by: Zachary Amsden
    Signed-off-by: Andi Kleen
    Signed-off-by: Andrew Morton

    Rusty Russell
     

25 Oct, 2006

1 commit

  • This patch adds support for feature fixups in modules. This involves
    adding support for R_PPC64_REL64 relocs to the 64 bits module loader.
    It also modifies modpost.c to ignore the powerpc fixup sections (or it
    would warn when used in .init.text).

    Signed-off-by: Benjamin Herrenschmidt
    Acked-by: Olof Johansson
    Signed-off-by: Paul Mackerras

    Benjamin Herrenschmidt
     

25 Sep, 2006

3 commits


01 Jul, 2006

2 commits


25 Jun, 2006

2 commits


17 Jun, 2006

1 commit


10 Jun, 2006

3 commits

  • scripts/mod/modpost.c: In function `check_license':
    scripts/mod/modpost.c:1094: parse error before `const'
    scripts/mod/modpost.c:1095: `basename' undeclared (first use in this function)
    scripts/mod/modpost.c:1095: (Each undeclared identifier is reported only once
    scripts/mod/modpost.c:1095: for each function it appears in.)

    Signed-off-by: Andrew Morton
    Signed-off-by: Sam Ravnborg

    Andrew Morton
     
  • Modules that uses GPL symbols can no longer be build with kbuild,
    the build will fail during the modpost step.
    When a GPL-incompatible module uses a EXPORT_SYMBOL_GPL_FUTURE symbol
    then warn during modpost so author are actually notified.

    The actual license compatibility check is shared with the kernel
    to make sure it is in sync.

    Patch originally from: Andreas Gruenbacher and
    Ram Pai

    Signed-off-by: Sam Ravnborg

    Sam Ravnborg
     
  • This patch provides the ability to identify the export-type of each
    exported symbols in Module.symvers.

    NOTE: It updates the Module.symvers file with the additional
    information as shown below.

    0x0f8b92af platform_device_add_resources vmlinux EXPORT_SYMBOL_GPL
    0xcf7efb2a ethtool_op_set_tx_csum vmlinux EXPORT_SYMBOL

    Signed-off-by: Andreas Gruenbacher
    Signed-off-by: Ram Pai
    Signed-off-by: Avantika Mathur
    Signed-off-by: Valdis Kletnieks
    Signed-off-by: Andrew Morton
    Signed-off-by: Sam Ravnborg

    Ram Pai
     

09 Jun, 2006

2 commits


22 May, 2006

2 commits

  • Here is an updated r_info layout fix. Please apply "check SHT_REL
    sections" patch before this.

    64bit mips has different r_info layout. This patch fixes modpost
    segfault for 64bit little endian mips kernel.

    Signed-off-by: Atsushi Nemoto
    Cc: Sam Ravnborg
    Cc: Ralf Baechle
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Atsushi Nemoto
     
  • I found that modpost can not detect section mismatch on mips and i386. On
    mips64, the modpost (with r_info layout fix) can detect it. The current
    modpst only checks SHT_RELA section but I suppose SHT_REL section should be
    checked also. This patch does not contain r_info layout fix. I'll post an
    updated r_info layout fix on next mail.

    Check SHT_REL sections as like as SHT_RELA sections to detect section
    mismatch.

    Signed-off-by: Atsushi Nemoto
    Cc: Sam Ravnborg
    Cc: Ralf Baechle
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Atsushi Nemoto
     

09 May, 2006

1 commit


01 May, 2006

2 commits


15 Apr, 2006

1 commit

  • Darren Jenkins pointed out a
    number of false positives where we referenced variables
    from a _driver variable.
    Fix it by check for that pattern and ignore it.

    Randy.Dunlap pointed out a similar
    set of warnings for a number of scsi drivers.
    In scsi world they misname their variables *_template or
    *_sht so add these to list of variables that may have references
    to .init.text with no warning.

    Randy.Dunlap also pointed out a scsi driver
    with many references to .exit.text from .rodata. This is compiler
    generated references and we already ignore these for .init.text, so
    ignore them for .exit.text also.

    Signed-off-by: Sam Ravnborg

    Sam Ravnborg
     

11 Apr, 2006

1 commit


26 Mar, 2006

1 commit

  • * master.kernel.org:/pub/scm/linux/kernel/git/sam/kbuild: (46 commits)
    kbuild: remove obsoleted scripts/reference_* files
    kbuild: fix make help & make *pkg
    kconfig: fix time ordering of writes to .kconfig.d and include/linux/autoconf.h
    Kconfig: remove the CONFIG_CC_ALIGN_* options
    kbuild: add -fverbose-asm to i386 Makefile
    kbuild: clean-up genksyms
    kbuild: Lindent genksyms.c
    kbuild: fix genksyms build error
    kbuild: in makefile.txt note that Makefile is preferred name for kbuild files
    kbuild: replace PHONY with FORCE
    kbuild: Fix bug in crc symbol generating of kernel and modules
    kbuild: change kbuild to not rely on incorrect GNU make behavior
    kbuild: when warning symbols exported twice now tell user this is the problem
    kbuild: fix make dir/file.xx when asm symlink is missing
    kbuild: in the section mismatch check try harder to find symbols
    kbuild: fix section mismatch check for unwind on IA64
    kbuild: kill false positives from section mismatch warnings for powerpc
    kbuild: kill trailing whitespace in modpost & friends
    kbuild: small update of allnoconfig description
    kbuild: make namespace.pl CROSS_COMPILE happy
    ...

    Trivial conflict in arch/ppc/boot/Makefile manually fixed up

    Linus Torvalds
     

17 Mar, 2006

1 commit

  • Jiri Benc reported that modpost would stop with SIGABRT if
    used with long filepaths.
    The error looked like:
    > Building modules, stage 2.
    > MODPOST
    > *** glibc detected *** scripts/mod/modpost: realloc(): invalid next size:
    +0x0809f588 ***
    > [...]

    Fix this by allocating at least the required memory + SZ bytes each time.
    Before we sometimes ended up allocating too little memory resuting in the
    glibc detected bug above. Based on patch originally submitted by: Jiri
    Benc

    Signed-off-by: Sam Ravnborg
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sam Ravnborg
     

09 Mar, 2006

1 commit

  • The scripts/genksyms/genksyms.c uses hardcoded "__crc_" prefix for
    crc symbols in kernel and modules. The prefix should be replaced by
    "MODULE_SYMBOL_PREFIX##__crc_" otherwise there will be warnings when
    MODULE_SYMBOL_PREFIX is not NULL.

    I am sorry my last patch for this issue is actually wrong. I revert
    it in this patch.

    Signed-off-by: Luke Yang
    Signed-off-by: Sam Ravnborg

    Luke Yang
     

05 Mar, 2006

4 commits


03 Mar, 2006

1 commit


27 Feb, 2006

2 commits

  • In several cases the section mismatch check triggered false warnings.
    Following patch introduce a whitelist to 'false positives' are not warned of.
    Two types of patterns are recognised:
    1) Typical case when a module parameter is _initdata
    2) When a function pointer is assigned to a driver structure

    In both patterns we rely on the actual name of the variable assigned

    Signed-off-by: Sam Ravnborg

    Sam Ravnborg
     
  • It seems popular to protect your work with copyright, so I decided to do
    so for modpost which I patch a great deal atm.

    Signed-off-by: Sam Ravnborg

    Sam Ravnborg
     

23 Feb, 2006

2 commits

  • Andrew Morton reported a number of false positives for ia64 - like these:
    WARNING: drivers/acpi/button.o - Section mismatch: reference to .init.text: from .IA_64.unwind.init.text after '' (at offset 0x0)
    WARNING: drivers/acpi/button.o - Section mismatch: reference to .exit.text: from .IA_64.unwind.exit.text after '' (at offset 0x0)
    WARNING: drivers/acpi/processor.o - Section mismatch: reference to .init.text: from .IA_64.unwind after '' (at offset 0x1e8)

    They are all false positives - or at least the .c code looks OK.
    It is not known why sometimes a section name is appended and sometimes not.

    Fix is to accept references from all sections that includes "unwind." in the name.

    Signed-off-by: Sam Ravnborg

    Sam Ravnborg
     
  • The kernel now requires that CC be 3.1.0 or higher. But we shouldn't place
    that requirement upon HOSTCC unless we really need to. Fixes my ia64 problem.

    Signed-off-by: Andrew Morton
    Signed-off-by: Sam Ravnborg

    akpm@osdl.org
     

19 Feb, 2006

3 commits

  • Try to look up the symbol that is referenced. Include the symbol
    name in the warning message.

    Signed-off-by: Sam Ravnborg

    Sam Ravnborg
     
  • Do not try to look up section name until we know it is not a special
    section. Otherwise we will address outside legal space and segfault.

    Signed-off-by: Sam Ravnborg

    Sam Ravnborg
     
  • Section mismatch is identified as references to .init*
    sections from non .init sections. And likewise references
    to .exit.* sections outside .exit sections.

    .init.* sections are discarded after a module is initialized
    and references to .init.* sections are oops candidates.
    .exit.* sections are discarded when a module is built-in and
    thus references to .exit are also oops candidates.

    The checks were possible to do using 'make buildcheck' which
    called the two perl scripts: reference_discarded.pl and
    reference_init.pl. This patch just moves the same functionality
    inside modpost and the scripts are then obsoleted.
    They will though be kept for a while so users can do double
    checks - but note that some .o files are skipped by the perl scripts
    so result is not 1:1.
    All credit for the concept goes to Keith Owens who implemented
    the original perl scrips - this patch just moves it to modpost.

    Compared to the perl script the implmentation in modpost will be run
    for each kernel build - thus catching the error much sooner, but
    the downside is that the individual .o file are not always identified.

    Signed-off-by: Sam Ravnborg

    Sam Ravnborg