acidanthera / bugtracker

Acidanthera Bugtracker
381 stars 43 forks source link

Cpustscsync maybe broken on macOS Monterey #1676

Closed reynan2020 closed 2 years ago

reynan2020 commented 3 years ago

Kernel panics and can't boot to macOS Monterey without using cpus=1 boot flag. Some times it is stucked at Appleacpicpu processor "" local apic "" when booting the installer.

IMG_20210610_103133 IMG_20210611_120859

I do clean install and followed dortania's guide, still the problem exist. CPUTSCSync works on macOS Big Sur with oc 7.1 but broken on macOS monterey Tried using VoodooTSCSync, it didn't work. Asus X409UA, Intel Core i3-7020U.

Ubsefor commented 3 years ago

May be related: Mine

No advanced logs yet, sadly(

reynan2020 commented 3 years ago

May be related: Mine

No advanced logs yet, sadly(

Try adding cpus=1 boot flag to NVRAM. I can boot with it but using only 1 cpu core out of 4 cores. I checked it and I have the same problem with you.

Ubsefor commented 3 years ago

May be related: Mine No advanced logs yet, sadly(

Try adding cpus=1 boot flag to NVRAM. I can boot with it but using only 1 cpu core out of 4 cores. I checked it and I have the same problem with you.

I’m not into installing betas yet, sadly. Just tried to get an idea whether it had any problems.

Also, does it need to stay cpus=1 after install? If so, it's not an option for me.

reynan2020 commented 3 years ago

May be related: Mine No advanced logs yet, sadly(

Try adding cpus=1 boot flag to NVRAM. I can boot with it but using only 1 cpu core out of 4 cores. I checked it and I have the same problem with you.

I’m not into installing betas yet, sadly. Just tried to get an idea whether it had any problems.

Also, does it need to stay cpus=1 after install? If so, it's not an option for me.

Yes, before and after install. You should add it and not remove that boot flag (macOS Monterey) until they fixed the issue.

Ubsefor commented 3 years ago

May be related: Mine No advanced logs yet, sadly(

Try adding cpus=1 boot flag to NVRAM. I can boot with it but using only 1 cpu core out of 4 cores. I checked it and I have the same problem with you.

I’m not into installing betas yet, sadly. Just tried to get an idea whether it had any problems. Also, does it need to stay cpus=1 after install? If so, it's not an option for me.

Yes, before and after install. You should add it and not remove that boot flag (macOS Monterey) until they fixed the issue.

Thanks for the info. I’ll try to gather logs in the end of the month if noone does it first as now I have no time tinkering with my pc.

m0d16l14n1 commented 3 years ago

I can actually boot with CpuTscSync.kext, but I will have panic about non-monotonic time, if i put laptop in sleep mode and then let it wake after some time (it can wake 2 or 3 times with no panic, or can`t wake even for 1st time). I am sure, that's panic caused by that kext, because if I remove it from config > no panic will happen. I will add panic log info here, once it get it again.

Btw, it can randomly stuck in same place as guys above have already mentioned (AppleACPICPU stuck)

m0d16l14n1 commented 3 years ago

Example of panic, using CpuTscSync.kext

panic(cpu 4 caller 0xffffff800a6d9bbe): Non-monotonic time: last_dispatch at 0x3cdc01b640, ctime 0x3cdc019e1e @sched_prim.c:737 Panicked task 0xffffff869fa59688: 185 threads: pid 0: kernel_task Backtrace (CPU 4), panicked thread: 0xffffff869fa892c0, Frame : Return Address 0xffffffd0ac513b70 : 0xffffff800a6b0dbd mach_kernel : _handle_debugger_trap + 0x41d 0xffffffd0ac513bc0 : 0xffffff800a8076f5 mach_kernel : _kdp_i386_trap + 0x145 0xffffffd0ac513c00 : 0xffffff800a7f70e3 mach_kernel : _kernel_trap + 0x533 0xffffffd0ac513c50 : 0xffffff800e5778f4 as.vit9696.VirtualSMC : __ZN18VirtualSMCProvider10kernelTrapI22x86_saved_state_1010_tEEvPT_Pm + 0x454 0xffffffd0ac513cd0 : 0xffffff800a650a7f mach_kernel : _return_from_trap + 0xff 0xffffffd0ac513cf0 : 0xffffff800a6b118d mach_kernel : _DebuggerTrapWithState + 0xad 0xffffffd0ac513e10 : 0xffffff800a6b0946 mach_kernel : _panic_trap_to_debugger + 0x2b6 0xffffffd0ac513e70 : 0xffffff800af1c019 mach_kernel : _panic + 0x54 0xffffffd0ac513ee0 : 0xffffff800a6d9bbe mach_kernel : _thread_unstop + 0x1b9e 0xffffffd0ac513f50 : 0xffffff800a6d7f77 mach_kernel : _thread_block_reason + 0xc7 0xffffffd0ac513fa0 : 0xffffff800a65018e mach_kernel : _call_continuation + 0x2e Kernel Extensions in backtrace: as.vit9696.VirtualSMC(1.2.5)[F07D3673-61E7-3E20-905E-BA9976C542F6]@0xffffff800e568000->0xffffff800e58efff dependency: as.vit9696.Lilu(1.5.4)[631CA054-AB5A-3FCA-B7B4-759BB8D9AC99]@0xffffff800e4e1000->0xffffff800e565fff dependency: com.apple.iokit.IOACPIFamily(1.4)[CC0594E9-8711-315B-A945-71C6051676E1]@0xffffff800ccb8000->0xffffff800ccb9fff

Process name corresponding to current thread (0xffffff869fa892c0): kernel_task Boot args: -v debug=0x100 keepsyms=1 -nvmefdbg -alcbeta -wegdbg alcverbs=1 -noDC9

Mac OS version: 21A5248p

Kernel version: Darwin Kernel Version 21.0.0: Thu May 27 21:01:58 PDT 2021; root:xnu-7938.0.0.111.2~2/RELEASE_X86_64 Kernel UUID: 338A6A5D-63E1-310A-8E0E-9721D4D78446 KernelCache slide: 0x000000000a400000 KernelCache base: 0xffffff800a600000 Kernel slide: 0x000000000a410000 Kernel text base: 0xffffff800a610000 __HIB text base: 0xffffff800a500000 System model name: MacBookAir9,1 (Mac-0CFF9C7C2B63DF8D) System shutdown begun: NO Panic diags file available: YES (0x0) Hibernation exit count: 0

System uptime in nanoseconds: 261389532512 Last Sleep: absolute base_tsc base_nano Uptime : 0x0000003cdc07c0ae Sleep : 0x0000003cd891cb4a 0x000000007cc6938b 0x0000002f7589046a Wake : 0x0000003cdb0cb3bb 0x000000007c52eee8 0x0000003cd9066702

ameenjuz commented 3 years ago

Example of panic, using CpuTscSync.kext

panic(cpu 4 caller 0xffffff800a6d9bbe): Non-monotonic time: last_dispatch at 0x3cdc01b640, ctime 0x3cdc019e1e @sched_prim.c:737 Panicked task 0xffffff869fa59688: 185 threads: pid 0: kernel_task Backtrace (CPU 4), panicked thread: 0xffffff869fa892c0, Frame : Return Address 0xffffffd0ac513b70 : 0xffffff800a6b0dbd mach_kernel : _handle_debugger_trap + 0x41d 0xffffffd0ac513bc0 : 0xffffff800a8076f5 mach_kernel : _kdp_i386_trap + 0x145 0xffffffd0ac513c00 : 0xffffff800a7f70e3 mach_kernel : _kernel_trap + 0x533 0xffffffd0ac513c50 : 0xffffff800e5778f4 as.vit9696.VirtualSMC : __ZN18VirtualSMCProvider10kernelTrapI22x86_saved_state_1010_tEEvPT_Pm + 0x454 0xffffffd0ac513cd0 : 0xffffff800a650a7f mach_kernel : _return_from_trap + 0xff 0xffffffd0ac513cf0 : 0xffffff800a6b118d mach_kernel : _DebuggerTrapWithState + 0xad 0xffffffd0ac513e10 : 0xffffff800a6b0946 mach_kernel : _panic_trap_to_debugger + 0x2b6 0xffffffd0ac513e70 : 0xffffff800af1c019 mach_kernel : _panic + 0x54 0xffffffd0ac513ee0 : 0xffffff800a6d9bbe mach_kernel : _thread_unstop + 0x1b9e 0xffffffd0ac513f50 : 0xffffff800a6d7f77 mach_kernel : _thread_block_reason + 0xc7 0xffffffd0ac513fa0 : 0xffffff800a65018e mach_kernel : _call_continuation + 0x2e Kernel Extensions in backtrace: as.vit9696.VirtualSMC(1.2.5)[F07D3673-61E7-3E20-905E-BA9976C542F6]@0xffffff800e568000->0xffffff800e58efff dependency: as.vit9696.Lilu(1.5.4)[631CA054-AB5A-3FCA-B7B4-759BB8D9AC99]@0xffffff800e4e1000->0xffffff800e565fff dependency: com.apple.iokit.IOACPIFamily(1.4)[CC0594E9-8711-315B-A945-71C6051676E1]@0xffffff800ccb8000->0xffffff800ccb9fff

Process name corresponding to current thread (0xffffff869fa892c0): kernel_task Boot args: -v debug=0x100 keepsyms=1 -nvmefdbg -alcbeta -wegdbg alcverbs=1 -noDC9

Mac OS version: 21A5248p

Kernel version: Darwin Kernel Version 21.0.0: Thu May 27 21:01:58 PDT 2021; root:xnu-7938.0.0.111.2~2/RELEASE_X86_64 Kernel UUID: 338A6A5D-63E1-310A-8E0E-9721D4D78446 KernelCache slide: 0x000000000a400000 KernelCache base: 0xffffff800a600000 Kernel slide: 0x000000000a410000 Kernel text base: 0xffffff800a610000 __HIB text base: 0xffffff800a500000 System model name: MacBookAir9,1 (Mac-0CFF9C7C2B63DF8D) System shutdown begun: NO Panic diags file available: YES (0x0) Hibernation exit count: 0

System uptime in nanoseconds: 261389532512 Last Sleep: absolute base_tsc base_nano Uptime : 0x0000003cdc07c0ae Sleep : 0x0000003cd891cb4a 0x000000007cc6938b 0x0000002f7589046a Wake : 0x0000003cdb0cb3bb 0x000000007c52eee8 0x0000003cd9066702

I m using kabylake system laptop My laptop do not wake from sleep when i press power button doesn't wake black screen occure unfortunatley after i force restart i get above report Non-monotonic time

wy414012 commented 3 years ago

opencore-2021-06-14-163125.txt 屏幕图

I encountered the same problem with detailed debug log.

notluquis commented 3 years ago

Same problem here with ASUS S14 X411UF, and I can only boot with cpus=1 flags, without SMCProcessor kext and with cputscsync. Here is my EFI. If anyone knows, take a look of my EFI and compare haha (or if I missing some Kext, ACPI file or option on my config file.)

anonymous-writer commented 3 years ago

With these settings processor frequency stays at max.

Currently the only option for BugSur and Monterrey for me here. https://www.hackintosh-forum.de/forum/thread/35703-kurzanleitung-high-sierra-mojave-catalina-und-bigsur-auf-asus-zenbook-ux330uak/?postID=705772#post705772 Under BigSur no problems. Under Monterey tsc stop after sleep.

Lacedaemon commented 3 years ago

Good find @anonymous-writer. Setting IOCPUNumber to 0 in TSCAdjustReset.kext allowed me to boot my machine without cpus=1 -liluoff -vsmcoff.

Specs:

kextstat:

Index Refs Address            Size       Wired      Name (Version) UUID <Linked Against>
   50    3 0                  0x2e000    0x2e000    as.vit9696.Lilu (1.5.4) E786988C-53D3-3100-8AE9-F41051B82348 <9 7 6 3 2 1>
   51    0 0                  0x180000   0x180000   as.vit9696.AppleALC (1.6.2) CE23E5CB-2591-3825-B5BE-7331E0804B7D <50 16 9 7 6 3 2 1>
   52    0 0                  0x82000    0x82000    as.vit9696.WhateverGreen (1.5.1) 655EF761-3949-394F-9D77-F40272FBFFCD <50 16 9 7 6 3 2 1>
   56    0 0                  0xc000     0xc000     hu.interferenc.TSCAdjustReset (1.1) 0D04744A-4524-37AA-9DA2-094D4DF7DDD8 <9 6 3>
   62    0 0                  0x1a000    0x1a000    as.vit9696.VirtualSMC (1.2.5) FB8F7ED7-09FB-3FAC-A10A-EADDD225E37F <50 15 9 7 6 3 2 1>
   70    0 0                  0x2b000    0x2b000    as.acidanthera.mieze.IntelMausi (1.0.7) 847DC2F1-1E00-3603-868E-BCEDC23BF132 <48 16 7 6 3 1>
cheesycod commented 3 years ago

TSCAdjustReset.kext works with no patches for me

anonymous-writer commented 3 years ago

Beta 2 does not solve the problem. For me still only TSCAdjustReset.kext works under Monterey. After Sleep TSC sync broken.

vit9696 commented 3 years ago

Just to make it clear, nobody uses this kext or macOS 12 from the core team. Thus nobody explored it. You are best to submit a PR with a fix.

anonymous-writer commented 3 years ago

Fix would be TSCAdjustReset.kext. The problem is that this kext loses its function after sleep under Monterey. Unfortunately I don't know how to fix that. On BigSur, this kext also works after Sleep. https://github.com/interferenc/TSCAdjustReset

wy414012 commented 3 years ago

@vit9696 Could you please help me to check if there is an error in my config.plist that causes tscs to not work, or give me some help, because the OS X version I maintain is currently between 10.9-11.5.x All are running normally, unable to upgrade 12 stuck on the previous log tscs not workingEFI

qhdcjm commented 3 years ago

Encountered the same problem ,Solved it with the following connection method “https://www.hackintosh-forum.de/forum/thread/35703-kurzanleitung-high-sierra-mojave-catalina-und-bigsur-auf-asus-zenbook-ux330uak/?postID=705772#post705772” Replace TSCAdjustReset mis x99a+gtx780

mishurov commented 3 years ago

I would prefer CPUTSCSync fixed, it is more modern and more consistent with OC and Lily ecosystem.

ameenjuz commented 3 years ago

Both of kexts worked on my laptop but only one thing is not working after sleep wont wake up on macOS Monterey 12 on big sur fine I think this is bug of macOS Monterey 12

mishurov commented 3 years ago

Just to make it clear, nobody uses this kext or macOS 12 from the core team. Thus nobody explored it. You are best to submit a PR with a fix.

@vit9696 it doesn't make it insignificant though. TSC synchronization affects all Kaby Lake CPUs, there're plenty of people who still use it. As macOS 12 becomes official (not beta) you'll be overwhelmed by similar issues here if you don't fix CPUTSCSync because it is in acidanthera repositories. The latest commit with the new constants doesn't fix the problem, I tried to compile.

This one may be related https://github.com/torvalds/linux/blob/v5.13/arch/x86/kernel/tsc.c#L661

notluquis commented 3 years ago

Just to make it clear, nobody uses this kext or macOS 12 from the core team. Thus nobody explored it. You are best to submit a PR with a fix.

@vit9696 it doesn't make it insignificant though. TSC synchronization affects all Kaby Lake CPUs, there're plenty of people who still use it. As macOS 12 becomes official (not beta) you'll be overwhelmed by similar issues here if you don't fix CPUTSCSync because it is in acidanthera repositories. The latest commit with the new constants doesn't fix the problem, I tried to compile.

This one may be related https://github.com/torvalds/linux/blob/v5.13/arch/x86/kernel/tsc.c#L661

Oki, this is true, but I hope you didn't say that in a bad way, because OpenCore is free lol.

Ab2774 commented 3 years ago

I think we can all agree that CpuTscSync is way better than TSCAdjustReset, it's more advanced, in my case, CpuTscSync can boot successfully with Monterey, however, when waking from the screen becomes black and unresponsive, similar to how it would be without it, if the laptop wakes without CpuTscSync it also becomes very laggy and useless. I'm pretty sure most of us are ready to troubleshoot until we can this fixed before it officially launches sometime in November. Thanks

ameenjuz commented 3 years ago

I think we can all agree that CpuTscSync is way better than TSCAdjustReset, it's more advanced, in my case, CpuTscSync can boot successfully with Monterey, however, when waking from the screen becomes black and unresponsive, similar to how it would be without it, if the laptop wakes without CpuTscSync it also becomes very laggy and useless. I'm pretty sure most of us are ready to troubleshoot until we can this fixed before it officially launches sometime in November. Thanks

Absolutly you are right CpuTscSync is better than TSCAdjustReset I agree that without CpuTscSync.kext the kabylake system is very laggy and useless after wake from sleep on macOS Big Sur Unfortunatly waking from the screen becomes black on macOS 12 I don't know confirm due to CpuTscSync.kext or bug of macOS 12 beta 2

Shinji3rd commented 3 years ago

@vit9696 I tried to compile that kext you mentioned in the reference, but I’m getting two errors about missing files (I’m not in front of the computer now, where I took a screenshot). And yes, I have Lilu debug in the correct folder. Maybe you know what it is. Do I need something in particular besides Lilu and Xcode?

Ab2774 commented 3 years ago

Hi, @Shinji3rd, I haven't tested the new build from macos-star branch yet because I'm currently not on Monterey, I compiled this one by myself, can you please test it and confirm that it's working after sleep? Thanks CpuTscSync-1.0.4-DEBUG.zip

ameenjuz commented 3 years ago

@Ab2774 I have same laptop as yours I tested your compiled kext kernel panic occure during boot Shows AppleAcpicpu kernel panic Please provide me released version not debug version Also latest compiled lilu

Ab2774 commented 3 years ago

Hi @ameenjuz, I don't think that it would make a difference but here you go, also, you can find all of the latest compiled kexts here: https://dortania.github.io/builds/?product=Lilu&viewall=true. CpuTscSync-1.0.4-RELEASE.zip

ameenjuz commented 3 years ago

@Ab2774 Unfortunatly monterey 12 do not boot with this latest commited kext But big sur boot fine and working after sleep as a before

wy414012 commented 3 years ago
vit9696 commented 3 years ago

Panic logs must be presented with keepsyms=1. You can download prebuilt binaries (artifacts) by clicking on the ticks on the commit page for the branch:

PNG image

https://github.com/acidanthera/CpuTscSync/commits/macos-star

wy414012 commented 3 years ago

@vit9696 macOS Big Sur11.5RC log opencore-2021-07-17-081735.txt macOS12.log opencore-2021-07-17-081655.txt

vit9696 commented 3 years ago

Neither of these files contains panic log.

wy414012 commented 3 years ago

How can I print out the panic section to a file?

vit9696 commented 3 years ago

ApplePanic = YES (see the PDF manual), if it does not work, then a photo.

wy414012 commented 3 years ago

see But it didn't work.

vit9696 commented 3 years ago

Sorry, but can you read plain English? I explicitly told you that keepsyms=1 must be provided. Please refrain from posting if you cannot help.

wy414012 commented 3 years ago

Sorry, I was negligent, now I will add the picture again. QQ20210717-165430

vit9696 commented 3 years ago

Right, what is your CPU? Does TSCAdjustReset work for you?

wy414012 commented 3 years ago

My cpu is E5 2670 v2, and TSCAdjustReset is not helpful to me. I can start without relying on any synchronous driver under macOS Big Sur, but I must rely on this driver under macOS12.

wy414012 commented 3 years ago

If there is no CpuTscSync driver and using TSCadjustReset, I can only enter a loop restart.

vit9696 commented 3 years ago

Ok, so your CPU simply does not support the MSR. Let me try it the other way.

wy414012 commented 3 years ago

ok

vit9696 commented 3 years ago

Try https://github.com/acidanthera/CpuTscSync/commit/24462592ff6534074356fac3f8092aef0add3ab5.

wy414012 commented 3 years ago

It's stuck here, logs But under macOS Big Sur11.5rc, my cpu can still load the patch normally. io

vit9696 commented 3 years ago

11 and 12 use different code paths, thus 11 still works. I added more logs in https://github.com/acidanthera/CpuTscSync/commit/814662fc4cbb3aa530fc1d33b2c39199f1a69686, please try it and make a photo with it. Also need to know how many cores and threads does your CPU have total and enabled.

wy414012 commented 3 years ago

My cpu has 10 cores and 20 threads, all enabled,I will take a photo test later.

m4rkv5 commented 3 years ago

I have a i9-7900x and setting up a new installation, which version should I test for you?

wy414012 commented 3 years ago

I did not close it and waited for it to report an error or run. logds

wy414012 commented 3 years ago

Unable to go to the next step, I manually closed it and uploaded the log record. opencore-2021-07-17-101520.txt