static void recalculate_xstate(struct cpu_policy *p)
{
uint64_t xstates = XSTATE_FP_SSE;
- unsigned int i, ecx_mask = 0, Da1 = p->xstate.Da1;
+ unsigned int ecx_mask = 0, Da1 = p->xstate.Da1;
/*
* The Da1 leaf is the only piece of information preserved in the common
/* Subleafs 2+ */
xstates &= ~XSTATE_FP_SSE;
BUILD_BUG_ON(ARRAY_SIZE(p->xstate.comp) < 63);
- bitmap_for_each ( i, &xstates, 63 )
+ for_each_set_bit ( i, xstates )
{
/*
* Pass through size (eax) and offset (ebx) directly. Visbility of
unsigned int xstate_uncompressed_size(uint64_t xcr0)
{
- unsigned int size = XSTATE_AREA_MIN_SIZE, i;
+ unsigned int size = XSTATE_AREA_MIN_SIZE;
/* Non-XCR0 states don't exist in an uncompressed image. */
ASSERT((xcr0 & ~X86_XCR0_STATES) == 0);
* with respect their index.
*/
xcr0 &= ~(X86_XCR0_SSE | X86_XCR0_X87);
- bitmap_for_each ( i, &xcr0, 63 )
+ for_each_set_bit ( i, xcr0 )
{
const struct xstate_component *c = &raw_cpu_policy.xstate.comp[i];
unsigned int s = c->offset + c->size;
unsigned int xstate_compressed_size(uint64_t xstates)
{
- unsigned int i, size = XSTATE_AREA_MIN_SIZE;
+ unsigned int size = XSTATE_AREA_MIN_SIZE;
+
+ ASSERT((xstates & ~(X86_XCR0_STATES | X86_XSS_STATES)) == 0);
if ( xstates == 0 )
return 0;
* componenets require aligning to 64 first.
*/
xstates &= ~(X86_XCR0_SSE | X86_XCR0_X87);
- bitmap_for_each ( i, &xstates, 63 )
+ for_each_set_bit ( i, xstates )
{
const struct xstate_component *c = &raw_cpu_policy.xstate.comp[i];