PR: 275322
Reported by: Cheyenne Wills <cheyenne.wills@gmail.com>
Details
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
I'm not fully familiar with the xsave details - I'm curious why this was AMD-specific (and/or, what implies that the x87 area was not saved, in the new block)?
AMD-specific thing there is that X87 state was not saved, as reported by xstate_bv.bit0 == 0 (I believe Intel always saves X87). But regardless of that, MXCSR state is always saved even if X87 is not. By overwriting X87 non-saved area with the default content, we also override the potentially changed MXCSR, which was reported in the PR.
sys/amd64/amd64/fpu.c | ||
---|---|---|
889 | Literally, Intel SDM states IF RFBM[1] = 1 or RFBM[2] = 1 THEN store MXCSR and MXCSR_MASK into legacy region of XSAVE area; FI; But now I think that the mask must be saved as well. |
sys/amd64/amd64/fpu.c | ||
---|---|---|
905–908 | we write this each time through the loop? |
sys/amd64/amd64/fpu.c | ||
---|---|---|
905–908 | Indeed. This is not incorrect but excessive of course. |
sys/amd64/amd64/fpu.c | ||
---|---|---|
889 | The Intel SDM also states that, when XSAVEC is used, only RFBM[1] set causes MXCSR and MXCSR_MASK to be stored. So shouldn't the newly introduced if be changed to deal with this situation, by testing only for RFBM[1], or RFBM[1] and RFBM[2], depending on whether XCOMP_BV[63] is set (flag for the compact format)? |
sys/amd64/amd64/fpu.c | ||
---|---|---|
889 | We do not use XSAVEC. This code needs to be completely revamped to accomodate XSAVEC. |