[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250327205355.378659-32-mingo@kernel.org>
Date: Thu, 27 Mar 2025 21:53:44 +0100
From: Ingo Molnar <mingo@...nel.org>
To: linux-kernel@...r.kernel.org
Cc: Juergen Gross <jgross@...e.com>,
"H . Peter Anvin" <hpa@...or.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Peter Zijlstra <peterz@...radead.org>,
Borislav Petkov <bp@...en8.de>,
Thomas Gleixner <tglx@...utronix.de>
Subject: [PATCH 31/41] x86/alternatives: Simplify text_poke_int3_handler()
Remove the 'desc' local variable indirection and use
tp_array directly.
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
arch/x86/kernel/alternative.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
index 244119066672..9402826e2903 100644
--- a/arch/x86/kernel/alternative.c
+++ b/arch/x86/kernel/alternative.c
@@ -2511,7 +2511,6 @@ static __always_inline int patch_cmp(const void *key, const void *elt)
noinstr int text_poke_int3_handler(struct pt_regs *regs)
{
- struct text_poke_int3_array *desc;
struct text_poke_int3_loc *tp;
int ret = 0;
void *ip;
@@ -2531,9 +2530,6 @@ noinstr int text_poke_int3_handler(struct pt_regs *regs)
if (!try_get_tp_array())
return 0;
- desc = &tp_array;
-
- WARN_ON_ONCE(desc->vec != tp_array.vec);
/*
* Discount the INT3. See text_poke_int3_batch().
@@ -2543,14 +2539,14 @@ noinstr int text_poke_int3_handler(struct pt_regs *regs)
/*
* Skip the binary search if there is a single member in the vector.
*/
- if (unlikely(desc->nr_entries > 1)) {
- tp = __inline_bsearch(ip, desc->vec, desc->nr_entries,
+ if (unlikely(tp_array.nr_entries > 1)) {
+ tp = __inline_bsearch(ip, tp_array.vec, tp_array.nr_entries,
sizeof(struct text_poke_int3_loc),
patch_cmp);
if (!tp)
goto out_put;
} else {
- tp = desc->vec;
+ tp = tp_array.vec;
if (text_poke_int3_addr(tp) != ip)
goto out_put;
}
--
2.45.2
Powered by blists - more mailing lists