1. 27 4月, 2008 1 次提交
  2. 26 4月, 2008 2 次提交
    • R
      kbuild: support loading extra symbols in modpost · 2d04b5ae
      Richard Hacker 提交于
      This patch adds a new command line option -E to modpost, expecting a symbol
      file as an argument which is read prior to symbol processing. -E can be
      supplied multiple times for as many files as is needed.
      
      When building kernel modules that depend on other modules not in the main
      kernel tree, modpost complains about undefined symbols:
      # make -C /path/to/linux/kernel M=/path/to/my/module
      ...
      Building modules, stage 2.
      ....
      WARNING: "rt_copy_buf" [/home/rich/osc_etl_rtw/osc_kmod.ko] undefined!
      ...etc
      
      This situation occurs when modpost processes the new module's symbols. When
      it finds symbols not exported by the mainline kernel, it issues this warning.
      
      The patch adds a new command line option -e to modpost which expects a symbol
      file as an argument. The symbols listed in this file are added to modpost's
      symbol tables during startup. -e can be supplied as often as required.
      
      This patch works together with the second patch. It introduces a new make
      variable, KBUILD_EXTRA_SYMBOLS, which is used when calling modpost.
      Signed-off-by: NRichard Hacker <lerichi@gmx.net>
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      2d04b5ae
    • S
      kbuild: error out on missing MODULE_LICENSE · eed7d279
      Sam Ravnborg 提交于
      Adrian Bunk suggested a build time check for
      missing MODULE_LICENSE annotation in modules.
      The build time check is fatal as we really
      want this fixed for all modules.
      In-tree modules should all have been fixed up by now.
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      Cc: Adrian Bunk <bunk@kernel.org>
      eed7d279
  3. 20 4月, 2008 1 次提交
    • K
      PNP: add all PNP card device id's as individual aliases · 0c81eed4
      Kay Sievers 提交于
      The current PNP combined card + devices module aliase can
      never ever match anything, because these values are not available
      all at the same time to request a module.
      
      Instead of adding the combined alias, we add the device id's
      all as individual aliases. Device id's are exported by the PNP
      bus and can now properly used to request the loading of a
      matching module.
      
      The module snd-sbawe currently exports aliases, which can never
      match anything:
        alias: pnp:cCTLXXXXdCTL0045dCTL0022*
        alias: pnp:cCTLXXXXdCTL0044dCTL0023*
        alias: pnp:cCTLXXXXdCTL0042dCTL0022*
        alias: pnp:cCTLXXXXdCTL0041dCTL0021*
        alias: pnp:cCTLXXXXdCTL0031dCTL0021*
        alias: pnp:cCTL00eddCTL0041dCTL0070*
        alias: pnp:cCTL00e9dCTL0045dCTL0022*
        alias: pnp:cCTL00e4dCTL0045dCTL0022*
        alias: pnp:cCTL00c7dCTL0045dCTL0022*
        alias: pnp:cCTL00c5dCTL0045dCTL0022*
        alias: pnp:cCTL00c3dCTL0045dCTL0022*
        alias: pnp:cCTL00c1dCTL0042dCTL0022*
        alias: pnp:cCTL00b2dCTL0044dCTL0023*
        alias: pnp:cCTL009edCTL0044dCTL0023*
        alias: pnp:cCTL009ddCTL0042dCTL0022*
        alias: pnp:cCTL009fdCTL0041dCTL0021*
        alias: pnp:cCTL009cdCTL0041dCTL0021*
        alias: pnp:cCTL009adCTL0041dCTL0021*
        alias: pnp:cCTL0054dCTL0031dCTL0021*
        alias: pnp:cCTL0048dCTL0031dCTL0021*
        alias: pnp:cCTL0047dCTL0031dCTL0021*
        alias: pnp:cCTL0046dCTL0031dCTL0021*
        alias: pnp:cCTL0045dCTL0031dCTL0021*
        alias: pnp:cCTL0044dCTL0031dCTL0021*
        alias: pnp:cCTL0043dCTL0031dCTL0021*
        alias: pnp:cCTL0042dCTL0031dCTL0021*
        alias: pnp:cCTL0039dCTL0031dCTL0021*
        alias: pnp:cCTL0035dCTL0031dCTL0021*
      
      With this patch it exports only the device id's, as properly
      matchable aliases:
        alias: pnp:dCTL0070*
        alias: pnp:dCTL0045*
        alias: pnp:dCTL0023*
        alias: pnp:dCTL0044*
        alias: pnp:dCTL0022*
        alias: pnp:dCTL0042*
        alias: pnp:dCTL0041*
        alias: pnp:dCTL0021*
        alias: pnp:dCTL0031*
      
      Now, the exported value of the PNP bus can be used to autoload
      a matching module:
        $ modprobe --first-time -n -v pnp:dCTL0045
        insmod /lib/modules/2.6.24-rc6-g5b825ed2-dirty/kernel/sound/core/snd-rawmidi.ko
        insmod /lib/modules/2.6.24-rc6-g5b825ed2-dirty/kernel/sound/drivers/mpu401/snd-mpu401-uart.ko
        insmod /lib/modules/2.6.24-rc6-g5b825ed2-dirty/kernel/sound/core/snd-hwdep.ko
        insmod /lib/modules/2.6.24-rc6-g5b825ed2-dirty/kernel/sound/isa/sb/snd-sb-common.ko
        insmod /lib/modules/2.6.24-rc6-g5b825ed2-dirty/kernel/sound/isa/sb/snd-sb16-csp.ko
        insmod /lib/modules/2.6.24-rc6-g5b825ed2-dirty/kernel/sound/isa/sb/snd-sb16-dsp.ko
        insmod /lib/modules/2.6.24-rc6-g5b825ed2-dirty/kernel/sound/drivers/opl3/snd-opl3-lib.ko
        insmod /lib/modules/2.6.24-rc6-g5b825ed2-dirty/kernel/sound/isa/sb/snd-sbawe.ko
      
        $ grep CTL0045 /sys/bus/pnp/devices/*/id
        /sys/bus/pnp/devices/01:01.00/id:CTL0045
      Signed-off-by: NKay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      0c81eed4
  4. 24 3月, 2008 1 次提交
  5. 20 2月, 2008 1 次提交
    • G
      kbuild: fix reversed symbol name order in modpost · b1d2675a
      Geert Uytterhoeven 提交于
      XXXINIT_TO_INIT and XXXEXIT_TO_EXIT warnings use the reversed symbol name order
      in the suggestion, e.g.:
      
          WARNING: vmlinux.o(.meminit.text+0x36c): Section mismatch in reference from the function free_area_init_core() to the function .init.text:setup_usemap()
          The function __meminit free_area_init_core() references
          a function __init setup_usemap().
          If free_area_init_core is only used by setup_usemap then
          annotate free_area_init_core with a matching annotation.
      Signed-off-by: NGeert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      b1d2675a
  6. 14 2月, 2008 1 次提交
    • M
      Linux Kernel Markers: create modpost file · b2e3e658
      Mathieu Desnoyers 提交于
      This adds some new magic in the MODPOST phase for CONFIG_MARKERS.  Analogous
      to the Module.symvers file, the build will now write a Module.markers file
      when CONFIG_MARKERS=y is set.  This file lists the name, defining module, and
      format string of each marker, separated by \t characters.  This simple text
      file can be used by offline build procedures for instrumentation code,
      analogous to how System.map and Module.symvers can be useful to have for
      kernels other than the one you are running right now.
      
      The strings are made easy to extract by having the __trace_mark macro define
      the name and format together in a single array called __mstrtab_* in the
      __markers_strings section.  This is straightforward and reliable as long as
      the marker structs are always defined by this macro.  It is an unreasonable
      amount of hairy work to extract the string pointers from the __markers section
      structs, which entails handling a relocation type for every machine under the
      sun.
      
      Mathieu :
      - Ran through checkpatch.pl
      Signed-off-by: NRoland McGrath <roland@redhat.com>
      Signed-off-by: NMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
      Cc: David Smith <dsmith@redhat.com>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b2e3e658
  7. 09 2月, 2008 2 次提交
  8. 03 2月, 2008 2 次提交
  9. 02 2月, 2008 1 次提交
    • G
      USB: handle idVendor of 0x0000 · de6f92b9
      Greg Kroah-Hartman 提交于
      Some crazy devices in the wild have a vendor id of 0x0000.  If we try to
      add a module alias with this id, we just can't do it due to a check in
      the file2alias.c file.  Change the test to verify that both the vendor
      and product ids are 0x0000 to show a real "blank" module alias.
      
      Note, the module-init-tools package also needs to be changed to properly
      generate the depmod tables.
      
      Cc: Janusz <janumix@poczta.fm>
      Cc: stable <stable@kernel.org>
      Cc: Jon Masters <jcm@redhat.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      de6f92b9
  10. 29 1月, 2008 16 次提交
    • S
      kbuild: warn about ld added unique sections · e241a630
      Sam Ravnborg 提交于
      If there is a mixture of specifying sections for code in gcc
      and assembler then if the assembler code do not add
      the "ax" flags the linker will see this as two different sections
      and generate unique sections for each. ld does so by adding a dot
      and a number.
      Teach modpost to warn if a section shows up that match this
      pattern - but do this only for non-debug sections.
      
      It will result in warnings like this:
      
      WARNING: vmlinux.o (.sched.text.1): unexpected section name.
      The (.[number]+) following section name are ld generated and not expected.
      Did you forget to use "ax"/"aw" in a .S file?
      Note that for example <linux/init.h> contains
      section definitions for use in .S files.
      
      All warnings seen with a defconfig build for:
      x86 (32+64bit) and sparc64 has been fixed (via respective maintainers).
      
      arm, powerpc (64 bit), s390 (32 bit), ia64, alpha, sh4 checked - no
      warnings seen with a defconfig build.
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      e241a630
    • S
      kbuild: add verbose option to Section mismatch reporting in modpost · 588ccd73
      Sam Ravnborg 提交于
      If the config option CONFIG_SECTION_MISMATCH is not set and
      we see a Section mismatch present the following to the user:
      
      modpost: Found 1 section mismatch(es).
      To see additional details select "Enable full Section mismatch analysis"
      in the Kernel Hacking menu (CONFIG_SECTION_MISMATCH).
      
      If the option CONFIG_SECTION_MISMATCH is selected
      then be verbose in the Section mismatch reporting from mdopost.
      Sample outputs:
      
      WARNING: o-x86_64/vmlinux.o(.text+0x7396): Section mismatch in reference from the function discover_ebda() to the variable .init.data:ebda_addr
      The function  discover_ebda() references
      the variable __initdata ebda_addr.
      This is often because discover_ebda lacks a __initdata
      annotation or the annotation of ebda_addr is wrong.
      
      WARNING: o-x86_64/vmlinux.o(.data+0x74d58): Section mismatch in reference from the variable pci_serial_quirks to the function .devexit.text:pci_plx9050_exit()
      The variable pci_serial_quirks references
      the function __devexit pci_plx9050_exit()
      If the reference is valid then annotate the
      variable with __exit* (see linux/init.h) or name the variable:
      *driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,
      
      WARNING: o-x86_64/vmlinux.o(__ksymtab+0x630): Section mismatch in reference from the variable __ksymtab_arch_register_cpu to the function .cpuinit.text:arch_register_cpu()
      The symbol arch_register_cpu is exported and annotated __cpuinit
      Fix this by removing the __cpuinit annotation of arch_register_cpu or drop the export.
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      588ccd73
    • A
      remove __attribute_used__ · 3ff6eecc
      Adrian Bunk 提交于
      Remove the deprecated __attribute_used__.
      
      [Introduce __section in a few places to silence checkpatch /sam]
      Signed-off-by: NAdrian Bunk <bunk@kernel.org>
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      3ff6eecc
    • S
      kbuild: simplified warning report in modpost · 58fb0d4f
      Sam Ravnborg 提交于
      Refactor code so the warning report function
      does nothing else than reporting warnings.
      As a side effect some other code paths were cleaned
      up by this.
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      58fb0d4f
    • S
      kbuild: introduce a few helpers in modpost · ff13f926
      Sam Ravnborg 提交于
      Introducing helpers to retreive symbol and section
      names cleaned up the code a bit.
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      ff13f926
    • S
      kbuild: use simpler section mismatch warnings in modpost · 157c23c8
      Sam Ravnborg 提交于
      The typical layout is now:
      WARNING: vmlinux.o(.text+0x372ec): Section mismatch: reference to .devinit.text:pci_scan_one_pbm in 'psycho_scan_bus'
      
      This is first step towards more readable warnings.
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      157c23c8
    • S
      Use separate sections for __dev/__cpu/__mem code/data · eb8f6890
      Sam Ravnborg 提交于
      Introducing separate sections for __dev* (HOTPLUG),
      __cpu* (HOTPLUG_CPU) and __mem* (MEMORY_HOTPLUG)
      allows us to do a much more reliable Section mismatch
      check in modpost. We are no longer dependent on the actual
      configuration of for example HOTPLUG.
      
      This has the effect that all users see much more
      Section mismatch warnings than before because they
      were almost all hidden when HOTPLUG was enabled.
      The advantage of this is that when building a piece
      of code then it is much more likely that the Section
      mismatch errors are spotted and the warnings will be
      felt less random of nature.
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      Cc: Greg KH <greg@kroah.com>
      Cc: Randy Dunlap <randy.dunlap@oracle.com>
      Cc: Adrian Bunk <bunk@kernel.org>
      eb8f6890
    • S
      kbuild: check section names consistently in modpost · 6c5bd235
      Sam Ravnborg 提交于
      Now that match() is introduced use it consistently so
      we can share the section name definitions.
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      6c5bd235
    • S
      kbuild: introduce blacklisting in modpost · 10668220
      Sam Ravnborg 提交于
      Change the logic in modpost so we identify all the
      bad combinations of sections that refer to other
      sections.
      Compared to the previous approach we are much less
      dependent on knowledge of what additional sections
      the tool chain uses and thus we can keep the false
      positives low.
      
      The implmentation is changed to use a table based
      lookup and we now check all combinations in first
      pass so we no longer need separate passes for init
      and exit sections.
      
      Tested that the same warnings are generated for
      an allyesconfig build without CONFIG_HOTPLUG.
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      Cc: Randy Dunlap <randy.dunlap@oracle.com>
      Cc: Adrian Bunk <bunk@kernel.org>
      10668220
    • S
      kbuild: code refactoring in modpost · 5b24c071
      Sam Ravnborg 提交于
      Split a too long function up in smaller bits to make
      prgram logic easier to follow.
      A few related changes done due to parameter
      changes.
      
      No functional changes.
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      5b24c071
    • S
      kbuild: try harder to find symbol names in modpost · 9ad21c3f
      Sam Ravnborg 提交于
      The relocation record sometimes contained an address
      which was not an exactly match for a symbol.
      
      Implment some simple logic such that if there
      is a symbol within 20 bytes of the address contained
      in the relocation record then print the name of this
      symbol.
      
      With this change modpost could find symbol names
      for the remaining .init.text symbols in my
      allyesconfig build for x86_64.
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      9ad21c3f
    • S
      kbuild: fix so modpost can now check any .o file · d1f25e66
      Sam Ravnborg 提交于
      It is very convinient to say:
      scripts/mod/modpost mm/built-in.o
      
      to check if any section mismatch errors occured
      in mm/ (as an example).
      Fix it so this is possible again.
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      d1f25e66
    • S
      kbuild: clean up modpost.c · df578e7d
      Sam Ravnborg 提交于
      akpm complained about overly long lines in modpost.c and
      when started additional style issues were fixed:
      
      o Updated my copyright
      o Removed unneeded {}
      o Drop assignments in if ()
      o Spaces around operators
      o Break long lines
      o locate * near variable not type
      o Fix a format specifier for sizeof()
      o Corrected placement of '{' and '}'
      o spaces to tabs (but use tabs only for indention)
      
      modpost.c is not checkpatch clean. Readability were favoured
      on top of checkpatch compliance.
      But checkpatch were used to find additional stuff to clean up.
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      df578e7d
    • A
      kbuild: fix a buffer overflow in modpost · 666ab414
      Andi Kleen 提交于
      When passing an file name > 1k the stack could be overflowed.
      Not really a security issue, but still better plugged.
      Signed-off-by: NAndi Kleen <ak@suse.de>
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      666ab414
    • A
      kbuild: fix format string warnings in modpost · 58b7a68d
      Andi Kleen 提交于
      Fix wrong format strings in modpost exposed by the previous patch.
      Including one missing argument -- some random data was printed instead.
      Signed-off-by: NAndi Kleen <ak@suse.de>
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      58b7a68d
    • A
      kbuild: declare the modpost error functions as printf like · 6d9a89ea
      Andi Kleen 提交于
      This way gcc can warn for wrong format strings
      Signed-off-by: NAndi Kleen <ak@suse.de>
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      6d9a89ea
  11. 23 10月, 2007 1 次提交
  12. 18 10月, 2007 1 次提交
    • T
      kbuild: modpost problem when symbols move from one module to another · 4b21960f
      Trent Piepho 提交于
      When part of build an external module tree, modpost first reads in the
      kernel's and then the external tree's Module.symvers files.  From these files
      it establishes a symbol => module mapping.  When it later reads in each module
      built and processes the symbols it finds, it discovers the symbol=>module
      mapping from Module.symvers and leaves it as it is.
      
      The problem comes with a module has been re-named or a symbol has moved from
      one module to another, since the Module.symvers file was generated.  modpost
      does not update the symbol=>module mapping when it finds the new location of
      the symbol when scanning the newly built modules.  This results in the module
      containing incorrect dependency information and the new Module.symvers file
      written by modpost will also contain the incorrect mappings, perpetuating the
      problem to the next build, and so on.
      
      When building the out of kernel development tree for kernel subsystem, like
      v4l-dvb or ALSA, deleting the external Module.symvers file before building
      (which the kernel build system doesn't do and shouldn't be necessary anyway),
      won't fix the problem.  modpost still reads the kernel's Module.symvers, and
      since we a building a kernel subsystem, it will define the same symbols as the
      external modules.
      Signed-off-by: NTrent Piepho <xyzzy@speakeasy.org>
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      4b21960f
  13. 14 10月, 2007 1 次提交
    • J
      i2c: Kill struct i2c_device_id · cee37ae4
      Jean Delvare 提交于
      I2C devices do not have any form of ID as PCI or USB devices have.
      No driver uses "MODULE_DEVICE_TABLE(i2c, ...)" because it doesn't
      make sense. So we can get rid of struct i2c_device_id and the
      associated support code.
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      Cc: Greg KH <greg@kroah.com>
      cee37ae4
  14. 13 10月, 2007 3 次提交
  15. 11 10月, 2007 2 次提交
    • P
      [NETNS]: Move some code into __init section when CONFIG_NET_NS=n · 4665079c
      Pavel Emelyanov 提交于
      With the net namespaces many code leaved the __init section,
      thus making the kernel occupy more memory than it did before.
      Since we have a config option that prohibits the namespace
      creation, the functions that initialize/finalize some netns
      stuff are simply not needed and can be freed after the boot.
      
      Currently, this is almost not noticeable, since few calls
      are no longer in __init, but when the namespaces will be
      merged it will be possible to free more code. I propose to
      use the __net_init, __net_exit and __net_initdata "attributes"
      for functions/variables that are not used if the CONFIG_NET_NS
      is not set to save more space in memory.
      
      The exiting functions cannot just reside in the __exit section,
      as noticed by David, since the init section will have
      references on it and the compilation will fail due to modpost
      checks. These references can exist, since the init namespace
      never dies and the exit callbacks are never called. So I
      introduce the __exit_refok attribute just like it is already
      done with the __init_refok.
      Signed-off-by: NPavel Emelyanov <xemul@openvz.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4665079c
    • M
      [SSB]: add Sonics Silicon Backplane bus support · 61e115a5
      Michael Buesch 提交于
      SSB is an SoC bus used in a number of embedded devices.  The most
      well-known of these devices is probably the Linksys WRT54G, but there
      are others as well.  The bus is also used internally on the BCM43xx
      and BCM44xx devices from Broadcom.
      
      This patch also includes support for SSB ID tables in modules, so
      that SSB drivers can be loaded automatically.
      Signed-off-by: NMichael Buesch <mb@bu3sch.de>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      61e115a5
  16. 24 9月, 2007 1 次提交
  17. 01 8月, 2007 1 次提交
  18. 26 7月, 2007 2 次提交
    • S
      kbuild: fix modpost warnings for xtensa · cb7e51d8
      Sam Ravnborg 提交于
      The Xtensa architecture places literal pools in sections separate
      from the instructions. The corresponsing text sections, therefore,
      reference the .literal section, and we have to suppress those
      warnings.
      
      The naming convention defines the name for a literal
      section as .SECTION.literal, unless .SECTION is .text. In that case
      the name is only .literal. Using strncmp() instead of strcmp()
      to compare the from-section with .SECTION.init.refok in pattern 0
      should not cause any regressions for other architectures.
      
      We also need to suppress warnings for two informational
      sections (.xt.lit and .xt.prop) used by the Xtensa architecture.
      Signed-off-by: NChris Zankel <chris@zankel.net>
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      cb7e51d8
    • S
      kbuild: be more foregiving on init section naming · 83cda2bb
      Sam Ravnborg 提交于
      In the whitelist function of modpost now use the same
      check to identify init_section as in other places of modpost.
      This has the effect that we now recognize sections named
      .init.text.19 as init sections and we no longer warn
      when we see these.
      
      At the same time make surrounding code readable by dropping
      use of temporary flags.
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      83cda2bb