From patchwork Tue Jun 7 16:06:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 69518 Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp2056349qgf; Tue, 7 Jun 2016 09:08:01 -0700 (PDT) X-Received: by 10.55.197.221 with SMTP id k90mr182395qkl.89.1465315681457; Tue, 07 Jun 2016 09:08:01 -0700 (PDT) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id v70si14426058qkv.221.2016.06.07.09.08.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Jun 2016 09:08:01 -0700 (PDT) Received-SPF: neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) smtp.mailfrom=xen-devel-bounces@lists.xen.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bAJWd-0002Jm-Vr; Tue, 07 Jun 2016 16:06:43 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bAJWc-0002I9-V8 for xen-devel@lists.xen.org; Tue, 07 Jun 2016 16:06:43 +0000 Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id ED/7B-17405-211F6575; Tue, 07 Jun 2016 16:06:42 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrGLMWRWlGSWpSXmKPExsVysyfVTVfwY1i 4wc1L+hZLPi5mcWD0OLr7N1MAYxRrZl5SfkUCa8asbXdZCzZyVszf+Yq9gfEdexcjF4eQwAZG iSWdvawQzmlGifdHGti6GDk52AQ0Je58/sQEYosISEtc+3yZEcRmFmhmlFh4wA/EFhYIldhwu BksziKgKnH95i5WEJtXwFli3rsDLCC2hICcxMljk8HinAIuEm0PHoHNFwKqWfqrgXECI/cCRo ZVjOrFqUVlqUW6FnpJRZnpGSW5iZk5uoYGxnq5qcXFiempOYlJxXrJ+bmbGIH+ZQCCHYwX2p0 PMUpyMCmJ8n5+FhYuxJeUn1KZkVicEV9UmpNafIhRhoNDSYJX+h1QTrAoNT21Ii0zBxhoMGkJ Dh4lEd7tb4HSvMUFibnFmekQqVOMilLivEdAEgIgiYzSPLg2WHBfYpSVEuZlBDpEiKcgtSg3s wRV/hWjOAejkjDvd5ApPJl5JXDTXwEtZgJavOxaMMjikkSElFQDo4HGEZ7oeXOObboW2P410y 7jbqNqoP/RtSF913Z3frbuKSsX8ct6/InjR9lqIxtNh+SkuRuL57YpaQbp3ZB7dflA+/u9Qs3 vAh5WiFzpqVn97mONSfSrwn21Wh+fTzh3/dp8mSafCBaRLIbzecs9OGOE/Y88OLiz6/nEkpnf Z6tNy+OyTBYxUGIpzkg01GIuKk4EAHjouQtpAgAA X-Env-Sender: julien.grall@arm.com X-Msg-Ref: server-15.tower-31.messagelabs.com!1465315601!40269372!1 X-Originating-IP: [217.140.101.70] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.46; banners=-,-,- X-VirusChecked: Checked Received: (qmail 31747 invoked from network); 7 Jun 2016 16:06:41 -0000 Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-15.tower-31.messagelabs.com with SMTP; 7 Jun 2016 16:06:41 -0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 92BCCF; Tue, 7 Jun 2016 09:07:15 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.215.28]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 112F63F21A; Tue, 7 Jun 2016 09:06:39 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Tue, 7 Jun 2016 17:06:14 +0100 Message-Id: <1465315583-1278-8-git-send-email-julien.grall@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1465315583-1278-1-git-send-email-julien.grall@arm.com> References: <1465315583-1278-1-git-send-email-julien.grall@arm.com> Cc: andre.przywara@arm.com, Julien Grall , sstabellini@kernel.org, wei.chen@arm.com, steve.capper@arm.com Subject: [Xen-devel] [PATCH v3 07/16] xen/arm: arm64: Reserve a brk immediate to fault on purpose 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: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" It may not possible to return a proper error when encoding an instruction. Instead, a handcrafted instruction will be returned. Also, provide the encoding for the faulting instruction. Signed-off-by: Julien Grall Acked-by: Stefano Stabellini --- Changes in v2: - Add Stefano's acked-by --- xen/include/asm-arm/arm64/brk.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/xen/include/asm-arm/arm64/brk.h b/xen/include/asm-arm/arm64/brk.h index 7867b07..04442c4 100644 --- a/xen/include/asm-arm/arm64/brk.h +++ b/xen/include/asm-arm/arm64/brk.h @@ -12,8 +12,21 @@ /* * #imm16 values used for BRK instruction generation * 0x001: xen-mode BUG() and WARN() traps + * 0x002: for triggering a fault on purpose (reserved) */ #define BRK_BUG_FRAME_IMM 1 +#define BRK_FAULT_IMM 2 + +/* + * BRK instruction encoding + * The #imm16 value should be placed at bits[20:5] within BRK ins + */ +#define AARCH64_BREAK_MON 0xd4200000 + +/* + * BRK instruction for provoking a fault on purpose + */ +#define AARCH64_BREAK_FAULT (AARCH64_BREAK_MON | (BRK_FAULT_IMM << 5)) #endif /* !__ASM_ARM_ARM64_BRK */ /*