Okay so I've done some more research.
Based on Pike's work here:
https://pikeralpha.wordpress.com/2016/08/10/checks-for-two-unused-processor-models-found/
I have pinpointed that the _xcpm_core_scope_msrs patch does only one thing: disables writes the MSR 0xE2. For our skylake X processors, the kernel wants to write 0x7e000003. With the patch disabled, I get the E3 error on wake. BUT I checked the KP report, like the others here and this part
Code:
0xfffffd000004c6d0 : 0xffffff801698c6b4 mach_kernel : _xcpm_perf_bias_set + 0x294
0xffffffa7644dbc20 : 0xffffff801698c9be mach_kernel : _xcpm_init + 0xde
Points to the exact wrmsr instuction the patch disables.
In fact, the processor register dump clearly shows
Code:
*** Panic Report ***
panic(cpu 0 caller 0xffffff801696e349): Kernel trap at 0xffffff801698c6b4, type 13=general protection, registers:
CR0: 0x0000000080010033, CR2: 0x000000010a141000, CR3: 0x000000002c354000, CR4: 0x00000000003627e0
RAX: 0x000000007e008003, RBX: 0xffffff8017057320, RCX: 0x00000000000000e2, RDX: 0x0000000000000000
RSP: 0xffffffa7644dbbf0, RBP: 0xffffffa7644dbc20, RSI: 0x0000000000000003, RDI: 0xffffff80170572c0
R8: 0x0000000100000201, R9: 0xffffff801a80101f, R10: 0x0000000000000003, R11: 0xffffff8016f70eeb
R12: 0xffffff8016f78896, R13: 0x0000000000000001, R14: 0x0000000000000000, R15: 0xffffff8016f7887c
RFL: 0x0000000000010046, RIP: 0xffffff801698c6b4, CS: 0x0000000000000008, SS: 0x0000000000000010
Fault CR2: 0x000000010a141000, Error code: 0x0000000000000000, Fault CPU: 0x0, PL: 0, VF: 0
RAX gets written to the lower 32 bits of the MSR named in RCX, and that is exactly what I tought it is: 7e008003 to 0xe2!
So in essence, on wake, the kernel tries to write to the MSR 0xE2 again, and this time it fails. I think it might be locked at that point. Because I just checked, and with an unlocked register, I can write to it whatever I want without a KP. So maybe, just maybe, the BIOS has another point where it locks the register, probably on s3 wake. That's my best guess so far, and I will look into the bios again.