Open Victorvkk38596 opened 3 months ago
Hi, thanks for your reporting. I will try to reproduce this bug in my environment (Maybe it will take much of time to ready for this arm64 environment).
This driver has been developed in kernel 5.10, and not support latest kernel. Maybe you can try it in kernel 5.10.
I am trying to install the module in Asahi Ubuntu ARM however I am encountering issues while making the module
EXTRA_CFLAGS="-O0 -g" make -C /lib/modules/
uname -r`/build M=/home/ubuntu/Desktop/system-register-tools/msr-arm modules make[1]: Entering directory '/usr/src/linux-headers-6.8.0-1008-apple-arm' warning: the compiler differs from the one used to build the kernel The kernel was built by: aarch64-linux-gnu-gcc-13 (Ubuntu 13.2.0-23ubuntu4) 13.2.0 You are using: gcc-13 (Ubuntu 13.2.0-23ubuntu4) 13.2.0 CC [M] /home/ubuntu/Desktop/system-register-tools/msr-arm/msr_insn.o In file included from /home/ubuntu/Desktop/system-register-tools/msr-arm/msr_insn.c:6: /home/ubuntu/Desktop/system-register-tools/msr-arm/msr_arm.h:104:37: warning: ‘struct undef_hook’ declared inside parameter list will not be visible outside of this definition or declaration 104~~~~~ /home/ubuntu/Desktop/system-register-tools/msr-arm/msr_arm.h:105:39: warning: ‘struct undef_hook’ declared inside parameter list will not be visible outside of this definition or declaration 105~~~~~ CC [M] /home/ubuntu/Desktop/system-register-tools/msr-arm/msr_arm.o In file included from /home/ubuntu/Desktop/system-register-tools/msr-arm/msr_arm.c:37: /home/ubuntu/Desktop/system-register-tools/msr-arm/msr_arm.h:104:37: warning: ‘struct undef_hook’ declared inside parameter list will not be visible outside of this definition or declaration 104~~~~~ /home/ubuntu/Desktop/system-register-tools/msr-arm/msr_arm.h:105:39: warning: ‘struct undef_hook’ declared inside parameter list will not be visible outside of this definition or declaration 105~~~~~ /home/ubuntu/Desktop/system-register-tools/msr-arm/msr_arm.c:78:15: error: variable ‘mrs_hook’ has initializer but incomplete type 78~~~~~ /home/ubuntu/Desktop/system-register-tools/msr-arm/msr_arm.c:79:10: error: ‘struct undef_hook’ has no member named ‘instr_mask’ 79~~~~~ /home/ubuntu/Desktop/system-register-tools/msr-arm/msr_arm.c:79:23: warning: excess elements in struct initializer 79~~~~~ /home/ubuntu/Desktop/system-register-tools/msr-arm/msr_arm.c:79:23: note: (near initialization for ‘mrs_hook’) /home/ubuntu/Desktop/system-register-tools/msr-arm/msr_arm.c:80:10: error: ‘struct undef_hook’ has no member named ‘instr_val’ 80~~~~ /home/ubuntu/Desktop/system-register-tools/msr-arm/msr_arm.c:80:23: warning: excess elements in struct initializer 80~~~~~ /home/ubuntu/Desktop/system-register-tools/msr-arm/msr_arm.c:80:23: note: (near initialization for ‘mrs_hook’) /home/ubuntu/Desktop/system-register-tools/msr-arm/msr_arm.c:81:10: error: ‘struct undef_hook’ has no member named ‘pstate_mask’ 81~~/home/ubuntu/Desktop/system-register-tools/msr-arm/msr_arm.h:35:27: warning: excess elements in struct initializer 35~~~~ /home/ubuntu/Desktop/system-register-tools/msr-arm/msr_arm.h:35:27: note: (near initialization for ‘mrs_hook’) 35~~~~ /home/ubuntu/Desktop/system-register-tools/msr-arm/msr_arm.c:82:10: error: ‘struct undef_hook’ has no member named ‘pstate_val’ 82~~~~~ /home/ubuntu/Desktop/system-register-tools/msr-arm/msr_arm.h:36:25: warning: excess elements in struct initializer 36~~~~~~ /home/ubuntu/Desktop/system-register-tools/msr-arm/msr_arm.h:36:25: note: (near initialization for ‘mrs_hook’) 36~~~~~~ /home/ubuntu/Desktop/system-register-tools/msr-arm/msr_arm.c:83:10: error: ‘struct undef_hook’ has no member named ‘fn’ 83~~/home/ubuntu/Desktop/system-register-tools/msr-arm/msr_arm.c:83:15: note: (near initialization for ‘mrs_hook’) /home/ubuntu/Desktop/system-register-tools/msr-arm/msr_arm.c:86:15: error: variable ‘msr_hook’ has initializer but incomplete type 86~~~~~ /home/ubuntu/Desktop/system-register-tools/msr-arm/msr_arm.c:87:10: error: ‘struct undef_hook’ has no member named ‘instr_mask’ 87~~~~~ /home/ubuntu/Desktop/system-register-tools/msr-arm/msr_arm.c:87:23: warning: excess elements in struct initializer 87~~~~~ /home/ubuntu/Desktop/system-register-tools/msr-arm/msr_arm.c:87:23: note: (near initialization for ‘msr_hook’) /home/ubuntu/Desktop/system-register-tools/msr-arm/msr_arm.c:88:10: error: ‘struct undef_hook’ has no member named ‘instr_val’ 88~~~~ /home/ubuntu/Desktop/system-register-tools/msr-arm/msr_arm.c:88:23: warning: excess elements in struct initializer 88~~~~~ /home/ubuntu/Desktop/system-register-tools/msr-arm/msr_arm.c:88:23: note: (near initialization for ‘msr_hook’) /home/ubuntu/Desktop/system-register-tools/msr-arm/msr_arm.c:89:10: error: ‘struct undef_hook’ has no member named ‘pstate_mask’ 89~~/home/ubuntu/Desktop/system-register-tools/msr-arm/msr_arm.h:35:27: warning: excess elements in struct initializer 35~~~~ /home/ubuntu/Desktop/system-register-tools/msr-arm/msr_arm.h:35:27: note: (near initialization for ‘msr_hook’) 35~~~~ /home/ubuntu/Desktop/system-register-tools/msr-arm/msr_arm.c:90:10: error: ‘struct undef_hook’ has no member named ‘pstate_val’ 90~~~~~ /home/ubuntu/Desktop/system-register-tools/msr-arm/msr_arm.h:36:25: warning: excess elements in struct initializer 36~~~~~~ /home/ubuntu/Desktop/system-register-tools/msr-arm/msr_arm.h:36:25: note: (near initialization for ‘msr_hook’) 36~~~~~~ /home/ubuntu/Desktop/system-register-tools/msr-arm/msr_arm.c:91:10: error: ‘struct undef_hook’ has no member named ‘fn’ 91~~/home/ubuntu/Desktop/system-register-tools/msr-arm/msr_arm.c:91:15: note: (near initialization for ‘msr_hook’) In file included from ./arch/arm64/include/asm/alternative.h:9, from ./arch/arm64/include/asm/lse.h:14, from ./arch/arm64/include/asm/cmpxchg.h:14, from ./arch/arm64/include/asm/atomic.h:16, from ./include/linux/atomic.h:7, from ./include/asm-generic/bitops/atomic.h:5, from ./arch/arm64/include/asm/bitops.h:25, from ./include/linux/bitops.h:68, from ./arch/arm64/include/asm/cache.h:40, from ./include/linux/cache.h:6, from ./include/linux/time.h:5, from ./arch/arm64/include/asm/stat.h:12, from ./include/linux/stat.h:6, from ./include/linux/module.h:13, from /home/ubuntu/Desktop/system-register-tools/msr-arm/msr_arm.c:15: /home/ubuntu/Desktop/system-register-tools/msr-arm/msr_arm.c: In function ‘msr_init’: ./include/linux/init.h:184:22: error: passing argument 1 of ‘class_create’ from incompatible pointer type [-Werror=incompatible-pointer-types] 184~~~~~~~~In file included from ./include/linux/device.h:31, from /home/ubuntu/Desktop/system-register-tools/msr-arm/msr_arm.c:23: ./include/linux/device/class.h:228:54: note: expected ‘const char ’ but argument is of type ‘struct module ’ 228~~^~ /home/ubuntu/Desktop/system-register-tools/msr-arm/msr_arm.c:325:21: error: too many arguments to function ‘class_create’ 325~~~ ./include/linux/device/class.h:228:29: note: declared here 228~~~ /home/ubuntu/Desktop/system-register-tools/msr-arm/msr_arm.c:330:28: error: assignment to ‘char ()(const struct device , umode_t )’ {aka ‘char ()(const struct device , short unsigned int )’} from incompatible pointer type ‘char ()(struct device , umode_t )’ {aka ‘char ()(struct device , short unsigned int )’} [-Werror=incompatible-pointer-types] 330~~~~~~~~~^~ /home/ubuntu/Desktop/system-register-tools/msr-arm/msr_arm.c:344:33: error: passing argument 1 of ‘register_undef_hook_el1’ from incompatible pointer type [-Werror=incompatible-pointer-types] 344~~~~~~~~~^~ /home/ubuntu/Desktop/system-register-tools/msr-arm/msr_arm.c: In function ‘msr_exit’: /home/ubuntu/Desktop/system-register-tools/msr-arm/msr_arm.c:365:35: error: passing argument 1 of ‘unregister_undef_hook_el1’ from incompatible pointer type [-Werror=incompatible-pointer-types] 365~~~~~~~~~^~ /home/ubuntu/Desktop/system-register-tools/msr-arm/msr_arm.c:366:35: error: passing argument 1 of ‘unregister_undef_hook_el1’ from incompatible pointer type [-Werror=incompatible-pointer-types] 366~~~~/home/ubuntu/Desktop/system-register-tools/msr-arm/msr_arm.h:105:51: note: expected ‘struct undef_hook ’ but argument is of type ‘struct undef_hook ’ 105 | void unregister_undef_hook_el1(struct undef_hook *hook); |
~~~~~^~ /home/ubuntu/Desktop/system-register-tools/msr-arm/msr_arm.c: At top level: /home/ubuntu/Desktop/system-register-tools/msr-arm/msr_arm.c:78:26: error: storage size of ‘mrs_hook’ isn’t known 78 | static struct undef_hook mrs_hook = { | ^~~~ /home/ubuntu/Desktop/system-register-tools/msr-arm/msr_arm.c:86:26: error: storage size of ‘msr_hook’ isn’t known 86 | static struct undef_hook msr_hook = { | ^~~~ cc1: some warnings being treated as errors make[3]: [scripts/Makefile.build:243: /home/ubuntu/Desktop/system-register-tools/msr-arm/msr_arm.o] Error 1 make[2]: [/usr/src/linux-headers-6.8.0-1008-apple-arm/Makefile:1925: /home/ubuntu/Desktop/system-register-tools/msr-arm] Error 2 make[1]: [Makefile:240: __sub-make] Error 2 make[1]: Leaving directory '/usr/src/linux-headers-6.8.0-1008-apple-arm' make: [Makefile:10: all] Error 2 `