Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
x86/xstate: Switch back to for_each_set_bit()
In all 3 examples, we're iterating over a scaler. They have an upper bound of 63 which is to exclude the top bit; the COMPRESSED bit. recalculate_xstate() calculates xstates directly and doesn't set the COMPRESSED bit. Both xstate_{un,}compressed_size() take architectural register values, neither of which permit the COMPRESSED bit either. xstate_uncompressed_size() has an ASSERT() covering this properly; add a equivelent ASSERT() to xstate_compressed_size() too. This alone produces: add/remove: 0/0 grow/shrink: 0/4 up/down: 0/-161 (-161) Function old new delta compress_xsave_states 66 58 -8 xstate_uncompressed_size 119 71 -48 xstate_compressed_size 124 76 -48 recalculate_xstate 347 290 -57 where xstate_{un,}compressed_size() have practically halved in size despite being small before. The change in compress_xsave_states() is unexpected. The function is almost entirely dead code, and within what remains there's a smaller stack frame. I suspect it's leftovers that the optimiser couldn't fully discard. Signed-off-by: Andrew Cooper <[email protected]> Reviewed-by: Jan Beulich <[email protected]>
- Loading branch information