diff mbox series

[RFC,05/16] objtool: arm64: Handle hypercalls as nops

Message ID 20190516103655.5509-6-raphael.gault@arm.com (mailing list archive)
State RFC
Headers show
Series objtool: Add support for Arm64 | expand

Commit Message

Raphael Gault May 16, 2019, 10:36 a.m. UTC
We consider that the hypervisor/secure-monitor is behaving
correctly. This enables us to handle hvc/smc/svc context switching
instructions as nop since we consider that the context is restored
correctly. This enables us to get rid of the "unsupported instruction
in callable function" warning which is not really useful.

Note that those instruction/warnings are caused by hypervisor-related
calls.

Signed-off-by: Raphael Gault <raphael.gault@arm.com>
---
 tools/objtool/arch/arm64/decode.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/tools/objtool/arch/arm64/decode.c b/tools/objtool/arch/arm64/decode.c
index 721152342dd3..6c77ad1a08ec 100644
--- a/tools/objtool/arch/arm64/decode.c
+++ b/tools/objtool/arch/arm64/decode.c
@@ -577,8 +577,11 @@  int arm_decode_except_gen(u32 instr, unsigned char *type,
 	case INSN_SVC:
 	case INSN_HVC:
 	case INSN_SMC:
-		*immediate = imm16;
-		*type = INSN_CONTEXT_SWITCH;
+		/*
+		 * We consider that the context will be restored correctly
+		 * with an unchanged sp and the same general registers
+		 */
+		*type = INSN_NOP;
 		return 0;
 	case INSN_BRK:
 		if (imm16 == 0x800)