From patchwork Wed Jun 22 11:15:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 70629 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp2492613qgy; Wed, 22 Jun 2016 04:17:43 -0700 (PDT) X-Received: by 10.159.36.65 with SMTP id 59mr11607824uaq.71.1466594260816; Wed, 22 Jun 2016 04:17:40 -0700 (PDT) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id s85si30461378vke.16.2016.06.22.04.17.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Jun 2016 04:17:40 -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 1bFg8K-0002Ku-P5; Wed, 22 Jun 2016 11:15:48 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bFg8I-0002G7-13 for xen-devel@lists.xen.org; Wed, 22 Jun 2016 11:15:46 +0000 Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id 29/E1-28354-1637A675; Wed, 22 Jun 2016 11:15:45 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrGLMWRWlGSWpSXmKPExsVysyfVTTehOCv cYOciQ4slHxezODB6HN39mymAMYo1My8pvyKBNWPWtrusBRs5K+bvfMXewPiOvYuRi0NIYBOj xPINu1khnNOMErP6NzF3MXJysAloStz5/IkJxBYRkJa49vkyI4jNLOAg8ebjPRYQW1ggVOL9k /dgNSwCqhK//7SD2bwCLhLz2ueyg9gSAnISJ49NZgWxOQVcJU4enQw2Rwio5vaBPawTGLkXMD KsYlQvTi0qSy3SNdZLKspMzyjJTczM0TU0MNbLTS0uTkxPzUlMKtZLzs/dxAj0LwMQ7GBs/uJ 0iFGSg0lJlFdeOStciC8pP6UyI7E4I76oNCe1+BCjDAeHkgSvTRFQTrAoNT21Ii0zBxhoMGkJ Dh4lEd46kDRvcUFibnFmOkTqFKOilDgvH0hCACSRUZoH1wYL7kuMslLCvIxAhwjxFKQW5WaWo Mq/YhTnYFQS5hUBmcKTmVcCN/0V0GImoMXL+tNBFpckIqSkGhhr7p9fJ2xo++VGZ92F7+oHgm J4jqid0Ztt2Glnud3nbFL3mmNtn/Teft7N1nIzzOn6pD1M4ac43HQutR5ceiL9F8Mjp383vrX MM7+5qvmrq0v9Bi+1utj+xqKN9zbNWvLmaLuHEfPl1W1sVdaO8+5cSq2KYvbZUlrw+ktR7C7F f82/dxQ2rLBSYinOSDTUYi4qTgQApgHUcmkCAAA= X-Env-Sender: julien.grall@arm.com X-Msg-Ref: server-9.tower-31.messagelabs.com!1466594144!9936372!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 21875 invoked from network); 22 Jun 2016 11:15:44 -0000 Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-9.tower-31.messagelabs.com with SMTP; 22 Jun 2016 11:15:44 -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 F1BD4440; Wed, 22 Jun 2016 04:16:30 -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 65CAD3F213; Wed, 22 Jun 2016 04:15:43 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Wed, 22 Jun 2016 12:15:22 +0100 Message-Id: <1466594130-19251-8-git-send-email-julien.grall@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1466594130-19251-1-git-send-email-julien.grall@arm.com> References: <1466594130-19251-1-git-send-email-julien.grall@arm.com> Cc: Julien Grall , sstabellini@kernel.org Subject: [Xen-devel] [PATCH v4 07/15] 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 */ /*