02 May, 2018

1 commit

  • commit dd709e72cb934eefd44de8d9969097173fbf45dc upstream.

    Commit 99492c39f39f ("earlycon: Fix __earlycon_table stride") tried to fix
    __earlycon_table stride by forcing the earlycon_id struct alignment to 32
    and asking the linker to 32-byte align the __earlycon_table symbol. This
    fix was based on commit 07fca0e57fca92 ("tracing: Properly align linker
    defined symbols") which tried a similar fix for the tracing subsystem.

    However, this fix doesn't quite work because there is no guarantee that
    gcc will place structures packed into an array format. In fact, gcc 4.9
    chooses to 64-byte align these structs by inserting additional padding
    between the entries because it has no clue that they are supposed to be in
    an array. If we are unlucky, the linker will assign symbol
    "__earlycon_table" to a 32-byte aligned address which does not correspond
    to the 64-byte aligned contents of section "__earlycon_table".

    To address this same problem, the fix to the tracing system was
    subsequently re-implemented using a more robust table of pointers approach
    by commits:
    3d56e331b653 ("tracing: Replace syscall_meta_data struct array with pointer array")
    654986462939 ("tracepoints: Fix section alignment using pointer array")
    e4a9ea5ee7c8 ("tracing: Replace trace_event struct array with pointer array")

    Let's use this same "array of pointers to structs" approach for
    EARLYCON_TABLE.

    Fixes: 99492c39f39f ("earlycon: Fix __earlycon_table stride")
    Signed-off-by: Daniel Kurtz
    Suggested-by: Aaron Durbin
    Reviewed-by: Rob Herring
    Tested-by: Guenter Roeck
    Reviewed-by: Guenter Roeck
    Cc: stable
    Signed-off-by: Greg Kroah-Hartman

    Daniel Kurtz
     

25 Dec, 2017

1 commit

  • commit 11af847446ed0d131cf24d16a7ef3d5ea7a49554 upstream.

    Rename the unwinder config options from:

    CONFIG_ORC_UNWINDER
    CONFIG_FRAME_POINTER_UNWINDER
    CONFIG_GUESS_UNWINDER

    to:

    CONFIG_UNWINDER_ORC
    CONFIG_UNWINDER_FRAME_POINTER
    CONFIG_UNWINDER_GUESS

    ... in order to give them a more logical config namespace.

    Suggested-by: Ingo Molnar
    Signed-off-by: Josh Poimboeuf
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/73972fc7e2762e91912c6b9584582703d6f1b8cc.1507924831.git.jpoimboe@redhat.com
    Signed-off-by: Ingo Molnar
    Signed-off-by: Greg Kroah-Hartman

    Josh Poimboeuf
     

10 Dec, 2017

1 commit

  • [ Upstream commit 564c9cc84e2adf8a6671c1937f0a9fe3da2a4b0e ]

    Using .text.unlikely for refcount exceptions isn't safe because gcc may
    move entire functions into .text.unlikely (e.g. in6_dev_dev()), which
    would cause any uses of a protected refcount_t function to stay inline
    with the function, triggering the protection unconditionally:

    .section .text.unlikely,"ax",@progbits
    .type in6_dev_get, @function
    in6_dev_getx:
    .LFB4673:
    .loc 2 4128 0
    .cfi_startproc
    ...
    lock; incl 480(%rbx)
    js 111f
    .pushsection .text.unlikely
    111: lea 480(%rbx), %rcx
    112: .byte 0x0f, 0xff
    .popsection
    113:

    This creates a unique .text..refcount section and adds an additional
    test to the exception handler to WARN in the case of having none of OF,
    SF, nor ZF set so we can see things like this more easily in the future.

    The double dot for the section name keeps it out of the TEXT_MAIN macro
    namespace, to avoid collisions and so it can be put at the end with
    text.unlikely to keep the cold code together.

    See commit:

    cb87481ee89db ("kbuild: linker script do not match C names unless LD_DEAD_CODE_DATA_ELIMINATION is configured")

    ... which matches C names: [a-zA-Z0-9_] but not ".".

    Reported-by: Mike Galbraith
    Signed-off-by: Kees Cook
    Cc: Ard Biesheuvel
    Cc: Elena
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: linux-arch
    Fixes: 7a46ec0e2f48 ("locking/refcounts, x86/asm: Implement fast refcount overflow protection")
    Link: http://lkml.kernel.org/r/1504382986-49301-2-git-send-email-keescook@chromium.org
    Signed-off-by: Ingo Molnar
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Kees Cook
     

10 Sep, 2017

1 commit

  • Pull MTD updates from Boris Brezillon:
    "General updates:
    - Constify pci_device_id in various drivers
    - Constify device_type
    - Remove pad control code from the Gemini driver
    - Use %pOF to print OF node full_name
    - Various fixes in the physmap_of driver
    - Remove unused vars in mtdswap
    - Check devm_kzalloc() return value in the spear_smi driver
    - Check clk_prepare_enable() return code in the st_spi_fsm driver
    - Create per MTD device debugfs enties

    NAND updates, from Boris Brezillon:
    - Fix memory leaks in the core
    - Remove unused NAND locking support
    - Rename nand.h into rawnand.h (preparing support for spi NANDs)
    - Use NAND_MAX_ID_LEN where appropriate
    - Fix support for 20nm Hynix chips
    - Fix support for Samsung and Hynix SLC NANDs
    - Various cleanup, improvements and fixes in the qcom driver
    - Fixes for bugs detected by various static code analysis tools
    - Fix mxc ooblayout definition
    - Add a new part_parsers to tmio and sharpsl platform data in order
    to define a custom list of partition parsers
    - Request the reset line in exclusive mode in the sunxi driver
    - Fix a build error in the orion-nand driver when compiled for ARMv4
    - Allow 64-bit mvebu platforms to select the PXA3XX driver

    SPI NOR updates, from Cyrille Pitchen and Marek Vasut:
    - add support to the JEDEC JESD216B specification (SFDP tables).
    - add support to the Intel Denverton SPI flash controller.
    - fix error recovery for Spansion/Cypress SPI NOR memories.
    - fix 4-byte address management for the Aspeed SPI controller.
    - add support to some Microchip SST26 memory parts
    - remove unneeded pinctrl header Write a message for tag:"

    * tag 'for-linus-20170904' of git://git.infradead.org/linux-mtd: (74 commits)
    mtd: nand: complain loudly when chip->bits_per_cell is not correctly initialized
    mtd: nand: make Samsung SLC NAND usable again
    mtd: nand: tmio: Register partitions using the parsers
    mfd: tmio: Add partition parsers platform data
    mtd: nand: sharpsl: Register partitions using the parsers
    mtd: nand: sharpsl: Add partition parsers platform data
    mtd: nand: qcom: Support for IPQ8074 QPIC NAND controller
    mtd: nand: qcom: support for IPQ4019 QPIC NAND controller
    dt-bindings: qcom_nandc: IPQ8074 QPIC NAND documentation
    dt-bindings: qcom_nandc: IPQ4019 QPIC NAND documentation
    dt-bindings: qcom_nandc: fix the ipq806x device tree example
    mtd: nand: qcom: support for different DEV_CMD register offsets
    mtd: nand: qcom: QPIC data descriptors handling
    mtd: nand: qcom: enable BAM or ADM mode
    mtd: nand: qcom: erased codeword detection configuration
    mtd: nand: qcom: support for read location registers
    mtd: nand: qcom: support for passing flags in DMA helper functions
    mtd: nand: qcom: add BAM DMA descriptor handling
    mtd: nand: qcom: allocate BAM transaction
    mtd: nand: qcom: DMA mapping support for register read buffer
    ...

    Linus Torvalds
     

05 Sep, 2017

1 commit

  • Pull x86 asm updates from Ingo Molnar:

    - Introduce the ORC unwinder, which can be enabled via
    CONFIG_ORC_UNWINDER=y.

    The ORC unwinder is a lightweight, Linux kernel specific debuginfo
    implementation, which aims to be DWARF done right for unwinding.
    Objtool is used to generate the ORC unwinder tables during build, so
    the data format is flexible and kernel internal: there's no
    dependency on debuginfo created by an external toolchain.

    The ORC unwinder is almost two orders of magnitude faster than the
    (out of tree) DWARF unwinder - which is important for perf call graph
    profiling. It is also significantly simpler and is coded defensively:
    there has not been a single ORC related kernel crash so far, even
    with early versions. (knock on wood!)

    But the main advantage is that enabling the ORC unwinder allows
    CONFIG_FRAME_POINTERS to be turned off - which speeds up the kernel
    measurably:

    With frame pointers disabled, GCC does not have to add frame pointer
    instrumentation code to every function in the kernel. The kernel's
    .text size decreases by about 3.2%, resulting in better cache
    utilization and fewer instructions executed, resulting in a broad
    kernel-wide speedup. Average speedup of system calls should be
    roughly in the 1-3% range - measurements by Mel Gorman [1] have shown
    a speedup of 5-10% for some function execution intense workloads.

    The main cost of the unwinder is that the unwinder data has to be
    stored in RAM: the memory cost is 2-4MB of RAM, depending on kernel
    config - which is a modest cost on modern x86 systems.

    Given how young the ORC unwinder code is it's not enabled by default
    - but given the performance advantages the plan is to eventually make
    it the default unwinder on x86.

    See Documentation/x86/orc-unwinder.txt for more details.

    - Remove lguest support: its intended role was that of a temporary
    proof of concept for virtualization, plus its removal will enable the
    reduction (removal) of the paravirt API as well, so Rusty agreed to
    its removal. (Juergen Gross)

    - Clean up and fix FSGS related functionality (Andy Lutomirski)

    - Clean up IO access APIs (Andy Shevchenko)

    - Enhance the symbol namespace (Jiri Slaby)

    * 'x86-asm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (47 commits)
    objtool: Handle GCC stack pointer adjustment bug
    x86/entry/64: Use ENTRY() instead of ALIGN+GLOBAL for stub32_clone()
    x86/fpu/math-emu: Add ENDPROC to functions
    x86/boot/64: Extract efi_pe_entry() from startup_64()
    x86/boot/32: Extract efi_pe_entry() from startup_32()
    x86/lguest: Remove lguest support
    x86/paravirt/xen: Remove xen_patch()
    objtool: Fix objtool fallthrough detection with function padding
    x86/xen/64: Fix the reported SS and CS in SYSCALL
    objtool: Track DRAP separately from callee-saved registers
    objtool: Fix validate_branch() return codes
    x86: Clarify/fix no-op barriers for text_poke_bp()
    x86/switch_to/64: Rewrite FS/GS switching yet again to fix AMD CPUs
    selftests/x86/fsgsbase: Test selectors 1, 2, and 3
    x86/fsgsbase/64: Report FSBASE and GSBASE correctly in core dumps
    x86/fsgsbase/64: Fully initialize FS and GS state in start_thread_common
    x86/asm: Fix UNWIND_HINT_REGS macro for older binutils
    x86/asm/32: Fix regs_get_register() on segment registers
    x86/xen/64: Rearrange the SYSCALL entries
    x86/asm/32: Remove a bunch of '& 0xffff' from pt_regs segment reads
    ...

    Linus Torvalds
     

29 Aug, 2017

1 commit


25 Aug, 2017

1 commit


15 Aug, 2017

1 commit

  • When XIP_KERNEL is enabled, some functions are defined in the .data
    ELF section because we require them to be in RAM whenever we communicate
    with the flash chip. However this causes problems when FTRACE is
    enabled and gcc emits calls to __gnu_mcount_nc in the function
    prolog:

    drivers/built-in.o: In function `cfi_chip_setup':
    :(.data+0x272fc): relocation truncated to fit: R_ARM_CALL against symbol `__gnu_mcount_nc' defined in .text section in arch/arm/kernel/built-in.o
    drivers/built-in.o: In function `cfi_probe_chip':
    :(.data+0x27de8): relocation truncated to fit: R_ARM_CALL against symbol `__gnu_mcount_nc' defined in .text section in arch/arm/kernel/built-in.o
    /tmp/ccY172rP.s: Assembler messages:
    /tmp/ccY172rP.s:70: Warning: ignoring changed section attributes for .data
    /tmp/ccY172rP.s: Error: 1 warning, treating warnings as errors
    make[5]: *** [drivers/mtd/chips/cfi_probe.o] Error 1
    /tmp/ccK4rjeO.s: Assembler messages:
    /tmp/ccK4rjeO.s:421: Warning: ignoring changed section attributes for .data
    /tmp/ccK4rjeO.s: Error: 1 warning, treating warnings as errors
    make[5]: *** [drivers/mtd/chips/cfi_util.o] Error 1
    /tmp/ccUvhCYR.s: Assembler messages:
    /tmp/ccUvhCYR.s:1895: Warning: ignoring changed section attributes for .data
    /tmp/ccUvhCYR.s: Error: 1 warning, treating warnings as errors

    Specifically, this does not work because the .data section is not
    marked executable, which leads LD to not generate trampolines for
    long calls.

    This moves the __xipram functions into their own .xiptext section instead.
    The section is still placed next to .data and located in RAM but is marked
    executable, which avoids the build errors.

    Also, we only need to place the XIP functions into a separate section
    if both CONFIG_XIP_KERNEL and CONFIG_MTD_XIP are set: When only MTD_XIP
    is used, the whole kernel is still in RAM and we do not need to worry
    about pulling out the rug under it. When only XIP_KERNEL but not MTD_XIP
    is set, the kernel is in some form of ROM, but we never write to it.

    Note that MTD_XIP has been broken on ARM since around 2011 or 2012. I
    have sent another patch[2] to fix compilation, which I plan to merge
    through arm-soc unless there are objections. The obvious alternative
    to that would be to completely rip out the MTD_XIP support from the
    kernel, since obviously nobody has been using it in a long while.

    Link: [1] https://patchwork.kernel.org/patch/8109771/
    Link: [2] https://patchwork.kernel.org/patch/9855225/
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Boris Brezillon

    Arnd Bergmann
     

10 Aug, 2017

1 commit

  • Generate irqentry and softirqentry text sections without
    any Kconfig dependencies. This will add extra sections, but
    there should be no performace impact.

    Suggested-by: Ingo Molnar
    Signed-off-by: Masami Hiramatsu
    Cc: Ananth N Mavinakayanahalli
    Cc: Anil S Keshavamurthy
    Cc: Chris Zankel
    Cc: David S . Miller
    Cc: Francis Deslauriers
    Cc: Jesper Nilsson
    Cc: Linus Torvalds
    Cc: Max Filippov
    Cc: Mikael Starvik
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: Yoshinori Sato
    Cc: linux-arch@vger.kernel.org
    Cc: linux-cris-kernel@axis.com
    Cc: mathieu.desnoyers@efficios.com
    Link: http://lkml.kernel.org/r/150172789110.27216.3955739126693102122.stgit@devbox
    Signed-off-by: Ingo Molnar

    Masami Hiramatsu
     

09 Aug, 2017

1 commit

  • The .data and .bss sections were modified in the generic linker script to
    pull in sections named .data., which are generated by gcc with
    -ffunction-sections and -fdata-sections options.

    The problem with this pattern is it can also match section names that Linux
    defines explicitly, e.g., .data.unlikely. This can cause Linux sections to
    get moved into the wrong place.

    The way to avoid this is to use ".." separators for explicit section names
    (the dot character is valid in a section name but not a C identifier).
    However currently there are sections which don't follow this rule, so for
    now just disable the wild card by default.

    Example: http://marc.info/?l=linux-arm-kernel&m=150106824024221&w=2

    Cc: # 4.9
    Fixes: b67067f1176df ("kbuild: allow archs to select link dead code/data elimination")
    Signed-off-by: Nicholas Piggin
    Signed-off-by: Masahiro Yamada

    Nicholas Piggin
     

26 Jul, 2017

1 commit

  • Add the new ORC unwinder which is enabled by CONFIG_ORC_UNWINDER=y.
    It plugs into the existing x86 unwinder framework.

    It relies on objtool to generate the needed .orc_unwind and
    .orc_unwind_ip sections.

    For more details on why ORC is used instead of DWARF, see
    Documentation/x86/orc-unwinder.txt - but the short version is
    that it's a simplified, fundamentally more robust debugninfo
    data structure, which also allows up to two orders of magnitude
    faster lookups than the DWARF unwinder - which matters to
    profiling workloads like perf.

    Thanks to Andy Lutomirski for the performance improvement ideas:
    splitting the ORC unwind table into two parallel arrays and creating a
    fast lookup table to search a subset of the unwind table.

    Signed-off-by: Josh Poimboeuf
    Cc: Andy Lutomirski
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: Denys Vlasenko
    Cc: H. Peter Anvin
    Cc: Jiri Slaby
    Cc: Linus Torvalds
    Cc: Mike Galbraith
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: live-patching@vger.kernel.org
    Link: http://lkml.kernel.org/r/0a6cbfb40f8da99b7a45a1a8302dc6aef16ec812.1500938583.git.jpoimboe@redhat.com
    [ Extended the changelog. ]
    Signed-off-by: Ingo Molnar

    Josh Poimboeuf
     

08 Jul, 2017

1 commit

  • Pull powerpc updates from Michael Ellerman:
    "Highlights include:

    - Support for STRICT_KERNEL_RWX on 64-bit server CPUs.

    - Platform support for FSP2 (476fpe) board

    - Enable ZONE_DEVICE on 64-bit server CPUs.

    - Generic & powerpc spin loop primitives to optimise busy waiting

    - Convert VDSO update function to use new update_vsyscall() interface

    - Optimisations to hypercall/syscall/context-switch paths

    - Improvements to the CPU idle code on Power8 and Power9.

    As well as many other fixes and improvements.

    Thanks to: Akshay Adiga, Andrew Donnellan, Andrew Jeffery, Anshuman
    Khandual, Anton Blanchard, Balbir Singh, Benjamin Herrenschmidt,
    Christophe Leroy, Christophe Lombard, Colin Ian King, Dan Carpenter,
    Gautham R. Shenoy, Hari Bathini, Ian Munsie, Ivan Mikhaylov, Javier
    Martinez Canillas, Madhavan Srinivasan, Masahiro Yamada, Matt Brown,
    Michael Neuling, Michal Suchanek, Murilo Opsfelder Araujo, Naveen N.
    Rao, Nicholas Piggin, Oliver O'Halloran, Paul Mackerras, Pavel Machek,
    Russell Currey, Santosh Sivaraj, Stephen Rothwell, Thiago Jung
    Bauermann, Yang Li"

    * tag 'powerpc-4.13-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (158 commits)
    powerpc/Kconfig: Enable STRICT_KERNEL_RWX for some configs
    powerpc/mm/radix: Implement STRICT_RWX/mark_rodata_ro() for Radix
    powerpc/mm/hash: Implement mark_rodata_ro() for hash
    powerpc/vmlinux.lds: Align __init_begin to 16M
    powerpc/lib/code-patching: Use alternate map for patch_instruction()
    powerpc/xmon: Add patch_instruction() support for xmon
    powerpc/kprobes/optprobes: Use patch_instruction()
    powerpc/kprobes: Move kprobes over to patch_instruction()
    powerpc/mm/radix: Fix execute permissions for interrupt_vectors
    powerpc/pseries: Fix passing of pp0 in updatepp() and updateboltedpp()
    powerpc/64s: Blacklist rtas entry/exit from kprobes
    powerpc/64s: Blacklist functions invoked on a trap
    powerpc/64s: Un-blacklist system_call() from kprobes
    powerpc/64s: Move system_call() symbol to just after setting MSR_EE
    powerpc/64s: Blacklist system_call() and system_call_common() from kprobes
    powerpc/64s: Convert .L__replay_interrupt_return to a local label
    powerpc64/elfv1: Only dereference function descriptor for non-text symbols
    cxl: Export library to support IBM XSL
    powerpc/dts: Use #include "..." to include local DT
    powerpc/perf/hv-24x7: Aggregate result elements on POWER9 SMT8
    ...

    Linus Torvalds
     

07 Jul, 2017

1 commit

  • Pull tracing updates from Steven Rostedt:
    "The new features of this release:

    - Added TRACE_DEFINE_SIZEOF() which allows trace events that use
    sizeof() it the TP_printk() to be converted to the actual size such
    that trace-cmd and perf can parse them correctly.

    - Some rework of the TRACE_DEFINE_ENUM() such that the above
    TRACE_DEFINE_SIZEOF() could reuse the same code.

    - Recording of tgid (Thread Group ID). This is similar to how task
    COMMs are recorded (cached at sched_switch), where it is in a table
    and used on output of the trace and trace_pipe files.

    - Have ":mod:" be cached when written into set_ftrace_filter.
    Then the functions of the module will be traced at module load.

    - Some random clean ups and small fixes"

    * tag 'trace-v4.13' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: (26 commits)
    ftrace: Test for NULL iter->tr in regex for stack_trace_filter changes
    ftrace: Decrement count for dyn_ftrace_total_info for init functions
    ftrace: Unlock hash mutex on failed allocation in process_mod_list()
    tracing: Add support for display of tgid in trace output
    tracing: Add support for recording tgid of tasks
    ftrace: Decrement count for dyn_ftrace_total_info file
    ftrace: Remove unused function ftrace_arch_read_dyn_info()
    sh/ftrace: Remove only user of ftrace_arch_read_dyn_info()
    ftrace: Have cached module filters be an active filter
    ftrace: Implement cached modules tracing on module load
    ftrace: Have the cached module list show in set_ftrace_filter
    ftrace: Add :mod: caching infrastructure to trace_array
    tracing: Show address when function names are not found
    ftrace: Add missing comment for FTRACE_OPS_FL_RCU
    tracing: Rename update the enum_map file
    tracing: Add TRACE_DEFINE_SIZEOF() macros
    tracing: define TRACE_DEFINE_SIZEOF() macro to map sizeof's to their values
    tracing: Rename enum_replace to eval_replace
    trace: rename enum_map functions
    trace: rename trace.c enum functions
    ...

    Linus Torvalds
     

14 Jun, 2017

3 commits


12 Jun, 2017

1 commit


30 May, 2017

1 commit

  • Add --orphan-handling=warn to final link flags. This ensures we can
    handle all sections explicitly. This would have caught subtle breakage
    such as 7de3b27bac47da9de08409df1d69664acbb72197 at build-time.

    Also bring existing orphan sections into the fold:
    - .text.hot and .text.unlikely are compiler generated sections.
    - .sdata2, .dynsbss, .plt are used by PPC32
    - We previously did not specify DWARF_DEBUG or STABS_DEBUG
    - DWARF_DEBUG did not include all DWARF sections that can be emitted
    - A number of sections are unused and can be discarded.

    Signed-off-by: Nicholas Piggin
    Signed-off-by: Michael Ellerman

    Nicholas Piggin
     

10 May, 2017

1 commit

  • Pull IOMMU updates from Joerg Roedel:

    - code optimizations for the Intel VT-d driver

    - ability to switch off a previously enabled Intel IOMMU

    - support for 'struct iommu_device' for OMAP, Rockchip and Mediatek
    IOMMUs

    - header optimizations for IOMMU core code headers and a few fixes that
    became necessary in other parts of the kernel because of that

    - ACPI/IORT updates and fixes

    - Exynos IOMMU optimizations

    - updates for the IOMMU dma-api code to bring it closer to use per-cpu
    iova caches

    - new command-line option to set default domain type allocated by the
    iommu core code

    - another command line option to allow the Intel IOMMU switched off in
    a tboot environment

    - ARM/SMMU: TLB sync optimisations for SMMUv2, Support for using an
    IDENTITY domain in conjunction with DMA ops, Support for SMR masking,
    Support for 16-bit ASIDs (was previously broken)

    - various other small fixes and improvements

    * tag 'iommu-updates-v4.12' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: (63 commits)
    soc/qbman: Move dma-mapping.h include to qman_priv.h
    soc/qbman: Fix implicit header dependency now causing build fails
    iommu: Remove trace-events include from iommu.h
    iommu: Remove pci.h include from trace/events/iommu.h
    arm: dma-mapping: Don't override dma_ops in arch_setup_dma_ops()
    ACPI/IORT: Fix CONFIG_IOMMU_API dependency
    iommu/vt-d: Don't print the failure message when booting non-kdump kernel
    iommu: Move report_iommu_fault() to iommu.c
    iommu: Include device.h in iommu.h
    x86, iommu/vt-d: Add an option to disable Intel IOMMU force on
    iommu/arm-smmu: Return IOVA in iova_to_phys when SMMU is bypassed
    iommu/arm-smmu: Correct sid to mask
    iommu/amd: Fix incorrect error handling in amd_iommu_bind_pasid()
    iommu: Make iommu_bus_notifier return NOTIFY_DONE rather than error code
    omap3isp: Remove iommu_group related code
    iommu/omap: Add iommu-group support
    iommu/omap: Make use of 'struct iommu_device'
    iommu/omap: Store iommu_dev pointer in arch_data
    iommu/omap: Move data structures to omap-iommu.h
    iommu/omap: Drop legacy-style device support
    ...

    Linus Torvalds
     

05 May, 2017

1 commit


02 May, 2017

1 commit

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

    - unwinder fixes and enhancements

    - improve ftrace interaction with the unwinder

    - optimize the code footprint of WARN() and related debugging
    constructs

    - ... plus misc updates, cleanups and fixes"

    * 'x86-asm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (24 commits)
    x86/unwind: Dump all stacks in unwind_dump()
    x86/unwind: Silence more entry-code related warnings
    x86/ftrace: Fix ebp in ftrace_regs_caller that screws up unwinder
    x86/unwind: Remove unused 'sp' parameter in unwind_dump()
    x86/unwind: Prepend hex mask value with '0x' in unwind_dump()
    x86/unwind: Properly zero-pad 32-bit values in unwind_dump()
    x86/unwind: Ensure stack pointer is aligned
    debug: Avoid setting BUGFLAG_WARNING twice
    x86/unwind: Silence entry-related warnings
    x86/unwind: Read stack return address in update_stack_state()
    x86/unwind: Move common code into update_stack_state()
    debug: Fix __bug_table[] in arch linker scripts
    debug: Add _ONCE() logic to report_bug()
    x86/debug: Define BUG() again for !CONFIG_BUG
    x86/debug: Implement __WARN() using UD0
    x86/ftrace: Use Makefile logic instead of #ifdef for compiling ftrace_*.o
    x86/ftrace: Add -mfentry support to x86_32 with DYNAMIC_FTRACE set
    x86/ftrace: Clean up ftrace_regs_caller
    x86/ftrace: Add stack frame pointer to ftrace_caller
    x86/ftrace: Move the ftrace specific code out of entry_32.S
    ...

    Linus Torvalds
     

20 Apr, 2017

1 commit

  • The IORT linker section introduced by commit 34ceea275f62
    ("ACPI/IORT: Introduce linker section for IORT entries probing")
    was needed to make sure SMMU drivers are registered (and therefore
    probed) in the kernel before devices using the SMMU have a chance
    to probe in turn.

    Through the introduction of deferred IOMMU configuration the linker
    section based IORT probing infrastructure is not needed any longer, in
    that device/SMMU probe dependencies are managed through the probe
    deferral mechanism, making the IORT linker section infrastructure
    unused, so that it can be removed.

    Remove the unused IORT linker section probing infrastructure
    from the kernel to complete the ACPI IORT IOMMU configure probe
    deferral mechanism implementation.

    Tested-by: Hanjun Guo
    Reviewed-by: Robin Murphy
    Signed-off-by: Lorenzo Pieralisi
    Cc: Sricharan R
    Signed-off-by: Joerg Roedel

    Lorenzo Pieralisi
     

08 Apr, 2017

1 commit

  • When __{start,end}_ro_after_init is referenced from C code, we run into
    the following build errors on blackfin:

    kernel/extable.c:169: undefined reference to `__start_ro_after_init'
    kernel/extable.c:169: undefined reference to `__end_ro_after_init'

    The build error is due to the fact that blackfin is one of the few
    arches that prepends an underscore '_' to all symbols defined in C.

    Fix this by wrapping __{start,end}_ro_after_init in vmlinux.lds.h with
    VMLINUX_SYMBOL(), which adds the necessary prefix for arches that have
    HAVE_UNDERSCORE_SYMBOL_PREFIX.

    Link: http://lkml.kernel.org/r/1491259387-15869-1-git-send-email-jeyu@redhat.com
    Signed-off-by: Jessica Yu
    Acked-by: Kees Cook
    Cc: Arnd Bergmann
    Cc: Eddie Kovsky
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jessica Yu
     

03 Apr, 2017

1 commit


01 Apr, 2017

1 commit

  • A section name for .data..ro_after_init was added by both:

    commit d07a980c1b8d ("s390: add proper __ro_after_init support")

    and

    commit d7c19b066dcf ("mm: kmemleak: scan .data.ro_after_init")

    The latter adds incorrect wrapping around the existing s390 section, and
    came later. I'd prefer the s390 naming, so this moves the s390-specific
    name up to the asm-generic/sections.h and renames the section as used by
    kmemleak (and in the future, kernel/extable.c).

    Link: http://lkml.kernel.org/r/20170327192213.GA129375@beast
    Signed-off-by: Kees Cook
    Acked-by: Heiko Carstens [s390 parts]
    Acked-by: Jakub Kicinski
    Cc: Eddie Kovsky
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kees Cook
     

30 Mar, 2017

1 commit

  • Josh suggested moving the _ONCE logic inside the trap handler, using a
    bit in the bug_entry::flags field, avoiding the need for the extra
    variable.

    Sadly this only works for WARN_ON_ONCE(), since the others have
    printk() statements prior to triggering the trap.

    Still, this saves a fair amount of text and some data:

    text data filename
    10682460 4530992 defconfig-build/vmlinux.orig
    10665111 4530096 defconfig-build/vmlinux.patched

    Suggested-by: Josh Poimboeuf
    Signed-off-by: Peter Zijlstra (Intel)
    Cc: Andy Lutomirski
    Cc: Arnd Bergmann
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: Denys Vlasenko
    Cc: H. Peter Anvin
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     

28 Mar, 2017

1 commit

  • The code introduced by commit 0c8893c9095d ("clockevents: Add a
    clkevt-of mechanism like clksrc-of") refer to __clkevt_of_table
    what doesn't exist in the vmlinux. As a result kernel build
    failed with error: "clkevt-probe.c:63: undefined reference to
    `__clkevt_of_table’"

    Fixes: 0c8893c9095d ("clockevents: Add a clkevt-of mechanism like clksrc-of")
    Signed-off-by: Alexander Kochetkov
    Signed-off-by: Daniel Lezcano

    Alexander Kochetkov
     

18 Dec, 2016

1 commit

  • Pull kbuild updates from Michal Marek:

    - prototypes for x86 asm-exported symbols (Adam Borowski) and a warning
    about missing CRCs (Nick Piggin)

    - asm-exports fix for LTO (Nicolas Pitre)

    - thin archives improvements (Nick Piggin)

    - linker script fix for CONFIG_LD_DEAD_CODE_DATA_ELIMINATION (Nick
    Piggin)

    - genksyms support for __builtin_va_list keyword

    - misc minor fixes

    * 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
    x86/kbuild: enable modversions for symbols exported from asm
    kbuild: fix scripts/adjust_autoksyms.sh* for the no modules case
    scripts/kallsyms: remove last remnants of --page-offset option
    make use of make variable CURDIR instead of calling pwd
    kbuild: cmd_export_list: tighten the sed script
    kbuild: minor improvement for thin archives build
    kbuild: modpost warn if export version crc is missing
    kbuild: keep data tables through dead code elimination
    kbuild: improve linker compatibility with lib-ksyms.o build
    genksyms: Regenerate parser
    kbuild/genksyms: handle va_list type
    kbuild: thin archives for multi-y targets
    kbuild: kallsyms allow 3-pass generation if symbols size has changed

    Linus Torvalds
     

29 Nov, 2016

2 commits

  • Since commit e647b532275b ("ACPI: Add early device probing
    infrastructure") the kernel has gained the infrastructure that allows
    adding linker script section entries to execute ACPI driver callbacks
    (ie probe routines) for all subsystems that register a table entry
    in the respective kernel section (eg clocksource, irqchip).

    Since ARM IOMMU devices data is described through IORT tables when
    booting with ACPI, the ARM IOMMU drivers must be made able to hook ACPI
    callback routines that are called to probe IORT entries and initialize
    the respective IOMMU devices.

    To avoid adding driver specific hooks into IORT table initialization
    code (breaking therefore code modularity - ie ACPI IORT code must be made
    aware of ARM SMMU drivers ACPI init callbacks), this patch adds code
    that allows ARM SMMU drivers to take advantage of the ACPI early probing
    infrastructure, so that they can add linker script section entries
    containing drivers callback to be executed on IORT tables detection.

    Since IORT nodes are differentiated by a type, the callback routines
    can easily parse the IORT table entries, check the IORT nodes and
    carry out some actions whenever the IORT node type associated with
    the driver specific callback is matched.

    Signed-off-by: Lorenzo Pieralisi
    Reviewed-by: Hanjun Guo
    Reviewed-by: Tomasz Nowicki
    Tested-by: Hanjun Guo
    Tested-by: Tomasz Nowicki
    Cc: Tomasz Nowicki
    Cc: "Rafael J. Wysocki"
    Cc: Marc Zyngier
    Signed-off-by: Will Deacon

    Lorenzo Pieralisi
     
  • When CONFIG_LD_DEAD_CODE_DATA_ELIMINATION is enabled we must ensure
    that we still keep various programatically-accessed tables.

    [npiggin: Fold Paul's patches into one, and add a few more tables.
    diff symbol tables of allyesconfig with/without -gc-sections shows up
    lost tables quite easily.]

    Signed-off-by: Paul Burton
    Signed-off-by: Nicholas Piggin
    Signed-off-by: Michal Marek

    Nicholas Piggin
     

12 Nov, 2016

1 commit

  • Limit the number of kmemleak false positives by including
    .data.ro_after_init in memory scanning. To achieve this we need to add
    symbols for start and end of the section to the linker scripts.

    The problem was been uncovered by commit 56989f6d8568 ("genetlink: mark
    families as __ro_after_init").

    Link: http://lkml.kernel.org/r/1478274173-15218-1-git-send-email-jakub.kicinski@netronome.com
    Reviewed-by: Catalin Marinas
    Signed-off-by: Jakub Kicinski
    Cc: Arnd Bergmann
    Cc: Cong Wang
    Cc: Johannes Berg
    Cc: Martin Schwidefsky
    Cc: Heiko Carstens
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jakub Kicinski
     

15 Oct, 2016

1 commit

  • Pull kbuild updates from Michal Marek:

    - EXPORT_SYMBOL for asm source by Al Viro.

    This does bring a regression, because genksyms no longer generates
    checksums for these symbols (CONFIG_MODVERSIONS). Nick Piggin is
    working on a patch to fix this.

    Plus, we are talking about functions like strcpy(), which rarely
    change prototypes.

    - Fixes for PPC fallout of the above by Stephen Rothwell and Nick
    Piggin

    - fixdep speedup by Alexey Dobriyan.

    - preparatory work by Nick Piggin to allow architectures to build with
    -ffunction-sections, -fdata-sections and --gc-sections

    - CONFIG_THIN_ARCHIVES support by Stephen Rothwell

    - fix for filenames with colons in the initramfs source by me.

    * 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild: (22 commits)
    initramfs: Escape colons in depfile
    ppc: there is no clear_pages to export
    powerpc/64: whitelist unresolved modversions CRCs
    kbuild: -ffunction-sections fix for archs with conflicting sections
    kbuild: add arch specific post-link Makefile
    kbuild: allow archs to select link dead code/data elimination
    kbuild: allow architectures to use thin archives instead of ld -r
    kbuild: Regenerate genksyms lexer
    kbuild: genksyms fix for typeof handling
    fixdep: faster CONFIG_ search
    ia64: move exports to definitions
    sparc32: debride memcpy.S a bit
    [sparc] unify 32bit and 64bit string.h
    sparc: move exports to definitions
    ppc: move exports to definitions
    arm: move exports to definitions
    s390: move exports to definitions
    m68k: move exports to definitions
    alpha: move exports to actual definitions
    x86: move exports to actual definitions
    ...

    Linus Torvalds
     

08 Oct, 2016

1 commit

  • When doing an nmi backtrace of many cores, most of which are idle, the
    output is a little overwhelming and very uninformative. Suppress
    messages for cpus that are idling when they are interrupted and just
    emit one line, "NMI backtrace for N skipped: idling at pc 0xNNN".

    We do this by grouping all the cpuidle code together into a new
    .cpuidle.text section, and then checking the address of the interrupted
    PC to see if it lies within that section.

    This commit suitably tags x86 and tile idle routines, and only adds in
    the minimal framework for other architectures.

    Link: http://lkml.kernel.org/r/1472487169-14923-5-git-send-email-cmetcalf@mellanox.com
    Signed-off-by: Chris Metcalf
    Acked-by: Peter Zijlstra (Intel)
    Tested-by: Peter Zijlstra (Intel)
    Tested-by: Daniel Thompson [arm]
    Tested-by: Petr Mladek
    Cc: Aaron Tomlin
    Cc: Peter Zijlstra (Intel)
    Cc: "Rafael J. Wysocki"
    Cc: Russell King
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Chris Metcalf
     

22 Sep, 2016

1 commit

  • Enabling -ffunction-sections modified the generic linker script to
    pull .text.* sections into regular TEXT_TEXT section, conflicting
    with some architectures. Revert that change and require archs that
    enable the option to ensure they have no conflicting section names,
    and do the appropriate merging.

    Reported-by: Guenter Roeck
    Tested-by: Guenter Roeck
    Fixes: b67067f1176d ("kbuild: allow archs to select link dead code/data elimination")
    Signed-off-by: Nicholas Piggin
    Signed-off-by: Michal Marek

    Nicholas Piggin
     

09 Sep, 2016

1 commit

  • Introduce LD_DEAD_CODE_DATA_ELIMINATION option for architectures to
    select to build with -ffunction-sections, -fdata-sections, and link
    with --gc-sections. It requires some work (documented) to ensure all
    unreferenced entrypoints are live, and requires toolchain and build
    verification, so it is made a per-arch option for now.

    On a random powerpc64le build, this yelds a significant size saving,
    it boots and runs fine, but there is a lot I haven't tested as yet, so
    these savings may be reduced if there are bugs in the link.

    text data bss dec filename
    11169741 1180744 1923176 14273661 vmlinux
    10445269 1004127 1919707 13369103 vmlinux.dce

    ~700K text, ~170K data, 6% removed from kernel image size.

    Signed-off-by: Nicholas Piggin
    Signed-off-by: Michal Marek

    Nicholas Piggin
     

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

1 commit

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

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

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

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

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

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

    Then there are two removals:

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

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

    And the usual bug fixes and cleanups"

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

    Linus Torvalds
     

15 Jul, 2016

1 commit

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

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

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

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

    . = ALIGN(PAGE_SIZE);
    __vvar_page = .;

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

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

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

    Dmitry Vyukov
     

21 Jun, 2016

1 commit


13 Jun, 2016

1 commit

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

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

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

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

    Heiko Carstens