Lines Matching defs:kvm
9 #include <kvm/arm_hypercalls.h>
10 #include <kvm/arm_psci.h>
47 cycles = systime_snapshot.cycles - vcpu->kvm->arch.timer_data.voffset;
50 cycles = systime_snapshot.cycles - vcpu->kvm->arch.timer_data.poffset;
98 struct kvm_smccc_features *smccc_feat = &vcpu->kvm->arch.smccc_feat;
136 static void init_smccc_filter(struct kvm *kvm)
140 mt_init(&kvm->arch.smccc_filter);
147 r = mtree_insert_range(&kvm->arch.smccc_filter,
153 r = mtree_insert_range(&kvm->arch.smccc_filter,
161 static int kvm_smccc_set_filter(struct kvm *kvm, struct kvm_smccc_filter __user *uaddr)
180 mutex_lock(&kvm->arch.config_lock);
182 if (kvm_vm_has_ran_once(kvm)) {
187 r = mtree_insert_range(&kvm->arch.smccc_filter, start, end,
192 set_bit(KVM_ARCH_FLAG_SMCCC_FILTER_CONFIGURED, &kvm->arch.flags);
195 mutex_unlock(&kvm->arch.config_lock);
199 static u8 kvm_smccc_filter_get_action(struct kvm *kvm, u32 func_id)
204 if (!test_bit(KVM_ARCH_FLAG_SMCCC_FILTER_CONFIGURED, &kvm->arch.flags))
213 val = mt_find(&kvm->arch.smccc_filter, &idx, idx);
223 u8 action = kvm_smccc_filter_get_action(vcpu->kvm, func_id);
255 struct kvm_smccc_features *smccc_feat = &vcpu->kvm->arch.smccc_feat;
382 void kvm_arm_init_hypercalls(struct kvm *kvm)
384 struct kvm_smccc_features *smccc_feat = &kvm->arch.smccc_feat;
390 init_smccc_filter(kvm);
393 void kvm_arm_teardown_hypercalls(struct kvm *kvm)
395 mtree_destroy(&kvm->arch.smccc_filter);
468 struct kvm_smccc_features *smccc_feat = &vcpu->kvm->arch.smccc_feat;
503 struct kvm *kvm = vcpu->kvm;
504 struct kvm_smccc_features *smccc_feat = &kvm->arch.smccc_feat;
528 mutex_lock(&kvm->arch.config_lock);
530 if (kvm_vm_has_ran_once(kvm) && val != *fw_reg_bmap) {
537 mutex_unlock(&kvm->arch.config_lock);
563 vcpu->kvm->arch.psci_version = val;
570 vcpu->kvm->arch.psci_version = val;
632 int kvm_vm_smccc_has_attr(struct kvm *kvm, struct kvm_device_attr *attr)
642 int kvm_vm_smccc_set_attr(struct kvm *kvm, struct kvm_device_attr *attr)
648 return kvm_smccc_set_filter(kvm, uaddr);