* is disabled make sure the pending bit is cleared to avoid re-
* polling.
*/
- if ( !vs->config.enabled )
+ if ( !vs->config.enable )
{
clear_bit(stimerx, &vv->stimer_pending);
return;
if ( vs->config.periodic )
start_stimer(vs);
else
- vs->config.enabled = 0;
+ vs->config.enable = 0;
}
void viridian_time_poll_timers(struct vcpu *v)
{
struct viridian_stimer *vs = &vv->stimer[i];
- if ( vs->config.enabled )
+ if ( vs->config.enable )
start_stimer(vs);
}
}
stop_stimer(vs);
- vs->config.raw = val;
+ vs->config.as_uint64 = val;
if ( !vs->config.sintx )
- vs->config.enabled = 0;
+ vs->config.enable = 0;
- if ( vs->config.enabled )
+ if ( vs->config.enable )
start_stimer(vs);
break;
vs->count = val;
if ( !vs->count )
- vs->config.enabled = 0;
+ vs->config.enable = 0;
else if ( vs->config.auto_enable )
- vs->config.enabled = 1;
+ vs->config.enable = 1;
- if ( vs->config.enabled )
+ if ( vs->config.enable )
start_stimer(vs);
break;
unsigned int stimerx = (idx - HV_X64_MSR_STIMER0_CONFIG) / 2;
const struct viridian_stimer *vs =
&array_access_nospec(vv->stimer, stimerx);
- union viridian_stimer_config_msr config = vs->config;
+ union hv_stimer_config config = vs->config;
if ( !(viridian_feature_mask(d) & HVMPV_stimer) )
return X86EMUL_EXCEPTION;
* the enabled flag is clear.
*/
if ( !config.periodic && test_bit(stimerx, &vv->stimer_pending) )
- config.enabled = 0;
+ config.enable = 0;
- *val = config.raw;
+ *val = config.as_uint64;
break;
}
{
const struct viridian_stimer *vs = &vv->stimer[i];
- ctxt->stimer_config_msr[i] = vs->config.raw;
+ ctxt->stimer_config_msr[i] = vs->config.as_uint64;
ctxt->stimer_count_msr[i] = vs->count;
}
}
{
struct viridian_stimer *vs = &vv->stimer[i];
- vs->config.raw = ctxt->stimer_config_msr[i];
+ vs->config.as_uint64 = ctxt->stimer_config_msr[i];
vs->count = ctxt->stimer_count_msr[i];
}
}
void *ptr;
};
-union viridian_stimer_config_msr
-{
- uint64_t raw;
- struct
- {
- uint64_t enabled:1;
- uint64_t periodic:1;
- uint64_t lazy:1;
- uint64_t auto_enable:1;
- uint64_t vector:8;
- uint64_t direct_mode:1;
- uint64_t reserved_zero1:3;
- uint64_t sintx:4;
- uint64_t reserved_zero2:44;
- };
-};
-
struct viridian_stimer {
struct vcpu *v;
struct timer timer;
- union viridian_stimer_config_msr config;
+ union hv_stimer_config config;
uint64_t count;
uint64_t expiration;
bool started;