How to update CPU microcode on linux K 3.10+
Well ... we all have seen this message
PEBS disabled due to CPU errata, please upgrade microcode
So what is this microcode ? how to update it ?
It is a kind-of intel processor firmware given out by intel time to time.
The latest one now is available as microcode.dat (download it form intel website)
make sure you have these 2 packages with you
1. iucode-tool
2. intel-microcode
In debian these are quite staightforward to install
Now run the tool
$ sudo iucode_tool -l /lib/firmware/microcode.dat
selected microcodes:
001: sig 0x00000650, pf mask 0x02, 1999-05-25, rev 0x0041, size 2048
002: sig 0x00000650, pf mask 0x08, 1999-05-25, rev 0x0045, size 2048
003: sig 0x00000650, pf mask 0x01, 1999-05-25, rev 0x0040, size 2048
004: sig 0x00000651, pf mask 0x01, 1999-05-25, rev 0x0040, size 2048
005: sig 0x00000652, pf mask 0x04, 1999-05-12, rev 0x002b, size 2048
006: sig 0x00000652, pf mask 0x01, 1999-05-12, rev 0x002a, size 2048
007: sig 0x00000652, pf mask 0x02, 1999-05-17, rev 0x002c, size 2048
008: sig 0x00000653, pf mask 0x01, 1999-06-28, rev 0x0010, size 2048
009: sig 0x00000653, pf mask 0x04, 1999-05-20, rev 0x000b, size 2048
010: sig 0x00000653, pf mask 0x02, 1999-05-18, rev 0x000c, size 2048
011: sig 0x00000653, pf mask 0x08, 1999-05-18, rev 0x000d, size 2048
012: sig 0x00000660, pf mask 0x01, 1999-05-05, rev 0x000a, size 2048
013: sig 0x00000665, pf mask 0x10, 1999-05-05, rev 0x0003, size 2048
014: sig 0x0000066a, pf mask 0x08, 1999-05-05, rev 0x000d, size 2048
015: sig 0x0000066a, pf mask 0x02, 1999-05-05, rev 0x000c, size 2048
016: sig 0x0000066a, pf mask 0x20, 1999-05-05, rev 0x000b, size 2048
017: sig 0x0000066d, pf mask 0x20, 1999-05-05, rev 0x0007, size 2048
018: sig 0x0000066d, pf mask 0x08, 1999-03-12, rev 0x0006, size 2048
019: sig 0x0000066d, pf mask 0x02, 1999-03-12, rev 0x0005, size 2048
020: sig 0x00000671, pf mask 0x04, 1998-08-11, rev 0x0014, size 2048
021: sig 0x00000672, pf mask 0x04, 1999-09-22, rev 0x0038, size 2048
022: sig 0x00000673, pf mask 0x04, 1999-09-10, rev 0x002e, size 2048
023: sig 0x00000681, pf mask 0x08, 1999-09-21, rev 0x000f, size 2048
024: sig 0x00000681, pf mask 0x04, 1999-09-21, rev 0x0010, size 2048
025: sig 0x00000681, pf mask 0x20, 1999-09-21, rev 0x000e, size 2048
026: sig 0x00000681, pf mask 0x01, 1999-09-21, rev 0x000d, size 2048
027: sig 0x00000681, pf mask 0x10, 1999-09-21, rev 0x0011, size 2048
028: sig 0x00000683, pf mask 0x08, 1999-10-15, rev 0x0008, size 2048
029: sig 0x00000683, pf mask 0x20, 1999-10-15, rev 0x0007, size 2048
030: sig 0x00000686, pf mask 0x01, 2000-05-05, rev 0x0007, size 2048
031: sig 0x00000686, pf mask 0x02, 2000-05-04, rev 0x000a, size 2048
032: sig 0x00000686, pf mask 0x04, 2000-05-04, rev 0x0002, size 2048
033: sig 0x00000686, pf mask 0x80, 2000-05-04, rev 0x000c, size 2048
034: sig 0x00000686, pf mask 0x10, 2000-05-05, rev 0x0008, size 2048
035: sig 0x0000068a, pf mask 0x80, 2000-12-07, rev 0x0005, size 2048
036: sig 0x0000068a, pf mask 0x10, 2000-11-02, rev 0x0001, size 2048
037: sig 0x0000068a, pf mask 0x20, 2000-12-07, rev 0x0004, size 2048
038: sig 0x00000695, pf mask 0x20, 2004-11-09, rev 0x0007, size 2048
039: sig 0x00000695, pf mask 0x10, 2004-11-09, rev 0x0007, size 2048
040: sig 0x00000695, pf mask 0x80, 2004-11-09, rev 0x0047, size 2048
041: sig 0x000006a0, pf mask 0x04, 2000-01-10, rev 0x0003, size 2048
042: sig 0x000006a1, pf mask 0x04, 2000-03-06, rev 0x0001, size 2048
043: sig 0x000006b1, pf mask 0x20, 2001-02-20, rev 0x001d, size 2048
044: sig 0x000006b1, pf mask 0x10, 2001-02-15, rev 0x001c, size 2048
045: sig 0x000006b4, pf mask 0x10, 2002-01-10, rev 0x0001, size 2048
046: sig 0x000006b4, pf mask 0x20, 2002-01-11, rev 0x0002, size 2048
047: sig 0x000006d6, pf mask 0x20, 2004-10-17, rev 0x0018, size 2048
048: sig 0x000006e8, pf mask 0x20, 2005-11-15, rev 0x0039, size 4096
049: sig 0x000006ec, pf mask 0x20, 2006-05-01, rev 0x0054, size 4096
050: sig 0x000006ec, pf mask 0x80, 2006-09-12, rev 0x0059, size 4096
051: sig 0x000006f2, pf mask 0x01, 2010-10-02, rev 0x005d, size 4096
052: sig 0x000006f2, pf mask 0x20, 2010-10-02, rev 0x005c, size 4096
053: sig 0x000006f6, pf mask 0x01, 2010-09-30, rev 0x00d0, size 4096
054: sig 0x000006f6, pf mask 0x04, 2010-10-01, rev 0x00d2, size 4096
055: sig 0x000006f6, pf mask 0x20, 2010-10-01, rev 0x00d1, size 4096
056: sig 0x000006f7, pf mask 0x10, 2010-10-02, rev 0x006a, size 4096
057: sig 0x000006f7, pf mask 0x40, 2010-10-02, rev 0x006b, size 4096
058: sig 0x000006fa, pf mask 0x80, 2010-10-02, rev 0x0095, size 4096
059: sig 0x000006fb, pf mask 0x20, 2010-10-03, rev 0x00ba, size 4096
060: sig 0x000006fb, pf mask 0x08, 2010-10-03, rev 0x00bb, size 4096
061: sig 0x000006fb, pf mask 0x80, 2010-10-03, rev 0x00ba, size 4096
062: sig 0x000006fb, pf mask 0x40, 2010-10-03, rev 0x00bc, size 4096
063: sig 0x000006fb, pf mask 0x10, 2010-10-03, rev 0x00ba, size 4096
064: sig 0x000006fb, pf mask 0x01, 2010-10-03, rev 0x00ba, size 4096
065: sig 0x000006fb, pf mask 0x04, 2010-10-03, rev 0x00bc, size 4096
066: sig 0x000006fd, pf mask 0x20, 2010-10-02, rev 0x00a4, size 4096
067: sig 0x000006fd, pf mask 0x01, 2010-10-02, rev 0x00a4, size 4096
068: sig 0x000006fd, pf mask 0x80, 2010-10-02, rev 0x00a4, size 4096
069: sig 0x00000f07, pf mask 0x02, 2000-11-15, rev 0x0008, size 2048
070: sig 0x00000f07, pf mask 0x01, 2002-07-16, rev 0x0012, size 2048
071: sig 0x00000f0a, pf mask 0x02, 2002-08-21, rev 0x0015, size 2048
072: sig 0x00000f0a, pf mask 0x04, 2002-07-16, rev 0x0014, size 2048
073: sig 0x00000f0a, pf mask 0x01, 2002-07-16, rev 0x0013, size 2048
074: sig 0x00000f12, pf mask 0x04, 2003-05-02, rev 0x002e, size 2048
075: sig 0x00000f24, pf mask 0x02, 2003-06-05, rev 0x001f, size 2048
076: sig 0x00000f24, pf mask 0x10, 2003-06-10, rev 0x0021, size 2048
077: sig 0x00000f24, pf mask 0x04, 2003-06-05, rev 0x001e, size 2048
078: sig 0x00000f25, pf mask 0x10, 2004-08-26, rev 0x002c, size 2048
079: sig 0x00000f25, pf mask 0x02, 2004-08-11, rev 0x002a, size 2048
080: sig 0x00000f25, pf mask 0x01, 2004-08-11, rev 0x0029, size 2048
081: sig 0x00000f25, pf mask 0x04, 2004-08-11, rev 0x002b, size 2048
082: sig 0x00000f26, pf mask 0x02, 2004-08-05, rev 0x0010, size 2048
083: sig 0x00000f27, pf mask 0x08, 2003-06-04, rev 0x0039, size 2048
084: sig 0x00000f27, pf mask 0x04, 2003-06-04, rev 0x0037, size 2048
085: sig 0x00000f27, pf mask 0x02, 2003-06-04, rev 0x0038, size 2048
086: sig 0x00000f29, pf mask 0x08, 2004-08-11, rev 0x002f, size 2048
087: sig 0x00000f29, pf mask 0x04, 2004-08-11, rev 0x002e, size 2048
088: sig 0x00000f29, pf mask 0x02, 2004-08-11, rev 0x002d, size 2048
089: sig 0x00000f32, pf mask 0x0d, 2004-05-11, rev 0x000a, size 2048
090: sig 0x00000f33, pf mask 0x0d, 2005-04-21, rev 0x000c, size 2048
091: sig 0x00000f34, pf mask 0x1d, 2005-04-21, rev 0x0017, size 7168
092: sig 0x00000f41, pf mask 0xbd, 2005-04-22, rev 0x0017, size 5120
093: sig 0x00000f41, pf mask 0x02, 2005-04-21, rev 0x0016, size 5120
094: sig 0x00000f43, pf mask 0x9d, 2005-04-21, rev 0x0005, size 2048
095: sig 0x00000f44, pf mask 0x9d, 2005-04-21, rev 0x0006, size 3072
096: sig 0x00000f47, pf mask 0x9d, 2005-04-21, rev 0x0003, size 3072
097: sig 0x00000f48, pf mask 0x5f, 2005-06-30, rev 0x0007, size 3072
098: sig 0x00000f48, pf mask 0x01, 2006-05-08, rev 0x000c, size 3072
099: sig 0x00000f48, pf mask 0x02, 2008-01-15, rev 0x000e, size 3072
100: sig 0x00000f49, pf mask 0xbd, 2005-04-21, rev 0x0003, size 2048
101: sig 0x00000f4a, pf mask 0x5c, 2005-12-14, rev 0x0004, size 2048
102: sig 0x00000f4a, pf mask 0x5d, 2005-06-10, rev 0x0002, size 2048
103: sig 0x00000f62, pf mask 0x04, 2005-12-15, rev 0x000f, size 3072
104: sig 0x00000f64, pf mask 0x01, 2005-12-15, rev 0x0002, size 3072
105: sig 0x00000f64, pf mask 0x34, 2005-12-23, rev 0x0004, size 3072
106: sig 0x00000f65, pf mask 0x01, 2006-04-26, rev 0x0008, size 2048
107: sig 0x00000f68, pf mask 0x22, 2006-07-14, rev 0x0009, size 2048
108: sig 0x00001632, pf mask 0x00, 1998-06-10, rev 0x0002, size 2048
109: sig 0x00010661, pf mask 0x80, 2010-10-04, rev 0x0044, size 4096
110: sig 0x00010661, pf mask 0x02, 2010-10-04, rev 0x0042, size 4096
111: sig 0x00010661, pf mask 0x01, 2010-10-04, rev 0x0043, size 4096
112: sig 0x00010676, pf mask 0x01, 2010-09-29, rev 0x060f, size 4096
113: sig 0x00010676, pf mask 0x80, 2010-09-29, rev 0x060f, size 4096
114: sig 0x00010676, pf mask 0x04, 2010-09-29, rev 0x060f, size 4096
115: sig 0x00010676, pf mask 0x40, 2010-09-29, rev 0x060f, size 4096
116: sig 0x00010676, pf mask 0x10, 2010-09-29, rev 0x060f, size 4096
117: sig 0x00010677, pf mask 0x10, 2010-09-29, rev 0x070a, size 4096
118: sig 0x0001067a, pf mask 0xa0, 2010-09-28, rev 0x0a0b, size 8192
119: sig 0x0001067a, pf mask 0x11, 2010-09-28, rev 0x0a0b, size 8192
120: sig 0x0001067a, pf mask 0x44, 2010-09-28, rev 0x0a0b, size 8192
121: sig 0x000106a4, pf mask 0x03, 2013-06-21, rev 0x0012, size 14336
122: sig 0x000106a5, pf mask 0x03, 2013-06-21, rev 0x0019, size 10240
123: sig 0x000106c2, pf mask 0x01, 2009-04-10, rev 0x0217, size 5120
124: sig 0x000106c2, pf mask 0x04, 2009-04-10, rev 0x0218, size 5120
125: sig 0x000106c2, pf mask 0x08, 2009-04-10, rev 0x0219, size 5120
126: sig 0x000106ca, pf mask 0x04, 2009-08-25, rev 0x0107, size 5120
127: sig 0x000106ca, pf mask 0x01, 2009-08-25, rev 0x0107, size 5120
128: sig 0x000106ca, pf mask 0x10, 2009-08-25, rev 0x0107, size 5120
129: sig 0x000106ca, pf mask 0x08, 2009-08-25, rev 0x0107, size 5120
130: sig 0x000106d1, pf mask 0x08, 2010-09-30, rev 0x0029, size 4096
131: sig 0x000106e4, pf mask 0x09, 2013-07-01, rev 0x0003, size 6144
132: sig 0x000106e5, pf mask 0x13, 2013-08-20, rev 0x0007, size 7168
133: sig 0x00020652, pf mask 0x12, 2013-06-26, rev 0x000e, size 8192
134: sig 0x00020655, pf mask 0x92, 2013-06-28, rev 0x0004, size 3072
135: sig 0x00020661, pf mask 0x01, 2009-10-23, rev 0x0104, size 5120
136: sig 0x00020661, pf mask 0x02, 2011-07-18, rev 0x0105, size 5120
137: sig 0x000206a7, pf mask 0x12, 2013-06-12, rev 0x0029, size 10240
138: sig 0x000206d6, pf mask 0x6d, 2012-05-22, rev 0x0619, size 16384
139: sig 0x000206d7, pf mask 0x6d, 2013-06-17, rev 0x0710, size 17408
140: sig 0x000206f2, pf mask 0x05, 2013-06-18, rev 0x0037, size 13312
141: sig 0x000306a9, pf mask 0x12, 2014-05-29, rev 0x001b, size 12288
142: sig 0x000306c3, pf mask 0x32, 2014-07-03, rev 0x001c, size 21504
143: sig 0x000306d4, pf mask 0xc0, 2014-12-05, rev 0x0018, size 14336
144: sig 0x000306e4, pf mask 0xed, 2014-05-29, rev 0x0428, size 13312
145: sig 0x000306e6, pf mask 0xed, 2013-06-19, rev 0x0600, size 11264
146: sig 0x000306e7, pf mask 0xed, 2014-05-29, rev 0x070d, size 15360
147: sig 0x000306f2, pf mask 0x6f, 2014-09-03, rev 0x0029, size 28672
148: sig 0x00040651, pf mask 0x72, 2014-07-03, rev 0x001c, size 20480
149: sig 0x00040661, pf mask 0x32, 2014-07-03, rev 0x0012, size 23552
That says that there are those microcodes in that package
Run this tool again with these options
iucode_tool -K/lib/firmware/intel‐ucode /lib/firmware/intel‐ucode/*
/lib/firmware/microcode.dat
This will create a lot of files under /lib/firmware/intel-ucode/...
in my case
$ ls
06-01-01 06-06-00 06-09-05 06-0f-06 06-1c-02 06-3a-09 0f-01-02 0f-04-03
06-01-02 06-06-05 06-09-06 06-0f-07 06-1c-0a 06-3c-03.initramfs 0f-01-03 0f-04-04
06-01-06 06-06-0a 06-0a-00 06-0f-0a 06-1d-01 06-3d-04 0f-02-02 0f-04-07
06-01-07 06-06-0d 06-0a-01 06-0f-0b 06-1e-04 06-3e-04 0f-02-04 0f-04-08
06-01-09 06-07-01 06-0a-04 06-0f-0d 06-1e-05 06-3e-06 0f-02-05 0f-04-09
06-03-02 06-07-02 06-0b-01 06-16-01 06-25-02 06-3e-07 0f-02-06 0f-04-0a
06-03-03 06-07-03 06-0b-04 06-17-06 06-25-05 06-3f-02.initramfs 0f-02-07 0f-06-02
06-03-04 06-08-00 06-0d-06 06-17-07 06-26-01 06-45-01.initramfs 0f-02-09 0f-06-04
06-05-00 06-08-01 06-0d-08 06-17-0a 06-2a-07 06-46-01.initramfs 0f-03-02 0f-06-05
06-05-01 06-08-03 06-0e-08 06-1a-04 06-2d-06 0f-00-07 0f-03-03 0f-06-08
06-05-02 06-08-06 06-0e-0c 06-1a-05 06-2d-07 0f-00-0a 0f-03-04
06-05-03 06-08-0a 06-0f-02 06-1c-01 06-2f-02 0f-01-01 0f-04-01
Now
in that directory /lib/firmware/intel-ucode
(as root shell) type this
for f in *
do
cat $f > /dev/cpu/microcode
done
dmesg will now show something like this
[ 205.415532] microcode: CPU0 sig=0x206a7, pf=0x10, revision=0x1b
[ 205.416330] microcode: CPU0 updated to revision 0x29, date = 2013-06-12
[ 205.416584] microcode: CPU1 sig=0x206a7, pf=0x10, revision=0x1b
[ 205.417341] microcode: CPU1 updated to revision 0x29, date = 2013-06-12
[ 205.417735] microcode: CPU2 sig=0x206a7, pf=0x10, revision=0x1b
[ 205.418509] microcode: CPU2 updated to revision 0x29, date = 2013-06-12
[ 205.418931] microcode: CPU3 sig=0x206a7, pf=0x10, revision=0x1b
[ 205.419949] microcode: CPU3 updated to revision 0x29, date = 2013-06-12
[ 205.420648] microcode: CPU4 sig=0x206a7, pf=0x10, revision=0x1b
[ 205.421543] microcode: CPU4 updated to revision 0x29, date = 2013-06-12
[ 205.422119] microcode: CPU5 sig=0x206a7, pf=0x10, revision=0x1b
[ 205.423232] microcode: CPU5 updated to revision 0x29, date = 2013-06-12
[ 205.423944] microcode: CPU6 sig=0x206a7, pf=0x10, revision=0x1b
[ 205.425179] microcode: CPU6 updated to revision 0x29, date = 2013-06-12
[ 205.425921] microcode: CPU7 sig=0x206a7, pf=0x10, revision=0x1b
[ 205.427138] microcode: CPU7 updated to revision 0x29, date = 2013-06-12
[ 205.427939] perf_event_intel: PEBS enabled due to microcode update
whola ! the microcode is updated ! and PEBS enabled.
You can apply microcodes as many times as you want since the ones which are applied will not be reapplied.