Computer literacy, help and repair

Install the latest CPU microcode. A completely alternative way to update microcodes What does processor microcode firmware give

Since the beginning of January, it was hard to miss the news regarding Specter and Meltdown hardware vulnerabilities - the topic turned out to be so serious and comprehensive. Although manufacturers have been aware of these issues since last summer, most seem to have only begun to react after the details were released by the Google Project Zero team.

For example, back in January, Intel released anti-Specter microcode updates for its Broadwell, Haswell, Skylake, Kaby Lake, and Coffee Lake processors, among other patches. But almost immediately it turned out that they lead to failures and. Initially, Intel stated that the problem only affected Broadwell and Haswell chips, but later admitted the existence of failures on computers with Skylake, Kaby Lake and Coffee Lake processors and partners and users to refrain from installing patches for now. Finally, in early February, a corrected version of the microcode, but only for mobile and desktop consumer chips of the Skylake family.

Now, after a month of intensive testing and patching by Intel and its partners, the time has come for other more or less relevant processors: microcode updates have been released for chips based on the Kaby Lake and Coffee Lake architectures, as well as Skylake-based platforms unaffected by the previous update. We are talking about processors of the 6th, 7th and 8th generations of Intel Core i, as well as the latest families of Core X, Xeon Scalable and Xeon D.

The new firmware variant will be available in most cases through OEM releases of new motherboard and laptop firmware. Intel still encouraged people to keep their systems up to date current versions, and also published a document , which outlined the status of similar microcode fixes for other products, including earlier chips starting with the 45nm Core 2. For some of these chips, patches are only planned, for others they are in the state of early testing, for the third - already exist in the form of a beta version. As a rule, the older the architecture, the later it will receive firmware with protection against Specter. However, microcode updates for more or less current Sandy Bridge, Ivy Bridge, Haswell, and Broadwell architectures are already in beta testing. Also, a number of Atom chips and even Xeon Phi accelerators have already received patches.

Intel recalled that there are other methods to combat the discovered vulnerabilities of the branch prediction block in modern processors. For example, Retpoline, developed by Google against Specter CVE-2017-5715 (branch target injection or target injection into a branch). For those interested in learning more about Retpoline and how it works, the company has published a special white paper.

Anti-Specter microcode updates released by Intel will start rolling out in the coming days and weeks in the form of fresh BIOS firmware for various motherboards. It is curious whether they will have an additional effect on the degradation of the performance of end systems?

Introducing BioStar A740G M2L+ donor (AMD 740G / SB710) and BioStar A740G M2+ recipient (AMD 740G / SB700). The motherboard with the letter “L” is more recent and officially supports AM3 processors, unlike the other one, which is limited only to support AM2 + processors. Asking for a comparative analysis of their BIOSes.
From office site loading only Last update BIOS firmware for each of these motherboards:
- for A740G M2+ latest beta A74GM916.BSS for September 2009
- for A740G M2L+ - file 74GCU511.BSS- May 2010

Next, we arm ourselves with the MMTOOL utility (I used versions 3.22, 3.23 and 3.26 - I did not find any differences in the work). To work with MMTOOL, the BIOS firmware file extensions must be renamed to *.rom.

Now we launch two MMTOOL and load firmware files from two mats into them. boards. We pay attention to the different sizes in the “Source size” column (and in “Size in Rom”, too, of course) of module 11 “P6 Micro Code” in each of the firmwares.

Go to the CPU PATCH section for a detailed comparison:

The donor file 74GCU511.rom - cpu_list contains 14 lines with support for CPURev.ID + 1 empty (Fig. 1).

The beta version of the recipient A74GM916.rom - cpu_list contains 13 lines with support for CPURev.ID + 1 empty (Fig. 2).

After analyzing the lists of these two BIOSes, it becomes obvious that for a newer motherboard, the developers used more recent patches for AMD processors, where the microcode of two lines with CPURev.ID 1043 and 1062 is corrected (dated 2009/07/31) and one line with CPURev.ID 10A0 is added (dated 2010/02/17).

Method number 1 - modification of distinctive strings.
These three distinctive lines are extracted from the donor 74GCU511.rom - the action "Extract a Patch Data" + "Apply" + 1 last empty line and saved to separate files.

Previously, in the CPU PATCH section of the recipient file A74GM916.rom, two lines with CPURev.ID numbers 1043 and 1062 are deleted (whose microcode is older than we will insert further) and the last empty line - the actions “Delete a Patch Data” + “Apply” ( Fig.3).

After that, a newer microcode is inserted in turn from four previously received patch files for CPURev.ID 1043, 1062, 10A0 and an empty string (Fig. 4).

Pay attention to the dimensions ("Source size" and "Size in Rom") of module 11 "P6 Micro Code" before and after applying these changes in the recipient file.
After application, these dimensions for the recipient (Fig. 6) will become identical to the dimensions of the same module in the donor file 74GCU511.rom (Fig. 5).
It is worth noting that it is easy to understand how the module size is formed (each line in the CPU PATCH section takes 2048 bytes).

It is better to save changes under a new file name.
Next, this file is checked so that MMTOOL opens again without errors.

Method number 2 - modification by replacing the entire module.
Actually, it is he who is described on the Internet (for example, partially).

In MMTOOL we circle the donor file 74GCU511.rom, go to the "Extract" tab and look for the line "P6 Micro Code". Then we select it, in the "module file" field we give it the name ncpucode.bin and execute Extract module "in uncompressed form".

Now in MMTOOL we load the recipient file A74GM916.rom, go to the "Replace" tab and again look for the line "P6 Micro Code". Select it, wait for Browse and select our donor module ncpucode.bin. Click Replase and then agree to replace this module.

Again, pay attention to the dimensions (“Source size” and “Size in Rom”) of module 11 “P6 Micro Code” before and after replacing this module in the recipient file.
After application, these dimensions for the recipient (Fig. 7) will become identical to the dimensions of the same module in the donor file 74GCU511.rom (Fig. 5).

If we compare the results of both methods (Fig. 6 and Fig. 7), then there is a noticeable difference of 10 bytes in the RomLoc address of the “User Defined or Reserved” module following the updated “P6 Micro Code” module - perhaps these are the features of MMTOOL...

Conclusion and afterword.
In this way, from different BIOS firmwares of various mats. boards on socket AM2 + (and even AM3 for comparison) you can find the latest microcodes for each type of CPURev.ID, both in Award and AMI BIOSes, then combine them into a single ncpucode.bin.
Subsequently, I got it with a size of 32768 bytes of 16 lines (microcodes) with the latest dates from among the studied firmware of various BIOSes: with 15 different types of processor revisions for the AM2 + socket (040A, 0413, 0414, 041B, 0433, 0680, 0C1B, 1000, 1020, 1022, 1040, 1041, 1043, 1062, 10A0) and the 16th line for RevID 0000 (apparently some universal microcode for processor revisions not described in other lines - IMHO, for example, future ones).

When combining your own ncpucode.bin by importing the necessary patches (microcodes) for each necessary processor revision, you can use absolutely any AMI BIOS firmware with the P6 Micro Code module as a laboratory one.

However, when saving the firmware file, an unpleasant feature of MMTOOL was noticed - for some reason the utility added 8 zero bytes to the end of the P6 Micro Code module - it turned out to be 32776 bytes in size. When extracting the same MMTOOL from the laboratory firmware, the ncpucode.bin file also became 32776 bytes in size.
You can edit this with simple editors available to all. But I also (accidentally) discovered alternative way: when the BIOS_EXT.EXE universal utility extracted all modules from the laboratory firmware, the ncpucode.bin file already turned out to be the correct size of 32768 bytes - the BIOS_EXT.EXE utility itself correctly determined the end of the “P6 Micro Code” module when saving it to a file.

It's no secret that the processor is a machine with microprogram control. And any of its instructions is a set of micro-instructions flashed into the ROM of the processor during its manufacture. Microcode errors and design errors (errata) can cause deviations from processor specifications and errors in its operation. When a processor is released, its specification and a list of discovered errata are usually published.

All Intel P6 processors, which include the Pentium Pro, Pentium II & III, Celeron, Pentium II & III Xeon, and Pentium II Overdrive families, have the remarkable "reprogrammable microcode" feature. In these processors, it is possible to change the microcode, i.e. it is possible to correct errors in the software and circuitry implementation of specific processors of the P6 family and some built-in errors almost at the hardware level. Errors can appear at the design stage of processors, and they are corrected precisely by changing the microcode. Each of the subfamilies (PII, Celeron, PPro, Xeon) has a specification. With the release of each new stepping of the processor (inside it, all devices are identical within the framework of technological deviations), Intel publishes a specification update for it, which indicates the detected and corrected errata (deviations from the specification).

These errors can, in principle, complicate the life of the software that runs on these "defective" processors (and the user ;-)) .

Of course, it all depends on the specific errors. To get rid of such horrors, a change in the microcode of the processor is required, as a result of which the error can be completely eliminated or the consequences of its presence can simply be mitigated.

By the way, bios support for newly released processors is determined, in particular, by the presence of the appropriate firmware. For example, when the first Celeron appeared, it was the lack of an appropriate microcode version that prevented the system from starting correctly with this processor.

The microcode updates themselves are 2K blocks of data flashed into the system BIOS. There is such a block for each stepping of the processor from the P6 family. Intel supplies the latest microcode versions to leading BIOS vendors. The update database is updated and updated as new models and firmware versions become available. Intel recommends updating the firmware using its utility when installing a new processor on the motherboard or reprogramming flash memory to ensure that the BIOS contains the latest firmware. This program determines the processor used (using CPUID) and looks for the corresponding update in its database. If a fresh version of the microcode is found, the utility locally flashes the code in the BIOS without affecting the rest of the areas. That. there is no need to reprogram the entire flash to support the new CPU, as was the case before. Intel periodically posts database updates on its website.

The latest database available to us has revision 5.01 and contains the following microcode versions:

ProcessorProcessor SteppingMicrocode Update Rev
Pentium III Processor0x6720x04
Pentium III Processor0x6730x02
Pentium III Xeon Processor0x6720x21
Pentium III Xeon Processor0x6730x22
Pentium II Processor0x6330x34
Pentium II Processor0x6340x35
Pentium II Processor0x6500x32
Pentium II Processor0x6510x30
Pentium II Processor0x6520x14
Pentium II Processor0x6530x01
Pentium II Xeon Processor0x6520x29
Pentium II Xeon Processor0x6530x04
Intel Celeron Processor0x6500x32
Intel Celeron Processor0x6510x30
Intel Celeron Processor0x6600x09
Intel Celeron Processor0x6650x02
Pentium II OverDrive Processorx16320x02
Pentium Pro Processor0x6120xC6
Pentium Pro Processor0x6160xC6
Pentium Pro Processor0x6170xC6
Pentium Pro Processor0x6190xD2

You can download the latest version of the microcode repair utility directly from here: pupdt501.exe (115 Kb)

The old database (PEP15.PDB) can be downloaded from here: pupdt461.exe (111 Kb)

After the utility is finished, you need to turn off the power of the computer. The update is downloaded to the processor during POST at each system startup. Naturally, for the utility to work, it is necessary to allow the flash memory to be overwritten with a jumper or in BIOS Setup. The program must be run from under the "bare" DOS.

However, this ideal scenario requires the BIOS to support a special processor microcode update API that allows the BIOS update utility to load the new microcode. If the version of the system BIOS that is being used does not support the API, the user has no choice but to obtain a new version from the motherboard manufacturer. However, it happens that finding it is not so easy, if not impossible.Often, after the production of a motherboard model is discontinued, the manufacturer stops releasing BIOS updates for it, but at the same time, new processors may appear on sale, and the user may want to install a new CPU in your system.

AT this case, the utility can still download technical fixes directly to the processor. In this case, the utility calls to load operating system immediately after the firmware update. However, the firmware update will be lost on a soft or hard reboot of the system.

The question arises, what is the risk of self-updating the firmware? Well, first of all, you first need to make sure that you really need it. If the firmware version is old, but the motherboard manufacturer does not offer new BIOS versions, but, most importantly, you are faced with an unstable operation of some application, and you expect that changing the processor microcode will help you. Only in this case it makes sense to change the firmware yourself. And about what it is fraught with - in my opinion, nothing dangerous. First of all, don't forget that loading microcode update into the processor is used in all BIOS on P6 boards and has been used for a long time (many people saw the mysterious Microcode Update: Enable/Disable option in Setup). And nothing! Everything is working.

This again emphasizes the need for its use. Who knows how things would have been without this update! The only difference is that earlier the microcode was updated with the installation of a new version of the flash, and now you can reprogram not all the contents of the BIOS, but only a limited piece.

My personal experience with this program has so far been limited to 7 cases, of which I managed to update the microcode on only one motherboard (Abit LX6 with PII 233). In other cases, the BIOS already contained updated versions of the microcode. Also, it was not possible to meet a BIOS that does not support microcode updates.

As for the similar possibility of updating the microcode in processors from other manufacturers (AMD, Cyrix), I could not find any information on this issue. But I'm almost sure that these CPUs have a similar ability to change the microcode.

You can optimize the performance of your computer's Intel or AMD CPU by installing the latest CPU firmware. Optimization is achieved mainly by correcting errors in the standard microcode received from the firmware of the motherboard.

BIOS/UEFI firmware updates for your motherboard usually contain new firmware versions for supported motherboard central processors. For this reason, the first thing to do is to make sure you are using the latest BIOS/UEFI version.

This guide allows you to optimize the performance of only those CPUs that were developed by Intel and AMD.

Notes:

  • Package installation software with microcodes can cause the computer to become unstable. For this reason, you should install this package only when you experience any problems related to the functioning of your computer's CPU!
  • Do not install the CPU Firmware Software Package if it is released before the BIOS/UEFI firmware of your computer motherboard!

1. Intel CPUs

If you are using an Intel CPU, you can proceed as follows.

Note: Do you need an Intel CPU firmware package that is newer than the one in the distribution's official repository? In this case, you can download the software package file with the extension .deb from

Synaptic package manager Software

Synaptic package manager"Search on computer"), enter a query Synaptic Synaptic Package Manager Synaptic package manager "Search" "microcode" and press the button "Search" next to him.

3.201501106.1 (in this case version 3 of the package was created on November 6, 2015).

« intel-microcode" and press the button "Apply"

dmesg | grep microcode

Enter

2. AMD CPUs

If you are using AMD processors, this guide will only apply to those manufactured after 2006 (AMD K10 and newer). If your computer has one of these CPUs installed, you can proceed as described below.

Note: Do you need an AMD CPU firmware package that is newer than the one in the distribution's official repository? In this case, you can download the software package file with the extension .deb from the Debian distribution's repository, which contains the newest packages. After downloading the package file, you should find it using the file manager and double-click to install the microcodes into the system. After installation is complete, you must restart your computer.

A. If you are using the Ubuntu distribution, you will need to install Synaptic package manager(this can be done with the app Software). In Linux Mint, this package manager is present immediately after installation.

B. First of all, you should run Synaptic package manager. On an Ubuntu distribution, click on the white Ubuntu logo at the top of the sidebar for this purpose ( "Search on computer"), enter a query Synaptic and select the first of the proposed applications Synaptic Package Manager. No need to use the quick search box for software packages of the main window Synaptic package manager, since the corresponding mechanism is unreliable; instead press the button "Search" on the toolbar, in the search field of the dialog box that opens, enter a query "amd64-microcode" and press the button "Search" next to him.

C. Now you should check the date of creation of the software package with CPU microcodes: this package must be created later than the BIOS / UEFI firmware of your computer motherboard! The creation date of the package in question is reflected in its version number, for example 2.20160316.1 (in this case version 2 of the package was created on March 2, 2016).

D. It's time to check the box next to the name of the software package "amd64-microcode" and press the button "Apply" on the application toolbar.

E. After the installation of the software package is complete, you must restart your computer.

F. After rebooting, it is worth checking if one of the installed microcodes is loaded correctly by typing the following command in a terminal window (use the copy/paste functions to avoid errors):

dmesg | grep microcode

After finishing entering the command, press the key Enter for its execution. If the firmware was successfully loaded, you will see several messages about it.

Would you like to learn about other settings and tricks for working with Linux systems? This website contains a large number of such materials.

Similar posts