Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/cddl/osnet Import fix from FreeBSD - see [1], [2] r...



details:   https://anonhg.NetBSD.org/src/rev/674152a839be
branches:  trunk
changeset: 346076:674152a839be
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Thu Jun 23 04:35:35 2016 +0000

description:
Import fix from FreeBSD - see [1], [2] references below...

Fix DTrace's panic() action.

It would previously call into some unfinished Solaris compatibility code
and return without actually calling panic(9). The compatibility code is
unneeded, however, so just remove it and have dtrace_panic() call vpanic(9)
directly.

Fixes immediate problem in PR-51265.  However, this now reveals another
redefined symbol 'strpbrk' in the required module "solaris".


[1] https://svnweb.freebsd.org/changeset/base/281916
[2] http://lists.freebsd.org/pipermail/svn-src-head/2015-April/071019.html

diffstat:

 external/cddl/osnet/dev/dtrace/amd64/dtrace_asm.S   |  210 +-------------------
 external/cddl/osnet/dev/dtrace/arm/dtrace_asm.S     |   17 -
 external/cddl/osnet/dev/dtrace/dtrace_hacks.c       |    5 +-
 external/cddl/osnet/dev/dtrace/i386/dtrace_asm.S    |  166 +---------------
 external/cddl/osnet/dist/uts/common/dtrace/dtrace.c |    4 +
 5 files changed, 7 insertions(+), 395 deletions(-)

diffs (truncated from 458 to 300 lines):

diff -r 07613cc57878 -r 674152a839be external/cddl/osnet/dev/dtrace/amd64/dtrace_asm.S
--- a/external/cddl/osnet/dev/dtrace/amd64/dtrace_asm.S Thu Jun 23 03:58:13 2016 +0000
+++ b/external/cddl/osnet/dev/dtrace/amd64/dtrace_asm.S Thu Jun 23 04:35:35 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dtrace_asm.S,v 1.5 2015/05/18 14:41:41 christos Exp $  */
+/*     $NetBSD: dtrace_asm.S,v 1.6 2016/06/23 04:35:35 pgoyette Exp $  */
 
 /*
  * CDDL HEADER START
@@ -364,211 +364,3 @@
        popfq
        ret
        END(dtrace_interrupt_enable)
-
-/*
- * The panic() and cmn_err() functions invoke vpanic() as a common entry point
- * into the panic code implemented in panicsys().  vpanic() is responsible
- * for passing through the format string and arguments, and constructing a
- * regs structure on the stack into which it saves the current register
- * values.  If we are not dying due to a fatal trap, these registers will
- * then be preserved in panicbuf as the current processor state.  Before
- * invoking panicsys(), vpanic() activates the first panic trigger (see
- * common/os/panic.c) and switches to the panic_stack if successful.  Note that
- * DTrace takes a slightly different panic path if it must panic from probe
- * context.  Instead of calling panic, it calls into dtrace_vpanic(), which
- * sets up the initial stack as vpanic does, calls dtrace_panic_trigger(), and
- * branches back into vpanic().
- */
-
-/*
-void
-vpanic(const char *format, va_list alist)
-*/
-       ENTRY(vpanic)                           /* Initial stack layout: */
-       
-       pushq   %rbp                            /* | %rip |     0x60    */
-       movq    %rsp, %rbp                      /* | %rbp |     0x58    */
-       pushfq                                  /* | rfl  |     0x50    */
-       pushq   %r11                            /* | %r11 |     0x48    */
-       pushq   %r10                            /* | %r10 |     0x40    */
-       pushq   %rbx                            /* | %rbx |     0x38    */
-       pushq   %rax                            /* | %rax |     0x30    */
-       pushq   %r9                             /* | %r9  |     0x28    */
-       pushq   %r8                             /* | %r8  |     0x20    */
-       pushq   %rcx                            /* | %rcx |     0x18    */
-       pushq   %rdx                            /* | %rdx |     0x10    */
-       pushq   %rsi                            /* | %rsi |     0x8 alist */
-       pushq   %rdi                            /* | %rdi |     0x0 format */
-
-       movq    %rsp, %rbx                      /* %rbx = current %rsp */
-
-       leaq    panic_quiesce(%rip), %rdi       /* %rdi = &panic_quiesce */
-       call    panic_trigger                   /* %eax = panic_trigger() */
-
-vpanic_common:
-       /*
-        * The panic_trigger result is in %eax from the call above, and
-        * dtrace_panic places it in %eax before branching here.
-        * The rdmsr instructions that follow below will clobber %eax so
-        * we stash the panic_trigger result in %r11d.
-        */
-       movl    %eax, %r11d
-       cmpl    $0, %r11d
-       je      0f
-
-       /*
-        * If panic_trigger() was successful, we are the first to initiate a
-        * panic: we now switch to the reserved panic_stack before continuing.
-        */
-       leaq    panic_stack(%rip), %rsp
-       addq    $PANICSTKSIZE, %rsp
-0:     subq    $REGSIZE, %rsp
-       /*
-        * Now that we've got everything set up, store the register values as
-        * they were when we entered vpanic() to the designated location in
-        * the regs structure we allocated on the stack.
-        */
-#ifdef notyet
-       movq    0x0(%rbx), %rcx
-       movq    %rcx, REGOFF_RDI(%rsp)
-       movq    0x8(%rbx), %rcx
-       movq    %rcx, REGOFF_RSI(%rsp)
-       movq    0x10(%rbx), %rcx
-       movq    %rcx, REGOFF_RDX(%rsp)
-       movq    0x18(%rbx), %rcx
-       movq    %rcx, REGOFF_RCX(%rsp)
-       movq    0x20(%rbx), %rcx
-
-       movq    %rcx, REGOFF_R8(%rsp)
-       movq    0x28(%rbx), %rcx
-       movq    %rcx, REGOFF_R9(%rsp)
-       movq    0x30(%rbx), %rcx
-       movq    %rcx, REGOFF_RAX(%rsp)
-       movq    0x38(%rbx), %rcx
-       movq    %rcx, REGOFF_RBX(%rsp)
-       movq    0x58(%rbx), %rcx
-
-       movq    %rcx, REGOFF_RBP(%rsp)
-       movq    0x40(%rbx), %rcx
-       movq    %rcx, REGOFF_R10(%rsp)
-       movq    0x48(%rbx), %rcx
-       movq    %rcx, REGOFF_R11(%rsp)
-       movq    %r12, REGOFF_R12(%rsp)
-
-       movq    %r13, REGOFF_R13(%rsp)
-       movq    %r14, REGOFF_R14(%rsp)
-       movq    %r15, REGOFF_R15(%rsp)
-
-       xorl    %ecx, %ecx
-       movw    %ds, %cx
-       movq    %rcx, REGOFF_DS(%rsp)
-       movw    %es, %cx
-       movq    %rcx, REGOFF_ES(%rsp)
-       movw    %fs, %cx
-       movq    %rcx, REGOFF_FS(%rsp)
-       movw    %gs, %cx
-       movq    %rcx, REGOFF_GS(%rsp)
-
-       movq    $0, REGOFF_TRAPNO(%rsp)
-
-       movq    $0, REGOFF_ERR(%rsp)
-       leaq    vpanic(%rip), %rcx
-       movq    %rcx, REGOFF_RIP(%rsp)
-       movw    %cs, %cx
-       movzwq  %cx, %rcx
-       movq    %rcx, REGOFF_CS(%rsp)
-       movq    0x50(%rbx), %rcx
-       movq    %rcx, REGOFF_RFL(%rsp)
-       movq    %rbx, %rcx
-       addq    $0x60, %rcx
-       movq    %rcx, REGOFF_RSP(%rsp)
-       movw    %ss, %cx
-       movzwq  %cx, %rcx
-       movq    %rcx, REGOFF_SS(%rsp)
-
-       /*
-        * panicsys(format, alist, rp, on_panic_stack) 
-        */     
-       movq    REGOFF_RDI(%rsp), %rdi          /* format */
-       movq    REGOFF_RSI(%rsp), %rsi          /* alist */
-       movq    %rsp, %rdx                      /* struct regs */
-       movl    %r11d, %ecx                     /* on_panic_stack */
-       call    panicsys
-       addq    $REGSIZE, %rsp
-#endif
-       popq    %rdi
-       popq    %rsi
-       popq    %rdx
-       popq    %rcx
-       popq    %r8
-       popq    %r9
-       popq    %rax
-       popq    %rbx
-       popq    %r10
-       popq    %r11
-       popfq
-       leave
-       ret
-       END(vpanic)
-
-/*
-void
-dtrace_vpanic(const char *format, va_list alist)
-*/
-       ENTRY(dtrace_vpanic)                    /* Initial stack layout: */
-
-       pushq   %rbp                            /* | %rip |     0x60    */
-       movq    %rsp, %rbp                      /* | %rbp |     0x58    */
-       pushfq                                  /* | rfl  |     0x50    */
-       pushq   %r11                            /* | %r11 |     0x48    */
-       pushq   %r10                            /* | %r10 |     0x40    */
-       pushq   %rbx                            /* | %rbx |     0x38    */
-       pushq   %rax                            /* | %rax |     0x30    */
-       pushq   %r9                             /* | %r9  |     0x28    */
-       pushq   %r8                             /* | %r8  |     0x20    */
-       pushq   %rcx                            /* | %rcx |     0x18    */
-       pushq   %rdx                            /* | %rdx |     0x10    */
-       pushq   %rsi                            /* | %rsi |     0x8 alist */
-       pushq   %rdi                            /* | %rdi |     0x0 format */
-
-       movq    %rsp, %rbx                      /* %rbx = current %rsp */
-
-       leaq    panic_quiesce(%rip), %rdi       /* %rdi = &panic_quiesce */
-       call    dtrace_panic_trigger    /* %eax = dtrace_panic_trigger() */
-       jmp     vpanic_common
-
-       END(dtrace_vpanic)
-
-/*
-int
-panic_trigger(int *tp)
-*/
-       ENTRY(panic_trigger)
-       xorl    %eax, %eax
-       movl    $0xdefacedd, %edx
-       lock
-         xchgl %edx, (%rdi)
-       cmpl    $0, %edx
-       je      0f 
-       movl    $0, %eax
-       ret
-0:     movl    $1, %eax
-       ret
-       END(panic_trigger)
-       
-/*
-int
-dtrace_panic_trigger(int *tp)
-*/
-       ENTRY(dtrace_panic_trigger)
-       xorl    %eax, %eax
-       movl    $0xdefacedd, %edx
-       lock
-         xchgl %edx, (%rdi)
-       cmpl    $0, %edx
-       je      0f
-       movl    $0, %eax
-       ret
-0:     movl    $1, %eax
-       ret
-       END(dtrace_panic_trigger)
diff -r 07613cc57878 -r 674152a839be external/cddl/osnet/dev/dtrace/arm/dtrace_asm.S
--- a/external/cddl/osnet/dev/dtrace/arm/dtrace_asm.S   Thu Jun 23 03:58:13 2016 +0000
+++ b/external/cddl/osnet/dev/dtrace/arm/dtrace_asm.S   Thu Jun 23 04:35:35 2016 +0000
@@ -224,23 +224,6 @@
 END(dtrace_invop_uninit)
 
 /*
-void
-vpanic(const char *format, va_list alist)
-*/
-ENTRY(vpanic)                          /* Initial stack layout: */
-vpanic_common:
-       RET
-END(vpanic)
-
-/*
-void
-dtrace_vpanic(const char *format, va_list alist)
-*/
-ENTRY(dtrace_vpanic)                   /* Initial stack layout: */
-       RET
-END(dtrace_vpanic)
-
-/*
 uintptr_t
 dtrace_caller(int aframes)
 */
diff -r 07613cc57878 -r 674152a839be external/cddl/osnet/dev/dtrace/dtrace_hacks.c
--- a/external/cddl/osnet/dev/dtrace/dtrace_hacks.c     Thu Jun 23 03:58:13 2016 +0000
+++ b/external/cddl/osnet/dev/dtrace/dtrace_hacks.c     Thu Jun 23 04:35:35 2016 +0000
@@ -1,13 +1,10 @@
-/*     $NetBSD: dtrace_hacks.c,v 1.3 2010/02/28 07:01:43 darran Exp $  */
+/*     $NetBSD: dtrace_hacks.c,v 1.4 2016/06/23 04:35:35 pgoyette Exp $        */
 
 /* $FreeBSD: src/sys/cddl/dev/dtrace/dtrace_hacks.c,v 1.1.4.1 2009/08/03 08:13:06 kensmith Exp $ */
 /* XXX Hacks.... */
 
 dtrace_cacheid_t dtrace_predcache_id;
 
-int panic_quiesce;
-char panic_stack[PANICSTKSIZE];
-
 cpu_core_t     cpu_core[MAXCPUS];
 
 boolean_t
diff -r 07613cc57878 -r 674152a839be external/cddl/osnet/dev/dtrace/i386/dtrace_asm.S
--- a/external/cddl/osnet/dev/dtrace/i386/dtrace_asm.S  Thu Jun 23 03:58:13 2016 +0000
+++ b/external/cddl/osnet/dev/dtrace/i386/dtrace_asm.S  Thu Jun 23 04:35:35 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dtrace_asm.S,v 1.4 2016/05/14 21:19:05 chs Exp $       */
+/*     $NetBSD: dtrace_asm.S,v 1.5 2016/06/23 04:35:35 pgoyette Exp $  */
 
 /*
  * CDDL HEADER START
@@ -366,167 +366,3 @@
        popfl
        ret
        END(dtrace_interrupt_enable)
-
-/*
- * The panic() and cmn_err() functions invoke vpanic() as a common entry point
- * into the panic code implemented in panicsys().  vpanic() is responsible
- * for passing through the format string and arguments, and constructing a
- * regs structure on the stack into which it saves the current register
- * values.  If we are not dying due to a fatal trap, these registers will
- * then be preserved in panicbuf as the current processor state.  Before
- * invoking panicsys(), vpanic() activates the first panic trigger (see
- * common/os/panic.c) and switches to the panic_stack if successful.  Note that
- * DTrace takes a slightly different panic path if it must panic from probe
- * context.  Instead of calling panic, it calls into dtrace_vpanic(), which
- * sets up the initial stack as vpanic does, calls dtrace_panic_trigger(), and
- * branches back into vpanic().
- */
-/*
-void vpanic(const char *format, va_list alist)
-*/
-       ENTRY(vpanic)                           /* Initial stack layout: */
-
-       pushl   %ebp                            /* | %eip | 20 */



Home | Main Index | Thread Index | Old Index