1. 13 Jul, 2018 10 commits
    • 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
  2. 12 Jul, 2018 9 commits
  3. 11 Jul, 2018 15 commits
    • Steven Rostedt (VMware)'s avatar
      ARM: 8780/1: ftrace: Only set kernel memory back to read-only after boot · b4c7e2bd
      Steven Rostedt (VMware) authored
      Dynamic ftrace requires modifying the code segments that are usually
      set to read-only. To do this, a per arch function is called both before
      and after the ftrace modifications are performed. The "before" function
      will set kernel code text to read-write to allow for ftrace to make the
      modifications, and the "after" function will set the kernel code text
      back to "read-only" to keep the kernel code text protected.
      
      The issue happens when dynamic ftrace is tested at boot up. The test is
      done before the kernel code text has been set to read-only. But the
      "before" and "after" calls are still performed. The "after" call will
      change the kernel code text to read-only prematurely, and other boot
      code that expects this code to be read-write will fail.
      
      The solution is to add a variable that is set when the kernel code text
      is expected to be converted to read-only, and make the ftrace "before"
      and "after" calls do nothing if that variable is not yet set. This is
      similar to the x86 solution from commit 16239630 ("ftrace, x86:
      make kernel text writable only for conversions").
      
      Link: http://lkml.kernel.org/r/20180620212906.24b7b66e@vmware.local.homeReported-by: default avatarStefan Agner <stefan@agner.ch>
      Tested-by: default avatarStefan Agner <stefan@agner.ch>
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
      b4c7e2bd
    • Kamal Heib's avatar
      RDMA/mlx5: Fix memory leak in mlx5_ib_create_srq() error path · d63c4673
      Kamal Heib authored
      Fix memory leak in the error path of mlx5_ib_create_srq() by making sure
      to free the allocated srq.
      
      Fixes: c2b37f76 ("IB/mlx5: Fix integer overflows in mlx5_ib_create_srq")
      Signed-off-by: default avatarKamal Heib <kamalheib1@gmail.com>
      Acked-by: default avatarLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
      d63c4673
    • Linus Torvalds's avatar
      Merge tag 'trace-v4.18-rc3-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace · c25c74b7
      Linus Torvalds authored
      Pull kprobe fix from Steven Rostedt:
       "This fixes a memory leak in the kprobe code"
      
      * tag 'trace-v4.18-rc3-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
        tracing/kprobe: Release kprobe print_fmt properly
      c25c74b7
    • Jiri Olsa's avatar
      tracing/kprobe: Release kprobe print_fmt properly · 0fc8c358
      Jiri Olsa authored
      We don't release tk->tp.call.print_fmt when destroying
      local uprobe. Also there's missing print_fmt kfree in
      create_local_trace_kprobe error path.
      
      Link: http://lkml.kernel.org/r/20180709141906.2390-1-jolsa@kernel.org
      
      Cc: stable@vger.kernel.org
      Fixes: e12f03d7 ("perf/core: Implement the 'perf_kprobe' PMU")
      Acked-by: default avatarSong Liu <songliubraving@fb.com>
      Acked-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      0fc8c358
    • Linus Torvalds's avatar
      Merge branch 'for-4.18-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata · 86125df7
      Linus Torvalds authored
      Pull libata fixes from Tejun Heo:
      
       - Jens's patches to expand the usable command depth from 31 to 32 broke
         sata_fsl due to a subtle command iteration bug. Fixed by introducing
         explicit iteration helpers and using the correct variant.
      
       - On some laptops, enabling LPM by default reportedly led to occasional
         hard hangs. Blacklist the affected cases.
      
       - Other misc fixes / changes.
      
      * 'for-4.18-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata:
        ata: Remove depends on HAS_DMA in case of platform dependency
        ata: Fix ZBC_OUT all bit handling
        ata: Fix ZBC_OUT command block check
        ahci: Add Intel Ice Lake LP PCI ID
        ahci: Disable LPM on Lenovo 50 series laptops with a too old BIOS
        sata_nv: remove redundant pointers sdev0 and sdev1
        sata_fsl: remove dead code in tag retrieval
        sata_fsl: convert to command iterator
        libata: convert eh to command iterators
        libata: add command iterator helpers
        ata: ahci_mvebu: ahci_mvebu_stop_engine() can be static
        libahci: Fix possible Spectre-v1 pmp indexing in ahci_led_store()
      86125df7
    • Alexey Khoroshilov's avatar
      sample: vfio-mdev: avoid deadlock in mdev_access() · 498e8bf5
      Alexey Khoroshilov authored
      mdev_access() calls mbochs_get_page() with mdev_state->ops_lock held,
      while mbochs_get_page() locks the mutex by itself.
      It leads to unavoidable deadlock.
      
      Found by Linux Driver Verification project (linuxtesting.org).
      Signed-off-by: default avatarAlexey Khoroshilov <khoroshilov@ispras.ru>
      Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
      498e8bf5
    • Dave Jiang's avatar
      nfit: fix unchecked dereference in acpi_nfit_ctl · ee6581ce
      Dave Jiang authored
      Incremental patch to fix the unchecked dereference in acpi_nfit_ctl.
      Reported by Dan Carpenter:
      
      "acpi/nfit: fix cmd_rc for acpi_nfit_ctl to
      always return a value" from Jun 28, 2018, leads to the following
      Smatch complaint:
      
          drivers/acpi/nfit/core.c:578 acpi_nfit_ctl()
           warn: variable dereferenced before check 'cmd_rc' (see line 411)
      
      drivers/acpi/nfit/core.c
         410
         411		*cmd_rc = -EINVAL;
                      ^^^^^^^^^^^^^^^^^^
      Patch adds unchecked dereference.
      
      Fixes: c1985cef ("acpi/nfit: fix cmd_rc for acpi_nfit_ctl to always return a value")
      Signed-off-by: default avatarDave Jiang <dave.jiang@intel.com>
      ee6581ce
    • Linus Torvalds's avatar
      Merge tag 'char-misc-4.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · a74aa967
      Linus Torvalds authored
      Pull char/misc fixes from Greg KH:
       "Here are a few char/misc driver fixes for 4.18-rc5.
      
        The "largest" stuff here is fixes for the UIO changes in 4.18-rc1 that
        caused breakages for some people. Thanks to Xiubo Li for fixing them
        quickly. Other than that, minor fixes for thunderbolt, vmw_balloon,
        nvmem, mei, ibmasm, and mei drivers. There's also a MAINTAINERS update
        where Rafael is offering to help out with reviewing driver core
        patches.
      
        All of these have been in linux-next with no reported issues"
      
      * tag 'char-misc-4.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
        nvmem: Don't let a NULL cell_id for nvmem_cell_get() crash us
        thunderbolt: Notify userspace when boot_acl is changed
        uio: fix crash after the device is unregistered
        uio: change to use the mutex lock instead of the spin lock
        uio: use request_threaded_irq instead
        fpga: altera-cvp: Fix an error handling path in 'altera_cvp_probe()'
        ibmasm: don't write out of bounds in read handler
        MAINTAINERS: Add myself as driver core changes reviewer
        mei: discard messages from not connected client during power down.
        vmw_balloon: fix inflation with batching
      a74aa967
    • Linus Torvalds's avatar
      Merge tag 'staging-4.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging · 1dc85ac2
      Linus Torvalds authored
      Pull staging fixes from Greg KH:
       "Here are two tiny staging driver fixes for reported issues for
        4.18-rc5.
      
        One fixes the r8822be driver to properly work on lots of new laptops,
        the other is for the rtl8723bs driver to fix an underflow error.
      
        Both have been in linux-next for a while with no reported issues"
      
      * tag 'staging-4.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
        staging: r8822be: Fix RTL8822be can't find any wireless AP
        staging: rtl8723bs: Prevent an underflow in rtw_check_beacon_data().
      1dc85ac2
    • Linus Torvalds's avatar
      Merge tag 'usb-4.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · 24d5b287
      Linus Torvalds authored
      Pull USB fixes from Greg KH:
       "Here are a number of small USB fixes for 4.18-rc5.
      
        Nothing major here, just the normal set of new device ids, xhci fixes,
        and some typec fixes. The typec fix required some tiny changes in an
        i2c driver, which that maintainer acked to come through my tree.
      
        All of these have been in linux-next for a while with no reported
        issues"
      
      * tag 'usb-4.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
        USB: yurex: fix out-of-bounds uaccess in read handler
        usb: quirks: add delay quirks for Corsair Strafe
        xhci: xhci-mem: off by one in xhci_stream_id_to_ring()
        usb/gadget: aspeed-vhub: add USB_LIBCOMPOSITE dependency
        docs: kernel-parameters.txt: document xhci-hcd.quirks parameter
        USB: serial: mos7840: fix status-register error handling
        USB: serial: keyspan_pda: fix modem-status error handling
        USB: serial: cp210x: add another USB ID for Qivicon ZigBee stick
        USB: serial: ch341: fix type promotion bug in ch341_control_in()
        i2c-cht-wc: Fix bq24190 supplier
        typec: tcpm: Correctly report power_supply current and voltage for non pd supply
        usb: xhci: dbc: Don't decrement runtime PM counter if DBC is not started
      24d5b287
    • Linus Torvalds's avatar
      Merge tag 'mmc-v4.18-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc · f1454959
      Linus Torvalds authored
      Pull MMC fixes from Ulf Hansson:
       "MMC core:
         - Fixup devname in /proc/interrupts for card detect GPIO
      
        MMC host:
         - sdhci-esdhc-imx: Allow 1.8V speed-modes without 100/200MHz pinctrls
         - sunxi: Disable IRQ in low power state to prevent IRQ storm
         - dw_mmc: Fix card threshold control configuration
         - renesas_sdhi_internal_dmac: Fixup DMA error paths"
      
      * tag 'mmc-v4.18-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc:
        mmc: sdhci-esdhc-imx: allow 1.8V modes without 100/200MHz pinctrl states
        mmc: sunxi: Disable irq during pm_suspend
        mmc: dw_mmc: fix card threshold control configuration
        mmc: core: cd_label must be last entry of mmc_gpio struct
        mmc: renesas_sdhi_internal_dmac: Cannot clear the RX_IN_USE in abort
        mmc: renesas_sdhi_internal_dmac: Fix missing unmap in error patch
      f1454959
    • Linus Torvalds's avatar
      Merge tag 'acpi-4.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 5d580932
      Linus Torvalds authored
      Pull ACPI fix from Rafael Wysocki:
       "Address a regression in ACPICA that ceased to clear the status of GPEs
        and fixed events before entering the ACPI S5 (off) system state during
        the 4.17 cycle which caused some systems to power up immediately after
        they had been turned off"
      
      * tag 'acpi-4.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        ACPICA: Clear status of all events when entering S5
      5d580932
    • Yandong Zhao's avatar
      arm64: neon: Fix function may_use_simd() return error status · 2fd8eb4a
      Yandong Zhao authored
      It does not matter if the caller of may_use_simd() migrates to
      another cpu after the call, but it is still important that the
      kernel_neon_busy percpu instance that is read matches the cpu the
      task is running on at the time of the read.
      
      This means that raw_cpu_read() is not sufficient.  kernel_neon_busy
      may appear true if the caller migrates during the execution of
      raw_cpu_read() and the next task to be scheduled in on the initial
      cpu calls kernel_neon_begin().
      
      This patch replaces raw_cpu_read() with this_cpu_read() to protect
      against this race.
      
      Cc: <stable@vger.kernel.org>
      Fixes: cb84d11e ("arm64: neon: Remove support for nested or hardirq kernel-mode NEON")
      Acked-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      Reviewed-by: default avatarDave Martin <Dave.Martin@arm.com>
      Reviewed-by: default avatarMark Rutland <mark.rutland@arm.com>
      Signed-off-by: default avatarYandong Zhao <yandong77520@gmail.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      2fd8eb4a
    • Ard Biesheuvel's avatar
      efi/x86: Fix mixed mode reboot loop by removing pointless call to PciIo->Attributes() · e2967018
      Ard Biesheuvel authored
      Hans de Goede reported that his mixed EFI mode Bay Trail tablet
      would not boot at all any more, but enter a reboot loop without
      any logs printed by the kernel.
      
      Unbreak 64-bit Linux/x86 on 32-bit UEFI:
      
      When it was first introduced, the EFI stub code that copies the
      contents of PCI option ROMs originally only intended to do so if
      the EFI_PCI_IO_ATTRIBUTE_EMBEDDED_ROM attribute was *not* set.
      
      The reason was that the UEFI spec permits PCI option ROM images
      to be provided by the platform directly, rather than via the ROM
      BAR, and in this case, the OS can only access them at runtime if
      they are preserved at boot time by copying them from the areas
      described by PciIo->RomImage and PciIo->RomSize.
      
      However, it implemented this check erroneously, as can be seen in
      commit:
      
        dd5fc854 ("EFI: Stash ROMs if they're not in the PCI BAR")
      
      which introduced:
      
          if (!attributes & EFI_PCI_IO_ATTRIBUTE_EMBEDDED_ROM)
                  continue;
      
      and given that the numeric value of EFI_PCI_IO_ATTRIBUTE_EMBEDDED_ROM
      is 0x4000, this condition never becomes true, and so the option ROMs
      were copied unconditionally.
      
      This was spotted and 'fixed' by commit:
      
        886d751a ("x86, efi: correct precedence of operators in setup_efi_pci")
      
      but inadvertently inverted the logic at the same time, defeating
      the purpose of the code, since it now only preserves option ROM
      images that can be read from the ROM BAR as well.
      
      Unsurprisingly, this broke some systems, and so the check was removed
      entirely in the following commit:
      
        73970188 ("x86, efi: remove attribute check from setup_efi_pci")
      
      It is debatable whether this check should have been included in the
      first place, since the option ROM image provided to the UEFI driver by
      the firmware may be different from the one that is actually present in
      the card's flash ROM, and so whatever PciIo->RomImage points at should
      be preferred regardless of whether the attribute is set.
      
      As this was the only use of the attributes field, we can remove
      the call to PciIo->Attributes() entirely, which is especially
      nice because its prototype involves uint64_t type by-value
      arguments which the EFI mixed mode has trouble dealing with.
      
      Any mixed mode system with PCI is likely to be affected.
      Tested-by: default avatarWilfried Klaebe <linux-kernel@lebenslange-mailadresse.de>
      Tested-by: default avatarHans de Goede <hdegoede@redhat.com>
      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/20180711090235.9327-2-ard.biesheuvel@linaro.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      e2967018
    • Vladimir Murzin's avatar
      ARM: 8775/1: NOMMU: Use instr_sync instead of plain isb in common code · cea39477
      Vladimir Murzin authored
      Greg reported that commit 3c241210 ("ARM: 8756/1: NOMMU: Postpone
      MPU activation till __after_proc_init") is causing breakage for the
      old Versatile platform in no-MMU mode (with out-of-tree patches):
      
        AS      arch/arm/kernel/head-nommu.o
      arch/arm/kernel/head-nommu.S: Assembler messages:
      arch/arm/kernel/head-nommu.S:180: Error: selected processor does not support `isb' in ARM mode
      scripts/Makefile.build:417: recipe for target 'arch/arm/kernel/head-nommu.o' failed
      make[2]: *** [arch/arm/kernel/head-nommu.o] Error 1
      Makefile:1034: recipe for target 'arch/arm/kernel' failed
      make[1]: *** [arch/arm/kernel] Error 2
      
      Since the code is common for all NOMMU builds usage of the isb was a
      bad idea (please, note that isb also used in MPU related code which is
      fine because MPU has dependency on CPU_V7/CPU_V7M), instead use more
      robust instr_sync assembler macro.
      
      Fixes: 3c241210 ("ARM: 8756/1: NOMMU: Postpone MPU activation till __after_proc_init")
      Reported-by: default avatarGreg Ungerer <gerg@kernel.org>
      Tested-by: default avatarGreg Ungerer <gerg@kernel.org>
      Signed-off-by: default avatarVladimir Murzin <vladimir.murzin@arm.com>
      Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
      cea39477
  4. 10 Jul, 2018 6 commits
    • Linus Torvalds's avatar
      Merge tag 'mips_fixes_4.18_3' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux · 1e09177a
      Linus Torvalds authored
      Pull MIPS fixes from Paul Burton:
       "A couple more MIPS fixes for 4.18:
      
         - Use async IPIs for arch_trigger_cpumask_backtrace() in order to
           avoid warnings & deadlocks, fixing a problem introduced in v3.19
           with the fix trivial to backport as far as v4.9.
      
         - Fix ioremap()'s MMU/TLB backed path to avoid spuriously rejecting
           valid requests due to an incorrect belief that the memory region is
           backed by potentially-in-use RAM. This fixes a regression in v4.2"
      
      * tag 'mips_fixes_4.18_3' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux:
        MIPS: Fix ioremap() RAM check
        MIPS: Use async IPIs for arch_trigger_cpumask_backtrace()
        MIPS: Call dump_stack() from show_regs()
      1e09177a
    • Mathieu Desnoyers's avatar
      rseq/selftests: cleanup: Update comment above rseq_prepare_unload · 8a465801
      Mathieu Desnoyers authored
      rseq as it was merged does not have rseq_finish_*() in the user-space
      selftests anymore. Update the rseq_prepare_unload() helper comment to
      adapt to this reality.
      Signed-off-by: default avatarMathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: linux-api@vger.kernel.org
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: "Paul E . McKenney" <paulmck@linux.vnet.ibm.com>
      Cc: Boqun Feng <boqun.feng@gmail.com>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Dave Watson <davejwatson@fb.com>
      Cc: Paul Turner <pjt@google.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: "H . Peter Anvin" <hpa@zytor.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Chris Lameter <cl@linux.com>
      Cc: Ben Maurer <bmaurer@fb.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Josh Triplett <josh@joshtriplett.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Michael Kerrisk <mtk.manpages@gmail.com>
      Cc: Joel Fernandes <joelaf@google.com>
      Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Link: https://lkml.kernel.org/r/20180709195155.7654-7-mathieu.desnoyers@efficios.com
      8a465801
    • Mathieu Desnoyers's avatar
      rseq: Remove unused types_32_64.h uapi header · 4f4c0acd
      Mathieu Desnoyers authored
      This header was introduced in the 4.18 merge window, and rseq does
      not need it anymore. Nuke it before the final release.
      Signed-off-by: default avatarMathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: linux-api@vger.kernel.org
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: "Paul E . McKenney" <paulmck@linux.vnet.ibm.com>
      Cc: Boqun Feng <boqun.feng@gmail.com>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Dave Watson <davejwatson@fb.com>
      Cc: Paul Turner <pjt@google.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: "H . Peter Anvin" <hpa@zytor.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Chris Lameter <cl@linux.com>
      Cc: Ben Maurer <bmaurer@fb.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Josh Triplett <josh@joshtriplett.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Michael Kerrisk <mtk.manpages@gmail.com>
      Cc: Joel Fernandes <joelaf@google.com>
      Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Link: https://lkml.kernel.org/r/20180709195155.7654-6-mathieu.desnoyers@efficios.com
      4f4c0acd
    • Mathieu Desnoyers's avatar
      rseq: uapi: Declare rseq_cs field as union, update includes · ec9c82e0
      Mathieu Desnoyers authored
      Declaring the rseq_cs field as a union between __u64 and two __u32
      allows both 32-bit and 64-bit kernels to read the full __u64, and
      therefore validate that a 32-bit user-space cleared the upper 32
      bits, thus ensuring a consistent behavior between native 32-bit
      kernels and 32-bit compat tasks on 64-bit kernels.
      
      Check that the rseq_cs value read is < TASK_SIZE.
      
      The asm/byteorder.h header needs to be included by rseq.h, now
      that it is not using linux/types_32_64.h anymore.
      
      Considering that only __32 and __u64 types are declared in linux/rseq.h,
      the linux/types.h header should always be included for both kernel and
      user-space code: including stdint.h is just for u64 and u32, which are
      not used in this header at all.
      
      Use copy_from_user()/clear_user() to interact with a 64-bit field,
      because arm32 does not implement 64-bit __get_user, and ppc32 does not
      64-bit get_user. Considering that the rseq_cs pointer does not need to
      be loaded/stored with single-copy atomicity from the kernel anymore, we
      can simply use copy_from_user()/clear_user().
      Signed-off-by: default avatarMathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: linux-api@vger.kernel.org
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: "Paul E . McKenney" <paulmck@linux.vnet.ibm.com>
      Cc: Boqun Feng <boqun.feng@gmail.com>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Dave Watson <davejwatson@fb.com>
      Cc: Paul Turner <pjt@google.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: "H . Peter Anvin" <hpa@zytor.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Chris Lameter <cl@linux.com>
      Cc: Ben Maurer <bmaurer@fb.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Josh Triplett <josh@joshtriplett.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Michael Kerrisk <mtk.manpages@gmail.com>
      Cc: Joel Fernandes <joelaf@google.com>
      Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Link: https://lkml.kernel.org/r/20180709195155.7654-5-mathieu.desnoyers@efficios.com
      ec9c82e0
    • Mathieu Desnoyers's avatar
      rseq: uapi: Update uapi comments · 0fb9a1ab
      Mathieu Desnoyers authored
      Update rseq uapi header comments to reflect that user-space need to do
      thread-local loads/stores from/to the struct rseq fields.
      
      As a consequence of this added requirement, the kernel does not need
      to perform loads/stores with single-copy atomicity.
      
      Update the comment associated to the "flags" fields to describe
      more accurately that it's only useful to facilitate single-stepping
      through rseq critical sections with debuggers.
      Signed-off-by: default avatarMathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: linux-api@vger.kernel.org
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: "Paul E . McKenney" <paulmck@linux.vnet.ibm.com>
      Cc: Boqun Feng <boqun.feng@gmail.com>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Dave Watson <davejwatson@fb.com>
      Cc: Paul Turner <pjt@google.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: "H . Peter Anvin" <hpa@zytor.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Chris Lameter <cl@linux.com>
      Cc: Ben Maurer <bmaurer@fb.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Josh Triplett <josh@joshtriplett.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Michael Kerrisk <mtk.manpages@gmail.com>
      Cc: Joel Fernandes <joelaf@google.com>
      Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Link: https://lkml.kernel.org/r/20180709195155.7654-4-mathieu.desnoyers@efficios.com
      0fb9a1ab
    • Mathieu Desnoyers's avatar
      rseq: Use get_user/put_user rather than __get_user/__put_user · 8f281770
      Mathieu Desnoyers authored
      __get_user()/__put_user() is used to read values for address ranges that
      were already checked with access_ok() on rseq registration.
      
      It has been recognized that __get_user/__put_user are optimizing the
      wrong thing. Replace them by get_user/put_user across rseq instead.
      
      If those end up showing up in benchmarks, the proper approach would be to
      use user_access_begin() / unsafe_{get,put}_user() / user_access_end()
      anyway.
      Signed-off-by: default avatarMathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: linux-api@vger.kernel.org
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: "Paul E . McKenney" <paulmck@linux.vnet.ibm.com>
      Cc: Boqun Feng <boqun.feng@gmail.com>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Dave Watson <davejwatson@fb.com>
      Cc: Paul Turner <pjt@google.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: "H . Peter Anvin" <hpa@zytor.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Chris Lameter <cl@linux.com>
      Cc: Ben Maurer <bmaurer@fb.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Josh Triplett <josh@joshtriplett.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Michael Kerrisk <mtk.manpages@gmail.com>
      Cc: Joel Fernandes <joelaf@google.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Link: https://lkml.kernel.org/r/20180709195155.7654-3-mathieu.desnoyers@efficios.com
      8f281770