Home
last modified time | relevance | path

Searched refs:ctxt (Results 1 – 25 of 36) sorted by relevance

12

/arch/x86/kvm/
Demulate.c194 int (*execute)(struct x86_emulate_ctxt *ctxt);
203 int (*check_perm)(struct x86_emulate_ctxt *ctxt);
242 static ulong reg_read(struct x86_emulate_ctxt *ctxt, unsigned nr) in reg_read() argument
244 if (!(ctxt->regs_valid & (1 << nr))) { in reg_read()
245 ctxt->regs_valid |= 1 << nr; in reg_read()
246 ctxt->_regs[nr] = ctxt->ops->read_gpr(ctxt, nr); in reg_read()
248 return ctxt->_regs[nr]; in reg_read()
251 static ulong *reg_write(struct x86_emulate_ctxt *ctxt, unsigned nr) in reg_write() argument
253 ctxt->regs_valid |= 1 << nr; in reg_write()
254 ctxt->regs_dirty |= 1 << nr; in reg_write()
[all …]
Dkvm_emulate.h97 ulong (*read_gpr)(struct x86_emulate_ctxt *ctxt, unsigned reg);
104 void (*write_gpr)(struct x86_emulate_ctxt *ctxt, unsigned reg, ulong val);
113 int (*read_std)(struct x86_emulate_ctxt *ctxt,
125 int (*read_phys)(struct x86_emulate_ctxt *ctxt, unsigned long addr,
136 int (*write_std)(struct x86_emulate_ctxt *ctxt,
146 int (*fetch)(struct x86_emulate_ctxt *ctxt,
156 int (*read_emulated)(struct x86_emulate_ctxt *ctxt,
167 int (*write_emulated)(struct x86_emulate_ctxt *ctxt,
180 int (*cmpxchg_emulated)(struct x86_emulate_ctxt *ctxt,
186 void (*invlpg)(struct x86_emulate_ctxt *ctxt, ulong addr);
[all …]
Dx86.c91 #define emul_to_vcpu(ctxt) \ argument
92 ((struct kvm_vcpu *)(ctxt)->vcpu)
338 static int emulator_fix_hypercall(struct x86_emulate_ctxt *ctxt);
6649 static int kvm_fetch_guest_virt(struct x86_emulate_ctxt *ctxt, in kvm_fetch_guest_virt() argument
6653 struct kvm_vcpu *vcpu = emul_to_vcpu(ctxt); in kvm_fetch_guest_virt()
6693 static int emulator_read_std(struct x86_emulate_ctxt *ctxt, in emulator_read_std() argument
6697 struct kvm_vcpu *vcpu = emul_to_vcpu(ctxt); in emulator_read_std()
6706 static int kvm_read_guest_phys_system(struct x86_emulate_ctxt *ctxt, in kvm_read_guest_phys_system() argument
6709 struct kvm_vcpu *vcpu = emul_to_vcpu(ctxt); in kvm_read_guest_phys_system()
6746 static int emulator_write_std(struct x86_emulate_ctxt *ctxt, gva_t addr, void *val, in emulator_write_std() argument
[all …]
/arch/arm64/kvm/hyp/include/hyp/
Dsysreg-sr.h19 static inline void __sysreg_save_common_state(struct kvm_cpu_context *ctxt) in __sysreg_save_common_state() argument
21 ctxt_sys_reg(ctxt, MDSCR_EL1) = read_sysreg(mdscr_el1); in __sysreg_save_common_state()
24 static inline void __sysreg_save_user_state(struct kvm_cpu_context *ctxt) in __sysreg_save_user_state() argument
26 ctxt_sys_reg(ctxt, TPIDR_EL0) = read_sysreg(tpidr_el0); in __sysreg_save_user_state()
27 ctxt_sys_reg(ctxt, TPIDRRO_EL0) = read_sysreg(tpidrro_el0); in __sysreg_save_user_state()
30 static inline bool ctxt_has_mte(struct kvm_cpu_context *ctxt) in ctxt_has_mte() argument
32 struct kvm_vcpu *vcpu = ctxt->__hyp_running_vcpu; in ctxt_has_mte()
35 vcpu = container_of(ctxt, struct kvm_vcpu, arch.ctxt); in ctxt_has_mte()
40 static inline void __sysreg_save_el1_state(struct kvm_cpu_context *ctxt) in __sysreg_save_el1_state() argument
42 ctxt_sys_reg(ctxt, CSSELR_EL1) = read_sysreg(csselr_el1); in __sysreg_save_el1_state()
[all …]
Dswitch.h147 &vcpu->arch.ctxt.fp_regs.fpsr); in __hyp_sve_restore_guest()
190 __fpsimd_restore_state(&vcpu->arch.ctxt.fp_regs); in kvm_hyp_handle_fpsimd()
275 #define __ptrauth_save_key(ctxt, key) \ argument
279 ctxt_sys_reg(ctxt, key ## KEYLO_EL1) = __val; \
281 ctxt_sys_reg(ctxt, key ## KEYHI_EL1) = __val; \
288 struct kvm_cpu_context *ctxt; in kvm_hyp_handle_ptrauth() local
294 ctxt = this_cpu_ptr(&kvm_hyp_ctxt); in kvm_hyp_handle_ptrauth()
295 __ptrauth_save_key(ctxt, APIA); in kvm_hyp_handle_ptrauth()
296 __ptrauth_save_key(ctxt, APIB); in kvm_hyp_handle_ptrauth()
297 __ptrauth_save_key(ctxt, APDA); in kvm_hyp_handle_ptrauth()
[all …]
Ddebug-sr.h92 struct kvm_cpu_context *ctxt) in __debug_save_state() argument
106 ctxt_sys_reg(ctxt, MDCCINT_EL1) = read_sysreg(mdccint_el1); in __debug_save_state()
110 struct kvm_cpu_context *ctxt) in __debug_restore_state() argument
125 write_sysreg(ctxt_sys_reg(ctxt, MDCCINT_EL1), mdccint_el1); in __debug_restore_state()
139 guest_ctxt = &vcpu->arch.ctxt; in __debug_switch_to_guest_common()
158 guest_ctxt = &vcpu->arch.ctxt; in __debug_switch_to_host_common()
/arch/x86/kernel/
Dsev.c230 static int vc_fetch_insn_kernel(struct es_em_ctxt *ctxt, in vc_fetch_insn_kernel() argument
233 return copy_from_kernel_nofault(buffer, (unsigned char *)ctxt->regs->ip, MAX_INSN_SIZE); in vc_fetch_insn_kernel()
236 static enum es_result __vc_decode_user_insn(struct es_em_ctxt *ctxt) in __vc_decode_user_insn() argument
241 insn_bytes = insn_fetch_from_user_inatomic(ctxt->regs, buffer); in __vc_decode_user_insn()
244 ctxt->fi.vector = X86_TRAP_PF; in __vc_decode_user_insn()
245 ctxt->fi.error_code = X86_PF_INSTR | X86_PF_USER; in __vc_decode_user_insn()
246 ctxt->fi.cr2 = ctxt->regs->ip; in __vc_decode_user_insn()
250 ctxt->fi.vector = X86_TRAP_GP; in __vc_decode_user_insn()
251 ctxt->fi.error_code = 0; in __vc_decode_user_insn()
252 ctxt->fi.cr2 = 0; in __vc_decode_user_insn()
[all …]
Dsev-shared.c77 static enum es_result vc_init_em_ctxt(struct es_em_ctxt *ctxt, in vc_init_em_ctxt() argument
83 memset(ctxt, 0, sizeof(*ctxt)); in vc_init_em_ctxt()
84 ctxt->regs = regs; in vc_init_em_ctxt()
87 ret = vc_decode_insn(ctxt); in vc_init_em_ctxt()
92 static void vc_finish_insn(struct es_em_ctxt *ctxt) in vc_finish_insn() argument
94 ctxt->regs->ip += ctxt->insn.length; in vc_finish_insn()
98 struct es_em_ctxt *ctxt, in sev_es_ghcb_hv_call() argument
126 ctxt->fi.vector = v; in sev_es_ghcb_hv_call()
128 ctxt->fi.error_code = info >> 32; in sev_es_ghcb_hv_call()
216 static enum es_result vc_insn_string_check(struct es_em_ctxt *ctxt, in vc_insn_string_check() argument
[all …]
/arch/x86/power/
Dcpu.c38 static void msr_save_context(struct saved_context *ctxt) in msr_save_context() argument
40 struct saved_msr *msr = ctxt->saved_msrs.array; in msr_save_context()
41 struct saved_msr *end = msr + ctxt->saved_msrs.num; in msr_save_context()
50 static void msr_restore_context(struct saved_context *ctxt) in msr_restore_context() argument
52 struct saved_msr *msr = ctxt->saved_msrs.array; in msr_restore_context()
53 struct saved_msr *end = msr + ctxt->saved_msrs.num; in msr_restore_context()
78 static void __save_processor_state(struct saved_context *ctxt) in __save_processor_state() argument
88 store_idt(&ctxt->idt); in __save_processor_state()
96 ctxt->gdt_desc.size = GDT_SIZE - 1; in __save_processor_state()
97 ctxt->gdt_desc.address = (unsigned long)get_cpu_gdt_rw(smp_processor_id()); in __save_processor_state()
[all …]
/arch/arm64/kvm/hyp/nvhe/
Dsysreg-sr.c21 void __sysreg_save_state_nvhe(struct kvm_cpu_context *ctxt) in __sysreg_save_state_nvhe() argument
23 __sysreg_save_el1_state(ctxt); in __sysreg_save_state_nvhe()
24 __sysreg_save_common_state(ctxt); in __sysreg_save_state_nvhe()
25 __sysreg_save_user_state(ctxt); in __sysreg_save_state_nvhe()
26 __sysreg_save_el2_return_state(ctxt); in __sysreg_save_state_nvhe()
29 void __sysreg_restore_state_nvhe(struct kvm_cpu_context *ctxt) in __sysreg_restore_state_nvhe() argument
31 __sysreg_restore_el1_state(ctxt); in __sysreg_restore_state_nvhe()
32 __sysreg_restore_common_state(ctxt); in __sysreg_restore_state_nvhe()
33 __sysreg_restore_user_state(ctxt); in __sysreg_restore_state_nvhe()
34 __sysreg_restore_el2_return_state(ctxt); in __sysreg_restore_state_nvhe()
Dffa.c94 static void ffa_set_retval(struct kvm_cpu_context *ctxt, in ffa_set_retval() argument
97 cpu_reg(ctxt, 0) = res->a0; in ffa_set_retval()
98 cpu_reg(ctxt, 1) = res->a1; in ffa_set_retval()
99 cpu_reg(ctxt, 2) = res->a2; in ffa_set_retval()
100 cpu_reg(ctxt, 3) = res->a3; in ffa_set_retval()
181 struct kvm_cpu_context *ctxt) in do_ffa_rxtx_map() argument
183 DECLARE_REG(phys_addr_t, tx, ctxt, 1); in do_ffa_rxtx_map()
184 DECLARE_REG(phys_addr_t, rx, ctxt, 2); in do_ffa_rxtx_map()
185 DECLARE_REG(u32, npages, ctxt, 3); in do_ffa_rxtx_map()
256 struct kvm_cpu_context *ctxt) in do_ffa_rxtx_unmap() argument
[all …]
Dhyp-main.c78 u64 ret = READ_ONCE(hyp_vcpu->host_vcpu->arch.ctxt.regs.regs[0]); in handle_pvm_entry_psci()
154 u64 rt_val = READ_ONCE(host_vcpu->arch.ctxt.regs.regs[0]); in handle_pvm_entry_sys64()
228 u64 rd_val = READ_ONCE(host_vcpu->arch.ctxt.regs.regs[0]); in handle_pvm_entry_dabt()
239 WRITE_ONCE(hyp_vcpu->host_vcpu->arch.ctxt.regs.pstate, in handle_pvm_exit_wfx()
240 hyp_vcpu->vcpu.arch.ctxt.regs.pstate & PSR_MODE_MASK); in handle_pvm_exit_wfx()
255 WRITE_ONCE(host_vcpu->arch.ctxt.regs.pstate, in handle_pvm_exit_sys64()
256 hyp_vcpu->vcpu.arch.ctxt.regs.pstate & PSR_MODE_MASK); in handle_pvm_exit_sys64()
262 WRITE_ONCE(host_vcpu->arch.ctxt.regs.regs[0], rt_val); in handle_pvm_exit_sys64()
320 WRITE_ONCE(host_vcpu->arch.ctxt.regs.regs[i], in handle_pvm_exit_hvc64()
348 WRITE_ONCE(host_vcpu->arch.ctxt.regs.regs[0], rt_val); in handle_pvm_exit_dabt()
[all …]
Dswitch.c59 struct kvm_cpu_context *ctxt = &vcpu->arch.ctxt; in __activate_traps() local
67 write_sysreg_el1(ctxt_sys_reg(ctxt, SCTLR_EL1), SYS_SCTLR); in __activate_traps()
69 write_sysreg_el1(ctxt_sys_reg(ctxt, TCR_EL1), SYS_TCR); in __activate_traps()
299 guest_ctxt = &vcpu->arch.ctxt; in __kvm_vcpu_run()
/arch/arm64/kvm/hyp/vhe/
Dsysreg-sr.c27 void sysreg_save_host_state_vhe(struct kvm_cpu_context *ctxt) in sysreg_save_host_state_vhe() argument
29 __sysreg_save_common_state(ctxt); in sysreg_save_host_state_vhe()
33 void sysreg_save_guest_state_vhe(struct kvm_cpu_context *ctxt) in sysreg_save_guest_state_vhe() argument
35 __sysreg_save_common_state(ctxt); in sysreg_save_guest_state_vhe()
36 __sysreg_save_el2_return_state(ctxt); in sysreg_save_guest_state_vhe()
40 void sysreg_restore_host_state_vhe(struct kvm_cpu_context *ctxt) in sysreg_restore_host_state_vhe() argument
42 __sysreg_restore_common_state(ctxt); in sysreg_restore_host_state_vhe()
46 void sysreg_restore_guest_state_vhe(struct kvm_cpu_context *ctxt) in sysreg_restore_guest_state_vhe() argument
48 __sysreg_restore_common_state(ctxt); in sysreg_restore_guest_state_vhe()
49 __sysreg_restore_el2_return_state(ctxt); in sysreg_restore_guest_state_vhe()
[all …]
/arch/arm64/include/asm/
Dkvm_asm.h319 .macro get_vcpu_ptr vcpu, ctxt
320 get_host_ctxt \ctxt, \vcpu
321 ldr \vcpu, [\ctxt, #HOST_CONTEXT_VCPU]
324 .macro get_loaded_vcpu vcpu, ctxt
325 adr_this_cpu \ctxt, kvm_hyp_ctxt, \vcpu
326 ldr \vcpu, [\ctxt, #HOST_CONTEXT_VCPU]
329 .macro set_loaded_vcpu vcpu, ctxt, tmp
330 adr_this_cpu \ctxt, kvm_hyp_ctxt, \tmp
331 str \vcpu, [\ctxt, #HOST_CONTEXT_VCPU]
357 .macro save_callee_saved_regs ctxt
[all …]
Dkvm_hyp.h77 void __sysreg_save_state_nvhe(struct kvm_cpu_context *ctxt);
78 void __sysreg_restore_state_nvhe(struct kvm_cpu_context *ctxt);
80 void sysreg_save_host_state_vhe(struct kvm_cpu_context *ctxt);
81 void sysreg_restore_host_state_vhe(struct kvm_cpu_context *ctxt);
82 void sysreg_save_guest_state_vhe(struct kvm_cpu_context *ctxt);
83 void sysreg_restore_guest_state_vhe(struct kvm_cpu_context *ctxt);
Dkvm_emulate.h545 memset(&vcpu->arch.ctxt.fp_regs, 0, sizeof(vcpu->arch.ctxt.fp_regs)); in kvm_reset_vcpu_core()
546 vcpu->arch.ctxt.spsr_abt = 0; in kvm_reset_vcpu_core()
547 vcpu->arch.ctxt.spsr_und = 0; in kvm_reset_vcpu_core()
548 vcpu->arch.ctxt.spsr_irq = 0; in kvm_reset_vcpu_core()
549 vcpu->arch.ctxt.spsr_fiq = 0; in kvm_reset_vcpu_core()
/arch/x86/boot/compressed/
Dsev.c78 static enum es_result vc_decode_insn(struct es_em_ctxt *ctxt) in vc_decode_insn() argument
83 memcpy(buffer, (unsigned char *)ctxt->regs->ip, MAX_INSN_SIZE); in vc_decode_insn()
85 ret = insn_decode(&ctxt->insn, buffer, MAX_INSN_SIZE, INSN_MODE_64); in vc_decode_insn()
92 static enum es_result vc_write_mem(struct es_em_ctxt *ctxt, in vc_write_mem() argument
100 static enum es_result vc_read_mem(struct es_em_ctxt *ctxt, in vc_read_mem() argument
108 static enum es_result vc_ioio_check(struct es_em_ctxt *ctxt, u16 port, size_t size) in vc_ioio_check() argument
184 struct es_em_ctxt ctxt; in do_boot_stage2_vc() local
191 result = vc_init_em_ctxt(&ctxt, regs, exit_code); in do_boot_stage2_vc()
198 result = vc_handle_rdtsc(boot_ghcb, &ctxt, exit_code); in do_boot_stage2_vc()
201 result = vc_handle_ioio(boot_ghcb, &ctxt); in do_boot_stage2_vc()
[all …]
/arch/x86/xen/
Dsmp_pv.c263 struct vcpu_guest_context *ctxt; in cpu_initialize_context() local
272 ctxt = kzalloc(sizeof(*ctxt), GFP_KERNEL); in cpu_initialize_context()
273 if (ctxt == NULL) in cpu_initialize_context()
283 ctxt->user_regs.eip = (unsigned long)asm_cpu_bringup_and_idle; in cpu_initialize_context()
284 ctxt->flags = VGCF_IN_KERNEL; in cpu_initialize_context()
285 ctxt->user_regs.eflags = 0x1000; /* IOPL_RING1 */ in cpu_initialize_context()
286 ctxt->user_regs.ds = __USER_DS; in cpu_initialize_context()
287 ctxt->user_regs.es = __USER_DS; in cpu_initialize_context()
288 ctxt->user_regs.ss = __KERNEL_DS; in cpu_initialize_context()
289 ctxt->user_regs.cs = __KERNEL_CS; in cpu_initialize_context()
[all …]
Dpmu.c30 #define field_offset(ctxt, field) ((void *)((uintptr_t)ctxt + \ argument
31 (uintptr_t)ctxt->field))
193 struct xen_pmu_intel_ctxt *ctxt; in xen_intel_pmu_emulate() local
203 ctxt = &xenpmu_data->pmu.c.intel; in xen_intel_pmu_emulate()
207 reg = &ctxt->global_ovf_ctrl; in xen_intel_pmu_emulate()
210 reg = &ctxt->global_status; in xen_intel_pmu_emulate()
213 reg = &ctxt->global_ctrl; in xen_intel_pmu_emulate()
216 reg = &ctxt->fixed_ctrl; in xen_intel_pmu_emulate()
221 fix_counters = field_offset(ctxt, fixed_counters); in xen_intel_pmu_emulate()
225 arch_cntr_pair = field_offset(ctxt, arch_counters); in xen_intel_pmu_emulate()
[all …]
/arch/arm64/kvm/hyp/include/nvhe/
Dtrap_handler.h14 #define cpu_reg(ctxt, r) (ctxt)->regs.regs[r] argument
15 #define DECLARE_REG(type, name, ctxt, reg) \ argument
16 type name = (type)cpu_reg(ctxt, (reg))
/arch/x86/kernel/cpu/mtrr/
Dmtrr.h49 void set_mtrr_done(struct set_mtrr_context *ctxt);
50 void set_mtrr_cache_disable(struct set_mtrr_context *ctxt);
51 void set_mtrr_prepare_save(struct set_mtrr_context *ctxt);
/arch/arm64/kvm/
Darch_timer.c55 u32 timer_get_ctl(struct arch_timer_context *ctxt) in timer_get_ctl() argument
57 struct kvm_vcpu *vcpu = ctxt->vcpu; in timer_get_ctl()
59 switch(arch_timer_ctx_index(ctxt)) { in timer_get_ctl()
70 u64 timer_get_cval(struct arch_timer_context *ctxt) in timer_get_cval() argument
72 struct kvm_vcpu *vcpu = ctxt->vcpu; in timer_get_cval()
74 switch(arch_timer_ctx_index(ctxt)) { in timer_get_cval()
85 static u64 timer_get_offset(struct arch_timer_context *ctxt) in timer_get_offset() argument
87 struct kvm_vcpu *vcpu = ctxt->vcpu; in timer_get_offset()
89 switch(arch_timer_ctx_index(ctxt)) { in timer_get_offset()
99 static void timer_set_ctl(struct arch_timer_context *ctxt, u32 ctl) in timer_set_ctl() argument
[all …]
Dguest.c138 return &vcpu->arch.ctxt.regs.regs[off]; in core_reg_addr()
141 return &vcpu->arch.ctxt.regs.sp; in core_reg_addr()
144 return &vcpu->arch.ctxt.regs.pc; in core_reg_addr()
147 return &vcpu->arch.ctxt.regs.pstate; in core_reg_addr()
150 return __ctxt_sys_reg(&vcpu->arch.ctxt, SP_EL1); in core_reg_addr()
153 return __ctxt_sys_reg(&vcpu->arch.ctxt, ELR_EL1); in core_reg_addr()
156 return __ctxt_sys_reg(&vcpu->arch.ctxt, SPSR_EL1); in core_reg_addr()
159 return &vcpu->arch.ctxt.spsr_abt; in core_reg_addr()
162 return &vcpu->arch.ctxt.spsr_und; in core_reg_addr()
165 return &vcpu->arch.ctxt.spsr_irq; in core_reg_addr()
[all …]
/arch/m68k/include/asm/
Dopenprom.h177 void (*pv_setctxt)(int ctxt, char *va, int pmeg);
245 void (*pv_setctxt)(int ctxt, char *va, int pmeg);

12