/xen-4.10.0-shim-comet/tools/fuzz/x86_instruction_emulator/ |
A D | fuzz-emul.c | 162 struct x86_emulate_ctxt *ctxt) in fuzz_read() argument 185 struct x86_emulate_ctxt *ctxt) in fuzz_read_io() argument 195 struct x86_emulate_ctxt *ctxt) in fuzz_insn_fetch() argument 609 printf("addr / sp size: %d / %d\n", ctxt->addr_size, ctxt->sp_size); in dump_state() 643 ctxt->lma = long_mode_active(ctxt); in set_sizes() 645 if ( in_longmode(ctxt) ) in set_sizes() 646 ctxt->addr_size = ctxt->sp_size = 64; in set_sizes() 842 sanitize_input(&ctxt); in LLVMFuzzerTestOneInput() 844 disable_hooks(&ctxt); in LLVMFuzzerTestOneInput() 850 set_sizes(&ctxt); in LLVMFuzzerTestOneInput() [all …]
|
/xen-4.10.0-shim-comet/xen/arch/x86/x86_emulate/ |
A D | x86_emulate.h | 590 struct x86_emulate_ctxt *ctxt, 599 struct x86_emulate_ctxt *ctxt, 620 struct x86_emulate_ctxt *ctxt); 626 struct x86_emulate_ctxt *ctxt, 670 ASSERT(!ctxt->event_pending); in x86_emul_hw_exception() 672 ctxt->event.vector = vector; in x86_emul_hw_exception() 676 ctxt->event_pending = true; in x86_emul_hw_exception() 682 ASSERT(!ctxt->event_pending); in x86_emul_pagefault() 687 ctxt->event.cr2 = cr2; in x86_emul_pagefault() 689 ctxt->event_pending = true; in x86_emul_pagefault() [all …]
|
A D | x86_emulate.c | 1549 return !(in_realmode(ctxt, ops) || (ctxt->regs->eflags & X86_EFLAGS_VM)); in in_protmode() 2081 switch ( ctxt->opcode ) in x86_decode_onebyte() 2400 ctxt->retire.raw = 0; in x86_decode() 2866 ctxt->opcode = opcode; in x86_decode() 3028 b = ctxt->opcode; in x86_emulate() 3209 switch ( ctxt->opcode ) in x86_emulate() 4029 ctxt->event.insn_len = _regs.r(ip) - ctxt->regs->r(ip); in x86_emulate() 5333 if ( ctxt->lma ) in x86_emulate() 8064 ASSERT(ctxt->lma); in x86_emulate_wrapper() 8074 typeof(ctxt->retire) retire = ctxt->retire; in x86_emulate_wrapper() [all …]
|
/xen-4.10.0-shim-comet/tools/libacpi/ |
A D | build.c | 93 madt = ctxt->mem_ops.alloc(ctxt, sz, 16); in construct_madt() 169 ctxt->mem_ops.v2p(ctxt, &madt->header.checksum); in construct_madt() 179 hpet = ctxt->mem_ops.alloc(ctxt, sizeof(*hpet), 16); in construct_hpet() 203 waet = ctxt->mem_ops.alloc(ctxt, sizeof(*waet), 16); in construct_waet() 227 p = ctxt->mem_ops.alloc(ctxt, size, 16); in construct_srat() 282 slit = ctxt->mem_ops.alloc(ctxt, size, 16); in construct_slit() 505 info->vm_gid_addr = ctxt->mem_ops.v2p(ctxt, buf); in new_vm_gid() 603 fadt = ctxt->mem_ops.alloc(ctxt, fadt_size, 16); in acpi_build_tables() 619 fadt->dsdt = ctxt->mem_ops.v2p(ctxt, dsdt); in acpi_build_tables() 620 fadt->x_dsdt = ctxt->mem_ops.v2p(ctxt, dsdt); in acpi_build_tables() [all …]
|
A D | libacpi.h | 51 void *(*alloc)(struct acpi_ctxt *ctxt, uint32_t size, uint32_t align); 52 void (*free)(struct acpi_ctxt *ctxt, void *v, uint32_t size); 53 unsigned long (*v2p)(struct acpi_ctxt *ctxt, void *v); 101 int acpi_build_tables(struct acpi_ctxt *ctxt, struct acpi_config *config);
|
/xen-4.10.0-shim-comet/xen/arch/x86/pv/ |
A D | emul-priv-op.c | 103 ioemul_handle_quirk(opcode, &ctxt->io_emul_stub[12], ctxt->ctxt.regs); in io_emul_stub_setup() 323 struct priv_op_ctxt *poc = container_of(ctxt, struct priv_op_ctxt, ctxt); in read_io() 422 struct priv_op_ctxt *poc = container_of(ctxt, struct priv_op_ctxt, ctxt); in write_io() 570 struct priv_op_ctxt *poc = container_of(ctxt, struct priv_op_ctxt, ctxt); in rep_ins() 637 struct priv_op_ctxt *poc = container_of(ctxt, struct priv_op_ctxt, ctxt); in rep_outs() 840 struct priv_op_ctxt *poc = container_of(ctxt, struct priv_op_ctxt, ctxt); in read_msr() 1273 container_of(ctxt, struct priv_op_ctxt, ctxt); in insn_fetch() 1351 ctxt.ctxt.addr_size = ar & _SEGMENT_L ? 64 : ar & _SEGMENT_DB ? 32 : 16; in pv_emulate_privileged_op() 1353 rc = x86_emulate(&ctxt.ctxt, &priv_op_ops); in pv_emulate_privileged_op() 1381 if ( ctxt.ctxt.retire.singlestep ) in pv_emulate_privileged_op() [all …]
|
A D | ro-page-fault.c | 78 struct ptwr_emulate_ctxt *ptwr_ctxt = ctxt->data; in ptwr_emulated_update() 102 ctxt); in ptwr_emulated_update() 273 ctxt->data = &ptwr_ctxt; in ptwr_do_page_fault() 274 rc = x86_emulate(ctxt, &ptwr_emulate_ops); in ptwr_do_page_fault() 320 ctxt->data = &mmio_ro_ctxt; in mmio_ro_do_page_fault() 332 struct x86_emulate_ctxt ctxt = { in pv_ro_page_fault() local 354 rc = ptwr_do_page_fault(&ctxt, addr, pte); in pv_ro_page_fault() 368 ctxt.event.vector == TRAP_page_fault ) in pv_ro_page_fault() 369 pv_inject_event(&ctxt.event); in pv_ro_page_fault() 373 ctxt.event.type, ctxt.event.vector); in pv_ro_page_fault() [all …]
|
A D | emul-gate-op.c | 124 container_of(ctxt, struct gate_op_ctxt, ctxt); in read_mem() 191 struct gate_op_ctxt ctxt = { .ctxt.regs = regs, .insn_fetch = true }; in pv_emulate_gate_op() local 217 if ( !pv_emul_read_descriptor(regs->cs, v, &ctxt.cs.base, &ctxt.cs.limit, in pv_emulate_gate_op() 227 ctxt.ctxt.addr_size = ar & _SEGMENT_DB ? 32 : 16; in pv_emulate_gate_op() 229 state = x86_decode_insn(&ctxt.ctxt, read_mem); in pv_emulate_gate_op() 230 ctxt.insn_fetch = false; in pv_emulate_gate_op() 234 pv_inject_event(&ctxt.ctxt.event); in pv_emulate_gate_op() 240 switch ( ctxt.ctxt.opcode ) in pv_emulate_gate_op() 265 &opnd_sel, sizeof(opnd_sel), &ctxt.ctxt); in pv_emulate_gate_op() 271 insn_len = x86_insn_length(state, &ctxt.ctxt); in pv_emulate_gate_op() [all …]
|
/xen-4.10.0-shim-comet/xen/arch/arm/ |
A D | vpsci.c | 30 struct vcpu_guest_context *ctxt; in do_common_cpu_on() local 53 memset(ctxt, 0, sizeof(*ctxt)); in do_common_cpu_on() 54 ctxt->user_regs.pc64 = (u64) entry_point; in do_common_cpu_on() 55 ctxt->sctlr = SCTLR_GUEST_INIT; in do_common_cpu_on() 56 ctxt->ttbr0 = 0; in do_common_cpu_on() 57 ctxt->ttbr1 = 0; in do_common_cpu_on() 70 ctxt->user_regs.x0 = context_id; in do_common_cpu_on() 76 ctxt->user_regs.cpsr |= PSR_THUMB; in do_common_cpu_on() 77 ctxt->flags = VGCF_online; in do_common_cpu_on() 80 rc = arch_set_info_guest(v, ctxt); in do_common_cpu_on() [all …]
|
A D | traps.c | 854 ctxt->ifsr32_el2, in show_registers_32() 856 ctxt->esr_el1 in show_registers_32() 858 ctxt->ifar, ctxt->ifsr, ctxt->dfar, ctxt->dfsr in show_registers_32() 985 struct reg_ctxt ctxt; in show_registers() local 1008 struct reg_ctxt ctxt; in vcpu_show_registers() local 1014 ctxt.dfar = v->arch.dfar; in vcpu_show_registers() 1015 ctxt.ifar = v->arch.ifar; in vcpu_show_registers() 1016 ctxt.dfsr = v->arch.dfsr; in vcpu_show_registers() 1017 ctxt.ifsr = v->arch.ifsr; in vcpu_show_registers() 1019 ctxt.far = v->arch.far; in vcpu_show_registers() [all …]
|
A D | domctl.c | 190 struct vcpu_guest_context *ctxt = c.nat; in arch_get_info_guest() local 195 ctxt->sctlr = v->arch.sctlr; in arch_get_info_guest() 196 ctxt->ttbr0 = v->arch.ttbr0; in arch_get_info_guest() 197 ctxt->ttbr1 = v->arch.ttbr1; in arch_get_info_guest() 198 ctxt->ttbcr = v->arch.ttbcr; in arch_get_info_guest() 201 ctxt->flags |= VGCF_online; in arch_get_info_guest()
|
/xen-4.10.0-shim-comet/xen/arch/x86/cpu/ |
A D | vpmu_amd.c | 218 struct xen_pmu_amd_ctxt *ctxt; in amd_vpmu_load() local 226 ctxt = vpmu->context; in amd_vpmu_load() 242 ctxt = vpmu->context; in amd_vpmu_load() 317 ctxt = vpmu->context; in amd_vpmu_save() 502 struct xen_pmu_amd_ctxt *ctxt; in svm_vpmu_initialise() local 511 ctxt = xmalloc_bytes(sizeof(*ctxt) + regs_sz); in svm_vpmu_initialise() 512 if ( !ctxt ) in svm_vpmu_initialise() 520 ctxt->counters = sizeof(*ctxt); in svm_vpmu_initialise() 521 ctxt->ctrls = ctxt->counters + sizeof(uint64_t) * num_counters; in svm_vpmu_initialise() 522 amd_vpmu_init_regs(ctxt); in svm_vpmu_initialise() [all …]
|
/xen-4.10.0-shim-comet/tools/tests/x86_emulator/ |
A D | test_x86_emulator.c | 157 struct x86_emulate_ctxt *ctxt) in read() argument 212 struct x86_emulate_ctxt *ctxt) in fetch() argument 226 struct x86_emulate_ctxt *ctxt) in write() argument 301 struct x86_emulate_ctxt ctxt; in main() local 314 ctxt.regs = ®s; in main() 315 ctxt.force_writeback = 0; in main() 3021 ctxt.lma = false; in main() 3022 ctxt.sp_size = ctxt.addr_size = 32; in main() 3049 ctxt.lma = true; in main() 3050 ctxt.sp_size = ctxt.addr_size = 64; in main() [all …]
|
/xen-4.10.0-shim-comet/tools/libxc/ |
A D | xc_dom_arm.c | 136 memset(ctxt, 0, sizeof(*ctxt)); in vcpu_arm32() 153 ctxt->ttbr0 = 0; in vcpu_arm32() 154 ctxt->ttbr1 = 0; in vcpu_arm32() 162 ctxt->user_regs.cpsr, ctxt->user_regs.pc32); in vcpu_arm32() 180 memset(ctxt, 0, sizeof(*ctxt)); in vcpu_arm64() 187 ctxt->user_regs.x1 = 0; in vcpu_arm64() 188 ctxt->user_regs.x2 = 0; in vcpu_arm64() 189 ctxt->user_regs.x3 = 0; in vcpu_arm64() 195 ctxt->ttbr0 = 0; in vcpu_arm64() 196 ctxt->ttbr1 = 0; in vcpu_arm64() [all …]
|
A D | xc_resume.c | 28 vcpu_guest_context_any_t ctxt; in modify_returncode() local 73 if ( (rc = xc_vcpu_getcontext(xch, domid, 0, &ctxt)) != 0 ) in modify_returncode() 76 SET_FIELD(&ctxt, user_regs.eax, 1, dinfo->guest_width); in modify_returncode() 78 if ( (rc = xc_vcpu_setcontext(xch, domid, 0, &ctxt)) != 0 ) in modify_returncode() 143 vcpu_guest_context_any_t ctxt; in xc_domain_resume_any() local 217 if ( xc_vcpu_getcontext(xch, domid, 0, &ctxt) ) in xc_domain_resume_any() 223 mfn = GET_FIELD(&ctxt, user_regs.edx, dinfo->guest_width); in xc_domain_resume_any()
|
/xen-4.10.0-shim-comet/xen/arch/x86/hvm/ |
A D | emulate.c | 1089 container_of(ctxt, struct hvm_emulate_ctxt, ctxt); in hvmemul_read() 1107 container_of(ctxt, struct hvm_emulate_ctxt, ctxt); in hvmemul_insn_fetch() 1154 container_of(ctxt, struct hvm_emulate_ctxt, ctxt); in hvmemul_write() 1306 container_of(ctxt, struct hvm_emulate_ctxt, ctxt); in hvmemul_validate() 1321 container_of(ctxt, struct hvm_emulate_ctxt, ctxt); in hvmemul_rep_ins() 1386 container_of(ctxt, struct hvm_emulate_ctxt, ctxt); in hvmemul_rep_outs() 1429 container_of(ctxt, struct hvm_emulate_ctxt, ctxt); in hvmemul_rep_movs() 1584 container_of(ctxt, struct hvm_emulate_ctxt, ctxt); in hvmemul_rep_stos() 1701 container_of(ctxt, struct hvm_emulate_ctxt, ctxt); in hvmemul_read_segment() 2203 ctxt.ctxt.data = &mmio_ro_ctxt; in hvm_emulate_one_mmio() [all …]
|
A D | hvm.c | 784 memset(&ctxt, 0, sizeof(ctxt)); in hvm_save_cpu_ctxt() 851 memcpy(ctxt.fpu_regs, v->arch.fpu_ctxt, sizeof(ctxt.fpu_regs)); in hvm_save_cpu_ctxt() 1111 memcpy(v->arch.fpu_ctxt, ctxt.fpu_regs, sizeof(ctxt.fpu_regs)); in hvm_load_cpu_ctxt() 1261 err = validate_xstate(ctxt->xcr0, ctxt->xcr0_accum, in hvm_load_cpu_xsave_states() 1268 d->domain_id, vcpuid, ctxt->xfeature_mask, ctxt->xcr0_accum, in hvm_load_cpu_xsave_states() 1269 ctxt->xcr0, ctxt->save_area.xsave_hdr.xstate_bv, err); in hvm_load_cpu_xsave_states() 1344 ctxt->count = 0; in hvm_save_cpu_msrs() 1369 ctxt->msr[ctxt->count].index = msrs_to_send[i]; in hvm_save_cpu_msrs() 1370 ctxt->msr[ctxt->count++].val = val; in hvm_save_cpu_msrs() 1462 rc = guest_wrmsr(v, ctxt->msr[i].index, ctxt->msr[i].val); in hvm_load_cpu_msrs() [all …]
|
A D | save.c | 139 hvm_domain_context_t ctxt = { }; in hvm_save_one() local 148 ctxt.size = hvm_sr_handlers[typecode].size; in hvm_save_one() 150 ctxt.size *= d->max_vcpus; in hvm_save_one() 151 ctxt.data = xmalloc_bytes(ctxt.size); in hvm_save_one() 152 if ( !ctxt.data ) in hvm_save_one() 155 if ( (rv = hvm_sr_handlers[typecode].save(d, &ctxt)) != 0 ) in hvm_save_one() 158 else if ( rv = -ENOENT, ctxt.cur >= sizeof(*desc) ) in hvm_save_one() 164 desc = (void *)(ctxt.data + off); in hvm_save_one() 167 if ( ctxt.cur < desc->length || in hvm_save_one() 168 off > ctxt.cur - desc->length ) in hvm_save_one() [all …]
|
A D | io.c | 82 struct hvm_emulate_ctxt ctxt; in hvm_emulate_one_insn() local 87 hvm_emulate_init_once(&ctxt, validate, guest_cpu_user_regs()); in hvm_emulate_one_insn() 89 rc = hvm_emulate_one(&ctxt); in hvm_emulate_one_insn() 99 hvm_dump_emulation_state(XENLOG_G_WARNING, descr, &ctxt, rc); in hvm_emulate_one_insn() 103 hvm_dump_emulation_state(XENLOG_G_WARNING, descr, &ctxt, rc); in hvm_emulate_one_insn() 108 hvm_inject_event(&ctxt.ctxt.event); in hvm_emulate_one_insn() 112 hvm_emulate_writeback(&ctxt); in hvm_emulate_one_insn()
|
/xen-4.10.0-shim-comet/xen/arch/x86/hvm/svm/ |
A D | emulate.c | 89 struct hvm_emulate_ctxt ctxt; in __get_instruction_length_from_list() local 110 hvm_emulate_init_once(&ctxt, NULL, guest_cpu_user_regs()); in __get_instruction_length_from_list() 111 hvm_emulate_init_per_insn(&ctxt, NULL, 0); in __get_instruction_length_from_list() 112 state = x86_decode_insn(&ctxt.ctxt, hvmemul_insn_fetch); in __get_instruction_length_from_list() 116 inst_len = x86_insn_length(state, &ctxt.ctxt); in __get_instruction_length_from_list() 127 ctxt.ctxt.opcode, inst_len, j); in __get_instruction_length_from_list() 141 if ( opc_tab[instr].opcode == ctxt.ctxt.opcode ) in __get_instruction_length_from_list()
|
/xen-4.10.0-shim-comet/xen/common/compat/ |
A D | domain.c | 54 struct vcpu_hvm_context ctxt; in compat_vcpu_op() local 56 if ( copy_from_guest(&ctxt, arg, 1) ) in compat_vcpu_op() 60 rc = v->is_initialised ? -EEXIST : arch_set_info_hvm_guest(v, &ctxt); in compat_vcpu_op() 65 struct compat_vcpu_guest_context *ctxt; in compat_vcpu_op() local 67 if ( (ctxt = xmalloc(struct compat_vcpu_guest_context)) == NULL ) in compat_vcpu_op() 70 if ( copy_from_guest(ctxt, arg, 1) ) in compat_vcpu_op() 72 xfree(ctxt); in compat_vcpu_op() 77 rc = v->is_initialised ? -EEXIST : arch_set_info_guest(v, ctxt); in compat_vcpu_op() 80 xfree(ctxt); in compat_vcpu_op()
|
/xen-4.10.0-shim-comet/xen/arch/x86/ |
A D | vm_event.c | 129 struct hvm_hw_cpu ctxt; in vm_event_fill_regs() local 135 hvm_funcs.save_cpu_ctxt(curr, &ctxt); in vm_event_fill_regs() 159 req->data.regs.x86.cr0 = ctxt.cr0; in vm_event_fill_regs() 160 req->data.regs.x86.cr2 = ctxt.cr2; in vm_event_fill_regs() 161 req->data.regs.x86.cr3 = ctxt.cr3; in vm_event_fill_regs() 162 req->data.regs.x86.cr4 = ctxt.cr4; in vm_event_fill_regs() 164 req->data.regs.x86.sysenter_cs = ctxt.sysenter_cs; in vm_event_fill_regs() 165 req->data.regs.x86.sysenter_esp = ctxt.sysenter_esp; in vm_event_fill_regs() 168 req->data.regs.x86.msr_efer = ctxt.msr_efer; in vm_event_fill_regs() 169 req->data.regs.x86.msr_star = ctxt.msr_star; in vm_event_fill_regs() [all …]
|
/xen-4.10.0-shim-comet/xen/include/asm-x86/hvm/ |
A D | emulate.h | 20 const struct x86_emulate_ctxt *ctxt); 23 struct x86_emulate_ctxt ctxt; member 80 struct cpuid_leaf *res, struct x86_emulate_ctxt *ctxt); 95 struct x86_emulate_ctxt *ctxt);
|
/xen-4.10.0-shim-comet/tools/firmware/hvmloader/ |
A D | util.c | 687 ctxt->emitted++; in __copy() 689 if (ctxt->remaining == 0) in __copy() 692 *(ctxt->ptr++) = c; in __copy() 693 --ctxt->remaining; in __copy() 701 ctxt.ptr = buf; in snprintf() 702 ctxt.emitted = 0; in snprintf() 703 ctxt.remaining = size; in snprintf() 709 if (ctxt.remaining != 0) in snprintf() 710 *ctxt.ptr = '\0'; in snprintf() 712 return ctxt.emitted; in snprintf() [all …]
|
/xen-4.10.0-shim-comet/xen/arch/x86/cpu/mcheck/ |
A D | vmce.c | 82 if ( ctxt->caps & ~guest_mcg_cap & ~MCG_CAP_COUNT & ~MCG_CTL_P ) in vmce_restore_vcpu() 86 is_hvm_vcpu(v) ? "HVM" : "PV", ctxt->caps, in vmce_restore_vcpu() 91 v->arch.vmce.mcg_cap = ctxt->caps; in vmce_restore_vcpu() 92 v->arch.vmce.bank[0].mci_ctl2 = ctxt->mci_ctl2_bank0; in vmce_restore_vcpu() 93 v->arch.vmce.bank[1].mci_ctl2 = ctxt->mci_ctl2_bank1; in vmce_restore_vcpu() 94 v->arch.vmce.mcg_ext_ctl = ctxt->mcg_ext_ctl; in vmce_restore_vcpu() 359 struct hvm_vmce_vcpu ctxt = { in vmce_save_vcpu_ctxt() local 366 err = hvm_save_entry(VMCE_VCPU, v->vcpu_id, h, &ctxt); in vmce_save_vcpu_ctxt() 378 struct hvm_vmce_vcpu ctxt; in vmce_load_vcpu_ctxt() local 388 err = hvm_load_entry_zeroextend(VMCE_VCPU, h, &ctxt); in vmce_load_vcpu_ctxt() [all …]
|