Lines Matching refs:vmsa
262 static int snp_set_vmsa(void *va, bool vmsa) in snp_set_vmsa() argument
274 if (vmsa) in snp_set_vmsa()
280 static void snp_cleanup_vmsa(struct sev_es_save_area *vmsa) in snp_cleanup_vmsa() argument
284 err = snp_set_vmsa(vmsa, false); in snp_cleanup_vmsa()
288 free_page((unsigned long)vmsa); in snp_cleanup_vmsa()
293 struct sev_es_save_area *vmsa = (struct sev_es_save_area *) in hv_snp_boot_ap() local
301 if (!vmsa) in hv_snp_boot_ap()
306 vmsa->gdtr.base = gdtr.address; in hv_snp_boot_ap()
307 vmsa->gdtr.limit = gdtr.size; in hv_snp_boot_ap()
309 asm volatile("movl %%es, %%eax;" : "=a" (vmsa->es.selector)); in hv_snp_boot_ap()
310 hv_populate_vmcb_seg(vmsa->es, vmsa->gdtr.base); in hv_snp_boot_ap()
312 asm volatile("movl %%cs, %%eax;" : "=a" (vmsa->cs.selector)); in hv_snp_boot_ap()
313 hv_populate_vmcb_seg(vmsa->cs, vmsa->gdtr.base); in hv_snp_boot_ap()
315 asm volatile("movl %%ss, %%eax;" : "=a" (vmsa->ss.selector)); in hv_snp_boot_ap()
316 hv_populate_vmcb_seg(vmsa->ss, vmsa->gdtr.base); in hv_snp_boot_ap()
318 asm volatile("movl %%ds, %%eax;" : "=a" (vmsa->ds.selector)); in hv_snp_boot_ap()
319 hv_populate_vmcb_seg(vmsa->ds, vmsa->gdtr.base); in hv_snp_boot_ap()
321 vmsa->efer = native_read_msr(MSR_EFER); in hv_snp_boot_ap()
323 asm volatile("movq %%cr4, %%rax;" : "=a" (vmsa->cr4)); in hv_snp_boot_ap()
324 asm volatile("movq %%cr3, %%rax;" : "=a" (vmsa->cr3)); in hv_snp_boot_ap()
325 asm volatile("movq %%cr0, %%rax;" : "=a" (vmsa->cr0)); in hv_snp_boot_ap()
327 vmsa->xcr0 = 1; in hv_snp_boot_ap()
328 vmsa->g_pat = HV_AP_INIT_GPAT_DEFAULT; in hv_snp_boot_ap()
329 vmsa->rip = (u64)secondary_startup_64_no_verify; in hv_snp_boot_ap()
330 vmsa->rsp = (u64)&ap_start_stack[PAGE_SIZE]; in hv_snp_boot_ap()
337 vmsa->vmpl = 0; in hv_snp_boot_ap()
338 vmsa->sev_features = sev_status >> 2; in hv_snp_boot_ap()
340 ret = snp_set_vmsa(vmsa, true); in hv_snp_boot_ap()
342 pr_err("RMPADJUST(%llx) failed: %llx\n", (u64)vmsa, ret); in hv_snp_boot_ap()
343 free_page((u64)vmsa); in hv_snp_boot_ap()
353 *(u64 *)&start_vp_input->vp_context = __pa(vmsa) | 1; in hv_snp_boot_ap()
364 snp_cleanup_vmsa(vmsa); in hv_snp_boot_ap()
365 vmsa = NULL; in hv_snp_boot_ap()
374 per_cpu(hv_sev_vmsa, cpu) = vmsa; in hv_snp_boot_ap()