Unlock 0xE2 MSR - profzei/Matebook-X-Pro-2018 GitHub Wiki
BIOS
Local repository
Version | |
---|---|
v. 1.37 | Matebook X Pro 1.37 |
v. 1.36 | Matebook X Pro 1.36 |
v. 1.33 | Matebook X Pro 1.33 |
v. 1.30 | Matebook X Pro 1.30 |
v. 1.29 | Matebook X Pro 1.29 |
v. 1.28 | Matebook X Pro 1.28 |
v. 1.26. | Matebook X Pro 1.26 |
Official HUAWEI repository for BIOS & Driver list
CFG Lock
What is CFG Lock ? Here's an extract from Dortania's guide :
"CFG-Lock is a setting in your BIOS that allows for a specific register(in this case the MSR 0xE2) to be written to. By default, most motherboards lock this variable with many even hiding the option outright in the GUI. And why we care about it is that macOS actually wants to write to this variable, and not just one part of macOS. Instead both the Kernel(XNU) and AppleIntelPowerManagement want this register.
So to fix it we have 2 options:
Patch macOS to work with our hardware :
This creates instability and unnecessary patching for many The 2 patches we use for this:
AppleCpuPmCfgLock
forAppleIntelPowerManagement.kext
AppleXcpmCfgLock
for the Kernel(XNU)Patch our firmware to support
MSR 0xE2
write :Very much preferred, as avoids patching allowing for greater flexibility regarding stability and OS upgrades"
-
This guide will show you how to unlock
CFG
in our Matebook X Pro. -
WARNING : This guide will involve modifying your firmware. In case of an error, it could potentially brick your computer. Only go ahead if you understand what you're doing. We decline responsibility for any damage (we are not responsible by any means if this happen). You have been warned, proceed with caution.
The BIOS version used on my system is 1.28
. Even if you use the same BIOS, please follow the guide to find your own offsets.
Check the CFG Lock address in your firmware
Tools :
UEFITool
: https://github.com/LongSoft/UEFIToolIFRExtract
(command line utility) : https://github.com/LongSoft/Universal-IFR-Extractor/releases/Keka
: https://www.keka.io/en/
-
Download your bios file version (some are archived in this repository)
-
Extract the
.exe
file with Keka. You might need to do it twice : on some versions, the.exe
file contains another.exe
file. -
You should now have a
UEFI_FW.bin
file (isflash.bin
for 1.29 version /BIOS.Capsule.FD
for 1.28 and 1.26 versions). Open it withUEFITool
. -
Search for "CFG Lock" (
Cmd + F
, then select the "Text" tab in the search dialog) -
Double click on the search result in the bottom panel.
-
The
PE32 image section
key containing the "CFG Lock" should now be selected. This should be a subsection of aDriverSampleDxe
key :
-
Select
DriverSampleDxe
, right-click andExtract as in
. Save it is as a.bin
file (don't forget to change the extension) -
Then, open the Terminal and browse to the location of the IFRExtract utility. Type :
./ifrextract /path/to/your/bin/file/file.bin result.txt
-
You should now have a
result.txt
file in your ifrextract directory. Open it, and search for "CFG Lock". You should find a line similar to this one :
0x9A52D One Of: CFG Lock, VarStoreInfo (VarOffset/VarName): 0x3C, VarStore: 0x3, QuestionId: 0x149, Size: 1, Min: 0x0, Max 0x1, Step: 0x0 {05 91 8E 02 8F 02 49 01 03 00 3C 00 10 10 00 01 00}
- What we are interested in here, is the address just after
One Of: CFG Lock, VarStoreInfo (VarOffset/VarName):
In this case :0x3C
. This is the register we need to change the value of, to disable CFG Lock.
- NOTE : for bios versions
1.26
,1.28
,1.29
,1.30
,1.33
,1.36
and1.37
, the address of the registry is0x3C
. But it might be different with other bios revisions, so checking this address is very important if you have a different bios version!
RU.efi
Tools :
RU.efi
utility : download it from http://ruexe.blogspot.com. You'll need a password to unlock the zip : it is provided close to the download link.
-
Grab a USB drive and format it as MBR/FAT32
-
At the root of this new drive, create an
EFI
folder. Inside this folder, create aBOOT
subfolder. Inside this/EFI/BOOT
folder, put theRU.efi
file you've downloaded and rename it asbootx64.efi
-
Reboot your computer and boot your USB key (press
F12
at boot) -
You should see a welcoming screen. Press any key to enter the program. Then, press FN+F5 and select
(A) UEFI variable
by pressing Enter :
- Scroll down to
CpuSetup
(in my case it is on the second page), press enter :
- Now, you should select the registry address that we've found earlier (in my case :
0x3C
). The first character stands for the line (0030
), and the second one for the column (0C
). Browse to the corresponding address. The upper left corner reminds you of the registry address currently selected :
-
The value should be changed from
1
to0
to unlock CFG : type in0
, then press Enter. -
Save your change with
CTLR + W
, then quit RU withALT + Q
Check if CFG is unlocked
-
Download the OpenCore Release matching your running OpenCore version : https://github.com/acidanthera/OpenCorePkg/releases/
-
Copy the
ControlMsrE2.efi
file from the downloaded zip (located inX64/EFI/OC/Tools
) to your computerEFI
partition in/EFI/OC/Tools
-
Edit your
config.plist
to enable the tool : add another entry inRoot --> Misc --> Tools
:
-
Reboot and select
ControlMsrE2.efi
in the OpenCore boot menu -
If you successfully unlocked your CFG, you should see this :
Disable CFG Patches
-
Once you're sure you've successfully disabled CFG Lock, you should remove CFG patches in your
config.plist
since they are not needed anymore -
Disable
Kernel -> Quirks -> AppleCpuPmCfgLock
andKernel -> Quirks -> AppleXcpmCfgLock
WARNING : If you update your BIOS, you must re-enable these patches before, as CFG Lock will be restored. After updating, you will have to unlock it again.
Credits
This guide was written by @ldan93 (Reference)