dkms modules not compiled with march=x86-64-v3 #270

Closed
opened 2025-02-20 16:50:50 +01:00 by mbod · 8 comments

I have installed linux-lts from v3 repo:

Name            : linux-lts
Version         : 6.12.15-1.1
...
Packager        : ALHP x86-64-v3 <alhp@harting.dev>

But when the zfs dkms modul is compiled it is not inheriting that march value but rather is compiled with just -march=x86-64:

root 13129 13123 99 16:48 pts/1 00:00:00 /usr/lib/gcc/x86_64-pc-linux-gnu/14.2.1/cc1 -quiet -nostdinc -I ./arch/x86/include -I ./arch/x86/include/generated -I ./include -I ./arch/x86/include/uapi -I ./arch/x86/include/generated/uapi -I ./include/uapi -I ./include/generated/uapi -D __KERNEL__ -D CC_USING_FENTRY -D MODULE -D CONFIG_MODULES -D KBUILD_BASENAME="config_zlib_inflate" -D KBUILD_MODNAME="config_zlib_inflate" -D __KBUILD_MODNAME=kmod_config_zlib_inflate -include ./include/linux/compiler-version.h -include ./include/linux/kconfig.h -include ./include/linux/compiler_types.h -MMD /var/lib/dkms/zfs/2.3.0/build/build/config_zlib_inflate/.config_zlib_inflate.o.d /var/lib/dkms/zfs/2.3.0/build/build/config_zlib_inflate/config_zlib_inflate.c -quiet -dumpdir /var/lib/dkms/zfs/2.3.0/build/build/config_zlib_inflate/ -dumpbase config_zlib_inflate.c -dumpbase-ext .c -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -m64 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -mtune=generic -mno-red-zone -mcmodel=kernel -mindirect-branch=thunk-extern -mindirect-branch-register -mindirect-branch-cs-prefix -mfunction-return=thunk-extern -mharden-sls=all -mrecord-mcount -mfentry -march=x86-64 ...

This is not the case for linux-tkg kernel or linux-cachyos-lts. Those kernels both inherit the march value to the zfs dkms module.

Why is that not happening for the ALHP kernel?

I have installed linux-lts from v3 repo: ``` Name : linux-lts Version : 6.12.15-1.1 ... Packager : ALHP x86-64-v3 <alhp@harting.dev> ``` But when the zfs dkms modul is compiled it is not inheriting that march value but rather is compiled with just -march=x86-64: `root 13129 13123 99 16:48 pts/1 00:00:00 /usr/lib/gcc/x86_64-pc-linux-gnu/14.2.1/cc1 -quiet -nostdinc -I ./arch/x86/include -I ./arch/x86/include/generated -I ./include -I ./arch/x86/include/uapi -I ./arch/x86/include/generated/uapi -I ./include/uapi -I ./include/generated/uapi -D __KERNEL__ -D CC_USING_FENTRY -D MODULE -D CONFIG_MODULES -D KBUILD_BASENAME="config_zlib_inflate" -D KBUILD_MODNAME="config_zlib_inflate" -D __KBUILD_MODNAME=kmod_config_zlib_inflate -include ./include/linux/compiler-version.h -include ./include/linux/kconfig.h -include ./include/linux/compiler_types.h -MMD /var/lib/dkms/zfs/2.3.0/build/build/config_zlib_inflate/.config_zlib_inflate.o.d /var/lib/dkms/zfs/2.3.0/build/build/config_zlib_inflate/config_zlib_inflate.c -quiet -dumpdir /var/lib/dkms/zfs/2.3.0/build/build/config_zlib_inflate/ -dumpbase config_zlib_inflate.c -dumpbase-ext .c -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -m64 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -mtune=generic -mno-red-zone -mcmodel=kernel -mindirect-branch=thunk-extern -mindirect-branch-register -mindirect-branch-cs-prefix -mfunction-return=thunk-extern -mharden-sls=all -mrecord-mcount -mfentry -march=x86-64 ...` This is not the case for linux-tkg kernel or linux-cachyos-lts. Those kernels both inherit the march value to the zfs dkms module. Why is that not happening for the ALHP kernel?
mbod changed title from dkms modules not compiled with march=x86-64-v3’ to dkms modules not compiled with march=x86-64-v3 2025-02-20 16:52:33 +01:00
Owner

Haven't had the time to do full research on this, but it may be due to how we enable vN in the kernel. If CachyOS and tkg use patched Kconfigs, then dkms modules probably inherit these options. Since we use KCFLAGS, they are probably not inherited.

Haven't had the time to do full research on this, but it may be due to how we enable vN in the kernel. If CachyOS and tkg use patched Kconfigs, then dkms modules probably inherit these options. Since we use `KCFLAGS`, they are probably not inherited.
Author

If that is the case it is bad. Modules which do compression or encryption for example, have a big benefit from -march=x86-64-v3

If that is the case it is bad. Modules which do compression or encryption for example, have a big benefit from `-march=x86-64-v3`
Owner

They are normally not out of tree :)

They are normally not out of tree :)
Author

They are normally not out of tree :)

All what dkms does is out-of-tree by definition. Does that mean the ALHP kernels are not supporting dkms? Thats a pity.

> They are normally not out of tree :) All what dkms does is out-of-tree by definition. Does that mean the ALHP kernels are not supporting dkms? Thats a pity.
Owner

All what dkms does is out-of-tree by definition. Does that mean the ALHP kernels are not supporting dkms? Thats a pity.

But not all what is out of tree is performance critical. I would not go as far as saying "dkms is not supported", that implies that dkms would not work, which is not the case at all. The user is responsible for setting any options they want, yes. With our current way of kernel compiling that's not avoidable.

If anyone wants to add an automated way of patching via Kconfigs, I'm always open to PRs.

> All what dkms does is out-of-tree by definition. Does that mean the ALHP kernels are not supporting dkms? Thats a pity. But not all what is out of tree is performance critical. I would not go as far as saying "dkms is not supported", that implies that dkms would not work, which is not the case at all. The user is responsible for setting any options they want, yes. With our current way of kernel compiling that's not avoidable. If anyone wants to add an **automated** way of patching via Kconfigs, I'm always open to PRs.
anonfunc added the bug label 2025-02-21 20:07:43 +01:00
Author

ok. But what that means is, that ALHP does not help to create a Linux environment full of -march=x86-64-v3. I can install the ALHP packages with -march=x86-64-v3 and I can edit /etc/makepkg.conf to make use of -march=x86-64-v3 for AUR packages. But then all DKMS modules will still be using only -march=x86-64. From my point of view tht is a bug in the AHLP kernels. Users are better off using the cachyos or linux-tkg kernels.

ok. But what that means is, that ALHP does not help to create a Linux environment full of `-march=x86-64-v3`. I can install the ALHP packages with `-march=x86-64-v3` and I can edit /etc/makepkg.conf to make use of `-march=x86-64-v3` for AUR packages. But then all DKMS modules will still be using only `-march=x86-64`. From my point of view tht is a bug in the AHLP kernels. Users are better off using the cachyos or linux-tkg kernels.
Owner

You can use whatever kernels you like, it's not like we have a warning somewhere, recommending against that.

create a Linux environment full

You won't have that with any of the available options, since not all packages actually compile fine on all feature levels (especially with -O3). If you really need to compile every DKMS module with these options, set the env correctly or use a different kernel.

You can use whatever kernels you like, it's not like we have a warning somewhere, recommending against that. > create a Linux environment full You won't have that with any of the available options, since not all packages actually compile fine on all feature levels (especially with `-O3`). If you really need to compile every DKMS module with these options, set the env correctly or use a different kernel.
anonfunc added wontfix and removed bug labels 2025-05-05 16:33:55 +02:00
Owner

Since this requires kernel patches, this will not be fixed. If anyone does come up with a low/free maintenance fix for this, PRs are open.

Since this requires kernel patches, this will not be fixed. If anyone does come up with a low/free maintenance fix for this, PRs are open.
Sign in to join this conversation.