1. 22 Mar, 2016 39 commits
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm · b91d9c67
      Linus Torvalds authored
      Pull more KVM updates from Paolo Bonzini:
       "Second round of KVM changes for 4.6:
      
         - build fixes for PPC KVM
         - miscellaneous bugfixes for ARM KVM
         - cleanup of memory barrier and removal of redundant barriers
         - x86 fixes: page tracking oops, support for old buggy KVM nested on 4.5
         - support for protection keys in guests
         - lockdep fix
         - another conversion to simple wait queues and raw spinlocks,
           backported from PREEMPT_RT"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (27 commits)
        KVM: page_track: fix access to NULL slot
        KVM: PPC: do not compile in vfio.o unconditionally
        kvm, rt: change async pagefault code locking for PREEMPT_RT
        KVM/PPC: update the comment of memory barrier in the kvmppc_prepare_to_enter()
        KVM/x86: update the comment of memory barrier in the vcpu_enter_guest()
        KVM: Replace smp_mb() with smp_load_acquire() in the kvm_flush_remote_tlbs()
        KVM/x86: Call smp_wmb() before increasing tlbs_dirty
        KVM: Replace smp_mb() with smp_mb_after_atomic() in the kvm_make_all_cpus_request()
        KVM/x86: Replace smp_mb() with smp_store_mb/release() in the walk_shadow_page_lockless_begin/end()
        KVM: Remove redundant smp_mb() in the kvm_mmu_commit_zap_page()
        KVM, pkeys: expose CPUID/CR4 to guest
        KVM, pkeys: add pkeys support for permission_fault
        KVM, pkeys: introduce pkru_mask to cache conditions
        KVM, pkeys: save/restore PKRU when guest/host switches
        x86: pkey: introduce write_pkru() for KVM
        KVM, pkeys: add pkeys support for xsave state
        KVM, pkeys: disable pkeys for guests in non-paging mode
        KVM: x86: remove magic number with enum cpuid_leafs
        KVM: MMU: return page fault error code from permission_fault
        KVM: fix spin_lock_init order on x86
        ...
      b91d9c67
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma · b8ba4526
      Linus Torvalds authored
      Pull more rdma updates from Doug Ledford:
       "Round two of 4.6 merge window patches.
      
        This is a monster pull request.  I held off on the hfi1 driver updates
        (the hfi1 driver is intimately tied to the qib driver and the new
        rdmavt software library that was created to help both of them) in my
        first pull request.  The hfi1/qib/rdmavt update is probably 90% of
        this pull request.  The hfi1 driver is being left in staging so that
        it can be fixed up in regards to the API that Al and yourself didn't
        like.  Intel has agreed to do the work, but in the meantime, this
        clears out 300+ patches in the backlog queue and brings my tree and
        their tree closer to sync.
      
        This also includes about 10 patches to the core and a few to mlx5 to
        create an infrastructure for configuring SRIOV ports on IB devices.
        That series includes one patch to the net core that we sent to netdev@
        and Dave Miller with each of the three revisions to the series.  We
        didn't get any response to the patch, so we took that as implicit
        approval.
      
        Finally, this series includes Intel's new iWARP driver for their x722
        cards.  It's not nearly the beast as the hfi1 driver.  It also has a
        linux-next merge issue, but that has been resolved and it now passes
        just fine.
      
        Summary:
      
         - A few minor core fixups needed for the next patch series
      
         - The IB SRIOV series.  This has bounced around for several versions.
           Of note is the fact that the first patch in this series effects the
           net core.  It was directed to netdev and DaveM for each iteration
           of the series (three versions total).  Dave did not object, but did
           not respond either.  I've taken this as permission to move forward
           with the series.
      
         - The new Intel X722 iWARP driver
      
         - A huge set of updates to the Intel hfi1 driver.  Of particular
           interest here is that we have left the driver in staging since it
           still has an API that people object to.  Intel is working on a fix,
           but getting these patches in now helps keep me sane as the upstream
           and Intel's trees were over 300 patches apart"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma: (362 commits)
        IB/ipoib: Allow mcast packets from other VFs
        IB/mlx5: Implement callbacks for manipulating VFs
        net/mlx5_core: Implement modify HCA vport command
        net/mlx5_core: Add VF param when querying vport counter
        IB/ipoib: Add ndo operations for configuring VFs
        IB/core: Add interfaces to control VF attributes
        IB/core: Support accessing SA in virtualized environment
        IB/core: Add subnet prefix to port info
        IB/mlx5: Fix decision on using MAD_IFC
        net/core: Add support for configuring VF GUIDs
        IB/{core, ulp} Support above 32 possible device capability flags
        IB/core: Replace setting the zero values in ib_uverbs_ex_query_device
        net/mlx5_core: Introduce offload arithmetic hardware capabilities
        net/mlx5_core: Refactor device capability function
        net/mlx5_core: Fix caching ATOMIC endian mode capability
        ib_srpt: fix a WARN_ON() message
        i40iw: Replace the obsolete crypto hash interface with shash
        IB/hfi1: Add SDMA cache eviction algorithm
        IB/hfi1: Switch to using the pin query function
        IB/hfi1: Specify mm when releasing pages
        ...
      b8ba4526
    • Linus Torvalds's avatar
      Merge tag 'nfs-for-4.6-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs · 01cde153
      Linus Torvalds authored
      Pull NFS client updates from Trond Myklebust:
       "Highlights include:
      
        Features:
         - Add support for multiple NFSv4.1 callbacks in flight
         - Initial patchset for RPC multipath support
         - Adapt RPC/RDMA to use the new completion queue API
      
        Bugfixes and cleanups:
         - nfs4: nfs4_ff_layout_prepare_ds should return NULL if connection failed
         - Cleanups to remove nfs_inode_dio_wait and nfs4_file_fsync
         - Fix RPC/RDMA credit accounting
         - Properly handle RDMA_ERROR replies
         - xprtrdma: Do not wait if ib_post_send() fails
         - xprtrdma: Segment head and tail XDR buffers on page boundaries
         - xprtrdma cleanups for dprintk, physical_op_map and unused macros"
      
      * tag 'nfs-for-4.6-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: (35 commits)
        nfs/blocklayout: make sure making a aligned read request
        nfs4: nfs4_ff_layout_prepare_ds should return NULL if connection failed
        nfs: remove nfs_inode_dio_wait
        nfs: remove nfs4_file_fsync
        xprtrdma: Use new CQ API for RPC-over-RDMA client send CQs
        xprtrdma: Use an anonymous union in struct rpcrdma_mw
        xprtrdma: Use new CQ API for RPC-over-RDMA client receive CQs
        xprtrdma: Serialize credit accounting again
        xprtrdma: Properly handle RDMA_ERROR replies
        rpcrdma: Add RPCRDMA_HDRLEN_ERR
        xprtrdma: Do not wait if ib_post_send() fails
        xprtrdma: Segment head and tail XDR buffers on page boundaries
        xprtrdma: Clean up dprintk format string containing a newline
        xprtrdma: Clean up physical_op_map()
        xprtrdma: Clean up unused RPCRDMA_INLINE_PAD_THRESH macro
        NFS add callback_ops to nfs4_proc_bind_conn_to_session_callback
        pnfs/NFSv4.1: Add multipath capabilities to pNFS flexfiles servers over NFSv3
        SUNRPC: Allow addition of new transports to a struct rpc_clnt
        NFSv4.1: nfs4_proc_bind_conn_to_session must iterate over all connections
        SUNRPC: Make NFS swap work with multipath
        ...
      01cde153
    • Linus Torvalds's avatar
      Merge branch 'overlayfs-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs · 243d5067
      Linus Torvalds authored
      Pull overlayfs updates from Miklos Szeredi:
       "Various fixes and tweaks"
      
      * 'overlayfs-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs:
        ovl: cleanup unused var in rename2
        ovl: rename is_merge to is_lowest
        ovl: fixed coding style warning
        ovl: Ensure upper filesystem supports d_type
        ovl: Warn on copy up if a process has a R/O fd open to the lower file
        ovl: honor flag MS_SILENT at mount
        ovl: verify upper dentry before unlink and rename
      243d5067
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse · 9f15dec8
      Linus Torvalds authored
      Pull fuse update from Miklos Szeredi:
       "This contains direct I/O fixes"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse:
        fuse: return patrial success from fuse_direct_io()
        fuse: Add reference counting for fuse_io_priv
        fuse: do not use iocb after it may have been freed
      9f15dec8
    • Linus Torvalds's avatar
      Merge tag 'for-linus-4.6-rc0-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip · 55fc733c
      Linus Torvalds authored
      Pull xen updates from David Vrabel:
       "Features and fixes for 4.6:
      
        - Make earlyprintk=xen work for HVM guests
      
        - Remove module support for things never built as modules"
      
      * tag 'for-linus-4.6-rc0-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
        drivers/xen: make platform-pci.c explicitly non-modular
        drivers/xen: make sys-hypervisor.c explicitly non-modular
        drivers/xen: make xenbus_dev_[front/back]end explicitly non-modular
        drivers/xen: make [xen-]ballon explicitly non-modular
        xen: audit usages of module.h ; remove unnecessary instances
        xen/x86: Drop mode-selecting ifdefs in startup_xen()
        xen/x86: Zero out .bss for PV guests
        hvc_xen: make early_printk work with HVM guests
        hvc_xen: fix xenboot for DomUs
        hvc_xen: add earlycon support
      55fc733c
    • Linus Torvalds's avatar
      Merge branch 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux · b8524959
      Linus Torvalds authored
      Pull i2c updates from Wolfram Sang:
       "Mostly usual driver updates and improvements.  The changelog should
        give an idea.  Standing out is the i2c-qup driver with lots of new
        capabilities and we also have now an i2c-demuxer.
      
        I'd especially like to welcome Peter Rosin as the i2c-mux maintainer.
        He has an interesting series for muxes in the queue and agreed to look
        after this part of the subsystem.  Thank you, Peter, and welcome
        again!
      
        The octeon changes were applied pretty recently before the merge
        window.  I am aware.  They are the first (and relatively simple)
        patches of a larger overhaul to this driver.  In case something goes
        wrong with them, they are easy to fix (or revert).  The advantage I
        see is that they are out of the way, and I can concentrate on the next
        block of patches.  I really would like to apply the overhaul in
        smaller batches to avoid regressions.  And waiting a cycle for the
        introductory patches seemed too much of a delay for me"
      
      * 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (39 commits)
        i2c: octeon: Support I2C_M_RECV_LEN
        i2c: octeon: Cleanup resource allocation code
        i2c: octeon: Cleanup i2c-octeon driver
        MAINTAINERS: add Peter Rosin as i2c mux maintainer
        dt-bindings: i2c: Spelling s/propoerty/property/
        i2c: immediately mark ourselves as registered
        i2c: i801: sort IDs alphabetically
        MAINTAINERS: Mika and me are designated reviewers for I2C DESIGNWARE
        i2c: octeon: Cleanup kerneldoc comments
        i2c: do not use internal data from driver core
        i2c: cadence: Fix the kernel-doc warnings
        i2c: imx: remove extra spaces.
        i2c: rcar: don't open code of_device_get_match_data()
        i2c: qup: Fix fifo handling after adding V2 support
        i2c: xiic: Implement power management
        i2c: piix4: Pre-shift the port number
        i2c: piix4: Always use the same type for port
        i2c: piix4: Support alternative port selection register
        i2c: tegra: don't open code of_device_get_match_data()
        i2c: riic, sh_mobile, rcar: Use ARCH_RENESAS
        ...
      b8524959
    • Linus Torvalds's avatar
      Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending · 5266e5b1
      Linus Torvalds authored
      Pull SCSI target updates from Nicholas Bellinger:
       "The highlights this round include:
      
         - Add target_alloc_session() w/ callback helper for doing se_session
           allocation + tag + se_node_acl lookup.  (HCH + nab)
      
         - Tree-wide fabric driver conversion to use target_alloc_session()
      
         - Convert sbp-target to use percpu_ida tag pre-allocation, and
           TARGET_SCF_ACK_KREF I/O krefs (Chris Boot + nab)
      
         - Convert usb-gadget to use percpu_ida tag pre-allocation, and
           TARGET_SCF_ACK_KREF I/O krefs (Andrzej Pietrasiewicz + nab)
      
         - Convert xen-scsiback to use percpu_ida tag pre-allocation, and
           TARGET_SCF_ACK_KREF I/O krefs (Juergen Gross + nab)
      
         - Convert tcm_fc to use TARGET_SCF_ACK_KREF I/O + TMR krefs
      
         - Convert ib_srpt to use percpu_ida tag pre-allocation
      
         - Add DebugFS node for qla2xxx target sess list (Quinn)
      
         - Rework iser-target connection termination (Jenny + Sagi)
      
         - Convert iser-target to new CQ API (HCH)
      
         - Add pass-through WRITE_SAME support for IBLOCK (Mike Christie)
      
         - Introduce data_bitmap for asynchronous access of data area (Sheng
           Yang + Andy)
      
         - Fix target_release_cmd_kref shutdown comp leak (Himanshu Madhani)
      
        Also, there is a separate PULL request coming for cxgb4 NIC driver
        prerequisites for supporting hw iscsi segmentation offload (ISO), that
        will be the base for a number of v4.7 developments involving
        iscsi-target hw offloads"
      
      * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending: (36 commits)
        target: Fix target_release_cmd_kref shutdown comp leak
        target: Avoid DataIN transfers for non-GOOD SAM status
        target/user: Report capability of handling out-of-order completions to userspace
        target/user: Fix size_t format-spec build warning
        target/user: Don't free expired command when time out
        target/user: Introduce data_bitmap, replace data_length/data_head/data_tail
        target/user: Free data ring in unified function
        target/user: Use iovec[] to describe continuous area
        target: Remove enum transport_lunflags_table
        target/iblock: pass WRITE_SAME to device if possible
        iser-target: Kill the ->isert_cmd back pointer in struct iser_tx_desc
        iser-target: Kill struct isert_rdma_wr
        iser-target: Convert to new CQ API
        iser-target: Split and properly type the login buffer
        iser-target: Remove ISER_RECV_DATA_SEG_LEN
        iser-target: Remove impossible condition from isert_wait_conn
        iser-target: Remove redundant wait in release_conn
        iser-target: Rework connection termination
        iser-target: Separate flows for np listeners and connections cma events
        iser-target: Add new state ISER_CONN_BOUND to isert_conn
        ...
      5266e5b1
    • Linus Torvalds's avatar
      Merge tag 'pci-v4.6-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci · fc739eba
      Linus Torvalds authored
      Pull PCI fixes from Bjorn Helgaas:
       "Here are two fixes for v4.6:
      
         - You merged a fix for a TI DRA7xx reset issue from another source,
           so Sekhar removed the "broken" tag from the driver, and
      
         - I botched a Kconfig merge and broke hotplug configuration for
           everybody, so Tero fixed that.
      
        Summary:
      
        TI DRA7xx host bridge driver:
          Revert "PCI: dra7xx: Mark driver as broken" (Sekhar Nori)
      
        Miscellaneous:
          Restore inclusion of pci/hotplug Kconfig (Tero Roponen)"
      
      * tag 'pci-v4.6-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
        Revert "PCI: dra7xx: Mark driver as broken"
        PCI: Restore inclusion of pci/hotplug Kconfig
      fc739eba
    • Linus Torvalds's avatar
      Merge tag 'sound-fix-4.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · 87cf815b
      Linus Torvalds authored
      Pull sound fixes from Takashi Iwai:
       "The previous pull request introduced a few WARN_ON() for Intel
        HD-audio HDMI.  Indeed it caught bugs, and now users get annoyed.  So
        this request came up: a collection of small fixes to paper over the
        inconsistencies on (mostly) old Intel chipsets.
      
        In addition, a trivial USB-audio quirk is included, too"
      
      * tag 'sound-fix-4.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
        ALSA: hda - Fix missing ELD update at unplugging
        ALSA: usb-audio: add Microsoft HD-5001 to quirks
        ALSA: hda - Workaround for unbalanced i915 power refcount by concurrent probe
        ALSA: hda - Fix spurious kernel WARNING on Baytrail HDMI
        ALSA: hda - Fix forgotten HDMI monitor_present update
        ALSA: hda - Really restrict i915 notifier to HSW+
      87cf815b
    • Linus Torvalds's avatar
      Merge tag 'iommu-updates-v4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu · b4af7f77
      Linus Torvalds authored
      Pull IOMMU updates from Joerg Roedel:
      
       - updates for the Exynos IOMMU driver to make use of default domains
         and to add support for the SYSMMU v5
      
       - new Mediatek IOMMU driver
      
       - support for the ARMv7 short descriptor format in the io-pgtable code
      
       - default domain support for the ARM SMMU
      
       - couple of other small fixes all over the place
      
      * tag 'iommu-updates-v4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: (41 commits)
        iommu/ipmmu-vmsa: Add r8a7795 DT binding
        iommu/mediatek: Check for NULL instead of IS_ERR()
        iommu/io-pgtable-armv7s: Fix kmem_cache_alloc() flags
        iommu/mediatek: Fix handling of of_count_phandle_with_args result
        iommu/dma: Fix NEED_SG_DMA_LENGTH dependency
        iommu/mediatek: Mark PM functions as __maybe_unused
        iommu/mediatek: Select ARM_DMA_USE_IOMMU
        iommu/exynos: Use proper readl/writel register interface
        iommu/exynos: Pointers are nto physical addresses
        dts: mt8173: Add iommu/smi nodes for mt8173
        iommu/mediatek: Add mt8173 IOMMU driver
        memory: mediatek: Add SMI driver
        dt-bindings: mediatek: Add smi dts binding
        dt-bindings: iommu: Add binding for mediatek IOMMU
        iommu/ipmmu-vmsa: Use ARCH_RENESAS
        iommu/exynos: Support multiple attach_device calls
        iommu/exynos: Add Maintainers entry for Exynos SYSMMU driver
        iommu/exynos: Add support for v5 SYSMMU
        iommu/exynos: Update device tree documentation
        iommu/exynos: Add support for SYSMMU controller with bogus version reg
        ...
      b4af7f77
    • Paolo Bonzini's avatar
      KVM: page_track: fix access to NULL slot · a6adb106
      Paolo Bonzini authored
      This happens when doing the reboot test from virt-tests:
      
      [  131.833653] BUG: unable to handle kernel NULL pointer dereference at           (null)
      [  131.842461] IP: [<ffffffffa0950087>] kvm_page_track_is_active+0x17/0x60 [kvm]
      [  131.850500] PGD 0
      [  131.852763] Oops: 0000 [#1] SMP
      [  132.007188] task: ffff880075fbc500 ti: ffff880850a3c000 task.ti: ffff880850a3c000
      [  132.138891] Call Trace:
      [  132.141639]  [<ffffffffa092bd11>] page_fault_handle_page_track+0x31/0x40 [kvm]
      [  132.149732]  [<ffffffffa093380f>] paging64_page_fault+0xff/0x910 [kvm]
      [  132.172159]  [<ffffffffa092c734>] kvm_mmu_page_fault+0x64/0x110 [kvm]
      [  132.179372]  [<ffffffffa06743c2>] handle_exception+0x1b2/0x430 [kvm_intel]
      [  132.187072]  [<ffffffffa067a301>] vmx_handle_exit+0x1e1/0xc50 [kvm_intel]
      ...
      
      Cc: Xiao Guangrong <guangrong.xiao@linux.intel.com>
      Fixes: 3d0c27adSigned-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      a6adb106
    • Paolo Bonzini's avatar
      KVM: PPC: do not compile in vfio.o unconditionally · 0af574be
      Paolo Bonzini authored
      Build on 32-bit PPC fails with the following error:
      
       int kvm_vfio_ops_init(void)
            ^
       In file included from arch/powerpc/kvm/../../../virt/kvm/vfio.c:21:0:
       arch/powerpc/kvm/../../../virt/kvm/vfio.h:8:90: note: previous definition of ‘kvm_vfio_ops_init’ was here
       arch/powerpc/kvm/../../../virt/kvm/vfio.c:292:6: error: redefinition of ‘kvm_vfio_ops_exit’
       void kvm_vfio_ops_exit(void)
                   ^
       In file included from arch/powerpc/kvm/../../../virt/kvm/vfio.c:21:0:
       arch/powerpc/kvm/../../../virt/kvm/vfio.h:12:91: note: previous definition of ‘kvm_vfio_ops_exit’ was here
       scripts/Makefile.build:258: recipe for target arch/powerpc/kvm/../../../virt/kvm/vfio.o failed
       make[3]: *** [arch/powerpc/kvm/../../../virt/kvm/vfio.o] Error 1
      
      Check whether CONFIG_KVM_VFIO is set before including vfio.o
      in the build.
      Reported-by: default avatarPranith Kumar <bobby.prani@gmail.com>
      Tested-by: default avatarPranith Kumar <bobby.prani@gmail.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      0af574be
    • Rik van Riel's avatar
      kvm, rt: change async pagefault code locking for PREEMPT_RT · 9db284f3
      Rik van Riel authored
      The async pagefault wake code can run from the idle task in exception
      context, so everything here needs to be made non-preemptible.
      
      Conversion to a simple wait queue and raw spinlock does the trick.
      Signed-off-by: default avatarRik van Riel <riel@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      9db284f3
    • Lan Tianyu's avatar
      KVM/PPC: update the comment of memory barrier in the kvmppc_prepare_to_enter() · 489153c7
      Lan Tianyu authored
      The barrier also orders the write to mode from any reads
      to the page tables done and so update the comment.
      Signed-off-by: default avatarLan Tianyu <tianyu.lan@intel.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      489153c7
    • Lan Tianyu's avatar
      KVM/x86: update the comment of memory barrier in the vcpu_enter_guest() · 0f127d12
      Lan Tianyu authored
      The barrier also orders the write to mode from any reads
      to the page tables done and so update the comment.
      Signed-off-by: default avatarLan Tianyu <tianyu.lan@intel.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      0f127d12
    • Lan Tianyu's avatar
      KVM: Replace smp_mb() with smp_load_acquire() in the kvm_flush_remote_tlbs() · 4ae3cb3a
      Lan Tianyu authored
      smp_load_acquire() is enough here and it's cheaper than smp_mb().
      Adding a comment about reusing memory barrier of kvm_make_all_cpus_request()
      here to keep order between modifications to the page tables and reading mode.
      Signed-off-by: default avatarLan Tianyu <tianyu.lan@intel.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      4ae3cb3a
    • Lan Tianyu's avatar
      KVM/x86: Call smp_wmb() before increasing tlbs_dirty · 7bfdf217
      Lan Tianyu authored
      Update spte before increasing tlbs_dirty to make sure no tlb flush
      in lost after spte is zapped. This pairs with the barrier in the
      kvm_flush_remote_tlbs().
      Signed-off-by: default avatarLan Tianyu <tianyu.lan@intel.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      7bfdf217
    • Lan Tianyu's avatar
    • Lan Tianyu's avatar
    • Lan Tianyu's avatar
      KVM: Remove redundant smp_mb() in the kvm_mmu_commit_zap_page() · 9753f529
      Lan Tianyu authored
      There is already a barrier inside of kvm_flush_remote_tlbs() which can
      help to make sure everyone sees our modifications to the page tables and
      see changes to vcpu->mode here. So remove the smp_mb in the
      kvm_mmu_commit_zap_page() and update the comment.
      Signed-off-by: default avatarLan Tianyu <tianyu.lan@intel.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      9753f529
    • Huaitong Han's avatar
      KVM, pkeys: expose CPUID/CR4 to guest · b9baba86
      Huaitong Han authored
      X86_FEATURE_PKU is referred to as "PKU" in the hardware documentation:
      CPUID.7.0.ECX[3]:PKU. X86_FEATURE_OSPKE is software support for pkeys,
      enumerated with CPUID.7.0.ECX[4]:OSPKE, and it reflects the setting of
      CR4.PKE(bit 22).
      
      This patch disables CPUID:PKU without ept, because pkeys is not yet
      implemented for shadow paging.
      Signed-off-by: default avatarHuaitong Han <huaitong.han@intel.com>
      Reviewed-by: default avatarXiao Guangrong <guangrong.xiao@linux.intel.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      b9baba86
    • Huaitong Han's avatar
      KVM, pkeys: add pkeys support for permission_fault · be94f6b7
      Huaitong Han authored
      Protection keys define a new 4-bit protection key field (PKEY) in bits
      62:59 of leaf entries of the page tables, the PKEY is an index to PKRU
      register(16 domains), every domain has 2 bits(write disable bit, access
      disable bit).
      
      Static logic has been produced in update_pkru_bitmask, dynamic logic need
      read pkey from page table entries, get pkru value, and deduce the correct
      result.
      
      [ Huaitong: Xiao helps to modify many sections. ]
      Signed-off-by: default avatarHuaitong Han <huaitong.han@intel.com>
      Signed-off-by: default avatarXiao Guangrong <guangrong.xiao@linux.intel.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      be94f6b7
    • Huaitong Han's avatar
      KVM, pkeys: introduce pkru_mask to cache conditions · 2d344105
      Huaitong Han authored
      PKEYS defines a new status bit in the PFEC. PFEC.PK (bit 5), if some
      conditions is true, the fault is considered as a PKU violation.
      pkru_mask indicates if we need to check PKRU.ADi and PKRU.WDi, and
      does cache some conditions for permission_fault.
      
      [ Huaitong: Xiao helps to modify many sections. ]
      Signed-off-by: default avatarHuaitong Han <huaitong.han@intel.com>
      Signed-off-by: default avatarXiao Guangrong <guangrong.xiao@linux.intel.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      2d344105
    • Xiao Guangrong's avatar
      KVM, pkeys: save/restore PKRU when guest/host switches · 1be0e61c
      Xiao Guangrong authored
      Currently XSAVE state of host is not restored after VM-exit and PKRU
      is managed by XSAVE so the PKRU from guest is still controlling the
      memory access even if the CPU is running the code of host. This is
      not safe as KVM needs to access the memory of userspace (e,g QEMU) to
      do some emulation.
      
      So we save/restore PKRU when guest/host switches.
      Signed-off-by: default avatarHuaitong Han <huaitong.han@intel.com>
      Signed-off-by: default avatarXiao Guangrong <guangrong.xiao@linux.intel.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      1be0e61c
    • Xiao Guangrong's avatar
      x86: pkey: introduce write_pkru() for KVM · 9e90199c
      Xiao Guangrong authored
      KVM will use it to switch pkru between guest and host.
      
      CC: Ingo Molnar <mingo@redhat.com>
      CC: Dave Hansen <dave.hansen@linux.intel.com>
      Signed-off-by: default avatarXiao Guangrong <guangrong.xiao@linux.intel.com>
      Signed-off-by: default avatarHuaitong Han <huaitong.han@intel.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      9e90199c
    • Huaitong Han's avatar
      KVM, pkeys: add pkeys support for xsave state · 17a511f8
      Huaitong Han authored
      This patch adds pkeys support for xsave state.
      Signed-off-by: default avatarHuaitong Han <huaitong.han@intel.com>
      Reviewed-by: default avatarXiao Guangrong <guangrong.xiao@linux.intel.com>
      Signed-off-by: default avatarXiao Guangrong <guangrong.xiao@linux.intel.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      17a511f8
    • Huaitong Han's avatar
      KVM, pkeys: disable pkeys for guests in non-paging mode · ddba2628
      Huaitong Han authored
      Pkeys is disabled if CPU is in non-paging mode in hardware. However KVM
      always uses paging mode to emulate guest non-paging, mode with TDP. To
      emulate this behavior, pkeys needs to be manually disabled when guest
      switches to non-paging mode.
      Signed-off-by: default avatarHuaitong Han <huaitong.han@intel.com>
      Reviewed-by: default avatarXiao Guangrong <guangrong.xiao@linux.intel.com>
      Signed-off-by: default avatarXiao Guangrong <guangrong.xiao@linux.intel.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      ddba2628
    • Huaitong Han's avatar
      KVM: x86: remove magic number with enum cpuid_leafs · e0b18ef7
      Huaitong Han authored
      This patch removes magic number with enum cpuid_leafs.
      Signed-off-by: default avatarHuaitong Han <huaitong.han@intel.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      e0b18ef7
    • Paolo Bonzini's avatar
      KVM: MMU: return page fault error code from permission_fault · f13577e8
      Paolo Bonzini authored
      This will help in the implementation of PKRU, where the PK bit of the page
      fault error code cannot be computed in advance (unlike I/D, R/W and U/S).
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      f13577e8
    • Sekhar Nori's avatar
      Revert "PCI: dra7xx: Mark driver as broken" · 9188269a
      Sekhar Nori authored
      Revert 5c3b99d0 ("PCI: dra7xx: Mark driver as broken").
      
      1c96bee4 ("ARM: DRA7: hwmod: Add custom reset handler for PCIeSS")
      added support to de-assert PCIe reset, so DRA7x PCIe is not broken anymore.
      Signed-off-by: default avatarSekhar Nori <nsekhar@ti.com>
      Signed-off-by: default avatarKishon Vijay Abraham I <kishon@ti.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      9188269a
    • Paolo Bonzini's avatar
      KVM: fix spin_lock_init order on x86 · e9ad4ec8
      Paolo Bonzini authored
      Moving the initialization earlier is needed in 4.6 because
      kvm_arch_init_vm is now using mmu_lock, causing lockdep to
      complain:
      
      [  284.440294] INFO: trying to register non-static key.
      [  284.445259] the code is fine but needs lockdep annotation.
      [  284.450736] turning off the locking correctness validator.
      ...
      [  284.528318]  [<ffffffff810aecc3>] lock_acquire+0xd3/0x240
      [  284.533733]  [<ffffffffa0305aa0>] ? kvm_page_track_register_notifier+0x20/0x60 [kvm]
      [  284.541467]  [<ffffffff81715581>] _raw_spin_lock+0x41/0x80
      [  284.546960]  [<ffffffffa0305aa0>] ? kvm_page_track_register_notifier+0x20/0x60 [kvm]
      [  284.554707]  [<ffffffffa0305aa0>] kvm_page_track_register_notifier+0x20/0x60 [kvm]
      [  284.562281]  [<ffffffffa02ece70>] kvm_mmu_init_vm+0x20/0x30 [kvm]
      [  284.568381]  [<ffffffffa02dbf7a>] kvm_arch_init_vm+0x1ea/0x200 [kvm]
      [  284.574740]  [<ffffffffa02bff3f>] kvm_dev_ioctl+0xbf/0x4d0 [kvm]
      
      However, it also helps fixing a preexisting problem, which is why this
      patch is also good for stable kernels: kvm_create_vm was incrementing
      current->mm->mm_count but not decrementing it at the out_err label (in
      case kvm_init_mmu_notifier failed).  The new initialization order makes
      it possible to add the required mmdrop without adding a new error label.
      
      Cc: stable@vger.kernel.org
      Reported-by: default avatarBorislav Petkov <bp@alien8.de>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      e9ad4ec8
    • Alexey Kardashevskiy's avatar
      KVM: PPC: Create a virtual-mode only TCE table handlers · 31217db7
      Alexey Kardashevskiy authored
      Upcoming in-kernel VFIO acceleration needs different handling in real
      and virtual modes which makes it hard to support both modes in
      the same handler.
      
      This creates a copy of kvmppc_rm_h_stuff_tce and kvmppc_rm_h_put_tce
      in addition to the existing kvmppc_rm_h_put_tce_indirect.
      
      This also fixes linker breakage when only PR KVM was selected (leaving
      HV KVM off): the kvmppc_h_put_tce/kvmppc_h_stuff_tce functions
      would not compile at all and the linked would fail.
      Signed-off-by: default avatarAlexey Kardashevskiy <aik@ozlabs.ru>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      31217db7
    • Paolo Bonzini's avatar
      KVM: VMX: fix nested vpid for old KVM guests · ef697a71
      Paolo Bonzini authored
      Old KVM guests invoke single-context invvpid without actually checking
      whether it is supported.  This was fixed by commit 518c8aee ("KVM: VMX:
      Make sure single type invvpid is supported before issuing invvpid
      instruction", 2010-08-01) and the patch after, but pre-2.6.36
      kernels lack it including RHEL 6.
      
      Reported-by: jmontleo@redhat.com
      Tested-by: jmontleo@redhat.com
      Cc: stable@vger.kernel.org
      Fixes: 99b83ac8Reviewed-by: default avatarDavid Matlack <dmatlack@google.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      ef697a71
    • Paolo Bonzini's avatar
      KVM: VMX: avoid guest hang on invalid invvpid instruction · f6870ee9
      Paolo Bonzini authored
      A guest executing an invalid invvpid instruction would hang
      because the instruction pointer was not updated.
      
      Reported-by: jmontleo@redhat.com
      Tested-by: jmontleo@redhat.com
      Cc: stable@vger.kernel.org
      Fixes: 99b83ac8Reviewed-by: default avatarDavid Matlack <dmatlack@google.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      f6870ee9
    • Paolo Bonzini's avatar
      KVM: VMX: avoid guest hang on invalid invept instruction · 2849eb4f
      Paolo Bonzini authored
      A guest executing an invalid invept instruction would hang
      because the instruction pointer was not updated.
      
      Cc: stable@vger.kernel.org
      Fixes: bfd0a56bReviewed-by: default avatarDavid Matlack <dmatlack@google.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      2849eb4f
    • Paolo Bonzini's avatar
      Merge tag 'kvm-arm-for-4.6-rc1' of... · a4717218
      Paolo Bonzini authored
      Merge tag 'kvm-arm-for-4.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD
      
      KVM/ARM Changes for v4.6-rc1
      
      Second round of patches for v4.6-rc1, fixing a small handful of issue:
       - disable preemption when calling smp_call_function_many
       - Make kvm_ksym_ref work on VHE systems again after KASRL breakage
       - Disable compiler instrumentation for hypervisor code that could make
         KVM/arm64 blow up.
      a4717218
    • Himanshu Madhani's avatar
      target: Fix target_release_cmd_kref shutdown comp leak · 5e47f198
      Himanshu Madhani authored
      This patch fixes an active I/O shutdown bug for fabric
      drivers using target_wait_for_sess_cmds(), where se_cmd
      descriptor shutdown would result in hung tasks waiting
      indefinitely for se_cmd->cmd_wait_comp to complete().
      
      To address this bug, drop the incorrect list_del_init()
      usage in target_wait_for_sess_cmds() and always complete()
      during se_cmd target_release_cmd_kref() put, in order to
      let caller invoke the final fabric release callback
      into se_cmd->se_tfo->release_cmd() code.
      Reported-by: default avatarHimanshu Madhani <himanshu.madhani@qlogic.com>
      Tested-by: default avatarHimanshu Madhani <himanshu.madhani@qlogic.com>
      Signed-off-by: default avatarHimanshu Madhani <himanshu.madhani@qlogic.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      5e47f198
    • Linus Torvalds's avatar
      Merge branch 'for-linus-4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs · 968f3e37
      Linus Torvalds authored
      Pull btrfs updates from Chris Mason:
       "We have a good sized cleanup of our internal read ahead code, and the
        first series of commits from Chandan to enable PAGE_SIZE > sectorsize
      
        Otherwise, it's a normal series of cleanups and fixes, with many
        thanks to Dave Sterba for doing most of the patch wrangling this time"
      
      * 'for-linus-4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs: (82 commits)
        btrfs: make sure we stay inside the bvec during __btrfs_lookup_bio_sums
        btrfs: Fix misspellings in comments.
        btrfs: Print Warning only if ENOSPC_DEBUG is enabled
        btrfs: scrub: silence an uninitialized variable warning
        btrfs: move btrfs_compression_type to compression.h
        btrfs: rename btrfs_print_info to btrfs_print_mod_info
        Btrfs: Show a warning message if one of objectid reaches its highest value
        Documentation: btrfs: remove usage specific information
        btrfs: use kbasename in btrfsic_mount
        Btrfs: do not collect ordered extents when logging that inode exists
        Btrfs: fix race when checking if we can skip fsync'ing an inode
        Btrfs: fix listxattrs not listing all xattrs packed in the same item
        Btrfs: fix deadlock between direct IO reads and buffered writes
        Btrfs: fix extent_same allowing destination offset beyond i_size
        Btrfs: fix file loss on log replay after renaming a file and fsync
        Btrfs: fix unreplayable log after snapshot delete + parent dir fsync
        Btrfs: fix lockdep deadlock warning due to dev_replace
        btrfs: drop unused argument in btrfs_ioctl_get_supported_features
        btrfs: add GET_SUPPORTED_FEATURES to the control device ioctls
        btrfs: change max_inline default to 2048
        ...
      968f3e37
  2. 21 Mar, 2016 1 commit
    • Linus Torvalds's avatar
      Merge tag 'mmc-v4.6' of git://git.linaro.org/people/ulf.hansson/mmc · e531cdf5
      Linus Torvalds authored
      Pull MMC updates from Ulf Hansson:
       "MMC core:
            - Fix ABI regression of MMC BLK ioctl
            - Remove the unused MMC_DATA_STREAM flag
            - Enable asynchronous system PM for the host device
            - Minor fixes and clean-ups
      
        SDHCI host:
           Throughout the years, the numbers of SDHCI variants have increased
           and so has also the numbers of SDHCI callbacks/quirks.  The purpose
           of these callbacks/quirks were to enable SDHCI to deal with variant
           specific requirements, but unfortunate this method didn't scale.
           Instead we have ended up with a mess.  Not only did the code become
           suboptimal but also highly fragile.
      
           Lately many discussions of how to move forward with SDHCI has taken
           place at the MMC mailing list.  Step by step, we aim to turn
           SDHCI's common code into a set of library functions.  This will
           enable for optimizations and allow some of the existing callbacks
           and quirks to be removed, which also should help to make the code
           less fragile.
      
           Therefore I am also really pleased to announce that Adrian Hunter
           (Intel) has volunteered to step in as the maintainer for SDHCI.
      
           Future wise, I hope the community around SDHCI will continue to
           grow and that this release cycle can be the starting point of
           moving SDHCI into a better shape.  As a matter of fact, already in
           this cycle the re-factoring has begun, but of course there are also
           fixes and new features included.  Some highlights:
      
            - sdhci-iproc: Add support for Broadcom's BCM2835 eMMC IP
            - sdhci-acpi: Add support for QCOM controllers
            - sdhci-pic32: Add new SDHCI variant for PIC32MZDA
      
        Other hosts:
            - atmel-mci: Fix a NULL pointer dereference
            - mediatek: Add SD write-protect support
            - mmc_spi: Fix card detect in GPIO case
            - tmio/sdhi: Add r8a7795 support
            - tmio/sdhi: Some fixes and clean-ups
            - dw_mmc: Add HW reset support
            - dw_mmc: Some fixes and clean-ups
            - sunxi: Add support for MMC DDR52 mode"
      
      * tag 'mmc-v4.6' of git://git.linaro.org/people/ulf.hansson/mmc: (123 commits)
        mmc: sdhci-of-at91: fix wake-up issue when using runtime pm
        mmc: sdhci-pci: Do not set DMA mask in enable_dma()
        mmc: sdhci-acpi: Remove enable_dma() hook
        mmc: sdhci: Set DMA mask when adding host
        mmc: block: fix ABI regression of mmc_blk_ioctl
        mmc: atmel-mci: Check pdata for NULL before dereferencing it at DMA config
        mmc: core: remove redundant memset of sdio_read_cccr
        mmc: core: remove redundant memset of mmc_decode_cid
        mmc: of_mmc_spi: fix unused warning
        mmc: sdhci-of-arasan: add phy support for sdhci-of-arasan
        mmc: sdhci-of-arasan: fix missing sdhci_pltfm_free for err handling
        mmc: sdhci-of-arasan: remove disable clk_ahb from sdhci_arasan_resume
        Documentation: bindings: add description of phy for sdhci-of-arasan
        mmc: sdhci: Fix override of timeout clk wrt max_busy_timeout
        mmc: mmci: Remove unnecessary header file
        mmc: sdhci-acpi: add QCOM controllers
        mmc: tegra: implement memcomp pad calibration
        mmc: mediatek: Use mmc_regulator_set_vqmmc in start_signal_voltage_switch
        mmc: mediatek: Change signal voltage error to dev_dbg()
        mmc: sh_mmcif, tmio: Use ARCH_RENESAS
        ...
      e531cdf5