u@home:~$

microcode something

Trying to learn the microcode syntax.

Put some data here.

u@uu:~/prjs/lib-micro/build$ ./ms_match_n_patch_read
idx p src    dst
00: 0 0x0000  0x0000
01: 1 0x1434  0x06c6
02: 1 0x4c04  0x7c0a
03: 1 0x61e6  0x7cae
04: 1 0x757a  0x7cb0
05: 1 0x244a  0x7cdc
06: 1 0x065c  0x7c5c
07: 1 0x29ca  0x7c2e
08: 1 0x2078  0x7cf6
09: 1 0x263a  0x7cfe
10: 1 0x18c4  0x7cfa
11: 1 0x78d6  0x7d02
12: 1 0x2018  0x7c04
13: 1 0x5b94  0x7c14
14: 1 0x5ce2  0x7c88
15: 1 0x6908  0x7c6c
16: 1 0x3b52  0x7c4a
17: 1 0x4e76  0x7db8
18: 1 0x01ce  0x7ce6
19: 1 0x2ec8  0x7d6e
20: 1 0x6ff6  0x7d26
21: 1 0x13da  0x7d94
22: 1 0x667c  0x7cea
23: 1 0x0cd2  0x7d0a
24: 1 0x0e66  0x7d7a
25: 1 0x4c5a  0x7dd6
26: 1 0x24bc  0x7d12
27: 1 0x31a4  0x7d36
28: 1 0x758e  0x7df6
29: 0 0x0000  0x0000
30: 0 0x0000  0x0000
31: 0 0x0000  0x0000



0x018000f0
up0  : 0x0
eflow: 0xc
up1  : 0x3
uaddr: 0x0
up2  : 0x3
sync : 0x0
crc  : 0x0

0x018000c0
up0  : 0x0
eflow: 0x0
up1  : 0x3
uaddr: 0x0
up2  : 0x3
sync : 0x0
crc  : 0x0

NOP_SEQWORD
up0  : 0x0
eflow: 0x0
up1  : 0x3
uaddr: 0x0
up2  : 0x3
sync : 0x0
crc  : 0x0

END_SEQWORD
up0  : 0x2
eflow: 0xc
up1  : 0x3
uaddr: 0x0
up2  : 0x2
sync : 0x1
crc  : 0x0


Now the basic prototype works.

The problems are the followings.

The CPU already has many microcode patches, as listed above.

In total 32 match and patch entries, 29 of them are taken.

And the very limited microcode ram, range from 0x7C00 to 0x7e00, is also full.

There was no microcode patch from linux (or may be just one, saw it through dmesg grep microcode). I added linux kernel command line option “dis_ucode_ldr” to disable loading microcode update. But still, the match and patch entries were not less.

So, maybe the microcode updates are from the bios, it is the coreboot in this case. I also disabled microcode updates in coreboot, but have not tried that image yet. Hope it gives more space.

Now I am working on this coreboot image, trying to get some space.

I tried to reset all the match and patch entries to 0, so that it is as to be no patch applied and the ram space will be all available. But when I did this, the system is freezed. I guess there may be some important patch that the CPU can not run without it.

After serveral attemps, cleaning the first 16 entries seems ok. And it squeezes some space in ram.

(If I only clean the first 5 entries, space from 7c00 to 7c10 is still in use by some of the rest patch entries.)

Here is the steps to setup.

  1. wrmsr to 0x1e6 with 0x200 (bit 9).

  2. lib-micro.bak/build.bak/cmps_static_do_fix_IN_patch

  3. lib-micro/build.bak/cmps_static_clean_first_16

  4. lib-micro/build/cmps_static

The code is simple. At the beginning of cmps’ microcode routine, check the memory content that rdi points to, fetching the first 64-bit data. If it matches certain pattern, in this case, 0x0000000041424142, returns z flag indicating the two strings in comparision are equal.

{SUBR_DSZ64_DRR(TMP10, TMP10, TMP10), GENARITHFLAGS_IR(0x0000003f, TMP10), SFENCE, 0x0b0000f2} // SEQW UEND0

The SUB uop clears TMP10 register and set the z flag that associated with TMP10. Only doing the arithemic operation so that the z flag can be generated to the architecture EFLAGS register by the following uop GENARITHFLAGS_IR(0x0000003f, TMP10).

Why 0x0000003f? Do not know yet.

Also not sure if the SFENCE is a must, copied that from the actual cmps microcode routine. So is 0x0b0000f2, which is a END_SEQWORD with up2 points to SFENCE with sync type being WAIT.


Later I compiled coreboot without CBFS microcode update blob. I thought there would be less or even no microcode update any more.

Surprisingly, the microcode match and path entries even has one more! And the sram space also is used up to 0x7df2.

u@uu:~/prjs/lib-micro.bak$ ./build/ms_match_n_patch_read_static
idx p src   dst
00: 0 0x0000  0x0000
01: 1 0x3a3a  0x7d9a
02: 1 0x6ef6  0x7d76
03: 1 0x6216  0x7d36
04: 1 0x29a2  0x7c80
05: 1 0x69ee  0x7d16
06: 1 0x18b2  0x7c26
07: 1 0x2832  0x7cea
08: 1 0x549a  0x7c3a
09: 1 0x6706  0x7d06
10: 1 0x23aa  0x7cca
11: 1 0x4868  0x7c60
12: 1 0x2010  0x7c08
13: 1 0x18dc  0x7c00
14: 1 0x4588  0x7c38
15: 1 0x5308  0x7d08
16: 1 0x211e  0x7dc4
17: 1 0x6a14  0x7d0e
18: 1 0x0c3e  0x7d44
19: 1 0x1362  0x7cd2
20: 1 0x5026  0x7cd6
21: 1 0x2842  0x7cfe
22: 1 0x038a  0x7d14
23: 1 0x2cb2  0x7d56
24: 1 0x0e66  0x7d8e
25: 1 0x4c5a  0x7dd4
26: 1 0x1436  0x7d2e
27: 1 0x24bc  0x7d0a
28: 1 0x31a4  0x7d3c
29: 1 0x758e  0x7df2
30: 0 0x0000  0x0000
31: 0 0x0000  0x0000

Should list sram content to find empty space.

From the coreboot doc, the microcode update is applied sometimes even before the core is out of reset.

And almost guaranteed that the cpu wont be stable without any microcode update.

Dump ms ram. It is also full. Not sure if the dump is correct yet.

u@uu:~/prjs/lib-micro$ ./build/show_msram_static
ms ram:
7c00: 00053d03ffc8 0152f45c027f 021e0303d23d 01b05600
7c04: 015d9d7002c0 000c44f7e208 000000000000 01ae2a00
7c08: 015d9d7002c0 000c98f7e208 000100030030 01b05600
7c0c: 015100000fb0 00620003f200 0004f007ffd0 01ae2a00
7c10: 00420000023f 196289480200 1062b40b0240 01b05600
7c14: 1a62b4080330 006205071200 186b119c0231 01ae2a00
7c18: 204337080235 017000035d72 000509031c88 01b05600
7c1c: 017000035d71 000d09800000 000c50f402c0 01ae2a00
7c20: 015d65700280 006322035200 00c800035035 01b05600
7c24: 015d0d7002c0 10628e0f0240 086a1d50037f 01ae2a00
7c28: 00070043ef9f 000501031c88 017000035d71 01b05600
7c2c: 000505031c88 017000035d71 0e750003003c 01ae2a00
7c30: 3042f1080240 0052111c0278 00650103f235 01b05600
7c34: 0151111c027f 0053d20002ff 000cd20002c0 01ae2a00
7c38: 000524071e08 0150157002f1 00210003fcbf 01b05600
7c3c: 00563103f23f 0052111c0278 00650103f235 01ae2a00
7c40: 0151111c027f 00632303f200 186a119c027f 01b05600
7c44: 2dcb3403f008 186ad201023f 2dcf34035008 01ae2a00
7c48: 0fff00000000 09628903f200 20628903f200 01b05600
7c4c: 286a446d023f 00401803ce08 006306030200 01ae2a00
7c50: 008805030c08 004147030c10 1062850f1240 01b05600
7c54: 1062810f2240 000e02000200 000c1c300280 01ae2a00
7c58: 000c5e7002c0 000a80800200 000800000000 01b05600
7c5c: 000a40800200 00320003df7c 000100034f74 01ae2a00
7c60: 1042f1080240 00430f080200 2d0fc8000008 01b05600
7c64: 0048d463000b 000a00400200 000800000000 01ae2a00
7c68: 1902f2880200 296272c003c0 20437f00023e 01b05600
7c6c: 290205c00200 00636103e200 00634503f200 01ae2a00
7c70: 013f0003f03f 017e0003effe 00630c03f200 01b05600
7c74: 00070103ffc8 2d0f1833f00a 01080003f010 01ae2a00
7c78: 20438e08023f 00633703f200 386b4e00003f 01b05600
7c7c: 00070103ffc8 0e250003f03f 00638e03f200 01ae2a00
7c80: 0e750003203c 104a00830332 0042bb1c0200 01b05600
7c84: 00002003cf08 000e08400240 000800000000 01ae2a00
7c88: 000e06600240 004800035d70 000800000000 01b05600
7c8c: 0042bb1f5235 00638a03f200 00850803ffc8 01ae2a00
7c90: 00850003dc7f 00141003f23f 00330003ff7f 01b05600
7c94: 00160403f23f 00852403ffc8 00850b03ffc8 01ae2a00
7c98: 00e100039032 00a100039e7d 00080003203a 01b05600
7c9c: 0007070b9e48 00430c00023f 00436100023e 01ae2a00
7ca0: 03800003f03e 00434500023f 00620403f200 01b05600
7ca4: 00040303ffc8 3929c271023f 00620c03f200 01ae2a00
7ca8: 0004ff03ffc8 3928aef1077f 3928aef1073f 01b05600
7cac: 00054703ffc8 0150ae7002ff 000e0c000200 01ae2a00
7cb0: 00620103f200 00087817e008 00000883ef88 01b05600
7cb4: 00a40503e23e 0e750003e03e 3928c2310fbf 01ae2a00
7cb8: 000a01000200 00626703e200 00641003e23e 01b05600
7cbc: 00410003efbf 00620003f200 386b69f103ff 01ae2a00
7cc0: 00637f03f200 392969310ffe 29626dc003c0 01b05600
7cc4: 00620c036200 0053111c0278 000879035008 01ae2a00
7cc8: 000155020c08 000000000000 1962dd480300 01b05600
7ccc: 286a8429027e 000000000000 006212173200 01ae2a00
7cd0: 204212140200 000000000000 004267000234 01b05600
7cd4: 000c644c0200 000000000000 004213140200 01ae2a00
7cd8: 000c28400280 000000000000 004900035030 01b05600
7cdc: 000c91600200 000000000000 000407033048 01ae2a00
7ce0: 086acc140cf4 000000000000 0eff00000000 01b05600
7ce4: 006350032200 000000000000 00520568027a 01ae2a00
7ce8: 00400403ef88 000000000000 00080f031008 01b05600
7cec: 204262000231 296270c00200 29620bc00200 01ae2a00
7cf0: 00480e1bc008 0062f01f1200 00330203f23e 01b05600
7cf4: 00010103ffc8 00240203e23e 006213174200 01ae2a00
7cf8: 2a6213540734 29620bc00240 386ad8e10232 01b05600
7cfc: 10629f0b2240 186aa8400272 005410031231 01ae2a00
7d00: 0052096402b1 00720003bef1 017100037df1 01b05600
7d04: 000800020037 006520022237 00080003f000 01ae2a00
7d08: 000108032c88 000000000000 2d0be41e100a 01b05600
7d0c: 006387030200 000000031c30 000100031c70 01ae2a00
7d10: 013100023c78 00a100322009 00150a022222 01b05600
7d14: 005000000efb 000000000000 1062e70b1240 01ae2a00
7d18: 386a163502f1 000d03800000 0042bb1c0235 01b05600
7d1c: 396289480200 000000000000 000501039008 01ae2a00
7d20: 00632203f200 00210003ffff 29632280023f 01b05600
7d24: 000cf83c02c0 000000000000 0052217002f8 01ae2a00
7d28: 00c800033035 204322080233 00320003fd73 01b05600
7d2c: 386a3631023f 000000000000 20435c00023f 01ae2a00
7d30: 2d0be443f00a 0004001bffc8 00250403f23f 01b05600
7d34: 00010003fffe 2d0fe443f00a 000a28000200 01ae2a00
7d38: 1062cd0bb240 00047003bec8 0150387402fb 01b05600
7d3c: 002510032235 000610131e08 3928197102b1 01ae2a00
7d40: 392829710231 00653d031235 000405031c48 01b05600
7d44: 000909240000 000c94600200 100a00100200 01ae2a00
7d48: 0fef02000000 00623b1bf200 29023b58023f 01b05600
7d4c: 20423b18023f 000d09800000 2d0ba0030008 01ae2a00
7d50: 01420b000f80 015dca680280 00880003a031 01b05600
7d54: 00012b039e48 01524d7402ff 00630703d200 01ae2a00
7d58: 20437808023d 00637803f200 00141703f23f 01b05600
7d5c: 00330003ffff 2dcb3403d008 286a9239003d 01ae2a00
7d60: 0151111c0272 0005ee03ae08 01503d7002fa 01b05600
7d64: 00054803ae08 0150267402fa 39283171023a 01ae2a00
7d68: 00050a07ae08 0150c57002fa 0005883f1c8a 01b05600
7d6c: 0131010b1231 0005202fdc8a 01312203d23d 01ae2a00
7d70: 000100031c7d 004700035d71 3d0b00031c88 01b05600
7d74: 3d0f00035c88 000000000000 1062800b2240 01ae2a00
7d78: 0004a1032c90 1929ee050032 00634703c200 01b05600
7d7c: 100a00000380 006353030200 00540f030230 01ae2a00
7d80: 013e75338c08 00360003cf38 096272800240 01b05600
7d84: 00629e1f2200 00480003fcbf 09a29e5ff27f 01ae2a00
7d88: 100a00100200 00040303f23f 00050003fff2 01b05600
7d8c: 0053ca38027f 000cca380240 00632003b200 01ae2a00
7d90: 0008e0036008 0008a0037008 000580079e48 01b05600
7d94: 000588078e08 00240103c23b 00003427c23c 01ae2a00
7d98: 00080103d008 033a4d73a00b 0fef01000000 01b05600
7d9c: 3062b40b0240 086aec140330 000d06800000 01ae2a00
7da0: 3962e1880280 000813036008 0150117002f6 01b05600
7da4: 000501036d88 1062e10b0240 386b40a802b0 01ae2a00
7da8: 0042f61c0236 006322035200 006520035235 01b05600
7dac: 204322000235 000cdccc0200 0062c31b3200 01ae2a00
7db0: 00160a033233 00040103fd48 00240a03f23f 01b05600
7db4: 2902c3180ff3 000000000000 00141e03b23d 01ae2a00
7db8: 00330003bd7b 00250203b23b 3929beb5033b 01b05600
7dbc: 0007fc035d48 0001a0035d48 3929c2b503fb 01ae2a00
7dc0: 0007fc035d48 0001a4035d48 006430035235 01b05600
7dc4: 286aaa60027f 00484703e010 00414003ef88 01ae2a00
7dc8: 00440003effe 00464703ef90 00620c03f200 01b05600
7dcc: 0047af03f43f 00410003effe 00621217f200 01ae2a00
7dd0: 01710003fffe 19290804003f 00621017f200 01b05600
7dd4: 0062fe1f0200 238000030c00 0c4b8027b000 01ae2a00
7dd8: 0c4b802b1000 00a100031ef1 002100030c31 01b05600
7ddc: 0c4b802fb000 0c4b80231000 00a100031ef1 01ae2a00
7de0: 004900030027 004900031026 004900032022 01b05600
7de4: 00080003a008 00000103b230 00000203c230 01ae2a00
7de8: 20628c0f9200 20428c0c023a 20620003dec0 01b05600
7dec: 204200000ef1 204200000c32 206200020f00 01ae2a00
7df0: 204200000efa 20428c0c0239 000000000000 01b05600
7df4: 00012c039e48 01521d7002ff 000000000000 01ae2a00
7df8: 000000000000 000000000000 000000000000 01b05600
7dfc: 000000000000 000000000000 000000000000 01ae2a00

The following data is what read out when I flashed coreboot.vgacbfshighres_3840x2160.10.rom.

The msrom may not be correct.

u@uu:~/prjs/lib-micro$ ./build/ms_match_n_patch_read_static
idx p src   dst
00: 0 0x0000  0x0000
01: 1 0x1434  0x06c6
02: 1 0x4c04  0x7c0a
03: 1 0x61e6  0x7cae
04: 1 0x757a  0x7cb0
05: 1 0x244a  0x7cdc
06: 1 0x065c  0x7c5c
07: 1 0x29ca  0x7c2e
08: 1 0x2078  0x7cf6
09: 1 0x263a  0x7cfe
10: 1 0x18c4  0x7cfa
11: 1 0x78d6  0x7d02
12: 1 0x2018  0x7c04
13: 1 0x5b94  0x7c14
14: 1 0x5ce2  0x7c88
15: 1 0x6908  0x7c6c
16: 1 0x3b52  0x7c4a
17: 1 0x4e76  0x7db8
18: 1 0x01ce  0x7ce6
19: 1 0x2ec8  0x7d6e
20: 1 0x6ff6  0x7d26
21: 1 0x13da  0x7d94
22: 1 0x667c  0x7cea
23: 1 0x0cd2  0x7d0a
24: 1 0x0e66  0x7d7a
25: 1 0x4c5a  0x7dd6
26: 1 0x24bc  0x7d12
27: 1 0x31a4  0x7d36
28: 1 0x758e  0x7df6
29: 0 0x0000  0x0000
30: 0 0x0000  0x0000
31: 0 0x0000  0x0000
u@uu:~/prjs/lib-micro$ ./build/show_msram_static
ms ram:
7c00: 00053d03ffc8 0152f45c027f 021e0303d23d 01b05600
7c04: 015db17002c0 000c44f7e208 000000000000 01ae2a00
7c08: 015db17002c0 000c98f7e208 000100030030 01b05600
7c0c: 015100000fb0 00620003f200 0004f007ffd0 01ae2a00
7c10: 00420000023f 2d0ba01b500a 015d2a380240 01b05600
7c14: 015d0d7002c0 10628e0f0240 086a1d50037f 01ae2a00
7c18: 00070043ef9f 196289480200 1062b40b0240 01b05600
7c1c: 1a62b4080330 006205071200 186b119c0231 01ae2a00
7c20: 204337080235 017000035d72 000509031c88 01b05600
7c24: 017000035d71 000d09800000 000ca4f402c0 01ae2a00
7c28: 015d65700280 006322035200 00c800035035 01b05600
7c2c: 000524071e08 01501d7002f1 0e750003003c 01ae2a00
7c30: 3042f1080240 0052111c0278 0151111c027f 01b05600
7c34: 0053d20002ff 000cd20002c0 00210003fcbf 01ae2a00
7c38: 00563103f23f 000501031c88 017000035d71 01b05600
7c3c: 000505031c88 017000035d71 1962dd480300 01ae2a00
7c40: 286a8429027e 00081a032008 000c11f002c0 01b05600
7c44: 0052667002b8 00081b032008 0151111c027f 01ae2a00
7c48: 000012140000 000cd28312f5 006212173200 01b05600
7c4c: 204212140200 0052111c0278 00650103f235 01ae2a00
7c50: 0151111c027f 00632303f200 186a119c027f 01b05600
7c54: 2dcb3403f008 186ad201023f 2dcf34035008 01ae2a00
7c58: 0052111c0278 204337080235 015dd20002c0 01b05600
7c5c: 0fff00000000 09628903f200 20628903f200 01ae2a00
7c60: 286a446d023f 00401803ce08 006306030200 01b05600
7c64: 008805030c08 004147030c10 1062850f1240 01ae2a00
7c68: 1062810f2240 000e02000200 000c1c300280 01b05600
7c6c: 000c727002c0 000a80800200 000800000000 01ae2a00
7c70: 000a40800200 00320003df7c 000100034f74 01b05600
7c74: 1042f1080240 00430f080200 2d0fc8000008 01ae2a00
7c78: 0048d463000b 000a00400200 000800000000 01b05600
7c7c: 1902f2880200 296272c003c0 20437f00023e 01ae2a00
7c80: 290205c00200 00636103e200 00634503f200 01b05600
7c84: 013f0003f03f 017e0003effe 00630c03f200 01ae2a00
7c88: 00070103ffc8 2d0f1833f00a 01080003f010 01b05600
7c8c: 20438e08023f 00633703f200 386b4e00003f 01ae2a00
7c90: 00070103ffc8 0e250003f03f 00638e03f200 01b05600
7c94: 0e750003203c 104a00830332 0042bb1c0200 01ae2a00
7c98: 00002003cf08 000e08400240 000800000000 01b05600
7c9c: 000e06600240 004800035d70 000800000000 01ae2a00
7ca0: 0042bb1f5235 00638a03f200 00850803ffc8 01b05600
7ca4: 00850003dc7f 00141003f23f 00330003ff7f 01ae2a00
7ca8: 00160403f23f 00852403ffc8 00850b03ffc8 01b05600
7cac: 00e100039032 00a100039e7d 00080003203a 01ae2a00
7cb0: 0007070b9e48 00430c00023f 00436100023e 01b05600
7cb4: 03800003f03e 00434500023f 00620403f200 01ae2a00
7cb8: 00040303ffc8 3929d671023f 00620c03f200 01b05600
7cbc: 0004ff03ffc8 3928c2f1077f 3928c2f1073f 01ae2a00
7cc0: 00054703ffc8 0150c27002ff 000e0c000200 01b05600
7cc4: 00620103f200 00087817e008 00000883ef88 01ae2a00
7cc8: 00a40503e23e 0e750003e03e 3928d6310fbf 01b05600
7ccc: 000a01000200 00626703e200 00641003e23e 01ae2a00
7cd0: 00410003efbf 00620003f200 386b7df103ff 01b05600
7cd4: 00637f03f200 39297d310ffe 29626dc003c0 01ae2a00
7cd8: 00620c036200 0053111c0278 000879335008 01b05600
7cdc: 000155020c08 000000000000 004267000234 01ae2a00
7ce0: 000c644c0200 000000000000 004213140200 01b05600
7ce4: 000c28400280 000000000000 004900035030 01ae2a00
7ce8: 000c91600200 000000000000 000407033048 01b05600
7cec: 086acc140cf4 000000000000 00080f031008 01ae2a00
7cf0: 204262000231 296270c00200 00520568027a 01b05600
7cf4: 00400403ef88 000000000000 29620bc00200 01ae2a00
7cf8: 00480e1bc008 0062f01f1200 00330203f23e 01b05600
7cfc: 00010103ffc8 00240203e23e 006213174200 01ae2a00
7d00: 2a6213540734 29620bc00240 386ad8e10232 01b05600
7d04: 10629f0b2240 186aa8400272 005410031231 01ae2a00
7d08: 0052096402b1 00720003bef1 017100037df1 01b05600
7d0c: 000800020037 006520022237 00080003f000 01ae2a00
7d10: 000108032c88 000000000000 2d0be41e100a 01b05600
7d14: 006387030200 000000031c30 000100031c70 01ae2a00
7d18: 013100023c78 00a100322009 00150a022222 01b05600
7d1c: 005000000efb 000000000000 1062e70b1240 01ae2a00
7d20: 386a1e3502f1 000d03800000 0042bb1c0235 01b05600
7d24: 396289480200 000000000000 000501039008 01ae2a00
7d28: 00632203f200 00210003ffff 29632280023f 01b05600
7d2c: 000cf83c02c0 000000000000 0052297002f8 01ae2a00
7d30: 00c800033035 204322080233 00320003fd73 01b05600
7d34: 386a3531023f 000000000000 002510032235 01ae2a00
7d38: 000610131e08 3928217102b1 392839710231 01b05600
7d3c: 00653d031235 000405031c48 000909240000 01ae2a00
7d40: 000c94600200 100a00100200 0fef02000000 01b05600
7d44: 00623b1bf200 29023b58023f 20423b18023f 01ae2a00
7d48: 000a28000200 1062cd0bb240 00047003bec8 01b05600
7d4c: 0150497402fb 000000000000 00630703d200 01ae2a00
7d50: 20437808023d 00637803f200 00141703f23f 01b05600
7d54: 00330003ffff 2dcb3403d008 286a9239003d 01ae2a00
7d58: 0005883f1c8a 0131010b1231 0005202fdc8a 01b05600
7d5c: 01312203d23d 000100031c7d 004700035d71 01ae2a00
7d60: 3d0b00031c88 3d0f00035c88 1062800b2240 01b05600
7d64: 0004a1032c90 1929ee050032 00634703c200 01ae2a00
7d68: 100a00000380 006353030200 00540f030230 01b05600
7d6c: 013e75338c08 00360003cf38 096272800240 01ae2a00
7d70: 00629e1f2200 00480003fcbf 09a29e5ff27f 01b05600
7d74: 100a00100200 00040303f23f 00050003fff2 01ae2a00
7d78: 0053ca38027f 000cca380240 00632003b200 01b05600
7d7c: 0008e0036008 0008a0037008 000580079e48 01ae2a00
7d80: 000588078e08 00240103c23b 00003427c23c 01b05600
7d84: 00080103d008 033a6173a00b 0fef01000000 01ae2a00
7d88: 3062b40b0240 086aec140330 000d06800000 01b05600
7d8c: 3962e1880280 000813036008 0150197002f6 01ae2a00
7d90: 000501036d88 1062e10b0240 386b40a802b0 01b05600
7d94: 0042f61c0236 006322035200 006520035235 01ae2a00
7d98: 204322000235 000cdccc0200 0062c31b3200 01b05600
7d9c: 00160a033233 00040103fd48 00240a03f23f 01ae2a00
7da0: 2902c3180ff3 000d09800000 2d0ba0030008 01b05600
7da4: 01420b000f80 015dca680280 00880003a031 01ae2a00
7da8: 00012b039e48 0152a17402ff 00141e03b23d 01b05600
7dac: 00330003bd7b 00250203b23b 3929b2b5033b 01ae2a00
7db0: 0007fc035d48 0001a0035d48 3929b6b503fb 01b05600
7db4: 0007fc035d48 0001a4035d48 006430035235 01ae2a00
7db8: 0151111c0272 0005ee03ae08 01504d7002fa 01b05600
7dbc: 00054803ae08 01502e7402fa 00650103f235 01ae2a00
7dc0: 39283171023a 0005bc03ae08 0150417002fa 01b05600
7dc4: 00050a07ae08 0150d97002fa 286aaa60027f 01ae2a00
7dc8: 00484703e010 00414003ef88 00440003effe 01b05600
7dcc: 00464703ef90 00620c03f200 0047af03f43f 01ae2a00
7dd0: 00410003effe 00621217f200 01710003fffe 01b05600
7dd4: 19290804003f 00621017f200 0062fe1f0200 01ae2a00
7dd8: 238000030c00 0c4b8027b000 0c4b802b1000 01b05600
7ddc: 00a100031ef1 002100030c31 0c4b802fb000 01ae2a00
7de0: 004900030027 004900031026 004900032022 01b05600
7de4: 00080003a008 00000103b230 00000203c230 01ae2a00
7de8: 20628c0f9200 20428c0c023a 20620003dec0 01b05600
7dec: 204200000ef1 204200000c32 206200020f00 01ae2a00
7df0: 204200000efa 20428c0c0239 000000000000 01b05600
7df4: 000000000000 000000000000 00880003a031 01ae2a00
7df8: 00012c039e48 0152257002ff 000000000000 01b05600
7dfc: 000000000000 000000000000 000000000000 01ae2a00

Clean first 16 math registers, then do the hook, that is how it could work currently.

u@uu:~/prjs/lib-micro$ ./cmps_bin/cmps_static_do_IN_fix
u@uu:~/prjs/lib-micro$ ./cmps_bin/cmps_static_clean_first_16_match
u@uu:~/prjs/lib-micro$ ./cmps_bin/cmps_static
patching addr: 00007c00 - ram: 00000000
jump_target return value: 0x7c00
7c00: 000500021861 237d3f000e88 0fff00000000 0b0000f2
0x3cc8 uop 0x1c0000231027
0x3cc8 uop 0x1c0000630026
0x3cc8 uop 0x108501034d08
      seqw 0x18000c0
Patching 3cc8 -> 7c10
7c10: 000000000000 0c4000231027 0008901f000d 018000c0
7c14: 006410030230 0040d75b0230 006410030230 018000c0
7c18: 0040e65f0330 006410030230 00403d770370 018000c0
7c1c: 000000000000 00050003ac31 0150007002fa 018000e5
7c20: 1c0000231027 1c0000630026 108501034d08 018000c0
7c24: 015dcc700240 015dcd700240 015dce700240 018000c0