[Linux-Xtensa] [PATCH 5/5] xtensa: allow single-stepping through unaligned load/store

Max Filippov jcmvbkbc at gmail.com
Mon Aug 4 21:29:41 UTC 2014


Update icount when icountlevel is non-zero but not greater than EXCM level
when load/store instruction is successfully emulated. This allows
single-stepping over such instruction in userspace debugger.

Signed-off-by: Max Filippov <jcmvbkbc at gmail.com>
---
 arch/xtensa/kernel/align.S | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/xtensa/kernel/align.S b/arch/xtensa/kernel/align.S
index 87d80d8..890004a 100644
--- a/arch/xtensa/kernel/align.S
+++ b/arch/xtensa/kernel/align.S
@@ -421,6 +421,14 @@ ENTRY(fast_unaligned)
 
 1:	wsr	a7, epc1		# skip emulated instruction
 
+	/* Update icount if we're single-stepping in userspace. */
+	rsr	a4, icountlevel
+	beqz	a4, 1f
+	bgeui	a4, LOCKLEVEL + 1, 1f
+	rsr	a4, icount
+	addi	a4, a4, 1
+	wsr	a4, icount
+1:
 	movi	a4, 0
 	rsr	a3, excsave1
 	s32i	a4, a3, EXC_TABLE_FIXUP
-- 
1.8.1.4



More information about the linux-xtensa mailing list