From: Julien Grall Date: Wed, 22 Jun 2016 11:15:22 +0000 (+0100) Subject: xen/arm: arm64: Reserve a brk immediate to fault on purpose X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~783 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=c36eba84a11f7cc4b40cd181d2f1215b105fc72b;p=xen.git 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 Acked-by: Stefano Stabellini --- diff --git a/xen/include/asm-arm/arm64/brk.h b/xen/include/asm-arm/arm64/brk.h index 7867b07359..04442c4b9f 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 */ /*