Kernel Extension to pin thread on a certain cpu core on Apple Silicon machines.(Also have the side effect to boost the frequecy to the max for that core). The pre-compiled kext is for T6000/T6000. If you want to use it on T8112, compile it with -DT8112 flag.
Unless you know what you are doing, otherwise don't use it.
- You need to disable SIP first(unless you codesign the kext).
- Switch to reduce security mode(https://softraid.com/faq/step-by-step-instructions-for-changing-the-security-settings-for-a-mac-with-apple-silicon/).
- Move .kext folder under /Library/Extensions/. There will be a window pops up, follow the instrucion from there.
- Run the command
sudo kextload /Library/Extensions/MacOS_CoreBinder.kext
.
Two ways:
- Pin the current thread via
sysctlbyname("kern.pin_core", NULL, NULL, &core, sizeof(core))
- Pin all the threads in a process using pid you had specified via syscall
sysctlbyname("kern.pin_core_pid", NULL, NULL, &pid_core, sizeof(pid_core))
Note:pid_core
top 32 bits for pid(-1 for all processes) bottom 32 bits for cpuid.
Thanks for the help from jht5132(https://tieba.baidu.com/home/main?fr=home&id=tb.1.7a7e3dba.vu9oHFoN6nhDwEfbdVfrrw&un=Jht5132) for testing the kext, without him this project won't be possible.
Screenshot provided by him.