2

FXSAVELinux カーネルをハッキングしているときに、FPU 関連のタスクを実行する前に命令を実行することに気付きました。FXSAVE命令によって FPU の状態がメモリ内の保存先に保存され、命令によって復元できることを理解していFXRSTORます。私の質問は、命令が実行されるFXSAVE前に 2 回実行できるかどうかです。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));

それとも、サポートされる保存レベルは 1 つだけですか?

4

1 に答える 1