drm/xe/pf: Skip VRAM auto-provisioning if already provisioned#309
drm/xe/pf: Skip VRAM auto-provisioning if already provisioned#309akanksh5-intc wants to merge 3 commits intointel-gpu:oot-backport/mainfrom
Conversation
Add AC_FREE_ATTRIBUTE_NOT_PRESENT macro call to AC_XE_CONFIG to enable detection of __free() cleanup attribute support during build configuration. Signed-off-by: Akanksha Hotta <akanksha.hotta@intel.com>
Add autoconf macro to detect if the __free() cleanup attribute is not
supported in the target kernel. This macro attempts to compile code using
the __free() attribute and defines BPM_FREE_ATTRIBUTE_NOT_PRESENT if
compilation fails, indicating the kernel doesn't support this feature.
Reference:
9b1ad184e4
drm/xe/pf: Skip VRAM auto-provisioning if already provisioned
Signed-off-by: Akanksha Hotta <akanksha.hotta@intel.com>
…tion
Error:
--------------------------------------------------------------------------
error: cleanup argument not a function
1847 | unsigned long *bitmap __free(bitmap) = bitmap_zalloc(allvfs, GFP_KERNEL);
| ^~~~~~~~
--------------------------------------------------------------------------
Signed-off-by: Akanksha Hotta <akanksha.hotta@intel.com>
e0a744c to
edff824
Compare
| AC_MATCH_TOKEN_UUID_NOT_PRESENT | ||
| AC_EXPORT_SYMBOL_FOR_MODULES_NOT_PRESENT | ||
| AC_DRM_MINOR_DEBUGFS_SYMLINK_NOT_PRESENT | ||
| AC_FREE_ATTRIBUTE_NOT_PRESENT |
There was a problem hiding this comment.
no need to add separate commits for autotools changes. all are part of single commit.
| @@ -0,0 +1,40 @@ | |||
| From 1816349e74052f52618f8a90d394aae5792e4fc6 Mon Sep 17 00:00:00 2001 | |||
There was a problem hiding this comment.
create a patch with zero sha commit.
| src/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c | 6 +++++- | ||
| 1 file changed, 5 insertions(+), 1 deletion(-) | ||
|
|
||
| diff --git a/src/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c b/src/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c |
There was a problem hiding this comment.
remove src directory name from patch. patches will apply inside src folder.
| { | ||
| unsigned int allvfs = 1 + xe_gt_sriov_pf_get_totalvfs(gt); /* PF plus VFs */ | ||
| - unsigned long *bitmap __free(bitmap) = bitmap_zalloc(allvfs, GFP_KERNEL); | ||
| + #ifndef BPM_FREE_ATTRIBUTE_NOT_PRESENT |
There was a problem hiding this comment.
changes should be part of inside true condition. actual source kernel code should not be changed.
| @@ -0,0 +1,18 @@ | |||
| dnl # | |||
| dnl # v6.17.13 - Cleanup attribute __free support | |||
There was a problem hiding this comment.
reference is wrong. please add actual kernel commit of upstream or mainline kernel.
| @@ -0,0 +1,18 @@ | |||
| dnl # | |||
| dnl # v6.17.13 - Cleanup attribute __free support | |||
| dnl # The __free() cleanup attribute was added in newer kernels | |||
| AC_KERNEL_TRY_COMPILE([ | ||
| #include <linux/slab.h> | ||
| ],[ | ||
| unsigned long *bitmap __free(bitmap) = bitmap_zalloc(1, GFP_KERNEL); |
There was a problem hiding this comment.
you are facing this issue ith 6.12 kernel as well?
There was a problem hiding this comment.
No, we're not facing any compilation issues.
| - unsigned long *bitmap __free(bitmap) = bitmap_zalloc(allvfs, GFP_KERNEL); | ||
| + #ifndef BPM_FREE_ATTRIBUTE_NOT_PRESENT | ||
| + unsigned long *bitmap __free(bitmap) = bitmap_zalloc(allvfs, GFP_KERNEL); | ||
| + #else |
There was a problem hiding this comment.
instead of adding a patch, can we fix this issue in backports headers/compat itself?
There was a problem hiding this comment.
yes we can do that.
In case VF's VRAM provisioning using sysfs is done by the admin prior to VFs enabling, this provisioning will be lost as PF will
run VRAM auto-provisioning anyway. To avoid that skip this auto-provisioning if any VF has been already provisioned with VRAM.
To help admin find any mistakes, add diagnostics messages about which VFs were provisioned with VRAM and which were missed.
Signed-off-by: Akanksha Hotta akanksha.hotta@intel.com