Jump to content

(solved) please help with wake without cpus=1


zhhbc
 Share

10 posts in this topic

Recommended Posts

Here is my setup:
Motherboard: MSI Z87-G41 PC Mate

CPU: i3-4150

GPU: PNY GTX650

Boot with UEFI mode using Clover bootloader and modified DSDT, running 10.9.5.

 

Almost everything works so far, Graphic/LAN/Audio and etc. But, here is my problem:

1) without "cpus=1", boot up okay, system functions well. but when it wakes from S3 sleep, login screen shows up, then freezes, after about 150 - 180 seconds, the machine restarts automatically.

2) with "cpus=1" everything seems fine, including wake up from S3 sleep.

 

Could anyone give me any idea when "cpus=1" is required for wake from S3 sleep, but is not needed for boot up? And how to fix this problem?

 

Thanks  a lot in advance!

 

Edit: Solved

  • Like 1
Link to comment
Share on other sites

Thanks for VoodooTSCSync.kext, it helped me identifying the root cause of this problem. With VoodooTSCSync.kext installed, sometime, the machine can wake up correctly. Sometime, it hangs with black screen, and didn't even reboot itself. When it wakes correctly, I saw this in "dmesg":

Unsynchronized TSC for cpu 2: 0x00000001893cf7e7, delta 0x16491dd42
Unsynchronized TSC for cpu 1: 0x00000001895cac5d, delta 0x16491dd38
Unsynchronized TSC for cpu 3: 0x000000018978762b, delta 0x16491dd5a

It seems that TSC values for cpu 1-3 are still synced, but those values are out-of-sync with TSC value of CPU 0. Now everthing starts to make sense: without VoodooTSCSync, TSC values are out of sync after wake from sleep, the kernel or maybe a kext detects the problem, and reboots the computer. With VoodooTSCSync installed, there are two cases: 1) if VoodooTSCSync code has been executed early enough after wake up, it forces TSC Values to sync, everything seems to be okay, 2) if VoodooTSCSync code didn't get executed early enough, kernel starts to react to out-of-sync TSC values, however, later on, VoodooTSCSync code force the TSC values synced again. That leads to "hang" condition. So the really problem is BIOS did poor job for S3 wakeup. It updates TSC for CPU0, not other cores. It should either update all cores, or nothing IMHO.

 

The problem has been identifed, how to fix it? VoodooTSCSync.kext works sometime, but it is not a reliable solution. I tried to find DSDT fixes, unforunately, I don't know how to run "wrmsr" or "rdmsr" instruction in aml code. If anyone knows how to do so, please let me know. The last resort for me is modifying the BIOS. Forunately, I was able to find the code that updating TSC value for CPU0 in S3Restore PEI module, patched the code so that it didn't update TSC anymore after wake, flashed modified BIOS. Volia, it works.

 

Hope it helps other people see the similar problem.

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

Thanks for VoodooTSCSync.kext, it helped me identifying the root cause of this problem. With VoodooTSCSync.kext installed, sometime, the machine can wake up correctly. Sometime, it hangs with black screen, and didn't even reboot itself. When it wakes correctly, I saw this in "dmesg":

Unsynchronized TSC for cpu 2: 0x00000001893cf7e7, delta 0x16491dd42
Unsynchronized TSC for cpu 1: 0x00000001895cac5d, delta 0x16491dd38
Unsynchronized TSC for cpu 3: 0x000000018978762b, delta 0x16491dd5a

It seems that TSC values for cpu 1-3 are still synced, but those values are out-of-sync with TSC value of CPU 0. Now everthing starts to make sense: without VoodooTSCSync, TSC values are out of sync after wake from sleep, the kernel or maybe a kext detects the problem, and reboots the computer. With VoodooTSCSync installed, there are two cases: 1) if VoodooTSCSync code has been executed early enough after wake up, it forces TSC Values to sync, everything seems to be okay, 2) if VoodooTSCSync code didn't get executed early enough, kernel starts to react to out-of-sync TSC values, however, later on, VoodooTSCSync code force the TSC values synced again. That leads to "hang" condition. So the really problem is BIOS did poor job for S3 wakeup. It updates TSC for CPU0, not other cores. It should either update all cores, or nothing IMHO.

 

The problem has been identifed, how to fix it? VoodooTSCSync.kext works sometime, but it is not a reliable solution. I tried to find DSDT fixes, unforunately, I don't know how to run "wrmsr" or "rdmsr" instruction in aml code. If anyone knows how to do so, please let me know. The last resort for me is modifying the BIOS. Forunately, I was able to find the code that updating TSC value for CPU0 in S3Restore PEI module, patched the code so that it didn't update TSC anymore after wake, flashed modified BIOS. Volia, it works.

 

Hope it helps other people see the similar problem.

Great!Can you share it about how to modified the bios? 

Link to comment
Share on other sites

  • 2 months later...

I had the exact same problem. I have a MSI P67A-GD55 motherboard and after upgrading to the latest UEFI, it would crash on wakeup. I got the same Unsynchronized TSC messages in the logs. Tried Voodootscsync but it wasn't reliable.

 

That's when I found this thread. Much thanks to you for finding the solution. I patched my BIOS and no more issues with sleep!

 

Great!Can you share it about how to modified the bios?

You can extract the S3Restore module using UEFITool by CodeRush. After that you can patch the wrmsr instruction(0F 30) with a couple of NOPs(90 90). There were two of them in my file. So I opened it up in IDA and found the right one to patch - the one were ECX was 0x10. Put it back together in the bios and flashed it.
  • Like 2
Link to comment
Share on other sites

I had the exact same problem. I have a MSI P67A-GD55 motherboard and after upgrading to the latest UEFI, it would crash on wakeup. I got the same Unsynchronized TSC messages in the logs. Tried Voodootscsync but it wasn't reliable.

 

That's when I found this thread. Much thanks to you for finding the solution. I patched my BIOS and no more issues with sleep!

 

You can extract the S3Restore module using UEFITool by CodeRush. After that you can patch the wrmsr instruction(0F 30) with a couple of NOPs(90 90). There were two of them in my file. So I opened it up in IDA and found the right one to patch - the one were ECX was 0x10. Put it back together in the bios and flashed it.

I extract the S3Restore module,but i dont know how to patch the file,plase help me.

Thanks!

Link to comment
Share on other sites

Hey, I couldn't download those files. It says I don't have the permission.

I downloaded v3.70 BIOS for your motherboard from this page and patched it. If you had already applied PM patch or some other BIOS patch, you'll have to do it again on this file.

 

Note: Flash at your own risk. Make sure it is the right file. If I didn't download the right file for your mobo then maybe upload your bios to some file hosting service.

X79E4_3.70_patched.zip

Link to comment
Share on other sites

Hey, I couldn't download those files. It says I don't have the permission.

I downloaded v3.70 BIOS for your motherboard from this page and patched it. If you had already applied PM patch or some other BIOS patch, you'll have to do it again on this file.

 

Note: Flash at your own risk. Make sure it is the right file. If I didn't download the right file for your mobo then maybe upload your bios to some file hosting service.

The bios you patched works very well,WOW!

No more Unsynchronized TSC for cpu!

Thank you so much!

Link to comment
Share on other sites

  • 2 months later...

Here is my setup:

Motherboard: MSI Z87-G41 PC Mate

CPU: i3-4150

GPU: PNY GTX650

Boot with UEFI mode using Clover bootloader and modified DSDT, running 10.9.5.

 

Almost everything works so far, Graphic/LAN/Audio and etc. But, here is my problem:

1) without "cpus=1", boot up okay, system functions well. but when it wakes from S3 sleep, login screen shows up, then freezes, after about 150 - 180 seconds, the machine restarts automatically.

2) with "cpus=1" everything seems fine, including wake up from S3 sleep.

 

Could anyone give me any idea when "cpus=1" is required for wake from S3 sleep, but is not needed for boot up? And how to fix this problem?

 

Thanks  a lot in advance!

 

Edit: Solved

Could u post your Bios that u patched. I have the same motherboard

 

Thanks!

Link to comment
Share on other sites

  • 1 year later...
  • 3 weeks later...

I have a similar motherboard.

Causing "Unsynchronised TSC"

Although I have read the previous contents could not understand how to change the BIOS to me.

This is link to my BIOS (AMI BIOS Version 3.9) - https://msi.com/Motherboard/support/H87-G41-PC-Mate.html#down-bios

I was able to rewrite the BIOS using methods and tools that have been described. It has been able to operate the perfect sleep far.

Link to comment
Share on other sites

 Share

×
×
  • Create New...