From: Julien Grall <julien.grall@arm.com>
To: xen-devel@lists.xenproject.org
Cc: Julien Grall <julien.grall@arm.com>,
sstabellini@kernel.org, Julien Grall <julien.grall@linaro.org>
Subject: [PATCH 15/15] xen/arm: traps: Move the implementation of GUEST_BUG_ON in traps.h
Date: Mon, 16 Jul 2018 18:27:12 +0100 [thread overview]
Message-ID: <20180716172712.20294-16-julien.grall@arm.com> (raw)
In-Reply-To: <20180716172712.20294-1-julien.grall@arm.com>
GUEST_BUG_ON may be used in other files doing guest emulation.
Signed-off-by: Julien Grall <julien.grall@linaro.org>
---
xen/arch/arm/traps.c | 24 ------------------------
xen/include/asm-arm/traps.h | 24 ++++++++++++++++++++++++
2 files changed, 24 insertions(+), 24 deletions(-)
diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index d1bf69b245..6751e4d754 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -68,30 +68,6 @@ static inline void check_stack_alignment_constraints(void) {
#endif
}
-/*
- * GUEST_BUG_ON is intended for checking that the guest state has not been
- * corrupted in hardware and/or that the hardware behaves as we
- * believe it should (i.e. that certain traps can only occur when the
- * guest is in a particular mode).
- *
- * The intention is to limit the damage such h/w bugs (or spec
- * misunderstandings) can do by turning them into Denial of Service
- * attacks instead of e.g. information leaks or privilege escalations.
- *
- * GUEST_BUG_ON *MUST* *NOT* be used to check for guest controllable state!
- *
- * Compared with regular BUG_ON it dumps the guest vcpu state instead
- * of Xen's state.
- */
-#define guest_bug_on_failed(p) \
-do { \
- show_execution_state(guest_cpu_user_regs()); \
- panic("Guest Bug: %pv: '%s', line %d, file %s\n", \
- current, p, __LINE__, __FILE__); \
-} while (0)
-#define GUEST_BUG_ON(p) \
- do { if ( unlikely(p) ) guest_bug_on_failed(#p); } while (0)
-
#ifdef CONFIG_ARM_32
static int debug_stack_lines = 20;
#define stack_words_per_line 8
diff --git a/xen/include/asm-arm/traps.h b/xen/include/asm-arm/traps.h
index 70b52d1d16..0acf7de67d 100644
--- a/xen/include/asm-arm/traps.h
+++ b/xen/include/asm-arm/traps.h
@@ -9,6 +9,30 @@
# include <asm/arm64/traps.h>
#endif
+/*
+ * GUEST_BUG_ON is intended for checking that the guest state has not been
+ * corrupted in hardware and/or that the hardware behaves as we
+ * believe it should (i.e. that certain traps can only occur when the
+ * guest is in a particular mode).
+ *
+ * The intention is to limit the damage such h/w bugs (or spec
+ * misunderstandings) can do by turning them into Denial of Service
+ * attacks instead of e.g. information leaks or privilege escalations.
+ *
+ * GUEST_BUG_ON *MUST* *NOT* be used to check for guest controllable state!
+ *
+ * Compared with regular BUG_ON it dumps the guest vcpu state instead
+ * of Xen's state.
+ */
+#define guest_bug_on_failed(p) \
+do { \
+ show_execution_state(guest_cpu_user_regs()); \
+ panic("Guest Bug: %pv: '%s', line %d, file %s\n", \
+ current, p, __LINE__, __FILE__); \
+} while (0)
+#define GUEST_BUG_ON(p) \
+ do { if ( unlikely(p) ) guest_bug_on_failed(#p); } while (0)
+
int check_conditional_instr(struct cpu_user_regs *regs, const union hsr hsr);
void advance_pc(struct cpu_user_regs *regs, const union hsr hsr);
--
2.11.0
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2018-07-16 17:27 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-16 17:26 [PATCH 00/15] xen/arm: Bunch of clean-up/improvement Julien Grall
2018-07-16 17:26 ` [PATCH 01/15] xen/arm: cpregs: Allow HSR_CPREG* to receive more than 1 parameter Julien Grall
2018-08-14 21:47 ` Stefano Stabellini
2018-07-16 17:26 ` [PATCH 02/15] xen/arm: cpregs: Fix typo in the documentation of TTBCR Julien Grall
2018-08-14 20:39 ` Stefano Stabellini
2018-07-16 17:27 ` [PATCH 03/15] xen/arm: Introduce helpers to clear/flags flags in HCR_EL2 Julien Grall
2018-08-14 20:46 ` Stefano Stabellini
2018-08-14 21:23 ` Julien Grall
2018-08-14 21:49 ` Stefano Stabellini
2018-08-14 22:53 ` Julien Grall
2018-08-14 23:03 ` Stefano Stabellini
2018-07-16 17:27 ` [PATCH 04/15] xen/arm: p2m: Reduce the locking section in get_page_from_gva Julien Grall
2018-08-14 20:49 ` Stefano Stabellini
2018-07-16 17:27 ` [PATCH 05/15] xen/arm: p2m: Limit call to mem access code use " Julien Grall
2018-07-17 9:54 ` Razvan Cojocaru
2018-08-14 20:59 ` Stefano Stabellini
2018-07-16 17:27 ` [PATCH 06/15] xen/arm: Rework lpae_mapping Julien Grall
2018-08-14 21:04 ` Stefano Stabellini
2018-07-16 17:27 ` [PATCH 07/15] xen/arm: Rework lpae_table Julien Grall
2018-08-14 21:07 ` Stefano Stabellini
2018-07-16 17:27 ` [PATCH 08/15] xen/arm: Rename lpae_valid to lpae_is_valid Julien Grall
2018-08-14 21:09 ` Stefano Stabellini
2018-07-16 17:27 ` [PATCH 09/15] xen/arm: guest_walk: Use lpae_is_mapping to simplify the code Julien Grall
2018-08-14 21:14 ` Stefano Stabellini
2018-07-16 17:27 ` [PATCH 10/15] xen/arm: Introduce helpers to get/set an MFN from/to an LPAE entry Julien Grall
2018-08-14 21:25 ` Stefano Stabellini
2018-07-16 17:27 ` [PATCH 11/15] xen/arm: Allow lpae_is_{table, mapping} helpers to work on invalid entry Julien Grall
2018-08-14 21:33 ` Stefano Stabellini
2018-08-14 22:51 ` Julien Grall
2018-08-15 19:13 ` Stefano Stabellini
2018-08-16 8:51 ` Julien Grall
2018-07-16 17:27 ` [PATCH 12/15] xen/arm: p2m: Rename ret to mfn in p2m_lookup Julien Grall
2018-08-14 21:35 ` Stefano Stabellini
2018-07-16 17:27 ` [PATCH 13/15] xen/arm: p2m: Introduce a new variable removing_mapping in __p2m_set_entry Julien Grall
2018-08-14 21:37 ` Stefano Stabellini
2018-07-16 17:27 ` [PATCH 14/15] xen/arm: guest_walk_tables: Switch the return to bool Julien Grall
2018-08-14 21:41 ` Stefano Stabellini
2018-07-16 17:27 ` Julien Grall [this message]
2018-08-14 21:43 ` [PATCH 15/15] xen/arm: traps: Move the implementation of GUEST_BUG_ON in traps.h Stefano Stabellini
2018-08-16 8:54 ` Julien Grall
2018-08-16 18:17 ` Stefano Stabellini
2018-08-20 9:17 ` Julien Grall
2018-08-20 22:02 ` Stefano Stabellini
2018-07-23 17:12 ` [PATCH 00/15] xen/arm: Bunch of clean-up/improvement Julien Grall
2018-08-22 15:45 ` Julien Grall
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180716172712.20294-16-julien.grall@arm.com \
--to=julien.grall@arm.com \
--cc=julien.grall@linaro.org \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.