CVS commit: src/sys/arch/x68k/stand/boot_ufs
Module Name:src Committed By: isaki Date: Tue Jan 14 04:00:41 UTC 2020 Modified Files: src/sys/arch/x68k/stand/boot_ufs: boot.S boot_ufs.h Log Message: Clean up. - B_KEYINP is no longer called from C. - B_COLOR is no longer used. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/arch/x68k/stand/boot_ufs/boot.S cvs rdiff -u -r1.5 -r1.6 src/sys/arch/x68k/stand/boot_ufs/boot_ufs.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/arch/x68k/stand/boot_ufs/boot.S diff -u src/sys/arch/x68k/stand/boot_ufs/boot.S:1.11 src/sys/arch/x68k/stand/boot_ufs/boot.S:1.12 --- src/sys/arch/x68k/stand/boot_ufs/boot.S:1.11 Mon Jan 13 03:34:05 2020 +++ src/sys/arch/x68k/stand/boot_ufs/boot.S Tue Jan 14 04:00:41 2020 @@ -2,7 +2,7 @@ | author: chapuni(webmas...@chapuni.com) | ITOH Yasufumi | -| $NetBSD: boot.S,v 1.11 2020/01/13 03:34:05 isaki Exp $ +| $NetBSD: boot.S,v 1.12 2020/01/14 04:00:41 isaki Exp $ #include #include "iocscall.h" @@ -451,10 +451,6 @@ raw_read_end: read_half: BOOT_ERROR("read half of block") -ENTRY_NOPROFILE(B_KEYINP) - IOCS(__B_KEYINP) - rts - ENTRY_NOPROFILE(B_PUTC) movel %sp@(4),%d1 IOCS(__B_PUTC) Index: src/sys/arch/x68k/stand/boot_ufs/boot_ufs.h diff -u src/sys/arch/x68k/stand/boot_ufs/boot_ufs.h:1.5 src/sys/arch/x68k/stand/boot_ufs/boot_ufs.h:1.6 --- src/sys/arch/x68k/stand/boot_ufs/boot_ufs.h:1.5 Sat Mar 14 14:46:07 2009 +++ src/sys/arch/x68k/stand/boot_ufs/boot_ufs.h Tue Jan 14 04:00:41 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: boot_ufs.h,v 1.5 2009/03/14 14:46:07 dsl Exp $ */ +/* $NetBSD: boot_ufs.h,v 1.6 2020/01/14 04:00:41 isaki Exp $ */ /*** * @@ -14,10 +14,8 @@ int badbaddr(volatile void *adr); #ifdef SCSI_ADHOC_BOOTPART void RAW_READ0(void *buf, u_int32_t blkpos, size_t bytelen); #endif -unsigned B_KEYINP(void); void B_PUTC(unsigned int c); void B_PRINT(const char *p); -unsigned B_COLOR(unsigned int w); extern unsigned ID; /* target SCSI ID */ extern unsigned BOOT_INFO; /* result of IOCS(__BOOTINF) */
CVS commit: src/sys/arch/x68k/stand/boot
Module Name:src Committed By: isaki Date: Tue Jan 14 03:48:10 UTC 2020 Modified Files: src/sys/arch/x68k/stand/boot: boot.c Log Message: consio_init() should be done before printf(). To generate a diff of this commit: cvs rdiff -u -r1.30 -r1.31 src/sys/arch/x68k/stand/boot/boot.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/x68k/stand/boot/boot.c diff -u src/sys/arch/x68k/stand/boot/boot.c:1.30 src/sys/arch/x68k/stand/boot/boot.c:1.31 --- src/sys/arch/x68k/stand/boot/boot.c:1.30 Thu Aug 4 12:15:07 2016 +++ src/sys/arch/x68k/stand/boot/boot.c Tue Jan 14 03:48:10 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: boot.c,v 1.30 2016/08/04 12:15:07 isaki Exp $ */ +/* $NetBSD: boot.c,v 1.31 2020/01/14 03:48:10 isaki Exp $ */ /* * Copyright (c) 2001 Minoura Makoto @@ -387,6 +387,8 @@ bootmain(int bootdev) u_int sram_memsize; u_int probed_memsize; + console_device = consio_init(console_device); + hostadaptor = get_scsi_host_adapter(); rtc_offset = RTC_OFFSET; try_bootp = 1; @@ -402,7 +404,6 @@ bootmain(int bootdev) exit(1); } - console_device = consio_init(console_device); setheap(HEAP_START, HEAP_END); #if !defined(NETBOOT)
CVS commit: src/sys/arch/x86/x86
Module Name:src Committed By: pgoyette Date: Tue Jan 14 01:41:37 UTC 2020 Modified Files: src/sys/arch/x86/x86: cpu.c Log Message: If "application processors" were skipped/disabled at boot time (due to RB_MD1 being set), don't try to examine the featurebus info, since it was never retrieved. Addresses kern/54815 XXX pullup-9 To generate a diff of this commit: cvs rdiff -u -r1.180 -r1.181 src/sys/arch/x86/x86/cpu.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/x86/x86/cpu.c diff -u src/sys/arch/x86/x86/cpu.c:1.180 src/sys/arch/x86/x86/cpu.c:1.181 --- src/sys/arch/x86/x86/cpu.c:1.180 Wed Jan 8 15:47:50 2020 +++ src/sys/arch/x86/x86/cpu.c Tue Jan 14 01:41:37 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.c,v 1.180 2020/01/08 15:47:50 ad Exp $ */ +/* $NetBSD: cpu.c,v 1.181 2020/01/14 01:41:37 pgoyette Exp $ */ /* * Copyright (c) 2000-2012 NetBSD Foundation, Inc. @@ -62,7 +62,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.180 2020/01/08 15:47:50 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.181 2020/01/14 01:41:37 pgoyette Exp $"); #include "opt_ddb.h" #include "opt_mpbios.h" /* for MPDEBUG */ @@ -540,6 +540,16 @@ cpu_rescan(device_t self, const char *if struct cpufeature_attach_args cfaa; struct cpu_info *ci = sc->sc_info; + /* + * If we booted with RB_MD1 to disable multiprocessor, the + * auto-configuration data still contains the additional + * CPUs. But their initialization was mostly bypassed + * during attach, so we have to make sure we don't look at + * their featurebus info, since it wasn't retrieved. + */ + if (ci == NULL) + return 0; + memset(&cfaa, 0, sizeof(cfaa)); cfaa.ci = ci;
CVS commit: src/share/man/man4
Module Name:src Committed By: jdolecek Date: Mon Jan 13 21:43:38 UTC 2020 Modified Files: src/share/man/man4: wd.4 Log Message: bump date for previous change To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/share/man/man4/wd.4 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man4/wd.4 diff -u src/share/man/man4/wd.4:1.21 src/share/man/man4/wd.4:1.22 --- src/share/man/man4/wd.4:1.21 Mon Jan 13 21:43:06 2020 +++ src/share/man/man4/wd.4 Mon Jan 13 21:43:38 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: wd.4,v 1.21 2020/01/13 21:43:06 jdolecek Exp $ +.\" $NetBSD: wd.4,v 1.22 2020/01/13 21:43:38 jdolecek Exp $ .\" .\" .\" Copyright (c) 1994 James A. Jegers @@ -23,7 +23,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd January 9, 2019 +.Dd January 13, 2020 .Dt WD 4 .Os .Sh NAME
CVS commit: src/share/man/man4
Module Name:src Committed By: jdolecek Date: Mon Jan 13 21:43:06 UTC 2020 Modified Files: src/share/man/man4: wd.4 Log Message: document the wd(4) sysctl nodes, and add the note about the Sumsung EVO drives part of fix for PR kern/54790 and PR kern/54855 To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/share/man/man4/wd.4 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man4/wd.4 diff -u src/share/man/man4/wd.4:1.20 src/share/man/man4/wd.4:1.21 --- src/share/man/man4/wd.4:1.20 Wed Jan 9 23:43:13 2019 +++ src/share/man/man4/wd.4 Mon Jan 13 21:43:06 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: wd.4,v 1.20 2019/01/09 23:43:13 gutteridge Exp $ +.\" $NetBSD: wd.4,v 1.21 2020/01/13 21:43:06 jdolecek Exp $ .\" .\" .\" Copyright (c) 1994 James A. Jegers @@ -64,8 +64,40 @@ and .Xr badsect 8 , the software list supports neither sector replacement nor retention across reboots. +.Pp +The following +.Xr sysctl 8 +variables control behavior of disks attached using this driver: +.Bl -tag -width 8n +.It Dv hw.wdX.use_ncq +Whether to use NCQ ATA commands for the disk. Only effective when the disk +hardware actually claims to support NCQ. Default to true. +.It Dv hw.wdX.use_ncq_prio +Use optional NCQ priority for high-priority I/O like meta-data. Intended +only for experimental use right now, might negatively affect performance. +This setting only has effect if +.Dv hw.wdX.use_ncq +is also true. +Default to false. +.El .Sh NOTES Certain +.Tn Samsung +.Tn 860 EVO +SSD drives have firmware bug which causes interface CRC errors when NCQ +ATA commands are used. For this reason NCQ is disabled for these drives +by default. +Affected drives include, but are not limited to: +.Pp +.Bl -tag -width Ds -offset indent -compact +.It Samsung SSD 860 EVO 500GB +.It Samsung SSD 860 EVO 1TB +.El +.Pp +It is recommended to not use the EVO SSD drives, and replace them +with other models. +.Pp +Certain .Tn Seagate .Tn Barracuda drives sold around 2003 have a known firmware bug leading to corrupted
CVS commit: src/sys/dev/ata
Module Name:src Committed By: jdolecek Date: Mon Jan 13 21:20:17 UTC 2020 Modified Files: src/sys/dev/ata: wd.c Log Message: disable NCQ by default for "Samsung SSD 860 EVO 1TB" and "Samsung SSD 860 EVO 500GB" - these drives have known broken NCQ support particularly when used with AMD SB710/750 chipsets, problem occur also under Linux and Windows https://eu.community.samsung.com/t5/Cameras-IT-Everything-Else/860-EVO-250GB-causing-freezes-on-AMD-system/td-p/575813 https://bugzilla.kernel.org/show_bug.cgi?id=201693 It seems there is no Samsung firmware update to fix this even. Disable NCQ regardless of the controller, it's likely same problem exists with other controllers too. This should fix PR kern/54790 and PR kern/54855 To generate a diff of this commit: cvs rdiff -u -r1.453 -r1.454 src/sys/dev/ata/wd.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/ata/wd.c diff -u src/sys/dev/ata/wd.c:1.453 src/sys/dev/ata/wd.c:1.454 --- src/sys/dev/ata/wd.c:1.453 Fri Dec 27 09:41:50 2019 +++ src/sys/dev/ata/wd.c Mon Jan 13 21:20:17 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: wd.c,v 1.453 2019/12/27 09:41:50 msaitoh Exp $ */ +/* $NetBSD: wd.c,v 1.454 2020/01/13 21:20:17 jdolecek Exp $ */ /* * Copyright (c) 1998, 2001 Manuel Bouyer. All rights reserved. @@ -54,7 +54,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.453 2019/12/27 09:41:50 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.454 2020/01/13 21:20:17 jdolecek Exp $"); #include "opt_ata.h" #include "opt_wd.h" @@ -231,8 +231,9 @@ static void bad144intern(struct wd_softc #endif #define WD_QUIRK_SPLIT_MOD15_WRITE 0x0001 /* must split certain writes */ +#define WD_QUIRK_BAD_NCQ 0x0002 /* drive NCQ support broken */ -#define WD_QUIRK_FMT "\20\1SPLIT_MOD15_WRITE\2FORCE_LBA48" +#define WD_QUIRK_FMT "\20\1SPLIT_MOD15_WRITE\2BAD_NCQ" /* * Quirk table for IDE drives. Put more-specific matches first, since @@ -259,14 +260,12 @@ static const struct wd_quirk { * Seagate Barracuda Serial ATA V family. * */ - { "ST3120023AS", - WD_QUIRK_SPLIT_MOD15_WRITE }, - { "ST380023AS", - WD_QUIRK_SPLIT_MOD15_WRITE }, - { "ST360015AS", - WD_QUIRK_SPLIT_MOD15_WRITE }, - { NULL, - 0 } + { "ST3120023AS", WD_QUIRK_SPLIT_MOD15_WRITE }, + { "ST380023AS", WD_QUIRK_SPLIT_MOD15_WRITE }, + { "ST360015AS", WD_QUIRK_SPLIT_MOD15_WRITE }, + { "Samsung SSD 860 EVO 1TB", WD_QUIRK_BAD_NCQ }, + { "Samsung SSD 860 EVO 500GB", WD_QUIRK_BAD_NCQ }, + { NULL, 0 } }; static const struct wd_quirk * @@ -375,6 +374,10 @@ wdattach(device_t parent, device_t self, if (wd->sc_quirks & WD_QUIRK_SPLIT_MOD15_WRITE) { aprint_error_dev(self, "drive corrupts write transfers with certain controllers, consider replacing\n"); } + + if (wd->sc_quirks & WD_QUIRK_BAD_NCQ) { + aprint_error_dev(self, "drive NCQ support broken, NCQ disabled, consider replacing\n"); + } } if ((wd->sc_params.atap_multi & 0xff) > 1) { @@ -2181,7 +2184,7 @@ wd_sysctl_attach(struct wd_softc *wd) return; } - wd->drv_ncq = true; + wd->drv_ncq = ((wd->sc_quirks & WD_QUIRK_BAD_NCQ) == 0) ? true : false; if ((error = sysctl_createv(&wd->nodelog, 0, NULL, NULL, CTLFLAG_READWRITE, CTLTYPE_BOOL, "use_ncq", SYSCTL_DESCR("use NCQ if supported"),
CVS commit: src/sys/arch/arm/include/arm32
Module Name:src Committed By: christos Date: Mon Jan 13 20:36:44 UTC 2020 Modified Files: src/sys/arch/arm/include/arm32: vmparam.h Log Message: Revert previous; we don't want arm to have variable page size. Instead nick@ is fixing the cache pages issue to use a separate pool. To generate a diff of this commit: cvs rdiff -u -r1.46 -r1.47 src/sys/arch/arm/include/arm32/vmparam.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/arch/arm/include/arm32/vmparam.h diff -u src/sys/arch/arm/include/arm32/vmparam.h:1.46 src/sys/arch/arm/include/arm32/vmparam.h:1.47 --- src/sys/arch/arm/include/arm32/vmparam.h:1.46 Sat Jan 11 14:06:34 2020 +++ src/sys/arch/arm/include/arm32/vmparam.h Mon Jan 13 15:36:44 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: vmparam.h,v 1.46 2020/01/11 19:06:34 christos Exp $ */ +/* $NetBSD: vmparam.h,v 1.47 2020/01/13 20:36:44 christos Exp $ */ /* * Copyright (c) 2001, 2002 Wasabi Systems, Inc. @@ -84,11 +84,6 @@ #define PAGE_SIZE (1 << PAGE_SHIFT) #define PAGE_MASK (PAGE_SIZE - 1) -#define MIN_PAGE_SHIFT 12 /* normal */ -#define MAX_PAGE_SHIFT 13 /* _ARM_ARCH_6 */ -#define MIN_PAGE_SIZE (1 << MIN_PAGE_SHIFT) -#define MAX_PAGE_SIZE (1 << MAX_PAGE_SHIFT) - /* * Mach derived constants */
CVS commit: src/sys/kern
Module Name:src Committed By: ad Date: Mon Jan 13 20:30:08 UTC 2020 Modified Files: src/sys/kern: subr_cpu.c Log Message: Fix some more bugs in the topo stuff, that prevented it from working properly with fake topo info + MP. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/kern/subr_cpu.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/subr_cpu.c diff -u src/sys/kern/subr_cpu.c:1.10 src/sys/kern/subr_cpu.c:1.11 --- src/sys/kern/subr_cpu.c:1.10 Mon Jan 13 02:18:13 2020 +++ src/sys/kern/subr_cpu.c Mon Jan 13 20:30:08 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: subr_cpu.c,v 1.10 2020/01/13 02:18:13 mrg Exp $ */ +/* $NetBSD: subr_cpu.c,v 1.11 2020/01/13 20:30:08 ad Exp $ */ /*- * Copyright (c) 2007, 2008, 2009, 2010, 2012, 2019, 2020 @@ -61,7 +61,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: subr_cpu.c,v 1.10 2020/01/13 02:18:13 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: subr_cpu.c,v 1.11 2020/01/13 20:30:08 ad Exp $"); #include #include @@ -236,6 +236,8 @@ cpu_topology_fake1(struct cpu_info *ci) ci->ci_schedstate.spc_flags |= (SPCF_CORE1ST | SPCF_PACKAGE1ST | SPCF_1STCLASS); ci->ci_package1st = ci; + ci->ci_is_slow = false; + cpu_topology_haveslow = false; } /* @@ -251,9 +253,11 @@ cpu_topology_fake(void) for (CPU_INFO_FOREACH(cii, ci)) { cpu_topology_fake1(ci); + /* Undo (early boot) flag set so everything links OK. */ + ci->ci_schedstate.spc_flags &= + ~(SPCF_CORE1ST | SPCF_PACKAGE1ST | SPCF_1STCLASS); } - cpu_topology_dump(); - } +} /* * Fix up basic CPU topology info. Right now that means attach each CPU to @@ -268,7 +272,7 @@ cpu_topology_init(void) if (!cpu_topology_present) { cpu_topology_fake(); - return; + goto linkit; } /* Find siblings in same core and package. */ @@ -292,7 +296,7 @@ cpu_topology_init(void) printf("cpu_topology_init: info bogus, " "faking it\n"); cpu_topology_fake(); - return; + goto linkit; } if (ci2 == ci || ci2->ci_package_id != ci->ci_package_id) { @@ -314,6 +318,7 @@ cpu_topology_init(void) } } + linkit: /* Identify lowest numbered SMT in each core. */ for (CPU_INFO_FOREACH(cii, ci)) { ci2 = ci3 = ci; @@ -358,7 +363,7 @@ cpu_topology_init(void) ci2->ci_package1st = ci3; ci2->ci_sibling[CPUREL_PACKAGE1ST] = ci3; ci2 = ci2->ci_sibling[CPUREL_PACKAGE]; - } while (ci2 != ci); + } while (ci2 != ci3); /* Now look for somebody else to link to. */ for (CPU_INFO_FOREACH(cii2, ci2)) {
CVS commit: src/sys/arch/xen/x86
Module Name:src Committed By: bouyer Date: Mon Jan 13 20:15:01 UTC 2020 Modified Files: src/sys/arch/xen/x86: cpu.c Log Message: Don't call cpu_switchto() before idle_loop(), it should not be needed any more. While there, assume (and KASSERT) that curlwp == ci->ci_data.cpu_idlelwp, this saves a lwp_getpcb() call. To generate a diff of this commit: cvs rdiff -u -r1.131 -r1.132 src/sys/arch/xen/x86/cpu.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/xen/x86/cpu.c diff -u src/sys/arch/xen/x86/cpu.c:1.131 src/sys/arch/xen/x86/cpu.c:1.132 --- src/sys/arch/xen/x86/cpu.c:1.131 Sat Nov 23 19:40:38 2019 +++ src/sys/arch/xen/x86/cpu.c Mon Jan 13 20:15:01 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.c,v 1.131 2019/11/23 19:40:38 ad Exp $ */ +/* $NetBSD: cpu.c,v 1.132 2020/01/13 20:15:01 bouyer Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -65,7 +65,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.131 2019/11/23 19:40:38 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.132 2020/01/13 20:15:01 bouyer Exp $"); #include "opt_ddb.h" #include "opt_multiprocessor.h" @@ -716,9 +716,10 @@ cpu_hatch(void *v) KASSERT((ci->ci_flags & CPUF_RUNNING) == 0); + KASSERT(ci->ci_curlwp == ci->ci_data.cpu_idlelwp); + KASSERT(curlwp == ci->ci_data.cpu_idlelwp); pcb = lwp_getpcb(curlwp); pcb->pcb_cr3 = pmap_pdirpa(pmap_kernel(), 0); - pcb = lwp_getpcb(ci->ci_data.cpu_idlelwp); xen_ipi_init(); @@ -739,8 +740,7 @@ cpu_hatch(void *v) aprint_debug_dev(ci->ci_dev, "running\n"); - cpu_switchto(NULL, ci->ci_data.cpu_idlelwp, true); - + KASSERT(ci->ci_curlwp == ci->ci_data.cpu_idlelwp); idle_loop(NULL); KASSERT(false); }
CVS commit: src/lib/libc/stdlib
Module Name:src Committed By: joerg Date: Mon Jan 13 19:14:02 UTC 2020 Modified Files: src/lib/libc/stdlib: jemalloc.c Log Message: Fix aarch64 definition in old jemalloc There is no platform-specific reason for avoiding TLS. The tiny allocations should be aligned the same as small allocations for ABI reasons. To generate a diff of this commit: cvs rdiff -u -r1.46 -r1.47 src/lib/libc/stdlib/jemalloc.c 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/stdlib/jemalloc.c diff -u src/lib/libc/stdlib/jemalloc.c:1.46 src/lib/libc/stdlib/jemalloc.c:1.47 --- src/lib/libc/stdlib/jemalloc.c:1.46 Thu Mar 28 15:05:03 2019 +++ src/lib/libc/stdlib/jemalloc.c Mon Jan 13 19:14:02 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: jemalloc.c,v 1.46 2019/03/28 15:05:03 christos Exp $ */ +/* $NetBSD: jemalloc.c,v 1.47 2020/01/13 19:14:02 joerg Exp $ */ /*- * Copyright (C) 2006,2007 Jason Evans . @@ -118,7 +118,7 @@ #include /* __FBSDID("$FreeBSD: src/lib/libc/stdlib/malloc.c,v 1.147 2007/06/15 22:00:16 jasone Exp $"); */ -__RCSID("$NetBSD: jemalloc.c,v 1.46 2019/03/28 15:05:03 christos Exp $"); +__RCSID("$NetBSD: jemalloc.c,v 1.47 2020/01/13 19:14:02 joerg Exp $"); #ifdef __FreeBSD__ #include "libc_private.h" @@ -216,7 +216,7 @@ __RCSID("$NetBSD: jemalloc.c,v 1.46 2019 #ifdef __aarch64__ # define QUANTUM_2POW_MIN 4 # define SIZEOF_PTR_2POW 3 -# define NO_TLS +# define TINY_MIN_2POW 3 #endif #ifdef __alpha__ # define QUANTUM_2POW_MIN 4
CVS commit: src/lib/libc/stdlib
Module Name:src Committed By: joerg Date: Mon Jan 13 19:14:38 UTC 2020 Modified Files: src/lib/libc/stdlib: jemalloc.c Log Message: Fix atfork malloc handling to include all the locks in old jemalloc. To generate a diff of this commit: cvs rdiff -u -r1.47 -r1.48 src/lib/libc/stdlib/jemalloc.c 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/stdlib/jemalloc.c diff -u src/lib/libc/stdlib/jemalloc.c:1.47 src/lib/libc/stdlib/jemalloc.c:1.48 --- src/lib/libc/stdlib/jemalloc.c:1.47 Mon Jan 13 19:14:02 2020 +++ src/lib/libc/stdlib/jemalloc.c Mon Jan 13 19:14:37 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: jemalloc.c,v 1.47 2020/01/13 19:14:02 joerg Exp $ */ +/* $NetBSD: jemalloc.c,v 1.48 2020/01/13 19:14:37 joerg Exp $ */ /*- * Copyright (C) 2006,2007 Jason Evans . @@ -118,7 +118,7 @@ #include /* __FBSDID("$FreeBSD: src/lib/libc/stdlib/malloc.c,v 1.147 2007/06/15 22:00:16 jasone Exp $"); */ -__RCSID("$NetBSD: jemalloc.c,v 1.47 2020/01/13 19:14:02 joerg Exp $"); +__RCSID("$NetBSD: jemalloc.c,v 1.48 2020/01/13 19:14:37 joerg Exp $"); #ifdef __FreeBSD__ #include "libc_private.h" @@ -3986,16 +3986,17 @@ _malloc_prefork(void) unsigned i; /* Acquire all mutexes in a safe order. */ - + malloc_mutex_lock(&init_lock); malloc_mutex_lock(&arenas_mtx); for (i = 0; i < narenas; i++) { if (arenas[i] != NULL) malloc_mutex_lock(&arenas[i]->mtx); } - - malloc_mutex_lock(&base_mtx); - malloc_mutex_lock(&chunks_mtx); + malloc_mutex_lock(&base_mtx); +#ifdef USE_BRK + malloc_mutex_lock(&brk_mtx); +#endif } void @@ -4004,16 +4005,18 @@ _malloc_postfork(void) unsigned i; /* Release all mutexes, now that fork() has completed. */ - - malloc_mutex_unlock(&chunks_mtx); - +#ifdef USE_BRK + malloc_mutex_unlock(&brk_mtx); +#endif malloc_mutex_unlock(&base_mtx); + malloc_mutex_unlock(&chunks_mtx); - for (i = 0; i < narenas; i++) { + for (i = narenas; i-- > 0; ) { if (arenas[i] != NULL) malloc_mutex_unlock(&arenas[i]->mtx); } malloc_mutex_unlock(&arenas_mtx); + malloc_mutex_unlock(&init_lock); } /*
CVS commit: src/tools/pkg_install/lib
Module Name:src Committed By: christos Date: Mon Jan 13 19:03:03 UTC 2020 Modified Files: src/tools/pkg_install/lib: Makefile Log Message: use the host compiler To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/tools/pkg_install/lib/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/pkg_install/lib/Makefile diff -u src/tools/pkg_install/lib/Makefile:1.1 src/tools/pkg_install/lib/Makefile:1.2 --- src/tools/pkg_install/lib/Makefile:1.1 Sun Jan 12 16:49:39 2020 +++ src/tools/pkg_install/lib/Makefile Mon Jan 13 14:03:03 2020 @@ -1,10 +1,23 @@ -# $NetBSD: Makefile,v 1.1 2020/01/12 21:49:39 christos Exp $ +# $NetBSD: Makefile,v 1.2 2020/01/13 19:03:03 christos Exp $ .include -HOSTLIB= ${LIB} +HOSTLIB= install + +.include + +SRCS= automatic.c conflicts.c dewey.c \ + fexec.c file.c global.c gpgsig.c iterate.c license.c lpkg.c \ + opattern.c parse-config.c pkcs7.c pkg_signature.c \ + pkgdb.c pkg_io.c plist.c remove.c \ + str.c version.c var.c vulnerabilities-file.c xwrapper.c HOST_CPPFLAGS+= ${CPPFLAGS} -HOST_SRCS+= ${SRCS} -.include "${NETBSDSRCDIR}/external/bsd/pkg_install/lib/Makefile" -.include "${.CURDIR}/../Makefile.inc" +CPPFLAGS+= -DHAVE_NBTOOL_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 + +.PATH: ${NETBSDSRCDIR}/external/bsd/pkg_install/dist/lib + +HOST_CPPFLAGS= ${CPPFLAGS} + +#.include "${.CURDIR}/../../Makefile.nbincludes" +.include
CVS commit: src/lib/libpthread
Module Name:src Committed By: ad Date: Mon Jan 13 18:22:56 UTC 2020 Modified Files: src/lib/libpthread: pthread.c pthread_cond.c pthread_int.h pthread_misc.c pthread_mutex.c pthread_rwlock.c Log Message: Rip out some very ambitious optimisations around pthread_mutex that are don't buy much. This stuff is hard enough to get right in the kernel let alone userspace, and I don't trust that it's right. To generate a diff of this commit: cvs rdiff -u -r1.153 -r1.154 src/lib/libpthread/pthread.c cvs rdiff -u -r1.65 -r1.66 src/lib/libpthread/pthread_cond.c \ src/lib/libpthread/pthread_mutex.c cvs rdiff -u -r1.97 -r1.98 src/lib/libpthread/pthread_int.h cvs rdiff -u -r1.15 -r1.16 src/lib/libpthread/pthread_misc.c cvs rdiff -u -r1.36 -r1.37 src/lib/libpthread/pthread_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/lib/libpthread/pthread.c diff -u src/lib/libpthread/pthread.c:1.153 src/lib/libpthread/pthread.c:1.154 --- src/lib/libpthread/pthread.c:1.153 Tue Mar 5 01:35:52 2019 +++ src/lib/libpthread/pthread.c Mon Jan 13 18:22:56 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: pthread.c,v 1.153 2019/03/05 01:35:52 christos Exp $ */ +/* $NetBSD: pthread.c,v 1.154 2020/01/13 18:22:56 ad Exp $ */ /*- * Copyright (c) 2001, 2002, 2003, 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__RCSID("$NetBSD: pthread.c,v 1.153 2019/03/05 01:35:52 christos Exp $"); +__RCSID("$NetBSD: pthread.c,v 1.154 2020/01/13 18:22:56 ad Exp $"); #define __EXPOSE_STACK 1 @@ -319,7 +319,6 @@ pthread__initthread(pthread_t t) t->pt_havespecific = 0; t->pt_early = NULL; t->pt_lwpctl = &pthread__dummy_lwpctl; - t->pt_blocking = 0; t->pt_droplock = NULL; memcpy(&t->pt_lockops, pthread__lock_ops, sizeof(t->pt_lockops)); @@ -1157,15 +1156,9 @@ pthread__park(pthread_t self, pthread_mu int rv, error; void *obj; - /* - * For non-interlocked release of mutexes we need a store - * barrier before incrementing pt_blocking away from zero. - * This is provided by pthread_mutex_unlock(). - */ self->pt_willpark = 1; pthread_mutex_unlock(lock); self->pt_willpark = 0; - self->pt_blocking++; /* * Wait until we are awoken by a pending unpark operation, @@ -1239,8 +1232,6 @@ pthread__park(pthread_t self, pthread_mu pthread_mutex_unlock(lock); } self->pt_early = NULL; - self->pt_blocking--; - membar_sync(); return rv; } Index: src/lib/libpthread/pthread_cond.c diff -u src/lib/libpthread/pthread_cond.c:1.65 src/lib/libpthread/pthread_cond.c:1.66 --- src/lib/libpthread/pthread_cond.c:1.65 Fri Dec 8 03:08:19 2017 +++ src/lib/libpthread/pthread_cond.c Mon Jan 13 18:22:56 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: pthread_cond.c,v 1.65 2017/12/08 03:08:19 christos Exp $ */ +/* $NetBSD: pthread_cond.c,v 1.66 2020/01/13 18:22:56 ad Exp $ */ /*- * Copyright (c) 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -46,7 +46,7 @@ */ #include -__RCSID("$NetBSD: pthread_cond.c,v 1.65 2017/12/08 03:08:19 christos Exp $"); +__RCSID("$NetBSD: pthread_cond.c,v 1.66 2020/01/13 18:22:56 ad Exp $"); #include #include @@ -164,7 +164,6 @@ pthread_cond_timedwait(pthread_cond_t *c self->pt_willpark = 1; pthread_mutex_unlock(mutex); self->pt_willpark = 0; - self->pt_blocking++; do { retval = _lwp_park(clkid, TIMER_ABSTIME, __UNCONST(abstime), self->pt_unpark, @@ -172,8 +171,6 @@ pthread_cond_timedwait(pthread_cond_t *c __UNVOLATILE(&mutex->ptm_waiters)); self->pt_unpark = 0; } while (retval == -1 && errno == ESRCH); - self->pt_blocking--; - membar_sync(); pthread_mutex_lock(mutex); /* Index: src/lib/libpthread/pthread_mutex.c diff -u src/lib/libpthread/pthread_mutex.c:1.65 src/lib/libpthread/pthread_mutex.c:1.66 --- src/lib/libpthread/pthread_mutex.c:1.65 Tue Mar 5 22:49:38 2019 +++ src/lib/libpthread/pthread_mutex.c Mon Jan 13 18:22:56 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: pthread_mutex.c,v 1.65 2019/03/05 22:49:38 christos Exp $ */ +/* $NetBSD: pthread_mutex.c,v 1.66 2020/01/13 18:22:56 ad Exp $ */ /*- * Copyright (c) 2001, 2003, 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -47,7 +47,7 @@ */ #include -__RCSID("$NetBSD: pthread_mutex.c,v 1.65 2019/03/05 22:49:38 christos Exp $"); +__RCSID("$NetBSD: pthread_mutex.c,v 1.66 2020/01/13 18:22:56 ad Exp $"); #include #include @@ -235,10 +235,7 @@ pthread__mutex_pause(void) /* * Spin while the holder is running. 'lwpctl' gives us the true - * status of the thread. pt_blocking is set by libpthread in order - * to cut out system call and kernel spinlock overhead on remote CPUs - * (could represent many thousands of clock cycles). pt_blocking also - * makes this thread yield if the target is calling sched_yield(). + * status of the thread. */ NOINLINE static void * pthread__mutex_spin(pthread_mutex_t *ptm, pthread_t owner) @@ -250,8 +247,7 @@
CVS commit: src/sys/arch/aarch64/aarch64
Module Name:src Committed By: ryo Date: Mon Jan 13 17:23:07 UTC 2020 Modified Files: src/sys/arch/aarch64/aarch64: bus_space_asm_generic.S Log Message: Fix mis-incrementing pointer size in bus_space_read_region_{4,8} pointed out by jmcneill@. thanks. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/aarch64/aarch64/bus_space_asm_generic.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/bus_space_asm_generic.S diff -u src/sys/arch/aarch64/aarch64/bus_space_asm_generic.S:1.1 src/sys/arch/aarch64/aarch64/bus_space_asm_generic.S:1.2 --- src/sys/arch/aarch64/aarch64/bus_space_asm_generic.S:1.1 Sun Apr 1 04:35:03 2018 +++ src/sys/arch/aarch64/aarch64/bus_space_asm_generic.S Mon Jan 13 17:23:07 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: bus_space_asm_generic.S,v 1.1 2018/04/01 04:35:03 ryo Exp $ */ +/* $NetBSD: bus_space_asm_generic.S,v 1.2 2020/01/13 17:23:07 ryo Exp $ */ /* * Copyright (c) 2017 Ryo Shimizu @@ -29,7 +29,7 @@ #include #include "assym.h" -RCSID("$NetBSD: bus_space_asm_generic.S,v 1.1 2018/04/01 04:35:03 ryo Exp $") +RCSID("$NetBSD: bus_space_asm_generic.S,v 1.2 2020/01/13 17:23:07 ryo Exp $") .macro generate_bsfunc funcname, dsbop /* uint8_t {funcname}_bs_r_1(x0:tag, x1:addr, x2:offset) */ @@ -334,7 +334,7 @@ ENTRY_NP(\funcname\()_bs_rr_4) ldr w8, [x1, x2] /* value = *src */ subs x4, x4, #1 /* count-- */ add x2, x2, x9 /* src += delta */ - str w8, [x3], #2 /* *dst++ = value */ + str w8, [x3], #4 /* *dst++ = value */ b.ne 1b ret #ifdef DIAGNOSTIC @@ -363,7 +363,7 @@ ENTRY_NP(\funcname\()_bs_rr_8) ldr x8, [x1, x2] /* value = *src */ subs x4, x4, #1 /* count-- */ add x2, x2, x9 /* src += delta */ - str x8, [x3], #2 /* *dst++ = value */ + str x8, [x3], #8 /* *dst++ = value */ b.ne 1b ret #ifdef DIAGNOSTIC @@ -423,7 +423,7 @@ ENTRY_NP(\funcname\()_bs_rr_4_swap) subs x4, x4, #1 /* count-- */ add x2, x2, x9 /* src += delta */ rev w8, w8 - str w8, [x3], #2 /* *dst++ = value */ + str w8, [x3], #4 /* *dst++ = value */ b.ne 1b ret #ifdef DIAGNOSTIC @@ -453,7 +453,7 @@ ENTRY_NP(\funcname\()_bs_rr_8_swap) subs x4, x4, #1 /* count-- */ add x2, x2, x9 /* src += delta */ rev x8, x8 - str x8, [x3], #2 /* *dst++ = value */ + str x8, [x3], #8 /* *dst++ = value */ b.ne 1b ret #ifdef DIAGNOSTIC
CVS commit: src/share/man/man3
Module Name:src Committed By: uwe Date: Mon Jan 13 16:11:54 UTC 2020 Modified Files: src/share/man/man3: bitops.3 Log Message: Sort the list. Minor markup and wording tweaks. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/share/man/man3/bitops.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man3/bitops.3 diff -u src/share/man/man3/bitops.3:1.5 src/share/man/man3/bitops.3:1.6 --- src/share/man/man3/bitops.3:1.5 Fri Dec 16 17:20:52 2016 +++ src/share/man/man3/bitops.3 Mon Jan 13 16:11:53 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: bitops.3,v 1.5 2016/12/16 17:20:52 abhinav Exp $ +.\" $NetBSD: bitops.3,v 1.6 2020/01/13 16:11:53 uwe Exp $ .\" .\" Copyright (c) 2011 Jukka Ruohonen .\" All rights reserved. @@ -35,22 +35,22 @@ .Sh DESCRIPTION The .In sys/bitops.h -header includes macros and -.Em static inline +header provides macros and +.Vt static inline functions related to bits and integers. Among these are: -.Bl -tag -width "fast_divide32(3) " -offset indent +.Bl -tag -width ".Xr fast_divide32 3" -offset indent .It Xr bitmap 3 bitmap manipulation macros +.It Xr fast_divide32 3 +a function for fast 32-bit division .It Xr ffs32 3 -functions to find the first and last bit in integers of type +functions to find the first and last set bit in integers of type .Vt uint32_t and .Vt uint64_t .It Xr ilog2 3 a macro for binary logarithm -.It Xr fast_divide32 3 -a function for fast 32-bit division .El .Sh SEE ALSO .Xr bits 3 ,
CVS commit: src/share/man/man3
Module Name:src Committed By: uwe Date: Mon Jan 13 16:01:37 UTC 2020 Modified Files: src/share/man/man3: dlfcn.3 Log Message: Oops. Restore the dot lost in -width ".Dv ..." To generate a diff of this commit: cvs rdiff -u -r1.38 -r1.39 src/share/man/man3/dlfcn.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man3/dlfcn.3 diff -u src/share/man/man3/dlfcn.3:1.38 src/share/man/man3/dlfcn.3:1.39 --- src/share/man/man3/dlfcn.3:1.38 Mon Jan 13 15:59:11 2020 +++ src/share/man/man3/dlfcn.3 Mon Jan 13 16:01:37 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: dlfcn.3,v 1.38 2020/01/13 15:59:11 uwe Exp $ +.\" $NetBSD: dlfcn.3,v 1.39 2020/01/13 16:01:37 uwe Exp $ .\" .\" Copyright (c) 1998 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -104,7 +104,7 @@ The .Fa mode parameter specifies symbol resolution time and symbol visibility. One of the following values may be used to specify symbol resolution time: -.Bl -tag -width "Dv RTLD_NODELETE" -offset indent +.Bl -tag -width ".Dv RTLD_NODELETE" -offset indent .It Dv RTLD_NOW Symbols are resolved immediately. .It Dv RTLD_LAZY @@ -113,7 +113,7 @@ This is the default value if resolution .El .Pp One of the following values may be used to specify symbol visibility: -.Bl -tag -width "Dv RTLD_NODELETE" -offset indent +.Bl -tag -width ".Dv RTLD_NODELETE" -offset indent .It Dv RTLD_GLOBAL The object's symbols and the symbols of its dependencies will be visible to other objects. @@ -135,7 +135,7 @@ then it is promoted to Additionally, one of the following flags may be ORed into the .Fa mode argument: -.Bl -tag -width "Dv RTLD_NODELETE" -offset indent +.Bl -tag -width ".Dv RTLD_NODELETE" -offset indent .It Dv RTLD_NODELETE Prevents unload of the loaded object on .Fn dlclose .
CVS commit: src/share/man/man3
Module Name:src Committed By: uwe Date: Mon Jan 13 15:59:12 UTC 2020 Modified Files: src/share/man/man3: dlfcn.3 Log Message: Fix -width in the tagged list of special "handle" values. To generate a diff of this commit: cvs rdiff -u -r1.37 -r1.38 src/share/man/man3/dlfcn.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man3/dlfcn.3 diff -u src/share/man/man3/dlfcn.3:1.37 src/share/man/man3/dlfcn.3:1.38 --- src/share/man/man3/dlfcn.3:1.37 Mon Jan 13 15:54:48 2020 +++ src/share/man/man3/dlfcn.3 Mon Jan 13 15:59:11 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: dlfcn.3,v 1.37 2020/01/13 15:54:48 uwe Exp $ +.\" $NetBSD: dlfcn.3,v 1.38 2020/01/13 15:59:11 uwe Exp $ .\" .\" Copyright (c) 1998 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -209,7 +209,7 @@ The following special .Fa handle values may be used with .Fn dlsym : -.Bl -tag -width "RTLD_DEFAULTXX" -offset indent +.Bl -tag -width ".Dv RTLD_DEFAULT" -offset indent .It Dv NULL Interpreted as a reference to the executable or shared object from which the call is being made.
CVS commit: src/share/man/man3
Module Name:src Committed By: uwe Date: Mon Jan 13 15:54:48 UTC 2020 Modified Files: src/share/man/man3: dlfcn.3 Log Message: Minor tweaks. Use same -indent for lists of values that are OR'ed as one argument. Use consistent markup for dli_* member names. Untabify Dl_info definition so that it lines up in PS output. To generate a diff of this commit: cvs rdiff -u -r1.36 -r1.37 src/share/man/man3/dlfcn.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man3/dlfcn.3 diff -u src/share/man/man3/dlfcn.3:1.36 src/share/man/man3/dlfcn.3:1.37 --- src/share/man/man3/dlfcn.3:1.36 Mon Jan 13 11:44:02 2020 +++ src/share/man/man3/dlfcn.3 Mon Jan 13 15:54:48 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: dlfcn.3,v 1.36 2020/01/13 11:44:02 wiz Exp $ +.\" $NetBSD: dlfcn.3,v 1.37 2020/01/13 15:54:48 uwe Exp $ .\" .\" Copyright (c) 1998 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -104,7 +104,7 @@ The .Fa mode parameter specifies symbol resolution time and symbol visibility. One of the following values may be used to specify symbol resolution time: -.Bl -tag -width "RTLD_GLOBALXX" -offset indent +.Bl -tag -width "Dv RTLD_NODELETE" -offset indent .It Dv RTLD_NOW Symbols are resolved immediately. .It Dv RTLD_LAZY @@ -113,7 +113,7 @@ This is the default value if resolution .El .Pp One of the following values may be used to specify symbol visibility: -.Bl -tag -width "RTLD_GLOBALXX" -offset indent +.Bl -tag -width "Dv RTLD_NODELETE" -offset indent .It Dv RTLD_GLOBAL The object's symbols and the symbols of its dependencies will be visible to other objects. @@ -135,12 +135,12 @@ then it is promoted to Additionally, one of the following flags may be ORed into the .Fa mode argument: -.Bl -tag -width "RTLD_NODELETEXX" -offset indent +.Bl -tag -width "Dv RTLD_NODELETE" -offset indent .It Dv RTLD_NODELETE Prevents unload of the loaded object on .Fn dlclose . The same behaviour may be requested by -.Fl "z nodelete" +.Fl z Cm nodelete option of the static linker .Xr ld 1 . .It Dv RTLD_NOLOAD @@ -256,10 +256,10 @@ as mapped in the process address space \ the value passed in the first argument .Fa addr . The symbols of a shared object are only eligible if -.Va addr +.Fa addr is between the base address of the shared object and the value of the symbol -.Dq _end +.Va _end in the same shared object. If no object for which this condition holds true can be found, @@ -272,23 +272,23 @@ and the shared object it is contained in The .Fa dli argument points at a caller-provided -.Va Dl_info +.Vt Dl_info structure defined as follows: .Bd -literal -offset indent typedef struct { - const char *dli_fname; /* File defining the symbol */ - void *dli_fbase; /* Base address */ - const char *dli_sname; /* Symbol name */ - const void *dli_saddr; /* Symbol address */ +const char *dli_fname; /* File defining the symbol */ +void*dli_fbase; /* Base address */ +const char *dli_sname; /* Symbol name */ +const void *dli_saddr; /* Symbol address */ } Dl_info; .Ed .Pp The structure members are further described as follows: -.Bl -tag -width "dli_fnameXX" -.It Li "dli_fname" +.Bl -tag -width "Va" +.It Va dli_fname The pathname of the shared object containing the address .Fa addr . -.It Li "dli_fbase" +.It Va dli_fbase The base address at which this shared object is loaded in the process address space. This may be zero if the symbol was found in the internally generated @@ -299,9 +299,9 @@ see .Xr link 5 .Pc which is not associated with a file. -.It Li "dli_sname" +.It Va dli_sname points at the nul-terminated name of the selected symbol -.It Li "dli_saddr" +.It Va dli_saddr is the actual address .Pq as it appears in the process address space of the symbol.
CVS commit: src/share/man/man3
Module Name:src Committed By: kamil Date: Mon Jan 13 14:25:06 UTC 2020 Modified Files: src/share/man/man3: dlinfo.3 Log Message: Fix a typo To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/share/man/man3/dlinfo.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man3/dlinfo.3 diff -u src/share/man/man3/dlinfo.3:1.5 src/share/man/man3/dlinfo.3:1.6 --- src/share/man/man3/dlinfo.3:1.5 Mon Jan 13 14:24:16 2020 +++ src/share/man/man3/dlinfo.3 Mon Jan 13 14:25:06 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: dlinfo.3,v 1.5 2020/01/13 14:24:16 kamil Exp $ +.\" $NetBSD: dlinfo.3,v 1.6 2020/01/13 14:25:06 kamil Exp $ .\" .\" Copyright (c) 2003 Alexey Zelkin .\" All rights reserved. @@ -271,7 +271,7 @@ it first appeared in .Sh AUTHORS .An -nosplit The -.Bx +.Nx implementation of the .Fn dlinfo function was written by
CVS commit: src/share/man/man3
Module Name:src Committed By: kamil Date: Mon Jan 13 14:24:16 UTC 2020 Modified Files: src/share/man/man3: dlinfo.3 Log Message: Correct the authorship note of dlinfo(3) To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/share/man/man3/dlinfo.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man3/dlinfo.3 diff -u src/share/man/man3/dlinfo.3:1.4 src/share/man/man3/dlinfo.3:1.5 --- src/share/man/man3/dlinfo.3:1.4 Mon Jan 13 14:10:52 2020 +++ src/share/man/man3/dlinfo.3 Mon Jan 13 14:24:16 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: dlinfo.3,v 1.4 2020/01/13 14:10:52 uwe Exp $ +.\" $NetBSD: dlinfo.3,v 1.5 2020/01/13 14:24:16 kamil Exp $ .\" .\" Copyright (c) 2003 Alexey Zelkin .\" All rights reserved. @@ -271,10 +271,10 @@ it first appeared in .Sh AUTHORS .An -nosplit The -.Fx +.Bx implementation of the .Fn dlinfo -function was originally written by +function was written by .An Antti Kantee Aq Mt po...@netbsd.org . .Pp The manual page for this function was written by
CVS commit: src/share/man/man3
Module Name:src Committed By: uwe Date: Mon Jan 13 14:10:52 UTC 2020 Modified Files: src/share/man/man3: dlinfo.3 Log Message: Miscellaneous fixes. No space after asterisk in "type *arg". There's no "-width indent", use something relevant instead. Do not document the structure tag of the Link_map typedef. Give the Link_map members a paragraph of their own for readability. Give them a bit more breathing space in the tagged list. Spell pooka's name correctly. TODO: The text is pleonastic in several places ("Do foo. On success does foo." etc) and could use some copy editing. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/share/man/man3/dlinfo.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man3/dlinfo.3 diff -u src/share/man/man3/dlinfo.3:1.3 src/share/man/man3/dlinfo.3:1.4 --- src/share/man/man3/dlinfo.3:1.3 Mon Jan 13 11:47:06 2020 +++ src/share/man/man3/dlinfo.3 Mon Jan 13 14:10:52 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: dlinfo.3,v 1.3 2020/01/13 11:47:06 wiz Exp $ +.\" $NetBSD: dlinfo.3,v 1.4 2020/01/13 14:10:52 uwe Exp $ .\" .\" Copyright (c) 2003 Alexey Zelkin .\" All rights reserved. @@ -40,7 +40,7 @@ dynamically linked program automatically .In link.h .In dlfcn.h .Ft int -.Fn dlinfo "void * handle" "int request" "void * p" +.Fn dlinfo "void *handle" "int request" "void *p" .Sh DESCRIPTION The .Fn dlinfo @@ -66,19 +66,20 @@ is the value returned from the information returned by the .Fn dlinfo function pertains to the specified object. -If handle is the special handle +If +.Fa handle +is the special handle .Dv RTLD_SELF , the information returned pertains to the caller itself. .Pp Possible values for the .Fa request argument are: -.Bl -tag -width indent +.Bl -tag -width "Dv RTLD_" .It Dv RTLD_DI_LINKMAP -Retrieve the +Retrieve the pointer to the .Vt Link_map -.Pq Vt "struct link_map" -structure pointer for the specified +for the specified .Fa handle . On successful return, the .Fa p @@ -98,6 +99,7 @@ in the same order as and .Xr dlclose 3 are called. +.Pp The .Vt Link_map structure is defined in @@ -113,11 +115,11 @@ void*l_ld; /* Pointer to struct link_map *l_next, /* linked list of mapped libs */ *l_prev; .Ed -.Bl -tag -width ".Va l_addr" +.Bl -tag -width Va .It Va l_addr The base address of the object loaded into memory. .It Va l_name -The full name of the loaded shared object. +The absolute pathname of the loaded shared object. .It Va l_ld The address of the dynamic linking information segment .Pq Dv PT_DYNAMIC @@ -273,7 +275,7 @@ The implementation of the .Fn dlinfo function was originally written by -.An Antii Kantee Aq Mt po...@netbsd.org . +.An Antti Kantee Aq Mt po...@netbsd.org . .Pp The manual page for this function was written by .An Alexey Zelkin Aq Mt phan...@freebsd.org
CVS commit: src/sys/dev/i2c
Module Name:src Committed By: thorpej Date: Mon Jan 13 12:53:46 UTC 2020 Modified Files: src/sys/dev/i2c: gttwsi_core.c Log Message: Fix silly mistake in rev 1.12. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/sys/dev/i2c/gttwsi_core.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/i2c/gttwsi_core.c diff -u src/sys/dev/i2c/gttwsi_core.c:1.14 src/sys/dev/i2c/gttwsi_core.c:1.15 --- src/sys/dev/i2c/gttwsi_core.c:1.14 Mon Jan 13 09:53:54 2020 +++ src/sys/dev/i2c/gttwsi_core.c Mon Jan 13 12:53:46 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: gttwsi_core.c,v 1.14 2020/01/13 09:53:54 martin Exp $ */ +/* $NetBSD: gttwsi_core.c,v 1.15 2020/01/13 12:53:46 thorpej Exp $ */ /* * Copyright (c) 2008 Eiji Kawauchi. * All rights reserved. @@ -66,7 +66,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: gttwsi_core.c,v 1.14 2020/01/13 09:53:54 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: gttwsi_core.c,v 1.15 2020/01/13 12:53:46 thorpej Exp $"); #include "locators.h" #include @@ -109,7 +109,7 @@ void gttwsi_write_4(struct gttwsi_softc *sc, uint32_t reg, uint32_t val) { - bus_space_write_4(sc->sc_bust, sc->sc_bush, reg, val); + bus_space_write_4(sc->sc_bust, sc->sc_bush, sc->sc_regmap[reg], val); #ifdef TWSI_DEBUG printf("I2C:W:[%" PRIu32 "]%02" PRIxBUSSIZE ":%02" PRIx32 "\n", reg, sc->sc_regmap[reg], val); #else
CVS commit: src/sys/arch/i386/i386
Module Name:src Committed By: ad Date: Mon Jan 13 12:03:42 UTC 2020 Modified Files: src/sys/arch/i386/i386: locore.S Log Message: It looks like Xen cpu_hatch() calls cpu_switchto() with prevlwp=NULL, instead of calling idle_loop() directly. I can't test a change to cpu_hatch() right now so allow for prevlwp=NULL. To generate a diff of this commit: cvs rdiff -u -r1.175 -r1.176 src/sys/arch/i386/i386/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/i386/i386/locore.S diff -u src/sys/arch/i386/i386/locore.S:1.175 src/sys/arch/i386/i386/locore.S:1.176 --- src/sys/arch/i386/i386/locore.S:1.175 Wed Jan 8 17:38:41 2020 +++ src/sys/arch/i386/i386/locore.S Mon Jan 13 12:03:41 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.175 2020/01/08 17:38:41 ad Exp $ */ +/* $NetBSD: locore.S,v 1.176 2020/01/13 12:03:41 ad Exp $ */ /* * Copyright-o-rama! @@ -128,7 +128,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.175 2020/01/08 17:38:41 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.176 2020/01/13 12:03:41 ad Exp $"); #include "opt_copy_symtab.h" #include "opt_ddb.h" @@ -1316,10 +1316,14 @@ ENTRY(cpu_switchto) movl 20(%esp),%edi /* newlwp */ movl 24(%esp),%edx /* returning */ + testl %esi,%esi /* oldlwp = NULL ? */ + jz skip_save + /* Save old context. */ movl L_PCB(%esi),%eax movl %esp,PCB_ESP(%eax) movl %ebp,PCB_EBP(%eax) +skip_save: /* Switch to newlwp's stack. */ movl L_PCB(%edi),%ebx
CVS commit: src/sys/kern
Module Name:src Committed By: ad Date: Mon Jan 13 11:53:25 UTC 2020 Modified Files: src/sys/kern: kern_runq.c Log Message: - Fix an inverted test that could have prevented LWPs running on helper CPUs to teleport somewhere better during preempt(). - Fix a comment. To generate a diff of this commit: cvs rdiff -u -r1.58 -r1.59 src/sys/kern/kern_runq.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_runq.c diff -u src/sys/kern/kern_runq.c:1.58 src/sys/kern/kern_runq.c:1.59 --- src/sys/kern/kern_runq.c:1.58 Sun Jan 12 22:03:22 2020 +++ src/sys/kern/kern_runq.c Mon Jan 13 11:53:24 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_runq.c,v 1.58 2020/01/12 22:03:22 ad Exp $ */ +/* $NetBSD: kern_runq.c,v 1.59 2020/01/13 11:53:24 ad Exp $ */ /*- * Copyright (c) 2019, 2020 The NetBSD Foundation, Inc. @@ -56,7 +56,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_runq.c,v 1.58 2020/01/12 22:03:22 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_runq.c,v 1.59 2020/01/13 11:53:24 ad Exp $"); #include "opt_dtrace.h" @@ -884,12 +884,12 @@ sched_preempted(struct lwp *l) * Try to select another CPU if: * * - there is no migration pending already - * - and there is no realtime LWP in the mix (no time to waste then) - * - and this LWP is running on a 2nd class CPU, or is child of vfork() + * - and this LWP is running on a 2nd class CPU + * - or this LWP is a child of vfork() that has just done execve() */ - if (tspc->spc_maxpriority >= PRI_USER_RT || l->l_target_cpu != NULL || - ((tspc->spc_flags & SPCF_1STCLASS) | (l->l_pflag & LP_TELEPORT)) - == 0) { + if (l->l_target_cpu != NULL || + ((tspc->spc_flags & SPCF_1STCLASS) != 0 && + (l->l_pflag & LP_TELEPORT) == 0)) { return; } @@ -911,20 +911,26 @@ sched_preempted(struct lwp *l) tci = tci->ci_sibling[CPUREL_CORE]; } - /* - * Try to find a better CPU to take it, but don't move to another - * 2nd class CPU; there's not much point. - * - * Search in the current CPU package in order to try and keep L2/L3 - * cache locality, but expand to include the whole system if needed. - */ if ((l->l_pflag & LP_TELEPORT) != 0) { + /* + * A child of vfork(): now that the parent is released, + * scatter far and wide, to match the LSIDL distribution + * done in sched_takecpu(). + */ l->l_pflag &= ~LP_TELEPORT; tci = sched_bestcpu(l, sched_nextpkg()); if (tci != ci) { l->l_target_cpu = tci; } } else { + /* + * Try to find a better CPU to take it, but don't move to + * another 2nd class CPU; there's not much point. + * + * Search in the current CPU package in order to try and + * keep L2/L3 cache locality, but expand to include the + * whole system if needed. + */ tci = sched_bestcpu(l, l->l_cpu); if (tci != ci && (tci->ci_schedstate.spc_flags & SPCF_1STCLASS) != 0) {
CVS commit: src/share/man/man3
Module Name:src Committed By: wiz Date: Mon Jan 13 11:47:06 UTC 2020 Modified Files: src/share/man/man3: dlinfo.3 Log Message: Add missing El. Fix grammar. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/share/man/man3/dlinfo.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man3/dlinfo.3 diff -u src/share/man/man3/dlinfo.3:1.2 src/share/man/man3/dlinfo.3:1.3 --- src/share/man/man3/dlinfo.3:1.2 Mon Jan 13 09:00:20 2020 +++ src/share/man/man3/dlinfo.3 Mon Jan 13 11:47:06 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: dlinfo.3,v 1.2 2020/01/13 09:00:20 kamil Exp $ +.\" $NetBSD: dlinfo.3,v 1.3 2020/01/13 11:47:06 wiz Exp $ .\" .\" Copyright (c) 2003 Alexey Zelkin .\" All rights reserved. @@ -31,7 +31,7 @@ .Os .Sh NAME .Nm dlinfo -.Nd information about dynamically loaded object +.Nd information about a dynamically loaded object .Sh LIBRARY (These functions are not in a library. They are included in every @@ -44,7 +44,7 @@ dynamically linked program automatically .Sh DESCRIPTION The .Fn dlinfo -function provides information about dynamically loaded object. +function provides information about a dynamically loaded object. The action taken by .Fn dlinfo and exact meaning and type of @@ -194,7 +194,7 @@ structure on the link-map list. .\" .Vt char .\" pointer .\" .Pq Fa "char *p" . -.\" .El +.El .Sh RETURN VALUES The .Fn dlinfo @@ -235,20 +235,20 @@ while (map != NULL) { .\" Dl_serinfo _info, *info = &_info; .\" Dl_serpath *path; .\" unsigned int cnt; -.\" +.\" .\" /* determine search path count and required buffer size */ .\" dlinfo(RTLD_SELF, RTLD_DI_SERINFOSIZE, (void *)info); -.\" +.\" .\" /* allocate new buffer and initialize */ .\" info = malloc(_info.dls_size); .\" info->dls_size = _info.dls_size; .\" info->dls_cnt = _info.dls_cnt; -.\" +.\" .\" /* obtain sarch path information */ .\" dlinfo(RTLD_SELF, RTLD_DI_SERINFO, (void *)info); -.\" +.\" .\" path = &info->dls_serpath[0]; -.\" +.\" .\" for (cnt = 1; cnt <= info->dls_cnt; cnt++, path++) { .\" (void) printf("%2d: %s\\n", cnt, path->dls_name); .\" }
CVS commit: src/share/man/man3
Module Name:src Committed By: wiz Date: Mon Jan 13 11:44:02 UTC 2020 Modified Files: src/share/man/man3: dlfcn.3 Log Message: Clean up dash use. Remove superfluous Pp. To generate a diff of this commit: cvs rdiff -u -r1.35 -r1.36 src/share/man/man3/dlfcn.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man3/dlfcn.3 diff -u src/share/man/man3/dlfcn.3:1.35 src/share/man/man3/dlfcn.3:1.36 --- src/share/man/man3/dlfcn.3:1.35 Mon Jan 13 09:00:59 2020 +++ src/share/man/man3/dlfcn.3 Mon Jan 13 11:44:02 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: dlfcn.3,v 1.35 2020/01/13 09:00:59 kamil Exp $ +.\" $NetBSD: dlfcn.3,v 1.36 2020/01/13 11:44:02 wiz Exp $ .\" .\" Copyright (c) 1998 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -113,7 +113,6 @@ This is the default value if resolution .El .Pp One of the following values may be used to specify symbol visibility: -.Pp .Bl -tag -width "RTLD_GLOBALXX" -offset indent .It Dv RTLD_GLOBAL The object's symbols and the symbols of its dependencies will be visible to @@ -203,8 +202,9 @@ However, the symbols of an object's depe All shared objects loaded at program startup are globally visible. Only the symbols in the main executable that are referenced by a shared object at link time will be visible unless it has been linked -with the --export-dynamic option where all of its symbols will be -visible. +with the +.Fl Fl export-dynamic +option where all of its symbols will be visible. The following special .Fa handle values may be used with @@ -251,8 +251,8 @@ and the must match in order for the symbol to be resolved. .Pp .Fn dladdr -examines all currently mapped shared objects for a symbol whose address -- -as mapped in the process address space -- is closest to but not exceeding +examines all currently mapped shared objects for a symbol whose address \(em +as mapped in the process address space \(em is closest to but not exceeding the value passed in the first argument .Fa addr . The symbols of a shared object are only eligible if
CVS commit: src/sys/arch/amd64/amd64
Module Name:src Committed By: ad Date: Mon Jan 13 11:40:15 UTC 2020 Modified Files: src/sys/arch/amd64/amd64: locore.S Log Message: It looks like Xen cpu_hatch() calls cpu_switchto() with prevlwp=NULL, instead of calling idle_loop() directly. I can't test a change to cpu_hatch() right now so allow for prevlwp=NULL. To generate a diff of this commit: cvs rdiff -u -r1.198 -r1.199 src/sys/arch/amd64/amd64/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/amd64/amd64/locore.S diff -u src/sys/arch/amd64/amd64/locore.S:1.198 src/sys/arch/amd64/amd64/locore.S:1.199 --- src/sys/arch/amd64/amd64/locore.S:1.198 Thu Jan 9 00:42:24 2020 +++ src/sys/arch/amd64/amd64/locore.S Mon Jan 13 11:40:15 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.198 2020/01/09 00:42:24 manu Exp $ */ +/* $NetBSD: locore.S,v 1.199 2020/01/13 11:40:15 ad Exp $ */ /* * Copyright-o-rama! @@ -1079,10 +1079,14 @@ ENTRY(cpu_switchto) movq %rdi,%r13 /* oldlwp */ movq %rsi,%r12 /* newlwp */ + testq %r13,%r13 /* oldlwp = NULL ? */ + jz .Lskip_save + /* Save old context. */ movq L_PCB(%r13),%rax movq %rsp,PCB_RSP(%rax) movq %rbp,PCB_RBP(%rax) +.Lskip_save: /* Switch to newlwp's stack. */ movq L_PCB(%r12),%r14
CVS commit: src/sys/dev/i2c
Module Name:src Committed By: martin Date: Mon Jan 13 09:53:54 UTC 2020 Modified Files: src/sys/dev/i2c: gttwsi_core.c Log Message: Fix debug printf formats. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/sys/dev/i2c/gttwsi_core.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/i2c/gttwsi_core.c diff -u src/sys/dev/i2c/gttwsi_core.c:1.13 src/sys/dev/i2c/gttwsi_core.c:1.14 --- src/sys/dev/i2c/gttwsi_core.c:1.13 Mon Jan 13 00:09:28 2020 +++ src/sys/dev/i2c/gttwsi_core.c Mon Jan 13 09:53:54 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: gttwsi_core.c,v 1.13 2020/01/13 00:09:28 thorpej Exp $ */ +/* $NetBSD: gttwsi_core.c,v 1.14 2020/01/13 09:53:54 martin Exp $ */ /* * Copyright (c) 2008 Eiji Kawauchi. * All rights reserved. @@ -66,7 +66,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: gttwsi_core.c,v 1.13 2020/01/13 00:09:28 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: gttwsi_core.c,v 1.14 2020/01/13 09:53:54 martin Exp $"); #include "locators.h" #include @@ -98,7 +98,7 @@ gttwsi_read_4(struct gttwsi_softc *sc, u const uint32_t val = bus_space_read_4(sc->sc_bust, sc->sc_bush, sc->sc_regmap[reg]); #ifdef TWSI_DEBUG - printf("I2C:R:[%u]%02x:%02x\n", reg, sc->sc_regmap[reg], val); + printf("I2C:R:[%" PRIu32 "]%02" PRIxBUSSIZE ":%02" PRIx32 "\n", reg, sc->sc_regmap[reg], val); #else DELAY(TWSI_READ_DELAY); #endif @@ -111,7 +111,7 @@ gttwsi_write_4(struct gttwsi_softc *sc, bus_space_write_4(sc->sc_bust, sc->sc_bush, reg, val); #ifdef TWSI_DEBUG - printf("I2C:W:[%u]%02x:%02x\n", reg, sc->sc_regmap[reg], val); + printf("I2C:W:[%" PRIu32 "]%02" PRIxBUSSIZE ":%02" PRIx32 "\n", reg, sc->sc_regmap[reg], val); #else DELAY(TWSI_WRITE_DELAY); #endif
CVS commit: src/share/man/man3
Module Name:src Committed By: kamil Date: Mon Jan 13 09:00:59 UTC 2020 Modified Files: src/share/man/man3: dlfcn.3 Log Message: Bump date in dlfcn(3) To generate a diff of this commit: cvs rdiff -u -r1.34 -r1.35 src/share/man/man3/dlfcn.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man3/dlfcn.3 diff -u src/share/man/man3/dlfcn.3:1.34 src/share/man/man3/dlfcn.3:1.35 --- src/share/man/man3/dlfcn.3:1.34 Mon Jan 13 08:29:05 2020 +++ src/share/man/man3/dlfcn.3 Mon Jan 13 09:00:59 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: dlfcn.3,v 1.34 2020/01/13 08:29:05 kamil Exp $ +.\" $NetBSD: dlfcn.3,v 1.35 2020/01/13 09:00:59 kamil Exp $ .\" .\" Copyright (c) 1998 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd June 25, 2011 +.Dd January 13, 2020 .Dt DLFCN 3 .Os .Sh NAME
CVS commit: src/share/man/man3
Module Name:src Committed By: kamil Date: Mon Jan 13 09:00:20 UTC 2020 Modified Files: src/share/man/man3: dlinfo.3 Log Message: Bump date in dlinfo(3) To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/share/man/man3/dlinfo.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man3/dlinfo.3 diff -u src/share/man/man3/dlinfo.3:1.1 src/share/man/man3/dlinfo.3:1.2 --- src/share/man/man3/dlinfo.3:1.1 Mon Jan 13 08:25:02 2020 +++ src/share/man/man3/dlinfo.3 Mon Jan 13 09:00:20 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: dlinfo.3,v 1.1 2020/01/13 08:25:02 kamil Exp $ +.\" $NetBSD: dlinfo.3,v 1.2 2020/01/13 09:00:20 kamil Exp $ .\" .\" Copyright (c) 2003 Alexey Zelkin .\" All rights reserved. @@ -26,7 +26,7 @@ .\" .\" $FreeBSD: head/lib/libc/gen/dlinfo.3 267774 2014-06-23 08:25:03Z bapt $ .\" -.Dd February 14, 2003 +.Dd January 13, 2020 .Dt DLINFO 3 .Os .Sh NAME
CVS commit: [ad-namecache] src/sys
Module Name:src Committed By: ad Date: Mon Jan 13 08:51:07 UTC 2020 Modified Files: src/sys/kern [ad-namecache]: vfs_cache.c src/sys/sys [ad-namecache]: namei.src vnode_impl.h Log Message: Make the per-directory lock a rwlock. To generate a diff of this commit: cvs rdiff -u -r1.126.2.3 -r1.126.2.4 src/sys/kern/vfs_cache.c cvs rdiff -u -r1.47.2.1 -r1.47.2.2 src/sys/sys/namei.src cvs rdiff -u -r1.19.2.1 -r1.19.2.2 src/sys/sys/vnode_impl.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/kern/vfs_cache.c diff -u src/sys/kern/vfs_cache.c:1.126.2.3 src/sys/kern/vfs_cache.c:1.126.2.4 --- src/sys/kern/vfs_cache.c:1.126.2.3 Wed Jan 8 21:55:10 2020 +++ src/sys/kern/vfs_cache.c Mon Jan 13 08:51:07 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: vfs_cache.c,v 1.126.2.3 2020/01/08 21:55:10 ad Exp $ */ +/* $NetBSD: vfs_cache.c,v 1.126.2.4 2020/01/13 08:51:07 ad Exp $ */ /*- * Copyright (c) 2008, 2019 The NetBSD Foundation, Inc. @@ -100,9 +100,10 @@ * vp->v_interlock: per vnode interlock taken when acquiring a ref. * * Most all modifications are made holding both cache_list_lock and the - * directory lock. nc_hittime is modified with only the directory lock - * held. See the definition of "struct namecache" in src/sys/namei.src - * for the particulars. + * directory lock write locked. nc_hittime does not have any kind of + * serialization appliet to it - updates are racy, but since it's only + * used for pseudo-LRU replacement it doesn't matter. See definition + * of "struct namecache" in src/sys/namei.src for the particulars. * * Per-CPU statistics, and "numcache" are read unlocked, since an * approximate value is OK. We maintain uintptr_t sized per-CPU @@ -149,7 +150,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: vfs_cache.c,v 1.126.2.3 2020/01/08 21:55:10 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vfs_cache.c,v 1.126.2.4 2020/01/13 08:51:07 ad Exp $"); #define __NAMECACHE_PRIVATE #ifdef _KERNEL_OPT @@ -280,7 +281,7 @@ static void cache_remove(struct namecache *ncp, bool inreverse) { - KASSERT(mutex_owned(VNODE_TO_VIMPL(ncp->nc_dvp)->vi_nclock)); + KASSERT(rw_write_held(VNODE_TO_VIMPL(ncp->nc_dvp)->vi_nclock)); SDT_PROBE(vfs, namecache, invalidate, done, ncp->nc_dvp, 0, 0, 0, 0); @@ -323,7 +324,7 @@ cache_lookup_entry(struct vnode *dvp, co struct namecache *ncp; struct iovec iov; - KASSERT(mutex_owned(VNODE_TO_VIMPL(dvp)->vi_nclock)); + KASSERT(rw_lock_held(VNODE_TO_VIMPL(dvp)->vi_nclock)); iov.iov_base = __UNCONST(name); iov.iov_len = namelen; @@ -333,7 +334,9 @@ cache_lookup_entry(struct vnode *dvp, co KASSERT(ncp->nc_dvp == dvp); /* * Avoid false sharing: don't write back to nc_hittime - * unless changed significantly. + * unless changed significantly. This is an unlocked + * update and is racy, but it doesn't matter since it's + * only used for pseudo-LRU replacement. */ if (((ncp->nc_hittime ^ hardclock_ticks) & ~31) != 0) { ncp->nc_hittime = hardclock_ticks; @@ -404,9 +407,10 @@ cache_lookup(struct vnode *dvp, const ch { struct namecache *ncp; struct vnode *vp; - kmutex_t *dirlock; + krwlock_t *dirlock; int error; bool hit; + krw_t op; /* Establish default result values */ if (iswht_ret != NULL) { @@ -426,11 +430,19 @@ cache_lookup(struct vnode *dvp, const ch return false; } + /* Could the entry be purged below? */ + if ((cnflags & ISLASTCN) != 0 && + ((cnflags & MAKEENTRY) == 0 || nameiop == CREATE)) { + op = RW_WRITER; + } else { + op = RW_READER; + } + dirlock = VNODE_TO_VIMPL(dvp)->vi_nclock; - mutex_enter(dirlock); + rw_enter(dirlock, op); ncp = cache_lookup_entry(dvp, name, namelen); if (__predict_false(ncp == NULL)) { - mutex_exit(dirlock); + rw_exit(dirlock); /* found nothing */ COUNT(ncs_miss); return false; @@ -442,7 +454,7 @@ cache_lookup(struct vnode *dvp, const ch * want cache entry to exist. */ cache_remove(ncp, false); - mutex_exit(dirlock); + rw_exit(dirlock); /* found nothing */ COUNT(ncs_badhits); return false; @@ -472,12 +484,12 @@ cache_lookup(struct vnode *dvp, const ch } else { KASSERT(!ncp->nc_whiteout); } - mutex_exit(dirlock); + rw_exit(dirlock); return hit; } vp = ncp->nc_vp; mutex_enter(vp->v_interlock); - mutex_exit(dirlock); + rw_exit(dirlock); /* * Unlocked except for the vnode interlock. Call vcache_tryvget(). @@ -513,7 +525,7 @@ cache_lookup_raw(struct vnode *dvp, cons { struct namecache *ncp; struct vnode *vp; - kmutex_t *dirlock; + krwlock_t *dirlock; int error; /* Establish default results. */ @@ -528,16 +540,16 @@ cache_lookup_raw(struct vnode *dvp, cons } dirlock = VNODE_TO_VIMPL(dvp)->vi_nclock; - mutex_enter(dirlock); + rw_enter(dirlock, RW_READER); if (__predict_false(namelen > USHRT_MAX)) { - mutex_exit(dirlock); + rw_exit(dirlock); /* found nothing
CVS commit: src/share/man/man3
Module Name:src Committed By: kamil Date: Mon Jan 13 08:29:05 UTC 2020 Modified Files: src/share/man/man3: dlfcn.3 Log Message: Cross-Link from dlfcn(3) to dlinfo(3) To generate a diff of this commit: cvs rdiff -u -r1.33 -r1.34 src/share/man/man3/dlfcn.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man3/dlfcn.3 diff -u src/share/man/man3/dlfcn.3:1.33 src/share/man/man3/dlfcn.3:1.34 --- src/share/man/man3/dlfcn.3:1.33 Sat Jun 25 12:44:37 2011 +++ src/share/man/man3/dlfcn.3 Mon Jan 13 08:29:05 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: dlfcn.3,v 1.33 2011/06/25 12:44:37 wiz Exp $ +.\" $NetBSD: dlfcn.3,v 1.34 2020/01/13 08:29:05 kamil Exp $ .\" .\" Copyright (c) 1998 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -350,6 +350,7 @@ a module that needs libpthread but isn't .Sh SEE ALSO .Xr ld 1 , .Xr rtld 1 , +.Xr dlinfo 3 , .Xr link 5 .Sh HISTORY Some of the
CVS commit: src
Module Name:src Committed By: kamil Date: Mon Jan 13 08:25:02 UTC 2020 Modified Files: src/distrib/sets/lists/comp: mi src/share/man/man3: Makefile Added Files: src/share/man/man3: dlinfo.3 Log Message: Document dlinfo(3) Man-page taken from FreeBSD. To generate a diff of this commit: cvs rdiff -u -r1.2299 -r1.2300 src/distrib/sets/lists/comp/mi cvs rdiff -u -r1.89 -r1.90 src/share/man/man3/Makefile cvs rdiff -u -r0 -r1.1 src/share/man/man3/dlinfo.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/comp/mi diff -u src/distrib/sets/lists/comp/mi:1.2299 src/distrib/sets/lists/comp/mi:1.2300 --- src/distrib/sets/lists/comp/mi:1.2299 Mon Dec 23 06:45:36 2019 +++ src/distrib/sets/lists/comp/mi Mon Jan 13 08:25:02 2020 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.2299 2019/12/23 06:45:36 maxv Exp $ +# $NetBSD: mi,v 1.2300 2020/01/13 08:25:02 kamil Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. ./etc/mtree/set.compcomp-sys-root @@ -6472,6 +6472,7 @@ ./usr/share/man/cat3/dlctl.0 comp-c-catman .cat ./usr/share/man/cat3/dlerror.0 comp-c-catman .cat ./usr/share/man/cat3/dlfcn.0 comp-c-catman .cat +./usr/share/man/cat3/dlinfo.0 comp-c-catman .cat ./usr/share/man/cat3/dlopen.0 comp-c-catman .cat ./usr/share/man/cat3/dlsym.0 comp-c-catman .cat ./usr/share/man/cat3/dlvsym.0 comp-c-catman .cat @@ -14502,6 +14503,7 @@ ./usr/share/man/html3/dlctl.html comp-c-htmlman html ./usr/share/man/html3/dlerror.html comp-c-htmlman html ./usr/share/man/html3/dlfcn.html comp-c-htmlman html +./usr/share/man/html3/dlinfo.html comp-c-htmlman html ./usr/share/man/html3/dlopen.html comp-c-htmlman html ./usr/share/man/html3/dlsym.html comp-c-htmlman html ./usr/share/man/html3/dlvsym.html comp-c-htmlman html @@ -22466,6 +22468,7 @@ ./usr/share/man/man3/dlctl.3 comp-c-man .man ./usr/share/man/man3/dlerror.3 comp-c-man .man ./usr/share/man/man3/dlfcn.3 comp-c-man .man +./usr/share/man/man3/dlinfo.3 comp-c-man .man ./usr/share/man/man3/dlopen.3 comp-c-man .man ./usr/share/man/man3/dlsym.3 comp-c-man .man ./usr/share/man/man3/dlvsym.3 comp-c-man .man Index: src/share/man/man3/Makefile diff -u src/share/man/man3/Makefile:1.89 src/share/man/man3/Makefile:1.90 --- src/share/man/man3/Makefile:1.89 Sun Nov 10 18:45:09 2019 +++ src/share/man/man3/Makefile Mon Jan 13 08:25:02 2020 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.89 2019/11/10 18:45:09 christos Exp $ +# $NetBSD: Makefile,v 1.90 2020/01/13 08:25:02 kamil Exp $ # @(#)Makefile 8.2 (Berkeley) 12/13/93 MAN= _DIAGASSERT.3 __CONCAT.3 __FPTRCAST.3 __UNCONST.3 __USE.3 CMSG_DATA.3 \ @@ -7,7 +7,7 @@ MAN= _DIAGASSERT.3 __CONCAT.3 __FPTRCAST __builtin_return_address.3 \ __builtin_types_compatible_p.3 __insn_barrier.3 \ assert.3 attribute.3 bitmap.3 bitops.3 bits.3 bitstring.3 \ - cdefs.3 dirent.3 dlfcn.3 dl_iterate_phdr.3 end.3 \ + cdefs.3 dirent.3 dlfcn.3 dlinfo.3 dl_iterate_phdr.3 end.3 \ fast_divide32.3 ffs32.3 gcq.3 \ ilog2.3 intro.3 inttypes.3 iso646.3 limits.3 \ makedev.3 offsetof.3 param.3 paths.3 queue.3 rbtree.3 sigevent.3 \ Added files: Index: src/share/man/man3/dlinfo.3 diff -u /dev/null src/share/man/man3/dlinfo.3:1.1 --- /dev/null Mon Jan 13 08:25:02 2020 +++ src/share/man/man3/dlinfo.3 Mon Jan 13 08:25:02 2020 @@ -0,0 +1,283 @@ +.\" $NetBSD: dlinfo.3,v 1.1 2020/01/13 08:25:02 kamil Exp $ +.\" +.\" Copyright (c) 2003 Alexey Zelkin +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\"notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\"notice, this list of conditions and the following disclaimer in the +.\"documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: head/lib/libc/gen/dlinfo.3 267774 2014-06-