Skip to contentSkip to conversation

drm/i915/gvt: Avoid full proxy f_ops debug attributes

PATCH Superseded Deepak R Varma 4 participants 19 messages Jan 10, 2023 – Jan 20, 2023

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover drm/i915/gvt: Avoid full proxy f_ops debug attributes

This patch series proposes to replace a combination of DEFINE_SIMPLE_ATTRIBUTE() + debugfs_create_file() by a combination of DEFINE_DEBUGFS_ATTRIBUTE() + debugfs_create_file_unsafe(). The change reduced overhead in terms of managing the full proxy f_ops at runtime. The patches 1 & 2 covers for the scan_nonprivbb
and vgpu_status f_ops debugfs attributes respectively.

Following coccicheck make command helped identify this change:

make coccicheck M=drivers/gpu/drm/i915/ MODE=patch COCCI=./scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci

Deepak R Varma (2):
drm/i915/gvt: Avoid full proxy f_ops for scan_nonprivbb debug
attributes
drm/i915/gvt: Avoid full proxy f_ops for vgpu_status debug attributes

 drivers/gpu/drm/i915/gvt/debugfs.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/2 drm/i915/gvt: Avoid full proxy f_ops for scan_nonprivbb debug attributes

Using DEFINE_SIMPLE_ATTRIBUTE macro with the debugfs_create_file() function adds the overhead of introducing a proxy file operation functions to wrap the original read/write inside file removal protection functions. This adds significant overhead in terms of introducing and managing the proxy factory file operations structure and function wrapping at runtime.
As a replacement, a combination of DEFINE_DEBUGFS_ATTRIBUTE macro paired with debugfs_create_file_unsafe() is suggested to be used instead. The DEFINE_DEBUGFS_ATTRIBUTE utilises debugfs_file_get() and debugfs_file_put() wrappers to protect the original read and write function calls for the debug attributes. There is no need for any runtime proxy file operations to be managed by the debugfs core. Following coccicheck make command helped identify this change:

make coccicheck M=drivers/gpu/drm/i915/ MODE=patch COCCI=./scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci

---
 drivers/gpu/drm/i915/gvt/debugfs.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/gvt/debugfs.c +5 -5
index 0616b73175f3..03f081c3d9a4 100644
@@ -147,9 +147,9 @@ vgpu_scan_nonprivbb_set(void *data, u64 val)
 	return 0;
 }
 
-DEFINE_SIMPLE_ATTRIBUTE(vgpu_scan_nonprivbb_fops,
-			vgpu_scan_nonprivbb_get, vgpu_scan_nonprivbb_set,
-			"0x%llx\n");
+DEFINE_DEBUGFS_ATTRIBUTE(vgpu_scan_nonprivbb_fops,
+			 vgpu_scan_nonprivbb_get, vgpu_scan_nonprivbb_set,
+			 "0x%llx\n");
 
 static int vgpu_status_get(void *data, u64 *val)
 {
@@ -180,8 +180,8 @@ void intel_gvt_debugfs_add_vgpu(struct intel_vgpu *vgpu)
 
 	debugfs_create_file("mmio_diff", 0444, vgpu->debugfs, vgpu,
 			    &vgpu_mmio_diff_fops);
-	debugfs_create_file("scan_nonprivbb", 0644, vgpu->debugfs, vgpu,
-			    &vgpu_scan_nonprivbb_fops);
+	debugfs_create_file_unsafe("scan_nonprivbb", 0644, vgpu->debugfs, vgpu,
+				   &vgpu_scan_nonprivbb_fops);
 	debugfs_create_file("status", 0644, vgpu->debugfs, vgpu,
 			    &vgpu_status_fops);
 }
Signature · 1 line
2.34.1
#2 lore raw

PATCH 2/2 drm/i915/gvt: Avoid full proxy f_ops for vgpu_status debug attributes

In reply to Deepak R Varma

Using DEFINE_SIMPLE_ATTRIBUTE macro with the debugfs_create_file() function adds the overhead of introducing a proxy file operation functions to wrap the original read/write inside file removal protection functions. This adds significant overhead in terms of introducing and managing the proxy factory file operations structure and function wrapping at runtime.
As a replacement, a combination of DEFINE_DEBUGFS_ATTRIBUTE macro paired with debugfs_create_file_unsafe() is suggested to be used instead. The DEFINE_DEBUGFS_ATTRIBUTE utilises debugfs_file_get() and debugfs_file_put() wrappers to protect the original read and write function calls for the debug attributes. There is no need for any runtime proxy file operations to be managed by the debugfs core. Following coccicheck make command helped identify this change:

make coccicheck M=drivers/gpu/drm/i915/ MODE=patch COCCI=./scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci

---
 drivers/gpu/drm/i915/gvt/debugfs.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/gvt/debugfs.c +3 -3
index 03f081c3d9a4..baccbf1761b7 100644
@@ -165,7 +165,7 @@ static int vgpu_status_get(void *data, u64 *val)
 	return 0;
 }
 
-DEFINE_SIMPLE_ATTRIBUTE(vgpu_status_fops, vgpu_status_get, NULL, "0x%llx\n");
+DEFINE_DEBUGFS_ATTRIBUTE(vgpu_status_fops, vgpu_status_get, NULL, "0x%llx\n");
 
 /**
  * intel_gvt_debugfs_add_vgpu - register debugfs entries for a vGPU
@@ -182,8 +182,8 @@ void intel_gvt_debugfs_add_vgpu(struct intel_vgpu *vgpu)
 			    &vgpu_mmio_diff_fops);
 	debugfs_create_file_unsafe("scan_nonprivbb", 0644, vgpu->debugfs, vgpu,
 				   &vgpu_scan_nonprivbb_fops);
-	debugfs_create_file("status", 0644, vgpu->debugfs, vgpu,
-			    &vgpu_status_fops);
+	debugfs_create_file_unsafe("status", 0644, vgpu->debugfs, vgpu,
+				   &vgpu_status_fops);
 }
 
 /**
Signature · 1 line
2.34.1
maintainer Reviewed-by on v1 2/2
#3 lore raw

Re: [PATCH 2/2] drm/i915/gvt: Avoid full proxy f_ops for vgpu_status debug attributes

Quoted 14 lines · Deepak R Varma

Using DEFINE_SIMPLE_ATTRIBUTE macro with the debugfs_create_file() function adds the overhead of introducing a proxy file operation functions to wrap the original read/write inside file removal protection functions. This adds significant overhead in terms of introducing and managing the proxy factory file operations structure and function wrapping at runtime.
As a replacement, a combination of DEFINE_DEBUGFS_ATTRIBUTE macro paired with debugfs_create_file_unsafe() is suggested to be used instead. The DEFINE_DEBUGFS_ATTRIBUTE utilises debugfs_file_get() and debugfs_file_put() wrappers to protect the original read and write function calls for the debug attributes. There is no need for any runtime proxy file operations to be managed by the debugfs core. Following coccicheck make command helped identify this change:

Quoted 3 lines

make coccicheck M=drivers/gpu/drm/i915/ MODE=patch COCCI=./scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci

I believe these 2 gvt cases could be done in one patch. But anyways,

for both patches... and will leave these 2 patches for gvt folks
to apply. Unless they ack and I apply in the drm-intel along with the other ones.

Quoted 33 lines
---
 drivers/gpu/drm/i915/gvt/debugfs.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/gvt/debugfs.c +3 -3
index 03f081c3d9a4..baccbf1761b7 100644
@@ -165,7 +165,7 @@ static int vgpu_status_get(void *data, u64 *val)
 	return 0;
 }
 
-DEFINE_SIMPLE_ATTRIBUTE(vgpu_status_fops, vgpu_status_get, NULL, "0x%llx\n");
+DEFINE_DEBUGFS_ATTRIBUTE(vgpu_status_fops, vgpu_status_get, NULL, "0x%llx\n");
 
 /**
  * intel_gvt_debugfs_add_vgpu - register debugfs entries for a vGPU
@@ -182,8 +182,8 @@ void intel_gvt_debugfs_add_vgpu(struct intel_vgpu *vgpu)
 			    &vgpu_mmio_diff_fops);
 	debugfs_create_file_unsafe("scan_nonprivbb", 0644, vgpu->debugfs, vgpu,
 				   &vgpu_scan_nonprivbb_fops);
-	debugfs_create_file("status", 0644, vgpu->debugfs, vgpu,
-			    &vgpu_status_fops);
+	debugfs_create_file_unsafe("status", 0644, vgpu->debugfs, vgpu,
+				   &vgpu_status_fops);
 }
 
 /**
Signature · 1 line
2.34.1
#16 lore raw

[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/gvt: Avoid full proxy f_ops debug attributes

In reply to Deepak R Varma
== Series Details ==

== Series Details ==

Series: drm/i915/gvt: Avoid full proxy f_ops debug attributes
URL : https://patchwork.freedesktop.org/series/112630/
State : warning

== Summary ==

Error: dim checkpatch failed
4c95e9b71212 drm/i915/gvt: Avoid full proxy f_ops for scan_nonprivbb debug attributes
-:21: WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line) #21:
make coccicheck M=drivers/gpu/drm/i915/ MODE=patch COCCI=./scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci

total: 0 errors, 1 warnings, 0 checks, 22 lines checked
33d68a01cad3 drm/i915/gvt: Avoid full proxy f_ops for vgpu_status debug attributes
-:21: WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line) #21:
make coccicheck M=drivers/gpu/drm/i915/ MODE=patch COCCI=./scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci

total: 0 errors, 1 warnings, 0 checks, 18 lines checked

#17 lore raw

[Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/gvt: Avoid full proxy f_ops debug attributes

In reply to Deepak R Varma
== Series Details ==

== Series Details ==

Series: drm/i915/gvt: Avoid full proxy f_ops debug attributes
URL : https://patchwork.freedesktop.org/series/112630/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_12569 -> Patchwork_112630v1
====================================================

Summary
-------

**SUCCESS**

No regressions found.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112630v1/index.html

Participating hosts (41 -> 40)
------------------------------

Missing (1): fi-snb-2520m

Known issues
------------

Here are the changes found in Patchwork_112630v1 that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@gem_exec_gttfill@basic:
- fi-pnv-d510: [PASS][1] -> [FAIL][2] ([i915#7229])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12569/fi-pnv-d510/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112630v1/fi-pnv-d510/igt@[email protected]

* igt@i915_selftest@live@guc_hang:
- fi-kbl-soraka: NOTRUN -> [INCOMPLETE][3] ([i915#7640])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112630v1/fi-kbl-soraka/igt@i915_selftest@live@guc_hang.html

* igt@kms_cursor_legacy@basic-busy-flip-before-cursor@atomic-transitions:
- fi-bsw-n3050: [PASS][4] -> [FAIL][5] ([i915#6298])
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12569/fi-bsw-n3050/igt@kms_cursor_legacy@[email protected]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112630v1/fi-bsw-n3050/igt@kms_cursor_legacy@[email protected]

#### Possible fixes ####

* igt@i915_selftest@live@gt_heartbeat:
- fi-kbl-soraka: [DMESG-FAIL][6] ([i915#5334]) -> [PASS][7]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12569/fi-kbl-soraka/igt@i915_selftest@live@gt_heartbeat.html
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112630v1/fi-kbl-soraka/igt@i915_selftest@live@gt_heartbeat.html

* igt@i915_selftest@live@gt_lrc:
- {bat-adlp-9}: [INCOMPLETE][8] ([i915#4983]) -> [PASS][9]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12569/bat-adlp-9/igt@i915_selftest@live@gt_lrc.html
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112630v1/bat-adlp-9/igt@i915_selftest@live@gt_lrc.html

* igt@i915_selftest@live@guc_multi_lrc:
- fi-kbl-soraka: [INCOMPLETE][10] ([i915#7640]) -> [PASS][11]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12569/fi-kbl-soraka/igt@i915_selftest@live@guc_multi_lrc.html
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112630v1/fi-kbl-soraka/igt@i915_selftest@live@guc_multi_lrc.html

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[i915#3546]: https://gitlab.freedesktop.org/drm/intel/issues/3546
[i915#4312]: https://gitlab.freedesktop.org/drm/intel/issues/4312
[i915#4983]: https://gitlab.freedesktop.org/drm/intel/issues/4983
[i915#5334]: https://gitlab.freedesktop.org/drm/intel/issues/5334
[i915#6298]: https://gitlab.freedesktop.org/drm/intel/issues/6298
[i915#6367]: https://gitlab.freedesktop.org/drm/intel/issues/6367
[i915#6997]: https://gitlab.freedesktop.org/drm/intel/issues/6997
[i915#7077]: https://gitlab.freedesktop.org/drm/intel/issues/7077
[i915#7229]: https://gitlab.freedesktop.org/drm/intel/issues/7229
[i915#7640]: https://gitlab.freedesktop.org/drm/intel/issues/7640
[i915#7828]: https://gitlab.freedesktop.org/drm/intel/issues/7828

Build changes
-------------

* Linux: CI_DRM_12569 -> Patchwork_112630v1

CI-20190529: 20190529
CI_DRM_12569: 739b2ee4e76d9cd64e5fbe834b682e550e496cf4 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_7115: c162d70b00c6f4cf6a0ba1ca7a7e2ad8f7190646 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_112630v1: 739b2ee4e76d9cd64e5fbe834b682e550e496cf4 @ git://anongit.freedesktop.org/gfx-ci/linux

### Linux commits

f66b7a25610a drm/i915/gvt: Avoid full proxy f_ops for vgpu_status debug attributes 26f67451ed4f drm/i915/gvt: Avoid full proxy f_ops for scan_nonprivbb debug attributes

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112630v1/index.html

#18 lore raw

[Intel-gfx] ✓ Fi.CI.IGT: success for drm/i915/gvt: Avoid full proxy f_ops debug attributes

In reply to Deepak R Varma
== Series Details ==

== Series Details ==

Series: drm/i915/gvt: Avoid full proxy f_ops debug attributes
URL : https://patchwork.freedesktop.org/series/112630/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_12569_full -> Patchwork_112630v1_full
====================================================

Summary
-------

**SUCCESS**

No regressions found.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112630v1/index.html

Participating hosts (14 -> 10)
------------------------------

Missing (4): shard-rkl0 pig-kbl-iris pig-glk-j5005 pig-skl-6260u

Known issues
------------

Here are the changes found in Patchwork_112630v1_full that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@gem_exec_fair@basic-none-share@rcs0:
- shard-glk: [PASS][1] -> [FAIL][2] ([i915#2842])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12569/shard-glk8/igt@gem_exec_fair@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112630v1/shard-glk9/igt@gem_exec_fair@[email protected]

* igt@gem_lmem_swapping@massive:
- shard-glk: NOTRUN -> [SKIP][3] ([fdo#109271] / [i915#4613])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112630v1/shard-glk2/igt@[email protected]

* igt@kms_ccs@pipe-b-bad-aux-stride-y_tiled_gen12_mc_ccs:
- shard-glk: NOTRUN -> [SKIP][4] ([fdo#109271] / [i915#3886])
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112630v1/shard-glk2/igt@kms_ccs@pipe-b-bad-aux-stride-y_tiled_gen12_mc_ccs.html

* igt@kms_frontbuffer_tracking@psr-rgb565-draw-mmap-gtt:
- shard-glk: NOTRUN -> [SKIP][5] ([fdo#109271]) +40 similar issues
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112630v1/shard-glk2/igt@[email protected]

* igt@kms_psr2_sf@overlay-primary-update-sf-dmg-area:
- shard-glk: NOTRUN -> [SKIP][6] ([fdo#109271] / [i915#658])
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112630v1/shard-glk2/igt@[email protected]

* igt@sysfs_clients@sema-25:
- shard-glk: NOTRUN -> [SKIP][7] ([fdo#109271] / [i915#2994])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112630v1/shard-glk2/igt@[email protected]

#### Possible fixes ####

* igt@drm_fdinfo@idle@rcs0:
- {shard-rkl}: [FAIL][8] ([i915#7742]) -> [PASS][9]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12569/shard-rkl-1/igt@drm_fdinfo@[email protected]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112630v1/shard-rkl-4/igt@drm_fdinfo@[email protected]

* igt@fbdev@unaligned-read:
- {shard-rkl}: [SKIP][10] ([i915#2582]) -> [PASS][11]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12569/shard-rkl-3/igt@[email protected]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112630v1/shard-rkl-6/igt@[email protected]

* igt@gem_exec_balancer@fairslice:
- {shard-rkl}: [SKIP][12] ([i915#6259]) -> [PASS][13]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12569/shard-rkl-5/igt@[email protected]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112630v1/shard-rkl-3/igt@[email protected]

* igt@gem_exec_reloc@basic-gtt-read:
- {shard-rkl}: [SKIP][14] ([i915#3281]) -> [PASS][15] +3 similar issues
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12569/shard-rkl-2/igt@[email protected]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112630v1/shard-rkl-5/igt@[email protected]

* igt@gem_mmap_gtt@coherency:
- {shard-rkl}: [SKIP][16] ([fdo#111656]) -> [PASS][17]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12569/shard-rkl-2/igt@[email protected]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112630v1/shard-rkl-5/igt@[email protected]

* igt@gem_mmap_wc@set-cache-level:
- {shard-rkl}: [SKIP][18] ([i915#1850]) -> [PASS][19]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12569/shard-rkl-2/igt@[email protected]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112630v1/shard-rkl-6/igt@[email protected]

* igt@gem_pread@uncached:
- {shard-rkl}: [SKIP][20] ([i915#3282]) -> [PASS][21] +1 similar issue
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12569/shard-rkl-2/igt@[email protected]
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112630v1/shard-rkl-5/igt@[email protected]

* igt@gen9_exec_parse@batch-invalid-length:
- {shard-rkl}: [SKIP][22] ([i915#2527]) -> [PASS][23] +1 similar issue
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12569/shard-rkl-2/igt@[email protected]
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112630v1/shard-rkl-5/igt@[email protected]

* igt@i915_pm_rpm@dpms-lpsp:
- {shard-dg1}: [SKIP][24] ([i915#1397]) -> [PASS][25]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12569/shard-dg1-15/igt@[email protected]
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112630v1/shard-dg1-14/igt@[email protected]

* igt@i915_pm_rpm@i2c:
- {shard-rkl}: [SKIP][26] ([fdo#109308]) -> [PASS][27]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12569/shard-rkl-2/igt@[email protected]
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112630v1/shard-rkl-6/igt@[email protected]

* igt@kms_big_fb@x-tiled-32bpp-rotate-0:
- {shard-rkl}: [SKIP][28] ([i915#1845] / [i915#4098]) -> [PASS][29] +27 similar issues
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12569/shard-rkl-1/igt@[email protected]
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112630v1/shard-rkl-6/igt@[email protected]

* igt@kms_dp_aux_dev:
- {shard-rkl}: [SKIP][30] ([i915#1257]) -> [PASS][31]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12569/shard-rkl-3/igt@kms_dp_aux_dev.html
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112630v1/shard-rkl-6/igt@kms_dp_aux_dev.html

* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-mmap-gtt:
- {shard-rkl}: [SKIP][32] ([i915#1849] / [i915#4098]) -> [PASS][33] +19 similar issues
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12569/shard-rkl-2/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-mmap-gtt.html
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112630v1/shard-rkl-6/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-mmap-gtt.html

* igt@kms_properties@plane-properties-legacy:
- {shard-rkl}: [SKIP][34] ([i915#1849]) -> [PASS][35] +2 similar issues
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12569/shard-rkl-2/igt@[email protected]
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112630v1/shard-rkl-6/igt@[email protected]

* igt@kms_psr@sprite_plane_onoff:
- {shard-rkl}: [SKIP][36] ([i915#1072]) -> [PASS][37] +1 similar issue
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12569/shard-rkl-1/igt@kms_psr@sprite_plane_onoff.html
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112630v1/shard-rkl-6/igt@kms_psr@sprite_plane_onoff.html

* igt@kms_universal_plane@universal-plane-pageflip-windowed-pipe-b:
- {shard-rkl}: [SKIP][38] ([i915#4098]) -> [PASS][39]
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12569/shard-rkl-3/igt@kms_universal_plane@universal-plane-pageflip-windowed-pipe-b.html
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112630v1/shard-rkl-6/igt@kms_universal_plane@universal-plane-pageflip-windowed-pipe-b.html

* igt@prime_vgem@basic-write:
- {shard-rkl}: [SKIP][40] ([fdo#109295] / [i915#3291] / [i915#3708]) -> [PASS][41]
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12569/shard-rkl-1/igt@[email protected]
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112630v1/shard-rkl-5/igt@[email protected]

* igt@prime_vgem@coherency-gtt:
- {shard-rkl}: [SKIP][42] ([fdo#109295] / [fdo#111656] / [i915#3708]) -> [PASS][43]
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12569/shard-rkl-2/igt@[email protected]
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112630v1/shard-rkl-5/igt@[email protected]

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109274]: https://bugs.freedesktop.org/show_bug.cgi?id=109274
[fdo#109279]: https://bugs.freedesktop.org/show_bug.cgi?id=109279
[fdo#109280]: https://bugs.freedesktop.org/show_bug.cgi?id=109280
[fdo#109283]: https://bugs.freedesktop.org/show_bug.cgi?id=109283
[fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285
[fdo#109289]: https://bugs.freedesktop.org/show_bug.cgi?id=109289
[fdo#109291]: https://bugs.freedesktop.org/show_bug.cgi?id=109291
[fdo#109295]: https://bugs.freedesktop.org/show_bug.cgi?id=109295
[fdo#109303]: https://bugs.freedesktop.org/show_bug.cgi?id=109303
[fdo#109308]: https://bugs.freedesktop.org/show_bug.cgi?id=109308
[fdo#109309]: https://bugs.freedesktop.org/show_bug.cgi?id=109309
[fdo#109312]: https://bugs.freedesktop.org/show_bug.cgi?id=109312
[fdo#109313]: https://bugs.freedesktop.org/show_bug.cgi?id=109313
[fdo#109315]: https://bugs.freedesktop.org/show_bug.cgi?id=109315
[fdo#109506]: https://bugs.freedesktop.org/show_bug.cgi?id=109506
[fdo#109642]: https://bugs.freedesktop.org/show_bug.cgi?id=109642
[fdo#110189]: https://bugs.freedesktop.org/show_bug.cgi?id=110189
[fdo#110542]: https://bugs.freedesktop.org/show_bug.cgi?id=110542
[fdo#110723]: https://bugs.freedesktop.org/show_bug.cgi?id=110723
[fdo#111068]: https://bugs.freedesktop.org/show_bug.cgi?id=111068
[fdo#111614]: https://bugs.freedesktop.org/show_bug.cgi?id=111614
[fdo#111615]: https://bugs.freedesktop.org/show_bug.cgi?id=111615
[fdo#111644]: https://bugs.freedesktop.org/show_bug.cgi?id=111644
[fdo#111656]: https://bugs.freedesktop.org/show_bug.cgi?id=111656
[fdo#111825]: https://bugs.freedesktop.org/show_bug.cgi?id=111825
[fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
[fdo#112054]: https://bugs.freedesktop.org/show_bug.cgi?id=112054
[fdo#112283]: https://bugs.freedesktop.org/show_bug.cgi?id=112283
[i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
[i915#1257]: https://gitlab.freedesktop.org/drm/intel/issues/1257
[i915#132]: https://gitlab.freedesktop.org/drm/intel/issues/132
[i915#1397]: https://gitlab.freedesktop.org/drm/intel/issues/1397
[i915#1825]: https://gitlab.freedesktop.org/drm/intel/issues/1825
[i915#1839]: https://gitlab.freedesktop.org/drm/intel/issues/1839
[i915#1845]: https://gitlab.freedesktop.org/drm/intel/issues/1845
[i915#1849]: https://gitlab.freedesktop.org/drm/intel/issues/1849
[i915#1850]: https://gitlab.freedesktop.org/drm/intel/issues/1850
[i915#1902]: https://gitlab.freedesktop.org/drm/intel/issues/1902
[i915#2190]: https://gitlab.freedesktop.org/drm/intel/issues/2190
[i915#2437]: https://gitlab.freedesktop.org/drm/intel/issues/2437
[i915#2527]: https://gitlab.freedesktop.org/drm/intel/issues/2527
[i915#2575]: https://gitlab.freedesktop.org/drm/intel/issues/2575
[i915#2582]: https://gitlab.freedesktop.org/drm/intel/issues/2582
[i915#2587]: https://gitlab.freedesktop.org/drm/intel/issues/2587
[i915#2658]: https://gitlab.freedesktop.org/drm/intel/issues/2658
[i915#2672]: https://gitlab.freedesktop.org/drm/intel/issues/2672
[i915#2705]: https://gitlab.freedesktop.org/drm/intel/issues/2705
[i915#280]: https://gitlab.freedesktop.org/drm/intel/issues/280
[i915#2842]: https://gitlab.freedesktop.org/drm/intel/issues/2842
[i915#2856]: https://gitlab.freedesktop.org/drm/intel/issues/2856
[i915#2920]: https://gitlab.freedesktop.org/drm/intel/issues/2920
[i915#2994]: https://gitlab.freedesktop.org/drm/intel/issues/2994
[i915#3116]: https://gitlab.freedesktop.org/drm/intel/issues/3116
[i915#315]: https://gitlab.freedesktop.org/drm/intel/issues/315
[i915#3281]: https://gitlab.freedesktop.org/drm/intel/issues/3281
[i915#3282]: https://gitlab.freedesktop.org/drm/intel/issues/3282
[i915#3291]: https://gitlab.freedesktop.org/drm/intel/issues/3291
[i915#3297]: https://gitlab.freedesktop.org/drm/intel/issues/3297
[i915#3299]: https://gitlab.freedesktop.org/drm/intel/issues/3299
[i915#3301]: https://gitlab.freedesktop.org/drm/intel/issues/3301
[i915#3323]: https://gitlab.freedesktop.org/drm/intel/issues/3323
[i915#3359]: https://gitlab.freedesktop.org/drm/intel/issues/3359
[i915#3361]: https://gitlab.freedesktop.org/drm/intel/issues/3361
[i915#3469]: https://gitlab.freedesktop.org/drm/intel/issues/3469
[i915#3528]: https://gitlab.freedesktop.org/drm/intel/issues/3528
[i915#3546]: https://gitlab.freedesktop.org/drm/intel/issues/3546
[i915#3547]: https://gitlab.freedesktop.org/drm/intel/issues/3547
[i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
[i915#3558]: https://gitlab.freedesktop.org/drm/intel/issues/3558
[i915#3637]: https://gitlab.freedesktop.org/drm/intel/issues/3637
[i915#3638]: https://gitlab.freedesktop.org/drm/intel/issues/3638
[i915#3689]: https://gitlab.freedesktop.org/drm/intel/issues/3689
[i915#3708]: https://gitlab.freedesktop.org/drm/intel/issues/3708
[i915#3734]: https://gitlab.freedesktop.org/drm/intel/issues/3734
[i915#3742]: https://gitlab.freedesktop.org/drm/intel/issues/3742
[i915#3804]: https://gitlab.freedesktop.org/drm/intel/issues/3804
[i915#3840]: https://gitlab.freedesktop.org/drm/intel/issues/3840
[i915#3886]: https://gitlab.freedesktop.org/drm/intel/issues/3886
[i915#404]: https://gitlab.freedesktop.org/drm/intel/issues/404
[i915#4070]: https://gitlab.freedesktop.org/drm/intel/issues/4070
[i915#4078]: https://gitlab.freedesktop.org/drm/intel/issues/4078
[i915#4098]: https://gitlab.freedesktop.org/drm/intel/issues/4098
[i915#426]: https://gitlab.freedesktop.org/drm/intel/issues/426
[i915#4270]: https://gitlab.freedesktop.org/drm/intel/issues/4270
[i915#4312]: https://gitlab.freedesktop.org/drm/intel/issues/4312
[i915#4387]: https://gitlab.freedesktop.org/drm/intel/issues/4387
[i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
[i915#4767]: https://gitlab.freedesktop.org/drm/intel/issues/4767
[i915#5176]: https://gitlab.freedesktop.org/drm/intel/issues/5176
[i915#5235]: https://gitlab.freedesktop.org/drm/intel/issues/5235
[i915#5286]: https://gitlab.freedesktop.org/drm/intel/issues/5286
[i915#5288]: https://gitlab.freedesktop.org/drm/intel/issues/5288
[i915#5289]: https://gitlab.freedesktop.org/drm/intel/issues/5289
[i915#5325]: https://gitlab.freedesktop.org/drm/intel/issues/5325
[i915#5327]: https://gitlab.freedesktop.org/drm/intel/issues/5327
[i915#533]: https://gitlab.freedesktop.org/drm/intel/issues/533
[i915#5439]: https://gitlab.freedesktop.org/drm/intel/issues/5439
[i915#5461]: https://gitlab.freedesktop.org/drm/intel/issues/5461
[i915#5723]: https://gitlab.freedesktop.org/drm/intel/issues/5723
[i915#5784]: https://gitlab.freedesktop.org/drm/intel/issues/5784
[i915#6095]: https://gitlab.freedesktop.org/drm/intel/issues/6095
[i915#6117]: https://gitlab.freedesktop.org/drm/intel/issues/6117
[i915#6248]: https://gitlab.freedesktop.org/drm/intel/issues/6248
[i915#6259]: https://gitlab.freedesktop.org/drm/intel/issues/6259
[i915#6334]: https://gitlab.freedesktop.org/drm/intel/issues/6334
[i915#6335]: https://gitlab.freedesktop.org/drm/intel/issues/6335
[i915#6355]: https://gitlab.freedesktop.org/drm/intel/issues/6355
[i915#6403]: https://gitlab.freedesktop.org/drm/intel/issues/6403
[i915#6433]: https://gitlab.freedesktop.org/drm/intel/issues/6433
[i915#6497]: https://gitlab.freedesktop.org/drm/intel/issues/6497
[i915#6524]: https://gitlab.freedesktop.org/drm/intel/issues/6524
[i915#658]: https://gitlab.freedesktop.org/drm/intel/issues/658
[i915#6768]: https://gitlab.freedesktop.org/drm/intel/issues/6768
[i915#6944]: https://gitlab.freedesktop.org/drm/intel/issues/6944
[i915#6946]: https://gitlab.freedesktop.org/drm/intel/issues/6946
[i915#6953]: https://gitlab.freedesktop.org/drm/intel/issues/6953
[i915#7037]: https://gitlab.freedesktop.org/drm/intel/issues/7037
[i915#7116]: https://gitlab.freedesktop.org/drm/intel/issues/7116
[i915#7118]: https://gitlab.freedesktop.org/drm/intel/issues/7118
[i915#7128]: https://gitlab.freedesktop.org/drm/intel/issues/7128
[i915#7294]: https://gitlab.freedesktop.org/drm/intel/issues/7294
[i915#7561]: https://gitlab.freedesktop.org/drm/intel/issues/7561
[i915#7651]: https://gitlab.freedesktop.org/drm/intel/issues/7651
[i915#7681]: https://gitlab.freedesktop.org/drm/intel/issues/7681
[i915#7697]: https://gitlab.freedesktop.org/drm/intel/issues/7697
[i915#7707]: https://gitlab.freedesktop.org/drm/intel/issues/7707
[i915#7711]: https://gitlab.freedesktop.org/drm/intel/issues/7711
[i915#7742]: https://gitlab.freedesktop.org/drm/intel/issues/7742
[i915#7828]: https://gitlab.freedesktop.org/drm/intel/issues/7828

Build changes
-------------

* Linux: CI_DRM_12569 -> Patchwork_112630v1
* Piglit: piglit_4509 -> None

CI-20190529: 20190529
CI_DRM_12569: 739b2ee4e76d9cd64e5fbe834b682e550e496cf4 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_7115: c162d70b00c6f4cf6a0ba1ca7a7e2ad8f7190646 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_112630v1: 739b2ee4e76d9cd64e5fbe834b682e550e496cf4 @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112630v1/index.html

maintainer
#4 lore raw

Re: [PATCH 2/2] drm/i915/gvt: Avoid full proxy f_ops for vgpu_status debug attributes

In reply to Rodrigo Vivi
Quoted 19 lines · Rodrigo Vivi
Quoted 14 lines · Deepak R Varma

Using DEFINE_SIMPLE_ATTRIBUTE macro with the debugfs_create_file() function adds the overhead of introducing a proxy file operation functions to wrap the original read/write inside file removal protection functions. This adds significant overhead in terms of introducing and managing the proxy factory file operations structure and function wrapping at runtime.
As a replacement, a combination of DEFINE_DEBUGFS_ATTRIBUTE macro paired with debugfs_create_file_unsafe() is suggested to be used instead. The DEFINE_DEBUGFS_ATTRIBUTE utilises debugfs_file_get() and debugfs_file_put() wrappers to protect the original read and write function calls for the debug attributes. There is no need for any runtime proxy file operations to be managed by the debugfs core. Following coccicheck make command helped identify this change:

Quoted 3 lines

make coccicheck M=drivers/gpu/drm/i915/ MODE=patch COCCI=./scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci

Quoted 7 lines

I believe these 2 gvt cases could be done in one patch. But anyways,

for both patches... and will leave these 2 patches for gvt folks
to apply. Unless they ack and I apply in the drm-intel along with the other ones.

Actually, could you please address the checkpatch issues before we can push? Sorry about that, but just noticed now when I was going to push the other ones.

Quoted 34 lines
Quoted 34 lines
---
 drivers/gpu/drm/i915/gvt/debugfs.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/gvt/debugfs.c +3 -3
index 03f081c3d9a4..baccbf1761b7 100644
@@ -165,7 +165,7 @@ static int vgpu_status_get(void *data, u64 *val)
 	return 0;
 }
 
-DEFINE_SIMPLE_ATTRIBUTE(vgpu_status_fops, vgpu_status_get, NULL, "0x%llx\n");
+DEFINE_DEBUGFS_ATTRIBUTE(vgpu_status_fops, vgpu_status_get, NULL, "0x%llx\n");
 
 /**
  * intel_gvt_debugfs_add_vgpu - register debugfs entries for a vGPU
@@ -182,8 +182,8 @@ void intel_gvt_debugfs_add_vgpu(struct intel_vgpu *vgpu)
 			    &vgpu_mmio_diff_fops);
 	debugfs_create_file_unsafe("scan_nonprivbb", 0644, vgpu->debugfs, vgpu,
 				   &vgpu_scan_nonprivbb_fops);
-	debugfs_create_file("status", 0644, vgpu->debugfs, vgpu,
-			    &vgpu_status_fops);
+	debugfs_create_file_unsafe("status", 0644, vgpu->debugfs, vgpu,
+				   &vgpu_status_fops);
 }
 
 /**
Signature · 1 line
2.34.1
#5 lore raw

Re: [PATCH 2/2] drm/i915/gvt: Avoid full proxy f_ops for vgpu_status debug attributes

Quoted 23 lines · Rodrigo Vivi
Quoted 22 lines · Rodrigo Vivi
Quoted 14 lines · Deepak R Varma

Using DEFINE_SIMPLE_ATTRIBUTE macro with the debugfs_create_file() function adds the overhead of introducing a proxy file operation functions to wrap the original read/write inside file removal protection functions. This adds significant overhead in terms of introducing and managing the proxy factory file operations structure and function wrapping at runtime.
As a replacement, a combination of DEFINE_DEBUGFS_ATTRIBUTE macro paired with debugfs_create_file_unsafe() is suggested to be used instead. The DEFINE_DEBUGFS_ATTRIBUTE utilises debugfs_file_get() and debugfs_file_put() wrappers to protect the original read and write function calls for the debug attributes. There is no need for any runtime proxy file operations to be managed by the debugfs core. Following coccicheck make command helped identify this change:

Quoted 3 lines

make coccicheck M=drivers/gpu/drm/i915/ MODE=patch COCCI=./scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci

I believe these 2 gvt cases could be done in one patch. But anyways,

Quoted 7 lines
Quoted 4 lines

for both patches... and will leave these 2 patches for gvt folks
to apply. Unless they ack and I apply in the drm-intel along with the other ones.

Actually, could you please address the checkpatch issues before we can push? Sorry about that, but just noticed now when I was going to push the other ones.

Hello Rodrigo,
The checkpatch warning is associated with the long "make coccicheck ..." command in the commit message. It is not part of the code, so is should not be carried forward into the code base.
If you still want me to correct it, I will need to split it into two lines which I think still violates the commit description guidelines.

Let me know what you think.

Thank you,
./drv

Quoted 35 lines
Quoted 35 lines
Quoted 35 lines

---
 drivers/gpu/drm/i915/gvt/debugfs.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/gvt/debugfs.c +3 -3
index 03f081c3d9a4..baccbf1761b7 100644
@@ -165,7 +165,7 @@ static int vgpu_status_get(void *data, u64 *val)
 	return 0;
 }
 
-DEFINE_SIMPLE_ATTRIBUTE(vgpu_status_fops, vgpu_status_get, NULL, "0x%llx\n");
+DEFINE_DEBUGFS_ATTRIBUTE(vgpu_status_fops, vgpu_status_get, NULL, "0x%llx\n");
 
 /**
  * intel_gvt_debugfs_add_vgpu - register debugfs entries for a vGPU
@@ -182,8 +182,8 @@ void intel_gvt_debugfs_add_vgpu(struct intel_vgpu *vgpu)
 			    &vgpu_mmio_diff_fops);
 	debugfs_create_file_unsafe("scan_nonprivbb", 0644, vgpu->debugfs, vgpu,
 				   &vgpu_scan_nonprivbb_fops);
-	debugfs_create_file("status", 0644, vgpu->debugfs, vgpu,
-			    &vgpu_status_fops);
+	debugfs_create_file_unsafe("status", 0644, vgpu->debugfs, vgpu,
+				   &vgpu_status_fops);
 }
 
 /**
Signature · 1 line
2.34.1
maintainer
#6 lore raw

Re: [PATCH 2/2] drm/i915/gvt: Avoid full proxy f_ops for vgpu_status debug attributes

Quoted 32 lines · Deepak R Varma
Quoted 23 lines · Rodrigo Vivi
Quoted 22 lines · Rodrigo Vivi
Quoted 14 lines · Deepak R Varma

Using DEFINE_SIMPLE_ATTRIBUTE macro with the debugfs_create_file() function adds the overhead of introducing a proxy file operation functions to wrap the original read/write inside file removal protection functions. This adds significant overhead in terms of introducing and managing the proxy factory file operations structure and function wrapping at runtime.
As a replacement, a combination of DEFINE_DEBUGFS_ATTRIBUTE macro paired with debugfs_create_file_unsafe() is suggested to be used instead. The DEFINE_DEBUGFS_ATTRIBUTE utilises debugfs_file_get() and debugfs_file_put() wrappers to protect the original read and write function calls for the debug attributes. There is no need for any runtime proxy file operations to be managed by the debugfs core. Following coccicheck make command helped identify this change:

Quoted 3 lines

make coccicheck M=drivers/gpu/drm/i915/ MODE=patch COCCI=./scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci

I believe these 2 gvt cases could be done in one patch. But anyways,

Quoted 7 lines
Quoted 4 lines

for both patches... and will leave these 2 patches for gvt folks
to apply. Unless they ack and I apply in the drm-intel along with the other ones.

Actually, could you please address the checkpatch issues before we can push? Sorry about that, but just noticed now when I was going to push the other ones.

Quoted 6 lines

Hello Rodrigo,
The checkpatch warning is associated with the long "make coccicheck ..." command in the commit message. It is not part of the code, so is should not be carried forward into the code base.
If you still want me to correct it, I will need to split it into two lines which I think still violates the commit description guidelines.

This part I would just ignore or fix myself while merging. But the next one about the parenthesis alignment need to be fixed in the code so we need another version. Since we try to avoid touching the code between CI and merge.

Then, since you need to change that, while changing that, also please break the coccinelle line in the commit msg.

I'd appreciate to have the patch for the pxp as well :)

Thanks a lot,
Rodrigo.

Quoted 43 lines

Let me know what you think.

Thank you,
./drv

Quoted 35 lines
Quoted 35 lines
Quoted 35 lines

---
 drivers/gpu/drm/i915/gvt/debugfs.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/gvt/debugfs.c +3 -3
index 03f081c3d9a4..baccbf1761b7 100644
@@ -165,7 +165,7 @@ static int vgpu_status_get(void *data, u64 *val)
 	return 0;
 }
 
-DEFINE_SIMPLE_ATTRIBUTE(vgpu_status_fops, vgpu_status_get, NULL, "0x%llx\n");
+DEFINE_DEBUGFS_ATTRIBUTE(vgpu_status_fops, vgpu_status_get, NULL, "0x%llx\n");
 
 /**
  * intel_gvt_debugfs_add_vgpu - register debugfs entries for a vGPU
@@ -182,8 +182,8 @@ void intel_gvt_debugfs_add_vgpu(struct intel_vgpu *vgpu)
 			    &vgpu_mmio_diff_fops);
 	debugfs_create_file_unsafe("scan_nonprivbb", 0644, vgpu->debugfs, vgpu,
 				   &vgpu_scan_nonprivbb_fops);
-	debugfs_create_file("status", 0644, vgpu->debugfs, vgpu,
-			    &vgpu_status_fops);
+	debugfs_create_file_unsafe("status", 0644, vgpu->debugfs, vgpu,
+				   &vgpu_status_fops);
 }
 
 /**
Signature · 1 line
2.34.1
#7 lore raw

Re: [PATCH 2/2] drm/i915/gvt: Avoid full proxy f_ops for vgpu_status debug attributes

Quoted 10 lines · Rodrigo Vivi
Quoted 9 lines
Quoted 2 lines

Actually, could you please address the checkpatch issues before we can push? Sorry about that, but just noticed now when I was going to push the other ones.

Hello Rodrigo,
The checkpatch warning is associated with the long "make coccicheck ..." command in the commit message. It is not part of the code, so is should not be carried forward into the code base.
If you still want me to correct it, I will need to split it into two lines which I think still violates the commit description guidelines.

Quoted 3 lines

This part I would just ignore or fix myself while merging. But the next one about the parenthesis alignment need to be fixed in the code so we need another version. Since we try to avoid touching the code between CI and merge.

I am sorry, but I am unable to locate the "second checkpatch complaint" you are referring to. I have received only the following from the checkpatch robot:

== Summary ==

Error: dim checkpatch failed
4c95e9b71212 drm/i915/gvt: Avoid full proxy f_ops for scan_nonprivbb debug attributes
-:21: WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line) #21:
make coccicheck M=drivers/gpu/drm/i915/ MODE=patch COCCI=./scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci

total: 0 errors, 1 warnings, 0 checks, 22 lines checked
33d68a01cad3 drm/i915/gvt: Avoid full proxy f_ops for vgpu_status debug attributes
-:21: WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line) #21:
make coccicheck M=drivers/gpu/drm/i915/ MODE=patch COCCI=./scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci

total: 0 errors, 1 warnings, 0 checks, 18 lines checked

===============================

Quoted 5 lines

Then, since you need to change that, while changing that, also please break the coccinelle line in the commit msg.

I'd appreciate to have the patch for the pxp as well :)

Sure. As mentioned in the other thread, I am looking into it and would submit a patch accordingly.

Thank you,
./drv

Quoted 48 lines

Thanks a lot,
Rodrigo.

Quoted 43 lines

Let me know what you think.

Thank you,
./drv

Quoted 35 lines
Quoted 35 lines
Quoted 35 lines

---
 drivers/gpu/drm/i915/gvt/debugfs.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/gvt/debugfs.c +3 -3
index 03f081c3d9a4..baccbf1761b7 100644
@@ -165,7 +165,7 @@ static int vgpu_status_get(void *data, u64 *val)
 	return 0;
 }
 
-DEFINE_SIMPLE_ATTRIBUTE(vgpu_status_fops, vgpu_status_get, NULL, "0x%llx\n");
+DEFINE_DEBUGFS_ATTRIBUTE(vgpu_status_fops, vgpu_status_get, NULL, "0x%llx\n");
 
 /**
  * intel_gvt_debugfs_add_vgpu - register debugfs entries for a vGPU
@@ -182,8 +182,8 @@ void intel_gvt_debugfs_add_vgpu(struct intel_vgpu *vgpu)
 			    &vgpu_mmio_diff_fops);
 	debugfs_create_file_unsafe("scan_nonprivbb", 0644, vgpu->debugfs, vgpu,
 				   &vgpu_scan_nonprivbb_fops);
-	debugfs_create_file("status", 0644, vgpu->debugfs, vgpu,
-			    &vgpu_status_fops);
+	debugfs_create_file_unsafe("status", 0644, vgpu->debugfs, vgpu,
+				   &vgpu_status_fops);
 }
 
 /**
Signature · 1 line
2.34.1
maintainer
#8 lore raw

Re: [PATCH 2/2] drm/i915/gvt: Avoid full proxy f_ops for vgpu_status debug attributes

Quoted 26 lines · Deepak R Varma
Quoted 10 lines · Rodrigo Vivi
Quoted 9 lines
Quoted 2 lines

Actually, could you please address the checkpatch issues before we can push? Sorry about that, but just noticed now when I was going to push the other ones.

Hello Rodrigo,
The checkpatch warning is associated with the long "make coccicheck ..." command in the commit message. It is not part of the code, so is should not be carried forward into the code base.
If you still want me to correct it, I will need to split it into two lines which I think still violates the commit description guidelines.

Quoted 3 lines

This part I would just ignore or fix myself while merging. But the next one about the parenthesis alignment need to be fixed in the code so we need another version. Since we try to avoid touching the code between CI and merge.

I am sorry, but I am unable to locate the "second checkpatch complaint" you are referring to. I have received only the following from the checkpatch robot:

== Summary ==

Error: dim checkpatch failed
4c95e9b71212 drm/i915/gvt: Avoid full proxy f_ops for scan_nonprivbb debug attributes
-:21: WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line) #21:
make coccicheck M=drivers/gpu/drm/i915/ MODE=patch COCCI=./scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci

Quoted 8 lines

total: 0 errors, 1 warnings, 0 checks, 22 lines checked
33d68a01cad3 drm/i915/gvt: Avoid full proxy f_ops for vgpu_status debug attributes
-:21: WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line) #21:
make coccicheck M=drivers/gpu/drm/i915/ MODE=patch COCCI=./scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci

total: 0 errors, 1 warnings, 0 checks, 18 lines checked

doh, my bad! this gvt patch is indeed right. up to gvt folks to modify this line when merging or to ignore...

The problem I mentioned was in the other series. Sorry for the noise.

but for the record:

-:47: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #47: FILE: drivers/gpu/drm/i915/display/intel_drrs.c:386:
+ debugfs_create_file_unsafe("i915_drrs_ctl", 0644, crtc->base.debugfs_entry,
+ crtc, &intel_drrs_debugfs_ctl_fops);

Quoted 64 lines

===============================

Quoted 5 lines

Then, since you need to change that, while changing that, also please break the coccinelle line in the commit msg.

I'd appreciate to have the patch for the pxp as well :)

Sure. As mentioned in the other thread, I am looking into it and would submit a patch accordingly.

Thank you,
./drv

Quoted 48 lines

Thanks a lot,
Rodrigo.

Quoted 43 lines

Let me know what you think.

Thank you,
./drv

Quoted 35 lines
Quoted 35 lines
Quoted 35 lines

---
 drivers/gpu/drm/i915/gvt/debugfs.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/gvt/debugfs.c +3 -3
index 03f081c3d9a4..baccbf1761b7 100644
@@ -165,7 +165,7 @@ static int vgpu_status_get(void *data, u64 *val)
 	return 0;
 }
 
-DEFINE_SIMPLE_ATTRIBUTE(vgpu_status_fops, vgpu_status_get, NULL, "0x%llx\n");
+DEFINE_DEBUGFS_ATTRIBUTE(vgpu_status_fops, vgpu_status_get, NULL, "0x%llx\n");
 
 /**
  * intel_gvt_debugfs_add_vgpu - register debugfs entries for a vGPU
@@ -182,8 +182,8 @@ void intel_gvt_debugfs_add_vgpu(struct intel_vgpu *vgpu)
 			    &vgpu_mmio_diff_fops);
 	debugfs_create_file_unsafe("scan_nonprivbb", 0644, vgpu->debugfs, vgpu,
 				   &vgpu_scan_nonprivbb_fops);
-	debugfs_create_file("status", 0644, vgpu->debugfs, vgpu,
-			    &vgpu_status_fops);
+	debugfs_create_file_unsafe("status", 0644, vgpu->debugfs, vgpu,
+				   &vgpu_status_fops);
 }
 
 /**
Signature · 1 line
2.34.1
Acked-by
#9 lore raw

Re: [PATCH 2/2] drm/i915/gvt: Avoid full proxy f_ops for vgpu_status debug attributes

In reply to Rodrigo Vivi
Quoted 19 lines · Rodrigo Vivi
Quoted 14 lines · Deepak R Varma

Using DEFINE_SIMPLE_ATTRIBUTE macro with the debugfs_create_file() function adds the overhead of introducing a proxy file operation functions to wrap the original read/write inside file removal protection functions. This adds significant overhead in terms of introducing and managing the proxy factory file operations structure and function wrapping at runtime.
As a replacement, a combination of DEFINE_DEBUGFS_ATTRIBUTE macro paired with debugfs_create_file_unsafe() is suggested to be used instead. The DEFINE_DEBUGFS_ATTRIBUTE utilises debugfs_file_get() and debugfs_file_put() wrappers to protect the original read and write function calls for the debug attributes. There is no need for any runtime proxy file operations to be managed by the debugfs core. Following coccicheck make command helped identify this change:

Quoted 3 lines

make coccicheck M=drivers/gpu/drm/i915/ MODE=patch COCCI=./scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci

Quoted 8 lines

I believe these 2 gvt cases could be done in one patch. But anyways,

for both patches... and will leave these 2 patches for gvt folks
to apply. Unless they ack and I apply in the drm-intel along with the other ones.

yeah, they're fine with me, feel free to apply them directly.

thanks!

Quoted 33 lines
Quoted 33 lines
---
 drivers/gpu/drm/i915/gvt/debugfs.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/gvt/debugfs.c +3 -3
index 03f081c3d9a4..baccbf1761b7 100644
@@ -165,7 +165,7 @@ static int vgpu_status_get(void *data, u64 *val)
 	return 0;
 }
 
-DEFINE_SIMPLE_ATTRIBUTE(vgpu_status_fops, vgpu_status_get, NULL, "0x%llx\n");
+DEFINE_DEBUGFS_ATTRIBUTE(vgpu_status_fops, vgpu_status_get, NULL, "0x%llx\n");
 
 /**
  * intel_gvt_debugfs_add_vgpu - register debugfs entries for a vGPU
@@ -182,8 +182,8 @@ void intel_gvt_debugfs_add_vgpu(struct intel_vgpu *vgpu)
 			    &vgpu_mmio_diff_fops);
 	debugfs_create_file_unsafe("scan_nonprivbb", 0644, vgpu->debugfs, vgpu,
 				   &vgpu_scan_nonprivbb_fops);
-	debugfs_create_file("status", 0644, vgpu->debugfs, vgpu,
-			    &vgpu_status_fops);
+	debugfs_create_file_unsafe("status", 0644, vgpu->debugfs, vgpu,
+				   &vgpu_status_fops);
 }
 
 /**
Signature · 1 line
2.34.1
maintainer
#10 lore raw

Re: [Intel-gfx] [PATCH 2/2] drm/i915/gvt: Avoid full proxy f_ops for vgpu_status debug attributes

Quoted 25 lines · Zhenyu Wang
Quoted 24 lines · Rodrigo Vivi
Quoted 14 lines · Deepak R Varma

Using DEFINE_SIMPLE_ATTRIBUTE macro with the debugfs_create_file() function adds the overhead of introducing a proxy file operation functions to wrap the original read/write inside file removal protection functions. This adds significant overhead in terms of introducing and managing the proxy factory file operations structure and function wrapping at runtime.
As a replacement, a combination of DEFINE_DEBUGFS_ATTRIBUTE macro paired with debugfs_create_file_unsafe() is suggested to be used instead. The DEFINE_DEBUGFS_ATTRIBUTE utilises debugfs_file_get() and debugfs_file_put() wrappers to protect the original read and write function calls for the debug attributes. There is no need for any runtime proxy file operations to be managed by the debugfs core. Following coccicheck make command helped identify this change:

Quoted 3 lines

make coccicheck M=drivers/gpu/drm/i915/ MODE=patch COCCI=./scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci

I believe these 2 gvt cases could be done in one patch. But anyways,

Quoted 7 lines
Quoted 3 lines

for both patches... and will leave these 2 patches for gvt folks
to apply. Unless they ack and I apply in the drm-intel along with the other ones.

yeah, they're fine with me, feel free to apply them directly.

Unfortunately I got some conflicts when trying to apply on drm-intel-next.

We probably need a new version, and probably through gvt branches it will be easier to handle conflicts if they appear.

Quoted 36 lines

thanks!

Quoted 33 lines
Quoted 33 lines
---
 drivers/gpu/drm/i915/gvt/debugfs.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/gvt/debugfs.c +3 -3
index 03f081c3d9a4..baccbf1761b7 100644
@@ -165,7 +165,7 @@ static int vgpu_status_get(void *data, u64 *val)
 	return 0;
 }
 
-DEFINE_SIMPLE_ATTRIBUTE(vgpu_status_fops, vgpu_status_get, NULL, "0x%llx\n");
+DEFINE_DEBUGFS_ATTRIBUTE(vgpu_status_fops, vgpu_status_get, NULL, "0x%llx\n");
 
 /**
  * intel_gvt_debugfs_add_vgpu - register debugfs entries for a vGPU
@@ -182,8 +182,8 @@ void intel_gvt_debugfs_add_vgpu(struct intel_vgpu *vgpu)
 			    &vgpu_mmio_diff_fops);
 	debugfs_create_file_unsafe("scan_nonprivbb", 0644, vgpu->debugfs, vgpu,
 				   &vgpu_scan_nonprivbb_fops);
-	debugfs_create_file("status", 0644, vgpu->debugfs, vgpu,
-			    &vgpu_status_fops);
+	debugfs_create_file_unsafe("status", 0644, vgpu->debugfs, vgpu,
+				   &vgpu_status_fops);
 }
 
 /**
Signature · 1 line
2.34.1
#11 lore raw

Re: [Intel-gfx] [PATCH 2/2] drm/i915/gvt: Avoid full proxy f_ops for vgpu_status debug attributes

Quoted 30 lines · Rodrigo Vivi
Quoted 29 lines · Zhenyu Wang
Quoted 27 lines · Rodrigo Vivi
Quoted 14 lines · Deepak R Varma

Using DEFINE_SIMPLE_ATTRIBUTE macro with the debugfs_create_file() function adds the overhead of introducing a proxy file operation functions to wrap the original read/write inside file removal protection functions. This adds significant overhead in terms of introducing and managing the proxy factory file operations structure and function wrapping at runtime.
As a replacement, a combination of DEFINE_DEBUGFS_ATTRIBUTE macro paired with debugfs_create_file_unsafe() is suggested to be used instead. The DEFINE_DEBUGFS_ATTRIBUTE utilises debugfs_file_get() and debugfs_file_put() wrappers to protect the original read and write function calls for the debug attributes. There is no need for any runtime proxy file operations to be managed by the debugfs core. Following coccicheck make command helped identify this change:

Quoted 3 lines

make coccicheck M=drivers/gpu/drm/i915/ MODE=patch COCCI=./scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci

I believe these 2 gvt cases could be done in one patch. But anyways,

for both patches... and will leave these 2 patches for gvt folks
to apply. Unless they ack and I apply in the drm-intel along with the other ones.

Quoted 8 lines
Quoted 3 lines

yeah, they're fine with me, feel free to apply them directly.

Unfortunately I got some conflicts when trying to apply on drm-intel-next.

We probably need a new version, and probably through gvt branches it will be easier to handle conflicts if they appear.

Hello Rodrigo,
Sure. I will send in a new version. I am current using linux-next git repo as my remote origin [tag 20230113]. Are there any specific instruction/location from where I should access the gvt branch?

Thank you.

Quoted 39 lines
Quoted 37 lines

thanks!

Quoted 33 lines
Quoted 33 lines
---
 drivers/gpu/drm/i915/gvt/debugfs.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/gvt/debugfs.c +3 -3
index 03f081c3d9a4..baccbf1761b7 100644
@@ -165,7 +165,7 @@ static int vgpu_status_get(void *data, u64 *val)
 	return 0;
 }
 
-DEFINE_SIMPLE_ATTRIBUTE(vgpu_status_fops, vgpu_status_get, NULL, "0x%llx\n");
+DEFINE_DEBUGFS_ATTRIBUTE(vgpu_status_fops, vgpu_status_get, NULL, "0x%llx\n");
 
 /**
  * intel_gvt_debugfs_add_vgpu - register debugfs entries for a vGPU
@@ -182,8 +182,8 @@ void intel_gvt_debugfs_add_vgpu(struct intel_vgpu *vgpu)
 			    &vgpu_mmio_diff_fops);
 	debugfs_create_file_unsafe("scan_nonprivbb", 0644, vgpu->debugfs, vgpu,
 				   &vgpu_scan_nonprivbb_fops);
-	debugfs_create_file("status", 0644, vgpu->debugfs, vgpu,
-			    &vgpu_status_fops);
+	debugfs_create_file_unsafe("status", 0644, vgpu->debugfs, vgpu,
+				   &vgpu_status_fops);
 }
 
 /**
Signature · 1 line
2.34.1
maintainer
#12 lore raw

Re: [Intel-gfx] [PATCH 2/2] drm/i915/gvt: Avoid full proxy f_ops for vgpu_status debug attributes

Quoted 37 lines · Deepak R Varma
Quoted 36 lines · Rodrigo Vivi
Quoted 25 lines · Zhenyu Wang
Quoted 24 lines · Rodrigo Vivi
Quoted 14 lines · Deepak R Varma

Using DEFINE_SIMPLE_ATTRIBUTE macro with the debugfs_create_file() function adds the overhead of introducing a proxy file operation functions to wrap the original read/write inside file removal protection functions. This adds significant overhead in terms of introducing and managing the proxy factory file operations structure and function wrapping at runtime.
As a replacement, a combination of DEFINE_DEBUGFS_ATTRIBUTE macro paired with debugfs_create_file_unsafe() is suggested to be used instead. The DEFINE_DEBUGFS_ATTRIBUTE utilises debugfs_file_get() and debugfs_file_put() wrappers to protect the original read and write function calls for the debug attributes. There is no need for any runtime proxy file operations to be managed by the debugfs core. Following coccicheck make command helped identify this change:

Quoted 3 lines

make coccicheck M=drivers/gpu/drm/i915/ MODE=patch COCCI=./scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci

I believe these 2 gvt cases could be done in one patch. But anyways,

Quoted 7 lines
Quoted 3 lines

for both patches... and will leave these 2 patches for gvt folks
to apply. Unless they ack and I apply in the drm-intel along with the other ones.

yeah, they're fine with me, feel free to apply them directly.

Unfortunately I got some conflicts when trying to apply on drm-intel-next.

Quoted 7 lines
Quoted 2 lines

We probably need a new version, and probably through gvt branches it will be easier to handle conflicts if they appear.

Hello Rodrigo,
Sure. I will send in a new version. I am current using linux-next git repo as my remote origin [tag 20230113]. Are there any specific instruction/location from where I should access the gvt branch?

https://github.com/intel/gvt-linux.git

but with the linux-next your patch is probably right for them.

Quoted 44 lines

Thank you.

Quoted 39 lines
Quoted 37 lines

thanks!

Quoted 33 lines
Quoted 33 lines
---
 drivers/gpu/drm/i915/gvt/debugfs.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/gvt/debugfs.c +3 -3
index 03f081c3d9a4..baccbf1761b7 100644
@@ -165,7 +165,7 @@ static int vgpu_status_get(void *data, u64 *val)
 	return 0;
 }
 
-DEFINE_SIMPLE_ATTRIBUTE(vgpu_status_fops, vgpu_status_get, NULL, "0x%llx\n");
+DEFINE_DEBUGFS_ATTRIBUTE(vgpu_status_fops, vgpu_status_get, NULL, "0x%llx\n");
 
 /**
  * intel_gvt_debugfs_add_vgpu - register debugfs entries for a vGPU
@@ -182,8 +182,8 @@ void intel_gvt_debugfs_add_vgpu(struct intel_vgpu *vgpu)
 			    &vgpu_mmio_diff_fops);
 	debugfs_create_file_unsafe("scan_nonprivbb", 0644, vgpu->debugfs, vgpu,
 				   &vgpu_scan_nonprivbb_fops);
-	debugfs_create_file("status", 0644, vgpu->debugfs, vgpu,
-			    &vgpu_status_fops);
+	debugfs_create_file_unsafe("status", 0644, vgpu->debugfs, vgpu,
+				   &vgpu_status_fops);
 }
 
 /**
Signature · 1 line
2.34.1
#13 lore raw

Re: [Intel-gfx] [PATCH 2/2] drm/i915/gvt: Avoid full proxy f_ops for vgpu_status debug attributes

Quoted 41 lines · Rodrigo Vivi
Quoted 40 lines · Deepak R Varma
Quoted 38 lines · Rodrigo Vivi
Quoted 25 lines · Zhenyu Wang
Quoted 24 lines · Rodrigo Vivi
Quoted 14 lines · Deepak R Varma

Using DEFINE_SIMPLE_ATTRIBUTE macro with the debugfs_create_file() function adds the overhead of introducing a proxy file operation functions to wrap the original read/write inside file removal protection functions. This adds significant overhead in terms of introducing and managing the proxy factory file operations structure and function wrapping at runtime.
As a replacement, a combination of DEFINE_DEBUGFS_ATTRIBUTE macro paired with debugfs_create_file_unsafe() is suggested to be used instead. The DEFINE_DEBUGFS_ATTRIBUTE utilises debugfs_file_get() and debugfs_file_put() wrappers to protect the original read and write function calls for the debug attributes. There is no need for any runtime proxy file operations to be managed by the debugfs core. Following coccicheck make command helped identify this change:

Quoted 3 lines

make coccicheck M=drivers/gpu/drm/i915/ MODE=patch COCCI=./scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci

I believe these 2 gvt cases could be done in one patch. But anyways,

Quoted 7 lines
Quoted 3 lines

for both patches... and will leave these 2 patches for gvt folks
to apply. Unless they ack and I apply in the drm-intel along with the other ones.

yeah, they're fine with me, feel free to apply them directly.

Unfortunately I got some conflicts when trying to apply on drm-intel-next.

We probably need a new version, and probably through gvt branches it will be easier to handle conflicts if they appear.

Quoted 9 lines
Quoted 4 lines

Hello Rodrigo,
Sure. I will send in a new version. I am current using linux-next git repo as my remote origin [tag 20230113]. Are there any specific instruction/location from where I should access the gvt branch?

https://github.com/intel/gvt-linux.git

but with the linux-next your patch is probably right for them.

yeah, I think so as currently from last pull request I don't have other updates in gvt tree, maybe it's just d-i-n hasn't included recent gvt change.

I saw Deepak sent a new one, feel free to apply. Let me know if there's still any issue.

thanks!

Quoted 38 lines
Quoted 38 lines
Quoted 36 lines
Quoted 34 lines
Quoted 34 lines
Quoted 34 lines
---
 drivers/gpu/drm/i915/gvt/debugfs.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/gvt/debugfs.c +3 -3
index 03f081c3d9a4..baccbf1761b7 100644
@@ -165,7 +165,7 @@ static int vgpu_status_get(void *data, u64 *val)
 	return 0;
 }
 
-DEFINE_SIMPLE_ATTRIBUTE(vgpu_status_fops, vgpu_status_get, NULL, "0x%llx\n");
+DEFINE_DEBUGFS_ATTRIBUTE(vgpu_status_fops, vgpu_status_get, NULL, "0x%llx\n");
 
 /**
  * intel_gvt_debugfs_add_vgpu - register debugfs entries for a vGPU
@@ -182,8 +182,8 @@ void intel_gvt_debugfs_add_vgpu(struct intel_vgpu *vgpu)
 			    &vgpu_mmio_diff_fops);
 	debugfs_create_file_unsafe("scan_nonprivbb", 0644, vgpu->debugfs, vgpu,
 				   &vgpu_scan_nonprivbb_fops);
-	debugfs_create_file("status", 0644, vgpu->debugfs, vgpu,
-			    &vgpu_status_fops);
+	debugfs_create_file_unsafe("status", 0644, vgpu->debugfs, vgpu,
+				   &vgpu_status_fops);
 }
 
 /**
Signature · 1 line
2.34.1
maintainer
#14 lore raw

Re: [Intel-gfx] [PATCH 2/2] drm/i915/gvt: Avoid full proxy f_ops for vgpu_status debug attributes

Quoted 52 lines · Zhenyu Wang
Quoted 41 lines · Rodrigo Vivi
Quoted 40 lines · Deepak R Varma
Quoted 38 lines · Rodrigo Vivi
Quoted 25 lines · Zhenyu Wang
Quoted 24 lines · Rodrigo Vivi
Quoted 14 lines · Deepak R Varma

Using DEFINE_SIMPLE_ATTRIBUTE macro with the debugfs_create_file() function adds the overhead of introducing a proxy file operation functions to wrap the original read/write inside file removal protection functions. This adds significant overhead in terms of introducing and managing the proxy factory file operations structure and function wrapping at runtime.
As a replacement, a combination of DEFINE_DEBUGFS_ATTRIBUTE macro paired with debugfs_create_file_unsafe() is suggested to be used instead. The DEFINE_DEBUGFS_ATTRIBUTE utilises debugfs_file_get() and debugfs_file_put() wrappers to protect the original read and write function calls for the debug attributes. There is no need for any runtime proxy file operations to be managed by the debugfs core. Following coccicheck make command helped identify this change:

Quoted 3 lines

make coccicheck M=drivers/gpu/drm/i915/ MODE=patch COCCI=./scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci

I believe these 2 gvt cases could be done in one patch. But anyways,

Quoted 7 lines
Quoted 3 lines

for both patches... and will leave these 2 patches for gvt folks
to apply. Unless they ack and I apply in the drm-intel along with the other ones.

yeah, they're fine with me, feel free to apply them directly.

Unfortunately I got some conflicts when trying to apply on drm-intel-next.

We probably need a new version, and probably through gvt branches it will be easier to handle conflicts if they appear.

Quoted 9 lines
Quoted 4 lines

Hello Rodrigo,
Sure. I will send in a new version. I am current using linux-next git repo as my remote origin [tag 20230113]. Are there any specific instruction/location from where I should access the gvt branch?

https://github.com/intel/gvt-linux.git

but with the linux-next your patch is probably right for them.

Quoted 6 lines

yeah, I think so as currently from last pull request I don't have other updates in gvt tree, maybe it's just d-i-n hasn't included recent gvt change.

I saw Deepak sent a new one, feel free to apply. Let me know if there's still any issue.

It still doesn't apply in drm-intel-next.
Could you please take it through your branch?

Quoted 41 lines

thanks!

Quoted 38 lines
Quoted 38 lines
Quoted 36 lines
Quoted 34 lines
Quoted 34 lines
Quoted 34 lines
---
 drivers/gpu/drm/i915/gvt/debugfs.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/gvt/debugfs.c +3 -3
index 03f081c3d9a4..baccbf1761b7 100644
@@ -165,7 +165,7 @@ static int vgpu_status_get(void *data, u64 *val)
 	return 0;
 }
 
-DEFINE_SIMPLE_ATTRIBUTE(vgpu_status_fops, vgpu_status_get, NULL, "0x%llx\n");
+DEFINE_DEBUGFS_ATTRIBUTE(vgpu_status_fops, vgpu_status_get, NULL, "0x%llx\n");
 
 /**
  * intel_gvt_debugfs_add_vgpu - register debugfs entries for a vGPU
@@ -182,8 +182,8 @@ void intel_gvt_debugfs_add_vgpu(struct intel_vgpu *vgpu)
 			    &vgpu_mmio_diff_fops);
 	debugfs_create_file_unsafe("scan_nonprivbb", 0644, vgpu->debugfs, vgpu,
 				   &vgpu_scan_nonprivbb_fops);
-	debugfs_create_file("status", 0644, vgpu->debugfs, vgpu,
-			    &vgpu_status_fops);
+	debugfs_create_file_unsafe("status", 0644, vgpu->debugfs, vgpu,
+				   &vgpu_status_fops);
 }
 
 /**
Signature · 1 line
2.34.1
#15 lore raw

Re: [Intel-gfx] [PATCH 2/2] drm/i915/gvt: Avoid full proxy f_ops for vgpu_status debug attributes

Quoted 4 lines · Rodrigo Vivi

It still doesn't apply in drm-intel-next.
Could you please take it through your branch?

sure, I'll pick it.