31 Aug, 2016

1 commit

  • There are three usercopy warnings which are currently being silenced for
    gcc 4.6 and newer:

    1) "copy_from_user() buffer size is too small" compile warning/error

    This is a static warning which happens when object size and copy size
    are both const, and copy size > object size. I didn't see any false
    positives for this one. So the function warning attribute seems to
    be working fine here.

    Note this scenario is always a bug and so I think it should be
    changed to *always* be an error, regardless of
    CONFIG_DEBUG_STRICT_USER_COPY_CHECKS.

    2) "copy_from_user() buffer size is not provably correct" compile warning

    This is another static warning which happens when I enable
    __compiletime_object_size() for new compilers (and
    CONFIG_DEBUG_STRICT_USER_COPY_CHECKS). It happens when object size
    is const, but copy size is *not*. In this case there's no way to
    compare the two at build time, so it gives the warning. (Note the
    warning is a byproduct of the fact that gcc has no way of knowing
    whether the overflow function will be called, so the call isn't dead
    code and the warning attribute is activated.)

    So this warning seems to only indicate "this is an unusual pattern,
    maybe you should check it out" rather than "this is a bug".

    I get 102(!) of these warnings with allyesconfig and the
    __compiletime_object_size() gcc check removed. I don't know if there
    are any real bugs hiding in there, but from looking at a small
    sample, I didn't see any. According to Kees, it does sometimes find
    real bugs. But the false positive rate seems high.

    3) "Buffer overflow detected" runtime warning

    This is a runtime warning where object size is const, and copy size >
    object size.

    All three warnings (both static and runtime) were completely disabled
    for gcc 4.6 with the following commit:

    2fb0815c9ee6 ("gcc4: disable __compiletime_object_size for GCC 4.6+")

    That commit mistakenly assumed that the false positives were caused by a
    gcc bug in __compiletime_object_size(). But in fact,
    __compiletime_object_size() seems to be working fine. The false
    positives were instead triggered by #2 above. (Though I don't have an
    explanation for why the warnings supposedly only started showing up in
    gcc 4.6.)

    So remove warning #2 to get rid of all the false positives, and re-enable
    warnings #1 and #3 by reverting the above commit.

    Furthermore, since #1 is a real bug which is detected at compile time,
    upgrade it to always be an error.

    Having done all that, CONFIG_DEBUG_STRICT_USER_COPY_CHECKS is no longer
    needed.

    Signed-off-by: Josh Poimboeuf
    Cc: Kees Cook
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: "H . Peter Anvin"
    Cc: Andy Lutomirski
    Cc: Steven Rostedt
    Cc: Brian Gerst
    Cc: Peter Zijlstra
    Cc: Frederic Weisbecker
    Cc: Byungchul Park
    Cc: Nilay Vaish
    Signed-off-by: Linus Torvalds

    Josh Poimboeuf
     

10 Aug, 2016

1 commit

  • This patch aims to get rid of endianness in queued_write_unlock(). We
    want to set __qrwlock->wmode to NULL, however the address is not
    &lock->cnts in big endian machine. That causes queued_write_unlock()
    write NULL to the wrong field of __qrwlock.

    So implement __qrwlock_write_byte() which returns the correct
    __qrwlock->wmode address.

    Suggested-by: Peter Zijlstra (Intel)
    Signed-off-by: Pan Xinhui
    Signed-off-by: Peter Zijlstra (Intel)
    Cc: Andrew Morton
    Cc: Linus Torvalds
    Cc: Paul E. McKenney
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: Waiman.Long@hpe.com
    Cc: arnd@arndb.de
    Cc: boqun.feng@gmail.com
    Cc: will.deacon@arm.com
    Link: http://lkml.kernel.org/r/1468835259-4486-1-git-send-email-xinhui.pan@linux.vnet.ibm.com
    Signed-off-by: Ingo Molnar

    pan xinhui
     

05 Aug, 2016

1 commit

  • Pull RTC updates from Alexandre Belloni:
    "RTC for 4.8

    Cleanups:
    - huge cleanup of rtc-generic and char/genrtc this allowed to cleanup
    rtc-cmos, rtc-sh, rtc-m68k, rtc-powerpc and rtc-parisc
    - move mn10300 to rtc-cmos

    Subsystem:
    - fix wakealarms after hibernate
    - multiples fixes for rctest
    - simplify implementations of .read_alarm

    New drivers:
    - Maxim MAX6916

    Drivers:
    - ds1307: fix weekday
    - m41t80: add wakeup support
    - pcf85063: add support for PCF85063A variant
    - rv8803: extend i2c fix and other fixes
    - s35390a: fix alarm reading, this fixes instant reboot after
    shutdown for QNAP TS-41x
    - s3c: clock fixes"

    * tag 'rtc-4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (65 commits)
    rtc: rv8803: Clear V1F when setting the time
    rtc: rv8803: Stop the clock while setting the time
    rtc: rv8803: Always apply the I²C workaround
    rtc: rv8803: Fix read day of week
    rtc: rv8803: Remove the check for valid time
    rtc: rv8803: Kconfig: Indicate rx8900 support
    rtc: asm9260: remove .owner field for driver
    rtc: at91sam9: Fix missing spin_lock_init()
    rtc: m41t80: add suspend handlers for alarm IRQ
    rtc: m41t80: make it a real error message
    rtc: pcf85063: Add support for the PCF85063A device
    rtc: pcf85063: fix year range
    rtc: hym8563: in .read_alarm set .tm_sec to 0 to signal minute accuracy
    rtc: explicitly set tm_sec = 0 for drivers with minute accurancy
    rtc: s3c: Add s3c_rtc_{enable/disable}_clk in s3c_rtc_setfreq()
    rtc: s3c: Remove unnecessary call to disable already disabled clock
    rtc: abx80x: use devm_add_action_or_reset()
    rtc: m41t80: use devm_add_action_or_reset()
    rtc: fix a typo and reduce three empty lines to one
    rtc: s35390a: improve two comments in .set_alarm
    ...

    Linus Torvalds
     

03 Aug, 2016

1 commit

  • Pull kbuild updates from Michal Marek:

    - GCC plugin support by Emese Revfy from grsecurity, with a fixup from
    Kees Cook. The plugins are meant to be used for static analysis of
    the kernel code. Two plugins are provided already.

    - reduction of the gcc commandline by Arnd Bergmann.

    - IS_ENABLED / IS_REACHABLE macro enhancements by Masahiro Yamada

    - bin2c fix by Michael Tautschnig

    - setlocalversion fix by Wolfram Sang

    * 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
    gcc-plugins: disable under COMPILE_TEST
    kbuild: Abort build on bad stack protector flag
    scripts: Fix size mismatch of kexec_purgatory_size
    kbuild: make samples depend on headers_install
    Kbuild: don't add obj tree in additional includes
    Kbuild: arch: look for generated headers in obtree
    Kbuild: always prefix objtree in LINUXINCLUDE
    Kbuild: avoid duplicate include path
    Kbuild: don't add ../../ to include path
    vmlinux.lds.h: replace config_enabled() with IS_ENABLED()
    kconfig.h: allow to use IS_{ENABLE,REACHABLE} in macro expansion
    kconfig.h: use already defined macros for IS_REACHABLE() define
    export.h: use __is_defined() to check if __KSYM_* is defined
    kconfig.h: use __is_defined() to check if MODULE is defined
    kbuild: setlocalversion: print error to STDERR
    Add sancov plugin
    Add Cyclomatic complexity GCC plugin
    GCC plugin infrastructure
    Shared library support

    Linus Torvalds
     

27 Jul, 2016

5 commits

  • Merge updates from Andrew Morton:

    - a few misc bits

    - ocfs2

    - most(?) of MM

    * emailed patches from Andrew Morton : (125 commits)
    thp: fix comments of __pmd_trans_huge_lock()
    cgroup: remove unnecessary 0 check from css_from_id()
    cgroup: fix idr leak for the first cgroup root
    mm: memcontrol: fix documentation for compound parameter
    mm: memcontrol: remove BUG_ON in uncharge_list
    mm: fix build warnings in
    mm, thp: convert from optimistic swapin collapsing to conservative
    mm, thp: fix comment inconsistency for swapin readahead functions
    thp: update Documentation/{vm/transhuge,filesystems/proc}.txt
    shmem: split huge pages beyond i_size under memory pressure
    thp: introduce CONFIG_TRANSPARENT_HUGE_PAGECACHE
    khugepaged: add support of collapse for tmpfs/shmem pages
    shmem: make shmem_inode_info::lock irq-safe
    khugepaged: move up_read(mmap_sem) out of khugepaged_alloc_page()
    thp: extract khugepaged from mm/huge_memory.c
    shmem, thp: respect MADV_{NO,}HUGEPAGE for file mappings
    shmem: add huge pages support
    shmem: get_unmapped_area align huge page
    shmem: prepare huge= mount option and sysfs knob
    mm, rmap: account shmem thp pages
    ...

    Linus Torvalds
     
  • This allows an arch which needs to do special handing with respect to
    different page size when flushing tlb to implement the same in mmu
    gather.

    Link: http://lkml.kernel.org/r/1465049193-22197-3-git-send-email-aneesh.kumar@linux.vnet.ibm.com
    Signed-off-by: Aneesh Kumar K.V
    Cc: Benjamin Herrenschmidt
    Cc: Michael Ellerman
    Cc: Hugh Dickins
    Cc: "Kirill A. Shutemov"
    Cc: Andrea Arcangeli
    Cc: Joonsoo Kim
    Cc: Mel Gorman
    Cc: David Rientjes
    Cc: Vlastimil Babka
    Cc: Minchan Kim
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Aneesh Kumar K.V
     
  • This updates the generic and arch specific implementation to return true
    if we need to do a tlb flush. That means if a __tlb_remove_page
    indicate a flush is needed, the page we try to remove need to be tracked
    and added again after the flush. We need to track it because we have
    already update the pte to none and we can't just loop back.

    This change is done to enable us to do a tlb_flush when we try to flush
    a range that consists of different page sizes. For architectures like
    ppc64, we can do a range based tlb flush and we need to track page size
    for that. When we try to remove a huge page, we will force a tlb flush
    and starts a new mmu gather.

    [aneesh.kumar@linux.vnet.ibm.com: mm-change-the-interface-for-__tlb_remove_page-v3]
    Link: http://lkml.kernel.org/r/1465049193-22197-2-git-send-email-aneesh.kumar@linux.vnet.ibm.com
    Link: http://lkml.kernel.org/r/1464860389-29019-2-git-send-email-aneesh.kumar@linux.vnet.ibm.com
    Signed-off-by: Aneesh Kumar K.V
    Cc: Benjamin Herrenschmidt
    Cc: Michael Ellerman
    Cc: Hugh Dickins
    Cc: "Kirill A. Shutemov"
    Cc: Andrea Arcangeli
    Cc: Joonsoo Kim
    Cc: Mel Gorman
    Cc: David Rientjes
    Cc: Vlastimil Babka
    Cc: Minchan Kim
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Aneesh Kumar K.V
     
  • Pull crypto updates from Herbert Xu:
    "Here is the crypto update for 4.8:

    API:
    - first part of skcipher low-level conversions
    - add KPP (Key-agreement Protocol Primitives) interface.

    Algorithms:
    - fix IPsec/cryptd reordering issues that affects aesni
    - RSA no longer does explicit leading zero removal
    - add SHA3
    - add DH
    - add ECDH
    - improve DRBG performance by not doing CTR by hand

    Drivers:
    - add x86 AVX2 multibuffer SHA256/512
    - add POWER8 optimised crc32c
    - add xts support to vmx
    - add DH support to qat
    - add RSA support to caam
    - add Layerscape support to caam
    - add SEC1 AEAD support to talitos
    - improve performance by chaining requests in marvell/cesa
    - add support for Araneus Alea I USB RNG
    - add support for Broadcom BCM5301 RNG
    - add support for Amlogic Meson RNG
    - add support Broadcom NSP SoC RNG"

    * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (180 commits)
    crypto: vmx - Fix aes_p8_xts_decrypt build failure
    crypto: vmx - Ignore generated files
    crypto: vmx - Adding support for XTS
    crypto: vmx - Adding asm subroutines for XTS
    crypto: skcipher - add comment for skcipher_alg->base
    crypto: testmgr - Print akcipher algorithm name
    crypto: marvell - Fix wrong flag used for GFP in mv_cesa_dma_add_iv_op
    crypto: nx - off by one bug in nx_of_update_msc()
    crypto: rsa-pkcs1pad - fix rsa-pkcs1pad request struct
    crypto: scatterwalk - Inline start/map/done
    crypto: scatterwalk - Remove unnecessary BUG in scatterwalk_start
    crypto: scatterwalk - Remove unnecessary advance in scatterwalk_pagedone
    crypto: scatterwalk - Fix test in scatterwalk_done
    crypto: api - Optimise away crypto_yield when hard preemption is on
    crypto: scatterwalk - add no-copy support to copychunks
    crypto: scatterwalk - Remove scatterwalk_bytes_sglen
    crypto: omap - Stop using crypto scatterwalk_bytes_sglen
    crypto: skcipher - Remove top-level givcipher interface
    crypto: user - Remove crypto_lookup_skcipher call
    crypto: cts - Convert to skcipher
    ...

    Linus Torvalds
     
  • Pull s390 updates from Martin Schwidefsky:
    "There are a couple of new things for s390 with this merge request:

    - a new scheduling domain "drawer" is added to reflect the unusual
    topology found on z13 machines. Performance tests showed up to 8
    percent gain with the additional domain.

    - the new crc-32 checksum crypto module uses the vector-galois-field
    multiply and sum SIMD instruction to speed up crc-32 and crc-32c.

    - proper __ro_after_init support, this requires RO_AFTER_INIT_DATA in
    the generic vmlinux.lds linker script definitions.

    - kcov instrumentation support. A prerequisite for that is the
    inline assembly basic block cleanup, which is the reason for the
    net/iucv/iucv.c change.

    - support for 2GB pages is added to the hugetlbfs backend.

    Then there are two removals:

    - the oprofile hardware sampling support is dead code and is removed.
    The oprofile user space uses the perf interface nowadays.

    - the ETR clock synchronization is removed, this has been superseeded
    be the STP clock synchronization. And it always has been
    "interesting" code..

    And the usual bug fixes and cleanups"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: (82 commits)
    s390/pci: Delete an unnecessary check before the function call "pci_dev_put"
    s390/smp: clean up a condition
    s390/cio/chp : Remove deprecated create_singlethread_workqueue
    s390/chsc: improve channel path descriptor determination
    s390/chsc: sanitize fmt check for chp_desc determination
    s390/cio: make fmt1 channel path descriptor optional
    s390/chsc: fix ioctl CHSC_INFO_CU command
    s390/cio/device_ops: fix kernel doc
    s390/cio: allow to reset channel measurement block
    s390/console: Make preferred console handling more consistent
    s390/mm: fix gmap tlb flush issues
    s390/mm: add support for 2GB hugepages
    s390: have unique symbol for __switch_to address
    s390/cpuinfo: show maximum thread id
    s390/ptrace: clarify bits in the per_struct
    s390: stack address vs thread_info
    s390: remove pointless load within __switch_to
    s390: enable kcov support
    s390/cpumf: use basic block for ecctr inline assembly
    s390/hypfs: use basic block for diag inline assembly
    ...

    Linus Torvalds
     

26 Jul, 2016

2 commits

  • Pull NOHZ updates from Ingo Molnar:

    - fix system/idle cputime leaked on cputime accounting (all nohz
    configs) (Rik van Riel)

    - remove the messy, ad-hoc irqtime account on nohz-full and make it
    compatible with CONFIG_IRQ_TIME_ACCOUNTING=y instead (Rik van Riel)

    - cleanups (Frederic Weisbecker)

    - remove unecessary irq disablement in the irqtime code (Rik van Riel)

    * 'timers-nohz-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    sched/cputime: Drop local_irq_save/restore from irqtime_account_irq()
    sched/cputime: Reorganize vtime native irqtime accounting headers
    sched/cputime: Clean up the old vtime gen irqtime accounting completely
    sched/cputime: Replace VTIME_GEN irq time code with IRQ_TIME_ACCOUNTING code
    sched/cputime: Count actually elapsed irq & softirq time

    Linus Torvalds
     
  • Pull locking updates from Ingo Molnar:
    "The locking tree was busier in this cycle than the usual pattern - a
    couple of major projects happened to coincide.

    The main changes are:

    - implement the atomic_fetch_{add,sub,and,or,xor}() API natively
    across all SMP architectures (Peter Zijlstra)

    - add atomic_fetch_{inc/dec}() as well, using the generic primitives
    (Davidlohr Bueso)

    - optimize various aspects of rwsems (Jason Low, Davidlohr Bueso,
    Waiman Long)

    - optimize smp_cond_load_acquire() on arm64 and implement LSE based
    atomic{,64}_fetch_{add,sub,and,andnot,or,xor}{,_relaxed,_acquire,_release}()
    on arm64 (Will Deacon)

    - introduce smp_acquire__after_ctrl_dep() and fix various barrier
    mis-uses and bugs (Peter Zijlstra)

    - after discovering ancient spin_unlock_wait() barrier bugs in its
    implementation and usage, strengthen its semantics and update/fix
    usage sites (Peter Zijlstra)

    - optimize mutex_trylock() fastpath (Peter Zijlstra)

    - ... misc fixes and cleanups"

    * 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (67 commits)
    locking/atomic: Introduce inc/dec variants for the atomic_fetch_$op() API
    locking/barriers, arch/arm64: Implement LDXR+WFE based smp_cond_load_acquire()
    locking/static_keys: Fix non static symbol Sparse warning
    locking/qspinlock: Use __this_cpu_dec() instead of full-blown this_cpu_dec()
    locking/atomic, arch/tile: Fix tilepro build
    locking/atomic, arch/m68k: Remove comment
    locking/atomic, arch/arc: Fix build
    locking/Documentation: Clarify limited control-dependency scope
    locking/atomic, arch/rwsem: Employ atomic_long_fetch_add()
    locking/atomic, arch/qrwlock: Employ atomic_fetch_add_acquire()
    locking/atomic, arch/mips: Convert to _relaxed atomics
    locking/atomic, arch/alpha: Convert to _relaxed atomics
    locking/atomic: Remove the deprecated atomic_{set,clear}_mask() functions
    locking/atomic: Remove linux/atomic.h:atomic_fetch_or()
    locking/atomic: Implement atomic{,64,_long}_fetch_{add,sub,and,andnot,or,xor}{,_relaxed,_acquire,_release}()
    locking/atomic: Fix atomic64_relaxed() bits
    locking/atomic, arch/xtensa: Implement atomic_fetch_{add,sub,and,or,xor}()
    locking/atomic, arch/x86: Implement atomic{,64}_fetch_{add,sub,and,or,xor}()
    locking/atomic, arch/tile: Implement atomic{,64}_fetch_{add,sub,and,or,xor}()
    locking/atomic, arch/sparc: Implement atomic{,64}_fetch_{add,sub,and,or,xor}()
    ...

    Linus Torvalds
     

15 Jul, 2016

1 commit

  • If CONFIG_KASAN is enabled and gcc is configured with
    --disable-initfini-array and/or gold linker is used, gcc emits
    .ctors/.dtors and .text.startup/.text.exit sections instead of
    .init_array/.fini_array. .dtors section is not explicitly accounted in
    the linker script and messes vvar/percpu layout.

    We want:
    ffffffff822bfd80 D _edata
    ffffffff822c0000 D __vvar_beginning_hack
    ffffffff822c0000 A __vvar_page
    ffffffff822c0080 0000000000000098 D vsyscall_gtod_data
    ffffffff822c1000 A __init_begin
    ffffffff822c1000 D init_per_cpu__irq_stack_union
    ffffffff822c1000 A __per_cpu_load
    ffffffff822d3000 D init_per_cpu__gdt_page

    We got:
    ffffffff8279a600 D _edata
    ffffffff8279b000 A __vvar_page
    ffffffff8279c000 A __init_begin
    ffffffff8279c000 D init_per_cpu__irq_stack_union
    ffffffff8279c000 A __per_cpu_load
    ffffffff8279e000 D __vvar_beginning_hack
    ffffffff8279e080 0000000000000098 D vsyscall_gtod_data
    ffffffff827ae000 D init_per_cpu__gdt_page

    This happens because __vvar_page and .vvar get different addresses in
    arch/x86/kernel/vmlinux.lds.S:

    . = ALIGN(PAGE_SIZE);
    __vvar_page = .;

    .vvar : AT(ADDR(.vvar) - LOAD_OFFSET) {
    /* work around gold bug 13023 */
    __vvar_beginning_hack = .;

    Discard .dtors/.fini_array/.text.exit, since we don't call dtors.
    Merge .text.startup into init text.

    Link: http://lkml.kernel.org/r/1467386363-120030-1-git-send-email-dvyukov@google.com
    Signed-off-by: Dmitry Vyukov
    Reviewed-by: Andrey Ryabinin
    Cc: [4.0+]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dmitry Vyukov
     

14 Jul, 2016

1 commit

  • Currently, if there was any irq or softirq time during 'ticks'
    jiffies, the entire period will be accounted as irq or softirq
    time.

    This is inaccurate if only a subset of the time was actually spent
    handling irqs, and could conceivably mis-count all of the ticks during
    a period as irq time, when there was some irq and some softirq time.

    This can actually happen when irqtime_account_process_tick is called
    from account_idle_ticks, which can pass a larger number of ticks down
    all at once.

    Fix this by changing irqtime_account_hi_update(), irqtime_account_si_update(),
    and steal_account_process_ticks() to work with cputime_t time units, and
    return the amount of time spent in each mode.

    Rename steal_account_process_ticks() to steal_account_process_time(), to
    reflect that time is now accounted in cputime_t, instead of ticks.

    Additionally, have irqtime_account_process_tick() take into account how
    much time was spent in each of steal, irq, and softirq time.

    The latter could help improve the accuracy of cputime
    accounting when returning from idle on a NO_HZ_IDLE CPU.

    Properly accounting how much time was spent in hardirq and
    softirq time will also allow the NO_HZ_FULL code to re-use
    these same functions for hardirq and softirq accounting.

    Signed-off-by: Rik van Riel
    [ Make nsecs_to_cputime64() actually return cputime64_t. ]
    Signed-off-by: Frederic Weisbecker
    Cc: Linus Torvalds
    Cc: Mike Galbraith
    Cc: Paolo Bonzini
    Cc: Peter Zijlstra
    Cc: Radim Krcmar
    Cc: Thomas Gleixner
    Cc: Wanpeng Li
    Link: http://lkml.kernel.org/r/1468421405-20056-2-git-send-email-fweisbec@gmail.com
    Signed-off-by: Ingo Molnar

    Rik van Riel
     

07 Jul, 2016

1 commit

  • With the inclusion of atomic FETCH-OP variants, many places in the
    kernel can make use of atomic_fetch_$op() to avoid the callers that
    need to compute the value/state _before_ the operation.

    Peter Zijlstra laid out the machinery but we are still missing the
    simpler dec,inc() calls (which future patches will make use of).

    This patch only deals with the generic code, as at least right now
    no arch actually implement them -- which is similar to what the
    OP-RETURN primitives currently do.

    Signed-off-by: Davidlohr Bueso
    Signed-off-by: Peter Zijlstra (Intel)
    Cc: Andrew Morton
    Cc: James.Bottomley@HansenPartnership.com
    Cc: Linus Torvalds
    Cc: Paul E. McKenney
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: awalls@md.metrocast.net
    Cc: bp@alien8.de
    Cc: cw00.choi@samsung.com
    Cc: davem@davemloft.net
    Cc: dledford@redhat.com
    Cc: dougthompson@xmission.com
    Cc: gregkh@linuxfoundation.org
    Cc: hans.verkuil@cisco.com
    Cc: heiko.carstens@de.ibm.com
    Cc: jikos@kernel.org
    Cc: kys@microsoft.com
    Cc: mchehab@osg.samsung.com
    Cc: pfg@sgi.com
    Cc: schwidefsky@de.ibm.com
    Cc: sean.hefty@intel.com
    Cc: sumit.semwal@linaro.org
    Link: http://lkml.kernel.org/r/20160628215651.GA20048@linux-80c1.suse
    Signed-off-by: Ingo Molnar

    Davidlohr Bueso
     

21 Jun, 2016

1 commit


16 Jun, 2016

2 commits

  • Since all architectures have this implemented now natively, remove this
    dead code.

    Signed-off-by: Peter Zijlstra (Intel)
    Cc: Andrew Morton
    Cc: Linus Torvalds
    Cc: Paul E. McKenney
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: linux-arch@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • …relaxed,_acquire,_release}()

    Now that all the architectures have implemented support for these new
    atomic primitives add on the generic infrastructure to expose and use
    it.

    Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
    Cc: Andrew Morton <akpm@linux-foundation.org>
    Cc: Arnd Bergmann <arnd@arndb.de>
    Cc: Boqun Feng <boqun.feng@gmail.com>
    Cc: Borislav Petkov <bp@suse.de>
    Cc: Davidlohr Bueso <dave@stgolabs.net>
    Cc: Frederic Weisbecker <fweisbec@gmail.com>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Will Deacon <will.deacon@arm.com>
    Cc: linux-arch@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Ingo Molnar <mingo@kernel.org>

    Peter Zijlstra
     

14 Jun, 2016

2 commits

  • This patch updates/fixes all spin_unlock_wait() implementations.

    The update is in semantics; where it previously was only a control
    dependency, we now upgrade to a full load-acquire to match the
    store-release from the spin_unlock() we waited on. This ensures that
    when spin_unlock_wait() returns, we're guaranteed to observe the full
    critical section we waited on.

    This fixes a number of spin_unlock_wait() users that (not
    unreasonably) rely on this.

    I also fixed a number of ticket lock versions to only wait on the
    current lock holder, instead of for a full unlock, as this is
    sufficient.

    Furthermore; again for ticket locks; I added an smp_rmb() in between
    the initial ticket load and the spin loop testing the current value
    because I could not convince myself the address dependency is
    sufficient, esp. if the loads are of different sizes.

    I'm more than happy to remove this smp_rmb() again if people are
    certain the address dependency does indeed work as expected.

    Note: PPC32 will be fixed independently

    Signed-off-by: Peter Zijlstra (Intel)
    Cc: Andrew Morton
    Cc: Linus Torvalds
    Cc: Paul E. McKenney
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: chris@zankel.net
    Cc: cmetcalf@mellanox.com
    Cc: davem@davemloft.net
    Cc: dhowells@redhat.com
    Cc: james.hogan@imgtec.com
    Cc: jejb@parisc-linux.org
    Cc: linux@armlinux.org.uk
    Cc: mpe@ellerman.id.au
    Cc: ralf@linux-mips.org
    Cc: realmz6@gmail.com
    Cc: rkuo@codeaurora.org
    Cc: rth@twiddle.net
    Cc: schwidefsky@de.ibm.com
    Cc: tony.luck@intel.com
    Cc: vgupta@synopsys.com
    Cc: ysato@users.sourceforge.jp
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Since all asm/barrier.h should/must include asm-generic/barrier.h the
    latter is a good place for generic infrastructure like this.

    This also allows archs to override the new smp_acquire__after_ctrl_dep().

    Signed-off-by: Peter Zijlstra (Intel)
    Cc: Andrew Morton
    Cc: Linus Torvalds
    Cc: Paul E. McKenney
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     

13 Jun, 2016

1 commit

  • commit c74ba8b3480d ("arch: Introduce post-init read-only memory")
    introduced the __ro_after_init attribute which allows to add variables
    to the ro_after_init data section.

    This new section was added to rodata, even though it contains writable
    data. This in turn causes problems on architectures which mark the
    page table entries read-only that point to rodata very early.

    This patch allows architectures to implement an own handling of the
    .data..ro_after_init section.
    Usually that would be:
    - mark the rodata section read-only very early
    - mark the ro_after_init section read-only within mark_rodata_ro

    Signed-off-by: Heiko Carstens
    Reviewed-by: Kees Cook
    Signed-off-by: Martin Schwidefsky

    Heiko Carstens
     

08 Jun, 2016

5 commits

  • The existing version uses a heavy barrier while only release semantics
    is required. So use atomic_sub_return_release() instead.

    Suggested-by: Peter Zijlstra (Intel)
    Signed-off-by: Pan Xinhui
    Signed-off-by: Peter Zijlstra (Intel)
    Cc: Andrew Morton
    Cc: Linus Torvalds
    Cc: Paul E. McKenney
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: arnd@arndb.de
    Cc: waiman.long@hp.com
    Link: http://lkml.kernel.org/r/1464943094-3129-1-git-send-email-xinhui.pan@linux.vnet.ibm.com
    Signed-off-by: Ingo Molnar

    Pan Xinhui
     
  • A while back Viro posted a number of 'interesting' mutex_is_locked()
    users on IRC, one of those was RCU.

    RCU seems to use mutex_is_locked() to avoid doing mutex_trylock(), the
    regular load before modify pattern.

    While the use isn't wrong per se, its curious in that its needed at all,
    mutex_trylock() should be good enough on its own to avoid the pointless
    cacheline bounces.

    So fix those and remove the mutex_is_locked() (ab)use from RCU.

    Reported-by: Al Viro
    Signed-off-by: Peter Zijlstra (Intel)
    Acked-by: Paul McKenney
    Acked-by: Davidlohr Bueso
    Cc: Andrew Morton
    Cc: Linus Torvalds
    Cc: Paul E. McKenney
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: Waiman Long
    Link: http://lkml.kernel.org/r/20160601185815.GW3190@twins.programming.kicks-ass.net
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • The rwsem-xadd count has been converted to an atomic variable and the
    rwsem code now directly uses atomic_long_add() and
    atomic_long_add_return(), so we can remove the arch implementations of
    rwsem_atomic_add() and rwsem_atomic_update().

    Signed-off-by: Jason Low
    Signed-off-by: Peter Zijlstra (Intel)
    Cc: Andrew Morton
    Cc: Arnd Bergmann
    Cc: Christoph Lameter
    Cc: Davidlohr Bueso
    Cc: Fenghua Yu
    Cc: Heiko Carstens
    Cc: Ivan Kokshaysky
    Cc: Jason Low
    Cc: Linus Torvalds
    Cc: Martin Schwidefsky
    Cc: Matt Turner
    Cc: Paul E. McKenney
    Cc: Peter Hurley
    Cc: Peter Zijlstra
    Cc: Richard Henderson
    Cc: Terry Rudd
    Cc: Thomas Gleixner
    Cc: Tim Chen
    Cc: Tony Luck
    Cc: Waiman Long
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Ingo Molnar

    Jason Low
     
  • Convert the rwsem count variable to an atomic_long_t since we use it
    as an atomic variable. This also allows us to remove the
    rwsem_atomic_{add,update}() "abstraction" which would now be an unnecesary
    level of indirection. In follow up patches, we also remove the
    rwsem_atomic_{add,update}() definitions across the various architectures.

    Suggested-by: Peter Zijlstra
    Signed-off-by: Jason Low
    [ Build warning fixes on various architectures. ]
    Signed-off-by: Peter Zijlstra (Intel)
    Cc: Andrew Morton
    Cc: Davidlohr Bueso
    Cc: Fenghua Yu
    Cc: Heiko Carstens
    Cc: Jason Low
    Cc: Linus Torvalds
    Cc: Martin Schwidefsky
    Cc: Paul E. McKenney
    Cc: Peter Hurley
    Cc: Terry Rudd
    Cc: Thomas Gleixner
    Cc: Tim Chen
    Cc: Tony Luck
    Cc: Waiman Long
    Link: http://lkml.kernel.org/r/1465017963-4839-2-git-send-email-jason.low2@hpe.com
    Signed-off-by: Ingo Molnar

    Jason Low
     
  • While this prior commit:

    54cf809b9512 ("locking,qspinlock: Fix spin_is_locked() and spin_unlock_wait()")

    ... fixes spin_is_locked() and spin_unlock_wait() for the usage
    in ipc/sem and netfilter, it does not in fact work right for the
    usage in task_work and futex.

    So while the 2 locks crossed problem:

    spin_lock(A) spin_lock(B)
    if (!spin_is_locked(B)) spin_unlock_wait(A)
    foo() foo();

    ... works with the smp_mb() injected by both spin_is_locked() and
    spin_unlock_wait(), this is not sufficient for:

    flag = 1;
    smp_mb(); spin_lock()
    spin_unlock_wait() if (!flag)
    // add to lockless list
    // iterate lockless list

    ... because in this scenario, the store from spin_lock() can be delayed
    past the load of flag, uncrossing the variables and loosing the
    guarantee.

    This patch reworks spin_is_locked() and spin_unlock_wait() to work in
    both cases by exploiting the observation that while the lock byte
    store can be delayed, the contender must have registered itself
    visibly in other state contained in the word.

    It also allows for architectures to override both functions, as PPC
    and ARM64 have an additional issue for which we currently have no
    generic solution.

    Signed-off-by: Peter Zijlstra (Intel)
    Cc: Andrew Morton
    Cc: Boqun Feng
    Cc: Davidlohr Bueso
    Cc: Giovanni Gherdovich
    Cc: Linus Torvalds
    Cc: Pan Xinhui
    Cc: Paul E. McKenney
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: Waiman Long
    Cc: Will Deacon
    Cc: stable@vger.kernel.org # v4.2 and later
    Fixes: 54cf809b9512 ("locking,qspinlock: Fix spin_is_locked() and spin_unlock_wait()")
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     

04 Jun, 2016

2 commits

  • No architecture uses the genrtc driver any more, so let's kill it off
    for good. This now also includes asm-generic/rtc.h, which is otherwise
    completely unused.

    Signed-off-by: Arnd Bergmann
    Acked-by: Geert Uytterhoeven
    Signed-off-by: Alexandre Belloni

    Arnd Bergmann
     
  • Drivers should not really include stuff from asm-generic directly,
    and the PC-style cmos rtc driver does this in order to reuse the
    mc146818 implementation of get_rtc_time/set_rtc_time rather than
    the architecture specific one for the architecture it gets built for.

    To make it more obvious what is going on, this moves and renames the
    two functions into include/linux/mc146818rtc.h, which holds the
    other mc146818 specific code. Ideally it would be in a .c file,
    but that would require extra infrastructure as the functions are
    called by multiple drivers with conflicting dependencies.

    With this change, the asm-generic/rtc.h header also becomes much
    more generic, so it can be reused more easily across any architecture
    that still relies on the genrtc driver.

    The only caller of the internal __get_rtc_time/__set_rtc_time
    functions is in arch/alpha/kernel/rtc.c, and we just change those
    over to the new naming.

    Signed-off-by: Arnd Bergmann
    Acked-by: Geert Uytterhoeven
    Signed-off-by: Alexandre Belloni

    Arnd Bergmann
     

31 May, 2016

2 commits

  • This will allow device drivers to consistently use io{read,write}XX
    also for 64-bit accesses.

    Acked-by: Arnd Bergmann
    Signed-off-by: Horia Geantă
    Signed-off-by: Herbert Xu

    Horia Geantă
     
  • While reviewing the addition of io{read,write}64be accessors, Arnd

    -finds a potential problem:
    "If an architecture overrides readq/writeq to have barriers but does
    not override ioread64be/iowrite64be, this will lack the barriers and
    behave differently from the little-endian version. I think the only
    affected architecture is ARC, since ARM and ARM64 both override the
    big-endian accessors to have the correct barriers, and all others
    don't use barriers at all."

    -suggests a fix for the same problem in existing code (16/32-bit
    accessors); the fix leads "to a double-swap on architectures that
    don't override the io{read,write}{16,32}be accessors, but it will
    work correctly on all architectures without them having to override
    these accessors."

    Suggested-by: Arnd Bergmann
    Acked-by: Arnd Bergmann
    Signed-off-by: Horia Geantă
    Signed-off-by: Herbert Xu

    Horia Geantă
     

26 May, 2016

1 commit


21 May, 2016

1 commit

  • Similar to commits:

    51d7d5205d33 ("powerpc: Add smp_mb() to arch_spin_is_locked()")
    d86b8da04dfa ("arm64: spinlock: serialise spin_unlock_wait against concurrent lockers")

    qspinlock suffers from the fact that the _Q_LOCKED_VAL store is
    unordered inside the ACQUIRE of the lock.

    And while this is not a problem for the regular mutual exclusive
    critical section usage of spinlocks, it breaks creative locking like:

    spin_lock(A) spin_lock(B)
    spin_unlock_wait(B) if (!spin_is_locked(A))
    do_something() do_something()

    In that both CPUs can end up running do_something at the same time,
    because our _Q_LOCKED_VAL store can drop past the spin_unlock_wait()
    spin_is_locked() loads (even on x86!!).

    To avoid making the normal case slower, add smp_mb()s to the less used
    spin_unlock_wait() / spin_is_locked() side of things to avoid this
    problem.

    Reported-and-tested-by: Davidlohr Bueso
    Reported-by: Giovanni Gherdovich
    Signed-off-by: Peter Zijlstra (Intel)
    Cc: stable@vger.kernel.org # v4.2 and later
    Signed-off-by: Linus Torvalds

    Peter Zijlstra
     

20 May, 2016

4 commits

  • Merge updates from Andrew Morton:

    - fsnotify fix

    - poll() timeout fix

    - a few scripts/ tweaks

    - debugobjects updates

    - the (small) ocfs2 queue

    - Minor fixes to kernel/padata.c

    - Maybe half of the MM queue

    * emailed patches from Andrew Morton : (117 commits)
    mm, page_alloc: restore the original nodemask if the fast path allocation failed
    mm, page_alloc: uninline the bad page part of check_new_page()
    mm, page_alloc: don't duplicate code in free_pcp_prepare
    mm, page_alloc: defer debugging checks of pages allocated from the PCP
    mm, page_alloc: defer debugging checks of freed pages until a PCP drain
    cpuset: use static key better and convert to new API
    mm, page_alloc: inline pageblock lookup in page free fast paths
    mm, page_alloc: remove unnecessary variable from free_pcppages_bulk
    mm, page_alloc: pull out side effects from free_pages_check
    mm, page_alloc: un-inline the bad part of free_pages_check
    mm, page_alloc: check multiple page fields with a single branch
    mm, page_alloc: remove field from alloc_context
    mm, page_alloc: avoid looking up the first zone in a zonelist twice
    mm, page_alloc: shortcut watermark checks for order-0 pages
    mm, page_alloc: reduce cost of fair zone allocation policy retry
    mm, page_alloc: shorten the page allocator fast path
    mm, page_alloc: check once if a zone has isolated pageblocks
    mm, page_alloc: move __GFP_HARDWALL modifications out of the fastpath
    mm, page_alloc: simplify last cpupid reset
    mm, page_alloc: remove unnecessary initialisation from __alloc_pages_nodemask()
    ...

    Linus Torvalds
     
  • I've just discovered that the useful-sounding has_transparent_hugepage()
    is actually an architecture-dependent minefield: on some arches it only
    builds if CONFIG_TRANSPARENT_HUGEPAGE=y, on others it's also there when
    not, but on some of those (arm and arm64) it then gives the wrong
    answer; and on mips alone it's marked __init, which would crash if
    called later (but so far it has not been called later).

    Straighten this out: make it available to all configs, with a sensible
    default in asm-generic/pgtable.h, removing its definitions from those
    arches (arc, arm, arm64, sparc, tile) which are served by the default,
    adding #define has_transparent_hugepage has_transparent_hugepage to
    those (mips, powerpc, s390, x86) which need to override the default at
    runtime, and removing the __init from mips (but maybe that kind of code
    should be avoided after init: set a static variable the first time it's
    called).

    Signed-off-by: Hugh Dickins
    Cc: "Kirill A. Shutemov"
    Cc: Andrea Arcangeli
    Cc: Andres Lagar-Cavilla
    Cc: Yang Shi
    Cc: Ning Qu
    Cc: Mel Gorman
    Cc: Konstantin Khlebnikov
    Acked-by: David S. Miller
    Acked-by: Vineet Gupta [arch/arc]
    Acked-by: Gerald Schaefer [arch/s390]
    Acked-by: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hugh Dickins
     
  • Pull IOMMU updates from Joerg Roedel:
    "The updates include:

    - rate limiting for the VT-d fault handler

    - remove statistics code from the AMD IOMMU driver. It is unused and
    should be replaced by something more generic if needed

    - per-domain pagesize-bitmaps in IOMMU core code to support systems
    with different types of IOMMUs

    - support for ACPI devices in the AMD IOMMU driver

    - 4GB mode support for Mediatek IOMMU driver

    - ARM-SMMU updates from Will Deacon:
    - support for 64k pages with SMMUv1 implementations (e.g MMU-401)
    - remove open-coded 64-bit MMIO accessors
    - initial support for 16-bit VMIDs, as supported by some ThunderX
    SMMU implementations
    - a couple of errata workarounds for silicon in the field

    - various fixes here and there"

    * tag 'iommu-updates-v4.7' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: (44 commits)
    iommu/arm-smmu: Use per-domain page sizes.
    iommu/amd: Remove statistics code
    iommu/dma: Finish optimising higher-order allocations
    iommu: Allow selecting page sizes per domain
    iommu: of: enforce const-ness of struct iommu_ops
    iommu: remove unused priv field from struct iommu_ops
    iommu/dma: Implement scatterlist segment merging
    iommu/arm-smmu: Clear cache lock bit of ACR
    iommu/arm-smmu: Support SMMUv1 64KB supplement
    iommu/arm-smmu: Decouple context format from kernel config
    iommu/arm-smmu: Tidy up 64-bit/atomic I/O accesses
    io-64-nonatomic: Add relaxed accessor variants
    iommu/arm-smmu: Work around MMU-500 prefetch errata
    iommu/arm-smmu: Convert ThunderX workaround to new method
    iommu/arm-smmu: Differentiate specific implementations
    iommu/arm-smmu: Workaround for ThunderX erratum #27704
    iommu/arm-smmu: Add support for 16 bit VMID
    iommu/amd: Move get_device_id() and friends to beginning of file
    iommu/amd: Don't use IS_ERR_VALUE to check integer values
    iommu/amd: Signedness bug in acpihid_device_group()
    ...

    Linus Torvalds
     
  • Pull MIPS updates from Ralf Baechle:
    "This is the main pull request for MIPS for 4.7. Here's the summary of
    the changes:

    - ATH79: Support for DTB passuing using the UHI boot protocol
    - ATH79: Remove support for builtin DTB.
    - ATH79: Add zboot debug serial support.
    - ATH79: Add initial support for Dragino MS14 (Dragine 2), Onion Omega
    and DPT-Module.
    - ATH79: Update devicetree clock support for AR9132 and AR9331.
    - ATH79: Cleanup the DT code.
    - ATH79: Support newer SOCs in ath79_ddr_ctrl_init.
    - ATH79: Fix regression in PCI window initialization.
    - BCM47xx: Move SPROM driver to drivers/firmware/
    - BCM63xx: Enable partition parser in defconfig.
    - BMIPS: BMIPS5000 has I cache filing from D cache
    - BMIPS: BMIPS: Add cpu-feature-overrides.h
    - BMIPS: Add Whirlwind support
    - BMIPS: Adjust mips-hpt-frequency for BCM7435
    - BMIPS: Remove maxcpus from BCM97435SVMB DTS
    - BMIPS: Add missing 7038 L1 register cells to BCM7435
    - BMIPS: Various tweaks to initialization code.
    - BMIPS: Enable partition parser in defconfig.
    - BMIPS: Cache tweaks.
    - BMIPS: Add UART, I2C and SATA devices to DT.
    - BMIPS: Add BCM6358 and BCM63268support
    - BMIPS: Add device tree example for BCM6358.
    - BMIPS: Improve Improve BCM6328 and BCM6368 device trees
    - Lantiq: Add support for device tree file from boot loader
    - Lantiq: Allow build with no built-in DT.
    - Loongson 3: Reserve 32MB for RS780E integrated GPU.
    - Loongson 3: Fix build error after ld-version.sh modification
    - Loongson 3: Move chipset ACPI code from drivers to arch.
    - Loongson 3: Speedup irq processing.
    - Loongson 3: Add basic Loongson 3A support.
    - Loongson 3: Set cache flush handlers to nop.
    - Loongson 3: Invalidate special TLBs when needed.
    - Loongson 3: Fast TLB refill handler.
    - MT7620: Fallback strategy for invalid syscfg0.
    - Netlogic: Fix CP0_EBASE redefinition warnings
    - Octeon: Initialization fixes
    - Octeon: Add DTS files for the D-Link DSR-1000N and EdgeRouter Lite
    - Octeon: Enable add Octeon-drivers in cavium_octeon_defconfig
    - Octeon: Correctly handle endian-swapped initramfs images.
    - Octeon: Support CN73xx, CN75xx and CN78xx.
    - Octeon: Remove dead code from cvmx-sysinfo.
    - Octeon: Extend number of supported CPUs past 32.
    - Octeon: Remove some code limiting NR_IRQS to 255.
    - Octeon: Simplify octeon_irq_ciu_gpio_set_type.
    - Octeon: Mark some functions __init in smp.c
    - Octeon: Octeon: Add Octeon III CN7xxx interface detection
    - PIC32: Add serial driver and bindings for it.
    - PIC32: Add PIC32 deadman timer driver and bindings.
    - PIC32: Add PIC32 clock timer driver and bindings.
    - Pistachio: Determine SoC revision during boot
    - Sibyte: Fix Kconfig dependencies of SIBYTE_BUS_WATCHER.
    - Sibyte: Strip redundant comments from bcm1480_regs.h.
    - Panic immediately if panic_on_oops is set.
    - module: fix incorrect IS_ERR_VALUE macro usage.
    - module: Make consistent use of pr_*
    - Remove no longer needed work_on_cpu() call.
    - Remove CONFIG_IPV6_PRIVACY from defconfigs.
    - Fix registers of non-crashing CPUs in dumps.
    - Handle MIPSisms in new vmcore_elf32_check_arch.
    - Select CONFIG_HANDLE_DOMAIN_IRQ and make it work.
    - Allow RIXI to be used on non-R2 or R6 cores.
    - Reserve nosave data for hibernation
    - Fix siginfo.h to use strict POSIX types.
    - Don't unwind user mode with EVA.
    - Fix watchpoint restoration
    - Ptrace watchpoints for R6.
    - Sync icache when it fills from dcache
    - I6400 I-cache fills from dcache.
    - Various MSA fixes.
    - Cleanup MIPS_CPU_* definitions.
    - Signal: Move generic copy_siginfo to signal.h
    - Signal: Fix uapi include in exported asm/siginfo.h
    - Timer fixes for sake of KVM.
    - XPA TLB refill fixes.
    - Treat perf counter feature
    - Update John Crispin's email address
    - Add PIC32 watchdog and bindings.
    - Handle R10000 LL/SC bug in set_pte()
    - cpufreq: Various fixes for Longson1.
    - R6: Fix R2 emulation.
    - mathemu: Cosmetic fix to ADDIUPC emulation, plenty of other small fixes
    - ELF: ABI and FP fixes.
    - Allow for relocatable kernel and use that to support KASLR.
    - Fix CPC_BASE_ADDR mask
    - Plenty fo smp-cps, CM, R6 and M6250 fixes.
    - Make reset_control_ops const.
    - Fix kernel command line handling of leading whitespace.
    - Cleanups to cache handling.
    - Add brcm, bcm6345-l1-intc device tree bindings.
    - Use generic clkdev.h header
    - Remove CLK_IS_ROOT usage.
    - Misc small cleanups.
    - CM: Fix compilation error when !MIPS_CM
    - oprofile: Fix a preemption issue
    - Detect DSP ASE v3 support:1"

    * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (275 commits)
    MIPS: pic32mzda: fix getting timer clock rate.
    MIPS: ath79: fix regression in PCI window initialization
    MIPS: ath79: make ath79_ddr_ctrl_init() compatible for newer SoCs
    MIPS: Fix VZ probe gas errors with binutils of MSA context in non-MSA kernels
    MIPS: cevt-r4k: Dynamically calculate min_delta_ns
    MIPS: malta-time: Take seconds into account
    MIPS: malta-time: Start GIC count before syncing to RTC
    MIPS: Force CPUs to lose FP context during mode switches
    ...

    Linus Torvalds
     

17 May, 2016

3 commits

  • Vikram reported that his ARM64 compiler managed to 'optimize' away the
    preempt_count manipulations in code like:

    preempt_enable_no_resched();
    put_user();
    preempt_disable();

    Irrespective of that fact that that is horrible code that should be
    fixed for many reasons, it does highlight a deficiency in the generic
    preempt_count manipulators. As it is never right to combine/elide
    preempt_count manipulations like this.

    Therefore sprinkle some volatile in the two generic accessors to
    ensure the compiler is aware of the fact that the preempt_count is
    observed outside of the regular program-order view and thus cannot be
    optimized away like this.

    x86; the only arch not using the generic code is not affected as we
    do all this in asm in order to use the segment base per-cpu stuff.

    Reported-by: Vikram Mulukutla
    Tested-by: Vikram Mulukutla
    Signed-off-by: Peter Zijlstra (Intel)
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Fixes: a787870924db ("sched, arch: Create asm/preempt.h")
    Link: http://lkml.kernel.org/r/20160516131751.GH3205@twins.programming.kicks-ass.net
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Pull x86 asm updates from Ingo Molnar:
    "The main changes in this cycle were:

    - MSR access API fixes and enhancements (Andy Lutomirski)

    - early exception handling improvements (Andy Lutomirski)

    - user-space FS/GS prctl usage fixes and improvements (Andy
    Lutomirski)

    - Remove the cpu_has_*() APIs and replace them with equivalents
    (Borislav Petkov)

    - task switch micro-optimization (Brian Gerst)

    - 32-bit entry code simplification (Denys Vlasenko)

    - enhance PAT handling in enumated CPUs (Toshi Kani)

    ... and lots of other cleanups/fixlets"

    * 'x86-asm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (70 commits)
    x86/arch_prctl/64: Restore accidentally removed put_cpu() in ARCH_SET_GS
    x86/entry/32: Remove asmlinkage_protect()
    x86/entry/32: Remove GET_THREAD_INFO() from entry code
    x86/entry, sched/x86: Don't save/restore EFLAGS on task switch
    x86/asm/entry/32: Simplify pushes of zeroed pt_regs->REGs
    selftests/x86/ldt_gdt: Test set_thread_area() deletion of an active segment
    x86/tls: Synchronize segment registers in set_thread_area()
    x86/asm/64: Rename thread_struct's fs and gs to fsbase and gsbase
    x86/arch_prctl/64: Remove FSBASE/GSBASE < 4G optimization
    x86/segments/64: When load_gs_index fails, clear the base
    x86/segments/64: When loadsegment(fs, ...) fails, clear the base
    x86/asm: Make asm/alternative.h safe from assembly
    x86/asm: Stop depending on ptrace.h in alternative.h
    x86/entry: Rename is_{ia32,x32}_task() to in_{ia32,x32}_syscall()
    x86/asm: Make sure verify_cpu() has a good stack
    x86/extable: Add a comment about early exception handlers
    x86/msr: Set the return value to zero when native_rdmsr_safe() fails
    x86/paravirt: Make "unsafe" MSR accesses unsafe even if PARAVIRT=y
    x86/paravirt: Add paravirt_{read,write}_msr()
    x86/msr: Carry on after a non-"safe" MSR access fails
    ...

    Linus Torvalds
     
  • Pull support for killable rwsems from Ingo Molnar:
    "This, by Michal Hocko, implements down_write_killable().

    The main usecase will be to update mm_sem usage sites to use this new
    API, to allow the mm-reaper introduced in commit aac453635549 ("mm,
    oom: introduce oom reaper") to tear down oom victim address spaces
    asynchronously with minimum latencies and without deadlock worries"

    [ The vfs will want it too as the inode lock is changed from a mutex to
    a rwsem due to the parallel lookup and readdir updates ]

    * 'locking-rwsem-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    locking/rwsem: Fix comment on register clobbering
    locking/rwsem: Fix down_write_killable()
    locking/rwsem, x86: Add frame annotation for call_rwsem_down_write_failed_killable()
    locking/rwsem: Provide down_write_killable()
    locking/rwsem, x86: Provide __down_write_killable()
    locking/rwsem, s390: Provide __down_write_killable()
    locking/rwsem, ia64: Provide __down_write_killable()
    locking/rwsem, alpha: Provide __down_write_killable()
    locking/rwsem: Introduce basis for down_write_killable()
    locking/rwsem, sparc: Drop superfluous arch specific implementation
    locking/rwsem, sh: Drop superfluous arch specific implementation
    locking/rwsem, xtensa: Drop superfluous arch specific implementation
    locking/rwsem: Drop explicit memory barriers
    locking/rwsem: Get rid of __down_write_nested()

    Linus Torvalds
     

13 May, 2016

2 commits

  • The generic copy_siginfo() is currently defined in
    asm-generic/siginfo.h, after including uapi/asm-generic/siginfo.h which
    defines the generic struct siginfo. However this makes it awkward for an
    architecture to use it if it has to define its own struct siginfo (e.g.
    MIPS and potentially IA64), since it means that asm-generic/siginfo.h
    can only be included after defining the arch-specific siginfo, which may
    be problematic if the arch-specific definition needs definitions from
    uapi/asm-generic/siginfo.h.

    It is possible to work around this by first including
    uapi/asm-generic/siginfo.h to get the constants before defining the
    arch-specific siginfo, and include asm-generic/siginfo.h after. However
    uapi headers can't be included by other uapi headers, so that first
    include has to be in an ifdef __kernel__, with the non __kernel__ case
    including the non-UAPI header instead.

    Instead of that mess, move the generic copy_siginfo() definition into
    linux/signal.h, which allows an arch-specific uapi/asm/siginfo.h to
    include asm-generic/siginfo.h and define the arch-specific siginfo, and
    for the generic copy_siginfo() to see that arch-specific definition.

    Signed-off-by: James Hogan
    Cc: Arnd Bergmann
    Cc: Ralf Baechle
    Cc: Petr Malat
    Cc: Tony Luck
    Cc: Fenghua Yu
    Cc: Christopher Ferris
    Cc: linux-arch@vger.kernel.org
    Cc: linux-mips@linux-mips.org
    Cc: linux-ia64@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Cc: # 4.0-
    Patchwork: https://patchwork.linux-mips.org/patch/12478/
    Signed-off-by: Ralf Baechle

    James Hogan
     
  • Move retrieval of compat syscall numbers into inline function defined in
    asm-generic header so that arches may override it.

    [ralf@linux-mips.org: Resolve merge conflict.]

    Suggested-by: Paul Burton
    Signed-off-by: Matt Redfearn
    Acked-by: Kees Cook
    Cc: IMG-MIPSLinuxKerneldevelopers@imgtec.com
    Cc: Arnd Bergmann
    Cc: Andy Lutomirski
    Cc: Will Drewry
    Cc: linux-arch@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/12978/
    Signed-off-by: Ralf Baechle

    Matt Redfearn