Here is the slightly modified data that you can use in your KernelAndKextPatches section of Clover config for macOS Sierra DP4:
<key>KextsToPatch</key> <array> <dict> <key>Comment</key> <string>IONVMeFamily Pike R. Alpha Patch#1</string> <key>Disabled</key> <false/> <key>Name</key> <string>IONVMeFamily</string> <key>Find</key> <data>ibPwAgAAweAMBQAQAACJgw==</data> <key>Replace</key> <data>ibPwAgAAweAJBQAQAACJgw==</data> </dict> <dict> <key>Comment</key> <string>IONVMeFamily Pike R. Alpha Patch#2</string> <key>Disabled</key> <false/> <key>Name</key> <string>IONVMeFamily</string> <key>Find</key> <data>D7aMiIIAAACD+QwPhTIBAA==</data> <key>Replace</key> <data>D7aMiIIAAACD+QkPhTIBAA==</data> </dict> <dict> <key>Comment</key> <string>IONVMeFamily Pike R. Alpha Patch#3</string> <key>Disabled</key> <false/> <key>Name</key> <string>IONVMeFamily</string> <key>Find</key> <data>AMeDpAAAAAAQAABIi0gISA==</data> <key>Replace</key> <data>AMeDpAAAAAACAABIi0gISA==</data> </dict> <dict> <key>Comment</key> <string>IONVMeFamily Pike R. Alpha Patch#4</string> <key>Disabled</key> <false/> <key>Name</key> <string>IONVMeFamily</string> <key>Find</key> <data>SYnGTYX2dGFBwecMSWP/vg==</data> <key>Replace</key> <data>SYnGTYX2dGFBwecJSWP/vg==</data> </dict> <dict> <key>Comment</key> <string>IONVMeFamily Pike R. Alpha Patch#5</string> <key>Disabled</key> <false/> <key>Name</key> <string>IONVMeFamily</string> <key>Find</key> <data>hv8PAABIwegMD7cPgeH/Dw==</data> <key>Replace</key> <data>hv8PAABIwegJD7cPgeH/Dw==</data> </dict> <dict> <key>Comment</key> <string>IONVMeFamily Pike R. Alpha Patch#6_7</string> <key>Disabled</key> <false/> <key>Name</key> <string>IONVMeFamily</string> <key>Find</key> <data>icGB4f8PAABIAdFIgfn/DwAAdzs=</data> <key>Replace</key> <data>icGB4f8BAABIAdFIgfn/AQAAdzs=</data> </dict> <dict> <key>Comment</key> <string>IONVMeFamily Pike R. Alpha Patch#8</string> <key>Disabled</key> <false/> <key>Name</key> <string>IONVMeFamily</string> <key>Find</key> <data>SYHF/w8AAEnB7QxJiwQkSA==</data> <key>Replace</key> <data>SYHF/w8AAEnB7QlJiwQkSA==</data> </dict> <dict> <key>Comment</key> <string>IONVMeFamily Pike R. Alpha Patch#9_10</string> <key>Disabled</key> <false/> <key>Name</key> <string>IONVMeFamily</string> <key>Find</key> <data>BgIAAEyNuAAQAABMiflIgeEA8P//SYmGGgEAAEmJjiIBAABBvAAQAABJKfQ=</data> <key>Replace</key> <data>BgIAAEyNuAACAABMiflIgeEA8P//SYmGGgEAAEmJjiIBAABBvAACAABJKfQ=</data> </dict> <dict> <key>Comment</key> <string>IONVMeFamily Pike R. Alpha Patch#11</string> <key>Disabled</key> <false/> <key>Name</key> <string>IONVMeFamily</string> <key>Find</key> <data>AABJiY4iAQAAugAQAABIKQ==</data> <key>Replace</key> <data>AABJiY4iAQAAugACAABIKQ==</data> </dict> <dict> <key>Comment</key> <string>IONVMeFamily Pike R. Alpha Patch#12</string> <key>Disabled</key> <false/> <key>Name</key> <string>IONVMeFamily</string> <key>Find</key> <data>yAAAAEkp17gAEAAATYskJA==</data> <key>Replace</key> <data>yAAAAEkp17gAAgAATYskJA==</data> </dict> <dict> <key>Comment</key> <string>IONVMeFamily Pike R. Alpha Patch#13</string> <key>Disabled</key> <false/> <key>Name</key> <string>IONVMeFamily</string> <key>Find</key> <data>4b+AQBUGTYnWugAQAABFMQ==</data> <key>Replace</key> <data>4b+AQBUGTYnWugACAABFMQ==</data> </dict> <dict> <key>Comment</key> <string>IONVMeFamily Pike R. Alpha Patch#14</string> <key>Disabled</key> <false/> <key>Name</key> <string>IONVMeFamily</string> <key>Find</key> <data>iWTY+EmBxAAQAABJgccA8A==</data> <key>Replace</key> <data>iWTY+EmBxAACAABJgccA8A==</data> </dict> <dict> <key>Comment</key> <string>IONVMeFamily Pike R. Alpha Patch#15</string> <key>Disabled</key> <false/> <key>Name</key> <string>IONVMeFamily</string> <key>Find</key> <data>Bf8PAABIwegMZvfB/w8PlQ==</data> <key>Replace</key> <data>Bf8PAABIwegJZvfB/w8PlQ==</data> </dict> <dict> <key>Comment</key> <string>IONVMeFamily Pike R. Alpha Patch#16</string> <key>Disabled</key> <false/> <key>Name</key> <string>IONVMeFamily</string> <key>Find</key> <data>weIIQQ+2wcHgDEQJ0EQJwA==</data> <key>Replace</key> <data>weIIQQ+2wcHgCUQJ0EQJwA==</data> </dict> <dict> <key>Comment</key> <string>IONVMeFamily Pike R. Alpha Patch#17</string> <key>Disabled</key> <false/> <key>Name</key> <string>IONVMeFamily</string> <key>Find</key> <data>RYTJD5XAD7bAweAMRAnYRA==</data> <key>Replace</key> <data>RYTJD5XAD7bAweAJRAnYRA==</data> </dict> </array>
Note that I removed the Info.plist patch, because that is no longer required. Not since DP2 anymore, which is when Apple fixed the IOPCIClassMatch error.
Another thing that changed is the first patch. Ok. It’s only a single byte that changed, but just so that you know what changed.
Edit: I don’t use Clover myself, and I prefer a dummy kext with the patched binary in it. Similar to what I use for AppleHDA8Series.sh but now even cleaner.
You may also want to add the patch to solve the orange drive icon (external drive) and you can do that by adding this patch but you should be using a tiny SSDT with these properties in it. Either that or a modified DSDT.
Presume you use RevoBoot.
Is there an *updated* “revoboot for dummies” equivalent resource?
nb: Am NOT asking you personally for assistance. (and never will). I understand your deep insights get ‘filtered’ by others for projects like Clover.
Shoulders of giants and all.
Sure I use RevoBoot. For good reasons. Like knowing when Apple changed something, and where, so that I can work around it. This is also why Chameleon is still alive and kicking. In part thanks to the solutions for problems that I found.
You think that Clover developers are going to write a driver for Apple’s new FileSystem? I personally don’t think so. Not even for HFS. All they really to do is load the VBOX EFI for it and that’s about it. The same thing will happen for apfs, but this is also why the number of developers with a solid know-how and deep understanding of the internals is declining. Thanks to not having to hack anymore…
About the RevoBoot setup guide. No. We don’t have one. Sorry.
Some interesting pointers to begin with:
Singh, Amit Mac OS X Internals (2007), pp. 362-379
Levin, Jonathan Mac OS® X and iOS Internals (2013), pp. 185-210
http://wiki.osx86project.org/wiki/index.php/Apple's_EFI_implementation
http://osxbook.com/book/bonus/chapter4/efiprogramming/
“Well hello command line, where have you been my whole life?” 😉
Speaking of RevoBoot, have you seen my PR? https://github.com/Piker-Alpha/RevoBoot/pull/14
No I did not. Apparently I am (no longer) getting notifications but I gladly accepted the updated data. Thanks a lot!
No problem, thanks for merging.
r-lind. Thanks for the pointers. I’m starting here:
http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-00sc-introduction-to-computer-science-and-programming-spring-2011/
See you on the other side 😉
Very good
“Not since DP2 anymore, which is when Apple fixed the IOPCIClassMatch error” <== again, Apple help hackint0sher? 🙂 https://pikeralpha.wordpress.com/2016/05/24/tim-cook-at-startup-fest-europe-amsterdam/#comment-5642
Or when Apple fixed they AppleAPIC.kext so that we don’t have to patch it anymore/use a certain BIOS setting.
any update for Sierra?
Not yet. But soonish.
Pike thanks so much for your posts I really have been enjoying them. I also blog with Hackintosh fixes and I know it takes time to put this stuff online.
Thanks to your NVMe patches I’ve been able to get my Samsung 950 Pros working on Sierra but something doesn’t seem right. My system log is getting spammed with the message:
AppleNVMe Assert failed: 0 == (status)
And this is while using two 950 Pro drives in raid, and booted to it. But the drives work OK and are fast. The issue is that there seems to be cache issues because the deleted process runs continuously invalidating caches and regenerating them. My guess is that it cant write to the cache for some reason. Maybe it is trying to update the boot cache and cannot for some reason? Do you have any ideas?
Here’s a screenshot of the whole message:

Thanks again!
Hi Nick,
Thanks. Much appreciated. Now. Do we actually patch the routine that dumps the errors? No idea. Not at home so I cannot check this right now.
Hey there @pikeralpha wondering if you have had any time to look at this? Would love to make some progress on fixing. Thanks so much!
Actually this was solved by installing a 3rd NVMe drive. This is a complete mystery to me why this worked. It could be because of the extra drive, or it could be because I dismantled and re-created the AppleRAID. No more AppleNVMe Assert failed: 0 == (status) errors.
Odd. My best guess would be that you solved it with the re-created AppleRAID setup.
Pike, Nick.
Been following your X99 adventures too Nick.
May I make a ancillary suggestion?
One of these:
http://amfeltec.com/products/pci-express-carrier-board-for-m-2-ssd-modules/
With (up to) 4 x oem 951’s – for full raid 0, ahci support. You may recall the result here:
http://barefeats.com/hard210.html
Anyway, good luck in your endeavours.
Thanks for your comment @13parsecs,
I did check out that board before upgrading to X99 because I didn’t have enough PCIe lanes. The cost of the card is still in the $350 range according to the company. I have 2x NVMe drives running in a software raid which is solid and I could run up to 5 because I have the PCIe slots for it.
Thanks for the suggestion though, that’s a cool article.
Dear Piker,
I’ve moved my post(related to NVMe) here.
I updated Sierra from 10.12.2 to 10.12.3 beta4(16D30a) with your great patches(not RehabMan’s one). There’s actually some errors from the system log.
The full log is here: https://github.com/syscl/XPS9350-macOS/files/718718/XPS.13.9350_10_12_3_beta4.zip
Thank you!
syscl
Thanks for moving it. Top!
Ok. I am looking at your log and I see three errors in it. The first error is usually about the LBA shift value, which we patched already, but the first error in your log appears to be related to the formatted LBA sector size/format (byte 0x1a/26) in the following structure (see flbas):
This value can be anything to represent: 512 (no metadata), 520 (8 bytes metadata), 528 (16 bytes metadata), 4096 (no metadata), 4104 (8 bytes metadata), 4160 (64 bytes metadata), and 4224 (128 bytes metadata) bytes. Among others. So how did you format the drive?
In IONVMeBlockStorageDevice::GetDeviceProperties() at offset 0x4cad in the binary, there is this code:
If flbas bit:4 (0x10) is set (1) then the metadata is transferred at the end of the data LBA, creating an extended data LBA. If flbas bit:4 is cleared (0) then the metadata for a command is transferred as a separate contiguous buffer of data. Bit:4 is not applicable when there is no metadata. And here it fails.
You can find this in the binary when you search for:
0xF6 0xC1 0x10
0x0F 0x85 0x1C 0x01 0x00 0x00
What I would do (first) is NOP/0x90 out the jne instruction – second line – and check the log. See if the error about line 174 is gone. If that works, then change the value 0x10 into 0x01 or 0x02, 0x04 and 0x08 to see which one works for your drive. Note that there are 16 possible supported LBA Formats (flbas bits 3:0) and I mentioned only a few values. By the way. This value points to a value in lbaf[16]. There the LBA size and format is defined. See the next structure:
Note: flbas bits 7:5 are reserved
Warning: Please note that doing this is not without risks!
Tip: I boot from a USB flash drive with the patched binary of the IONVMeFamily.kext on it. Which is relatively easy to setup, and it should protect you from drive errors. When I am done and everything works, only then I copy the driver to my SSD.
Dear Pike:
I love you!!!!!!! After change 0x10 to 0x01, it works as expected!!
find: f6c1100f 851c0100 00
replace: f6c1010f 851c0100 00
Here’s the screenshot, I will install macOS on NVMe and report here soon!

Thank you very much!!!
syscl
Phew. That is good to hear. One issue less to worry about 😉
Hello @Piker-Alpha,
How are you?
Could you please give me the reason why you change the value from 0x10 to 0x01, 0x02, 0x04, 0x08? Is this value depends on specific hard disk and cannot be changed?(Very curious about it)
Here’s the NVMe information after install macOS 10.12.2

Here’s the ioreg
https://github.com/syscl/XPS9350-macOS/files/721209/syscl.s.MacBook.zip
There’s no IONVMEFamily.kext error in log anymore, gut ;).
Now the rest is to log out the IONVMeFamily information before sleep(to see what cause the data corruption):
sudo log config –mode “level:debug”
log show –predicate ‘process == “kernel”‘ –last “5m”
is this command lines fit your requirement?
Thank you!
syscl
I think that I explained that already in my previous post 😉
Edit: Sorry for running out of time/being a bit lazy. I now added some extra information. I hope that this helps you to understand what we are doing 😉
Ok. Let’s assume that there is no firmware bug, which can cause data corruption as well, and that sleep is entered without delay, then you may need to add Sleep (0x3e8) in method _PTS to give it some time to flush out the data.
For the debug output. I take it that the corruption occurs when it enters sleep, so you will need to write the data (in plain text) so another volume/device, or it will be lost.
You can setup a hot corner to enter sleep. What I do is move the mouse cursor in the upper left corner to let it sleep, and then after a short while, I move the cursor around on the screen to wake it up, before is goes into a deeper sleep state. Why? The last few lines in the log may give me some clues as to what goes wrong. So please. Try this before anything.
Dear Pike,
OK, I need some time to digest your content 😉
BTW, my friends lent their MacBook9,1 and MacBookPro13,2 for me. I dumped some information from their new MacBook. I soon found some interesting properties rooted Device (SSD0):
“deep-idle”, here’s the code I changed(added deep-idle and removed “sats-express-power-off” and “ssd-off-in-S4”:
If (LEqual (NVME, One))
{
Return (Package (0x06)
{
“deep-idle”
One,
“use-msi”,
One,
“nvme-LPSR-during-S3-S4”,
One
})
}
Else
{
Return (Package (0x02)
{
“use-msi”,
One,
})
}
Then there will be deep-idle in ioreg:

Now, the power consume has slightly lowered down(lower 0.1w~0.3w).
Wish this could help to improve power consume.
Have a good day,
syscl
Let’s first check if deep-idle et all is even supported. Add nvme=0x100 to your boot arguments and reboot. Check the log for IONVMeFamily related output.
Dear Pike,
I added nvme=0x100 -v in boot arguments then reboot. But I found no a single line log information about IONVMeFamily. Does that means something or I do something wrong? I use IONVMeFamily.kext from 10.12.3 beta4(16D30a).
Thank you,
syscl
I going to assume that you forgot to add debug=0x12a and perhaps I am wrong and was it nvme=0x101. Give it a try. You should find at least a few lines with IONVMeController:: in the log.
Hi @Pike,
Thanks for the heads up.
boot arguments: debug=0x12a nvme=0x100 -v gives:
no NVMe log
boot arguments: debug=0x12a nvme=0x101 -v gives only the following log of NVMe:
2017-01-22 13:02:05.181918-0600 localhost kernel[0]: (IONVMeFamily) virtual bool IONVMeController::InitializePCI()::861:Number of MSI-X interrupts=0x13
Thank you,
syscl
Ok. 0x101 it is then, but that line alone is even less than anything else I have seen so far.
Edit: Do I have your ACPI tables? If not. Please link me to the files. Thanks.
OK Pike, here’s the ACPI(origin + patched):
https://github.com/syscl/XPS9350-macOS/files/727292/ACPI.zip
Thank you for your patience. I am really appreciate!
Have a great day,
syscl