08 Oct, 2016

3 commits

  • This came to light when implementing native 64-bit atomics for ARCv2.

    The atomic64 self-test code uses CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
    to check whether atomic64_dec_if_positive() is available. It seems it
    was needed when not every arch defined it. However as of current code
    the Kconfig option seems needless

    - for CONFIG_GENERIC_ATOMIC64 it is auto-enabled in lib/Kconfig and a
    generic definition of API is present lib/atomic64.c
    - arches with native 64-bit atomics select it in arch/*/Kconfig and
    define the API in their headers

    So I see no point in keeping the Kconfig option

    Compile tested for:
    - blackfin (CONFIG_GENERIC_ATOMIC64)
    - x86 (!CONFIG_GENERIC_ATOMIC64)
    - ia64

    Link: http://lkml.kernel.org/r/1473703083-8625-3-git-send-email-vgupta@synopsys.com
    Signed-off-by: Vineet Gupta
    Cc: Richard Henderson
    Cc: Ivan Kokshaysky
    Cc: Matt Turner
    Cc: Russell King
    Cc: Catalin Marinas
    Cc: Will Deacon
    Cc: Ralf Baechle
    Cc: "James E.J. Bottomley"
    Cc: Helge Deller
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Michael Ellerman
    Cc: Martin Schwidefsky
    Cc: Heiko Carstens
    Cc: "David S. Miller"
    Cc: Chris Metcalf
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: "H. Peter Anvin"
    Cc: Vineet Gupta
    Cc: Zhaoxiu Zeng
    Cc: Linus Walleij
    Cc: Alexander Potapenko
    Cc: Andrey Ryabinin
    Cc: Herbert Xu
    Cc: Ming Lin
    Cc: Arnd Bergmann
    Cc: Geert Uytterhoeven
    Cc: Peter Zijlstra
    Cc: Borislav Petkov
    Cc: Andi Kleen
    Cc: Boqun Feng
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vineet Gupta
     
  • Avoid making ifdef get pretty unwieldy if many ARCHs support gigantic
    page. No functional change with this patch.

    Link: http://lkml.kernel.org/r/1475227569-63446-2-git-send-email-xieyisheng1@huawei.com
    Signed-off-by: Yisheng Xie
    Suggested-by: Michal Hocko
    Acked-by: Michal Hocko
    Acked-by: Naoya Horiguchi
    Acked-by: Hillf Danton
    Cc: Hanjun Guo
    Cc: Will Deacon
    Cc: Dave Hansen
    Cc: Sudeep Holla
    Cc: Catalin Marinas
    Cc: Mark Rutland
    Cc: Rob Herring
    Cc: Mike Kravetz
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Yisheng Xie
     
  • Pull PCI updates from Bjorn Helgaas:
    "Summary of PCI changes for the v4.9 merge window:

    Enumeration:
    - microblaze: Add multidomain support for procfs (Bharat Kumar Gogada)

    Resource management:
    - Ignore requested alignment for PROBE_ONLY and fixed resources (Yongji Xie)
    - Ignore requested alignment for VF BARs (Yongji Xie)

    PCI device hotplug:
    - Make core explicitly non-modular (Paul Gortmaker)

    PCIe native device hotplug:
    - Rename pcie_isr() locals for clarity (Bjorn Helgaas)
    - Return IRQ_NONE when we can't read interrupt status (Bjorn Helgaas)
    - Remove unnecessary guard (Bjorn Helgaas)
    - Clean up dmesg "Slot(%s)" messages (Bjorn Helgaas)
    - Remove useless pciehp_get_latch_status() calls (Bjorn Helgaas)
    - Clear attention LED on device add (Keith Busch)
    - Allow exclusive userspace control of indicators (Keith Busch)
    - Process all hotplug events before looking for new ones (Mayurkumar Patel)
    - Don't re-read Slot Status when queuing hotplug event (Mayurkumar Patel)
    - Don't re-read Slot Status when handling surprise event (Mayurkumar Patel)
    - Make explicitly non-modular (Paul Gortmaker)

    Power management:
    - Afford direct-complete to devices with non-standard PM (Lukas Wunner)
    - Query platform firmware for device power state (Lukas Wunner)
    - Recognize D3cold in pci_update_current_state() (Lukas Wunner)
    - Avoid unnecessary resume after direct-complete (Lukas Wunner)
    - Make explicitly non-modular (Paul Gortmaker)

    Virtualization:
    - Mark Atheros AR9580 to avoid bus reset (Maik Broemme)
    - Check for pci_setup_device() failure in pci_iov_add_virtfn() (Po Liu)

    MSI:
    - Enable PCI_MSI_IRQ_DOMAIN support for ARC (Joao Pinto)

    AER:
    - Remove aerdriver.nosourceid kernel parameter (Bjorn Helgaas)
    - Remove aerdriver.forceload kernel parameter (Bjorn Helgaas)
    - Fix aer_probe() kernel-doc comment (Cao jin)
    - Add bus flag to skip source ID matching (Jon Derrick)
    - Avoid memory allocation in interrupt handling path (Jon Derrick)
    - Cache capability position (Keith Busch)
    - Make explicitly non-modular (Paul Gortmaker)
    - Remove duplicate AER severity translation (Tyler Baicar)
    - Send correct severity to calculate AER severity (Tyler Baicar)

    Precision Time Measurement:
    - Add Precision Time Measurement (PTM) support (Jonathan Yong)
    - Add PTM clock granularity information (Bjorn Helgaas)
    - Add pci_enable_ptm() for drivers to enable PTM on endpoints (Bjorn Helgaas)

    Generic host bridge driver:
    - Fix pci_remap_iospace() failure path (Lorenzo Pieralisi)
    - Make explicitly non-modular (Paul Gortmaker)

    Altera host bridge driver:
    - Remove redundant platform_get_resource() return value check (Bjorn Helgaas)
    - Poll for link training status after retraining the link (Ley Foon Tan)
    - Rework config accessors for use without a struct pci_bus (Ley Foon Tan)
    - Move retrain from fixup to altera_pcie_host_init() (Ley Foon Tan)
    - Make MSI explicitly non-modular (Paul Gortmaker)
    - Make explicitly non-modular (Paul Gortmaker)
    - Relax device number checking to allow SR-IOV (Po Liu)

    ARM Versatile host bridge driver:
    - Fix pci_remap_iospace() failure path (Lorenzo Pieralisi)

    Axis ARTPEC-6 host bridge driver:
    - Drop __init from artpec6_add_pcie_port() (Niklas Cassel)

    Freescale i.MX6 host bridge driver:
    - Make explicitly non-modular (Paul Gortmaker)

    Intel VMD host bridge driver:
    - Add quirk for AER to ignore source ID (Jon Derrick)
    - Allocate IRQ lists with correct MSI-X count (Jon Derrick)
    - Convert to use pci_alloc_irq_vectors() API (Jon Derrick)
    - Eliminate vmd_vector member from list type (Jon Derrick)
    - Eliminate index member from IRQ list (Jon Derrick)
    - Synchronize with RCU freeing MSI IRQ descs (Keith Busch)
    - Request userspace control of PCIe hotplug indicators (Keith Busch)
    - Move VMD driver to drivers/pci/host (Keith Busch)

    Marvell Aardvark host bridge driver:
    - Fix pci_remap_iospace() failure path (Lorenzo Pieralisi)
    - Remove redundant dev_err call in advk_pcie_probe() (Wei Yongjun)

    Microsoft Hyper-V host bridge driver:
    - Use zero-length array in struct pci_packet (Dexuan Cui)
    - Use pci_function_description[0] in struct definitions (Dexuan Cui)
    - Remove the unused 'wrk' in struct hv_pcibus_device (Dexuan Cui)
    - Handle vmbus_sendpacket() failure in hv_compose_msi_msg() (Dexuan Cui)
    - Handle hv_pci_generic_compl() error case (Dexuan Cui)
    - Use list_move_tail() instead of list_del() + list_add_tail() (Wei Yongjun)

    NVIDIA Tegra host bridge driver:
    - Fix pci_remap_iospace() failure path (Lorenzo Pieralisi)
    - Remove redundant _data suffix (Thierry Reding)
    - Use of_device_get_match_data() (Thierry Reding)

    Qualcomm host bridge driver:
    - Make explicitly non-modular (Paul Gortmaker)

    Renesas R-Car host bridge driver:
    - Consolidate register space lookup and ioremap (Bjorn Helgaas)
    - Don't disable/unprepare clocks on prepare/enable failure (Geert Uytterhoeven)
    - Add multi-MSI support (Grigory Kletsko)
    - Fix pci_remap_iospace() failure path (Lorenzo Pieralisi)
    - Fix some checkpatch warnings (Sergei Shtylyov)
    - Try increasing PCIe link speed to 5 GT/s at boot (Sergei Shtylyov)

    Rockchip host bridge driver:
    - Add DT bindings for Rockchip PCIe controller (Shawn Lin)
    - Add Rockchip PCIe controller support (Shawn Lin)
    - Improve the deassert sequence of four reset pins (Shawn Lin)
    - Fix wrong transmitted FTS count (Shawn Lin)
    - Increase the Max Credit update interval (Rajat Jain)

    Samsung Exynos host bridge driver:
    - Make explicitly non-modular (Paul Gortmaker)

    ST Microelectronics SPEAr13xx host bridge driver:
    - Make explicitly non-modular (Paul Gortmaker)

    Synopsys DesignWare host bridge driver:
    - Return data directly from dw_pcie_readl_rc() (Bjorn Helgaas)
    - Exchange viewport of `MEMORYs' and `CFGs/IOs' (Dong Bo)
    - Check LTSSM training bit before deciding link is up (Jisheng Zhang)
    - Move link wait definitions to .c file (Joao Pinto)
    - Wait for iATU enable (Joao Pinto)
    - Add iATU Unroll feature (Joao Pinto)
    - Fix pci_remap_iospace() failure path (Lorenzo Pieralisi)
    - Make explicitly non-modular (Paul Gortmaker)
    - Relax device number checking to allow SR-IOV (Po Liu)
    - Keep viewport fixed for IO transaction if num_viewport > 2 (Pratyush Anand)
    - Remove redundant platform_get_resource() return value check (Wei Yongjun)

    TI DRA7xx host bridge driver:
    - Make explicitly non-modular (Paul Gortmaker)

    TI Keystone host bridge driver:
    - Propagate request_irq() failure (Wei Yongjun)

    Xilinx AXI host bridge driver:
    - Keep both legacy and MSI interrupt domain references (Bharat Kumar Gogada)
    - Clear interrupt register for invalid interrupt (Bharat Kumar Gogada)
    - Clear correct MSI set bit (Bharat Kumar Gogada)
    - Dispose of MSI virtual IRQ (Bharat Kumar Gogada)
    - Make explicitly non-modular (Paul Gortmaker)
    - Relax device number checking to allow SR-IOV (Po Liu)

    Xilinx NWL host bridge driver:
    - Expand error logging (Bharat Kumar Gogada)
    - Enable all MSI interrupts using MSI mask (Bharat Kumar Gogada)
    - Make explicitly non-modular (Paul Gortmaker)

    Miscellaneous:
    - Drop CONFIG_KEXEC_CORE ifdeffery (Lukas Wunner)
    - portdrv: Make explicitly non-modular (Paul Gortmaker)
    - Make DPC explicitly non-modular (Paul Gortmaker)"

    * tag 'pci-v4.9-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (105 commits)
    x86/PCI: VMD: Move VMD driver to drivers/pci/host
    PCI: rockchip: Fix wrong transmitted FTS count
    PCI: rockchip: Improve the deassert sequence of four reset pins
    PCI: rockchip: Increase the Max Credit update interval
    PCI: rcar: Try increasing PCIe link speed to 5 GT/s at boot
    PCI/AER: Fix aer_probe() kernel-doc comment
    PCI: Ignore requested alignment for VF BARs
    PCI: Ignore requested alignment for PROBE_ONLY and fixed resources
    PCI: Avoid unnecessary resume after direct-complete
    PCI: Recognize D3cold in pci_update_current_state()
    PCI: Query platform firmware for device power state
    PCI: Afford direct-complete to devices with non-standard PM
    PCI/AER: Cache capability position
    PCI/AER: Avoid memory allocation in interrupt handling path
    x86/PCI: VMD: Request userspace control of PCIe hotplug indicators
    PCI: pciehp: Allow exclusive userspace control of indicators
    ACPI / APEI: Send correct severity to calculate AER severity
    PCI/AER: Remove duplicate AER severity translation
    x86/PCI: VMD: Synchronize with RCU freeing MSI IRQ descs
    x86/PCI: VMD: Eliminate index member from IRQ list
    ...

    Linus Torvalds
     

05 Oct, 2016

1 commit

  • Move the driver source and Kconfig to the PCI host bridge drivers directory
    and move the config option to a more appropriate sub-menu instead of
    occupying the top-level location.

    Update the Kconfig option with the X86_64 dependency that was implicitly
    included from the previous location, and add information about the module
    name when built as a loadable module.

    Signed-off-by: Keith Busch
    Signed-off-by: Bjorn Helgaas
    CC: Jon Derrick

    Keith Busch
     

04 Oct, 2016

2 commits

  • Pull x86 platform changes from Ingo Molnar:
    "The main changes in this cycle were:

    - SGI UV updates (Andrew Banman)

    - Intel MID updates (Andy Shevchenko)

    - Initial Mellanox systems platform (Vadim Pasternak)"

    * 'x86-platform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86/platform/mellanox: Fix return value check in mlxplat_init()
    x86/platform/mellanox: Introduce support for Mellanox systems platform
    x86/platform/uv/BAU: Add UV4-specific functions
    x86/platform/uv/BAU: Fix payload queue setup on UV4 hardware
    x86/platform/uv/BAU: Disable software timeout on UV4 hardware
    x86/platform/uv/BAU: Populate ->uvhub_version with UV4 version information
    x86/platform/uv/BAU: Use generic function pointers
    x86/platform/uv/BAU: Add generic function pointers
    x86/platform/uv/BAU: Convert uv_physnodeaddr() use to uv_gpa_to_offset()
    x86/platform/uv/BAU: Clean up pq_init()
    x86/platform/uv/BAU: Clean up and update printks
    x86/platform/uv/BAU: Clean up vertical alignment
    x86/platform/intel-mid: Keep SRAM powered on at boot
    x86/platform/intel-mid: Add Intel Penwell to ID table
    x86/cpu: Rename Merrifield2 to Moorefield
    x86/platform/intel-mid: Implement power off sequence
    x86/platform/intel-mid: Enable SD card detection on Merrifield
    x86/platform/intel-mid: Enable WiFi on Intel Edison
    x86/platform/intel-mid: Run PWRMU command immediately

    Linus Torvalds
     
  • Pull low-level x86 updates from Ingo Molnar:
    "In this cycle this topic tree has become one of those 'super topics'
    that accumulated a lot of changes:

    - Add CONFIG_VMAP_STACK=y support to the core kernel and enable it on
    x86 - preceded by an array of changes. v4.8 saw preparatory changes
    in this area already - this is the rest of the work. Includes the
    thread stack caching performance optimization. (Andy Lutomirski)

    - switch_to() cleanups and all around enhancements. (Brian Gerst)

    - A large number of dumpstack infrastructure enhancements and an
    unwinder abstraction. The secret long term plan is safe(r) live
    patching plus maybe another attempt at debuginfo based unwinding -
    but all these current bits are standalone enhancements in a frame
    pointer based debug environment as well. (Josh Poimboeuf)

    - More __ro_after_init and const annotations. (Kees Cook)

    - Enable KASLR for the vmemmap memory region. (Thomas Garnier)"

    [ The virtually mapped stack changes are pretty fundamental, and not
    x86-specific per se, even if they are only used on x86 right now. ]

    * 'x86-asm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (70 commits)
    x86/asm: Get rid of __read_cr4_safe()
    thread_info: Use unsigned long for flags
    x86/alternatives: Add stack frame dependency to alternative_call_2()
    x86/dumpstack: Fix show_stack() task pointer regression
    x86/dumpstack: Remove dump_trace() and related callbacks
    x86/dumpstack: Convert show_trace_log_lvl() to use the new unwinder
    oprofile/x86: Convert x86_backtrace() to use the new unwinder
    x86/stacktrace: Convert save_stack_trace_*() to use the new unwinder
    perf/x86: Convert perf_callchain_kernel() to use the new unwinder
    x86/unwind: Add new unwind interface and implementations
    x86/dumpstack: Remove NULL task pointer convention
    fork: Optimize task creation by caching two thread stacks per CPU if CONFIG_VMAP_STACK=y
    sched/core: Free the stack early if CONFIG_THREAD_INFO_IN_TASK
    lib/syscall: Pin the task stack in collect_syscall()
    x86/process: Pin the target stack in get_wchan()
    x86/dumpstack: Pin the target stack when dumping it
    kthread: Pin the stack via try_get_task_stack()/put_task_stack() in to_live_kthread() function
    sched/core: Add try_get_task_stack() and put_task_stack()
    x86/entry/64: Fix a minor comment rebase error
    iommu/amd: Don't put completion-wait semaphore on stack
    ...

    Linus Torvalds
     

30 Sep, 2016

1 commit

  • We've unconditionally used the queued spinlock for many releases now.

    Its time to remove the old ticket lock code.

    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
    Cc: Waiman.Long@hpe.com
    Cc: david.vrabel@citrix.com
    Cc: dhowells@redhat.com
    Cc: pbonzini@redhat.com
    Cc: xen-devel@lists.xenproject.org
    Link: http://lkml.kernel.org/r/20160518184302.GO3193@twins.programming.kicks-ass.net
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     

23 Sep, 2016

1 commit

  • Enable system support for the Mellanox Technologies platform, which
    provides support for the next Mellanox basic systems: "msx6710",
    "msx6720", "msb7700", "msn2700", "msx1410", "msn2410", "msb7800",
    "msn2740", "msn2100" and also various number of derivative systems from
    the above basic types.

    The Kconfig controlling compilation of this code is: MLX_PLATFORM

    Signed-off-by: Vadim Pasternak
    Cc: jiri@resnulli.us
    Cc: gregkh@linuxfoundation.org
    Cc: platform-driver-x86@vger.kernel.org
    Cc: geert@linux-m68k.org
    Cc: linux@roeck-us.net
    Cc: akpm@linux-foundation.org
    Cc: mchehab@kernel.org
    Cc: davem@davemloft.net
    Cc: kvalo@codeaurora.org
    Link: http://lkml.kernel.org/r/1474578822-33805-1-git-send-email-vadimp@mellanox.com
    Signed-off-by: Thomas Gleixner

    Vadim Pasternak
     

15 Sep, 2016

2 commits


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
     

24 Aug, 2016

2 commits

  • Make HAVE_FUNCTION_GRAPH_FP_TEST a normal define, independent from
    kconfig. This removes some config file pollution and simplifies the
    checking for the fp test.

    Suggested-by: Steven Rostedt
    Signed-off-by: Josh Poimboeuf
    Acked-by: Steven Rostedt
    Cc: Andy Lutomirski
    Cc: Andy Lutomirski
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: Byungchul Park
    Cc: Denys Vlasenko
    Cc: Frederic Weisbecker
    Cc: H. Peter Anvin
    Cc: Kees Cook
    Cc: Linus Torvalds
    Cc: Nilay Vaish
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/2c4e5f05054d6d367f702fd153af7a0109dd5c81.1471607358.git.jpoimboe@redhat.com
    Signed-off-by: Ingo Molnar

    Josh Poimboeuf
     
  • This allows x86_64 kernels to enable vmapped stacks by setting
    HAVE_ARCH_VMAP_STACK=y - which enables the CONFIG_VMAP_STACK=y
    high level Kconfig option.

    There are a couple of interesting bits:

    First, x86 lazily faults in top-level paging entries for the vmalloc
    area. This won't work if we get a page fault while trying to access
    the stack: the CPU will promote it to a double-fault and we'll die.
    To avoid this problem, probe the new stack when switching stacks and
    forcibly populate the pgd entry for the stack when switching mms.

    Second, once we have guard pages around the stack, we'll want to
    detect and handle stack overflow.

    I didn't enable it on x86_32. We'd need to rework the double-fault
    code a bit and I'm concerned about running out of vmalloc virtual
    addresses under some workloads.

    This patch, by itself, will behave somewhat erratically when the
    stack overflows while RSP is still more than a few tens of bytes
    above the bottom of the stack. Specifically, we'll get #PF and make
    it to no_context and them oops without reliably triggering a
    double-fault, and no_context doesn't know about stack overflows.
    The next patch will improve that case.

    Thank you to Nadav and Brian for helping me pay enough attention to
    the SDM to hopefully get this right.

    Signed-off-by: Andy Lutomirski
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: Denys Vlasenko
    Cc: H. Peter Anvin
    Cc: Josh Poimboeuf
    Cc: Linus Torvalds
    Cc: Nadav Amit
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/c88f3e2920b18e6cc621d772a04a62c06869037e.1470907718.git.luto@kernel.org
    [ Minor edits. ]
    Signed-off-by: Ingo Molnar

    Andy Lutomirski
     

09 Aug, 2016

1 commit

  • Pull usercopy protection from Kees Cook:
    "Tbhis implements HARDENED_USERCOPY verification of copy_to_user and
    copy_from_user bounds checking for most architectures on SLAB and
    SLUB"

    * tag 'usercopy-v4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
    mm: SLUB hardened usercopy support
    mm: SLAB hardened usercopy support
    s390/uaccess: Enable hardened usercopy
    sparc/uaccess: Enable hardened usercopy
    powerpc/uaccess: Enable hardened usercopy
    ia64/uaccess: Enable hardened usercopy
    arm64/uaccess: Enable hardened usercopy
    ARM: uaccess: Enable hardened usercopy
    x86/uaccess: Enable hardened usercopy
    mm: Hardened usercopy
    mm: Implement stack frame object validation
    mm: Add is_migrate_cma_page

    Linus Torvalds
     

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

3 commits

  • Pull ACPI updates from Rafael Wysocki:
    "The new feaures here are the support for ACPI overlays (allowing ACPI
    tables to be loaded at any time from EFI variables or via configfs)
    and the LPI (Low-Power Idle) support. Also notable is the ACPI-based
    NUMA support for ARM64.

    Apart from that we have two new drivers, for the DPTF (Dynamic Power
    and Thermal Framework) power participant device and for the Intel
    Broxton WhiskeyCove PMIC, some more PMIC-related changes, support for
    the Boot Error Record Table (BERT) in APEI and support for
    platform-initiated graceful shutdown.

    Plus two new pieces of documentation and usual assorted fixes and
    cleanups in quite a few places.

    Specifics:

    - Support for ACPI SSDT overlays allowing Secondary System
    Description Tables (SSDTs) to be loaded at any time from EFI
    variables or via configfs (Octavian Purdila, Mika Westerberg).

    - Support for the ACPI LPI (Low-Power Idle) feature introduced in
    ACPI 6.0 and allowing processor idle states to be represented in
    ACPI tables in a hierarchical way (with the help of Processor
    Container objects) and support for ACPI idle states management on
    ARM64, based on LPI (Sudeep Holla).

    - General improvements of ACPI support for NUMA and ARM64 support for
    ACPI-based NUMA (Hanjun Guo, David Daney, Robert Richter).

    - General improvements of the ACPI table upgrade mechanism and ARM64
    support for that feature (Aleksey Makarov, Jon Masters).

    - Support for the Boot Error Record Table (BERT) in APEI and
    improvements of kernel messages printed by the error injection code
    (Huang Ying, Borislav Petkov).

    - New driver for the Intel Broxton WhiskeyCove PMIC operation region
    and support for the REGS operation region on Broxton, PMIC code
    cleanups (Bin Gao, Felipe Balbi, Paul Gortmaker).

    - New driver for the power participant device which is part of the
    Dynamic Power and Thermal Framework (DPTF) and DPTF-related code
    reorganization (Srinivas Pandruvada).

    - Support for the platform-initiated graceful shutdown feature
    introduced in ACPI 6.1 (Prashanth Prakash).

    - ACPI button driver update related to lid input events generated
    automatically on initialization and system resume that have been
    problematic for some time (Lv Zheng).

    - ACPI EC driver cleanups (Lv Zheng).

    - Documentation of the ACPICA release automation process and the
    in-kernel ACPI AML debugger (Lv Zheng).

    - New blacklist entry and two fixes for the ACPI backlight driver
    (Alex Hung, Arvind Yadav, Ralf Gerbig).

    - Cleanups of the ACPI pci_slot driver (Joe Perches, Paul Gortmaker).

    - ACPI CPPC code changes to make it more robust against possible
    defects in ACPI tables and new symbol definitions for PCC (Hoan
    Tran).

    - System reboot code modification to execute the ACPI _PTS (Prepare
    To Sleep) method in addition to _TTS (Ocean He).

    - ACPICA-related change to carry out lock ordering checks in ACPICA
    if ACPICA debug is enabled in the kernel (Lv Zheng).

    - Assorted minor fixes and cleanups (Andy Shevchenko, Baoquan He,
    Bhaktipriya Shridhar, Paul Gortmaker, Rafael Wysocki)"

    * tag 'acpi-4.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (71 commits)
    ACPI: enable ACPI_PROCESSOR_IDLE on ARM64
    arm64: add support for ACPI Low Power Idle(LPI)
    drivers: firmware: psci: initialise idle states using ACPI LPI
    cpuidle: introduce CPU_PM_CPU_IDLE_ENTER macro for ARM{32, 64}
    arm64: cpuidle: drop __init section marker to arm_cpuidle_init
    ACPI / processor_idle: Add support for Low Power Idle(LPI) states
    ACPI / processor_idle: introduce ACPI_PROCESSOR_CSTATE
    ACPI / DPTF: move int340x_thermal.c to the DPTF folder
    ACPI / DPTF: Add DPTF power participant driver
    ACPI / lpat: make it explicitly non-modular
    ACPI / dock: make dock explicitly non-modular
    ACPI / PCI: make pci_slot explicitly non-modular
    ACPI / PMIC: remove modular references from non-modular code
    ACPICA: Linux: Enable ACPI_MUTEX_DEBUG for Linux kernel
    ACPI: Rename configfs.c to acpi_configfs.c to prevent link error
    ACPI / debugger: Add AML debugger documentation
    ACPI: Add documentation describing ACPICA release automation
    ACPI: add support for loading SSDTs via configfs
    ACPI: add support for configfs
    efi / ACPI: load SSTDs from EFI variables
    ...

    Linus Torvalds
     
  • Enables CONFIG_HARDENED_USERCOPY checks on x86. This is done both in
    copy_*_user() and __copy_*_user() because copy_*_user() actually calls
    down to _copy_*_user() and not __copy_*_user().

    Based on code from PaX and grsecurity.

    Signed-off-by: Kees Cook
    Tested-by: Valdis Kletnieks

    Kees Cook
     
  • This creates per-architecture function arch_within_stack_frames() that
    should validate if a given object is contained by a kernel stack frame.
    Initial implementation is on x86.

    This is based on code from PaX.

    Signed-off-by: Kees Cook

    Kees Cook
     

26 Jul, 2016

2 commits

  • Pull x86 cleanups from Ingo Molnar:
    "Three small cleanups"

    * 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    lguest: Read offset of device_cap later
    lguest: Read length of device_cap later
    x86: Do away with ARCH_[WANT_OPTIONAL|REQUIRE]_GPIOLIB

    Linus Torvalds
     
  • Pull x86 boot updates from Ingo Molnar:
    "The main changes:

    - add initial commits to randomize kernel memory section virtual
    addresses, enabled via a new kernel option: RANDOMIZE_MEMORY
    (Thomas Garnier, Kees Cook, Baoquan He, Yinghai Lu)

    - enhance KASLR (RANDOMIZE_BASE) physical memory randomization (Kees
    Cook)

    - EBDA/BIOS region boot quirk cleanups (Andy Lutomirski, Ingo Molnar)

    - misc cleanups/fixes"

    * 'x86-boot-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86/boot: Simplify EBDA-vs-BIOS reservation logic
    x86/boot: Clarify what x86_legacy_features.reserve_bios_regions does
    x86/boot: Reorganize and clean up the BIOS area reservation code
    x86/mm: Do not reference phys addr beyond kernel
    x86/mm: Add memory hotplug support for KASLR memory randomization
    x86/mm: Enable KASLR for vmalloc memory regions
    x86/mm: Enable KASLR for physical mapping memory regions
    x86/mm: Implement ASLR for kernel memory regions
    x86/mm: Separate variable for trampoline PGD
    x86/mm: Add PUD VA support for physical mapping
    x86/mm: Update physical mapping variable names
    x86/mm: Refactor KASLR entropy functions
    x86/KASLR: Fix boot crash with certain memory configurations
    x86/boot/64: Add forgotten end of function marker
    x86/KASLR: Allow randomization below the load address
    x86/KASLR: Extend kernel image physical address randomization to addresses larger than 4G
    x86/KASLR: Randomize virtual address separately
    x86/KASLR: Clarify identity map interface
    x86/boot: Refuse to build with data relocations
    x86/KASLR, x86/power: Remove x86 hibernation restrictions

    Linus Torvalds
     

09 Jul, 2016

1 commit


08 Jul, 2016

3 commits

  • Add a new option (CONFIG_RANDOMIZE_MEMORY_PHYSICAL_PADDING) to define
    the padding used for the physical memory mapping section when KASLR
    memory is enabled. It ensures there is enough virtual address space when
    CONFIG_MEMORY_HOTPLUG is used. The default value is 10 terabytes. If
    CONFIG_MEMORY_HOTPLUG is not used, no space is reserved increasing the
    entropy available.

    Signed-off-by: Thomas Garnier
    Signed-off-by: Kees Cook
    Cc: Alexander Kuleshov
    Cc: Alexander Popov
    Cc: Andrew Morton
    Cc: Andy Lutomirski
    Cc: Aneesh Kumar K.V
    Cc: Baoquan He
    Cc: Boris Ostrovsky
    Cc: Borislav Petkov
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: Christian Borntraeger
    Cc: Dan Williams
    Cc: Dave Hansen
    Cc: Dave Young
    Cc: Denys Vlasenko
    Cc: Dmitry Vyukov
    Cc: H. Peter Anvin
    Cc: Jan Beulich
    Cc: Joerg Roedel
    Cc: Jonathan Corbet
    Cc: Josh Poimboeuf
    Cc: Juergen Gross
    Cc: Kirill A. Shutemov
    Cc: Linus Torvalds
    Cc: Lv Zheng
    Cc: Mark Salter
    Cc: Martin Schwidefsky
    Cc: Matt Fleming
    Cc: Peter Zijlstra
    Cc: Stephen Smalley
    Cc: Thomas Gleixner
    Cc: Toshi Kani
    Cc: Xiao Guangrong
    Cc: Yinghai Lu
    Cc: kernel-hardening@lists.openwall.com
    Cc: linux-doc@vger.kernel.org
    Link: http://lkml.kernel.org/r/1466556426-32664-10-git-send-email-keescook@chromium.org
    Signed-off-by: Ingo Molnar

    Thomas Garnier
     
  • Randomizes the virtual address space of kernel memory regions for
    x86_64. This first patch adds the infrastructure and does not randomize
    any region. The following patches will randomize the physical memory
    mapping, vmalloc and vmemmap regions.

    This security feature mitigates exploits relying on predictable kernel
    addresses. These addresses can be used to disclose the kernel modules
    base addresses or corrupt specific structures to elevate privileges
    bypassing the current implementation of KASLR. This feature can be
    enabled with the CONFIG_RANDOMIZE_MEMORY option.

    The order of each memory region is not changed. The feature looks at the
    available space for the regions based on different configuration options
    and randomizes the base and space between each. The size of the physical
    memory mapping is the available physical memory. No performance impact
    was detected while testing the feature.

    Entropy is generated using the KASLR early boot functions now shared in
    the lib directory (originally written by Kees Cook). Randomization is
    done on PGD & PUD page table levels to increase possible addresses. The
    physical memory mapping code was adapted to support PUD level virtual
    addresses. This implementation on the best configuration provides 30,000
    possible virtual addresses in average for each memory region. An
    additional low memory page is used to ensure each CPU can start with a
    PGD aligned virtual address (for realmode).

    x86/dump_pagetable was updated to correctly display each region.

    Updated documentation on x86_64 memory layout accordingly.

    Performance data, after all patches in the series:

    Kernbench shows almost no difference (-+ less than 1%):

    Before:

    Average Optimal load -j 12 Run (std deviation): Elapsed Time 102.63 (1.2695)
    User Time 1034.89 (1.18115) System Time 87.056 (0.456416) Percent CPU 1092.9
    (13.892) Context Switches 199805 (3455.33) Sleeps 97907.8 (900.636)

    After:

    Average Optimal load -j 12 Run (std deviation): Elapsed Time 102.489 (1.10636)
    User Time 1034.86 (1.36053) System Time 87.764 (0.49345) Percent CPU 1095
    (12.7715) Context Switches 199036 (4298.1) Sleeps 97681.6 (1031.11)

    Hackbench shows 0% difference on average (hackbench 90 repeated 10 times):

    attemp,before,after 1,0.076,0.069 2,0.072,0.069 3,0.066,0.066 4,0.066,0.068
    5,0.066,0.067 6,0.066,0.069 7,0.067,0.066 8,0.063,0.067 9,0.067,0.065
    10,0.068,0.071 average,0.0677,0.0677

    Signed-off-by: Thomas Garnier
    Signed-off-by: Kees Cook
    Cc: Alexander Kuleshov
    Cc: Alexander Popov
    Cc: Andrew Morton
    Cc: Andy Lutomirski
    Cc: Aneesh Kumar K.V
    Cc: Baoquan He
    Cc: Boris Ostrovsky
    Cc: Borislav Petkov
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: Christian Borntraeger
    Cc: Dan Williams
    Cc: Dave Hansen
    Cc: Dave Young
    Cc: Denys Vlasenko
    Cc: Dmitry Vyukov
    Cc: H. Peter Anvin
    Cc: Jan Beulich
    Cc: Joerg Roedel
    Cc: Jonathan Corbet
    Cc: Josh Poimboeuf
    Cc: Juergen Gross
    Cc: Kirill A. Shutemov
    Cc: Linus Torvalds
    Cc: Lv Zheng
    Cc: Mark Salter
    Cc: Martin Schwidefsky
    Cc: Matt Fleming
    Cc: Peter Zijlstra
    Cc: Stephen Smalley
    Cc: Thomas Gleixner
    Cc: Toshi Kani
    Cc: Xiao Guangrong
    Cc: Yinghai Lu
    Cc: kernel-hardening@lists.openwall.com
    Cc: linux-doc@vger.kernel.org
    Link: http://lkml.kernel.org/r/1466556426-32664-6-git-send-email-keescook@chromium.org
    Signed-off-by: Ingo Molnar

    Thomas Garnier
     
  • Signed-off-by: Ingo Molnar

    Ingo Molnar
     

26 Jun, 2016

2 commits

  • We want the physical address to be randomized anywhere between
    16MB and the top of physical memory (up to 64TB).

    This patch exchanges the prior slots[] array for the new slot_areas[]
    array, and lifts the limitation of KERNEL_IMAGE_SIZE on the physical
    address offset for 64-bit. As before, process_e820_entry() walks
    memory and populates slot_areas[], splitting on any detected mem_avoid
    collisions.

    Finally, since the slots[] array and its associated functions are not
    needed any more, so they are removed.

    Based on earlier patches by Baoquan He.

    Originally-from: Baoquan He
    Signed-off-by: Kees Cook
    Cc: Andrew Morton
    Cc: Andrey Ryabinin
    Cc: Andy Lutomirski
    Cc: Baoquan He
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: Denys Vlasenko
    Cc: Dmitry Vyukov
    Cc: H. Peter Anvin
    Cc: H.J. Lu
    Cc: Josh Poimboeuf
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: Yinghai Lu
    Link: http://lkml.kernel.org/r/1464216334-17200-5-git-send-email-keescook@chromium.org
    Signed-off-by: Ingo Molnar

    Kees Cook
     
  • The mc146818_get_time/mc146818_set_time functions are rather large
    inline functions in a global header file and are used in several
    drivers and in x86 specific code.

    Here we move them into a separate .c file that is compiled whenever
    any of the users require it. This also lets us remove the linux/acpi.h
    header inclusion from mc146818rtc.h, which in turn avoids some
    warnings about duplicate definition of the TRUE/FALSE macros.

    Signed-off-by: Arnd Bergmann
    Signed-off-by: Alexandre Belloni

    Arnd Bergmann
     

22 Jun, 2016

1 commit


18 Jun, 2016

1 commit

  • Several modern devices, such as PC/104 cards, are expected to run on
    modern systems via an ISA bus interface. Since ISA is a legacy interface
    for most modern architectures, ISA support should remain disabled in
    general. Support for ISA-style drivers should be enabled on a per driver
    basis.

    To allow ISA-style drivers on modern systems, this patch introduces the
    ISA_BUS_API and ISA_BUS Kconfig options. The ISA bus driver will now
    build conditionally on the ISA_BUS_API Kconfig option, which defaults to
    the legacy ISA Kconfig option. The ISA_BUS Kconfig option allows the
    ISA_BUS_API Kconfig option to be selected on architectures which do not
    enable ISA (e.g. X86_64).

    The ISA_BUS Kconfig option is currently only implemented for X86
    architectures. Other architectures may have their own ISA_BUS Kconfig
    options added as required.

    Reviewed-by: Guenter Roeck
    Signed-off-by: William Breathitt Gray
    Acked-by: Linus Torvalds
    Signed-off-by: Greg Kroah-Hartman

    William Breathitt Gray
     

10 Jun, 2016

1 commit

  • This replaces:

    - "select ARCH_REQUIRE_GPIOLIB" with "select GPIOLIB" as this can
    now be selected directly.

    - "select ARCH_WANT_OPTIONAL_GPIOLIB" with no dependency: GPIOLIB
    is now selectable by everyone, so we need not declare our
    intent to select it.

    When ordering the symbols the following rationale was used:
    if the selects were in alphabetical order, I moved select GPIOLIB
    to be in alphabetical order, but if the selects were not
    maintained in alphabetical order, I just replaced
    "select ARCH_REQUIRE_GPIOLIB" with "select GPIOLIB".

    Signed-off-by: Linus Walleij
    Cc: Michael Büsch
    Link: http://lkml.kernel.org/r/1464870018-8281-1-git-send-email-linus.walleij@linaro.org
    Signed-off-by: Thomas Gleixner

    Linus Walleij
     

08 Jun, 2016

2 commits

  • People complained about ARCH_HWEIGHT_CFLAGS and how it throws a wrench
    into kcov, lto, etc, experimentations.

    Add asm versions for __sw_hweight{32,64}() and do explicit saving and
    restoring of clobbered registers. This gets rid of the special calling
    convention. We get to call those functions on !X86_FEATURE_POPCNT CPUs.

    We still need to hardcode POPCNT and register operands as some old gas
    versions which we support, do not know about POPCNT.

    Btw, remove redundant REX prefix from 32-bit POPCNT because alternatives
    can do padding now.

    Suggested-by: H. Peter Anvin
    Signed-off-by: Borislav Petkov
    Acked-by: Peter Zijlstra (Intel)
    Cc: Andy Lutomirski
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: Denys Vlasenko
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/1464605787-20603-1-git-send-email-bp@alien8.de
    Signed-off-by: Ingo Molnar

    Borislav Petkov
     
  • This patch allows to build the whole kernel with GCC plugins. It was ported from
    grsecurity/PaX. The infrastructure supports building out-of-tree modules and
    building in a separate directory. Cross-compilation is supported too.
    Currently the x86, arm, arm64 and uml architectures enable plugins.

    The directory of the gcc plugins is scripts/gcc-plugins. You can use a file or a directory
    there. The plugins compile with these options:
    * -fno-rtti: gcc is compiled with this option so the plugins must use it too
    * -fno-exceptions: this is inherited from gcc too
    * -fasynchronous-unwind-tables: this is inherited from gcc too
    * -ggdb: it is useful for debugging a plugin (better backtrace on internal
    errors)
    * -Wno-narrowing: to suppress warnings from gcc headers (ipa-utils.h)
    * -Wno-unused-variable: to suppress warnings from gcc headers (gcc_version
    variable, plugin-version.h)

    The infrastructure introduces a new Makefile target called gcc-plugins. It
    supports all gcc versions from 4.5 to 6.0. The scripts/gcc-plugin.sh script
    chooses the proper host compiler (gcc-4.7 can be built by either gcc or g++).
    This script also checks the availability of the included headers in
    scripts/gcc-plugins/gcc-common.h.

    The gcc-common.h header contains frequently included headers for GCC plugins
    and it has a compatibility layer for the supported gcc versions.

    The gcc-generate-*-pass.h headers automatically generate the registration
    structures for GIMPLE, SIMPLE_IPA, IPA and RTL passes.

    Note that 'make clean' keeps the *.so files (only the distclean or mrproper
    targets clean all) because they are needed for out-of-tree modules.

    Based on work created by the PaX Team.

    Signed-off-by: Emese Revfy
    Acked-by: Kees Cook
    Signed-off-by: Michal Marek

    Emese Revfy
     

22 May, 2016

1 commit

  • Commit b3c1be1b789c ("base: isa: Remove X86_32 dependency") made ISA
    support available on x86-64 too. That's not right - while there are
    some LPC-style devices that might be useful still and be based on
    ISA-like IP blocks, that is *not* an excuse to try to enable any random
    legacy drivers.

    Such drivers should be individually enabled and made to perhaps depend
    on ISA_DMA_API instead (which we have continued to support on x86-64).
    Or we could add another "ISA_XYZ_API" that we support that doesn't
    enable random old drivers that aren't even 64-bit clean nor do we have
    any test coverage for.

    Turning off ISA will now also turn off some drivers that have been
    marked as depending on it as part of this series, and that used to work
    on modern platforms.

    See for example commits ad7afc38eab3..cc736607c86d, which may also need
    to be reverted.

    This commit means that the warnings that came in due to enabling ISA
    widely are now gone again.

    Acked-by: William Breathitt Gray
    Cc: Linus Walleij
    Cc: Guenter Roeck
    Cc: Greg Kroah-Hartman
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

21 May, 2016

4 commits

  • Merge more updates from Andrew Morton:

    - the rest of MM

    - KASAN updates

    - procfs updates

    - exit, fork updates

    - printk updates

    - lib/ updates

    - radix-tree testsuite updates

    - checkpatch updates

    - kprobes updates

    - a few other misc bits

    * emailed patches from Andrew Morton : (162 commits)
    samples/kprobes: print out the symbol name for the hooks
    samples/kprobes: add a new module parameter
    kprobes: add the "tls" argument for j_do_fork
    init/main.c: simplify initcall_blacklisted()
    fs/efs/super.c: fix return value
    checkpatch: improve --git shortcut
    checkpatch: reduce number of `git log` calls with --git
    checkpatch: add support to check already applied git commits
    checkpatch: add --list-types to show message types to show or ignore
    checkpatch: advertise the --fix and --fix-inplace options more
    checkpatch: whine about ACCESS_ONCE
    checkpatch: add test for keywords not starting on tabstops
    checkpatch: improve CONSTANT_COMPARISON test for structure members
    checkpatch: add PREFER_IS_ENABLED test
    lib/GCD.c: use binary GCD algorithm instead of Euclidean
    radix-tree: free up the bottom bit of exceptional entries for reuse
    dax: move RADIX_DAX_ definitions to dax.c
    radix-tree: make radix_tree_descend() more useful
    radix-tree: introduce radix_tree_replace_clear_tags()
    radix-tree: tidy up __radix_tree_create()
    ...

    Linus Torvalds
     
  • Pull driver core updates from Greg KH:
    "Here's the "big" driver core update for 4.7-rc1.

    Mostly just debugfs changes, the long-known and messy races with
    removing debugfs files should be fixed thanks to the great work of
    Nicolai Stange. We also have some isa updates in here (the x86
    maintainers told me to take it through this tree), a new warning when
    we run out of dynamic char major numbers, and a few other assorted
    changes, details in the shortlog.

    All have been in linux-next for some time with no reported issues"

    * tag 'driver-core-4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (32 commits)
    Revert "base: dd: don't remove driver_data in -EPROBE_DEFER case"
    gpio: ws16c48: Utilize the ISA bus driver
    gpio: 104-idio-16: Utilize the ISA bus driver
    gpio: 104-idi-48: Utilize the ISA bus driver
    gpio: 104-dio-48e: Utilize the ISA bus driver
    watchdog: ebc-c384_wdt: Utilize the ISA bus driver
    iio: stx104: Utilize the module_isa_driver and max_num_isa_dev macros
    iio: stx104: Add X86 dependency to STX104 Kconfig option
    Documentation: Add ISA bus driver documentation
    isa: Implement the max_num_isa_dev macro
    isa: Implement the module_isa_driver macro
    pnp: pnpbios: Add explicit X86_32 dependency to PNPBIOS
    isa: Decouple X86_32 dependency from the ISA Kconfig option
    driver-core: use 'dev' argument in dev_dbg_ratelimited stub
    base: dd: don't remove driver_data in -EPROBE_DEFER case
    kernfs: Move faulting copy_user operations outside of the mutex
    devcoredump: add scatterlist support
    debugfs: unproxify files created through debugfs_create_u32_array()
    debugfs: unproxify files created through debugfs_create_blob()
    debugfs: unproxify files created through debugfs_create_bool()
    ...

    Linus Torvalds
     
  • printk() takes some locks and could not be used a safe way in NMI
    context.

    The chance of a deadlock is real especially when printing stacks from
    all CPUs. This particular problem has been addressed on x86 by the
    commit a9edc8809328 ("x86/nmi: Perform a safe NMI stack trace on all
    CPUs").

    The patchset brings two big advantages. First, it makes the NMI
    backtraces safe on all architectures for free. Second, it makes all NMI
    messages almost safe on all architectures (the temporary buffer is
    limited. We still should keep the number of messages in NMI context at
    minimum).

    Note that there already are several messages printed in NMI context:
    WARN_ON(in_nmi()), BUG_ON(in_nmi()), anything being printed out from MCE
    handlers. These are not easy to avoid.

    This patch reuses most of the code and makes it generic. It is useful
    for all messages and architectures that support NMI.

    The alternative printk_func is set when entering and is reseted when
    leaving NMI context. It queues IRQ work to copy the messages into the
    main ring buffer in a safe context.

    __printk_nmi_flush() copies all available messages and reset the buffer.
    Then we could use a simple cmpxchg operations to get synchronized with
    writers. There is also used a spinlock to get synchronized with other
    flushers.

    We do not longer use seq_buf because it depends on external lock. It
    would be hard to make all supported operations safe for a lockless use.
    It would be confusing and error prone to make only some operations safe.

    The code is put into separate printk/nmi.c as suggested by Steven
    Rostedt. It needs a per-CPU buffer and is compiled only on
    architectures that call nmi_enter(). This is achieved by the new
    HAVE_NMI Kconfig flag.

    The are MN10300 and Xtensa architectures. We need to clean up NMI
    handling there first. Let's do it separately.

    The patch is heavily based on the draft from Peter Zijlstra, see

    https://lkml.org/lkml/2015/6/10/327

    [arnd@arndb.de: printk-nmi: use %zu format string for size_t]
    [akpm@linux-foundation.org: min_t->min - all types are size_t here]
    Signed-off-by: Petr Mladek
    Suggested-by: Peter Zijlstra
    Suggested-by: Steven Rostedt
    Cc: Jan Kara
    Acked-by: Russell King [arm part]
    Cc: Daniel Thompson
    Cc: Jiri Kosina
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: Ralf Baechle
    Cc: Benjamin Herrenschmidt
    Cc: Martin Schwidefsky
    Cc: David Miller
    Cc: Daniel Thompson
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Petr Mladek
     
  • Define HAVE_EXIT_THREAD for archs which want to do something in
    exit_thread. For others, let's define exit_thread as an empty inline.

    This is a cleanup before we change the prototype of exit_thread to
    accept a task parameter.

    [akpm@linux-foundation.org: fix mips]
    Signed-off-by: Jiri Slaby
    Cc: "David S. Miller"
    Cc: "H. Peter Anvin"
    Cc: "James E.J. Bottomley"
    Cc: Aurelien Jacquiot
    Cc: Benjamin Herrenschmidt
    Cc: Catalin Marinas
    Cc: Chen Liqin
    Cc: Chris Metcalf
    Cc: Chris Zankel
    Cc: David Howells
    Cc: Fenghua Yu
    Cc: Geert Uytterhoeven
    Cc: Guan Xuetao
    Cc: Haavard Skinnemoen
    Cc: Hans-Christian Egtvedt
    Cc: Heiko Carstens
    Cc: Helge Deller
    Cc: Ingo Molnar
    Cc: Ivan Kokshaysky
    Cc: James Hogan
    Cc: Jeff Dike
    Cc: Jesper Nilsson
    Cc: Jiri Slaby
    Cc: Jonas Bonn
    Cc: Koichi Yasutake
    Cc: Lennox Wu
    Cc: Ley Foon Tan
    Cc: Mark Salter
    Cc: Martin Schwidefsky
    Cc: Matt Turner
    Cc: Max Filippov
    Cc: Michael Ellerman
    Cc: Michal Simek
    Cc: Mikael Starvik
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Ralf Baechle
    Cc: Rich Felker
    Cc: Richard Henderson
    Cc: Richard Kuo
    Cc: Richard Weinberger
    Cc: Russell King
    Cc: Steven Miao
    Cc: Thomas Gleixner
    Cc: Tony Luck
    Cc: Vineet Gupta
    Cc: Will Deacon
    Cc: Yoshinori Sato
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jiri Slaby
     

18 May, 2016

1 commit

  • Pull networking updates from David Miller:
    "Highlights:

    1) Support SPI based w5100 devices, from Akinobu Mita.

    2) Partial Segmentation Offload, from Alexander Duyck.

    3) Add GMAC4 support to stmmac driver, from Alexandre TORGUE.

    4) Allow cls_flower stats offload, from Amir Vadai.

    5) Implement bpf blinding, from Daniel Borkmann.

    6) Optimize _ASYNC_ bit twiddling on sockets, unless the socket is
    actually using FASYNC these atomics are superfluous. From Eric
    Dumazet.

    7) Run TCP more preemptibly, also from Eric Dumazet.

    8) Support LED blinking, EEPROM dumps, and rxvlan offloading in mlx5e
    driver, from Gal Pressman.

    9) Allow creating ppp devices via rtnetlink, from Guillaume Nault.

    10) Improve BPF usage documentation, from Jesper Dangaard Brouer.

    11) Support tunneling offloads in qed, from Manish Chopra.

    12) aRFS offloading in mlx5e, from Maor Gottlieb.

    13) Add RFS and RPS support to SCTP protocol, from Marcelo Ricardo
    Leitner.

    14) Add MSG_EOR support to TCP, this allows controlling packet
    coalescing on application record boundaries for more accurate
    socket timestamp sampling. From Martin KaFai Lau.

    15) Fix alignment of 64-bit netlink attributes across the board, from
    Nicolas Dichtel.

    16) Per-vlan stats in bridging, from Nikolay Aleksandrov.

    17) Several conversions of drivers to ethtool ksettings, from Philippe
    Reynes.

    18) Checksum neutral ILA in ipv6, from Tom Herbert.

    19) Factorize all of the various marvell dsa drivers into one, from
    Vivien Didelot

    20) Add VF support to qed driver, from Yuval Mintz"

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1649 commits)
    Revert "phy dp83867: Fix compilation with CONFIG_OF_MDIO=m"
    Revert "phy dp83867: Make rgmii parameters optional"
    r8169: default to 64-bit DMA on recent PCIe chips
    phy dp83867: Make rgmii parameters optional
    phy dp83867: Fix compilation with CONFIG_OF_MDIO=m
    bpf: arm64: remove callee-save registers use for tmp registers
    asix: Fix offset calculation in asix_rx_fixup() causing slow transmissions
    switchdev: pass pointer to fib_info instead of copy
    net_sched: close another race condition in tcf_mirred_release()
    tipc: fix nametable publication field in nl compat
    drivers: net: Don't print unpopulated net_device name
    qed: add support for dcbx.
    ravb: Add missing free_irq() calls to ravb_close()
    qed: Remove a stray tab
    net: ethernet: fec-mpc52xx: use phy_ethtool_{get|set}_link_ksettings
    net: ethernet: fec-mpc52xx: use phydev from struct net_device
    bpf, doc: fix typo on bpf_asm descriptions
    stmmac: hardware TX COE doesn't work when force_thresh_dma_mode is set
    net: ethernet: fs-enet: use phy_ethtool_{get|set}_link_ksettings
    net: ethernet: fs-enet: use phydev from struct net_device
    ...

    Linus Torvalds
     

17 May, 2016

2 commits

  • Pull x86 boot updates from Ingo Molnar:
    "The biggest changes in this cycle were:

    - prepare for more KASLR related changes, by restructuring, cleaning
    up and fixing the existing boot code. (Kees Cook, Baoquan He,
    Yinghai Lu)

    - simplifly/concentrate subarch handling code, eliminate
    paravirt_enabled() usage. (Luis R Rodriguez)"

    * 'x86-boot-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (50 commits)
    x86/KASLR: Clarify purpose of each get_random_long()
    x86/KASLR: Add virtual address choosing function
    x86/KASLR: Return earliest overlap when avoiding regions
    x86/KASLR: Add 'struct slot_area' to manage random_addr slots
    x86/boot: Add missing file header comments
    x86/KASLR: Initialize mapping_info every time
    x86/boot: Comment what finalize_identity_maps() does
    x86/KASLR: Build identity mappings on demand
    x86/boot: Split out kernel_ident_mapping_init()
    x86/boot: Clean up indenting for asm/boot.h
    x86/KASLR: Improve comments around the mem_avoid[] logic
    x86/boot: Simplify pointer casting in choose_random_location()
    x86/KASLR: Consolidate mem_avoid[] entries
    x86/boot: Clean up pointer casting
    x86/boot: Warn on future overlapping memcpy() use
    x86/boot: Extract error reporting functions
    x86/boot: Correctly bounds-check relocations
    x86/KASLR: Clean up unused code from old 'run_size' and rename it to 'kernel_total_size'
    x86/boot: Fix "run_size" calculation
    x86/boot: Calculate decompression size during boot not build
    ...

    Linus Torvalds
     
  • Split the HAVE_BPF_JIT into two for distinguishing cBPF and eBPF JITs.

    Current cBPF ones:

    # git grep -n HAVE_CBPF_JIT arch/
    arch/arm/Kconfig:44: select HAVE_CBPF_JIT
    arch/mips/Kconfig:18: select HAVE_CBPF_JIT if !CPU_MICROMIPS
    arch/powerpc/Kconfig:129: select HAVE_CBPF_JIT
    arch/sparc/Kconfig:35: select HAVE_CBPF_JIT

    Current eBPF ones:

    # git grep -n HAVE_EBPF_JIT arch/
    arch/arm64/Kconfig:61: select HAVE_EBPF_JIT
    arch/s390/Kconfig:126: select HAVE_EBPF_JIT if PACK_STACK && HAVE_MARCH_Z196_FEATURES
    arch/x86/Kconfig:94: select HAVE_EBPF_JIT if X86_64

    Later code also needs this facility to check for eBPF JITs.

    Signed-off-by: Daniel Borkmann
    Acked-by: Alexei Starovoitov
    Signed-off-by: David S. Miller

    Daniel Borkmann