Skip to content

drm/xe/pf: Skip VRAM auto-provisioning if already provisioned#309

Open
akanksh5-intc wants to merge 3 commits intointel-gpu:oot-backport/mainfrom
akanksh5-intc:oot-backport-250326
Open

drm/xe/pf: Skip VRAM auto-provisioning if already provisioned#309
akanksh5-intc wants to merge 3 commits intointel-gpu:oot-backport/mainfrom
akanksh5-intc:oot-backport-250326

Conversation

@akanksh5-intc
Copy link
Contributor

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

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>
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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add kernel commit header here.

AC_KERNEL_TRY_COMPILE([
#include <linux/slab.h>
],[
unsigned long *bitmap __free(bitmap) = bitmap_zalloc(1, GFP_KERNEL);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are facing this issue ith 6.12 kernel as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of adding a patch, can we fix this issue in backports headers/compat itself?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes we can do that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants