From: Dan Aloni <da-x@monatomic.org>
To: Joe Korty <joe.korty@ccur.com>
Cc: Keith Owens <kaos@sgi.com>, Nathan Scott <nathans@sgi.com>,
kdb@oss.sgi.com, linux-kernel@vger.kernel.org
Subject: Re: Announce: kdb v4.4 is available for kernel 2.6.16
Date: Sun, 2 Apr 2006 13:23:50 +0300 [thread overview]
Message-ID: <20060402102350.GA4671@localdomain> (raw)
In-Reply-To: <20060401234313.GA22482@tsunami.ccur.com>
On Sat, Apr 01, 2006 at 06:43:13PM -0500, Joe Korty wrote:
> On Sat, Apr 01, 2006 at 08:04:30PM +0300, Dan Aloni wrote:
> > > Current versions are :-
> > >
> > > kdb-v4.4-2.6.16-common-1.bz2
> > > kdb-v4.4-2.6.16-i386-1.bz2
> > > kdb-v4.4-2.6.16-ia64-1.bz2
> >
> > Thanks for this new version, however I'm looking forward to see
> > kdb maintained also for the x86_64 architecture. Currently I have
> > got as far as forward-porting it to a level where it "works" except
> > for one annoying issue where setjmp/longjmp looks to be broken:
>
> Problem is due to the mixed C/asm implementation of setjmp/longjmp.
> Replace that with one written entirely in assemply and it will work.
> Here's mine:
Thanks, it's obviously a better way to do it, I've tested it and
made it into a patch:
diff --git a/arch/x86_64/kdb/kdbasupport.c b/arch/x86_64/kdb/kdbasupport.c
index 57c2a72..1be4909 100644
--- a/arch/x86_64/kdb/kdbasupport.c
+++ b/arch/x86_64/kdb/kdbasupport.c
@@ -1029,71 +1029,41 @@ kdba_clearsinglestep(struct pt_regs *reg
regs->eflags &= ~EF_IE;
}
-#ifdef KDB_HAVE_LONGJMP
-int asmlinkage
-kdba_setjmp(kdb_jmp_buf *jb)
-{
-#if defined(CONFIG_FRAME_POINTER)
- __asm__("movq %rbx, (0*8)(%rdi);"
- "movq %rbp, (1*8)(%rdi);"
- "movq %r12, (2*8)(%rdi);"
- "movq %r13, (3*8)(%rdi);"
- "movq %r14, (4*8)(%rdi);"
- "movq %r15, (5*8)(%rdi);"
- "leaq 16(%rsp), %rdx;"
- "movq %rdx, (6*8)(%rdi);"
- "movq (%rsp), %rax;"
- "movq %rax, (7*8)(%rdi)");
-#else /* CONFIG_FRAME_POINTER */
- __asm__("movq %rbx, (0*8)(%rdi);"
- "movq %rbp, (1*8)(%rdi);"
- "movq %r12, (2*8)(%rdi);"
- "movq %r13, (3*8)(%rdi);"
- "movq %r14, (4*8)(%rdi);"
- "movq %r15, (5*8)(%rdi);"
- "leaq 8(%rsp), %rdx;"
- "movq %rdx, (6*8)(%rdi);"
- "movq (%rsp), %rax;"
- "movq %rax, (7*8)(%rdi)");
-#endif /* CONFIG_FRAME_POINTER */
- KDB_STATE_SET(LONGJMP);
- return 0;
-}
-
-void asmlinkage
-kdba_longjmp(kdb_jmp_buf *jb, int reason)
-{
-#if defined(CONFIG_FRAME_POINTER)
- __asm__("movq (0*8)(%rdi),%rbx;"
- "movq (1*8)(%rdi),%rbp;"
- "movq (2*8)(%rdi),%r12;"
- "movq (3*8)(%rdi),%r13;"
- "movq (4*8)(%rdi),%r14;"
- "movq (5*8)(%rdi),%r15;"
- "test %esi,%esi;"
- "mov $01,%eax;"
- "cmove %eax,%esi;"
- "mov %esi, %eax;"
- "movq (7*8)(%rdi),%rdx;"
- "movq (6*8)(%rdi),%rsp;"
- "jmpq *%rdx");
-#else /* CONFIG_FRAME_POINTER */
- __asm__("movq (0*8)(%rdi),%rbx;"
- "movq (1*8)(%rdi),%rbp;"
- "movq (2*8)(%rdi),%r12;"
- "movq (3*8)(%rdi),%r13;"
- "movq (4*8)(%rdi),%r14;"
- "movq (5*8)(%rdi),%r15;"
- "test %esi,%esi;"
- "mov $01,%eax;"
- "cmove %eax,%esi;"
- "mov %esi, %eax;"
- "movq (7*8)(%rdi),%rdx;"
- "movq (6*8)(%rdi),%rsp;"
- "jmpq *%rdx");
-#endif /* CONFIG_FRAME_POINTER */
-}
-#endif /* KDB_HAVE_LONGJMP */
+asm(
+" .section .text\n"
+" .globl kdba_setjmp\n"
+" .p2align 4\n"
+"kdba_setjmp:\n"
+" movq %rbx,0x0(%rdi)\n"
+" movq %rbp,0x8(%rdi)\n"
+" movq %r12,0x10(%rdi)\n"
+" movq %r13,0x18(%rdi)\n"
+" movq %r14,0x20(%rdi)\n"
+" movq %r15,0x28(%rdi)\n"
+" leaq 0x8(%rsp),%rdx\n"
+" movq %rdx,0x30(%rdi)\n"
+" movq (%rsp),%rax\n"
+" movq %rax,0x38(%rdi)\n"
+" xorq %rax,%rax\n"
+" ret\n"
+" \n"
+" .globl kdba_longjmp\n"
+"kdba_longjmp:\n"
+" movq 0x0(%rdi),%rbx\n"
+" movq 0x8(%rdi),%rbp\n"
+" movq 0x10(%rdi),%r12\n"
+" movq 0x18(%rdi),%r13\n"
+" movq 0x20(%rdi),%r14\n"
+" movq 0x28(%rdi),%r15\n"
+" test %esi,%esi\n"
+" mov $1,%eax\n"
+" cmove %eax,%esi\n"
+" mov %esi,%eax\n"
+" movq 0x38(%rdi),%rdx\n"
+" movq 0x30(%rdi),%rsp\n"
+" jmpq *%rdx\n"
+" .previous\n"
+);
/*
* kdba_enable_lbr
--
Dan Aloni, Linux specialist
XIV LTD, http://www.xivstorage.com
da-x@monatomic.org, da-x@colinux.org, da-x@gmx.net, dan@xiv.co.il
next prev parent reply other threads:[~2006-04-02 10:22 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-24 5:48 Announce: kdb v4.4 is available for kernel 2.6.6 Keith Owens
2004-05-24 5:48 ` Keith Owens
2004-06-01 21:20 ` Thomas Duffy
2004-06-01 21:20 ` Thomas Duffy
2004-07-16 4:59 ` Keith Owens
2004-07-16 4:59 ` Keith Owens
2004-06-07 5:40 ` Announce: kdb v4.4 is available for kernel 2.6.7-rc2 Keith Owens
2004-06-07 5:40 ` Keith Owens
2004-06-17 1:16 ` Announce: kdb v4.4 is available for kernel 2.6.7 Keith Owens
2004-06-17 1:16 ` Keith Owens
2004-10-21 3:52 ` Announce: kdb v4.4 is available for kernel 2.6.9 Keith Owens
2004-10-21 3:52 ` Keith Owens
2004-12-25 12:17 ` Announce: kdb v4.4 is available for kernel 2.6.10 Keith Owens
2004-12-25 12:17 ` Keith Owens
2004-12-27 13:00 ` Paulo Marques
2005-01-24 15:21 ` gowda_avinash
2005-01-24 15:21 ` gowda_avinash
2005-01-24 15:34 ` Keith Owens
2005-01-24 15:34 ` Keith Owens
2005-01-25 4:25 ` Saravanan s
2005-01-25 4:37 ` Saravanan s
2005-01-25 4:44 ` Keith Owens
2005-01-25 4:44 ` Keith Owens
2005-01-25 5:52 ` Jack F Vogel
2005-01-25 5:52 ` Jack F Vogel
2005-03-03 2:53 ` Announce: kdb v4.4 is available for kernel 2.6.11 Keith Owens
2005-03-03 2:53 ` Keith Owens
2005-06-18 6:19 ` Announce: kdb v4.4 is available for kernel 2.6.12 Keith Owens
2005-06-18 6:19 ` Keith Owens
2005-08-29 2:12 ` Announce: kdb v4.4 is available for kernel 2.6.13 Keith Owens
2005-08-29 2:12 ` Keith Owens
2005-09-20 7:32 ` Announce: kdb v4.4 is available for kernel 2.6.14-rc1 Keith Owens
2005-09-21 6:21 ` Announce: kdb v4.4 is available for kernel 2.6.14-rc2 Keith Owens
2005-09-21 6:21 ` Keith Owens
2005-10-28 7:29 ` Announce: kdb v4.4 is available for kernel 2.6.14 Keith Owens
2005-10-28 7:29 ` Keith Owens
2006-01-04 9:10 ` Announce: kdb v4.4 is available for kernel 2.6.15 Keith Owens
2006-01-04 9:10 ` Keith Owens
2006-01-04 15:04 ` Jeff V. Merkey
2006-01-04 15:04 ` Jeff V. Merkey
2006-03-21 5:59 ` Announce: kdb v4.4 is available for kernel 2.6.16 Keith Owens
2006-03-21 5:59 ` Keith Owens
2006-04-01 17:04 ` Dan Aloni
2006-04-01 20:37 ` Hugh Dickins
2006-04-01 23:43 ` Joe Korty
2006-04-02 10:23 ` Dan Aloni [this message]
2006-03-24 6:21 ` Keith Owens
2006-03-24 6:21 ` Keith Owens
2006-06-27 11:45 ` Announce: kdb v4.4 is available for kernel 2.6.17 Keith Owens
2006-06-27 11:45 ` Keith Owens
2006-06-27 12:06 ` Nigel Cunningham
2006-06-27 12:06 ` Nigel Cunningham
2006-09-20 5:37 ` Announce: kdb v4.4 is available for kernel 2.6.18 Keith Owens
2006-09-20 5:37 ` Keith Owens
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=20060402102350.GA4671@localdomain \
--to=da-x@monatomic.org \
--cc=joe.korty@ccur.com \
--cc=kaos@sgi.com \
--cc=kdb@oss.sgi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nathans@sgi.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.