From patchwork Tue Dec 13 19:08:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 9473001 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9A97B60476 for ; Tue, 13 Dec 2016 19:11:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9303828470 for ; Tue, 13 Dec 2016 19:11:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 857E32866A; Tue, 13 Dec 2016 19:11:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 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.wl.linuxfoundation.org (Postfix) with ESMTPS id 2733A28470 for ; Tue, 13 Dec 2016 19:11:27 +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 1cGsRS-0002H1-TX; Tue, 13 Dec 2016 19:08:46 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cGsRR-0002Gr-Cj for xen-devel@lists.xenproject.org; Tue, 13 Dec 2016 19:08:45 +0000 Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id C0/F8-16730-C3740585; Tue, 13 Dec 2016 19:08:44 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrBIsWRWlGSWpSXmKPExsVybKJsh66Ne0C Ewbld7Bbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8bcvTdYC7pYK9qXrWRtYOxl6WLk4hASmMoo MXHyDkYIZzaTxJcTZ1i7GDk5WAS0JR50/WYGsdkEDCX+PtnE1sXIwSEBZC/5zAESFhFQkri3a jITiM0sYCCx5dkPdhBbWEBT4tGpPYwg5bwCXhI7ewtBwqICuhKH/v1hA7F5BQQlTs58wgLRqi WxfPo2MFtCIENiXs8cVgjbS2LRjUtQtprE1XObmCcw8s9C0j4LSfsCRqZVjOrFqUVlqUW6lnp JRZnpGSW5iZk5uoYGxnq5qcXFiempOYlJxXrJ+bmbGIGhVs/AwLiD8fVPp0OMkhxMSqK8b+wD IoT4kvJTKjMSizPii0pzUosPMcpwcChJ8Mq7AeUEi1LTUyvSMnOAQQ+TluDgURLhLXUFSvMWF yTmFmemQ6ROMepyHHi/4imTEEtefl6qlDivAsgMAZCijNI8uBGwCLzEKCslzMvIwMAgxFOQWp SbWYIq/4pRnINRSZh3O8gqnsy8ErhNr4COYAI6QnSJP8gRJYkIKakGRo6dLwzvKQmzuXI2LPM qnXaL/QnnlskVfRfKRP8ab9uXdz4inf3Zkm81HHsk9j/adDI9NDB79tpCdQuJV7+6FVbkZh7c 9uf/rvX9x6cLTd+0XCq/dd/vQwabT37pk3qyx8an/bWnn/BOzmOqrUw8bK3majemZwjzv+tSF 6p/sUZX4f6FKyq/ZyixFGckGmoxFxUnAgAXvRr8uwIAAA== X-Env-Sender: sstabellini@kernel.org X-Msg-Ref: server-5.tower-31.messagelabs.com!1481656122!72717361!1 X-Originating-IP: [198.145.29.136] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.1.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 22178 invoked from network); 13 Dec 2016 19:08:43 -0000 Received: from mail.kernel.org (HELO mail.kernel.org) (198.145.29.136) by server-5.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 13 Dec 2016 19:08:43 -0000 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 47A492042C; Tue, 13 Dec 2016 19:08:41 +0000 (UTC) Received: from [10.1.10.56] (96-82-76-110-static.hfc.comcastbusiness.net [96.82.76.110]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1ABB220382; Tue, 13 Dec 2016 19:08:40 +0000 (UTC) Date: Tue, 13 Dec 2016 11:08:39 -0800 (PST) From: Stefano Stabellini X-X-Sender: sstabellini@sstabellini-ThinkPad-X260 To: xen-devel@lists.xenproject.org Message-ID: User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 X-Virus-Scanned: ClamAV using ClamSMTP Cc: julien.grall@arm.com, sstabellini@kernel.org Subject: [Xen-devel] [PATCH] fix LDRB Thumb2 decoding 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-Virus-Scanned: ClamAV using ClamSMTP Rt is four bit at offset 12, not three. See see encoding T2 for LDRB A8.8.70 in ARM DDI 0406C.c Suggested-by: Julien Grall Signed-off-by: Stefano Stabellini Reviewed-by: Julien Grall diff --git a/xen/arch/arm/decode.c b/xen/arch/arm/decode.c index c6f49a5..514b7a2 100644 --- a/xen/arch/arm/decode.c +++ b/xen/arch/arm/decode.c @@ -41,7 +41,7 @@ static int decode_thumb2(register_t pc, struct hsr_dabt *dabt, uint16_t hw1) if ( raw_copy_from_guest(&hw2, (void *__user)(pc + 2), sizeof (hw2)) ) return -EFAULT; - rt = (hw2 >> 12) & 0x7; + rt = (hw2 >> 12) & 0xf; switch ( (hw1 >> 9) & 0xf ) {