Lines Matching +full:load +full:- +full:reduced
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
82 return -EINVAL; in kvm_vcpu_enable_sve()
84 vcpu->arch.sve_max_vl = kvm_sve_max_vl; in kvm_vcpu_enable_sve()
98 * vcpu->arch.sve_state as necessary.
107 vl = vcpu->arch.sve_max_vl; in kvm_vcpu_finalize_sve()
112 * set_sve_vls(). Double-check here just to be sure: in kvm_vcpu_finalize_sve()
116 return -EIO; in kvm_vcpu_finalize_sve()
121 return -ENOMEM; in kvm_vcpu_finalize_sve()
129 vcpu->arch.sve_state = buf; in kvm_vcpu_finalize_sve()
139 return -EINVAL; in kvm_arm_vcpu_finalize()
142 return -EPERM; in kvm_arm_vcpu_finalize()
147 return -EINVAL; in kvm_arm_vcpu_finalize()
160 void *sve_state = vcpu->arch.sve_state; in kvm_arm_vcpu_destroy()
167 kfree(vcpu->arch.ccsidr); in kvm_arm_vcpu_destroy()
173 memset(vcpu->arch.sve_state, 0, vcpu_sve_state_size(vcpu)); in kvm_vcpu_reset_sve()
183 if (!test_bit(KVM_ARM_VCPU_PTRAUTH_ADDRESS, vcpu->arch.features) || in kvm_vcpu_enable_ptrauth()
184 !test_bit(KVM_ARM_VCPU_PTRAUTH_GENERIC, vcpu->arch.features) || in kvm_vcpu_enable_ptrauth()
186 return -EINVAL; in kvm_vcpu_enable_ptrauth()
193 * kvm_reset_vcpu - sets core registers and sys_regs to reset value
204 * on the memory-backed values of system registers, we want to do a full put if
205 * we were loaded (handling a request) and load the values back at the end of
208 * preempt notifiers which also call put/load.
217 spin_lock(&vcpu->arch.mp_state_lock); in kvm_reset_vcpu()
218 reset_state = vcpu->arch.reset_state; in kvm_reset_vcpu()
219 vcpu->arch.reset_state.reset = false; in kvm_reset_vcpu()
220 spin_unlock(&vcpu->arch.mp_state_lock); in kvm_reset_vcpu()
222 /* Reset PMU outside of the non-preemptible section */ in kvm_reset_vcpu()
226 loaded = (vcpu->cpu != -1); in kvm_reset_vcpu()
232 ret = -EINVAL; in kvm_reset_vcpu()
237 if (test_bit(KVM_ARM_VCPU_SVE, vcpu->arch.features)) { in kvm_reset_vcpu()
246 if (test_bit(KVM_ARM_VCPU_PTRAUTH_ADDRESS, vcpu->arch.features) || in kvm_reset_vcpu()
247 test_bit(KVM_ARM_VCPU_PTRAUTH_GENERIC, vcpu->arch.features)) { in kvm_reset_vcpu()
249 ret = -EINVAL; in kvm_reset_vcpu()
262 ret = -EINVAL; in kvm_reset_vcpu()
268 memset(&vcpu->arch.ctxt.fp_regs, 0, sizeof(vcpu->arch.ctxt.fp_regs)); in kvm_reset_vcpu()
269 vcpu->arch.ctxt.spsr_abt = 0; in kvm_reset_vcpu()
270 vcpu->arch.ctxt.spsr_und = 0; in kvm_reset_vcpu()
271 vcpu->arch.ctxt.spsr_irq = 0; in kvm_reset_vcpu()
272 vcpu->arch.ctxt.spsr_fiq = 0; in kvm_reset_vcpu()
273 vcpu_gp_regs(vcpu)->pstate = pstate; in kvm_reset_vcpu()
331 * Check with ARMv8.5-GTG that our PAGE_SIZE is supported at in kvm_set_ipa_limit()
332 * Stage-2. If not, things will stop very quickly. in kvm_set_ipa_limit()
336 kvm_err("PAGE_SIZE not supported at Stage-2, giving up\n"); in kvm_set_ipa_limit()
337 return -EINVAL; in kvm_set_ipa_limit()
339 kvm_debug("PAGE_SIZE supported at Stage-2 (default)\n"); in kvm_set_ipa_limit()
342 kvm_debug("PAGE_SIZE supported at Stage-2 (advertised)\n"); in kvm_set_ipa_limit()
346 return -EINVAL; in kvm_set_ipa_limit()
352 " (Reduced IPA size, limited VM/VMM compatibility)" : "")); in kvm_set_ipa_limit()