在破解 Linux 内核时,我注意到它会FXSAVE在执行 FPU 相关任务之前执行一条指令。我知道该FXSAVE指令会将 FPU 状态保存到内存中的目标位置,可以通过FXRSTOR指令恢复。我的问题是我是否可以在执行指令FXSAVE之前执行两次。FXRSTOR
例如:
char fxsave_region1[512] __attribute__((aligned(16)));
char fxsave_region2[512] __attribute__((aligned(16)));
asm volatile(" fxsave; "::"m"(fxsave_region1));
/* miscellaneous floating point operations */
asm volatile(" fxsave; "::"m"(fxsave_region2)); /* will this work? */
/* some more miscellaneous floating point operations */
asm volatile(" fxrstor; "::"m"(fxsave_region2));
/* even more miscellaneous floating point operations */
asm volatile(" fxrstor; "::"m"(fxsave_region1));
还是只支持一级储蓄?