Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial
authorLinus Torvalds <torvalds@g5.osdl.org>
Sun, 26 Mar 2006 17:41:18 +0000 (09:41 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Sun, 26 Mar 2006 17:41:18 +0000 (09:41 -0800)
* git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial:
  drivers/char/ftape/lowlevel/fdc-io.c: Correct a comment
  Kconfig help: MTD_JEDECPROBE already supports Intel
  Remove ugly debugging stuff
  do_mounts.c: Minor ROOT_DEV comment cleanup
  BUG_ON() Conversion in drivers/s390/block/dasd_devmap.c
  BUG_ON() Conversion in mm/mempool.c
  BUG_ON() Conversion in mm/memory.c
  BUG_ON() Conversion in kernel/fork.c
  BUG_ON() Conversion in ipc/sem.c
  BUG_ON() Conversion in fs/ext2/
  BUG_ON() Conversion in fs/hfs/
  BUG_ON() Conversion in fs/dcache.c
  BUG_ON() Conversion in fs/buffer.c
  BUG_ON() Conversion in input/serio/hp_sdc_mlc.c
  BUG_ON() Conversion in md/dm-table.c
  BUG_ON() Conversion in md/dm-path-selector.c
  BUG_ON() Conversion in drivers/isdn
  BUG_ON() Conversion in drivers/char
  BUG_ON() Conversion in drivers/mtd/

334 files changed:
Documentation/cachetlb.txt
Documentation/drivers/edac/edac.txt
Documentation/networking/vortex.txt
Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
MAINTAINERS
arch/alpha/Kconfig
arch/alpha/kernel/osf_sys.c
arch/alpha/lib/ev6-memchr.S
arch/alpha/lib/fpreg.c
arch/arm/Kconfig
arch/arm26/Kconfig
arch/arm26/kernel/traps.c
arch/cris/Kconfig
arch/frv/Kconfig
arch/frv/mm/mmu-context.c
arch/h8300/Kconfig
arch/i386/Kconfig
arch/i386/Makefile
arch/i386/boot/Makefile
arch/i386/kernel/acpi/boot.c
arch/i386/kernel/cpu/cpufreq/powernow-k8.c
arch/i386/kernel/cpu/mtrr/main.c
arch/i386/kernel/dmi_scan.c
arch/i386/kernel/efi.c
arch/i386/kernel/kprobes.c
arch/i386/kernel/microcode.c
arch/i386/kernel/process.c
arch/i386/kernel/setup.c
arch/i386/kernel/traps.c
arch/ia64/Kconfig
arch/ia64/ia32/ia32priv.h
arch/ia64/ia32/sys_ia32.c
arch/ia64/kernel/Makefile
arch/ia64/kernel/acpi.c
arch/ia64/kernel/efi.c
arch/ia64/kernel/kprobes.c
arch/ia64/kernel/mca.c
arch/ia64/kernel/process.c
arch/ia64/kernel/setup.c
arch/ia64/lib/Makefile
arch/ia64/lib/bitop.c [deleted file]
arch/ia64/mm/Makefile
arch/ia64/mm/ioremap.c [new file with mode: 0644]
arch/ia64/sn/kernel/setup.c
arch/m32r/Kconfig
arch/m68k/Kconfig
arch/m68k/bvme6000/config.c
arch/m68knommu/Kconfig
arch/mips/Kconfig
arch/mips/kernel/linux32.c
arch/mips/kernel/scall64-n32.S
arch/mips/kernel/scall64-o32.S
arch/mips/lasat/sysctl.c
arch/parisc/Kconfig
arch/parisc/kernel/sys_parisc32.c
arch/parisc/kernel/syscall_table.S
arch/powerpc/Kconfig
arch/powerpc/kernel/kprobes.c
arch/powerpc/kernel/process.c
arch/powerpc/kernel/sys_ppc32.c
arch/powerpc/mm/imalloc.c
arch/powerpc/platforms/cell/spu_base.c
arch/powerpc/platforms/powermac/cpufreq_64.c
arch/ppc/Kconfig
arch/s390/Kconfig
arch/s390/crypto/crypt_s390_query.c
arch/s390/kernel/compat_linux.c
arch/s390/kernel/compat_wrapper.S
arch/s390/kernel/syscalls.S
arch/sh/Kconfig
arch/sh64/Kconfig
arch/sparc/Kconfig
arch/sparc64/Kconfig
arch/sparc64/kernel/kprobes.c
arch/sparc64/kernel/sparc64_ksyms.c
arch/sparc64/kernel/sys_sparc32.c
arch/sparc64/kernel/systbls.S
arch/sparc64/lib/Makefile
arch/sparc64/lib/find_bit.c [deleted file]
arch/um/Kconfig.i386
arch/um/Kconfig.x86_64
arch/v850/Kconfig
arch/x86_64/Kconfig
arch/x86_64/Makefile
arch/x86_64/boot/Makefile
arch/x86_64/ia32/ia32entry.S
arch/x86_64/ia32/sys_ia32.c
arch/x86_64/kernel/kprobes.c
arch/x86_64/kernel/process.c
arch/xtensa/Kconfig
block/Kconfig
block/cfq-iosched.c
drivers/acpi/osl.c
drivers/acpi/processor_core.c
drivers/acpi/tables.c
drivers/block/Kconfig
drivers/block/aoe/aoeblk.c
drivers/block/floppy.c
drivers/block/loop.c
drivers/block/pktcdvd.c
drivers/char/Kconfig
drivers/char/ipmi/ipmi_devintf.c
drivers/char/ipmi/ipmi_msghandler.c
drivers/char/ipmi/ipmi_poweroff.c
drivers/char/ipmi/ipmi_si_intf.c
drivers/char/ipmi/ipmi_si_sm.h
drivers/char/ipmi/ipmi_watchdog.c
drivers/char/mem.c
drivers/char/tlclk.c
drivers/edac/Kconfig
drivers/edac/amd76x_edac.c
drivers/edac/e752x_edac.c
drivers/edac/e7xxx_edac.c
drivers/edac/edac_mc.c
drivers/edac/edac_mc.h
drivers/edac/i82860_edac.c
drivers/edac/i82875p_edac.c
drivers/edac/r82600_edac.c
drivers/firmware/efivars.c
drivers/firmware/pcdp.c
drivers/ieee1394/highlevel.c
drivers/input/touchscreen/ads7846.c
drivers/isdn/Makefile
drivers/isdn/gigaset/Kconfig [new file with mode: 0644]
drivers/isdn/gigaset/Makefile [new file with mode: 0644]
drivers/isdn/gigaset/asyncdata.c [new file with mode: 0644]
drivers/isdn/gigaset/bas-gigaset.c [new file with mode: 0644]
drivers/isdn/gigaset/common.c [new file with mode: 0644]
drivers/isdn/gigaset/ev-layer.c [new file with mode: 0644]
drivers/isdn/gigaset/gigaset.h [new file with mode: 0644]
drivers/isdn/gigaset/i4l.c [new file with mode: 0644]
drivers/isdn/gigaset/interface.c [new file with mode: 0644]
drivers/isdn/gigaset/isocdata.c [new file with mode: 0644]
drivers/isdn/gigaset/proc.c [new file with mode: 0644]
drivers/isdn/gigaset/usb-gigaset.c [new file with mode: 0644]
drivers/isdn/hardware/avm/avmcard.h
drivers/isdn/i4l/Kconfig
drivers/macintosh/smu.c
drivers/md/bitmap.c
drivers/md/dm-crypt.c
drivers/md/dm-io.c
drivers/md/dm-mpath.c
drivers/md/dm-raid1.c
drivers/md/dm-snap.c
drivers/md/dm.c
drivers/md/kcopyd.c
drivers/md/multipath.c
drivers/message/i2o/i2o_block.c
drivers/net/3c59x.c
drivers/net/sis900.c
drivers/net/wan/dscc4.c
drivers/parport/share.c
drivers/pci/hotplug/rpadlpar_core.c
drivers/pci/hotplug/sgi_hotplug.c
drivers/pnp/isapnp/core.c
drivers/s390/char/raw3270.c
drivers/s390/scsi/zfcp_aux.c
drivers/scsi/iscsi_tcp.c
drivers/scsi/lpfc/lpfc_mem.c
drivers/scsi/qla2xxx/qla_os.c
drivers/scsi/scsi_lib.c
drivers/telephony/phonedev.c
fs/afs/file.c
fs/bio.c
fs/block_dev.c
fs/buffer.c
fs/cifs/cifsfs.c
fs/cifs/file.c
fs/cifs/inode.c
fs/cifs/readdir.c
fs/cramfs/inode.c
fs/dcache.c
fs/dcookies.c
fs/direct-io.c
fs/dnotify.c
fs/eventpoll.c
fs/exec.c
fs/ext2/inode.c
fs/ext3/balloc.c
fs/ext3/dir.c
fs/ext3/inode.c
fs/ext3/super.c
fs/fat/inode.c
fs/fcntl.c
fs/hfs/inode.c
fs/hfsplus/inode.c
fs/inode.c
fs/inotify.c
fs/jbd/transaction.c
fs/jffs2/compr_zlib.c
fs/jfs/inode.c
fs/jfs/jfs_logmgr.c
fs/jfs/jfs_metapage.c
fs/lockd/host.c
fs/lockd/svc.c
fs/lockd/svcsubs.c
fs/locks.c
fs/mpage.c
fs/namespace.c
fs/nfs/callback.c
fs/nfs/file.c
fs/nfs/read.c
fs/nfs/write.c
fs/nfsd/nfs4state.c
fs/ntfs/logfile.c
fs/ntfs/mft.c
fs/ntfs/ntfs.h
fs/ocfs2/aops.c
fs/ocfs2/journal.c
fs/ocfs2/namei.c
fs/partitions/devfs.c
fs/pipe.c
fs/proc/array.c
fs/proc/generic.c
fs/proc/proc_devtree.c
fs/reiserfs/inode.c
fs/reiserfs/prints.c
fs/super.c
fs/xfs/linux-2.6/xfs_aops.c
fs/xfs/linux-2.6/xfs_super.c
include/asm-alpha/bitops.h
include/asm-alpha/fpu.h
include/asm-arm/bitops.h
include/asm-arm26/bitops.h
include/asm-cris/bitops.h
include/asm-frv/bitops.h
include/asm-generic/bitops.h
include/asm-generic/bitops/__ffs.h [new file with mode: 0644]
include/asm-generic/bitops/atomic.h [new file with mode: 0644]
include/asm-generic/bitops/ext2-atomic.h [new file with mode: 0644]
include/asm-generic/bitops/ext2-non-atomic.h [new file with mode: 0644]
include/asm-generic/bitops/ffs.h [new file with mode: 0644]
include/asm-generic/bitops/ffz.h [new file with mode: 0644]
include/asm-generic/bitops/find.h [new file with mode: 0644]
include/asm-generic/bitops/fls.h [new file with mode: 0644]
include/asm-generic/bitops/fls64.h [new file with mode: 0644]
include/asm-generic/bitops/hweight.h [new file with mode: 0644]
include/asm-generic/bitops/le.h [new file with mode: 0644]
include/asm-generic/bitops/minix-le.h [new file with mode: 0644]
include/asm-generic/bitops/minix.h [new file with mode: 0644]
include/asm-generic/bitops/non-atomic.h [new file with mode: 0644]
include/asm-generic/bitops/sched.h [new file with mode: 0644]
include/asm-h8300/bitops.h
include/asm-h8300/types.h
include/asm-i386/bitops.h
include/asm-i386/kprobes.h
include/asm-i386/stat.h
include/asm-i386/types.h
include/asm-ia64/bitops.h
include/asm-ia64/dmi.h [new file with mode: 0644]
include/asm-ia64/io.h
include/asm-ia64/sn/sn_sal.h
include/asm-m32r/bitops.h
include/asm-m68k/bitops.h
include/asm-m68k/stat.h
include/asm-m68knommu/bitops.h
include/asm-mips/bitops.h
include/asm-mips/types.h
include/asm-parisc/bitops.h
include/asm-powerpc/bitops.h
include/asm-powerpc/types.h
include/asm-s390/bitops.h
include/asm-s390/types.h
include/asm-sh/bitops.h
include/asm-sh/stat.h
include/asm-sh/thread_info.h
include/asm-sh/types.h
include/asm-sh64/bitops.h
include/asm-sparc/bitops.h
include/asm-sparc64/bitops.h
include/asm-v850/bitops.h
include/asm-x86_64/bitops.h
include/asm-xtensa/bitops.h
include/linux/bitops.h
include/linux/buffer_head.h
include/linux/compat.h
include/linux/efi.h
include/linux/ext3_fs.h
include/linux/fs.h
include/linux/gameport.h
include/linux/gigaset_dev.h [new file with mode: 0644]
include/linux/highmem.h
include/linux/hpet.h
include/linux/hrtimer.h
include/linux/i2o.h
include/linux/ipmi.h
include/linux/ipmi_msgdefs.h
include/linux/ipmi_smi.h
include/linux/jbd.h
include/linux/ktime.h
include/linux/mempool.h
include/linux/proc_fs.h
include/linux/sched.h
include/linux/serio.h
include/linux/smp.h
include/linux/stat.h
include/linux/statfs.h
include/linux/time.h
include/linux/timer.h
include/linux/timex.h
include/linux/types.h
init/initramfs.c
init/main.c
ipc/compat.c
ipc/mqueue.c
ipc/msg.c
ipc/sem.c
ipc/shm.c
ipc/util.c
ipc/util.h
kernel/compat.c
kernel/fork.c
kernel/hrtimer.c
kernel/irq/manage.c
kernel/itimer.c
kernel/kprobes.c
kernel/posix-timers.c
kernel/power/swap.c
kernel/sched.c
kernel/time.c
lib/Makefile
lib/bitmap.c
lib/find_next_bit.c
lib/hweight.c [new file with mode: 0644]
mm/highmem.c
mm/memory.c
mm/mempool.c
net/ipv4/ipvs/ip_vs_ctl.c
net/ipv4/netfilter/ipt_hashlimit.c
net/netlink/genetlink.c
net/sunrpc/sched.c
sound/oss/cmpci.c
sound/oss/sonicvibes.c
sound/oss/vwsnd.c

index 4ae418889b881c857f4c3b77b8b554e405f705ae..53245c429f7d9f13999803ea4ced0813437fceb5 100644 (file)
@@ -362,6 +362,27 @@ maps this page at its virtual address.
        likely that you will need to flush the instruction cache
        for copy_to_user_page().
 
+  void flush_anon_page(struct page *page, unsigned long vmaddr)
+       When the kernel needs to access the contents of an anonymous
+       page, it calls this function (currently only
+       get_user_pages()).  Note: flush_dcache_page() deliberately
+       doesn't work for an anonymous page.  The default
+       implementation is a nop (and should remain so for all coherent
+       architectures).  For incoherent architectures, it should flush
+       the cache of the page at vmaddr in the current user process.
+
+  void flush_kernel_dcache_page(struct page *page)
+       When the kernel needs to modify a user page is has obtained
+       with kmap, it calls this function after all modifications are
+       complete (but before kunmapping it) to bring the underlying
+       page up to date.  It is assumed here that the user has no
+       incoherent cached copies (i.e. the original page was obtained
+       from a mechanism like get_user_pages()).  The default
+       implementation is a nop and should remain so on all coherent
+       architectures.  On incoherent architectures, this should flush
+       the kernel cache for page (using page_address(page)).
+
+
   void flush_icache_range(unsigned long start, unsigned long end)
        When the kernel stores into addresses that it will execute
        out of (eg when loading modules), this function is called.
index d37191fe5681fcd48683bc5ba1e3703585ac21b7..70d96a62e5e12e2dcdcd58a64e623e0f7678c106 100644 (file)
@@ -21,7 +21,7 @@ within the computer system. In the initial release, memory Correctable Errors
 
 Detecting CE events, then harvesting those events and reporting them,
 CAN be a predictor of future UE events.  With CE events, the system can
-continue to operate, but with less safety. Preventive maintainence and
+continue to operate, but with less safety. Preventive maintenance and
 proactive part replacement of memory DIMMs exhibiting CEs can reduce
 the likelihood of the dreaded UE events and system 'panics'.
 
@@ -29,13 +29,13 @@ the likelihood of the dreaded UE events and system 'panics'.
 In addition, PCI Bus Parity and SERR Errors are scanned for on PCI devices
 in order to determine if errors are occurring on data transfers.
 The presence of PCI Parity errors must be examined with a grain of salt.
-There are several addin adapters that do NOT follow the PCI specification
+There are several add-in adapters that do NOT follow the PCI specification
 with regards to Parity generation and reporting. The specification says
 the vendor should tie the parity status bits to 0 if they do not intend
 to generate parity.  Some vendors do not do this, and thus the parity bit
 can "float" giving false positives.
 
-The PCI Parity EDAC device has the ability to "skip" known flakey
+The PCI Parity EDAC device has the ability to "skip" known flaky
 cards during the parity scan. These are set by the parity "blacklist"
 interface in the sysfs for PCI Parity. (See the PCI section in the sysfs
 section below.) There is also a parity "whitelist" which is used as
@@ -101,7 +101,7 @@ Memory Controller (mc) Model
 
 First a background on the memory controller's model abstracted in EDAC.
 Each mc device controls a set of DIMM memory modules. These modules are
-layed out in a Chip-Select Row (csrowX) and Channel table (chX). There can
+laid out in a Chip-Select Row (csrowX) and Channel table (chX). There can
 be multiple csrows and two channels.
 
 Memory controllers allow for several csrows, with 8 csrows being a typical value.
@@ -131,7 +131,7 @@ for memory DIMMs:
        DIMM_B1
 
 Labels for these slots are usually silk screened on the motherboard. Slots
-labeled 'A' are channel 0 in this example. Slots labled 'B'
+labeled 'A' are channel 0 in this example. Slots labeled 'B'
 are channel 1. Notice that there are two csrows possible on a
 physical DIMM. These csrows are allocated their csrow assignment
 based on the slot into which the memory DIMM is placed. Thus, when 1 DIMM
@@ -140,7 +140,7 @@ is placed in each Channel, the csrows cross both DIMMs.
 Memory DIMMs come single or dual "ranked". A rank is a populated csrow.
 Thus, 2 single ranked DIMMs, placed in slots DIMM_A0 and DIMM_B0 above
 will have 1 csrow, csrow0. csrow1 will be empty. On the other hand,
-when 2 dual ranked DIMMs are similiaryly placed, then both csrow0 and
+when 2 dual ranked DIMMs are similarly placed, then both csrow0 and
 csrow1 will be populated. The pattern repeats itself for csrow2 and
 csrow3.
 
@@ -246,7 +246,7 @@ Module Version read-only attribute file:
 
        'mc_version'
 
-       The EDAC CORE modules's version and compile date are shown here to
+       The EDAC CORE module's version and compile date are shown here to
        indicate what EDAC is running.
 
 
@@ -423,7 +423,7 @@ Total memory managed by this csrow attribute file:
        'size_mb'
 
        This attribute file displays, in count of megabytes, of memory
-       that this csrow contatins.
+       that this csrow contains.
 
 
 Memory Type attribute file:
@@ -557,7 +557,7 @@ On Header Type 00 devices the primary status is looked at
 for any parity error regardless of whether Parity is enabled on the
 device.  (The spec indicates parity is generated in some cases).
 On Header Type 01 bridges, the secondary status register is also
-looked at to see if parity ocurred on the bus on the other side of
+looked at to see if parity occurred on the bus on the other side of
 the bridge.
 
 
@@ -588,7 +588,7 @@ Panic on PCI PARITY Error:
        'panic_on_pci_parity'
 
 
-       This control files enables or disables panic'ing when a parity
+       This control files enables or disables panicking when a parity
        error has been detected.
 
 
@@ -616,12 +616,12 @@ PCI Device Whitelist:
 
        This control file allows for an explicit list of PCI devices to be
        scanned for parity errors. Only devices found on this list will
-       be examined.  The list is a line of hexadecimel VENDOR and DEVICE
+       be examined.  The list is a line of hexadecimal VENDOR and DEVICE
        ID tuples:
 
        1022:7450,1434:16a6
 
-       One or more can be inserted, seperated by a comma.
+       One or more can be inserted, separated by a comma.
 
        To write the above list doing the following as one command line:
 
@@ -639,11 +639,11 @@ PCI Device Blacklist:
 
        This control file allows for a list of PCI devices to be
        skipped for scanning.
-       The list is a line of hexadecimel VENDOR and DEVICE ID tuples:
+       The list is a line of hexadecimal VENDOR and DEVICE ID tuples:
 
        1022:7450,1434:16a6
 
-       One or more can be inserted, seperated by a comma.
+       One or more can be inserted, separated by a comma.
 
        To write the above list doing the following as one command line:
 
@@ -651,14 +651,14 @@ PCI Device Blacklist:
                > /sys/devices/system/edac/pci/pci_parity_blacklist
 
 
-       To display what the whitelist current contatins,
+       To display what the whitelist currently contains,
        simply 'cat' the same file.
 
 =======================================================================
 
 PCI Vendor and Devices IDs can be obtained with the lspci command. Using
 the -n option lspci will display the vendor and device IDs. The system
-adminstrator will have to determine which devices should be scanned or
+administrator will have to determine which devices should be scanned or
 skipped.
 
 
@@ -669,5 +669,5 @@ Turn OFF a whitelist by an empty echo command:
 
        echo > /sys/devices/system/edac/pci/pci_parity_whitelist
 
-and any previous blacklist will be utililzed.
+and any previous blacklist will be utilized.
 
index 3759acf95b2919ddf646b25f1d937e218c79aa8a..6091e5f6794f90c33d1c031d8fcb0d0114a35587 100644 (file)
@@ -24,36 +24,44 @@ Since kernel 2.3.99-pre6, this driver incorporates the support for the
 
 This driver supports the following hardware:
 
-   3c590 Vortex 10Mbps
-   3c592 EISA 10mbps Demon/Vortex
-   3c597 EISA Fast Demon/Vortex
-   3c595 Vortex 100baseTx
-   3c595 Vortex 100baseT4
-   3c595 Vortex 100base-MII
-   3Com Vortex
-   3c900 Boomerang 10baseT
-   3c900 Boomerang 10Mbps Combo
-   3c900 Cyclone 10Mbps TPO
-   3c900B Cyclone 10Mbps T
-   3c900 Cyclone 10Mbps Combo
-   3c900 Cyclone 10Mbps TPC
-   3c900B-FL Cyclone 10base-FL
-   3c905 Boomerang 100baseTx
-   3c905 Boomerang 100baseT4
-   3c905B Cyclone 100baseTx
-   3c905B Cyclone 10/100/BNC
-   3c905B-FX Cyclone 100baseFx
-   3c905C Tornado
-   3c980 Cyclone
-   3cSOHO100-TX Hurricane
-   3c555 Laptop Hurricane
-   3c575 Boomerang CardBus
-   3CCFE575 Cyclone CardBus
-   3CCFE575CT Cyclone CardBus
-   3CCFE656 Cyclone CardBus
-   3CCFEM656 Cyclone CardBus
-   3c450 Cyclone/unknown
-
+       3c590 Vortex 10Mbps
+       3c592 EISA 10Mbps Demon/Vortex
+       3c597 EISA Fast Demon/Vortex
+       3c595 Vortex 100baseTx
+       3c595 Vortex 100baseT4
+       3c595 Vortex 100base-MII
+       3c900 Boomerang 10baseT
+       3c900 Boomerang 10Mbps Combo
+       3c900 Cyclone 10Mbps TPO
+       3c900 Cyclone 10Mbps Combo
+       3c900 Cyclone 10Mbps TPC
+       3c900B-FL Cyclone 10base-FL
+       3c905 Boomerang 100baseTx
+       3c905 Boomerang 100baseT4
+       3c905B Cyclone 100baseTx
+       3c905B Cyclone 10/100/BNC
+       3c905B-FX Cyclone 100baseFx
+       3c905C Tornado
+       3c920B-EMB-WNM (ATI Radeon 9100 IGP)
+       3c980 Cyclone
+       3c980C Python-T
+       3cSOHO100-TX Hurricane
+       3c555 Laptop Hurricane
+       3c556 Laptop Tornado
+       3c556B Laptop Hurricane
+       3c575 [Megahertz] 10/100 LAN  CardBus
+       3c575 Boomerang CardBus
+       3CCFE575BT Cyclone CardBus
+       3CCFE575CT Tornado CardBus
+       3CCFE656 Cyclone CardBus
+       3CCFEM656B Cyclone+Winmodem CardBus
+       3CXFEM656C Tornado+Winmodem CardBus
+       3c450 HomePNA Tornado
+       3c920 Tornado
+       3c982 Hydra Dual Port A
+       3c982 Hydra Dual Port B
+       3c905B-T4
+       3c920B-EMB-WNM Tornado
 
 Module parameters
 =================
@@ -293,11 +301,6 @@ Donald's wake-on-LAN page:
 
      http://www.scyld.com/wakeonlan.html
 
-3Com's documentation for many NICs, including the ones supported by
-this driver is available at 
-
-     http://support.3com.com/partners/developer/developer_form.html
-
 3Com's DOS-based application for setting up the NICs EEPROMs:
 
        ftp://ftp.3com.com/pub/nic/3c90x/3c90xx2.exe
@@ -312,10 +315,10 @@ Autonegotiation notes
 ---------------------
 
   The driver uses a one-minute heartbeat for adapting to changes in
-  the external LAN environment.  This means that when, for example, a
-  machine is unplugged from a hubbed 10baseT LAN plugged into a
-  switched 100baseT LAN, the throughput will be quite dreadful for up
-  to sixty seconds.  Be patient.
+  the external LAN environment if link is up and 5 seconds if link is down.
+  This means that when, for example, a machine is unplugged from a hubbed
+  10baseT LAN plugged into a  switched 100baseT LAN, the throughput
+  will be quite dreadful for up to sixty seconds.  Be patient.
 
   Cisco interoperability note from Walter Wong <wcw+@CMU.EDU>:
 
index 6dc9d9f622ca622e517aceacbd539b727d9f7208..6feef9e82b63f832a26272d4909a575fcdc3cd03 100644 (file)
@@ -2836,7 +2836,7 @@ struct _snd_pcm_runtime {
 
         <para>
        Note that this callback became non-atomic since the recent version.
-       You can use schedule-related fucntions safely in this callback now.
+       You can use schedule-related functions safely in this callback now.
         </para>
 
         <para>
index 4e8fbbc5566de6683aa151d167a64a4e13eb0ed0..f27846734b06c1ce184dde2a59cc5201c8377357 100644 (file)
@@ -882,13 +882,34 @@ W:        http://ebtables.sourceforge.net/
 S:     Maintained
 
 EDAC-CORE
-P:      Doug Thompson
-M:      norsk5@xmission.com, dthompson@linuxnetworx.com
-P:      Dave Peterson
-M:      dsp@llnl.gov, dave_peterson@pobox.com
-L:      bluesmoke-devel@lists.sourceforge.net
-W:      bluesmoke.sourceforge.net
-S:      Maintained
+P:     Doug Thompson
+M:     norsk5@xmission.com, dthompson@linuxnetworx.com
+P:     Dave Peterson
+M:     dsp@llnl.gov, dave_peterson@pobox.com
+L:     bluesmoke-devel@lists.sourceforge.net
+W:     bluesmoke.sourceforge.net
+S:     Maintained
+
+EDAC-E752X
+P:     Dave Peterson
+M:     dsp@llnl.gov, dave_peterson@pobox.com
+L:     bluesmoke-devel@lists.sourceforge.net
+W:     bluesmoke.sourceforge.net
+S:     Maintained
+
+EDAC-E7XXX
+P:     Dave Peterson
+M:     dsp@llnl.gov, dave_peterson@pobox.com
+L:     bluesmoke-devel@lists.sourceforge.net
+W:     bluesmoke.sourceforge.net
+S:     Maintained
+
+EDAC-R82600
+P:     Tim Small
+M:     tim@buttersideup.com
+L:     bluesmoke-devel@lists.sourceforge.net
+W:     bluesmoke.sourceforge.net
+S:     Maintained
 
 EEPRO100 NETWORK DRIVER
 P:     Andrey V. Savochkin
@@ -1039,6 +1060,15 @@ M:       khc@pm.waw.pl
 W:     http://www.kernel.org/pub/linux/utils/net/hdlc/
 S:     Maintained
 
+GIGASET ISDN DRIVERS
+P:     Hansjoerg Lipp
+M:     hjlipp@web.de
+P:     Tilman Schmidt
+M:     tilman@imap.cc
+L:     gigaset307x-common@lists.sourceforge.net
+W:     http://gigaset307x.sourceforge.net/
+S:     Maintained
+
 HARDWARE MONITORING
 P:     Jean Delvare
 M:     khali@linux-fr.org
index eedf41bf7057567b182ab221c64908da1685c98d..9bef61b303674e3be48a0fbb403ee7d85c126e30 100644 (file)
@@ -25,6 +25,10 @@ config RWSEM_XCHGADD_ALGORITHM
        bool
        default y
 
+config GENERIC_FIND_NEXT_BIT
+       bool
+       default y
+
 config GENERIC_CALIBRATE_DELAY
        bool
        default y
@@ -447,6 +451,10 @@ config ALPHA_IRONGATE
        depends on ALPHA_NAUTILUS
        default y
 
+config GENERIC_HWEIGHT
+       bool
+       default y if !ALPHA_EV6 && !ALPHA_EV67
+
 config ALPHA_AVANTI
        bool
        depends on ALPHA_XL || ALPHA_AVANTI_CH
index 7fb14f42a12519938dd6840e48f1ef3c8e66abf6..31afe3d91ac6fd3fcd7df09635184ff0113c2fa6 100644 (file)
@@ -821,7 +821,6 @@ osf_setsysinfo(unsigned long op, void __user *buffer, unsigned long nbytes,
    affects all sorts of things, like timeval and itimerval.  */
 
 extern struct timezone sys_tz;
-extern int do_adjtimex(struct timex *);
 
 struct timeval32
 {
index a8e843dbcc23de767b8e9432966e12fa36454294..1a5f71b9d8b10286f324b2e13e9be79ddb1d4abb 100644 (file)
@@ -84,7 +84,7 @@ $last_quad:
         beq     $2, $not_found # U : U L U L
 
 $found_it:
-#if defined(__alpha_fix__) && defined(__alpha_cix__)
+#ifdef CONFIG_ALPHA_EV67
        /*
         * Since we are guaranteed to have set one of the bits, we don't
         * have to worry about coming back with a 0x40 out of cttz...
index 97c4d9d7a4d56f3f37f8e9c9484f62509adde748..05017ba34c3cc40e22a97b4de62bdc0f363901de 100644 (file)
@@ -4,7 +4,7 @@
  * (C) Copyright 1998 Linus Torvalds
  */
 
-#if defined(__alpha_cix__) || defined(__alpha_fix__)
+#if defined(CONFIG_ALPHA_EV6) || defined(CONFIG_ALPHA_EV67)
 #define STT(reg,val)  asm volatile ("ftoit $f"#reg",%0" : "=r"(val));
 #else
 #define STT(reg,val)  asm volatile ("stt $f"#reg",%0" : "=m"(val));
@@ -53,7 +53,7 @@ alpha_read_fp_reg (unsigned long reg)
        return val;
 }
 
-#if defined(__alpha_cix__) || defined(__alpha_fix__)
+#if defined(CONFIG_ALPHA_EV6) || defined(CONFIG_ALPHA_EV67)
 #define LDT(reg,val)  asm volatile ("itoft %0,$f"#reg : : "r"(val));
 #else
 #define LDT(reg,val)  asm volatile ("ldt $f"#reg",%0" : : "m"(val));
@@ -98,7 +98,7 @@ alpha_write_fp_reg (unsigned long reg, unsigned long val)
        }
 }
 
-#if defined(__alpha_cix__) || defined(__alpha_fix__)
+#if defined(CONFIG_ALPHA_EV6) || defined(CONFIG_ALPHA_EV67)
 #define STS(reg,val)  asm volatile ("ftois $f"#reg",%0" : "=r"(val));
 #else
 #define STS(reg,val)  asm volatile ("sts $f"#reg",%0" : "=m"(val));
@@ -147,7 +147,7 @@ alpha_read_fp_reg_s (unsigned long reg)
        return val;
 }
 
-#if defined(__alpha_cix__) || defined(__alpha_fix__)
+#if defined(CONFIG_ALPHA_EV6) || defined(CONFIG_ALPHA_EV67)
 #define LDS(reg,val)  asm volatile ("itofs %0,$f"#reg : : "r"(val));
 #else
 #define LDS(reg,val)  asm volatile ("lds $f"#reg",%0" : : "m"(val));
index 0dd24ebdf6ac2163f03a4b1b02040953edbc3072..bf2e72698d020beabbb9ad14c687dcbec1debc28 100644 (file)
@@ -53,6 +53,10 @@ config RWSEM_GENERIC_SPINLOCK
 config RWSEM_XCHGADD_ALGORITHM
        bool
 
+config GENERIC_HWEIGHT
+       bool
+       default y
+
 config GENERIC_CALIBRATE_DELAY
        bool
        default y
index dee23d87fc5acf482af0ed3d68afc26d4fc6b2ea..cf4ebf4c274d792882ddfd7159982ac51528cae6 100644 (file)
@@ -41,6 +41,10 @@ config RWSEM_GENERIC_SPINLOCK
 config RWSEM_XCHGADD_ALGORITHM
        bool
 
+config GENERIC_HWEIGHT
+       bool
+       default y
+
 config GENERIC_CALIBRATE_DELAY
        bool
        default y
index 5847ea5d7747f6f73dd86bbd6f18af2eaa930ef9..a79de041b50e5c9795b33fa02563eee185ff26cb 100644 (file)
@@ -34,7 +34,7 @@
 #include <asm/system.h>
 #include <asm/uaccess.h>
 #include <asm/unistd.h>
-#include <asm/semaphore.h>
+#include <linux/mutex.h>
 
 #include "ptrace.h"
 
@@ -207,19 +207,19 @@ void die_if_kernel(const char *str, struct pt_regs *regs, int err)
        die(str, regs, err);
 }
 
-static DECLARE_MUTEX(undef_sem);
+static DEFINE_MUTEX(undef_mutex);
 static int (*undef_hook)(struct pt_regs *);
 
 int request_undef_hook(int (*fn)(struct pt_regs *))
 {
        int ret = -EBUSY;
 
-       down(&undef_sem);
+       mutex_lock(&undef_mutex);
        if (undef_hook == NULL) {
                undef_hook = fn;
                ret = 0;
        }
-       up(&undef_sem);
+       mutex_unlock(&undef_mutex);
 
        return ret;
 }
@@ -228,12 +228,12 @@ int release_undef_hook(int (*fn)(struct pt_regs *))
 {
        int ret = -EINVAL;
 
-       down(&undef_sem);
+       mutex_lock(&undef_mutex);
        if (undef_hook == fn) {
                undef_hook = NULL;
                ret = 0;
        }
-       up(&undef_sem);
+       mutex_unlock(&undef_mutex);
 
        return ret;
 }
index b832619497372a6336b8ad46f1b21f01728d98bf..856b665020e770d8a464e40a74cd91a7f5649b7e 100644 (file)
@@ -16,6 +16,14 @@ config RWSEM_GENERIC_SPINLOCK
 config RWSEM_XCHGADD_ALGORITHM
        bool
 
+config GENERIC_FIND_NEXT_BIT
+       bool
+       default y
+
+config GENERIC_HWEIGHT
+       bool
+       default y
+
 config GENERIC_CALIBRATE_DELAY
        bool
        default y
index e0838371237093e3f4800d5c12ccc604d363526f..95a3892b8d1bc6cfa601b6f956ae66687c855bb4 100644 (file)
@@ -17,6 +17,10 @@ config GENERIC_FIND_NEXT_BIT
        bool
        default y
 
+config GENERIC_HWEIGHT
+       bool
+       default y
+
 config GENERIC_CALIBRATE_DELAY
        bool
        default n
index f2c6866fc88b93e1ffb6a3edf9ece5d6376e270b..1530a4111e6d743345ff379d191ba7d6df06e9a3 100644 (file)
@@ -54,9 +54,9 @@ static unsigned get_cxn(mm_context_t *ctx)
                /* find the first unallocated context number
                 * - 0 is reserved for the kernel
                 */
-               cxn = find_next_zero_bit(&cxn_bitmap, NR_CXN, 1);
+               cxn = find_next_zero_bit(cxn_bitmap, NR_CXN, 1);
                if (cxn < NR_CXN) {
-                       set_bit(cxn, &cxn_bitmap);
+                       set_bit(cxn, cxn_bitmap);
                }
                else {
                        /* none remaining - need to steal someone else's cxn */
@@ -138,7 +138,7 @@ void destroy_context(struct mm_struct *mm)
                        cxn_pinned = -1;
 
                list_del_init(&ctx->id_link);
-               clear_bit(ctx->id, &cxn_bitmap);
+               clear_bit(ctx->id, cxn_bitmap);
                __flush_tlb_mm(ctx->id);
                ctx->id = 0;
        }
index 98308b018a3514c3456b7bee5677e315083bc6ed..cabf0bfffc534a06b1e9850d8d814cd98fa988a4 100644 (file)
@@ -29,6 +29,14 @@ config RWSEM_XCHGADD_ALGORITHM
        bool
        default n
 
+config GENERIC_FIND_NEXT_BIT
+       bool
+       default y
+
+config GENERIC_HWEIGHT
+       bool
+       default y
+
 config GENERIC_CALIBRATE_DELAY
        bool
        default y
index b008fb0cd7b7faa4c6114d6a49fa632522108edc..f7db71d0b913ed6408480cdf1d4facb4ead77ec1 100644 (file)
@@ -37,6 +37,10 @@ config GENERIC_IOMAP
        bool
        default y
 
+config GENERIC_HWEIGHT
+       bool
+       default y
+
 config ARCH_MAY_HAVE_PC_FDC
        bool
        default y
index c848a5b303918a9d6134b31e132b4d605879bbb1..3e4adb1e224430ce3398ff538c09d316522b5ab2 100644 (file)
@@ -103,7 +103,7 @@ AFLAGS += $(mflags-y)
 boot := arch/i386/boot
 
 PHONY += zImage bzImage compressed zlilo bzlilo \
-         zdisk bzdisk fdimage fdimage144 fdimage288 install
+         zdisk bzdisk fdimage fdimage144 fdimage288 isoimage install
 
 all: bzImage
 
@@ -122,7 +122,7 @@ zlilo bzlilo: vmlinux
 zdisk bzdisk: vmlinux
        $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) zdisk
 
-fdimage fdimage144 fdimage288: vmlinux
+fdimage fdimage144 fdimage288 isoimage: vmlinux
        $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) $@
 
 install:
@@ -139,6 +139,9 @@ define archhelp
   echo  '                 install to $$(INSTALL_PATH) and run lilo'
   echo  '  bzdisk       - Create a boot floppy in /dev/fd0'
   echo  '  fdimage      - Create a boot floppy image'
+  echo  '  isoimage     - Create a boot CD-ROM image'
 endef
 
-CLEAN_FILES += arch/$(ARCH)/boot/fdimage arch/$(ARCH)/boot/mtools.conf
+CLEAN_FILES += arch/$(ARCH)/boot/fdimage \
+              arch/$(ARCH)/boot/image.iso \
+              arch/$(ARCH)/boot/mtools.conf
index f136752563b105b93fee00a3b75824eb2c6af055..33e55476381be9a5954ab616c541955d933fb841 100644 (file)
@@ -62,8 +62,12 @@ $(obj)/setup $(obj)/bootsect: %: %.o FORCE
 $(obj)/compressed/vmlinux: FORCE
        $(Q)$(MAKE) $(build)=$(obj)/compressed IMAGE_OFFSET=$(IMAGE_OFFSET) $@
 
-# Set this if you want to pass append arguments to the zdisk/fdimage kernel
+# Set this if you want to pass append arguments to the zdisk/fdimage/isoimage kernel
 FDARGS = 
+# Set this if you want an initrd included with the zdisk/fdimage/isoimage kernel
+FDINITRD =
+
+image_cmdline = default linux $(FDARGS) $(if $(FDINITRD),initrd=initrd.img,)
 
 $(obj)/mtools.conf: $(src)/mtools.conf.in
        sed -e 's|@OBJ@|$(obj)|g' < $< > $@
@@ -72,8 +76,11 @@ $(obj)/mtools.conf: $(src)/mtools.conf.in
 zdisk: $(BOOTIMAGE) $(obj)/mtools.conf
        MTOOLSRC=$(obj)/mtools.conf mformat a:                  ; sync
        syslinux /dev/fd0                                       ; sync
-       echo 'default linux $(FDARGS)' | \
+       echo '$(image_cmdline)' | \
                MTOOLSRC=$(src)/mtools.conf mcopy - a:syslinux.cfg
+       if [ -f '$(FDINITRD)' ] ; then \
+               MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' a:initrd.img ; \
+       fi
        MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) a:linux  ; sync
 
 # These require being root or having syslinux 2.02 or higher installed
@@ -81,18 +88,39 @@ fdimage fdimage144: $(BOOTIMAGE) $(obj)/mtools.conf
        dd if=/dev/zero of=$(obj)/fdimage bs=1024 count=1440
        MTOOLSRC=$(obj)/mtools.conf mformat v:                  ; sync
        syslinux $(obj)/fdimage                                 ; sync
-       echo 'default linux $(FDARGS)' | \
+       echo '$(image_cmdline)' | \
                MTOOLSRC=$(obj)/mtools.conf mcopy - v:syslinux.cfg
+       if [ -f '$(FDINITRD)' ] ; then \
+               MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' v:initrd.img ; \
+       fi
        MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) v:linux  ; sync
 
 fdimage288: $(BOOTIMAGE) $(obj)/mtools.conf
        dd if=/dev/zero of=$(obj)/fdimage bs=1024 count=2880
        MTOOLSRC=$(obj)/mtools.conf mformat w:                  ; sync
        syslinux $(obj)/fdimage                                 ; sync
-       echo 'default linux $(FDARGS)' | \
+       echo '$(image_cmdline)' | \
                MTOOLSRC=$(obj)/mtools.conf mcopy - w:syslinux.cfg
+       if [ -f '$(FDINITRD)' ] ; then \
+               MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' w:initrd.img ; \
+       fi
        MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) w:linux  ; sync
 
+isoimage: $(BOOTIMAGE)
+       -rm -rf $(obj)/isoimage
+       mkdir $(obj)/isoimage
+       cp `echo /usr/lib*/syslinux/isolinux.bin | awk '{ print $1; }'` \
+               $(obj)/isoimage
+       cp $(BOOTIMAGE) $(obj)/isoimage/linux
+       echo '$(image_cmdline)' > $(obj)/isoimage/isolinux.cfg
+       if [ -f '$(FDINITRD)' ] ; then \
+               cp '$(FDINITRD)' $(obj)/isoimage/initrd.img ; \
+       fi
+       mkisofs -J -r -o $(obj)/image.iso -b isolinux.bin -c boot.cat \
+               -no-emul-boot -boot-load-size 4 -boot-info-table \
+               $(obj)/isoimage
+       rm -rf $(obj)/isoimage
+
 zlilo: $(BOOTIMAGE)
        if [ -f $(INSTALL_PATH)/vmlinuz ]; then mv $(INSTALL_PATH)/vmlinuz $(INSTALL_PATH)/vmlinuz.old; fi
        if [ -f $(INSTALL_PATH)/System.map ]; then mv $(INSTALL_PATH)/System.map $(INSTALL_PATH)/System.old; fi
index f1a21945963d77b80f125db518a432580647f10a..033066176b3efdae5a097ca5cf11fbf4b8cd945f 100644 (file)
@@ -668,10 +668,10 @@ unsigned long __init acpi_find_rsdp(void)
        unsigned long rsdp_phys = 0;
 
        if (efi_enabled) {
-               if (efi.acpi20)
-                       return __pa(efi.acpi20);
-               else if (efi.acpi)
-                       return __pa(efi.acpi);
+               if (efi.acpi20 != EFI_INVALID_TABLE_ADDR)
+                       return efi.acpi20;
+               else if (efi.acpi != EFI_INVALID_TABLE_ADDR)
+                       return efi.acpi;
        }
        /*
         * Scan memory looking for the RSDP signature. First search EBDA (low
index e5bc06480ff99fbf39f83c0836c6cc004e6cacc6..1e70823e1cb583ea8a8ff78c66472169f0cecf96 100644 (file)
@@ -40,6 +40,7 @@
 
 #ifdef CONFIG_X86_POWERNOW_K8_ACPI
 #include <linux/acpi.h>
+#include <linux/mutex.h>
 #include <acpi/processor.h>
 #endif
 
@@ -49,7 +50,7 @@
 #include "powernow-k8.h"
 
 /* serialize freq changes  */
-static DECLARE_MUTEX(fidvid_sem);
+static DEFINE_MUTEX(fidvid_mutex);
 
 static struct powernow_k8_data *powernow_data[NR_CPUS];
 
@@ -943,17 +944,17 @@ static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsi
        if (cpufreq_frequency_table_target(pol, data->powernow_table, targfreq, relation, &newstate))
                goto err_out;
 
-       down(&fidvid_sem);
+       mutex_lock(&fidvid_mutex);
 
        powernow_k8_acpi_pst_values(data, newstate);
 
        if (transition_frequency(data, newstate)) {
                printk(KERN_ERR PFX "transition frequency failed\n");
                ret = 1;
-               up(&fidvid_sem);
+               mutex_unlock(&fidvid_mutex);
                goto err_out;
        }
-       up(&fidvid_sem);
+       mutex_unlock(&fidvid_mutex);
 
        pol->cur = find_khz_freq_from_fid(data->currfid);
        ret = 0;
index 3b4618bed70d56fd1bc79087652b7b3c10791376..fff90bda473323a7fd0364d6db35475bbb862cd8 100644 (file)
@@ -36,6 +36,7 @@
 #include <linux/pci.h>
 #include <linux/smp.h>
 #include <linux/cpu.h>
+#include <linux/mutex.h>
 
 #include <asm/mtrr.h>
 
@@ -47,7 +48,7 @@
 u32 num_var_ranges = 0;
 
 unsigned int *usage_table;
-static DECLARE_MUTEX(mtrr_sem);
+static DEFINE_MUTEX(mtrr_mutex);
 
 u32 size_or_mask, size_and_mask;
 
@@ -333,7 +334,7 @@ int mtrr_add_page(unsigned long base, unsigned long size,
        /* No CPU hotplug when we change MTRR entries */
        lock_cpu_hotplug();
        /*  Search for existing MTRR  */
-       down(&mtrr_sem);
+       mutex_lock(&mtrr_mutex);
        for (i = 0; i < num_var_ranges; ++i) {
                mtrr_if->get(i, &lbase, &lsize, &ltype);
                if (base >= lbase + lsize)
@@ -371,7 +372,7 @@ int mtrr_add_page(unsigned long base, unsigned long size,
                printk(KERN_INFO "mtrr: no more MTRRs available\n");
        error = i;
  out:
-       up(&mtrr_sem);
+       mutex_unlock(&mtrr_mutex);
        unlock_cpu_hotplug();
        return error;
 }
@@ -464,7 +465,7 @@ int mtrr_del_page(int reg, unsigned long base, unsigned long size)
        max = num_var_ranges;
        /* No CPU hotplug when we change MTRR entries */
        lock_cpu_hotplug();
-       down(&mtrr_sem);
+       mutex_lock(&mtrr_mutex);
        if (reg < 0) {
                /*  Search for existing MTRR  */
                for (i = 0; i < max; ++i) {
@@ -503,7 +504,7 @@ int mtrr_del_page(int reg, unsigned long base, unsigned long size)
                set_mtrr(reg, 0, 0, 0);
        error = reg;
  out:
-       up(&mtrr_sem);
+       mutex_unlock(&mtrr_mutex);
        unlock_cpu_hotplug();
        return error;
 }
@@ -685,7 +686,7 @@ void mtrr_ap_init(void)
        if (!mtrr_if || !use_intel())
                return;
        /*
-        * Ideally we should hold mtrr_sem here to avoid mtrr entries changed,
+        * Ideally we should hold mtrr_mutex here to avoid mtrr entries changed,
         * but this routine will be called in cpu boot time, holding the lock
         * breaks it. This routine is called in two cases: 1.very earily time
         * of software resume, when there absolutely isn't mtrr entry changes;
index ebc8dc116c430425dd0051734d5db552f8bde4df..5efceebc48dc7c5c23789c9ed8b2ea331bb34c35 100644 (file)
@@ -3,6 +3,7 @@
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/dmi.h>
+#include <linux/efi.h>
 #include <linux/bootmem.h>
 #include <linux/slab.h>
 #include <asm/dmi.h>
@@ -185,47 +186,72 @@ static void __init dmi_decode(struct dmi_header *dm)
        }
 }
 
-void __init dmi_scan_machine(void)
+static int __init dmi_present(char __iomem *p)
 {
        u8 buf[15];
-       char __iomem *p, *q;
+       memcpy_fromio(buf, p, 15);
+       if ((memcmp(buf, "_DMI_", 5) == 0) && dmi_checksum(buf)) {
+               u16 num = (buf[13] << 8) | buf[12];
+               u16 len = (buf[7] << 8) | buf[6];
+               u32 base = (buf[11] << 24) | (buf[10] << 16) |
+                       (buf[9] << 8) | buf[8];
 
-       /*
-        * no iounmap() for that ioremap(); it would be a no-op, but it's
-        * so early in setup that sucker gets confused into doing what
-        * it shouldn't if we actually call it.
-        */
-       p = ioremap(0xF0000, 0x10000);
-       if (p == NULL)
-               goto out;
-
-       for (q = p; q < p + 0x10000; q += 16) {
-               memcpy_fromio(buf, q, 15);
-               if ((memcmp(buf, "_DMI_", 5) == 0) && dmi_checksum(buf)) {
-                       u16 num = (buf[13] << 8) | buf[12];
-                       u16 len = (buf[7] << 8) | buf[6];
-                       u32 base = (buf[11] << 24) | (buf[10] << 16) |
-                                  (buf[9] << 8) | buf[8];
-
-                       /*
-                        * DMI version 0.0 means that the real version is taken from
-                        * the SMBIOS version, which we don't know at this point.
-                        */
-                       if (buf[14] != 0)
-                               printk(KERN_INFO "DMI %d.%d present.\n",
-                                       buf[14] >> 4, buf[14] & 0xF);
-                       else
-                               printk(KERN_INFO "DMI present.\n");
+               /*
+                * DMI version 0.0 means that the real version is taken from
+                * the SMBIOS version, which we don't know at this point.
+                */
+               if (buf[14] != 0)
+                       printk(KERN_INFO "DMI %d.%d present.\n",
+                              buf[14] >> 4, buf[14] & 0xF);
+               else
+                       printk(KERN_INFO "DMI present.\n");
+               if (dmi_table(base,len, num, dmi_decode) == 0)
+                       return 0;
+       }
+       return 1;
+}
 
-                       if (dmi_table(base,len, num, dmi_decode) == 0)
+void __init dmi_scan_machine(void)
+{
+       char __iomem *p, *q;
+       int rc;
+
+       if (efi_enabled) {
+               if (efi.smbios == EFI_INVALID_TABLE_ADDR)
+                       goto out;
+
+               /* This is called as a core_initcall() because it isn't
+                * needed during early boot.  This also means we can
+                * iounmap the space when we're done with it.
+               */
+               p = dmi_ioremap(efi.smbios, 32);
+               if (p == NULL)
+                       goto out;
+
+               rc = dmi_present(p + 0x10); /* offset of _DMI_ string */
+               dmi_iounmap(p, 32);
+               if (!rc)
+                       return;
+       }
+       else {
+               /*
+                * no iounmap() for that ioremap(); it would be a no-op, but
+                * it's so early in setup that sucker gets confused into doing
+                * what it shouldn't if we actually call it.
+                */
+               p = dmi_ioremap(0xF0000, 0x10000);
+               if (p == NULL)
+                       goto out;
+
+               for (q = p; q < p + 0x10000; q += 16) {
+                       rc = dmi_present(q);
+                       if (!rc)
                                return;
                }
        }
-
-out:   printk(KERN_INFO "DMI not present or invalid.\n");
+ out:  printk(KERN_INFO "DMI not present or invalid.\n");
 }
 
-
 /**
  *     dmi_check_system - check system DMI data
  *     @list: array of dmi_system_id structures to match against
index 7ec6cfa01fb30d093e1c2fd7fd35e854e55a00d2..9202b67c4b2e5cc925b0670d0b3e804dc719abbc 100644 (file)
@@ -361,7 +361,7 @@ void __init efi_init(void)
         */
        c16 = (efi_char16_t *) boot_ioremap(efi.systab->fw_vendor, 2);
        if (c16) {
-               for (i = 0; i < sizeof(vendor) && *c16; ++i)
+               for (i = 0; i < (sizeof(vendor) - 1) && *c16; ++i)
                        vendor[i] = *c16++;
                vendor[i] = '\0';
        } else
@@ -381,29 +381,38 @@ void __init efi_init(void)
        if (config_tables == NULL)
                printk(KERN_ERR PFX "Could not map EFI Configuration Table!\n");
 
+       efi.mps        = EFI_INVALID_TABLE_ADDR;
+       efi.acpi       = EFI_INVALID_TABLE_ADDR;
+       efi.acpi20     = EFI_INVALID_TABLE_ADDR;
+       efi.smbios     = EFI_INVALID_TABLE_ADDR;
+       efi.sal_systab = EFI_INVALID_TABLE_ADDR;
+       efi.boot_info  = EFI_INVALID_TABLE_ADDR;
+       efi.hcdp       = EFI_INVALID_TABLE_ADDR;
+       efi.uga        = EFI_INVALID_TABLE_ADDR;
+
        for (i = 0; i < num_config_tables; i++) {
                if (efi_guidcmp(config_tables[i].guid, MPS_TABLE_GUID) == 0) {
-                       efi.mps = (void *)config_tables[i].table;
+                       efi.mps = config_tables[i].table;
                        printk(KERN_INFO " MPS=0x%lx ", config_tables[i].table);
                } else
                    if (efi_guidcmp(config_tables[i].guid, ACPI_20_TABLE_GUID) == 0) {
-                       efi.acpi20 = __va(config_tables[i].table);
+                       efi.acpi20 = config_tables[i].table;
                        printk(KERN_INFO " ACPI 2.0=0x%lx ", config_tables[i].table);
                } else
                    if (efi_guidcmp(config_tables[i].guid, ACPI_TABLE_GUID) == 0) {
-                       efi.acpi = __va(config_tables[i].table);
+                       efi.acpi = config_tables[i].table;
                        printk(KERN_INFO " ACPI=0x%lx ", config_tables[i].table);
                } else
                    if (efi_guidcmp(config_tables[i].guid, SMBIOS_TABLE_GUID) == 0) {
-                       efi.smbios = (void *) config_tables[i].table;
+                       efi.smbios = config_tables[i].table;
                        printk(KERN_INFO " SMBIOS=0x%lx ", config_tables[i].table);
                } else
                    if (efi_guidcmp(config_tables[i].guid, HCDP_TABLE_GUID) == 0) {
-                       efi.hcdp = (void *)config_tables[i].table;
+                       efi.hcdp = config_tables[i].table;
                        printk(KERN_INFO " HCDP=0x%lx ", config_tables[i].table);
                } else
                    if (efi_guidcmp(config_tables[i].guid, UGA_IO_PROTOCOL_GUID) == 0) {
-                       efi.uga = (void *)config_tables[i].table;
+                       efi.uga = config_tables[i].table;
                        printk(KERN_INFO " UGA=0x%lx ", config_tables[i].table);
                }
        }
index 7a59050242a7ca58f5786ba11e4cd5c83077a51a..f19768789e8a607203023d7ba3788efbc7bc3c1b 100644 (file)
 #include <asm/cacheflush.h>
 #include <asm/kdebug.h>
 #include <asm/desc.h>
+#include <asm/uaccess.h>
 
 void jprobe_return_end(void);
 
 DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL;
 DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk);
 
+/* insert a jmp code */
+static inline void set_jmp_op(void *from, void *to)
+{
+       struct __arch_jmp_op {
+               char op;
+               long raddr;
+       } __attribute__((packed)) *jop;
+       jop = (struct __arch_jmp_op *)from;
+       jop->raddr = (long)(to) - ((long)(from) + 5);
+       jop->op = RELATIVEJUMP_INSTRUCTION;
+}
+
+/*
+ * returns non-zero if opcodes can be boosted.
+ */
+static inline int can_boost(kprobe_opcode_t opcode)
+{
+       switch (opcode & 0xf0 ) {
+       case 0x70:
+               return 0; /* can't boost conditional jump */
+       case 0x90:
+               /* can't boost call and pushf */
+               return opcode != 0x9a && opcode != 0x9c;
+       case 0xc0:
+               /* can't boost undefined opcodes and soft-interruptions */
+               return (0xc1 < opcode && opcode < 0xc6) ||
+                       (0xc7 < opcode && opcode < 0xcc) || opcode == 0xcf;
+       case 0xd0:
+               /* can boost AA* and XLAT */
+               return (opcode == 0xd4 || opcode == 0xd5 || opcode == 0xd7);
+       case 0xe0:
+               /* can boost in/out and (may be) jmps */
+               return (0xe3 < opcode && opcode != 0xe8);
+       case 0xf0:
+               /* clear and set flags can be boost */
+               return (opcode == 0xf5 || (0xf7 < opcode && opcode < 0xfe));
+       default:
+               /* currently, can't boost 2 bytes opcodes */
+               return opcode != 0x0f;
+       }
+}
+
+
 /*
  * returns non-zero if opcode modifies the interrupt flag.
  */
@@ -65,6 +109,11 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
 
        memcpy(p->ainsn.insn, p->addr, MAX_INSN_SIZE * sizeof(kprobe_opcode_t));
        p->opcode = *p->addr;
+       if (can_boost(p->opcode)) {
+               p->ainsn.boostable = 0;
+       } else {
+               p->ainsn.boostable = -1;
+       }
        return 0;
 }
 
@@ -155,9 +204,13 @@ static int __kprobes kprobe_handler(struct pt_regs *regs)
 {
        struct kprobe *p;
        int ret = 0;
-       kprobe_opcode_t *addr = NULL;
-       unsigned long *lp;
+       kprobe_opcode_t *addr;
        struct kprobe_ctlblk *kcb;
+#ifdef CONFIG_PREEMPT
+       unsigned pre_preempt_count = preempt_count();
+#endif /* CONFIG_PREEMPT */
+
+       addr = (kprobe_opcode_t *)(regs->eip - sizeof(kprobe_opcode_t));
 
        /*
         * We don't want to be preempted for the entire
@@ -166,17 +219,6 @@ static int __kprobes kprobe_handler(struct pt_regs *regs)
        preempt_disable();
        kcb = get_kprobe_ctlblk();
 
-       /* Check if the application is using LDT entry for its code segment and
-        * calculate the address by reading the base address from the LDT entry.
-        */
-       if ((regs->xcs & 4) && (current->mm)) {
-               lp = (unsigned long *) ((unsigned long)((regs->xcs >> 3) * 8)
-                                       + (char *) current->mm->context.ldt);
-               addr = (kprobe_opcode_t *) (get_desc_base(lp) + regs->eip -
-                                               sizeof(kprobe_opcode_t));
-       } else {
-               addr = (kprobe_opcode_t *)(regs->eip - sizeof(kprobe_opcode_t));
-       }
        /* Check we're not actually recursing */
        if (kprobe_running()) {
                p = get_kprobe(addr);
@@ -252,6 +294,21 @@ static int __kprobes kprobe_handler(struct pt_regs *regs)
                /* handler has already set things up, so skip ss setup */
                return 1;
 
+       if (p->ainsn.boostable == 1 &&
+#ifdef CONFIG_PREEMPT
+           !(pre_preempt_count) && /*
+                                      * This enables booster when the direct
+                                      * execution path aren't preempted.
+                                      */
+#endif /* CONFIG_PREEMPT */
+           !p->post_handler && !p->break_handler ) {
+               /* Boost up -- we can execute copied instructions directly */
+               reset_current_kprobe();
+               regs->eip = (unsigned long)p->ainsn.insn;
+               preempt_enable_no_resched();
+               return 1;
+       }
+
 ss_probe:
        prepare_singlestep(p, regs);
        kcb->kprobe_status = KPROBE_HIT_SS;
@@ -267,17 +324,44 @@ no_kprobe:
  * here. When a retprobed function returns, this probe is hit and
  * trampoline_probe_handler() runs, calling the kretprobe's handler.
  */
- void kretprobe_trampoline_holder(void)
+ void __kprobes kretprobe_trampoline_holder(void)
  {
-       asm volatile (  ".global kretprobe_trampoline\n"
+       asm volatile ( ".global kretprobe_trampoline\n"
                        "kretprobe_trampoline: \n"
-                       "nop\n");
- }
+                       "       pushf\n"
+                       /* skip cs, eip, orig_eax, es, ds */
+                       "       subl $20, %esp\n"
+                       "       pushl %eax\n"
+                       "       pushl %ebp\n"
+                       "       pushl %edi\n"
+                       "       pushl %esi\n"
+                       "       pushl %edx\n"
+                       "       pushl %ecx\n"
+                       "       pushl %ebx\n"
+                       "       movl %esp, %eax\n"
+                       "       call trampoline_handler\n"
+                       /* move eflags to cs */
+                       "       movl 48(%esp), %edx\n"
+                       "       movl %edx, 44(%esp)\n"
+                       /* save true return address on eflags */
+                       "       movl %eax, 48(%esp)\n"
+                       "       popl %ebx\n"
+                       "       popl %ecx\n"
+                       "       popl %edx\n"
+                       "       popl %esi\n"
+                       "       popl %edi\n"
+                       "       popl %ebp\n"
+                       "       popl %eax\n"
+                       /* skip eip, orig_eax, es, ds */
+                       "       addl $16, %esp\n"
+                       "       popf\n"
+                       "       ret\n");
+}
 
 /*
- * Called when we hit the probe point at kretprobe_trampoline
+ * Called from kretprobe_trampoline
  */
-int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
+fastcall void *__kprobes trampoline_handler(struct pt_regs *regs)
 {
         struct kretprobe_instance *ri = NULL;
         struct hlist_head *head;
@@ -306,8 +390,11 @@ int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
                        /* another task is sharing our hash bucket */
                         continue;
 
-               if (ri->rp && ri->rp->handler)
+               if (ri->rp && ri->rp->handler){
+                       __get_cpu_var(current_kprobe) = &ri->rp->kp;
                        ri->rp->handler(ri, regs);
+                       __get_cpu_var(current_kprobe) = NULL;
+               }
 
                orig_ret_address = (unsigned long)ri->ret_addr;
                recycle_rp_inst(ri);
@@ -322,18 +409,10 @@ int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
        }
 
        BUG_ON(!orig_ret_address || (orig_ret_address == trampoline_address));
-       regs->eip = orig_ret_address;
 
-       reset_current_kprobe();
        spin_unlock_irqrestore(&kretprobe_lock, flags);
-       preempt_enable_no_resched();
 
-       /*
-        * By returning a non-zero value, we are telling
-        * kprobe_handler() that we don't want the post_handler
-        * to run (and have re-enabled preemption)
-        */
-        return 1;
+       return (void*)orig_ret_address;
 }
 
 /*
@@ -357,15 +436,17 @@ int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
  * 2) If the single-stepped instruction was a call, the return address
  * that is atop the stack is the address following the copied instruction.
  * We need to make it the address following the original instruction.
+ *
+ * This function also checks instruction size for preparing direct execution.
  */
 static void __kprobes resume_execution(struct kprobe *p,
                struct pt_regs *regs, struct kprobe_ctlblk *kcb)
 {
        unsigned long *tos = (unsigned long *)&regs->esp;
-       unsigned long next_eip = 0;
        unsigned long copy_eip = (unsigned long)p->ainsn.insn;
        unsigned long orig_eip = (unsigned long)p->addr;
 
+       regs->eflags &= ~TF_MASK;
        switch (p->ainsn.insn[0]) {
        case 0x9c:              /* pushfl */
                *tos &= ~(TF_MASK | IF_MASK);
@@ -375,37 +456,51 @@ static void __kprobes resume_execution(struct kprobe *p,
        case 0xcb:
        case 0xc2:
        case 0xca:
-               regs->eflags &= ~TF_MASK;
-               /* eip is already adjusted, no more changes required*/
-               return;
+       case 0xea:              /* jmp absolute -- eip is correct */
+               /* eip is already adjusted, no more changes required */
+               p->ainsn.boostable = 1;
+               goto no_change;
        case 0xe8:              /* call relative - Fix return addr */
                *tos = orig_eip + (*tos - copy_eip);
                break;
        case 0xff:
                if ((p->ainsn.insn[1] & 0x30) == 0x10) {
                        /* call absolute, indirect */
-                       /* Fix return addr; eip is correct. */
-                       next_eip = regs->eip;
+                       /*
+                        * Fix return addr; eip is correct.
+                        * But this is not boostable
+                        */
                        *tos = orig_eip + (*tos - copy_eip);
+                       goto no_change;
                } else if (((p->ainsn.insn[1] & 0x31) == 0x20) ||       /* jmp near, absolute indirect */
                           ((p->ainsn.insn[1] & 0x31) == 0x21)) {       /* jmp far, absolute indirect */
-                       /* eip is correct. */
-                       next_eip = regs->eip;
+                       /* eip is correct. And this is boostable */
+                       p->ainsn.boostable = 1;
+                       goto no_change;
                }
-               break;
-       case 0xea:              /* jmp absolute -- eip is correct */
-               next_eip = regs->eip;
-               break;
        default:
                break;
        }
 
-       regs->eflags &= ~TF_MASK;
-       if (next_eip) {
-               regs->eip = next_eip;
-       } else {
-               regs->eip = orig_eip + (regs->eip - copy_eip);
+       if (p->ainsn.boostable == 0) {
+               if ((regs->eip > copy_eip) &&
+                   (regs->eip - copy_eip) + 5 < MAX_INSN_SIZE) {
+                       /*
+                        * These instructions can be executed directly if it
+                        * jumps back to correct address.
+                        */
+                       set_jmp_op((void *)regs->eip,
+                                  (void *)orig_eip + (regs->eip - copy_eip));
+                       p->ainsn.boostable = 1;
+               } else {
+                       p->ainsn.boostable = -1;
+               }
        }
+
+       regs->eip = orig_eip + (regs->eip - copy_eip);
+
+no_change:
+       return;
 }
 
 /*
@@ -453,15 +548,57 @@ static inline int kprobe_fault_handler(struct pt_regs *regs, int trapnr)
        struct kprobe *cur = kprobe_running();
        struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
 
-       if (cur->fault_handler && cur->fault_handler(cur, regs, trapnr))
-               return 1;
-
-       if (kcb->kprobe_status & KPROBE_HIT_SS) {
-               resume_execution(cur, regs, kcb);
+       switch(kcb->kprobe_status) {
+       case KPROBE_HIT_SS:
+       case KPROBE_REENTER:
+               /*
+                * We are here because the instruction being single
+                * stepped caused a page fault. We reset the current
+                * kprobe and the eip points back to the probe address
+                * and allow the page fault handler to continue as a
+                * normal page fault.
+                */
+               regs->eip = (unsigned long)cur->addr;
                regs->eflags |= kcb->kprobe_old_eflags;
-
-               reset_current_kprobe();
+               if (kcb->kprobe_status == KPROBE_REENTER)
+                       restore_previous_kprobe(kcb);
+               else
+                       reset_current_kprobe();
                preempt_enable_no_resched();
+               break;
+       case KPROBE_HIT_ACTIVE:
+       case KPROBE_HIT_SSDONE:
+               /*
+                * We increment the nmissed count for accounting,
+                * we can also use npre/npostfault count for accouting
+                * these specific fault cases.
+                */
+               kprobes_inc_nmissed_count(cur);
+
+               /*
+                * We come here because instructions in the pre/post
+                * handler caused the page_fault, this could happen
+                * if handler tries to access user space by
+                * copy_from_user(), get_user() etc. Let the
+                * user-specified handler try to fix it first.
+                */
+               if (cur->fault_handler && cur->fault_handler(cur, regs, trapnr))
+                       return 1;
+
+               /*
+                * In case the user-specified fault handler returned
+                * zero, try to fix up.
+                */
+               if (fixup_exception(regs))
+                       return 1;
+
+               /*
+                * fixup_exception() could not handle it,
+                * Let do_page_fault() fix it.
+                */
+               break;
+       default:
+               break;
        }
        return 0;
 }
@@ -475,6 +612,9 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self,
        struct die_args *args = (struct die_args *)data;
        int ret = NOTIFY_DONE;
 
+       if (args->regs && user_mode(args->regs))
+               return ret;
+
        switch (val) {
        case DIE_INT3:
                if (kprobe_handler(args->regs))
@@ -564,12 +704,7 @@ int __kprobes longjmp_break_handler(struct kprobe *p, struct pt_regs *regs)
        return 0;
 }
 
-static struct kprobe trampoline_p = {
-       .addr = (kprobe_opcode_t *) &kretprobe_trampoline,
-       .pre_handler = trampoline_probe_handler
-};
-
 int __init arch_init_kprobes(void)
 {
-       return register_kprobe(&trampoline_p);
+       return 0;
 }
index 55bc365b87536196f42f43bc45200f4983c98aaa..dd780a00553f3eeeeb038c25824d8a8346a00114 100644 (file)
@@ -81,6 +81,7 @@
 #include <linux/miscdevice.h>
 #include <linux/spinlock.h>
 #include <linux/mm.h>
+#include <linux/mutex.h>
 
 #include <asm/msr.h>
 #include <asm/uaccess.h>
@@ -114,7 +115,7 @@ MODULE_LICENSE("GPL");
 static DEFINE_SPINLOCK(microcode_update_lock);
 
 /* no concurrent ->write()s are allowed on /dev/cpu/microcode */
-static DECLARE_MUTEX(microcode_sem);
+static DEFINE_MUTEX(microcode_mutex);
 
 static void __user *user_buffer;       /* user area microcode data buffer */
 static unsigned int user_buffer_size;  /* it's size */
@@ -444,7 +445,7 @@ static ssize_t microcode_write (struct file *file, const char __user *buf, size_
                return -EINVAL;
        }
 
-       down(&microcode_sem);
+       mutex_lock(&microcode_mutex);
 
        user_buffer = (void __user *) buf;
        user_buffer_size = (int) len;
@@ -453,7 +454,7 @@ static ssize_t microcode_write (struct file *file, const char __user *buf, size_
        if (!ret)
                ret = (ssize_t)len;
 
-       up(&microcode_sem);
+       mutex_unlock(&microcode_mutex);
 
        return ret;
 }
index 299e616740843f900d6bd1fdfce3d38a1373cb56..24b3e745478b9917940c34825d0c5102050ecaea 100644 (file)
@@ -38,7 +38,6 @@
 #include <linux/kallsyms.h>
 #include <linux/ptrace.h>
 #include <linux/random.h>
-#include <linux/kprobes.h>
 
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
@@ -364,13 +363,6 @@ void exit_thread(void)
        struct task_struct *tsk = current;
        struct thread_struct *t = &tsk->thread;
 
-       /*
-        * Remove function-return probe instances associated with this task
-        * and put them back on the free list. Do not insert an exit probe for
-        * this function, it will be disabled by kprobe_flush_task if you do.
-        */
-       kprobe_flush_task(tsk);
-
        /* The process may have allocated an io port bitmap... nuke it. */
        if (unlikely(NULL != t->io_bitmap_ptr)) {
                int cpu = get_cpu();
index d313a11acafade034a57212b0018f17bdbb8ccd0..6917daa159ab351a4fe86da9aa6ee5276d959df6 100644 (file)
@@ -1058,10 +1058,10 @@ static int __init
 free_available_memory(unsigned long start, unsigned long end, void *arg)
 {
        /* check max_low_pfn */
-       if (start >= ((max_low_pfn + 1) << PAGE_SHIFT))
+       if (start >= (max_low_pfn << PAGE_SHIFT))
                return 0;
-       if (end >= ((max_low_pfn + 1) << PAGE_SHIFT))
-               end = (max_low_pfn + 1) << PAGE_SHIFT;
+       if (end >= (max_low_pfn << PAGE_SHIFT))
+               end = max_low_pfn << PAGE_SHIFT;
        if (start < end)
                free_bootmem(start, end - start);
 
@@ -1286,8 +1286,6 @@ legacy_init_iomem_resources(struct resource *code_resource, struct resource *dat
        probe_roms();
        for (i = 0; i < e820.nr_map; i++) {
                struct resource *res;
-               if (e820.map[i].addr + e820.map[i].size > 0x100000000ULL)
-                       continue;
                res = kzalloc(sizeof(struct resource), GFP_ATOMIC);
                switch (e820.map[i].type) {
                case E820_RAM:  res->name = "System RAM"; break;
index de5386b01d389bb795626e61e882d40eafd3b29d..4624f8ca24598bcac8cb827006684ab72bf9c229 100644 (file)
@@ -386,8 +386,12 @@ void die(const char * str, struct pt_regs * regs, long err)
 #endif
                if (nl)
                        printk("\n");
-       notify_die(DIE_OOPS, (char *)str, regs, err, 255, SIGSEGV);
-               show_registers(regs);
+               if (notify_die(DIE_OOPS, str, regs, err,
+                                       current->thread.trap_no, SIGSEGV) !=
+                               NOTIFY_STOP)
+                       show_registers(regs);
+               else
+                       regs = NULL;
        } else
                printk(KERN_EMERG "Recursive die() failure, output suppressed\n");
 
@@ -395,6 +399,9 @@ void die(const char * str, struct pt_regs * regs, long err)
        die.lock_owner = -1;
        spin_unlock_irqrestore(&die.lock, flags);
 
+       if (!regs)
+               return;
+
        if (kexec_should_crash(current))
                crash_kexec(regs);
 
@@ -623,7 +630,7 @@ static DEFINE_SPINLOCK(nmi_print_lock);
 
 void die_nmi (struct pt_regs *regs, const char *msg)
 {
-       if (notify_die(DIE_NMIWATCHDOG, msg, regs, 0, 0, SIGINT) ==
+       if (notify_die(DIE_NMIWATCHDOG, msg, regs, 0, 2, SIGINT) ==
            NOTIFY_STOP)
                return;
 
@@ -662,7 +669,7 @@ static void default_do_nmi(struct pt_regs * regs)
                reason = get_nmi_reason();
  
        if (!(reason & 0xc0)) {
-               if (notify_die(DIE_NMI_IPI, "nmi_ipi", regs, reason, 0, SIGINT)
+               if (notify_die(DIE_NMI_IPI, "nmi_ipi", regs, reason, 2, SIGINT)
                                                        == NOTIFY_STOP)
                        return;
 #ifdef CONFIG_X86_LOCAL_APIC
@@ -678,7 +685,7 @@ static void default_do_nmi(struct pt_regs * regs)
                unknown_nmi_error(reason, regs);
                return;
        }
-       if (notify_die(DIE_NMI, "nmi", regs, reason, 0, SIGINT) == NOTIFY_STOP)
+       if (notify_die(DIE_NMI, "nmi", regs, reason, 2, SIGINT) == NOTIFY_STOP)
                return;
        if (reason & 0x80)
                mem_parity_error(reason, regs);
index 10b6b9e7716baae92d2d5fe2b852d965c86b2e07..edffe25a477ab597a6615288df78ebdf976a0bba 100644 (file)
@@ -34,6 +34,10 @@ config RWSEM_XCHGADD_ALGORITHM
        bool
        default y
 
+config GENERIC_FIND_NEXT_BIT
+       bool
+       default y
+
 config GENERIC_CALIBRATE_DELAY
        bool
        default y
@@ -42,6 +46,10 @@ config TIME_INTERPOLATION
        bool
        default y
 
+config DMI
+       bool
+       default y
+
 config EFI
        bool
        default y
index 68ceb4e690c7a63a91960f750ab6282094938246..ccb98ed48e58d27467e53f8e38830cab3b52b7c4 100644 (file)
@@ -29,9 +29,9 @@
 struct partial_page {
        struct partial_page     *next; /* linked list, sorted by address */
        struct rb_node          pp_rb;
-       /* 64K is the largest "normal" page supported by ia64 ABI. So 4K*32
+       /* 64K is the largest "normal" page supported by ia64 ABI. So 4K*64
         * should suffice.*/
-       unsigned int            bitmap;
+       unsigned long           bitmap;
        unsigned int            base;
 };
 
index 13e739e4c84d9827ca49506175a1fabfb225f1ae..5366b3b23d0909dda2eee5ed2858d02d4f6234e1 100644 (file)
@@ -25,7 +25,6 @@
 #include <linux/resource.h>
 #include <linux/times.h>
 #include <linux/utsname.h>
-#include <linux/timex.h>
 #include <linux/smp.h>
 #include <linux/smp_lock.h>
 #include <linux/sem.h>
@@ -2591,78 +2590,4 @@ sys32_setresgid(compat_gid_t rgid, compat_gid_t egid,
        ssgid = (sgid == (compat_gid_t)-1) ? ((gid_t)-1) : ((gid_t)sgid);
        return sys_setresgid(srgid, segid, ssgid);
 }
-
-/* Handle adjtimex compatibility. */
-
-struct timex32 {
-       u32 modes;
-       s32 offset, freq, maxerror, esterror;
-       s32 status, constant, precision, tolerance;
-       struct compat_timeval time;
-       s32 tick;
-       s32 ppsfreq, jitter, shift, stabil;
-       s32 jitcnt, calcnt, errcnt, stbcnt;
-       s32  :32; s32  :32; s32  :32; s32  :32;
-       s32  :32; s32  :32; s32  :32; s32  :32;
-       s32  :32; s32  :32; s32  :32; s32  :32;
-};
-
-extern int do_adjtimex(struct timex *);
-
-asmlinkage long
-sys32_adjtimex(struct timex32 *utp)
-{
-       struct timex txc;
-       int ret;
-
-       memset(&txc, 0, sizeof(struct timex));
-
-       if(get_user(txc.modes, &utp->modes) ||
-          __get_user(txc.offset, &utp->offset) ||
-          __get_user(txc.freq, &utp->freq) ||
-          __get_user(txc.maxerror, &utp->maxerror) ||
-          __get_user(txc.esterror, &utp->esterror) ||
-          __get_user(txc.status, &utp->status) ||
-          __get_user(txc.constant, &utp->constant) ||
-          __get_user(txc.precision, &utp->precision) ||
-          __get_user(txc.tolerance, &utp->tolerance) ||
-          __get_user(txc.time.tv_sec, &utp->time.tv_sec) ||
-          __get_user(txc.time.tv_usec, &utp->time.tv_usec) ||
-          __get_user(txc.tick, &utp->tick) ||
-          __get_user(txc.ppsfreq, &utp->ppsfreq) ||
-          __get_user(txc.jitter, &utp->jitter) ||
-          __get_user(txc.shift, &utp->shift) ||
-          __get_user(txc.stabil, &utp->stabil) ||
-          __get_user(txc.jitcnt, &utp->jitcnt) ||
-          __get_user(txc.calcnt, &utp->calcnt) ||
-          __get_user(txc.errcnt, &utp->errcnt) ||
-          __get_user(txc.stbcnt, &utp->stbcnt))
-               return -EFAULT;
-
-       ret = do_adjtimex(&txc);
-
-       if(put_user(txc.modes, &utp->modes) ||
-          __put_user(txc.offset, &utp->offset) ||
-          __put_user(txc.freq, &utp->freq) ||
-          __put_user(txc.maxerror, &utp->maxerror) ||
-          __put_user(txc.esterror, &utp->esterror) ||
-          __put_user(txc.status, &utp->status) ||
-          __put_user(txc.constant, &utp->constant) ||
-          __put_user(txc.precision, &utp->precision) ||
-          __put_user(txc.tolerance, &utp->tolerance) ||
-          __put_user(txc.time.tv_sec, &utp->time.tv_sec) ||
-          __put_user(txc.time.tv_usec, &utp->time.tv_usec) ||
-          __put_user(txc.tick, &utp->tick) ||
-          __put_user(txc.ppsfreq, &utp->ppsfreq) ||
-          __put_user(txc.jitter, &utp->jitter) ||
-          __put_user(txc.shift, &utp->shift) ||
-          __put_user(txc.stabil, &utp->stabil) ||
-          __put_user(txc.jitcnt, &utp->jitcnt) ||
-          __put_user(txc.calcnt, &utp->calcnt) ||
-          __put_user(txc.errcnt, &utp->errcnt) ||
-          __put_user(txc.stbcnt, &utp->stbcnt))
-               ret = -EFAULT;
-
-       return ret;
-}
 #endif /* NOTYET */
index 09a0dbc17fb687bfc6e79ba6377e012246846180..59e871dae7423454edcadb968b9e0a54ca9111e1 100644 (file)
@@ -7,7 +7,7 @@ extra-y := head.o init_task.o vmlinux.lds
 obj-y := acpi.o entry.o efi.o efi_stub.o gate-data.o fsys.o ia64_ksyms.o irq.o irq_ia64.o      \
         irq_lsapic.o ivt.o machvec.o pal.o patch.o process.o perfmon.o ptrace.o sal.o          \
         salinfo.o semaphore.o setup.o signal.o sys_ia64.o time.o traps.o unaligned.o \
-        unwind.o mca.o mca_asm.o topology.o
+        unwind.o mca.o mca_asm.o topology.o dmi_scan.o
 
 obj-$(CONFIG_IA64_BRL_EMU)     += brl_emu.o
 obj-$(CONFIG_IA64_GENERIC)     += acpi-ext.o
@@ -30,6 +30,7 @@ obj-$(CONFIG_IA64_MCA_RECOVERY)       += mca_recovery.o
 obj-$(CONFIG_KPROBES)          += kprobes.o jprobes.o
 obj-$(CONFIG_IA64_UNCACHED_ALLOCATOR)  += uncached.o
 mca_recovery-y                 += mca_drv.o mca_drv_asm.o
+dmi_scan-y                     += ../../i386/kernel/dmi_scan.o
 
 # The gate DSO image is built using a special linker script.
 targets += gate.so gate-syms.o
index a4e218ce2edb89c045efc53ddb07b2eb2c472255..58c93a30348cdfdc43bd6b7c5acbf36245141b75 100644 (file)
@@ -651,9 +651,9 @@ unsigned long __init acpi_find_rsdp(void)
 {
        unsigned long rsdp_phys = 0;
 
-       if (efi.acpi20)
-               rsdp_phys = __pa(efi.acpi20);
-       else if (efi.acpi)
+       if (efi.acpi20 != EFI_INVALID_TABLE_ADDR)
+               rsdp_phys = efi.acpi20;
+       else if (efi.acpi != EFI_INVALID_TABLE_ADDR)
                printk(KERN_WARNING PREFIX
                       "v1.0/r0.71 tables no longer supported\n");
        return rsdp_phys;
index 9990320b6f9a7ee7edad9c41f988a4681c7e2018..12cfedce73b1caa4f52b15dd8f8dada1f77a3639 100644 (file)
@@ -458,24 +458,33 @@ efi_init (void)
        printk(KERN_INFO "EFI v%u.%.02u by %s:",
               efi.systab->hdr.revision >> 16, efi.systab->hdr.revision & 0xffff, vendor);
 
+       efi.mps        = EFI_INVALID_TABLE_ADDR;
+       efi.acpi       = EFI_INVALID_TABLE_ADDR;
+       efi.acpi20     = EFI_INVALID_TABLE_ADDR;
+       efi.smbios     = EFI_INVALID_TABLE_ADDR;
+       efi.sal_systab = EFI_INVALID_TABLE_ADDR;
+       efi.boot_info  = EFI_INVALID_TABLE_ADDR;
+       efi.hcdp       = EFI_INVALID_TABLE_ADDR;
+       efi.uga        = EFI_INVALID_TABLE_ADDR;
+
        for (i = 0; i < (int) efi.systab->nr_tables; i++) {
                if (efi_guidcmp(config_tables[i].guid, MPS_TABLE_GUID) == 0) {
-                       efi.mps = __va(config_tables[i].table);
+                       efi.mps = config_tables[i].table;
                        printk(" MPS=0x%lx", config_tables[i].table);
                } else if (efi_guidcmp(config_tables[i].guid, ACPI_20_TABLE_GUID) == 0) {
-                       efi.acpi20 = __va(config_tables[i].table);
+                       efi.acpi20 = config_tables[i].table;
                        printk(" ACPI 2.0=0x%lx", config_tables[i].table);
                } else if (efi_guidcmp(config_tables[i].guid, ACPI_TABLE_GUID) == 0) {
-                       efi.acpi = __va(config_tables[i].table);
+                       efi.acpi = config_tables[i].table;
                        printk(" ACPI=0x%lx", config_tables[i].table);
                } else if (efi_guidcmp(config_tables[i].guid, SMBIOS_TABLE_GUID) == 0) {
-                       efi.smbios = __va(config_tables[i].table);
+                       efi.smbios = config_tables[i].table;
                        printk(" SMBIOS=0x%lx", config_tables[i].table);
                } else if (efi_guidcmp(config_tables[i].guid, SAL_SYSTEM_TABLE_GUID) == 0) {
-                       efi.sal_systab = __va(config_tables[i].table);
+                       efi.sal_systab = config_tables[i].table;
                        printk(" SALsystab=0x%lx", config_tables[i].table);
                } else if (efi_guidcmp(config_tables[i].guid, HCDP_TABLE_GUID) == 0) {
-                       efi.hcdp = __va(config_tables[i].table);
+                       efi.hcdp = config_tables[i].table;
                        printk(" HCDP=0x%lx", config_tables[i].table);
                }
        }
@@ -677,27 +686,34 @@ EXPORT_SYMBOL(efi_mem_attributes);
 /*
  * Determines whether the memory at phys_addr supports the desired
  * attribute (WB, UC, etc).  If this returns 1, the caller can safely
- * access *size bytes at phys_addr with the specified attribute.
+ * access size bytes at phys_addr with the specified attribute.
  */
-static int
-efi_mem_attribute_range (unsigned long phys_addr, unsigned long *size, u64 attr)
+int
+efi_mem_attribute_range (unsigned long phys_addr, unsigned long size, u64 attr)
 {
+       unsigned long end = phys_addr + size;
        efi_memory_desc_t *md = efi_memory_descriptor(phys_addr);
-       unsigned long md_end;
 
-       if (!md || (md->attribute & attr) != attr)
+       /*
+        * Some firmware doesn't report MMIO regions in the EFI memory
+        * map.  The Intel BigSur (a.k.a. HP i2000) has this problem.
+        * On those platforms, we have to assume UC is valid everywhere.
+        */
+       if (!md || (md->attribute & attr) != attr) {
+               if (attr == EFI_MEMORY_UC && !efi_memmap_has_mmio())
+                       return 1;
                return 0;
+       }
 
        do {
-               md_end = efi_md_end(md);
-               if (phys_addr + *size <= md_end)
+               unsigned long md_end = efi_md_end(md);
+
+               if (end <= md_end)
                        return 1;
 
                md = efi_memory_descriptor(md_end);
-               if (!md || (md->attribute & attr) != attr) {
-                       *size = md_end - phys_addr;
-                       return 1;
-               }
+               if (!md || (md->attribute & attr) != attr)
+                       return 0;
        } while (md);
        return 0;
 }
@@ -708,7 +724,7 @@ efi_mem_attribute_range (unsigned long phys_addr, unsigned long *size, u64 attr)
  * control access size.
  */
 int
-valid_phys_addr_range (unsigned long phys_addr, unsigned long *size)
+valid_phys_addr_range (unsigned long phys_addr, unsigned long size)
 {
        return efi_mem_attribute_range(phys_addr, size, EFI_MEMORY_WB);
 }
@@ -723,7 +739,7 @@ valid_phys_addr_range (unsigned long phys_addr, unsigned long *size)
  * because that doesn't appear in the boot-time EFI memory map.
  */
 int
-valid_mmap_phys_addr_range (unsigned long phys_addr, unsigned long *size)
+valid_mmap_phys_addr_range (unsigned long phys_addr, unsigned long size)
 {
        if (efi_mem_attribute_range(phys_addr, size, EFI_MEMORY_WB))
                return 1;
@@ -731,14 +747,6 @@ valid_mmap_phys_addr_range (unsigned long phys_addr, unsigned long *size)
        if (efi_mem_attribute_range(phys_addr, size, EFI_MEMORY_UC))
                return 1;
 
-       /*
-        * Some firmware doesn't report MMIO regions in the EFI memory map.
-        * The Intel BigSur (a.k.a. HP i2000) has this problem.  In this
-        * case, we can't use the EFI memory map to validate mmap requests.
-        */
-       if (!efi_memmap_has_mmio())
-               return 1;
-
        return 0;
 }
 
index 50ae8c7d453d5075641a191dcfdf5bf0d4087ece..789881ca83d43606e389b65b481a8fc99083fb54 100644 (file)
@@ -34,6 +34,7 @@
 #include <asm/pgtable.h>
 #include <asm/kdebug.h>
 #include <asm/sections.h>
+#include <asm/uaccess.h>
 
 extern void jprobe_inst_return(void);
 
@@ -722,13 +723,50 @@ static int __kprobes kprobes_fault_handler(struct pt_regs *regs, int trapnr)
        struct kprobe *cur = kprobe_running();
        struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
 
-       if (cur->fault_handler && cur->fault_handler(cur, regs, trapnr))
-               return 1;
 
-       if (kcb->kprobe_status & KPROBE_HIT_SS) {
-               resume_execution(cur, regs);
-               reset_current_kprobe();
+       switch(kcb->kprobe_status) {
+       case KPROBE_HIT_SS:
+       case KPROBE_REENTER:
+               /*
+                * We are here because the instruction being single
+                * stepped caused a page fault. We reset the current
+                * kprobe and the instruction pointer points back to
+                * the probe address and allow the page fault handler
+                * to continue as a normal page fault.
+                */
+               regs->cr_iip = ((unsigned long)cur->addr) & ~0xFULL;
+               ia64_psr(regs)->ri = ((unsigned long)cur->addr) & 0xf;
+               if (kcb->kprobe_status == KPROBE_REENTER)
+                       restore_previous_kprobe(kcb);
+               else
+                       reset_current_kprobe();
                preempt_enable_no_resched();
+               break;
+       case KPROBE_HIT_ACTIVE:
+       case KPROBE_HIT_SSDONE:
+               /*
+                * We increment the nmissed count for accounting,
+                * we can also use npre/npostfault count for accouting
+                * these specific fault cases.
+                */
+               kprobes_inc_nmissed_count(cur);
+
+               /*
+                * We come here because instructions in the pre/post
+                * handler caused the page_fault, this could happen
+                * if handler tries to access user space by
+                * copy_from_user(), get_user() etc. Let the
+                * user-specified handler try to fix it first.
+                */
+               if (cur->fault_handler && cur->fault_handler(cur, regs, trapnr))
+                       return 1;
+
+               /*
+                * Let ia64_do_page_fault() fix it.
+                */
+               break;
+       default:
+               break;
        }
 
        return 0;
@@ -740,6 +778,9 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self,
        struct die_args *args = (struct die_args *)data;
        int ret = NOTIFY_DONE;
 
+       if (args->regs && user_mode(args->regs))
+               return ret;
+
        switch(val) {
        case DIE_BREAK:
                /* err is break number from ia64_bad_break() */
index 87ff7fe33cfb3b4e81568b58bac575d36e3bb20f..8963171788d52b44873fda9433c968b194df4f57 100644 (file)
@@ -69,6 +69,7 @@
 #include <linux/kernel.h>
 #include <linux/smp.h>
 #include <linux/workqueue.h>
+#include <linux/cpumask.h>
 
 #include <asm/delay.h>
 #include <asm/kdebug.h>
@@ -1505,7 +1506,7 @@ format_mca_init_stack(void *mca_data, unsigned long offset,
        ti->cpu = cpu;
        p->thread_info = ti;
        p->state = TASK_UNINTERRUPTIBLE;
-       __set_bit(cpu, &p->cpus_allowed);
+       cpu_set(cpu, p->cpus_allowed);
        INIT_LIST_HEAD(&p->tasks);
        p->parent = p->real_parent = p->group_leader = p;
        INIT_LIST_HEAD(&p->children);
index 309d59658e5ff9344bbd122c8d364fed8b8a1c09..355d57970ba31cf3368aa61e5c32c92b81a85029 100644 (file)
@@ -30,7 +30,6 @@
 #include <linux/efi.h>
 #include <linux/interrupt.h>
 #include <linux/delay.h>
-#include <linux/kprobes.h>
 
 #include <asm/cpu.h>
 #include <asm/delay.h>
@@ -738,13 +737,6 @@ void
 exit_thread (void)
 {
 
-       /*
-        * Remove function-return probe instances associated with this task
-        * and put them back on the free list. Do not insert an exit probe for
-        * this function, it will be disabled by kprobe_flush_task if you do.
-        */
-       kprobe_flush_task(current);
-
        ia64_drop_fpu(current);
 #ifdef CONFIG_PERFMON
        /* if needed, stop monitoring and flush state to perfmon context */
index eb388e271b2b5a73746f4454347882c04aa0c8cc..e4dfda1eb7dd656f65a54320ee6af64cbb5757a9 100644 (file)
@@ -37,6 +37,7 @@
 #include <linux/string.h>
 #include <linux/threads.h>
 #include <linux/tty.h>
+#include <linux/dmi.h>
 #include <linux/serial.h>
 #include <linux/serial_core.h>
 #include <linux/efi.h>
@@ -433,7 +434,7 @@ setup_arch (char **cmdline_p)
        find_memory();
 
        /* process SAL system table: */
-       ia64_sal_init(efi.sal_systab);
+       ia64_sal_init(__va(efi.sal_systab));
 
        ia64_setup_printk_clock();
 
@@ -887,3 +888,10 @@ check_bugs (void)
        ia64_patch_mckinley_e9((unsigned long) __start___mckinley_e9_bundles,
                               (unsigned long) __end___mckinley_e9_bundles);
 }
+
+static int __init run_dmi_scan(void)
+{
+       dmi_scan_machine();
+       return 0;
+}
+core_initcall(run_dmi_scan);
index ac64664a1807d3dfaa7e1122b8ae2e5203f45112..d8536a2c22a9cd0b7ce42a608c403d3108c7c918 100644 (file)
@@ -6,7 +6,7 @@ obj-y := io.o
 
 lib-y := __divsi3.o __udivsi3.o __modsi3.o __umodsi3.o                 \
        __divdi3.o __udivdi3.o __moddi3.o __umoddi3.o                   \
-       bitop.o checksum.o clear_page.o csum_partial_copy.o             \
+       checksum.o clear_page.o csum_partial_copy.o                     \
        clear_user.o strncpy_from_user.o strlen_user.o strnlen_user.o   \
        flush.o ip_fast_csum.o do_csum.o                                \
        memset.o strlen.o
diff --git a/arch/ia64/lib/bitop.c b/arch/ia64/lib/bitop.c
deleted file mode 100644 (file)
index 82e299c..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-#include <linux/compiler.h>
-#include <linux/types.h>
-#include <asm/intrinsics.h>
-#include <linux/module.h>
-#include <linux/bitops.h>
-
-/*
- * Find next zero bit in a bitmap reasonably efficiently..
- */
-
-int __find_next_zero_bit (const void *addr, unsigned long size, unsigned long offset)
-{
-       unsigned long *p = ((unsigned long *) addr) + (offset >> 6);
-       unsigned long result = offset & ~63UL;
-       unsigned long tmp;
-
-       if (offset >= size)
-               return size;
-       size -= result;
-       offset &= 63UL;
-       if (offset) {
-               tmp = *(p++);
-               tmp |= ~0UL >> (64-offset);
-               if (size < 64)
-                       goto found_first;
-               if (~tmp)
-                       goto found_middle;
-               size -= 64;
-               result += 64;
-       }
-       while (size & ~63UL) {
-               if (~(tmp = *(p++)))
-                       goto found_middle;
-               result += 64;
-               size -= 64;
-       }
-       if (!size)
-               return result;
-       tmp = *p;
-found_first:
-       tmp |= ~0UL << size;
-       if (tmp == ~0UL)                /* any bits zero? */
-               return result + size;   /* nope */
-found_middle:
-       return result + ffz(tmp);
-}
-EXPORT_SYMBOL(__find_next_zero_bit);
-
-/*
- * Find next bit in a bitmap reasonably efficiently..
- */
-int __find_next_bit(const void *addr, unsigned long size, unsigned long offset)
-{
-       unsigned long *p = ((unsigned long *) addr) + (offset >> 6);
-       unsigned long result = offset & ~63UL;
-       unsigned long tmp;
-
-       if (offset >= size)
-               return size;
-       size -= result;
-       offset &= 63UL;
-       if (offset) {
-               tmp = *(p++);
-               tmp &= ~0UL << offset;
-               if (size < 64)
-                       goto found_first;
-               if (tmp)
-                       goto found_middle;
-               size -= 64;
-               result += 64;
-       }
-       while (size & ~63UL) {
-               if ((tmp = *(p++)))
-                       goto found_middle;
-               result += 64;
-               size -= 64;
-       }
-       if (!size)
-               return result;
-       tmp = *p;
-  found_first:
-       tmp &= ~0UL >> (64-size);
-       if (tmp == 0UL)         /* Are any bits set? */
-               return result + size; /* Nope. */
-  found_middle:
-       return result + __ffs(tmp);
-}
-EXPORT_SYMBOL(__find_next_bit);
index d78d20f0a0f041668c1b9680037a7769613a4dc6..bb0a01a8187895fd6e072c2191cb4415dc24e2ca 100644 (file)
@@ -2,7 +2,7 @@
 # Makefile for the ia64-specific parts of the memory manager.
 #
 
-obj-y := init.o fault.o tlb.o extable.o
+obj-y := init.o fault.o tlb.o extable.o ioremap.o
 
 obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
 obj-$(CONFIG_NUMA)        += numa.o
diff --git a/arch/ia64/mm/ioremap.c b/arch/ia64/mm/ioremap.c
new file mode 100644 (file)
index 0000000..6232862
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * (c) Copyright 2006 Hewlett-Packard Development Company, L.P.
+ *     Bjorn Helgaas <bjorn.helgaas@hp.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/compiler.h>
+#include <linux/module.h>
+#include <linux/efi.h>
+#include <asm/io.h>
+
+static inline void __iomem *
+__ioremap (unsigned long offset, unsigned long size)
+{
+       return (void __iomem *) (__IA64_UNCACHED_OFFSET | offset);
+}
+
+void __iomem *
+ioremap (unsigned long offset, unsigned long size)
+{
+       if (efi_mem_attribute_range(offset, size, EFI_MEMORY_UC))
+               return __ioremap(offset, size);
+
+       if (efi_mem_attribute_range(offset, size, EFI_MEMORY_WB))
+               return phys_to_virt(offset);
+
+       /*
+        * Someday this should check ACPI resources so we
+        * can do the right thing for hot-plugged regions.
+        */
+       return __ioremap(offset, size);
+}
+EXPORT_SYMBOL(ioremap);
+
+void __iomem *
+ioremap_nocache (unsigned long offset, unsigned long size)
+{
+       return __ioremap(offset, size);
+}
+EXPORT_SYMBOL(ioremap_nocache);
index 8b6d5c8447089d8523ed807583c9c317cc9caf0b..30988dfbddff242e38bbf480a0d016282595f618 100644 (file)
@@ -327,10 +327,11 @@ sn_scan_pcdp(void)
        struct pcdp_interface_pci if_pci;
        extern struct efi efi;
 
-       pcdp = efi.hcdp;
-       if (! pcdp)
+       if (efi.hcdp == EFI_INVALID_TABLE_ADDR)
                return;         /* no hcdp/pcdp table */
 
+       pcdp = __va(efi.hcdp);
+
        if (pcdp->rev < 3)
                return;         /* only support PCDP (rev >= 3) */
 
index a3dcc3fab4b736660ab3b621d3321c730949f501..05c864c6c2d937e31f893c3b1aa783e190906c33 100644 (file)
@@ -214,6 +214,14 @@ config RWSEM_XCHGADD_ALGORITHM
        bool
        default n
 
+config GENERIC_FIND_NEXT_BIT
+       bool
+       default y
+
+config GENERIC_HWEIGHT
+       bool
+       default y
+
 config GENERIC_CALIBRATE_DELAY
        bool
        default y
index 8849439e88dd35f997238d0fbee9e4eea3c342ed..805b81fedf80a3129fec1c525487cc2d9da239ef 100644 (file)
@@ -17,6 +17,10 @@ config RWSEM_GENERIC_SPINLOCK
 config RWSEM_XCHGADD_ALGORITHM
        bool
 
+config GENERIC_HWEIGHT
+       bool
+       default y
+
 config GENERIC_CALIBRATE_DELAY
        bool
        default y
index 3ffc84f9c29194453c172d7fe107c58561c0313c..c90cb5fcc8efb6e82559d608ba3ed42b8e46bb5d 100644 (file)
@@ -142,7 +142,7 @@ void __init config_bvme6000(void)
     /* Now do the PIT configuration */
 
     pit->pgcr  = 0x00; /* Unidirectional 8 bit, no handshake for now */
-    pit->psrr  = 0x18; /* PIACK and PIRQ fucntions enabled */
+    pit->psrr  = 0x18; /* PIACK and PIRQ functions enabled */
     pit->pacr  = 0x00; /* Sub Mode 00, H2 i/p, no DMA */
     pit->padr  = 0x00; /* Just to be tidy! */
     pit->paddr = 0x00; /* All inputs for now (safest) */
index e50858dbc23777ba6ef85b08bb9c70bef6dd211c..3cde6822ead172b122bc66543a784ea4396cacf4 100644 (file)
@@ -25,6 +25,14 @@ config RWSEM_XCHGADD_ALGORITHM
        bool
        default n
 
+config GENERIC_FIND_NEXT_BIT
+       bool
+       default y
+
+config GENERIC_HWEIGHT
+       bool
+       default y
+
 config GENERIC_CALIBRATE_DELAY
        bool
        default y
index ac2012f033d611863c31812d04fb3417276e58a7..5080ea1799a43807c31f718b439b21b441d487aa 100644 (file)
@@ -801,6 +801,14 @@ config RWSEM_GENERIC_SPINLOCK
 config RWSEM_XCHGADD_ALGORITHM
        bool
 
+config GENERIC_FIND_NEXT_BIT
+       bool
+       default y
+
+config GENERIC_HWEIGHT
+       bool
+       default y
+
 config GENERIC_CALIBRATE_DELAY
        bool
        default y
index 013bc93688e8a3dd28caf15da957da976998d05b..3f40c37a9ee670252a56abf6066ad3b0cbfaec0d 100644 (file)
@@ -30,7 +30,6 @@
 #include <linux/utime.h>
 #include <linux/utsname.h>
 #include <linux/personality.h>
-#include <linux/timex.h>
 #include <linux/dnotify.h>
 #include <linux/module.h>
 #include <linux/binfmts.h>
@@ -1157,79 +1156,6 @@ out:
        return err;
 }
 
-/* Handle adjtimex compatibility. */
-
-struct timex32 {
-       u32 modes;
-       s32 offset, freq, maxerror, esterror;
-       s32 status, constant, precision, tolerance;
-       struct compat_timeval time;
-       s32 tick;
-       s32 ppsfreq, jitter, shift, stabil;
-       s32 jitcnt, calcnt, errcnt, stbcnt;
-       s32  :32; s32  :32; s32  :32; s32  :32;
-       s32  :32; s32  :32; s32  :32; s32  :32;
-       s32  :32; s32  :32; s32  :32; s32  :32;
-};
-
-extern int do_adjtimex(struct timex *);
-
-asmlinkage int sys32_adjtimex(struct timex32 __user *utp)
-{
-       struct timex txc;
-       int ret;
-
-       memset(&txc, 0, sizeof(struct timex));
-
-       if (get_user(txc.modes, &utp->modes) ||
-          __get_user(txc.offset, &utp->offset) ||
-          __get_user(txc.freq, &utp->freq) ||
-          __get_user(txc.maxerror, &utp->maxerror) ||
-          __get_user(txc.esterror, &utp->esterror) ||
-          __get_user(txc.status, &utp->status) ||
-          __get_user(txc.constant, &utp->constant) ||
-          __get_user(txc.precision, &utp->precision) ||
-          __get_user(txc.tolerance, &utp->tolerance) ||
-          __get_user(txc.time.tv_sec, &utp->time.tv_sec) ||
-          __get_user(txc.time.tv_usec, &utp->time.tv_usec) ||
-          __get_user(txc.tick, &utp->tick) ||
-          __get_user(txc.ppsfreq, &utp->ppsfreq) ||
-          __get_user(txc.jitter, &utp->jitter) ||
-          __get_user(txc.shift, &utp->shift) ||
-          __get_user(txc.stabil, &utp->stabil) ||
-          __get_user(txc.jitcnt, &utp->jitcnt) ||
-          __get_user(txc.calcnt, &utp->calcnt) ||
-          __get_user(txc.errcnt, &utp->errcnt) ||
-          __get_user(txc.stbcnt, &utp->stbcnt))
-               return -EFAULT;
-
-       ret = do_adjtimex(&txc);
-
-       if (put_user(txc.modes, &utp->modes) ||
-          __put_user(txc.offset, &utp->offset) ||
-          __put_user(txc.freq, &utp->freq) ||
-          __put_user(txc.maxerror, &utp->maxerror) ||
-          __put_user(txc.esterror, &utp->esterror) ||
-          __put_user(txc.status, &utp->status) ||
-          __put_user(txc.constant, &utp->constant) ||
-          __put_user(txc.precision, &utp->precision) ||
-          __put_user(txc.tolerance, &utp->tolerance) ||
-          __put_user(txc.time.tv_sec, &utp->time.tv_sec) ||
-          __put_user(txc.time.tv_usec, &utp->time.tv_usec) ||
-          __put_user(txc.tick, &utp->tick) ||
-          __put_user(txc.ppsfreq, &utp->ppsfreq) ||
-          __put_user(txc.jitter, &utp->jitter) ||
-          __put_user(txc.shift, &utp->shift) ||
-          __put_user(txc.stabil, &utp->stabil) ||
-          __put_user(txc.jitcnt, &utp->jitcnt) ||
-          __put_user(txc.calcnt, &utp->calcnt) ||
-          __put_user(txc.errcnt, &utp->errcnt) ||
-          __put_user(txc.stbcnt, &utp->stbcnt))
-               ret = -EFAULT;
-
-       return ret;
-}
-
 asmlinkage int sys32_sendfile(int out_fd, int in_fd, compat_off_t __user *offset,
        s32 count)
 {
index 02c8267e45e73fb5d5fed93497ef9f40124d2cb2..05a2c0567daedd953d3a62cb82cc54c356fc2b8b 100644 (file)
@@ -273,7 +273,7 @@ EXPORT(sysn32_call_table)
        PTR     sys_pivot_root
        PTR     sys32_sysctl
        PTR     sys_prctl
-       PTR     sys32_adjtimex
+       PTR     compat_sys_adjtimex
        PTR     compat_sys_setrlimit            /* 6155 */
        PTR     sys_chroot
        PTR     sys_sync
index 797e0d87488930fc4c453066a41eb3b4cf67a5f9..19c4ca481b02c3ee1ccc6560a1748d2807959ebf 100644 (file)
@@ -328,7 +328,7 @@ sys_call_table:
        PTR     sys_setdomainname
        PTR     sys32_newuname
        PTR     sys_ni_syscall                  /* sys_modify_ldt */
-       PTR     sys32_adjtimex
+       PTR     compat_sys_adjtimex
        PTR     sys_mprotect                    /* 4125 */
        PTR     compat_sys_sigprocmask
        PTR     sys_ni_syscall                  /* was creat_module */
index 8ff43a1c1e99c43f8cbbf5f49310f448b5fc87b4..e3d5aaa90f0db260ee78026df04ff603f4690c8c 100644 (file)
 #include <linux/string.h>
 #include <linux/net.h>
 #include <linux/inet.h>
+#include <linux/mutex.h>
 #include <asm/uaccess.h>
 
 #include "sysctl.h"
 #include "ds1603.h"
 
-static DECLARE_MUTEX(lasat_info_sem);
+static DEFINE_MUTEX(lasat_info_mutex);
 
 /* Strategy function to write EEPROM after changing string entry */
 int sysctl_lasatstring(ctl_table *table, int *name, int nlen,
@@ -43,17 +44,17 @@ int sysctl_lasatstring(ctl_table *table, int *name, int nlen,
                void *newval, size_t newlen, void **context)
 {
        int r;
-       down(&lasat_info_sem);
+       mutex_lock(&lasat_info_mutex);
        r = sysctl_string(table, name,
                          nlen, oldval, oldlenp, newval, newlen, context);
        if (r < 0) {
-               up(&lasat_info_sem);
+               mutex_unlock(&lasat_info_mutex);
                return r;
        }
        if (newval && newlen) {
                lasat_write_eeprom_info();
        }
-       up(&lasat_info_sem);
+       mutex_unlock(&lasat_info_mutex);
        return 1;
 }
 
@@ -63,14 +64,14 @@ int proc_dolasatstring(ctl_table *table, int write, struct file *filp,
                       void *buffer, size_t *lenp, loff_t *ppos)
 {
        int r;
-       down(&lasat_info_sem);
+       mutex_lock(&lasat_info_mutex);
        r = proc_dostring(table, write, filp, buffer, lenp, ppos);
        if ( (!write) || r) {
-               up(&lasat_info_sem);
+               mutex_unlock(&lasat_info_mutex);
                return r;
        }
        lasat_write_eeprom_info();
-       up(&lasat_info_sem);
+       mutex_unlock(&lasat_info_mutex);
        return 0;
 }
 
@@ -79,14 +80,14 @@ int proc_dolasatint(ctl_table *table, int write, struct file *filp,
                       void *buffer, size_t *lenp, loff_t *ppos)
 {
        int r;
-       down(&lasat_info_sem);
+       mutex_lock(&lasat_info_mutex);
        r = proc_dointvec(table, write, filp, buffer, lenp, ppos);
        if ( (!write) || r) {
-               up(&lasat_info_sem);
+               mutex_unlock(&lasat_info_mutex);
                return r;
        }
        lasat_write_eeprom_info();
-       up(&lasat_info_sem);
+       mutex_unlock(&lasat_info_mutex);
        return 0;
 }
 
@@ -98,7 +99,7 @@ int proc_dolasatrtc(ctl_table *table, int write, struct file *filp,
                       void *buffer, size_t *lenp, loff_t *ppos)
 {
        int r;
-       down(&lasat_info_sem);
+       mutex_lock(&lasat_info_mutex);
        if (!write) {
                rtctmp = ds1603_read();
                /* check for time < 0 and set to 0 */
@@ -107,11 +108,11 @@ int proc_dolasatrtc(ctl_table *table, int write, struct file *filp,
        }
        r = proc_dointvec(table, write, filp, buffer, lenp, ppos);
        if ( (!write) || r) {
-               up(&lasat_info_sem);
+               mutex_unlock(&lasat_info_mutex);
                return r;
        }
        ds1603_set(rtctmp);
-       up(&lasat_info_sem);
+       mutex_unlock(&lasat_info_mutex);
        return 0;
 }
 #endif
@@ -122,16 +123,16 @@ int sysctl_lasat_intvec(ctl_table *table, int *name, int nlen,
                    void *newval, size_t newlen, void **context)
 {
        int r;
-       down(&lasat_info_sem);
+       mutex_lock(&lasat_info_mutex);
        r = sysctl_intvec(table, name, nlen, oldval, oldlenp, newval, newlen, context);
        if (r < 0) {
-               up(&lasat_info_sem);
+               mutex_unlock(&lasat_info_mutex);
                return r;
        }
        if (newval && newlen) {
                lasat_write_eeprom_info();
        }
-       up(&lasat_info_sem);
+       mutex_unlock(&lasat_info_mutex);
        return 1;
 }
 
@@ -142,19 +143,19 @@ int sysctl_lasat_rtc(ctl_table *table, int *name, int nlen,
                    void *newval, size_t newlen, void **context)
 {
        int r;
-       down(&lasat_info_sem);
+       mutex_lock(&lasat_info_mutex);
        rtctmp = ds1603_read();
        if (rtctmp < 0)
                rtctmp = 0;
        r = sysctl_intvec(table, name, nlen, oldval, oldlenp, newval, newlen, context);
        if (r < 0) {
-               up(&lasat_info_sem);
+               mutex_unlock(&lasat_info_mutex);
                return r;
        }
        if (newval && newlen) {
                ds1603_set(rtctmp);
        }
-       up(&lasat_info_sem);
+       mutex_unlock(&lasat_info_mutex);
        return 1;
 }
 #endif
@@ -192,13 +193,13 @@ int proc_lasat_ip(ctl_table *table, int write, struct file *filp,
                return 0;
        }
 
-       down(&lasat_info_sem);
+       mutex_lock(&lasat_info_mutex);
        if (write) {
                len = 0;
                p = buffer;
                while (len < *lenp) {
                        if(get_user(c, p++)) {
-                               up(&lasat_info_sem);
+                               mutex_unlock(&lasat_info_mutex);
                                return -EFAULT;
                        }
                        if (c == 0 || c == '\n')
@@ -209,7 +210,7 @@ int proc_lasat_ip(ctl_table *table, int write, struct file *filp,
                        len = sizeof(proc_lasat_ipbuf) - 1;
                if (copy_from_user(proc_lasat_ipbuf, buffer, len))
                {
-                       up(&lasat_info_sem);
+                       mutex_unlock(&lasat_info_mutex);
                        return -EFAULT;
                }
                proc_lasat_ipbuf[len] = 0;
@@ -230,12 +231,12 @@ int proc_lasat_ip(ctl_table *table, int write, struct file *filp,
                        len = *lenp;
                if (len)
                        if(copy_to_user(buffer, proc_lasat_ipbuf, len)) {
-                               up(&lasat_info_sem);
+                               mutex_unlock(&lasat_info_mutex);
                                return -EFAULT;
                        }
                if (len < *lenp) {
                        if(put_user('\n', ((char *) buffer) + len)) {
-                               up(&lasat_info_sem);
+                               mutex_unlock(&lasat_info_mutex);
                                return -EFAULT;
                        }
                        len++;
@@ -244,7 +245,7 @@ int proc_lasat_ip(ctl_table *table, int write, struct file *filp,
                *ppos += len;
        }
        update_bcastaddr();
-       up(&lasat_info_sem);
+       mutex_unlock(&lasat_info_mutex);
        return 0;
 }
 #endif /* defined(CONFIG_INET) */
@@ -256,10 +257,10 @@ static int sysctl_lasat_eeprom_value(ctl_table *table, int *name, int nlen,
 {
        int r;
 
-       down(&lasat_info_sem);
+       mutex_lock(&lasat_info_mutex);
        r = sysctl_intvec(table, name, nlen, oldval, oldlenp, newval, newlen, context);
        if (r < 0) {
-               up(&lasat_info_sem);
+               mutex_unlock(&lasat_info_mutex);
                return r;
        }
 
@@ -271,7 +272,7 @@ static int sysctl_lasat_eeprom_value(ctl_table *table, int *name, int nlen,
                lasat_write_eeprom_info();
                lasat_init_board_info();
        }
-       up(&lasat_info_sem);
+       mutex_unlock(&lasat_info_mutex);
 
        return 0;
 }
@@ -280,10 +281,10 @@ int proc_lasat_eeprom_value(ctl_table *table, int write, struct file *filp,
                       void *buffer, size_t *lenp, loff_t *ppos)
 {
        int r;
-       down(&lasat_info_sem);
+       mutex_lock(&lasat_info_mutex);
        r = proc_dointvec(table, write, filp, buffer, lenp, ppos);
        if ( (!write) || r) {
-               up(&lasat_info_sem);
+               mutex_unlock(&lasat_info_mutex);
                return r;
        }
        if (filp && filp->f_dentry)
@@ -294,7 +295,7 @@ int proc_lasat_eeprom_value(ctl_table *table, int write, struct file *filp,
                        lasat_board_info.li_eeprom_info.debugaccess = lasat_board_info.li_debugaccess;
        }
        lasat_write_eeprom_info();
-       up(&lasat_info_sem);
+       mutex_unlock(&lasat_info_mutex);
        return 0;
 }
 
index eca33cfa8a4c5dab12d927acf389b703a4f87528..6b3c50964ca9e79bfd2ba2fcb8f1a30968f91278 100644 (file)
@@ -25,6 +25,14 @@ config RWSEM_GENERIC_SPINLOCK
 config RWSEM_XCHGADD_ALGORITHM
        bool
 
+config GENERIC_FIND_NEXT_BIT
+       bool
+       default y
+
+config GENERIC_HWEIGHT
+       bool
+       default y
+
 config GENERIC_CALIBRATE_DELAY
        bool
        default y
index 61356901841093163f7deb95fa46c045179d0d65..d286f68a3d3a6a6257dce190054b5db570e80fce 100644 (file)
@@ -21,7 +21,6 @@
 #include <linux/times.h>
 #include <linux/utsname.h>
 #include <linux/time.h>
-#include <linux/timex.h>
 #include <linux/smp.h>
 #include <linux/smp_lock.h>
 #include <linux/sem.h>
@@ -567,63 +566,6 @@ asmlinkage int sys32_sendfile64(int out_fd, int in_fd, compat_loff_t __user *off
 }
 
 
-struct timex32 {
-       unsigned int modes;     /* mode selector */
-       int offset;             /* time offset (usec) */
-       int freq;               /* frequency offset (scaled ppm) */
-       int maxerror;           /* maximum error (usec) */
-       int esterror;           /* estimated error (usec) */
-       int status;             /* clock command/status */
-       int constant;           /* pll time constant */
-       int precision;          /* clock precision (usec) (read only) */
-       int tolerance;          /* clock frequency tolerance (ppm)
-                                * (read only)
-                                */
-       struct compat_timeval time;     /* (read only) */
-       int tick;               /* (modified) usecs between clock ticks */
-
-       int ppsfreq;           /* pps frequency (scaled ppm) (ro) */
-       int jitter;            /* pps jitter (us) (ro) */
-       int shift;              /* interval duration (s) (shift) (ro) */
-       int stabil;            /* pps stability (scaled ppm) (ro) */
-       int jitcnt;            /* jitter limit exceeded (ro) */
-       int calcnt;            /* calibration intervals (ro) */
-       int errcnt;            /* calibration errors (ro) */
-       int stbcnt;            /* stability limit exceeded (ro) */
-
-       int  :32; int  :32; int  :32; int  :32;
-       int  :32; int  :32; int  :32; int  :32;
-       int  :32; int  :32; int  :32; int  :32;
-};
-
-asmlinkage long sys32_adjtimex(struct timex32 __user *txc_p32)
-{
-       struct timex txc;
-       struct timex32 t32;
-       int ret;
-       extern int do_adjtimex(struct timex *txc);
-
-       if(copy_from_user(&t32, txc_p32, sizeof(struct timex32)))
-               return -EFAULT;
-#undef CP
-#define CP(x) txc.x = t32.x
-       CP(modes); CP(offset); CP(freq); CP(maxerror); CP(esterror);
-       CP(status); CP(constant); CP(precision); CP(tolerance);
-       CP(time.tv_sec); CP(time.tv_usec); CP(tick); CP(ppsfreq); CP(jitter);
-       CP(shift); CP(stabil); CP(jitcnt); CP(calcnt); CP(errcnt);
-       CP(stbcnt);
-       ret = do_adjtimex(&txc);
-#undef CP
-#define CP(x) t32.x = txc.x
-       CP(modes); CP(offset); CP(freq); CP(maxerror); CP(esterror);
-       CP(status); CP(constant); CP(precision); CP(tolerance);
-       CP(time.tv_sec); CP(time.tv_usec); CP(tick); CP(ppsfreq); CP(jitter);
-       CP(shift); CP(stabil); CP(jitcnt); CP(calcnt); CP(errcnt);
-       CP(stbcnt);
-       return copy_to_user(txc_p32, &t32, sizeof(struct timex32)) ? -EFAULT : ret;
-}
-
-
 struct sysinfo32 {
        s32 uptime;
        u32 loads[3];
index 71011eadb872d54d495dbcd0e0d919ed0c0db165..89b6c56ea0a8dea90116bf0f27138d94723f8221 100644 (file)
        /* struct sockaddr... */
        ENTRY_SAME(recvfrom)
        /* struct timex contains longs */
-       ENTRY_DIFF(adjtimex)
+       ENTRY_COMP(adjtimex)
        ENTRY_SAME(mprotect)            /* 125 */
        /* old_sigset_t forced to 32 bits.  Beware glibc sigset_t */
        ENTRY_COMP(sigprocmask)
index fae42da7468d0b82b1c6f3ab911d3ec3e05c1414..a433b7126d33495728fb2e0889cdb09a385bd91f 100644 (file)
@@ -37,6 +37,10 @@ config RWSEM_XCHGADD_ALGORITHM
        bool
        default y
 
+config GENERIC_HWEIGHT
+       bool
+       default y
+
 config GENERIC_CALIBRATE_DELAY
        bool
        default y
index cb1fe5878e8b73724ef86056962e2d5dc37e58fe..ad7a90212204ee68eea83075b51fbadf5a62ef4b 100644 (file)
 #include <linux/kprobes.h>
 #include <linux/ptrace.h>
 #include <linux/preempt.h>
+#include <linux/module.h>
 #include <asm/cacheflush.h>
 #include <asm/kdebug.h>
 #include <asm/sstep.h>
+#include <asm/uaccess.h>
 
 DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL;
 DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk);
@@ -372,17 +374,62 @@ static inline int kprobe_fault_handler(struct pt_regs *regs, int trapnr)
 {
        struct kprobe *cur = kprobe_running();
        struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
-
-       if (cur->fault_handler && cur->fault_handler(cur, regs, trapnr))
-               return 1;
-
-       if (kcb->kprobe_status & KPROBE_HIT_SS) {
-               resume_execution(cur, regs);
+       const struct exception_table_entry *entry;
+
+       switch(kcb->kprobe_status) {
+       case KPROBE_HIT_SS:
+       case KPROBE_REENTER:
+               /*
+                * We are here because the instruction being single
+                * stepped caused a page fault. We reset the current
+                * kprobe and the nip points back to the probe address
+                * and allow the page fault handler to continue as a
+                * normal page fault.
+                */
+               regs->nip = (unsigned long)cur->addr;
                regs->msr &= ~MSR_SE;
                regs->msr |= kcb->kprobe_saved_msr;
-
-               reset_current_kprobe();
+               if (kcb->kprobe_status == KPROBE_REENTER)
+                       restore_previous_kprobe(kcb);
+               else
+                       reset_current_kprobe();
                preempt_enable_no_resched();
+               break;
+       case KPROBE_HIT_ACTIVE:
+       case KPROBE_HIT_SSDONE:
+               /*
+                * We increment the nmissed count for accounting,
+                * we can also use npre/npostfault count for accouting
+                * these specific fault cases.
+                */
+               kprobes_inc_nmissed_count(cur);
+
+               /*
+                * We come here because instructions in the pre/post
+                * handler caused the page_fault, this could happen
+                * if handler tries to access user space by
+                * copy_from_user(), get_user() etc. Let the
+                * user-specified handler try to fix it first.
+                */
+               if (cur->fault_handler && cur->fault_handler(cur, regs, trapnr))
+                       return 1;
+
+               /*
+                * In case the user-specified fault handler returned
+                * zero, try to fix up.
+                */
+               if ((entry = search_exception_tables(regs->nip)) != NULL) {
+                       regs->nip = entry->fixup;
+                       return 1;
+               }
+
+               /*
+                * fixup_exception() could not handle it,
+                * Let do_page_fault() fix it.
+                */
+               break;
+       default:
+               break;
        }
        return 0;
 }
@@ -396,6 +443,9 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self,
        struct die_args *args = (struct die_args *)data;
        int ret = NOTIFY_DONE;
 
+       if (args->regs && user_mode(args->regs))
+               return ret;
+
        switch (val) {
        case DIE_BPT:
                if (kprobe_handler(args->regs))
index 1770a066c2176f71afa3e736904d8744bf0e0b84..f698aa77127eb818e5568404c70b3728c0ca52f6 100644 (file)
@@ -35,7 +35,6 @@
 #include <linux/mqueue.h>
 #include <linux/hardirq.h>
 #include <linux/utsname.h>
-#include <linux/kprobes.h>
 
 #include <asm/pgtable.h>
 #include <asm/uaccess.h>
@@ -460,7 +459,6 @@ void show_regs(struct pt_regs * regs)
 
 void exit_thread(void)
 {
-       kprobe_flush_task(current);
        discard_lazy_cpu_state();
 }
 
index cd75ab2908fa851e9b34043f0c74f3b0322f957c..ec274e688816d399bb16a349f1eb96a6164b48c8 100644 (file)
@@ -24,7 +24,6 @@
 #include <linux/resource.h>
 #include <linux/times.h>
 #include <linux/utsname.h>
-#include <linux/timex.h>
 #include <linux/smp.h>
 #include <linux/smp_lock.h>
 #include <linux/sem.h>
@@ -161,78 +160,6 @@ asmlinkage long compat_sys_sysfs(u32 option, u32 arg1, u32 arg2)
        return sys_sysfs((int)option, arg1, arg2);
 }
 
-/* Handle adjtimex compatibility. */
-struct timex32 {
-       u32 modes;
-       s32 offset, freq, maxerror, esterror;
-       s32 status, constant, precision, tolerance;
-       struct compat_timeval time;
-       s32 tick;
-       s32 ppsfreq, jitter, shift, stabil;
-       s32 jitcnt, calcnt, errcnt, stbcnt;
-       s32  :32; s32  :32; s32  :32; s32  :32;
-       s32  :32; s32  :32; s32  :32; s32  :32;
-       s32  :32; s32  :32; s32  :32; s32  :32;
-};
-
-extern int do_adjtimex(struct timex *);
-
-asmlinkage long compat_sys_adjtimex(struct timex32 __user *utp)
-{
-       struct timex txc;
-       int ret;
-       
-       memset(&txc, 0, sizeof(struct timex));
-
-       if(get_user(txc.modes, &utp->modes) ||
-          __get_user(txc.offset, &utp->offset) ||
-          __get_user(txc.freq, &utp->freq) ||
-          __get_user(txc.maxerror, &utp->maxerror) ||
-          __get_user(txc.esterror, &utp->esterror) ||
-          __get_user(txc.status, &utp->status) ||
-          __get_user(txc.constant, &utp->constant) ||
-          __get_user(txc.precision, &utp->precision) ||
-          __get_user(txc.tolerance, &utp->tolerance) ||
-          __get_user(txc.time.tv_sec, &utp->time.tv_sec) ||
-          __get_user(txc.time.tv_usec, &utp->time.tv_usec) ||
-          __get_user(txc.tick, &utp->tick) ||
-          __get_user(txc.ppsfreq, &utp->ppsfreq) ||
-          __get_user(txc.jitter, &utp->jitter) ||
-          __get_user(txc.shift, &utp->shift) ||
-          __get_user(txc.stabil, &utp->stabil) ||
-          __get_user(txc.jitcnt, &utp->jitcnt) ||
-          __get_user(txc.calcnt, &utp->calcnt) ||
-          __get_user(txc.errcnt, &utp->errcnt) ||
-          __get_user(txc.stbcnt, &utp->stbcnt))
-               return -EFAULT;
-
-       ret = do_adjtimex(&txc);
-
-       if(put_user(txc.modes, &utp->modes) ||
-          __put_user(txc.offset, &utp->offset) ||
-          __put_user(txc.freq, &utp->freq) ||
-          __put_user(txc.maxerror, &utp->maxerror) ||
-          __put_user(txc.esterror, &utp->esterror) ||
-          __put_user(txc.status, &utp->status) ||
-          __put_user(txc.constant, &utp->constant) ||
-          __put_user(txc.precision, &utp->precision) ||
-          __put_user(txc.tolerance, &utp->tolerance) ||
-          __put_user(txc.time.tv_sec, &utp->time.tv_sec) ||
-          __put_user(txc.time.tv_usec, &utp->time.tv_usec) ||
-          __put_user(txc.tick, &utp->tick) ||
-          __put_user(txc.ppsfreq, &utp->ppsfreq) ||
-          __put_user(txc.jitter, &utp->jitter) ||
-          __put_user(txc.shift, &utp->shift) ||
-          __put_user(txc.stabil, &utp->stabil) ||
-          __put_user(txc.jitcnt, &utp->jitcnt) ||
-          __put_user(txc.calcnt, &utp->calcnt) ||
-          __put_user(txc.errcnt, &utp->errcnt) ||
-          __put_user(txc.stbcnt, &utp->stbcnt))
-               ret = -EFAULT;
-
-       return ret;
-}
-
 asmlinkage long compat_sys_pause(void)
 {
        current->state = TASK_INTERRUPTIBLE;
index 8b0c132bc163f174b512b7d48515e12d071f3732..add8c1a9af68ae12db88b1501f7b3f5d1c2ad1e4 100644 (file)
 #include <asm/uaccess.h>
 #include <asm/pgalloc.h>
 #include <asm/pgtable.h>
-#include <asm/semaphore.h>
+#include <linux/mutex.h>
 #include <asm/cacheflush.h>
 
 #include "mmu_decl.h"
 
-static DECLARE_MUTEX(imlist_sem);
+static DEFINE_MUTEX(imlist_mutex);
 struct vm_struct * imlist = NULL;
 
 static int get_free_im_addr(unsigned long size, unsigned long *im_addr)
@@ -257,7 +257,7 @@ struct vm_struct * im_get_free_area(unsigned long size)
        struct vm_struct *area;
        unsigned long addr;
        
-       down(&imlist_sem);
+       mutex_lock(&imlist_mutex);
        if (get_free_im_addr(size, &addr)) {
                printk(KERN_ERR "%s() cannot obtain addr for size 0x%lx\n",
                                __FUNCTION__, size);
@@ -272,7 +272,7 @@ struct vm_struct * im_get_free_area(unsigned long size)
                        __FUNCTION__, addr, size);
        }
 next_im_done:
-       up(&imlist_sem);
+       mutex_unlock(&imlist_mutex);
        return area;
 }
 
@@ -281,9 +281,9 @@ struct vm_struct * im_get_area(unsigned long v_addr, unsigned long size,
 {
        struct vm_struct *area;
 
-       down(&imlist_sem);
+       mutex_lock(&imlist_mutex);
        area = __im_get_area(v_addr, size, criteria);
-       up(&imlist_sem);
+       mutex_unlock(&imlist_mutex);
        return area;
 }
 
@@ -297,17 +297,17 @@ void im_free(void * addr)
                printk(KERN_ERR "Trying to %s bad address (%p)\n", __FUNCTION__,                        addr);
                return;
        }
-       down(&imlist_sem);
+       mutex_lock(&imlist_mutex);
        for (p = &imlist ; (tmp = *p) ; p = &tmp->next) {
                if (tmp->addr == addr) {
                        *p = tmp->next;
                        unmap_vm_area(tmp);
                        kfree(tmp);
-                       up(&imlist_sem);
+                       mutex_unlock(&imlist_mutex);
                        return;
                }
        }
-       up(&imlist_sem);
+       mutex_unlock(&imlist_mutex);
        printk(KERN_ERR "Trying to %s nonexistent area (%p)\n", __FUNCTION__,
                        addr);
 }
index d75ae03df68679e9bd05d9d97c5ef00d0b18d174..a8fa1eeeb17443753177ff857369fbdd635df81a 100644 (file)
@@ -32,7 +32,7 @@
 
 #include <asm/io.h>
 #include <asm/prom.h>
-#include <asm/semaphore.h>
+#include <linux/mutex.h>
 #include <asm/spu.h>
 #include <asm/mmu_context.h>
 
@@ -342,7 +342,7 @@ spu_free_irqs(struct spu *spu)
 }
 
 static LIST_HEAD(spu_list);
-static DECLARE_MUTEX(spu_mutex);
+static DEFINE_MUTEX(spu_mutex);
 
 static void spu_init_channels(struct spu *spu)
 {
@@ -382,7 +382,7 @@ struct spu *spu_alloc(void)
 {
        struct spu *spu;
 
-       down(&spu_mutex);
+       mutex_lock(&spu_mutex);
        if (!list_empty(&spu_list)) {
                spu = list_entry(spu_list.next, struct spu, list);
                list_del_init(&spu->list);
@@ -391,7 +391,7 @@ struct spu *spu_alloc(void)
                pr_debug("No SPU left\n");
                spu = NULL;
        }
-       up(&spu_mutex);
+       mutex_unlock(&spu_mutex);
 
        if (spu)
                spu_init_channels(spu);
@@ -402,9 +402,9 @@ EXPORT_SYMBOL_GPL(spu_alloc);
 
 void spu_free(struct spu *spu)
 {
-       down(&spu_mutex);
+       mutex_lock(&spu_mutex);
        list_add_tail(&spu->list, &spu_list);
-       up(&spu_mutex);
+       mutex_unlock(&spu_mutex);
 }
 EXPORT_SYMBOL_GPL(spu_free);
 
@@ -633,14 +633,14 @@ static int __init create_spu(struct device_node *spe)
        spu->wbox_callback = NULL;
        spu->stop_callback = NULL;
 
-       down(&spu_mutex);
+       mutex_lock(&spu_mutex);
        spu->number = number++;
        ret = spu_request_irqs(spu);
        if (ret)
                goto out_unmap;
 
        list_add(&spu->list, &spu_list);
-       up(&spu_mutex);
+       mutex_unlock(&spu_mutex);
 
        pr_debug(KERN_DEBUG "Using SPE %s %02x %p %p %p %p %d\n",
                spu->name, spu->isrc, spu->local_store,
@@ -648,7 +648,7 @@ static int __init create_spu(struct device_node *spe)
        goto out;
 
 out_unmap:
-       up(&spu_mutex);
+       mutex_unlock(&spu_mutex);
        spu_unmap(spu);
 out_free:
        kfree(spu);
@@ -668,10 +668,10 @@ static void destroy_spu(struct spu *spu)
 static void cleanup_spu_base(void)
 {
        struct spu *spu, *tmp;
-       down(&spu_mutex);
+       mutex_lock(&spu_mutex);
        list_for_each_entry_safe(spu, tmp, &spu_list, list)
                destroy_spu(spu);
-       up(&spu_mutex);
+       mutex_unlock(&spu_mutex);
 }
 module_exit(cleanup_spu_base);
 
index a415e8d2f7aff2e6fb0c0e71d8d28a685a3d64b5..b57e465a1b71d3ceb3409f6efd84a233c0c871e5 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/cpufreq.h>
 #include <linux/init.h>
 #include <linux/completion.h>
+#include <linux/mutex.h>
 #include <asm/prom.h>
 #include <asm/machdep.h>
 #include <asm/irq.h>
@@ -90,7 +91,7 @@ static void (*g5_switch_volt)(int speed_mode);
 static int (*g5_switch_freq)(int speed_mode);
 static int (*g5_query_freq)(void);
 
-static DECLARE_MUTEX(g5_switch_mutex);
+static DEFINE_MUTEX(g5_switch_mutex);
 
 
 static struct smu_sdbp_fvt *g5_fvt_table;      /* table of op. points */
@@ -327,7 +328,7 @@ static int g5_cpufreq_target(struct cpufreq_policy *policy,
        if (g5_pmode_cur == newstate)
                return 0;
 
-       down(&g5_switch_mutex);
+       mutex_lock(&g5_switch_mutex);
 
        freqs.old = g5_cpu_freqs[g5_pmode_cur].frequency;
        freqs.new = g5_cpu_freqs[newstate].frequency;
@@ -337,7 +338,7 @@ static int g5_cpufreq_target(struct cpufreq_policy *policy,
        rc = g5_switch_freq(newstate);
        cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
 
-       up(&g5_switch_mutex);
+       mutex_unlock(&g5_switch_mutex);
 
        return rc;
 }
index 54a0a9bb12ddd1d6dfbbd790dce465e2226d162d..3a3e302b4ea247c15ae53e3bd4bdb2f1e3b1f69b 100644 (file)
@@ -19,6 +19,10 @@ config RWSEM_XCHGADD_ALGORITHM
        bool
        default y
 
+config GENERIC_HWEIGHT
+       bool
+       default y
+
 config GENERIC_CALIBRATE_DELAY
        bool
        default y
index 2b7364ed23bc5115924a70edc1aa9d46d4da8e6c..01c5c082f9705e43c7705857fe5171bd4bb7c528 100644 (file)
@@ -14,6 +14,10 @@ config RWSEM_XCHGADD_ALGORITHM
        bool
        default y
 
+config GENERIC_HWEIGHT
+       bool
+       default y
+
 config GENERIC_CALIBRATE_DELAY
        bool
        default y
index def02bdc44a475a9bc9813c20d1d916ee363e1df..54fb11d7fadd1dbbdc8120c9903eff3fc1a58c7e 100644 (file)
@@ -55,7 +55,7 @@ static void query_available_functions(void)
        printk(KERN_INFO "KMC_AES_256: %d\n",
                crypt_s390_func_available(KMC_AES_256_ENCRYPT));
 
-       /* query available KIMD fucntions */
+       /* query available KIMD functions */
        printk(KERN_INFO "KIMD_QUERY: %d\n",
                crypt_s390_func_available(KIMD_QUERY));
        printk(KERN_INFO "KIMD_SHA_1: %d\n",
index cc058dc3bc8b96ad06ecd63c24c978a35a28eb7a..5e14de37c17b0c26fa2b6ef7d0127a7890c3ea2b 100644 (file)
@@ -26,7 +26,6 @@
 #include <linux/resource.h>
 #include <linux/times.h>
 #include <linux/utsname.h>
-#include <linux/timex.h>
 #include <linux/smp.h>
 #include <linux/smp_lock.h>
 #include <linux/sem.h>
@@ -705,79 +704,6 @@ asmlinkage long sys32_sendfile64(int out_fd, int in_fd,
        return ret;
 }
 
-/* Handle adjtimex compatibility. */
-
-struct timex32 {
-       u32 modes;
-       s32 offset, freq, maxerror, esterror;
-       s32 status, constant, precision, tolerance;
-       struct compat_timeval time;
-       s32 tick;
-       s32 ppsfreq, jitter, shift, stabil;
-       s32 jitcnt, calcnt, errcnt, stbcnt;
-       s32  :32; s32  :32; s32  :32; s32  :32;
-       s32  :32; s32  :32; s32  :32; s32  :32;
-       s32  :32; s32  :32; s32  :32; s32  :32;
-};
-
-extern int do_adjtimex(struct timex *);
-
-asmlinkage long sys32_adjtimex(struct timex32 __user *utp)
-{
-       struct timex txc;
-       int ret;
-
-       memset(&txc, 0, sizeof(struct timex));
-
-       if(get_user(txc.modes, &utp->modes) ||
-          __get_user(txc.offset, &utp->offset) ||
-          __get_user(txc.freq, &utp->freq) ||
-          __get_user(txc.maxerror, &utp->maxerror) ||
-          __get_user(txc.esterror, &utp->esterror) ||
-          __get_user(txc.status, &utp->status) ||
-          __get_user(txc.constant, &utp->constant) ||
-          __get_user(txc.precision, &utp->precision) ||
-          __get_user(txc.tolerance, &utp->tolerance) ||
-          __get_user(txc.time.tv_sec, &utp->time.tv_sec) ||
-          __get_user(txc.time.tv_usec, &utp->time.tv_usec) ||
-          __get_user(txc.tick, &utp->tick) ||
-          __get_user(txc.ppsfreq, &utp->ppsfreq) ||
-          __get_user(txc.jitter, &utp->jitter) ||
-          __get_user(txc.shift, &utp->shift) ||
-          __get_user(txc.stabil, &utp->stabil) ||
-          __get_user(txc.jitcnt, &utp->jitcnt) ||
-          __get_user(txc.calcnt, &utp->calcnt) ||
-          __get_user(txc.errcnt, &utp->errcnt) ||
-          __get_user(txc.stbcnt, &utp->stbcnt))
-               return -EFAULT;
-
-       ret = do_adjtimex(&txc);
-
-       if(put_user(txc.modes, &utp->modes) ||
-          __put_user(txc.offset, &utp->offset) ||
-          __put_user(txc.freq, &utp->freq) ||
-          __put_user(txc.maxerror, &utp->maxerror) ||
-          __put_user(txc.esterror, &utp->esterror) ||
-          __put_user(txc.status, &utp->status) ||
-          __put_user(txc.constant, &utp->constant) ||
-          __put_user(txc.precision, &utp->precision) ||
-          __put_user(txc.tolerance, &utp->tolerance) ||
-          __put_user(txc.time.tv_sec, &utp->time.tv_sec) ||
-          __put_user(txc.time.tv_usec, &utp->time.tv_usec) ||
-          __put_user(txc.tick, &utp->tick) ||
-          __put_user(txc.ppsfreq, &utp->ppsfreq) ||
-          __put_user(txc.jitter, &utp->jitter) ||
-          __put_user(txc.shift, &utp->shift) ||
-          __put_user(txc.stabil, &utp->stabil) ||
-          __put_user(txc.jitcnt, &utp->jitcnt) ||
-          __put_user(txc.calcnt, &utp->calcnt) ||
-          __put_user(txc.errcnt, &utp->errcnt) ||
-          __put_user(txc.stbcnt, &utp->stbcnt))
-               ret = -EFAULT;
-
-       return ret;
-}
-
 #ifdef CONFIG_SYSCTL
 struct __sysctl_args32 {
        u32 name;
index 50e80138e7adeeaabb34aef7d879bbb69139a1e8..199da68bd7be3ac9092270361ab223598ac10a60 100644 (file)
@@ -551,10 +551,10 @@ sys32_newuname_wrapper:
        llgtr   %r2,%r2                 # struct new_utsname *
        jg      s390x_newuname          # branch to system call
 
-       .globl  sys32_adjtimex_wrapper 
-sys32_adjtimex_wrapper:
-       llgtr   %r2,%r2                 # struct timex_emu31 *
-       jg      sys32_adjtimex          # branch to system call
+       .globl  compat_sys_adjtimex_wrapper
+compat_sys_adjtimex_wrapper:
+       llgtr   %r2,%r2                 # struct compat_timex *
+       jg      compat_sys_adjtimex     # branch to system call
 
        .globl  sys32_mprotect_wrapper 
 sys32_mprotect_wrapper:
index 7c88d85c3597bfaad8d70c4f69f7b1543a479637..2f56654da82153143f9e22b42e92393ac9d77b01 100644 (file)
@@ -132,7 +132,7 @@ SYSCALL(sys_clone_glue,sys_clone_glue,sys32_clone_glue)             /* 120 */
 SYSCALL(sys_setdomainname,sys_setdomainname,sys32_setdomainname_wrapper)
 SYSCALL(sys_newuname,s390x_newuname,sys32_newuname_wrapper)
 NI_SYSCALL                                                     /* modify_ldt for i386 */
-SYSCALL(sys_adjtimex,sys_adjtimex,sys32_adjtimex_wrapper)
+SYSCALL(sys_adjtimex,sys_adjtimex,compat_sys_adjtimex_wrapper)
 SYSCALL(sys_mprotect,sys_mprotect,sys32_mprotect_wrapper)      /* 125 */
 SYSCALL(sys_sigprocmask,sys_sigprocmask,compat_sys_sigprocmask_wrapper)
 NI_SYSCALL                                                     /* old "create module" */
index e9b275d90737ba9601152adc91ac37693818d00f..58583f4594719ddcd5da635bec148858ef5807fc 100644 (file)
@@ -21,6 +21,14 @@ config RWSEM_GENERIC_SPINLOCK
 config RWSEM_XCHGADD_ALGORITHM
        bool
 
+config GENERIC_FIND_NEXT_BIT
+       bool
+       default y
+
+config GENERIC_HWEIGHT
+       bool
+       default y
+
 config GENERIC_HARDIRQS
        bool
        default y
index 07b172deb872b46478d5d44df926efcddf2acc98..58c678e0666786709a6da152d24fa3d9df158dfd 100644 (file)
@@ -21,6 +21,14 @@ config RWSEM_GENERIC_SPINLOCK
        bool
        default y
 
+config GENERIC_FIND_NEXT_BIT
+       bool
+       default y
+
+config GENERIC_HWEIGHT
+       bool
+       default y
+
 config GENERIC_CALIBRATE_DELAY
        bool
        default y
index 7c58fc1a39c46ae6f7bab2aeb57ffafcf495b12d..9431e967aa455000e218dddc99681518418cebe8 100644 (file)
@@ -150,6 +150,14 @@ config RWSEM_GENERIC_SPINLOCK
 config RWSEM_XCHGADD_ALGORITHM
        bool
 
+config GENERIC_FIND_NEXT_BIT
+       bool
+       default y
+
+config GENERIC_HWEIGHT
+       bool
+       default y
+
 config GENERIC_CALIBRATE_DELAY
        bool
        default y
index 267afddf63cfaaef0db000a0f0bc5426fa75f6b1..d1e2fc56648629a5801f4b4e75ce30a882fdb61e 100644 (file)
@@ -162,6 +162,14 @@ config RWSEM_XCHGADD_ALGORITHM
        bool
        default y
 
+config GENERIC_FIND_NEXT_BIT
+       bool
+       default y
+
+config GENERIC_HWEIGHT
+       bool
+       default y if !ULTRA_HAS_POPULATION_COUNT
+
 config GENERIC_CALIBRATE_DELAY
        bool
        default y
index b9a9ce70e55c1f281ff4759b47abc6d03e10ae49..ffc7309e9f22d51e640f77b95aab4028e57c841f 100644 (file)
@@ -6,9 +6,11 @@
 #include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/kprobes.h>
+#include <linux/module.h>
 #include <asm/kdebug.h>
 #include <asm/signal.h>
 #include <asm/cacheflush.h>
+#include <asm/uaccess.h>
 
 /* We do not have hardware single-stepping on sparc64.
  * So we implement software single-stepping with breakpoint
@@ -302,16 +304,68 @@ static inline int kprobe_fault_handler(struct pt_regs *regs, int trapnr)
 {
        struct kprobe *cur = kprobe_running();
        struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
+       const struct exception_table_entry *entry;
+
+       switch(kcb->kprobe_status) {
+       case KPROBE_HIT_SS:
+       case KPROBE_REENTER:
+               /*
+                * We are here because the instruction being single
+                * stepped caused a page fault. We reset the current
+                * kprobe and the tpc points back to the probe address
+                * and allow the page fault handler to continue as a
+                * normal page fault.
+                */
+               regs->tpc = (unsigned long)cur->addr;
+               regs->tnpc = kcb->kprobe_orig_tnpc;
+               regs->tstate = ((regs->tstate & ~TSTATE_PIL) |
+                               kcb->kprobe_orig_tstate_pil);
+               if (kcb->kprobe_status == KPROBE_REENTER)
+                       restore_previous_kprobe(kcb);
+               else
+                       reset_current_kprobe();
+               preempt_enable_no_resched();
+               break;
+       case KPROBE_HIT_ACTIVE:
+       case KPROBE_HIT_SSDONE:
+               /*
+                * We increment the nmissed count for accounting,
+                * we can also use npre/npostfault count for accouting
+                * these specific fault cases.
+                */
+               kprobes_inc_nmissed_count(cur);
+
+               /*
+                * We come here because instructions in the pre/post
+                * handler caused the page_fault, this could happen
+                * if handler tries to access user space by
+                * copy_from_user(), get_user() etc. Let the
+                * user-specified handler try to fix it first.
+                */
+               if (cur->fault_handler && cur->fault_handler(cur, regs, trapnr))
+                       return 1;
 
-       if (cur->fault_handler && cur->fault_handler(cur, regs, trapnr))
-               return 1;
+               /*
+                * In case the user-specified fault handler returned
+                * zero, try to fix up.
+                */
 
-       if (kcb->kprobe_status & KPROBE_HIT_SS) {
-               resume_execution(cur, regs, kcb);
+               entry = search_exception_tables(regs->tpc);
+               if (entry) {
+                       regs->tpc = entry->fixup;
+                       regs->tnpc = regs->tpc + 4;
+                       return 1;
+               }
 
-               reset_current_kprobe();
-               preempt_enable_no_resched();
+               /*
+                * fixup_exception() could not handle it,
+                * Let do_page_fault() fix it.
+                */
+               break;
+       default:
+               break;
        }
+
        return 0;
 }
 
@@ -324,6 +378,9 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self,
        struct die_args *args = (struct die_args *)data;
        int ret = NOTIFY_DONE;
 
+       if (args->regs && user_mode(args->regs))
+               return ret;
+
        switch (val) {
        case DIE_DEBUG:
                if (kprobe_handler(args->regs))
index 9914a17651b4fee5ea07b54477cb39d8b618b5d6..c7fbbcfce8241d0eaecd8224a025288ffbba614a 100644 (file)
@@ -175,11 +175,6 @@ EXPORT_SYMBOL(set_bit);
 EXPORT_SYMBOL(clear_bit);
 EXPORT_SYMBOL(change_bit);
 
-/* Bit searching */
-EXPORT_SYMBOL(find_next_bit);
-EXPORT_SYMBOL(find_next_zero_bit);
-EXPORT_SYMBOL(find_next_zero_le_bit);
-
 EXPORT_SYMBOL(ivector_table);
 EXPORT_SYMBOL(enable_irq);
 EXPORT_SYMBOL(disable_irq);
index 0e41df024489d3b981f726193a3ebbf50a807868..2e906bad56faac67154d10be40de2d74782fe79f 100644 (file)
@@ -19,7 +19,6 @@
 #include <linux/resource.h>
 #include <linux/times.h>
 #include <linux/utsname.h>
-#include <linux/timex.h>
 #include <linux/smp.h>
 #include <linux/smp_lock.h>
 #include <linux/sem.h>
@@ -945,79 +944,6 @@ asmlinkage long compat_sys_sendfile64(int out_fd, int in_fd,
        return ret;
 }
 
-/* Handle adjtimex compatibility. */
-
-struct timex32 {
-       u32 modes;
-       s32 offset, freq, maxerror, esterror;
-       s32 status, constant, precision, tolerance;
-       struct compat_timeval time;
-       s32 tick;
-       s32 ppsfreq, jitter, shift, stabil;
-       s32 jitcnt, calcnt, errcnt, stbcnt;
-       s32  :32; s32  :32; s32  :32; s32  :32;
-       s32  :32; s32  :32; s32  :32; s32  :32;
-       s32  :32; s32  :32; s32  :32; s32  :32;
-};
-
-extern int do_adjtimex(struct timex *);
-
-asmlinkage long sys32_adjtimex(struct timex32 __user *utp)
-{
-       struct timex txc;
-       int ret;
-
-       memset(&txc, 0, sizeof(struct timex));
-
-       if (get_user(txc.modes, &utp->modes) ||
-           __get_user(txc.offset, &utp->offset) ||
-           __get_user(txc.freq, &utp->freq) ||
-           __get_user(txc.maxerror, &utp->maxerror) ||
-           __get_user(txc.esterror, &utp->esterror) ||
-           __get_user(txc.status, &utp->status) ||
-           __get_user(txc.constant, &utp->constant) ||
-           __get_user(txc.precision, &utp->precision) ||
-           __get_user(txc.tolerance, &utp->tolerance) ||
-           __get_user(txc.time.tv_sec, &utp->time.tv_sec) ||
-           __get_user(txc.time.tv_usec, &utp->time.tv_usec) ||
-           __get_user(txc.tick, &utp->tick) ||
-           __get_user(txc.ppsfreq, &utp->ppsfreq) ||
-           __get_user(txc.jitter, &utp->jitter) ||
-           __get_user(txc.shift, &utp->shift) ||
-           __get_user(txc.stabil, &utp->stabil) ||
-           __get_user(txc.jitcnt, &utp->jitcnt) ||
-           __get_user(txc.calcnt, &utp->calcnt) ||
-           __get_user(txc.errcnt, &utp->errcnt) ||
-           __get_user(txc.stbcnt, &utp->stbcnt))
-               return -EFAULT;
-
-       ret = do_adjtimex(&txc);
-
-       if (put_user(txc.modes, &utp->modes) ||
-           __put_user(txc.offset, &utp->offset) ||
-           __put_user(txc.freq, &utp->freq) ||
-           __put_user(txc.maxerror, &utp->maxerror) ||
-           __put_user(txc.esterror, &utp->esterror) ||
-           __put_user(txc.status, &utp->status) ||
-           __put_user(txc.constant, &utp->constant) ||
-           __put_user(txc.precision, &utp->precision) ||
-           __put_user(txc.tolerance, &utp->tolerance) ||
-           __put_user(txc.time.tv_sec, &utp->time.tv_sec) ||
-           __put_user(txc.time.tv_usec, &utp->time.tv_usec) ||
-           __put_user(txc.tick, &utp->tick) ||
-           __put_user(txc.ppsfreq, &utp->ppsfreq) ||
-           __put_user(txc.jitter, &utp->jitter) ||
-           __put_user(txc.shift, &utp->shift) ||
-           __put_user(txc.stabil, &utp->stabil) ||
-           __put_user(txc.jitcnt, &utp->jitcnt) ||
-           __put_user(txc.calcnt, &utp->calcnt) ||
-           __put_user(txc.errcnt, &utp->errcnt) ||
-           __put_user(txc.stbcnt, &utp->stbcnt))
-               ret = -EFAULT;
-
-       return ret;
-}
-
 /* This is just a version for 32-bit applications which does
  * not force O_LARGEFILE on.
  */
index c3adb7ac167d1b84c8bfd13cb412a98804d90951..3b250f2318fdaaee2c1fbfdf1e3237f26e9cfac8 100644 (file)
@@ -63,7 +63,7 @@ sys_call_table32:
 /*200*/        .word sys32_ssetmask, sys_sigsuspend, compat_sys_newlstat, sys_uselib, compat_sys_old_readdir
        .word sys32_readahead, sys32_socketcall, sys32_syslog, sys32_lookup_dcookie, sys32_fadvise64
 /*210*/        .word sys32_fadvise64_64, sys32_tgkill, sys32_waitpid, sys_swapoff, sys32_sysinfo
-       .word sys32_ipc, sys32_sigreturn, sys_clone, sys32_ioprio_get, sys32_adjtimex
+       .word sys32_ipc, sys32_sigreturn, sys_clone, sys32_ioprio_get, compat_sys_adjtimex
 /*220*/        .word sys32_sigprocmask, sys_ni_syscall, sys32_delete_module, sys_ni_syscall, sys32_getpgid
        .word sys32_bdflush, sys32_sysfs, sys_nis_syscall, sys32_setfsuid16, sys32_setfsgid16
 /*230*/        .word sys32_select, compat_sys_time, sys_nis_syscall, compat_sys_stime, compat_sys_statfs64
index 8812ded19f01bda18efff8c28085180c324bf3b9..4a725d8985f1b384f6cbeb56d36f595966d47edb 100644 (file)
@@ -14,6 +14,6 @@ lib-y := PeeCeeI.o copy_page.o clear_page.o strlen.o strncmp.o \
         NGmemcpy.o NGcopy_from_user.o NGcopy_to_user.o NGpatch.o \
         NGpage.o NGbzero.o \
         copy_in_user.o user_fixup.o memmove.o \
-        mcount.o ipcsum.o rwsem.o xor.o find_bit.o delay.o
+        mcount.o ipcsum.o rwsem.o xor.o delay.o
 
 obj-y += iomap.o
diff --git a/arch/sparc64/lib/find_bit.c b/arch/sparc64/lib/find_bit.c
deleted file mode 100644 (file)
index 6059557..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-#include <linux/bitops.h>
-
-/**
- * find_next_bit - find the next set bit in a memory region
- * @addr: The address to base the search on
- * @offset: The bitnumber to start searching at
- * @size: The maximum size to search
- */
-unsigned long find_next_bit(const unsigned long *addr, unsigned long size,
-                               unsigned long offset)
-{
-       const unsigned long *p = addr + (offset >> 6);
-       unsigned long result = offset & ~63UL;
-       unsigned long tmp;
-
-       if (offset >= size)
-               return size;
-       size -= result;
-       offset &= 63UL;
-       if (offset) {
-               tmp = *(p++);
-               tmp &= (~0UL << offset);
-               if (size < 64)
-                       goto found_first;
-               if (tmp)
-                       goto found_middle;
-               size -= 64;
-               result += 64;
-       }
-       while (size & ~63UL) {
-               if ((tmp = *(p++)))
-                       goto found_middle;
-               result += 64;
-               size -= 64;
-       }
-       if (!size)
-               return result;
-       tmp = *p;
-
-found_first:
-       tmp &= (~0UL >> (64 - size));
-       if (tmp == 0UL)        /* Are any bits set? */
-               return result + size; /* Nope. */
-found_middle:
-       return result + __ffs(tmp);
-}
-
-/* find_next_zero_bit() finds the first zero bit in a bit string of length
- * 'size' bits, starting the search at bit 'offset'. This is largely based
- * on Linus's ALPHA routines, which are pretty portable BTW.
- */
-
-unsigned long find_next_zero_bit(const unsigned long *addr,
-                       unsigned long size, unsigned long offset)
-{
-       const unsigned long *p = addr + (offset >> 6);
-       unsigned long result = offset & ~63UL;
-       unsigned long tmp;
-
-       if (offset >= size)
-               return size;
-       size -= result;
-       offset &= 63UL;
-       if (offset) {
-               tmp = *(p++);
-               tmp |= ~0UL >> (64-offset);
-               if (size < 64)
-                       goto found_first;
-               if (~tmp)
-                       goto found_middle;
-               size -= 64;
-               result += 64;
-       }
-       while (size & ~63UL) {
-               if (~(tmp = *(p++)))
-                       goto found_middle;
-               result += 64;
-               size -= 64;
-       }
-       if (!size)
-               return result;
-       tmp = *p;
-
-found_first:
-       tmp |= ~0UL << size;
-       if (tmp == ~0UL)        /* Are any bits zero? */
-               return result + size; /* Nope. */
-found_middle:
-       return result + ffz(tmp);
-}
-
-unsigned long find_next_zero_le_bit(unsigned long *addr, unsigned long size, unsigned long offset)
-{
-       unsigned long *p = addr + (offset >> 6);
-       unsigned long result = offset & ~63UL;
-       unsigned long tmp;
-
-       if (offset >= size)
-               return size;
-       size -= result;
-       offset &= 63UL;
-       if(offset) {
-               tmp = __swab64p(p++);
-               tmp |= (~0UL >> (64-offset));
-               if(size < 64)
-                       goto found_first;
-               if(~tmp)
-                       goto found_middle;
-               size -= 64;
-               result += 64;
-       }
-       while(size & ~63) {
-               if(~(tmp = __swab64p(p++)))
-                       goto found_middle;
-               result += 64;
-               size -= 64;
-       }
-       if(!size)
-               return result;
-       tmp = __swab64p(p);
-found_first:
-       tmp |= (~0UL << size);
-       if (tmp == ~0UL)        /* Are any bits zero? */
-               return result + size; /* Nope. */
-found_middle:
-       return result + ffz(tmp);
-}
index ef79ed25aecd5fd64125a7777990e14d4e4846f0..85e6a55b3b59d6741c069378d31091c7de02ec55 100644 (file)
@@ -52,3 +52,8 @@ config ARCH_HAS_SC_SIGNALS
 config ARCH_REUSE_HOST_VSYSCALL_AREA
        bool
        default y
+
+config GENERIC_HWEIGHT
+       bool
+       default y
+
index aae19bc4b06a7055e4f3742af315f2064f0575db..f60e9e506424cf91e6b97ff61105a7dfc4b4788d 100644 (file)
@@ -46,3 +46,8 @@ config ARCH_REUSE_HOST_VSYSCALL_AREA
 config SMP_BROKEN
        bool
        default y
+
+config GENERIC_HWEIGHT
+       bool
+       default y
+
index e7fc3e500342edc9384b458e8b7d89e156a194d1..37ec644603ab886eb3221f7606488ce760dceb85 100644 (file)
@@ -16,6 +16,12 @@ config RWSEM_GENERIC_SPINLOCK
 config RWSEM_XCHGADD_ALGORITHM
        bool
        default n
+config GENERIC_FIND_NEXT_BIT
+       bool
+       default y
+config GENERIC_HWEIGHT
+       bool
+       default y
 config GENERIC_CALIBRATE_DELAY
        bool
        default y
index 6420baeb8c1fec7d3d0def187c56b14f01d7e1d3..45efe0ca88f81290227f0ab2262451664be92225 100644 (file)
@@ -45,6 +45,10 @@ config RWSEM_GENERIC_SPINLOCK
 config RWSEM_XCHGADD_ALGORITHM
        bool
 
+config GENERIC_HWEIGHT
+       bool
+       default y
+
 config GENERIC_CALIBRATE_DELAY
        bool
        default y
index 0fbc0283609c8c05011d8fd8108826135a0c8a73..585fd4a559c8792e20150c25339eb8d58aaea9db 100644 (file)
@@ -70,7 +70,7 @@ drivers-$(CONFIG_OPROFILE)            += arch/x86_64/oprofile/
 boot := arch/x86_64/boot
 
 PHONY += bzImage bzlilo install archmrproper \
-        fdimage fdimage144 fdimage288 archclean
+        fdimage fdimage144 fdimage288 isoimage archclean
 
 #Default target when executing "make"
 all: bzImage
@@ -87,7 +87,7 @@ bzlilo: vmlinux
 bzdisk: vmlinux
        $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) zdisk
 
-fdimage fdimage144 fdimage288: vmlinux
+fdimage fdimage144 fdimage288 isoimage: vmlinux
        $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) $@
 
 install:
@@ -99,11 +99,16 @@ archclean:
 define archhelp
   echo  '* bzImage     - Compressed kernel image (arch/$(ARCH)/boot/bzImage)'
   echo  '  install     - Install kernel using'
-  echo  '                  (your) ~/bin/installkernel or'
-  echo  '                  (distribution) /sbin/installkernel or'
-  echo  '                install to $$(INSTALL_PATH) and run lilo'
+  echo  '                 (your) ~/bin/installkernel or'
+  echo  '                 (distribution) /sbin/installkernel or'
+  echo  '                 install to $$(INSTALL_PATH) and run lilo'
+  echo  '  bzdisk       - Create a boot floppy in /dev/fd0'
+  echo  '  fdimage      - Create a boot floppy image'
+  echo  '  isoimage     - Create a boot CD-ROM image'
 endef
 
-CLEAN_FILES += arch/$(ARCH)/boot/fdimage arch/$(ARCH)/boot/mtools.conf
+CLEAN_FILES += arch/$(ARCH)/boot/fdimage \
+              arch/$(ARCH)/boot/image.iso \
+              arch/$(ARCH)/boot/mtools.conf
 
 
index 29f8396ed151c9d0dc12725dc19d4fc729971f2c..43ee6c50c2778ed4c55cf9ecb4afa0046802b3f8 100644 (file)
@@ -60,8 +60,12 @@ $(obj)/setup $(obj)/bootsect: %: %.o FORCE
 $(obj)/compressed/vmlinux: FORCE
        $(Q)$(MAKE) $(build)=$(obj)/compressed IMAGE_OFFSET=$(IMAGE_OFFSET) $@
 
-# Set this if you want to pass append arguments to the zdisk/fdimage kernel
+# Set this if you want to pass append arguments to the zdisk/fdimage/isoimage kernel
 FDARGS = 
+# Set this if you want an initrd included with the zdisk/fdimage/isoimage kernel
+FDINITRD =
+
+image_cmdline = default linux $(FDARGS) $(if $(FDINITRD),initrd=initrd.img,)
 
 $(obj)/mtools.conf: $(src)/mtools.conf.in
        sed -e 's|@OBJ@|$(obj)|g' < $< > $@
@@ -70,8 +74,11 @@ $(obj)/mtools.conf: $(src)/mtools.conf.in
 zdisk: $(BOOTIMAGE) $(obj)/mtools.conf
        MTOOLSRC=$(obj)/mtools.conf mformat a:                  ; sync
        syslinux /dev/fd0                                       ; sync
-       echo 'default linux $(FDARGS)' | \
+       echo '$(image_cmdline)' | \
                MTOOLSRC=$(obj)/mtools.conf mcopy - a:syslinux.cfg
+       if [ -f '$(FDINITRD)' ] ; then \
+               MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' a:initrd.img ; \
+       fi
        MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) a:linux  ; sync
 
 # These require being root or having syslinux 2.02 or higher installed
@@ -79,18 +86,39 @@ fdimage fdimage144: $(BOOTIMAGE) $(obj)/mtools.conf
        dd if=/dev/zero of=$(obj)/fdimage bs=1024 count=1440
        MTOOLSRC=$(obj)/mtools.conf mformat v:                  ; sync
        syslinux $(obj)/fdimage                                 ; sync
-       echo 'default linux $(FDARGS)' | \
+       echo '$(image_cmdline)' | \
                MTOOLSRC=$(obj)/mtools.conf mcopy - v:syslinux.cfg
+       if [ -f '$(FDINITRD)' ] ; then \
+               MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' v:initrd.img ; \
+       fi
        MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) v:linux  ; sync
 
 fdimage288: $(BOOTIMAGE) $(obj)/mtools.conf
        dd if=/dev/zero of=$(obj)/fdimage bs=1024 count=2880
        MTOOLSRC=$(obj)/mtools.conf mformat w:                  ; sync
        syslinux $(obj)/fdimage                                 ; sync
-       echo 'default linux $(FDARGS)' | \
+       echo '$(image_cmdline)' | \
                MTOOLSRC=$(obj)/mtools.conf mcopy - w:syslinux.cfg
+       if [ -f '$(FDINITRD)' ] ; then \
+               MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' w:initrd.img ; \
+       fi
        MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) w:linux  ; sync
 
+isoimage: $(BOOTIMAGE)
+       -rm -rf $(obj)/isoimage
+       mkdir $(obj)/isoimage
+       cp `echo /usr/lib*/syslinux/isolinux.bin | awk '{ print $1; }'` \
+               $(obj)/isoimage
+       cp $(BOOTIMAGE) $(obj)/isoimage/linux
+       echo '$(image_cmdline)' > $(obj)/isoimage/isolinux.cfg
+       if [ -f '$(FDINITRD)' ] ; then \
+               cp '$(FDINITRD)' $(obj)/isoimage/initrd.img ; \
+       fi
+       mkisofs -J -r -o $(obj)/image.iso -b isolinux.bin -c boot.cat \
+               -no-emul-boot -boot-load-size 4 -boot-info-table \
+               $(obj)/isoimage
+       rm -rf $(obj)/isoimage
+
 zlilo: $(BOOTIMAGE)
        if [ -f $(INSTALL_PATH)/vmlinuz ]; then mv $(INSTALL_PATH)/vmlinuz $(INSTALL_PATH)/vmlinuz.old; fi
        if [ -f $(INSTALL_PATH)/System.map ]; then mv $(INSTALL_PATH)/System.map $(INSTALL_PATH)/System.old; fi
index 00dee176c08ef6cab15397fda3f0ebcf8819c549..7549a4389fbfbfb761188fe271a7e780ed0042f3 100644 (file)
@@ -501,7 +501,7 @@ ia32_sys_call_table:
        .quad sys_setdomainname
        .quad sys_uname
        .quad sys_modify_ldt
-       .quad sys32_adjtimex
+       .quad compat_sys_adjtimex
        .quad sys32_mprotect            /* 125 */
        .quad compat_sys_sigprocmask
        .quad quiet_ni_syscall          /* create_module */
index 2b2d029f477ca4866caace5da4950fd5a17fa490..f182b20858e25e02adca0a93db6ce55c2f6afec1 100644 (file)
@@ -30,7 +30,6 @@
 #include <linux/resource.h>
 #include <linux/times.h>
 #include <linux/utsname.h>
-#include <linux/timex.h>
 #include <linux/smp.h>
 #include <linux/smp_lock.h>
 #include <linux/sem.h>
@@ -767,82 +766,6 @@ sys32_sendfile(int out_fd, int in_fd, compat_off_t __user *offset, s32 count)
        return ret;
 }
 
-/* Handle adjtimex compatibility. */
-
-struct timex32 {
-       u32 modes;
-       s32 offset, freq, maxerror, esterror;
-       s32 status, constant, precision, tolerance;
-       struct compat_timeval time;
-       s32 tick;
-       s32 ppsfreq, jitter, shift, stabil;
-       s32 jitcnt, calcnt, errcnt, stbcnt;
-       s32  :32; s32  :32; s32  :32; s32  :32;
-       s32  :32; s32  :32; s32  :32; s32  :32;
-       s32  :32; s32  :32; s32  :32; s32  :32;
-};
-
-extern int do_adjtimex(struct timex *);
-
-asmlinkage long
-sys32_adjtimex(struct timex32 __user *utp)
-{
-       struct timex txc;
-       int ret;
-
-       memset(&txc, 0, sizeof(struct timex));
-
-       if (!access_ok(VERIFY_READ, utp, sizeof(struct timex32)) ||
-          __get_user(txc.modes, &utp->modes) ||
-          __get_user(txc.offset, &utp->offset) ||
-          __get_user(txc.freq, &utp->freq) ||
-          __get_user(txc.maxerror, &utp->maxerror) ||
-          __get_user(txc.esterror, &utp->esterror) ||
-          __get_user(txc.status, &utp->status) ||
-          __get_user(txc.constant, &utp->constant) ||
-          __get_user(txc.precision, &utp->precision) ||
-          __get_user(txc.tolerance, &utp->tolerance) ||
-          __get_user(txc.time.tv_sec, &utp->time.tv_sec) ||
-          __get_user(txc.time.tv_usec, &utp->time.tv_usec) ||
-          __get_user(txc.tick, &utp->tick) ||
-          __get_user(txc.ppsfreq, &utp->ppsfreq) ||
-          __get_user(txc.jitter, &utp->jitter) ||
-          __get_user(txc.shift, &utp->shift) ||
-          __get_user(txc.stabil, &utp->stabil) ||
-          __get_user(txc.jitcnt, &utp->jitcnt) ||
-          __get_user(txc.calcnt, &utp->calcnt) ||
-          __get_user(txc.errcnt, &utp->errcnt) ||
-          __get_user(txc.stbcnt, &utp->stbcnt))
-               return -EFAULT;
-
-       ret = do_adjtimex(&txc);
-
-       if (!access_ok(VERIFY_WRITE, utp, sizeof(struct timex32)) ||
-          __put_user(txc.modes, &utp->modes) ||
-          __put_user(txc.offset, &utp->offset) ||
-          __put_user(txc.freq, &utp->freq) ||
-          __put_user(txc.maxerror, &utp->maxerror) ||
-          __put_user(txc.esterror, &utp->esterror) ||
-          __put_user(txc.status, &utp->status) ||
-          __put_user(txc.constant, &utp->constant) ||
-          __put_user(txc.precision, &utp->precision) ||
-          __put_user(txc.tolerance, &utp->tolerance) ||
-          __put_user(txc.time.tv_sec, &utp->time.tv_sec) ||
-          __put_user(txc.time.tv_usec, &utp->time.tv_usec) ||
-          __put_user(txc.tick, &utp->tick) ||
-          __put_user(txc.ppsfreq, &utp->ppsfreq) ||
-          __put_user(txc.jitter, &utp->jitter) ||
-          __put_user(txc.shift, &utp->shift) ||
-          __put_user(txc.stabil, &utp->stabil) ||
-          __put_user(txc.jitcnt, &utp->jitcnt) ||
-          __put_user(txc.calcnt, &utp->calcnt) ||
-          __put_user(txc.errcnt, &utp->errcnt) ||
-          __put_user(txc.stbcnt, &utp->stbcnt))
-               ret = -EFAULT;
-
-       return ret;
-}
-
 asmlinkage long sys32_mmap2(unsigned long addr, unsigned long len,
        unsigned long prot, unsigned long flags,
        unsigned long fd, unsigned long pgoff)
index 14f0ced613b683706f6d360c8ef835b2b9243d08..accbff3fec491826071ad572c19d0207413a1bca 100644 (file)
 #include <linux/string.h>
 #include <linux/slab.h>
 #include <linux/preempt.h>
+#include <linux/module.h>
 
 #include <asm/cacheflush.h>
 #include <asm/pgtable.h>
 #include <asm/kdebug.h>
+#include <asm/uaccess.h>
 
 void jprobe_return_end(void);
 static void __kprobes arch_copy_kprobe(struct kprobe *p);
@@ -578,16 +580,62 @@ int __kprobes kprobe_fault_handler(struct pt_regs *regs, int trapnr)
 {
        struct kprobe *cur = kprobe_running();
        struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
+       const struct exception_table_entry *fixup;
 
-       if (cur->fault_handler && cur->fault_handler(cur, regs, trapnr))
-               return 1;
-
-       if (kcb->kprobe_status & KPROBE_HIT_SS) {
-               resume_execution(cur, regs, kcb);
+       switch(kcb->kprobe_status) {
+       case KPROBE_HIT_SS:
+       case KPROBE_REENTER:
+               /*
+                * We are here because the instruction being single
+                * stepped caused a page fault. We reset the current
+                * kprobe and the rip points back to the probe address
+                * and allow the page fault handler to continue as a
+                * normal page fault.
+                */
+               regs->rip = (unsigned long)cur->addr;
                regs->eflags |= kcb->kprobe_old_rflags;
-
-               reset_current_kprobe();
+               if (kcb->kprobe_status == KPROBE_REENTER)
+                       restore_previous_kprobe(kcb);
+               else
+                       reset_current_kprobe();
                preempt_enable_no_resched();
+               break;
+       case KPROBE_HIT_ACTIVE:
+       case KPROBE_HIT_SSDONE:
+               /*
+                * We increment the nmissed count for accounting,
+                * we can also use npre/npostfault count for accouting
+                * these specific fault cases.
+                */
+               kprobes_inc_nmissed_count(cur);
+
+               /*
+                * We come here because instructions in the pre/post
+                * handler caused the page_fault, this could happen
+                * if handler tries to access user space by
+                * copy_from_user(), get_user() etc. Let the
+                * user-specified handler try to fix it first.
+                */
+               if (cur->fault_handler && cur->fault_handler(cur, regs, trapnr))
+                       return 1;
+
+               /*
+                * In case the user-specified fault handler returned
+                * zero, try to fix up.
+                */
+               fixup = search_exception_tables(regs->rip);
+               if (fixup) {
+                       regs->rip = fixup->fixup;
+                       return 1;
+               }
+
+               /*
+                * fixup() could not handle it,
+                * Let do_page_fault() fix it.
+                */
+               break;
+       default:
+               break;
        }
        return 0;
 }
@@ -601,6 +649,9 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self,
        struct die_args *args = (struct die_args *)data;
        int ret = NOTIFY_DONE;
 
+       if (args->regs && user_mode(args->regs))
+               return ret;
+
        switch (val) {
        case DIE_INT3:
                if (kprobe_handler(args->regs))
index 81111835722d84cf7e561d4ffd21a75f33f0a708..0370720515f17568a2fdee8ae057aef3c12ba584 100644 (file)
@@ -35,8 +35,8 @@
 #include <linux/ptrace.h>
 #include <linux/utsname.h>
 #include <linux/random.h>
-#include <linux/kprobes.h>
 #include <linux/notifier.h>
+#include <linux/kprobes.h>
 
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
@@ -353,13 +353,6 @@ void exit_thread(void)
        struct task_struct *me = current;
        struct thread_struct *t = &me->thread;
 
-       /*
-        * Remove function-return probe instances associated with this task
-        * and put them back on the free list. Do not insert an exit probe for
-        * this function, it will be disabled by kprobe_flush_task if you do.
-        */
-       kprobe_flush_task(me);
-
        if (me->thread.io_bitmap_ptr) { 
                struct tss_struct *tss = &per_cpu(init_tss, get_cpu());
 
index e90ef5db89138d258fdbce8cbc259cc55aeb7c1b..dbeb3504c3c80b8d3756217db17f4fa9157bcb99 100644 (file)
@@ -22,6 +22,14 @@ config RWSEM_XCHGADD_ALGORITHM
        bool
        default y
 
+config GENERIC_FIND_NEXT_BIT
+       bool
+       default y
+
+config GENERIC_HWEIGHT
+       bool
+       default y
+
 config GENERIC_HARDIRQS
        bool
        default y
index 96783645092dc106cd4f4b300958aeae5b684e2a..43ca070dc0f81b58ba2a2757bf907acce36b02bc 100644 (file)
@@ -23,4 +23,13 @@ config BLK_DEV_IO_TRACE
 
          git://brick.kernel.dk/data/git/blktrace.git
 
+config LSF
+       bool "Support for Large Single Files"
+       depends on X86 || (MIPS && 32BIT) || PPC32 || ARCH_S390_31 || SUPERH || UML
+       default n
+       help
+         When CONFIG_LBD is disabled, say Y here if you want to
+         handle large file(bigger than 2TB), otherwise say N.
+         When CONFIG_LBD is enabled, Y is set automatically.
+
 source block/Kconfig.iosched
index c4a0d5d8d7f0dd4080ae63c7897c8fcdde3b10d7..bde40a6ae66533c2b07f46e1eb8d4952fc0e96ed 100644 (file)
@@ -2191,7 +2191,7 @@ static int cfq_init_queue(request_queue_t *q, elevator_t *e)
        if (!cfqd->cfq_hash)
                goto out_cfqhash;
 
-       cfqd->crq_pool = mempool_create(BLKDEV_MIN_RQ, mempool_alloc_slab, mempool_free_slab, crq_pool);
+       cfqd->crq_pool = mempool_create_slab_pool(BLKDEV_MIN_RQ, crq_pool);
        if (!cfqd->crq_pool)
                goto out_crqpool;
 
index ac5bbaedac1ba7f15972881b1662081903ed2292..13b5fd5854a80bd9f92d1eb8e90764a3fe8f6d5a 100644 (file)
@@ -156,12 +156,10 @@ acpi_status acpi_os_get_root_pointer(u32 flags, struct acpi_pointer *addr)
 {
        if (efi_enabled) {
                addr->pointer_type = ACPI_PHYSICAL_POINTER;
-               if (efi.acpi20)
-                       addr->pointer.physical =
-                           (acpi_physical_address) virt_to_phys(efi.acpi20);
-               else if (efi.acpi)
-                       addr->pointer.physical =
-                           (acpi_physical_address) virt_to_phys(efi.acpi);
+               if (efi.acpi20 != EFI_INVALID_TABLE_ADDR)
+                       addr->pointer.physical = efi.acpi20;
+               else if (efi.acpi != EFI_INVALID_TABLE_ADDR)
+                       addr->pointer.physical = efi.acpi;
                else {
                        printk(KERN_ERR PREFIX
                               "System description tables not found\n");
@@ -182,22 +180,14 @@ acpi_status
 acpi_os_map_memory(acpi_physical_address phys, acpi_size size,
                   void __iomem ** virt)
 {
-       if (efi_enabled) {
-               if (EFI_MEMORY_WB & efi_mem_attributes(phys)) {
-                       *virt = (void __iomem *)phys_to_virt(phys);
-               } else {
-                       *virt = ioremap(phys, size);
-               }
-       } else {
-               if (phys > ULONG_MAX) {
-                       printk(KERN_ERR PREFIX "Cannot map memory that high\n");
-                       return AE_BAD_PARAMETER;
-               }
-               /*
-                * ioremap checks to ensure this is in reserved space
-                */
-               *virt = ioremap((unsigned long)phys, size);
+       if (phys > ULONG_MAX) {
+               printk(KERN_ERR PREFIX "Cannot map memory that high\n");
+               return AE_BAD_PARAMETER;
        }
+       /*
+        * ioremap checks to ensure this is in reserved space
+        */
+       *virt = ioremap((unsigned long)phys, size);
 
        if (!*virt)
                return AE_NO_MEMORY;
@@ -409,18 +399,8 @@ acpi_os_read_memory(acpi_physical_address phys_addr, u32 * value, u32 width)
 {
        u32 dummy;
        void __iomem *virt_addr;
-       int iomem = 0;
 
-       if (efi_enabled) {
-               if (EFI_MEMORY_WB & efi_mem_attributes(phys_addr)) {
-                       /* HACK ALERT! We can use readb/w/l on real memory too.. */
-                       virt_addr = (void __iomem *)phys_to_virt(phys_addr);
-               } else {
-                       iomem = 1;
-                       virt_addr = ioremap(phys_addr, width);
-               }
-       } else
-               virt_addr = (void __iomem *)phys_to_virt(phys_addr);
+       virt_addr = ioremap(phys_addr, width);
        if (!value)
                value = &dummy;
 
@@ -438,10 +418,7 @@ acpi_os_read_memory(acpi_physical_address phys_addr, u32 * value, u32 width)
                BUG();
        }
 
-       if (efi_enabled) {
-               if (iomem)
-                       iounmap(virt_addr);
-       }
+       iounmap(virt_addr);
 
        return AE_OK;
 }
@@ -450,18 +427,8 @@ acpi_status
 acpi_os_write_memory(acpi_physical_address phys_addr, u32 value, u32 width)
 {
        void __iomem *virt_addr;
-       int iomem = 0;
 
-       if (efi_enabled) {
-               if (EFI_MEMORY_WB & efi_mem_attributes(phys_addr)) {
-                       /* HACK ALERT! We can use writeb/w/l on real memory too */
-                       virt_addr = (void __iomem *)phys_to_virt(phys_addr);
-               } else {
-                       iomem = 1;
-                       virt_addr = ioremap(phys_addr, width);
-               }
-       } else
-               virt_addr = (void __iomem *)phys_to_virt(phys_addr);
+       virt_addr = ioremap(phys_addr, width);
 
        switch (width) {
        case 8:
@@ -477,8 +444,7 @@ acpi_os_write_memory(acpi_physical_address phys_addr, u32 value, u32 width)
                BUG();
        }
 
-       if (iomem)
-               iounmap(virt_addr);
+       iounmap(virt_addr);
 
        return AE_OK;
 }
index 99a3a28594daf333eb8c9355f2a886ed43f5f626..713b763884a95d61afd37e9dc79ed28be70fd6e3 100644 (file)
@@ -246,7 +246,7 @@ static int acpi_processor_errata(struct acpi_processor *pr)
 }
 
 /* --------------------------------------------------------------------------
-                              Common ACPI processor fucntions
+                              Common ACPI processor functions
    -------------------------------------------------------------------------- */
 
 /*
index 31d4f3ffc265b5b2d28055ea1eaec5b317c8f5d4..7f37c7cc5ef1e2aa836d4f5705b599a89156542a 100644 (file)
@@ -587,7 +587,8 @@ int __init acpi_table_init(void)
                return -ENODEV;
        }
 
-       rsdp = (struct acpi_table_rsdp *)__va(rsdp_phys);
+       rsdp = (struct acpi_table_rsdp *)__acpi_map_table(rsdp_phys,
+               sizeof(struct acpi_table_rsdp));
        if (!rsdp) {
                printk(KERN_WARNING PREFIX "Unable to map RSDP\n");
                return -ENODEV;
index e57ac5a432462bc2ef4c3323f329808ab0f107ca..875ae7699025add355935826cccb2d7dc2266900 100644 (file)
@@ -400,13 +400,16 @@ config BLK_DEV_RAM_SIZE
          8192.
 
 config BLK_DEV_INITRD
-       bool "Initial RAM disk (initrd) support"
+       bool "Initial RAM filesystem and RAM disk (initramfs/initrd) support"
        help
-         The initial RAM disk is a RAM disk that is loaded by the boot loader
-         (loadlin or lilo) and that is mounted as root before the normal boot
-         procedure. It is typically used to load modules needed to mount the
-         "real" root file system, etc. See <file:Documentation/initrd.txt>
-         for details.
+         The initial RAM filesystem is a ramfs which is loaded by the
+         boot loader (loadlin or lilo) and that is mounted as root
+         before the normal boot procedure. It is typically used to
+         load modules needed to mount the "real" root file system,
+         etc. See <file:Documentation/initrd.txt> for details.
+
+         If RAM disk support (BLK_DEV_RAM) is also included, this
+         also enables initial RAM disk (initrd) support.
 
 
 config CDROM_PKTCDVD
index 32fea55fac484f4fab1f42b0904f98290e28d8a4..393b86a3dbf8e189ca26913aef7692d38c3072a3 100644 (file)
@@ -211,9 +211,7 @@ aoeblk_gdalloc(void *vp)
                return;
        }
 
-       d->bufpool = mempool_create(MIN_BUFS,
-                                   mempool_alloc_slab, mempool_free_slab,
-                                   buf_pool_cache);
+       d->bufpool = mempool_create_slab_pool(MIN_BUFS, buf_pool_cache);
        if (d->bufpool == NULL) {
                printk(KERN_ERR "aoe: aoeblk_gdalloc: cannot allocate bufpool "
                        "for %ld.%ld\n", d->aoemajor, d->aoeminor);
index 840919bba76cc146df23ef736cd45b318b0e2d9c..d3ad9081697ea35852a417256c70d56e97d77c46 100644 (file)
@@ -250,6 +250,18 @@ static int irqdma_allocated;
 #include <linux/cdrom.h>       /* for the compatibility eject ioctl */
 #include <linux/completion.h>
 
+/*
+ * Interrupt freeing also means /proc VFS work - dont do it
+ * from interrupt context. We push this work into keventd:
+ */
+static void fd_free_irq_fn(void *data)
+{
+       fd_free_irq();
+}
+
+static DECLARE_WORK(fd_free_irq_work, fd_free_irq_fn, NULL);
+
+
 static struct request *current_req;
 static struct request_queue *floppy_queue;
 static void do_fd_request(request_queue_t * q);
@@ -4433,6 +4445,13 @@ static int floppy_grab_irq_and_dma(void)
                return 0;
        }
        spin_unlock_irqrestore(&floppy_usage_lock, flags);
+
+       /*
+        * We might have scheduled a free_irq(), wait it to
+        * drain first:
+        */
+       flush_scheduled_work();
+
        if (fd_request_irq()) {
                DPRINT("Unable to grab IRQ%d for the floppy driver\n",
                       FLOPPY_IRQ);
@@ -4522,7 +4541,7 @@ static void floppy_release_irq_and_dma(void)
        if (irqdma_allocated) {
                fd_disable_dma();
                fd_free_dma();
-               fd_free_irq();
+               schedule_work(&fd_free_irq_work);
                irqdma_allocated = 0;
        }
        set_dor(0, ~0, 8);
@@ -4633,6 +4652,8 @@ void cleanup_module(void)
        /* eject disk, if any */
        fd_eject(0);
 
+       flush_scheduled_work();         /* fd_free_irq() might be pending */
+
        wait_for_completion(&device_release);
 }
 
index 74bf0255e98f44dd2cc405426254a6e9b744f19d..9c3b94e8f03baa7d4138802e01b87e27e511c159 100644 (file)
@@ -839,7 +839,9 @@ static int loop_set_fd(struct loop_device *lo, struct file *lo_file,
 
        set_blocksize(bdev, lo_blocksize);
 
-       kernel_thread(loop_thread, lo, CLONE_KERNEL);
+       error = kernel_thread(loop_thread, lo, CLONE_KERNEL);
+       if (error < 0)
+               goto out_putf;
        wait_for_completion(&lo->lo_done);
        return 0;
 
index 1d261f985f31920068ebb294486e459b181ba745..a04f60693c396446d4a310e8c1df0eaef62c5012 100644 (file)
@@ -230,16 +230,6 @@ static int pkt_grow_pktlist(struct pktcdvd_device *pd, int nr_packets)
        return 1;
 }
 
-static void *pkt_rb_alloc(gfp_t gfp_mask, void *data)
-{
-       return kmalloc(sizeof(struct pkt_rb_node), gfp_mask);
-}
-
-static void pkt_rb_free(void *ptr, void *data)
-{
-       kfree(ptr);
-}
-
 static inline struct pkt_rb_node *pkt_rbtree_next(struct pkt_rb_node *node)
 {
        struct rb_node *n = rb_next(&node->rb_node);
@@ -2073,16 +2063,6 @@ static int pkt_close(struct inode *inode, struct file *file)
 }
 
 
-static void *psd_pool_alloc(gfp_t gfp_mask, void *data)
-{
-       return kmalloc(sizeof(struct packet_stacked_data), gfp_mask);
-}
-
-static void psd_pool_free(void *ptr, void *data)
-{
-       kfree(ptr);
-}
-
 static int pkt_end_io_read_cloned(struct bio *bio, unsigned int bytes_done, int err)
 {
        struct packet_stacked_data *psd = bio->bi_private;
@@ -2475,7 +2455,8 @@ static int pkt_setup_dev(struct pkt_ctrl_command *ctrl_cmd)
        if (!pd)
                return ret;
 
-       pd->rb_pool = mempool_create(PKT_RB_POOL_SIZE, pkt_rb_alloc, pkt_rb_free, NULL);
+       pd->rb_pool = mempool_create_kmalloc_pool(PKT_RB_POOL_SIZE,
+                                                 sizeof(struct pkt_rb_node));
        if (!pd->rb_pool)
                goto out_mem;
 
@@ -2639,7 +2620,8 @@ static int __init pkt_init(void)
 {
        int ret;
 
-       psd_pool = mempool_create(PSD_POOL_SIZE, psd_pool_alloc, psd_pool_free, NULL);
+       psd_pool = mempool_create_kmalloc_pool(PSD_POOL_SIZE,
+                                       sizeof(struct packet_stacked_data));
        if (!psd_pool)
                return -ENOMEM;
 
index 5980f3e886fc7acc668522b14e2c79b496d468da..facc3f1d9e377f47d87122c8f3c9414e6a29f352 100644 (file)
@@ -187,6 +187,7 @@ config MOXA_SMARTIO
 config ISI
        tristate "Multi-Tech multiport card support (EXPERIMENTAL)"
        depends on SERIAL_NONSTANDARD
+       select FW_LOADER
        help
          This is a driver for the Multi-Tech cards which provide several
          serial ports.  The driver is experimental and can currently only be
index 7c0684deea06a8d1d479f2939ededa537c3bf65d..932feedda262216dcdf8c0b0b7f82e93e5054c69 100644 (file)
@@ -90,7 +90,7 @@ static unsigned int ipmi_poll(struct file *file, poll_table *wait)
 
        spin_lock_irqsave(&priv->recv_msg_lock, flags);
 
-       if (! list_empty(&(priv->recv_msgs)))
+       if (!list_empty(&(priv->recv_msgs)))
                mask |= (POLLIN | POLLRDNORM);
 
        spin_unlock_irqrestore(&priv->recv_msg_lock, flags);
@@ -789,21 +789,53 @@ MODULE_PARM_DESC(ipmi_major, "Sets the major number of the IPMI device.  By"
                 " interface.  Other values will set the major device number"
                 " to that value.");
 
+/* Keep track of the devices that are registered. */
+struct ipmi_reg_list {
+       dev_t            dev;
+       struct list_head link;
+};
+static LIST_HEAD(reg_list);
+static DEFINE_MUTEX(reg_list_mutex);
+
 static struct class *ipmi_class;
 
-static void ipmi_new_smi(int if_num)
+static void ipmi_new_smi(int if_num, struct device *device)
 {
        dev_t dev = MKDEV(ipmi_major, if_num);
+       struct ipmi_reg_list *entry;
 
        devfs_mk_cdev(dev, S_IFCHR | S_IRUSR | S_IWUSR,
                      "ipmidev/%d", if_num);
 
-       class_device_create(ipmi_class, NULL, dev, NULL, "ipmi%d", if_num);
+       entry = kmalloc(sizeof(*entry), GFP_KERNEL);
+       if (!entry) {
+               printk(KERN_ERR "ipmi_devintf: Unable to create the"
+                      " ipmi class device link\n");
+               return;
+       }
+       entry->dev = dev;
+
+       mutex_lock(&reg_list_mutex);
+       class_device_create(ipmi_class, NULL, dev, device, "ipmi%d", if_num);
+       list_add(&entry->link, &reg_list);
+       mutex_unlock(&reg_list_mutex);
 }
 
 static void ipmi_smi_gone(int if_num)
 {
-       class_device_destroy(ipmi_class, MKDEV(ipmi_major, if_num));
+       dev_t dev = MKDEV(ipmi_major, if_num);
+       struct ipmi_reg_list *entry;
+
+       mutex_lock(&reg_list_mutex);
+       list_for_each_entry(entry, &reg_list, link) {
+               if (entry->dev == dev) {
+                       list_del(&entry->link);
+                       kfree(entry);
+                       break;
+               }
+       }
+       class_device_destroy(ipmi_class, dev);
+       mutex_unlock(&reg_list_mutex);
        devfs_remove("ipmidev/%d", if_num);
 }
 
@@ -856,6 +888,14 @@ module_init(init_ipmi_devintf);
 
 static __exit void cleanup_ipmi(void)
 {
+       struct ipmi_reg_list *entry, *entry2;
+       mutex_lock(&reg_list_mutex);
+       list_for_each_entry_safe(entry, entry2, &reg_list, link) {
+               list_del(&entry->link);
+               class_device_destroy(ipmi_class, entry->dev);
+               kfree(entry);
+       }
+       mutex_unlock(&reg_list_mutex);
        class_destroy(ipmi_class);
        ipmi_smi_watcher_unregister(&smi_watcher);
        devfs_remove(DEVICE_NAME);
index abd4c5118a1b52f4e901c6d30ce54df381a97371..b8fb87c6c29f5fb9f58cae180ec87282b61701c7 100644 (file)
@@ -48,7 +48,7 @@
 
 #define PFX "IPMI message handler: "
 
-#define IPMI_DRIVER_VERSION "38.0"
+#define IPMI_DRIVER_VERSION "39.0"
 
 static struct ipmi_recv_msg *ipmi_alloc_recv_msg(void);
 static int ipmi_init_msghandler(void);
@@ -162,6 +162,28 @@ struct ipmi_proc_entry
 };
 #endif
 
+struct bmc_device
+{
+       struct platform_device *dev;
+       struct ipmi_device_id  id;
+       unsigned char          guid[16];
+       int                    guid_set;
+
+       struct kref            refcount;
+
+       /* bmc device attributes */
+       struct device_attribute device_id_attr;
+       struct device_attribute provides_dev_sdrs_attr;
+       struct device_attribute revision_attr;
+       struct device_attribute firmware_rev_attr;
+       struct device_attribute version_attr;
+       struct device_attribute add_dev_support_attr;
+       struct device_attribute manufacturer_id_attr;
+       struct device_attribute product_id_attr;
+       struct device_attribute guid_attr;
+       struct device_attribute aux_firmware_rev_attr;
+};
+
 #define IPMI_IPMB_NUM_SEQ      64
 #define IPMI_MAX_CHANNELS       16
 struct ipmi_smi
@@ -178,9 +200,8 @@ struct ipmi_smi
        /* Used for wake ups at startup. */
        wait_queue_head_t waitq;
 
-       /* The IPMI version of the BMC on the other end. */
-       unsigned char       version_major;
-       unsigned char       version_minor;
+       struct bmc_device *bmc;
+       char *my_dev_name;
 
        /* This is the lower-layer's sender routine. */
        struct ipmi_smi_handlers *handlers;
@@ -194,6 +215,9 @@ struct ipmi_smi
        struct ipmi_proc_entry *proc_entries;
 #endif
 
+       /* Driver-model device for the system interface. */
+       struct device          *si_dev;
+
        /* A table of sequence numbers for this interface.  We use the
            sequence numbers for IPMB messages that go out of the
            interface to match them up with their responses.  A routine
@@ -312,6 +336,7 @@ struct ipmi_smi
        /* Events that were received with the proper format. */
        unsigned int events;
 };
+#define to_si_intf_from_dev(device) container_of(device, struct ipmi_smi, dev)
 
 /* Used to mark an interface entry that cannot be used but is not a
  * free entry, either, primarily used at creation and deletion time so
@@ -320,6 +345,15 @@ struct ipmi_smi
 #define IPMI_INVALID_INTERFACE(i) (((i) == NULL) \
                                   || (i == IPMI_INVALID_INTERFACE_ENTRY))
 
+/**
+ * The driver model view of the IPMI messaging driver.
+ */
+static struct device_driver ipmidriver = {
+       .name = "ipmi",
+       .bus = &platform_bus_type
+};
+static DEFINE_MUTEX(ipmidriver_mutex);
+
 #define MAX_IPMI_INTERFACES 4
 static ipmi_smi_t ipmi_interfaces[MAX_IPMI_INTERFACES];
 
@@ -393,7 +427,7 @@ int ipmi_smi_watcher_register(struct ipmi_smi_watcher *watcher)
                if (IPMI_INVALID_INTERFACE(intf))
                        continue;
                spin_unlock_irqrestore(&interfaces_lock, flags);
-               watcher->new_smi(i);
+               watcher->new_smi(i, intf->si_dev);
                spin_lock_irqsave(&interfaces_lock, flags);
        }
        spin_unlock_irqrestore(&interfaces_lock, flags);
@@ -409,14 +443,14 @@ int ipmi_smi_watcher_unregister(struct ipmi_smi_watcher *watcher)
 }
 
 static void
-call_smi_watchers(int i)
+call_smi_watchers(int i, struct device *dev)
 {
        struct ipmi_smi_watcher *w;
 
        down_read(&smi_watchers_sem);
        list_for_each_entry(w, &smi_watchers, link) {
                if (try_module_get(w->owner)) {
-                       w->new_smi(i);
+                       w->new_smi(i, dev);
                        module_put(w->owner);
                }
        }
@@ -844,8 +878,8 @@ void ipmi_get_version(ipmi_user_t   user,
                      unsigned char *major,
                      unsigned char *minor)
 {
-       *major = user->intf->version_major;
-       *minor = user->intf->version_minor;
+       *major = ipmi_version_major(&user->intf->bmc->id);
+       *minor = ipmi_version_minor(&user->intf->bmc->id);
 }
 
 int ipmi_set_my_address(ipmi_user_t   user,
@@ -1553,7 +1587,8 @@ static int version_file_read_proc(char *page, char **start, off_t off,
        ipmi_smi_t intf = data;
 
        return sprintf(out, "%d.%d\n",
-                      intf->version_major, intf->version_minor);
+                      ipmi_version_major(&intf->bmc->id),
+                      ipmi_version_minor(&intf->bmc->id));
 }
 
 static int stat_file_read_proc(char *page, char **start, off_t off,
@@ -1712,6 +1747,470 @@ static void remove_proc_entries(ipmi_smi_t smi)
 #endif /* CONFIG_PROC_FS */
 }
 
+static int __find_bmc_guid(struct device *dev, void *data)
+{
+       unsigned char *id = data;
+       struct bmc_device *bmc = dev_get_drvdata(dev);
+       return memcmp(bmc->guid, id, 16) == 0;
+}
+
+static struct bmc_device *ipmi_find_bmc_guid(struct device_driver *drv,
+                                            unsigned char *guid)
+{
+       struct device *dev;
+
+       dev = driver_find_device(drv, NULL, guid, __find_bmc_guid);
+       if (dev)
+               return dev_get_drvdata(dev);
+       else
+               return NULL;
+}
+
+struct prod_dev_id {
+       unsigned int  product_id;
+       unsigned char device_id;
+};
+
+static int __find_bmc_prod_dev_id(struct device *dev, void *data)
+{
+       struct prod_dev_id *id = data;
+       struct bmc_device *bmc = dev_get_drvdata(dev);
+
+       return (bmc->id.product_id == id->product_id
+               && bmc->id.product_id == id->product_id
+               && bmc->id.device_id == id->device_id);
+}
+
+static struct bmc_device *ipmi_find_bmc_prod_dev_id(
+       struct device_driver *drv,
+       unsigned char product_id, unsigned char device_id)
+{
+       struct prod_dev_id id = {
+               .product_id = product_id,
+               .device_id = device_id,
+       };
+       struct device *dev;
+
+       dev = driver_find_device(drv, NULL, &id, __find_bmc_prod_dev_id);
+       if (dev)
+               return dev_get_drvdata(dev);
+       else
+               return NULL;
+}
+
+static ssize_t device_id_show(struct device *dev,
+                             struct device_attribute *attr,
+                             char *buf)
+{
+       struct bmc_device *bmc = dev_get_drvdata(dev);
+
+       return snprintf(buf, 10, "%u\n", bmc->id.device_id);
+}
+
+static ssize_t provides_dev_sdrs_show(struct device *dev,
+                                     struct device_attribute *attr,
+                                     char *buf)
+{
+       struct bmc_device *bmc = dev_get_drvdata(dev);
+
+       return snprintf(buf, 10, "%u\n",
+                       bmc->id.device_revision && 0x80 >> 7);
+}
+
+static ssize_t revision_show(struct device *dev, struct device_attribute *attr,
+                            char *buf)
+{
+       struct bmc_device *bmc = dev_get_drvdata(dev);
+
+       return snprintf(buf, 20, "%u\n",
+                       bmc->id.device_revision && 0x0F);
+}
+
+static ssize_t firmware_rev_show(struct device *dev,
+                                struct device_attribute *attr,
+                                char *buf)
+{
+       struct bmc_device *bmc = dev_get_drvdata(dev);
+
+       return snprintf(buf, 20, "%u.%x\n", bmc->id.firmware_revision_1,
+                       bmc->id.firmware_revision_2);
+}
+
+static ssize_t ipmi_version_show(struct device *dev,
+                                struct device_attribute *attr,
+                                char *buf)
+{
+       struct bmc_device *bmc = dev_get_drvdata(dev);
+
+       return snprintf(buf, 20, "%u.%u\n",
+                       ipmi_version_major(&bmc->id),
+                       ipmi_version_minor(&bmc->id));
+}
+
+static ssize_t add_dev_support_show(struct device *dev,
+                                   struct device_attribute *attr,
+                                   char *buf)
+{
+       struct bmc_device *bmc = dev_get_drvdata(dev);
+
+       return snprintf(buf, 10, "0x%02x\n",
+                       bmc->id.additional_device_support);
+}
+
+static ssize_t manufacturer_id_show(struct device *dev,
+                                   struct device_attribute *attr,
+                                   char *buf)
+{
+       struct bmc_device *bmc = dev_get_drvdata(dev);
+
+       return snprintf(buf, 20, "0x%6.6x\n", bmc->id.manufacturer_id);
+}
+
+static ssize_t product_id_show(struct device *dev,
+                              struct device_attribute *attr,
+                              char *buf)
+{
+       struct bmc_device *bmc = dev_get_drvdata(dev);
+
+       return snprintf(buf, 10, "0x%4.4x\n", bmc->id.product_id);
+}
+
+static ssize_t aux_firmware_rev_show(struct device *dev,
+                                    struct device_attribute *attr,
+                                    char *buf)
+{
+       struct bmc_device *bmc = dev_get_drvdata(dev);
+
+       return snprintf(buf, 21, "0x%02x 0x%02x 0x%02x 0x%02x\n",
+                       bmc->id.aux_firmware_revision[3],
+                       bmc->id.aux_firmware_revision[2],
+                       bmc->id.aux_firmware_revision[1],
+                       bmc->id.aux_firmware_revision[0]);
+}
+
+static ssize_t guid_show(struct device *dev, struct device_attribute *attr,
+                        char *buf)
+{
+       struct bmc_device *bmc = dev_get_drvdata(dev);
+
+       return snprintf(buf, 100, "%Lx%Lx\n",
+                       (long long) bmc->guid[0],
+                       (long long) bmc->guid[8]);
+}
+
+static void
+cleanup_bmc_device(struct kref *ref)
+{
+       struct bmc_device *bmc;
+
+       bmc = container_of(ref, struct bmc_device, refcount);
+
+       device_remove_file(&bmc->dev->dev,
+                          &bmc->device_id_attr);
+       device_remove_file(&bmc->dev->dev,
+                          &bmc->provides_dev_sdrs_attr);
+       device_remove_file(&bmc->dev->dev,
+                          &bmc->revision_attr);
+       device_remove_file(&bmc->dev->dev,
+                          &bmc->firmware_rev_attr);
+       device_remove_file(&bmc->dev->dev,
+                          &bmc->version_attr);
+       device_remove_file(&bmc->dev->dev,
+                          &bmc->add_dev_support_attr);
+       device_remove_file(&bmc->dev->dev,
+                          &bmc->manufacturer_id_attr);
+       device_remove_file(&bmc->dev->dev,
+                          &bmc->product_id_attr);
+       if (bmc->id.aux_firmware_revision_set)
+               device_remove_file(&bmc->dev->dev,
+                                  &bmc->aux_firmware_rev_attr);
+       if (bmc->guid_set)
+               device_remove_file(&bmc->dev->dev,
+                                  &bmc->guid_attr);
+       platform_device_unregister(bmc->dev);
+       kfree(bmc);
+}
+
+static void ipmi_bmc_unregister(ipmi_smi_t intf)
+{
+       struct bmc_device *bmc = intf->bmc;
+
+       sysfs_remove_link(&intf->si_dev->kobj, "bmc");
+       if (intf->my_dev_name) {
+               sysfs_remove_link(&bmc->dev->dev.kobj, intf->my_dev_name);
+               kfree(intf->my_dev_name);
+               intf->my_dev_name = NULL;
+       }
+
+       mutex_lock(&ipmidriver_mutex);
+       kref_put(&bmc->refcount, cleanup_bmc_device);
+       mutex_unlock(&ipmidriver_mutex);
+}
+
+static int ipmi_bmc_register(ipmi_smi_t intf)
+{
+       int               rv;
+       struct bmc_device *bmc = intf->bmc;
+       struct bmc_device *old_bmc;
+       int               size;
+       char              dummy[1];
+
+       mutex_lock(&ipmidriver_mutex);
+
+       /*
+        * Try to find if there is an bmc_device struct
+        * representing the interfaced BMC already
+        */
+       if (bmc->guid_set)
+               old_bmc = ipmi_find_bmc_guid(&ipmidriver, bmc->guid);
+       else
+               old_bmc = ipmi_find_bmc_prod_dev_id(&ipmidriver,
+                                                   bmc->id.product_id,
+                                                   bmc->id.device_id);
+
+       /*
+        * If there is already an bmc_device, free the new one,
+        * otherwise register the new BMC device
+        */
+       if (old_bmc) {
+               kfree(bmc);
+               intf->bmc = old_bmc;
+               bmc = old_bmc;
+
+               kref_get(&bmc->refcount);
+               mutex_unlock(&ipmidriver_mutex);
+
+               printk(KERN_INFO
+                      "ipmi: interfacing existing BMC (man_id: 0x%6.6x,"
+                      " prod_id: 0x%4.4x, dev_id: 0x%2.2x)\n",
+                      bmc->id.manufacturer_id,
+                      bmc->id.product_id,
+                      bmc->id.device_id);
+       } else {
+               bmc->dev = platform_device_alloc("ipmi_bmc",
+                                                bmc->id.device_id);
+               if (! bmc->dev) {
+                       printk(KERN_ERR
+                              "ipmi_msghandler:"
+                              " Unable to allocate platform device\n");
+                       return -ENOMEM;
+               }
+               bmc->dev->dev.driver = &ipmidriver;
+               dev_set_drvdata(&bmc->dev->dev, bmc);
+               kref_init(&bmc->refcount);
+
+               rv = platform_device_register(bmc->dev);
+               mutex_unlock(&ipmidriver_mutex);
+               if (rv) {
+                       printk(KERN_ERR
+                              "ipmi_msghandler:"
+                              " Unable to register bmc device: %d\n",
+                              rv);
+                       /* Don't go to out_err, you can only do that if
+                          the device is registered already. */
+                       return rv;
+               }
+
+               bmc->device_id_attr.attr.name = "device_id";
+               bmc->device_id_attr.attr.owner = THIS_MODULE;
+               bmc->device_id_attr.attr.mode = S_IRUGO;
+               bmc->device_id_attr.show = device_id_show;
+
+               bmc->provides_dev_sdrs_attr.attr.name = "provides_device_sdrs";
+               bmc->provides_dev_sdrs_attr.attr.owner = THIS_MODULE;
+               bmc->provides_dev_sdrs_attr.attr.mode = S_IRUGO;
+               bmc->provides_dev_sdrs_attr.show = provides_dev_sdrs_show;
+
+
+               bmc->revision_attr.attr.name = "revision";
+               bmc->revision_attr.attr.owner = THIS_MODULE;
+               bmc->revision_attr.attr.mode = S_IRUGO;
+               bmc->revision_attr.show = revision_show;
+
+               bmc->firmware_rev_attr.attr.name = "firmware_revision";
+               bmc->firmware_rev_attr.attr.owner = THIS_MODULE;
+               bmc->firmware_rev_attr.attr.mode = S_IRUGO;
+               bmc->firmware_rev_attr.show = firmware_rev_show;
+
+               bmc->version_attr.attr.name = "ipmi_version";
+               bmc->version_attr.attr.owner = THIS_MODULE;
+               bmc->version_attr.attr.mode = S_IRUGO;
+               bmc->version_attr.show = ipmi_version_show;
+
+               bmc->add_dev_support_attr.attr.name
+                       = "additional_device_support";
+               bmc->add_dev_support_attr.attr.owner = THIS_MODULE;
+               bmc->add_dev_support_attr.attr.mode = S_IRUGO;
+               bmc->add_dev_support_attr.show = add_dev_support_show;
+
+               bmc->manufacturer_id_attr.attr.name = "manufacturer_id";
+               bmc->manufacturer_id_attr.attr.owner = THIS_MODULE;
+               bmc->manufacturer_id_attr.attr.mode = S_IRUGO;
+               bmc->manufacturer_id_attr.show = manufacturer_id_show;
+
+               bmc->product_id_attr.attr.name = "product_id";
+               bmc->product_id_attr.attr.owner = THIS_MODULE;
+               bmc->product_id_attr.attr.mode = S_IRUGO;
+               bmc->product_id_attr.show = product_id_show;
+
+               bmc->guid_attr.attr.name = "guid";
+               bmc->guid_attr.attr.owner = THIS_MODULE;
+               bmc->guid_attr.attr.mode = S_IRUGO;
+               bmc->guid_attr.show = guid_show;
+
+               bmc->aux_firmware_rev_attr.attr.name = "aux_firmware_revision";
+               bmc->aux_firmware_rev_attr.attr.owner = THIS_MODULE;
+               bmc->aux_firmware_rev_attr.attr.mode = S_IRUGO;
+               bmc->aux_firmware_rev_attr.show = aux_firmware_rev_show;
+
+               device_create_file(&bmc->dev->dev,
+                                  &bmc->device_id_attr);
+               device_create_file(&bmc->dev->dev,
+                                  &bmc->provides_dev_sdrs_attr);
+               device_create_file(&bmc->dev->dev,
+                                  &bmc->revision_attr);
+               device_create_file(&bmc->dev->dev,
+                                  &bmc->firmware_rev_attr);
+               device_create_file(&bmc->dev->dev,
+                                  &bmc->version_attr);
+               device_create_file(&bmc->dev->dev,
+                                  &bmc->add_dev_support_attr);
+               device_create_file(&bmc->dev->dev,
+                                  &bmc->manufacturer_id_attr);
+               device_create_file(&bmc->dev->dev,
+                                  &bmc->product_id_attr);
+               if (bmc->id.aux_firmware_revision_set)
+                       device_create_file(&bmc->dev->dev,
+                                          &bmc->aux_firmware_rev_attr);
+               if (bmc->guid_set)
+                       device_create_file(&bmc->dev->dev,
+                                          &bmc->guid_attr);
+
+               printk(KERN_INFO
+                      "ipmi: Found new BMC (man_id: 0x%6.6x, "
+                      " prod_id: 0x%4.4x, dev_id: 0x%2.2x)\n",
+                      bmc->id.manufacturer_id,
+                      bmc->id.product_id,
+                      bmc->id.device_id);
+       }
+
+       /*
+        * create symlink from system interface device to bmc device
+        * and back.
+        */
+       rv = sysfs_create_link(&intf->si_dev->kobj,
+                              &bmc->dev->dev.kobj, "bmc");
+       if (rv) {
+               printk(KERN_ERR
+                      "ipmi_msghandler: Unable to create bmc symlink: %d\n",
+                      rv);
+               goto out_err;
+       }
+
+       size = snprintf(dummy, 0, "ipmi%d", intf->intf_num);
+       intf->my_dev_name = kmalloc(size+1, GFP_KERNEL);
+       if (!intf->my_dev_name) {
+               rv = -ENOMEM;
+               printk(KERN_ERR
+                      "ipmi_msghandler: allocate link from BMC: %d\n",
+                      rv);
+               goto out_err;
+       }
+       snprintf(intf->my_dev_name, size+1, "ipmi%d", intf->intf_num);
+
+       rv = sysfs_create_link(&bmc->dev->dev.kobj, &intf->si_dev->kobj,
+                              intf->my_dev_name);
+       if (rv) {
+               kfree(intf->my_dev_name);
+               intf->my_dev_name = NULL;
+               printk(KERN_ERR
+                      "ipmi_msghandler:"
+                      " Unable to create symlink to bmc: %d\n",
+                      rv);
+               goto out_err;
+       }
+
+       return 0;
+
+out_err:
+       ipmi_bmc_unregister(intf);
+       return rv;
+}
+
+static int
+send_guid_cmd(ipmi_smi_t intf, int chan)
+{
+       struct kernel_ipmi_msg            msg;
+       struct ipmi_system_interface_addr si;
+
+       si.addr_type = IPMI_SYSTEM_INTERFACE_ADDR_TYPE;
+       si.channel = IPMI_BMC_CHANNEL;
+       si.lun = 0;
+
+       msg.netfn = IPMI_NETFN_APP_REQUEST;
+       msg.cmd = IPMI_GET_DEVICE_GUID_CMD;
+       msg.data = NULL;
+       msg.data_len = 0;
+       return i_ipmi_request(NULL,
+                             intf,
+                             (struct ipmi_addr *) &si,
+                             0,
+                             &msg,
+                             intf,
+                             NULL,
+                             NULL,
+                             0,
+                             intf->channels[0].address,
+                             intf->channels[0].lun,
+                             -1, 0);
+}
+
+static void
+guid_handler(ipmi_smi_t intf, struct ipmi_recv_msg *msg)
+{
+       if ((msg->addr.addr_type != IPMI_SYSTEM_INTERFACE_ADDR_TYPE)
+           || (msg->msg.netfn != IPMI_NETFN_APP_RESPONSE)
+           || (msg->msg.cmd != IPMI_GET_DEVICE_GUID_CMD))
+               /* Not for me */
+               return;
+
+       if (msg->msg.data[0] != 0) {
+               /* Error from getting the GUID, the BMC doesn't have one. */
+               intf->bmc->guid_set = 0;
+               goto out;
+       }
+
+       if (msg->msg.data_len < 17) {
+               intf->bmc->guid_set = 0;
+               printk(KERN_WARNING PFX
+                      "guid_handler: The GUID response from the BMC was too"
+                      " short, it was %d but should have been 17.  Assuming"
+                      " GUID is not available.\n",
+                      msg->msg.data_len);
+               goto out;
+       }
+
+       memcpy(intf->bmc->guid, msg->msg.data, 16);
+       intf->bmc->guid_set = 1;
+ out:
+       wake_up(&intf->waitq);
+}
+
+static void
+get_guid(ipmi_smi_t intf)
+{
+       int rv;
+
+       intf->bmc->guid_set = 0x2;
+       intf->null_user_handler = guid_handler;
+       rv = send_guid_cmd(intf, 0);
+       if (rv)
+               /* Send failed, no GUID available. */
+               intf->bmc->guid_set = 0;
+       wait_event(intf->waitq, intf->bmc->guid_set != 2);
+       intf->null_user_handler = NULL;
+}
+
 static int
 send_channel_info_cmd(ipmi_smi_t intf, int chan)
 {
@@ -1804,8 +2303,8 @@ channel_handler(ipmi_smi_t intf, struct ipmi_recv_msg *msg)
 
 int ipmi_register_smi(struct ipmi_smi_handlers *handlers,
                      void                     *send_info,
-                     unsigned char            version_major,
-                     unsigned char            version_minor,
+                     struct ipmi_device_id    *device_id,
+                     struct device            *si_dev,
                      unsigned char            slave_addr,
                      ipmi_smi_t               *new_intf)
 {
@@ -1813,7 +2312,11 @@ int ipmi_register_smi(struct ipmi_smi_handlers *handlers,
        int              rv;
        ipmi_smi_t       intf;
        unsigned long    flags;
+       int              version_major;
+       int              version_minor;
 
+       version_major = ipmi_version_major(device_id);
+       version_minor = ipmi_version_minor(device_id);
 
        /* Make sure the driver is actually initialized, this handles
           problems with initialization order. */
@@ -1831,10 +2334,15 @@ int ipmi_register_smi(struct ipmi_smi_handlers *handlers,
        if (!intf)
                return -ENOMEM;
        memset(intf, 0, sizeof(*intf));
+       intf->bmc = kzalloc(sizeof(*intf->bmc), GFP_KERNEL);
+       if (!intf->bmc) {
+               kfree(intf);
+               return -ENOMEM;
+       }
        intf->intf_num = -1;
        kref_init(&intf->refcount);
-       intf->version_major = version_major;
-       intf->version_minor = version_minor;
+       intf->bmc->id = *device_id;
+       intf->si_dev = si_dev;
        for (j = 0; j < IPMI_MAX_CHANNELS; j++) {
                intf->channels[j].address = IPMI_BMC_SLAVE_ADDR;
                intf->channels[j].lun = 2;
@@ -1884,6 +2392,8 @@ int ipmi_register_smi(struct ipmi_smi_handlers *handlers,
           caller before sending any messages with it. */
        *new_intf = intf;
 
+       get_guid(intf);
+
        if ((version_major > 1)
            || ((version_major == 1) && (version_minor >= 5)))
        {
@@ -1898,6 +2408,7 @@ int ipmi_register_smi(struct ipmi_smi_handlers *handlers,
                /* Wait for the channel info to be read. */
                wait_event(intf->waitq,
                           intf->curr_channel >= IPMI_MAX_CHANNELS);
+               intf->null_user_handler = NULL;
        } else {
                /* Assume a single IPMB channel at zero. */
                intf->channels[0].medium = IPMI_CHANNEL_MEDIUM_IPMB;
@@ -1907,6 +2418,8 @@ int ipmi_register_smi(struct ipmi_smi_handlers *handlers,