Skip to content

update zen_workaround for kernels > 6.16 and C23#4006

Merged
rocallahan merged 1 commit intorr-debugger:masterfrom
GitMensch:patch-3
Aug 23, 2025
Merged

update zen_workaround for kernels > 6.16 and C23#4006
rocallahan merged 1 commit intorr-debugger:masterfrom
GitMensch:patch-3

Conversation

@GitMensch
Copy link
Contributor

kernel functions renamed in 7cbc2ba7c107a1a537524ae505e192f4f88cc209 and 6fe22abacd40e259fffec744a02d5ca3febccd68 which both arrived with 6.16. rc1

fixes #4004

co-authored by @symphorien

@symphorien
Copy link

it does not build

make: Leaving directory '/nix/store/2l0bd52ch90r0r1msj0banw4smii8igk-linux-6.16-dev/lib/modules/6.16.0/build'
error: builder for '/nix/store/whb5j2vqai8zxk714k1ws86d17afd402-rr-zen_workaround-5.9.0.drv' failed with exit code 2;
       last 25 log lines:
       >   CC [M]  zen_workaround.o
       > zen_workaround.c: In function 'edit_ls_cfg_on_cpu':
       > zen_workaround.c:38:14: error: implicit declaration of function 'rdmsrl_safe'; did you mean 'rdmsrq_safe'? [-Wimplicit-function-declaration]
       >    38 |         if (!rdmsrl_safe(MSR_AMD64_LS_CFG, &value)) {
       >       |              ^~~~~~~~~~~
       >       |              rdmsrq_safe
       > zen_workaround.c:41:22: error: implicit declaration of function 'wrmsrl_safe'; did you mean 'wrmsr_safe'? [-Wimplicit-function-declaration]
       >    41 |                 if (!wrmsrl_safe(MSR_AMD64_LS_CFG, new_value)) {
       >       |                      ^~~~~~~~~~~
       >       |                      wrmsr_safe
       > zen_workaround.c: At top level:
       > zen_workaround.c:59:6: warning: no previous prototype for 'on_write_msr' [-Wmissing-prototypes]
       >    59 | void on_write_msr(void *data, unsigned int msr, u64 val, int failed)
       >       |      ^~~~~~~~~~~~
       > zen_workaround.c: In function 'on_write_msr':
       > zen_workaround.c:62:17: error: implicit declaration of function 'native_wrmsrl'; did you mean 'native_wrmsr'? [-Wimplicit-function-declaration]
       >    62 |                 native_wrmsrl(MSR_AMD64_LS_CFG, set_speclockmap_disable(val));
       >       |                 ^~~~~~~~~~~~~
       >       |                 native_wrmsr
       > make[3]: *** [/nix/store/2l0bd52ch90r0r1msj0banw4smii8igk-linux-6.16-dev/lib/modules/6.16.0/source/scripts/Makefile.build:287: zen_workaround.o] Error 1
       > make[2]: *** [/nix/store/2l0bd52ch90r0r1msj0banw4smii8igk-linux-6.16-dev/lib/modules/6.16.0/source/Makefile:2003: .] Error 2
       > make[1]: *** [/nix/store/2l0bd52ch90r0r1msj0banw4smii8igk-linux-6.16-dev/lib/modules/6.16.0/source/Makefile:248: __sub-make] Error 2
       > make[1]: Leaving directory '/build/source/third-party/zen-pmu-workaround'
       > make: *** [/nix/store/2l0bd52ch90r0r1msj0banw4smii8igk-linux-6.16-dev/lib/modules/6.16.0/source/Makefile:248: __sub-make] Error 2
       > make: Leaving directory '/nix/store/2l0bd52ch90r0r1msj0banw4smii8igk-linux-6.16-dev/lib/modules/6.16.0/build'
       For full logs, run:
         nix-store -l /nix/store/whb5j2vqai8zxk714k1ws86d17afd402-rr-zen_workaround-5.9.0.drv

I think you forgot to replace the ls by qs in the function names.

@GitMensch
Copy link
Contributor Author

can you please note what the error in the patch is?

@dzaima
Copy link
Contributor

dzaima commented Aug 20, 2025

You added #define wrmsrq_safe wrmsrl_safe & co, but don't ever use the wrmsrq_safe you define, as the code still has wrmsrl_safe.

@symphorien
Copy link

To gain time I opened another PR #4007

* follow kernel function rename
* use defines for old names with old kernels
* include appropriate headers and
  explicit mark static functions

kernel functions renamed in 7cbc2ba7c107a1a537524ae505e192f4f88cc209
and 6fe22abacd40e259fffec744a02d5ca3febccd68 which both arrived with 6.16. rc1

fixes rr-debugger#4004

co-authored by @symphorien  Guillaume Girol
@GitMensch
Copy link
Contributor Author

Thanks,. I've rebased and force-pushed

@rocallahan rocallahan merged commit 86aa1eb into rr-debugger:master Aug 23, 2025
@GitMensch GitMensch deleted the patch-3 branch August 24, 2025 10:59
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.

zen-pmu-workaround fails to build on linux 6.16

4 participants

Comments