Lines Matching refs:vgc

220 mp_set_cpu_context(vcpu_guest_context_t *vgc, cpu_t *cp)
224 vgc->flags = VGCF_IN_KERNEL;
232 vgc->user_regs.cs = KCS_SEL | SEL_KPL; /* force to ring 3 */
234 vgc->user_regs.cs = KCS_SEL;
236 vgc->user_regs.ds = KDS_SEL;
237 vgc->user_regs.es = KDS_SEL;
238 vgc->user_regs.ss = KDS_SEL;
239 vgc->kernel_ss = KDS_SEL;
250 vgc->user_regs.fs = 0;
251 vgc->user_regs.gs = 0;
252 vgc->user_regs.rflags = F_OFF | iopl;
254 vgc->user_regs.fs = KFS_SEL;
255 vgc->user_regs.gs = KGS_SEL;
256 vgc->user_regs.eflags = F_OFF | iopl;
257 vgc->event_callback_cs = vgc->user_regs.cs;
258 vgc->failsafe_callback_cs = vgc->user_regs.cs;
265 ASSERT(NIDT == sizeof (vgc->trap_ctxt) / sizeof (vgc->trap_ctxt[0]));
268 trap_info_t *ti = &vgc->trap_ctxt[vec];
286 vgc->gdt_frames[0] = pa_to_ma(mmu_btop(cp->cpu_m.mcpu_gdtpa));
288 vgc->gdt_frames[0] = pfn_to_mfn(mmu_btop(cp->cpu_m.mcpu_gdtpa));
290 vgc->gdt_ents = NGDT;
292 vgc->ctrlreg[0] = CR0_ENABLE_FPU_FLAGS(getcr0());
296 vgc->ctrlreg[3] =
300 vgc->ctrlreg[3] =
303 vgc->ctrlreg[4] = getcr4();
305 vgc->event_callback_eip = (uintptr_t)xen_callback;
306 vgc->failsafe_callback_eip = (uintptr_t)xen_failsafe_callback;
307 vgc->flags |= VGCF_failsafe_disables_events;
313 vgc->syscall_callback_eip = (uintptr_t)sys_syscall;
314 vgc->flags |= VGCF_syscall_disables_events;
316 ASSERT(vgc->user_regs.gs == 0);
317 vgc->gs_base_kernel = (uintptr_t)cp;
320 return (xen_vcpu_initialize(cp->cpu_id, vgc));
338 vcpu_guest_context_t vgc;
366 bzero(&vgc, sizeof (vgc));
369 vgc.user_regs.rip = tp->t_pc;
370 vgc.user_regs.rsp = tp->t_sp;
371 vgc.user_regs.rbp = tp->t_sp - 2 * sizeof (greg_t);
373 vgc.user_regs.eip = tp->t_pc;
374 vgc.user_regs.esp = tp->t_sp;
375 vgc.user_regs.ebp = tp->t_sp - 2 * sizeof (greg_t);
392 vgc.kernel_sp = (ulong_t)tp->t_stk;
394 err = mp_set_cpu_context(&vgc, cp);
446 pcb_to_user_regs(label_t *pcb, vcpu_guest_context_t *vgc)
449 vgc->user_regs.rip = pcb->val[REG_LABEL_PC];
450 vgc->user_regs.rsp = pcb->val[REG_LABEL_SP];
451 vgc->user_regs.rbp = pcb->val[REG_LABEL_BP];
452 vgc->user_regs.rbx = pcb->val[REG_LABEL_RBX];
453 vgc->user_regs.r12 = pcb->val[REG_LABEL_R12];
454 vgc->user_regs.r13 = pcb->val[REG_LABEL_R13];
455 vgc->user_regs.r14 = pcb->val[REG_LABEL_R14];
456 vgc->user_regs.r15 = pcb->val[REG_LABEL_R15];
458 vgc->user_regs.eip = pcb->val[REG_LABEL_PC];
459 vgc->user_regs.esp = pcb->val[REG_LABEL_SP];
460 vgc->user_regs.ebp = pcb->val[REG_LABEL_BP];
461 vgc->user_regs.ebx = pcb->val[REG_LABEL_EBX];
462 vgc->user_regs.esi = pcb->val[REG_LABEL_ESI];
463 vgc->user_regs.edi = pcb->val[REG_LABEL_EDI];
474 vcpu_guest_context_t vgc;
480 bzero(&vgc, sizeof (vgc));
482 pcb_to_user_regs(&cp->cpu_thread->t_pcb, &vgc);
490 vgc.user_regs.rax = 1;
491 vgc.user_regs.rsp += sizeof (ulong_t);
493 vgc.user_regs.eax = 1;
494 vgc.user_regs.esp += sizeof (ulong_t);
497 vgc.kernel_sp = cp->cpu_thread->t_sp;
499 err = mp_set_cpu_context(&vgc, cp);
958 xen_vcpu_initialize(processorid_t id, vcpu_guest_context_t *vgc)
962 if ((err = HYPERVISOR_vcpu_op(VCPUOP_initialise, id, vgc)) != 0) {