Unverified Commit 50a2fbeb authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!9803 v2 x86/ftrace: Disable lockdep check when execute ftrace_int3_handler()

parents d127ee13 f9eb92f5
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -585,9 +585,15 @@ dotraplinkage void notrace do_int3(struct pt_regs *regs, long error_code)
	 * ftrace must be first, everything else may cause a recursive crash.
	 * See note by declaration of modifying_ftrace_code in ftrace.c
	 */
	if (unlikely(atomic_read(&modifying_ftrace_code)) &&
	    ftrace_int3_handler(regs))
	if (unlikely(atomic_read(&modifying_ftrace_code))) {
		int ret;

		lockdep_off();
		ret = ftrace_int3_handler(regs);
		lockdep_on();
		if (ret)
			return;
	}
#endif
	if (poke_int3_handler(regs))
		return;
+2 −8
Original line number Diff line number Diff line
@@ -1581,11 +1581,6 @@ unsigned long ftrace_location_range(unsigned long start, unsigned long end)
	key.ip = start;
	key.flags = end;	/* overload flags, as it is unsigned long */

	/*
	 * It is in atomic context when called from ftrace_int3_handler(),
	 * in this case rcu lock is not needed.
	 */
	if (!in_atomic())
	rcu_read_lock();
	for (pg = ftrace_pages_start; pg; pg = pg->next) {
		if (pg->index == 0 ||
@@ -1600,7 +1595,6 @@ unsigned long ftrace_location_range(unsigned long start, unsigned long end)
			break;
		}
	}
	if (!in_atomic())
	rcu_read_unlock();

	return ip;