From: Chris Metcalf <cmetcalf@tilera.com>
To: Chris Metcalf <cmetcalf@tilera.com>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH] arch/tile: fix single-stepping over swint1 instructions on tilegx
Date: Thu, 29 Mar 2012 16:11:09 -0400 [thread overview]
Message-ID: <201203302105.q2UL57mo006302@farm-0012.internal.tilera.com> (raw)
In-Reply-To: <4F761E1C.80808.com>
If we are single-stepping and make a syscall, we call ptrace_notify()
explicitly on the return path back to user space, since we are returning
to a pc value set artificially to the next instruction, and otherwise
we won't register that we stepped over the syscall instruction (swint1).
Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
---
arch/tile/kernel/intvec_64.S | 21 ++++++++++++++++++---
1 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/arch/tile/kernel/intvec_64.S b/arch/tile/kernel/intvec_64.S
index 6a1ea82..cbf7334 100644
--- a/arch/tile/kernel/intvec_64.S
+++ b/arch/tile/kernel/intvec_64.S
@@ -22,6 +22,7 @@
#include <asm/irqflags.h>
#include <asm/asm-offsets.h>
#include <asm/types.h>
+#include <asm/signal.h>
#include <hv/hypervisor.h>
#include <arch/abi.h>
#include <arch/interrupts.h>
@@ -1047,11 +1048,25 @@ handle_syscall:
/* Do syscall trace again, if requested. */
ld r30, r31
- andi r30, r30, _TIF_SYSCALL_TRACE
- beqzt r30, 1f
+ andi r0, r30, _TIF_SYSCALL_TRACE
+ {
+ andi r0, r30, _TIF_SINGLESTEP
+ beqzt r0, 1f
+ }
jal do_syscall_trace
FEEDBACK_REENTER(handle_syscall)
-1: j .Lresume_userspace /* jump into middle of interrupt_return */
+ andi r0, r30, _TIF_SINGLESTEP
+
+1: beqzt r0, 2f
+
+ /* Single stepping -- notify ptrace. */
+ {
+ movei r0, SIGTRAP
+ jal ptrace_notify
+ }
+ FEEDBACK_REENTER(handle_syscall)
+
+2: j .Lresume_userspace /* jump into middle of interrupt_return */
.Lcompat_syscall:
/*
--
1.6.5.2
next prev parent reply other threads:[~2012-03-30 22:53 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <4F761E1C.80808.com>
2012-02-15 4:58 ` [PATCH] arch/tile: remove references to cpu_*_map Rusty Russell
2012-03-27 17:47 ` [PATCH] arch/tile/Kconfig: remove pointless "!M386" test Chris Metcalf
2012-03-27 17:53 ` [PATCH] arch/tile/Kconfig: rename tile_defconfig to tilepro_defconfig Chris Metcalf
2012-03-27 17:56 ` [PATCH] arch/tile/Kconfig: don't specify CONFIG_PAGE_OFFSET for 64-bit builds Chris Metcalf
2012-03-27 18:04 ` [PATCH] arch/tile: fix typo in <arch/spr_def.h> Chris Metcalf
2012-03-27 18:10 ` [PATCH] arch/tile: revert comment for atomic64_add_unless() Chris Metcalf
2012-03-30 21:19 ` Arun Sharma
2012-03-27 18:17 ` [PATCH] arch/tile: fix gcc 4.6 warnings in <asm/bitops_64.h> Chris Metcalf
2012-03-27 19:21 ` [PATCH] arch/tile: use 0 for IRQ_RESCHEDULE instead of 1 Chris Metcalf
2012-03-27 19:40 ` [PATCH] arch/tile: use interrupt critical sections less Chris Metcalf
2012-03-29 17:30 ` [PATCH] arch/tile: support building big-endian kernel Chris Metcalf
2012-03-29 17:39 ` [PATCH] arch/tile: optimize get_user/put_user and friends Chris Metcalf
2012-03-29 17:58 ` [PATCH] arch/tile: Allow tilegx to build with either 16K or 64K page size Chris Metcalf
2012-03-29 18:02 ` [PATCH] arch/tile: avoid false corrupt frame warning in early boot Chris Metcalf
2012-03-29 18:05 ` [PATCH] arch/tile: make sure to build memcpy_user_64 without frame pointer Chris Metcalf
2012-03-29 18:06 ` [PATCH] arch/tile: various improvements to stack backtracer Chris Metcalf
2012-03-29 18:52 ` [PATCH] arch/tile: work around a hardware issue with the return-address stack Chris Metcalf
2012-03-29 19:23 ` [PATCH] arch/tile: improve trap handling a bit Chris Metcalf
2012-03-29 19:25 ` [PATCH] arch/tile: support <asm/cachectl.h> header for cacheflush() syscall Chris Metcalf
2012-03-29 19:29 ` [PATCH] arch/tile: fix a couple of comments that needed updating Chris Metcalf
2012-03-29 19:30 ` [PATCH] arch/tile/Makefile: use KCFLAGS when figuring out the libgcc path Chris Metcalf
2012-03-29 19:34 ` [PATCH] arch/tile: don't wait for migrating PTEs in an NMI handler Chris Metcalf
2012-03-29 19:36 ` [PATCH] arch/tile: don't set the homecache of a PTE unless appropriate Chris Metcalf
2012-03-29 19:40 ` [PATCH] arch/tile: don't enable irqs unconditionally in page fault handler Chris Metcalf
2012-03-29 19:42 ` [PATCH] arch/tile: support loading kernels larger than 16 MB Chris Metcalf
2012-03-29 19:43 ` [PATCH] arch/tile: fix bug in delay_backoff() Chris Metcalf
2012-03-29 19:44 ` [PATCH] arch/tile: don't leak kernel memory when we unload modules Chris Metcalf
2012-03-29 19:48 ` [PATCH] arch/tile: support kexec() for tilegx Chris Metcalf
2012-03-29 19:50 ` [PATCH] arch/tile: fix up locking in pgtable.c slightly Chris Metcalf
2012-03-29 19:56 ` [PATCH] arch/tile: use memparse() for "maxmem" and "maxnodemem" options Chris Metcalf
2012-03-29 19:57 ` [PATCH] arch/tile: add "nop" after "nap" to help GX idle power draw Chris Metcalf
2012-03-29 19:59 ` [PATCH] arch/tile: implement panic_smp_self_stop() Chris Metcalf
2012-03-29 20:11 ` Chris Metcalf [this message]
2012-03-29 20:14 ` [PATCH] arch/tile: fix pointer cast in cacheflush.c Chris Metcalf
2012-03-29 20:19 ` [PATCH] arch/tile: export the page_home() function Chris Metcalf
2012-03-30 19:29 ` [PATCH] arch/tile: stop mentioning the "kvm" subdirectory Chris Metcalf
2012-03-30 19:46 ` [PATCH] arch/tile: use atomic exchange in arch_write_unlock() Chris Metcalf
2012-03-30 19:47 ` [PATCH] arch/tile: fix finv_buffer_remote() for tilegx Chris Metcalf
2012-03-30 19:55 ` [PATCH] arch/tile: fix a reference to cpu_possible_map in a comment Chris Metcalf
2012-03-30 20:01 ` [PATCH] arch/tile: fix hardwall for tilegx and generalize for idn and ipi Chris Metcalf
2012-03-30 20:21 ` [PATCH] arch/tile: allow querying cpu module information from the hypervisor Chris Metcalf
2012-03-30 20:24 ` [PATCH] arch/tile: return SIGBUS for addresses that are unaligned AND invalid Chris Metcalf
2012-03-30 20:27 ` [PATCH] arch/tile: remove bogus performance optimization Chris Metcalf
2012-03-30 20:29 ` [PATCH] arch/tile: avoid accidentally unmasking NMI-type interrupt accidentally Chris Metcalf
2012-03-30 20:31 ` [PATCH] arch/tile: add descriptive text if the kernel reports a bad trap Chris Metcalf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201203302105.q2UL57mo006302@farm-0012.internal.tilera.com \
--to=cmetcalf@tilera.com \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®