Lines Matching refs:vmcb
1198 uint32_t event_inj = ldl_phys(env->vm_vmcb + offsetof(struct vmcb, control.event_inj));
1208 stl_phys(env->vm_vmcb + offsetof(struct vmcb, control.event_inj_err), error_code);
1210 stl_phys(env->vm_vmcb + offsetof(struct vmcb, control.event_inj), event_inj);
1277 uint32_t event_inj = ldl_phys(env->vm_vmcb + offsetof(struct vmcb, control.event_inj));
1278 stl_phys(env->vm_vmcb + offsetof(struct vmcb, control.event_inj), event_inj & ~SVM_EVTINJ_VALID);
4952 stq_phys(env->vm_hsave + offsetof(struct vmcb, save.gdtr.base), env->gdt.base);
4953 stl_phys(env->vm_hsave + offsetof(struct vmcb, save.gdtr.limit), env->gdt.limit);
4955 stq_phys(env->vm_hsave + offsetof(struct vmcb, save.idtr.base), env->idt.base);
4956 stl_phys(env->vm_hsave + offsetof(struct vmcb, save.idtr.limit), env->idt.limit);
4958 stq_phys(env->vm_hsave + offsetof(struct vmcb, save.cr0), env->cr[0]);
4959 stq_phys(env->vm_hsave + offsetof(struct vmcb, save.cr2), env->cr[2]);
4960 stq_phys(env->vm_hsave + offsetof(struct vmcb, save.cr3), env->cr[3]);
4961 stq_phys(env->vm_hsave + offsetof(struct vmcb, save.cr4), env->cr[4]);
4962 stq_phys(env->vm_hsave + offsetof(struct vmcb, save.dr6), env->dr[6]);
4963 stq_phys(env->vm_hsave + offsetof(struct vmcb, save.dr7), env->dr[7]);
4965 stq_phys(env->vm_hsave + offsetof(struct vmcb, save.efer), env->efer);
4966 stq_phys(env->vm_hsave + offsetof(struct vmcb, save.rflags), compute_eflags());
4968 svm_save_seg(env->vm_hsave + offsetof(struct vmcb, save.es),
4970 svm_save_seg(env->vm_hsave + offsetof(struct vmcb, save.cs),
4972 svm_save_seg(env->vm_hsave + offsetof(struct vmcb, save.ss),
4974 svm_save_seg(env->vm_hsave + offsetof(struct vmcb, save.ds),
4977 stq_phys(env->vm_hsave + offsetof(struct vmcb, save.rip),
4979 stq_phys(env->vm_hsave + offsetof(struct vmcb, save.rsp), ESP);
4980 stq_phys(env->vm_hsave + offsetof(struct vmcb, save.rax), EAX);
4983 vmcb in svm mode */
4984 env->intercept = ldq_phys(env->vm_vmcb + offsetof(struct vmcb, control.intercept));
4985 env->intercept_cr_read = lduw_phys(env->vm_vmcb + offsetof(struct vmcb, control.intercept_cr_read));
4986 env->intercept_cr_write = lduw_phys(env->vm_vmcb + offsetof(struct vmcb, control.intercept_cr_write));
4987 env->intercept_dr_read = lduw_phys(env->vm_vmcb + offsetof(struct vmcb, control.intercept_dr_read));
4988 env->intercept_dr_write = lduw_phys(env->vm_vmcb + offsetof(struct vmcb, control.intercept_dr_write));
4989 env->intercept_exceptions = ldl_phys(env->vm_vmcb + offsetof(struct vmcb, control.intercept_exceptions));
4994 env->tsc_offset = ldq_phys(env->vm_vmcb + offsetof(struct vmcb, control.tsc_offset));
4996 env->gdt.base = ldq_phys(env->vm_vmcb + offsetof(struct vmcb, save.gdtr.base));
4997 env->gdt.limit = ldl_phys(env->vm_vmcb + offsetof(struct vmcb, save.gdtr.limit));
4999 env->idt.base = ldq_phys(env->vm_vmcb + offsetof(struct vmcb, save.idtr.base));
5000 env->idt.limit = ldl_phys(env->vm_vmcb + offsetof(struct vmcb, save.idtr.limit));
5003 stq_phys(env->vm_vmcb + offsetof(struct vmcb, control.exit_info_2), 0);
5005 cpu_x86_update_cr0(env, ldq_phys(env->vm_vmcb + offsetof(struct vmcb, save.cr0)));
5006 cpu_x86_update_cr4(env, ldq_phys(env->vm_vmcb + offsetof(struct vmcb, save.cr4)));
5007 cpu_x86_update_cr3(env, ldq_phys(env->vm_vmcb + offsetof(struct vmcb, save.cr3)));
5008 env->cr[2] = ldq_phys(env->vm_vmcb + offsetof(struct vmcb, save.cr2));
5009 int_ctl = ldl_phys(env->vm_vmcb + offsetof(struct vmcb, control.int_ctl));
5019 ldq_phys(env->vm_vmcb + offsetof(struct vmcb, save.efer)));
5021 load_eflags(ldq_phys(env->vm_vmcb + offsetof(struct vmcb, save.rflags)),
5025 svm_load_seg_cache(env->vm_vmcb + offsetof(struct vmcb, save.es),
5027 svm_load_seg_cache(env->vm_vmcb + offsetof(struct vmcb, save.cs),
5029 svm_load_seg_cache(env->vm_vmcb + offsetof(struct vmcb, save.ss),
5031 svm_load_seg_cache(env->vm_vmcb + offsetof(struct vmcb, save.ds),
5034 EIP = ldq_phys(env->vm_vmcb + offsetof(struct vmcb, save.rip));
5036 ESP = ldq_phys(env->vm_vmcb + offsetof(struct vmcb, save.rsp));
5037 EAX = ldq_phys(env->vm_vmcb + offsetof(struct vmcb, save.rax));
5038 env->dr[7] = ldq_phys(env->vm_vmcb + offsetof(struct vmcb, save.dr7));
5039 env->dr[6] = ldq_phys(env->vm_vmcb + offsetof(struct vmcb, save.dr6));
5040 cpu_x86_set_cpl(env, ldub_phys(env->vm_vmcb + offsetof(struct vmcb, save.cpl)));
5044 switch(ldub_phys(env->vm_vmcb + offsetof(struct vmcb, control.tlb_ctl))) {
5060 event_inj = ldl_phys(env->vm_vmcb + offsetof(struct vmcb, control.event_inj));
5064 uint32_t event_inj_err = ldl_phys(env->vm_vmcb + offsetof(struct vmcb, control.event_inj_err));
5124 addr, ldq_phys(addr + offsetof(struct vmcb, save.fs.base)),
5127 svm_load_seg_cache(addr + offsetof(struct vmcb, save.fs),
5129 svm_load_seg_cache(addr + offsetof(struct vmcb, save.gs),
5131 svm_load_seg(addr + offsetof(struct vmcb, save.tr),
5133 svm_load_seg(addr + offsetof(struct vmcb, save.ldtr),
5137 env->kernelgsbase = ldq_phys(addr + offsetof(struct vmcb, save.kernel_gs_base));
5138 env->lstar = ldq_phys(addr + offsetof(struct vmcb, save.lstar));
5139 env->cstar = ldq_phys(addr + offsetof(struct vmcb, save.cstar));
5140 env->fmask = ldq_phys(addr + offsetof(struct vmcb, save.sfmask));
5142 env->star = ldq_phys(addr + offsetof(struct vmcb, save.star));
5143 env->sysenter_cs = ldq_phys(addr + offsetof(struct vmcb, save.sysenter_cs));
5144 env->sysenter_esp = ldq_phys(addr + offsetof(struct vmcb, save.sysenter_esp));
5145 env->sysenter_eip = ldq_phys(addr + offsetof(struct vmcb, save.sysenter_eip));
5159 addr, ldq_phys(addr + offsetof(struct vmcb, save.fs.base)),
5162 svm_save_seg(addr + offsetof(struct vmcb, save.fs),
5164 svm_save_seg(addr + offsetof(struct vmcb, save.gs),
5166 svm_save_seg(addr + offsetof(struct vmcb, save.tr),
5168 svm_save_seg(addr + offsetof(struct vmcb, save.ldtr),
5172 stq_phys(addr + offsetof(struct vmcb, save.kernel_gs_base), env->kernelgsbase);
5173 stq_phys(addr + offsetof(struct vmcb, save.lstar), env->lstar);
5174 stq_phys(addr + offsetof(struct vmcb, save.cstar), env->cstar);
5175 stq_phys(addr + offsetof(struct vmcb, save.sfmask), env->fmask);
5177 stq_phys(addr + offsetof(struct vmcb, save.star), env->star);
5178 stq_phys(addr + offsetof(struct vmcb, save.sysenter_cs), env->sysenter_cs);
5179 stq_phys(addr + offsetof(struct vmcb, save.sysenter_esp), env->sysenter_esp);
5180 stq_phys(addr + offsetof(struct vmcb, save.sysenter_eip), env->sysenter_eip);
5250 uint64_t addr = ldq_phys(env->vm_vmcb + offsetof(struct vmcb, control.msrpm_base_pa));
5290 uint64_t addr = ldq_phys(env->vm_vmcb + offsetof(struct vmcb, control.iopm_base_pa));
5294 stq_phys(env->vm_vmcb + offsetof(struct vmcb, control.exit_info_2),
5308 ldq_phys(env->vm_vmcb + offsetof(struct vmcb, control.exit_info_2)),
5312 stl_phys(env->vm_vmcb + offsetof(struct vmcb, control.int_state), SVM_INTERRUPT_SHADOW_MASK);
5315 stl_phys(env->vm_vmcb + offsetof(struct vmcb, control.int_state), 0);
5318 /* Save the VM state in the vmcb */
5319 svm_save_seg(env->vm_vmcb + offsetof(struct vmcb, save.es),
5321 svm_save_seg(env->vm_vmcb + offsetof(struct vmcb, save.cs),
5323 svm_save_seg(env->vm_vmcb + offsetof(struct vmcb, save.ss),
5325 svm_save_seg(env->vm_vmcb + offsetof(struct vmcb, save.ds),
5328 stq_phys(env->vm_vmcb + offsetof(struct vmcb, save.gdtr.base), env->gdt.base);
5329 stl_phys(env->vm_vmcb + offsetof(struct vmcb, save.gdtr.limit), env->gdt.limit);
5331 stq_phys(env->vm_vmcb + offsetof(struct vmcb, save.idtr.base), env->idt.base);
5332 stl_phys(env->vm_vmcb + offsetof(struct vmcb, save.idtr.limit), env->idt.limit);
5334 stq_phys(env->vm_vmcb + offsetof(struct vmcb, save.efer), env->efer);
5335 stq_phys(env->vm_vmcb + offsetof(struct vmcb, save.cr0), env->cr[0]);
5336 stq_phys(env->vm_vmcb + offsetof(struct vmcb, save.cr2), env->cr[2]);
5337 stq_phys(env->vm_vmcb + offsetof(struct vmcb, save.cr3), env->cr[3]);
5338 stq_phys(env->vm_vmcb + offsetof(struct vmcb, save.cr4), env->cr[4]);
5340 int_ctl = ldl_phys(env->vm_vmcb + offsetof(struct vmcb, control.int_ctl));
5345 stl_phys(env->vm_vmcb + offsetof(struct vmcb, control.int_ctl), int_ctl);
5347 stq_phys(env->vm_vmcb + offsetof(struct vmcb, save.rflags), compute_eflags());
5348 stq_phys(env->vm_vmcb + offsetof(struct vmcb, save.rip), env->eip);
5349 stq_phys(env->vm_vmcb + offsetof(struct vmcb, save.rsp), ESP);
5350 stq_phys(env->vm_vmcb + offsetof(struct vmcb, save.rax), EAX);
5351 stq_phys(env->vm_vmcb + offsetof(struct vmcb, save.dr7), env->dr[7]);
5352 stq_phys(env->vm_vmcb + offsetof(struct vmcb, save.dr6), env->dr[6]);
5353 stb_phys(env->vm_vmcb + offsetof(struct vmcb, save.cpl), env->hflags & HF_CPL_MASK);
5363 env->gdt.base = ldq_phys(env->vm_hsave + offsetof(struct vmcb, save.gdtr.base));
5364 env->gdt.limit = ldl_phys(env->vm_hsave + offsetof(struct vmcb, save.gdtr.limit));
5366 env->idt.base = ldq_phys(env->vm_hsave + offsetof(struct vmcb, save.idtr.base));
5367 env->idt.limit = ldl_phys(env->vm_hsave + offsetof(struct vmcb, save.idtr.limit));
5369 cpu_x86_update_cr0(env, ldq_phys(env->vm_hsave + offsetof(struct vmcb, save.cr0)) | CR0_PE_MASK);
5370 cpu_x86_update_cr4(env, ldq_phys(env->vm_hsave + offsetof(struct vmcb, save.cr4)));
5371 cpu_x86_update_cr3(env, ldq_phys(env->vm_hsave + offsetof(struct vmcb, save.cr3)));
5375 ldq_phys(env->vm_hsave + offsetof(struct vmcb, save.efer)));
5377 load_eflags(ldq_phys(env->vm_hsave + offsetof(struct vmcb, save.rflags)),
5381 svm_load_seg_cache(env->vm_hsave + offsetof(struct vmcb, save.es),
5383 svm_load_seg_cache(env->vm_hsave + offsetof(struct vmcb, save.cs),
5385 svm_load_seg_cache(env->vm_hsave + offsetof(struct vmcb, save.ss),
5387 svm_load_seg_cache(env->vm_hsave + offsetof(struct vmcb, save.ds),
5390 EIP = ldq_phys(env->vm_hsave + offsetof(struct vmcb, save.rip));
5391 ESP = ldq_phys(env->vm_hsave + offsetof(struct vmcb, save.rsp));
5392 EAX = ldq_phys(env->vm_hsave + offsetof(struct vmcb, save.rax));
5394 env->dr[6] = ldq_phys(env->vm_hsave + offsetof(struct vmcb, save.dr6));
5395 env->dr[7] = ldq_phys(env->vm_hsave + offsetof(struct vmcb, save.dr7));
5399 stq_phys(env->vm_vmcb + offsetof(struct vmcb, control.exit_code), exit_code);
5400 stq_phys(env->vm_vmcb + offsetof(struct vmcb, control.exit_info_1), exit_info_1);
5402 stl_phys(env->vm_vmcb + offsetof(struct vmcb, control.exit_int_info),
5403 ldl_phys(env->vm_vmcb + offsetof(struct vmcb, control.event_inj)));
5404 stl_phys(env->vm_vmcb + offsetof(struct vmcb, control.exit_int_info_err),
5405 ldl_phys(env->vm_vmcb + offsetof(struct vmcb, control.event_inj_err)));