Commit 0f363b25 authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Ingo Molnar

x86: Fix off-by-one in instruction decoder

Stephane reported that the PEBS fixup was broken by the recent commit to
the instruction decoder. The thing had an off-by-one which resulted in
not being able to decode the last instruction and always bail.
Reported-by: default avatarStephane Eranian <>
Fixes: 6ba48ff4 ("x86: Remove arbitrary instruction size limit in instruction decoder")
Signed-off-by: default avatarPeter Zijlstra (Intel) <>
Cc: # 3.18
Cc: <>
Cc: Jiri Olsa <>
Cc: Liang Kan <>
Cc: Arnaldo Carvalho de Melo <>
Cc: Dave Hansen <>
Cc: Jim Keniston <>
Cc: Linus Torvalds <>
Cc: Masami Hiramatsu <>
Link: default avatarIngo Molnar <>
parent 300176af
......@@ -28,7 +28,7 @@
/* Verify next sizeof(t) bytes can be on the same instruction */
#define validate_next(t, insn, n) \
((insn)->next_byte + sizeof(t) + n < (insn)->end_kaddr)
((insn)->next_byte + sizeof(t) + n <= (insn)->end_kaddr)
#define __get_next(t, insn) \
({ t r = *(t*)insn->next_byte; insn->next_byte += sizeof(t); r; })
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