1. 31 3月, 2009 1 次提交
    • R
      module: include other structures in module version check · 8c8ef42a
      Rusty Russell 提交于
      With CONFIG_MODVERSIONS, we version 'struct module' using a dummy
      export, but other things matter too:
      
      1) 'struct modversion_info' determines the layout of the __versions section,
      2) 'struct kernel_param' determines the layout of the __params section,
      3) 'struct kernel_symbol' determines __ksymtab*.
      4) 'struct marker' determines __markers.
      5) 'struct tracepoint' determines __tracepoints.
      
      So we rename 'struct_module' to 'module_layout' and include these in
      the signature.  Now it's general we can add others later on without
      confusion.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      8c8ef42a
  2. 25 3月, 2009 2 次提交
    • J
      dynamic debug: combine dprintk and dynamic printk · e9d376f0
      Jason Baron 提交于
      This patch combines Greg Bank's dprintk() work with the existing dynamic
      printk patchset, we are now calling it 'dynamic debug'.
      
      The new feature of this patchset is a richer /debugfs control file interface,
      (an example output from my system is at the bottom), which allows fined grained
      control over the the debug output. The output can be controlled by function,
      file, module, format string, and line number.
      
      for example, enabled all debug messages in module 'nf_conntrack':
      
      echo -n 'module nf_conntrack +p' > /mnt/debugfs/dynamic_debug/control
      
      to disable them:
      
      echo -n 'module nf_conntrack -p' > /mnt/debugfs/dynamic_debug/control
      
      A further explanation can be found in the documentation patch.
      Signed-off-by: NGreg Banks <gnb@sgi.com>
      Signed-off-by: NJason Baron <jbaron@redhat.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      e9d376f0
    • E
      platform: introduce module id table for platform devices · 57fee4a5
      Eric Miao 提交于
      Now platform_device is being widely used on SoC processors where the
      peripherals are attached to the system bus, which is simple enough.
      
      However, silicon IPs for these SoCs are usually shared heavily across
      a family of processors, even products from different companies.  This
      makes the original simple driver name based matching insufficient, or
      simply not straight-forward.
      
      Introduce a module id table for platform devices, and makes it clear
      that a platform driver is able to support some shared IP and handle
      slight differences across different platforms (by 'driver_data').
      Module alias is handled automatically when a MODULE_DEVICE_TABLE()
      is defined.
      
      To not disturb the current platform drivers too much, the matched id
      entry is recorded and can be retrieved by platform_get_device_id().
      Signed-off-by: NEric Miao <eric.miao@marvell.com>
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Cc: Ben Dooks <ben-linux@fluff.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      57fee4a5
  3. 16 3月, 2009 2 次提交
    • I
      kconfig: improve seed in randconfig · b0fe5510
      Ingo Molnar 提交于
      'make randconfig' uses glibc's rand function, and the seed of
      that PRNG is set via:
      
      			srand(time(NULL));
      
      But 'time()' only increases once every second - freezing the
      randconfig result within a single second.
      
      My Nehalem testbox does randconfig much faster than 1 second
       and i have a few scripts that do 'randconfig until condition X'
      loops.
      
      Those scripts currently waste a lot of CPU time due to randconfig
      changing its seed only once per second currently.
      
      Change the seed to be micrseconds based. (I checked the statistical
      spread of the seed - the now.tv_sec*now.tv_usec multiplication
      there further improves it.)
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Cc: Roman Zippel <zippel@linux-m68k.org>
      [sam: fix for systems where usec is zero - noticed by Geert Uytterhoeven]
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      b0fe5510
    • S
      kconfig: fix randconfig for choice blocks · 184832c9
      Sam Ravnborg 提交于
      Ingo Molnar reported that 'make randconfig' was not covering
      choice blocks properly, resulting in certain config options
      being left out of randconfig testing altogether.
      
      With the following patch we:
      - properly randomize choice value for normal choice blocks
      - properly randomize for multi choice blocks
      - added several comments to explain what is going on
      
      The root cause of the bug was that SYMBOL_VALID was set on the
      symbol representing the choice block so clearing this did
      the trick initially.
      But testign revealed a few more issues that is now fixed.
      Reported-by: NIngo Molnar <mingo@elte.hu>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Roman Zippel <zippel@linux-m68k.org>
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      184832c9
  4. 07 3月, 2009 3 次提交
    • J
      kbuild: fix 'make rpm' when CONFIG_LOCALVERSION_AUTO=y and using SCM tree · b925dbfe
      Josh Hunt 提交于
      Running 'make rpm' fails when CONFIG_LOCALVERSION_AUTO=y and using a kernel source
      tree under SCM.  This is due to KERNELRELEASE being different when the initial make
      is run and when make is run from rpmbuild.
      
      mkspec creates kernel.spec using KERNELRELEASE:
      
      <mkspec>
      echo "%files"
      echo '%defattr (-, root, root)'
      echo "%dir /lib/modules"
      echo "/lib/modules/$KERNELRELEASE"
      echo "/lib/firmware"
      echo "/boot/*"
      echo ""
      </mkspec>
      
      When CONFIG_LOCALVERSION_AUTO=y scripts/setlocalversion is called and grabs any
      additional version info from SCM.  Next, the srctree is tarred up and SCM
      information is excluded.
      
      rpmbuild reruns make and in the process generates a new include/config/kernel.release
      and thus a new KERNELRELEASE.  However this time the SCM information is gone so
      KERNELRELEASE no longer has the additional version information.  When "make modules_install"
      runs, it uses the new KERNELRELEASE value to determine where to install the modules.
      This conflicts with where the spec file assumes they are going because of the
      mis-matching KERNELRELEASE versions.
      
      <snippet>
      + INSTALL_MOD_PATH=/var/tmp/kernel-2.6.29rc4tip01479g5d85422-root
      + make -j16 modules_install
        INSTALL crypto/aead.ko
        INSTALL crypto/cbc.ko
        INSTALL crypto/chainiv.ko
        INSTALL crypto/crc32c.ko
        INSTALL crypto/crypto_algapi.ko
        INSTALL crypto/crypto_blkcipher.ko
        INSTALL crypto/crypto_hash.ko
        INSTALL crypto/cryptomgr.ko
        INSTALL crypto/ecb.ko
        INSTALL crypto/eseqiv.ko
        INSTALL crypto/krng.ko
        INSTALL crypto/md5.ko
        INSTALL crypto/pcbc.ko
        INSTALL crypto/rng.ko
        INSTALL drivers/block/cciss.ko
        INSTALL drivers/hid/hid-dummy.ko
        INSTALL drivers/scsi/iscsi_tcp.ko
        INSTALL drivers/scsi/libiscsi.ko
        INSTALL drivers/scsi/libiscsi_tcp.ko
        INSTALL drivers/scsi/scsi_transport_iscsi.ko
        INSTALL drivers/scsi/scsi_wait_scan.ko
        INSTALL fs/lockd/lockd.ko
        INSTALL fs/nfs/nfs.ko
        INSTALL fs/nfsd/nfsd.ko
        INSTALL lib/libcrc32c.ko
        INSTALL net/sunrpc/sunrpc.ko
        DEPMOD  2.6.29-rc4-tip
      + cp arch/x86/boot/bzImage
      /var/tmp/kernel-2.6.29rc4tip01479g5d85422-root/boot/vmlinuz-2.6.29-rc4-tip-01479-g5d85422
      + cp System.map
      /var/tmp/kernel-2.6.29rc4tip01479g5d85422-root/boot/System.map-2.6.29-rc4-tip-01479-g5d85422
      + cp .config
      /var/tmp/kernel-2.6.29rc4tip01479g5d85422-root/boot/config-2.6.29-rc4-tip-01479-g5d85422
      + cp vmlinux vmlinux.orig
      + bzip2 -9 vmlinux
      + mv vmlinux.bz2
      /var/tmp/kernel-2.6.29rc4tip01479g5d85422-root/boot/vmlinux-2.6.29-rc4-tip-01479-g5d85422.bz2
      + mv vmlinux.orig vmlinux
      + /usr/lib/rpm/brp-compress
      Processing files: kernel-2.6.29rc4tip01479g5d85422-2
      error: File not found:
      /var/tmp/kernel-2.6.29rc4tip01479g5d85422-root/lib/modules/2.6.29-rc4-tip-01479-g5d85422
      
      RPM build errors:
          File not found:
      /var/tmp/kernel-2.6.29rc4tip01479g5d85422-root/lib/modules/2.6.29-rc4-tip-01479-g5d85422
      make[1]: *** [rpm] Error 1
      make: *** [rpm] Error 2
      </snippet>
      
      I have tested this patch on git -tip, Linus' git tree, and the kernel.org tar files, both
      with and without CONFIG_LOCALVERSION_AUTO=y.
      Signed-off-by: NJosh Hunt <josh@scalex86.org>
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      ----
      b925dbfe
    • J
      kbuild: fix mkspec to cleanup RPM_BUILD_ROOT · a2ebcc7a
      Josh Hunt 提交于
      The contents of the %clean section in mkspec is currently commented
      out leaving RPM_BUILD_ROOT and its contents on the build machine.
      This patch removes it once the rpm build process is complete.
      Signed-off-by: NJosh Hunt <josh@scalex86.org>
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      a2ebcc7a
    • J
      kbuild: fix C libary confusion in unifdef.c due to getline() · d15bd106
      Justin P. Mattock 提交于
      This fixes an error when compiling the kernel.
      
        CHK     include/linux/version.h
        HOSTCC  scripts/unifdef
      scripts/unifdef.c:209: error: conflicting types for 'getline'
      /usr/include/stdio.h:651: note: previous declaration of 'getline' was here
      make[1]: *** [scripts/unifdef] Error 1
      make: *** [__headers] Error 2
      Signed-off-by: NJustin P. Mattock <justinmattock@gmail.com>
      Cc:  Frederic Weisbecker <fweisbec@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      d15bd106
  5. 28 2月, 2009 8 次提交
  6. 20 2月, 2009 1 次提交
  7. 17 2月, 2009 1 次提交
  8. 15 2月, 2009 7 次提交
  9. 12 2月, 2009 1 次提交
    • R
      kernel-doc: fix syscall wrapper processing · b4870bc5
      Randy Dunlap 提交于
      Fix kernel-doc processing of SYSCALL wrappers.
      
      The SYSCALL wrapper patches played havoc with kernel-doc for
      syscalls.  Syscalls that were scanned for DocBook processing
      reported warnings like this one, for sys_tgkill:
      
      Warning(kernel/signal.c:2285): No description found for parameter 'tgkill'
      Warning(kernel/signal.c:2285): No description found for parameter 'pid_t'
      Warning(kernel/signal.c:2285): No description found for parameter 'int'
      
      because the macro parameters all "look like" function parameters,
      although they are not:
      
      /**
       *  sys_tgkill - send signal to one specific thread
       *  @tgid: the thread group ID of the thread
       *  @pid: the PID of the thread
       *  @sig: signal to be sent
       *
       *  This syscall also checks the @tgid and returns -ESRCH even if the PID
       *  exists but it's not belonging to the target process anymore. This
       *  method solves the problem of threads exiting and PIDs getting reused.
       */
      SYSCALL_DEFINE3(tgkill, pid_t, tgid, pid_t, pid, int, sig)
      {
      ...
      
      This patch special-cases the handling SYSCALL_DEFINE* function
      prototypes by expanding them to
      	long sys_foobar(type1 arg1, type1 arg2, ...)
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b4870bc5
  10. 11 2月, 2009 1 次提交
  11. 10 2月, 2009 2 次提交
    • T
      x86: implement x86_32 stack protector · 60a5317f
      Tejun Heo 提交于
      Impact: stack protector for x86_32
      
      Implement stack protector for x86_32.  GDT entry 28 is used for it.
      It's set to point to stack_canary-20 and have the length of 24 bytes.
      CONFIG_CC_STACKPROTECTOR turns off CONFIG_X86_32_LAZY_GS and sets %gs
      to the stack canary segment on entry.  As %gs is otherwise unused by
      the kernel, the canary can be anywhere.  It's defined as a percpu
      variable.
      
      x86_32 exception handlers take register frame on stack directly as
      struct pt_regs.  With -fstack-protector turned on, gcc copies the
      whole structure after the stack canary and (of course) doesn't copy
      back on return thus losing all changed.  For now, -fno-stack-protector
      is added to all files which contain those functions.  We definitely
      need something better.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      60a5317f
    • T
      stackprotector: update make rules · 5d707e9c
      Tejun Heo 提交于
      Impact: no default -fno-stack-protector if stackp is enabled, cleanup
      
      Stackprotector make rules had the following problems.
      
      * cc support test and warning are scattered across makefile and
        kernel/panic.c.
      
      * -fno-stack-protector was always added regardless of configuration.
      
      Update such that cc support test and warning are contained in makefile
      and -fno-stack-protector is added iff stackp is turned off.  While at
      it, prepare for 32bit support.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      5d707e9c
  12. 06 2月, 2009 1 次提交
    • T
      modpost: NOBITS sections may point beyond the end of the file · 56fc82c5
      Tejun Heo 提交于
      Impact: fix link failure on certain toolchains with specific configs
      
      Recent percpu change made x86_64 split .data.init section into three
      separate segments - data.init, percpu and data.init2.  data.init2 gets
      .data.nosave and .bss.* and is followed by .notes segment.  Depending
      on configuration both segments might contain no data, in which case
      the tool chain makes the section header to contain offset beyond the
      end of the file.
      
      modpost isn't too happy about it and fails build - as reported by
      Pawel Dziekonski:
      
          Building modules, stage 2.
          MODPOST 416 modules
          FATAL: vmlinux is truncated. sechdrs[i].sh_offset=10354688 >
          sizeof(*hrd)=64
          make[1]: *** [__modpost] Error 1
      
      Teach modpost that NOBITS section may point beyond the end of the file
      and that .modinfo can't be NOBITS.
      Reported-by: NPawel Dziekonski <dzieko@gmail.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      56fc82c5
  13. 31 1月, 2009 1 次提交
  14. 21 1月, 2009 1 次提交
  15. 16 1月, 2009 6 次提交
  16. 15 1月, 2009 2 次提交