1. 17 Feb, 2018 5 commits
    • Linus Torvalds's avatar
      Merge tag 'for-linus-4.16a-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip · f73f047d
      Linus Torvalds authored
      Pull xen fixes from Juergen Gross:
      
       - fixes for the Xen pvcalls frontend driver
      
       - fix for booting Xen pv domains
      
       - fix for the xenbus driver user interface
      
      * tag 'for-linus-4.16a-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
        pvcalls-front: wait for other operations to return when release passive sockets
        pvcalls-front: introduce a per sock_mapping refcount
        x86/xen: Calculate __max_logical_packages on PV domains
        xenbus: track caller request id
      f73f047d
    • Stefano Stabellini's avatar
      pvcalls-front: wait for other operations to return when release passive sockets · d1a75e08
      Stefano Stabellini authored
      Passive sockets can have ongoing operations on them, specifically, we
      have two wait_event_interruptable calls in pvcalls_front_accept.
      
      Add two wake_up calls in pvcalls_front_release, then wait for the
      potential waiters to return and release the sock_mapping refcount.
      Signed-off-by: default avatarStefano Stabellini <stefano@aporeto.com>
      Acked-by: default avatarJuergen Gross <jgross@suse.com>
      Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
      d1a75e08
    • Stefano Stabellini's avatar
      pvcalls-front: introduce a per sock_mapping refcount · 64d68718
      Stefano Stabellini authored
      Introduce a per sock_mapping refcount, in addition to the existing
      global refcount. Thanks to the sock_mapping refcount, we can safely wait
      for it to be 1 in pvcalls_front_release before freeing an active socket,
      instead of waiting for the global refcount to be 1.
      Signed-off-by: default avatarStefano Stabellini <stefano@aporeto.com>
      Acked-by: default avatarJuergen Gross <jgross@suse.com>
      Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
      64d68718
    • Prarit Bhargava's avatar
      x86/xen: Calculate __max_logical_packages on PV domains · 63e708f8
      Prarit Bhargava authored
      The kernel panics on PV domains because native_smp_cpus_done() is
      only called for HVM domains.
      
      Calculate __max_logical_packages for PV domains.
      
      Fixes: b4c0a732 ("x86/smpboot: Fix __max_logical_packages estimate")
      Signed-off-by: default avatarPrarit Bhargava <prarit@redhat.com>
      Tested-and-reported-by: default avatarSimon Gaiser <simon@invisiblethingslab.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: x86@kernel.org
      Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
      Cc: Juergen Gross <jgross@suse.com>
      Cc: Dou Liyang <douly.fnst@cn.fujitsu.com>
      Cc: Prarit Bhargava <prarit@redhat.com>
      Cc: Kate Stewart <kstewart@linuxfoundation.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
      Cc: xen-devel@lists.xenproject.org
      Reviewed-by: default avatarBoris Ostrovsky <boris.ostrovsky@oracle.com>
      Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
      63e708f8
    • Joao Martins's avatar
      xenbus: track caller request id · 29fee6ee
      Joao Martins authored
      Commit fd8aa909 ("xen: optimize xenbus driver for multiple concurrent
      xenstore accesses") optimized xenbus concurrent accesses but in doing so
      broke UABI of /dev/xen/xenbus. Through /dev/xen/xenbus applications are in
      charge of xenbus message exchange with the correct header and body. Now,
      after the mentioned commit the replies received by application will no
      longer have the header req_id echoed back as it was on request (see
      specification below for reference), because that particular field is being
      overwritten by kernel.
      
      struct xsd_sockmsg
      {
        uint32_t type;  /* XS_??? */
        uint32_t req_id;/* Request identifier, echoed in daemon's response.  */
        uint32_t tx_id; /* Transaction id (0 if not related to a transaction). */
        uint32_t len;   /* Length of data following this. */
      
        /* Generally followed by nul-terminated string(s). */
      };
      
      Before there was only one request at a time so req_id could simply be
      forwarded back and forth. To allow simultaneous requests we need a
      different req_id for each message thus kernel keeps a monotonic increasing
      counter for this field and is written on every request irrespective of
      userspace value.
      
      Forwarding again the req_id on userspace requests is not a solution because
      we would open the possibility of userspace-generated req_id colliding with
      kernel ones. So this patch instead takes another route which is to
      artificially keep user req_id while keeping the xenbus logic as is. We do
      that by saving the original req_id before xs_send(), use the private kernel
      counter as req_id and then once reply comes and was validated, we restore
      back the original req_id.
      
      Cc: <stable@vger.kernel.org> # 4.11
      Fixes: fd8aa909 ("xen: optimize xenbus driver for multiple concurrent xenstore accesses")
      Reported-by: default avatarBhavesh Davda <bhavesh.davda@oracle.com>
      Signed-off-by: default avatarJoao Martins <joao.m.martins@oracle.com>
      Reviewed-by: default avatarJuergen Gross <jgross@suse.com>
      Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
      29fee6ee
  2. 16 Feb, 2018 13 commits
    • Linus Torvalds's avatar
      Merge tag 'dma-mapping-4.16-2' of git://git.infradead.org/users/hch/dma-mapping · 1e3510b2
      Linus Torvalds authored
      Pull dma-mapping fixes from Christoph Hellwig:
       "A few dma-mapping fixes for the fallout from the changes in rc1"
      
      * tag 'dma-mapping-4.16-2' of git://git.infradead.org/users/hch/dma-mapping:
        powerpc/macio: set a proper dma_coherent_mask
        dma-mapping: fix a comment typo
        dma-direct: comment the dma_direct_free calling convention
        dma-direct: mark as is_phys
        ia64: fix build failure with CONFIG_SWIOTLB
      1e3510b2
    • Arnd Bergmann's avatar
      mm: hide a #warning for COMPILE_TEST · af27d940
      Arnd Bergmann authored
      We get a warning about some slow configurations in randconfig kernels:
      
        mm/memory.c:83:2: error: #warning Unfortunate NUMA and NUMA Balancing config, growing page-frame for last_cpupid. [-Werror=cpp]
      
      The warning is reasonable by itself, but gets in the way of randconfig
      build testing, so I'm hiding it whenever CONFIG_COMPILE_TEST is set.
      
      The warning was added in 2013 in commit 75980e97 ("mm: fold
      page->_last_nid into page->flags where possible").
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      af27d940
    • Linus Torvalds's avatar
      Merge tag 'mips_fixes_4.16_2' of git://git.kernel.org/pub/scm/linux/kernel/git/jhogan/mips · 78352f18
      Linus Torvalds authored
      Pull MIPS fixes from James Hogan:
       "A few fixes for outstanding MIPS issues:
      
         - an __init section mismatch warning when brcmstb_pm is enabled
      
         - a regression handling multiple mem=X@Y arguments (4.11)
      
         - a USB Kconfig select warning, and related sparc cleanup (4.16)"
      
      * tag 'mips_fixes_4.16_2' of git://git.kernel.org/pub/scm/linux/kernel/git/jhogan/mips:
        sparc,leon: Select USB_UHCI_BIG_ENDIAN_{MMIO,DESC}
        usb: Move USB_UHCI_BIG_ENDIAN_* out of USB_SUPPORT
        MIPS: Fix incorrect mem=X@Y handling
        MIPS: BMIPS: Fix section mismatch warning
      78352f18
    • Linus Torvalds's avatar
      Merge tag 'for-4.16-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux · da370f1d
      Linus Torvalds authored
      Pull btrfs fixes from David Sterba:
       "We have a few assorted fixes, some of them show up during fstests so I
        gave them more testing"
      
      * tag 'for-4.16-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
        btrfs: Fix use-after-free when cleaning up fs_devs with a single stale device
        Btrfs: fix null pointer dereference when replacing missing device
        btrfs: remove spurious WARN_ON(ref->count < 0) in find_parent_nodes
        btrfs: Ignore errors from btrfs_qgroup_trace_extent_post
        Btrfs: fix unexpected -EEXIST when creating new inode
        Btrfs: fix use-after-free on root->orphan_block_rsv
        Btrfs: fix btrfs_evict_inode to handle abnormal inodes correctly
        Btrfs: fix extent state leak from tree log
        Btrfs: fix crash due to not cleaning up tree log block's dirty bits
        Btrfs: fix deadlock in run_delalloc_nocow
      da370f1d
    • Linus Torvalds's avatar
      Merge tag 'for-4.16/dm-chained-bios-fix' of... · c85b0b14
      Linus Torvalds authored
      Merge tag 'for-4.16/dm-chained-bios-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm
      
      Pull device mapper fix from Mike Snitzer:
       "Fix for DM core to properly propagate errors (avoids overriding
        non-zero error with 0). This is particularly important given DM core's
        increased use of chained bios"
      
      * tag 'for-4.16/dm-chained-bios-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
        dm: correctly handle chained bios in dec_pending()
      c85b0b14
    • Linus Torvalds's avatar
      Merge tag 'platform-drivers-x86-v4.16-4' of git://git.infradead.org/linux-platform-drivers-x86 · 5e8639b7
      Linus Torvalds authored
      Pull x86 platform driver fixes from Andy Shevchenko:
      
       - regression fix in keyboard support for Dell laptops
      
       - prevent out-of-boundary write in WMI bus driver
      
       - increase timeout to read functional key status on Lenovo laptops
      
      * tag 'platform-drivers-x86-v4.16-4' of git://git.infradead.org/linux-platform-drivers-x86:
        platform/x86: dell-laptop: Removed duplicates in DMI whitelist
        platform/x86: dell-laptop: fix kbd_get_state's request value
        platform/x86: ideapad-laptop: Increase timeout to wait for EC answer
        platform/x86: wmi: fix off-by-one write in wmi_dev_probe()
      5e8639b7
    • Linus Torvalds's avatar
      Merge tag 'sound-4.16-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · 1a2a7d3e
      Linus Torvalds authored
      Pull sound fixes from Takashi Iwai:
       "A collection of usual suspects:
      
         - a handful USB-audio and HD-audio device-specific quirks
      
         - some trivial fixes for the new AC97 bus stuff
      
         - another race fix in ALSA sequencer core"
      
      * tag 'sound-4.16-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
        ALSA: hda/realtek: PCI quirk for Fujitsu U7x7
        ALSA: seq: Fix racy pool initializations
        ALSA: usb: add more device quirks for USB DSD devices
        ALSA: usb-audio: Fix UAC2 get_ctl request with a RANGE attribute
        ALSA: ac97: Fix copy and paste typo in documentation
        ALSA: usb-audio: add implicit fb quirk for Behringer UFX1204
        ALSA: ac97: kconfig: Remove select of undefined symbol AC97
        ALSA: hda/realtek - Enable Thinkpad Dock device for ALC298 platform
        ALSA: hda/realtek - Add headset mode support for Dell laptop
        ALSA: hda - Fix headset mic detection problem for two Dell machines
      1a2a7d3e
    • Linus Torvalds's avatar
      Merge tag 'drm-fixes-for-v4.16-rc2' of git://people.freedesktop.org/~airlied/linux · bad57539
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "One nouveau regression fix, one AMD quirk and a full set of i915
        fixes.
      
        The i915 fixes are mostly for things caught by their CI system, main
        ones being DSI panel fixes and GEM fixes"
      
      * tag 'drm-fixes-for-v4.16-rc2' of git://people.freedesktop.org/~airlied/linux:
        drm/nouveau: Make clock gate support conditional
        drm/i915: Fix DSI panels with v1 MIPI sequences without a DEASSERT sequence v3
        drm/i915: Free memdup-ed DSI VBT data structures on driver_unload
        drm/i915: Add intel_bios_cleanup() function
        drm/i915/vlv: Add cdclk workaround for DSI
        drm/i915/gvt: fix one typo of render_mmio trace
        drm/i915/gvt: Support BAR0 8-byte reads/writes
        drm/i915/gvt: add 0xe4f0 into gen9 render list
        drm/i915/pmu: Fix building without CONFIG_PM
        drm/i915/pmu: Fix sleep under atomic in RC6 readout
        drm/i915/pmu: Fix PMU enable vs execlists tasklet race
        drm/i915: Lock out execlist tasklet while peeking inside for busy-stats
        drm/i915/breadcrumbs: Ignore unsubmitted signalers
        drm/i915: Don't wake the device up to check if the engine is asleep
        drm/i915: Avoid truncation before clamping userspace's priority value
        drm/i915/perf: Fix compiler warning for string truncation
        drm/i915/perf: Fix compiler warning for string truncation
        drm/amdgpu: add new device to use atpx quirk
      bad57539
    • NeilBrown's avatar
      dm: correctly handle chained bios in dec_pending() · 8dd601fa
      NeilBrown authored
      dec_pending() is given an error status (possibly 0) to be recorded
      against a bio.  It can be called several times on the one 'struct
      dm_io', and it is careful to only assign a non-zero error to
      io->status.  However when it then assigned io->status to bio->bi_status,
      it is not careful and could overwrite a genuine error status with 0.
      
      This can happen when chained bios are in use.  If a bio is chained
      beneath the bio that this dm_io is handling, the child bio might
      complete and set bio->bi_status before the dm_io completes.
      
      This has been possible since chained bios were introduced in 3.14, and
      has become a lot easier to trigger with commit 18a25da8 ("dm: ensure
      bio submission follows a depth-first tree walk") as that commit caused
      dm to start using chained bios itself.
      
      A particular failure mode is that if a bio spans an 'error' target and a
      working target, the 'error' fragment will complete instantly and set the
      ->bi_status, and the other fragment will normally complete a little
      later, and will clear ->bi_status.
      
      The fix is simply to only assign io_error to bio->bi_status when
      io_error is not zero.
      Reported-and-tested-by: default avatarMilan Broz <gmazyland@gmail.com>
      Cc: stable@vger.kernel.org (v3.14+)
      Signed-off-by: default avatarNeilBrown <neilb@suse.com>
      Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
      8dd601fa
    • Dave Airlie's avatar
      Merge branch 'linux-4.16' of git://github.com/skeggsb/linux into drm-fixes · bfad2d08
      Dave Airlie authored
      single fix for older gpus.
      
      * 'linux-4.16' of git://github.com/skeggsb/linux:
        drm/nouveau: Make clock gate support conditional
      bfad2d08
    • Thierry Reding's avatar
      drm/nouveau: Make clock gate support conditional · 92256269
      Thierry Reding authored
      The recently introduced clock gate support breaks on Tegra chips because
      no thermal support is enabled for those devices. Conditionalize the code
      on the existence of thermal support to fix this.
      
      Fixes: b138eca6 ("drm/nouveau: Add support for basic clockgating on Kepler1")
      Cc: Martin Peres <martin.peres@free.fr>
      Cc: Lyude Paul <lyude@redhat.com>
      Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
      Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
      Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
      92256269
    • Dave Airlie's avatar
      Merge tag 'drm-intel-fixes-2018-02-14-1' of... · 8d3c6294
      Dave Airlie authored
      Merge tag 'drm-intel-fixes-2018-02-14-1' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes
      
      There are important fixes for VLV with MIPI/DSI panels,
      2 clean-up patches needed for this MIPI/DSI fix,
      and many fixes for GEM including fixes for Perf OA and PMU,
      and fixes on scheduler and preemption.
      
      This also includes GVT fixes: "This has one to fix GTT mmio 8b
      access from guest and two simple ones for mmio switch and typo fix"
      
      * tag 'drm-intel-fixes-2018-02-14-1' of git://anongit.freedesktop.org/drm/drm-intel:
        drm/i915: Fix DSI panels with v1 MIPI sequences without a DEASSERT sequence v3
        drm/i915: Free memdup-ed DSI VBT data structures on driver_unload
        drm/i915: Add intel_bios_cleanup() function
        drm/i915/vlv: Add cdclk workaround for DSI
        drm/i915/gvt: fix one typo of render_mmio trace
        drm/i915/gvt: Support BAR0 8-byte reads/writes
        drm/i915/gvt: add 0xe4f0 into gen9 render list
        drm/i915/pmu: Fix building without CONFIG_PM
        drm/i915/pmu: Fix sleep under atomic in RC6 readout
        drm/i915/pmu: Fix PMU enable vs execlists tasklet race
        drm/i915: Lock out execlist tasklet while peeking inside for busy-stats
        drm/i915/breadcrumbs: Ignore unsubmitted signalers
        drm/i915: Don't wake the device up to check if the engine is asleep
        drm/i915: Avoid truncation before clamping userspace's priority value
        drm/i915/perf: Fix compiler warning for string truncation
        drm/i915/perf: Fix compiler warning for string truncation
      8d3c6294
    • Dave Airlie's avatar
      Merge branch 'drm-next-4.16' of git://people.freedesktop.org/~agd5f/linux into drm-fixes · 6bdd5b4e
      Dave Airlie authored
      single atpx fix
      
      * 'drm-next-4.16' of git://people.freedesktop.org/~agd5f/linux:
        drm/amdgpu: add new device to use atpx quirk
      6bdd5b4e
  3. 15 Feb, 2018 22 commits
    • Linus Torvalds's avatar
      Merge tag 'acpi-4.16-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · b63b1e57
      Linus Torvalds authored
      Pull ACPI fixes from Rafael Wysocki:
       "These fix a system resume regression from the 4.13 cycle, clean up
        device table handling in the ACPI core, update sysfs ABI documentation
        of a couple of drivers and add an expected switch fall-through marker
        to the SPCR table parsing code.
      
        Specifics:
      
         - Revert a problematic EC driver change from the 4.13 cycle that
           introduced a system resume regression on Thinkpad X240 (Rafael
           Wysocki).
      
         - Clean up device tables handling in the ACPI core and the related
           part of the device properties framework (Andy Shevchenko).
      
         - Update the sysfs ABI documentatio of the dock and the INT3407
           special device drivers (Aishwarya Pant).
      
         - Add an expected switch fall-through marker to the SPCR table
           parsing code (Gustavo Silva)"
      
      * tag 'acpi-4.16-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        ACPI: dock: document sysfs interface
        ACPI / DPTF: Document dptf_power sysfs atttributes
        device property: Constify device_get_match_data()
        ACPI / bus: Rename acpi_get_match_data() to acpi_device_get_match_data()
        ACPI / bus: Remove checks in acpi_get_match_data()
        ACPI / bus: Do not traverse through non-existed device table
        ACPI: SPCR: Mark expected switch fall-through in acpi_parse_spcr
        ACPI / EC: Restore polling during noirq suspend/resume phases
      b63b1e57
    • Linus Torvalds's avatar
      Merge tag 'pm-4.16-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 8bb89666
      Linus Torvalds authored
      Pull power management fixes from Rafael Wysocki:
       "These fix a recently introduced build issue related to cpuidle and two
        bugs in the PM core, update cpuidle documentation and clean up memory
        allocations in the operating performance points (OPP) framework.
      
        Specifics:
      
         - Fix a recently introduced build issue related to cpuidle by
           covering all of the relevant combinations of Kconfig options
           in its header (Rafael Wysocki).
      
         - Add missing invocation of pm_runtime_drop_link() to the
           !CONFIG_SRCU variant of __device_link_del() (Lukas Wunner).
      
         - Fix unbalanced IRQ enable in the wakeup interrupts framework
           (Tony Lindgren).
      
         - Update cpuidle sysfs ABI documentation (Aishwarya Pant).
      
         - Use GFP_KERNEL instead of GFP_ATOMIC for allocating memory
           in dev_pm_opp_init_cpufreq_table() (Jia-Ju Bai)"
      
      * tag 'pm-4.16-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        PM: cpuidle: Fix cpuidle_poll_state_init() prototype
        PM / runtime: Update links_count also if !CONFIG_SRCU
        PM / wakeirq: Fix unbalanced IRQ enable for wakeirq
        Documentation/ABI: update cpuidle sysfs documentation
        opp: cpu: Replace GFP_ATOMIC with GFP_KERNEL in dev_pm_opp_init_cpufreq_table
      8bb89666
    • Linus Torvalds's avatar
      Merge tag 'hwmon-for-linus-v4.16-rc2' of... · 3e9f4df0
      Linus Torvalds authored
      Merge tag 'hwmon-for-linus-v4.16-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
      
      Pull hwmon fix from Guenter Roeck:
       "Fix bad temperature display on Ryzen/Threadripper"
      
      * tag 'hwmon-for-linus-v4.16-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
        hwmon: (k10temp) Only apply temperature offset if result is positive
      3e9f4df0
    • Linus Torvalds's avatar
      Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost · 2439f976
      Linus Torvalds authored
      Pull virtio fixes from Michael Tsirkin:
       "This includes a bugfix for virtio 9p fs. It also fixes hybernation for
        s390 guests with virtio devices"
      
      * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
        virtio/s390: implement PM operations for virtio_ccw
        9p/trans_virtio: discard zero-length reply
      2439f976
    • James Hogan's avatar
      sparc,leon: Select USB_UHCI_BIG_ENDIAN_{MMIO,DESC} · 5efad9ee
      James Hogan authored
      Now that USB_UHCI_BIG_ENDIAN_MMIO and USB_UHCI_BIG_ENDIAN_DESC are moved
      outside of the USB_SUPPORT conditional, simply select them from
      SPARC_LEON rather than by the symbol's defaults in drivers/usb/Kconfig,
      similar to how it is done for USB_EHCI_BIG_ENDIAN_MMIO and
      USB_EHCI_BIG_ENDIAN_DESC.
      Signed-off-by: default avatarJames Hogan <jhogan@kernel.org>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Corentin Labbe <clabbe.montjoie@gmail.com>
      Cc: sparclinux@vger.kernel.org
      Cc: linux-usb@vger.kernel.org
      Acked-by: default avatarDavid S. Miller <davem@davemloft.net>
      Patchwork: https://patchwork.linux-mips.org/patch/18560/
      5efad9ee
    • James Hogan's avatar
      usb: Move USB_UHCI_BIG_ENDIAN_* out of USB_SUPPORT · ec897569
      James Hogan authored
      Move the Kconfig symbols USB_UHCI_BIG_ENDIAN_MMIO and
      USB_UHCI_BIG_ENDIAN_DESC out of drivers/usb/host/Kconfig, which is
      conditional upon USB && USB_SUPPORT, so that it can be freely selected
      by platform Kconfig symbols in architecture code.
      
      For example once the MIPS_GENERIC platform selects are fixed in commit
      2e6522c5 ("MIPS: Fix typo BIG_ENDIAN to CPU_BIG_ENDIAN"), the MIPS
      32r6_defconfig warns like so:
      
      warning: (MIPS_GENERIC) selects USB_UHCI_BIG_ENDIAN_MMIO which has unmet direct dependencies (USB_SUPPORT && USB)
      warning: (MIPS_GENERIC) selects USB_UHCI_BIG_ENDIAN_DESC which has unmet direct dependencies (USB_SUPPORT && USB)
      
      Fixes: 2e6522c5 ("MIPS: Fix typo BIG_ENDIAN to CPU_BIG_ENDIAN")
      Signed-off-by: default avatarJames Hogan <jhogan@kernel.org>
      Cc: Corentin Labbe <clabbe.montjoie@gmail.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Paul Burton <paul.burton@mips.com>
      Cc: linux-usb@vger.kernel.org
      Cc: linux-mips@linux-mips.org
      Acked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Patchwork: https://patchwork.linux-mips.org/patch/18559/
      ec897569
    • Linus Torvalds's avatar
      Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 1388c804
      Linus Torvalds authored
      Pull scheduler fixes from Ingo Molnar:
       "Misc fixes:
      
         - fix rq->lock lockdep annotation bug
      
         - fix/improve update_curr_rt() and update_curr_dl() accounting
      
         - update documentation
      
         - remove unused macro"
      
      * 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        sched/cpufreq: Remove unused SUGOV_KTHREAD_PRIORITY macro
        sched/core: Fix DEBUG_SPINLOCK annotation for rq->lock
        sched/rt: Make update_curr_rt() more accurate
        sched/deadline: Make update_curr_dl() more accurate
        membarrier-sync-core: Document architecture support
      1388c804
    • Linus Torvalds's avatar
      Merge branch 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · e9e3b300
      Linus Torvalds authored
      Pull locking fixes from Ingo Molnar:
       "This contains two qspinlock fixes and three documentation and comment
        fixes"
      
      * 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        locking/semaphore: Update the file path in documentation
        locking/atomic/bitops: Document and clarify ordering semantics for failed test_and_{}_bit()
        locking/qspinlock: Ensure node->count is updated before initialising node
        locking/qspinlock: Ensure node is initialised before updating prev->next
        Documentation/locking/mutex-design: Update to reflect latest changes
      e9e3b300
    • Rafael J. Wysocki's avatar
      Merge branches 'acpi-ec', 'acpi-tables' and 'acpi-doc' · 31a3be35
      Rafael J. Wysocki authored
      * acpi-ec:
        ACPI / EC: Restore polling during noirq suspend/resume phases
      
      * acpi-tables:
        ACPI: SPCR: Mark expected switch fall-through in acpi_parse_spcr
      
      * acpi-doc:
        ACPI: dock: document sysfs interface
        ACPI / DPTF: Document dptf_power sysfs atttributes
      31a3be35
    • Rafael J. Wysocki's avatar
      Merge branches 'pm-cpuidle' and 'pm-opp' · 822ffaa5
      Rafael J. Wysocki authored
      * pm-cpuidle:
        PM: cpuidle: Fix cpuidle_poll_state_init() prototype
        Documentation/ABI: update cpuidle sysfs documentation
      
      * pm-opp:
        opp: cpu: Replace GFP_ATOMIC with GFP_KERNEL in dev_pm_opp_init_cpufreq_table
      822ffaa5
    • Alexander Abrosimov's avatar
      platform/x86: dell-laptop: Removed duplicates in DMI whitelist · c8ba9db2
      Alexander Abrosimov authored
      Fixed a mistake in which several entries were duplicated in the DMI list
      from the below commit
      fe486138 platform/x86: dell-laptop: Add 2-in-1 devices to the DMI whitelist
      Signed-off-by: default avatarAlexander Abrosimov <alexander.n.abrosimov@gmail.com>
      Reviewed-by: default avatarPali Rohár <pali.rohar@gmail.com>
      Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      c8ba9db2
    • Laszlo Toth's avatar
      platform/x86: dell-laptop: fix kbd_get_state's request value · eca39e7f
      Laszlo Toth authored
      Commit 9862b436 ("platform/x86: dell-laptop: Allocate buffer on heap
      rather than globally")
      broke one request, changed it back to the original value.
      
      Tested on a Dell E6540, backlight came back.
      
      Fixes: 9862b436 ("platform/x86: dell-laptop: Allocate buffer on heap rather than globally")
      Signed-off-by: default avatarLaszlo Toth <laszlth@gmail.com>
      Reviewed-by: default avatarPali Rohár <pali.rohar@gmail.com>
      Reviewed-by: default avatarMario Limonciello <mario.limonciello@dell.com>
      Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      eca39e7f
    • Aaron Ma's avatar
      platform/x86: ideapad-laptop: Increase timeout to wait for EC answer · ed5b9ba7
      Aaron Ma authored
      Lenovo E41-20 needs more time than 100ms to read VPC,
      the funtion keys always failed responding.
      Increase timeout to get the value from VPC, then
      the funtion keys like mic mute key work well.
      Signed-off-by: default avatarAaron Ma <aaron.ma@canonical.com>
      Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      ed5b9ba7
    • Andrey Ryabinin's avatar
      platform/x86: wmi: fix off-by-one write in wmi_dev_probe() · 6e1d8ea9
      Andrey Ryabinin authored
      wmi_dev_probe() allocates one byte less than necessary, thus
      subsequent sprintf() call writes trailing zero past the end
      of the 'buf':
      
          BUG: KASAN: slab-out-of-bounds in vsnprintf+0xda4/0x1240
          Write of size 1 at addr ffff880423529caf by task kworker/1:1/32
      
          Call Trace:
           dump_stack+0xb3/0x14d
           print_address_description+0xd7/0x380
           kasan_report+0x166/0x2b0
           vsnprintf+0xda4/0x1240
           sprintf+0x9b/0xd0
           wmi_dev_probe+0x1c3/0x400
           driver_probe_device+0x5d1/0x990
           bus_for_each_drv+0x109/0x190
           __device_attach+0x217/0x360
           bus_probe_device+0x1ad/0x260
           deferred_probe_work_func+0x10f/0x5d0
           process_one_work+0xa8b/0x1dc0
           worker_thread+0x20d/0x17d0
           kthread+0x311/0x3d0
           ret_from_fork+0x3a/0x50
      
          Allocated by task 32:
           kasan_kmalloc+0xa0/0xd0
           __kmalloc+0x14f/0x3e0
           wmi_dev_probe+0x182/0x400
           driver_probe_device+0x5d1/0x990
           bus_for_each_drv+0x109/0x190
           __device_attach+0x217/0x360
           bus_probe_device+0x1ad/0x260
           deferred_probe_work_func+0x10f/0x5d0
           process_one_work+0xa8b/0x1dc0
           worker_thread+0x20d/0x17d0
           kthread+0x311/0x3d0
           ret_from_fork+0x3a/0x50
      
      Increment allocation size to fix this.
      
      Fixes: 44b6b766 ("platform/x86: wmi: create userspace interface for drivers")
      Signed-off-by: default avatarAndrey Ryabinin <aryabinin@virtuozzo.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      6e1d8ea9
    • Linus Torvalds's avatar
      Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · e525de3a
      Linus Torvalds authored
      Pull x86 fixes from Ingo Molnar:
       "Misc fixes all across the map:
      
         - /proc/kcore vsyscall related fixes
         - LTO fix
         - build warning fix
         - CPU hotplug fix
         - Kconfig NR_CPUS cleanups
         - cpu_has() cleanups/robustification
         - .gitignore fix
         - memory-failure unmapping fix
         - UV platform fix"
      
      * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/mm, mm/hwpoison: Don't unconditionally unmap kernel 1:1 pages
        x86/error_inject: Make just_return_func() globally visible
        x86/platform/UV: Fix GAM Range Table entries less than 1GB
        x86/build: Add arch/x86/tools/insn_decoder_test to .gitignore
        x86/smpboot: Fix uncore_pci_remove() indexing bug when hot-removing a physical CPU
        x86/mm/kcore: Add vsyscall page to /proc/kcore conditionally
        vfs/proc/kcore, x86/mm/kcore: Fix SMAP fault when dumping vsyscall user page
        x86/Kconfig: Further simplify the NR_CPUS config
        x86/Kconfig: Simplify NR_CPUS config
        x86/MCE: Fix build warning introduced by "x86: do not use print_symbol()"
        x86/cpufeature: Update _static_cpu_has() to use all named variables
        x86/cpufeature: Reindent _static_cpu_has()
      e525de3a
    • Linus Torvalds's avatar
      Merge branch 'x86-pti-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · d4667ca1
      Linus Torvalds authored
      Pull x86 PTI and Spectre related fixes and updates from Ingo Molnar:
       "Here's the latest set of Spectre and PTI related fixes and updates:
      
        Spectre:
         - Add entry code register clearing to reduce the Spectre attack
           surface
         - Update the Spectre microcode blacklist
         - Inline the KVM Spectre helpers to get close to v4.14 performance
           again.
         - Fix indirect_branch_prediction_barrier()
         - Fix/improve Spectre related kernel messages
         - Fix array_index_nospec_mask() asm constraint
         - KVM: fix two MSR handling bugs
      
        PTI:
         - Fix a paranoid entry PTI CR3 handling bug
         - Fix comments
      
        objtool:
         - Fix paranoid_entry() frame pointer warning
         - Annotate WARN()-related UD2 as reachable
         - Various fixes
         - Add Add Peter Zijlstra as objtool co-maintainer
      
        Misc:
         - Various x86 entry code self-test fixes
         - Improve/simplify entry code stack frame generation and handling
           after recent heavy-handed PTI and Spectre changes. (There's two
           more WIP improvements expected here.)
         - Type fix for cache entries
      
        There's also some low risk non-fix changes I've included in this
        branch to reduce backporting conflicts:
      
         - rename a confusing x86_cpu field name
         - de-obfuscate the naming of single-TLB flushing primitives"
      
      * 'x86-pti-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (41 commits)
        x86/entry/64: Fix CR3 restore in paranoid_exit()
        x86/cpu: Change type of x86_cache_size variable to unsigned int
        x86/spectre: Fix an error message
        x86/cpu: Rename cpu_data.x86_mask to cpu_data.x86_stepping
        selftests/x86/mpx: Fix incorrect bounds with old _sigfault
        x86/mm: Rename flush_tlb_single() and flush_tlb_one() to __flush_tlb_one_[user|kernel]()
        x86/speculation: Add <asm/msr-index.h> dependency
        nospec: Move array_index_nospec() parameter checking into separate macro
        x86/speculation: Fix up array_index_nospec_mask() asm constraint
        x86/debug: Use UD2 for WARN()
        x86/debug, objtool: Annotate WARN()-related UD2 as reachable
        objtool: Fix segfault in ignore_unreachable_insn()
        selftests/x86: Disable tests requiring 32-bit support on pure 64-bit systems
        selftests/x86: Do not rely on "int $0x80" in single_step_syscall.c
        selftests/x86: Do not rely on "int $0x80" in test_mremap_vdso.c
        selftests/x86: Fix build bug caused by the 5lvl test which has been moved to the VM directory
        selftests/x86/pkeys: Remove unused functions
        selftests/x86: Clean up and document sscanf() usage
        selftests/x86: Fix vDSO selftest segfault for vsyscall=none
        x86/entry/64: Remove the unused 'icebp' macro
        ...
      d4667ca1
    • Ingo Molnar's avatar
      x86/entry/64: Fix CR3 restore in paranoid_exit() · e4865757
      Ingo Molnar authored
      Josh Poimboeuf noticed the following bug:
      
       "The paranoid exit code only restores the saved CR3 when it switches back
        to the user GS.  However, even in the kernel GS case, it's possible that
        it needs to restore a user CR3, if for example, the paranoid exception
        occurred in the syscall exit path between SWITCH_TO_USER_CR3_STACK and
        SWAPGS."
      
      Josh also confirmed via targeted testing that it's possible to hit this bug.
      
      Fix the bug by also restoring CR3 in the paranoid_exit_no_swapgs branch.
      
      The reason we haven't seen this bug reported by users yet is probably because
      "paranoid" entry points are limited to the following cases:
      
       idtentry double_fault       do_double_fault  has_error_code=1  paranoid=2
       idtentry debug              do_debug         has_error_code=0  paranoid=1 shift_ist=DEBUG_STACK
       idtentry int3               do_int3          has_error_code=0  paranoid=1 shift_ist=DEBUG_STACK
       idtentry machine_check      do_mce           has_error_code=0  paranoid=1
      
      Amongst those entry points only machine_check is one that will interrupt an
      IRQS-off critical section asynchronously - and machine check events are rare.
      
      The other main asynchronous entries are NMI entries, which can be very high-freq
      with perf profiling, but they are special: they don't use the 'idtentry' macro but
      are open coded and restore user CR3 unconditionally so don't have this bug.
      Reported-and-tested-by: default avatarJosh Poimboeuf <jpoimboe@redhat.com>
      Reviewed-by: default avatarAndy Lutomirski <luto@kernel.org>
      Acked-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Arjan van de Ven <arjan@linux.intel.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Dan Williams <dan.j.williams@intel.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20180214073910.boevmg65upbk3vqb@gmail.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      e4865757
    • Gustavo A. R. Silva's avatar
      x86/cpu: Change type of x86_cache_size variable to unsigned int · 24dbc600
      Gustavo A. R. Silva authored
      Currently, x86_cache_size is of type int, which makes no sense as we
      will never have a valid cache size equal or less than 0. So instead of
      initializing this variable to -1, it can perfectly be initialized to 0
      and use it as an unsigned variable instead.
      Suggested-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarGustavo A. R. Silva <garsilva@embeddedor.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Addresses-Coverity-ID: 1464429
      Link: http://lkml.kernel.org/r/20180213192208.GA26414@embeddedor.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      24dbc600
    • Dan Carpenter's avatar
      x86/spectre: Fix an error message · 9de29eac
      Dan Carpenter authored
      If i == ARRAY_SIZE(mitigation_options) then we accidentally print
      garbage from one space beyond the end of the mitigation_options[] array.
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Woodhouse <dwmw@amazon.co.uk>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: KarimAllah Ahmed <karahmed@amazon.de>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: kernel-janitors@vger.kernel.org
      Fixes: 9005c683 ("x86/spectre: Simplify spectre_v2 command line parsing")
      Link: http://lkml.kernel.org/r/20180214071416.GA26677@mwandaSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      9de29eac
    • Jia Zhang's avatar
      x86/cpu: Rename cpu_data.x86_mask to cpu_data.x86_stepping · b399151c
      Jia Zhang authored
      x86_mask is a confusing name which is hard to associate with the
      processor's stepping.
      
      Additionally, correct an indent issue in lib/cpu.c.
      Signed-off-by: default avatarJia Zhang <qianyue.zj@alibaba-inc.com>
      [ Updated it to more recent kernels. ]
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: bp@alien8.de
      Cc: tony.luck@intel.com
      Link: http://lkml.kernel.org/r/1514771530-70829-1-git-send-email-qianyue.zj@alibaba-inc.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      b399151c
    • Rui Wang's avatar
      selftests/x86/mpx: Fix incorrect bounds with old _sigfault · 961888b1
      Rui Wang authored
      For distributions with old userspace header files, the _sigfault
      structure is different. mpx-mini-test fails with the following
      error:
      
        [root@Purley]# mpx-mini-test_64 tabletest
        XSAVE is supported by HW & OS
        XSAVE processor supported state mask: 0x2ff
        XSAVE OS supported state mask: 0x2ff
         BNDREGS: size: 64 user: 1 supervisor: 0 aligned: 0
          BNDCSR: size: 64 user: 1 supervisor: 0 aligned: 0
        starting mpx bounds table test
        ERROR: siginfo bounds do not match shadow bounds for register 0
      
      Fix it by using the correct offset of _lower/_upper in _sigfault.
      RHEL needs this patch to work.
      Signed-off-by: default avatarRui Wang <rui.y.wang@intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: dave.hansen@linux.intel.com
      Fixes: e754aedc ("x86/mpx, selftests: Add MPX self test")
      Link: http://lkml.kernel.org/r/1513586050-1641-1-git-send-email-rui.y.wang@intel.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      961888b1
    • Andy Lutomirski's avatar
      x86/mm: Rename flush_tlb_single() and flush_tlb_one() to __flush_tlb_one_[user|kernel]() · 1299ef1d
      Andy Lutomirski authored
      flush_tlb_single() and flush_tlb_one() sound almost identical, but
      they really mean "flush one user translation" and "flush one kernel
      translation".  Rename them to flush_tlb_one_user() and
      flush_tlb_one_kernel() to make the semantics more obvious.
      
      [ I was looking at some PTI-related code, and the flush-one-address code
        is unnecessarily hard to understand because the names of the helpers are
        uninformative.  This came up during PTI review, but no one got around to
        doing it. ]
      Signed-off-by: default avatarAndy Lutomirski <luto@kernel.org>
      Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Dave Hansen <dave.hansen@intel.com>
      Cc: Eduardo Valentin <eduval@amazon.com>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: Juergen Gross <jgross@suse.com>
      Cc: Kees Cook <keescook@google.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Linux-MM <linux-mm@kvack.org>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Will Deacon <will.deacon@arm.com>
      Link: http://lkml.kernel.org/r/3303b02e3c3d049dc5235d5651e0ae6d29a34354.1517414378.git.luto@kernel.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      1299ef1d