Source-Changes-HG archive

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

[src/netbsd-9]: src Pull up following revision(s) (requested by jmcneill in t...



details:   https://anonhg.NetBSD.org/src/rev/ebd46870de22
branches:  netbsd-9
changeset: 843644:ebd46870de22
user:      martin <martin%NetBSD.org@localhost>
date:      Mon Dec 09 15:19:30 2019 +0000

description:
Pull up following revision(s) (requested by jmcneill in ticket #525):

        external/cddl/osnet/dev/dtrace/aarch64/dtrace_isa.c: revision 1.1
        distrib/sets/lists/modules/md.i386: revision 1.83
        share/mk/bsd.own.mk: revision 1.1168
        usr.bin/mkubootimage/mkubootimage.c: revision 1.25
        sys/modules/dtrace/Makefile: revision 1.7
        usr.bin/mkubootimage/mkubootimage.c: revision 1.26
        sys/modules/dtrace/Makefile: revision 1.8
        external/cddl/osnet/dist/lib/libdtrace/aarch64/dt_isadep.c: revision 1.2
        distrib/sets/lists/modules/mi: revision 1.128
        sys/arch/aarch64/include/frame.h: revision 1.3
        sys/arch/evbarm/conf/mk.generic64: revision 1.4
        external/cddl/osnet/dist/lib/libdtrace/common/dt_link.c: revision 1.12
        sys/modules/cyclic/Makefile: revision 1.4
        sys/arch/aarch64/conf/Makefile.aarch64: revision 1.16
        external/cddl/osnet/dev/dtrace/aarch64/dtrace_subr.c: revision 1.1
        sys/arch/aarch64/aarch64/start.S: revision 1.3
        sys/arch/aarch64/aarch64/trap.c: revision 1.22
        external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c: revision 1.1
        external/cddl/osnet/dev/dtrace/aarch64/dtrace_asm.S: revision 1.1
        external/cddl/osnet/dev/fbt/aarch64/fbt_isa.h: revision 1.1
        external/cddl/osnet/dev/dtrace/aarch64/regset.h: revision 1.1
        external/cddl/osnet/lib/libdtrace/Makefile: revision 1.26
        distrib/sets/lists/modules/md.amd64: revision 1.82
        usr.bin/mkubootimage/mkubootimage.1: revision 1.13
        distrib/sets/lists/modules/ad.arm: revision 1.14

Add KDTRACE_HOOKS support.

Define lwp_trapframe() macro

dtrace: add support for aarch64

Add syscall_linux back for other arm architectures (accidently removed
in previous)

Add -u flag for updating headers in place.

Fix alignment of .text section by changing load address to
0xffffffc000000000 and adding 64 bytes of padding before the entry point.

Update arm64 image header in place

Move dtrace_syscall_linux out of mi set list

Enable DTrace on aarch64

Fix signed/unsigned comparison

diffstat:

 distrib/sets/lists/modules/ad.arm                          |    4 +-
 distrib/sets/lists/modules/md.amd64                        |    4 +-
 distrib/sets/lists/modules/md.i386                         |    4 +-
 distrib/sets/lists/modules/mi                              |    4 +-
 external/cddl/osnet/dev/dtrace/aarch64/dtrace_asm.S        |  171 +++++
 external/cddl/osnet/dev/dtrace/aarch64/dtrace_isa.c        |  430 +++++++++++++
 external/cddl/osnet/dev/dtrace/aarch64/dtrace_subr.c       |  332 ++++++++++
 external/cddl/osnet/dev/dtrace/aarch64/regset.h            |   51 +
 external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c              |  234 +++++++
 external/cddl/osnet/dev/fbt/aarch64/fbt_isa.h              |   30 +
 external/cddl/osnet/dist/lib/libdtrace/aarch64/dt_isadep.c |    2 +
 external/cddl/osnet/dist/lib/libdtrace/common/dt_link.c    |   10 +-
 external/cddl/osnet/lib/libdtrace/Makefile                 |    5 +-
 share/mk/bsd.own.mk                                        |    3 +-
 sys/arch/aarch64/aarch64/start.S                           |    9 +-
 sys/arch/aarch64/aarch64/trap.c                            |   29 +-
 sys/arch/aarch64/conf/Makefile.aarch64                     |    4 +-
 sys/arch/aarch64/include/frame.h                           |    4 +-
 sys/arch/evbarm/conf/mk.generic64                          |   18 +-
 sys/modules/cyclic/Makefile                                |    2 +
 sys/modules/dtrace/Makefile                                |    5 +-
 usr.bin/mkubootimage/mkubootimage.1                        |    7 +-
 usr.bin/mkubootimage/mkubootimage.c                        |   19 +-
 23 files changed, 1346 insertions(+), 35 deletions(-)

diffs (truncated from 1731 to 300 lines):

diff -r 2c9cf5da813c -r ebd46870de22 distrib/sets/lists/modules/ad.arm
--- a/distrib/sets/lists/modules/ad.arm Mon Dec 09 13:06:38 2019 +0000
+++ b/distrib/sets/lists/modules/ad.arm Mon Dec 09 15:19:30 2019 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: ad.arm,v 1.12 2019/02/03 08:02:58 pgoyette Exp $
+# $NetBSD: ad.arm,v 1.12.2.1 2019/12/09 15:19:30 martin Exp $
 
 ./@MODULEDIR@/compat_netbsd32                  base-kernel-modules     kmod
 ./@MODULEDIR@/compat_netbsd32/compat_netbsd32.kmod base-kernel-modules kmod
@@ -44,5 +44,7 @@
 ./@MODULEDIR@/compat_netbsd32_sysvipc_14/compat_netbsd32_sysvipc_14.kmod       base-kernel-modules     kmod
 ./@MODULEDIR@/compat_netbsd32_sysvipc_50       base-kernel-modules     kmod
 ./@MODULEDIR@/compat_netbsd32_sysvipc_50/compat_netbsd32_sysvipc_50.kmod       base-kernel-modules     kmod
+./@MODULEDIR@/dtrace_syscall_linux             base-kernel-modules     kmod,dtrace
+./@MODULEDIR@/dtrace_syscall_linux/dtrace_syscall_linux.kmod   base-kernel-modules     kmod,dtrace
 ./@MODULEDIR@/exec_elf32                       base-kernel-modules     kmod
 ./@MODULEDIR@/exec_elf32/exec_elf32.kmod       base-kernel-modules     kmod
diff -r 2c9cf5da813c -r ebd46870de22 distrib/sets/lists/modules/md.amd64
--- a/distrib/sets/lists/modules/md.amd64       Mon Dec 09 13:06:38 2019 +0000
+++ b/distrib/sets/lists/modules/md.amd64       Mon Dec 09 15:19:30 2019 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: md.amd64,v 1.80 2019/02/03 08:02:58 pgoyette Exp $
+# $NetBSD: md.amd64,v 1.80.2.1 2019/12/09 15:19:30 martin Exp $
 #
 # NOTE that there are two sets of files here:
 # @MODULEDIR@ and amd64-xen
@@ -115,6 +115,8 @@
 ./@MODULEDIR@/drmkms_agp/drmkms_agp.kmod       base-kernel-modules     kmod
 ./@MODULEDIR@/drmkms_pci                       base-kernel-modules     kmod
 ./@MODULEDIR@/drmkms_pci/drmkms_pci.kmod       base-kernel-modules     kmod
+./@MODULEDIR@/dtrace_syscall_linux             base-kernel-modules     kmod,dtrace
+./@MODULEDIR@/dtrace_syscall_linux/dtrace_syscall_linux.kmod   base-kernel-modules     kmod,dtrace
 ./@MODULEDIR@/dtrace_syscall_linux32           base-kernel-modules     kmod,dtrace
 ./@MODULEDIR@/dtrace_syscall_linux32/dtrace_syscall_linux32.kmod       base-kernel-modules     kmod,dtrace
 ./@MODULEDIR@/dtrace_syscall_netbsd32          base-kernel-modules     kmod,dtrace
diff -r 2c9cf5da813c -r ebd46870de22 distrib/sets/lists/modules/md.i386
--- a/distrib/sets/lists/modules/md.i386        Mon Dec 09 13:06:38 2019 +0000
+++ b/distrib/sets/lists/modules/md.i386        Mon Dec 09 15:19:30 2019 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: md.i386,v 1.82 2018/09/19 16:11:53 maxv Exp $
+# $NetBSD: md.i386,v 1.82.2.1 2019/12/09 15:19:30 martin Exp $
 #
 # NOTE that there are two sets of files here: @MODULEDIR@ and i386pae-xen
 #
@@ -79,6 +79,8 @@
 ./@MODULEDIR@/drmkms_agp/drmkms_agp.kmod       base-kernel-modules     kmod
 ./@MODULEDIR@/drmkms_pci                       base-kernel-modules     kmod
 ./@MODULEDIR@/drmkms_pci/drmkms_pci.kmod       base-kernel-modules     kmod
+./@MODULEDIR@/dtrace_syscall_linux             base-kernel-modules     kmod,dtrace
+./@MODULEDIR@/dtrace_syscall_linux/dtrace_syscall_linux.kmod   base-kernel-modules     kmod,dtrace
 ./@MODULEDIR@/emdtv                            base-kernel-modules     kmod
 ./@MODULEDIR@/emdtv/emdtv.kmod                 base-kernel-modules     kmod
 ./@MODULEDIR@/est                              base-kernel-modules     kmod
diff -r 2c9cf5da813c -r ebd46870de22 distrib/sets/lists/modules/mi
--- a/distrib/sets/lists/modules/mi     Mon Dec 09 13:06:38 2019 +0000
+++ b/distrib/sets/lists/modules/mi     Mon Dec 09 15:19:30 2019 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.122.2.2 2019/10/28 16:37:55 martin Exp $
+# $NetBSD: mi,v 1.122.2.3 2019/12/09 15:19:30 martin Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -146,8 +146,6 @@
 ./@MODULEDIR@/dtrace_sdt/dtrace_sdt.kmod               base-kernel-modules     kmod,dtrace
 ./@MODULEDIR@/dtrace_syscall                           base-kernel-modules     kmod,dtrace
 ./@MODULEDIR@/dtrace_syscall/dtrace_syscall.kmod       base-kernel-modules     kmod,dtrace
-./@MODULEDIR@/dtrace_syscall_linux                     base-kernel-modules     kmod,dtrace
-./@MODULEDIR@/dtrace_syscall_linux/dtrace_syscall_linux.kmod   base-kernel-modules     kmod,dtrace
 ./@MODULEDIR@/dtv                              base-kernel-modules     kmod
 ./@MODULEDIR@/dtv/dtv.kmod                     base-kernel-modules     kmod
 ./@MODULEDIR@/dtv_math                         base-kernel-modules     kmod
diff -r 2c9cf5da813c -r ebd46870de22 external/cddl/osnet/dev/dtrace/aarch64/dtrace_asm.S
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/external/cddl/osnet/dev/dtrace/aarch64/dtrace_asm.S       Mon Dec 09 15:19:30 2019 +0000
@@ -0,0 +1,171 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License, Version 1.0 only
+ * (the "License").  You may not use this file except in compliance
+ * with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ *
+ * $FreeBSD$
+ */
+/*
+ * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#define _ASM
+#define _LOCORE
+
+#include <sys/cpuvar_defs.h>
+#include <sys/dtrace.h>
+
+#include <machine/asm.h>
+
+/*
+void dtrace_membar_producer(void)
+*/
+ENTRY(dtrace_membar_producer)
+       RET
+END(dtrace_membar_producer)
+
+/*
+void dtrace_membar_consumer(void)
+*/
+ENTRY(dtrace_membar_consumer)
+       RET
+END(dtrace_membar_consumer)
+
+/*
+dtrace_icookie_t dtrace_interrupt_disable(void)
+*/
+ENTRY(dtrace_interrupt_disable)
+       mrs     x0, daif
+       msr     daifset, #2
+       RET
+END(dtrace_interrupt_disable)
+
+/*
+void dtrace_interrupt_enable(dtrace_icookie_t cookie)
+*/
+ENTRY(dtrace_interrupt_enable)
+       msr     daif, x0
+       RET
+END(dtrace_interrupt_enable)
+/*
+uint8_t
+dtrace_fuword8_nocheck(void *addr)
+*/
+ENTRY(dtrace_fuword8_nocheck)
+       ldrb    w0, [x0]
+       RET
+END(dtrace_fuword8_nocheck)
+
+/*
+uint16_t
+dtrace_fuword16_nocheck(void *addr)
+*/
+ENTRY(dtrace_fuword16_nocheck)
+       ldrh    w0, [x0]
+       RET
+END(dtrace_fuword16_nocheck)
+
+/*
+uint32_t
+dtrace_fuword32_nocheck(void *addr)
+*/
+ENTRY(dtrace_fuword32_nocheck)
+       ldr     w0, [x0]
+       RET
+END(dtrace_fuword32_nocheck)
+
+/*
+uint64_t
+dtrace_fuword64_nocheck(void *addr)
+*/
+ENTRY(dtrace_fuword64_nocheck)
+       ldr     x0, [x0]
+       RET
+END(dtrace_fuword64_nocheck)
+
+/*
+void
+dtrace_copy(uintptr_t uaddr, uintptr_t kaddr, size_t size)
+*/
+ENTRY(dtrace_copy)
+       cbz     x2, 2f          /* If len == 0 then skip loop */
+1:
+       ldrb    w4, [x0], #1    /* Load from uaddr */
+       strb    w4, [x1], #1    /* Store in kaddr */
+       sub     x2, x2, #1      /* len-- */
+       cbnz    x2, 1b
+2:
+       RET
+END(dtrace_copy)
+
+/*
+void
+dtrace_copystr(uintptr_t uaddr, uintptr_t kaddr, size_t size,
+    volatile uint16_t *flags)
+XXX: Check for flags?
+*/
+ENTRY(dtrace_copystr)
+       cbz     x2, 2f          /* If len == 0 then skip loop */
+ 
+1:     ldrb    w4, [x0], #1    /* Load from uaddr */
+       strb    w4, [x1], #1    /* Store in kaddr */
+       cbz     w4, 2f          /* If == 0 then break */
+       sub     x2, x2, #1      /* len-- */
+       cbnz    x2, 1b
+2:
+       RET
+END(dtrace_copystr)
+
+/*
+uintptr_t
+dtrace_caller(int aframes)
+*/
+ENTRY(dtrace_caller)
+       mov     x0, #-1
+       RET
+END(dtrace_caller)
+
+/*
+uint32_t
+dtrace_cas32(uint32_t *target, uint32_t cmp, uint32_t new)
+*/
+ENTRY(dtrace_cas32)
+1:     ldxr    w3, [x0]        /* Load target */
+       cmp     w3, w1          /* Check if *target == cmp */
+       bne     2f              /* No, return */
+       stxr    w12, w2, [x0]   /* Store new to target */
+       cbnz    w12, 1b         /* Try again if store not succeed */
+2:     mov     w0, w3          /* Return the value loaded from target */
+       RET
+END(dtrace_cas32)
+
+/*
+void *
+dtrace_casptr(volatile void *target, volatile void *cmp, volatile void *new)
+*/
+ENTRY(dtrace_casptr)
+1:     ldxr    x3, [x0]        /* Load target */
+       cmp     x3, x1          /* Check if *target == cmp */
+       bne     2f              /* No, return */
+       stxr    w12, x2, [x0]   /* Store new to target */
+       cbnz    w12, 1b         /* Try again if store not succeed */
+2:     mov     x0, x3          /* Return the value loaded from target */
+       RET
+END(dtrace_casptr)
diff -r 2c9cf5da813c -r ebd46870de22 external/cddl/osnet/dev/dtrace/aarch64/dtrace_isa.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/external/cddl/osnet/dev/dtrace/aarch64/dtrace_isa.c       Mon Dec 09 15:19:30 2019 +0000
@@ -0,0 +1,430 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License, Version 1.0 only
+ * (the "License").  You may not use this file except in compliance
+ * with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ *
+ * $FreeBSD$
+ */
+/*
+ * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
+ * Use is subject to license terms.
+ */
+#include <sys/cdefs.h>
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+
+#include <machine/frame.h>
+#include <machine/reg.h>
+
+#include <machine/db_machdep.h>
+#include <machine/vmparam.h>
+#include <ddb/db_sym.h>
+#include <ddb/ddb.h>
+
+#include "regset.h"
+
+#define        INKERNEL(va)    ((VM_MIN_KERNEL_ADDRESS <= (va)) && ((va) < VM_MAX_KERNEL_ADDRESS))
+#define        CURRENT_CPU     cpu_index(curcpu())
+
+struct unwind_state {
+       register_t fp;
+       register_t sp;
+       register_t pc;



Home | Main Index | Thread Index | Old Index