CVS commit: src/usr.sbin/sysinst
Module Name:src Committed By: isaki Date: Tue Dec 10 06:25:50 UTC 2019 Modified Files: src/usr.sbin/sysinst: README.md_defs Log Message: Fix typo. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/sysinst/README.md_defs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/sysinst/README.md_defs diff -u src/usr.sbin/sysinst/README.md_defs:1.2 src/usr.sbin/sysinst/README.md_defs:1.3 --- src/usr.sbin/sysinst/README.md_defs:1.2 Mon Dec 9 19:16:53 2019 +++ src/usr.sbin/sysinst/README.md_defs Tue Dec 10 06:25:50 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: README.md_defs,v 1.2 2019/12/09 19:16:53 martin Exp $ */ +/* $NetBSD: README.md_defs,v 1.3 2019/12/10 06:25:50 isaki Exp $ */ The following is trying to document the most important machine dependent defines used in the sysinst code. @@ -88,5 +88,5 @@ DISKLABEL_NO_ONDISK_VERIFY usually undef If defined, do not verify the presence of on-disk disklabels before offering the disklabel partitioning scheme. This allows ports to use -kernel translation for the disklabel ioctls (e.g. x86k uses Human68k +kernel translation for the disklabel ioctls (e.g. x68k uses Human68k partitions this way).
CVS commit: src/sys/arch
Module Name:src Committed By: manu Date: Tue Dec 10 02:06:07 UTC 2019 Modified Files: src/sys/arch/amd64/amd64: locore.S machdep.c src/sys/arch/amd64/conf: GENERIC files.amd64 kern.ldscript src/sys/arch/x86/x86: efi.c multiboot2.c Log Message: Add multiboot 2 support to amd64 kernel To generate a diff of this commit: cvs rdiff -u -r1.192 -r1.193 src/sys/arch/amd64/amd64/locore.S cvs rdiff -u -r1.342 -r1.343 src/sys/arch/amd64/amd64/machdep.c cvs rdiff -u -r1.548 -r1.549 src/sys/arch/amd64/conf/GENERIC cvs rdiff -u -r1.113 -r1.114 src/sys/arch/amd64/conf/files.amd64 cvs rdiff -u -r1.27 -r1.28 src/sys/arch/amd64/conf/kern.ldscript cvs rdiff -u -r1.20 -r1.21 src/sys/arch/x86/x86/efi.c cvs rdiff -u -r1.2 -r1.3 src/sys/arch/x86/x86/multiboot2.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/amd64/amd64/locore.S diff -u src/sys/arch/amd64/amd64/locore.S:1.192 src/sys/arch/amd64/amd64/locore.S:1.193 --- src/sys/arch/amd64/amd64/locore.S:1.192 Fri Nov 22 23:36:25 2019 +++ src/sys/arch/amd64/amd64/locore.S Tue Dec 10 02:06:07 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.192 2019/11/22 23:36:25 ad Exp $ */ +/* $NetBSD: locore.S,v 1.193 2019/12/10 02:06:07 manu Exp $ */ /* * Copyright-o-rama! @@ -158,6 +158,7 @@ #include "opt_compat_netbsd.h" #include "opt_compat_netbsd32.h" +#include "opt_multiboot.h" #include "opt_xen.h" #include "opt_svs.h" @@ -177,6 +178,13 @@ #include #include +#ifndef XENPV +#include +#endif + +#define CODE_SEGMENT 0x08 +#define DATA_SEGMENT 0x10 + #if NLAPIC > 0 #include #endif @@ -424,6 +432,50 @@ END(farjmp64) .space 512 tmpstk: +.section multiboot,"ax",@progbits +#if defined(MULTIBOOT) + .align 8 + .globl Multiboot2_Header +_C_LABEL(Multiboot2_Header): + .int MULTIBOOT2_HEADER_MAGIC + .int MULTIBOOT2_ARCHITECTURE_I386 + .int Multiboot2_Header_end - Multiboot2_Header + .int -(MULTIBOOT2_HEADER_MAGIC + MULTIBOOT2_ARCHITECTURE_I386 \ + + (Multiboot2_Header_end - Multiboot2_Header)) + + .int 1 /* MULTIBOOT_HEADER_TAG_INFORMATION_REQUEST */ + .int 12 /* sizeof(multiboot_header_tag_information_request) */ + /* + sizeof(uint32_t) * requests */ + .int 4 /* MULTIBOOT_TAG_TYPE_BASIC_MEMINFO */ + .align 8 + + .int 3 /* MULTIBOOT_HEADER_TAG_ENTRY_ADDRESS */ + .int 16 /* sizeof(struct multiboot_tag_efi64) */ + .quad (multiboot2_entry - KERNBASE) + .align 8 + + .int 9 /* MULTIBOOT_HEADER_TAG_ENTRY_ADDRESS_EFI64 */ + .int 16 /* sizeof(struct multiboot_tag_efi64) */ + .quad (multiboot2_entry - KERNBASE) + .align 8 + +#if notyet + /* + * Could be used to get an early console for debug, + * but this is broken. + */ + .int 7 /* MULTIBOOT_HEADER_TAG_EFI_BS */ + .int 8 /* sizeof(struct multiboot_tag) */ + .align 8 +#endif + + .int 0 /* MULTIBOOT_HEADER_TAG_END */ + .int 8 /* sizeof(struct multiboot_tag) */ + .align 8 + .globl Multiboot2_Header_end +_C_LABEL(Multiboot2_Header_end): +#endif /* MULTIBOOT */ + /* * Some hackage to deal with 64bit symbols in 32 bit mode. * This may not be needed if things are cleaned up a little. @@ -440,6 +492,700 @@ ENTRY(start) /* Warm boot */ movw $0x1234,0x472 +#if defined(MULTIBOOT) + jmp .Lnative_loader + + +multiboot2_entry: + .code64 + /* + * multiboot2 entry point. We are left here without + * stack and with no idea of where we were loaded in memory. + * The only inputs are + * %eax MULTIBOOT2_BOOTLOADER_MAGIC + * %ebx pointer to multiboot_info + * + * Here we will: + * - copy the kernel to 0x20 (KERNTEXTOFF - KERNBASE) + * as almost all the code in locore.S assume it is there. + * This is derived from + * src/sys/arch/i386/stand/efiboot/bootx64/startprog64.S + * - copy multiboot_info, as done in multiboot_pre_reloc() from + * src/sys/arch/x86/x86/multiboot2.c + * Unfortunately we cannot call that function as there is + * no simple way to build it as 32 bit code in a 64 bit kernel. + * - Copy ELF symbols, also as in multiboot_pre_reloc() + */ + + cli + + /* + * Discover our load address and use it to get start address + */ + mov $_RELOC(tmpstk),%rsp + call next +next: pop %r8 + sub $(next - start), %r8 + + /* + * Save multiboot_info for later. We cannot use + * temporary stack for that since we are going to + * overwrite it. + */ + movl %ebx, (multiboot2_info_ptr - start)(%r8) + + /* + * Get relocated multiboot2_loader entry point in %r9 + */ + mov $(KERNTEXTOFF - KERNBASE), %r9 + add $(multiboot2_loader - kernel_text), %r9 + + /* Copy kernel */ + mov $(KERNTEXTOFF - KERNBASE), %rdi /* dest */ + mov %r8, %rsi + sub $(start - kernel_text), %rsi /* src */ + mov $(__kernel_end - kernel_text), %rcx /* size *. + mov %rcx, %r12 + movq %rdi, %r11 /* for misaligned check */ + +#if !defined(NO_OVERLAP) + movq %rdi, %r13 + subq %rsi, %r13 +#endif + + shrq $3, %rcx /* count for copy by words */ + jz 8f /* j if less than 8 bytes */ + + lea
CVS commit: src/sys/arch/i386/stand
Module Name:src Committed By: manu Date: Tue Dec 10 02:02:48 UTC 2019 Modified Files: src/sys/arch/i386/stand/boot: devopen.c src/sys/arch/i386/stand/efiboot: devopen.c src/sys/arch/i386/stand/lib: biosdisk.c Log Message: In-RAID partitions with no name can be candidate for booting The code to select boot partition in RAID assumed thet had a name, which is true when there is a GPT inside the RAID, but not when there is a disklabel inside the RAID. This caused a regression from behavior of NetBSD 8.1. We fix this by allowing nameless partition to be boot candidates. This fixes misc/54748 While there, let raid device be used in the boot specification, like raid0a:/netbsd. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/arch/i386/stand/boot/devopen.c cvs rdiff -u -r1.8 -r1.9 src/sys/arch/i386/stand/efiboot/devopen.c cvs rdiff -u -r1.52 -r1.53 src/sys/arch/i386/stand/lib/biosdisk.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/i386/stand/boot/devopen.c diff -u src/sys/arch/i386/stand/boot/devopen.c:1.9 src/sys/arch/i386/stand/boot/devopen.c:1.10 --- src/sys/arch/i386/stand/boot/devopen.c:1.9 Sun Aug 18 02:18:24 2019 +++ src/sys/arch/i386/stand/boot/devopen.c Tue Dec 10 02:02:47 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: devopen.c,v 1.9 2019/08/18 02:18:24 manu Exp $ */ +/* $NetBSD: devopen.c,v 1.10 2019/12/10 02:02:47 manu Exp $ */ /*- * Copyright (c) 2005 The NetBSD Foundation, Inc. @@ -156,7 +156,7 @@ devopen(struct open_file *f, const char if (strstr(devname, "raid") == devname) { f->f_dev = [0]; /* must be biosdisk */ - return biosdisk_open_name(f, devname); + return biosdisk_open_name(f, fname); } #endif Index: src/sys/arch/i386/stand/efiboot/devopen.c diff -u src/sys/arch/i386/stand/efiboot/devopen.c:1.8 src/sys/arch/i386/stand/efiboot/devopen.c:1.9 --- src/sys/arch/i386/stand/efiboot/devopen.c:1.8 Thu Sep 26 12:21:03 2019 +++ src/sys/arch/i386/stand/efiboot/devopen.c Tue Dec 10 02:02:47 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: devopen.c,v 1.8 2019/09/26 12:21:03 nonaka Exp $ */ +/* $NetBSD: devopen.c,v 1.9 2019/12/10 02:02:47 manu Exp $ */ /*- * Copyright (c) 2005 The NetBSD Foundation, Inc. @@ -151,6 +151,7 @@ int devopen(struct open_file *f, const char *fname, char **file) { char *fsname, *devname; + const char *xname = NULL; int unit, partition; int biosdev; int i, error; @@ -172,8 +173,12 @@ devopen(struct open_file *f, const char nfsys = nfsys_disk; /* Search by GPT label or raidframe name */ - if ((strstr(devname, "NAME=") == devname) || - (strstr(devname, "raid") == devname)) { + if (strstr(devname, "NAME=") == devname) + xname = devname; + if (strstr(devname, "raid") == devname) + xname = fname; + + if (xname != NULL) { f->f_dev = [0]; /* must be biosdisk */ if (!kernel_loaded) { @@ -181,7 +186,7 @@ devopen(struct open_file *f, const char BI_ADD(, BTINFO_BOOTPATH, sizeof(bibp)); } - error = biosdisk_open_name(f, devname); + error = biosdisk_open_name(f, xname); return error; } Index: src/sys/arch/i386/stand/lib/biosdisk.c diff -u src/sys/arch/i386/stand/lib/biosdisk.c:1.52 src/sys/arch/i386/stand/lib/biosdisk.c:1.53 --- src/sys/arch/i386/stand/lib/biosdisk.c:1.52 Fri Sep 13 02:19:46 2019 +++ src/sys/arch/i386/stand/lib/biosdisk.c Tue Dec 10 02:02:47 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: biosdisk.c,v 1.52 2019/09/13 02:19:46 manu Exp $ */ +/* $NetBSD: biosdisk.c,v 1.53 2019/12/10 02:02:47 manu Exp $ */ /* * Copyright (c) 1996, 1998 @@ -1401,9 +1401,9 @@ next_disk: continue; if (d->part[part].fstype == FS_UNUSED) continue; - if (d->part[part].part_name == NULL) -continue; - if (strcmp(d->part[part].part_name, name) == 0) { + + if (d->part[part].part_name != NULL && + strcmp(d->part[part].part_name, name) == 0) { *biosdev = raidframe[i].biosdev; *offset = raidframe[i].offset + RF_PROTECTED_SECTORS
CVS commit: src/sys/sys
Module Name:src Committed By: ad Date: Mon Dec 9 21:08:56 UTC 2019 Modified Files: src/sys/sys: mutex.h Log Message: Add mutex_owner_running(). To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/sys/sys/mutex.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/sys/mutex.h diff -u src/sys/sys/mutex.h:1.23 src/sys/sys/mutex.h:1.24 --- src/sys/sys/mutex.h:1.23 Sat Nov 30 15:34:07 2019 +++ src/sys/sys/mutex.h Mon Dec 9 21:08:56 2019 @@ -1,7 +1,7 @@ -/* $NetBSD: mutex.h,v 1.23 2019/11/30 15:34:07 riastradh Exp $ */ +/* $NetBSD: mutex.h,v 1.24 2019/12/09 21:08:56 ad Exp $ */ /*- - * Copyright (c) 2002, 2006, 2007, 2008, 2009 The NetBSD Foundation, Inc. + * Copyright (c) 2002, 2006, 2007, 2008, 2009, 2019 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation @@ -199,6 +199,7 @@ int mutex_tryenter(kmutex_t *); int mutex_owned(const kmutex_t *); int mutex_ownable(const kmutex_t *); lwp_t *mutex_owner(const kmutex_t *); +bool mutex_owner_running(const kmutex_t *); void mutex_obj_init(void); kmutex_t *mutex_obj_alloc(kmutex_type_t, int);
CVS commit: src/sys/kern
Module Name:src Committed By: ad Date: Mon Dec 9 21:05:23 UTC 2019 Modified Files: src/sys/kern: kern_mutex.c Log Message: - Add a mutex_owner_running() for the benefit of the pagedaemon, which needs help with locking things in reverse order. - Expunge the panicstr checks. - Make MUTEX_NODEBUG work for adaptive mutexes too. To generate a diff of this commit: cvs rdiff -u -r1.80 -r1.81 src/sys/kern/kern_mutex.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/kern/kern_mutex.c diff -u src/sys/kern/kern_mutex.c:1.80 src/sys/kern/kern_mutex.c:1.81 --- src/sys/kern/kern_mutex.c:1.80 Fri Nov 29 19:44:59 2019 +++ src/sys/kern/kern_mutex.c Mon Dec 9 21:05:23 2019 @@ -1,7 +1,7 @@ -/* $NetBSD: kern_mutex.c,v 1.80 2019/11/29 19:44:59 ad Exp $ */ +/* $NetBSD: kern_mutex.c,v 1.81 2019/12/09 21:05:23 ad Exp $ */ /*- - * Copyright (c) 2002, 2006, 2007, 2008 The NetBSD Foundation, Inc. + * Copyright (c) 2002, 2006, 2007, 2008, 2019 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation @@ -40,7 +40,7 @@ #define __MUTEX_PRIVATE #include -__KERNEL_RCSID(0, "$NetBSD: kern_mutex.c,v 1.80 2019/11/29 19:44:59 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_mutex.c,v 1.81 2019/12/09 21:05:23 ad Exp $"); #include #include @@ -61,9 +61,6 @@ __KERNEL_RCSID(0, "$NetBSD: kern_mutex.c #include -#define MUTEX_PANIC_SKIP_SPIN 1 -#define MUTEX_PANIC_SKIP_ADAPTIVE 1 - /* * When not running a debug kernel, spin mutexes are not much * more than an splraiseipl() and splx() pair. @@ -348,46 +345,23 @@ void _mutex_init(kmutex_t *mtx, kmutex_type_t type, int ipl, uintptr_t return_address) { + lockops_t *lockops __unused; bool dodebug; memset(mtx, 0, sizeof(*mtx)); - switch (type) { - case MUTEX_ADAPTIVE: - KASSERT(ipl == IPL_NONE); - break; - case MUTEX_DEFAULT: - case MUTEX_DRIVER: - if (ipl == IPL_NONE || ipl == IPL_SOFTCLOCK || - ipl == IPL_SOFTBIO || ipl == IPL_SOFTNET || - ipl == IPL_SOFTSERIAL) { - type = MUTEX_ADAPTIVE; - } else { - type = MUTEX_SPIN; - } - break; - default: - break; - } - - switch (type) { - case MUTEX_NODEBUG: - dodebug = LOCKDEBUG_ALLOC(mtx, NULL, return_address); - MUTEX_INITIALIZE_SPIN(mtx, dodebug, ipl); - break; - case MUTEX_ADAPTIVE: - dodebug = LOCKDEBUG_ALLOC(mtx, _adaptive_lockops, - return_address); + if (ipl == IPL_NONE || ipl == IPL_SOFTCLOCK || + ipl == IPL_SOFTBIO || ipl == IPL_SOFTNET || + ipl == IPL_SOFTSERIAL) { + lockops = (type == MUTEX_NODEBUG ? + NULL : _adaptive_lockops); + dodebug = LOCKDEBUG_ALLOC(mtx, lockops, return_address); MUTEX_INITIALIZE_ADAPTIVE(mtx, dodebug); - break; - case MUTEX_SPIN: - dodebug = LOCKDEBUG_ALLOC(mtx, _spin_lockops, - return_address); + } else { + lockops = (type == MUTEX_NODEBUG ? + NULL : _spin_lockops); + dodebug = LOCKDEBUG_ALLOC(mtx, lockops, return_address); MUTEX_INITIALIZE_SPIN(mtx, dodebug, ipl); - break; - default: - panic("mutex_init: impossible type"); - break; } } @@ -504,10 +478,6 @@ mutex_vector_enter(kmutex_t *mtx) * to reduce cache line ping-ponging between CPUs. */ do { -#if MUTEX_PANIC_SKIP_SPIN - if (panicstr != NULL) -break; -#endif while (MUTEX_SPINBIT_LOCKED_P(mtx)) { SPINLOCK_BACKOFF(count); #ifdef LOCKDEBUG @@ -565,12 +535,6 @@ mutex_vector_enter(kmutex_t *mtx) owner = mtx->mtx_owner; continue; } -#if MUTEX_PANIC_SKIP_ADAPTIVE - if (__predict_false(panicstr != NULL)) { - KPREEMPT_ENABLE(curlwp); - return; - } -#endif if (__predict_false(MUTEX_OWNER(owner) == curthread)) { MUTEX_ABORT(mtx, "locking against myself"); } @@ -746,10 +710,6 @@ mutex_vector_exit(kmutex_t *mtx) if (MUTEX_SPIN_P(mtx)) { #ifdef FULL if (__predict_false(!MUTEX_SPINBIT_LOCKED_P(mtx))) { -#if MUTEX_PANIC_SKIP_SPIN - if (panicstr != NULL) -return; -#endif MUTEX_ABORT(mtx, "exiting unheld spin mutex"); } MUTEX_UNLOCKED(mtx); @@ -759,14 +719,6 @@ mutex_vector_exit(kmutex_t *mtx) return; } -#ifdef MUTEX_PANIC_SKIP_ADAPTIVE - if (__predict_false((uintptr_t)panicstr | cold)) { - MUTEX_UNLOCKED(mtx); - MUTEX_RELEASE(mtx); - return; - } -#endif - curthread = (uintptr_t)curlwp; MUTEX_DASSERT(mtx, curthread != 0); MUTEX_ASSERT(mtx, MUTEX_OWNER(mtx->mtx_owner) == curthread); @@ -869,6 +821,24 @@ mutex_owner(const kmutex_t *mtx) } /* + * mutex_owner_running: + * + * Return true if an adaptive mutex is held and the owner is running + * on a CPU. For the pagedaemon. + */ +bool +mutex_owner_running(const kmutex_t *mtx) +{ + bool rv; + + MUTEX_ASSERT(mtx, MUTEX_ADAPTIVE_P(mtx)); + kpreempt_disable(); + rv = mutex_oncpu(MUTEX_OWNER(mtx->mtx_owner)); + kpreempt_enable(); + return rv; +} + +/* * mutex_ownable: * * When compiled with DEBUG and LOCKDEBUG defined, ensure that @@
CVS commit: src/sys/kern
Module Name:src Committed By: ad Date: Mon Dec 9 21:02:10 UTC 2019 Modified Files: src/sys/kern: kern_rwlock.c Log Message: Expunge the panicstr checks, we don't need them. To generate a diff of this commit: cvs rdiff -u -r1.58 -r1.59 src/sys/kern/kern_rwlock.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/kern/kern_rwlock.c diff -u src/sys/kern/kern_rwlock.c:1.58 src/sys/kern/kern_rwlock.c:1.59 --- src/sys/kern/kern_rwlock.c:1.58 Sat Nov 30 14:21:16 2019 +++ src/sys/kern/kern_rwlock.c Mon Dec 9 21:02:10 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_rwlock.c,v 1.58 2019/11/30 14:21:16 ad Exp $ */ +/* $NetBSD: kern_rwlock.c,v 1.59 2019/12/09 21:02:10 ad Exp $ */ /*- * Copyright (c) 2002, 2006, 2007, 2008, 2009, 2019 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_rwlock.c,v 1.58 2019/11/30 14:21:16 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_rwlock.c,v 1.59 2019/12/09 21:02:10 ad Exp $"); #define __RWLOCK_PRIVATE @@ -357,10 +357,6 @@ rw_vector_enter(krwlock_t *rw, const krw owner = next; continue; } - if (__predict_false(panicstr != NULL)) { - KPREEMPT_ENABLE(curlwp); - return; - } if (__predict_false(RW_OWNER(rw) == curthread)) { rw_abort(__func__, __LINE__, rw, "locking against myself"); @@ -450,9 +446,6 @@ rw_vector_exit(krwlock_t *rw) curthread = (uintptr_t)curlwp; RW_ASSERT(rw, curthread != 0); - if (__predict_false(panicstr != NULL)) - return; - /* * Again, we use a trick. Since we used an add operation to * set the required lock bits, we can use a subtract to clear @@ -729,8 +722,6 @@ rw_read_held(krwlock_t *rw) { uintptr_t owner; - if (panicstr != NULL) - return 1; if (rw == NULL) return 0; owner = rw->rw_owner; @@ -748,8 +739,6 @@ int rw_write_held(krwlock_t *rw) { - if (panicstr != NULL) - return 1; if (rw == NULL) return 0; return (rw->rw_owner & (RW_WRITE_LOCKED | RW_THREAD)) == @@ -767,8 +756,6 @@ int rw_lock_held(krwlock_t *rw) { - if (panicstr != NULL) - return 1; if (rw == NULL) return 0; return (rw->rw_owner & RW_THREAD) != 0;
CVS commit: src/sys/dev/pci
Module Name:src Committed By: ad Date: Mon Dec 9 21:00:48 UTC 2019 Modified Files: src/sys/dev/pci: ichsmb.c Log Message: Fix LOCKDEBUG panic on detach. To generate a diff of this commit: cvs rdiff -u -r1.61 -r1.62 src/sys/dev/pci/ichsmb.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/ichsmb.c diff -u src/sys/dev/pci/ichsmb.c:1.61 src/sys/dev/pci/ichsmb.c:1.62 --- src/sys/dev/pci/ichsmb.c:1.61 Thu Nov 21 17:47:23 2019 +++ src/sys/dev/pci/ichsmb.c Mon Dec 9 21:00:48 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: ichsmb.c,v 1.61 2019/11/21 17:47:23 ad Exp $ */ +/* $NetBSD: ichsmb.c,v 1.62 2019/12/09 21:00:48 ad Exp $ */ /* $OpenBSD: ichiic.c,v 1.18 2007/05/03 09:36:26 dlg Exp $ */ /* @@ -22,7 +22,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ichsmb.c,v 1.61 2019/11/21 17:47:23 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ichsmb.c,v 1.62 2019/12/09 21:00:48 ad Exp $"); #include #include @@ -163,6 +163,7 @@ ichsmb_attach(device_t parent, device_t sc->sc_pc = pa->pa_pc; pci_aprint_devinfo(pa, NULL); + mutex_init(>sc_i2c_mutex, MUTEX_DEFAULT, IPL_NONE); /* Read configuration */ conf = pci_conf_read(pa->pa_pc, pa->pa_tag, LPCIB_SMB_HOSTC); @@ -208,7 +209,6 @@ ichsmb_attach(device_t parent, device_t sc->sc_i2c_device = NULL; flags = 0; - mutex_init(>sc_i2c_mutex, MUTEX_DEFAULT, IPL_NONE); ichsmb_rescan(self, "i2cbus", ); out: if (!pmf_device_register(self, NULL, NULL))
CVS commit: [netbsd-9] src/doc
Module Name:src Committed By: bouyer Date: Mon Dec 9 19:33:56 UTC 2019 Modified Files: src/doc [netbsd-9]: CHANGES-9.0 Log Message: Tickets 537 and 538 To generate a diff of this commit: cvs rdiff -u -r1.1.2.132 -r1.1.2.133 src/doc/CHANGES-9.0 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES-9.0 diff -u src/doc/CHANGES-9.0:1.1.2.132 src/doc/CHANGES-9.0:1.1.2.133 --- src/doc/CHANGES-9.0:1.1.2.132 Mon Dec 9 16:23:19 2019 +++ src/doc/CHANGES-9.0 Mon Dec 9 19:33:56 2019 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-9.0,v 1.1.2.132 2019/12/09 16:23:19 martin Exp $ +# $NetBSD: CHANGES-9.0,v 1.1.2.133 2019/12/09 19:33:56 bouyer Exp $ A complete list of changes from the initial NetBSD 9.0 branch on 2019-07-30 until the 9.0 release: @@ -6922,3 +6922,15 @@ distrib/notes/common/legal.common upto Sync with reality and sort. [uwe, ticket #536] +usr.sbin/sysinst/disklabel.c 1.16, 1.17 + + Fix installation when using existing disklabel partitions with + disk pack names containing spaces. + [martin, ticket #537] + +usr.sbin/sysinst/bsddisklabel.c 1.32 + + PR install/54745: fix confusion about absolut and NetBSD-partition + relative offsets. + [martin, ticket #538] +
CVS commit: [netbsd-9] src/usr.sbin/sysinst
Module Name:src Committed By: bouyer Date: Mon Dec 9 19:33:26 UTC 2019 Modified Files: src/usr.sbin/sysinst [netbsd-9]: bsddisklabel.c Log Message: Pull up following revision(s) (requested by martin in ticket #538): usr.sbin/sysinst/bsddisklabel.c: revision 1.32 PR install/54745: fix confusion about absolut and NetBSD-partition relative offsets. To generate a diff of this commit: cvs rdiff -u -r1.23.2.6 -r1.23.2.7 src/usr.sbin/sysinst/bsddisklabel.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/sysinst/bsddisklabel.c diff -u src/usr.sbin/sysinst/bsddisklabel.c:1.23.2.6 src/usr.sbin/sysinst/bsddisklabel.c:1.23.2.7 --- src/usr.sbin/sysinst/bsddisklabel.c:1.23.2.6 Sun Nov 17 13:45:26 2019 +++ src/usr.sbin/sysinst/bsddisklabel.c Mon Dec 9 19:33:25 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: bsddisklabel.c,v 1.23.2.6 2019/11/17 13:45:26 msaitoh Exp $ */ +/* $NetBSD: bsddisklabel.c,v 1.23.2.7 2019/12/09 19:33:25 bouyer Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -1342,7 +1342,8 @@ apply_settings_to_partitions(struct pm_d /* * Now add new inner partitions (and cloned partitions) */ - for (i = 0; i < wanted->num && from < wanted->parts->disk_size; i++) { + for (i = 0; i < wanted->num && from < + (wanted->parts->disk_size + wanted->parts->disk_start); i++) { struct part_usage_info *want = >infos[i]; if (want->cur_part_id != NO_PART)
CVS commit: [netbsd-9] src/usr.sbin/sysinst
Module Name:src Committed By: bouyer Date: Mon Dec 9 19:31:18 UTC 2019 Modified Files: src/usr.sbin/sysinst [netbsd-9]: disklabel.c Log Message: Pull up following revision(s) (requested by martin in ticket #537): usr.sbin/sysinst/disklabel.c: revision 1.16 usr.sbin/sysinst/disklabel.c: revision 1.17 Sanitize disk type and packname a bit more - when using existing disklabel partitions we might run into trouble later when filing this label (unescaped) in disktab format otherwise. Relax restrictions on packnames, as disklabel(8) does not do full decoding for the tag field. Fix quoting of command args. To generate a diff of this commit: cvs rdiff -u -r1.10.2.5 -r1.10.2.6 src/usr.sbin/sysinst/disklabel.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/sysinst/disklabel.c diff -u src/usr.sbin/sysinst/disklabel.c:1.10.2.5 src/usr.sbin/sysinst/disklabel.c:1.10.2.6 --- src/usr.sbin/sysinst/disklabel.c:1.10.2.5 Sun Nov 17 13:45:26 2019 +++ src/usr.sbin/sysinst/disklabel.c Mon Dec 9 19:31:18 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: disklabel.c,v 1.10.2.5 2019/11/17 13:45:26 msaitoh Exp $ */ +/* $NetBSD: disklabel.c,v 1.10.2.6 2019/12/09 19:31:18 bouyer Exp $ */ /* * Copyright 2018 The NetBSD Foundation, Inc. @@ -262,13 +262,32 @@ disklabel_parts_read(const char *disk, d return >dp; } +/* + * Escape a string for usage as a tag name in a capfile(5), + * we really know there is enough space in the destination buffer... + */ +static void +escape_capfile(char *dest, const char *src, size_t len) +{ + while (*src && len > 0) { + if (*src == ':') + *dest++ = ' '; + else + *dest++ = *src; + src++; + len--; + } + *dest = 0; +} + static bool disklabel_write_to_disk(struct disk_partitions *arg) { struct disklabel_disk_partitions *parts = (struct disklabel_disk_partitions*)arg; FILE *f; - char fname[PATH_MAX], packname[sizeof(parts->l.d_packname)+1]; + char fname[PATH_MAX], packname[sizeof(parts->l.d_packname)+1], + disktype[sizeof(parts->l.d_typename)+1]; int i, rv = 0; const char *disk = parts->dp.disk, *s; const struct partition *lp; @@ -281,13 +300,10 @@ disklabel_write_to_disk(struct disk_part assert(parts->l.d_ncylinders != 0); assert(parts->l.d_secpercyl != 0); - sprintf(fname, "/tmp/disklabel.%u", getpid()); - f = fopen(fname, "w"); - if (f == NULL) - return false; - /* make sure we have a 0 terminated packname */ strlcpy(packname, parts->l.d_packname, sizeof packname); + if (packname[0] == 0) + strcpy(packname, "fictious"); /* fill typename with disk name prefix, if not already set */ if (strlen(parts->l.d_typename) == 0) { @@ -298,18 +314,24 @@ disklabel_write_to_disk(struct disk_part *d = *s; } } - parts->l.d_typename[sizeof(parts->l.d_typename)-1] = 0; /* we need a valid disk type name, so enforce an arbitrary if * above did not yield a usable one */ if (strlen(parts->l.d_typename) == 0) strncpy(parts->l.d_typename, "SCSI", sizeof(parts->l.d_typename)); + escape_capfile(disktype, parts->l.d_typename, + sizeof(parts->l.d_typename)); + + sprintf(fname, "/tmp/disklabel.%u", getpid()); + f = fopen(fname, "w"); + if (f == NULL) + return false; lp = parts->l.d_partitions; scripting_fprintf(NULL, "cat <%s\n", fname); scripting_fprintf(f, "%s|NetBSD installation generated:\\\n", - parts->l.d_typename); + disktype); scripting_fprintf(f, "\t:nc#%d:nt#%d:ns#%d:\\\n", parts->l.d_ncylinders, parts->l.d_ntracks, parts->l.d_nsectors); scripting_fprintf(f, "\t:sc#%d:su#%" PRIu32 ":\\\n", @@ -351,8 +373,8 @@ disklabel_write_to_disk(struct disk_part */ #ifdef DISKLABEL_CMD /* disklabel the disk */ - rv = run_program(RUN_DISPLAY, "%s -f %s %s %s %s", - DISKLABEL_CMD, fname, disk, parts->l.d_typename, packname); + rv = run_program(RUN_DISPLAY, "%s -f %s %s '%s' '%s'", + DISKLABEL_CMD, fname, disk, disktype, packname); #endif unlink(fname);
CVS commit: src/usr.sbin/sysinst
Module Name:src Committed By: martin Date: Mon Dec 9 19:16:54 UTC 2019 Modified Files: src/usr.sbin/sysinst: README.md_defs disklabel.c partitions.c partitions.h src/usr.sbin/sysinst/arch/x68k: md.h Log Message: PR install/54582: allow MD code to disable on-disk presence verification of "real" disklabels. Auto-enable this (at run time) when there is no other partitioning scheme but disklabel configured. Hard-coded enable this for x68k to allow using kernel based translations for native Human68k partitions. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/sysinst/README.md_defs cvs rdiff -u -r1.17 -r1.18 src/usr.sbin/sysinst/disklabel.c cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/sysinst/partitions.c cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/sysinst/partitions.h cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/sysinst/arch/x68k/md.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/sysinst/README.md_defs diff -u src/usr.sbin/sysinst/README.md_defs:1.1 src/usr.sbin/sysinst/README.md_defs:1.2 --- src/usr.sbin/sysinst/README.md_defs:1.1 Wed Aug 14 12:49:37 2019 +++ src/usr.sbin/sysinst/README.md_defs Mon Dec 9 19:16:53 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: README.md_defs,v 1.1 2019/08/14 12:49:37 martin Exp $ */ +/* $NetBSD: README.md_defs,v 1.2 2019/12/09 19:16:53 martin Exp $ */ The following is trying to document the most important machine dependent defines used in the sysinst code. @@ -83,3 +83,10 @@ used like: returns true if the disk could be made bootable with only a disklabel (and no MBR). + +DISKLABEL_NO_ONDISK_VERIFY usually undefined + +If defined, do not verify the presence of on-disk disklabels before +offering the disklabel partitioning scheme. This allows ports to use +kernel translation for the disklabel ioctls (e.g. x86k uses Human68k +partitions this way). Index: src/usr.sbin/sysinst/disklabel.c diff -u src/usr.sbin/sysinst/disklabel.c:1.17 src/usr.sbin/sysinst/disklabel.c:1.18 --- src/usr.sbin/sysinst/disklabel.c:1.17 Sat Dec 7 13:33:45 2019 +++ src/usr.sbin/sysinst/disklabel.c Mon Dec 9 19:16:53 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: disklabel.c,v 1.17 2019/12/07 13:33:45 martin Exp $ */ +/* $NetBSD: disklabel.c,v 1.18 2019/12/09 19:16:53 martin Exp $ */ /* * Copyright 2018 The NetBSD Foundation, Inc. @@ -171,9 +171,17 @@ disklabel_parts_read(const char *disk, d char diskpath[MAXPATHLEN]; uint flags; - if (run_program(RUN_SILENT | RUN_ERROR_OK, - "disklabel -r %s", disk) != 0) - return NULL; +#ifndef DISKLABEL_NO_ONDISK_VERIFY + if (!only_have_disklabel()) { + /* + * If there are alternative partitioning schemes, + * verify we really have a disklabel. + */ + if (run_program(RUN_SILENT | RUN_ERROR_OK, + "disklabel -r %s", disk) != 0) + return NULL; + } +#endif /* read partitions */ Index: src/usr.sbin/sysinst/partitions.c diff -u src/usr.sbin/sysinst/partitions.c:1.5 src/usr.sbin/sysinst/partitions.c:1.6 --- src/usr.sbin/sysinst/partitions.c:1.5 Tue Nov 12 16:33:14 2019 +++ src/usr.sbin/sysinst/partitions.c Mon Dec 9 19:16:53 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: partitions.c,v 1.5 2019/11/12 16:33:14 martin Exp $ */ +/* $NetBSD: partitions.c,v 1.6 2019/12/09 19:16:53 martin Exp $ */ /* * Copyright 2018 The NetBSD Foundation, Inc. @@ -129,6 +129,20 @@ static bool have_only_disklabel_boot_sup } #endif +bool +only_have_disklabel(void) +{ + + if (num_available_part_schemes > 1) + return false; + +#if RAW_PART != 2 + if (available_part_schemes[0] == _disklabel_parts) + return true; +#endif + return available_part_schemes[0] == _parts; +} + /* * One time initialization */ Index: src/usr.sbin/sysinst/partitions.h diff -u src/usr.sbin/sysinst/partitions.h:1.8 src/usr.sbin/sysinst/partitions.h:1.9 --- src/usr.sbin/sysinst/partitions.h:1.8 Tue Nov 12 16:33:14 2019 +++ src/usr.sbin/sysinst/partitions.h Mon Dec 9 19:16:53 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: partitions.h,v 1.8 2019/11/12 16:33:14 martin Exp $ */ +/* $NetBSD: partitions.h,v 1.9 2019/12/09 19:16:53 martin Exp $ */ /* * Copyright 2018 The NetBSD Foundation, Inc. @@ -579,3 +579,5 @@ bool generic_adapt_foreign_part_info( */ void partitions_init(void); void partitions_cleanup(void); +bool only_have_disklabel(void); + Index: src/usr.sbin/sysinst/arch/x68k/md.h diff -u src/usr.sbin/sysinst/arch/x68k/md.h:1.3 src/usr.sbin/sysinst/arch/x68k/md.h:1.4 --- src/usr.sbin/sysinst/arch/x68k/md.h:1.3 Wed Oct 2 11:16:04 2019 +++ src/usr.sbin/sysinst/arch/x68k/md.h Mon Dec 9 19:16:53 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: md.h,v 1.3 2019/10/02 11:16:04 maya Exp $ */ +/* $NetBSD: md.h,v 1.4 2019/12/09 19:16:53 martin Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -89,3 +89,10 @@ * On x68k, do what the 1.2 install scripts did. */ #define DISKLABEL_CMD "disklabel -w" + +/* + * We rely on kernel support to translate
CVS commit: [netbsd-9] src/doc
Module Name:src Committed By: martin Date: Mon Dec 9 16:23:19 UTC 2019 Modified Files: src/doc [netbsd-9]: CHANGES-9.0 Log Message: Tickets #519 - #525, #527 - #536 To generate a diff of this commit: cvs rdiff -u -r1.1.2.131 -r1.1.2.132 src/doc/CHANGES-9.0 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES-9.0 diff -u src/doc/CHANGES-9.0:1.1.2.131 src/doc/CHANGES-9.0:1.1.2.132 --- src/doc/CHANGES-9.0:1.1.2.131 Sun Dec 8 15:05:44 2019 +++ src/doc/CHANGES-9.0 Mon Dec 9 16:23:19 2019 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-9.0,v 1.1.2.131 2019/12/08 15:05:44 martin Exp $ +# $NetBSD: CHANGES-9.0,v 1.1.2.132 2019/12/09 16:23:19 martin Exp $ A complete list of changes from the initial NetBSD 9.0 branch on 2019-07-30 until the 9.0 release: @@ -6807,3 +6807,118 @@ xsrc/external/mit/MesaLib/dist/src/mesa/ CVE-2019-5068: use permission 0600 for shmget(2). [maya, ticket #518] +share/tmac/doc2html1.69 + + Use groff -Tencoding argument to emit + [uwe, ticket #519] + +usr.bin/menuc/testm/main.c 1.8 +usr.bin/menuc/testm/menus.mc 1.13 + + Fix typo in ad clause. + [uwe, ticket #520] + +sys/dev/mii/devlist2h.awk 1.10 + + Fix s/product/model/ search-and-destroy accident that affected license. + [uwe, ticket #521] + +distrib/notes/common/extract-contrib-string.pl upto 1.24 + + Various fixes and some more special cases. + [uwe, ticket #522] + +distrib/notes/Makefile.inc up to 1.52 +distrib/notes/common/macros up to 1.54 + + Improve the table of contents in the release notes. + [uwe, ticket #523] + +sys/external/bsd/dwc2/dwc2.c 1.60-1.66 + + PR/54696: calulate the right lenght for isoc transfer and the + usb_syncmem. + [skrll, ticket #524] + +distrib/sets/lists/modules/ad.arm 1.14 +distrib/sets/lists/modules/md.amd64 1.82 +distrib/sets/lists/modules/md.i386 1.83 +distrib/sets/lists/modules/mi 1.128 +external/cddl/osnet/dev/dtrace/aarch64/dtrace_asm.S 1.1 +external/cddl/osnet/dev/dtrace/aarch64/dtrace_isa.c 1.1 +external/cddl/osnet/dev/dtrace/aarch64/dtrace_subr.c 1.1 +external/cddl/osnet/dev/dtrace/aarch64/regset.h 1.1 +external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c 1.1 +external/cddl/osnet/dev/fbt/aarch64/fbt_isa.h 1.1 +external/cddl/osnet/dist/lib/libdtrace/aarch64/dt_isadep.c 1.2 +external/cddl/osnet/dist/lib/libdtrace/common/dt_link.c 1.12 +external/cddl/osnet/lib/libdtrace/Makefile 1.26 +share/mk/bsd.own.mk1.1168 +sys/arch/aarch64/aarch64/start.S 1.3 +sys/arch/aarch64/aarch64/trap.c 1.22 +sys/arch/aarch64/conf/Makefile.aarch64 1.16 +sys/arch/aarch64/include/frame.h 1.3 +sys/arch/evbarm/conf/mk.generic64 1.4 +sys/modules/cyclic/Makefile 1.4 +sys/modules/dtrace/Makefile 1.7,1.8 +usr.bin/mkubootimage/mkubootimage.1 1.13 +usr.bin/mkubootimage/mkubootimage.c 1.25,1.26 + + dtrace: add aarch64 support + [jmcneill, ticket #525] + +lib/libc/sys/modctl.21.16 +sbin/modstat/modstat.81.24,1.26 + + PR kern/54737: note that the size returned by modctl(2) + and displayed by modstat(8) is only for the module's text section. + [pgoyette, ticket #527] + +sys/dev/cons.c 1.76,1.77 + + Fix reference count leak in cons(4). + [riastradh, ticket #528] + +sys/arch/arm/rockchip/rk3399_pcie.c 1.8 +sys/arch/evbarm/conf/std.generic64 1.12 + + arm: rk3399: fix a PCIe crash. + [jmcneill, ticket #529] + +crypto/external/bsd/openssl/dist/crypto/engine/eng_devcrypto.c 1.5 + + PR/54740: Izumi Tsutsui: Disable cryptoengine unavailable message when + device is not configured (ENXIO). + [tsutsui, ticket #530] + +include/monetary.h1.4 + + PR lib/54744: add missing __END_DECLS for C++ compiles. + [kre, ticket #531] + +sys/arch/aarch64/aarch64/locore.S 1.46 + + Mark FDT as non-exec and create KVA=VA mapping of same size as + identity mapping. + [skrll, ticket #532] + +sys/arch/macppc/conf/INSTALL_601 1.3 + + Add platinumfb. + [scole, ticket #533] + +libexec/ld.elf_so/rtld.c 1.201 + + Fix debug printf format for a size_t argument. + [uwe, ticket #534] + +libexec/ld.elf_so/arch/powerpc/ppc_reloc.c 1.59,1.60 + + Resolve ADDR16_LO, ADDR16_HI, and ADDR16_HA relocs. + [uwe, ticket #535] + +distrib/notes/common/legal.common upto 1.124 (adapted) + + Sync with reality and sort. + [uwe, ticket #536] +
CVS commit: [netbsd-9] src/distrib/notes/common
Module Name:src Committed By: martin Date: Mon Dec 9 16:20:11 UTC 2019 Modified Files: src/distrib/notes/common [netbsd-9]: legal.common Log Message: Pull up the following changes, requested by uwe in ticket #536: distrib/notes/common/legal.common upto 1.124 (adapted) Sync with reality and sort. To generate a diff of this commit: cvs rdiff -u -r1.98.12.1 -r1.98.12.2 src/distrib/notes/common/legal.common Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/notes/common/legal.common diff -u src/distrib/notes/common/legal.common:1.98.12.1 src/distrib/notes/common/legal.common:1.98.12.2 --- src/distrib/notes/common/legal.common:1.98.12.1 Thu Nov 21 19:28:39 2019 +++ src/distrib/notes/common/legal.common Mon Dec 9 16:20:11 2019 @@ -1,4 +1,4 @@ -.\" $NetBSD: legal.common,v 1.98.12.1 2019/11/21 19:28:39 martin Exp $ +.\" $NetBSD: legal.common,v 1.98.12.2 2019/12/09 16:20:11 martin Exp $ .\" .\" Copyright (c) 1999-2004 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -55,9 +55,6 @@ This product includes software developed NetBSD Project. See https://www.NetBSD.org/ for information about NetBSD. .It -This product includes software developed by Intel Corporation and -its contributors. -.It This product includes cryptographic software written by Eric Young (e...@cryptsoft.com) .It @@ -66,55 +63,41 @@ Eric Young (e...@mincom.oz.au) .It This product includes software designed by William Allen Simpson. .It -This product includes software developed at Ludd, University of -Lulea, Sweden and its contributors. +This product includes software developed at Ludd, University of Lule\(oa. .It -This product includes software developed at Ludd, University of Lulea. +This product includes software developed at Ludd, University of +Lule\(oa, Sweden and its contributors. .It This product includes software developed at the Information Technology Division, US Naval Research Laboratory. .It -This product includes software developed by -David Jones and Gordon Ross -.It -This product includes software developed by -Hellmuth Michaelis and Joerg Wunsch -.It -This product includes software developed by -Internet Research Institute, Inc. -.It -This product includes software developed by -Leo Weppelman and Waldi Ravens. -.It -This product includes software developed by Mika Kortelainen -.It This product includes software developed by Aaron Brown and Harvard University. .It This product includes software developed by Adam Ciarcinski for the NetBSD project. .It +This product includes software developed by Adam Glass. +.It This product includes software developed by Adam Glass and Charles M. Hannum. .It -This product includes software developed by Adam Glass. +This product includes software developed by Alex Zepeda. .It This product includes software developed by Alex Zepeda, and Colin Wood for the NetBSD Projet. .It -This product includes software developed by Alex Zepeda. -.It This product includes software developed by Allen Briggs. .It This product includes software developed by Amancio Hasty and Roger Hardiman .It -This product includes software developed by Berkeley Software Design, Inc. +This product includes software developed by Ben Gray. .It -This product includes software developed by Bill Paul. +This product includes software developed by Berkeley Software Design, +Inc. .It -This product includes software developed by Bodo Moeller. -(If available, substitute umlauted o for oe) +This product includes software developed by Bill Paul. .It This product includes software developed by Boris Popov. .It @@ -126,30 +109,35 @@ This product includes software developed .It This product includes software developed by Charles Hannum. .It +This product includes software developed by Charles M. Hannum. +.It This product includes software developed by Charles M. Hannum, by the University of Vermont and State Agricultural College and Garrett A. Wollman, by William F. Jolitz, and by the University of California, Berkeley, Lawrence Berkeley Laboratory, and its contributors. .It -This product includes software developed by Charles M. Hannum. +This product includes software developed by Christian E. Hopps. .It This product includes software developed by Christian E. Hopps, Ezra Story, Kari Mettinen, Markus Wild, Lutz Vieweg and Michael Teske. .It -This product includes software developed by Christian E. Hopps. +This product includes software developed by Christopher G. Demetriou. .It This product includes software developed by Christopher G. Demetriou for the NetBSD Project. .It -This product includes software developed by Christopher G. Demetriou. -.It This product includes software developed by Chuck Silvers. .It +This product includes software developed by Cisco Systems, Inc. +.It +This product includes software developed by Colin Wood.
CVS commit: src/sys/arch/emips/emips
Module Name:src Committed By: tsutsui Date: Mon Dec 9 16:19:11 UTC 2019 Modified Files: src/sys/arch/emips/emips: interrupt.c Log Message: Fix incorrect argument order of cpu_intr(), slipped in rev 1.2. Pointed out by maya@ in PR/45080. Should be pulled up to netbsd-9. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/arch/emips/emips/interrupt.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/emips/emips/interrupt.c diff -u src/sys/arch/emips/emips/interrupt.c:1.6 src/sys/arch/emips/emips/interrupt.c:1.7 --- src/sys/arch/emips/emips/interrupt.c:1.6 Mon Jul 11 16:18:56 2016 +++ src/sys/arch/emips/emips/interrupt.c Mon Dec 9 16:19:11 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: interrupt.c,v 1.6 2016/07/11 16:18:56 matt Exp $ */ +/* $NetBSD: interrupt.c,v 1.7 2019/12/09 16:19:11 tsutsui Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.6 2016/07/11 16:18:56 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.7 2019/12/09 16:19:11 tsutsui Exp $"); #include #include @@ -95,7 +95,7 @@ intr_init(void) * emips uses one line for all I/O interrupts (0x8000). */ void -cpu_intr(int ppl, uint32_t status, vaddr_t pc) +cpu_intr(int ppl, vaddr_t pc, uint32_t status) { uint32_t ipending; int ipl;
CVS commit: [netbsd-9] src/libexec/ld.elf_so/arch/powerpc
Module Name:src Committed By: martin Date: Mon Dec 9 16:14:10 UTC 2019 Modified Files: src/libexec/ld.elf_so/arch/powerpc [netbsd-9]: ppc_reloc.c Log Message: Pull up following revision(s) (requested by uwe in ticket #535): libexec/ld.elf_so/arch/powerpc/ppc_reloc.c: revision 1.60 libexec/ld.elf_so/arch/powerpc/ppc_reloc.c: revision 1.59 Resolve ADDR16_LO, ADDR16_HI, and ADDR16_HA relocs. Recent GNU ld does not resolve them statically if the reloc is in a writable section and the symbol is not already referenced from text. Use existing lo() and hi() macros. Same object code is generated. To generate a diff of this commit: cvs rdiff -u -r1.58 -r1.58.2.1 src/libexec/ld.elf_so/arch/powerpc/ppc_reloc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/libexec/ld.elf_so/arch/powerpc/ppc_reloc.c diff -u src/libexec/ld.elf_so/arch/powerpc/ppc_reloc.c:1.58 src/libexec/ld.elf_so/arch/powerpc/ppc_reloc.c:1.58.2.1 --- src/libexec/ld.elf_so/arch/powerpc/ppc_reloc.c:1.58 Sun Dec 30 03:23:46 2018 +++ src/libexec/ld.elf_so/arch/powerpc/ppc_reloc.c Mon Dec 9 16:14:10 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: ppc_reloc.c,v 1.58 2018/12/30 03:23:46 christos Exp $ */ +/* $NetBSD: ppc_reloc.c,v 1.58.2.1 2019/12/09 16:14:10 martin Exp $ */ /*- * Copyright (C) 1998 Tsubai Masanari @@ -30,7 +30,7 @@ #include #ifndef lint -__RCSID("$NetBSD: ppc_reloc.c,v 1.58 2018/12/30 03:23:46 christos Exp $"); +__RCSID("$NetBSD: ppc_reloc.c,v 1.58.2.1 2019/12/09 16:14:10 martin Exp $"); #endif /* not lint */ #include @@ -197,6 +197,9 @@ _rtld_relocate_nonplt_objects(Obj_Entry case R_TYPE(ADDR32): /* S + A */ #endif case R_TYPE(GLOB_DAT): /* S + A */ + case R_TYPE(ADDR16_LO): + case R_TYPE(ADDR16_HI): + case R_TYPE(ADDR16_HA): case R_TYPE(DTPMOD): case R_TYPE(DTPREL): case R_TYPE(TPREL): @@ -234,6 +237,50 @@ _rtld_relocate_nonplt_objects(Obj_Entry obj->path, (void *)*where, defobj->path)); break; + /* + * Recent GNU ld does not resolve ADDR16_{LO,HI,HA} if + * the reloc is in a writable section and the symbol + * is not already referenced from text. + */ + case R_TYPE(ADDR16_LO): { + tmp = (Elf_Addr)(defobj->relocbase + def->st_value + + rela->r_addend); + + uint16_t tmp16 = lo(tmp); + + uint16_t *where16 = (uint16_t *)where; + if (*where16 != tmp16) +*where16 = tmp16; + rdbg(("ADDR16_LO %s in %s --> #lo(%p) = 0x%x in %s", + obj->strtab + obj->symtab[symnum].st_name, + obj->path, (void *)tmp, tmp16, defobj->path)); + break; + } + + case R_TYPE(ADDR16_HI): + case R_TYPE(ADDR16_HA): { + tmp = (Elf_Addr)(defobj->relocbase + def->st_value + + rela->r_addend); + + uint16_t tmp16 = hi(tmp); + if (ELF_R_TYPE(rela->r_info) == R_TYPE(ADDR16_HA) + && (tmp & __ha16)) +++tmp16; /* adjust to ha(tmp) */ + + uint16_t *where16 = (uint16_t *)where; + if (*where16 != tmp16) +*where16 = tmp16; + rdbg(("ADDR16_H%c %s in %s --> #h%c(%p) = 0x%x in %s", + (ELF_R_TYPE(rela->r_info) == R_TYPE(ADDR16_HI) + ? 'I' : 'A'), + obj->strtab + obj->symtab[symnum].st_name, + obj->path, + (ELF_R_TYPE(rela->r_info) == R_TYPE(ADDR16_HI) + ? 'i' : 'a'), + (void *)tmp, tmp16, defobj->path)); + break; + } + case R_TYPE(RELATIVE): /* B + A */ *where = (Elf_Addr)(obj->relocbase + rela->r_addend); rdbg(("RELATIVE in %s --> %p", obj->path,
CVS commit: [netbsd-9] src/libexec/ld.elf_so
Module Name:src Committed By: martin Date: Mon Dec 9 16:12:16 UTC 2019 Modified Files: src/libexec/ld.elf_so [netbsd-9]: rtld.c Log Message: Pull up following revision(s) (requested by uwe in ticket #534): libexec/ld.elf_so/rtld.c: revision 1.201 _rtld_relro - fix debug printf format for a size_t argument To generate a diff of this commit: cvs rdiff -u -r1.197.2.1 -r1.197.2.2 src/libexec/ld.elf_so/rtld.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/libexec/ld.elf_so/rtld.c diff -u src/libexec/ld.elf_so/rtld.c:1.197.2.1 src/libexec/ld.elf_so/rtld.c:1.197.2.2 --- src/libexec/ld.elf_so/rtld.c:1.197.2.1 Wed Sep 18 16:09:07 2019 +++ src/libexec/ld.elf_so/rtld.c Mon Dec 9 16:12:16 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: rtld.c,v 1.197.2.1 2019/09/18 16:09:07 martin Exp $ */ +/* $NetBSD: rtld.c,v 1.197.2.2 2019/12/09 16:12:16 martin Exp $ */ /* * Copyright 1996 John D. Polstra. @@ -40,7 +40,7 @@ #include #ifndef lint -__RCSID("$NetBSD: rtld.c,v 1.197.2.1 2019/09/18 16:09:07 martin Exp $"); +__RCSID("$NetBSD: rtld.c,v 1.197.2.2 2019/12/09 16:12:16 martin Exp $"); #endif /* not lint */ #include @@ -1776,7 +1776,7 @@ _rtld_relro(const Obj_Entry *obj, bool w if (wantmain != (obj ==_rtld_objmain)) return 0; - dbg(("RELRO %s %p %lx\n", obj->path, obj->relro_page, obj->relro_size)); + dbg(("RELRO %s %p %zx\n", obj->path, obj->relro_page, obj->relro_size)); if (mprotect(obj->relro_page, obj->relro_size, PROT_READ) == -1) { _rtld_error("%s: Cannot enforce relro " "protection: %s", obj->path, xstrerror(errno));
CVS commit: [netbsd-9] src/sys/arch/macppc/conf
Module Name:src Committed By: martin Date: Mon Dec 9 16:10:35 UTC 2019 Modified Files: src/sys/arch/macppc/conf [netbsd-9]: INSTALL_601 Log Message: Pull up following revision(s) (requested by scole in ticket #533): sys/arch/macppc/conf/INSTALL_601: revision 1.3 add platinumfb To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.2.6.1 src/sys/arch/macppc/conf/INSTALL_601 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/macppc/conf/INSTALL_601 diff -u src/sys/arch/macppc/conf/INSTALL_601:1.2 src/sys/arch/macppc/conf/INSTALL_601:1.2.6.1 --- src/sys/arch/macppc/conf/INSTALL_601:1.2 Mon Jan 7 01:44:59 2019 +++ src/sys/arch/macppc/conf/INSTALL_601 Mon Dec 9 16:10:35 2019 @@ -1,4 +1,4 @@ -# $NetBSD: INSTALL_601,v 1.2 2019/01/07 01:44:59 scole Exp $ +# $NetBSD: INSTALL_601,v 1.2.6.1 2019/12/09 16:10:35 martin Exp $ # # config file for INSTALL # @@ -84,7 +84,7 @@ ahc* at pci? dev ? function ? # Adaptec # untested with OF 1.0.5 # this will take over the console if output-device is set to 'screen' or # 'platinum'. It will provide a NetBSD console, but still won't work with OF -#platinumfb0 at mainbus? +platinumfb0 at mainbus? #gffb* at pci? function ? # NVIDIA GeForce2 MX #machfb* at pci? function ? # ATI Mach 64, Rage, Rage Pro
CVS commit: [netbsd-9] src/sys/arch/aarch64/aarch64
Module Name:src Committed By: martin Date: Mon Dec 9 16:08:58 UTC 2019 Modified Files: src/sys/arch/aarch64/aarch64 [netbsd-9]: locore.S Log Message: Pull up following revision(s) (requested by skrll in ticket #532): sys/arch/aarch64/aarch64/locore.S: revision 1.46 Mark FDT as non-exec and create KVA=VA mapping of same size as identity mapping, i.e. include BOOTPAGE_ALLOC_MAX To generate a diff of this commit: cvs rdiff -u -r1.39.2.2 -r1.39.2.3 src/sys/arch/aarch64/aarch64/locore.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/aarch64/aarch64/locore.S diff -u src/sys/arch/aarch64/aarch64/locore.S:1.39.2.2 src/sys/arch/aarch64/aarch64/locore.S:1.39.2.3 --- src/sys/arch/aarch64/aarch64/locore.S:1.39.2.2 Wed Oct 23 19:14:19 2019 +++ src/sys/arch/aarch64/aarch64/locore.S Mon Dec 9 16:08:57 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.39.2.2 2019/10/23 19:14:19 martin Exp $ */ +/* $NetBSD: locore.S,v 1.39.2.3 2019/12/09 16:08:57 martin Exp $ */ /* * Copyright (c) 2017 Ryo Shimizu @@ -38,7 +38,7 @@ #include #include "assym.h" -RCSID("$NetBSD: locore.S,v 1.39.2.2 2019/10/23 19:14:19 martin Exp $") +RCSID("$NetBSD: locore.S,v 1.39.2.3 2019/12/09 16:08:57 martin Exp $") /*#define DEBUG_LOCORE /* debug print */ @@ -819,6 +819,7 @@ init_mmutable: adr x6, bootpage_alloc /* allocator */ mov x5, xzr/* flags = 0 */ mov x4, #LX_BLKPAG_ATTR_NORMAL_NC|LX_BLKPAG_AP_RW /* attr */ + orr x4, x4, #LX_BLKPAG_UXN|LX_BLKPAG_PXN mov x3, #L2_SIZE /* blocksize */ mov x2, #L2_SIZE /* size */ mov x1, x8/* pa */ @@ -837,6 +838,7 @@ init_mmutable: adr x1, start /* pa = start */ ADDR x2, _end sub x2, x2, x1 /* size = _end - start */ + add x2, x2, #BOOTPAGE_ALLOC_MAX /* for bootpage_alloc() */ ldr x0, =start /* va */ bl pmapboot_enter cbnz x0, init_mmutable_error
CVS commit: src/sys/dev/dm
Module Name:src Committed By: tkusumi Date: Mon Dec 9 16:06:19 UTC 2019 Modified Files: src/sys/dev/dm: dm_target_linear.c Log Message: dm: Silence aprint_normal() in dm_target_linear_status() dm_target_linear_status() shouldn't print this debug message by default on dmsetup "table" ioctl/command. To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/sys/dev/dm/dm_target_linear.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/dm/dm_target_linear.c diff -u src/sys/dev/dm/dm_target_linear.c:1.25 src/sys/dev/dm/dm_target_linear.c:1.26 --- src/sys/dev/dm/dm_target_linear.c:1.25 Sun Dec 8 04:41:02 2019 +++ src/sys/dev/dm/dm_target_linear.c Mon Dec 9 16:06:19 2019 @@ -1,4 +1,4 @@ -/*$NetBSD: dm_target_linear.c,v 1.25 2019/12/08 04:41:02 tkusumi Exp $ */ +/*$NetBSD: dm_target_linear.c,v 1.26 2019/12/09 16:06:19 tkusumi Exp $ */ /* * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__KERNEL_RCSID(0, "$NetBSD: dm_target_linear.c,v 1.25 2019/12/08 04:41:02 tkusumi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dm_target_linear.c,v 1.26 2019/12/09 16:06:19 tkusumi Exp $"); /* * This file implements initial version of device-mapper dklinear target. @@ -106,7 +106,6 @@ dm_target_linear_status(void *target_con aprint_debug("Linear target status function called\n"); params = kmem_alloc(DM_MAX_PARAMS_SIZE, KM_SLEEP); - aprint_normal("%s %" PRIu64, tlc->pdev->name, tlc->offset); snprintf(params, DM_MAX_PARAMS_SIZE, "%s %" PRIu64, tlc->pdev->name, tlc->offset);
CVS commit: [netbsd-9] src/include
Module Name:src Committed By: martin Date: Mon Dec 9 16:05:05 UTC 2019 Modified Files: src/include [netbsd-9]: monetary.h Log Message: Pull up following revision(s) (requested by kre in ticket #531): include/monetary.h: revision 1.4 PR lib/54744 (br...@haible.de) Add missing __END_DECLS for C++ compiles. XXX pullup -9 XXX pullup -8 (bug not present in -7). To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.3.6.1 src/include/monetary.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/include/monetary.h diff -u src/include/monetary.h:1.3 src/include/monetary.h:1.3.6.1 --- src/include/monetary.h:1.3 Wed Aug 16 13:53:20 2017 +++ src/include/monetary.h Mon Dec 9 16:05:04 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: monetary.h,v 1.3 2017/08/16 13:53:20 joerg Exp $ */ +/* $NetBSD: monetary.h,v 1.3.6.1 2019/12/09 16:05:04 martin Exp $ */ /*- * Copyright (c) 2001 Alexey Zelkin @@ -52,6 +52,7 @@ typedef struct _locale *locale_t; __BEGIN_DECLS ssize_t strfmon_l(char * __restrict, size_t, locale_t, const char * __restrict, ...) __attribute__((__format__(__strfmon__, 4, 5))); +__END_DECLS #endif __BEGIN_DECLS
CVS commit: [netbsd-9] src/crypto/external/bsd/openssl/dist/crypto/engine
Module Name:src Committed By: martin Date: Mon Dec 9 16:02:37 UTC 2019 Modified Files: src/crypto/external/bsd/openssl/dist/crypto/engine [netbsd-9]: eng_devcrypto.c Log Message: Pull up following revision(s) (requested by tsutsui in ticket #530): crypto/external/bsd/openssl/dist/crypto/engine/eng_devcrypto.c: revision 1.5 PR/54740: Izumi Tsutsui: Disable cryptoengine unavailable message when device is not configured (ENXIO). To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.4.4.1 \ src/crypto/external/bsd/openssl/dist/crypto/engine/eng_devcrypto.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/crypto/external/bsd/openssl/dist/crypto/engine/eng_devcrypto.c diff -u src/crypto/external/bsd/openssl/dist/crypto/engine/eng_devcrypto.c:1.4 src/crypto/external/bsd/openssl/dist/crypto/engine/eng_devcrypto.c:1.4.4.1 --- src/crypto/external/bsd/openssl/dist/crypto/engine/eng_devcrypto.c:1.4 Tue Mar 12 16:58:13 2019 +++ src/crypto/external/bsd/openssl/dist/crypto/engine/eng_devcrypto.c Mon Dec 9 16:02:37 2019 @@ -761,7 +761,7 @@ void engine_load_devcrypto_int() if ((cfd = open("/dev/crypto", O_RDWR, 0)) < 0) { #ifndef ENGINE_DEVCRYPTO_DEBUG -if (errno != ENOENT) +if (errno != ENOENT && errno != ENXIO) #endif fprintf(stderr, "Could not open /dev/crypto: %s\n", strerror(errno)); return;
CVS commit: [netbsd-9] src/sys/arch
Module Name:src Committed By: martin Date: Mon Dec 9 16:01:12 UTC 2019 Modified Files: src/sys/arch/arm/rockchip [netbsd-9]: rk3399_pcie.c src/sys/arch/evbarm/conf [netbsd-9]: std.generic64 Log Message: Pull up following revision(s) (requested by jmcneill in ticket #529): sys/arch/evbarm/conf/std.generic64: revision 1.12 sys/arch/arm/rockchip/rk3399_pcie.c: revision 1.8 Define __BUS_SPACE_HAS_PROBING_METHODS Use bus_space_{peek,poke}_4 for pci conf reg access. To generate a diff of this commit: cvs rdiff -u -r1.6.2.1 -r1.6.2.2 src/sys/arch/arm/rockchip/rk3399_pcie.c cvs rdiff -u -r1.10.2.1 -r1.10.2.2 src/sys/arch/evbarm/conf/std.generic64 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/arm/rockchip/rk3399_pcie.c diff -u src/sys/arch/arm/rockchip/rk3399_pcie.c:1.6.2.1 src/sys/arch/arm/rockchip/rk3399_pcie.c:1.6.2.2 --- src/sys/arch/arm/rockchip/rk3399_pcie.c:1.6.2.1 Sun Dec 8 12:55:30 2019 +++ src/sys/arch/arm/rockchip/rk3399_pcie.c Mon Dec 9 16:01:12 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: rk3399_pcie.c,v 1.6.2.1 2019/12/08 12:55:30 martin Exp $ */ +/* $NetBSD: rk3399_pcie.c,v 1.6.2.2 2019/12/09 16:01:12 martin Exp $ */ /* * Copyright (c) 2018 Mark Kettenis * @@ -17,7 +17,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: rk3399_pcie.c,v 1.6.2.1 2019/12/08 12:55:30 martin Exp $"); +__KERNEL_RCSID(1, "$NetBSD: rk3399_pcie.c,v 1.6.2.2 2019/12/09 16:01:12 martin Exp $"); #include #include @@ -121,10 +121,10 @@ __KERNEL_RCSID(1, "$NetBSD: rk3399_pcie. bus_space_read_4((sc)->sc_iot, (sc)->sc_ioh, (reg)) #define HWRITE4(sc, reg, val) \ bus_space_write_4((sc)->sc_iot, (sc)->sc_ioh, (reg), (val)) -#define AXIREAD4(sc, reg) \ - bus_space_read_4((sc)->sc_iot, (sc)->sc_axi_ioh, (reg)) -#define AXIWRITE4(sc, reg, val) \ - bus_space_write_4((sc)->sc_iot, (sc)->sc_axi_ioh, (reg), (val)) +#define AXIPEEK4(sc, reg, valp) \ + bus_space_peek_4((sc)->sc_iot, (sc)->sc_axi_ioh, (reg), (valp)) +#define AXIPOKE4(sc, reg, val) \ + bus_space_poke_4((sc)->sc_iot, (sc)->sc_axi_ioh, (reg), (val)) struct rkpcie_softc { struct pcihost_softc sc_phsc; @@ -540,8 +540,12 @@ rkpcie_conf_read(void *v, pcitag_t tag, if (bus == phsc->sc_bus_min) return HREAD4(sc, PCIE_RC_NORMAL_BASE + reg); - else - return AXIREAD4(sc, reg); + else { + uint32_t val; + if (AXIPEEK4(sc, reg, ) != 0) + return 0x; + return val; + } } void @@ -563,7 +567,7 @@ rkpcie_conf_write(void *v, pcitag_t tag, if (bus == phsc->sc_bus_min) HWRITE4(sc, PCIE_RC_NORMAL_BASE + reg, data); else - AXIWRITE4(sc, reg, data); + AXIPOKE4(sc, reg, data); } static int Index: src/sys/arch/evbarm/conf/std.generic64 diff -u src/sys/arch/evbarm/conf/std.generic64:1.10.2.1 src/sys/arch/evbarm/conf/std.generic64:1.10.2.2 --- src/sys/arch/evbarm/conf/std.generic64:1.10.2.1 Sun Sep 22 12:35:56 2019 +++ src/sys/arch/evbarm/conf/std.generic64 Mon Dec 9 16:01:11 2019 @@ -1,4 +1,4 @@ -# $NetBSD: std.generic64,v 1.10.2.1 2019/09/22 12:35:56 martin Exp $ +# $NetBSD: std.generic64,v 1.10.2.2 2019/12/09 16:01:11 martin Exp $ # # generic NetBSD/evbarm64 with FDT support @@ -23,6 +23,7 @@ options _ARM32_NEED_BUS_DMA_BOUNCE options __HAVE_GENERIC_CPU_INITCLOCKS options __HAVE_PCI_CONF_HOOK options __HAVE_PCI_MSI_MSIX +options __BUS_SPACE_HAS_PROBING_METHODS # XXXNH not yet #options __HAVE_CPU_UAREA_ALLOC_IDLELWP
CVS commit: [netbsd-9] src/sys/dev
Module Name:src Committed By: martin Date: Mon Dec 9 15:58:48 UTC 2019 Modified Files: src/sys/dev [netbsd-9]: cons.c Log Message: Pull up following revision(s) (requested by riastradh in ticket #528): sys/dev/cons.c: revision 1.76 sys/dev/cons.c: revision 1.77 Fix reference count leak in cons(4). Don't forget to vrele after you're done, folks! XXX pullup-9 XXX pullup-8 XXX pullup-7 XXX pullup-6... 5... 4 might not have had this bug! Restore historical $Hdr$ tag after git cvsexportcommit nixed it. To generate a diff of this commit: cvs rdiff -u -r1.75 -r1.75.24.1 src/sys/dev/cons.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/cons.c diff -u src/sys/dev/cons.c:1.75 src/sys/dev/cons.c:1.75.24.1 --- src/sys/dev/cons.c:1.75 Fri May 29 16:26:45 2015 +++ src/sys/dev/cons.c Mon Dec 9 15:58:48 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: cons.c,v 1.75 2015/05/29 16:26:45 macallan Exp $ */ +/* $NetBSD: cons.c,v 1.75.24.1 2019/12/09 15:58:48 martin Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -39,7 +39,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cons.c,v 1.75 2015/05/29 16:26:45 macallan Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cons.c,v 1.75.24.1 2019/12/09 15:58:48 martin Exp $"); #include #include @@ -158,6 +158,7 @@ cnclose(dev_t dev, int flag, int mode, s if (error == 0) { error = VOP_CLOSE(vp, flag, kauth_cred_get()); VOP_UNLOCK(vp); + vrele(vp); } return error; }
CVS commit: [netbsd-9] src
Module Name:src Committed By: martin Date: Mon Dec 9 15:56:49 UTC 2019 Modified Files: src/lib/libc/sys [netbsd-9]: modctl.2 src/sbin/modstat [netbsd-9]: modstat.8 Log Message: Pull up following revision(s) (requested by pgoyette in ticket #527): sbin/modstat/modstat.8: revision 1.24 sbin/modstat/modstat.8: revision 1.26 lib/libc/sys/modctl.2: revision 1.16 Note that the size returned by modctl(2) and displayed by modstat(8) is only for the module's text section, not for the entire size of the module. Addresses PR kern-54737 Remove superfluous Pp. To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.15.2.1 src/lib/libc/sys/modctl.2 cvs rdiff -u -r1.23 -r1.23.2.1 src/sbin/modstat/modstat.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/sys/modctl.2 diff -u src/lib/libc/sys/modctl.2:1.15 src/lib/libc/sys/modctl.2:1.15.2.1 --- src/lib/libc/sys/modctl.2:1.15 Mon Apr 8 10:47:16 2019 +++ src/lib/libc/sys/modctl.2 Mon Dec 9 15:56:49 2019 @@ -1,4 +1,4 @@ -.\" $NetBSD: modctl.2,v 1.15 2019/04/08 10:47:16 pgoyette Exp $ +.\" $NetBSD: modctl.2,v 1.15.2.1 2019/12/09 15:56:49 martin Exp $ .\" .\" Copyright (c) 2009 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -24,7 +24,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd April 8, 2019 +.Dd December 4, 2019 .Dt MODCTL 2 .Os .Sh NAME @@ -184,7 +184,7 @@ Miscellaneous. The load address within the kernel. (This value is available only for privileged users.) .It Fa "u_int ms_size" -Loaded size of the module. +Loaded size of the module's text section. (This value is available only for privileged users.) .It Fa "u_int ms_refcnt" Current number of live references to this module. Index: src/sbin/modstat/modstat.8 diff -u src/sbin/modstat/modstat.8:1.23 src/sbin/modstat/modstat.8:1.23.2.1 --- src/sbin/modstat/modstat.8:1.23 Sun Jan 27 02:08:36 2019 +++ src/sbin/modstat/modstat.8 Mon Dec 9 15:56:49 2019 @@ -1,4 +1,4 @@ -.\" $NetBSD: modstat.8,v 1.23 2019/01/27 02:08:36 pgoyette Exp $ +.\" $NetBSD: modstat.8,v 1.23.2.1 2019/12/09 15:56:49 martin Exp $ .\" .\" Copyright (c) 1993 Christopher G. Demetriou .\" All rights reserved. @@ -32,7 +32,7 @@ .\" .\" <> .\" -.Dd September 8, 2018 +.Dd December 4, 2019 .Dt MODSTAT 8 .Os .Sh NAME @@ -76,7 +76,6 @@ In addition to listing the currently loa the information reported by .Nm includes: -.Pp .Bl -tag -width Loadaddr .It Li CLASS Module class, such as @@ -90,7 +89,7 @@ indicates that the module was loaded dur .Qq Dv filesys indicates that the module was loaded from the file system. .It Li SIZE -Size of the module in bytes. +Size of the module's text section, in bytes. .It Li FLAG The module flags: .Bl -tag -width a -offset indent -compact
CVS commit: src/sys/dev/dm
Module Name:src Committed By: tkusumi Date: Mon Dec 9 15:54:59 UTC 2019 Modified Files: src/sys/dev/dm: device-mapper.c Log Message: dm: Fix error handling in dmioctl() Looks like cleanup_exit label is in a wrong place. Should skip prop_dictionary_copyout_ioctl() on error. To generate a diff of this commit: cvs rdiff -u -r1.47 -r1.48 src/sys/dev/dm/device-mapper.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/dm/device-mapper.c diff -u src/sys/dev/dm/device-mapper.c:1.47 src/sys/dev/dm/device-mapper.c:1.48 --- src/sys/dev/dm/device-mapper.c:1.47 Sat Dec 7 16:13:39 2019 +++ src/sys/dev/dm/device-mapper.c Mon Dec 9 15:54:59 2019 @@ -1,4 +1,4 @@ -/*$NetBSD: device-mapper.c,v 1.47 2019/12/07 16:13:39 tkusumi Exp $ */ +/*$NetBSD: device-mapper.c,v 1.48 2019/12/09 15:54:59 tkusumi Exp $ */ /* * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -355,20 +355,18 @@ dmioctl(dev_t dev, const u_long cmd, voi int r; prop_dictionary_t dm_dict_in; - r = 0; - aprint_debug("dmioctl called\n"); KASSERT(data != NULL); if ((r = disk_ioctl_switch(dev, cmd, data)) == ENOTTY) { - struct plistref *pref = (struct plistref *) data; + struct plistref *pref = (struct plistref *)data; /* Check if we were called with NETBSD_DM_IOCTL ioctl otherwise quit. */ if ((r = dm_ioctl_switch(cmd)) != 0) return r; - if((r = prop_dictionary_copyin_ioctl(pref, cmd, _dict_in)) + if ((r = prop_dictionary_copyin_ioctl(pref, cmd, _dict_in)) != 0) return r; @@ -379,8 +377,8 @@ dmioctl(dev_t dev, const u_long cmd, voi if ((r = dm_cmd_to_fun(dm_dict_in)) != 0) goto cleanup_exit; -cleanup_exit: r = prop_dictionary_copyout_ioctl(pref, cmd, dm_dict_in); +cleanup_exit: prop_object_release(dm_dict_in); }
CVS commit: src/sys/external/bsd/drm2/drm
Module Name:src Committed By: jakllsch Date: Mon Dec 9 15:37:26 UTC 2019 Modified Files: src/sys/external/bsd/drm2/drm: files.drmkms Log Message: build drm_panel.c w/ drmkms To generate a diff of this commit: cvs rdiff -u -r1.32 -r1.33 src/sys/external/bsd/drm2/drm/files.drmkms Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/drm2/drm/files.drmkms diff -u src/sys/external/bsd/drm2/drm/files.drmkms:1.32 src/sys/external/bsd/drm2/drm/files.drmkms:1.33 --- src/sys/external/bsd/drm2/drm/files.drmkms:1.32 Mon Nov 18 20:02:09 2019 +++ src/sys/external/bsd/drm2/drm/files.drmkms Mon Dec 9 15:37:26 2019 @@ -1,4 +1,4 @@ -# $NetBSD: files.drmkms,v 1.32 2019/11/18 20:02:09 christos Exp $ +# $NetBSD: files.drmkms,v 1.33 2019/12/09 15:37:26 jakllsch Exp $ include "external/bsd/drm2/linux/files.drmkms_linux" @@ -89,6 +89,7 @@ file external/bsd/drm2/drm/drm_memory.c file external/bsd/drm2/dist/drm/drm_mm.c drmkms file external/bsd/drm2/dist/drm/drm_modes.c drmkms file external/bsd/drm2/dist/drm/drm_modeset_lock.c drmkms +file external/bsd/drm2/dist/drm/drm_panel.c drmkms #file external/bsd/drm2/dist/drm/drm_pci.c drmkms # drmkms_pci file external/bsd/drm2/dist/drm/drm_plane_helper.c drmkms #file external/bsd/drm2/dist/drm/drm_platform.c drmkms
CVS commit: src/sys/external/bsd/drm2/dist/drm
Module Name:src Committed By: jakllsch Date: Mon Dec 9 15:36:16 UTC 2019 Modified Files: src/sys/external/bsd/drm2/dist/drm: drm_panel.c Log Message: workaround netbsd incompatible LIST_HEAD adapted from drm_bridge.c r1.3 To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/drm2/dist/drm/drm_panel.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/drm2/dist/drm/drm_panel.c diff -u src/sys/external/bsd/drm2/dist/drm/drm_panel.c:1.2 src/sys/external/bsd/drm2/dist/drm/drm_panel.c:1.3 --- src/sys/external/bsd/drm2/dist/drm/drm_panel.c:1.2 Mon Aug 27 04:58:19 2018 +++ src/sys/external/bsd/drm2/dist/drm/drm_panel.c Mon Dec 9 15:36:16 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: drm_panel.c,v 1.2 2018/08/27 04:58:19 riastradh Exp $ */ +/* $NetBSD: drm_panel.c,v 1.3 2019/12/09 15:36:16 jakllsch Exp $ */ /* * Copyright (C) 2013, NVIDIA Corporation. All rights reserved. @@ -24,7 +24,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: drm_panel.c,v 1.2 2018/08/27 04:58:19 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: drm_panel.c,v 1.3 2019/12/09 15:36:16 jakllsch Exp $"); #include #include @@ -32,8 +32,13 @@ __KERNEL_RCSID(0, "$NetBSD: drm_panel.c, #include #include +#ifdef __NetBSD__ +static struct mutex panel_lock; +static struct list_head panel_list = LIST_HEAD_INIT(panel_list); +#else static DEFINE_MUTEX(panel_lock); static LIST_HEAD(panel_list); +#endif void drm_panel_init(struct drm_panel *panel) {
CVS commit: src/sys/dev/dm
Module Name:src Committed By: tkusumi Date: Mon Dec 9 15:30:42 UTC 2019 Modified Files: src/sys/dev/dm: dm_target_stripe.c Log Message: dm: Correct target name "stripe" -> "striped" Sync with Linux kernel. The file name is "stripe", but the target name is "striped". DragonFlyBSD also follows this. To generate a diff of this commit: cvs rdiff -u -r1.32 -r1.33 src/sys/dev/dm/dm_target_stripe.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/dm/dm_target_stripe.c diff -u src/sys/dev/dm/dm_target_stripe.c:1.32 src/sys/dev/dm/dm_target_stripe.c:1.33 --- src/sys/dev/dm/dm_target_stripe.c:1.32 Sun Dec 8 10:50:21 2019 +++ src/sys/dev/dm/dm_target_stripe.c Mon Dec 9 15:30:42 2019 @@ -1,4 +1,4 @@ -/*$NetBSD: dm_target_stripe.c,v 1.32 2019/12/08 10:50:21 tkusumi Exp $*/ +/*$NetBSD: dm_target_stripe.c,v 1.33 2019/12/09 15:30:42 tkusumi Exp $*/ /* * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__KERNEL_RCSID(0, "$NetBSD: dm_target_stripe.c,v 1.32 2019/12/08 10:50:21 tkusumi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dm_target_stripe.c,v 1.33 2019/12/09 15:30:42 tkusumi Exp $"); /* * This file implements initial version of device-mapper stripe target. @@ -73,11 +73,11 @@ dm_target_stripe_modcmd(modcmd_t cmd, vo switch (cmd) { case MODULE_CMD_INIT: - if ((dmt = dm_target_lookup("stripe")) != NULL) { + if ((dmt = dm_target_lookup("striped")) != NULL) { dm_target_unbusy(dmt); return EEXIST; } - dmt = dm_target_alloc("stripe"); + dmt = dm_target_alloc("striped"); dmt->version[0] = 1; dmt->version[1] = 0; @@ -96,7 +96,7 @@ dm_target_stripe_modcmd(modcmd_t cmd, vo break; case MODULE_CMD_FINI: - r = dm_target_rem("stripe"); + r = dm_target_rem("striped"); break; case MODULE_CMD_STAT:
CVS commit: [netbsd-9] src
Module Name:src Committed By: martin Date: Mon Dec 9 15:19:32 UTC 2019 Modified Files: src/distrib/sets/lists/modules [netbsd-9]: ad.arm md.amd64 md.i386 mi src/external/cddl/osnet/dist/lib/libdtrace/aarch64 [netbsd-9]: dt_isadep.c src/external/cddl/osnet/dist/lib/libdtrace/common [netbsd-9]: dt_link.c src/external/cddl/osnet/lib/libdtrace [netbsd-9]: Makefile src/share/mk [netbsd-9]: bsd.own.mk src/sys/arch/aarch64/aarch64 [netbsd-9]: start.S trap.c src/sys/arch/aarch64/conf [netbsd-9]: Makefile.aarch64 src/sys/arch/aarch64/include [netbsd-9]: frame.h src/sys/arch/evbarm/conf [netbsd-9]: mk.generic64 src/sys/modules/cyclic [netbsd-9]: Makefile src/sys/modules/dtrace [netbsd-9]: Makefile src/usr.bin/mkubootimage [netbsd-9]: mkubootimage.1 mkubootimage.c Added Files: src/external/cddl/osnet/dev/dtrace/aarch64 [netbsd-9]: dtrace_asm.S dtrace_isa.c dtrace_subr.c regset.h src/external/cddl/osnet/dev/fbt/aarch64 [netbsd-9]: fbt_isa.c fbt_isa.h Log Message: 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 0xffc0 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 To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.12.2.1 src/distrib/sets/lists/modules/ad.arm cvs rdiff -u -r1.80 -r1.80.2.1 src/distrib/sets/lists/modules/md.amd64 cvs rdiff -u -r1.82 -r1.82.2.1 src/distrib/sets/lists/modules/md.i386 cvs rdiff -u -r1.122.2.2 -r1.122.2.3 src/distrib/sets/lists/modules/mi cvs rdiff -u -r0 -r1.1.2.2 \ src/external/cddl/osnet/dev/dtrace/aarch64/dtrace_asm.S \ src/external/cddl/osnet/dev/dtrace/aarch64/dtrace_isa.c \ src/external/cddl/osnet/dev/dtrace/aarch64/dtrace_subr.c \ src/external/cddl/osnet/dev/dtrace/aarch64/regset.h cvs rdiff -u -r0 -r1.1.2.2 src/external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c \ src/external/cddl/osnet/dev/fbt/aarch64/fbt_isa.h cvs rdiff -u -r1.1.1.1 -r1.1.1.1.6.1 \ src/external/cddl/osnet/dist/lib/libdtrace/aarch64/dt_isadep.c cvs rdiff -u -r1.11 -r1.11.4.1 \ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_link.c cvs rdiff -u -r1.21 -r1.21.2.1 src/external/cddl/osnet/lib/libdtrace/Makefile cvs rdiff -u -r1.1149.2.2 -r1.1149.2.3 src/share/mk/bsd.own.mk cvs rdiff -u -r1.2 -r1.2.6.1 src/sys/arch/aarch64/aarch64/start.S cvs rdiff -u -r1.17.4.1 -r1.17.4.2 src/sys/arch/aarch64/aarch64/trap.c cvs rdiff -u -r1.15 -r1.15.4.1 src/sys/arch/aarch64/conf/Makefile.aarch64 cvs rdiff -u -r1.2 -r1.2.6.1 src/sys/arch/aarch64/include/frame.h cvs rdiff -u -r1.3 -r1.3.4.1 src/sys/arch/evbarm/conf/mk.generic64 cvs rdiff -u -r1.3 -r1.3.34.1 src/sys/modules/cyclic/Makefile cvs rdiff -u -r1.6 -r1.6.22.1 src/sys/modules/dtrace/Makefile cvs rdiff -u -r1.12 -r1.12.6.1 src/usr.bin/mkubootimage/mkubootimage.1 cvs rdiff -u -r1.24 -r1.24.6.1 src/usr.bin/mkubootimage/mkubootimage.c Please note that diffs are not public domain; they are subject to the copyright notices on the
CVS commit: src/sys/arch/arm/sunxi
Module Name:src Committed By: riastradh Date: Mon Dec 9 14:55:52 UTC 2019 Modified Files: src/sys/arch/arm/sunxi: sun8i_crypto.c Log Message: Reduce some duplicated bus_dma clutter. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/sunxi/sun8i_crypto.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/arm/sunxi/sun8i_crypto.c diff -u src/sys/arch/arm/sunxi/sun8i_crypto.c:1.1 src/sys/arch/arm/sunxi/sun8i_crypto.c:1.2 --- src/sys/arch/arm/sunxi/sun8i_crypto.c:1.1 Mon Dec 9 04:51:03 2019 +++ src/sys/arch/arm/sunxi/sun8i_crypto.c Mon Dec 9 14:55:52 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: sun8i_crypto.c,v 1.1 2019/12/09 04:51:03 riastradh Exp $ */ +/* $NetBSD: sun8i_crypto.c,v 1.2 2019/12/09 14:55:52 riastradh Exp $ */ /*- * Copyright (c) 2019 The NetBSD Foundation, Inc. @@ -43,7 +43,7 @@ */ #include -__KERNEL_RCSID(1, "$NetBSD: sun8i_crypto.c,v 1.1 2019/12/09 04:51:03 riastradh Exp $"); +__KERNEL_RCSID(1, "$NetBSD: sun8i_crypto.c,v 1.2 2019/12/09 14:55:52 riastradh Exp $"); #include #include @@ -115,10 +115,7 @@ struct sun8i_crypto_softc { }; struct sun8i_crypto_task { - bus_dma_segment_t ct_desc_seg[1]; - int ct_desc_nseg; - bus_dmamap_t ct_desc_map; - void *ct_desc_kva; + struct sun8i_crypto_buf ct_buf; struct sun8i_crypto_taskdesc *ct_desc; void (*ct_callback)(struct sun8i_crypto_softc *, struct sun8i_crypto_task *, void *, int); @@ -329,48 +326,25 @@ sun8i_crypto_task_get(struct sun8i_crypt void *cookie) { struct sun8i_crypto_task *task; - const size_t desc_size = sizeof(*task->ct_desc); int error; + /* Allocate a task. */ task = kmem_zalloc(sizeof(*task), KM_SLEEP); - /* Allocate DMA-safe memory for the descriptor. */ - error = bus_dmamem_alloc(sc->sc_dmat, desc_size, 0, 0, - task->ct_desc_seg, __arraycount(task->ct_desc_seg), - >ct_desc_nseg, BUS_DMA_NOWAIT); + /* Allocate a buffer for the descriptor. */ + error = sun8i_crypto_allocbuf(sc, sizeof(*task->ct_desc), + >ct_buf); if (error) goto fail0; - /* Map the descriptor into kernel virtual address space. */ - error = bus_dmamem_map(sc->sc_dmat, task->ct_desc_seg, - task->ct_desc_nseg, desc_size, >ct_desc_kva, BUS_DMA_NOWAIT); - if (error) - goto fail1; - task->ct_desc = task->ct_desc_kva; - - /* Create a map for exposing the descriptor to DMA. */ - error = bus_dmamap_create(sc->sc_dmat, desc_size, 1, desc_size, 0, - BUS_DMA_NOWAIT, >ct_desc_map); - if (error) - goto fail2; - - /* Load the descriptor into the DMA map. */ - error = bus_dmamap_load(sc->sc_dmat, task->ct_desc_map, - task->ct_desc_kva, desc_size, NULL, BUS_DMA_NOWAIT); - if (error) - goto fail3; - + /* Initialize the task object and return it. */ + task->ct_desc = task->ct_buf.cb_kva; task->ct_callback = callback; task->ct_cookie = cookie; - return task; -fail4: __unused - bus_dmamap_unload(sc->sc_dmat, task->ct_desc_map); -fail3: bus_dmamap_destroy(sc->sc_dmat, task->ct_desc_map); -fail2: bus_dmamem_unmap(sc->sc_dmat, task->ct_desc_kva, - sizeof(*task->ct_desc)); -fail1: bus_dmamem_free(sc->sc_dmat, task->ct_desc_seg, task->ct_desc_nseg); +fail1: __unused + sun8i_crypto_freebuf(sc, sizeof(*task->ct_desc), >ct_buf); fail0: kmem_free(task, sizeof(*task)); return NULL; } @@ -380,11 +354,7 @@ sun8i_crypto_task_put(struct sun8i_crypt struct sun8i_crypto_task *task) { - bus_dmamap_unload(sc->sc_dmat, task->ct_desc_map); - bus_dmamap_destroy(sc->sc_dmat, task->ct_desc_map); - bus_dmamem_unmap(sc->sc_dmat, task->ct_desc_kva, - sizeof(*task->ct_desc)); - bus_dmamem_free(sc->sc_dmat, task->ct_desc_seg, task->ct_desc_nseg); + sun8i_crypto_freebuf(sc, sizeof(*task->ct_desc), >ct_buf); kmem_free(task, sizeof(*task)); } @@ -604,7 +574,7 @@ sun8i_crypto_submit(struct sun8i_crypto_ task->ct_desc->td_cid = htole32(i); /* Prepare to send the descriptor to the device by DMA. */ - bus_dmamap_sync(sc->sc_dmat, task->ct_desc_map, 0, + bus_dmamap_sync(sc->sc_dmat, task->ct_buf.cb_map, 0, sizeof(*task->ct_desc), BUS_DMASYNC_PREWRITE); /* Confirm we're ready to go. */ @@ -622,7 +592,7 @@ sun8i_crypto_submit(struct sun8i_crypto_ /* Set the task descriptor queue address. */ sun8i_crypto_write(sc, SUN8I_CRYPTO_TDQ, - task->ct_desc_map->dm_segs[0].ds_addr); + task->ct_buf.cb_map->dm_segs[0].ds_addr); /* Notify the engine to load it, and wait for acknowledgement. */ sun8i_crypto_write(sc, SUN8I_CRYPTO_TLR, SUN8I_CRYPTO_TLR_LOAD); @@ -819,7 +789,7 @@ sun8i_crypto_chan_done(struct sun8i_cryp sun8i_crypto_write(sc, SUN8I_CRYPTO_ICR, icr); /* Finished sending the descriptor to the device by DMA. */ - bus_dmamap_sync(sc->sc_dmat, task->ct_desc_map, 0, + bus_dmamap_sync(sc->sc_dmat, task->ct_buf.cb_map, 0, sizeof(*task->ct_desc), BUS_DMASYNC_POSTWRITE); /* Temporarily release the lock to
CVS commit: src/sys/arch/arm/sunxi
Module Name:src Committed By: riastradh Date: Mon Dec 9 14:56:06 UTC 2019 Modified Files: src/sys/arch/arm/sunxi: sun8i_crypto.c Log Message: Factor out some of the self-test logic used for debugging. Add missing bus_dmamap_sync(POSTWRITE) while here. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/sunxi/sun8i_crypto.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/arm/sunxi/sun8i_crypto.c diff -u src/sys/arch/arm/sunxi/sun8i_crypto.c:1.2 src/sys/arch/arm/sunxi/sun8i_crypto.c:1.3 --- src/sys/arch/arm/sunxi/sun8i_crypto.c:1.2 Mon Dec 9 14:55:52 2019 +++ src/sys/arch/arm/sunxi/sun8i_crypto.c Mon Dec 9 14:56:06 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: sun8i_crypto.c,v 1.2 2019/12/09 14:55:52 riastradh Exp $ */ +/* $NetBSD: sun8i_crypto.c,v 1.3 2019/12/09 14:56:06 riastradh Exp $ */ /*- * Copyright (c) 2019 The NetBSD Foundation, Inc. @@ -43,7 +43,7 @@ */ #include -__KERNEL_RCSID(1, "$NetBSD: sun8i_crypto.c,v 1.2 2019/12/09 14:55:52 riastradh Exp $"); +__KERNEL_RCSID(1, "$NetBSD: sun8i_crypto.c,v 1.3 2019/12/09 14:56:06 riastradh Exp $"); #include #include @@ -981,9 +981,9 @@ out: /* Done -- clear the RNG-pending fl * Self-test */ -static uint8_t selftest_input[16]; -static uint8_t selftest_key[16]; -static uint8_t selftest_output[16] = { +static const uint8_t selftest_input[16]; +static const uint8_t selftest_key[16]; +static const uint8_t selftest_output[16] = { 0x66,0xe9,0x4b,0xd4,0xef,0x8a,0x2c,0x3b, 0x88,0x4c,0xfa,0x59,0xca,0x34,0x2b,0x2e, }; @@ -1061,70 +1061,65 @@ fail1: sun8i_crypto_freebuf(sc, sizeof s fail0: aprint_error_dev(self, "failed to run self-test, error=%d\n", error); } +static bool +sun8i_crypto_selftest_check(struct sun8i_crypto_softc *sc, const char *title, +size_t n, const void *expected, const void *actual) +{ + const uint8_t *e = expected; + const uint8_t *a = actual; + size_t i; + + if (memcmp(e, a, n) == 0) + return true; + + device_printf(sc->sc_dev, "self-test: %s\n", title); + printf("expected: "); + for (i = 0; i < n; i++) + printf("%02hhx", e[i]); + printf("\n"); + printf("actual: "); + for (i = 0; i < n; i++) + printf("%02hhx", a[i]); + printf("\n"); + return false; +} + static void sun8i_crypto_selftest_done(struct sun8i_crypto_softc *sc, struct sun8i_crypto_task *task, void *cookie, int error) { struct sun8i_crypto_selftest *selftest = cookie; - unsigned i; bool ok = true; KASSERT(selftest == >sc_selftest); + /* + * Finished the DMA read into the output buffer, and finished + * the DMA writes from the key buffer and input buffer. + */ bus_dmamap_sync(sc->sc_dmat, selftest->cs_out.cb_map, 0, sizeof selftest_output, BUS_DMASYNC_POSTREAD); + bus_dmamap_sync(sc->sc_dmat, selftest->cs_key.cb_map, 0, + sizeof selftest_key, BUS_DMASYNC_POSTWRITE); bus_dmamap_sync(sc->sc_dmat, selftest->cs_in.cb_map, 0, sizeof selftest_input, BUS_DMASYNC_POSTWRITE); + /* If anything went wrong, fail now. */ if (error) { device_printf(sc->sc_dev, "self-test error=%d\n", error); goto out; } - if (memcmp(selftest_input, selftest->cs_in.cb_kva, - sizeof selftest_input) != 0) { - device_printf(sc->sc_dev, "self-test: input clobbered\n"); - printf("expected: "); - for (i = 0; i < sizeof selftest_input; i++) - printf("%02hhx", selftest_input[i]); - printf("\n"); - printf("actual: "); - for (i = 0; i < sizeof selftest_input; i++) - printf("%02hhx", - ((const uint8_t *)selftest->cs_in.cb_kva)[i]); - printf("\n"); - ok = false; - } - - if (memcmp(selftest_key, selftest->cs_key.cb_kva, - sizeof selftest_key) != 0) { - device_printf(sc->sc_dev, "self-test: key clobbered\n"); - printf("expected: "); - for (i = 0; i < sizeof selftest_key; i++) - printf("%02hhx", selftest_key[i]); - printf("\n"); - printf("actual: "); - for (i = 0; i < sizeof selftest_key; i++) - printf("%02hhx", - ((const uint8_t *)selftest->cs_key.cb_kva)[i]); - printf("\n"); - ok = false; - } - - if (memcmp(selftest_output, selftest->cs_out.cb_kva, - sizeof selftest_output) != 0) { - device_printf(sc->sc_dev, "self-test: output mismatch\n"); - printf("expected: "); - for (i = 0; i < sizeof selftest_output; i++) - printf("%02hhx", selftest_output[i]); - printf("\n"); - printf("actual: "); - for (i = 0; i < sizeof selftest_output; i++) - printf("%02hhx", - ((const uint8_t *)selftest->cs_out.cb_kva)[i]); - printf("\n"); - ok = false; - } + /* + * Verify the input and key weren't clobbered, and verify the + * output matches what we expect. + */ + ok &= sun8i_crypto_selftest_check(sc, "input clobbered", + sizeof selftest_input, selftest_input, selftest->cs_in.cb_kva); + ok &= sun8i_crypto_selftest_check(sc, "key clobbered", + sizeof selftest_key, selftest_key, selftest->cs_key.cb_kva); + ok &= sun8i_crypto_selftest_check(sc,
CVS commit: src/sys/arch/arm/sunxi
Module Name:src Committed By: riastradh Date: Mon Dec 9 14:56:18 UTC 2019 Modified Files: src/sys/arch/arm/sunxi: sun8i_crypto.c Log Message: Make sure ERESTART doesn't come flying out to userland. I picked ERESTART to mean `all channels are occupied' because that's what opencrypto(9) uses to decide whether to queue a request, but it's not appropriate for sysctl(2) to return that. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/sunxi/sun8i_crypto.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/arm/sunxi/sun8i_crypto.c diff -u src/sys/arch/arm/sunxi/sun8i_crypto.c:1.3 src/sys/arch/arm/sunxi/sun8i_crypto.c:1.4 --- src/sys/arch/arm/sunxi/sun8i_crypto.c:1.3 Mon Dec 9 14:56:06 2019 +++ src/sys/arch/arm/sunxi/sun8i_crypto.c Mon Dec 9 14:56:18 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: sun8i_crypto.c,v 1.3 2019/12/09 14:56:06 riastradh Exp $ */ +/* $NetBSD: sun8i_crypto.c,v 1.4 2019/12/09 14:56:18 riastradh Exp $ */ /*- * Copyright (c) 2019 The NetBSD Foundation, Inc. @@ -43,7 +43,7 @@ */ #include -__KERNEL_RCSID(1, "$NetBSD: sun8i_crypto.c,v 1.3 2019/12/09 14:56:06 riastradh Exp $"); +__KERNEL_RCSID(1, "$NetBSD: sun8i_crypto.c,v 1.4 2019/12/09 14:56:18 riastradh Exp $"); #include #include @@ -1232,8 +1232,11 @@ sun8i_crypto_sysctl_rng(SYSCTLFN_ARGS) /* Submit the TRNG task. */ error = sun8i_crypto_submit_trng(sc, req->cu_task, size); - if (error) + if (error) { + if (error == ERESTART) + error = EBUSY; goto out2; + } /* Wait for the request to complete. */ mutex_enter(>cu_lock);
CVS commit: src/sys/arch/arm/sunxi
Module Name:src Committed By: riastradh Date: Mon Dec 9 14:56:44 UTC 2019 Modified Files: src/sys/arch/arm/sunxi: sun8i_crypto.c Log Message: Tidy up comments. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/sunxi/sun8i_crypto.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/arm/sunxi/sun8i_crypto.c diff -u src/sys/arch/arm/sunxi/sun8i_crypto.c:1.5 src/sys/arch/arm/sunxi/sun8i_crypto.c:1.6 --- src/sys/arch/arm/sunxi/sun8i_crypto.c:1.5 Mon Dec 9 14:56:30 2019 +++ src/sys/arch/arm/sunxi/sun8i_crypto.c Mon Dec 9 14:56:44 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: sun8i_crypto.c,v 1.5 2019/12/09 14:56:30 riastradh Exp $ */ +/* $NetBSD: sun8i_crypto.c,v 1.6 2019/12/09 14:56:44 riastradh Exp $ */ /*- * Copyright (c) 2019 The NetBSD Foundation, Inc. @@ -43,7 +43,7 @@ */ #include -__KERNEL_RCSID(1, "$NetBSD: sun8i_crypto.c,v 1.5 2019/12/09 14:56:30 riastradh Exp $"); +__KERNEL_RCSID(1, "$NetBSD: sun8i_crypto.c,v 1.6 2019/12/09 14:56:44 riastradh Exp $"); #include #include @@ -731,14 +731,17 @@ sun8i_crypto_worker(struct work *wk, voi /* Process the channels. */ for (i = 0; i < SUN8I_CRYPTO_NCHAN; i++) { + /* Check whether the channel is done. */ if (!ISSET(done, SUN8I_CRYPTO_ISR_DONE_CHAN(i))) { - /* Check to see if we have a task that timed out. */ + /* Nope. Do we have a task to time out? */ if ((sc->sc_chan[i].cc_task != NULL) && ((now - sc->sc_chan[i].cc_starttime) >= SUN8I_CRYPTO_TIMEOUT)) sun8i_crypto_chan_done(sc, i, ETIMEDOUT); continue; } + + /* Channel is done. Interpret the error if any. */ esr_chan = __SHIFTOUT(esr, SUN8I_CRYPTO_ESR_CHAN(i)); if (esr_chan & SUN8I_CRYPTO_ESR_CHAN_ALGNOTSUP) { device_printf(sc->sc_dev, "channel %u:" @@ -758,7 +761,10 @@ sun8i_crypto_worker(struct work *wk, voi error = 0; } - /* May release the lock to invoke a callback. */ + /* + * Notify the task of completion. May release the lock + * to invoke a callback. + */ sun8i_crypto_chan_done(sc, i, error); } @@ -1152,6 +1158,7 @@ sun8i_crypto_sysctl_attach(struct sun8i_ struct sun8i_crypto_sysctl *cy = >sc_sysctl; int error; + /* hw.sun8icryptoN (node) */ error = sysctl_createv(>cy_log, 0, NULL, >cy_root_node, CTLFLAG_PERMANENT, CTLTYPE_NODE, device_xname(sc->sc_dev), SYSCTL_DESCR("sun8i crypto engine knobs"), @@ -1164,6 +1171,7 @@ sun8i_crypto_sysctl_attach(struct sun8i_ return; } + /* hw.sun8icryptoN.rng (`struct', 1024-byte array) */ sysctl_createv(>cy_log, 0, >cy_root_node, NULL, CTLFLAG_PERMANENT|CTLFLAG_READONLY|CTLFLAG_PRIVATE, CTLTYPE_STRUCT, "rng", SYSCTL_DESCR("Read up to 1024 bytes out of the TRNG"),
CVS commit: src/sys/arch/arm/sunxi
Module Name:src Committed By: riastradh Date: Mon Dec 9 14:56:30 UTC 2019 Modified Files: src/sys/arch/arm/sunxi: sun8i_crypto.c Log Message: Avoid a race between interruption and reacquisition of lock. Otherwise, we would have leaked the memory in this case. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/sunxi/sun8i_crypto.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/arm/sunxi/sun8i_crypto.c diff -u src/sys/arch/arm/sunxi/sun8i_crypto.c:1.4 src/sys/arch/arm/sunxi/sun8i_crypto.c:1.5 --- src/sys/arch/arm/sunxi/sun8i_crypto.c:1.4 Mon Dec 9 14:56:18 2019 +++ src/sys/arch/arm/sunxi/sun8i_crypto.c Mon Dec 9 14:56:30 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: sun8i_crypto.c,v 1.4 2019/12/09 14:56:18 riastradh Exp $ */ +/* $NetBSD: sun8i_crypto.c,v 1.5 2019/12/09 14:56:30 riastradh Exp $ */ /*- * Copyright (c) 2019 The NetBSD Foundation, Inc. @@ -43,7 +43,7 @@ */ #include -__KERNEL_RCSID(1, "$NetBSD: sun8i_crypto.c,v 1.4 2019/12/09 14:56:18 riastradh Exp $"); +__KERNEL_RCSID(1, "$NetBSD: sun8i_crypto.c,v 1.5 2019/12/09 14:56:30 riastradh Exp $"); #include #include @@ -1244,10 +1244,15 @@ sun8i_crypto_sysctl_rng(SYSCTLFN_ARGS) error = cv_wait_sig(>cu_cv, >cu_lock); if (error) { /* - * Never mind -- notify the callback that it - * has to clean up after itself. + * If we finished while waiting to acquire the + * lock, ignore the error and just return now. + * Otherwise, notify the callback that it has + * to clean up after us. */ - req->cu_cancel = true; + if (req->cu_done) +error = 0; + else +req->cu_cancel = true; break; } } @@ -1277,6 +1282,7 @@ sun8i_crypto_sysctl_rng(SYSCTLFN_ARGS) /* Clear the buffer. */ explicit_memset(req->cu_buf.cb_kva, 0, size); + /* Clean up. */ out2: sun8i_crypto_task_put(sc, req->cu_task); out1: sun8i_crypto_freebuf(sc, req->cu_size, >cu_buf); out0: cv_destroy(>cu_cv); @@ -1309,7 +1315,7 @@ sun8i_crypto_sysctl_rng_done(struct sun8 if (!cancel) return; - /* Clean up. */ + /* Clean up after the main thread cancelled. */ sun8i_crypto_task_put(sc, req->cu_task); sun8i_crypto_freebuf(sc, req->cu_size, >cu_buf); cv_destroy(>cu_cv);
CVS commit: [netbsd-9] src/sys/external/bsd/dwc2
Module Name:src Committed By: martin Date: Mon Dec 9 13:06:38 UTC 2019 Modified Files: src/sys/external/bsd/dwc2 [netbsd-9]: dwc2.c Log Message: Pull up following revision(s) (requested by skrll in ticket #524): sys/external/bsd/dwc2/dwc2.c: revision 1.60 sys/external/bsd/dwc2/dwc2.c: revision 1.61 sys/external/bsd/dwc2/dwc2.c: revision 1.62 sys/external/bsd/dwc2/dwc2.c: revision 1.63 sys/external/bsd/dwc2/dwc2.c: revision 1.64 sys/external/bsd/dwc2/dwc2.c: revision 1.65 sys/external/bsd/dwc2/dwc2.c: revision 1.66 KNF Make dwc2debug sysctl'able Need for previous Use size_t for loop count variable Calulate the right lenght for isoc transfer and the usb_syncmem PR/54696: Kernel panic in bus_dma.c on Raspberry Pi 3B/3B+ build fix Consistency. To generate a diff of this commit: cvs rdiff -u -r1.59 -r1.59.4.1 src/sys/external/bsd/dwc2/dwc2.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/dwc2/dwc2.c diff -u src/sys/external/bsd/dwc2/dwc2.c:1.59 src/sys/external/bsd/dwc2/dwc2.c:1.59.4.1 --- src/sys/external/bsd/dwc2/dwc2.c:1.59 Tue Mar 19 08:17:46 2019 +++ src/sys/external/bsd/dwc2/dwc2.c Mon Dec 9 13:06:38 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: dwc2.c,v 1.59 2019/03/19 08:17:46 ryo Exp $ */ +/* $NetBSD: dwc2.c,v 1.59.4.1 2019/12/09 13:06:38 martin Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -30,19 +30,21 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.59 2019/03/19 08:17:46 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.59.4.1 2019/12/09 13:06:38 martin Exp $"); #include "opt_usb.h" #include -#include -#include -#include + +#include #include -#include +#include +#include #include #include -#include +#include +#include +#include #include @@ -74,6 +76,33 @@ __KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.5 } while (0) #define DPRINTF(...) DPRINTFN(1, __VA_ARGS__) int dwc2debug = 0; + +SYSCTL_SETUP(sysctl_hw_dwc2_setup, "sysctl hw.dwc2 setup") +{ + int err; + const struct sysctlnode *rnode; + const struct sysctlnode *cnode; + + err = sysctl_createv(clog, 0, NULL, , + CTLFLAG_PERMANENT, CTLTYPE_NODE, "dwc2", + SYSCTL_DESCR("dwc2 global controls"), + NULL, 0, NULL, 0, CTL_HW, CTL_CREATE, CTL_EOL); + + if (err) + goto fail; + + /* control debugging printfs */ + err = sysctl_createv(clog, 0, , , + CTLFLAG_PERMANENT|CTLFLAG_READWRITE, CTLTYPE_INT, + "debug", SYSCTL_DESCR("Enable debugging output"), + NULL, 0, , sizeof(dwc2debug), CTL_CREATE, CTL_EOL); + if (err) + goto fail; + + return; +fail: + aprint_error("%s: sysctl_createv failed (err = %d)\n", __func__, err); +} #else #define DPRINTF(...) do { } while (0) #define DPRINTFN(...) do { } while (0) @@ -947,7 +976,6 @@ dwc2_device_start(struct usbd_xfer *xfer uint32_t off = 0; int retval, err; int alloc_bandwidth = 0; - int i; DPRINTFN(1, "xfer=%p pipe=%p\n", xfer, xfer->ux_pipe); @@ -987,6 +1015,14 @@ dwc2_device_start(struct usbd_xfer *xfer DPRINTFN(3, "req = %p dma = %" PRIxBUSADDR " len %d dir %s\n", KERNADDR(>req_dma, 0), DMAADDR(>req_dma, 0), len, dir == UE_DIR_IN ? "in" : "out"); + } else if (xfertype == UE_ISOCHRONOUS) { + DPRINTFN(3, "xfer=%p nframes=%d flags=%d addr=%d endpt=%d," + " mps=%d dir %s\n", xfer, xfer->ux_nframes, xfer->ux_flags, addr, + epnum, mps, dir == UT_READ ? "in" :"out"); + + len = 0; + for (size_t i = 0; i < xfer->ux_nframes; i++) + len += xfer->ux_frlengths[i]; } else { DPRINTFN(3, "xfer=%p len=%d flags=%d addr=%d endpt=%d," " mps=%d dir %s\n", xfer, xfer->ux_length, xfer->ux_flags, addr, @@ -1080,8 +1116,9 @@ dwc2_device_start(struct usbd_xfer *xfer KASSERTMSG(xfer->ux_nframes == 0 || xfertype == UE_ISOCHRONOUS, "nframes %d xfertype %d\n", xfer->ux_nframes, xfertype); - for (off = i = 0; i < xfer->ux_nframes; ++i) { - DPRINTFN(3, "xfer=%p frame=%d offset=%d length=%d\n", xfer, i, + off = 0; + for (size_t i = 0; i < xfer->ux_nframes; ++i) { + DPRINTFN(3, "xfer=%p frame=%zd offset=%d length=%d\n", xfer, i, off, xfer->ux_frlengths[i]); dwc2_hcd_urb_set_iso_desc_params(dwc2_urb, i, off, @@ -1470,22 +1507,21 @@ void dwc2_host_complete(struct dwc2_hsot DPRINTFN(3, "xfer=%p actlen=%d\n", xfer, xfer->ux_actlen); if (xfertype == UE_ISOCHRONOUS) { - int i; - xfer->ux_actlen = 0; - for (i = 0; i < xfer->ux_nframes; ++i) { + for (size_t i = 0; i < xfer->ux_nframes; ++i) { xfer->ux_frlengths[i] = dwc2_hcd_urb_get_iso_desc_actual_length( urb, i); + DPRINTFN(1, "xfer=%p frame=%zu length=%d\n", xfer, i, + xfer->ux_frlengths[i]); xfer->ux_actlen += xfer->ux_frlengths[i]; } + DPRINTFN(1, "xfer=%p actlen=%d (isoc)\n", xfer, xfer->ux_actlen); } if (xfertype == UE_ISOCHRONOUS && dbg_perio()) { - int i; - - for (i = 0; i <
CVS commit: [netbsd-9] src/distrib/notes
Module Name:src Committed By: martin Date: Mon Dec 9 13:00:23 UTC 2019 Modified Files: src/distrib/notes [netbsd-9]: Makefile.inc src/distrib/notes/common [netbsd-9]: macros Log Message: Pull up the following revisions, requested by uwe in ticket #523: distrib/notes/Makefile.inc up to 1.52 distrib/notes/common/macros up to 1.54 Improve table of contents. To generate a diff of this commit: cvs rdiff -u -r1.43.18.4 -r1.43.18.5 src/distrib/notes/Makefile.inc cvs rdiff -u -r1.43.6.1 -r1.43.6.2 src/distrib/notes/common/macros Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/notes/Makefile.inc diff -u src/distrib/notes/Makefile.inc:1.43.18.4 src/distrib/notes/Makefile.inc:1.43.18.5 --- src/distrib/notes/Makefile.inc:1.43.18.4 Wed Nov 27 16:07:30 2019 +++ src/distrib/notes/Makefile.inc Mon Dec 9 13:00:22 2019 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.43.18.4 2019/11/27 16:07:30 martin Exp $ +# $NetBSD: Makefile.inc,v 1.43.18.5 2019/12/09 13:00:22 martin Exp $ # # Ross Harvey @@ -13,12 +13,13 @@ MKTOCS?=yes M?= ${.CURDIR:T} COMMON= ${.CURDIR}/../common -MAIN= ${COMMON}/main ${COMMON}/macros ${EXTRA} +MAIN= ${COMMON}/main ${EXTRA} TARG= INSTALL TARGS= ${TARG}.ps ${TARG}.txt ${TARG}.html ${TARG}.more TOCS= ${TARG}.PostScript.toc ${TARG}.ASCII.toc ${TARG}.HTML.toc \ ${TARG}.more.toc -SRCS= ${MAIN} whatis ${COMMON}/contents hardware xfer prep \ +SRCS= ${MAIN} ${COMMON}/macros \ + whatis ${COMMON}/contents hardware xfer prep \ ${.CURDIR}/install ${COMMON}/postinstall upgrade \ ${COMMON}/legal.common ${COMMON}/netboot \ ${COMMON}/sysinst \ @@ -102,35 +103,26 @@ ${TARG}.more: ${SRCS} ${TOC.more} ${DIST ${TOOL_GROFF} ${ARGS_MORE} -mdoc ${MAIN} > $@ -# Rules to build the table of contents (.toc) files. -# They are generated twice to take into account the -# space taken by the TOC itself. -# - -TOCPROC= 2>&1 >/dev/null |\ - ${TOOL_SED} -n -e 's/"//g' \ - -e '/^\.Ti/{s/ \([A-Za-z]\)/ "\1/; s/ *$$/"/; p; }' +# Rules to build the table of contents (.toc) files. For the +# PostScript version it's generated twice to take into account the +# space taken by the TOC itself. Other versions are not paginated. ${TARG}.PostScript.toc: ${SRCS} - ${TOOL_GROFF} -dTOC=1 ${ARGS_PS} -mdoc ${MAIN} ${TOCPROC} > $@.tmp + ${TOOL_GROFF} -dTOC=1 ${ARGS_PS} -mdoc ${MAIN} > /dev/null mv -f $@.tmp $@ - ${TOOL_GROFF} -dTOC=1 ${ARGS_PS} -mdoc ${MAIN} ${TOCPROC} > $@.tmp + ${TOOL_GROFF} -dTOC=1 ${ARGS_PS} -mdoc ${MAIN} > /dev/null mv -f $@.tmp $@ ${TARG}.ASCII.toc: ${SRCS} - ${TOOL_GROFF} -dTOC=1 ${ARGS_TXT} -mdoc ${MAIN} ${TOCPROC} > $@.tmp - mv -f $@.tmp $@ - ${TOOL_GROFF} -dTOC=1 ${ARGS_TXT} -mdoc ${MAIN} ${TOCPROC} > $@.tmp + ${TOOL_GROFF} -dTOC=1 ${ARGS_TXT} -mdoc ${MAIN} > /dev/null mv -f $@.tmp $@ ${TARG}.HTML.toc: ${SRCS} - ${TOOL_GROFF} -dTOC=1 ${ARGS_HTML} -mdoc ${MAIN} ${TOCPROC} > $@.tmp + ${TOOL_GROFF} -dTOC=1 ${ARGS_HTML} -mdoc ${MAIN} > /dev/null mv -f $@.tmp $@ ${TARG}.more.toc: ${SRCS} - ${TOOL_GROFF} -dTOC=1 ${ARGS_MORE} -mdoc ${MAIN} ${TOCPROC} > $@.tmp - mv -f $@.tmp $@ - ${TOOL_GROFF} -dTOC=1 ${ARGS_MORE} -mdoc ${MAIN} ${TOCPROC} > $@.tmp + ${TOOL_GROFF} -dTOC=1 ${ARGS_MORE} -mdoc ${MAIN} > /dev/null mv -f $@.tmp $@ Index: src/distrib/notes/common/macros diff -u src/distrib/notes/common/macros:1.43.6.1 src/distrib/notes/common/macros:1.43.6.2 --- src/distrib/notes/common/macros:1.43.6.1 Wed Nov 27 13:36:55 2019 +++ src/distrib/notes/common/macros Mon Dec 9 13:00:22 2019 @@ -1,4 +1,4 @@ -.\" $NetBSD: macros,v 1.43.6.1 2019/11/27 13:36:55 msaitoh Exp $ +.\" $NetBSD: macros,v 1.43.6.2 2019/12/09 13:00:22 martin Exp $ .\" .\" Copyright (c) 1999-2004 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -309,42 +309,102 @@ .\" XXX To should be unnecessary if we handle parseable/callable. .\" .Tc import the TOC .\" .Ti depth page "item" (internal) output an entry -.if dTOC \{ +.ds toc-file INSTALL.\*[format].toc +.if dTOC \{\ +.tm ...writing \*[toc-file].tmp +.open toc-tmp \*[toc-file].tmp +.de mktoc +.nr mktoc-level \\$1 +.shift +.write toc-tmp .Ti \\n[mktoc-level] \\n% "\\$*" +.. .rn Ss Ss-toc .de Ss .Ss-toc \\$@ -.tm .Ti 0 \\n% "\\$*" +.mktoc 0 \\$@ .. .rn Ss2 Ss2-toc .de Ss2 .Ss2-toc \\$@ -.tm .Ti 1 \\n% "\\$*" +.mktoc 1 \\$@ .. .\} .de Te -.ie rHTML \\$2 -.el \\$2 -.if dTOC \.tm .Ti \\$1 \\n% \\$2 +.nr Te-toc-level \\$1 +.shift +.ie rHTML \\$* +.el \\$* +.if dTOC .mktoc \\n[Te-toc-level] \\$@ .. .de To -.if rHTML -.if dTOC \.tm .Ti \\$1 \\n% \\$2 +.nr To-toc-level \\$1 +.shift +.if rHTML +.if dTOC .mktoc \\n[To-toc-level] \\$@ +.. +. +.\" .Tc and .Ti for PostScript +. +.ie '\*[format]'PostScript' \{\ +.de Ti +.nr Ti-toc-level \\$1 +.nr Ti-page \\$2 +.shift 2 +.nr Ti-indent (\\n[Tc-saved-indent]+(3n*\\n[Ti-toc-level])) +.in \\n[Ti-indent]u
CVS commit: [netbsd-9] src/distrib/notes/common
Module Name:src Committed By: martin Date: Mon Dec 9 12:55:16 UTC 2019 Modified Files: src/distrib/notes/common [netbsd-9]: extract-contrib-string.pl Log Message: Pull up the following revisions, requested by uwe in ticket #522: distrib/notes/common/extract-contrib-string.pl upto 1.24 Various fixes and some more special cases. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.14.64.1 \ src/distrib/notes/common/extract-contrib-string.pl Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/notes/common/extract-contrib-string.pl diff -u src/distrib/notes/common/extract-contrib-string.pl:1.14 src/distrib/notes/common/extract-contrib-string.pl:1.14.64.1 --- src/distrib/notes/common/extract-contrib-string.pl:1.14 Mon May 26 08:11:41 2008 +++ src/distrib/notes/common/extract-contrib-string.pl Mon Dec 9 12:55:16 2019 @@ -31,7 +31,7 @@ # Extract BSD-mandated copyright messages for NetBSD documentation # # Usage: -# 1) find /usr/src -type f -print \ +# 1) find src xsrc -type f -print \ #| perl extract-contrib-string.pl #>x # @@ -49,8 +49,9 @@ # -? display help/usage message -$ack_line1="[aA]ll( commercial)?( marketing or)? advertising materials mentioning( features)?"; -$ack_line2="display the following( acknowledge?ment)?"; +$ack_line1='([aA]ll( commercial)?( marketing or)? advertising materials mentioning( features)?' +. '|\d\. Redistributions of any form whatsoever)'; +$ack_line2='(display the( following)?( acknowledge?ment)?|acknowledge?ment:$)'; $ack_endline= '(\d\.\s*(Neither the name' . '|The name of the company nor the name' # Wasn't my idea @@ -59,11 +60,16 @@ $ack_endline= . '|The names? (of )?.* nor the names? of' . '|The names? (of )?.* or any of it\'?s members' . '|Redistributions of any form whatsoever' -. '|The names .*"OpenSSL Toolkit.*" and .*"OpenSSL Project.*" must not be used))' +. '|The names .*"OpenSSL Toolkit.*" and .*"OpenSSL Project.*" must not be used' +. "|Urbana-Champaign Independent Media Center's name" +. '))' +.'|(^Neither the name)' .'|(THIS SOFTWARE IS PROVIDED)' +.'|(ALL WARRANTIES WITH REGARD)' .'|(The word \'cryptographic\' can be left out if)' .'|(may be used to endorse)' .'|(@end cartouche)' +.'|()' .'|(Redistribution and use in source and binary forms)' .'|(may not be used to endorse)' .'|(\.IP 4)' @@ -114,7 +120,7 @@ while(<>) { line: while() { - if (0 and /$ack_line2/i){ + if (0 and /$ack_line2/in){ print "?> $_" if $debug; if ($fn !~ m,$known_bad_clause_3_wording,) { @@ -128,29 +134,39 @@ while(<>) { # special case perl script generating a license (openssl's # mkerr.pl) - ignore the quoted license, there is another one # inside: - if (/^\"\s\*.*$ack_line1.*\\n\"\,/) { - while(!/$ack_endline/i) { + if (/^\"\s\*.*$ack_line1.*\\n\"\,/n) { + while(!/$ack_endline/in) { print "S> $_" if $debug; $_ = ; } } - if (/$ack_line1/i - or (/$ack_line2/ and $fn =~ m,$known_bad_clause_3_wording,)) { + if (/$ack_line1/in + or (/$ack_line2/n and $fn =~ m,$known_bad_clause_3_wording,)) { print "1> $_" if $debug; $_= unless $fn =~ m,$known_bad_clause_3_wording,; - if (/$ack_line2/i or $fn =~ m,$known_bad_clause_3_wording,){ + if (/$ack_line2/in or $fn =~ m,$known_bad_clause_3_wording,){ print "2> $_" if $debug; $msg=""; - $msg = $_ if ($fn =~ m,$known_bad_clause_3_wording, and /``/); + + if ($fn =~ m,$known_bad_clause_3_wording, and /``/) { + $msg = $_; + } + elsif (/:\s+This product/) { + # src/sys/lib/libkern/rngtest.c - bad clause 3 wording + # that is not like others, so special case it here + $msg = $_; + $msg =~ s/^.*:\s+(This product.*)$/$1/; + } + $cnt=0; $_=; - while(!/$ack_endline/i) { + while(!/$ack_endline/in) { print "C> $_" if $debug; @@ -177,6 +193,11 @@ while(<>) { $msg =~ s/''.*$//o; } + # XXX: pcap - add to known_bad_clause_3_wording but + # that code seems to have problems. Easier to add a + # hack here, shouldn't affect good clause 3. + $msg =~ s/''\s+Neither the name.*$//; + # *roff while ($msg =~ /^\.\\"\s*/) { $msg =~ s/^\.\\"\s*//o; @@ -216,7 +237,7 @@ while(<>) { $msg =~ s/^REM\s*//g; # BASIC?!? $msg =~ s/\nREM\s*/\n/g; # BASIC?!? $msg =~ s/^dnl\s*//g; # m4 - $msg =~ s/\dnl\s*/\n/g; # m4 + $msg =~ s/\ndnl\s*/\n/g; # m4 $msg =~ s/^\s+-\s+//g; # seen in docbook files $msg =~ s/\n\s+-\s+/ /g; # $msg =~ s/^[#\\\|";]+\s*//g; # sh etc. @@ -235,6 +256,14 @@ while(<>) { $msg =~ s/''\s*$//; $msg =~ s/^\"//o; $msg =~ s/\"$//o; + $msg =~ s/\"\.$/./o; + + # Fix ISO-646-SE spelling of Lule\(oa + $msg =~
CVS commit: [netbsd-9] src/sys/dev/mii
Module Name:src Committed By: martin Date: Mon Dec 9 12:49:39 UTC 2019 Modified Files: src/sys/dev/mii [netbsd-9]: devlist2h.awk Log Message: Pull up following revision(s) (requested by uwe in ticket #521): sys/dev/mii/devlist2h.awk: revision 1.10 Fix s/product/model/ search-and-destroy accident that affected license. Back in 1998 thorpej@ adapted this from one of the several versions we have in the tree but needed s/product/model/ in the text of the script. Unfortunately that also affected the license text: "This model includes software..." and "...or promote models". To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.9.4.1 src/sys/dev/mii/devlist2h.awk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/devlist2h.awk diff -u src/sys/dev/mii/devlist2h.awk:1.9 src/sys/dev/mii/devlist2h.awk:1.9.4.1 --- src/sys/dev/mii/devlist2h.awk:1.9 Mon Mar 25 09:46:24 2019 +++ src/sys/dev/mii/devlist2h.awk Mon Dec 9 12:49:39 2019 @@ -1,5 +1,5 @@ #! /usr/bin/awk -f -# $NetBSD: devlist2h.awk,v 1.9 2019/03/25 09:46:24 msaitoh Exp $ +# $NetBSD: devlist2h.awk,v 1.9.4.1 2019/12/09 12:49:39 martin Exp $ # # Copyright (c) 1998 The NetBSD Foundation, Inc. # All rights reserved. @@ -41,8 +41,8 @@ #documentation and/or other materials provided with the distribution. # 3. All advertising materials mentioning features or use of this software #must display the following acknowledgement: -# This model includes software developed by Christopher G. Demetriou. -# 4. The name of the author(s) may not be used to endorse or promote models +# This product includes software developed by Christopher G. Demetriou. +# 4. The name of the author(s) may not be used to endorse or promote products #derived from this software without specific prior written permission # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
CVS commit: [netbsd-9] src/usr.bin/menuc/testm
Module Name:src Committed By: martin Date: Mon Dec 9 12:48:22 UTC 2019 Modified Files: src/usr.bin/menuc/testm [netbsd-9]: main.c menus.mc Log Message: Pull up following revision(s) (requested by uwe in ticket #520): usr.bin/menuc/testm/main.c: revision 1.8 usr.bin/menuc/testm/menus.mc: revision 1.13 Fix typo in ad clause. Ok perry@. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.7.6.1 src/usr.bin/menuc/testm/main.c cvs rdiff -u -r1.12 -r1.12.2.1 src/usr.bin/menuc/testm/menus.mc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/menuc/testm/main.c diff -u src/usr.bin/menuc/testm/main.c:1.7 src/usr.bin/menuc/testm/main.c:1.7.6.1 --- src/usr.bin/menuc/testm/main.c:1.7 Tue Jan 23 22:12:52 2018 +++ src/usr.bin/menuc/testm/main.c Mon Dec 9 12:48:22 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.7 2018/01/23 22:12:52 sevan Exp $ */ +/* $NetBSD: main.c,v 1.7.6.1 2019/12/09 12:48:22 martin Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -16,7 +16,7 @@ *documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software *must display the following acknowledgement: - * This product includes software develooped for the NetBSD Project by + * This product includes software developed for the NetBSD Project by * Piermont Information Systems Inc. * 4. The name of Piermont Information Systems Inc. may not be used to endorse *or promote products derived from this software without specific prior Index: src/usr.bin/menuc/testm/menus.mc diff -u src/usr.bin/menuc/testm/menus.mc:1.12 src/usr.bin/menuc/testm/menus.mc:1.12.2.1 --- src/usr.bin/menuc/testm/menus.mc:1.12 Mon Feb 25 20:47:37 2019 +++ src/usr.bin/menuc/testm/menus.mc Mon Dec 9 12:48:22 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: menus.mc,v 1.12 2019/02/25 20:47:37 martin Exp $ */ +/* $NetBSD: menus.mc,v 1.12.2.1 2019/12/09 12:48:22 martin Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -16,7 +16,7 @@ *documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software *must display the following acknowledgement: - * This product includes software develooped for the NetBSD Project by + * This product includes software developed for the NetBSD Project by * Piermont Information Systems Inc. * 4. The name of Piermont Information Systems Inc. may not be used to endorse *or promote products derived from this software without specific prior
CVS commit: [netbsd-9] src/share/tmac
Module Name:src Committed By: martin Date: Mon Dec 9 12:46:32 UTC 2019 Modified Files: src/share/tmac [netbsd-9]: doc2html Log Message: Pull up following revision(s) (requested by uwe in ticket #519): share/tmac/doc2html: revision 1.69 Use groff -Tencoding argument to emit To generate a diff of this commit: cvs rdiff -u -r1.67.16.1 -r1.67.16.2 src/share/tmac/doc2html Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/tmac/doc2html diff -u src/share/tmac/doc2html:1.67.16.1 src/share/tmac/doc2html:1.67.16.2 --- src/share/tmac/doc2html:1.67.16.1 Tue Nov 26 08:56:51 2019 +++ src/share/tmac/doc2html Mon Dec 9 12:46:32 2019 @@ -1,4 +1,4 @@ -.\" $NetBSD: doc2html,v 1.67.16.1 2019/11/26 08:56:51 martin Exp $ +.\" $NetBSD: doc2html,v 1.67.16.2 2019/12/09 12:46:32 martin Exp $ .\" .\" Copyright (c) 1998, 1999, 2008 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -263,9 +263,17 @@ TODO: . fl .. .em end-macro +. +.\" map groff -Tencoding argument to the charset name +.ie '\*(.T'ascii' .ds html-charset US-ASCII +.el .ie '\*(.T'latin1' .ds html-charset ISO-8859-1 +.el .ie '\*(.T'utf8' .ds html-charset UTF-8 +.el .ab unsupported encoding \*(.T +. .de init-html + \\*[document-title]\\$* \\*[title-section]