Lines Matching refs:vmsa

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