x86/mm/kmmio: Remove redundant preempt_disable()

Now that kmmio uses rcu_read_lock_sched_notrace() there's no reason to
call preempt_disable() as the read_lock_sched_notrace() already does that
and is redundant.

This also removes the preempt_enable_no_resched() as the "no_resched()"
portion was bogus as there's no reason to do that.

Link: https://lkml.kernel.org/r/20221212103703.7129cc5d@gandalf.local.home

Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: "x86@kernel.org" <x86@kernel.org>
Cc: Karol Herbst <karolherbst@gmail.com>
Cc: Pekka Paalanen <ppaalanen@gmail.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Ingo Molnar <mingo@kernel.org>
Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
parent c1ac03af
...@@ -246,14 +246,13 @@ int kmmio_handler(struct pt_regs *regs, unsigned long addr) ...@@ -246,14 +246,13 @@ int kmmio_handler(struct pt_regs *regs, unsigned long addr)
page_base &= page_level_mask(l); page_base &= page_level_mask(l);
/* /*
* Preemption is now disabled to prevent process switch during * Hold the RCU read lock over single stepping to avoid looking
* single stepping. We can only handle one active kmmio trace * up the probe and kmmio_fault_page again. The rcu_read_lock_sched()
* also disables preemption and prevents process switch during
* the single stepping. We can only handle one active kmmio trace
* per cpu, so ensure that we finish it before something else * per cpu, so ensure that we finish it before something else
* gets to run. We also hold the RCU read lock over single * gets to run.
* stepping to avoid looking up the probe and kmmio_fault_page
* again.
*/ */
preempt_disable();
rcu_read_lock_sched_notrace(); rcu_read_lock_sched_notrace();
faultpage = get_kmmio_fault_page(page_base); faultpage = get_kmmio_fault_page(page_base);
...@@ -324,7 +323,6 @@ int kmmio_handler(struct pt_regs *regs, unsigned long addr) ...@@ -324,7 +323,6 @@ int kmmio_handler(struct pt_regs *regs, unsigned long addr)
no_kmmio: no_kmmio:
rcu_read_unlock_sched_notrace(); rcu_read_unlock_sched_notrace();
preempt_enable_no_resched();
return ret; return ret;
} }
...@@ -364,7 +362,6 @@ static int post_kmmio_handler(unsigned long condition, struct pt_regs *regs) ...@@ -364,7 +362,6 @@ static int post_kmmio_handler(unsigned long condition, struct pt_regs *regs)
ctx->active--; ctx->active--;
BUG_ON(ctx->active); BUG_ON(ctx->active);
rcu_read_unlock_sched_notrace(); rcu_read_unlock_sched_notrace();
preempt_enable_no_resched();
/* /*
* if somebody else is singlestepping across a probe point, flags * if somebody else is singlestepping across a probe point, flags
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment