XPS9350-macOS icon indicating copy to clipboard operation
XPS9350-macOS copied to clipboard

HWP register + Sleep corrupt Windows?

Open syscl opened this issue 7 years ago • 27 comments

Hello @all,

I've experienced this issue about 3 times, when I enable HWP + Sleep, my Windows 10 Pro 1511 corrupted and indicating the disk has been corrupted. I have no idea why this happen, because w/o HWP and sleep, there's no such corruption. I also see another people post about this, but I forgot where he post it.

I am really really busy these days, tell me if there's any progress about this issue.

syscl

syscl avatar Mar 04 '17 17:03 syscl

Be more specific please. HWP enabled in Windows or in MacOS? Also, look here: https://github.com/syscl/XPS9350-macOS/issues/26#issuecomment-283994465

bozma88 avatar Mar 04 '17 17:03 bozma88

@bozma88 The reason of #74 occurs remain unknown, I tried my best to remember what causes the bug, but I have a very bad memory and it's hard for me to remember what cause this issue.

But I've noticed that Windows corrupted after very similar procedures:

  • macOS use ssdtPRGen.sh at the beginning
  • ...
  • switch to HWP
  • ...
  • sleep

I leave ... in the procedure, because I can't remember if there's some other operations/changes that will cause Windows corruption, but obvious, I can't boot into Windows anymore. 2 of the corruption indicated disk corrupt, and one indicated kernel related issue. I can't remember what the issue is, but I will try to investigate what's wrong.

Tell me if you have any idea about this issue.

Thank you, syscl

syscl avatar Mar 04 '17 17:03 syscl

First of all, if you look at #26, you'll see that hibernatemode is still enabled because of autopoweroff, so first of all will be to disable it. Then, my advice is to create two git branches. Main one with hwp disabled, and an experimental branch with hwp. Pc works very well with native SSDTS, no HWP, no ssdtprgen, I still get full PM and 10h battery life (i7-9360). Set main branch to a stable setup without HWP and merge changes when they become stable, too dangerous to keep HWP on main branch for data integrity.

bozma88 avatar Mar 04 '17 18:03 bozma88

@bozma88 I doubt power management work with native SSDTs unless you use GeneratePStates and GenerateCStates. A simple method to see if you have full power management is by checking if there's 4 or 5 selections in System Preferences->Energy Saver->Power Adapter. From my experience, w/o ssdtPRGen there will be only 2 or 3 selection under Power Adapter and an error from kernel.log about:unknown CPU. That's why we need ssdtPRGen if we do not use HWP.

I still doubt if HWP cause some registers change such that Windows get corrupted. Because even Windows get corrupted, macOS still work like a charm... Though I barely use Windows, but I need Windows just in case.

Thank you, syscl

syscl avatar Mar 04 '17 19:03 syscl

Look at first 2 pages of my 9360 LTS guide on TMX. There's the log of P states for CPU and GPU with native SSDTs. Some advanced features like autopoweroff amd darkwakes are disabled (so you don't see relative settings in energy prefpane) but sleep and P states work very well, so do audio PM and USB PM.

bozma88 avatar Mar 04 '17 19:03 bozma88

@bozma88 Sorry I can't browse Tonymacx86 for such a long time, around Feb 1st I can't open even a single page on Tonymacx86, though RehabMan insisted there's no issue browsing tonymacx86, but I'd try to browse it in my apartment, in school, and even through my mobile LTE, no one succeed.

OK, back to the discussion, P states and GPU States indicates nothing about full power management, if you use any Intel Family Process e.g. Ivy Bridge i3-3225, Haswell E3-1230 v3, i7-4712HQ, Skylake i7-6560U(yes, I have all of them), w/o SSDT-pr, P/C States are still there. XCPM will read dynamic SSDT tables then give you partly power management, but it's incomplete as I said.

syscl

syscl avatar Mar 04 '17 19:03 syscl

Thank you. I'll test with SSDT-pr in terms of computing power and battery life and will let you know. Now I'm getting 10 full hours, with always-off fan, low case temps and a higher benchmarks than with HWP set in full performance mode, so I suspect that many PM features are working well. Will report in a few days.

bozma88 avatar Mar 04 '17 19:03 bozma88

@bozma88 I disable some dynamic tables in config.plist intentionally, maybe that's the reason why Power management is a bit worse than original one. Because I need time to figure out what this tables are used for. You can manually remove it then see if it improves your battery life...

As a side note, why I disable some dynamic tables is because it "seems" lower down my laptop's core temperature a bit, but it seems this is just my illusion. I will try to re enable those tables, here's the tables I disable for power management:

<key>DropTables</key>
		<array>
			<dict>
				<key>Signature</key>
				<string>SSDT</string>
				<key>TableId</key>
				<string>Ther_Rvp</string>
			</dict>
			<dict>
				<key>Signature</key>
				<string>SSDT</string>
				<key>TableId</key>
				<string>CpuSsdt</string>
			</dict>
			<dict>
				<key>Signature</key>
				<string>SSDT</string>
				<key>TableId</key>
				<string>Cpu0Ist</string>
			</dict>
			<dict>
				<key>Signature</key>
				<string>SSDT</string>
				<key>TableId</key>
				<string>ApIst</string>
			</dict>
			<dict>
				<key>Signature</key>
				<string>SSDT</string>
				<key>TableId</key>
				<string>Cpu0Cst</string>
			</dict>
			<dict>
				<key>Signature</key>
				<string>SSDT</string>
				<key>TableId</key>
				<string>ApCst</string>
			</dict>
		</array>

I await for your feedback, thank you, syscl

syscl avatar Mar 04 '17 19:03 syscl

@syscl @bozma88 I got some .app files corrupted in my Google Drive folder (I have google app installed on XPS 13, and thats dangerous as it has auto-sync and this can damage all files on the cloud), so I guess sleep fix is not enough. I had autopoweroff to 1, so now I set it to 0. Will try this way.

Anyway thats strange, only .app files got corrupted (other files were ok)

mircoianese avatar Mar 05 '17 15:03 mircoianese

@ZombieTheBest Thanks for the writes up, please use Disk Utility to do a first aid it will reduce the file system errors.

syscl

syscl avatar Mar 05 '17 15:03 syscl

@bozma88 @ZombieTheBest Here's the origin pmset -g from my macOS

 standbydelay         10800
 standby              1
 halfdim              1
 hibernatefile        /var/vm/sleepimage
 powernap             0
 gpuswitch            2
 disksleep            0
 sleep                60 (sleep prevented by AddressBookSourceSync)
 autopoweroffdelay    28800
 hibernatemode        0
 autopoweroff         1
 ttyskeepawake        1
 displaysleep         60
 lidwake              1

I am doing some more testing. Give me one sec.

syscl

syscl avatar Mar 05 '17 15:03 syscl

@ZombieTheBest @bozma88 Ok, I did some research about hibernatemode and autopoweroff, this two values are very easily get changed by macOS itself. More like system trying to reset the "incorrect" values once it found. A simple test:

  • set hibernatemode = 0
  • Go to System Preferences->Energy Saver, check and uncheck arbitrary options you like
  • then pmset -g, this time you will find hibernatemode always reset to 3 by operating system, even though we do nothing!

autopoweroff has the similar phenomenon, but once we set Autopoweroff = False in X86PlatformPlugin.kext, system will "correct" the value to 0 instead of 1 like it did to "correct" hibernatemode from 0 to 3.

We need to figure out what cause the hibernate mode = 3 by system.

My time is very limited due to another exam and due next week.

Thank you, syscl

syscl avatar Mar 05 '17 16:03 syscl

Take me off this list please. I Unsubscribed from the Git and am still getting notifications here

Sent from my iPhone

On Mar 4, 2017, at 9:03 AM, Zhou Yating [email protected] wrote:

Hello @all,

I've experienced this issue about 3 times, when I enable HWP + Sleep, my Windows 10 Pro 1511 corrupted and indicating the disk has been corrupted. I have no idea why this happen, because w/o HWP and sleep, there's no such corruption. I also see another people post about this, but I forgot where he post it.

I am really really busy these days, tell me if there's any progress about this issue.

syscl

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

CaliMac avatar Mar 05 '17 16:03 CaliMac

@syscl Nice! Meanwhile the "sleep script" should work right? I think you should release an update with autopoweroff FALSE in X86PlatformPlugin and then the only thing to do is find what triggers hibernatemode to 3.

EDIT: You already did! ;)

mircoianese avatar Mar 05 '17 18:03 mircoianese

@syscl, in response to your observation about dropping SSDT tables, I have to make some things clear. I am NOT using your script to patch my hackintosh. My 9360 conversion guide is on TMX and is mirrored on Insanelymac, so you can have a look! Link here: http://www.insanelymac.com/forum/topic/320471-guide-dell-xps-13-9360-on-macos-sierra-1012x-lts-long-term-support-guide My approach is a bit different: I try to be as lean as possible, the less ACPI tables I drop, the less I patch, the less I inject, the happier I am. My guide is a LTS guide, so I change things slowly and not before I am sure that nothing will compromise laptop stability and data integrity. As for now, no one following my guide had data corruption. I don't drop any SSDT table related to power management, nor I use HWP, nor I use SSDT-pr gen. I don't know how many hours of work you get. I get 10-12 hours at 50% screen brightness and for now I am pretty satisfied with that. I write here because I want to work together to make this hackintosh almost perfect, but my main aim is to keep it stable at all times, since I use it for work.

So, to recap: I don't drop any SSDT table, and I don't drop original SSDTs. Laptop is blazing fast, sleep is reliable and loses 1% every 3 hours, and I don't have any data corruption. I checked sleep logs with pmset -g log and I don't have any darkwake event, ever. Maybe you can check your log, maybe darkwakes are destroying your data. Since my PM is not native, darkwakes never occur.

Next thing I'll try: using SSDT-pr-gen to see whether it improves battery life compared to non-OS-managed PM, but I'm afraid it will enable autopoweroff and darkwakes by default, and it's a risk I don't want to take.

bozma88 avatar Mar 06 '17 22:03 bozma88

@bozma88 If you try my script, deploy will install a sleep script to turn off autopoweroff and change hibernatemode to 0 before system go to sleep per sleep.

BTW, dell smbios truncate has been fixed credit David Passmore and syscl. Only add DellSMBIOSPatch = True in config.plist(refer to my Clover/config.plist). Then enjoy your new SMBIOS.

syscl

syscl avatar Mar 06 '17 22:03 syscl

Yes, I know that, but I am using with satisfaction MacBook9,1 so no patch needed, one less thing in my plist makes me happy! Yes I see your script, but It's a "defensive strategy", I want to fix the source so that the system does not reset do wrong default values. Will let you know :)

bozma88 avatar Mar 06 '17 22:03 bozma88

I'm still on this thread after unsubscribing a half dozen times.  Please remove me from your thread thanks,Dave Albright

On Saturday, March 4, 2017 9:33 AM, Marco Bozzola <[email protected]> wrote:

Be more specific please. HWP enabled in Windows or in MacOS? Also, look here: #26 (comment)— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

CaliMac avatar Mar 06 '17 22:03 CaliMac

Please remove me from this thread -   I unsubscribed from it on GitHub and emails keep pouring in. 

On Saturday, March 4, 2017 10:27 AM, Marco Bozzola <[email protected]> wrote:

First of all, if you look at #26, you'll see that hibernatemode is still enabled because of autopoweroff, so first of all will be to disable it. Then, my advice is to create two git branches. Main one with hwp disabled, and an experimental branch with hwp. Pc works very well with native SSDTS, no HWP, no ssdtprgen, I still get full PM and 10h battery life (i7-9360). Set main branch to a stable setup without HWP and merge changes when they become stable, too dangerous to keep HWP on main branch for data integrity.— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

CaliMac avatar Mar 06 '17 22:03 CaliMac

please unsubscribe me amor this thread.  Dave Albright [email protected] www.davealbright.com 916-224-4500

On Sunday, March 5, 2017 7:04 AM, Zhou Yating <[email protected]> wrote:

@ZombieTheBest Thanks for the writes up, please use Disk Utility to do a first aid it will reduce the file system errors.syscl— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

CaliMac avatar Mar 06 '17 22:03 CaliMac

We can't do anything. Maybe you are still subscibed to the whole repo. If not, email GitHub support and please don't flood the thread, it's unpolite and it clutters everything.

bozma88 avatar Mar 06 '17 22:03 bozma88

@CaliMac You need to go to the repo main page and Unwatch the repo.

svindled avatar Mar 09 '17 18:03 svindled

@syscl, I also have windows 10 dual boot, but never have corrupted, but I never set it to sleep in mac and in windows, always shutdown

Maybe it can confirm that sleep has something to do with it

x4080 avatar Mar 11 '17 22:03 x4080

@syscl, @wmchris, look at this answer: https://pikeralpha.wordpress.com/2017/02/06/nvme-boot-args-and-dummy-kext/#comment-8975

I am using native 4K format for long time and I have no issues, but I understand that not anyone can use it (e.g. Samsung drives).

In this reply Pike admits it didn't patch the whole NVMe driver set. Looking at a Macbook13,2 ioreg (https://pastebin.com/LmDbeafr), AppleS3XController is loaded. I believe firmly that in our Dell, AppleS3XController is used during darkwakes or wake to hibernate. The name, itself, tells that it may be tailored for operation during S3 power states.

So, to finally fix the corruption issue on systems running 512b sectors and full OS Power Management (thus darkwaking and/or hibernating), I think that AppleS3XController (and eventually AppleS3LabController) should be patched too.

bozma88 avatar Jun 04 '17 17:06 bozma88

Added a thread here, I hope it develops well: http://bit.ly/2s6U8eA

EDIT: for some reason, the linked thread is waiting approval by moderators. Until it's approved, you cannot access it.

bozma88 avatar Jun 04 '17 18:06 bozma88

it doesnt require approval by moderators, you've mentioned something they dont like. You'll get a warn or a ban in a few days. Had the same problem with tony. Use insanelymac. :-)

krim404 avatar Jun 04 '17 19:06 krim404

@wmchris, luckily that's not the case, the thread got unlocked. Have a look you all!

bozma88 avatar Jun 04 '17 21:06 bozma88