30 Apr, 2008

1 commit

  • We can see an ever repeating problem pattern with objects of any kind in the
    kernel:

    1) freeing of active objects
    2) reinitialization of active objects

    Both problems can be hard to debug because the crash happens at a point where
    we have no chance to decode the root cause anymore. One problem spot are
    kernel timers, where the detection of the problem often happens in interrupt
    context and usually causes the machine to panic.

    While working on a timer related bug report I had to hack specialized code
    into the timer subsystem to get a reasonable hint for the root cause. This
    debug hack was fine for temporary use, but far from a mergeable solution due
    to the intrusiveness into the timer code.

    The code further lacked the ability to detect and report the root cause
    instantly and keep the system operational.

    Keeping the system operational is important to get hold of the debug
    information without special debugging aids like serial consoles and special
    knowledge of the bug reporter.

    The problems described above are not restricted to timers, but timers tend to
    expose it usually in a full system crash. Other objects are less explosive,
    but the symptoms caused by such mistakes can be even harder to debug.

    Instead of creating specialized debugging code for the timer subsystem a
    generic infrastructure is created which allows developers to verify their code
    and provides an easy to enable debug facility for users in case of trouble.

    The debugobjects core code keeps track of operations on static and dynamic
    objects by inserting them into a hashed list and sanity checking them on
    object operations and provides additional checks whenever kernel memory is
    freed.

    The tracked object operations are:
    - initializing an object
    - adding an object to a subsystem list
    - deleting an object from a subsystem list

    Each operation is sanity checked before the operation is executed and the
    subsystem specific code can provide a fixup function which allows to prevent
    the damage of the operation. When the sanity check triggers a warning message
    and a stack trace is printed.

    The list of operations can be extended if the need arises. For now it's
    limited to the requirements of the first user (timers).

    The core code enqueues the objects into hash buckets. The hash index is
    generated from the address of the object to simplify the lookup for the check
    on kfree/vfree. Each bucket has it's own spinlock to avoid contention on a
    global lock.

    The debug code can be compiled in without being active. The runtime overhead
    is minimal and could be optimized by asm alternatives. A kernel command line
    option enables the debugging code.

    Thanks to Ingo Molnar for review, suggestions and cleanup patches.

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Ingo Molnar
    Cc: Greg KH
    Cc: Randy Dunlap
    Cc: Kay Sievers
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Thomas Gleixner
     

29 Apr, 2008

1 commit

  • Due to the rcupreempt.h WARN_ON trigged, I got 2G syslog file. For some
    serious complaining of kernel, we need repeat the warnings, so here I isolate
    the ratelimit part of printk.c to a standalone file.

    Signed-off-by: Dave Young
    Acked-by: Paul E. McKenney
    Tested-by: Paul E. McKenney
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dave Young
     

27 Apr, 2008

1 commit

  • Generic versions of __find_first_bit and __find_first_zero_bit
    are introduced as simplified versions of __find_next_bit and
    __find_next_zero_bit. Their compilation and use are guarded by
    a new config variable GENERIC_FIND_FIRST_BIT.

    The generic versions of find_first_bit and find_first_zero_bit
    are implemented in terms of the newly introduced __find_first_bit
    and __find_first_zero_bit.

    This patch does not remove the i386-specific implementation,
    but it does switch i386 to use the generic functions by setting
    GENERIC_FIND_FIRST_BIT=y for X86_32.

    Signed-off-by: Alexander van Heukelum
    Signed-off-by: Ingo Molnar

    Alexander van Heukelum
     

22 Apr, 2008

1 commit

  • * 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc: (202 commits)
    [POWERPC] Fix compile breakage for 64-bit UP configs
    [POWERPC] Define copy_siginfo_from_user32
    [POWERPC] Add compat handler for PTRACE_GETSIGINFO
    [POWERPC] i2c: Fix build breakage introduced by OF helpers
    [POWERPC] Optimize fls64() on 64-bit processors
    [POWERPC] irqtrace support for 64-bit powerpc
    [POWERPC] Stacktrace support for lockdep
    [POWERPC] Move stackframe definitions to common header
    [POWERPC] Fix device-tree locking vs. interrupts
    [POWERPC] Make pci_bus_to_host()'s struct pci_bus * argument const
    [POWERPC] Remove unused __max_memory variable
    [POWERPC] Simplify xics direct/lpar irq_host setup
    [POWERPC] Use pseries_setup_i8259_cascade() in pseries_mpic_init_IRQ()
    [POWERPC] Turn xics_setup_8259_cascade() into a generic pseries_setup_i8259_cascade()
    [POWERPC] Move xics_setup_8259_cascade() into platforms/pseries/setup.c
    [POWERPC] Use asm-generic/bitops/find.h in bitops.h
    [POWERPC] 83xx: mpc8315 - fix USB UTMI Host setup
    [POWERPC] 85xx: Fix the size of qe muram for MPC8568E
    [POWERPC] 86xx: mpc86xx_hpcn - Temporarily accept old dts node identifier.
    [POWERPC] 86xx: mark functions static, other minor cleanups
    ...

    Linus Torvalds
     

19 Apr, 2008

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.26: (1090 commits)
    [NET]: Fix and allocate less memory for ->priv'less netdevices
    [IPV6]: Fix dangling references on error in fib6_add().
    [NETLABEL]: Fix NULL deref in netlbl_unlabel_staticlist_gen() if ifindex not found
    [PKT_SCHED]: Fix datalen check in tcf_simp_init().
    [INET]: Uninline the __inet_inherit_port call.
    [INET]: Drop the inet_inherit_port() call.
    SCTP: Initialize partial_bytes_acked to 0, when all of the data is acked.
    [netdrvr] forcedeth: internal simplifications; changelog removal
    phylib: factor out get_phy_id from within get_phy_device
    PHY: add BCM5464 support to broadcom PHY driver
    cxgb3: Fix __must_check warning with dev_dbg.
    tc35815: Statistics cleanup
    natsemi: fix MMIO for PPC 44x platforms
    [TIPC]: Cleanup of TIPC reference table code
    [TIPC]: Optimized initialization of TIPC reference table
    [TIPC]: Remove inlining of reference table locking routines
    e1000: convert uint16_t style integers to u16
    ixgb: convert uint16_t style integers to u16
    sb1000.c: make const arrays static
    sb1000.c: stop inlining largish static functions
    ...

    Linus Torvalds
     

17 Apr, 2008

1 commit

  • Semaphores are no longer performance-critical, so a generic C
    implementation is better for maintainability, debuggability and
    extensibility. Thanks to Peter Zijlstra for fixing the lockdep
    warning. Thanks to Harvey Harrison for pointing out that the
    unlikely() was unnecessary.

    Signed-off-by: Matthew Wilcox
    Acked-by: Ingo Molnar

    Matthew Wilcox
     

29 Mar, 2008

1 commit

  • The knock-out. The pcounter abstraction is not used any longer in the
    kernel.

    Not sure whether this should go via netdev tree, but as far as I
    remember it was added via this one, and besides Eric thinks that
    Andrew shouldn't mind this.

    Signed-off-by: Pavel Emelyanov
    Signed-off-by: David S. Miller

    Pavel Emelyanov
     

14 Feb, 2008

1 commit


09 Feb, 2008

1 commit

  • lib/scatterlist.c is needed by drivers/media/video/videobuf-dma-sg.c, and
    we would like to be able to use the latter without PCI too, for example, on
    PXA270 ARM CPU. It is then possible to create a configuration with
    CONFIG_BLOCK=n, where only module code will need scatterlist.c. Therefore
    it must be in obj-y.

    Signed-off-by: Guennadi Liakhovetski
    Acked-by: Jens Axboe
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Guennadi Liakhovetski
     

06 Feb, 2008

1 commit


29 Jan, 2008

1 commit

  • This just generalises what was introduced by Eric Dumazet for the struct proto
    inuse field in 286ab3d46058840d68e5d7d52e316c1f7e98c59f:

    [NET]: Define infrastructure to keep 'inuse' changes in an efficent SMP/NUMA way.

    Please look at the comment in there to see the rationale.

    Signed-off-by: Arnaldo Carvalho de Melo
    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Arnaldo Carvalho de Melo
     

28 Jan, 2008

1 commit


15 Nov, 2007

1 commit

  • mac80211 has a reference to __bitmap_empty() via bitmap_empty(). In
    lib/bitmap.c this is flagged with an EXPORT_SYMBOL(), but this is
    ultimately ineffective due to bitmap.o being linked in lib-y, resulting in:

    ERROR: "__bitmap_empty" [net/mac80211/mac80211.ko] undefined!

    Moving bitmap.o to obj-y fixes this up.

    Signed-off-by: Paul Mundt
    Cc: "John W. Linville"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Paul Mundt
     

20 Oct, 2007

1 commit

  • Cause writes to cpuset "cpus" file to update cpus_allowed for member tasks:

    - collect batches of tasks under tasklist_lock and then call
    set_cpus_allowed() on them outside the lock (since this can sleep).

    - add a simple generic priority heap type to allow efficient collection
    of batches of tasks to be processed without duplicating or missing any
    tasks in subsequent batches.

    - make "cpus" file update a no-op if the mask hasn't changed

    - fix race between update_cpumask() and sched_setaffinity() by making
    sched_setaffinity() post-check that it's not running on any cpus outside
    cpuset_cpus_allowed().

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Paul Menage
    Cc: Paul Jackson
    Cc: David Rientjes
    Cc: Nick Piggin
    Cc: Peter Zijlstra
    Cc: Balbir Singh
    Cc: Cedric Le Goater
    Cc: "Eric W. Biederman"
    Cc: Serge Hallyn
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Paul Menage
     

17 Oct, 2007

1 commit

  • Given a set of objects, floating proportions aims to efficiently give the
    proportional 'activity' of a single item as compared to the whole set. Where
    'activity' is a measure of a temporal property of the items.

    It is efficient in that it need not inspect any other items of the set
    in order to provide the answer. It is not even needed to know how many
    other items there are.

    It has one parameter, and that is the period of 'time' over which the
    'activity' is measured.

    Signed-off-by: Peter Zijlstra
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Peter Zijlstra
     

13 Oct, 2007

1 commit


08 Oct, 2007

1 commit

  • Modulat lguest started giving linking errors

    MODPOST 1 modules
    ERROR: "kasprintf" [drivers/lguest/lg.ko] undefined!

    Signed-off-by: Alexey Dobriyan
    Cc: Rusty Russell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     

23 Aug, 2007

1 commit

  • Introduce CONFIG_CHECK_SIGNATURE to control inclusion of check_signature()
    and avoid problems on platforms that don't have readb().

    Let the few legacy (ISA || PCI || X86) drivers that need check_signature()
    select CONFIG_CHECK_SIGNATURE.

    Signed-off-by: Geert Uytterhoeven
    Cc: Jeff Dike
    Cc: Heiko Carstens
    Cc: Roman Zippel
    Cc: Alan Cox
    Cc: Martin Schwidefsky
    Cc: Russell King
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Geert Uytterhoeven
     

01 Aug, 2007

1 commit

  • kasprintf pulls in kmalloc which proved to be fatal for at least
    bootimage target on alpha.
    Move it to a separate file so only users of kasprintf are exposed
    to the dependency on kmalloc.

    Signed-off-by: Sam Ravnborg
    Cc: Jeremy Fitzhardinge
    Cc: Meelis Roos
    Cc: Richard Henderson
    Cc: Ivan Kokshaysky
    Cc: Jay Estabrook
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sam Ravnborg
     

18 Jul, 2007

2 commits

  • argv_split() is a helper function which takes a string, splits it at
    whitespace, and returns a NULL-terminated argv vector. This is
    deliberately simple - it does no quote processing of any kind.

    [ Seems to me that this is something which is already being done in
    the kernel, but I couldn't find any other implementations, either to
    steal or replace. Keep an eye out. ]

    Signed-off-by: Jeremy Fitzhardinge
    Signed-off-by: Chris Wright
    Cc: Andrew Morton
    Cc: Randy Dunlap

    Jeremy Fitzhardinge
     
  • Add CRC7 routines, used for example in MMC over SPI communication.
    Kerneldoc updates

    [akpm@linux-foundation.org: fix funny mix of const and non-const]
    Signed-off-by: Jan Nikitenko
    Signed-off-by: David Brownell
    Cc: "Randy.Dunlap"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jan Nikitenko
     

17 Jul, 2007

2 commits


11 Jul, 2007

1 commit

  • This is a hybrid version of the patch to add the LZO1X compression
    algorithm to the kernel. Nitin and myself have merged the best parts of
    the various patches to form this version which we're both happy with (and
    are jointly signing off).

    The performance of this version is equivalent to the original minilzo code
    it was based on. Bytecode comparisons have also been made on ARM, i386 and
    x86_64 with favourable results.

    There are several users of LZO lined up including jffs2, crypto and reiser4
    since its much faster than zlib.

    Signed-off-by: Nitin Gupta
    Signed-off-by: Richard Purdie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Richard Purdie
     

11 May, 2007

3 commits

  • Based on ace_dump_mem() from Grant Likely for the Xilinx SystemACE
    CompactFlash interface.

    Add print_hex_dump() & hex_dumper() to lib/hexdump.c and linux/kernel.h.

    This patch adds the functions print_hex_dump() & hex_dumper().
    print_hex_dump() can be used to perform a hex + ASCII dump of data to
    syslog, in an easily viewable format, thus providing a common text hex dump
    format.

    hex_dumper() provides a dump-to-memory function. It converts one "line" of
    output (16 bytes of input) at a time.

    Example usages:
    print_hex_dump(KERN_DEBUG, DUMP_PREFIX_ADDRESS, frame->data, frame->len);
    hex_dumper(frame->data, frame->len, linebuf, sizeof(linebuf));

    Example output using %DUMP_PREFIX_OFFSET:
    0009ab42: 40414243 44454647 48494a4b 4c4d4e4f-@ABCDEFG HIJKLMNO
    Example output using %DUMP_PREFIX_ADDRESS:
    ffffffff88089af0: 70717273 74757677 78797a7b 7c7d7e7f-pqrstuvw xyz{|}~.

    [akpm@linux-foundation.org: cleanups, add export]
    Signed-off-by: Randy Dunlap
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     
  • * 'juju' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6: (138 commits)
    firewire: Convert OHCI driver to use standard goto unwinding for error handling.
    firewire: Always use parens with sizeof.
    firewire: Drop single buffer request support.
    firewire: Add a comment to describe why we split the sg list.
    firewire: Return SCSI_MLQUEUE_HOST_BUSY for out of memory cases in queuecommand.
    firewire: Handle the last few DMA mapping error cases.
    firewire: Allocate scsi_host up front and allocate the sbp2_device as hostdata.
    firewire: Provide module aliase for backwards compatibility.
    firewire: Add to fw-core-y instead of assigning fw-core-objs in Makefile.
    firewire: Break out shared IEEE1394 constant to separate header file.
    firewire: Use linux/*.h instead of asm/*.h header files.
    firewire: Uppercase most macro names.
    firewire: Coding style cleanup: no spaces after function names.
    firewire: Convert card_rwsem to a regular mutex.
    firewire: Clean up comment style.
    firewire: Use lib/ implementation of CRC ITU-T.
    CRC ITU-T V.41
    firewire: Rename fw-device-cdev.c to fw-cdev.c and move header to include/linux.
    firewire: Future proof the iso ioctls by adding a handle for the iso context.
    firewire: Add read/write and size annotations to IOC numbers.
    ...

    Acked-by: Christoph Hellwig
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     
  • This will add the CRC calculation according
    to the CRC ITU-T V.41 to the kernel lib/ folder.

    This code has been derived from the rt2x00 driver,
    currently found only in the wireless-dev tree, but
    this library is generic and could be used by more
    drivers who currently use their own implementation.

    Signed-off-by: Ivo van Doorn

    Also useful for the new firewire stack.

    Signed-off-by: Kristian Hoegsberg
    Signed-off-by: Stefan Richter

    Ivo van Doorn
     

26 Apr, 2007

1 commit


12 Feb, 2007

2 commits

  • * Split the implementation-agnostic stuff in separate files.
    * Make sure that targets using non-default request_irq() pull
    kernel/irq/devres.o
    * Introduce new symbols (HAS_IOPORT and HAS_IOMEM) defaulting to positive;
    allow architectures to turn them off (we needed these symbols anyway for
    dependencies of quite a few drivers).
    * protect the ioport-related parts of lib/devres.o with CONFIG_HAS_IOPORT.

    Signed-off-by: Al Viro
    Signed-off-by: Linus Torvalds

    Al Viro
     
  • Part of long forgotten patch
    http://groups.google.com/group/fa.linux.kernel/msg/e98e941ce1cf29f6?dmode=source
    Since then, m32r grabbed two copies.

    Leave s390 copy because of important absence of CONFIG_VT, but remove
    references to non-existent timerlist_lock. ia64 also loses timerlist_lock.

    Signed-off-by: Alexey Dobriyan
    Acked-by: Martin Schwidefsky
    Cc: Andi Kleen
    Cc: "Luck, Tony"
    Cc: Hirokazu Takata
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kirill Korotaev
     

10 Feb, 2007

2 commits

  • devres change moved iomap.o from obj-$(CONFIG_GENERIC_IOMAP) to lib-y
    making it not linked if no in-kernel driver uses it. Fix it.

    Signed-off-by: Tejun Heo
    Signed-off-by: Jeff Garzik

    Tejun Heo
     
  • Implement device resource management, in short, devres. A device
    driver can allocate arbirary size of devres data which is associated
    with a release function. On driver detach, release function is
    invoked on the devres data, then, devres data is freed.

    devreses are typed by associated release functions. Some devreses are
    better represented by single instance of the type while others need
    multiple instances sharing the same release function. Both usages are
    supported.

    devreses can be grouped using devres group such that a device driver
    can easily release acquired resources halfway through initialization
    or selectively release resources (e.g. resources for port 1 out of 4
    ports).

    This patch adds devres core including documentation and the following
    managed interfaces.

    * alloc/free : devm_kzalloc(), devm_kzfree()
    * IO region : devm_request_region(), devm_release_region()
    * IRQ : devm_request_irq(), devm_free_irq()
    * DMA : dmam_alloc_coherent(), dmam_free_coherent(),
    dmam_declare_coherent_memory(), dmam_pool_create(),
    dmam_pool_destroy()
    * PCI : pcim_enable_device(), pcim_pin_device(), pci_is_managed()
    * iomap : devm_ioport_map(), devm_ioport_unmap(), devm_ioremap(),
    devm_ioremap_nocache(), devm_iounmap(), pcim_iomap_table(),
    pcim_iomap(), pcim_iounmap()

    Signed-off-by: Tejun Heo
    Signed-off-by: Jeff Garzik

    Tejun Heo
     

14 Dec, 2006

2 commits

  • Remove useless includes of linux/io.h, don't even try to build iomap_copy
    on uml (it doesn't have readb() et.al., so...)

    Signed-off-by: Al Viro
    Acked-by: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Al Viro
     
  • When some objects are allocated by one CPU but freed by another CPU we can
    consume lot of cycles doing divides in obj_to_index().

    (Typical load on a dual processor machine where network interrupts are
    handled by one particular CPU (allocating skbufs), and the other CPU is
    running the application (consuming and freeing skbufs))

    Here on one production server (dual-core AMD Opteron 285), I noticed this
    divide took 1.20 % of CPU_CLK_UNHALTED events in kernel. But Opteron are
    quite modern cpus and the divide is much more expensive on oldest
    architectures :

    On a 200 MHz sparcv9 machine, the division takes 64 cycles instead of 1
    cycle for a multiply.

    Doing some math, we can use a reciprocal multiplication instead of a divide.

    If we want to compute V = (A / B) (A and B being u32 quantities)
    we can instead use :

    V = ((u64)A * RECIPROCAL(B)) >> 32 ;

    where RECIPROCAL(B) is precalculated to ((1LL << 32) + (B - 1)) / B

    Note :

    I wrote pure C code for clarity. gcc output for i386 is not optimal but
    acceptable :

    mull 0x14(%ebx)
    mov %edx,%eax // part of the >> 32
    xor %edx,%edx // useless
    mov %eax,(%esp) // could be avoided
    mov %edx,0x4(%esp) // useless
    mov (%esp),%ebx

    [akpm@osdl.org: small cleanups]
    Signed-off-by: Eric Dumazet
    Cc: Christoph Lameter
    Cc: David Miller
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric Dumazet
     

09 Dec, 2006

3 commits

  • This patch provides base functions implement to fault-injection
    capabilities.

    - The function should_fail() is taken from failmalloc-1.0
    (http://www.nongnu.org/failmalloc/)

    [akpm@osdl.org: cleanups, comments, add __init]
    Cc:
    Signed-off-by: Akinobu Mita
    Signed-off-by: Don Mullis
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     
  • This patch provides two bit reverse functions and bit reverse table.

    - reverse the order of bits in a u32 value

    u8 bitrev8(u8 x);

    - reverse the order of bits in a u32 value

    u32 bitrev32(u32 x);

    - byte reverse table

    const u8 byte_rev_table[256];

    Signed-off-by: Akinobu Mita
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     
  • This patch adds common handling for kernel BUGs, for use by architectures as
    they wish. The code is derived from arch/powerpc.

    The advantages of having common BUG handling are:
    - consistent BUG reporting across architectures
    - shared implementation of out-of-line file/line data
    - implement CONFIG_DEBUG_BUGVERBOSE consistently

    This means that in inline impact of BUG is just the illegal instruction
    itself, which is an improvement for i386 and x86-64.

    A BUG is represented in the instruction stream as an illegal instruction,
    which has file/line information associated with it. This extra information is
    stored in the __bug_table section in the ELF file.

    When the kernel gets an illegal instruction, it first confirms it might
    possibly be from a BUG (ie, in kernel mode, the right illegal instruction).
    It then calls report_bug(). This searches __bug_table for a matching
    instruction pointer, and if found, prints the corresponding file/line
    information. If report_bug() determines that it wasn't a BUG which caused the
    trap, it returns BUG_TRAP_TYPE_NONE.

    Some architectures (powerpc) implement WARN using the same mechanism; if the
    illegal instruction was the result of a WARN, then report_bug(Q) returns
    CONFIG_DEBUG_BUGVERBOSE; otherwise it returns BUG_TRAP_TYPE_BUG.

    lib/bug.c keeps a list of loaded modules which can be searched for __bug_table
    entries. The architecture must call
    module_bug_finalize()/module_bug_cleanup() from its corresponding
    module_finalize/cleanup functions.

    Unsetting CONFIG_DEBUG_BUGVERBOSE will reduce the kernel size by some amount.
    At the very least, filename and line information will not be recorded for each
    but, but architectures may decide to store no extra information per BUG at
    all.

    Unfortunately, gcc doesn't have a general way to mark an asm() as noreturn, so
    architectures will generally have to include an infinite loop (or similar) in
    the BUG code, so that gcc knows execution won't continue beyond that point.
    gcc does have a __builtin_trap() operator which may be useful to achieve the
    same effect, unfortunately it cannot be used to actually implement the BUG
    itself, because there's no way to get the instruction's address for use in
    generating the __bug_table entry.

    [randy.dunlap@oracle.com: Handle BUG=n, GENERIC_BUG=n to prevent build errors]
    [bunk@stusta.de: include/linux/bug.h must always #include
    Cc: Andi Kleen
    Cc: Hugh Dickens
    Cc: Michael Ellerman
    Cc: Paul Mackerras
    Cc: Benjamin Herrenschmidt
    Cc: Rusty Russell
    Signed-off-by: Adrian Bunk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeremy Fitzhardinge
     

08 Dec, 2006

1 commit

  • Always build hweight8/16/32/64() functions into the kernel so that loadable
    modules may use them.

    I didn't remove GENERIC_HWEIGHT since ALPHA_EV67, ia64, and some variants
    of UltraSparc(64) provide their own hweight functions.

    Fixes config/build problems with NTFS=m and JOYSTICK_ANALOG=m.

    Kernel: arch/x86_64/boot/bzImage is ready (#19)
    Building modules, stage 2.
    MODPOST 94 modules
    WARNING: "hweight32" [fs/ntfs/ntfs.ko] undefined!
    WARNING: "hweight16" [drivers/input/joystick/analog.ko] undefined!
    WARNING: "hweight8" [drivers/input/joystick/analog.ko] undefined!
    make[1]: *** [__modpost] Error 1
    make: *** [modules] Error 2

    Signed-off-by: Randy Dunlap
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     

17 Oct, 2006

2 commits

  • This library function should be in obj-y and not in lib-y. But when we do
    that it clashes unpleasantly with the assembly-language implementation in the
    ia64 architecture.

    Instead of trying to fix it all up, just remove the generic carta_random32 in
    the expectation that the recently-made-generic random32() will suffice.

    If/when perfmon is migrated to random32, ia64's private carta_random32
    implementation can also be removed.

    Cc: Stephane Eranian
    Cc: "Luck, Tony"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • Make net_random() more widely available by calling it random32

    akpm: hopefully this will permit the removal of carta_random32. That needs
    confirmation from Stephane - this code looks somewhat more computationally
    expensive, and has a different (ie: callee-stateful) interface.

    [akpm@osdl.org: lots of build fixes, cleanups]
    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller
    Cc: Stephane Eranian
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stephen Hemminger