Lines Matching +full:ecx +full:- +full:2000
3 * Copyright (C) 2000, 2001, 2002 Andi Kleen, SuSE Labs
6 * Gareth Hughes <gareth@valinux.com>, May 2000
51 #include <asm/text-patching.h>
67 #include <asm/insn-eval.h>
76 #include <asm/processor-flags.h>
101 * FineIBT: f0 75 f9 lock jne . - 6
104 * static_call: 0f b9 cc ud1 %esp,%ecx
106 * Notably UBSAN uses EAX, static_call uses ECX.
129 *len = addr - start; in decode_bug()
134 *len = addr - start; in decode_bug()
146 *len = addr - start; in decode_bug()
177 *len = addr - start; in decode_bug()
204 tsk->thread.error_code = error_code; in do_trap_no_signal()
205 tsk->thread.trap_nr = trapnr; in do_trap_no_signal()
221 tsk->thread.error_code = error_code; in do_trap_no_signal()
222 tsk->thread.trap_nr = trapnr; in do_trap_no_signal()
224 return -1; in do_trap_no_signal()
234 tsk->comm, task_pid_nr(tsk), type, desc, in show_signal()
235 regs->ip, regs->sp, error_code); in show_signal()
236 print_vma_addr(KERN_CONT " in ", regs->ip); in show_signal()
276 * This address is usually regs->ip, but when an uprobe moved the code out
277 * of line then regs->ip points to the XOL code which would confuse
279 * a trap happened in XOL code then uprobe maps regs->ip back to the
310 unsigned long addr = regs->ip; in handle_bug()
333 if (regs->flags & X86_EFLAGS_IF) in handle_bug()
338 if (report_bug(regs->ip, regs) == BUG_TRAP_TYPE_WARN) { in handle_bug()
356 (void *)regs->ip); in handle_bug()
365 * When continuing, and regs->ip hasn't changed, move it to the next in handle_bug()
370 if (regs->ip == addr) in handle_bug()
371 regs->ip += ud_len; in handle_bug()
373 regs->ip = addr; in handle_bug()
376 if (regs->flags & X86_EFLAGS_IF) in handle_bug()
453 const char *name = stack_type_name(info->type); in handle_stack_overflow()
456 name, (void *)fault_address, info->begin, info->end); in handle_stack_overflow()
489 * while the stack is read-only are, in fact, recoverable.
513 * If IRET takes a non-IST fault on the espfix64 stack, then we in DEFINE_IDTENTRY_DF()
526 if (((long)regs->sp >> P4D_SHIFT) == ESPFIX_PGD_ENTRY && in DEFINE_IDTENTRY_DF()
527 regs->cs == __KERNEL_CS && in DEFINE_IDTENTRY_DF()
528 regs->ip == (unsigned long)native_irq_return_iret) in DEFINE_IDTENTRY_DF()
530 struct pt_regs *gpregs = (struct pt_regs *)this_cpu_read(cpu_tss_rw.x86_tss.sp0) - 1; in DEFINE_IDTENTRY_DF()
531 unsigned long *p = (unsigned long *)regs->sp; in DEFINE_IDTENTRY_DF()
534 * regs->sp points to the failing IRET frame on the in DEFINE_IDTENTRY_DF()
536 * in gpregs->ss through gpregs->ip. in DEFINE_IDTENTRY_DF()
539 gpregs->ip = p[0]; in DEFINE_IDTENTRY_DF()
540 gpregs->cs = p[1]; in DEFINE_IDTENTRY_DF()
541 gpregs->flags = p[2]; in DEFINE_IDTENTRY_DF()
542 gpregs->sp = p[3]; in DEFINE_IDTENTRY_DF()
543 gpregs->ss = p[4]; in DEFINE_IDTENTRY_DF()
544 gpregs->orig_ax = 0; /* Missing (lost) #GP error code */ in DEFINE_IDTENTRY_DF()
557 regs->ip = (unsigned long)asm_exc_general_protection; in DEFINE_IDTENTRY_DF()
558 regs->sp = (unsigned long)&gpregs->orig_ax; in DEFINE_IDTENTRY_DF()
568 tsk->thread.error_code = error_code; in DEFINE_IDTENTRY_DF()
569 tsk->thread.trap_nr = X86_TRAP_DF; in DEFINE_IDTENTRY_DF()
575 * take any non-IST exception while too close to the bottom of in DEFINE_IDTENTRY_DF()
579 * According to the SDM (footnote in 6.15 under "Interrupt 14 - in DEFINE_IDTENTRY_DF()
580 * Page-Fault Exception (#PF): in DEFINE_IDTENTRY_DF()
644 * out whether any part of the access to that address was non-canonical.
653 if (copy_from_kernel_nofault(insn_buf, (void *)regs->ip, in get_kernel_gp_address()
662 if (*addr == -1UL) in get_kernel_gp_address()
668 * - the operand is not in the kernel half in get_kernel_gp_address()
669 * - the last byte of the operand is not in the user canonical half in get_kernel_gp_address()
672 *addr + insn.opnd_bytes - 1 > __VIRTUAL_MASK) in get_kernel_gp_address()
683 struct thread_struct *t = ¤t->thread; in fixup_iopl_exception()
687 if (!IS_ENABLED(CONFIG_X86_IOPL_IOPERM) || t->iopl_emul != 3) in fixup_iopl_exception()
699 if (!t->iopl_warn && printk_ratelimit()) { in fixup_iopl_exception()
701 current->comm, task_pid_nr(current), ip); in fixup_iopl_exception()
704 t->iopl_warn = 1; in fixup_iopl_exception()
707 regs->ip += 1; in fixup_iopl_exception()
726 * in *before* interrupts are re-enabled. in try_fixup_enqcmd_gp()
741 if (!mm_valid_pasid(current->mm)) in try_fixup_enqcmd_gp()
744 pasid = mm_get_enqcmd_pasid(current->mm); in try_fixup_enqcmd_gp()
750 if (current->pasid_activated) in try_fixup_enqcmd_gp()
754 current->pasid_activated = 1; in try_fixup_enqcmd_gp()
769 current->thread.error_code = error_code; in gp_try_fixup_and_notify()
770 current->thread.trap_nr = trapnr; in gp_try_fixup_and_notify()
774 * from kprobe_running(), we have to be non-preemptible. in gp_try_fixup_and_notify()
786 current->thread.error_code = error_code; in gp_user_force_sig_segv()
787 current->thread.trap_nr = trapnr; in gp_user_force_sig_segv()
830 snprintf(desc, sizeof(desc), "segment-related " GPFSTR); in DEFINE_IDTENTRY_ERRORCODE()
836 (hint == GP_NON_CANONICAL) ? "probably for non-canonical address" in DEFINE_IDTENTRY_ERRORCODE()
841 * KASAN is interested only in the non-canonical case, clear it in DEFINE_IDTENTRY_ERRORCODE()
919 * Help handler running on a per-cpu (IST or entry trampoline) stack
925 struct pt_regs *regs = (struct pt_regs *)current_top_of_stack() - 1; in sync_regs()
939 * In the SYSCALL entry path the RSP value comes from user-space - don't in vc_switch_off_ist()
950 * use the fall-back stack instead in this case. in vc_switch_off_ist()
952 sp = regs->sp; in vc_switch_off_ist()
961 * Found a safe stack - switch to it as if the entry didn't happen via in vc_switch_off_ist()
965 sp = ALIGN_DOWN(sp, 8) - sizeof(*regs_ret); in vc_switch_off_ist()
986 new_stack = (struct pt_regs *)__this_cpu_read(cpu_tss_rw.x86_tss.sp0) - 1; in fixup_bad_iret()
989 __memcpy(&tmp.ip, (void *)bad_regs->sp, 5*8); in fixup_bad_iret()
1006 * code that can be single-stepped in the SYSENTER entry path, then in is_sysenter_singlestep()
1007 * assume that this is a useless single-step trap due to SYSENTER in is_sysenter_singlestep()
1013 return (regs->ip - (unsigned long)__begin_SYSENTER_singlestep_region) < in is_sysenter_singlestep()
1014 (unsigned long)__end_SYSENTER_singlestep_region - in is_sysenter_singlestep()
1017 return (regs->ip - (unsigned long)entry_SYSENTER_compat) < in is_sysenter_singlestep()
1018 (unsigned long)__end_entry_SYSENTER_compat - in is_sysenter_singlestep()
1032 * Certain debug exceptions may clear bits 0-3. The remaining in debug_read_clear_dr6()
1048 * Our handling of the processor debug registers is non-trivial.
1052 * only set watchpoints on userspace addresses. Therefore the in-kernel
1076 * consumed - hw_breakpoint_handler(), single_stop_cont(). in notify_debug()
1079 * for signals - ptrace_triggered(), kgdb_hw_overflow_handler(). in notify_debug()
1119 * it for userspace, but we just took a kernel #DB, so re-set in exc_debug_kernel()
1147 * The kernel doesn't use TF single-step outside of: in exc_debug_kernel()
1149 * - Kprobes, consumed through kprobe_debug_handler() in exc_debug_kernel()
1150 * - KGDB, consumed through notify_debug() in exc_debug_kernel()
1158 regs->flags &= ~X86_EFLAGS_TF; in exc_debug_kernel()
1195 current->thread.virtual_dr6 = (dr6 & DR_STEP); in exc_debug_user()
1227 dr6 |= current->thread.virtual_dr6; in exc_debug_user()
1310 task->thread.error_code = 0; in math_error()
1311 task->thread.trap_nr = trapnr; in math_error()
1325 task->thread.trap_nr = trapnr; in math_error()
1326 task->thread.error_code = 0; in math_error()
1405 case -EPERM: in handle_xfd_event()
1408 case -EFAULT: in handle_xfd_event()
1445 * to kill the task than getting stuck in a never-ending in DEFINE_IDTENTRY()
1483 * never generated on accesses to normal, TD-private memory that has been
1490 * IRET will re-enable NMIs and nested NMI will corrupt the NMI stack.
1493 * the NMI entry code. Entry code paths do not access TD-shared memory,
1507 * the interrupt-disabled region before TDGETVEINFO, a #DF (fault
1520 * NMIs/Machine-checks/Interrupts will be in a disabled state in DEFINE_IDTENTRY()
1558 /* Init GHCB memory pages when running as an SEV-ES guest */ in trap_init()