From: David Vrabel Date: Tue, 3 May 2016 16:15:38 +0000 (+0100) Subject: x86: show correct code in CPU state X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~1173 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=1ca472c7208a7f72ab8a61aa7fe5fe1954fc345b;p=xen.git x86: show correct code in CPU state When showing the CPU state (e.g., after a crash) the dump of code around RIP is incorrect. Incorrect: Xen code around (...): 00 c6 c1 ee 08 48 c1 e0 <04> 03 04 f1 8b ... ^^ Uninitialized ^^ Missing 0x48 Correct: Xen code around (...): c6 c1 ee 08 48 c1 e0 04 <48> 03 04 f1 8b ... When coping the bytes before RIP, the destination was off-by-one. Signed-off-by: David Vrabel Reviewed-by: Andrew Cooper Release-acked-by: Wei Liu --- diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index 8384158455..08954412f8 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -150,7 +150,7 @@ static void show_code(const struct cpu_user_regs *regs) : "=&c" (missing_before), "=&D" (tmp), "=&S" (tmp) : "0" (ARRAY_SIZE(insns_before)), - "1" (insns_before + ARRAY_SIZE(insns_before)), + "1" (insns_before + ARRAY_SIZE(insns_before) - 1), "2" (regs->rip - 1)); clac();