24 Sep, 2009

1 commit

  • * remove asm/atomic.h inclusion from linux/utsname.h --
    not needed after kref conversion
    * remove linux/utsname.h inclusion from files which do not need it

    NOTE: it looks like fs/binfmt_elf.c do not need utsname.h, however
    due to some personality stuff it _is_ needed -- cowardly leave ELF-related
    headers and files alone.

    Signed-off-by: Alexey Dobriyan
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     

23 Sep, 2009

2 commits


19 Jun, 2009

1 commit

  • avr32, mn10300, parisc, s390, sh, xtensa:

    They never set PT_DTRACE, but clear it after do_execve().

    Signed-off-by: Oleg Nesterov
    Cc: David Howells
    Acked-by: Kyle McMartin
    Cc: Grant Grundler
    Cc: Matthew Wilcox
    Acked-by: Martin Schwidefsky
    Cc: Heiko Carstens
    Acked-by: Paul Mundt
    Acked-by: Chris Zankel
    Acked-by: Roland McGrath
    Acked-by: Haavard Skinnemoen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     

12 Jun, 2009

1 commit


03 Apr, 2009

1 commit


26 Mar, 2009

4 commits


14 Jan, 2009

1 commit


31 Dec, 2008

2 commits


15 Nov, 2008

1 commit


22 Aug, 2008

1 commit

  • Ever since commit 43ca5c3a1cefdaa09231d64485b8f676118bf1e0 ([S390] Convert
    monitor calls to function calls.), the kernel refused to IPL with spinlock
    debugging enabled.

    BUG: spinlock bad magic on CPU#0, swapper/0
    lock: 00000000003a4668, .magic: 00000000, .owner: /-1, .owner_cpu: 0
    CPU: 0 Not tainted 2.6.25 #1
    Process swapper (pid: 0, task: 000000000034f958, ksp: 0000000000377d60)
    0000000000377ab8 0000000000352628 0000000000377d60 0000000000377d60
    0000000000016af4 00000000fffff7b5 0000000000377d60 0000000000000000
    0000000000000000 0000000000377a18 0000000000000009 0000000000377a18
    0000000000377a78 000000000023c920 0000000000016af4 0000000000377a18
    0000000000000005 0000000000000000 0000000000377b58 0000000000377ab8
    Call Trace:
    ([] show_trace+0xdc/0x108)
    [] show_stack+0xc2/0xfc
    [] dump_stack+0xb2/0xc0
    []

    Signed-off-by: Josef 'Jeff' Sipek
    Signed-off-by: Heiko Carstens
    Signed-off-by: Martin Schwidefsky

    Josef 'Jeff' Sipek
     

19 Jul, 2008

1 commit


14 Jul, 2008

1 commit


30 Apr, 2008

1 commit


17 Apr, 2008

4 commits

  • Newer s390 models have a breaking-event-address-recording register.
    Each time an instruction causes a break in the sequential instruction
    execution, the address is saved in that hardware register. On a program
    interrupt the address is copied to the lowcore address 272-279, which
    makes it software accessible.

    This patch changes the program check handler and the stack overflow
    checker to copy the value into the pt_regs argument.
    The oops output is enhanced to show the last known breaking address.
    It might give additional information if the stack trace is corrupted.

    The feature is only available on 64 bit.

    The new oops output looks like:

    [---------snip----------]
    Modules linked in: vmcp sunrpc qeth_l2 dm_mod qeth ccwgroup
    CPU: 2 Not tainted 2.6.24zlive-host #8
    Process modprobe (pid: 4788, task: 00000000bf3d8718, ksp: 00000000b2b0b8e0)
    Krnl PSW : 0704200180000000 000003e000020028 (vmcp_init+0x28/0xe4 [vmcp])
    R:0 T:1 IO:1 EX:1 Key:0 M:1 W:0 P:0 AS:0 CC:2 PM:0 EA:3
    Krnl GPRS: 0000000004000002 000003e000020000 0000000000000000 0000000000000001
    000000000015734c ffffffffffffffff 000003e0000b3b00 0000000000000000
    000003e00007ca30 00000000b5bb5d40 00000000b5bb5800 000003e0000b3b00
    000003e0000a2000 00000000003ecf50 00000000b2b0bd50 00000000b2b0bcb0
    Krnl Code: 000003e000020018: c0c000040ff4 larl %r12,3e0000a2000
    000003e00002001e: e3e0f0000024 stg %r14,0(%r15)
    000003e000020024: a7f40001 brc 15,3e000020026
    >000003e000020028: e310c0100004 lg %r1,16(%r12)
    000003e00002002e: c020000413dc larl %r2,3e0000a27e6
    000003e000020034: c0a00004aee6 larl %r10,3e0000b5e00
    000003e00002003a: a7490001 lghi %r4,1
    000003e00002003e: a75900f0 lghi %r5,240
    Call Trace:
    ([] blocking_notifier_call_chain+0x2c/0x40)
    [] sys_init_module+0x19d8/0x1b08
    [] sysc_noemu+0x10/0x16
    [] 0x2000011cda2
    Last Breaking-Event-Address:
    [] vmcp_init+0x24/0xe4 [vmcp]
    [---------snip----------]

    Signed-off-by: Christian Borntraeger
    Signed-off-by: Martin Schwidefsky
    Signed-off-by: Heiko Carstens

    Christian Borntraeger
     
  • Most noteable part of this commit is the new local header file entry.h
    which contains all the function declarations of functions that get only
    called from asm code or are arch internal. That way we can avoid extern
    declarations in C files.
    This is more or less the same that was done for sparc64.

    Signed-off-by: Martin Schwidefsky
    Signed-off-by: Heiko Carstens

    Heiko Carstens
     
  • This way we get rid of s390's NO_IDLE_HZ and use the generic dynticks
    variant instead. In addition we get high resolution timers for free.

    Signed-off-by: Martin Schwidefsky
    Signed-off-by: Heiko Carstens

    Heiko Carstens
     
  • Remove the program check generating monitor calls and use function
    calls instead. Theres is no real advantage in using monitor calls,
    but they do make debugging harder, because of all the program checks
    it generates.

    Signed-off-by: Martin Schwidefsky
    Signed-off-by: Heiko Carstens

    Heiko Carstens
     

05 Mar, 2008

1 commit

  • If a machine check handling is pending when the idle loop is entered
    default_idle will be left with timer ticks and virtual timer disabled.
    Fix this by "calling" the idle_chain. Also a BUG_ON(!in_interrupt) in
    start_hz_timer must be removed since the function now gets called from
    non interrupt context as well.

    Signed-off-by: Heiko Carstens
    Signed-off-by: Martin Schwidefsky

    Heiko Carstens
     

19 Feb, 2008

1 commit

  • If both NO_IDLE_HZ and VIRT_TIMER are disabled default_idle won't load
    an enabled wait psw and busy loop instead. This is because the
    idle_chain is empty and the return value of atomic_notifier_call_chain
    will be NOTIFY_DONE, which causes default_idle to return instead of
    loading an enabled wait psw.
    Fix this by calling __atomic_notifier_call_chain instead and add proper
    return value handling.

    Signed-off-by: Heiko Carstens
    Signed-off-by: Martin Schwidefsky

    Heiko Carstens
     

10 Feb, 2008

1 commit


26 Jan, 2008

1 commit


05 Nov, 2007

1 commit

  • Commit fae8b22d3e3e3a3d317a7746493997af02a3f35c
    "[S390] Add per-cpu idle time / idle count sysfs attributes" causes
    a link error on !CONFIG_SMP.
    Fix this by adding some #ifdef's. Real fix would be to cleanup the
    code since we don't register a cpu on !CONFIG_SMP. But that would
    be quite a big patch. For the time being this is good enough.

    arch/s390/kernel/built-in.o: In function `do_monitor_call':
    (.text+0x50d4): undefined reference to `per_cpu__s390_idle'
    arch/s390/kernel/built-in.o: In function `cpu_idle':
    (.text+0x518c): undefined reference to `per_cpu__s390_idle'
    make: *** [.tmp_vmlinux1] Error 1

    Signed-off-by: Heiko Carstens
    Signed-off-by: Martin Schwidefsky

    Heiko Carstens
     

22 Oct, 2007

2 commits


20 Oct, 2007

1 commit

  • One of the easiest things to isolate is the pid printed in kernel log.
    There was a patch, that made this for arch-independent code, this one makes
    so for arch/xxx files.

    It took some time to cross-compile it, but hopefully these are all the
    printks in arch code.

    Signed-off-by: Alexey Dobriyan
    Signed-off-by: Pavel Emelyanov
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     

30 Jul, 2007

1 commit

  • Remove fs.h from mm.h. For this,
    1) Uninline vma_wants_writenotify(). It's pretty huge anyway.
    2) Add back fs.h or less bloated headers (err.h) to files that need it.

    As result, on x86_64 allyesconfig, fs.h dependencies cut down from 3929 files
    rebuilt down to 3444 (-12.3%).

    Cross-compile tested without regressions on my two usual configs and (sigh):

    alpha arm-mx1ads mips-bigsur powerpc-ebony
    alpha-allnoconfig arm-neponset mips-capcella powerpc-g5
    alpha-defconfig arm-netwinder mips-cobalt powerpc-holly
    alpha-up arm-netx mips-db1000 powerpc-iseries
    arm arm-ns9xxx mips-db1100 powerpc-linkstation
    arm-assabet arm-omap_h2_1610 mips-db1200 powerpc-lite5200
    arm-at91rm9200dk arm-onearm mips-db1500 powerpc-maple
    arm-at91rm9200ek arm-picotux200 mips-db1550 powerpc-mpc7448_hpc2
    arm-at91sam9260ek arm-pleb mips-ddb5477 powerpc-mpc8272_ads
    arm-at91sam9261ek arm-pnx4008 mips-decstation powerpc-mpc8313_rdb
    arm-at91sam9263ek arm-pxa255-idp mips-e55 powerpc-mpc832x_mds
    arm-at91sam9rlek arm-realview mips-emma2rh powerpc-mpc832x_rdb
    arm-ateb9200 arm-realview-smp mips-excite powerpc-mpc834x_itx
    arm-badge4 arm-rpc mips-fulong powerpc-mpc834x_itxgp
    arm-carmeva arm-s3c2410 mips-ip22 powerpc-mpc834x_mds
    arm-cerfcube arm-shannon mips-ip27 powerpc-mpc836x_mds
    arm-clps7500 arm-shark mips-ip32 powerpc-mpc8540_ads
    arm-collie arm-simpad mips-jazz powerpc-mpc8544_ds
    arm-corgi arm-spitz mips-jmr3927 powerpc-mpc8560_ads
    arm-csb337 arm-trizeps4 mips-malta powerpc-mpc8568mds
    arm-csb637 arm-versatile mips-mipssim powerpc-mpc85xx_cds
    arm-ebsa110 i386 mips-mpc30x powerpc-mpc8641_hpcn
    arm-edb7211 i386-allnoconfig mips-msp71xx powerpc-mpc866_ads
    arm-em_x270 i386-defconfig mips-ocelot powerpc-mpc885_ads
    arm-ep93xx i386-up mips-pb1100 powerpc-pasemi
    arm-footbridge ia64 mips-pb1500 powerpc-pmac32
    arm-fortunet ia64-allnoconfig mips-pb1550 powerpc-ppc64
    arm-h3600 ia64-bigsur mips-pnx8550-jbs powerpc-prpmc2800
    arm-h7201 ia64-defconfig mips-pnx8550-stb810 powerpc-ps3
    arm-h7202 ia64-gensparse mips-qemu powerpc-pseries
    arm-hackkit ia64-sim mips-rbhma4200 powerpc-up
    arm-integrator ia64-sn2 mips-rbhma4500 s390
    arm-iop13xx ia64-tiger mips-rm200 s390-allnoconfig
    arm-iop32x ia64-up mips-sb1250-swarm s390-defconfig
    arm-iop33x ia64-zx1 mips-sead s390-up
    arm-ixp2000 m68k mips-tb0219 sparc
    arm-ixp23xx m68k-amiga mips-tb0226 sparc-allnoconfig
    arm-ixp4xx m68k-apollo mips-tb0287 sparc-defconfig
    arm-jornada720 m68k-atari mips-workpad sparc-up
    arm-kafa m68k-bvme6000 mips-wrppmc sparc64
    arm-kb9202 m68k-hp300 mips-yosemite sparc64-allnoconfig
    arm-ks8695 m68k-mac parisc sparc64-defconfig
    arm-lart m68k-mvme147 parisc-allnoconfig sparc64-up
    arm-lpd270 m68k-mvme16x parisc-defconfig um-x86_64
    arm-lpd7a400 m68k-q40 parisc-up x86_64
    arm-lpd7a404 m68k-sun3 powerpc x86_64-allnoconfig
    arm-lubbock m68k-sun3x powerpc-cell x86_64-defconfig
    arm-lusl7200 mips powerpc-celleb x86_64-up
    arm-mainstone mips-atlas powerpc-chrp32

    Signed-off-by: Alexey Dobriyan
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     

10 Jul, 2007

1 commit

  • sched-cfs-v2.6.22-git-v18.patch introduces CPU_IDLE in sched.h.
    This conflict with the already existing define in
    include/asm-s390/processor.h
    Just rename the s390 defines, since they will go away as soon as
    we support CONFIG_NO_HZ instead of our own CONFIG_NO_IDLE_HZ.

    Signed-off-by: Heiko Carstens
    Signed-off-by: Andrew Morton
    Signed-off-by: Ingo Molnar
    Signed-off-by: Martin Schwidefsky

    Heiko Carstens
     

09 May, 2007

1 commit


27 Apr, 2007

1 commit

  • Remove system call glue for sys_clone, sys_fork, sys_vfork, sys_execve,
    sys_sigreturn, sys_rt_sigreturn and sys_sigaltstack. Call do_execve from
    kernel_execve directly, move pt_regs to the right place and branch to
    sysc_return to start the user space program. This removes the last
    in-kernel system call.

    Signed-off-by: Martin Schwidefsky
    Signed-off-by: Heiko Carstens

    Martin Schwidefsky
     

06 Feb, 2007

1 commit

  • This provides a noexec protection on s390 hardware. Our hardware does
    not have any bits left in the pte for a hw noexec bit, so this is a
    different approach using shadow page tables and a special addressing
    mode that allows separate address spaces for code and data.

    As a special feature of our "secondary-space" addressing mode, separate
    page tables can be specified for the translation of data addresses
    (storage operands) and instruction addresses. The shadow page table is
    used for the instruction addresses and the standard page table for the
    data addresses.
    The shadow page table is linked to the standard page table by a pointer
    in page->lru.next of the struct page corresponding to the page that
    contains the standard page table (since page->private is not really
    private with the pte_lock and the page table pages are not in the LRU
    list).
    Depending on the software bits of a pte, it is either inserted into
    both page tables or just into the standard (data) page table. Pages of
    a vma that does not have the VM_EXEC bit set get mapped only in the
    data address space. Any try to execute code on such a page will cause a
    page translation exception. The standard reaction to this is a SIGSEGV
    with two exceptions: the two system call opcodes 0x0a77 (sys_sigreturn)
    and 0x0aad (sys_rt_sigreturn) are allowed. They are stored by the
    kernel to the signal stack frame. Unfortunately, the signal return
    mechanism cannot be modified to use an SA_RESTORER because the
    exception unwinding code depends on the system call opcode stored
    behind the signal stack frame.

    This feature requires that user space is executed in secondary-space
    mode and the kernel in home-space mode, which means that the addressing
    modes need to be switched and that the noexec protection only works
    for user space.
    After switching the addressing modes, we cannot use the mvcp/mvcs
    instructions anymore to copy between kernel and user space. A new
    mvcos instruction has been added to the z9 EC/BC hardware which allows
    to copy between arbitrary address spaces, but on older hardware the
    page tables need to be walked manually.

    Signed-off-by: Gerald Schaefer
    Signed-off-by: Martin Schwidefsky

    Gerald Schaefer
     

28 Sep, 2006

1 commit

  • Major cleanup of all s390 inline assemblies. They now have a common
    coding style. Quite a few have been shortened, mainly by using register
    asm variables. Use of the EX_TABLE macro helps as well. The atomic ops,
    bit ops and locking inlines new use the Q-constraint if a newer gcc
    is used. That results in slightly better code.

    Thanks to Christian Borntraeger for proof reading the changes.

    Signed-off-by: Martin Schwidefsky

    Martin Schwidefsky
     

12 Jul, 2006

1 commit


04 Jul, 2006

1 commit


01 Jul, 2006

1 commit


28 Mar, 2006

1 commit

  • The kernel's implementation of notifier chains is unsafe. There is no
    protection against entries being added to or removed from a chain while the
    chain is in use. The issues were discussed in this thread:

    http://marc.theaimsgroup.com/?l=linux-kernel&m=113018709002036&w=2

    We noticed that notifier chains in the kernel fall into two basic usage
    classes:

    "Blocking" chains are always called from a process context
    and the callout routines are allowed to sleep;

    "Atomic" chains can be called from an atomic context and
    the callout routines are not allowed to sleep.

    We decided to codify this distinction and make it part of the API. Therefore
    this set of patches introduces three new, parallel APIs: one for blocking
    notifiers, one for atomic notifiers, and one for "raw" notifiers (which is
    really just the old API under a new name). New kinds of data structures are
    used for the heads of the chains, and new routines are defined for
    registration, unregistration, and calling a chain. The three APIs are
    explained in include/linux/notifier.h and their implementation is in
    kernel/sys.c.

    With atomic and blocking chains, the implementation guarantees that the chain
    links will not be corrupted and that chain callers will not get messed up by
    entries being added or removed. For raw chains the implementation provides no
    guarantees at all; users of this API must provide their own protections. (The
    idea was that situations may come up where the assumptions of the atomic and
    blocking APIs are not appropriate, so it should be possible for users to
    handle these things in their own way.)

    There are some limitations, which should not be too hard to live with. For
    atomic/blocking chains, registration and unregistration must always be done in
    a process context since the chain is protected by a mutex/rwsem. Also, a
    callout routine for a non-raw chain must not try to register or unregister
    entries on its own chain. (This did happen in a couple of places and the code
    had to be changed to avoid it.)

    Since atomic chains may be called from within an NMI handler, they cannot use
    spinlocks for synchronization. Instead we use RCU. The overhead falls almost
    entirely in the unregister routine, which is okay since unregistration is much
    less frequent that calling a chain.

    Here is the list of chains that we adjusted and their classifications. None
    of them use the raw API, so for the moment it is only a placeholder.

    ATOMIC CHAINS
    -------------
    arch/i386/kernel/traps.c: i386die_chain
    arch/ia64/kernel/traps.c: ia64die_chain
    arch/powerpc/kernel/traps.c: powerpc_die_chain
    arch/sparc64/kernel/traps.c: sparc64die_chain
    arch/x86_64/kernel/traps.c: die_chain
    drivers/char/ipmi/ipmi_si_intf.c: xaction_notifier_list
    kernel/panic.c: panic_notifier_list
    kernel/profile.c: task_free_notifier
    net/bluetooth/hci_core.c: hci_notifier
    net/ipv4/netfilter/ip_conntrack_core.c: ip_conntrack_chain
    net/ipv4/netfilter/ip_conntrack_core.c: ip_conntrack_expect_chain
    net/ipv6/addrconf.c: inet6addr_chain
    net/netfilter/nf_conntrack_core.c: nf_conntrack_chain
    net/netfilter/nf_conntrack_core.c: nf_conntrack_expect_chain
    net/netlink/af_netlink.c: netlink_chain

    BLOCKING CHAINS
    ---------------
    arch/powerpc/platforms/pseries/reconfig.c: pSeries_reconfig_chain
    arch/s390/kernel/process.c: idle_chain
    arch/x86_64/kernel/process.c idle_notifier
    drivers/base/memory.c: memory_chain
    drivers/cpufreq/cpufreq.c cpufreq_policy_notifier_list
    drivers/cpufreq/cpufreq.c cpufreq_transition_notifier_list
    drivers/macintosh/adb.c: adb_client_list
    drivers/macintosh/via-pmu.c sleep_notifier_list
    drivers/macintosh/via-pmu68k.c sleep_notifier_list
    drivers/macintosh/windfarm_core.c wf_client_list
    drivers/usb/core/notify.c usb_notifier_list
    drivers/video/fbmem.c fb_notifier_list
    kernel/cpu.c cpu_chain
    kernel/module.c module_notify_list
    kernel/profile.c munmap_notifier
    kernel/profile.c task_exit_notifier
    kernel/sys.c reboot_notifier_list
    net/core/dev.c netdev_chain
    net/decnet/dn_dev.c: dnaddr_chain
    net/ipv4/devinet.c: inetaddr_chain

    It's possible that some of these classifications are wrong. If they are,
    please let us know or submit a patch to fix them. Note that any chain that
    gets called very frequently should be atomic, because the rwsem read-locking
    used for blocking chains is very likely to incur cache misses on SMP systems.
    (However, if the chain's callout routines may sleep then the chain cannot be
    atomic.)

    The patch set was written by Alan Stern and Chandra Seetharaman, incorporating
    material written by Keith Owens and suggestions from Paul McKenney and Andrew
    Morton.

    [jes@sgi.com: restructure the notifier chain initialization macros]
    Signed-off-by: Alan Stern
    Signed-off-by: Chandra Seetharaman
    Signed-off-by: Jes Sorensen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alan Stern