Jump to content
About Just Joined group Read more... ×

sherylynn

Members
  • Content Count

    2
  • Joined

  • Last visited


Reputation Activity

  1. Thanks
    sherylynn reacted to Pene in Patch for using NVMe under macOS Sierra is ready.   
    Hello RehabMan / Others involved,

    Regarding the Plextor/LiteOn/Hynix "special patch", I see it mentioned as "IONVMeFamily Preferred Block Size patch".
    However I can't see the relation of this patch to block size (I think the description is wrong), and I also don't understand why we need 4 variants (0x01, 0x02, 0x04, 0x08).
     
    If we look at what we are patching (for High Sierra, which by the way is the same for Mojave Beta1): 
    ... 8A 48 1A (mov cl, byte [rax+0x1a]) F6 C1 10 (test cl, 0x10) 0F 85 41 01 00 00 (jne some_32bit_offset) 80 E1 0F (and cl, 0xf) 0F B6 C9 (movzx ecx, cl) ...  
    The test in this code is on byte 26 (0x1a) of the Identify Namespace, which represents Formatted LBA Size (FLBAS). Its structure is something like this:
    struct { UCHAR   LbaFormatIndex              : 4; UCHAR   MetadataInExtendedDataLBA   : 1;   UCHAR   Reserved                    : 3; } FLBAS;  // byte 26    M - Formatted LBA Size (FLBAS) Bits 3-0 indicate the index of the chosen format variant for the namespace, and Bit 4 indicates whether metadata for a command is transferred as part of an extended data LBA.
    The test instruction of original code checks if Bit 4 (0x10) of FLBAS is set to 1 (this bit corresponds to MetadataInExtendedDataLBA), and if it is, the jne instruction performs the jump.
     
    The problem here is that OSX decides that metadata should be used, only by the data at byte 26 (FLBAS), which these drives don't properly respect, and doesn't perform further checks.
    Linux driver, for example, takes that value into consideration only if the active LBA Format data structure has MS (metadata size) > 0:
    NVME_NS_FLBAS_LBA_MASK = 0xf; NVME_NS_FLBAS_META_EXT = 0x10; ... ns->ms = le16_to_cpu(id->lbaf[id->flbas & NVME_NS_FLBAS_LBA_MASK].ms); ns->ext = ns->ms && (id->flbas & NVME_NS_FLBAS_META_EXT);  
    Or another possible place to check, would be byte 27 of the Identify Namespace (MC), that shows the metadata capabilities (but not necessarily the active setting):
    struct { UCHAR MetadataInExtendedDataLBA : 1; UCHAR MetadataInSeperateBuffer : 1; UCHAR Reserved : 6; } MC; // byte 27 M - Metadata Capabilities (MC)  
    Under linux, we can easily see the inconsistency for this drive:
    $ sudo nvme id-ns /dev/nvme0n1 NVME Identify Namespace 1: ... flbas : 0x11 mc : 0 ... lbaf 0 : ms:0 lbads:9 rp:0x1 lbaf 1 : ms:0 lbads:12 rp:0 (in use) FLBAS bit 4 is set to 1, but MC bit 0 is set to 0. We can also see the two available LBA formats (512 and 4K), none of which allows metadata (ms=0, which stands for metadata size, clearly means unsupported)
     
    So, in the above code (when unpatched), FLBAS bit 4 would trigger the jump, although no metadata is present in extended data LBA, leading to an assert (as probably OSX NVME driver doesn't support such metadata).
     
    Anyway, about the proposed patch: it is clear that in the patch we reverse bit 4 (0x10) of FLBAS to disable checking for metadata, but my question is, why additionally in the presented patch variants we also add tests on bits 0-3 of FLBAS, which may just trigger as well the assert? (each of the 4 variants 0x01 0x02, 0x04, 0x08 adds a test on one of the bits 0-3, when the original check does not test at all against LbaFormatIndex, so I can't really see the logic in that). It is clear that the "proper" solution would be to add further checks for metadata presence, but as the intention here seems just to disable checking for metadata, why not, for example, just reverse bit 4 (0x00) instead of all the variants? This would result in something like this, and should work for all cases (the relevant code is the same for 10.12.x->10.14b1):
    <dict> <key>Comment</key> <string>IONVMeFamily: Ignore FLBAS bit:4 being set - for Plextor/LiteOn/Hynix</string> <key>Disabled</key> <false/> <key>Name</key> <string>IONVMeFamily</string> <key>Find</key> <data>SBr2wRAPhQ==</data> <key>Replace</key> <data>SBr2wQAPhQ==</data> </dict>  
     
    Edit (Feb 2019): Updated the Find/Replace pattern above to be compatible also with the coming 10.14.4 (it remains compatible also with older versions), as the underlying code described at the beginning of this post was changed into the following equivalent:
    ... 0F B6 48 1A (movzx ecx, byte [rax+0x1a]) F6 C1 10 (test cl, 0x10) 0F 85 44 01 00 00 (jne some_32bit_offset) 83 E1 0F (and ecx, 0xf) ...  
  2. Like
    sherylynn reacted to Vlada. in [HOW TO] Modification of AMD FB + Clover injection   
    Hmm... strange that fakeid doesn't work. Well, if my suggestion doesn't work and fake id doesn't work too, then you should manually make changes in the AMD7000Controller.kext.
     
    Make a copy of AMD7000Controller.kext on desktop, then open the info.plist file inside the kext and find 0x68101002 hex then replace those numbers with 0x68111002 and reinstall the kext again.
     
    That's not the perfect solution, but it'll do the job until you find the best one.
  3. Like
    sherylynn reacted to Pavo in [HOW TO] Modification of AMD FB + Clover injection   
    Yeah the normal AMD script is for 10.10 and 10.11 only, for Sierra the pointer changed, so a different script was done. Example of Sierra script:
    sudo php /Users/henrybrock/Dropbox/ATI_FrameBuffers_Sierra_Edition.php Password: No log handling enabled - using stderr logging Created directory: /var/db/net-snmp Created directory: /var/db/net-snmp/mib_indexes -------------------------AMD2400Controller.kext------------------------- Iago (2) @ 0x109df0 LVDS, ???? 020000004000000019000000000000000001001200000000 0010000016000000c4000000000000001000011100000000 -------------------------AMD2600Controller.kext------------------------- Hypoprion (2) @ 0x109dc0 LVDS, ???? 020000004000000019000000000000000001001200000000 0010000016000000c4000000000000001000011100000000 Lamna (2) @ 0x109df0 SDVI, DDVI 000200001400000080000000000000000001021100000000 040000001600000080000000000000000010011200000000 -------------------------AMD3800Controller.kext------------------------- Megalodon (3) @ 0x10ada0 SDVI, DDVI, SVIDEO 000200001400000000000000000000000001021100000000 040000001600000000000000000000000010011200000000 800000000200000004000000000000000010000000000000 Triakis (2) @ 0x10adf0 SDVI, DDVI 000200001400000000000000000000000001021100000000 040000001600000000000000000000000010011200000000 -------------------------AMD4600Controller.kext------------------------- Flicker (3) @ 0x107d20 DP, DP, SDVI 000400000004000000010000000000000201030500000000 000400000004000000010000000000000100020200000000 000200001402000000010000000000000010010400000000 Gliff (3) @ 0x107d70 LVDS, LVDS, DP 020000004000000019010000000000000201000300000000 020000000001000019010000000000002001020200000000 000400000406000000010000000000001000010100000000 Shrike (3) @ 0x107dc0 LVDS, LVDS, DP 020000004000000019010000000000000201000300000000 020000000001000019010000000000002001020200000000 000400000403000000010000000000001000010100000000 -------------------------AMD4800Controller.kext------------------------- Cardinal (2) @ 0x106d50 SDVI, DDVI 000200001402000000010000000000000101010400000000 040000001402000000010000000000000010020300000000 MotMot (2) @ 0x106d80 DP, DDVI 000400000401000000010000000000001000020300000000 040000001402000000010000000000000111010400000000 Quail (3) @ 0x106db0 LVDS, LVDS, DP 020000004000000019010000000000002201000700000000 020000000001000019010000000000002001030400000000 000400000403000000010000000000001000020300000000 -------------------------AMD5000Controller.kext------------------------- Douc (2) @ 0xc8630 LVDS, DP 020000000005000019030000000000002103020200000000 000400000402000000030000000000001102010100000000 Langur (3) @ 0xc8660 DP, DP, DDVI 000400000406000000010000000000002103040200000000 000400000406000000010000000000001102010100000000 040000001402000000010000000000000204050300000000 Uakari (4) @ 0xc86b0 DP, DDVI, SDVI, HDMI 000400000004000000710000000000001204040100000000 040000001400000000710000000000000112010300000000 000200001400000000710000000000000000060500000000 000800000002000000710000000000002205050400000000 Zonalis (6) @ 0xc8710 DP, DP, DP, DP, DP, DP 000400000406000000710000000000002001060600000000 000400000406000000710000000000001000050500000000 000400000406000000710000000000002103020400000000 000400000406000000710000000000001102010300000000 000400000406000000710000000000002205040200000000 000400000406000000710000000000001204030100000000 Alouatta (4) @ 0xc87a0 LVDS, DP, DP, DP 020000000001000019010000000000001204030300000000 000400000406000000710000000000001102010100000000 000400000406000000710000000000002103020200000000 000400000406000000710000000000002205040400000000 Hoolock (3) @ 0xc8800 DP, DP, DDVI 000400000406000000010000000000002103050100000000 000400000406000000010000000000001102040200000000 040000001402000000010000000000000204010300000000 Vervet (4) @ 0xc8850 DP, DDVI, SDVI, HDMI 000400000004000000710000000000001204040200000000 040000001400000000710000000000000112010400000000 000200001400000000710000000000000000060300000000 000800000002000000710000000000002205050100000000 Baboon (3) @ 0xc88b0 DDVI, HDMI, VGA 040000001400000000010000000000000102010300000000 000800000002000000710000000000002205020100000000 100000001000000000010000000000000010000200000000 Eulemur (3) @ 0xc8900 DDVI, HDMI, VGA 040000001400000000010000000000000102010400000000 000800000002000000710000000000001204040200000000 100000001000000000000000000000000010000100000000 Galago (2) @ 0xc8960 LVDS, DP 020000000001000019030000000000002103020200000000 000400000406000000730000000000001102010100000000 Colobus (2) @ 0xc89a0 LVDS, DP 020000000001000019030000000000002103020200000000 000400000406000000730000000000001102010100000000 Mangabey (2) @ 0xc89e0 LVDS, DP 020000004000000019010000000000000000000300000000 000400000406000000730000000000001102010100000000 Nomascus (4) @ 0xc8a20 LVDS, LVDS, DP, DP 020000004000000019010000000000000000000500000000 020000000001000019030000000000001204030300000000 000400000406000000730000000000001102010100000000 000400000407000000730000000000002103020200000000 Orangutan (2) @ 0xc8a90 LVDS, DP 020000004000000019010000000000000000000500000000 000400000406000000730000000000001102010100000000 -------------------------AMD6000Controller.kext------------------------- Pithecia (2) @ 0xe7650 DP, DDVI 000400000403000000010000000000002103020400000000 040000001402000000010000000000000000040300000000 Bulrushes (6) @ 0xe7680 DP, DP, DP, DP, DP, DP 000400000403000000010000000000001102010100000000 000400000403000000010000000000002103020200000000 000400000403000000010000000000001204030300000000 000400000403000000010000000000002205040400000000 000400000403000000010000000000001000050500000000 000400000403000000010000000000002001060600000000 Cattail (4) @ 0xe7710 LVDS, DP, DP, DP 020000004000000039050000000000000000000500000000 000400000403000000010000000000001102010100000000 000400000001000000091000000000002103020200000000 000400000001000000091000000000001204030300000000 Hydrilla (5) @ 0xe7770 LVDS, DP, DP, DP, DP 020000000001000019010000000000001204030300000000 000400000403000000010000000000001102010100000000 000400000001000000091000000000002103020200000000 000400000001000000091000000000002205050400000000 000400000403000000010000000000001000040500000000 Duckweed (4) @ 0xe77f0 DP, DP, HDMI, SDVI 000400000403000000010000000000001204040100000000 000400000403000000010000000000002205050200000000 000800000402000000010000000000001102030400000000 000200001402000000010000000000000000060500000000 Fanwort (4) @ 0xe7850 LVDS, DP, DP, DP 020000004000000039050000000000000000000400000000 000400000403000000010000000000001102010100000000 000400000001000000091000000000002103020200000000 000400000001000000091000000000001204030300000000 Elodea (5) @ 0xe78b0 LVDS, DP, DP, DP, DP 020000000001000019010000000000001204030300000000 000400000403000000010000000000001000050500000000 000400000403000000010000000000001102010100000000 000400000001000000091000000000002103020200000000 000400000001000000091000000000002205040400000000 Kudzu (2) @ 0xe7930 DP, HDMI 000400000403000000010000000000001204030300000000 000800000402000000010000000000001102010100000000 Gibba (5) @ 0xe7960 DP, DP, HDMI, SDVI, DDVI 000400000403000000010000000000001204050100000000 000400000403000000010000000000002205040200000000 000800000402000000010000000000001102060400000000 000200001402000000010000000000000000030500000000 040000000402000000010000000000001102010300000000 Lotus (3) @ 0xe79e0 DP, HDMI, DP 000400000403000000010000000000001102010100000000 000800000402000000010000000000002205040400000000 000400000001000000010000000000002103020200000000 Ipomoea (3) @ 0xe7a30 DP, HDMI, VGA 000400000403000000010000000000001204010500000000 000800000402000000010000000000001102040300000000 100000001000000000010000000000000000000200000000 Muskgrass (4) @ 0xe7a80 DP, DP, DP, HDMI 000400000403000000010100000000001102010100000000 000400000001000000091200000000002103020200000000 000400000001000000091300000000002205040400000000 000800000402000000010400000000001204030300000000 Juncus (4) @ 0xe7ae0 DP, DP, DP, DP 000400000403000000010000000000001204030300000000 000400000403000000010000000000001000040500000000 000400000403000000010000000000001102010100000000 000400000403000000010000000000002103020200000000 Osmunda (4) @ 0xe7b40 LVDS, DP, DP, HDMI 020000000001000039050100000000001000050500000000 000400000403000000090200000000001102010100000000 000400000403000000090300000000002103020200000000 000800000402000000010400000000001204030300000000 Pondweed (3) @ 0xe7ba0 LVDS, DP, DP 020000000001000019010100000000001000050500000000 000400000403000000010200000000001102010100000000 000400000403000000010300000000002103020200000000 Spikerush (4) @ 0xe7bf0 LVDS, DP, DP, DP 020000004000000039050100000000000000000500000000 000400000403000000010200000000001102010100000000 000400000001000000090200000000002103020200000000 000400000001000000090300000000001204030300000000 Typha (5) @ 0xe7c50 DP, DP, DP, DP, DDVI 000400000403000000010100000000001102040100000000 000400000403000000010200000000002103050200000000 000400000001000000090300000000001000020500000000 000400000001000000090400000000002001030600000000 040000001402000000010500000000000204010300000000 -------------------------AMD7000Controller.kext------------------------- Ramen (6) @ 0xed770 LVDS, HDMI, DP, DP, DP, DP 020000000001000039050108000000002001050600000000 000800000402000000010200000000001000030500000000 000400000403000000010343000000001102010100000000 000400000001000000010431000000002103040300000000 000400000403000000010563000000001204020200000000 000400000001000000010651000000002205040300000000 Tako (6) @ 0xed870 LVDS, LVDS, DP, DP, DP, DP 020000000001000000010151000000002205020400000000 020000000001000000010261010000001204010300000000 000400000403000000010343000000001102030100000000 000400000001000000010431000000002103050500000000 000400000403000000010523000000001000040200000000 000400000001000000010611000000002001050500000000 Namako (4) @ 0xed900 LVDS, LVDS, DP, DP 020000000001000000010151000000002205020200000000 020000000001000000010261010000001204010100000000 000400000403000000010343000000001102030300000000 000400000403000000010433000000002103040400000000 Aji (4) @ 0xed9c0 DP, DP, DDVI, HDMI 000400000403000000010101000000001204050100000000 000400000403000000010201000000002205040200000000 040000001402000000010300000000000000030600000000 000800000402000000010400000000001102010400000000 Buri (4) @ 0xeda20 LVDS, DP, DP, HDMI 020000000001000039050100000000001000050500000000 000400000403000000090200000000001102010100000000 000400000403000000090300000000002103020200000000 000800000402000000010400000000001204030300000000 Chutoro (5) @ 0xeda80 LVDS, DP, DP, DP, DP 020000000001000019010100000000001204030300000000 000400000403000000010201000000001102010100000000 000400000001000000090300000000002103020200000000 000400000001000000090400000000002205040400000000 000400000403000000010500000000001000050500000000 Dashimaki (4) @ 0xedb00 DP, DP, DDVI, HDMI 000400000403000000010101000000001204020200000000 000400000403000000010200000000002205030500000000 040000001402000000010301000000000000040400000000 000800000402000000010400000000001102010100000000 Ebi (5) @ 0xedb60 LVDS, DP, DP, DP, DP 020000000001000019010100000000001204030300000000 000400000403000000010201000000001102010100000000 000400000001000000090301000000002103020200000000 000400000001000000090401000000002205040400000000 000400000403000000010501000000001000050500000000 Gari (5) @ 0xedbe0 LVDS, DP, DP, DP, DP 020000000001000019010100000000001204030300000000 000400000403000000010201000000001102010100000000 000400000001000000090300000000002103020200000000 000400000001000000090400000000002205040400000000 000400000403000000010500000000001000050500000000 Futomaki (4) @ 0xedc90 DP, DP, DDVI, HDMI 000400000403000000010101000000001204040100000000 000400000403000000010201000000002205050200000000 040000001402000000010300000000000000060600000000 000800000402000000010400000000001102010300000000 Hamachi (4) @ 0xedcf0 DP, DP, DDVI, HDMI 000400000403000000010101000000001204050100000000 000400000403000000010201000000002205040200000000 040000001402000000010300000000000000030600000000 000800000402000000010400000000001102010400000000 OPM (6) @ 0xedd90 DP, DP, DP, DP, DP, DP 000400000403000000010001000000001102010100000000 000400000403000000010001000000002103020200000000 000400000403000000010001000000001204030300000000 000400000403000000010001000000002205040400000000 000400000403000000010001000000001000050500000000 000400001403000000010001000000002001060600000000 Ikura (1) @ 0xede20 HDMI 000800000402000000010100000000001204030100000000 IkuraS (6) @ 0xede40 DP, DP, DP, DP, DP, DP 000400000403000000010143000000001102010300000000 000400000403000000010233000000002103020400000000 000400000403000000010363000000001204030100000000 000400000403000000010453000000002205040200000000 000400000403000000010523000000001000050500000000 000400000403000000010613000000002001060600000000 Junsai (6) @ 0xeded0 DP, DP, DP, DP, DP, DP 000400000403000000010001000000001204030100000000 000400000403000000010001000000002205040200000000 000400000403000000010001000000001102010300000000 000400000403000000010001000000002103020400000000 000400000403000000010001000000001000050500000000 000400000403000000010001000000002001060600000000 Kani (1) @ 0xedf60 HDMI 000800000402000000010100000000001204030100000000 KaniS (6) @ 0xedf80 DP, DP, DP, DP, DP, DP 000400000403000000010143000000001102010300000000 000400000403000000010233000000002103020400000000 000400000403000000010363000000001204030100000000 000400000403000000010453000000002205040200000000 000400000403000000010523000000001000050500000000 000400000403000000010613000000002001060600000000 DashimakiS (4) @ 0xee010 DP, DP, DDVI, HDMI 000400000403000000010101000000001204020200000000 000400000403000000010201000000002205030500000000 040000001402000000010300000000000000040400000000 000800000402000000010400000000001102010100000000 Maguro (1) @ 0xee070 HDMI 000800000402000000010100000000001204030100000000 MaguroS (6) @ 0xee090 DP, DP, DP, DP, DP, DP 000400000403000000010143000000001102010300000000 000400000403000000010233000000002103020400000000 000400000403000000010363000000001204030100000000 000400000403000000010453000000002205040200000000 000400000403000000010523000000001000050500000000 000400000403000000010613000000002001060600000000 -------------------------AMD8000Controller.kext------------------------- Exmoor (6) @ 0xf4f20 LVDS, LVDS, DP, DP, DP, DP 020000000001000000010151000000002205020400000000 020000000001000000010261010000001204010300000000 000400000403000000010343000000001102030100000000 000400000001000000010431000000002103050500000000 000400000403000000010523000000001000040200000000 000400000001000000010611000000002001050500000000 Baladi (6) @ 0xf50b0 DP, DP, DP, DP, DP, DP 000400000403000000010300000000001204030300000000 000400000403000000010100000000001102010100000000 000400000403000000010200000000002103020200000000 000400000403000000010400000000002205040400000000 000400000403000000010500000000001000050500000000 000400000403000000010600000000002001060600000000 -------------------------AMD9000Controller.kext------------------------- Exmoor (6) @ 0x13f540 LVDS, LVDS, DP, DP, DP, DP 020000000001000000010151000000002205020400000000 020000000001000000010261010000001204010300000000 000400000403000000010343000000001102030100000000 000400000001000000010431000000002103050500000000 000400000403000000010523000000001000040200000000 000400000001000000010611000000002001050500000000 OPM (6) @ 0x13f5d0 DP, DP, DP, DP, DP, DP 000400000403000000000001000000001000010100000000 000400000403000000000001000000002001020200000000 000400000403000000000001000000001102030300000000 000400000403000000000001000000002103040400000000 000400000403000000000001000000001204050500000000 000400000403000000000001000000002205060600000000 MalteseS (1) @ 0x13f660 HDMI 000800000402000000010100000000001204030100000000 Lagotto (4) @ 0x13f680 DP, HDMI, DDVI, DDVI 000400000403000000010100000000001102040100000000 000800000402000000010200000000002103050300000000 040000000402000000010300000000000000010500000000 040000000402000000010400000000000204060600000000 GreyhoundS (1) @ 0x13f6e0 HDMI 000800000402000000010100000000001204030100000000 Maltese (6) @ 0x13f770 DP, DP, DP, DP, DP, DP 000400000403000000010123000000001000010300000000 000400000403000000010213000000002001020400000000 000400000403000000010343000000001102030100000000 000400000403000000010433000000002103040200000000 000400000403000000010563000000001204050500000000 000400000403000000010653000000002205060600000000 Labrador (6) @ 0x13f820 LVDS, LVDS, DP, DP, DP, DP 020000000001000000010131000000002103020400000000 020000000001000000010241010000001102010300000000 000400000403000000010323000000001000030100000000 000400000001000000010411000000002001050500000000 000400000403000000010563000000001204040200000000 000400000001000000010651000000002205050500000000 Basset (4) @ 0x13f8b0 LVDS, LVDS, DP, DP 020000000001000000010131000000002103020200000000 020000000001000000010241010000001102010100000000 000400000403000000010323000000001000030300000000 000400000403000000010413000000002001040400000000 Greyhound (6) @ 0x13f990 DP, DP, DP, DP, DP, DP 000400000403000000010123000000001000010300000000 000400000403000000010213000000002001020400000000 000400000403000000010343000000001102030100000000 000400000403000000010433000000002103040200000000 000400000403000000010563000000001204050500000000 000400000403000000010653000000002205060600000000 Baladi (6) @ 0x13fa40 DP, DP, DP, DP, DP, DP 000400000403000000010300000000001204030300000000 000400000403000000010100000000001102010100000000 000400000403000000010200000000002103020200000000 000400000403000000010400000000002205040400000000 000400000403000000010500000000001000050500000000 000400000403000000010600000000002001060600000000 -------------------------AMD9510Controller.kext------------------------- Exmoor (6) @ 0x107080 LVDS, LVDS, DP, DP, DP, DP 020000000001000000010151000000002205020400000000 020000000001000000010261010000001204010300000000 000400000403000000010343000000001102030100000000 000400000001000000010431000000002103050500000000 000400000403000000010523000000001000040200000000 000400000001000000010611000000002001050500000000 Berbice (5) @ 0x107110 LVDS, DP, DP, DP, DP 020000000001000039050108000000002001010100000000 000400000001000000010243000000001000020200000000 000400000403000000010313000000002103030300000000 000400000403000000010453000000001102040400000000 000400000403000000010533000000001204050500000000 Baladi (6) @ 0x107300 DP, DP, DP, DP, DP, DP 000400000403000000010300000000001204030300000000 000400000403000000010100000000001102010100000000 000400000403000000010200000000002103020200000000 000400000403000000010400000000002205040400000000 000400000403000000010500000000001000050500000000 000400000403000000010600000000002001060600000000 Sierra_AMDFramebuffers-master.zip
×