xen/arm: arm64: Reserve a brk immediate to fault on purpose

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 <julien.grall@arm.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
This commit is contained in:
Julien Grall authored and Stefano Stabellini committed 2016-07-13 18:30:46 +01:00
1 parent 7a89a1f56a
commit c36eba84a1
1 file changed
+13
+13
View File
@@ -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 */
/*
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.