AMI INTEL CPU Microcode Update Guide

1)if u use Broadwell microcode 17 it has the same size as original, so u can put whatever haswell microcode u want. The fit is always ok.
Test it and check what it writes there when u use broadwell microcode 17 :
Attention!!!
Check the Address in the FIT
Address 01 mCode + Size 01 mCode = Address 02 mCode

2)U dont need to replace nothing about 3 and 4. Motherboard dont gonna use the engineering samples. And if u try an engineer sample i beleive that simply it will not start.

So to follow up, after spending quite some time checking my work I was confident enough of the changes to go ahead and flash.

1.) Added Broadwell 1B and Haswell 23 (which also removed the engineering samples)
2.) Fixed address in FIT for Haswell Microcode
3.) Removed addresses (blanked out with "FF") in FIT for Microcode that no longer existed.
4.) Re-Validated FIT via UEFITool NE to make sure it was reading Microcode data correctly.

After USB Flashback, everything went okay, HWInfo is reading correct Microcode version, and Windows has picked up on this and turned on Spectre mitigations.

Personally I don’t use Ubu anymore to update my microcodes. I only use it to verify my work because it removes some of the other microcodes. Thats awesome you guys got it working!

Someone asked me to update their microcode on a MSI X299 Sli Pro board and had a problem trying to replace GUID 17088572-377F-44EF-8F4E-B09FFF46A070 the Microcode file inside UefiTool choking on the bios file when it tried to save the modified file erroring out with "Bad Image Relocation Entry". Same thing also happened with Phoenix Tool. If anyone knows of any compatibility issues with UefiTool and X299 bios files please let us know.

Thank you

@davidm71
thank you for the good (if a bit complicated) guide.
a couple of questions:
1. you used 2 different versions of UEFITool, but both are now outdated… have you tried with the latest version, if it is possible to use just one?
2. the guide is for replacing microcodes, how does it work when you want to add one without touching the previous ones? I am asking because I want to make a desktop chipset (Skylake in my case) functional with SKL, KBL and CFL CPUs

@elisw
1. Newer version work too. You need the new engine (NE) version for reading the FIT, and the non-NE version for changing the firmware because NE is read-only and non-NE has no support for the FIT.
2. You can add more microcodes to the end of the Microcode FFS and you will need to add new microcode entries for each new microcode to the FIT.

@elisw and @Ethaniel ,

I tried the newer version 22.1 of Uefitool. Thats the first thing I did and it choked on the X299 MSI SLI Plus bios file when I tried to replace it.
There must be something special about that MSI bios file format that the tools do not like. Even Phoenixtool couldn’t do it and complained there
was one module too many or something.

For now we have to wait for the developer of those tools to comment. I have opened an issue on the github page. Hopefully Coderush if he
has time would take a look.

Thanks.

PS: @elisw As far as adding one I suppose you would just insert the microcode at the end of the master microcode file, and then append the start address to the FIT table if possible.
Theoretically it should work. If you have a lot of ‘FF’ 's at the end you would also have to make sure the file size matches the previous size in some cases or because I found out that
some bios files have more than just microcodes listed in that FIT table (or just replace an unneeded entry or append to the last entry). Point is the FIT table would have to be corrected
to point to each entry correctly wether its a Microcode or Bootgaurd or what ever. Then open your modded file inside the NE version of UEFITool to make sure it can successfully read the entries.



Like elisw I find the guide a bit complicated - maybe more complicated than it has to be.
Probably it makes things more difficult for me to understand because I’m not a native speaker.

For example it took me a while to realise that you are using the UBU tool just as a microcode repository. And guess what I found when I searched for "Hx Edit" on Google? Definitely not "HxD".

Things became (a bit) clearer when I found your outdated guide here:
http://www.overclock.net/t/1577530/guide-how-to-update-the-cpu-microcode-on-the-x99-ami-bios

What about providing a short title to each step that reveals what you intend to do?
And what about giving a clear designation to each of the files you use? I found "that file" confusing. You could mention the file name extension for example.

Sorry if I sound like a teacher. But I think your guide is too good/important to not deserve to be more "accessible".

@davidm71
I had a deeper look at my BIOS: it is of the small type(8192 KB)
The whole volume (AFDD39F1-19D7-4501-A730-CE5A27E1154B), where both FIT table and microcodes are, has a full size (262144 bytes) which is too small to have 3 microcodes, as they are circa 95 KB each.
Will it be possible to enlarge the microcodes volume (maybe reducing the size of other volumes to keep the full BIOS size equal or is it a dead end?

Sorry guys I was at a conference for the last few days. Will try to make my guide a little clearer and easier to understand. Stay tuned.

@elisw ,

Wheres your bios file? Lets take a look…




Hi,

I spent the day trying to figure out how to add an extra microcode file to the pre-existing microcode master file and may have a solution though it could be kind of risky. This is what I have done. The first thing to do is to append the extra microcode file unto the last microcode within the master microcode file making sure the footer at the end remains the same. The problem here is that most likely there won’t be any firmware volume room or space left to accomodate the extra microcode. In anycase you also need to extract the FIT table using UEFITOOL NE version and open it in a hex editor and add another entry without altering file size. Got to do a little hexadecimal math to correct the correct offset location.

You can do that by using a hex calculator to add the last microcode address location value to the length value of that last microcode entry according to UEFITool NE’s FIT table. You also have to change the value that corresponds to the number of entries in the FIT table file. That is the 8th byte on the first line inside that FIT table. For example I changed ‘05’ to ‘06’ to reflect I have 5 entries as before I had 4 entries. Then you save every thing and replace the FIT table in UEFITool and then replace the master microcode file using UEFITool assuming you have enough room to do so or else UEFITool will bitch and complain.

If that happens you have to compress the next file in the UEFI volume following the microcode master file. In my case it was GUID 2D27C618-7DCD-41F5-BB10-21166BE7E143 and it was the last and only file I had following my microcode file which was GUID 17088572-377F-44EF-8F4E-B09FFF46A070. I used some advanced commands to compress the file and add it back. Here’s the link in another thread here I asked if it would work: [Experimental] LZMA F86 decompression. I wish you could compress the microcode file as that would make life easier but I don’t think that would be possible. I can’t even promise that compressing the following file in the main volume will not corrupt your bios. However at the very least UEFITool NE was able to open the bios file and list 5 microcodes where as there was four before. Need more expert advice at this point to move forward…

Crazy…


Edit: Sorry its a bit verbose here. This is an advanced mod fwiw. Will try to clean it up later.

don’t worry, for the time being I am satisfied with two microcodes… but if you succeed I am definitively interested.
link for bios download:
http://asrock.pc.cdn.bitgravity.com/BIOS…DS(7.30)ROM.zip

@elisw ,

I took a look and in your case there is no free room to add a 3rd microcode at all.
Unless of course you can grow the ffsv2 folder which is a mystery…

Please advise how to add update agesa ? ASRock x370 Taichi firmware & microcode drive.google.com/open?id=1iE88FLr7gOcNCLw_uT6EHPQMIVbQvb7Z

@davidm71 :

Thanks a lot for your information. I only wanted to change the microcode in the BIOS of my MSI GE62 6QF laptop and I always prefer to do things while having some control over the process. However, as this is the first time that I do this kind of modding, I’d prefer if an expert could check the attached BIOS file before I flash it. The file is modified from the original file in http://download.msi.com/bos_exe/nb/E16J4IMS.117.zip. The original file has the microcode version 0xC2, which includes the Spectre fix, but I prefer to use the previous microcode version 0xBE until Intel fixes the buggy new microcode. So I downgraded the microcode in the BIOS file to the BE version (attached to this post). Could you do some tests to confirm that I have not done anything stupid on it? I have opened it with MMTool and UBU with no warnings. Do I have to take an extra care because this is a laptop or have you had positive experiences flashing laptops with modded BIOSes?

Thanks in advance!

E16J4IMS.117_BE.rar (3.81 MB)

@Prodif I’m not really sure. Sorry.

@ikerrg Looks ok as far as UefiTool NE and Ubutool reading it correctly but I’m not an expert on laptops so your on your own here… Good luck!



Thanks! I was asking because your BIOS filename looks from MSI, like mine, and the GUID for the microcode area is exactly the same as in my BIOS (you can check that in the file that I uploaded before). I am a bit reluctant to use this modded BIOS if nobody has previously flashed a MSI laptop. I don’t know if there would be some kind of CRC in the BIOS file that I should change or something else never tested.

Thanks again anyway.



Thanks! I was asking because your BIOS filename looks from MSI, like mine, and the GUID for the microcode area is exactly the same as in my BIOS (you can check that in the file that I uploaded before). I am a bit reluctant to use this modded BIOS if nobody has previously flashed a MSI laptop. I don’t know if there would be some kind of CRC in the BIOS file that I should change or something else never tested.

Thanks again anyway.




Mines a desktop so it may be a little different. Personally if it works just leave it. Notebook roms are a pain to reprogram if it bricked. Though by all means if you feel confident go for it!

do not flash or mod a msi laptop bios you will brick it.

on the msi fourm there is a guy that mods it go that way if you want to mod a msi laptop. he will ask for a small donation.
I used it about 4 times now and the last time he fixed my laptop when i tryed to flash the intel me firmware and screw up the laptop.

davidm71
The microcode replaced. Whether it is necessary to replace with updated sections: AmdVersionDxe, AmiAgesaDxe, AmdVersionPei, AmiAgesaPei, CpuPei, CpuSetAgesaPcd ?