Message ID | 1462292138-4958-1-git-send-email-david.vrabel@citrix.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On 03/05/16 17:15, David Vrabel wrote: > When showing the CPU state (e.g., after a crash) the dump of code > around RIP is incorrect. > > Incorrect: > > Xen code around <ffff82d0801113cf> (...): > 00 c6 c1 ee 08 48 c1 e0 <04> 03 04 f1 8b ... > ^^ Uninitialized ^^ Missing 0x48 > > Correct: > > Xen code around <ffff82d0801113cf> (...): > 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 <david.vrabel@citrix.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com> CC'ing Wei for release ack. > --- > xen/arch/x86/traps.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c > index 8384158..0895441 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(); >
On Tue, May 03, 2016 at 05:19:26PM +0100, Andrew Cooper wrote: > On 03/05/16 17:15, David Vrabel wrote: > > When showing the CPU state (e.g., after a crash) the dump of code > > around RIP is incorrect. > > > > Incorrect: > > > > Xen code around <ffff82d0801113cf> (...): > > 00 c6 c1 ee 08 48 c1 e0 <04> 03 04 f1 8b ... > > ^^ Uninitialized ^^ Missing 0x48 > > > > Correct: > > > > Xen code around <ffff82d0801113cf> (...): > > 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 <david.vrabel@citrix.com> > > Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com> > > CC'ing Wei for release ack. Release-acked-by: Wei Liu <wei.liu2@citrix.com> > > > --- > > xen/arch/x86/traps.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c > > index 8384158..0895441 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(); > > >
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index 8384158..0895441 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();
When showing the CPU state (e.g., after a crash) the dump of code around RIP is incorrect. Incorrect: Xen code around <ffff82d0801113cf> (...): 00 c6 c1 ee 08 48 c1 e0 <04> 03 04 f1 8b ... ^^ Uninitialized ^^ Missing 0x48 Correct: Xen code around <ffff82d0801113cf> (...): 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 <david.vrabel@citrix.com> --- xen/arch/x86/traps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)