Lines Matching +full:ipa +full:- +full:shared
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
128 return -EINVAL; in kvm_vcpu_enable_sve()
132 return -EINVAL; in kvm_vcpu_enable_sve()
134 vcpu->arch.sve_max_vl = kvm_sve_max_vl; in kvm_vcpu_enable_sve()
141 vcpu->arch.flags |= KVM_ARM64_GUEST_HAS_SVE; in kvm_vcpu_enable_sve()
148 * vcpu->arch.sve_state as necessary.
155 vl = vcpu->arch.sve_max_vl; in kvm_vcpu_finalize_sve()
158 * Responsibility for these properties is shared between in kvm_vcpu_finalize_sve()
160 * set_sve_vls(). Double-check here just to be sure: in kvm_vcpu_finalize_sve()
164 return -EIO; in kvm_vcpu_finalize_sve()
168 return -ENOMEM; in kvm_vcpu_finalize_sve()
170 vcpu->arch.sve_state = buf; in kvm_vcpu_finalize_sve()
171 vcpu->arch.flags |= KVM_ARM64_VCPU_SVE_FINALIZED; in kvm_vcpu_finalize_sve()
180 return -EINVAL; in kvm_arm_vcpu_finalize()
183 return -EPERM; in kvm_arm_vcpu_finalize()
188 return -EINVAL; in kvm_arm_vcpu_finalize()
201 kfree(vcpu->arch.sve_state); in kvm_arm_vcpu_destroy()
207 memset(vcpu->arch.sve_state, 0, vcpu_sve_state_size(vcpu)); in kvm_vcpu_reset_sve()
217 if (!test_bit(KVM_ARM_VCPU_PTRAUTH_ADDRESS, vcpu->arch.features) || in kvm_vcpu_enable_ptrauth()
218 !test_bit(KVM_ARM_VCPU_PTRAUTH_GENERIC, vcpu->arch.features) || in kvm_vcpu_enable_ptrauth()
220 return -EINVAL; in kvm_vcpu_enable_ptrauth()
222 vcpu->arch.flags |= KVM_ARM64_GUEST_HAS_PTRAUTH; in kvm_vcpu_enable_ptrauth()
227 * kvm_reset_vcpu - sets core registers and sys_regs to reset value
239 * on the memory-backed values of system registers, we want to do a full put if
251 /* Reset PMU outside of the non-preemptible section */ in kvm_reset_vcpu()
255 loaded = (vcpu->cpu != -1); in kvm_reset_vcpu()
260 if (test_bit(KVM_ARM_VCPU_SVE, vcpu->arch.features)) { in kvm_reset_vcpu()
269 if (test_bit(KVM_ARM_VCPU_PTRAUTH_ADDRESS, vcpu->arch.features) || in kvm_reset_vcpu()
270 test_bit(KVM_ARM_VCPU_PTRAUTH_GENERIC, vcpu->arch.features)) { in kvm_reset_vcpu()
272 ret = -EINVAL; in kvm_reset_vcpu()
277 switch (vcpu->arch.target) { in kvm_reset_vcpu()
279 if (test_bit(KVM_ARM_VCPU_EL1_32BIT, vcpu->arch.features)) { in kvm_reset_vcpu()
281 ret = -EINVAL; in kvm_reset_vcpu()
294 vcpu_gp_regs(vcpu)->pstate = pstate; in kvm_reset_vcpu()
303 if (vcpu->arch.reset_state.reset) { in kvm_reset_vcpu()
304 unsigned long target_pc = vcpu->arch.reset_state.pc; in kvm_reset_vcpu()
313 if (vcpu->arch.reset_state.be) in kvm_reset_vcpu()
317 vcpu_set_reg(vcpu, 0, vcpu->arch.reset_state.r0); in kvm_reset_vcpu()
319 vcpu->arch.reset_state.reset = false; in kvm_reset_vcpu()
346 * Check with ARMv8.5-GTG that our PAGE_SIZE is supported at in kvm_set_ipa_limit()
347 * Stage-2. If not, things will stop very quickly. in kvm_set_ipa_limit()
365 kvm_err("PAGE_SIZE not supported at Stage-2, giving up\n"); in kvm_set_ipa_limit()
366 return -EINVAL; in kvm_set_ipa_limit()
368 kvm_debug("PAGE_SIZE supported at Stage-2 (default)\n"); in kvm_set_ipa_limit()
371 kvm_debug("PAGE_SIZE supported at Stage-2 (advertised)\n"); in kvm_set_ipa_limit()
377 "KVM IPA Size Limit (%d bits) is smaller than default size\n", in kvm_set_ipa_limit()
379 kvm_info("IPA Size Limit: %d bits\n", kvm_ipa_limit); in kvm_set_ipa_limit()
399 return -EINVAL; in kvm_arm_setup_stage2()
405 return -EINVAL; in kvm_arm_setup_stage2()
438 kvm->arch.vtcr = vtcr; in kvm_arm_setup_stage2()