Lines Matching refs:arch
85 &kvm->arch.flags); in kvm_vm_ioctl_enable_cap()
93 set_bit(KVM_ARCH_FLAG_MTE_ENABLED, &kvm->arch.flags); in kvm_vm_ioctl_enable_cap()
99 set_bit(KVM_ARCH_FLAG_SYSTEM_SUSPEND_ENABLED, &kvm->arch.flags); in kvm_vm_ioctl_enable_cap()
115 kvm->arch.mmu.split_page_chunk_size = new_cap; in kvm_vm_ioctl_enable_cap()
140 mutex_init(&kvm->arch.config_lock); in kvm_arch_init_vm()
145 mutex_lock(&kvm->arch.config_lock); in kvm_arch_init_vm()
146 mutex_unlock(&kvm->arch.config_lock); in kvm_arch_init_vm()
158 if (!zalloc_cpumask_var(&kvm->arch.supported_cpus, GFP_KERNEL_ACCOUNT)) { in kvm_arch_init_vm()
162 cpumask_copy(kvm->arch.supported_cpus, cpu_possible_mask); in kvm_arch_init_vm()
164 ret = kvm_init_stage2_mmu(kvm, &kvm->arch.mmu, type); in kvm_arch_init_vm()
177 bitmap_zero(kvm->arch.vcpu_features, KVM_VCPU_MAX_FEATURES); in kvm_arch_init_vm()
182 free_cpumask_var(kvm->arch.supported_cpus); in kvm_arch_init_vm()
200 bitmap_free(kvm->arch.pmu_filter); in kvm_arch_destroy_vm()
201 free_cpumask_var(kvm->arch.supported_cpus); in kvm_arch_destroy_vm()
271 r = kvm->arch.vgic.msis_require_devid; in kvm_vm_ioctl_check_extension()
313 r = kvm->arch.mmu.split_page_chunk_size; in kvm_vm_ioctl_check_extension()
358 spin_lock_init(&vcpu->arch.mp_state_lock); in kvm_arch_vcpu_create()
363 mutex_lock(&vcpu->kvm->arch.config_lock); in kvm_arch_vcpu_create()
364 mutex_unlock(&vcpu->kvm->arch.config_lock); in kvm_arch_vcpu_create()
370 bitmap_zero(vcpu->arch.features, KVM_VCPU_MAX_FEATURES); in kvm_arch_vcpu_create()
372 vcpu->arch.mmu_page_cache.gfp_zero = __GFP_ZERO; in kvm_arch_vcpu_create()
378 vcpu->arch.fp_state = FP_STATE_FREE; in kvm_arch_vcpu_create()
387 kvm_arm_pvtime_vcpu_init(&vcpu->arch); in kvm_arch_vcpu_create()
389 vcpu->arch.hw_mmu = &vcpu->kvm->arch.mmu; in kvm_arch_vcpu_create()
407 kvm_mmu_free_memory_cache(&vcpu->arch.mmu_page_cache); in kvm_arch_vcpu_destroy()
429 mmu = vcpu->arch.hw_mmu; in kvm_arch_vcpu_load()
454 if (kvm_arm_is_pvtime_enabled(&vcpu->arch)) in kvm_arch_vcpu_load()
466 if (!cpumask_test_cpu(cpu, vcpu->kvm->arch.supported_cpus)) in kvm_arch_vcpu_load()
487 WRITE_ONCE(vcpu->arch.mp_state.mp_state, KVM_MP_STATE_STOPPED); in __kvm_arm_vcpu_power_off()
494 spin_lock(&vcpu->arch.mp_state_lock); in kvm_arm_vcpu_power_off()
496 spin_unlock(&vcpu->arch.mp_state_lock); in kvm_arm_vcpu_power_off()
501 return READ_ONCE(vcpu->arch.mp_state.mp_state) == KVM_MP_STATE_STOPPED; in kvm_arm_vcpu_stopped()
506 WRITE_ONCE(vcpu->arch.mp_state.mp_state, KVM_MP_STATE_SUSPENDED); in kvm_arm_vcpu_suspend()
513 return READ_ONCE(vcpu->arch.mp_state.mp_state) == KVM_MP_STATE_SUSPENDED; in kvm_arm_vcpu_suspended()
519 *mp_state = READ_ONCE(vcpu->arch.mp_state); in kvm_arch_vcpu_ioctl_get_mpstate()
529 spin_lock(&vcpu->arch.mp_state_lock); in kvm_arch_vcpu_ioctl_set_mpstate()
533 WRITE_ONCE(vcpu->arch.mp_state, *mp_state); in kvm_arch_vcpu_ioctl_set_mpstate()
545 spin_unlock(&vcpu->arch.mp_state_lock); in kvm_arch_vcpu_ioctl_set_mpstate()
561 && !kvm_arm_vcpu_stopped(v) && !v->arch.pause); in kvm_arch_vcpu_runnable()
646 mutex_lock(&kvm->arch.config_lock); in kvm_arch_vcpu_run_pid_change()
647 set_bit(KVM_ARCH_FLAG_HAS_RAN_ONCE, &kvm->arch.flags); in kvm_arch_vcpu_run_pid_change()
648 mutex_unlock(&kvm->arch.config_lock); in kvm_arch_vcpu_run_pid_change()
664 vcpu->arch.pause = true; in kvm_arm_halt_guest()
674 vcpu->arch.pause = false; in kvm_arm_resume_guest()
684 (!kvm_arm_vcpu_stopped(vcpu)) && (!vcpu->arch.pause), in kvm_vcpu_sleep()
687 if (kvm_arm_vcpu_stopped(vcpu) || vcpu->arch.pause) { in kvm_vcpu_sleep()
953 kvm_arm_vmid_update(&vcpu->arch.hw_mmu->vmid); in kvm_arch_vcpu_ioctl_run()
1229 return !bitmap_equal(vcpu->arch.features, &features, KVM_VCPU_MAX_FEATURES); in kvm_vcpu_init_changed()
1239 mutex_lock(&kvm->arch.config_lock); in __kvm_vcpu_set_target()
1241 if (test_bit(KVM_ARCH_FLAG_VCPU_FEATURES_CONFIGURED, &kvm->arch.flags) && in __kvm_vcpu_set_target()
1242 !bitmap_equal(kvm->arch.vcpu_features, &features, KVM_VCPU_MAX_FEATURES)) in __kvm_vcpu_set_target()
1245 bitmap_copy(vcpu->arch.features, &features, KVM_VCPU_MAX_FEATURES); in __kvm_vcpu_set_target()
1250 bitmap_zero(vcpu->arch.features, KVM_VCPU_MAX_FEATURES); in __kvm_vcpu_set_target()
1254 bitmap_copy(kvm->arch.vcpu_features, &features, KVM_VCPU_MAX_FEATURES); in __kvm_vcpu_set_target()
1255 set_bit(KVM_ARCH_FLAG_VCPU_FEATURES_CONFIGURED, &kvm->arch.flags); in __kvm_vcpu_set_target()
1258 mutex_unlock(&kvm->arch.config_lock); in __kvm_vcpu_set_target()
1321 vcpu->arch.cptr_el2 = kvm_get_reset_cptr_el2(vcpu); in kvm_arch_vcpu_ioctl_vcpu_init()
1326 spin_lock(&vcpu->arch.mp_state_lock); in kvm_arch_vcpu_ioctl_vcpu_init()
1331 WRITE_ONCE(vcpu->arch.mp_state.mp_state, KVM_MP_STATE_RUNNABLE); in kvm_arch_vcpu_ioctl_vcpu_init()
1333 spin_unlock(&vcpu->arch.mp_state_lock); in kvm_arch_vcpu_ioctl_vcpu_init()