Lines Matching +full:architecturally +full:- +full:defined
1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (C) 2012,2013 - ARM Ltd
7 * Copyright (C) 2012 - Virtual Open Systems and Columbia University
75 return -EINVAL; in kvm_vcpu_enable_sve()
77 vcpu->arch.sve_max_vl = kvm_sve_max_vl; in kvm_vcpu_enable_sve()
91 * vcpu->arch.sve_state as necessary.
100 vl = vcpu->arch.sve_max_vl; in kvm_vcpu_finalize_sve()
105 * set_sve_vls(). Double-check here just to be sure: in kvm_vcpu_finalize_sve()
109 return -EIO; in kvm_vcpu_finalize_sve()
114 return -ENOMEM; in kvm_vcpu_finalize_sve()
122 vcpu->arch.sve_state = buf; in kvm_vcpu_finalize_sve()
132 return -EINVAL; in kvm_arm_vcpu_finalize()
135 return -EPERM; in kvm_arm_vcpu_finalize()
140 return -EINVAL; in kvm_arm_vcpu_finalize()
153 void *sve_state = vcpu->arch.sve_state; in kvm_arm_vcpu_destroy()
165 memset(vcpu->arch.sve_state, 0, vcpu_sve_state_size(vcpu)); in kvm_vcpu_reset_sve()
175 if (!test_bit(KVM_ARM_VCPU_PTRAUTH_ADDRESS, vcpu->arch.features) || in kvm_vcpu_enable_ptrauth()
176 !test_bit(KVM_ARM_VCPU_PTRAUTH_GENERIC, vcpu->arch.features) || in kvm_vcpu_enable_ptrauth()
178 return -EINVAL; in kvm_vcpu_enable_ptrauth()
185 * kvm_set_vm_width() - set the register width for the guest
198 struct kvm *kvm = vcpu->kvm; in kvm_set_vm_width()
203 lockdep_assert_held(&kvm->lock); in kvm_set_vm_width()
205 if (test_bit(KVM_ARCH_FLAG_REG_WIDTH_CONFIGURED, &kvm->arch.flags)) { in kvm_set_vm_width()
210 if (is32bit == test_bit(KVM_ARCH_FLAG_EL1_32BIT, &kvm->arch.flags)) in kvm_set_vm_width()
213 return -EINVAL; in kvm_set_vm_width()
217 return -EINVAL; in kvm_set_vm_width()
221 return -EINVAL; in kvm_set_vm_width()
224 set_bit(KVM_ARCH_FLAG_EL1_32BIT, &kvm->arch.flags); in kvm_set_vm_width()
226 set_bit(KVM_ARCH_FLAG_REG_WIDTH_CONFIGURED, &kvm->arch.flags); in kvm_set_vm_width()
232 * kvm_reset_vcpu - sets core registers and sys_regs to reset value
236 * architecturally defined reset values, except for registers whose reset is
243 * on the memory-backed values of system registers, we want to do a full put if
256 mutex_lock(&vcpu->kvm->lock); in kvm_reset_vcpu()
259 reset_state = vcpu->arch.reset_state; in kvm_reset_vcpu()
260 WRITE_ONCE(vcpu->arch.reset_state.reset, false); in kvm_reset_vcpu()
262 mutex_unlock(&vcpu->kvm->lock); in kvm_reset_vcpu()
267 /* Reset PMU outside of the non-preemptible section */ in kvm_reset_vcpu()
271 loaded = (vcpu->cpu != -1); in kvm_reset_vcpu()
276 if (test_bit(KVM_ARM_VCPU_SVE, vcpu->arch.features)) { in kvm_reset_vcpu()
285 if (test_bit(KVM_ARM_VCPU_PTRAUTH_ADDRESS, vcpu->arch.features) || in kvm_reset_vcpu()
286 test_bit(KVM_ARM_VCPU_PTRAUTH_GENERIC, vcpu->arch.features)) { in kvm_reset_vcpu()
288 ret = -EINVAL; in kvm_reset_vcpu()
293 switch (vcpu->arch.target) { in kvm_reset_vcpu()
302 ret = -EINVAL; in kvm_reset_vcpu()
310 memset(&vcpu->arch.ctxt.fp_regs, 0, sizeof(vcpu->arch.ctxt.fp_regs)); in kvm_reset_vcpu()
311 vcpu->arch.ctxt.spsr_abt = 0; in kvm_reset_vcpu()
312 vcpu->arch.ctxt.spsr_und = 0; in kvm_reset_vcpu()
313 vcpu->arch.ctxt.spsr_irq = 0; in kvm_reset_vcpu()
314 vcpu->arch.ctxt.spsr_fiq = 0; in kvm_reset_vcpu()
315 vcpu_gp_regs(vcpu)->pstate = pstate; in kvm_reset_vcpu()
373 * Check with ARMv8.5-GTG that our PAGE_SIZE is supported at in kvm_set_ipa_limit()
374 * Stage-2. If not, things will stop very quickly. in kvm_set_ipa_limit()
378 kvm_err("PAGE_SIZE not supported at Stage-2, giving up\n"); in kvm_set_ipa_limit()
379 return -EINVAL; in kvm_set_ipa_limit()
381 kvm_debug("PAGE_SIZE supported at Stage-2 (default)\n"); in kvm_set_ipa_limit()
384 kvm_debug("PAGE_SIZE supported at Stage-2 (advertised)\n"); in kvm_set_ipa_limit()
388 return -EINVAL; in kvm_set_ipa_limit()
405 return -EINVAL; in kvm_arm_setup_stage2()
411 return -EINVAL; in kvm_arm_setup_stage2()
416 current->comm); in kvm_arm_setup_stage2()
417 return -EINVAL; in kvm_arm_setup_stage2()
423 kvm->arch.vtcr = kvm_get_vtcr(mmfr0, mmfr1, phys_shift); in kvm_arm_setup_stage2()