From patchwork Tue Jun 7 16:06:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 69531 Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp2056724qgf; Tue, 7 Jun 2016 09:08:41 -0700 (PDT) X-Received: by 10.176.65.161 with SMTP id 30mr123533uap.48.1465315699103; Tue, 07 Jun 2016 09:08:19 -0700 (PDT) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id 101si2497210uak.113.2016.06.07.09.08.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Jun 2016 09:08:19 -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 1bAJWc-0002Il-NV; Tue, 07 Jun 2016 16:06:42 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bAJWb-0002Fx-LA for xen-devel@lists.xen.org; Tue, 07 Jun 2016 16:06:41 +0000 Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id B7/EA-09289-011F6575; Tue, 07 Jun 2016 16:06:40 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrCLMWRWlGSWpSXmKPExsVysyfVTVfgY1i 4wcnHMhZLPi5mcWD0OLr7N1MAYxRrZl5SfkUCa8aT1TeZCm4KVsz7+JO5gfEtXxcjF4eQwCZG iU2n97NBOKcZJdbsnsvUxcjJwSagKXHn8ycwW0RAWuLa58uMIDazQDOjxMIDfl2MHBzCAnESV w9KgIRZBFQluif8ZQQJ8wo4S5w9mggSlhCQkzh5bDIriM0p4CLR9uARG4gtBFSy9FcD4wRG7g WMDKsY1YtTi8pSi3SN9ZKKMtMzSnITM3N0DQ2M9XJTi4sT01NzEpOK9ZLzczcxAn3LAAQ7GJu /OB1ilORgUhLl/fwsLFyILyk/pTIjsTgjvqg0J7X4EKMMB4eSBG/hO6CcYFFqempFWmYOMMhg 0hIcPEoivFkgad7igsTc4sx0iNQpRkUpcV4dkIQASCKjNA+uDRbYlxhlpYR5GYEOEeIpSC3Kz SxBlX/FKM7BqCTMawYyhSczrwRu+iugxUxAi5ddCwZZXJKIkJJqYCwVPxMan55kt4cvNuJ31N 8Ihgw3xo1NzIXGV8TeSRw7bcsT99aKd/tC28DstJitUvci36wvjmnkyKrcECWvFtbzd0mM6tL /XvtLA0+1SxpoJmrbPZrZ+3NSQZDWaZmrKRxbHsVvXMGhYnx6rV4VVw5bTvTL53sXJr3szpYt PPfxiIDrTb0EJZbijERDLeai4kQAAijQZGcCAAA= X-Env-Sender: julien.grall@arm.com X-Msg-Ref: server-2.tower-31.messagelabs.com!1465315599!44175506!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 22398 invoked from network); 7 Jun 2016 16:06:40 -0000 Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-2.tower-31.messagelabs.com with SMTP; 7 Jun 2016 16:06:40 -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 45E85434; Tue, 7 Jun 2016 09:07:14 -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 B10F73F21A; Tue, 7 Jun 2016 09:06:38 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Tue, 7 Jun 2016 17:06:13 +0100 Message-Id: <1465315583-1278-7-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 06/16] xen/arm: arm64: Move the define BRK_BUG_FRAME into a separate header 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" New immediates will be defined in the future. To keep track of the immediates allocated, gather all of them in a separate header. Also rename BRK_BUG_FRAME to BKR_BUG_FRAME_IMM. Signed-off-by: Julien Grall Reviewed-by: Stefano Stabellini --- Changes in v2: - Add Stefano's reviewed-by --- xen/arch/arm/traps.c | 2 +- xen/include/asm-arm/arm64/brk.h | 26 ++++++++++++++++++++++++++ xen/include/asm-arm/arm64/bug.h | 5 ++--- 3 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 xen/include/asm-arm/arm64/brk.h diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c index aa3e3c2..a4eedca 100644 --- a/xen/arch/arm/traps.c +++ b/xen/arch/arm/traps.c @@ -1203,7 +1203,7 @@ static void do_trap_brk(struct cpu_user_regs *regs, const union hsr hsr) switch (hsr.brk.comment) { - case BRK_BUG_FRAME: + case BRK_BUG_FRAME_IMM: if ( do_bug_frame(regs, regs->pc) ) goto die; diff --git a/xen/include/asm-arm/arm64/brk.h b/xen/include/asm-arm/arm64/brk.h new file mode 100644 index 0000000..7867b07 --- /dev/null +++ b/xen/include/asm-arm/arm64/brk.h @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2016 ARM Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#ifndef __ASM_ARM_ARM64_BRK +#define __ASM_ARM_ARM64_BRK + +/* + * #imm16 values used for BRK instruction generation + * 0x001: xen-mode BUG() and WARN() traps + */ +#define BRK_BUG_FRAME_IMM 1 + +#endif /* !__ASM_ARM_ARM64_BRK */ +/* + * Local variables: + * mode: C + * c-file-style: "BSD" + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ diff --git a/xen/include/asm-arm/arm64/bug.h b/xen/include/asm-arm/arm64/bug.h index 42b0e4f..59f664d 100644 --- a/xen/include/asm-arm/arm64/bug.h +++ b/xen/include/asm-arm/arm64/bug.h @@ -2,9 +2,8 @@ #define __ARM_ARM64_BUG_H__ #include +#include -#define BRK_BUG_FRAME 1 - -#define BUG_INSTR "brk " __stringify(BRK_BUG_FRAME) +#define BUG_INSTR "brk " __stringify(BRK_BUG_FRAME_IMM) #endif /* __ARM_ARM64_BUG_H__ */