1. 01 Apr, 2017 1 commit
  2. 30 Mar, 2017 2 commits
    • Changbin Du's avatar
      drm/i915/gvt: exclude cfg space from failsafe mode · f8572690
      Changbin Du authored
      When test GVTg as below scenario:
        VM boot --> failsafe --> kill qemu --> VM boot.
      Qemu report error at the second boot:
        ERROR: PCI region size must be pow2 type=0x0, size=0x1fa1000
      
      Qemu need access PCI_ROM_ADDRESS reg to determine the size of expansion
      PCI rom. The mechanism just like the BAR reg (write-read) and we should
      return the size 0 since we have no rom. If we reject the write to
      PCI_ROM_ADDRESS, Qemu cannot get the correct size of rom.
      
      Essentially, GVTg failsafe mode should not break PCI function. So we
      exclude cfg space from failsafe mode. This can fix above issue.
      
      v2: add Fixes and Bugzilla link.
      
      Fixes: fd64be63 ("drm/i915/gvt: introduced failsafe mode into vgpu")
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100296Signed-off-by: default avatarChangbin Du <changbin.du@intel.com>
      Signed-off-by: default avatarZhenyu Wang <zhenyuw@linux.intel.com>
      f8572690
    • Zhi Wang's avatar
      drm/i915/gvt: Activate/de-activate vGPU in mdev ops. · b79c52ae
      Zhi Wang authored
      This patch introduces two functions for activating/de-activating vGPU in
      mdev ops.
      
      A racing condition was found between virtual vblank emulation and KVGMT
      mdev release path. V-blank emulation will emulate and inject V-blank
      interrupt for every active vGPU with holding gvt->lock, while in mdev
      release path, it will directly release hypervisor handle without changing
      vGPU status or taking gvt->lock, so a kernel oops is encountered when
      vblank emulation is injecting a interrupt with a invalid hypervisor
      handle. (Reported by Terrence)
      
      To solve this problem, we factor out vGPU activation/de-activation from
      vGPU creation/destruction path and let KVMGT mdev release ops de-activate
      the vGPU before release hypervisor handle. Once a vGPU is de-activated,
      GVT-g will not emulate v-blank for it or touch the hypervisor handle.
      
      Fixes: 659643f7 ("drm/i915/gvt/kvmgt: add vfio/mdev support to KVMGT")
      Signed-off-by: default avatarZhi Wang <zhi.a.wang@intel.com>
      Signed-off-by: default avatarZhenyu Wang <zhenyuw@linux.intel.com>
      b79c52ae
  3. 22 Mar, 2017 1 commit
    • Changbin Du's avatar
      drm/i915/gvt: Use force single submit flag to distinguish gvt request from i915 request · bc2d4b62
      Changbin Du authored
      In my previous Commit ab9da627906a ("drm/i915: make context status
      notifier head be per engine") rely on scheduler->current_workload[x]
      to distinguish gvt spacial request from i915 request. But this is
      not always true since no synchronization between workload_thread and
      lrc irq handler.
      
          lrc irq handler               workload_thread
               ----                          ----
        pick i915 requests;
                                      intel_vgpu_submit_execlist();
                                      current_workload[x] = xxx;
        shadow_context_status_change();
      
      Then current_workload[x] is not null but current request is of i915 self.
      So instead we check ctx flag CONTEXT_FORCE_SINGLE_SUBMISSION. Only gvt
      request set this flag and always set.
      
      v2: Reverse the order of multi-condition 'if' statement.
      
      Fixes: ab9da6279 ("drm/i915: make context status notifier head be per engine")
      Signed-off-by: default avatarChangbin Du <changbin.du@intel.com>
      Reviewed-by: default avatarYulei Zhang <yulei.zhang@intel.com>
      Signed-off-by: default avatarZhenyu Wang <zhenyuw@linux.intel.com>
      bc2d4b62
  4. 21 Mar, 2017 3 commits
  5. 20 Mar, 2017 2 commits
    • Pei Zhang's avatar
      drm/i915/gvt: add write handler for mmio mbctl · 975629c3
      Pei Zhang authored
      Guest will write mmio mbctl which need a special handler in gvt to
      clear the bit 4 to inidcate the write operation success.
      
      V2: use bit definition macro to make code readable.
      Signed-off-by: default avatarPei Zhang <pei.zhang@intel.com>
      Signed-off-by: default avatarZhenyu Wang <zhenyuw@linux.intel.com>
      975629c3
    • Alex Williamson's avatar
      drm/i915/kvmgt: Hold struct kvm reference · 93a15b58
      Alex Williamson authored
      The kvmgt code keeps a pointer to the struct kvm associated with the
      device, but doesn't actually hold a reference to it.  If we do unclean
      shutdown testing (ie. killing the user process), then we can see the
      kvm association to the device unset, which causes kvmgt to trigger a
      device release via a work queue.  Naturally we cannot guarantee that
      the cached struct kvm pointer is still valid at this point without
      holding a reference.  The observed failure in this case is a stuck
      cpu trying to acquire the spinlock from the invalid reference, but
      other failure modes are clearly possible.  Hold a reference to avoid
      this.
      Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
      Cc: stable@vger.kernel.org #v4.10
      Cc: Jike Song <jike.song@intel.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
      Cc: Zhi Wang <zhi.a.wang@intel.com>
      Reviewed-by: default avatarJike Song <jike.song@intel.com>
      Signed-off-by: default avatarZhenyu Wang <zhenyuw@linux.intel.com>
      93a15b58
  6. 17 Mar, 2017 9 commits
  7. 13 Mar, 2017 3 commits
  8. 09 Mar, 2017 11 commits
  9. 08 Mar, 2017 3 commits
  10. 06 Mar, 2017 2 commits
    • Changbin Du's avatar
      drm/i915/gvt: protect RO and Rsvd bits of virtual vgpu configuration space · c2e04fda
      Changbin Du authored
      Per PCI specification, Configuration Register has different types (RO,
      RW, RW1C, Rsvd). For RO Register bits are read-only and cannot be
      altered by software. For RW1C Register bits indicate status when read.
      A Set bit indicates a status event which is Cleared by writing a 1b.
      Writing a 0b to RW1C bits has no effect. Reserved Register is for future
      implementations, and they are read-only and must return zero when read.
      
      Current vGPU configuration write emulation just copy the value as it is.
      So we haven't emulated RO, RW1C and Rsvd Registers correctly. This patch
      is following the Spec to correct emulation logic. We add a function
      vgpu_cfg_mem_write to wrap the access to vGPU configuration memory.
      The write function uses a RW Register bitmap to avoid RO bits be
      overwritten, and emulate RW1C behavior for the particular status Register.
      
      v2:
        new = src[i] --> new = src[i] & mask (zhenyu)
      Signed-off-by: default avatarChangbin Du <changbin.du@intel.com>
      Cc: Xiaoguang Chen <xiaoguang.chen@intel.com>
      Cc: Zhiyuan Lv <zhiyuan.lv@intel.com>
      Cc: Min He <min.he@intel.com>
      Reviewed-by: default avatarZhenyu Wang <zhenyuw@linux.intel.com>
      Signed-off-by: default avatarZhenyu Wang <zhenyuw@linux.intel.com>
      c2e04fda
    • Chuanxiao Dong's avatar
      drm/i915/gvt: handle workload lifecycle properly · 8f1117ab
      Chuanxiao Dong authored
      Currently i915 has a request replay mechanism which can make sure
      the request can be replayed after a GPU reset. With this mechanism,
      gvt should wait until the GVT request seqno passed before complete
      the current workload. So that there should be a context switch interrupt
      come before gvt free the workload. In this way, workload lifecylce
      matches with the i915 request lifecycle. The workload can only be freed
      after the request is completed.
      
      v2: use gvt_dbg_sched instead of gvt_err to print when wait again
      Signed-off-by: default avatarChuanxiao Dong <chuanxiao.dong@intel.com>
      Signed-off-by: default avatarZhenyu Wang <zhenyuw@linux.intel.com>
      8f1117ab
  11. 05 Mar, 2017 2 commits
    • Linus Torvalds's avatar
      Linux 4.11-rc1 · c1ae3cfa
      Linus Torvalds authored
      c1ae3cfa
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 8d70eeb8
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) Fix double-free in batman-adv, from Sven Eckelmann.
      
       2) Fix packet stats for fast-RX path, from Joannes Berg.
      
       3) Netfilter's ip_route_me_harder() doesn't handle request sockets
          properly, fix from Florian Westphal.
      
       4) Fix sendmsg deadlock in rxrpc, from David Howells.
      
       5) Add missing RCU locking to transport hashtable scan, from Xin Long.
      
       6) Fix potential packet loss in mlxsw driver, from Ido Schimmel.
      
       7) Fix race in NAPI handling between poll handlers and busy polling,
          from Eric Dumazet.
      
       8) TX path in vxlan and geneve need proper RCU locking, from Jakub
          Kicinski.
      
       9) SYN processing in DCCP and TCP need to disable BH, from Eric
          Dumazet.
      
      10) Properly handle net_enable_timestamp() being invoked from IRQ
          context, also from Eric Dumazet.
      
      11) Fix crash on device-tree systems in xgene driver, from Alban Bedel.
      
      12) Do not call sk_free() on a locked socket, from Arnaldo Carvalho de
          Melo.
      
      13) Fix use-after-free in netvsc driver, from Dexuan Cui.
      
      14) Fix max MTU setting in bonding driver, from WANG Cong.
      
      15) xen-netback hash table can be allocated from softirq context, so use
          GFP_ATOMIC. From Anoob Soman.
      
      16) Fix MAC address change bug in bgmac driver, from Hari Vyas.
      
      17) strparser needs to destroy strp_wq on module exit, from WANG Cong.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (69 commits)
        strparser: destroy workqueue on module exit
        sfc: fix IPID endianness in TSOv2
        sfc: avoid max() in array size
        rds: remove unnecessary returned value check
        rxrpc: Fix potential NULL-pointer exception
        nfp: correct DMA direction in XDP DMA sync
        nfp: don't tell FW about the reserved buffer space
        net: ethernet: bgmac: mac address change bug
        net: ethernet: bgmac: init sequence bug
        xen-netback: don't vfree() queues under spinlock
        xen-netback: keep a local pointer for vif in backend_disconnect()
        netfilter: nf_tables: don't call nfnetlink_set_err() if nfnetlink_send() fails
        netfilter: nft_set_rbtree: incorrect assumption on lower interval lookups
        netfilter: nf_conntrack_sip: fix wrong memory initialisation
        can: flexcan: fix typo in comment
        can: usb_8dev: Fix memory leak of priv->cmd_msg_buffer
        can: gs_usb: fix coding style
        can: gs_usb: Don't use stack memory for USB transfers
        ixgbe: Limit use of 2K buffers on architectures with 256B or larger cache lines
        ixgbe: update the rss key on h/w, when ethtool ask for it
        ...
      8d70eeb8
  12. 04 Mar, 2017 1 commit
    • Linus Torvalds's avatar
      Merge tag 'kvm-4.11-2' of git://git.kernel.org/pub/scm/virt/kvm/kvm · 2d62e076
      Linus Torvalds authored
      Pull more KVM updates from Radim Krčmář:
       "Second batch of KVM changes for the 4.11 merge window:
      
        PPC:
         - correct assumption about ASDR on POWER9
         - fix MMIO emulation on POWER9
      
        x86:
         - add a simple test for ioperm
         - cleanup TSS (going through KVM tree as the whole undertaking was
           caused by VMX's use of TSS)
         - fix nVMX interrupt delivery
         - fix some performance counters in the guest
      
        ... and two cleanup patches"
      
      * tag 'kvm-4.11-2' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
        KVM: nVMX: Fix pending events injection
        x86/kvm/vmx: remove unused variable in segment_base()
        selftests/x86: Add a basic selftest for ioperm
        x86/asm: Tidy up TSS limit code
        kvm: convert kvm.users_count from atomic_t to refcount_t
        KVM: x86: never specify a sample period for virtualized in_tx_cp counters
        KVM: PPC: Book3S HV: Don't use ASDR for real-mode HPT faults on POWER9
        KVM: PPC: Book3S HV: Fix software walk of guest process page tables
      2d62e076