1. 15 Jul, 2018 8 commits
    • Ard Biesheuvel's avatar
      efi/libstub/arm: Add opt-in Kconfig option for the DTB loader · 3d7ee348
      Ard Biesheuvel authored
      There are various ways a platform can provide a device tree binary
      to the kernel, with different levels of sophistication:
      
      - ideally, the UEFI firmware, which is tightly coupled with the
        platform, provides a device tree image directly as a UEFI
        configuration table, and typically permits the contents to be
        manipulated either via menu options or via UEFI environment
        variables that specify a replacement image,
      
      - GRUB for ARM has a 'devicetree' directive which allows a device
        tree image to be loaded from any location accessible to GRUB, and
        supersede the one provided by the firmware,
      
      - the EFI stub implements a dtb= command line option that allows a
        device tree image to be loaded from a file residing in the same
        file system as the one the kernel image was loaded from.
      
      The dtb= command line option was never intended to be more than a
      development feature, to allow the other options to be implemented
      in parallel. So let's make it an opt-in feature that is disabled
      by default, but can be re-enabled at will.
      
      Note that we already disable the dtb= command line option when we
      detect that we are running with UEFI Secure Boot enabled.
      Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      Reviewed-by: default avatarAlexander Graf <agraf@suse.de>
      Acked-by: default avatarLeif Lindholm <leif.lindholm@linaro.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-efi@vger.kernel.org
      Link: http://lkml.kernel.org/r/20180711094040.12506-7-ard.biesheuvel@linaro.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      3d7ee348
    • Sai Praneeth's avatar
      efi: Remove the declaration of efi_late_init() as the function is unused · f5dcc214
      Sai Praneeth authored
      The following commit:
      
        7b0a9114 ("efi/x86: Move the EFI BGRT init code to early init code")
      
      ... removed the implementation and all the references to
      efi_late_init() but the function is still declared at
      include/linux/efi.h.
      
      Hence, remove the unnecessary declaration.
      Signed-off-by: default avatarSai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
      Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-efi@vger.kernel.org
      Link: http://lkml.kernel.org/r/20180711094040.12506-6-ard.biesheuvel@linaro.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      f5dcc214
    • Arnd Bergmann's avatar
      efi/cper: Avoid using get_seconds() · 7bb49709
      Arnd Bergmann authored
      get_seconds() is deprecated because of the 32-bit time overflow
      in y2038/y2106 on 32-bit architectures. The way it is used in
      cper_next_record_id() causes an overflow in 2106 when unsigned UTC
      seconds overflow, even on 64-bit architectures.
      
      This starts using ktime_get_real_seconds() to give us more than 32 bits
      of timestamp on all architectures, and then changes the algorithm to use
      39 bits for the timestamp after the y2038 wrap date, plus an always-1
      bit at the top. This gives us another 127 epochs of 136 years, with
      strictly monotonically increasing sequence numbers across boots.
      
      This is almost certainly overkill, but seems better than just extending
      the deadline from 2038 to 2106.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-efi@vger.kernel.org
      Link: http://lkml.kernel.org/r/20180711094040.12506-5-ard.biesheuvel@linaro.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      7bb49709
    • Sai Praneeth's avatar
      efi: Use a work queue to invoke EFI Runtime Services · 3eb420e7
      Sai Praneeth authored
      Presently, when a user process requests the kernel to execute any
      UEFI runtime service, the kernel temporarily switches to a separate
      set of page tables that describe the virtual mapping of the UEFI
      runtime services regions in memory. Since UEFI runtime services are
      typically invoked with interrupts enabled, any code that may be called
      during this time, will have an incorrect view of the process's address
      space. Although it is unusual for code running in interrupt context to
      make assumptions about the process context it runs in, there are cases
      (such as the perf subsystem taking samples) where this causes problems.
      
      So let's set up a work queue for calling UEFI runtime services, so that
      the actual calls are made when the work queue items are dispatched by a
      work queue worker running in a separate kernel thread. Such threads are
      not expected to have userland mappings in the first place, and so the
      additional mappings created for the UEFI runtime services can never
      clash with any.
      
      The ResetSystem() runtime service is not covered by the work queue
      handling, since it is not expected to return, and may be called at a
      time when the kernel is torn down to the point where we cannot expect
      work queues to still be operational.
      
      The non-blocking variants of SetVariable() and QueryVariableInfo()
      are also excluded: these are intended to be used from atomic context,
      which obviously rules out waiting for a completion to be signalled by
      another thread. Note that these variants are currently only used for
      UEFI runtime services calls that occur very early in the boot, and
      for ones that occur in critical conditions, e.g., to flush kernel logs
      to UEFI variables via efi-pstore.
      Suggested-by: default avatarAndy Lutomirski <luto@kernel.org>
      Signed-off-by: default avatarSai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
      [ardb: exclude ResetSystem() from the workqueue treatment
             merge from 2 separate patches and rewrite commit log]
      Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-efi@vger.kernel.org
      Link: http://lkml.kernel.org/r/20180711094040.12506-4-ard.biesheuvel@linaro.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      3eb420e7
    • Sai Praneeth's avatar
      efi/x86: Use non-blocking SetVariable() for efi_delete_dummy_variable() · 5a58bc1b
      Sai Praneeth authored
      Presently, efi_delete_dummy_variable() uses set_variable() which might
      block, which the scheduler is rightfully upset about when used from
      the idle thread, producing this splat:
      
        "bad: scheduling from the idle thread!"
      
      So, make efi_delete_dummy_variable() use set_variable_nonblocking(),
      which, as the name suggests, doesn't block.
      Signed-off-by: default avatarSai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
      Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-efi@vger.kernel.org
      Link: http://lkml.kernel.org/r/20180711094040.12506-3-ard.biesheuvel@linaro.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      5a58bc1b
    • Ingo Molnar's avatar
      efi/x86: Clean up the eboot code · 90a2186b
      Ingo Molnar authored
      Various small cleanups:
      
       - Standardize printk messages:
      
           'alloc' => 'allocate'
           'mem'   => 'memory'
      
         also put variable names in printk messages between quotes.
      
       - Align mass-assignments vertically for better readability
      
       - Break multi-line function prototypes at the name where possible,
         not in the middle of the parameter list
      
       - Use a newline before return statements consistently.
      
       - Use curly braces in a balanced fashion.
      
       - Remove stray newlines.
      
      No change in functionality.
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Matt Fleming <matt@codeblueprint.co.uk>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-efi@vger.kernel.org
      Link: http://lkml.kernel.org/r/20180711094040.12506-2-ard.biesheuvel@linaro.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      90a2186b
    • Linus Torvalds's avatar
      Linux 4.18-rc5 · 9d3cce1e
      Linus Torvalds authored
      9d3cce1e
    • Linus Torvalds's avatar
      Merge tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · 41b55d23
      Linus Torvalds authored
      Pull ARM SoC fixes from Olof Johansson:
      
       - A fix for OMAP5 and DRA7 to make the branch predictor hardening
         settings take proper effect on secondary cores
      
       - Disable USB OTG on am3517 since current driver isn't working
      
       - Fix thermal sensor register settings on Armada 38x
      
       - Fix suspend/resume IRQs on pxa3xx
      
      * tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
        ARM: dts: am3517.dtsi:  Disable reference to OMAP3 OTG controller
        ARM: DRA7/OMAP5: Enable ACTLR[0] (Enable invalidates of BTB) for secondary cores
        ARM: pxa: irq: fix handling of ICMR registers in suspend/resume
        ARM: dts: armada-38x: use the new thermal binding
      41b55d23
  2. 14 Jul, 2018 19 commits
  3. 13 Jul, 2018 13 commits
    • Linus Torvalds's avatar
      Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux · 2db39a2f
      Linus Torvalds authored
      Pull i2c fixes from Wolfram Sang:
      
       - I2C core bugfix regarding bus recovery
      
       - driver bugfix for the tegra driver
      
       - typo correction
      
      * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
        i2c: recovery: if possible send STOP with recovery pulses
        i2c: tegra: Fix NACK error handling
        i2c: stu300: use non-archaic spelling of failes
      2db39a2f
    • Linus Torvalds's avatar
      Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 3951dbf2
      Linus Torvalds authored
      Pull timer fixes from Ingo Molnar:
       "A clocksource driver fix and a revert"
      
      * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        clocksource: arm_arch_timer: Set arch_mem_timer cpumask to cpu_possible_mask
        Revert "tick: Prefer a lower rating device only if it's CPU local device"
      3951dbf2
    • Linus Torvalds's avatar
      Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · aa0a3247
      Linus Torvalds authored
      Pull perf tool fixes from Ingo Molnar:
       "Misc tooling fixes: python3 related fixes, gcc8 fix, bashism fixes and
        some other smaller fixes"
      
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf tools: Use python-config --includes rather than --cflags
        perf script python: Fix dict reference counting
        perf stat: Fix --interval_clear option
        perf tools: Fix compilation errors on gcc8
        perf test shell: Prevent temporary editor files from being considered test scripts
        perf llvm-utils: Remove bashism from kernel include fetch script
        perf test shell: Make perf's inet_pton test more portable
        perf test shell: Replace '|&' with '2>&1 |' to work with more shells
        perf scripts python: Add Python 3 support to EventClass.py
        perf scripts python: Add Python 3 support to sched-migration.py
        perf scripts python: Add Python 3 support to Util.py
        perf scripts python: Add Python 3 support to SchedGui.py
        perf scripts python: Add Python 3 support to Core.py
        perf tools: Generate a Python script compatible with Python 2 and 3
      aa0a3247
    • Linus Torvalds's avatar
      Merge branch 'efi-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 75adbd13
      Linus Torvalds authored
      Pull EFI fix from Ingo Molnar:
       "Fix a UEFI mixed mode (64-bit kernel on 32-bit UEFI) reboot loop
        regression"
      
      * 'efi-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        efi/x86: Fix mixed mode reboot loop by removing pointless call to PciIo->Attributes()
      75adbd13
    • Linus Torvalds's avatar
      Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · ae4ea397
      Linus Torvalds authored
      Pull rseq fixes from Ingo Molnar:
       "Various rseq ABI fixes and cleanups: use get_user()/put_user(),
        validate parameters and use proper uapi types, etc"
      
      * 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        rseq/selftests: cleanup: Update comment above rseq_prepare_unload
        rseq: Remove unused types_32_64.h uapi header
        rseq: uapi: Declare rseq_cs field as union, update includes
        rseq: uapi: Update uapi comments
        rseq: Use get_user/put_user rather than __get_user/__put_user
        rseq: Use __u64 for rseq_cs fields, validate user inputs
      ae4ea397
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma · 4659fc84
      Linus Torvalds authored
      Pull rdma fixes from Jason Gunthorpe:
       "Things have been quite slow, only 6 RC patches have been sent to the
        list. Regression, user visible bugs, and crashing fixes:
      
         - cxgb4 could wrongly fail MR creation due to a typo
      
         - various crashes if the wrong QP type is mixed in with APIs that
           expect other types
      
         - syzkaller oops
      
         - using ERR_PTR and NULL together cases HFI1 to crash in some cases
      
         - mlx5 memory leak in error unwind"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma:
        RDMA/mlx5: Fix memory leak in mlx5_ib_create_srq() error path
        RDMA/uverbs: Don't fail in creation of multiple flows
        IB/hfi1: Fix incorrect mixing of ERR_PTR and NULL return values
        RDMA/uverbs: Fix slab-out-of-bounds in ib_uverbs_ex_create_flow
        RDMA/uverbs: Protect from attempts to create flows on unsupported QP
        iw_cxgb4: correctly enforce the max reg_mr depth
      4659fc84
    • Linus Torvalds's avatar
      Merge tag 'vfio-v4.18-rc5' of git://github.com/awilliam/linux-vfio · 2a7e1211
      Linus Torvalds authored
      Pull VFIO fix from Alex Williamson:
       "Fix deadlock in mbochs sample driver (Alexey Khoroshilov)"
      
      * tag 'vfio-v4.18-rc5' of git://github.com/awilliam/linux-vfio:
        sample: vfio-mdev: avoid deadlock in mdev_access()
      2a7e1211
    • Linus Torvalds's avatar
      Merge tag 'kbuild-fixes-v4.18-2' of... · 79facf30
      Linus Torvalds authored
      Merge tag 'kbuild-fixes-v4.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
      
      Pull Kbuild fixes from Masahiro Yamada:
      
       - update Kbuild and Kconfig documents
      
       - sanitize -I compiler option handling
      
       - update extract-vmlinux script to recognize LZ4 and ZSTD
      
       - fix tools Makefiles
      
       - update tags.sh to handle __ro_after_init
      
       - suppress warnings in case getconf does not recognize LFS_* parameters
      
      * tag 'kbuild-fixes-v4.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
        kbuild: suppress warnings from 'getconf LFS_*'
        scripts/tags.sh: add __ro_after_init
        tools: build: Use HOSTLDFLAGS with fixdep
        tools: build: Fixup host c flags
        tools build: fix # escaping in .cmd files for future Make
        scripts: teach extract-vmlinux about LZ4 and ZSTD
        kbuild: remove duplicated comments about PHONY
        kbuild: .PHONY is not a variable, but PHONY is
        kbuild: do not drop -I without parameter
        kbuild: document the KBUILD_KCONFIG env. variable
        kconfig: update user kconfig tools doc.
        kbuild: delete INSTALL_FW_PATH from kbuild documentation
        kbuild: update ARCH alias info for sparc
        kbuild: update ARCH alias info for sh
      79facf30
    • Linus Torvalds's avatar
      Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · 9d2e3489
      Linus Torvalds authored
      Pull arm64 fixes from Will Deacon:
       "Catalin's out enjoying the sunshine, so I'm sending the fixes for a
        couple of weeks (although there hopefully won't be any more!).
      
        We've got a revert of a previous fix because it broke the build with
        some distro toolchains and a preemption fix when detemining whether or
        not the SIMD unit is in use.
      
        Summary:
      
         - Revert back to the 'linux' target for LD, as 'elf' breaks some
           distributions
      
         - Fix preemption race when testing whether the vector unit is in use
           or not"
      
      * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
        arm64: neon: Fix function may_use_simd() return error status
        Revert "arm64: Use aarch64elf and aarch64elfb emulation mode variants"
      9d2e3489
    • Linus Torvalds's avatar
      Merge branch 'fixes' of git://git.armlinux.org.uk/~rmk/linux-arm · e6ef7607
      Linus Torvalds authored
      Pull ARM fixes from Russell King:
       "A couple of small fixes this time around from Steven for an
        interaction between ftrace and kernel read-only protection, and
        Vladimir for nommu"
      
      * 'fixes' of git://git.armlinux.org.uk/~rmk/linux-arm:
        ARM: 8780/1: ftrace: Only set kernel memory back to read-only after boot
        ARM: 8775/1: NOMMU: Use instr_sync instead of plain isb in common code
      e6ef7607
    • Linus Torvalds's avatar
      Merge tag 'trace-v4.18-rc3-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace · 35a84f34
      Linus Torvalds authored
      Pull tracing fixlet from Steven Rostedt:
       "Joel Fernandes asked to add a feature in tracing that Android had its
        own patch internally for. I took it back in 4.13. Now he realizes that
        he had a mistake, and swapped the values from what Android had. This
        means that the old Android tools will break when using a new kernel
        that has the new feature on it.
      
        The options are:
      
         1. To swap it back to what Android wants.
         2. Add a command line option or something to do the swap
         3. Just let Android carry a patch that swaps it back
      
        Since it requires setting a tracing option to enable this anyway, I
        doubt there are other users of this than Android. Thus, I've decided
        to take option 1. If someone else is actually depending on the order
        that is in the kernel, then we will have to revert this change and go
        to option 2 or 3"
      
      * tag 'trace-v4.18-rc3-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
        tracing: Reorder display of TGID to be after PID
      35a84f34
    • Linus Torvalds's avatar
      Merge tag 'sound-4.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · a0092e5e
      Linus Torvalds authored
      Pull sound fixes from Takashi Iwai:
       "Just a few HD-auio fixes: one fix for a possible mutex deadlock at
        HDMI hotplug handling is somewhat subtle and delicate, while the rest
        are usual device-specific quirks"
      
      * tag 'sound-4.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
        ALSA: hda/ca0132: Update a pci quirk device name
        ALSA: hda/ca0132: Add Recon3Di quirk for Gigabyte G1.Sniper Z97
        ALSA: hda/realtek - two more lenovo models need fixup of MIC_LOCATION
        ALSA: hda - Handle pm failure during hotplug
      a0092e5e
    • Linus Torvalds's avatar
      Merge tag 'libnvdimm-fixes-4.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm · 4596f554
      Linus Torvalds authored
      Pull libnvdimm fixes from Dave Jiang:
      
       - ensure that a variable passed in by reference to acpi_nfit_ctl is
         always set to a value. An incremental patch is provided due to notice
         from testing in -next. The rest of the commits did not exhibit
         issues.
      
       - fix a return path in nsio_rw_bytes() that was not returning "bytes
         remain" as expected for the function.
      
       - address an issue where applications polling on scrub-completion for
         the NVDIMM may falsely wakeup and read the wrong state value and
         cause hang.
      
       - change the test unit persistent capability attribute to fix up a
         broken assumption in the unit test infrastructure wrt the
         'write_cache' attribute
      
       - ratelimit dev_info() in the dax device check_vma() function since
         this is easily triggered from userspace
      
      * tag 'libnvdimm-fixes-4.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
        nfit: fix unchecked dereference in acpi_nfit_ctl
        acpi, nfit: Fix scrub idle detection
        tools/testing/nvdimm: advertise a write cache for nfit_test
        acpi/nfit: fix cmd_rc for acpi_nfit_ctl to always return a value
        dev-dax: check_vma: ratelimit dev_info-s
        libnvdimm, pmem: Fix memcpy_mcsafe() return code handling in nsio_rw_bytes()
      4596f554