DEV Community

Cover image for Unlocking BIOS to Turn off CFG Lock (0xE2 MSR) in Xiaomi NoteBook 14
Utkarsh Sharma
Utkarsh Sharma

Posted on

Unlocking BIOS to Turn off CFG Lock (0xE2 MSR) in Xiaomi NoteBook 14

⚠️ Disclaimer: I am not responsible for any damage that might ensue from trying this yourself. I have tried this on my laptop and it has worked perfectly, however, the results might not be the same for you. If you are NOT comfortable with modding your UEFI/BIOS, I would stop reading here.

This guide is only recommended for users who have already installed macOS, for users who are installing for the first time enable AppleCpuPmCfgLock and AppleXcpmCfgLock under Kernel -> Quirks in opencore’s config.plist file.

Note that this guide is only applicable for XiaoMi Notebook 14 Horizon edition (i5 10th generation Intel processor).

What is CFG-Lock

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, Xiaomi 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.

Unlock CFG

Prerequisites

Before proceeding with the rest of this guide, you’ll first need to check if your firmware supports CFG.

Step 1: Checking CFG Lock Status

First download ControlMsrE2.efi and add this tool inside EFI/OC/Tools and config.plist .

Next, boot OpenCore and press spacebar to reveal ControlMsrE2.efi and then select it. This should provide you one of the following:

CFG-Lock is enabled:

This firmware has LOCKED MSR 0xE2 register!
Enter fullscreen mode Exit fullscreen mode

CFG-Lock is disabled:

This firmware has UNLOCKED MSR 0xE2 register!
Enter fullscreen mode Exit fullscreen mode

Step2: Unlock CFG

Since Xiaomi notebook 14 does not provide a bios firmware file. It becomes very difficult to find the address of the CFG lock. Since horizon edition (i5) comes with TIMI 1946 motherboard. we know the CFG lock register address is *0x3E *.

It is very crucial to know the correct address because changing wrong address register might brick your device permanently.

First, rename BOOTx64.efito oc.efi present in your USB \EFI\BOOT also, put RU.efi in the same folder.

Now take Shell.efirename it to BOOTx64.efi and copy-paste it in the directory as above. Finally, your directory will look like this.

Let’s boot into USB and the shell will open.

type Shell>RU.efi and press Enter.

This will open up RU Bios Tool and to continue Press any key.

Now we need to go into List view so we can navigate to CpuSetup.
Press ALT + = key i.e alt and = key together.

List View

Now use the Up/Down arrow key to navigate to CpuSetup and press Enter.

As you can see in the image the green circle is where the selected register address is shown. We need to navigate to address 003E i.e present in row 0030 and column 0E. Value at this address means

0x3E: 01 ← Locked.

0x3E: 00 ← Unlocked.

To edit this press Spacebar and then **00 **press **Enter **to store the value. It will look like this.

Now to save this press CTRL+W

Successfully saved

Press **ALT+Q **to quit.

Now Restart the PC and boot back to shell and type shell>oc.efi to load OpenCore and again press the spacebar to reveal the ControlMsrE2 option and select it.

If it shows UNLOCKED MSR then congratulation you have successfully unlocked the CFG lock.

To make USB boot directly into OpenCore just rename oc.efi to BOOTx64.efi and remove other .efi files from the directory EFI\BOOT

Oh, yeah! Unlocked… Now, you’ve stepped in the door of a BIOS engineer.

Check out my Hackintosh Repo for XiaoMi Notebook 14.

References:

Fixing CFG Lock | OpenCore Post-Install
How to hack PC BIOS — CFG Unlock
XiaoMi-Pro-Hackintosh/BIOS at main · daliansky/XiaoMi-Pro-Hackintosh

Top comments (0)