Skip to contentSkip to conversation

Intel-gfx Digest, Vol 185, Issue 285

Intel-gfx Matt Jack 1 participant 1 message Jun 14, 2023 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Matt Jack

author
#1 lore raw

Man, can someone reply to me is this exactly what’s going on to my devices? What do you want me to do seriously man it’s getting old. Do you want me to compile and make one of these units and then my device will be OK again like what is the deal?

Sent from my iPhone

Quoted 356 lines · On Jun 13, 2023, at 11:24 PM, [email protected] wrote:

Send Intel-gfx mailing list submissions to
[email protected]

To subscribe or unsubscribe via the World Wide Web, visit
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
or, via email, send a message with subject or body 'help' to
[email protected]

You can reach the person managing the list at
[email protected]

When replying, please edit your Subject line so it is more specific than "Re: Contents of Intel-gfx digest..."

Today's Topics:

1. Re: [PATCH] drm/i915/guc/slpc: Apply min softlimit correctly (Dixit, Ashutosh)
2. Re: [PATCH v3 00/28] drm/i915/gvt: KVM: KVMGT fixes and page-track cleanups (Ma, Yongwei)
3. Re: [PATCH v12 21/24] vfio: Determine noiommu device in

     __vfio_register_dev() (Liu, Yi L)

----------------------------------------------------------------------

Message: 1
Date: Tue, 13 Jun 2023 19:25:42 -0700
From: "Dixit, Ashutosh" <[email protected]>
To: Vinay Belgaumkar <[email protected]>
Cc: [email protected], [email protected]
Subject: Re: [Intel-gfx] [PATCH] drm/i915/guc/slpc: Apply min
softlimit correctly
Message-ID: <[email protected]>
Content-Type: text/plain; charset=US-ASCII

Quoted 2 lines · Vinay Belgaumkar

Hi Vinay,

Quoted 2 lines

We were skipping when min_softlimit was equal to RPn. We need to apply it rergardless as efficient frequency will push the SLPC min to RPe.

regardless

Quoted 2 lines

This will break scenarios where user sets a min softlimit < RPe before reset and then performs a GT reset.

Can you explain the reason for the patch clearly in terms of variables in the code, what variable has what value and what is the bug. I am not following from the above description.

Thanks.
--
Ashutosh

Quoted 22 lines
Fixes 95ccf312a1e4 ("drm/i915/guc/slpc: Allow SLPC to use efficient frequency")

---
drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c +1 -2
index 01b75529311c..ee9f83af7cf6 100644
@@ -606,7 +606,7 @@ static int slpc_set_softlimits(struct intel_guc_slpc *slpc)
       if (unlikely(ret))
           return ret;
       slpc_to_gt(slpc)->defaults.min_freq = slpc->min_freq_softlimit;
-    } else if (slpc->min_freq_softlimit != slpc->min_freq) {
+    } else {
       return intel_guc_slpc_set_min_freq(slpc,
                          slpc->min_freq_softlimit);
   }
--
Quoted 2 lines

2.38.1

------------------------------

Message: 2
Date: Wed, 14 Jun 2023 03:06:15 +0000
From: "Ma, Yongwei" <[email protected]>
To: "Christopherson,, Sean" <[email protected]>, Paolo Bonzini
<[email protected]>, Zhenyu Wang <[email protected]>, "Wang, Zhi A" <[email protected]>
Cc: "[email protected]" <[email protected]>,
"[email protected]" <[email protected]>, "[email protected]" <[email protected]>, "[email protected]" <[email protected]>, "Zhao, Yan Y" <[email protected]>, Ben Gardon <[email protected]>, "Ma, Yongwei" <[email protected]>
Subject: Re: [Intel-gfx] [PATCH v3 00/28] drm/i915/gvt: KVM: KVMGT
fixes and page-track cleanups
Message-ID:

   <BL1PR11MB53686A129ABEC1725EFD5FAE895AA@BL1PR11MB5368.namprd11.prod.outlook.com>

Content-Type: text/plain; charset="utf-8"

Quoted 89 lines

Fix a variety of found-by-inspection bugs in KVMGT, and overhaul KVM's page-track APIs to provide a leaner and cleaner interface. The motivation for this series is to (significantly) reduce the number of KVM APIs that KVMGT uses, with a long-term goal of making all kvm_host.h headers KVM-internal.

As always for this series, the KVMGT changes are compile tested only.

Based on "git://git.kernel.org/pub/scm/virt/kvm/kvm.git tags/kvm-6.4-1".

v3:
- Collect reviewed/tested tags (I apologize if I missed any, I manually gathered them this time due to a goof in my workflow). [Yan]
- Drop check on max KVM paging size from KVMGT. [Yan]
- Drop the explicit change on THP pages, and instead validate that the pfns (not struct page pointers) are contiguous. [Yan]
- Fix buggy intel_gvt_dma_map_guest_page() usage by eliminating a helper for shadowing 2MiB GTT entries. [Yan]
- Move kvm_arch_flush_shadow_{all,memslot}() to mmu.c instead of exposing
kvm_mmu_zap_all_fast() outside of mmu.c. [Yan]
- Fix an alignment goof in hlist_for_each_entry_srcu() usage. [Yan]
- Wrap full definition of external page track structures with CONFIG_KVM_EXTERNAL_WRITE_TRACKING. [Yan]

v2:
- https://lore.kernel.org/all/[email protected]
- Reuse vgpu_lock to protect gfn hash instead of introducing a new (and buggy) mutext. [Yan]
- Remove a spurious return from kvm_page_track_init(). [Yan]
- Take @kvm directly in the inner __kvm_page_track_write(). [Yan]
- Delete the gfn sanity check that relies on kvm_is_visible_gfn() instead of providing a dedicated interface. [Yan]

v1: https://lore.kernel.org/lkml/20221223005739.1295925-1-
[email protected]

Sean Christopherson (24):
drm/i915/gvt: Verify pfn is "valid" before dereferencing "struct page" drm/i915/gvt: Verify hugepages are contiguous in physical address
space
drm/i915/gvt: Put the page reference obtained by KVM's gfn_to_pfn() drm/i915/gvt: Explicitly check that vGPU is attached before shadowing drm/i915/gvt: Error out on an attempt to shadowing an unknown GTT
entry type
drm/i915/gvt: Don't rely on KVM's gfn_to_pfn() to query possible 2M
GTT
drm/i915/gvt: Use an "unsigned long" to iterate over memslot gfns drm/i915/gvt: Drop unused helper intel_vgpu_reset_gtt() drm/i915/gvt: Protect gfn hash table with vgpu_lock
KVM: x86/mmu: Move kvm_arch_flush_shadow_{all,memslot}() to mmu.c
KVM: x86/mmu: Don't rely on page-track mechanism to flush on memslot
change
KVM: x86/mmu: Don't bounce through page-track mechanism for guest
PTEs
KVM: drm/i915/gvt: Drop @vcpu from KVM's ->track_write() hook
KVM: x86: Reject memslot MOVE operations if KVMGT is attached drm/i915/gvt: Don't bother removing write-protection on to-be-deleted
slot
KVM: x86/mmu: Move KVM-only page-track declarations to internal header
KVM: x86/mmu: Use page-track notifiers iff there are external users
KVM: x86/mmu: Drop infrastructure for multiple page-track modes
KVM: x86/mmu: Rename page-track APIs to reflect the new reality
KVM: x86/mmu: Assert that correct locks are held for page
write-tracking
KVM: x86/mmu: Bug the VM if write-tracking is used but not enabled
KVM: x86/mmu: Drop @slot param from exported/external page-track APIs
KVM: x86/mmu: Handle KVM bookkeeping in page-track APIs, not callers drm/i915/gvt: Drop final dependencies on KVM internal details

Yan Zhao (4):
drm/i915/gvt: remove interface intel_gvt_is_valid_gfn
KVM: x86: Add a new page-track hook to handle memslot deletion drm/i915/gvt: switch from ->track_flush_slot() to
->track_remove_region()
KVM: x86: Remove the unused page-track hook track_flush_slot()

arch/x86/include/asm/kvm_host.h       |  16 +-
arch/x86/include/asm/kvm_page_track.h |  73 +++-----
arch/x86/kvm/mmu.h                    |   2 +
arch/x86/kvm/mmu/mmu.c                |  51 +++--
arch/x86/kvm/mmu/page_track.c         | 256 +++++++++++++-------------
arch/x86/kvm/mmu/page_track.h         |  58 ++++++
arch/x86/kvm/x86.c                    |  22 +--
drivers/gpu/drm/i915/gvt/gtt.c        | 102 ++--------
drivers/gpu/drm/i915/gvt/gtt.h        |   1 -
drivers/gpu/drm/i915/gvt/gvt.h        |   3 +-
drivers/gpu/drm/i915/gvt/kvmgt.c      | 117 +++++-------
drivers/gpu/drm/i915/gvt/page_track.c |  10 +-
12 files changed, 320 insertions(+), 391 deletions(-)  create mode 100644
Quoted 6 lines

arch/x86/kvm/mmu/page_track.h

base-commit: b3c98052d46948a8d65d2778c7f306ff38366aac --
2.40.1.606.ga4b1b128d6-goog

Verified GVT-g on Intel platform host Core(TM) i7-8559U CPU @ 2.70GHz
+ Ubuntu22.04 LTS.

Both Linux Ubuntu 22.04 VM and Windows10 VM could boot up successfully. 3D benchmark GLmark2 can run in the guest VM.

Best Regards,
Yongwei Ma

------------------------------

Message: 3
Date: Wed, 14 Jun 2023 03:24:00 +0000
From: "Liu, Yi L" <[email protected]>
To: Alex Williamson <[email protected]>, Jason Gunthorpe
<[email protected]>
Cc: "Tian, Kevin" <[email protected]>, "[email protected]"
<[email protected]>, "[email protected]" <[email protected]>, "[email protected]" <[email protected]>, "[email protected]" <[email protected]>, "[email protected]" <[email protected]>, "[email protected]" <[email protected]>, "[email protected]" <[email protected]>, "[email protected]" <[email protected]>, "[email protected]" <[email protected]>, "[email protected]" <[email protected]>, "[email protected]" <[email protected]>, "[email protected]" <[email protected]>, "[email protected]" <[email protected]>, "[email protected]" <[email protected]>, "[email protected]" <[email protected]>, "[email protected]" <[email protected]>, "[email protected]" <[email protected]>, "Hao, Xudong" <[email protected]>, "Zhao, Yan Y" <[email protected]>, "Xu, Terrence" <[email protected]>, "Jiang, Yanting" <[email protected]>, "Duan, Zhenzhong" <[email protected]>, "[email protected]" <[email protected]>
Subject: Re: [Intel-gfx] [PATCH v12 21/24] vfio: Determine noiommu
device in __vfio_register_dev()
Message-ID:

   <DS0PR11MB7529F2D5EF95E9E1D63C9264C35AA@DS0PR11MB7529.namprd11.prod.outlook.com>

Content-Type: text/plain; charset="us-ascii"

Quoted 41 lines

From: Alex Williamson <[email protected]>
Sent: Wednesday, June 14, 2023 4:11 AM

Quoted 12 lines · On Tue, 13 Jun 2023 14:35:09 -0300 Jason Gunthorpe <[email protected]> wrote:
Quoted 2 lines · Alex Williamson

[Sorry for breaking threading, replying to my own message id with reply content from Yi since the Cc list got broken]

Yikes it is really busted, I think I fixed it?

Quoted 6 lines

If we renamed your function above to vfio_device_has_iommu_group(), couldn't we just wrap device_add like below instead to not have cdev setup for a noiommu device, generate an error for a physical device w/o IOMMU backing, and otherwise setup the cdev device?

static inline int vfio_device_add(struct vfio_device *device, enum vfio_group_type

type)

Quoted 6 lines
Quoted 4 lines

{

#if IS_ENABLED(CONFIG_VFIO_GROUP)
   if (device->group->type == VFIO_NO_IOMMU)
       return device_add(&device->device);

vfio_device_is_noiommu() embeds the IS_ENABLED

But patch 23/ makes the definition of struct vfio_group conditional on CONFIG_VFIO_GROUP, so while CONFIG_VFIO_NOIOMMU depends on CONFIG_VFIO_GROUP and the result could be determined, I think the compiler is still unhappy about the undefined reference. We'd need a !CONFIG_VFIO_GROUP stub for the function.

Quoted 9 lines
Quoted 4 lines
#else
   if (type == VFIO_IOMMU && !vfio_device_has_iommu_group(device))
       return -EINVAL;

#endif

The require test is this from the group code:

   if (!device_iommu_capable(dev, IOMMU_CAP_CACHE_COHERENCY)) {
Quoted 8 lines
Quoted 3 lines

We could lift it out of the group code and call it from vfio_main.c like:

if (type == VFIO_IOMMU && !vfio_device_is_noiommu(vdev)

&& !device_iommu_capable(dev,

Quoted 2 lines

IOMMU_CAP_CACHE_COHERENCY))
FAIL

Ack. Thanks,

So, what I got is:

1) Add bellow check in __vfio_register_dev() to fail the physical devices that don't have IOMMU protection.

/*
* noiommu device is a special type supported by the group interface.
* Such type represents the physical devices that are not iommu backed. */
if (type == VFIO_IOMMU && !vfio_device_is_noiommu(device)) &&
!vfio_device_has_iommu_group(device))
return -EINVAL; //or maybe -EOPNOTSUPP?

Nit: require a vfio_device_is_noiommu() stub which returns false for the VFIO_GROUP unset case.

2) Have below functions to add device

#if IS_ENABLED(CONFIG_VFIO_DEVICE_CDEV)
static inline int vfio_device_add(struct vfio_device *device)

{
   if (vfio_device_is_noiommu(device))
       return device_add(&device->device);
   vfio_init_device_cdev(device);
   return cdev_device_add(&device->cdev, &device->device);
}

static inline void vfio_device_del(struct vfio_device *device)

{
   if (vfio_device_is_noiommu(device))
       return device_del(&device->device);
   cdev_device_del(&device->cdev, &device->device);
}

#else
blabla
#endif

Regards,
Yi Liu

------------------------------

Subject: Digest Footer

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

------------------------------

End of Intel-gfx Digest, Vol 185, Issue 285
*******************************************