Lines Matching refs:mtrr_state
96 static bool mtrr_is_enabled(struct kvm_mtrr *mtrr_state) in mtrr_is_enabled() argument
98 return !!(mtrr_state->deftype & IA32_MTRR_DEF_TYPE_E); in mtrr_is_enabled()
101 static bool fixed_mtrr_is_enabled(struct kvm_mtrr *mtrr_state) in fixed_mtrr_is_enabled() argument
103 return !!(mtrr_state->deftype & IA32_MTRR_DEF_TYPE_FE); in fixed_mtrr_is_enabled()
106 static u8 mtrr_default_type(struct kvm_mtrr *mtrr_state) in mtrr_default_type() argument
108 return mtrr_state->deftype & IA32_MTRR_DEF_TYPE_TYPE_MASK; in mtrr_default_type()
312 struct kvm_mtrr *mtrr_state = &vcpu->arch.mtrr_state; in update_mtrr() local
320 if (!mtrr_is_enabled(mtrr_state) && msr != MSR_MTRRdefType) in update_mtrr()
325 if (!fixed_mtrr_is_enabled(mtrr_state)) in update_mtrr()
333 var_mtrr_range(&mtrr_state->var_ranges[index], &start, &end); in update_mtrr()
346 struct kvm_mtrr *mtrr_state = &vcpu->arch.mtrr_state; in set_var_mtrr_msr() local
352 cur = &mtrr_state->var_ranges[index]; in set_var_mtrr_msr()
356 list_del(&mtrr_state->var_ranges[index].node); in set_var_mtrr_msr()
369 list_for_each_entry(tmp, &mtrr_state->head, node) in set_var_mtrr_msr()
385 *(u64 *)&vcpu->arch.mtrr_state.fixed_ranges[index] = data; in kvm_mtrr_set_msr()
387 vcpu->arch.mtrr_state.deftype = data; in kvm_mtrr_set_msr()
418 *pdata = *(u64 *)&vcpu->arch.mtrr_state.fixed_ranges[index]; in kvm_mtrr_get_msr()
420 *pdata = vcpu->arch.mtrr_state.deftype; in kvm_mtrr_get_msr()
429 *pdata = vcpu->arch.mtrr_state.var_ranges[index].base; in kvm_mtrr_get_msr()
431 *pdata = vcpu->arch.mtrr_state.var_ranges[index].mask; in kvm_mtrr_get_msr()
441 INIT_LIST_HEAD(&vcpu->arch.mtrr_state.head); in kvm_vcpu_mtrr_init()
446 struct kvm_mtrr *mtrr_state; member
480 if (!fixed_mtrr_is_enabled(iter->mtrr_state)) in mtrr_lookup_fixed_start()
520 struct kvm_mtrr *mtrr_state = iter->mtrr_state; in __mtrr_lookup_var_next() local
522 list_for_each_entry_continue(iter->range, &mtrr_state->head, node) in __mtrr_lookup_var_next()
532 struct kvm_mtrr *mtrr_state = iter->mtrr_state; in mtrr_lookup_var_start() local
537 iter->range = list_prepare_entry(iter->range, &mtrr_state->head, node); in mtrr_lookup_var_start()
554 if (iter->index >= ARRAY_SIZE(iter->mtrr_state->fixed_ranges)) in mtrr_lookup_fixed_next()
569 if (!mtrr_is_enabled(iter->mtrr_state)) { in mtrr_lookup_start()
579 struct kvm_mtrr *mtrr_state, u64 start, u64 end) in mtrr_lookup_init() argument
581 iter->mtrr_state = mtrr_state; in mtrr_lookup_init()
595 iter->mem_type = iter->mtrr_state->fixed_ranges[iter->index]; in mtrr_lookup_okay()
621 struct kvm_mtrr *mtrr_state = &vcpu->arch.mtrr_state; in kvm_mtrr_get_guest_memory_type() local
631 mtrr_for_each_mem_type(&iter, mtrr_state, start, end) { in kvm_mtrr_get_guest_memory_type()
683 return mtrr_default_type(mtrr_state); in kvm_mtrr_get_guest_memory_type()
698 struct kvm_mtrr *mtrr_state = &vcpu->arch.mtrr_state; in kvm_mtrr_check_gfn_range_consistency() local
705 mtrr_for_each_mem_type(&iter, mtrr_state, start, end) { in kvm_mtrr_check_gfn_range_consistency()
724 return type == mtrr_default_type(mtrr_state); in kvm_mtrr_check_gfn_range_consistency()