Lines Matching full:vmsa

800 	struct sev_es_save_area *save = svm->sev_es.vmsa;  in sev_es_sync_vmsa()
806 /* Check some debug related fields before encrypting the VMSA */ in sev_es_sync_vmsa()
811 * SEV-ES will use a VMSA that is pointed to by the VMCB, not in sev_es_sync_vmsa()
812 * the traditional VMSA that is part of the VMCB. Copy the in sev_es_sync_vmsa()
813 * traditional VMSA as it has been built so far (in prep in sev_es_sync_vmsa()
885 pr_debug("Virtual Machine Save Area (VMSA):\n"); in sev_es_sync_vmsa()
894 struct sev_data_launch_update_vmsa vmsa; in __sev_launch_update_vmsa() local
903 /* Perform some pre-encryption checks against the VMSA */ in __sev_launch_update_vmsa()
910 * the VMSA memory content (i.e it will write the same memory region in __sev_launch_update_vmsa()
913 clflush_cache_range(svm->sev_es.vmsa, PAGE_SIZE); in __sev_launch_update_vmsa()
915 vmsa.reserved = 0; in __sev_launch_update_vmsa()
916 vmsa.handle = to_kvm_sev_info(kvm)->handle; in __sev_launch_update_vmsa()
917 vmsa.address = __sme_pa(svm->sev_es.vmsa); in __sev_launch_update_vmsa()
918 vmsa.len = PAGE_SIZE; in __sev_launch_update_vmsa()
919 ret = sev_issue_cmd(kvm, SEV_CMD_LAUNCH_UPDATE_VMSA, &vmsa, error); in __sev_launch_update_vmsa()
2014 * Transfer VMSA and GHCB state to the destination. Nullify and in sev_migrate_from()
2427 u64 pfn = __pa(svm->sev_es.vmsa) >> PAGE_SHIFT; in snp_launch_update_vmsa()
2433 /* Transition the VMSA page to a firmware state. */ in snp_launch_update_vmsa()
2438 /* Issue the SNP command to encrypt the VMSA */ in snp_launch_update_vmsa()
2439 data.address = __sme_pa(svm->sev_es.vmsa); in snp_launch_update_vmsa()
3155 * If it's an SNP guest, then the VMSA was marked in the RMP table as in sev_free_vcpu()
3160 u64 pfn = __pa(svm->sev_es.vmsa) >> PAGE_SHIFT; in sev_free_vcpu()
3167 sev_flush_encrypted_page(vcpu, svm->sev_es.vmsa); in sev_free_vcpu()
3169 __free_page(virt_to_page(svm->sev_es.vmsa)); in sev_free_vcpu()
3468 * VMSA, e.g. if userspace forces the vCPU to be RUNNABLE after an SNP in pre_sev_run()
3876 /* Clear use of the VMSA */ in sev_snp_init_protected_guest_state()
3880 * When replacing the VMSA during SEV-SNP AP creation, in sev_snp_init_protected_guest_state()
3896 * The new VMSA will be private memory guest memory, so retrieve the in sev_snp_init_protected_guest_state()
3903 * From this point forward, the VMSA will always be a guest-mapped page in sev_snp_init_protected_guest_state()
3904 * rather than the initial one allocated by KVM in svm->sev_es.vmsa. In in sev_snp_init_protected_guest_state()
3905 * theory, svm->sev_es.vmsa could be free'd and cleaned up here, but in sev_snp_init_protected_guest_state()
3913 /* Use the new VMSA */ in sev_snp_init_protected_guest_state()
3921 * then care should be taken to ensure svm->sev_es.vmsa is pinned in sev_snp_init_protected_guest_state()
3961 vcpu_unimpl(vcpu, "vmgexit: invalid AP VMSA address [%#llx] from guest\n", in sev_snp_ap_creation()
3967 * Malicious guest can RMPADJUST a large page into VMSA which in sev_snp_ap_creation()
3970 * of VMSA page, reject the AP CREATE request if VMSA address from in sev_snp_ap_creation()
3975 "vmgexit: AP VMSA address [%llx] from guest is unsafe as it is 2M aligned\n", in sev_snp_ap_creation()
4464 * An SEV-ES guest requires a VMSA area that is a separate from the in sev_es_init_vmcb()
4465 * VMCB page. Do not include the encryption mask on the VMSA physical in sev_es_init_vmcb()
4467 * the VMSA will be NULL if this vCPU is the destination for intrahost in sev_es_init_vmcb()
4470 if (svm->sev_es.vmsa && !svm->sev_es.snp_has_guest_vmsa) in sev_es_init_vmcb()
4471 svm->vmcb->control.vmsa_pa = __pa(svm->sev_es.vmsa); in sev_es_init_vmcb()
4577 * the guest has actually enabled (or not!) in the VMSA. in sev_es_prepare_switch_to_guest()
4645 * 2MB-aligned VMCB, VMSA, or AVIC backing page. in snp_safe_alloc_page_node()