Skip to content
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

Cpustscsync maybe broken on macOS Monterey #1676

Closed
reynan2020 opened this issue Jun 10, 2021 · 130 comments
Closed

Cpustscsync maybe broken on macOS Monterey #1676

reynan2020 opened this issue Jun 10, 2021 · 130 comments

Comments

@reynan2020
Copy link

reynan2020 commented Jun 10, 2021

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
Copy link

Ubsefor commented Jun 10, 2021

May be related: Mine

No advanced logs yet, sadly(

@reynan2020
Copy link
Author

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
Copy link

Ubsefor commented Jun 10, 2021

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
Copy link
Author

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
Copy link

Ubsefor commented Jun 10, 2021

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
Copy link

m0d16l14n1 commented Jun 12, 2021

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
Copy link

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
Copy link

ameenjuz commented Jun 13, 2021

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
Copy link

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

I encountered the same problem with detailed debug log.

@notluquis
Copy link

notluquis commented Jun 20, 2021

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
Copy link

anonymous-writer commented Jun 20, 2021

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
Copy link

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

Specs:

  • CPU: i7-9820X
  • Mobo: EVGA X299 Micro
  • OpenCore: 0.7.0
  • OS: 21A5248p

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
Copy link

cheesycod commented Jun 26, 2021

TSCAdjustReset.kext works with no patches for me

@anonymous-writer
Copy link

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

@vit9696
Copy link
Contributor

vit9696 commented Jun 29, 2021

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
Copy link

anonymous-writer commented Jun 30, 2021

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
Copy link

wy414012 commented Jul 1, 2021

@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
Copy link

qhdcjm commented Jul 8, 2021

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
Copy link

mishurov commented Jul 8, 2021

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

@ameenjuz
Copy link

ameenjuz commented Jul 8, 2021

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
Copy link

mishurov commented Jul 8, 2021

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
Copy link

notluquis commented Jul 8, 2021

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
Copy link

Ab2774 commented Jul 8, 2021

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
Copy link

ameenjuz commented Jul 8, 2021

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

@acidanthera acidanthera locked and limited conversation to collaborators Jul 8, 2021
@acidanthera acidanthera unlocked this conversation Jul 16, 2021
vit9696 referenced this issue in acidanthera/CpuTscSync Jul 16, 2021
@Shinji3rd
Copy link

@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
Copy link

Ab2774 commented Jul 17, 2021

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

@vit9696
Copy link
Contributor

vit9696 commented Jul 19, 2021

Well, ‘powernap’ feature, or better call it the darkwake, seems to not working with the same kernel panic if the machine manages to enter darkwake state. Will gather logs with keepsyms=1 later, as now I’m testing a workaround for my laptop specific model (syncing tsc is not needed at all with lower bios firmware)

Where is the panic log?

@xjwan110
Copy link

Can you share this latest driver?

@Ubsefor
Copy link

Ubsefor commented Jul 19, 2021

Where is the panic log?

Here it is, but it’s without keepsyms, so it’s kinda useless… At least from what I can tell it is awfully similar to earlier kps after sleep.
I will attach the log with keepsyms=1 a bit later.

Kernel-2021-07-19-080649.txt

@vit9696
Copy link
Contributor

vit9696 commented Jul 19, 2021

Need it redone with keepsyms, yes.

@wy414012
Copy link

@vit9696 I used two days to fix the error in the motherboard firmware. The problem of stuck loading ssdt has been fixed, but I got a kernel panic.
acidanthera/CpuTscSync@37ff126
test01

@Ab2774
Copy link

Ab2774 commented Jul 20, 2021

Hi @vit9696, it appears that CpuTscSync is attached to AppleACPICPU under CPU@0 instead of the last CPU (in my case CPU@3), I tried to attach my KP log but I can't boot to my Monterey Disk anymore and I don't know why, I took a copy of IOReg before restarting, hope it helps. (@ameenjuz do you have the same issue as mine since we have the same laptop model? And is it different in Clover?)

Big Sur:
Big Sur
Monterey:
Monterey
Thanks.

@ameenjuz
Copy link

@Ab2774 I don't have any boot issue
Cputscsync With latest commit changes is working fine including sleep in clover bootloader but unfortunatlly do not wake up after sleep on OpenCore bootloader

@Ab2774
Copy link

Ab2774 commented Jul 20, 2021

@Ab2774 I don't have any boot issue
Cputscsync With latest commit changes is working fine including sleep in clover bootloader but unfortunatlly do not wake up after sleep on OpenCore bootloader

Hi, @ameenjuz, can you provide a copy of IOReg in Monterey in both Clover and OpenCore?
I really appreciate it.
Thanks

@ameenjuz
Copy link

ameenjuz commented Jul 20, 2021

@Ab2774
Sorry i m not at home now i will attach later
remember if you have boot issue remove AppleBaclightSmoother.kext
Because it is causing to boot7

@ameenjuz
Copy link

@Ab2774
Both of bootloader shows same in ioreg like your above
it appears that CpuTscSync is attached to AppleACPICPU under CPU@0 instead of the last CPU (in my case CPU@3 but sleep&wake is working on clover

@wy414012
Copy link

The reason why the Xeon Cpu cannot be synchronized may be related to the new power management driver. After entering the firmware ssdt, I found that the power management uses com.apple.driver.ACPI_SMC_PlatformPlugin for management, of course My machine can't work normally. The cpu frequency only recognizes 2.38hz, and it restarts once a minute or so, and the complete kext loaded by the system is attached.
kext.txt

@stychos
Copy link

stychos commented Jul 29, 2021

After beta 4 couldn't load extension built from master branch. But realized that my dual-xeon machine works well even without this kext.

@ameenjuz
Copy link

ameenjuz commented Aug 3, 2021

@lvs1974 @vit9696 thanks for hard work
Latest commit worked on my i5-7200u kabylake system and properly wokeup after sleep on macOS 12 on OpenCore
But on ioreg it appears that CpuTscSync is attached to AppleACPICPU under CPU@0 instead of the last CPU3

@lvs1974
Copy link

lvs1974 commented Aug 3, 2021

@ameenjuz: it is correct behaviour for macOS 12, tsc adjust is executed when the last cpu is available in ACPI.

@mishurov
Copy link

mishurov commented Aug 3, 2021

@lvs1974 when I tested on my laptop, during the boot process for me it was sufficient just to reset MSR_IA32_TSC_ADJUST on the first core CPU0 without even waiting for other cores or executing mp_rendezvous_no_intrs. Can't say about sleeping though. I didn't know about IOHibernateSystemWake() Lilu routing at the time.

@Sher1ocks
Copy link

I recently started using CpuTscSync on Skylake laptop in monterey
It is because of the phenomenon that it does not drop below 1.5 GHz at any moment and it continues to be higher than that. I used CpuTscSync and this problem went away.
I used a file that was committed two days ago, but strangely, when I press the restart button after turning on Chrome, the Chrome does not respond.

no problem
acidanthera/CpuTscSync@38a95e7

chrome problem
acidanthera/CpuTscSync@370f97c

@wy414012
Copy link

This may be helpful for the TSC repair of e5-26xx series cpu. This is the cpu detailed information obtained using msr-tool under centos.
cupid.txt
@vit9696

@vit9696
Copy link
Contributor

vit9696 commented Oct 25, 2021

I believe the recent updates to CpuTscSync and Lilu fix most of the issues. Let's raise another issue if there are more.

@rishsharma
Copy link

FWIW, I tried with updated kexts and OpenCore 0.75 on a p8p67 pro and still get this same issue. Let me know if I can provide any details.

@gulios
Copy link

gulios commented Dec 18, 2021

Asus UX430AU i7-7500U
Open Core 0.7.7
CpuTscSync 1.0.5
On BigSur it worked fine. After Monterey getting random KP on wake up(black screen, fans spining. Only hard reset to boot again)
All kexts are up2date.

@vit9696 can you check it please?

Thank you

panic(cpu 0 caller 0xffffff80076b34e3): Non-monotonic time: invoke at 0xbbf1a113bd5f, runnable at 0xbbf1a79343a2 @sched_prim.c:2865
Panicked task 0xffffff8b5588a670: 195 threads: pid 0: kernel_task
Backtrace (CPU 0), panicked thread: 0xffffff94eefba000, Frame : Return Address
0xffffffe06535b7b0 : 0xffffff8007687ddd 
0xffffffe06535b800 : 0xffffff80077e7d15 
0xffffffe06535b840 : 0xffffff80077d74e3 
0xffffffe06535b890 : 0xffffff8007627a60 
0xffffffe06535b8b0 : 0xffffff80076881ad 
0xffffffe06535b9d0 : 0xffffff8007687966 
0xffffffe06535ba30 : 0xffffff8007f160b9 
0xffffffe06535baa0 : 0xffffff80076b34e3 
0xffffffe06535bb10 : 0xffffff80076b1137 
0xffffffe06535bb60 : 0xffffff800767e5df 
0xffffffe06535bb70 : 0xffffff8007627d20 
0xffffffe06535bc90 : 0xffffff80077bc62c 
0xffffffe06535bcb0 : 0xffffff80076a81ee 
0xffffffe06535bd00 : 0xffffff8007e7beee 
0xffffffe06535bd50 : 0xffffff8007ec7b86 
0xffffffe06535bdd0 : 0xffffff8007e3ffd6 
0xffffffe06535be40 : 0xffffff8007e3ccd4 
0xffffffe06535be90 : 0xffffff8007e3a190 
0xffffffe06535bee0 : 0xffffff8007e3a02a 
0xffffffe06535bf20 : 0xffffff8007e5756e 
0xffffffe06535bf60 : 0xffffff8007e56b97 
0xffffffe06535bfa0 : 0xffffff800762718e 

Process name corresponding to current thread (0xffffff94eefba000): kernel_task
Boot args: -v

Mac OS version:
21C52

Kernel version:
Darwin Kernel Version 21.2.0: Sun Nov 28 20:28:54 PST 2021; root:xnu-8019.61.5~1/RELEASE_X86_64
Kernel UUID: E32C293C-7D8B-327C-A335-6AAD250A4881
KernelCache slide: 0x0000000007400000
KernelCache base:  0xffffff8007600000
Kernel slide:      0x0000000007410000
Kernel text base:  0xffffff8007610000
__HIB  text base: 0xffffff8007500000
System model name: MacBookPro14,1 (Mac-B4831CEBD52A0C4C)
System shutdown begun: NO
Panic diags file available: YES (0x0)
Hibernation exit count: 0

System uptime in nanoseconds: 206646464074988
Last Sleep:           absolute           base_tsc          base_nano
  Uptime  : 0x0000bbf1a115de2a
  Sleep   : 0x0000bbf19e351529 0x000000003b6a9ea7 0x0000b8bfb4d953af
  Wake    : 0x0000b8bfb7b1d6e6 0x000000003b6b3252 0x0000bbf19e92f416
Zone info:
Foreign   : 0xffffff8015f82000 - 0xffffff8015f8f000
Native    : 0xffffff80223e9000 - 0xffffffa0223e9000
Readonly  : 0xffffff84ef0b5000 - 0xffffff8688a49000
Metadata  : 0xffffffed7fd1d000 - 0xffffffed9fde2000
Bitmaps   : 0xffffffed9fde2000 - 0xffffffeda2de2000

@sushilei
Copy link

Asus UX430AU i7-7500U Open Core 0.7.7 CpuTscSync 1.0.5 On BigSur it worked fine. After Monterey getting random KP on wake up(black screen, fans spining. Only hard reset to boot again) All kexts are up2date.

@vit9696 can you check it please?

Thank you

panic(cpu 0 caller 0xffffff80076b34e3): Non-monotonic time: invoke at 0xbbf1a113bd5f, runnable at 0xbbf1a79343a2 @sched_prim.c:2865
Panicked task 0xffffff8b5588a670: 195 threads: pid 0: kernel_task
Backtrace (CPU 0), panicked thread: 0xffffff94eefba000, Frame : Return Address
0xffffffe06535b7b0 : 0xffffff8007687ddd 
0xffffffe06535b800 : 0xffffff80077e7d15 
0xffffffe06535b840 : 0xffffff80077d74e3 
0xffffffe06535b890 : 0xffffff8007627a60 
0xffffffe06535b8b0 : 0xffffff80076881ad 
0xffffffe06535b9d0 : 0xffffff8007687966 
0xffffffe06535ba30 : 0xffffff8007f160b9 
0xffffffe06535baa0 : 0xffffff80076b34e3 
0xffffffe06535bb10 : 0xffffff80076b1137 
0xffffffe06535bb60 : 0xffffff800767e5df 
0xffffffe06535bb70 : 0xffffff8007627d20 
0xffffffe06535bc90 : 0xffffff80077bc62c 
0xffffffe06535bcb0 : 0xffffff80076a81ee 
0xffffffe06535bd00 : 0xffffff8007e7beee 
0xffffffe06535bd50 : 0xffffff8007ec7b86 
0xffffffe06535bdd0 : 0xffffff8007e3ffd6 
0xffffffe06535be40 : 0xffffff8007e3ccd4 
0xffffffe06535be90 : 0xffffff8007e3a190 
0xffffffe06535bee0 : 0xffffff8007e3a02a 
0xffffffe06535bf20 : 0xffffff8007e5756e 
0xffffffe06535bf60 : 0xffffff8007e56b97 
0xffffffe06535bfa0 : 0xffffff800762718e 

Process name corresponding to current thread (0xffffff94eefba000): kernel_task
Boot args: -v

Mac OS version:
21C52

Kernel version:
Darwin Kernel Version 21.2.0: Sun Nov 28 20:28:54 PST 2021; root:xnu-8019.61.5~1/RELEASE_X86_64
Kernel UUID: E32C293C-7D8B-327C-A335-6AAD250A4881
KernelCache slide: 0x0000000007400000
KernelCache base:  0xffffff8007600000
Kernel slide:      0x0000000007410000
Kernel text base:  0xffffff8007610000
__HIB  text base: 0xffffff8007500000
System model name: MacBookPro14,1 (Mac-B4831CEBD52A0C4C)
System shutdown begun: NO
Panic diags file available: YES (0x0)
Hibernation exit count: 0

System uptime in nanoseconds: 206646464074988
Last Sleep:           absolute           base_tsc          base_nano
  Uptime  : 0x0000bbf1a115de2a
  Sleep   : 0x0000bbf19e351529 0x000000003b6a9ea7 0x0000b8bfb4d953af
  Wake    : 0x0000b8bfb7b1d6e6 0x000000003b6b3252 0x0000bbf19e92f416
Zone info:
Foreign   : 0xffffff8015f82000 - 0xffffff8015f8f000
Native    : 0xffffff80223e9000 - 0xffffffa0223e9000
Readonly  : 0xffffff84ef0b5000 - 0xffffff8688a49000
Metadata  : 0xffffffed7fd1d000 - 0xffffffed9fde2000
Bitmaps   : 0xffffffed9fde2000 - 0xffffffeda2de2000

I have the same error

@sushilei
Copy link

@gulios did you solve this problem

@gulios
Copy link

gulios commented Jan 10, 2022

no, still random KP on wake up.
Maybe @vit9696 will help with this.

#1900

@paulotex
Copy link

Report on this issue on a X299 with a i9-9940X: It was still giving me a non-monotonic time KP with version 1.0.5 and with kernel option TSC_sync_margin=0. My machine sleeps every evening, and I was getting this KP once or twice a week. But with the latest version 1.0.6 the issue seems to be solved. I am now on day 6 without a KP. I still use the kernel boot option TSC_sync_margin=0.

Thanks for the good work guys!

@BillDH2k
Copy link

BillDH2k commented Nov 5, 2022

vit9696 commented [on Jul 17, 2021] (#1676 (comment)). [on booting issue]:

Well, the situation unpleasant. The root cause of the issue is that on macOS 12 CPU registration comes in parallel with many other things, so SMP support (hardware multithreading) is initialised even before all the CPU cores are initialised.

Normally the solution is to wait for all CPUs to register, then perform the TSC sync on them. Now it is no longer feasible, since whenever even just 2 CPUs register, we already have multithreading and potentially a kernel panic. I am not quite sure how to address it best.

@vit9696 For systems unable to boot under Monterey due to TSC out of sync, here is a solution worked for my setup (DELL T5810, X99, Hanswell-E/Broadwell-E Xeon): Perform a TSC Reset, with this efi tool ResetTSCAdjust.efi [link], during OC booting, before launching macOS. May be OC could consider add this tool as an option. Or may be built in and perform this command automatically. This could overcome systems with their BIOS not reset TSC properly on boot up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests