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
75 return -EINVAL; in kvm_vcpu_enable_sve()
77 vcpu->arch.sve_max_vl = kvm_sve_max_vl; in kvm_vcpu_enable_sve()
84 vcpu->arch.flags |= KVM_ARM64_GUEST_HAS_SVE; in kvm_vcpu_enable_sve()
91 * vcpu->arch.sve_state as necessary.
98 vl = vcpu->arch.sve_max_vl; in kvm_vcpu_finalize_sve()
101 * Responsibility for these properties is shared between in kvm_vcpu_finalize_sve()
103 * set_sve_vls(). Double-check here just to be sure: in kvm_vcpu_finalize_sve()
107 return -EIO; in kvm_vcpu_finalize_sve()
111 return -ENOMEM; in kvm_vcpu_finalize_sve()
113 vcpu->arch.sve_state = buf; in kvm_vcpu_finalize_sve()
114 vcpu->arch.flags |= KVM_ARM64_VCPU_SVE_FINALIZED; in kvm_vcpu_finalize_sve()
123 return -EINVAL; in kvm_arm_vcpu_finalize()
126 return -EPERM; in kvm_arm_vcpu_finalize()
131 return -EINVAL; in kvm_arm_vcpu_finalize()
144 kfree(vcpu->arch.sve_state); in kvm_arm_vcpu_destroy()
150 memset(vcpu->arch.sve_state, 0, vcpu_sve_state_size(vcpu)); in kvm_vcpu_reset_sve()
160 if (!test_bit(KVM_ARM_VCPU_PTRAUTH_ADDRESS, vcpu->arch.features) || in kvm_vcpu_enable_ptrauth()
161 !test_bit(KVM_ARM_VCPU_PTRAUTH_GENERIC, vcpu->arch.features) || in kvm_vcpu_enable_ptrauth()
163 return -EINVAL; in kvm_vcpu_enable_ptrauth()
165 vcpu->arch.flags |= KVM_ARM64_GUEST_HAS_PTRAUTH; in kvm_vcpu_enable_ptrauth()
180 kvm_for_each_vcpu(i, tmp, vcpu->kvm) { in vcpu_allowed_register_width()
189 * kvm_reset_vcpu - sets core registers and sys_regs to reset value
201 * on the memory-backed values of system registers, we want to do a full put if
214 mutex_lock(&vcpu->kvm->lock); in kvm_reset_vcpu()
215 reset_state = vcpu->arch.reset_state; in kvm_reset_vcpu()
216 WRITE_ONCE(vcpu->arch.reset_state.reset, false); in kvm_reset_vcpu()
217 mutex_unlock(&vcpu->kvm->lock); in kvm_reset_vcpu()
219 /* Reset PMU outside of the non-preemptible section */ in kvm_reset_vcpu()
223 loaded = (vcpu->cpu != -1); in kvm_reset_vcpu()
228 if (test_bit(KVM_ARM_VCPU_SVE, vcpu->arch.features)) { in kvm_reset_vcpu()
237 if (test_bit(KVM_ARM_VCPU_PTRAUTH_ADDRESS, vcpu->arch.features) || in kvm_reset_vcpu()
238 test_bit(KVM_ARM_VCPU_PTRAUTH_GENERIC, vcpu->arch.features)) { in kvm_reset_vcpu()
240 ret = -EINVAL; in kvm_reset_vcpu()
246 ret = -EINVAL; in kvm_reset_vcpu()
250 switch (vcpu->arch.target) { in kvm_reset_vcpu()
252 if (test_bit(KVM_ARM_VCPU_EL1_32BIT, vcpu->arch.features)) { in kvm_reset_vcpu()
259 ret = -EINVAL; in kvm_reset_vcpu()
267 memset(&vcpu->arch.ctxt.fp_regs, 0, sizeof(vcpu->arch.ctxt.fp_regs)); in kvm_reset_vcpu()
268 vcpu->arch.ctxt.spsr_abt = 0; in kvm_reset_vcpu()
269 vcpu->arch.ctxt.spsr_und = 0; in kvm_reset_vcpu()
270 vcpu->arch.ctxt.spsr_irq = 0; in kvm_reset_vcpu()
271 vcpu->arch.ctxt.spsr_fiq = 0; in kvm_reset_vcpu()
272 vcpu_gp_regs(vcpu)->pstate = pstate; in kvm_reset_vcpu()
321 * IPA size beyond 48 bits could not be supported in kvm_set_ipa_limit()
330 * Check with ARMv8.5-GTG that our PAGE_SIZE is supported at in kvm_set_ipa_limit()
331 * Stage-2. If not, things will stop very quickly. in kvm_set_ipa_limit()
348 kvm_err("PAGE_SIZE not supported at Stage-2, giving up\n"); in kvm_set_ipa_limit()
349 return -EINVAL; in kvm_set_ipa_limit()
351 kvm_debug("PAGE_SIZE supported at Stage-2 (default)\n"); in kvm_set_ipa_limit()
354 kvm_debug("PAGE_SIZE supported at Stage-2 (advertised)\n"); in kvm_set_ipa_limit()
358 return -EINVAL; in kvm_set_ipa_limit()
362 kvm_info("IPA Size Limit: %d bits%s\n", kvm_ipa_limit, in kvm_set_ipa_limit()
364 " (Reduced IPA size, limited VM/VMM compatibility)" : "")); in kvm_set_ipa_limit()
375 return -EINVAL; in kvm_arm_setup_stage2()
381 return -EINVAL; in kvm_arm_setup_stage2()
385 pr_warn_once("%s using unsupported default IPA limit, upgrade your VMM\n", in kvm_arm_setup_stage2()
386 current->comm); in kvm_arm_setup_stage2()
387 return -EINVAL; in kvm_arm_setup_stage2()
393 kvm->arch.vtcr = kvm_get_vtcr(mmfr0, mmfr1, phys_shift); in kvm_arm_setup_stage2()