Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1693879 > unrolled thread

[PATCH 11/16] ARM: Advance the IT state on successful emulation of an UNDEF

Started byMarc Zyngier <marc.zyngier@arm.com>
First post2017-07-21 19:20 +0200
Last post2017-07-21 19:20 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 11/16] ARM: Advance the IT state on successful emulation of an UNDEF Marc Zyngier <marc.zyngier@arm.com> - 2017-07-21 19:20 +0200

#1693879 — [PATCH 11/16] ARM: Advance the IT state on successful emulation of an UNDEF

FromMarc Zyngier <marc.zyngier@arm.com>
Date2017-07-21 19:20 +0200
Subject[PATCH 11/16] ARM: Advance the IT state on successful emulation of an UNDEF
Message-ID<u5JKO-7DO-19@gated-at.bofh.it>
When trapping a conditional Thumb instruction, we need to
advance the IT state accordingly, or we'll end-up corrupting
the execution of a subsequent instruction.

Let's add calls to arm_advance_itstate() in the relevant
spots.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 arch/arm/kernel/traps.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index ca51e80a60b6..b697e9234a07 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -472,11 +472,14 @@ asmlinkage void __exception do_undefinstr(struct pt_regs *regs)
 		else
 			regs->ARM_pc +=4;
 
+		arm_advance_itstate(regs);
 		return;
 	}
 
-	if (call_undef_hook(regs, instr) == 0)
+	if (call_undef_hook(regs, instr) == 0) {
+		arm_advance_itstate(regs);
 		return;
+	}
 
 die_sig:
 #ifdef CONFIG_DEBUG_USER
-- 
2.11.0

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web