From: Brian Gerst <brgerst@gmail.com>
To: x86@kernel.org, linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@kernel.org>, "H. Peter Anvin" <hpa@zytor.com>,
Denys Vlasenko <dvlasenk@redhat.com>,
Andy Lutomirski <luto@amacapital.net>,
Borislav Petkov <bp@suse.de>,
Thomas Gleixner <tglx@linutronix.de>
Subject: [PATCH 2/4] x86-32, kgdb: Don't use thread.ip in sleeping_thread_to_gdb_regs()
Date: Sat, 21 May 2016 12:04:49 -0400 [thread overview]
Message-ID: <1463846691-18498-3-git-send-email-brgerst@gmail.com> (raw)
In-Reply-To: <1463846691-18498-1-git-send-email-brgerst@gmail.com>
Match 64-bit and set gdb_regs[GDB_PC] to zero. thread.ip is always the
same point in the scheduler (except for newly forked processes), and will
be removed in a future patch.
Signed-off-by: Brian Gerst <brgerst@gmail.com>
---
arch/x86/kernel/kgdb.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/x86/kernel/kgdb.c b/arch/x86/kernel/kgdb.c
index 04cde52..fe649a5 100644
--- a/arch/x86/kernel/kgdb.c
+++ b/arch/x86/kernel/kgdb.c
@@ -172,7 +172,6 @@ void sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct task_struct *p)
gdb_regs[GDB_ES] = __KERNEL_DS;
gdb_regs[GDB_PS] = 0;
gdb_regs[GDB_CS] = __KERNEL_CS;
- gdb_regs[GDB_PC] = p->thread.ip;
gdb_regs[GDB_SS] = __KERNEL_DS;
gdb_regs[GDB_FS] = 0xFFFF;
gdb_regs[GDB_GS] = 0xFFFF;
@@ -180,7 +179,6 @@ void sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct task_struct *p)
gdb_regs32[GDB_PS] = *(unsigned long *)(p->thread.sp + 8);
gdb_regs32[GDB_CS] = __KERNEL_CS;
gdb_regs32[GDB_SS] = __KERNEL_DS;
- gdb_regs[GDB_PC] = 0;
gdb_regs[GDB_R8] = 0;
gdb_regs[GDB_R9] = 0;
gdb_regs[GDB_R10] = 0;
@@ -190,6 +188,7 @@ void sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct task_struct *p)
gdb_regs[GDB_R14] = 0;
gdb_regs[GDB_R15] = 0;
#endif
+ gdb_regs[GDB_PC] = 0;
gdb_regs[GDB_SP] = p->thread.sp;
}
--
2.5.5
next prev parent reply other threads:[~2016-05-21 16:05 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-21 16:04 [PATCH 0/4] x86: Rewrite switch_to() Brian Gerst
2016-05-21 16:04 ` [PATCH 1/4] x86: Save return value from kernel_thread Brian Gerst
2016-05-22 1:44 ` Andy Lutomirski
2016-05-22 2:19 ` Brian Gerst
2016-05-21 16:04 ` Brian Gerst [this message]
2016-05-23 17:05 ` [PATCH 2/4] x86-32, kgdb: Don't use thread.ip in sleeping_thread_to_gdb_regs() Andy Lutomirski
2016-05-21 16:04 ` [PATCH 3/4] x86: Rewrite switch_to() code Brian Gerst
2016-05-22 17:59 ` Andy Lutomirski
2016-05-22 19:31 ` Brian Gerst
2016-05-22 21:07 ` Andy Lutomirski
2016-05-23 2:34 ` Josh Poimboeuf
2016-05-23 4:47 ` Andy Lutomirski
2016-05-23 11:40 ` Josh Poimboeuf
2016-05-23 11:49 ` Brian Gerst
2016-05-23 12:05 ` Josh Poimboeuf
2016-05-23 11:14 ` Brian Gerst
2016-05-23 11:47 ` Josh Poimboeuf
2016-05-23 11:49 ` Josh Poimboeuf
2016-05-23 16:46 ` Josh Poimboeuf
2016-05-23 17:03 ` Andy Lutomirski
2016-05-23 18:44 ` Josh Poimboeuf
2016-07-12 14:16 ` Josh Poimboeuf
2016-06-15 1:31 ` Andy Lutomirski
2016-06-15 8:03 ` Ingo Molnar
2016-06-15 11:52 ` Brian Gerst
2016-05-21 16:04 ` [PATCH 4/4] x86: Pass kernel thread parameters in fork_frame Brian Gerst
2016-05-22 18:01 ` Andy Lutomirski
2016-05-22 19:21 ` Brian Gerst
2016-05-23 15:23 ` Josh Poimboeuf
2016-05-23 15:36 ` Andy Lutomirski
2016-05-23 21:04 ` Brian Gerst
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=1463846691-18498-3-git-send-email-brgerst@gmail.com \
--to=brgerst@gmail.com \
--cc=bp@suse.de \
--cc=dvlasenk@redhat.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=mingo@kernel.org \
--cc=tglx@linutronix.de \
--cc=x86@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;
as well as URLs for NNTP newsgroup(s).