Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to support linux kernel 6.7.x #168

Merged
merged 1 commit into from
May 8, 2024
Merged

Try to support linux kernel 6.7.x #168

merged 1 commit into from
May 8, 2024

Conversation

shenwii
Copy link
Contributor

@shenwii shenwii commented May 7, 2024

When I updated Linux Kernel to 6.7.12, then it's does not build. So I fixed some files to make it build success on Linux 6.7.x.

It's tested on my PC.

  • OS: Debian Testing
  • Linux Kernel: 6.7.12-amd64
  • CPU: Intel N100

I have not other platforms, so I can't make sure it's can work on other platforms.

@NovaPixell
Copy link

I've just tried build for Intel N95, Kernel 6.8.4-2 PVE.

Make Logs:

/var/lib/dkms/i915-sriov-dkms/6.8.4-2/build/drivers/gpu/drm/i915/i915_memcpy.c: In function ‘i915_unaligned_memcpy_from_wc’:
/var/lib/dkms/i915-sriov-dkms/6.8.4-2/build/drivers/gpu/drm/i915/i915_memcpy.c:148:17: error: implicit declaration of function ‘memcpy’ [-Werror=implicit-function-declaration]
  148 |                 memcpy(dst, src, x);
      |                 ^~~~~~
/var/lib/dkms/i915-sriov-dkms/6.8.4-2/build/drivers/gpu/drm/i915/i915_memcpy.c:29:1: note: include ‘<string.h>’ or provide a declaration of ‘memcpy’
   28 | #include "i915_memcpy.h"
  +++ |+#include <string.h>
   29 |
/var/lib/dkms/i915-sriov-dkms/6.8.4-2/build/drivers/gpu/drm/i915/i915_memcpy.c:148:17: warning: incompatible implicit declaration of built-in function ‘memcpy’ [-Wbuiltin-declaration-mismatch]
  148 |                 memcpy(dst, src, x);
      |                 ^~~~~~
/var/lib/dkms/i915-sriov-dkms/6.8.4-2/build/drivers/gpu/drm/i915/i915_memcpy.c:148:17: note: include ‘<string.h>’ or provide a declaration of ‘memcpy’
/var/lib/dkms/i915-sriov-dkms/6.8.4-2/build/drivers/gpu/drm/i915/i915_memcpy.c: In function ‘i915_memcpy_init_early’:
/var/lib/dkms/i915-sriov-dkms/6.8.4-2/build/drivers/gpu/drm/i915/i915_memcpy.c:165:13: error: implicit declaration of function ‘static_cpu_has’; did you mean ‘static_key_false’? [-Werror=implicit-function-declaration]
  165 |         if (static_cpu_has(X86_FEATURE_XMM4_1) &&
      |             ^~~~~~~~~~~~~~
      |             static_key_false
/var/lib/dkms/i915-sriov-dkms/6.8.4-2/build/drivers/gpu/drm/i915/i915_memcpy.c:166:14: error: implicit declaration of function ‘boot_cpu_has’ [-Werror=implicit-function-declaration]
  166 |             !boot_cpu_has(X86_FEATURE_HYPERVISOR))
      |              ^~~~~~~~~~~~
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:243: /var/lib/dkms/i915-sriov-dkms/6.8.4-2/build/drivers/gpu/drm/i915/i915_memcpy.o] Error 1
make[1]: *** [/usr/src/linux-headers-6.8.4-2-pve/Makefile:1926: /var/lib/dkms/i915-sriov-dkms/6.8.4-2/build] Error 2
make: *** [Makefile:240: __sub-make] Error 2
make: Leaving directory '/usr/src/linux-headers-6.8.4-2-pve'

@ich777
Copy link
Contributor

ich777 commented May 7, 2024

I can confirm that it builds against Kernel 6.7.12, still needs to be tested.
Thank you @shenwii great work! :)

But fails against Kernel 6.8.9 (but that was not the point of this PR anyways):

/usr/src/i915-sriov-dkms/drivers/gpu/drm/i915/i915_memcpy.c:36:8: error: type defaults to 'int' in declaration of 'DEFINE_STATIC_KEY_FALSE' [-Werror=implicit-int]
   36 | static DEFINE_STATIC_KEY_FALSE(has_movntdqa);
      |        ^~~~~~~~~~~~~~~~~~~~~~~
/usr/src/i915-sriov-dkms/drivers/gpu/drm/i915/i915_memcpy.c:36:1: warning: parameter names (without types) in function declaration
   36 | static DEFINE_STATIC_KEY_FALSE(has_movntdqa);
      | ^~~~~~
/usr/src/i915-sriov-dkms/drivers/gpu/drm/i915/i915_memcpy.c: In function 'i915_memcpy_from_wc':
/usr/src/i915-sriov-dkms/drivers/gpu/drm/i915/i915_memcpy.c:118:13: error: implicit declaration of function 'static_branch_likely' [-Werror=implicit-function-declaration]
  118 |         if (static_branch_likely(&has_movntdqa)) {
      |             ^~~~~~~~~~~~~~~~~~~~
  CC [M]  /usr/src/i915-sriov-dkms/drivers/gpu/drm/i915/i915_sw_fence_work.o
/usr/src/i915-sriov-dkms/drivers/gpu/drm/i915/i915_memcpy.c:118:35: error: 'has_movntdqa' undeclared (first use in this function)
  118 |         if (static_branch_likely(&has_movntdqa)) {
      |                                   ^~~~~~~~~~~~
/usr/src/i915-sriov-dkms/drivers/gpu/drm/i915/i915_memcpy.c:118:35: note: each undeclared identifier is reported only once for each function it appears in
/usr/src/i915-sriov-dkms/drivers/gpu/drm/i915/i915_memcpy.c: In function 'i915_unaligned_memcpy_from_wc':
/usr/src/i915-sriov-dkms/drivers/gpu/drm/i915/i915_memcpy.c:148:17: error: implicit declaration of function 'memcpy' [-Werror=implicit-function-declaration]
  148 |                 memcpy(dst, src, x);
      |                 ^~~~~~
/usr/src/i915-sriov-dkms/drivers/gpu/drm/i915/i915_memcpy.c:29:1: note: include '<string.h>' or provide a declaration of 'memcpy'
   28 | #include "i915_memcpy.h"
  +++ |+#include <string.h>
   29 | 
/usr/src/i915-sriov-dkms/drivers/gpu/drm/i915/i915_memcpy.c:148:17: warning: incompatible implicit declaration of built-in function 'memcpy' [-Wbuiltin-declaration-mismatch]
  148 |                 memcpy(dst, src, x);
      |                 ^~~~~~
/usr/src/i915-sriov-dkms/drivers/gpu/drm/i915/i915_memcpy.c:148:17: note: include '<string.h>' or provide a declaration of 'memcpy'
  CC [M]  /usr/src/i915-sriov-dkms/drivers/gpu/drm/i915/i915_syncmap.o
/usr/src/i915-sriov-dkms/drivers/gpu/drm/i915/i915_memcpy.c: In function 'i915_memcpy_init_early':
/usr/src/i915-sriov-dkms/drivers/gpu/drm/i915/i915_memcpy.c:165:13: error: implicit declaration of function 'static_cpu_has' [-Werror=implicit-function-declaration]
  165 |         if (static_cpu_has(X86_FEATURE_XMM4_1) &&
      |             ^~~~~~~~~~~~~~
/usr/src/i915-sriov-dkms/drivers/gpu/drm/i915/i915_memcpy.c:166:14: error: implicit declaration of function 'boot_cpu_has' [-Werror=implicit-function-declaration]
  166 |             !boot_cpu_has(X86_FEATURE_HYPERVISOR))
      |              ^~~~~~~~~~~~
/usr/src/i915-sriov-dkms/drivers/gpu/drm/i915/i915_memcpy.c:167:17: error: implicit declaration of function 'static_branch_enable' [-Werror=implicit-function-declaration]
  167 |                 static_branch_enable(&has_movntdqa);
      |                 ^~~~~~~~~~~~~~~~~~~~
  CC [M]  /usr/src/i915-sriov-dkms/drivers/gpu/drm/i915/i915_user_extensions.o
/usr/src/i915-sriov-dkms/drivers/gpu/drm/i915/i915_memcpy.c:167:39: error: 'has_movntdqa' undeclared (first use in this function)
  167 |                 static_branch_enable(&has_movntdqa);
      |                                       ^~~~~~~~~~~~

@NovaPixell this PR just fixes the build against 6.7.x

@ich777
Copy link
Contributor

ich777 commented May 7, 2024

@strongtz I think this can be merged, working fine on Kenerl 6.7.12:
attatchment Vs7LF5

@michael-pptf
Copy link
Contributor

Well, did anyone test for kernel < 6.7?

If it doesn't work, then the Issues board would be flooded with another wave of users who can't build on older kernels.

There must be a better way to do this than a Merge. Can we set tags, branches, or whatever it might be?

@ich777
Copy link
Contributor

ich777 commented May 7, 2024

@michael-pptf did you go through the PR?
The changes will only take effect when you build for Kernel 6.7+

You can still build it on older versions and it will not apply the necessary changes for Kernel 6.7

@michael-pptf
Copy link
Contributor

@michael-pptf did you go through the PR? The changes will only take effect when you buidl for Kernel 6.7+

You can still build it on older versions and it will not apply the necessary changes for Kernel 6.7

The last merged PR has already caused problems for couple of users, posted in issues. #161 #165 just to list two of them.

If this commit is made on top of that PR, it will be the same.

If we are dropping support for PVE 8.1/Kernel 6.5, please PR the README, too.

@ich777
Copy link
Contributor

ich777 commented May 7, 2024

The last merged PR has already caused problems for couple of users, posted in issues. #161 #165 just to list two of them.

Hmm good catch but how would you solve that?
The maintainer does not have any hardware more on hand and or better speaking doesn't use SR-IOV anymore.

If this commit is made on top of that PR, it will be the same.

Sure but what about the other users which are in need for this PR?
The build and module is still working fine form me with the old PR on Kernel 6.1.79 (including this patch).

I really don't know why it isn't working properly with Proxmox (I think I even did a build for Kernel 6.5.13 with the PR which causes issues on Proxmox which is working fine for me).

The main problem as I see it is that Intel has pushed official SR-IOV support past Kernel 6.9 now in the Xe driver because it's not ready yet as it seems and development will take a bit longer. Hopefully we will see it on of the next Kernel releases but this could take some time but I hope for the best.

@michael-pptf
Copy link
Contributor

The problem, as I see it, is the new firmware shipped with newer kernels.

I can't say it is every time, but most of the time, when Intel updates a bit of the i915 SRIOV code base, they will ship a slightly different firmware. They might be there just to support a new iGPU, a new Arc GPU or what not, but the slightest variations of the firmware would be problematic for this repo.

The main difference of this repo and Intel's is that we can only INFER what Intel has done based on the diffs. We have no idea why something is done, or something is done a particular way.

Ubuntu 24.04 LTS defaulted to kernel 6.8. It is only my guess that Intel has mainlined a stable build of their codebase and firmware shipped with 6.8 since it is selected for LTS, and the change is so drastic that this repo doesn't work anymore. If you think this makes any sense, then I'd say we choose a kernel < 6.8 and just have support for it. Where this intersects with Proxmox the best, I think, it's 6.2-6.5.

If people want to build on 6.7, that's fine, too. Although personally I don't see what is so attractive about 6.7 but to each of their own. We just need to include a branch, or a committer's repo even, for 6.7 - Then the main can stay with 6.5 and older.

@strongtz strongtz merged commit 3d7a1b3 into strongtz:master May 8, 2024
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.

5 participants