-
Notifications
You must be signed in to change notification settings - Fork 133
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
DKMS compilations fails on 6.3 #422
Comments
Thanks Not CachyOS only but general issue with Linux kernel 6.3.rc1 Work in progress. Stay tuned. |
CoreFreq branch It builds and runs OK on my 3950X. Save and sync your file-systems prior launching the driver. Any code review from anyone is welcomed: |
Builds and works perfectly now! |
When built with
Is there some setup required for UMC? CPU is Zen 2 3500X, platform X570. |
Make sure to fully rebuild and reload from working directory. No previous instance still running. make ARCH_PMC=UMC clean all
rmmod corefreqk
insmod ./corefreqk.ko
./corefreqd -d ## check threaded monitoring loops
./corefreq-cli |
Daemon is not launching.
|
Probably driver If not done yet, please check your kernel log for any trace of CoreFreq driver crash ? Can you make sure again the standard build (without that PMC) is still running OK ? |
EDIT: |
I have installed CachyOS for ArchLinux and I can't reproduce the Daemon issue with CoreFreq branch linux_6_3 make ARCH_PMC=UMC clean all |
From Daemon process, I've tried to write one of the read-only mmap pages of corefreqk.ko which has throw a segfault to this user-space process. |
And I need your acknowledgement if there's no remaining issue before merging into master branch. |
The computer with the 3500X is my parents' HTPC. I don't have access to it all the time (remotely, reverse tunnel via site-to-site VPN) as it's not always powered on. I'll be at their place today for some maintenance on the HTPC and try to debug further. PBO and UEFI settings are configured for low power usage and low thermal envelope, including disablement of cores (2 of the 6 are enabled). I suspect the failures may have something to do with that. I'll check what dmesg prints after loading the module. Is there any extra compilation flags or module options to increase its verbosity? |
|
Only thing it prints is some info, no error. ewout@enthoo ~ % sudo dmesg | tail
[ 230.475320] rfkill: input handler disabled
[ 231.205749] input: solaar-keyboard as /devices/virtual/input/input31
[ 1162.036175] logitech-djreceiver 0003:046D:C52B.0004: device of type eQUAD step 4 DJ (0x04) connected on slot 2
[ 1162.058254] input: Logitech K270 as /devices/pci0000:00/0000:00:01.2/0000:02:00.0/0000:03:08.0/0000:07:00.3/usb3/3-1/3-1:1.2/0003:046D:C52B.0004/0003:046D:4003.0009/input/input32
[ 1162.062013] logitech-hidpp-device 0003:046D:4003.0009: input,hidraw3: USB HID v1.11 Keyboard [Logitech K270] on usb-0000:07:00.3-1/input2:2
[ 1162.176015] logitech-hidpp-device 0003:046D:4003.0009: HID++ 2.0 device connected.
[ 3171.121897] snd_hda_codec_hdmi hdaudioC0D0: HDMI: audio coding xtype 11 not expected
[ 5079.763522] overlayfs: "xino" feature enabled using 2 upper inode bits.
[ 5079.831385] overlayfs: "xino" feature enabled using 2 upper inode bits.
[ 6396.239435] CoreFreq(1:-1:-1): Processor [ 8F_71] Architecture [Zen2/Matisse] CPU [2/2]
ewout@enthoo ~ % sudo dmesg | grep -i corefreq
[ 6396.239435] CoreFreq(1:-1:-1): Processor [ 8F_71] Architecture [Zen2/Matisse] CPU [2/2]
ewout@enthoo ~ % lsmod | grep -i corefreqk
corefreqk 622592 0
ewout@enthoo ~ %
ewout@enthoo ~ % sudo corefreqd -d
Driver connection error code 13
Version 0.0.0: 'Permission denied' @ line 9213
ewout@enthoo ~ % 🤷♂️ |
What's going on are linked to the two Cores.
To minimize the consumed power I won't touch the Core count and left enabled those BIOS settings. Same with SMT. PL, Power Limiter, is what you should tune. You can also tune the Vcore, SoC, and DRAM voltage Think also that kernel will migrate at its best all tasks to the two total CPUs. It's bad balance to my taste. So far, the Daemon issue is due to unsupported factors. |
The 3500X is a 3600 with disabled SMT from factory, can't enable it. S3 works just fine.
The PC is used primarily as HTPC, just watching online content. The build uses a NH-L9x65 and in its stock configuration the cooler couldn't keep up. With a custom "35W Eco Mode" (PPT = 40W, TDC = 35A, EDC = 40A) all is fine again. The disablement of cores was done to ensure it never ramps up any fans.
XMP is disabled, that's about it on underclocking.
In my testing C6 state wasn't toggled much in those scenarios, when playing DRM encrypted videos in Firefox (no hardware acceleration support in Widevine on Linux, so CPU decryption + CPU H264 decode). Having only two cores enabled is more energy efficient. |
Yes it seems not related to 6.3 indeed. Probably should migrate to a new issue. Thanks for trying to reproduce 👍🏻 |
Can you put Processor back running CoreFreq and provide CLI outputs and UI screenshots. |
Here's what occurs when trying to run CoreFreq on 6.3 with the latest commits Edit: It is due to the daemon and not the kernel module itself; modprobing corefreqk is fine but the daemon gives the kernel bug. |
Reading journal, issue is said to be linked with a If this only happens when built when Line 22858 in 85d0b2e
Printing the computed and real allocation size in both cases:
Rounded to page size, allocation of |
But static int CoreFreqK_mmap(struct file *pfile, struct vm_area_struct *vma)
{
unsigned long reqSize = vma->vm_end - vma->vm_start;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0)
/* vm_flags_t vm_ro = VM_READ;*/
#endif
int rc = -EIO;
UNUSED(pfile);
if (vma->vm_pgoff == ID_RO_VMA_PROC) {
if (PUBLIC(RO(Proc)) != NULL)
{
const unsigned long secSize = ROUND_TO_PAGES(sizeof(PROC_RO));
if (reqSize != secSize) {
rc = -EAGAIN;
goto EXIT_PAGE;
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0)
/* vm_flags_reset_once(vma, vm_ro);*/
#else
vma->vm_flags = VM_READ;
#endif
vma->vm_page_prot = PAGE_READONLY;
rc = remap_pfn_range( vma,
vma->vm_start,
virt_to_phys((void *) PUBLIC(RO(Proc))) >> PAGE_SHIFT,
reqSize,
vma->vm_page_prot);
}
} else if (vma->vm_pgoff == ID_RW_VMA_PROC) {
if (PUBLIC(RW(Proc)) != NULL)
{
const unsigned long secSize = ROUND_TO_PAGES(sizeof(PROC_RW));
if (reqSize != secSize) {
rc = -EAGAIN;
goto EXIT_PAGE;
}
rc = remap_pfn_range( vma,
vma->vm_start,
virt_to_phys((void *) PUBLIC(RW(Proc))) >> PAGE_SHIFT,
reqSize,
vma->vm_page_prot);
}
} else if (vma->vm_pgoff == ID_RO_VMA_GATE) {
if (PUBLIC(RO(Proc)) != NULL)
{
switch (SysGate_OnDemand()) {
default:
case -1:
break;
case 1:
fallthrough;
case 0: {
const unsigned long
secSize = PAGE_SIZE << PUBLIC(RO(Proc))->Gate.ReqMem.Order;
if (reqSize != secSize) {
return -EAGAIN;
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0)
/* vm_flags_reset_once(vma, vm_ro);*/
#else
vma->vm_flags = VM_READ;
#endif
vma->vm_page_prot = PAGE_READONLY;
rc = remap_pfn_range( vma,
vma->vm_start,
virt_to_phys((void *) PUBLIC(OF(Gate))) >> PAGE_SHIFT,
reqSize,
vma->vm_page_prot);
}
break;
}
}
} else if ((vma->vm_pgoff >= ID_RO_VMA_CORE)
&& (vma->vm_pgoff < ID_RW_VMA_CORE))
{
signed int cpu = vma->vm_pgoff - ID_RO_VMA_CORE;
if (PUBLIC(RO(Proc)) != NULL) {
if ((cpu >= 0) && (cpu < PUBLIC(RO(Proc))->CPU.Count)) {
if (PUBLIC(RO(Core, AT(cpu))) != NULL)
{
const unsigned long secSize = ROUND_TO_PAGES(sizeof(CORE_RO));
if (reqSize != secSize) {
rc = -EAGAIN;
goto EXIT_PAGE;
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0)
/* vm_flags_reset_once(vma, vm_ro);*/
#else
vma->vm_flags = VM_READ;
#endif
vma->vm_page_prot = PAGE_READONLY;
rc = remap_pfn_range( vma,
vma->vm_start,
virt_to_phys((void *) PUBLIC(RO(Core, AT(cpu)))) >> PAGE_SHIFT,
reqSize,
vma->vm_page_prot);
}
}
}
} else if ((vma->vm_pgoff >= ID_RW_VMA_CORE)
&& (vma->vm_pgoff < ID_ANY_VMA_JAIL))
{
signed int cpu = vma->vm_pgoff - ID_RW_VMA_CORE;
if (PUBLIC(RO(Proc)) != NULL) {
if ((cpu >= 0) && (cpu < PUBLIC(RO(Proc))->CPU.Count)) {
if (PUBLIC(RW(Core, AT(cpu))) != NULL)
{
const unsigned long secSize = ROUND_TO_PAGES(sizeof(CORE_RW));
if (reqSize != secSize) {
rc = -EAGAIN;
goto EXIT_PAGE;
}
rc = remap_pfn_range( vma,
vma->vm_start,
virt_to_phys((void *) PUBLIC(RW(Core, AT(cpu)))) >> PAGE_SHIFT,
reqSize,
vma->vm_page_prot);
}
}
}
}
EXIT_PAGE:
return rc;
} Next please rebuild, reload and test Daemon connection. |
Also make sure any previous installation of CoreFreq binaries is removed |
corefreqd -d freezes and hangs the console. This is with or without ARCH_PMC=UMC. |
Do you confirm to have comment |
Yes, I commented them out as requested above and rebuilt it. |
I still can't reproduce that bug with 6.3 I would like to know about your kernel environment, especially the |
linux-cachyos-rc 6.3-rc2 Link to the patch list: https://github.com/CachyOS/kernel-patches/tree/master/6.3 |
Thanks. But I would like to have a working status using the mainline kernel version 6.3 |
I'm currently compiling it without the per-VMA locks patch to see if that's the problem |
Thank you very much |
It is not the per-VMA locks, I'm going to compile it without any patches now |
I also noticed this line in my dmesg: [ 2.298642] memfd_create() without MFD_EXEC nor MFD_NOEXEC_SEAL, pid=1 'systemd' |
Sorry no idea what this is. I have built, and boot CachyOS from AUR and CoreFreq is running as expected. |
I think that's unrelated. I still get the same error without any patches; it seems to have something to do with vm_mmap_pgoff. I'm going to try it with GCC and O2 now |
What Compiler and options were you using during issue ? |
Yep, it was Clang. It's working now. Clang, -flto=auto, and -O3 |
Thank you. @emansom : Were you also building kernel with clang while Daemon being denied ? |
It was working up to this point, it's most likely to do with this being an RC kernel; these kinds of issues usually get fixed by the time the kernel gets released. |
At that point I don't see other reason to keep issue opened. |
|
I have been able to reproduce the issue and setting off Make CoreFreq as below when clang is in used:
Make sure of this prerequisite:
|
When using linux-cachyos-rc as kernel, DKMS compilation fails.
The text was updated successfully, but these errors were encountered: