Messages in this thread | | | From | Ingo Molnar <> | Date | Wed, 6 May 2015 14:46:19 +0200 | Subject | Re: [PATCH 084/208] x86/fpu: Rename xsave.header::xstate_bv to 'xfeatures' |
| |
* Ingo Molnar <mingo2.kernel.org@gmail.com> wrote:
> > XSTATE_BV is the set of states written to the xsave area. > > > > XCOMP_BV is essentially always XCR0 (aka pcntxt_mask, aka > > xfeatures_mask) or'd with bit 63. > > So how about this naming: > > /* > * Mask of xstate components currently not in init state, > * typically written to by XSAVE*. > */ > u64 xfeat_mask_used; /* SDM: XSTATE_BV */ > > /* > * Mask of all state components saved/restored, plus the > * compaction flag. (Note that the XRSTORS instruction caches > * this value, and the next SAVES done for this same > * area expects it to match, before it can perform the 'were > * these registers modified' hardware optimization.) > */ > u64 xfeat_mask_all; /* SDM: XCOMP_BV */ > > (Note that I kept the SDM name easily greppable.)
Hm, so the problem with this naming is that for non-compacted XRSTOR, XCOMP_BV has to be zero. (This seems nonsensical btw., as there's a separate 'compaction' flag at bit 63 already.)
So a better name would be:
/* * Mask of xstate components currently not in init state, * typically written to by XSAVE*. */ u64 xfeat_used_mask; /* SDM: XSTATE_BV */
/* * This mask is non-zero if the CPU supports state compaction: * it is the mask of all state components to be saved/restored, * plus the compaction flag at bit 63. * (Note that the XRSTORS instruction caches this value, and * the next SAVES done for this same area expects it to match, * before it can perform the 'were these registers modified' * hardware optimization.) */ u64 xfeat_comp_mask; /* SDM: XCOMP_BV */
?
Thanks,
Ingo
| |