1. 05 Jan, 2023 1 commit
  2. 04 Jan, 2023 5 commits
    • Zheng Wang's avatar
      drm/i915/gvt: fix double free bug in split_2MB_gtt_entry · 4a61648a
      Zheng Wang authored
      If intel_gvt_dma_map_guest_page failed, it will call
      ppgtt_invalidate_spt, which will finally free the spt.
      But the caller function ppgtt_populate_spt_by_guest_entry
      does not notice that, it will free spt again in its error
      path.
      
      Fix this by canceling the mapping of DMA address and freeing sub_spt.
      Besides, leave the handle of spt destroy to caller function instead
      of callee function when error occurs.
      
      Fixes: b901b252 ("drm/i915/gvt: Add 2M huge gtt support")
      Signed-off-by: default avatarZheng Wang <zyytlz.wz@163.com>
      Reviewed-by: default avatarZhenyu Wang <zhenyuw@linux.intel.com>
      Signed-off-by: default avatarZhenyu Wang <zhenyuw@linux.intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20221229165641.1192455-1-zyytlz.wz@163.com
      4a61648a
    • Zhi Wang's avatar
      drm/i915/gvt: use atomic operations to change the vGPU status · a06d4b9e
      Zhi Wang authored
      Several vGPU status are used to decide the availability of GVT-g core
      logics when creating a vGPU. Use atomic operations on changing the vGPU
      status to avoid the racing.
      
      Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
      Cc: Kevin Tian <kevin.tian@intel.com>
      Cc: Jason Gunthorpe <jgg@nvidia.com>
      Cc: intel-gvt-dev@lists.freedesktop.org
      Suggested-by: default avatarAlex Williamson <alex.williamson@redhat.com>
      Signed-off-by: default avatarZhi Wang <zhi.a.wang@intel.com>
      Reviewed-by: default avatarZhenyu Wang <zhenyuw@linux.intel.com>
      Reviewed-by: default avatarKevin Tian <kevin.tian@intel.com>
      Signed-off-by: default avatarZhenyu Wang <zhenyuw@linux.intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20221110122034.3382-2-zhi.a.wang@intel.com
      a06d4b9e
    • Zhenyu Wang's avatar
      drm/i915/gvt: fix vgpu debugfs clean in remove · 704f3384
      Zhenyu Wang authored
      Check carefully on root debugfs available when destroying vgpu,
      e.g in remove case drm minor's debugfs root might already be destroyed,
      which led to kernel oops like below.
      
      Console: switching to colour dummy device 80x25
      i915 0000:00:02.0: MDEV: Unregistering
      intel_vgpu_mdev b1338b2d-a709-4c23-b766-cc436c36cdf0: Removing from iommu group 14
      BUG: kernel NULL pointer dereference, address: 0000000000000150
      PGD 0 P4D 0
      Oops: 0000 [#1] PREEMPT SMP
      CPU: 3 PID: 1046 Comm: driverctl Not tainted 6.1.0-rc2+ #6
      Hardware name: HP HP ProDesk 600 G3 MT/829D, BIOS P02 Ver. 02.44 09/13/2022
      RIP: 0010:__lock_acquire+0x5e2/0x1f90
      Code: 87 ad 09 00 00 39 05 e1 1e cc 02 0f 82 f1 09 00 00 ba 01 00 00 00 48 83 c4 48 89 d0 5b 5d 41 5c 41 5d 41 5e 41 5f c3 45 31 ff <48> 81 3f 60 9e c2 b6 45 0f 45 f8 83 fe 01 0f 87 55 fa ff ff 89 f0
      RSP: 0018:ffff9f770274f948 EFLAGS: 00010046
      RAX: 0000000000000003 RBX: 0000000000000000 RCX: 0000000000000000
      RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000150
      RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000000000000
      R10: ffff8895d1173300 R11: 0000000000000001 R12: 0000000000000000
      R13: 0000000000000150 R14: 0000000000000000 R15: 0000000000000000
      FS:  00007fc9b2ba0740(0000) GS:ffff889cdfcc0000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 0000000000000150 CR3: 000000010fd93005 CR4: 00000000003706e0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      Call Trace:
       <TASK>
       lock_acquire+0xbf/0x2b0
       ? simple_recursive_removal+0xa5/0x2b0
       ? lock_release+0x13d/0x2d0
       down_write+0x2a/0xd0
       ? simple_recursive_removal+0xa5/0x2b0
       simple_recursive_removal+0xa5/0x2b0
       ? start_creating.part.0+0x110/0x110
       ? _raw_spin_unlock+0x29/0x40
       debugfs_remove+0x40/0x60
       intel_gvt_debugfs_remove_vgpu+0x15/0x30 [kvmgt]
       intel_gvt_destroy_vgpu+0x60/0x100 [kvmgt]
       intel_vgpu_release_dev+0xe/0x20 [kvmgt]
       device_release+0x30/0x80
       kobject_put+0x79/0x1b0
       device_release_driver_internal+0x1b8/0x230
       bus_remove_device+0xec/0x160
       device_del+0x189/0x400
       ? up_write+0x9c/0x1b0
       ? mdev_device_remove_common+0x60/0x60 [mdev]
       mdev_device_remove_common+0x22/0x60 [mdev]
       mdev_device_remove_cb+0x17/0x20 [mdev]
       device_for_each_child+0x56/0x80
       mdev_unregister_parent+0x5a/0x81 [mdev]
       intel_gvt_clean_device+0x2d/0xe0 [kvmgt]
       intel_gvt_driver_remove+0x2e/0xb0 [i915]
       i915_driver_remove+0xac/0x100 [i915]
       i915_pci_remove+0x1a/0x30 [i915]
       pci_device_remove+0x31/0xa0
       device_release_driver_internal+0x1b8/0x230
       unbind_store+0xd8/0x100
       kernfs_fop_write_iter+0x156/0x210
       vfs_write+0x236/0x4a0
       ksys_write+0x61/0xd0
       do_syscall_64+0x55/0x80
       ? find_held_lock+0x2b/0x80
       ? lock_release+0x13d/0x2d0
       ? up_read+0x17/0x20
       ? lock_is_held_type+0xe3/0x140
       ? asm_exc_page_fault+0x22/0x30
       ? lockdep_hardirqs_on+0x7d/0x100
       entry_SYSCALL_64_after_hwframe+0x46/0xb0
      RIP: 0033:0x7fc9b2c9e0c4
      Code: 15 71 7d 0d 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b7 0f 1f 00 f3 0f 1e fa 80 3d 3d 05 0e 00 00 74 13 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 54 c3 0f 1f 00 48 83 ec 28 48 89 54 24 18 48
      RSP: 002b:00007ffec29c81c8 EFLAGS: 00000202 ORIG_RAX: 0000000000000001
      RAX: ffffffffffffffda RBX: 000000000000000d RCX: 00007fc9b2c9e0c4
      RDX: 000000000000000d RSI: 0000559f8b5f48a0 RDI: 0000000000000001
      RBP: 0000559f8b5f48a0 R08: 0000559f8b5f3540 R09: 00007fc9b2d76d30
      R10: 0000000000000000 R11: 0000000000000202 R12: 000000000000000d
      R13: 00007fc9b2d77780 R14: 000000000000000d R15: 00007fc9b2d72a00
       </TASK>
      Modules linked in: sunrpc intel_rapl_msr intel_rapl_common intel_pmc_core_pltdrv intel_pmc_core intel_tcc_cooling x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel ee1004 igbvf rapl vfat fat intel_cstate intel_uncore pktcdvd i2c_i801 pcspkr wmi_bmof i2c_smbus acpi_pad vfio_pci vfio_pci_core vfio_virqfd zram fuse dm_multipath kvmgt mdev vfio_iommu_type1 vfio kvm irqbypass i915 nvme e1000e igb nvme_core crct10dif_pclmul crc32_pclmul crc32c_intel polyval_clmulni polyval_generic serio_raw ghash_clmulni_intel sha512_ssse3 dca drm_buddy intel_gtt video wmi drm_display_helper ttm
      CR2: 0000000000000150
      ---[ end trace 0000000000000000 ]---
      
      Cc: Wang Zhi <zhi.a.wang@intel.com>
      Cc: He Yu <yu.he@intel.com>
      Cc: Alex Williamson <alex.williamson@redhat.com>
      Cc: stable@vger.kernel.org
      Reviewed-by: default avatarZhi Wang <zhi.a.wang@intel.com>
      Tested-by: default avatarYu He <yu.he@intel.com>
      Fixes: bc7b0be3 ("drm/i915/gvt: Add basic debugfs infrastructure")
      Signed-off-by: default avatarZhenyu Wang <zhenyuw@linux.intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20221219140357.769557-2-zhenyuw@linux.intel.com
      704f3384
    • Zhenyu Wang's avatar
      drm/i915/gvt: fix gvt debugfs destroy · c4b850d1
      Zhenyu Wang authored
      When gvt debug fs is destroyed, need to have a sane check if drm
      minor's debugfs root is still available or not, otherwise in case like
      device remove through unbinding, drm minor's debugfs directory has
      already been removed, then intel_gvt_debugfs_clean() would act upon
      dangling pointer like below oops.
      
      i915 0000:00:02.0: Direct firmware load for i915/gvt/vid_0x8086_did_0x1926_rid_0x0a.golden_hw_state failed with error -2
      i915 0000:00:02.0: MDEV: Registered
      Console: switching to colour dummy device 80x25
      i915 0000:00:02.0: MDEV: Unregistering
      BUG: kernel NULL pointer dereference, address: 00000000000000a0
      PGD 0 P4D 0
      Oops: 0002 [#1] PREEMPT SMP PTI
      CPU: 2 PID: 2486 Comm: gfx-unbind.sh Tainted: G          I        6.1.0-rc8+ #15
      Hardware name: Dell Inc. XPS 13 9350/0JXC1H, BIOS 1.13.0 02/10/2020
      RIP: 0010:down_write+0x1f/0x90
      Code: 1d ff ff 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 53 48 89 fb e8 62 c0 ff ff bf 01 00 00 00 e8 28 5e 31 ff 31 c0 ba 01 00 00 00 <f0> 48 0f b1 13 75 33 65 48 8b 04 25 c0 bd 01 00 48 89 43 08 bf 01
      RSP: 0018:ffff9eb3036ffcc8 EFLAGS: 00010246
      RAX: 0000000000000000 RBX: 00000000000000a0 RCX: ffffff8100000000
      RDX: 0000000000000001 RSI: 0000000000000064 RDI: ffffffffa48787a8
      RBP: ffff9eb3036ffd30 R08: ffffeb1fc45a0608 R09: ffffeb1fc45a05c0
      R10: 0000000000000002 R11: 0000000000000000 R12: 0000000000000000
      R13: ffff91acc33fa328 R14: ffff91acc033f080 R15: ffff91acced533e0
      FS:  00007f6947bba740(0000) GS:ffff91ae36d00000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 00000000000000a0 CR3: 00000001133a2002 CR4: 00000000003706e0
      Call Trace:
       <TASK>
       simple_recursive_removal+0x9f/0x2a0
       ? start_creating.part.0+0x120/0x120
       ? _raw_spin_lock+0x13/0x40
       debugfs_remove+0x40/0x60
       intel_gvt_debugfs_clean+0x15/0x30 [kvmgt]
       intel_gvt_clean_device+0x49/0xe0 [kvmgt]
       intel_gvt_driver_remove+0x2f/0xb0
       i915_driver_remove+0xa4/0xf0
       i915_pci_remove+0x1a/0x30
       pci_device_remove+0x33/0xa0
       device_release_driver_internal+0x1b2/0x230
       unbind_store+0xe0/0x110
       kernfs_fop_write_iter+0x11b/0x1f0
       vfs_write+0x203/0x3d0
       ksys_write+0x63/0xe0
       do_syscall_64+0x37/0x90
       entry_SYSCALL_64_after_hwframe+0x63/0xcd
      RIP: 0033:0x7f6947cb5190
      Code: 40 00 48 8b 15 71 9c 0d 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b7 0f 1f 00 80 3d 51 24 0e 00 00 74 17 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 58 c3 0f 1f 80 00 00 00 00 48 83 ec 28 48 89
      RSP: 002b:00007ffcbac45a28 EFLAGS: 00000202 ORIG_RAX: 0000000000000001
      RAX: ffffffffffffffda RBX: 000000000000000d RCX: 00007f6947cb5190
      RDX: 000000000000000d RSI: 0000555e35c866a0 RDI: 0000000000000001
      RBP: 0000555e35c866a0 R08: 0000000000000002 R09: 0000555e358cb97c
      R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000001
      R13: 000000000000000d R14: 0000000000000000 R15: 0000555e358cb8e0
       </TASK>
      Modules linked in: kvmgt
      CR2: 00000000000000a0
      ---[ end trace 0000000000000000 ]---
      
      Cc: Wang, Zhi <zhi.a.wang@intel.com>
      Cc: He, Yu <yu.he@intel.com>
      Cc: stable@vger.kernel.org
      Reviewed-by: default avatarZhi Wang <zhi.a.wang@intel.com>
      Fixes: bc7b0be3 ("drm/i915/gvt: Add basic debugfs infrastructure")
      Signed-off-by: default avatarZhenyu Wang <zhenyuw@linux.intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20221219140357.769557-1-zhenyuw@linux.intel.com
      c4b850d1
    • Dan Carpenter's avatar
      drm/i915: unpin on error in intel_vgpu_shadow_mm_pin() · 3792fc50
      Dan Carpenter authored
      Call intel_vgpu_unpin_mm() on this error path.
      
      Fixes: 41874148 ("drm/i915/gvt: Adding ppgtt to GVT GEM context after shadow pdps settled.")
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarZhenyu Wang <zhenyuw@linux.intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/Y3OQ5tgZIVxyQ/WV@kiliReviewed-by: default avatarZhenyu Wang <zhenyuw@linux.intel.com>
      3792fc50
  3. 01 Jan, 2023 6 commits
  4. 31 Dec, 2022 2 commits
  5. 30 Dec, 2022 19 commits
  6. 29 Dec, 2022 3 commits
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm · 2258c2dc
      Linus Torvalds authored
      Pull kvm fixes from Paolo Bonzini:
       "Changes that were posted too late for 6.1, or after the release.
      
        x86:
      
         - several fixes to nested VMX execution controls
      
         - fixes and clarification to the documentation for Xen emulation
      
         - do not unnecessarily release a pmu event with zero period
      
         - MMU fixes
      
         - fix Coverity warning in kvm_hv_flush_tlb()
      
        selftests:
      
         - fixes for the ucall mechanism in selftests
      
         - other fixes mostly related to compilation with clang"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (41 commits)
        KVM: selftests: restore special vmmcall code layout needed by the harness
        Documentation: kvm: clarify SRCU locking order
        KVM: x86: fix deadlock for KVM_XEN_EVTCHN_RESET
        KVM: x86/xen: Documentation updates and clarifications
        KVM: x86/xen: Add KVM_XEN_INVALID_GPA and KVM_XEN_INVALID_GFN to uapi
        KVM: x86/xen: Simplify eventfd IOCTLs
        KVM: x86/xen: Fix SRCU/RCU usage in readers of evtchn_ports
        KVM: x86/xen: Use kvm_read_guest_virt() instead of open-coding it badly
        KVM: x86/xen: Fix memory leak in kvm_xen_write_hypercall_page()
        KVM: Delete extra block of "};" in the KVM API documentation
        kvm: x86/mmu: Remove duplicated "be split" in spte.h
        kvm: Remove the unused macro KVM_MMU_READ_{,UN}LOCK()
        MAINTAINERS: adjust entry after renaming the vmx hyperv files
        KVM: selftests: Mark correct page as mapped in virt_map()
        KVM: arm64: selftests: Don't identity map the ucall MMIO hole
        KVM: selftests: document the default implementation of vm_vaddr_populate_bitmap
        KVM: selftests: Use magic value to signal ucall_alloc() failure
        KVM: selftests: Disable "gnu-variable-sized-type-not-at-end" warning
        KVM: selftests: Include lib.mk before consuming $(CC)
        KVM: selftests: Explicitly disable builtins for mem*() overrides
        ...
      2258c2dc
    • Jens Axboe's avatar
      Merge tag 'nvme-6.2-2022-12-29' of git://git.infradead.org/nvme into block-6.2 · 1551ed5a
      Jens Axboe authored
      Pull NVMe fixes from Christoph:
      
      "nvme fixes for Linux 6.2
      
       - fix various problems in handling the Command Supported and Effects log
         (Christoph Hellwig)
       - don't allow unprivileged passthrough of commands that don't transfer
         data but modify logical block content (Christoph Hellwig)
       - add a features and quirks policy document (Christoph Hellwig)
       - fix some really nasty code that was correct but made smatch complain
         (Sagi Grimberg)"
      
      * tag 'nvme-6.2-2022-12-29' of git://git.infradead.org/nvme:
        nvme-auth: fix smatch warning complaints
        nvme: consult the CSE log page for unprivileged passthrough
        nvme: also return I/O command effects from nvme_command_effects
        nvmet: don't defer passthrough commands with trivial effects to the workqueue
        nvmet: set the LBCC bit for commands that modify data
        nvmet: use NVME_CMD_EFFECTS_CSUPP instead of open coding it
        nvme: fix the NVME_CMD_EFFECTS_CSE_MASK definition
        docs, nvme: add a feature and quirk policy document
      1551ed5a
    • Bhaskar Chowdhury's avatar
      kconfig: Add static text for search information in help menu · da8daff9
      Bhaskar Chowdhury authored
      Add few static text to explain how one can bring up the search dialog
      box by pressing the forward slash key anywhere on this interface.
      Signed-off-by: default avatarBhaskar Chowdhury <unixbhaskar@gmail.com>
      Acked-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      da8daff9
  7. 28 Dec, 2022 4 commits