Skip to contentSkip to conversation

drm/i915/gtt: Disable read-only support under GVT]

PATCH Yuan, Hang 2 participants 3 messages Oct 25, 2018 – Oct 26, 2018 1 message not in the archive

lore
Share & tools
lore

Yuan, Hang

author
#1 lore raw
In reply to a message not in the archive

Hi Chris,

I checked GVT shadow PPGTT handling codes and think GVT does propagate guest PTE flags to shadow PPGTT entry. Then I run i915 self-test case "igt_ctx_readonly" in KVMGT's guest. The case doesn't report any errors. Can I know if there are any other reasons that you think GVT breaks read-only support?

Thanks,
Henry

Quoted 50 lines

----- Forwarded message from Chris Wilson <[email protected]> -----

Date: Thu, 12 Jul 2018 19:53:12 +0100
From: Chris Wilson <[email protected]>
To: [email protected]
Cc: Chris Wilson <[email protected]>, Zhenyu Wang <[email protected]>, Jon Bloomfield <[email protected]>, Joonas Lahtinen
<[email protected]>, Matthew Auld
<[email protected]>
Subject: [PATCH 3/6] drm/i915/gtt: Disable read-only support under GVT
X-Mailer: git-send-email 2.18.0

GVT is not propagating the PTE bits, and is always setting the read-write bit, thus breaking read-only support.

Cc Zhenyu Wang <[email protected]>
Cc Jon Bloomfield <[email protected]>
Cc Joonas Lahtinen <[email protected]>
Cc Matthew Auld <[email protected]>
---
 drivers/gpu/drm/i915/i915_gem_gtt.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_gem_gtt.c +6 -3
index 6c0b438afe46..8e70a45b8a90 100644
@@ -1662,8 +1662,12 @@ static struct i915_hw_ppgtt
 *gen8_ppgtt_create(struct drm_i915_private *i915)
 		1ULL << 48 :
 		1ULL << 32;
 
-	/* From bdw, there is support for read-only pages in the PPGTT */
-	ppgtt->vm.has_read_only = true;
+	/*
+	 * From bdw, there is support for read-only pages in the PPGTT.
+	 *
+	 * XXX GVT is not setting honouring the PTE bits.
+	 */
+	ppgtt->vm.has_read_only = !intel_vgpu_active(i915);
 
 	i915_address_space_init(&ppgtt->vm, i915);
 
--

2.18.0

Quoted 6 lines

----- End forwarded message -----

--
Open Source Technology Center, Intel ltd.

$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827

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

#2 lore raw

Quoting Yuan, Hang (2018-10-25 11:07:48)

Quoted 3 lines

Hi Chris,

I checked GVT shadow PPGTT handling codes and think GVT does propagate guest PTE flags to shadow PPGTT entry. Then I run i915 self-test case "igt_ctx_readonly" in KVMGT's guest. The case doesn't report any errors. Can I know if there are any other reasons that you think GVT breaks read-only support?

I thought it was from a ci result, but going back through the logs we have never run the selftests at that time under CI. So call it a lack of testing and a misread of the code.

igt_ctx_readonly should be sufficient to prove the test, except it needs a bit of refinement to be stricter over hang detection.
https://patchwork.freedesktop.org/patch/256433/
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

author
#3 lore raw
Quoted 21 lines

-----Original Message-----
From: intel-gvt-dev [mailto:[email protected]] On Behalf Of Chris Wilson
Sent: Thursday, October 25, 2018 8:51 PM
To: Yuan, Hang <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Zhenyu Wang <[email protected]>; Bloomfield, Jon <[email protected]>; [email protected]
Subject: RE: [FW: [PATCH 3/6] drm/i915/gtt: Disable read-only support under GVT]

Quoting Yuan, Hang (2018-10-25 11:07:48)

Quoted 3 lines

Hi Chris,

I checked GVT shadow PPGTT handling codes and think GVT does

propagate guest PTE flags to shadow PPGTT entry. Then I run i915 self-test case "igt_ctx_readonly" in KVMGT's guest. The case doesn't report any errors. Can I know if there are any other reasons that you think GVT breaks read- only support?

Quoted 8 lines

I thought it was from a ci result, but going back through the logs we have never run the selftests at that time under CI. So call it a lack of testing and a misread of the code.

igt_ctx_readonly should be sufficient to prove the test, except it needs a bit of refinement to be stricter over hang detection.
https://patchwork.freedesktop.org/patch/256433/
-Chris

[Yuan, Hang] Thanks. I will apply the patch and test again.
_______________________________________________
Intel-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx