17 Dec, 2017

1 commit

  • commit 4d2dc2cc766c3b51929658cacbc6e34fc8e242fb upstream.

    Currently, we're capping the values too low in the F_GETLK64 case. The
    fields in that structure are 64-bit values, so we shouldn't need to do
    any sort of fixup there.

    Make sure we check that assumption at build time in the future however
    by ensuring that the sizes we're copying will fit.

    With this, we no longer need COMPAT_LOFF_T_MAX either, so remove it.

    Fixes: 94073ad77fff2 (fs/locks: don't mess with the address limit in compat_fcntl64)
    Reported-by: Vitaly Lipatov
    Signed-off-by: Jeff Layton
    Reviewed-by: David Howells
    Signed-off-by: Greg Kroah-Hartman

    Jeff Layton
     

04 Nov, 2017

2 commits


02 Nov, 2017

3 commits

  • Many user space API headers have licensing information, which is either
    incomplete, badly formatted or just a shorthand for referring to the
    license under which the file is supposed to be. This makes it hard for
    compliance tools to determine the correct license.

    Update these files with an SPDX license identifier. The identifier was
    chosen based on the license information in the file.

    GPL/LGPL licensed headers get the matching GPL/LGPL SPDX license
    identifier with the added 'WITH Linux-syscall-note' exception, which is
    the officially assigned exception identifier for the kernel syscall
    exception:

    NOTE! This copyright does *not* cover user programs that use kernel
    services by normal system calls - this is merely considered normal use
    of the kernel, and does *not* fall under the heading of "derived work".

    This exception makes it possible to include GPL headers into non GPL
    code, without confusing license compliance tools.

    Headers which have either explicit dual licensing or are just licensed
    under a non GPL license are updated with the corresponding SPDX
    identifier and the GPLv2 with syscall exception identifier. The format
    is:
    ((GPL-2.0 WITH Linux-syscall-note) OR SPDX-ID-OF-OTHER-LICENSE)

    SPDX license identifiers are a legally binding shorthand, which can be
    used instead of the full boiler plate text. The update does not remove
    existing license information as this has to be done on a case by case
    basis and the copyright holders might have to be consulted. This will
    happen in a separate step.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne. See the previous patch in this series for the
    methodology of how this patch was researched.

    Reviewed-by: Kate Stewart
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • Many user space API headers are missing licensing information, which
    makes it hard for compliance tools to determine the correct license.

    By default are files without license information under the default
    license of the kernel, which is GPLV2. Marking them GPLV2 would exclude
    them from being included in non GPLV2 code, which is obviously not
    intended. The user space API headers fall under the syscall exception
    which is in the kernels COPYING file:

    NOTE! This copyright does *not* cover user programs that use kernel
    services by normal system calls - this is merely considered normal use
    of the kernel, and does *not* fall under the heading of "derived work".

    otherwise syscall usage would not be possible.

    Update the files which contain no license information with an SPDX
    license identifier. The chosen identifier is 'GPL-2.0 WITH
    Linux-syscall-note' which is the officially assigned identifier for the
    Linux syscall exception. SPDX license identifiers are a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne. See the previous patch in this series for the
    methodology of how this patch was researched.

    Reviewed-by: Kate Stewart
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

01 Nov, 2017

1 commit

  • By default, sparse assumes a 64bit machine when compiled on x86-64
    and 32bit when compiled on anything else.

    This can of course create all sort of problems, like issuing false
    warnings like: 'constant ... is so big it is unsigned long long'
    or 'shift too big (32) for type unsigned long' when the architecture
    is 64bit while sparse was compiled on a 32bit machine, or worse,
    to not emit legitimate warnings in the reverse situation.

    Fix this by passing to sparse the appropriate -m32/-m64 flag.

    To: Chris Metcalf
    Signed-off-by: Luc Van Oostenryck
    Signed-off-by: Chris Metcalf

    Luc Van Oostenryck
     

23 Sep, 2017

1 commit


13 Sep, 2017

1 commit

  • Pull dma-mapping updates from Christoph Hellwig:

    - removal of the old dma_alloc_noncoherent interface

    - remove unused flags to dma_declare_coherent_memory

    - restrict OF DMA configuration to specific physical busses

    - use the iommu mailing list for dma-mapping questions and patches

    * tag 'dma-mapping-4.14' of git://git.infradead.org/users/hch/dma-mapping:
    dma-coherent: fix dma_declare_coherent_memory() logic error
    ARM: imx: mx31moboard: Remove unused 'dma' variable
    dma-coherent: remove an unused variable
    MAINTAINERS: use the iommu list for the dma-mapping subsystem
    dma-coherent: remove the DMA_MEMORY_MAP and DMA_MEMORY_IO flags
    dma-coherent: remove the DMA_MEMORY_INCLUDES_CHILDREN flag
    of: restrict DMA configuration
    dma-mapping: remove dma_alloc_noncoherent and dma_free_noncoherent
    i825xx: switch to switch to dma_alloc_attrs
    au1000_eth: switch to dma_alloc_attrs
    sgiseeq: switch to dma_alloc_attrs
    dma-mapping: reduce dma_mapping_error inline bloat

    Linus Torvalds
     

12 Sep, 2017

1 commit

  • Pull namespace updates from Eric Biederman:
    "Life has been busy and I have not gotten half as much done this round
    as I would have liked. I delayed it so that a minor conflict
    resolution with the mips tree could spend a little time in linux-next
    before I sent this pull request.

    This includes two long delayed user namespace changes from Kirill
    Tkhai. It also includes a very useful change from Serge Hallyn that
    allows the security capability attribute to be used inside of user
    namespaces. The practical effect of this is people can now untar
    tarballs and install rpms in user namespaces. It had been suggested to
    generalize this and encode some of the namespace information
    information in the xattr name. Upon close inspection that makes the
    things that should be hard easy and the things that should be easy
    more expensive.

    Then there is my bugfix/cleanup for signal injection that removes the
    magic encoding of the siginfo union member from the kernel internal
    si_code. The mips folks reported the case where I had used FPE_FIXME
    me is impossible so I have remove FPE_FIXME from mips, while at the
    same time including a return statement in that case to keep gcc from
    complaining about unitialized variables.

    I almost finished the work to get make copy_siginfo_to_user a trivial
    copy to user. The code is available at:

    git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace.git neuter-copy_siginfo_to_user-v3

    But I did not have time/energy to get the code posted and reviewed
    before the merge window opened.

    I was able to see that the security excuse for just copying fields
    that we know are initialized doesn't work in practice there are buggy
    initializations that don't initialize the proper fields in siginfo. So
    we still sometimes copy unitialized data to userspace"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace:
    Introduce v3 namespaced file capabilities
    mips/signal: In force_fcr31_sig return in the impossible case
    signal: Remove kernel interal si_code magic
    fcntl: Don't use ambiguous SIG_POLL si_codes
    prctl: Allow local CAP_SYS_ADMIN changing exe_file
    security: Use user_namespace::level to avoid redundant iterations in cap_capable()
    userns,pidns: Verify the userns for new pid namespaces
    signal/testing: Don't look for __SI_FAULT in userspace
    signal/mips: Document a conflict with SI_USER with SIGFPE
    signal/sparc: Document a conflict with SI_USER with SIGFPE
    signal/ia64: Document a conflict with SI_USER with SIGFPE
    signal/alpha: Document a conflict with SI_USER for SIGTRAP

    Linus Torvalds
     

10 Sep, 2017

1 commit

  • Merge more updates from Andrew Morton:

    - most of the rest of MM

    - a small number of misc things

    - lib/ updates

    - checkpatch

    - autofs updates

    - ipc/ updates

    * emailed patches from Andrew Morton : (126 commits)
    ipc: optimize semget/shmget/msgget for lots of keys
    ipc/sem: play nicer with large nsops allocations
    ipc/sem: drop sem_checkid helper
    ipc: convert kern_ipc_perm.refcount from atomic_t to refcount_t
    ipc: convert sem_undo_list.refcnt from atomic_t to refcount_t
    ipc: convert ipc_namespace.count from atomic_t to refcount_t
    kcov: support compat processes
    sh: defconfig: cleanup from old Kconfig options
    mn10300: defconfig: cleanup from old Kconfig options
    m32r: defconfig: cleanup from old Kconfig options
    drivers/pps: use surrounding "if PPS" to remove numerous dependency checks
    drivers/pps: aesthetic tweaks to PPS-related content
    cpumask: make cpumask_next() out-of-line
    kmod: move #ifdef CONFIG_MODULES wrapper to Makefile
    kmod: split off umh headers into its own file
    MAINTAINERS: clarify kmod is just a kernel module loader
    kmod: split out umh code into its own file
    test_kmod: flip INT checks to be consistent
    test_kmod: remove paranoid UINT_MAX check on uint range processing
    vfat: deduplicate hex2bin()
    ...

    Linus Torvalds
     

09 Sep, 2017

2 commits

  • First, number of CPUs can't be negative number.

    Second, different signnnedness leads to suboptimal code in the following
    cases:

    1)
    kmalloc(nr_cpu_ids * sizeof(X));

    "int" has to be sign extended to size_t.

    2)
    while (loff_t *pos < nr_cpu_ids)

    MOVSXD is 1 byte longed than the same MOV.

    Other cases exist as well. Basically compiler is told that nr_cpu_ids
    can't be negative which can't be deduced if it is "int".

    Code savings on allyesconfig kernel: -3KB

    add/remove: 0/0 grow/shrink: 25/264 up/down: 261/-3631 (-3370)
    function old new delta
    coretemp_cpu_online 450 512 +62
    rcu_init_one 1234 1272 +38
    pci_device_probe 374 399 +25

    ...

    pgdat_reclaimable_pages 628 556 -72
    select_fallback_rq 446 369 -77
    task_numa_find_cpu 1923 1807 -116

    Link: http://lkml.kernel.org/r/20170819114959.GA30580@avx2
    Signed-off-by: Alexey Dobriyan
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     
  • Pull PCI updates from Bjorn Helgaas:

    - add enhanced Downstream Port Containment support, which prints more
    details about Root Port Programmed I/O errors (Dongdong Liu)

    - add Layerscape ls1088a and ls2088a support (Hou Zhiqiang)

    - add MediaTek MT2712 and MT7622 support (Ryder Lee)

    - add MediaTek MT2712 and MT7622 MSI support (Honghui Zhang)

    - add Qualcom IPQ8074 support (Varadarajan Narayanan)

    - add R-Car r8a7743/5 device tree support (Biju Das)

    - add Rockchip per-lane PHY support for better power management (Shawn
    Lin)

    - fix IRQ mapping for hot-added devices by replacing the
    pci_fixup_irqs() boot-time design with a host bridge hook called at
    probe-time (Lorenzo Pieralisi, Matthew Minter)

    - fix race when enabling two devices that results in upstream bridge
    not being enabled correctly (Srinath Mannam)

    - fix pciehp power fault infinite loop (Keith Busch)

    - fix SHPC bridge MSI hotplug events by enabling bus mastering
    (Aleksandr Bezzubikov)

    - fix a VFIO issue by correcting PCIe capability sizes (Alex
    Williamson)

    - fix an INTD issue on Xilinx and possibly other drivers by unifying
    INTx IRQ domain support (Paul Burton)

    - avoid IOMMU stalls by marking AMD Stoney GPU ATS as broken (Joerg
    Roedel)

    - allow APM X-Gene device assignment to guests by adding an ACS quirk
    (Feng Kan)

    - fix driver crashes by disabling Extended Tags on Broadcom HT2100
    (Extended Tags support is required for PCIe Receivers but not
    Requesters, and we now enable them by default when Requesters support
    them) (Sinan Kaya)

    - fix MSIs for devices that use phantom RIDs for DMA by assuming MSIs
    use the real Requester ID (not a phantom RID) (Robin Murphy)

    - prevent assignment of Intel VMD children to guests (which may be
    supported eventually, but isn't yet) by not associating an IOMMU with
    them (Jon Derrick)

    - fix Intel VMD suspend/resume by releasing IRQs on suspend (Scott
    Bauer)

    - fix a Function-Level Reset issue with Intel 750 NVMe by waiting
    longer (up to 60sec instead of 1sec) for device to become ready
    (Sinan Kaya)

    - fix a Function-Level Reset issue on iProc Stingray by working around
    hardware defects in the CRS implementation (Oza Pawandeep)

    - fix an issue with Intel NVMe P3700 after an iProc reset by adding a
    delay during shutdown (Oza Pawandeep)

    - fix a Microsoft Hyper-V lockdep issue by polling instead of blocking
    in compose_msi_msg() (Stephen Hemminger)

    - fix a wireless LAN driver timeout by clearing DesignWare MSI
    interrupt status after it is handled, not before (Faiz Abbas)

    - fix DesignWare ATU enable checking (Jisheng Zhang)

    - reduce Layerscape dependencies on the bootloader by doing more
    initialization in the driver (Hou Zhiqiang)

    - improve Intel VMD performance allowing allocation of more IRQ vectors
    than present CPUs (Keith Busch)

    - improve endpoint framework support for initial DMA mask, different
    BAR sizes, configurable page sizes, MSI, test driver, etc (Kishon
    Vijay Abraham I, Stan Drozd)

    - rework CRS support to add periodic messages while we poll during
    enumeration and after Function-Level Reset and prepare for possible
    other uses of CRS (Sinan Kaya)

    - clean up Root Port AER handling by removing unnecessary code and
    moving error handler methods to struct pcie_port_service_driver
    (Christoph Hellwig)

    - clean up error handling paths in various drivers (Bjorn Andersson,
    Fabio Estevam, Gustavo A. R. Silva, Harunobu Kurokawa, Jeffy Chen,
    Lorenzo Pieralisi, Sergei Shtylyov)

    - clean up SR-IOV resource handling by disabling VF decoding before
    updating the corresponding resource structs (Gavin Shan)

    - clean up DesignWare-based drivers by unifying quirks to update Class
    Code and Interrupt Pin and related handling of write-protected
    registers (Hou Zhiqiang)

    - clean up by adding empty generic pcibios_align_resource() and
    pcibios_fixup_bus() and removing empty arch-specific implementations
    (Palmer Dabbelt)

    - request exclusive reset control for several drivers to allow cleanup
    elsewhere (Philipp Zabel)

    - constify various structures (Arvind Yadav, Bhumika Goyal)

    - convert from full_name() to %pOF (Rob Herring)

    - remove unused variables from iProc, HiSi, Altera, Keystone (Shawn
    Lin)

    * tag 'pci-v4.14-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (170 commits)
    PCI: xgene: Clean up whitespace
    PCI: xgene: Define XGENE_PCI_EXP_CAP and use generic PCI_EXP_RTCTL offset
    PCI: xgene: Fix platform_get_irq() error handling
    PCI: xilinx-nwl: Fix platform_get_irq() error handling
    PCI: rockchip: Fix platform_get_irq() error handling
    PCI: altera: Fix platform_get_irq() error handling
    PCI: spear13xx: Fix platform_get_irq() error handling
    PCI: artpec6: Fix platform_get_irq() error handling
    PCI: armada8k: Fix platform_get_irq() error handling
    PCI: dra7xx: Fix platform_get_irq() error handling
    PCI: exynos: Fix platform_get_irq() error handling
    PCI: iproc: Clean up whitespace
    PCI: iproc: Rename PCI_EXP_CAP to IPROC_PCI_EXP_CAP
    PCI: iproc: Add 500ms delay during device shutdown
    PCI: Fix typos and whitespace errors
    PCI: Remove unused "res" variable from pci_resource_io()
    PCI: Correct kernel-doc of pci_vpd_srdt_size(), pci_vpd_srdt_tag()
    PCI/AER: Reformat AER register definitions
    iommu/vt-d: Prevent VMD child devices from being remapping targets
    x86/PCI: Use is_vmd() rather than relying on the domain number
    ...

    Linus Torvalds
     

08 Sep, 2017

1 commit


05 Sep, 2017

1 commit

  • Pull locking updates from Ingo Molnar:

    - Add 'cross-release' support to lockdep, which allows APIs like
    completions, where it's not the 'owner' who releases the lock, to be
    tracked. It's all activated automatically under
    CONFIG_PROVE_LOCKING=y.

    - Clean up (restructure) the x86 atomics op implementation to be more
    readable, in preparation of KASAN annotations. (Dmitry Vyukov)

    - Fix static keys (Paolo Bonzini)

    - Add killable versions of down_read() et al (Kirill Tkhai)

    - Rework and fix jump_label locking (Marc Zyngier, Paolo Bonzini)

    - Rework (and fix) tlb_flush_pending() barriers (Peter Zijlstra)

    - Remove smp_mb__before_spinlock() and convert its usages, introduce
    smp_mb__after_spinlock() (Peter Zijlstra)

    * 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (56 commits)
    locking/lockdep/selftests: Fix mixed read-write ABBA tests
    sched/completion: Avoid unnecessary stack allocation for COMPLETION_INITIALIZER_ONSTACK()
    acpi/nfit: Fix COMPLETION_INITIALIZER_ONSTACK() abuse
    locking/pvqspinlock: Relax cmpxchg's to improve performance on some architectures
    smp: Avoid using two cache lines for struct call_single_data
    locking/lockdep: Untangle xhlock history save/restore from task independence
    locking/refcounts, x86/asm: Disable CONFIG_ARCH_HAS_REFCOUNT for the time being
    futex: Remove duplicated code and fix undefined behaviour
    Documentation/locking/atomic: Finish the document...
    locking/lockdep: Fix workqueue crossrelease annotation
    workqueue/lockdep: 'Fix' flush_work() annotation
    locking/lockdep/selftests: Add mixed read-write ABBA tests
    mm, locking/barriers: Clarify tlb_flush_pending() barriers
    locking/lockdep: Make CONFIG_LOCKDEP_CROSSRELEASE and CONFIG_LOCKDEP_COMPLETIONS truly non-interactive
    locking/lockdep: Explicitly initialize wq_barrier::done::map
    locking/lockdep: Rename CONFIG_LOCKDEP_COMPLETE to CONFIG_LOCKDEP_COMPLETIONS
    locking/lockdep: Reword title of LOCKDEP_CROSSRELEASE config
    locking/lockdep: Make CONFIG_LOCKDEP_CROSSRELEASE part of CONFIG_PROVE_LOCKING
    locking/refcounts, x86/asm: Implement fast refcount overflow protection
    locking/lockdep: Fix the rollback and overwrite detection logic in crossrelease
    ...

    Linus Torvalds
     

29 Aug, 2017

1 commit


26 Aug, 2017

1 commit

  • There is code duplicated over all architecture's headers for
    futex_atomic_op_inuser. Namely op decoding, access_ok check for uaddr,
    and comparison of the result.

    Remove this duplication and leave up to the arches only the needed
    assembly which is now in arch_futex_atomic_op_inuser.

    This effectively distributes the Will Deacon's arm64 fix for undefined
    behaviour reported by UBSAN to all architectures. The fix was done in
    commit 5f16a046f8e1 (arm64: futex: Fix undefined behaviour with
    FUTEX_OP_OPARG_SHIFT usage). Look there for an example dump.

    And as suggested by Thomas, check for negative oparg too, because it was
    also reported to cause undefined behaviour report.

    Note that s390 removed access_ok check in d12a29703 ("s390/uaccess:
    remove pointless access_ok() checks") as access_ok there returns true.
    We introduce it back to the helper for the sake of simplicity (it gets
    optimized away anyway).

    Signed-off-by: Jiri Slaby
    Signed-off-by: Thomas Gleixner
    Acked-by: Russell King
    Acked-by: Michael Ellerman (powerpc)
    Acked-by: Heiko Carstens [s390]
    Acked-by: Chris Metcalf [for tile]
    Reviewed-by: Darren Hart (VMware)
    Reviewed-by: Will Deacon [core/arm64]
    Cc: linux-mips@linux-mips.org
    Cc: Rich Felker
    Cc: linux-ia64@vger.kernel.org
    Cc: linux-sh@vger.kernel.org
    Cc: peterz@infradead.org
    Cc: Benjamin Herrenschmidt
    Cc: Max Filippov
    Cc: Paul Mackerras
    Cc: sparclinux@vger.kernel.org
    Cc: Jonas Bonn
    Cc: linux-s390@vger.kernel.org
    Cc: linux-arch@vger.kernel.org
    Cc: Yoshinori Sato
    Cc: linux-hexagon@vger.kernel.org
    Cc: Helge Deller
    Cc: "James E.J. Bottomley"
    Cc: Catalin Marinas
    Cc: Matt Turner
    Cc: linux-snps-arc@lists.infradead.org
    Cc: Fenghua Yu
    Cc: Arnd Bergmann
    Cc: linux-xtensa@linux-xtensa.org
    Cc: Stefan Kristiansson
    Cc: openrisc@lists.librecores.org
    Cc: Ivan Kokshaysky
    Cc: Stafford Horne
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: Richard Henderson
    Cc: Chris Zankel
    Cc: Michal Simek
    Cc: Tony Luck
    Cc: linux-parisc@vger.kernel.org
    Cc: Vineet Gupta
    Cc: Ralf Baechle
    Cc: Richard Kuo
    Cc: linux-alpha@vger.kernel.org
    Cc: Martin Schwidefsky
    Cc: linuxppc-dev@lists.ozlabs.org
    Cc: "David S. Miller"
    Link: http://lkml.kernel.org/r/20170824073105.3901-1-jslaby@suse.cz

    Jiri Slaby
     

17 Aug, 2017

1 commit

  • There is no agreed-upon definition of spin_unlock_wait()'s semantics,
    and it appears that all callers could do just as well with a lock/unlock
    pair. This commit therefore removes the underlying arch-specific
    arch_spin_unlock_wait() for all architectures providing them.

    Signed-off-by: Paul E. McKenney
    Cc:
    Cc: Peter Zijlstra
    Cc: Alan Stern
    Cc: Andrea Parri
    Cc: Linus Torvalds
    Acked-by: Will Deacon
    Acked-by: Boqun Feng

    Paul E. McKenney
     

10 Aug, 2017

1 commit

  • Those architectures that have a special atomic_set implementation also
    need a special atomic_set_release(), because for the very same reason
    WRITE_ONCE() is broken for them, smp_store_release() is too.

    The vast majority is architectures that have spinlock hash based atomic
    implementation except hexagon which seems to have a hardware 'feature'.

    The spinlock based atomics should be SC, that is, none of them appear to
    place extra barriers in atomic_cmpxchg() or any of the other SC atomic
    primitives and therefore seem to rely on their spinlock implementation
    being SC (I did not fully validate all that).

    Therefore, the normal atomic_set() is SC and can be used at
    atomic_set_release().

    Signed-off-by: Peter Zijlstra (Intel)
    Acked-by: Chris Metcalf [for tile]
    Cc: Boqun Feng
    Cc: Linus Torvalds
    Cc: Paul McKenney
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: Will Deacon
    Cc: davem@davemloft.net
    Cc: james.hogan@imgtec.com
    Cc: jejb@parisc-linux.org
    Cc: rkuo@codeaurora.org
    Cc: vgupta@synopsys.com
    Link: http://lkml.kernel.org/r/20170609110506.yod47flaav3wgoj5@hirez.programming.kicks-ass.net
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     

04 Aug, 2017

1 commit

  • The pci_fixup_irqs() function allocates IRQs for all PCI devices present in
    a system; those PCI devices possibly belong to different PCI bus trees (and
    possibly rooted at different host bridges) and may well be enabled (ie
    probed and bound to a driver) by the time pci_fixup_irqs() is called when
    probing a given host bridge driver.

    Furthermore, current kernel code relying on pci_fixup_irqs() to assign
    legacy PCI IRQs to devices does not work at all for hotplugged devices in
    that the code carrying out the IRQ fixup is called at host bridge driver
    probe time, which just cannot take into account devices hotplugged after
    the system has booted.

    The introduction of map/swizzle function hooks in struct pci_host_bridge
    allows us to define per-bridge map/swizzle functions that can be used at
    device probe time in PCI core code to allocate IRQs for a given device
    (through pci_assign_irq()).

    Convert PCI host bridge initialization code to the
    pci_scan_root_bus_bridge() API (that allows to pass a struct
    pci_host_bridge with initializedmap/swizzle pointers) and remove the
    pci_fixup_irqs() call from arch code.

    Signed-off-by: Lorenzo Pieralisi
    Signed-off-by: Bjorn Helgaas
    Cc: Chris Metcalf

    Lorenzo Pieralisi
     

03 Aug, 2017

2 commits

  • Multiple architectures define this as a trivial function, and I'm adding
    another one as part of the RISC-V port. Add a __weak version of
    pcibios_align_resource() and delete the now-obselete ones in a handful of
    ports.

    The only functional change should be that a handful of ports used to export
    pcibios_fixup_bus(). Only some architectures export this, so I just
    dropped it.

    Signed-off-by: Palmer Dabbelt
    Signed-off-by: Bjorn Helgaas

    Palmer Dabbelt
     
  • Multiple architectures define this as an empty function, and I'm adding
    another one as part of the RISC-V port. Add a __weak version of
    pcibios_fixup_bus() and delete the now-obselete ones in a handful of
    ports.

    The only functional change should be that microblaze used to export
    pcibios_fixup_bus(). None of the other architectures exports this, so I
    just dropped it.

    Signed-off-by: Palmer Dabbelt
    Signed-off-by: Bjorn Helgaas

    Palmer Dabbelt
     

25 Jul, 2017

1 commit

  • struct siginfo is a union and the kernel since 2.4 has been hiding a union
    tag in the high 16bits of si_code using the values:
    __SI_KILL
    __SI_TIMER
    __SI_POLL
    __SI_FAULT
    __SI_CHLD
    __SI_RT
    __SI_MESGQ
    __SI_SYS

    While this looks plausible on the surface, in practice this situation has
    not worked well.

    - Injected positive signals are not copied to user space properly
    unless they have these magic high bits set.

    - Injected positive signals are not reported properly by signalfd
    unless they have these magic high bits set.

    - These kernel internal values leaked to userspace via ptrace_peek_siginfo

    - It was possible to inject these kernel internal values and cause the
    the kernel to misbehave.

    - Kernel developers got confused and expected these kernel internal values
    in userspace in kernel self tests.

    - Kernel developers got confused and set si_code to __SI_FAULT which
    is SI_USER in userspace which causes userspace to think an ordinary user
    sent the signal and that it was not kernel generated.

    - The values make it impossible to reorganize the code to transform
    siginfo_copy_to_user into a plain copy_to_user. As si_code must
    be massaged before being passed to userspace.

    So remove these kernel internal si codes and make the kernel code simpler
    and more maintainable.

    To replace these kernel internal magic si_codes introduce the helper
    function siginfo_layout, that takes a signal number and an si_code and
    computes which union member of siginfo is being used. Have
    siginfo_layout return an enumeration so that gcc will have enough
    information to warn if a switch statement does not handle all of union
    members.

    A couple of architectures have a messed up ABI that defines signal
    specific duplications of SI_USER which causes more special cases in
    siginfo_layout than I would like. The good news is only problem
    architectures pay the cost.

    Update all of the code that used the previous magic __SI_ values to
    use the new SIL_ values and to call siginfo_layout to get those
    values. Escept where not all of the cases are handled remove the
    defaults in the switch statements so that if a new case is missed in
    the future the lack will show up at compile time.

    Modify the code that copies siginfo si_code to userspace to just copy
    the value and not cast si_code to a short first. The high bits are no
    longer used to hold a magic union member.

    Fixup the siginfo header files to stop including the __SI_ values in
    their constants and for the headers that were missing it to properly
    update the number of si_codes for each signal type.

    The fixes to copy_siginfo_from_user32 implementations has the
    interesting property that several of them perviously should never have
    worked as the __SI_ values they depended up where kernel internal.
    With that dependency gone those implementations should work much
    better.

    The idea of not passing the __SI_ values out to userspace and then
    not reinserting them has been tested with criu and criu worked without
    changes.

    Ref: 2.4.0-test1
    Signed-off-by: "Eric W. Biederman"

    Eric W. Biederman
     

24 Jul, 2017

1 commit


20 Jul, 2017

1 commit

  • Remove old, dead Kconfig options (in order appearing in this commit):
    - CRYPTO_ZLIB: commit 110492183c4b ("crypto: compress - remove unused
    pcomp interface");
    - IP_NF_TARGET_ULOG: commit d4da843e6fad ("netfilter: kill remnants of
    ulog targets");

    Signed-off-by: Krzysztof Kozlowski
    Signed-off-by: Chris Metcalf

    Krzysztof Kozlowski
     

16 Jul, 2017

1 commit


15 Jul, 2017

1 commit


11 Jul, 2017

1 commit

  • Since commit fcc8487d477a ("uapi: export all headers under uapi
    directories"), all (and only) headers under uapi directories are
    exported, but asm-generic wrappers are still exceptions.

    To complete de-coupling the uapi from kernel headers, move generic-y
    of exported headers to uapi/asm/Kbuild.

    With this change, "make headers_install" will just need to parse
    uapi/asm/Kbuild to build up exported headers.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

08 Jul, 2017

1 commit

  • …/masahiroy/linux-kbuild

    Pull Kbuild thin archives updates from Masahiro Yamada:
    "Thin archives migration by Nicholas Piggin.

    THIN_ARCHIVES has been available for a while as an optional feature
    only for PowerPC architecture, but we do not need two different
    intermediate-artifact schemes.

    Using thin archives instead of conventional incremental linking has
    various advantages:

    - save disk space for builds

    - speed-up building a little

    - fix some link issues (for example, allyesconfig on ARM) due to more
    flexibility for the final linking

    - work better with dead code elimination we are planning

    As discussed before, this migration has been done unconditionally so
    that any problems caused by this will show up with "git bisect".

    With testing with 0-day and linux-next, some architectures actually
    showed up problems, but they were trivial and all fixed now"

    * tag 'kbuild-thinar-v4.13' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
    tile: remove unneeded extra-y in Makefile
    kbuild: thin archives make default for all archs
    x86/um: thin archives build fix
    tile: thin archives fix linking
    ia64: thin archives fix linking
    sh: thin archives fix linking
    kbuild: handle libs-y archives separately from built-in.o archives
    kbuild: thin archives use P option to ar
    kbuild: thin archives final link close --whole-archives option
    ia64: remove unneeded extra-y in Makefile.gate
    tile: fix dependency and .*.cmd inclusion for incremental build
    sparc64: Use indirect calls in hamming weight stubs

    Linus Torvalds
     

07 Jul, 2017

5 commits

  • Merge misc updates from Andrew Morton:

    - a few hotfixes

    - various misc updates

    - ocfs2 updates

    - most of MM

    * emailed patches from Andrew Morton : (108 commits)
    mm, memory_hotplug: move movable_node to the hotplug proper
    mm, memory_hotplug: drop CONFIG_MOVABLE_NODE
    mm, memory_hotplug: drop artificial restriction on online/offline
    mm: memcontrol: account slab stats per lruvec
    mm: memcontrol: per-lruvec stats infrastructure
    mm: memcontrol: use generic mod_memcg_page_state for kmem pages
    mm: memcontrol: use the node-native slab memory counters
    mm: vmstat: move slab statistics from zone to node counters
    mm/zswap.c: delete an error message for a failed memory allocation in zswap_dstmem_prepare()
    mm/zswap.c: improve a size determination in zswap_frontswap_init()
    mm/zswap.c: delete an error message for a failed memory allocation in zswap_pool_create()
    mm/swapfile.c: sort swap entries before free
    mm/oom_kill: count global and memory cgroup oom kills
    mm: per-cgroup memory reclaim stats
    mm: kmemleak: treat vm_struct as alternative reference to vmalloc'ed objects
    mm: kmemleak: factor object reference updating out of scan_block()
    mm: kmemleak: slightly reduce the size of some structures on 64-bit architectures
    mm, mempolicy: don't check cpuset seqlock where it doesn't matter
    mm, cpuset: always use seqlock when changing task's nodemask
    mm, mempolicy: simplify rebinding mempolicies when updating cpusets
    ...

    Linus Torvalds
     
  • Pull user access str* updates from Al Viro:
    "uaccess str...() dead code removal"

    * 'uaccess.strlen' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
    s390 keyboard.c: don't open-code strndup_user()
    mips: get rid of unused __strnlen_user()
    get rid of unused __strncpy_from_user() instances
    kill strlen_user()

    Linus Torvalds
     
  • Pull dma-mapping infrastructure from Christoph Hellwig:
    "This is the first pull request for the new dma-mapping subsystem

    In this new subsystem we'll try to properly maintain all the generic
    code related to dma-mapping, and will further consolidate arch code
    into common helpers.

    This pull request contains:

    - removal of the DMA_ERROR_CODE macro, replacing it with calls to
    ->mapping_error so that the dma_map_ops instances are more self
    contained and can be shared across architectures (me)

    - removal of the ->set_dma_mask method, which duplicates the
    ->dma_capable one in terms of functionality, but requires more
    duplicate code.

    - various updates for the coherent dma pool and related arm code
    (Vladimir)

    - various smaller cleanups (me)"

    * tag 'dma-mapping-4.13' of git://git.infradead.org/users/hch/dma-mapping: (56 commits)
    ARM: dma-mapping: Remove traces of NOMMU code
    ARM: NOMMU: Set ARM_DMA_MEM_BUFFERABLE for M-class cpus
    ARM: NOMMU: Introduce dma operations for noMMU
    drivers: dma-mapping: allow dma_common_mmap() for NOMMU
    drivers: dma-coherent: Introduce default DMA pool
    drivers: dma-coherent: Account dma_pfn_offset when used with device tree
    dma: Take into account dma_pfn_offset
    dma-mapping: replace dmam_alloc_noncoherent with dmam_alloc_attrs
    dma-mapping: remove dmam_free_noncoherent
    crypto: qat - avoid an uninitialized variable warning
    au1100fb: remove a bogus dma_free_nonconsistent call
    MAINTAINERS: add entry for dma mapping helpers
    powerpc: merge __dma_set_mask into dma_set_mask
    dma-mapping: remove the set_dma_mask method
    powerpc/cell: use the dma_supported method for ops switching
    powerpc/cell: clean up fixed mapping dma_ops initialization
    tile: remove dma_supported and mapping_error methods
    xen-swiotlb: remove xen_swiotlb_set_dma_mask
    arm: implement ->dma_supported instead of ->set_dma_mask
    mips/loongson64: implement ->dma_supported instead of ->set_dma_mask
    ...

    Linus Torvalds
     
  • A poisoned or migrated hugepage is stored as a swap entry in the page
    tables. On architectures that support hugepages consisting of
    contiguous page table entries (such as on arm64) this leads to ambiguity
    in determining the page table entry to return in huge_pte_offset() when
    a poisoned entry is encountered.

    Let's remove the ambiguity by adding a size parameter to convey
    additional information about the requested address. Also fixup the
    definition/usage of huge_pte_offset() throughout the tree.

    Link: http://lkml.kernel.org/r/20170522133604.11392-4-punit.agrawal@arm.com
    Signed-off-by: Punit Agrawal
    Acked-by: Steve Capper
    Cc: Catalin Marinas
    Cc: Will Deacon
    Cc: Tony Luck
    Cc: Fenghua Yu
    Cc: James Hogan (odd fixer:METAG ARCHITECTURE)
    Cc: Ralf Baechle (supporter:MIPS)
    Cc: "James E.J. Bottomley"
    Cc: Helge Deller
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Michael Ellerman
    Cc: Martin Schwidefsky
    Cc: Heiko Carstens
    Cc: Yoshinori Sato
    Cc: Rich Felker
    Cc: "David S. Miller"
    Cc: Chris Metcalf
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: "H. Peter Anvin"
    Cc: Alexander Viro
    Cc: Michal Hocko
    Cc: Mike Kravetz
    Cc: Naoya Horiguchi
    Cc: "Aneesh Kumar K.V"
    Cc: "Kirill A. Shutemov"
    Cc: Hillf Danton
    Cc: Mark Rutland
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Punit Agrawal
     
  • Add a default ioremap function which was not provided in all
    circumstances. (Only when CONFIG_PCI and CONFIG_TILEGX was set).

    I have designs to use them in scatterlist.c where they'd likely never be
    called with this architecture, but it is needed to compile. Thus, if
    the function is ever hit it returns NULL.

    Link: http://lkml.kernel.org/r/1495726904-27380-1-git-send-email-logang@deltatee.com
    Signed-off-by: Logan Gunthorpe
    Signed-off-by: Stephen Bates
    Cc: Chris Metcalf
    Cc: Mel Gorman
    Cc: Michal Hocko
    Cc: Johannes Weiner
    Cc: Vlastimil Babka
    Cc: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Logan Gunthorpe
     

04 Jul, 2017

3 commits

  • Pull SMP hotplug updates from Thomas Gleixner:
    "This update is primarily a cleanup of the CPU hotplug locking code.

    The hotplug locking mechanism is an open coded RWSEM, which allows
    recursive locking. The main problem with that is the recursive nature
    as it evades the full lockdep coverage and hides potential deadlocks.

    The rework replaces the open coded RWSEM with a percpu RWSEM and
    establishes full lockdep coverage that way.

    The bulk of the changes fix up recursive locking issues and address
    the now fully reported potential deadlocks all over the place. Some of
    these deadlocks have been observed in the RT tree, but on mainline the
    probability was low enough to hide them away."

    * 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (37 commits)
    cpu/hotplug: Constify attribute_group structures
    powerpc: Only obtain cpu_hotplug_lock if called by rtasd
    ARM/hw_breakpoint: Fix possible recursive locking for arch_hw_breakpoint_init
    cpu/hotplug: Remove unused check_for_tasks() function
    perf/core: Don't release cred_guard_mutex if not taken
    cpuhotplug: Link lock stacks for hotplug callbacks
    acpi/processor: Prevent cpu hotplug deadlock
    sched: Provide is_percpu_thread() helper
    cpu/hotplug: Convert hotplug locking to percpu rwsem
    s390: Prevent hotplug rwsem recursion
    arm: Prevent hotplug rwsem recursion
    arm64: Prevent cpu hotplug rwsem recursion
    kprobes: Cure hotplug lock ordering issues
    jump_label: Reorder hotplug lock and jump_label_lock
    perf/tracing/cpuhotplug: Fix locking order
    ACPI/processor: Use cpu_hotplug_disable() instead of get_online_cpus()
    PCI: Replace the racy recursion prevention
    PCI: Use cpu_hotplug_disable() instead of get_online_cpus()
    perf/x86/intel: Drop get_online_cpus() in intel_snb_check_microcode()
    x86/perf: Drop EXPORT of perf_check_microcode
    ...

    Linus Torvalds
     
  • no users left

    Signed-off-by: Al Viro

    Al Viro
     
  • Pull locking updates from Ingo Molnar:
    "The main changes in this cycle were:

    - Add CONFIG_REFCOUNT_FULL=y to allow the disabling of the 'full'
    (robustness checked) refcount_t implementation with slightly lower
    runtime overhead. (Kees Cook)

    The lighter weight variant is the default. The two variants use the
    same API. Having this variant was a precondition by some
    maintainers to merge refcount_t cleanups.

    - Add lockdep support for rtmutexes (Peter Zijlstra)

    - liblockdep fixes and improvements (Sasha Levin, Ben Hutchings)

    - ... misc fixes and improvements"

    * 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (30 commits)
    locking/refcount: Remove the half-implemented refcount_sub() API
    locking/refcount: Create unchecked atomic_t implementation
    locking/rtmutex: Don't initialize lockdep when not required
    locking/selftest: Add RT-mutex support
    locking/selftest: Remove the bad unlock ordering test
    rt_mutex: Add lockdep annotations
    MAINTAINERS: Claim atomic*_t maintainership
    locking/x86: Remove the unused atomic_inc_short() methd
    tools/lib/lockdep: Remove private kernel headers
    tools/lib/lockdep: Hide liblockdep output from test results
    tools/lib/lockdep: Add dummy current_gfp_context()
    tools/include: Add IS_ERR_OR_NULL to err.h
    tools/lib/lockdep: Add empty __is_[module,kernel]_percpu_address
    tools/lib/lockdep: Include err.h
    tools/include: Add (mostly) empty include/linux/sched/mm.h
    tools/lib/lockdep: Use LDFLAGS
    tools/lib/lockdep: Remove double-quotes from soname
    tools/lib/lockdep: Fix object file paths used in an out-of-tree build
    tools/lib/lockdep: Fix compilation for 4.11
    tools/lib/lockdep: Don't mix fd-based and stream IO
    ...

    Linus Torvalds
     

30 Jun, 2017

3 commits