From patchwork Tue May 3 16:15:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Vrabel X-Patchwork-Id: 9006181 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 731AEBF29F for ; Tue, 3 May 2016 16:18:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AE5742022A for ; Tue, 3 May 2016 16:18:18 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D0FA820122 for ; Tue, 3 May 2016 16:18:17 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1axczI-0007CC-L7; Tue, 03 May 2016 16:15:52 +0000 Received: from mail6.bemta6.messagelabs.com ([85.158.143.247]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1axczH-0007C6-M2 for xen-devel@lists.xenproject.org; Tue, 03 May 2016 16:15:51 +0000 Received: from [85.158.143.35] by server-2.bemta-6.messagelabs.com id 66/92-09532-6BEC8275; Tue, 03 May 2016 16:15:50 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrKLMWRWlGSWpSXmKPExsXitHRDpO62cxr hBne2Klt83zKZyYHR4/CHKywBjFGsmXlJ+RUJrBnz7/sUPOOouLn2PmsD41a2LkZODgkBf4m7 72+zg9hsAjoSj5fMALI5OEQEVCRu7zUACTMLlEt0rWhhArGFBewkFk17yQZSwgJUsneeCkiYV 8BNYsqLe6wQE+Ukzh//yQxiCwGVfFy7ihWiRlDi5MwnLBAjJSQOvnjBDFHPLXH79FTmCYw8s5 CUzUJStoCRaRWjenFqUVlqka6RXlJRZnpGSW5iZo6uoYGZXm5qcXFiempOYlKxXnJ+7iZGYHA wAMEOxmV/nQ4xSnIwKYny/liiES7El5SfUpmRWJwRX1Sak1p8iFGGg0NJgvf0WaCcYFFqempF WmYOMExh0hIcPEoivDwgad7igsTc4sx0iNQpRkUpcV5/kIQASCKjNA+uDRYblxhlpYR5GYEOE eIpSC3KzSxBlX/FKM7BqCTMexdkCk9mXgnc9FdAi5mAFmevVwVZXJKIkJJqYIzY4/Mt/ghHw/ lleyfOqFyw9MEGpZoHS7KybrKvNTvxPyu6Wq5CWfqF/b/nK/K9JsSYloXf71ux8IGVX5RxWbT HO+OorY2VX1rfLfzCWxjJ8VqY6674rNTKrsRywQ/dczZHnT1axMviFyvtF7N8p6Uk//dN8/Y/ D/AzkZl/QfqOXF3a3n0uOUosxRmJhlrMRcWJADhg/5uIAgAA X-Env-Sender: prvs=9242e7d23=david.vrabel@citrix.com X-Msg-Ref: server-8.tower-21.messagelabs.com!1462292149!12379577!1 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 8.34; banners=-,-,- X-VirusChecked: Checked Received: (qmail 63265 invoked from network); 3 May 2016 16:15:50 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-8.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 3 May 2016 16:15:50 -0000 X-IronPort-AV: E=Sophos;i="5.24,573,1454976000"; d="scan'208";a="351420609" From: David Vrabel To: Date: Tue, 3 May 2016 17:15:38 +0100 Message-ID: <1462292138-4958-1-git-send-email-david.vrabel@citrix.com> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 X-DLP: MIA2 Cc: Andrew Cooper , David Vrabel , Jan Beulich Subject: [Xen-devel] [PATCHv1 for-4.7] x86: show correct code in CPU state X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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();