Unlocking BIOS to Turn off CFG Lock (0xE2 MSR) in Xiaomi NoteBook 14 
Tags: hackintosh, tutorial
Published: 2022-01-31 08:09:53

**⚠️ 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**

* A bootable disk formatted by Fat32. Don’t waste your time creating a new one. Your OpenCore bootable USB stick is fine.

* Disable Secure Boot

* UEFI Shell ([download](https://github.com/uttusharma/Xiaomi-Notebook14-Hackintosh/blob/master/BIOS/Shell.efi) / [alternate download](https://github.com/tianocore/edk2/blob/UDK2018/ShellBinPkg/UefiShell/X64/Shell.efi))

* Bios Tool: RU ([download](https://github.com/uttusharma/Xiaomi-Notebook14-Hackintosh/blob/master/BIOS/RU.efi) / [original website](http://ruexe.blogspot.com/))

* ControlMsrE2.efi ([download](https://github.com/uttusharma/Xiaomi-Notebook14-Hackintosh/blob/master/BIOS/ControlMsrE2.efi) / [opencore](https://github.com/acidanthera/OpenCorePkg/releases))

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!

![](https://cdn-images-1.medium.com/max/2000/1*romuCgxUbUKPexYMhqYTVg.png)

**CFG-Lock is disabled:**

    This firmware has UNLOCKED MSR 0xE2 register!

![](https://cdn-images-1.medium.com/max/2000/1*N163wQ5qTObLTcH9tCTNGw.png)

## 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.

![](https://cdn-images-1.medium.com/max/2000/1*Gdq_jp9hR9RzulwklUSFKg.png)

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

![](https://cdn-images-1.medium.com/max/2000/1*sMkaropbEdwW6BObqygzoA.png)

![](https://cdn-images-1.medium.com/max/2000/0*QIbaPYfQab4fleCV)

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

![](https://cdn-images-1.medium.com/max/2000/0*u3f2knvwUFRJwZPr.jpg)

type Shell>**RU.efi** and press Enter.

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

![](https://cdn-images-1.medium.com/max/2000/1*eDsarRnCgOj8f-tPmb-9FA.png)

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](https://cdn-images-1.medium.com/max/2000/1*aO_olcO3RiAvwEDr86Ftsg.png)

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

![](https://cdn-images-1.medium.com/max/2000/1*r0pqz6LPGmB9tpEHl_ENrA.png)

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.

![](https://cdn-images-1.medium.com/max/2000/1*pI5jZmvZTILFXp_RmuxtCw.png)

Now to save this press **CTRL+W**

![Successfully saved](https://cdn-images-1.medium.com/max/2000/1*yDF0l9OPTrkhACg1ERSMYg.png)

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.

![](https://cdn-images-1.medium.com/max/2000/1*Q7HJeW93X6lXrmTobh_G3A.png)

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.

![](https://cdn-images-1.medium.com/max/2000/0*nXQHNG1hb1wmBODe)

Check out my [Hackintosh Repo for XiaoMi Notebook 14](https://github.com/uttusharma/Xiaomi-Notebook14-Hackintosh).

### References:
[**Fixing CFG Lock | OpenCore Post-Install**](https://dortania.github.io/OpenCore-Post-Install/misc/msr-lock.html#checking-if-your-firmware-supports-cfg-lock-unlocking)
[**How to hack PC BIOS — CFG Unlock**](https://homanhuang.medium.com/how-to-hack-pc-bios-cfg-unlock-412d7128d0e3)
[**XiaoMi-Pro-Hackintosh/BIOS at main · daliansky/XiaoMi-Pro-Hackintosh**](https://github.com/daliansky/XiaoMi-Pro-Hackintosh/tree/main/BIOS#how-to-unlock-better-performance-2)