Lines Matching defs:vmsa

263 static int snp_set_vmsa(void *va, bool vmsa)
275 if (vmsa)
281 static void snp_cleanup_vmsa(struct sev_es_save_area *vmsa)
285 err = snp_set_vmsa(vmsa, false);
289 free_page((unsigned long)vmsa);
294 struct sev_es_save_area *vmsa = (struct sev_es_save_area *)
302 if (!vmsa)
307 vmsa->gdtr.base = gdtr.address;
308 vmsa->gdtr.limit = gdtr.size;
310 asm volatile("movl %%es, %%eax;" : "=a" (vmsa->es.selector));
311 hv_populate_vmcb_seg(vmsa->es, vmsa->gdtr.base);
313 asm volatile("movl %%cs, %%eax;" : "=a" (vmsa->cs.selector));
314 hv_populate_vmcb_seg(vmsa->cs, vmsa->gdtr.base);
316 asm volatile("movl %%ss, %%eax;" : "=a" (vmsa->ss.selector));
317 hv_populate_vmcb_seg(vmsa->ss, vmsa->gdtr.base);
319 asm volatile("movl %%ds, %%eax;" : "=a" (vmsa->ds.selector));
320 hv_populate_vmcb_seg(vmsa->ds, vmsa->gdtr.base);
322 vmsa->efer = native_read_msr(MSR_EFER);
324 asm volatile("movq %%cr4, %%rax;" : "=a" (vmsa->cr4));
325 asm volatile("movq %%cr3, %%rax;" : "=a" (vmsa->cr3));
326 asm volatile("movq %%cr0, %%rax;" : "=a" (vmsa->cr0));
328 vmsa->xcr0 = 1;
329 vmsa->g_pat = HV_AP_INIT_GPAT_DEFAULT;
330 vmsa->rip = (u64)secondary_startup_64_no_verify;
331 vmsa->rsp = (u64)&ap_start_stack[PAGE_SIZE];
338 vmsa->vmpl = 0;
339 vmsa->sev_features = sev_status >> 2;
341 ret = snp_set_vmsa(vmsa, true);
343 pr_err("RMPADJUST(%llx) failed: %llx\n", (u64)vmsa, ret);
344 free_page((u64)vmsa);
354 *(u64 *)&start_vp_input->vp_context = __pa(vmsa) | 1;
365 snp_cleanup_vmsa(vmsa);
366 vmsa = NULL;
375 per_cpu(hv_sev_vmsa, cpu) = vmsa;