[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 11 Nov 2019 14:13:09 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: x86@...nel.org
Cc: peterz@...radead.org, linux-kernel@...r.kernel.org,
rostedt@...dmis.org, mhiramat@...nel.org, bristot@...hat.com,
jbaron@...mai.com, torvalds@...ux-foundation.org,
tglx@...utronix.de, mingo@...nel.org, namit@...are.com,
hpa@...or.com, luto@...nel.org, ard.biesheuvel@...aro.org,
jpoimboe@...hat.com, jeyu@...nel.org, alexei.starovoitov@...il.com
Subject: [PATCH -v5 17/17] x86/alternative: Use INT3_INSN_SIZE
Use INT3_INSN_SIZE instead of sizeof(int3).
Suggested-by: Ingo Molnar <mingo@...nel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
---
arch/x86/kernel/alternative.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
--- a/arch/x86/kernel/alternative.c
+++ b/arch/x86/kernel/alternative.c
@@ -1088,7 +1088,7 @@ static void text_poke_bp_batch(struct te
* First step: add a int3 trap to the address that will be patched.
*/
for (i = 0; i < nr_entries; i++)
- text_poke(text_poke_addr(&tp[i]), &int3, sizeof(int3));
+ text_poke(text_poke_addr(&tp[i]), &int3, INT3_INSN_SIZE);
text_poke_sync();
@@ -1098,10 +1098,10 @@ static void text_poke_bp_batch(struct te
for (do_sync = 0, i = 0; i < nr_entries; i++) {
int len = text_opcode_size(tp[i].opcode);
- if (len - sizeof(int3) > 0) {
- text_poke(text_poke_addr(&tp[i]) + sizeof(int3),
- (const char *)tp[i].text + sizeof(int3),
- len - sizeof(int3));
+ if (len - INT3_INSN_SIZE > 0) {
+ text_poke(text_poke_addr(&tp[i]) + INT3_INSN_SIZE,
+ (const char *)tp[i].text + INT3_INSN_SIZE,
+ len - INT3_INSN_SIZE);
do_sync++;
}
}
@@ -1123,7 +1123,7 @@ static void text_poke_bp_batch(struct te
if (tp[i].text[0] == INT3_INSN_OPCODE)
continue;
- text_poke(text_poke_addr(&tp[i]), tp[i].text, sizeof(int3));
+ text_poke(text_poke_addr(&tp[i]), tp[i].text, INT3_INSN_SIZE);
do_sync++;
}
Powered by blists - more mailing lists