From owner-svn-src-all@freebsd.org Sun Feb 2 04:52:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F0258239275; Sun, 2 Feb 2020 04:52:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 489JV467fMz4VLB; Sun, 2 Feb 2020 04:52:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CDF6FA8E6; Sun, 2 Feb 2020 04:52:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0124qSbi052144; Sun, 2 Feb 2020 04:52:28 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0124qSJ2052141; Sun, 2 Feb 2020 04:52:28 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202002020452.0124qSJ2052141@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 2 Feb 2020 04:52:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357393 - in head: share/man/man4 sys/dev/ppbus X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: share/man/man4 sys/dev/ppbus X-SVN-Commit-Revision: 357393 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2020 04:52:29 -0000 Author: imp Date: Sun Feb 2 04:52:28 2020 New Revision: 357393 URL: https://svnweb.freebsd.org/changeset/base/357393 Log: Add deprecation notice to vpo.4 This driver has seen no real changes for almost 20 years. It's for hardware that's 25 years old. It has no reports of active use, nor has it been seen in the NYCBug dmesg database at all. Schedule its removal for 13.0. Reviewed by: rgrimes@ (earlier version) Relnote: Yes MFC After: 3 days Differential Revision: https://reviews.freebsd.org/D23403 Modified: head/share/man/man4/vpo.4 head/sys/dev/ppbus/vpo.c Modified: head/share/man/man4/vpo.4 ============================================================================== --- head/share/man/man4/vpo.4 Sat Feb 1 23:46:30 2020 (r357392) +++ head/share/man/man4/vpo.4 Sun Feb 2 04:52:28 2020 (r357393) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 14, 2004 +.Dd December 21, 2019 .Dt VPO 4 .Os .Sh NAME @@ -39,6 +39,12 @@ For one or more SCSI busses: The .Nm driver provide access to parallel port Iomega Zip and Jaz drives. +.Sh DEPRECATED +The +.Nm +driver is now deprecated. +It will be removed in +.Fx 13.0 . .Sh HARDWARE The .Nm Modified: head/sys/dev/ppbus/vpo.c ============================================================================== --- head/sys/dev/ppbus/vpo.c Sat Feb 1 23:46:30 2020 (r357392) +++ head/sys/dev/ppbus/vpo.c Sun Feb 2 04:52:28 2020 (r357393) @@ -126,6 +126,7 @@ vpo_probe(device_t dev) return (error); } ppb_unlock(ppbus); + gone_in_dev(dev, 13, "Hardware no longer relevant"); return (0); } From owner-svn-src-all@freebsd.org Sun Feb 2 04:53:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A5671239336; Sun, 2 Feb 2020 04:53:29 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 489JWF3y7Nz4VTm; Sun, 2 Feb 2020 04:53:29 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 82E8DA8FB; Sun, 2 Feb 2020 04:53:29 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0124rTWO052376; Sun, 2 Feb 2020 04:53:29 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0124rRIo052363; Sun, 2 Feb 2020 04:53:27 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202002020453.0124rRIo052363@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 2 Feb 2020 04:53:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357394 - in head: . share/man/man4 share/man/man9 sys/conf sys/dev/ppbus sys/modules sys/modules/vpo X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: . share/man/man4 share/man/man9 sys/conf sys/dev/ppbus sys/modules sys/modules/vpo X-SVN-Commit-Revision: 357394 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2020 04:53:29 -0000 Author: imp Date: Sun Feb 2 04:53:27 2020 New Revision: 357394 URL: https://svnweb.freebsd.org/changeset/base/357394 Log: Remove vpo.4 The Parallel Port SCSI adapter was interesting for 100MB ZIP drives, but is no longer used or maintained. Remove it from the tree. The Parallel Port microsequencer (microseq.9) is now mostly unused in the tree, but remains. PPI still refrences it, but doesn't use its full functionality. Relnotes: Yes Reviewed by: rgrimes@, Ihor Antonov Discussed on: arch@ Differential Revision: https://reviews.freebsd.org/D23389 Deleted: head/share/man/man4/vpo.4 head/sys/dev/ppbus/immio.c head/sys/dev/ppbus/vpo.c head/sys/dev/ppbus/vpoio.c head/sys/dev/ppbus/vpoio.h head/sys/modules/vpo/Makefile Modified: head/ObsoleteFiles.inc head/share/man/man4/Makefile head/share/man/man4/ppbus.4 head/share/man/man9/microseq.9 head/sys/conf/NOTES head/sys/conf/files head/sys/conf/options head/sys/modules/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sun Feb 2 04:52:28 2020 (r357393) +++ head/ObsoleteFiles.inc Sun Feb 2 04:53:27 2020 (r357394) @@ -36,6 +36,10 @@ # xargs -n1 | sort | uniq -d; # done +# 20200127: vpo removed +OLD_FILES+=usr/share/man/man4/imm.4.gz +OLD_FILES+=usr/share/man/man4/vpo.4.gz + # 20200104: gcc libssp removed OLD_FILES+=usr/include/ssp/ssp.h OLD_FILES+=usr/include/ssp/stdio.h Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Sun Feb 2 04:52:28 2020 (r357393) +++ head/share/man/man4/Makefile Sun Feb 2 04:53:27 2020 (r357394) @@ -553,7 +553,6 @@ MAN= aac.4 \ ${_vmd.4} \ ${_vmm.4} \ ${_vmx.4} \ - vpo.4 \ vr.4 \ vt.4 \ vte.4 \ @@ -740,7 +739,6 @@ MLINKS+=vge.4 if_vge.4 MLINKS+=vlan.4 if_vlan.4 MLINKS+=vxlan.4 if_vxlan.4 MLINKS+=${_vmx.4} ${_if_vmx.4} -MLINKS+=vpo.4 imm.4 MLINKS+=vr.4 if_vr.4 MLINKS+=vte.4 if_vte.4 MLINKS+=${_vtnet.4} ${_if_vtnet.4} Modified: head/share/man/man4/ppbus.4 ============================================================================== --- head/share/man/man4/ppbus.4 Sun Feb 2 04:52:28 2020 (r357393) +++ head/share/man/man4/ppbus.4 Sun Feb 2 04:53:27 2020 (r357394) @@ -33,8 +33,6 @@ .Sh SYNOPSIS .Cd "device ppbus" .Pp -.Cd "device vpo" -.Pp .Cd "device lpt" .Cd "device plip" .Cd "device ppi" @@ -66,8 +64,6 @@ and non-standard software: .Pp .Bl -column "Driver" -compact .It Em Driver Ta Em Description -.It Sy vpo Ta "VPI0 parallel to Adaptec AIC-7110 SCSI controller driver" . -It uses standard and non-standard parallel port accesses. .It Sy ppi Ta "Parallel port interface for general I/O" .It Sy pps Ta "Pulse per second Timing Interface" .It Sy lpbb Ta "Philips official parallel port I2C bit-banging interface" @@ -336,22 +332,11 @@ operation (opcodes are described in .Xr microseq 9 ) . Standard I/O operations are implemented at ppbus level whereas basic I/O operations and microseq language are coded at adapter level for efficiency. -.Pp -As an example, the -.Xr vpo 4 -driver uses microsequences to implement: -.Bl -bullet -offset indent -.It -a modified version of the NIBBLE transfer mode -.It -various I/O sequences to initialize, select and allocate the peripheral -.El .Sh SEE ALSO .Xr lpt 4 , .Xr plip 4 , .Xr ppc 4 , .Xr ppi 4 , -.Xr vpo 4 .Sh HISTORY The .Nm Modified: head/share/man/man9/microseq.9 ============================================================================== --- head/share/man/man9/microseq.9 Sun Feb 2 04:52:28 2020 (r357393) +++ head/share/man/man9/microseq.9 Sun Feb 2 04:53:27 2020 (r357394) @@ -51,7 +51,7 @@ efficient code Before using microsequences, you are encouraged to look at .Xr ppc 4 microsequencer implementation and an example of how using it in -.Xr vpo 4 . +.Xr ppi 4 . .Sh PPBUS register model .Ss Background The parallel port model chosen for ppbus is the PC parallel port model. @@ -477,7 +477,7 @@ executed at ppbus layer. .Sh SEE ALSO .Xr ppbus 4 , .Xr ppc 4 , -.Xr vpo 4 +.Xr ppi 4 .Sh HISTORY The .Nm Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Sun Feb 2 04:52:28 2020 (r357393) +++ head/sys/conf/NOTES Sun Feb 2 04:53:27 2020 (r357394) @@ -2358,9 +2358,6 @@ device syr827 # Silergy Corp. DC/DC regulator # are automatically probed and attached when found. # # Supported devices: -# vpo Iomega Zip Drive -# Requires SCSI disk support ('scbus' and 'da'), best -# performance is achieved with ports in EPP 1.9 mode. # lpt Parallel Printer # plip Parallel network interface # ppi General-purpose I/O ("Geek Port") + IEEE1284 I/O @@ -2378,7 +2375,6 @@ options DEBUG_1284 # IEEE1284 signaling protocol debu options PERIPH_1284 # Makes your computer act as an IEEE1284 # compliant peripheral options DONTPROBE_1284 # Avoid boot detection of PnP parallel devices -options VP0_DEBUG # ZIP/ZIP+ debug options LPT_DEBUG # Printer driver debug options PPC_DEBUG # Parallel chipset level debug options PLIP_DEBUG # Parallel network IP interface debug @@ -2389,7 +2385,6 @@ device ppc hint.ppc.0.at="isa" hint.ppc.0.irq="7" device ppbus -device vpo device lpt device plip device ppi Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Feb 2 04:52:28 2020 (r357393) +++ head/sys/conf/files Sun Feb 2 04:53:27 2020 (r357394) @@ -2672,7 +2672,6 @@ dev/pms/RefTisa/tisa/sassata/sata/host/ossasat.c optio dev/pms/RefTisa/tisa/sassata/sata/host/sathw.c optional pmspcv \ compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w" dev/ppbus/if_plip.c optional plip -dev/ppbus/immio.c optional vpo dev/ppbus/lpbb.c optional lpbb dev/ppbus/lpt.c optional lpt dev/ppbus/pcfclock.c optional pcfclock @@ -2683,8 +2682,6 @@ dev/ppbus/ppbconf.c optional ppbus dev/ppbus/ppbus_if.m optional ppbus dev/ppbus/ppi.c optional ppi dev/ppbus/pps.c optional pps -dev/ppbus/vpo.c optional vpo -dev/ppbus/vpoio.c optional vpo dev/ppc/ppc.c optional ppc dev/ppc/ppc_acpi.c optional ppc acpi dev/ppc/ppc_isa.c optional ppc isa Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Sun Feb 2 04:52:28 2020 (r357393) +++ head/sys/conf/options Sun Feb 2 04:53:27 2020 (r357394) @@ -569,7 +569,6 @@ TI_JUMBO_HDRSPLIT opt_ti.h # with 'make CC="cc -DDEBUG"'. CLUSTERDEBUG opt_debug_cluster.h DEBUG_1284 opt_ppb_1284.h -VP0_DEBUG opt_vpo.h LPT_DEBUG opt_lpt.h PLIP_DEBUG opt_plip.h LOCKF_DEBUG opt_debug_lockf.h Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Sun Feb 2 04:52:28 2020 (r357393) +++ head/sys/modules/Makefile Sun Feb 2 04:53:27 2020 (r357394) @@ -372,7 +372,6 @@ SUBDIR= \ ${_vmd} \ ${_vmm} \ ${_vmware} \ - ${_vpo} \ vr \ vte \ ${_wbwd} \ @@ -558,7 +557,6 @@ _hwpmc_mips74k= hwpmc_mips74k ${MACHINE_CPUARCH} != "mips" && ${MACHINE_CPUARCH} != "powerpc" && \ ${MACHINE_CPUARCH} != "riscv" _syscons= syscons -_vpo= vpo .endif .if ${MACHINE_CPUARCH} != "mips" From owner-svn-src-all@freebsd.org Sun Feb 2 06:51:42 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BDA0823AFA6; Sun, 2 Feb 2020 06:51:42 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 489M7f4h3Hz4ZWZ; Sun, 2 Feb 2020 06:51:42 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9BF14BEFD; Sun, 2 Feb 2020 06:51:42 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0126pgjH024152; Sun, 2 Feb 2020 06:51:42 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0126pgkF024151; Sun, 2 Feb 2020 06:51:42 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202002020651.0126pgkF024151@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 2 Feb 2020 06:51:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357395 - in head/sys/arm: conf ralink X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/arm: conf ralink X-SVN-Commit-Revision: 357395 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2020 06:51:42 -0000 Author: imp Date: Sun Feb 2 06:51:42 2020 New Revision: 357395 URL: https://svnweb.freebsd.org/changeset/base/357395 Log: Remove Ralink RT1310 support This armv5 SoC is being removed consistent with the removal of armv5 support, per discussions in arm@ mailing list. Deleted: head/sys/arm/conf/RT1310 head/sys/arm/ralink/files.ralink head/sys/arm/ralink/if_fv.c head/sys/arm/ralink/if_fvreg.h head/sys/arm/ralink/rt1310_gpio.c head/sys/arm/ralink/rt1310_intc.c head/sys/arm/ralink/rt1310_machdep.c head/sys/arm/ralink/rt1310_timer.c head/sys/arm/ralink/rt1310reg.h head/sys/arm/ralink/rt1310var.h head/sys/arm/ralink/std.ralink From owner-svn-src-all@freebsd.org Sun Feb 2 06:52:05 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2759323B123; Sun, 2 Feb 2020 06:52:05 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 489M8502xKz4Zmq; Sun, 2 Feb 2020 06:52:05 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F0E81BF13; Sun, 2 Feb 2020 06:52:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0126q4ZA024221; Sun, 2 Feb 2020 06:52:04 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0126q4SQ024220; Sun, 2 Feb 2020 06:52:04 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202002020652.0126q4SQ024220@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 2 Feb 2020 06:52:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357396 - in head/sys/arm: conf mv mv/discovery mv/kirkwood mv/orion X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/arm: conf mv mv/discovery mv/kirkwood mv/orion X-SVN-Commit-Revision: 357396 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2020 06:52:05 -0000 Author: imp Date: Sun Feb 2 06:52:04 2020 New Revision: 357396 URL: https://svnweb.freebsd.org/changeset/base/357396 Log: Remove armv5 marvell support. Per plans to remove armv5 support, remove the armv5 marvell discovery, kirkwood and orion families. Deleted: head/sys/arm/conf/DB-78XXX head/sys/arm/conf/DB-88F5XXX head/sys/arm/conf/DB-88F6XXX head/sys/arm/conf/DOCKSTAR head/sys/arm/conf/DREAMPLUG-1001 head/sys/arm/conf/SHEEVAPLUG head/sys/arm/conf/TS7800 head/sys/arm/conf/std.arm head/sys/arm/mv/armv5_machdep.c head/sys/arm/mv/discovery/discovery.c head/sys/arm/mv/discovery/files.db78xxx head/sys/arm/mv/discovery/std.db78xxx head/sys/arm/mv/files.mv head/sys/arm/mv/kirkwood/files.kirkwood head/sys/arm/mv/kirkwood/kirkwood.c head/sys/arm/mv/kirkwood/std.db88f6xxx head/sys/arm/mv/kirkwood/std.kirkwood head/sys/arm/mv/orion/db88f5xxx.c head/sys/arm/mv/orion/files.db88f5xxx head/sys/arm/mv/orion/files.ts7800 head/sys/arm/mv/orion/orion.c head/sys/arm/mv/orion/std.db88f5xxx head/sys/arm/mv/orion/std.ts7800 From owner-svn-src-all@freebsd.org Sun Feb 2 06:52:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 19BDE23B158; Sun, 2 Feb 2020 06:52:12 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 489M8C5hJ8z4ZsP; Sun, 2 Feb 2020 06:52:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3EAFABF1D; Sun, 2 Feb 2020 06:52:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0126qAaS024277; Sun, 2 Feb 2020 06:52:10 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0126qALO024276; Sun, 2 Feb 2020 06:52:10 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202002020652.0126qALO024276@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 2 Feb 2020 06:52:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357397 - in head/sys: arm/conf arm/include conf X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: arm/conf arm/include conf X-SVN-Commit-Revision: 357397 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2020 06:52:12 -0000 Author: imp Date: Sun Feb 2 06:52:10 2020 New Revision: 357397 URL: https://svnweb.freebsd.org/changeset/base/357397 Log: Remove old boardid/mach-types support. This has been long obsolete in linux and now that all armv4/5 support is gone, it can be retired too. Deleted: head/sys/arm/conf/genboardid.awk head/sys/arm/conf/mach-types head/sys/arm/include/board.h Modified: head/sys/conf/files.arm Modified: head/sys/conf/files.arm ============================================================================== --- head/sys/conf/files.arm Sun Feb 2 06:52:04 2020 (r357396) +++ head/sys/conf/files.arm Sun Feb 2 06:52:10 2020 (r357397) @@ -89,11 +89,6 @@ arm/arm/unwind.c optional ddb | kdtrace_hooks | stack arm/arm/vm_machdep.c standard arm/arm/vfp.c standard arm/cloudabi32/cloudabi32_sysvec.c optional compat_cloudabi32 -board_id.h standard \ - dependency "$S/arm/conf/genboardid.awk $S/arm/conf/mach-types" \ - compile-with "${AWK} -f $S/arm/conf/genboardid.awk $S/arm/conf/mach-types > board_id.h" \ - no-obj no-implicit-rule before-depend \ - clean "board_id.h" cddl/compat/opensolaris/kern/opensolaris_atomic.c optional !armv7 !armv6 zfs | !armv7 !armv6 dtrace compile-with "${CDDL_C}" cddl/dev/dtrace/arm/dtrace_asm.S optional dtrace compile-with "${DTRACE_S}" cddl/dev/dtrace/arm/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}" From owner-svn-src-all@freebsd.org Sun Feb 2 06:57:51 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0CB6F23B34D; Sun, 2 Feb 2020 06:57:51 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: from mail-qk1-f193.google.com (mail-qk1-f193.google.com [209.85.222.193]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 489MGj4w5vz4b8P; Sun, 2 Feb 2020 06:57:49 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: by mail-qk1-f193.google.com with SMTP id v195so11037670qkb.11; Sat, 01 Feb 2020 22:57:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fbnZ63uPcrupvcoPQU74+Pienaqx6Qv/CdK4wnUsl2A=; b=QwuTim7CEKu4Oq3aFpnaxUUNOdx9lF0xflaGZwALU8KbP6P9aZdxQPDXhvQ/rbLMjb O4TCudP3hdcA02iSA1QjZcnIZl10ryLtc9f1nhYMtN0gy7hwu54AHQ66LJj/z4T8p6lW JluNoLjgLzlCsIN8wwYxq6lR4J386qCV7/Fb3zXa84BxU8m8MfcXwOyYoJy4u7QuL1h3 IvxyVFYaGW1h/dCGj69T7GeOMxGaj9bPIdUMLFgguXw6cMwkZLtndbSKzK4lExd5ViLe ecY7QAHamLXPdXI1XEXgDLXbICLlbEwmC+fgwIMynj9KSxVLAB/thBDndHliztV/V/Qg o1tQ== X-Gm-Message-State: APjAAAWGUFOPZhJth2ICDnS5MJa0MylnaZ1b1s/l2c8ctV1CzVjDLZoD tW2D2jp8Cpo2Hb44gkZFfvjM+2gLkdLC8bnmFdOAzljA X-Google-Smtp-Source: APXvYqy0IxXnhUYH98ZCd27fmiMk4URVM9sSFCkwuk3gd+EylLa3vnMZBsoezVKWGU4YmihSFu0vFtyGy/SHhFC3U1s= X-Received: by 2002:a37:6897:: with SMTP id d145mr18409074qkc.398.1580626668223; Sat, 01 Feb 2020 22:57:48 -0800 (PST) MIME-Version: 1.0 References: <202001300331.00U3VGCe017289@repo.freebsd.org> In-Reply-To: <202001300331.00U3VGCe017289@repo.freebsd.org> From: Antoine Brodin Date: Sun, 2 Feb 2020 07:57:36 +0100 Message-ID: Subject: Re: svn commit: r357284 - in head: include lib/libc/stdio To: Kyle Evans Cc: src-committers , svn-src-all , svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 489MGj4w5vz4b8P X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of antoinebrodinfreebsd@gmail.com designates 209.85.222.193 as permitted sender) smtp.mailfrom=antoinebrodinfreebsd@gmail.com X-Spamd-Result: default: False [-4.15 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_NEQ_ENVFROM(0.00)[antoine@freebsd.org,antoinebrodinfreebsd@gmail.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; RCVD_TLS_ALL(0.00)[]; IP_SCORE(-2.15)[ip: (-5.91), ipnet: 209.85.128.0/17(-3.04), asn: 15169(-1.76), country: US(-0.05)]; RCVD_IN_DNSWL_NONE(0.00)[193.222.85.209.list.dnswl.org : 127.0.5.0]; FORGED_SENDER(0.30)[antoine@freebsd.org,antoinebrodinfreebsd@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[193.222.85.209.rep.mailspike.net : 127.0.0.17]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2020 06:57:51 -0000 On Thu, Jan 30, 2020 at 4:31 AM Kyle Evans wrote: > > Author: kevans > Date: Thu Jan 30 03:31:16 2020 > New Revision: 357284 > URL: https://svnweb.freebsd.org/changeset/base/357284 > > Log: > stdio: provide _unlocked variants of fflush, fputc, fputs, fread, fwrite > > fflush_unlocked is currently desired in ports by sysutils/metalog, and > redefined as the locked fflush. > > fputc_unlocked, fputs_unlocked, fread_unlocked, and fwrite_unlocked are > currently desired in ports by devel/elfutils, and redefined as the locked > fputs, fread, and fwrite respectively. > > Reviewed by: kib > MFC after: 2 weeks > Differential Revision: https://reviews.freebsd.org/D23336 Hi, It seems that this change broke lang/gcc* ports. Antoine From owner-svn-src-all@freebsd.org Sun Feb 2 08:27:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AD01923D190; Sun, 2 Feb 2020 08:27:09 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 489PFn4C4Cz4gFW; Sun, 2 Feb 2020 08:27:09 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8B558D0B8; Sun, 2 Feb 2020 08:27:09 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0128R9G6079820; Sun, 2 Feb 2020 08:27:09 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0128R98w079819; Sun, 2 Feb 2020 08:27:09 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202002020827.0128R98w079819@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 2 Feb 2020 08:27:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357398 - in head/sys: arm/conf conf X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: arm/conf conf X-SVN-Commit-Revision: 357398 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2020 08:27:09 -0000 Author: imp Date: Sun Feb 2 08:27:08 2020 New Revision: 357398 URL: https://svnweb.freebsd.org/changeset/base/357398 Log: Move arm back to having one LINT Now that armv5 is gone, we no longer need multiple LINT files. Kill the odd-ball support here. From now on, we just have LINT built from notes like all the other platforms. Keep the removal of LINT-V5/7 to remove stale files for a while still.. Deleted: head/sys/arm/conf/NOTES.armv7 Modified: head/sys/arm/conf/NOTES head/sys/conf/makeLINT.mk Modified: head/sys/arm/conf/NOTES ============================================================================== --- head/sys/arm/conf/NOTES Sun Feb 2 06:52:10 2020 (r357397) +++ head/sys/arm/conf/NOTES Sun Feb 2 08:27:08 2020 (r357398) @@ -1,7 +1,50 @@ +# arm-specific changes for doing a LINT build. # $FreeBSD$ -options FDT +machine arm armv7 +cpu CPU_CORTEXA +cpu CPU_MV_PJ4B +makeoptions CONF_CFLAGS+="-march=armv7a" + +# Add options for armv7 that are not in sys/conf/NOTES... + +options ARM_L2_PIPT # Only L2 PIPT is supported +options FDT # Flattened device tree support +options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) +options INTRNG # Include INTRNG framework +options LINUX_BOOT_ABI # Process metadata passed from U-Boot +options PLATFORM # Include platform_if support +options SMP # Nearly all v7 SoCs are multicore +options VFP # Enable floating point hardware support + +# NOTE: dtrace introduces CDDL-licensed components into the kernel +device dtrace # dtrace core +device dtraceall # include all dtrace modules +options KDTRACE_HOOKS + +# Add misc devices which are specific to various arm platforms... + +device generic_timer # ARM Generic Timer +device gic # Interrupt controller +device gpio # gpio interface and bus +device mpcore_timer # ARM MPCore Timer +device pl310 # PL310 L2 cache controller +device pl330 # ARM PL330 dma controller +device pmu # PMU support (for CCNT). +device twsi # i2c controller on Marvel and Allwinner +device xdma # xDMA framework for SoC on-chip dma controllers + +# Add EXT_RESOURCES pseudo devices... + +options EXT_RESOURCES +device clk +device phy +device hwreset +device nvmem +device regulator +device syscon + # Undo options from sys/conf/NOTES that we do not want... nooptions COMPAT_FREEBSD4 @@ -12,9 +55,6 @@ nooptions COMPAT_FREEBSD9 nooptions PPC_PROBE_CHIPSET nooptions MAXCPU # value is set in machine/param.h -# Devices in sys/conf/NOTES for which no such hardware exists on arm, -# or the drivers don't compile... - nodevice sym nodevice ccr @@ -25,10 +65,18 @@ nodevice snd_cmi nodevice mpr nodevice mps -# Add devices which are specific to various arm platforms... +# Build SOC-specific modules... -device twsi # i2c controller on Marvel and Allwinner +makeoptions MODULES_EXTRA+="allwinner" +makeoptions MODULES_EXTRA+="arm_ti" +makeoptions MODULES_EXTRA+="imx" -device pl330 # ARM PL330 dma controller -device xdma # xDMA framework for SoC on-chip dma controllers +# Build dtb files... +makeoptions MODULES_EXTRA+="dtb/allwinner" +makeoptions MODULES_EXTRA+="dtb/am335x" +makeoptions MODULES_EXTRA+="dtb/imx6" +makeoptions MODULES_EXTRA+="dtb/nvidia" +makeoptions MODULES_EXTRA+="dtb/omap4" +makeoptions MODULES_EXTRA+="dtb/rpi" +makeoptions MODULES_EXTRA+="dtb/zynq" Modified: head/sys/conf/makeLINT.mk ============================================================================== --- head/sys/conf/makeLINT.mk Sun Feb 2 06:52:10 2020 (r357397) +++ head/sys/conf/makeLINT.mk Sun Feb 2 08:27:08 2020 (r357398) @@ -13,7 +13,8 @@ clean: .endif .if ${TARGET} == "arm" # LINT-V5 removed 2019-11-26. The clean rule is left here temporarily - # to avoid having stale copies left behind. + # to avoid having stale copies left behind. LINT-V7 left the tree on + # 2020-02-02. rm -f LINT-V5 LINT-V7 .endif .if ${TARGET} == "powerpc" @@ -54,11 +55,6 @@ LINT: ${NOTES} ${MAKELINT_SED} echo "nodevice sk" >> ${.TARGET}-NOIP echo "nodevice txp" >> ${.TARGET}-NOIP echo "nodevice netmap" >> ${.TARGET}-NOIP -.endif -.if ${TARGET} == "arm" - cat ${NOTES} ${.CURDIR}/NOTES.armv7 | sed -E -n -f ${MAKELINT_SED} > \ - ${.TARGET}-V7 - rm ${.TARGET} .endif .if ${TARGET} == "mips" echo "machine ${TARGET} ${TARGET_ARCH}" >> ${.TARGET} From owner-svn-src-all@freebsd.org Sun Feb 2 08:27:15 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C954223D1BD; Sun, 2 Feb 2020 08:27:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 489PFv54nlz3BmV; Sun, 2 Feb 2020 08:27:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A8AD8D0B9; Sun, 2 Feb 2020 08:27:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0128RFfl079876; Sun, 2 Feb 2020 08:27:15 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0128RFo5079874; Sun, 2 Feb 2020 08:27:15 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202002020827.0128RFo5079874@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 2 Feb 2020 08:27:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357399 - in head/sys: arm/arm conf X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: arm/arm conf X-SVN-Commit-Revision: 357399 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2020 08:27:15 -0000 Author: imp Date: Sun Feb 2 08:27:14 2020 New Revision: 357399 URL: https://svnweb.freebsd.org/changeset/base/357399 Log: Kill old armv4 busdma Move to having one busdma option for arm: the armv6/v7 one. Kill now-unused option ARM_USE_V6_BUSDMA too. Fixup files.arm to match rename. Added: head/sys/arm/arm/busdma_machdep.c (contents, props changed) - copied, changed from r357398, head/sys/arm/arm/busdma_machdep-v6.c Deleted: head/sys/arm/arm/busdma_machdep-v4.c head/sys/arm/arm/busdma_machdep-v6.c Modified: head/sys/conf/files.arm head/sys/conf/options.arm Copied and modified: head/sys/arm/arm/busdma_machdep.c (from r357398, head/sys/arm/arm/busdma_machdep-v6.c) ============================================================================== Modified: head/sys/conf/files.arm ============================================================================== --- head/sys/conf/files.arm Sun Feb 2 08:27:08 2020 (r357398) +++ head/sys/conf/files.arm Sun Feb 2 08:27:14 2020 (r357399) @@ -9,8 +9,7 @@ arm/arm/blockio.S standard arm/arm/bus_space_asm_generic.S standard arm/arm/bus_space_base.c optional fdt arm/arm/bus_space_generic.c standard -arm/arm/busdma_machdep-v4.c optional !armv7 !armv6 !ARM_USE_V6_BUSDMA -arm/arm/busdma_machdep-v6.c optional armv7 | armv6 | ARM_USE_V6_BUSDMA +arm/arm/busdma_machdep.c standard arm/arm/copystr.S standard arm/arm/cpufunc.c standard arm/arm/cpufunc_asm.S standard Modified: head/sys/conf/options.arm ============================================================================== --- head/sys/conf/options.arm Sun Feb 2 08:27:08 2020 (r357398) +++ head/sys/conf/options.arm Sun Feb 2 08:27:14 2020 (r357399) @@ -5,7 +5,6 @@ ARM_CACHE_LOCK_ENABLE opt_global.h ARM_KERN_DIRECTMAP opt_vm.h ARM_L2_PIPT opt_global.h ARM_MANY_BOARD opt_global.h -ARM_USE_V6_BUSDMA opt_global.h ARM_WANT_TP_ADDRESS opt_global.h COUNTS_PER_SEC opt_timer.h CPSW_ETHERSWITCH opt_cpsw.h From owner-svn-src-all@freebsd.org Sun Feb 2 08:27:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 89B3623D202; Sun, 2 Feb 2020 08:27:22 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 489PG22pMzz3Btm; Sun, 2 Feb 2020 08:27:22 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3BDFED0BB; Sun, 2 Feb 2020 08:27:22 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0128RMn7080038; Sun, 2 Feb 2020 08:27:22 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0128RLcl079945; Sun, 2 Feb 2020 08:27:21 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202002020827.0128RLcl079945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 2 Feb 2020 08:27:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357400 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 357400 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2020 08:27:22 -0000 Author: imp Date: Sun Feb 2 08:27:20 2020 New Revision: 357400 URL: https://svnweb.freebsd.org/changeset/base/357400 Log: Fix old-style build Fix the old-style build by using ${SRCTOP} instead of a weird construct that only works for new-style build. Simplify the building of keymap files by using macros Move atkbdmap.h in files.x86 This has been broken since r296899 which removed the implicit dependency on /usr/share. Modified: head/sys/conf/files head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/conf/files.x86 head/sys/conf/kern.pre.mk Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Feb 2 08:27:14 2020 (r357399) +++ head/sys/conf/files Sun Feb 2 08:27:20 2020 (r357400) @@ -50,7 +50,7 @@ pccarddevs.h standard \ no-obj no-implicit-rule before-depend \ clean "pccarddevs.h" kbdmuxmap.h optional kbdmux_dflt_keymap \ - compile-with "kbdcontrol -P ${S:S/sys$/share/}/vt/keymaps -P ${S:S/sys$/share/}/syscons/keymaps -L ${KBDMUX_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > kbdmuxmap.h" \ + compile-with "${KEYMAP} -L ${KBDMUX_DFLT_KEYMAP} | ${KEYMAP_FIX} > ${.TARGET}" \ no-obj no-implicit-rule before-depend \ clean "kbdmuxmap.h" teken_state.h optional sc | vt \ @@ -59,7 +59,7 @@ teken_state.h optional sc | vt \ no-obj no-implicit-rule before-depend \ clean "teken_state.h" ukbdmap.h optional ukbd_dflt_keymap \ - compile-with "kbdcontrol -P ${S:S/sys$/share/}/vt/keymaps -P ${S:S/sys$/share/}/syscons/keymaps -L ${UKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > ukbdmap.h" \ + compile-with "${KEYMAP} -L ${UKBD_DFLT_KEYMAP} | ${KEYMAP_FIX} > ${.TARGET}" \ no-obj no-implicit-rule before-depend \ clean "ukbdmap.h" usbdevs.h optional usb \ Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Sun Feb 2 08:27:14 2020 (r357399) +++ head/sys/conf/files.amd64 Sun Feb 2 08:27:20 2020 (r357400) @@ -77,11 +77,6 @@ font.h optional sc_dflt_font \ no-obj no-implicit-rule before-depend \ clean "font.h ${SC_DFLT_FONT}-8x14 ${SC_DFLT_FONT}-8x16 ${SC_DFLT_FONT}-8x8" # -atkbdmap.h optional atkbd_dflt_keymap \ - compile-with "kbdcontrol -P ${S:S/sys$/share/}/vt/keymaps -P ${S:S/sys$/share/}/syscons/keymaps -L ${ATKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > atkbdmap.h" \ - no-obj no-implicit-rule before-depend \ - clean "atkbdmap.h" -# amd64/acpica/acpi_machdep.c optional acpi acpi_wakecode.o optional acpi \ dependency "$S/amd64/acpica/acpi_wakecode.S assym.inc" \ Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Sun Feb 2 08:27:14 2020 (r357399) +++ head/sys/conf/files.i386 Sun Feb 2 08:27:20 2020 (r357400) @@ -52,11 +52,6 @@ font.h optional sc_dflt_font \ no-obj no-implicit-rule before-depend \ clean "font.h ${SC_DFLT_FONT}-8x14 ${SC_DFLT_FONT}-8x16 ${SC_DFLT_FONT}-8x8" # -atkbdmap.h optional atkbd_dflt_keymap \ - compile-with "kbdcontrol -P ${S:S/sys$/share/}/vt/keymaps -P ${S:S/sys$/share/}/syscons/keymaps -L ${ATKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > atkbdmap.h" \ - no-obj no-implicit-rule before-depend \ - clean "atkbdmap.h" -# cddl/contrib/opensolaris/common/atomic/i386/opensolaris_atomic.S optional zfs | dtrace compile-with "${ZFS_S}" cddl/dev/dtrace/i386/dtrace_asm.S optional dtrace compile-with "${DTRACE_S}" cddl/dev/dtrace/i386/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}" Modified: head/sys/conf/files.x86 ============================================================================== --- head/sys/conf/files.x86 Sun Feb 2 08:27:14 2020 (r357399) +++ head/sys/conf/files.x86 Sun Feb 2 08:27:20 2020 (r357400) @@ -12,6 +12,11 @@ # limitations in config: backslash-newline doesn't work in strings, and # dependency lines other than the first are silently ignored. +# +atkbdmap.h optional atkbd_dflt_keymap \ + compile-with "${KEYMAP} -L ${ATKBD_DFLT_KEYMAP} | ${KEYMAP_FIX} > ${.TARGET}" \ + no-obj no-implicit-rule before-depend \ + clean "atkbdmap.h" cddl/dev/fbt/x86/fbt_isa.c optional dtrace_fbt | dtraceall compile-with "${FBT_C}" cddl/dev/dtrace/x86/dis_tables.c optional dtrace_fbt | dtraceall compile-with "${DTRACE_C}" cddl/dev/dtrace/x86/instr_size.c optional dtrace_fbt | dtraceall compile-with "${DTRACE_C}" Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Sun Feb 2 08:27:14 2020 (r357399) +++ head/sys/conf/kern.pre.mk Sun Feb 2 08:27:20 2020 (r357400) @@ -271,6 +271,9 @@ SYSTEM_OBJS= locore.o ${MDOBJS} ${OBJS} SYSTEM_OBJS+= ${SYSTEM_CFILES:.c=.o} SYSTEM_OBJS+= hack.pico +KEYMAP=kbdcontrol -P ${SRCTOP}/share/vt/keymaps -P ${SRCTOP}/share/syscons/keymaps +KEYMAP_FIX=sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' + MD_ROOT_SIZE_CONFIGURED!= grep MD_ROOT_SIZE opt_md.h || true ; echo .if ${MFS_IMAGE:Uno} != "no" .if empty(MD_ROOT_SIZE_CONFIGURED) From owner-svn-src-all@freebsd.org Sun Feb 2 08:27:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A1C4123D28C; Sun, 2 Feb 2020 08:27:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 489PG83hQVz3C7N; Sun, 2 Feb 2020 08:27:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 35628D0BC; Sun, 2 Feb 2020 08:27:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0128RSK2080114; Sun, 2 Feb 2020 08:27:28 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0128RR4L080109; Sun, 2 Feb 2020 08:27:27 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202002020827.0128RR4L080109@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 2 Feb 2020 08:27:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357401 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 357401 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2020 08:27:28 -0000 Author: imp Date: Sun Feb 2 08:27:26 2020 New Revision: 357401 URL: https://svnweb.freebsd.org/changeset/base/357401 Log: Move font.h generation to conf/files from conf/files.* Use ${SRCTOP} instead of /usr/share. Prefer to depend on option sc_dflt_fnt instead of sc. gc the 4 otherwise identical instances in the tree. Platforms that don't need this won't included it. Modified: head/sys/conf/files head/sys/conf/files.amd64 head/sys/conf/files.arm head/sys/conf/files.i386 head/sys/conf/files.powerpc Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Feb 2 08:27:20 2020 (r357400) +++ head/sys/conf/files Sun Feb 2 08:27:26 2020 (r357401) @@ -34,6 +34,10 @@ feeder_rate_gen.h optional sound \ compile-with "${AWK} -f $S/tools/sound/feeder_rate_mkfilter.awk -- ${FEEDER_RATE_PRESETS} > feeder_rate_gen.h" \ no-obj no-implicit-rule before-depend \ clean "feeder_rate_gen.h" +font.h optional sc_dflt_font \ + compile-with "uudecode < ${SRCTOP}/share/syscons/fonts/${SC_DFLT_FONT}-8x16.fnt && file2c 'static u_char dflt_font_16[16*256] = {' '};' < ${SC_DFLT_FONT}-8x16 > font.h && uudecode < ${SRCTOP}/share/syscons/fonts/${SC_DFLT_FONT}-8x14.fnt && file2c 'static u_char dflt_font_14[14*256] = {' '};' < ${SC_DFLT_FONT}-8x14 >> font.h && uudecode < ${SRCTOP}/share/syscons/fonts/${SC_DFLT_FONT}-8x8.fnt && file2c 'static u_char dflt_font_8[8*256] = {' '};' < ${SC_DFLT_FONT}-8x8 >> font.h" \ + no-obj no-implicit-rule before-depend \ + clean "font.h ${SC_DFLT_FONT}-8x14 ${SC_DFLT_FONT}-8x16 ${SC_DFLT_FONT}-8x8" snd_fxdiv_gen.h optional sound \ dependency "$S/tools/sound/snd_fxdiv_gen.awk" \ compile-with "${AWK} -f $S/tools/sound/snd_fxdiv_gen.awk -- > snd_fxdiv_gen.h" \ Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Sun Feb 2 08:27:20 2020 (r357400) +++ head/sys/conf/files.amd64 Sun Feb 2 08:27:26 2020 (r357401) @@ -72,11 +72,6 @@ ia32_assym.h standard \ no-obj no-implicit-rule before-depend \ clean "ia32_assym.h" # -font.h optional sc_dflt_font \ - compile-with "uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x16.fnt && file2c 'static u_char dflt_font_16[16*256] = {' '};' < ${SC_DFLT_FONT}-8x16 > font.h && uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x14.fnt && file2c 'static u_char dflt_font_14[14*256] = {' '};' < ${SC_DFLT_FONT}-8x14 >> font.h && uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x8.fnt && file2c 'static u_char dflt_font_8[8*256] = {' '};' < ${SC_DFLT_FONT}-8x8 >> font.h" \ - no-obj no-implicit-rule before-depend \ - clean "font.h ${SC_DFLT_FONT}-8x14 ${SC_DFLT_FONT}-8x16 ${SC_DFLT_FONT}-8x8" -# amd64/acpica/acpi_machdep.c optional acpi acpi_wakecode.o optional acpi \ dependency "$S/amd64/acpica/acpi_wakecode.S assym.inc" \ Modified: head/sys/conf/files.arm ============================================================================== --- head/sys/conf/files.arm Sun Feb 2 08:27:20 2020 (r357400) +++ head/sys/conf/files.arm Sun Feb 2 08:27:26 2020 (r357401) @@ -112,10 +112,6 @@ dev/psci/smccc_arm.S optional psci dev/syscons/scgfbrndr.c optional sc dev/uart/uart_cpu_fdt.c optional uart fdt -font.h optional sc \ - compile-with "uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x16.fnt && file2c 'u_char dflt_font_16[16*256] = {' '};' < ${SC_DFLT_FONT}-8x16 > font.h && uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x14.fnt && file2c 'u_char dflt_font_14[14*256] = {' '};' < ${SC_DFLT_FONT}-8x14 >> font.h && uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x8.fnt && file2c 'u_char dflt_font_8[8*256] = {' '};' < ${SC_DFLT_FONT}-8x8 >> font.h" \ - no-obj no-implicit-rule before-depend \ - clean "font.h ${SC_DFLT_FONT}-8x14 ${SC_DFLT_FONT}-8x16 ${SC_DFLT_FONT}-8x8" kern/msi_if.m optional intrng kern/pic_if.m optional intrng kern/subr_busdma_bufalloc.c standard Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Sun Feb 2 08:27:20 2020 (r357400) +++ head/sys/conf/files.i386 Sun Feb 2 08:27:26 2020 (r357401) @@ -47,11 +47,6 @@ linux_vdso.so optional compat_linux \ no-implicit-rule \ clean "linux_vdso.so" # -font.h optional sc_dflt_font \ - compile-with "uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x16.fnt && file2c 'static u_char dflt_font_16[16*256] = {' '};' < ${SC_DFLT_FONT}-8x16 > font.h && uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x14.fnt && file2c 'static u_char dflt_font_14[14*256] = {' '};' < ${SC_DFLT_FONT}-8x14 >> font.h && uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x8.fnt && file2c 'static u_char dflt_font_8[8*256] = {' '};' < ${SC_DFLT_FONT}-8x8 >> font.h" \ - no-obj no-implicit-rule before-depend \ - clean "font.h ${SC_DFLT_FONT}-8x14 ${SC_DFLT_FONT}-8x16 ${SC_DFLT_FONT}-8x8" -# cddl/contrib/opensolaris/common/atomic/i386/opensolaris_atomic.S optional zfs | dtrace compile-with "${ZFS_S}" cddl/dev/dtrace/i386/dtrace_asm.S optional dtrace compile-with "${DTRACE_S}" cddl/dev/dtrace/i386/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}" Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Sun Feb 2 08:27:20 2020 (r357400) +++ head/sys/conf/files.powerpc Sun Feb 2 08:27:26 2020 (r357401) @@ -9,11 +9,6 @@ # # -font.h optional sc \ - compile-with "uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x16.fnt && file2c 'u_char dflt_font_16[16*256] = {' '};' < ${SC_DFLT_FONT}-8x16 > font.h && uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x14.fnt && file2c 'u_char dflt_font_14[14*256] = {' '};' < ${SC_DFLT_FONT}-8x14 >> font.h && uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x8.fnt && file2c 'u_char dflt_font_8[8*256] = {' '};' < ${SC_DFLT_FONT}-8x8 >> font.h" \ - no-obj no-implicit-rule before-depend \ - clean "font.h ${SC_DFLT_FONT}-8x14 ${SC_DFLT_FONT}-8x16 ${SC_DFLT_FONT}-8x8" -# # There is only an asm version on ppc64. cddl/compat/opensolaris/kern/opensolaris_atomic.c optional zfs powerpc | dtrace powerpc | zfs powerpcspe | dtrace powerpcspe compile-with "${ZFS_C}" cddl/dev/dtrace/powerpc/dtrace_asm.S optional dtrace compile-with "${DTRACE_S}" From owner-svn-src-all@freebsd.org Sun Feb 2 08:46:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2796723DA33; Sun, 2 Feb 2020 08:46:30 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 489Ph606Lpz3DWT; Sun, 2 Feb 2020 08:46:30 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EEC3ED45F; Sun, 2 Feb 2020 08:46:29 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0128kTA5092612; Sun, 2 Feb 2020 08:46:29 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0128kT3q092611; Sun, 2 Feb 2020 08:46:29 GMT (envelope-from philip@FreeBSD.org) Message-Id: <202002020846.0128kT3q092611@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: philip set sender to philip@FreeBSD.org using -f From: Philip Paeps Date: Sun, 2 Feb 2020 08:46:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357402 - stable/12/sys/dev/acpi_support X-SVN-Group: stable-12 X-SVN-Commit-Author: philip X-SVN-Commit-Paths: stable/12/sys/dev/acpi_support X-SVN-Commit-Revision: 357402 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2020 08:46:30 -0000 Author: philip Date: Sun Feb 2 08:46:29 2020 New Revision: 357402 URL: https://svnweb.freebsd.org/changeset/base/357402 Log: MFC r357292: acpi_ibm: add support for ThinkPad PrivacyGuard ThinkPad PrivacyGuard is a built-in toggleable privacy filter that restricts viewing angles when on. It is an available on some new ThinkPad models such as the X1 Carbon 7th gen (as an optional HW upgrade). The privacy filter can be enabled/disabled via an ACPI call. This commit adds a sysctl under dev.acpi_ibm that allows for getting and setting the PrivacyGuard state. Submitted by: Kamila Součková Reviewed By: cem, philip Differential Revision: https://reviews.freebsd.org/D23370 _M . M sys/dev/acpi_support/acpi_ibm.c Modified: stable/12/sys/dev/acpi_support/acpi_ibm.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/acpi_support/acpi_ibm.c ============================================================================== --- stable/12/sys/dev/acpi_support/acpi_ibm.c Sun Feb 2 08:27:26 2020 (r357401) +++ stable/12/sys/dev/acpi_support/acpi_ibm.c Sun Feb 2 08:46:29 2020 (r357402) @@ -75,6 +75,7 @@ ACPI_MODULE_NAME("IBM") #define ACPI_IBM_METHOD_THERMAL 13 #define ACPI_IBM_METHOD_HANDLEREVENTS 14 #define ACPI_IBM_METHOD_MIC_LED 15 +#define ACPI_IBM_METHOD_PRIVACYGUARD 16 /* Hotkeys/Buttons */ #define IBM_RTC_HOTKEY1 0x64 @@ -123,6 +124,8 @@ ACPI_MODULE_NAME("IBM") #define IBM_NAME_MASK_WLAN (1 << 2) #define IBM_NAME_THERMAL_GET "TMP7" #define IBM_NAME_THERMAL_UPDT "UPDT" +#define IBM_NAME_PRIVACYGUARD_GET "GSSS" +#define IBM_NAME_PRIVACYGUARD_SET "SSSS" #define IBM_NAME_EVENTS_STATUS_GET "DHKC" #define IBM_NAME_EVENTS_MASK_GET "DHKN" @@ -146,6 +149,10 @@ ACPI_MODULE_NAME("IBM") #define IBM_EVENT_MUTE 0x17 #define IBM_EVENT_ACCESS_IBM_BUTTON 0x18 +/* Device-specific register flags */ +#define IBM_FLAG_PRIVACYGUARD_DEVICE_PRESENT 0x10000 +#define IBM_FLAG_PRIVACYGUARD_ON 0x1 + #define ABS(x) (((x) < 0)? -(x) : (x)) struct acpi_ibm_softc { @@ -268,6 +275,11 @@ static struct { .method = ACPI_IBM_METHOD_MIC_LED, .description = "Mic led", }, + { + .name = "privacyguard", + .method = ACPI_IBM_METHOD_PRIVACYGUARD, + .description = "PrivacyGuard enable", + }, { NULL, 0, NULL, 0 } }; @@ -327,7 +339,12 @@ static int acpi_ibm_bluetooth_set(struct acpi_ibm_soft static int acpi_ibm_thinklight_set(struct acpi_ibm_softc *sc, int arg); static int acpi_ibm_volume_set(struct acpi_ibm_softc *sc, int arg); static int acpi_ibm_mute_set(struct acpi_ibm_softc *sc, int arg); +static int acpi_ibm_privacyguard_get(struct acpi_ibm_softc *sc); +static ACPI_STATUS acpi_ibm_privacyguard_set(struct acpi_ibm_softc *sc, int arg); +static ACPI_STATUS acpi_ibm_privacyguard_acpi_call(struct acpi_ibm_softc *sc, bool write, int *arg); +static int acpi_status_to_errno(ACPI_STATUS status); + static device_method_t acpi_ibm_methods[] = { /* Device interface */ DEVMETHOD(device_probe, acpi_ibm_probe), @@ -351,6 +368,19 @@ DRIVER_MODULE(acpi_ibm, acpi, acpi_ibm_driver, acpi_ib MODULE_DEPEND(acpi_ibm, acpi, 1, 1, 1); static char *ibm_ids[] = {"IBM0068", "LEN0068", "LEN0268", NULL}; +static int +acpi_status_to_errno(ACPI_STATUS status) +{ + switch (status) { + case AE_OK: + return (0); + case AE_BAD_PARAMETER: + return (EINVAL); + default: + return (ENODEV); + } +} + static void ibm_led(void *softc, int onoff) { @@ -818,6 +848,11 @@ acpi_ibm_sysctl_get(struct acpi_ibm_softc *sc, int met else val = -1; break; + + case ACPI_IBM_METHOD_PRIVACYGUARD: + val = acpi_ibm_privacyguard_get(sc); + break; + } return (val); @@ -874,6 +909,10 @@ acpi_ibm_sysctl_set(struct acpi_ibm_softc *sc, int met return acpi_ibm_bluetooth_set(sc, arg); break; + case ACPI_IBM_METHOD_PRIVACYGUARD: + return (acpi_status_to_errno(acpi_ibm_privacyguard_set(sc, arg))); + break; + case ACPI_IBM_METHOD_FANLEVEL: if (arg < 0 || arg > 7) return (EINVAL); @@ -1005,6 +1044,10 @@ acpi_ibm_sysctl_init(struct acpi_ibm_softc *sc, int me case ACPI_IBM_METHOD_HANDLEREVENTS: return (TRUE); + + case ACPI_IBM_METHOD_PRIVACYGUARD: + return (acpi_ibm_privacyguard_get(sc) != -1); + } return (FALSE); } @@ -1220,6 +1263,60 @@ acpi_ibm_thinklight_set(struct acpi_ibm_softc *sc, int } return (0); +} + +/* + * Helper function to make a get or set ACPI call to the PrivacyGuard handle. + * Only meant to be used internally by the get/set functions below. + */ +static ACPI_STATUS +acpi_ibm_privacyguard_acpi_call(struct acpi_ibm_softc *sc, bool write, int *arg) { + ACPI_OBJECT Arg; + ACPI_OBJECT_LIST Args; + ACPI_STATUS status; + ACPI_OBJECT out_obj; + ACPI_BUFFER result; + + Arg.Type = ACPI_TYPE_INTEGER; + Arg.Integer.Value = (write ? *arg : 0); + Args.Count = 1; + Args.Pointer = &Arg; + result.Length = sizeof(out_obj); + result.Pointer = &out_obj; + + status = AcpiEvaluateObject(sc->handle, + (write ? IBM_NAME_PRIVACYGUARD_SET : IBM_NAME_PRIVACYGUARD_GET), + &Args, &result); + if (ACPI_SUCCESS(status) && !write) + *arg = out_obj.Integer.Value; + + return (status); +} + +/* + * Returns -1 if the device is not present. + */ +static int +acpi_ibm_privacyguard_get(struct acpi_ibm_softc *sc) +{ + ACPI_STATUS status; + int val; + + status = acpi_ibm_privacyguard_acpi_call(sc, false, &val); + if (ACPI_SUCCESS(status) && + (val & IBM_FLAG_PRIVACYGUARD_DEVICE_PRESENT)) + return (val & IBM_FLAG_PRIVACYGUARD_ON); + + return (-1); +} + +static ACPI_STATUS +acpi_ibm_privacyguard_set(struct acpi_ibm_softc *sc, int arg) +{ + if (arg < 0 || arg > 1) + return (AE_BAD_PARAMETER); + + return (acpi_ibm_privacyguard_acpi_call(sc, true, &arg)); } static int From owner-svn-src-all@freebsd.org Sun Feb 2 09:35:49 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BBE8C23EC30; Sun, 2 Feb 2020 09:35:49 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 489Qn14Zp3z3Gvv; Sun, 2 Feb 2020 09:35:49 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 987E0DD8C; Sun, 2 Feb 2020 09:35:49 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0129ZnPV022860; Sun, 2 Feb 2020 09:35:49 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0129ZnXD022858; Sun, 2 Feb 2020 09:35:49 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202002020935.0129ZnXD022858@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 2 Feb 2020 09:35:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357403 - in head/sys: fs/nullfs sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: fs/nullfs sys X-SVN-Commit-Revision: 357403 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2020 09:35:49 -0000 Author: mjg Date: Sun Feb 2 09:35:48 2020 New Revision: 357403 URL: https://svnweb.freebsd.org/changeset/base/357403 Log: vfs: remove the never set VDESC_VPP_WILLRELE flag Modified: head/sys/fs/nullfs/null_vnops.c head/sys/sys/vnode.h Modified: head/sys/fs/nullfs/null_vnops.c ============================================================================== --- head/sys/fs/nullfs/null_vnops.c Sun Feb 2 08:46:29 2020 (r357402) +++ head/sys/fs/nullfs/null_vnops.c Sun Feb 2 09:35:48 2020 (r357403) @@ -317,15 +317,12 @@ null_bypass(struct vop_generic_args *ap) * We must avoid these ops. * (This should go away when these ops are regularized.) */ - if (descp->vdesc_flags & VDESC_VPP_WILLRELE) - goto out; vppp = VOPARG_OFFSETTO(struct vnode***, descp->vdesc_vpp_offset,ap); if (*vppp) error = null_nodeget(old_vps[0]->v_mount, **vppp, *vppp); } - out: return (error); } Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Sun Feb 2 08:46:29 2020 (r357402) +++ head/sys/sys/vnode.h Sun Feb 2 09:35:48 2020 (r357403) @@ -463,7 +463,6 @@ extern struct vattr va_null; /* predefined null vattr #define VDESC_VP1_WILLRELE 0x0002 #define VDESC_VP2_WILLRELE 0x0004 #define VDESC_VP3_WILLRELE 0x0008 -#define VDESC_VPP_WILLRELE 0x0200 /* * A generic structure. From owner-svn-src-all@freebsd.org Sun Feb 2 09:36:33 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6E57723EC9D; Sun, 2 Feb 2020 09:36:33 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 489Qns2HMfz3H3N; Sun, 2 Feb 2020 09:36:33 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 49952DD8D; Sun, 2 Feb 2020 09:36:33 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0129aXCa022941; Sun, 2 Feb 2020 09:36:33 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0129aWmF022938; Sun, 2 Feb 2020 09:36:32 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202002020936.0129aWmF022938@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 2 Feb 2020 09:36:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357404 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 357404 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2020 09:36:33 -0000 Author: mjg Date: Sun Feb 2 09:36:32 2020 New Revision: 357404 URL: https://svnweb.freebsd.org/changeset/base/357404 Log: vfs: remove the now empty vop_unlock_post Modified: head/sys/kern/vfs_subr.c head/sys/kern/vnode_if.src head/sys/sys/vnode.h Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sun Feb 2 09:35:48 2020 (r357403) +++ head/sys/kern/vfs_subr.c Sun Feb 2 09:36:32 2020 (r357404) @@ -5385,12 +5385,6 @@ vop_unlock_pre(void *ap) } void -vop_unlock_post(void *ap, int rc) -{ - return; -} - -void vop_need_inactive_pre(void *ap) { struct vop_need_inactive_args *a = ap; Modified: head/sys/kern/vnode_if.src ============================================================================== --- head/sys/kern/vnode_if.src Sun Feb 2 09:35:48 2020 (r357403) +++ head/sys/kern/vnode_if.src Sun Feb 2 09:36:32 2020 (r357404) @@ -386,7 +386,6 @@ vop_lock1 { %! unlock pre vop_unlock_pre -%! unlock post vop_unlock_post vop_unlock { IN struct vnode *vp; Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Sun Feb 2 09:35:48 2020 (r357403) +++ head/sys/sys/vnode.h Sun Feb 2 09:36:32 2020 (r357404) @@ -824,7 +824,6 @@ void vop_strategy_pre(void *a); void vop_lock_pre(void *a); void vop_lock_post(void *a, int rc); void vop_unlock_pre(void *a); -void vop_unlock_post(void *a, int rc); void vop_need_inactive_pre(void *a); void vop_need_inactive_post(void *a, int rc); #else @@ -832,7 +831,6 @@ void vop_need_inactive_post(void *a, int rc); #define vop_lock_pre(x) do { } while (0) #define vop_lock_post(x, y) do { } while (0) #define vop_unlock_pre(x) do { } while (0) -#define vop_unlock_post(x, y) do { } while (0) #define vop_need_inactive_pre(x) do { } while (0) #define vop_need_inactive_post(x, y) do { } while (0) #endif From owner-svn-src-all@freebsd.org Sun Feb 2 09:37:17 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 684EA23ED1D; Sun, 2 Feb 2020 09:37:17 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 489Qpj270pz3H9w; Sun, 2 Feb 2020 09:37:17 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 43CA1DD8E; Sun, 2 Feb 2020 09:37:17 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0129bHCR023018; Sun, 2 Feb 2020 09:37:17 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0129bH9E023017; Sun, 2 Feb 2020 09:37:17 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202002020937.0129bH9E023017@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 2 Feb 2020 09:37:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357405 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 357405 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2020 09:37:17 -0000 Author: mjg Date: Sun Feb 2 09:37:16 2020 New Revision: 357405 URL: https://svnweb.freebsd.org/changeset/base/357405 Log: fd: use atomic_load_ptr instead of hand-rolled cast through volatile No change in assembly. Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Sun Feb 2 09:36:32 2020 (r357404) +++ head/sys/kern/kern_descrip.c Sun Feb 2 09:37:16 2020 (r357405) @@ -2737,8 +2737,7 @@ fget_unlocked(struct filedesc *fdp, int fd, cap_rights * table before this fd was closed, so it possible that * there is a stale fp pointer in cached version. */ - fdt = *(const struct fdescenttbl * const volatile *) - &(fdp->fd_files); + fdt = (struct fdescenttbl *)atomic_load_ptr(&fdp->fd_files); continue; } if (__predict_false(count + 1 < count)) From owner-svn-src-all@freebsd.org Sun Feb 2 09:38:40 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F353423ED99; Sun, 2 Feb 2020 09:38:40 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 489QrJ5zNrz3HJK; Sun, 2 Feb 2020 09:38:40 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C84D2DD8F; Sun, 2 Feb 2020 09:38:40 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0129cepa023125; Sun, 2 Feb 2020 09:38:40 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0129ceeY023124; Sun, 2 Feb 2020 09:38:40 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202002020938.0129ceeY023124@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 2 Feb 2020 09:38:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357406 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 357406 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2020 09:38:41 -0000 Author: mjg Date: Sun Feb 2 09:38:40 2020 New Revision: 357406 URL: https://svnweb.freebsd.org/changeset/base/357406 Log: fd: sprinkle some predits around fget clang inlines fget -> _fget into kern_fstat and eliminates several checkes, but prior to this change it would assume fget_unlocked was likely to fail and consequently avoidable jumps got generated. Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Sun Feb 2 09:37:16 2020 (r357405) +++ head/sys/kern/kern_descrip.c Sun Feb 2 09:38:40 2020 (r357406) @@ -1437,7 +1437,7 @@ kern_fstat(struct thread *td, int fd, struct stat *sbp AUDIT_ARG_FD(fd); error = fget(td, fd, &cap_fstat_rights, &fp); - if (error != 0) + if (__predict_false(error != 0)) return (error); AUDIT_ARG_FILE(td->td_proc, fp); @@ -2792,9 +2792,9 @@ _fget(struct thread *td, int fd, struct file **fpp, in *fpp = NULL; fdp = td->td_proc->p_fd; error = fget_unlocked(fdp, fd, needrightsp, &fp, seqp); - if (error != 0) + if (__predict_false(error != 0)) return (error); - if (fp->f_ops == &badfileops) { + if (__predict_false(fp->f_ops == &badfileops)) { fdrop(fp, td); return (EBADF); } From owner-svn-src-all@freebsd.org Sun Feb 2 11:37:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8CE1C22A95F; Sun, 2 Feb 2020 11:37:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 489TTN3F2rz42YV; Sun, 2 Feb 2020 11:37:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 65677F40B; Sun, 2 Feb 2020 11:37:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 012BbSdV008394; Sun, 2 Feb 2020 11:37:28 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 012BbSwd008392; Sun, 2 Feb 2020 11:37:28 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202002021137.012BbSwd008392@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 2 Feb 2020 11:37:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357407 - head X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 357407 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2020 11:37:28 -0000 Author: imp Date: Sun Feb 2 11:37:27 2020 New Revision: 357407 URL: https://svnweb.freebsd.org/changeset/base/357407 Log: Per the firm plan, start to remove sparc64 The sparc64 architecture is being removed from FreeBSD 13, starting now. This removes it from the top level only. It is the only architecture that didn't see substantial work after the call to get things working with the external toolchain. Modified: head/Makefile head/Makefile.inc1 Modified: head/Makefile ============================================================================== --- head/Makefile Sun Feb 2 09:38:40 2020 (r357406) +++ head/Makefile Sun Feb 2 11:37:27 2020 (r357407) @@ -89,7 +89,7 @@ # # See src/UPDATING `COMMON ITEMS' for more complete information. # -# If TARGET=machine (e.g. powerpc, sparc64, ...) is specified you can +# If TARGET=machine (e.g. powerpc, arm64, ...) is specified you can # cross build world for other machine types using the buildworld target, # and once the world is built you can cross build a kernel using the # buildkernel target. @@ -488,7 +488,7 @@ worlds: .PHONY # In all cases, if the user specifies TARGETS on the command line, # honor that most of all. # -TARGETS?=amd64 arm arm64 i386 mips powerpc riscv sparc64 +TARGETS?=amd64 arm arm64 i386 mips powerpc riscv _UNIVERSE_TARGETS= ${TARGETS} TARGET_ARCHES_arm?= armv6 armv7 TARGET_ARCHES_arm64?= aarch64 @@ -501,14 +501,12 @@ TARGET_ARCHES_${target}?= ${target} .endfor MAKE_PARAMS_mips?= CROSS_TOOLCHAIN=mips-gcc6 -MAKE_PARAMS_sparc64?= CROSS_TOOLCHAIN=sparc64-gcc6 TOOLCHAINS_mips= mips-gcc6 -TOOLCHAINS_sparc64= sparc64-gcc6 # Remove architectures only supported by external toolchain from # universe if required toolchain packages are missing. -.for target in mips sparc64 +.for target in mips .if ${_UNIVERSE_TARGETS:M${target}} .for toolchain in ${TOOLCHAINS_${target}} .if !exists(/usr/local/share/toolchains/${toolchain}.mk) Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sun Feb 2 09:38:40 2020 (r357406) +++ head/Makefile.inc1 Sun Feb 2 11:37:27 2020 (r357407) @@ -153,8 +153,7 @@ KNOWN_ARCHES?= aarch64/arm64 \ powerpc64/powerpc \ powerpcspe/powerpc \ riscv64/riscv \ - riscv64sf/riscv \ - sparc64 + riscv64sf/riscv .if ${TARGET} == ${TARGET_ARCH} _t= ${TARGET} @@ -2290,8 +2289,6 @@ _basic_bootstrap_tools_multilink+=bin/test test,[ _basic_bootstrap_tools=usr.bin/awk usr.bin/cut bin/expr usr.bin/gencat \ usr.bin/join usr.bin/mktemp bin/rmdir usr.bin/sed usr.bin/sort \ usr.bin/truncate usr.bin/tsort -# elf2aout is required for sparc64 build -_basic_bootstrap_tools+=usr.bin/elf2aout # file2c is required for building usr.sbin/config: _basic_bootstrap_tools+=usr.bin/file2c # uuencode/uudecode required for share/tabset @@ -2915,14 +2912,10 @@ _cddl_lib_libctf= cddl/lib/libctf _cddl_lib= cddl/lib cddl/lib/libctf__L: lib/libz__L .endif -# cddl/lib/libdtrace requires lib/libproc and lib/librtld_db; it's only built -# on select architectures though (see cddl/lib/Makefile) -.if ${MACHINE_CPUARCH} != "sparc64" _prebuild_libs+= lib/libprocstat lib/libproc lib/librtld_db lib/libprocstat__L: lib/libelf__L lib/libkvm__L lib/libutil__L lib/libproc__L: lib/libprocstat__L lib/librtld_db__L: lib/libprocstat__L -.endif .if ${MK_CRYPT} != "no" .if ${MK_OPENSSL} != "no" From owner-svn-src-all@freebsd.org Sun Feb 2 14:41:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BDD37230458; Sun, 2 Feb 2020 14:41:09 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 489YYK4h4Gz4FDq; Sun, 2 Feb 2020 14:41:09 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9BF441959C; Sun, 2 Feb 2020 14:41:09 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 012Ef9Ea019444; Sun, 2 Feb 2020 14:41:09 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 012Ef93Q019443; Sun, 2 Feb 2020 14:41:09 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202002021441.012Ef93Q019443@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 2 Feb 2020 14:41:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357409 - head/sys/modules X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/modules X-SVN-Commit-Revision: 357409 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2020 14:41:09 -0000 Author: emaste Date: Sun Feb 2 14:41:09 2020 New Revision: 357409 URL: https://svnweb.freebsd.org/changeset/base/357409 Log: Move ce enable to SOURCELESS_HOST ce contains obfuscated code that runs on the host's processor Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Sun Feb 2 12:54:38 2020 (r357408) +++ head/sys/modules/Makefile Sun Feb 2 14:41:09 2020 (r357409) @@ -725,7 +725,7 @@ _vmm= vmm _3dfx= 3dfx _3dfx_linux= 3dfx_linux _apm= apm -.if ${MK_SOURCELESS_UCODE} != "no" +.if ${MK_SOURCELESS_HOST} != "no" _ce= ce .endif .if ${MK_SOURCELESS_UCODE} != "no" From owner-svn-src-all@freebsd.org Sun Feb 2 15:36:13 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 118CB231AA7; Sun, 2 Feb 2020 15:36:13 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 489Zmr6jzTz4JR2; Sun, 2 Feb 2020 15:36:12 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DCE6F1A068; Sun, 2 Feb 2020 15:36:12 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 012FaCTB054704; Sun, 2 Feb 2020 15:36:12 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 012FaCXX054703; Sun, 2 Feb 2020 15:36:12 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202002021536.012FaCXX054703@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 2 Feb 2020 15:36:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357410 - head/sys/fs/pseudofs X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/fs/pseudofs X-SVN-Commit-Revision: 357410 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2020 15:36:13 -0000 Author: kevans Date: Sun Feb 2 15:36:12 2020 New Revision: 357410 URL: https://svnweb.freebsd.org/changeset/base/357410 Log: pseudofs: don't do VEXEC check in VOP_CACHEDLOOKUP VOP_CACHEDLOOKUP should assume that the appropriate VEXEC check has been done in the caller (vfs_cache_lookup), so it does not belong here. Modified: head/sys/fs/pseudofs/pseudofs_vnops.c Modified: head/sys/fs/pseudofs/pseudofs_vnops.c ============================================================================== --- head/sys/fs/pseudofs/pseudofs_vnops.c Sun Feb 2 14:41:09 2020 (r357409) +++ head/sys/fs/pseudofs/pseudofs_vnops.c Sun Feb 2 15:36:12 2020 (r357410) @@ -466,10 +466,6 @@ pfs_lookup(struct vop_cachedlookup_args *va) PFS_RETURN (ENOTDIR); KASSERT_PN_IS_DIR(pd); - error = VOP_ACCESS(vn, VEXEC, cnp->cn_cred, cnp->cn_thread); - if (error) - PFS_RETURN (error); - /* * Don't support DELETE or RENAME. CREATE is supported so * that O_CREAT will work, but the lookup will still fail if From owner-svn-src-all@freebsd.org Sun Feb 2 16:10:33 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B6CD42328CF; Sun, 2 Feb 2020 16:10:33 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 489bXT4LFfz4LDx; Sun, 2 Feb 2020 16:10:33 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 903391A5CD; Sun, 2 Feb 2020 16:10:33 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 012GAXp7073089; Sun, 2 Feb 2020 16:10:33 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 012GAXkJ073088; Sun, 2 Feb 2020 16:10:33 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202002021610.012GAXkJ073088@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 2 Feb 2020 16:10:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357411 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 357411 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2020 16:10:33 -0000 Author: kevans Date: Sun Feb 2 16:10:33 2020 New Revision: 357411 URL: https://svnweb.freebsd.org/changeset/base/357411 Log: zfs: light refactor to indicate cachedlookup in zfs_lookup If we come from VOP_CACHEDLOOKUP, we must skip the VEXEC check as it will have been done in the caller (vfs_cache_lookup). This is a part of D23247, which may skip the earlier VEXEC check as well if the root fd was opened with O_SEARCH. This one required slightly more work as zfs_lookup may also be called indirectly as VOP_LOOKUP or a couple of other places where we must do the check. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Feb 2 15:36:12 2020 (r357410) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Feb 2 16:10:33 2020 (r357411) @@ -1470,7 +1470,7 @@ zfs_lookup_lock(vnode_t *dvp, vnode_t *vp, const char /* ARGSUSED */ static int zfs_lookup(vnode_t *dvp, char *nm, vnode_t **vpp, struct componentname *cnp, - int nameiop, cred_t *cr, kthread_t *td, int flags) + int nameiop, cred_t *cr, kthread_t *td, int flags, boolean_t cached) { znode_t *zdp = VTOZ(dvp); znode_t *zp; @@ -1542,9 +1542,12 @@ zfs_lookup(vnode_t *dvp, char *nm, vnode_t **vpp, stru /* * Check accessibility of directory. */ - if (error = zfs_zaccess(zdp, ACE_EXECUTE, 0, B_FALSE, cr)) { - ZFS_EXIT(zfsvfs); - return (error); + if (!cached) { + error = zfs_zaccess(zdp, ACE_EXECUTE, 0, B_FALSE, cr); + if (error != 0) { + ZFS_EXIT(zfsvfs); + return (error); + } } if (zfsvfs->z_utf8 && u8_validate(nm, strlen(nm), @@ -4894,12 +4897,7 @@ zfs_freebsd_access(ap) } static int -zfs_freebsd_lookup(ap) - struct vop_lookup_args /* { - struct vnode *a_dvp; - struct vnode **a_vpp; - struct componentname *a_cnp; - } */ *ap; +zfs_freebsd_lookup(struct vop_lookup_args *ap, boolean_t cached) { struct componentname *cnp = ap->a_cnp; char nm[NAME_MAX + 1]; @@ -4908,10 +4906,17 @@ zfs_freebsd_lookup(ap) strlcpy(nm, cnp->cn_nameptr, MIN(cnp->cn_namelen + 1, sizeof(nm))); return (zfs_lookup(ap->a_dvp, nm, ap->a_vpp, cnp, cnp->cn_nameiop, - cnp->cn_cred, cnp->cn_thread, 0)); + cnp->cn_cred, cnp->cn_thread, 0, cached)); } static int +zfs_freebsd_cachedlookup(struct vop_cachedlookup_args *ap) +{ + + return (zfs_freebsd_lookup((struct vop_lookup_args *)ap, B_TRUE)); +} + +static int zfs_cache_lookup(ap) struct vop_lookup_args /* { struct vnode *a_dvp; @@ -4925,7 +4930,7 @@ zfs_cache_lookup(ap) if (zfsvfs->z_use_namecache) return (vfs_cache_lookup(ap)); else - return (zfs_freebsd_lookup(ap)); + return (zfs_freebsd_lookup(ap, B_FALSE)); } static int @@ -5507,7 +5512,7 @@ vop_getextattr { ZFS_ENTER(zfsvfs); error = zfs_lookup(ap->a_vp, NULL, &xvp, NULL, 0, ap->a_cred, td, - LOOKUP_XATTR); + LOOKUP_XATTR, B_FALSE); if (error != 0) { ZFS_EXIT(zfsvfs); return (error); @@ -5576,7 +5581,7 @@ vop_deleteextattr { ZFS_ENTER(zfsvfs); error = zfs_lookup(ap->a_vp, NULL, &xvp, NULL, 0, ap->a_cred, td, - LOOKUP_XATTR); + LOOKUP_XATTR, B_FALSE); if (error != 0) { ZFS_EXIT(zfsvfs); return (error); @@ -5644,7 +5649,7 @@ vop_setextattr { ZFS_ENTER(zfsvfs); error = zfs_lookup(ap->a_vp, NULL, &xvp, NULL, 0, ap->a_cred, td, - LOOKUP_XATTR | CREATE_XATTR_DIR); + LOOKUP_XATTR | CREATE_XATTR_DIR, B_FALSE); if (error != 0) { ZFS_EXIT(zfsvfs); return (error); @@ -5721,7 +5726,7 @@ vop_listextattr { *sizep = 0; error = zfs_lookup(ap->a_vp, NULL, &xvp, NULL, 0, ap->a_cred, td, - LOOKUP_XATTR); + LOOKUP_XATTR, B_FALSE); if (error != 0) { ZFS_EXIT(zfsvfs); /* @@ -5982,7 +5987,7 @@ struct vop_vector zfs_vnodeops = { .vop_access = zfs_freebsd_access, .vop_allocate = VOP_EINVAL, .vop_lookup = zfs_cache_lookup, - .vop_cachedlookup = zfs_freebsd_lookup, + .vop_cachedlookup = zfs_freebsd_cachedlookup, .vop_getattr = zfs_freebsd_getattr, .vop_setattr = zfs_freebsd_setattr, .vop_create = zfs_freebsd_create, From owner-svn-src-all@freebsd.org Sun Feb 2 16:35:00 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B1F052332BE; Sun, 2 Feb 2020 16:35:00 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 489c4h50rHz4MdY; Sun, 2 Feb 2020 16:35:00 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 88B841AB4C; Sun, 2 Feb 2020 16:35:00 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 012GZ0WX091095; Sun, 2 Feb 2020 16:35:00 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 012GYvo2091063; Sun, 2 Feb 2020 16:34:57 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202002021634.012GYvo2091063@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 2 Feb 2020 16:34:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357412 - in head: contrib/netbsd-tests/lib/libc/c063 lib/libc/sys lib/libc/tests/c063 sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/fs/devfs sys/fs/fuse sys/fs/nfsclient sys/fs/sm... X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: contrib/netbsd-tests/lib/libc/c063 lib/libc/sys lib/libc/tests/c063 sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/fs/devfs sys/fs/fuse sys/fs/nfsclient sys/fs/smbfs sys/fs/tmpfs sys/kern... X-SVN-Commit-Revision: 357412 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2020 16:35:00 -0000 Author: kevans Date: Sun Feb 2 16:34:57 2020 New Revision: 357412 URL: https://svnweb.freebsd.org/changeset/base/357412 Log: Provide O_SEARCH O_SEARCH is defined by POSIX [0] to open a directory for searching, skipping permissions checks on the directory itself after the initial open(). This is close to the semantics we've historically applied for O_EXEC on a directory, which is UB according to POSIX. Conveniently, O_SEARCH on a file is also explicitly undefined behavior according to POSIX, so O_EXEC would be a fine choice. The spec goes on to state that O_SEARCH and O_EXEC need not be distinct values, but they're not defined to be the same value. This was pointed out as an incompatibility with other systems that had made its way into libarchive, which had assumed that O_EXEC was an alias for O_SEARCH. This defines compatibility O_SEARCH/FSEARCH (equivalent to O_EXEC and FEXEC respectively) and expands our UB for O_EXEC on a directory. O_EXEC on a directory is checked in vn_open_vnode already, so for completeness we add a NOEXECCHECK when O_SEARCH has been specified on the top-level fd and do not re-check that when descending in namei. [0] https://pubs.opengroup.org/onlinepubs/9699919799/ Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D23247 Modified: head/contrib/netbsd-tests/lib/libc/c063/t_o_search.c head/lib/libc/sys/open.2 head/lib/libc/tests/c063/Makefile head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c head/sys/fs/devfs/devfs_vnops.c head/sys/fs/fuse/fuse_vnops.c head/sys/fs/nfsclient/nfs_clvnops.c head/sys/fs/smbfs/smbfs_vnops.c head/sys/fs/tmpfs/tmpfs_vnops.c head/sys/kern/vfs_cache.c head/sys/kern/vfs_lookup.c head/sys/kern/vfs_subr.c head/sys/sys/fcntl.h head/sys/sys/namei.h head/sys/sys/vnode.h Modified: head/contrib/netbsd-tests/lib/libc/c063/t_o_search.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/c063/t_o_search.c Sun Feb 2 16:10:33 2020 (r357411) +++ head/contrib/netbsd-tests/lib/libc/c063/t_o_search.c Sun Feb 2 16:34:57 2020 (r357412) @@ -33,9 +33,10 @@ __RCSID("$NetBSD: t_o_search.c,v 1.5 2017/01/10 22:25: #include -#include +#include #include +#include #include #include #include @@ -50,7 +51,7 @@ __RCSID("$NetBSD: t_o_search.c,v 1.5 2017/01/10 22:25: * until a decision is reached about the semantics of O_SEARCH and a * non-broken implementation is available. */ -#if (O_MASK & O_SEARCH) != 0 +#if defined(__FreeBSD__) || (O_MASK & O_SEARCH) != 0 #define USE_O_SEARCH #endif @@ -257,11 +258,79 @@ ATF_TC_BODY(o_search_notdir, tc) int fd; ATF_REQUIRE(mkdir(DIR, 0755) == 0); +#ifndef __FreeBSD__ ATF_REQUIRE((dfd = open(FILE, O_CREAT|O_RDWR|O_SEARCH, 0644)) != -1); +#else + ATF_REQUIRE((dfd = open(FILE, O_CREAT|O_SEARCH, 0644)) != -1); +#endif ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) == -1); ATF_REQUIRE(errno == ENOTDIR); } +#ifdef USE_O_SEARCH +ATF_TC(o_search_nord); +ATF_TC_HEAD(o_search_nord, tc) +{ + atf_tc_set_md_var(tc, "descr", "See that openat succeeds with no read permission"); + atf_tc_set_md_var(tc, "require.user", "unprivileged"); +} +ATF_TC_BODY(o_search_nord, tc) +{ + int dfd, fd; + + ATF_REQUIRE(mkdir(DIR, 0755) == 0); + ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1); + ATF_REQUIRE(close(fd) == 0); + + ATF_REQUIRE(chmod(DIR, 0100) == 0); + ATF_REQUIRE((dfd = open(DIR, O_SEARCH, 0)) != -1); + + ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) != -1); + + ATF_REQUIRE(close(dfd) == 0); +} + +ATF_TC(o_search_getdents); +ATF_TC_HEAD(o_search_getdents, tc) +{ + atf_tc_set_md_var(tc, "descr", "See that O_SEARCH forbids getdents"); +} +ATF_TC_BODY(o_search_getdents, tc) +{ + char buf[1024]; + int dfd; + + ATF_REQUIRE(mkdir(DIR, 0755) == 0); + ATF_REQUIRE((dfd = open(DIR, O_SEARCH, 0)) != -1); + ATF_REQUIRE(getdents(dfd, buf, sizeof(buf)) < 0); + ATF_REQUIRE(close(dfd) == 0); +} + +ATF_TC(o_search_revokex); +ATF_TC_HEAD(o_search_revokex, tc) +{ + atf_tc_set_md_var(tc, "descr", "See that *at behaves after chmod -x"); + atf_tc_set_md_var(tc, "require.user", "unprivileged"); +} +ATF_TC_BODY(o_search_revokex, tc) +{ + int dfd, fd; + struct stat sb; + + ATF_REQUIRE(mkdir(DIR, 0755) == 0); + ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1); + ATF_REQUIRE(close(fd) == 0); + + ATF_REQUIRE((dfd = open(DIR, O_SEARCH, 0)) != -1); + + /* Drop permissions. The kernel must still not check the exec bit. */ + ATF_REQUIRE(chmod(DIR, 0000) == 0); + ATF_REQUIRE(fstatat(dfd, BASEFILE, &sb, 0) == 0); + + ATF_REQUIRE(close(dfd) == 0); +} +#endif /* USE_O_SEARCH */ + ATF_TP_ADD_TCS(tp) { @@ -276,6 +345,11 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, o_search_unpriv_flag2); #endif ATF_TP_ADD_TC(tp, o_search_notdir); +#ifdef USE_O_SEARCH + ATF_TP_ADD_TC(tp, o_search_nord); + ATF_TP_ADD_TC(tp, o_search_getdents); + ATF_TP_ADD_TC(tp, o_search_revokex); +#endif return atf_no_error(); } Modified: head/lib/libc/sys/open.2 ============================================================================== --- head/lib/libc/sys/open.2 Sun Feb 2 16:10:33 2020 (r357411) +++ head/lib/libc/sys/open.2 Sun Feb 2 16:34:57 2020 (r357412) @@ -28,7 +28,7 @@ .\" @(#)open.2 8.2 (Berkeley) 11/16/93 .\" $FreeBSD$ .\" -.Dd September 28, 2019 +.Dd January 31, 2020 .Dt OPEN 2 .Os .Sh NAME @@ -166,6 +166,7 @@ O_RDONLY open for reading only O_WRONLY open for writing only O_RDWR open for reading and writing O_EXEC open for execute only +O_SEARCH open for search only, an alias for O_EXEC O_NONBLOCK do not block on open O_APPEND append on each write O_CREAT create file if it does not exist @@ -326,6 +327,19 @@ If the specified path is absolute, allows arbitrary prefix that ends up at the topping directory, after which all further resolved components must be under it. .Pp +When +.Fa fd +is opened with +.Dv O_SEARCH , +execute permissions are checked at open time. +The +.Fa fd +may not be used for any read operations like +.Xr getdirentries 2 . +The primary use for this descriptor will be as the lookup descriptor for the +.Fn *at +family of functions. +.Pp If successful, .Fn open returns a non-negative integer, termed a file descriptor. @@ -518,9 +532,12 @@ An attempt was made to open a descriptor with an illeg of .Dv O_RDONLY , .Dv O_WRONLY , -.Dv O_RDWR +or +.Dv O_RDWR , and -.Dv O_EXEC . +.Dv O_EXEC +or +.Dv O_SEARCH . .It Bq Er EBADF The .Fa path Modified: head/lib/libc/tests/c063/Makefile ============================================================================== --- head/lib/libc/tests/c063/Makefile Sun Feb 2 16:10:33 2020 (r357411) +++ head/lib/libc/tests/c063/Makefile Sun Feb 2 16:34:57 2020 (r357412) @@ -1,7 +1,5 @@ # $FreeBSD$ -#TODO: t_o_search - NETBSD_ATF_TESTS_C= faccessat_test NETBSD_ATF_TESTS_C+= fchmodat_test NETBSD_ATF_TESTS_C+= fchownat_test @@ -11,6 +9,7 @@ NETBSD_ATF_TESTS_C+= linkat_test NETBSD_ATF_TESTS_C+= mkdirat_test NETBSD_ATF_TESTS_C+= mkfifoat_test NETBSD_ATF_TESTS_C+= mknodat_test +NETBSD_ATF_TESTS_C+= o_search_test NETBSD_ATF_TESTS_C+= openat_test NETBSD_ATF_TESTS_C+= readlinkat_test NETBSD_ATF_TESTS_C+= renameat_test Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Feb 2 16:10:33 2020 (r357411) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Feb 2 16:34:57 2020 (r357412) @@ -1543,10 +1543,14 @@ zfs_lookup(vnode_t *dvp, char *nm, vnode_t **vpp, stru * Check accessibility of directory. */ if (!cached) { - error = zfs_zaccess(zdp, ACE_EXECUTE, 0, B_FALSE, cr); - if (error != 0) { - ZFS_EXIT(zfsvfs); - return (error); + if ((cnp->cn_flags & NOEXECCHECK) != 0) { + cnp->cn_flags &= ~NOEXECCHECK; + } else { + error = zfs_zaccess(zdp, ACE_EXECUTE, 0, B_FALSE, cr); + if (error != 0) { + ZFS_EXIT(zfsvfs); + return (error); + } } } Modified: head/sys/fs/devfs/devfs_vnops.c ============================================================================== --- head/sys/fs/devfs/devfs_vnops.c Sun Feb 2 16:10:33 2020 (r357411) +++ head/sys/fs/devfs/devfs_vnops.c Sun Feb 2 16:34:57 2020 (r357412) @@ -946,8 +946,8 @@ devfs_lookupx(struct vop_lookup_args *ap, int *dm_unlo if ((flags & ISDOTDOT) && (dvp->v_vflag & VV_ROOT)) return (EIO); - error = VOP_ACCESS(dvp, VEXEC, cnp->cn_cred, td); - if (error) + error = vn_dir_check_exec(dvp, cnp); + if (error != 0) return (error); if (cnp->cn_namelen == 1 && *pname == '.') { Modified: head/sys/fs/fuse/fuse_vnops.c ============================================================================== --- head/sys/fs/fuse/fuse_vnops.c Sun Feb 2 16:10:33 2020 (r357411) +++ head/sys/fs/fuse/fuse_vnops.c Sun Feb 2 16:34:57 2020 (r357412) @@ -1006,7 +1006,9 @@ fuse_vnop_lookup(struct vop_lookup_args *ap) if (islastcn && vfs_isrdonly(mp) && (nameiop != LOOKUP)) return EROFS; - if ((err = fuse_internal_access(dvp, VEXEC, td, cred))) + if ((cnp->cn_flags & NOEXECCHECK) != 0) + cnp->cn_flags &= ~NOEXECCHECK; + else if ((err = fuse_internal_access(dvp, VEXEC, td, cred))) return err; if (flags & ISDOTDOT) { Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Sun Feb 2 16:10:33 2020 (r357411) +++ head/sys/fs/nfsclient/nfs_clvnops.c Sun Feb 2 16:34:57 2020 (r357412) @@ -1195,7 +1195,8 @@ nfs_lookup(struct vop_lookup_args *ap) } NFSUNLOCKNODE(np); - if ((error = VOP_ACCESS(dvp, VEXEC, cnp->cn_cred, td)) != 0) + error = vn_dir_check_exec(dvp, cnp); + if (error != 0) return (error); error = cache_lookup(dvp, vpp, cnp, &nctime, &ncticks); if (error > 0 && error != ENOENT) Modified: head/sys/fs/smbfs/smbfs_vnops.c ============================================================================== --- head/sys/fs/smbfs/smbfs_vnops.c Sun Feb 2 16:10:33 2020 (r357411) +++ head/sys/fs/smbfs/smbfs_vnops.c Sun Feb 2 16:34:57 2020 (r357412) @@ -1199,7 +1199,8 @@ smbfs_lookup(ap) islastcn = flags & ISLASTCN; if (islastcn && (mp->mnt_flag & MNT_RDONLY) && (nameiop != LOOKUP)) return EROFS; - if ((error = VOP_ACCESS(dvp, VEXEC, cnp->cn_cred, td)) != 0) + error = vn_dir_check_exec(dvp, cnp); + if (error != 0) return error; smp = VFSTOSMBFS(mp); dnp = VTOSMB(dvp); Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Sun Feb 2 16:10:33 2020 (r357411) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Sun Feb 2 16:34:57 2020 (r357412) @@ -90,7 +90,7 @@ tmpfs_lookup1(struct vnode *dvp, struct vnode **vpp, s *vpp = NULLVP; /* Check accessibility of requested node as a first step. */ - error = VOP_ACCESS(dvp, VEXEC, cnp->cn_cred, cnp->cn_thread); + error = vn_dir_check_exec(dvp, cnp); if (error != 0) goto out; Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sun Feb 2 16:10:33 2020 (r357411) +++ head/sys/kern/vfs_cache.c Sun Feb 2 16:34:57 2020 (r357412) @@ -2141,9 +2141,7 @@ vfs_cache_lookup(struct vop_lookup_args *ap) int error; struct vnode **vpp = ap->a_vpp; struct componentname *cnp = ap->a_cnp; - struct ucred *cred = cnp->cn_cred; int flags = cnp->cn_flags; - struct thread *td = cnp->cn_thread; *vpp = NULL; dvp = ap->a_dvp; @@ -2155,8 +2153,8 @@ vfs_cache_lookup(struct vop_lookup_args *ap) (cnp->cn_nameiop == DELETE || cnp->cn_nameiop == RENAME)) return (EROFS); - error = VOP_ACCESS(dvp, VEXEC, cred, td); - if (error) + error = vn_dir_check_exec(dvp, cnp); + if (error != 0) return (error); error = cache_lookup(dvp, vpp, cnp, NULL, NULL); Modified: head/sys/kern/vfs_lookup.c ============================================================================== --- head/sys/kern/vfs_lookup.c Sun Feb 2 16:10:33 2020 (r357411) +++ head/sys/kern/vfs_lookup.c Sun Feb 2 16:34:57 2020 (r357412) @@ -308,6 +308,7 @@ namei(struct nameidata *ndp) struct vnode *dp; /* the directory we are searching */ struct iovec aiov; /* uio for reading symbolic links */ struct componentname *cnp; + struct file *dfp; struct thread *td; struct proc *p; cap_rights_t rights; @@ -445,10 +446,22 @@ namei(struct nameidata *ndp) AUDIT_ARG_ATFD1(ndp->ni_dirfd); if (cnp->cn_flags & AUDITVNODE2) AUDIT_ARG_ATFD2(ndp->ni_dirfd); - error = fgetvp_rights(td, ndp->ni_dirfd, - &rights, &ndp->ni_filecaps, &dp); - if (error == EINVAL) + /* + * Effectively inlined fgetvp_rights, because we need to + * inspect the file as well as grabbing the vnode. + */ + error = fget_cap_locked(fdp, ndp->ni_dirfd, &rights, + &dfp, &ndp->ni_filecaps); + if (error != 0 || dfp->f_ops == &badfileops || + dfp->f_vnode == NULL) { error = ENOTDIR; + } else { + dp = dfp->f_vnode; + vrefact(dp); + + if ((dfp->f_flag & FSEARCH) != 0) + cnp->cn_flags |= NOEXECCHECK; + } #ifdef CAPABILITIES /* * If file descriptor doesn't have all rights, Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sun Feb 2 16:10:33 2020 (r357411) +++ head/sys/kern/vfs_subr.c Sun Feb 2 16:34:57 2020 (r357412) @@ -6377,3 +6377,15 @@ __mnt_vnode_markerfree_lazy(struct vnode **mvp, struct mtx_unlock(&mp->mnt_listmtx); mnt_vnode_markerfree_lazy(mvp, mp); } + +int +vn_dir_check_exec(struct vnode *vp, struct componentname *cnp) +{ + + if ((cnp->cn_flags & NOEXECCHECK) != 0) { + cnp->cn_flags &= ~NOEXECCHECK; + return (0); + } + + return (VOP_ACCESS(vp, VEXEC, cnp->cn_cred, cnp->cn_thread)); +} Modified: head/sys/sys/fcntl.h ============================================================================== --- head/sys/sys/fcntl.h Sun Feb 2 16:10:33 2020 (r357411) +++ head/sys/sys/fcntl.h Sun Feb 2 16:34:57 2020 (r357412) @@ -119,9 +119,11 @@ typedef __pid_t pid_t; #if __POSIX_VISIBLE >= 200809 #define O_DIRECTORY 0x00020000 /* Fail if not directory */ #define O_EXEC 0x00040000 /* Open for execute only */ +#define O_SEARCH O_EXEC #endif #ifdef _KERNEL #define FEXEC O_EXEC +#define FSEARCH O_SEARCH #endif #if __POSIX_VISIBLE >= 200809 Modified: head/sys/sys/namei.h ============================================================================== --- head/sys/sys/namei.h Sun Feb 2 16:10:33 2020 (r357411) +++ head/sys/sys/namei.h Sun Feb 2 16:34:57 2020 (r357412) @@ -161,7 +161,8 @@ struct nameidata { #define AUDITVNODE2 0x08000000 /* audit the looked up vnode information */ #define TRAILINGSLASH 0x10000000 /* path ended in a slash */ #define NOCAPCHECK 0x20000000 /* do not perform capability checks */ -#define PARAMASK 0x3ffffe00 /* mask of parameter descriptors */ +#define NOEXECCHECK 0x40000000 /* do not perform exec check on dir */ +#define PARAMASK 0x7ffffe00 /* mask of parameter descriptors */ /* * Namei results flags Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Sun Feb 2 16:10:33 2020 (r357411) +++ head/sys/sys/vnode.h Sun Feb 2 16:34:57 2020 (r357412) @@ -953,6 +953,8 @@ int vn_chown(struct file *fp, uid_t uid, gid_t gid, st void vn_fsid(struct vnode *vp, struct vattr *va); +int vn_dir_check_exec(struct vnode *vp, struct componentname *cnp); + #define VOP_UNLOCK_FLAGS(vp, flags) ({ \ struct vnode *_vp = (vp); \ int _flags = (flags); \ From owner-svn-src-all@freebsd.org Sun Feb 2 18:07:48 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 878C92352B1; Sun, 2 Feb 2020 18:07:48 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 489f7m32Dhz4Sl0; Sun, 2 Feb 2020 18:07:48 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E3DB1BC08; Sun, 2 Feb 2020 18:07:48 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 012I7m2S046968; Sun, 2 Feb 2020 18:07:48 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 012I7m4L046967; Sun, 2 Feb 2020 18:07:48 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202002021807.012I7m4L046967@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 2 Feb 2020 18:07:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357413 - head/sys/dev/acpi_support X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/dev/acpi_support X-SVN-Commit-Revision: 357413 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2020 18:07:48 -0000 Author: emaste Date: Sun Feb 2 18:07:47 2020 New Revision: 357413 URL: https://svnweb.freebsd.org/changeset/base/357413 Log: acpi_ibm: whitespace fixup Modified: head/sys/dev/acpi_support/acpi_ibm.c Modified: head/sys/dev/acpi_support/acpi_ibm.c ============================================================================== --- head/sys/dev/acpi_support/acpi_ibm.c Sun Feb 2 16:34:57 2020 (r357412) +++ head/sys/dev/acpi_support/acpi_ibm.c Sun Feb 2 18:07:47 2020 (r357413) @@ -276,9 +276,9 @@ static struct { .description = "Mic led", }, { - .name = "privacyguard", - .method = ACPI_IBM_METHOD_PRIVACYGUARD, - .description = "PrivacyGuard enable", + .name = "privacyguard", + .method = ACPI_IBM_METHOD_PRIVACYGUARD, + .description = "PrivacyGuard enable", }, { NULL, 0, NULL, 0 } }; From owner-svn-src-all@freebsd.org Sun Feb 2 18:27:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 183C2235AFF; Sun, 2 Feb 2020 18:27:38 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 489fZd6vc2z4Tm2; Sun, 2 Feb 2020 18:27:37 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E84D01BF9D; Sun, 2 Feb 2020 18:27:37 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 012IRb7L058990; Sun, 2 Feb 2020 18:27:37 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 012IRb8r058989; Sun, 2 Feb 2020 18:27:37 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <202002021827.012IRb8r058989@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 2 Feb 2020 18:27:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357414 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 357414 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2020 18:27:38 -0000 Author: pfg Date: Sun Feb 2 18:27:37 2020 New Revision: 357414 URL: https://svnweb.freebsd.org/changeset/base/357414 Log: ethernet: add some more Ethertypes. Add some types based on other BSDs and also add EtherCat and PROFINET, which are IEC standards. There is a public list (CSV format) at: https://standards.ieee.org/products-services/regauth/ MFC after: 2 weeks Modified: head/sys/net/ethernet.h Modified: head/sys/net/ethernet.h ============================================================================== --- head/sys/net/ethernet.h Sun Feb 2 18:07:47 2020 (r357413) +++ head/sys/net/ethernet.h Sun Feb 2 18:27:37 2020 (r357414) @@ -98,6 +98,11 @@ struct ether_vlan_header { ((((((pri) & 7) << 1) | ((cfi) & 1)) << 12) | ((vlid) & EVL_VLID_MASK)) /* + * Ethernet protocol types. + * + * A public list is available from the IEEE Ragistration Authority: + * https://standards.ieee.org/products-services/regauth/ + * * NOTE: 0x0000-0x05DC (0..1500) are generally IEEE 802.3 length fields. * However, there are some conflicts. */ @@ -347,7 +352,14 @@ struct ether_vlan_header { #define ETHERTYPE_PPPOE 0x8864 /* PPP Over Ethernet Session Stage */ #define ETHERTYPE_LANPROBE 0x8888 /* HP LanProbe test? */ #define ETHERTYPE_PAE 0x888e /* EAPOL PAE/802.1x */ +#define ETHERTYPE_PROFINET 0x8892 /* PROFINET RT Protocol */ +#define ETHERTYPE_AOE 0x88a2 /* ATA Protocol */ +#define ETHERTYPE_ETHERCAT 0x88a4 /* EtherCat Protocol */ +#define ETHERTYPE_FCOE 0x8906 /* Fibre Channel over Ethernet */ #define ETHERTYPE_QINQ 0x88A8 /* 802.1ad VLAN stacking */ +#define ETHERTYPE_LLDP 0x88CC /* Link Layer Discovery Protocol */ +#define ETHERTYPE_MACSEC 0x88e5 /* 802.1AE MAC Security */ +#define ETHERTYPE_PBB 0x88e7 /* 802.1Q Provider Backbone Bridges */ #define ETHERTYPE_LOOPBACK 0x9000 /* Loopback: used to test interfaces */ #define ETHERTYPE_8021Q9100 0x9100 /* IEEE 802.1Q stacking (proprietary) */ #define ETHERTYPE_LBACK ETHERTYPE_LOOPBACK /* DEC MOP loopback */ From owner-svn-src-all@freebsd.org Sun Feb 2 18:33:21 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 31FFB236014; Sun, 2 Feb 2020 18:33:21 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 489fjF0X7Hz4VGl; Sun, 2 Feb 2020 18:33:21 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0D3D51C167; Sun, 2 Feb 2020 18:33:21 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 012IXKud064577; Sun, 2 Feb 2020 18:33:20 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 012IXKdJ064576; Sun, 2 Feb 2020 18:33:20 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <202002021833.012IXKdJ064576@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 2 Feb 2020 18:33:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357415 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 357415 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2020 18:33:21 -0000 Author: pfg Date: Sun Feb 2 18:33:20 2020 New Revision: 357415 URL: https://svnweb.freebsd.org/changeset/base/357415 Log: ethernet: add some more Ethertypes. Sort ETHERTYPE_FCOE, from r357414. Modified: head/sys/net/ethernet.h Modified: head/sys/net/ethernet.h ============================================================================== --- head/sys/net/ethernet.h Sun Feb 2 18:27:37 2020 (r357414) +++ head/sys/net/ethernet.h Sun Feb 2 18:33:20 2020 (r357415) @@ -355,11 +355,11 @@ struct ether_vlan_header { #define ETHERTYPE_PROFINET 0x8892 /* PROFINET RT Protocol */ #define ETHERTYPE_AOE 0x88a2 /* ATA Protocol */ #define ETHERTYPE_ETHERCAT 0x88a4 /* EtherCat Protocol */ -#define ETHERTYPE_FCOE 0x8906 /* Fibre Channel over Ethernet */ #define ETHERTYPE_QINQ 0x88A8 /* 802.1ad VLAN stacking */ #define ETHERTYPE_LLDP 0x88CC /* Link Layer Discovery Protocol */ #define ETHERTYPE_MACSEC 0x88e5 /* 802.1AE MAC Security */ #define ETHERTYPE_PBB 0x88e7 /* 802.1Q Provider Backbone Bridges */ +#define ETHERTYPE_FCOE 0x8906 /* Fibre Channel over Ethernet */ #define ETHERTYPE_LOOPBACK 0x9000 /* Loopback: used to test interfaces */ #define ETHERTYPE_8021Q9100 0x9100 /* IEEE 802.1Q stacking (proprietary) */ #define ETHERTYPE_LBACK ETHERTYPE_LOOPBACK /* DEC MOP loopback */ From owner-svn-src-all@freebsd.org Sun Feb 2 19:01:17 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6ED6A236930; Sun, 2 Feb 2020 19:01:17 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 489gKT2HDpz4WbK; Sun, 2 Feb 2020 19:01:17 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 496B01C5B2; Sun, 2 Feb 2020 19:01:17 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 012J1HKP079687; Sun, 2 Feb 2020 19:01:17 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 012J1H2p079686; Sun, 2 Feb 2020 19:01:17 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202002021901.012J1H2p079686@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 2 Feb 2020 19:01:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357416 - head/sys/dev/acpi_support X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/dev/acpi_support X-SVN-Commit-Revision: 357416 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2020 19:01:17 -0000 Author: emaste Date: Sun Feb 2 19:01:16 2020 New Revision: 357416 URL: https://svnweb.freebsd.org/changeset/base/357416 Log: acpi_ibm: whitespace and wrapping cleanup Modified: head/sys/dev/acpi_support/acpi_ibm.c Modified: head/sys/dev/acpi_support/acpi_ibm.c ============================================================================== --- head/sys/dev/acpi_support/acpi_ibm.c Sun Feb 2 18:33:20 2020 (r357415) +++ head/sys/dev/acpi_support/acpi_ibm.c Sun Feb 2 19:01:16 2020 (r357416) @@ -363,8 +363,7 @@ static driver_t acpi_ibm_driver = { static devclass_t acpi_ibm_devclass; -DRIVER_MODULE(acpi_ibm, acpi, acpi_ibm_driver, acpi_ibm_devclass, - 0, 0); +DRIVER_MODULE(acpi_ibm, acpi, acpi_ibm_driver, acpi_ibm_devclass, 0, 0); MODULE_DEPEND(acpi_ibm, acpi, 1, 1, 1); static char *ibm_ids[] = {"IBM0068", "LEN0068", "LEN0268", NULL}; @@ -384,7 +383,7 @@ acpi_status_to_errno(ACPI_STATUS status) static void ibm_led(void *softc, int onoff) { - struct acpi_ibm_softc* sc = (struct acpi_ibm_softc*) softc; + struct acpi_ibm_softc *sc = (struct acpi_ibm_softc *)softc; ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); @@ -410,7 +409,7 @@ ibm_led_task(struct acpi_ibm_softc *sc, int pending __ } static int -acpi_ibm_mic_led_set (struct acpi_ibm_softc *sc, int arg) +acpi_ibm_mic_led_set(struct acpi_ibm_softc *sc, int arg) { ACPI_OBJECT_LIST input; ACPI_OBJECT params[1]; @@ -429,10 +428,10 @@ acpi_ibm_mic_led_set (struct acpi_ibm_softc *sc, int a input.Pointer = params; input.Count = 1; - status = AcpiEvaluateObject (sc->handle, "MMTS", &input, NULL); + status = AcpiEvaluateObject(sc->handle, "MMTS", &input, NULL); if (ACPI_SUCCESS(status)) sc->mic_led_state = arg; - return(status); + return (status); } return (0); @@ -443,14 +442,13 @@ acpi_ibm_probe(device_t dev) { int rv; - if (acpi_disabled("ibm") || - device_get_unit(dev) != 0) + if (acpi_disabled("ibm") || device_get_unit(dev) != 0) return (ENXIO); rv = ACPI_ID_PROBE(device_get_parent(dev), dev, ibm_ids, NULL); - if (rv <= 0) + if (rv <= 0) device_set_desc(dev, "ThinkPad ACPI Extras"); - + return (rv); } @@ -459,7 +457,7 @@ acpi_ibm_attach(device_t dev) { int i; int hkey; - struct acpi_ibm_softc *sc; + struct acpi_ibm_softc *sc; char *maker, *product; ACPI_OBJECT_LIST input; ACPI_OBJECT params[1]; @@ -474,12 +472,12 @@ acpi_ibm_attach(device_t dev) sc->handle = acpi_get_handle(dev); /* Look for the first embedded controller */ - if (!(ec_devclass = devclass_find ("acpi_ec"))) { + if (!(ec_devclass = devclass_find ("acpi_ec"))) { if (bootverbose) device_printf(dev, "Couldn't find acpi_ec devclass\n"); return (EINVAL); } - if (!(sc->ec_dev = devclass_get_device(ec_devclass, 0))) { + if (!(sc->ec_dev = devclass_get_device(ec_devclass, 0))) { if (bootverbose) device_printf(dev, "Couldn't find acpi_ec device\n"); return (EINVAL); @@ -496,14 +494,13 @@ acpi_ibm_attach(device_t dev) if (sc->events_mask_supported) { SYSCTL_ADD_UINT(sc->sysctl_ctx, - SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, - "initialmask", CTLFLAG_RD, - &sc->events_initialmask, 0, "Initial eventmask"); + SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, "initialmask", + CTLFLAG_RD, &sc->events_initialmask, 0, + "Initial eventmask"); if (ACPI_SUCCESS (acpi_GetInteger(sc->handle, "MHKV", &hkey))) { device_printf(dev, "Firmware version is 0x%X\n", hkey); - switch(hkey >> 8) - { + switch (hkey >> 8) { case 1: /* The availmask is the bitmask of supported events */ if (ACPI_FAILURE(acpi_GetInteger(sc->handle, @@ -561,18 +558,17 @@ acpi_ibm_attach(device_t dev) /* Hook up thermal node */ if (acpi_ibm_sysctl_init(sc, ACPI_IBM_METHOD_THERMAL)) { SYSCTL_ADD_PROC(sc->sysctl_ctx, - SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, - "thermal", CTLTYPE_INT | CTLFLAG_RD, - sc, 0, acpi_ibm_thermal_sysctl, "I", - "Thermal zones"); + SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, "thermal", + CTLTYPE_INT | CTLFLAG_RD, sc, 0, acpi_ibm_thermal_sysctl, + "I", "Thermal zones"); } /* Hook up handlerevents node */ if (acpi_ibm_sysctl_init(sc, ACPI_IBM_METHOD_HANDLEREVENTS)) { SYSCTL_ADD_PROC(sc->sysctl_ctx, - SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, - "handlerevents", CTLTYPE_STRING | CTLFLAG_RW, - sc, 0, acpi_ibm_handlerevents_sysctl, "I", + SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, "handlerevents", + CTLTYPE_STRING | CTLFLAG_RW, sc, 0, + acpi_ibm_handlerevents_sysctl, "I", "devd(8) events handled by acpi_ibm"); } @@ -610,7 +606,6 @@ nosmbios: acpi_ibm_sysctl_set(sc, ACPI_IBM_METHOD_EVENTS, 1); ACPI_SERIAL_END(ibm); - return (0); } @@ -677,7 +672,7 @@ acpi_ibm_eventmask_set(struct acpi_ibm_softc *sc, int arg[1].Type = ACPI_TYPE_INTEGER; for (int i = 0; i < 32; ++i) { - arg[0].Integer.Value = i+1; + arg[0].Integer.Value = i + 1; arg[1].Integer.Value = (((1 << i) & val) != 0); status = AcpiEvaluateObject(sc->handle, IBM_NAME_EVENTS_MASK_SET, &args, NULL); @@ -814,8 +809,7 @@ acpi_ibm_sysctl_get(struct acpi_ibm_softc *sc, int met if (sc->fan_handle) { if(ACPI_FAILURE(acpi_GetInteger(sc->fan_handle, NULL, &val))) val = -1; - } - else { + } else { ACPI_EC_READ(sc->ec_dev, IBM_EC_FANSPEED, &val_ec, 2); val = val_ec; } @@ -841,10 +835,10 @@ acpi_ibm_sysctl_get(struct acpi_ibm_softc *sc, int met if (!sc->fan_handle) { ACPI_EC_READ(sc->ec_dev, IBM_EC_FANSTATUS, &val_ec, 1); val = (val_ec & IBM_EC_MASK_FANSTATUS) == IBM_EC_MASK_FANSTATUS; - } - else + } else val = -1; break; + case ACPI_IBM_METHOD_MIC_LED: if (sc->mic_led_handle) return sc->mic_led_state; @@ -855,7 +849,6 @@ acpi_ibm_sysctl_get(struct acpi_ibm_softc *sc, int met case ACPI_IBM_METHOD_PRIVACYGUARD: val = acpi_ibm_privacyguard_get(sc); break; - } return (val); @@ -901,7 +894,7 @@ acpi_ibm_sysctl_set(struct acpi_ibm_softc *sc, int met break; case ACPI_IBM_METHOD_MIC_LED: - return acpi_ibm_mic_led_set (sc, arg); + return acpi_ibm_mic_led_set(sc, arg); break; case ACPI_IBM_METHOD_THINKLIGHT: @@ -971,10 +964,9 @@ acpi_ibm_sysctl_init(struct acpi_ibm_softc *sc, int me if (ACPI_SUCCESS(AcpiGetHandle(sc->handle, "MMTS", &sc->mic_led_handle))) { /* Turn off mic led by default */ - acpi_ibm_mic_led_set (sc, 0); - return(TRUE); - } - else + acpi_ibm_mic_led_set(sc, 0); + return (TRUE); + } else sc->mic_led_handle = NULL; return (FALSE); @@ -995,8 +987,7 @@ acpi_ibm_sysctl_init(struct acpi_ibm_softc *sc, int me else if (ACPI_SUCCESS(AcpiGetHandle(sc->handle, "\\LGHT", &sc->light_handle))) { sc->light_cmd_on = 1; sc->light_cmd_off = 0; - } - else + } else sc->light_handle = NULL; sc->light_set_supported = (sc->light_handle && @@ -1050,7 +1041,6 @@ acpi_ibm_sysctl_init(struct acpi_ibm_softc *sc, int me case ACPI_IBM_METHOD_PRIVACYGUARD: return (acpi_ibm_privacyguard_get(sc) != -1); - } return (FALSE); } @@ -1273,7 +1263,8 @@ acpi_ibm_thinklight_set(struct acpi_ibm_softc *sc, int * Only meant to be used internally by the get/set functions below. */ static ACPI_STATUS -acpi_ibm_privacyguard_acpi_call(struct acpi_ibm_softc *sc, bool write, int *arg) { +acpi_ibm_privacyguard_acpi_call(struct acpi_ibm_softc *sc, bool write, int *arg) +{ ACPI_OBJECT Arg; ACPI_OBJECT_LIST Args; ACPI_STATUS status; @@ -1484,7 +1475,6 @@ acpi_ibm_notify(ACPI_HANDLE h, UINT32 notify, void *co acpi_GetInteger(acpi_get_handle(dev), IBM_NAME_EVENTS_GET, &event); if (event == 0) break; - type = (event >> 12) & 0xf; arg = event & 0xfff; From owner-svn-src-all@freebsd.org Sun Feb 2 19:02:08 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 25E74236B94; Sun, 2 Feb 2020 19:02:08 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 489gLS0Ggxz4Wvp; Sun, 2 Feb 2020 19:02:08 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 030521C71A; Sun, 2 Feb 2020 19:02:08 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 012J27di082954; Sun, 2 Feb 2020 19:02:07 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 012J27Kn082953; Sun, 2 Feb 2020 19:02:07 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <202002021902.012J27Kn082953@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 2 Feb 2020 19:02:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357417 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 357417 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2020 19:02:08 -0000 Author: pfg Date: Sun Feb 2 19:02:07 2020 New Revision: 357417 URL: https://svnweb.freebsd.org/changeset/base/357417 Log: style(9): Fix spaces after #define. No functional change. Modified: head/sys/net/ethernet.h Modified: head/sys/net/ethernet.h ============================================================================== --- head/sys/net/ethernet.h Sun Feb 2 19:01:16 2020 (r357416) +++ head/sys/net/ethernet.h Sun Feb 2 19:02:07 2020 (r357417) @@ -6,7 +6,7 @@ */ #ifndef _NET_ETHERNET_H_ -#define _NET_ETHERNET_H_ +#define _NET_ETHERNET_H_ /* * Some basic Ethernet constants. @@ -271,7 +271,7 @@ struct ether_vlan_header { #define ETHERTYPE_AARP 0x80F3 /* AppleTalk AARP */ /* 0x80F4 - 0x80F5 Kinetics */ #define ETHERTYPE_APOLLO 0x80F7 /* Apollo Computer */ -#define ETHERTYPE_VLAN 0x8100 /* IEEE 802.1Q VLAN tagging (XXX conflicts) */ +#define ETHERTYPE_VLAN 0x8100 /* IEEE 802.1Q VLAN tagging (XXX conflicts) */ /* 0x80FF - 0x8101 Wellfleet Communications (XXX conflicts) */ #define ETHERTYPE_BOFL 0x8102 /* Wellfleet; BOFL (Breath OF Life) pkts [every 5-10 secs.] */ #define ETHERTYPE_WELLFLEET 0x8103 /* Wellfleet Communications */ @@ -344,7 +344,7 @@ struct ether_vlan_header { #define ETHERTYPE_SLOW 0x8809 /* 802.3ad link aggregation (LACP) */ #define ETHERTYPE_PPP 0x880B /* PPP (obsolete by PPPoE) */ #define ETHERTYPE_HITACHI 0x8820 /* Hitachi Cable (Optoelectronic Systems Laboratory) */ -#define ETHERTYPE_TEST 0x8822 /* Network Conformance Testing */ +#define ETHERTYPE_TEST 0x8822 /* Network Conformance Testing */ #define ETHERTYPE_MPLS 0x8847 /* MPLS Unicast */ #define ETHERTYPE_MPLS_MCAST 0x8848 /* MPLS Multicast */ #define ETHERTYPE_AXIS 0x8856 /* Axis Communications AB proprietary bootstrap/config */ @@ -393,7 +393,7 @@ struct ether_vlan_header { * ether_vlan_mtap. This function will re-insert VLAN tags for the duration * of the tap, so they show up properly for network analyzers. */ -#define ETHER_BPF_MTAP(_ifp, _m) do { \ +#define ETHER_BPF_MTAP(_ifp, _m) do { \ if (bpf_peers_present((_ifp)->if_bpf)) { \ M_ASSERTVALID(_m); \ if (((_m)->m_flags & M_VLANTAG) != 0) \ From owner-svn-src-all@freebsd.org Sun Feb 2 19:16:53 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 66FF4237059; Sun, 2 Feb 2020 19:16:53 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 489ggT26lDz4XXF; Sun, 2 Feb 2020 19:16:53 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 43AF41C91A; Sun, 2 Feb 2020 19:16:53 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 012JGriB089773; Sun, 2 Feb 2020 19:16:53 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 012JGrnl089772; Sun, 2 Feb 2020 19:16:53 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <202002021916.012JGrnl089772@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Sun, 2 Feb 2020 19:16:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357418 - head/lib/msun/powerpc X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: head/lib/msun/powerpc X-SVN-Commit-Revision: 357418 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2020 19:16:53 -0000 Author: bdragon Date: Sun Feb 2 19:16:52 2020 New Revision: 357418 URL: https://svnweb.freebsd.org/changeset/base/357418 Log: [PowerPC] Fix feholdexcept() on powerpc referencing the wrong struct member In r355656, endianness handling of the floating point environment was fixed in the PowerPC code to work as intended. However, one bit got missed, causing feholdexcept() to mis-save the fenv. Submitted by: Renato Riolino Differential Revision: https://reviews.freebsd.org/D23382 Modified: head/lib/msun/powerpc/fenv.h Modified: head/lib/msun/powerpc/fenv.h ============================================================================== --- head/lib/msun/powerpc/fenv.h Sun Feb 2 19:02:07 2020 (r357417) +++ head/lib/msun/powerpc/fenv.h Sun Feb 2 19:16:52 2020 (r357418) @@ -217,7 +217,7 @@ feholdexcept(fenv_t *__envp) union __fpscr __r; __mffs(&__r); - *__envp = __r.__d; + *__envp = __r.__bits.__reg; __r.__bits.__reg &= ~(FE_ALL_EXCEPT | _ENABLE_MASK); __mtfsf(__r); return (0); From owner-svn-src-all@freebsd.org Sun Feb 2 19:45:13 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7B5C8237D9C; Sun, 2 Feb 2020 19:45:13 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 489hJ91NyCz4Z22; Sun, 2 Feb 2020 19:45:13 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 26D671CEB2; Sun, 2 Feb 2020 19:45:13 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 012JjDYh009387; Sun, 2 Feb 2020 19:45:13 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 012JjC3W009385; Sun, 2 Feb 2020 19:45:12 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202002021945.012JjC3W009385@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 2 Feb 2020 19:45:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357419 - in head: include lib/libc/stdio X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: include lib/libc/stdio X-SVN-Commit-Revision: 357419 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2020 19:45:13 -0000 Author: kevans Date: Sun Feb 2 19:45:12 2020 New Revision: 357419 URL: https://svnweb.freebsd.org/changeset/base/357419 Log: libc: provide fputc_unlocked Among the same justification as the other stdio _unlocked; in addition to an inline version in , we must provide a function in libc as well for the functionality. This fixes the lang/gcc* builds, which want to use the symbol from libc. PR: 243810 Reported by: antoine, swills, Michael X-MFC-With: r357284 Modified: head/include/stdio.h head/lib/libc/stdio/Symbol.map head/lib/libc/stdio/fputc.c Modified: head/include/stdio.h ============================================================================== --- head/include/stdio.h Sun Feb 2 19:16:52 2020 (r357418) +++ head/include/stdio.h Sun Feb 2 19:45:12 2020 (r357419) @@ -348,6 +348,7 @@ int feof_unlocked(FILE *); int ferror_unlocked(FILE *); int fflush_unlocked(FILE *); int fileno_unlocked(FILE *); +int fputc_unlocked(int, FILE *); int fputs_unlocked(const char * __restrict, FILE * __restrict); size_t fread_unlocked(void * __restrict, size_t, size_t, FILE * __restrict); size_t fwrite_unlocked(const void * __restrict, size_t, size_t, Modified: head/lib/libc/stdio/Symbol.map ============================================================================== --- head/lib/libc/stdio/Symbol.map Sun Feb 2 19:16:52 2020 (r357418) +++ head/lib/libc/stdio/Symbol.map Sun Feb 2 19:45:12 2020 (r357419) @@ -173,6 +173,7 @@ FBSD_1.5 { FBSD_1.6 { fflush_unlocked; + fputc_unlocked; fputs_unlocked; fread_unlocked; fwrite_unlocked; Modified: head/lib/libc/stdio/fputc.c ============================================================================== --- head/lib/libc/stdio/fputc.c Sun Feb 2 19:16:52 2020 (r357418) +++ head/lib/libc/stdio/fputc.c Sun Feb 2 19:45:12 2020 (r357419) @@ -47,13 +47,21 @@ __FBSDID("$FreeBSD$"); #undef fputc_unlocked int +fputc_unlocked(int c, FILE *fp) +{ + + /* Orientation set by __sputc() when buffer is full. */ + /* ORIENT(fp, -1); */ + return (__sputc(c, fp)); +} + +int fputc(int c, FILE *fp) { int retval; + FLOCKFILE_CANCELSAFE(fp); - /* Orientation set by __sputc() when buffer is full. */ - /* ORIENT(fp, -1); */ - retval = __sputc(c, fp); + retval = fputc_unlocked(c, fp); FUNLOCKFILE_CANCELSAFE(); return (retval); } From owner-svn-src-all@freebsd.org Sun Feb 2 19:47:51 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 12787237EDA; Sun, 2 Feb 2020 19:47:51 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 489hMB6Q83z4ZHl; Sun, 2 Feb 2020 19:47:50 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qt1-f176.google.com (mail-qt1-f176.google.com [209.85.160.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id CB38D14F20; Sun, 2 Feb 2020 19:47:50 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qt1-f176.google.com with SMTP id v25so9812949qto.7; Sun, 02 Feb 2020 11:47:50 -0800 (PST) X-Gm-Message-State: APjAAAUoaGUYY77en8QjnaosiRQbEPMni4np9xz2+C8hhL/gojNTro5q xFO2mM8Az2y7/WbgCsU2PtLgKRw1CswiUv0U8GE= X-Google-Smtp-Source: APXvYqxzxkQkQlojgprCTAhSE+tnJ6d+MyjvpS3Dj3102LXW8P8G5Byinsi/vSkBCbYB+96o+1OpihiQtwpzvC5MPco= X-Received: by 2002:aed:3f70:: with SMTP id q45mr4973866qtf.310.1580672870138; Sun, 02 Feb 2020 11:47:50 -0800 (PST) MIME-Version: 1.0 References: <202001300331.00U3VGCe017289@repo.freebsd.org> In-Reply-To: From: Kyle Evans Date: Sun, 2 Feb 2020 13:47:38 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r357284 - in head: include lib/libc/stdio To: Antoine Brodin Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2020 19:47:51 -0000 On Sun, Feb 2, 2020 at 12:57 AM Antoine Brodin wrote: > > On Thu, Jan 30, 2020 at 4:31 AM Kyle Evans wrote: > > > > Author: kevans > > Date: Thu Jan 30 03:31:16 2020 > > New Revision: 357284 > > URL: https://svnweb.freebsd.org/changeset/base/357284 > > > > Log: > > stdio: provide _unlocked variants of fflush, fputc, fputs, fread, fwrite > > > > fflush_unlocked is currently desired in ports by sysutils/metalog, and > > redefined as the locked fflush. > > > > fputc_unlocked, fputs_unlocked, fread_unlocked, and fwrite_unlocked are > > currently desired in ports by devel/elfutils, and redefined as the locked > > fputs, fread, and fwrite respectively. > > > > Reviewed by: kib > > MFC after: 2 weeks > > Differential Revision: https://reviews.freebsd.org/D23336 > > Hi, > > It seems that this change broke lang/gcc* ports. > Tested/fixed with r357419; sorry for the breakage! Thanks, Kyle Evans From owner-svn-src-all@freebsd.org Sun Feb 2 20:51:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 257D9239C3D; Sun, 2 Feb 2020 20:51:29 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 489jmd0C72z4dsj; Sun, 2 Feb 2020 20:51:29 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F2B3A1DA29; Sun, 2 Feb 2020 20:51:28 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 012KpSCL046067; Sun, 2 Feb 2020 20:51:28 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 012KpS5V046066; Sun, 2 Feb 2020 20:51:28 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202002022051.012KpS5V046066@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 2 Feb 2020 20:51:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357420 - head/bin/pwait X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/bin/pwait X-SVN-Commit-Revision: 357420 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2020 20:51:29 -0000 Author: delphij Date: Sun Feb 2 20:51:28 2020 New Revision: 357420 URL: https://svnweb.freebsd.org/changeset/base/357420 Log: Remove unused include. MFC after: 2 weeks Modified: head/bin/pwait/pwait.c Modified: head/bin/pwait/pwait.c ============================================================================== --- head/bin/pwait/pwait.c Sun Feb 2 19:45:12 2020 (r357419) +++ head/bin/pwait/pwait.c Sun Feb 2 20:51:28 2020 (r357420) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include From owner-svn-src-all@freebsd.org Sun Feb 2 20:53:31 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ED7E0239FB6; Sun, 2 Feb 2020 20:53:31 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 489jpz61TCz4fFK; Sun, 2 Feb 2020 20:53:31 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C9F161DB82; Sun, 2 Feb 2020 20:53:31 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 012KrVdx051059; Sun, 2 Feb 2020 20:53:31 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 012KrVLf051058; Sun, 2 Feb 2020 20:53:31 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202002022053.012KrVLf051058@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 2 Feb 2020 20:53:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357421 - head/sbin/fsck_msdosfs X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/sbin/fsck_msdosfs X-SVN-Commit-Revision: 357421 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2020 20:53:32 -0000 Author: delphij Date: Sun Feb 2 20:53:31 2020 New Revision: 357421 URL: https://svnweb.freebsd.org/changeset/base/357421 Log: Diff reduction against NetBSD, no functional change. MFC after: 1 week Modified: head/sbin/fsck_msdosfs/boot.c Modified: head/sbin/fsck_msdosfs/boot.c ============================================================================== --- head/sbin/fsck_msdosfs/boot.c Sun Feb 2 20:51:28 2020 (r357420) +++ head/sbin/fsck_msdosfs/boot.c Sun Feb 2 20:53:31 2020 (r357421) @@ -28,7 +28,7 @@ #include #ifndef lint -__RCSID("$NetBSD: boot.c,v 1.21 2018/02/08 09:05:17 dholland Exp $"); +__RCSID("$NetBSD: boot.c,v 1.22 2020/01/11 16:29:07 christos Exp $"); static const char rcsid[] = "$FreeBSD$"; #endif /* not lint */ @@ -267,10 +267,11 @@ readboot(int dosfs, struct bootblock *boot) } /* - * The number of clusters is derived from available data sectors, divided - * by sectors per cluster. + * The number of clusters is derived from available data sectors, + * divided by sectors per cluster. */ - boot->NumClusters = (boot->NumSectors - boot->FirstCluster) / boot->bpbSecPerClust; + boot->NumClusters = + (boot->NumSectors - boot->FirstCluster) / boot->bpbSecPerClust; if (boot->flags & FAT32) { if (boot->NumClusters > (CLUST_RSRVD & CLUST32_MASK)) { @@ -320,8 +321,8 @@ readboot(int dosfs, struct bootblock *boot) } /* - * There are two reserved clusters. To avoid adding CLUST_FIRST every time - * when we perform boundary checks, we increment the NumClusters by 2, + * There are two reserved clusters. To avoid adding CLUST_FIRST every + * time we perform boundary checks, we increment the NumClusters by 2, * which is CLUST_FIRST to denote the first out-of-range cluster number. */ boot->NumClusters += CLUST_FIRST; From owner-svn-src-all@freebsd.org Sun Feb 2 20:56:19 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7BE5323A05F; Sun, 2 Feb 2020 20:56:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 489jtC2khLz4fNt; Sun, 2 Feb 2020 20:56:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 549E61DB83; Sun, 2 Feb 2020 20:56:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 012KuJlX051263; Sun, 2 Feb 2020 20:56:19 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 012KuJL2051262; Sun, 2 Feb 2020 20:56:19 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202002022056.012KuJL2051262@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 2 Feb 2020 20:56:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357422 - head/sys/dev/acpi_support X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/dev/acpi_support X-SVN-Commit-Revision: 357422 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2020 20:56:19 -0000 Author: emaste Date: Sun Feb 2 20:56:18 2020 New Revision: 357422 URL: https://svnweb.freebsd.org/changeset/base/357422 Log: acpi_ibm: remove superfluous cast Reported by: kib Modified: head/sys/dev/acpi_support/acpi_ibm.c Modified: head/sys/dev/acpi_support/acpi_ibm.c ============================================================================== --- head/sys/dev/acpi_support/acpi_ibm.c Sun Feb 2 20:53:31 2020 (r357421) +++ head/sys/dev/acpi_support/acpi_ibm.c Sun Feb 2 20:56:18 2020 (r357422) @@ -383,7 +383,7 @@ acpi_status_to_errno(ACPI_STATUS status) static void ibm_led(void *softc, int onoff) { - struct acpi_ibm_softc *sc = (struct acpi_ibm_softc *)softc; + struct acpi_ibm_softc *sc = softc; ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); From owner-svn-src-all@freebsd.org Mon Feb 3 01:08:16 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 03D8223F4E4; Mon, 3 Feb 2020 01:08:16 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 489qSv6K9Yz3Npv; Mon, 3 Feb 2020 01:08:15 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D421420B06; Mon, 3 Feb 2020 01:08:15 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 01318FWI000357; Mon, 3 Feb 2020 01:08:15 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01318FsA000356; Mon, 3 Feb 2020 01:08:15 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <202002030108.01318FsA000356@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 3 Feb 2020 01:08:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357423 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 357423 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 01:08:16 -0000 Author: pfg Date: Mon Feb 3 01:08:15 2020 New Revision: 357423 URL: https://svnweb.freebsd.org/changeset/base/357423 Log: ethernet: Minor cleanup. Consistently use uppercase for ethertype hex numbers. Modified: head/sys/net/ethernet.h Modified: head/sys/net/ethernet.h ============================================================================== --- head/sys/net/ethernet.h Sun Feb 2 20:56:18 2020 (r357422) +++ head/sys/net/ethernet.h Mon Feb 3 01:08:15 2020 (r357423) @@ -351,14 +351,14 @@ struct ether_vlan_header { #define ETHERTYPE_PPPOEDISC 0x8863 /* PPP Over Ethernet Discovery Stage */ #define ETHERTYPE_PPPOE 0x8864 /* PPP Over Ethernet Session Stage */ #define ETHERTYPE_LANPROBE 0x8888 /* HP LanProbe test? */ -#define ETHERTYPE_PAE 0x888e /* EAPOL PAE/802.1x */ +#define ETHERTYPE_PAE 0x888E /* EAPOL PAE/802.1x */ #define ETHERTYPE_PROFINET 0x8892 /* PROFINET RT Protocol */ -#define ETHERTYPE_AOE 0x88a2 /* ATA Protocol */ -#define ETHERTYPE_ETHERCAT 0x88a4 /* EtherCat Protocol */ +#define ETHERTYPE_AOE 0x88A2 /* ATA Protocol */ +#define ETHERTYPE_ETHERCAT 0x88A4 /* EtherCat Protocol */ #define ETHERTYPE_QINQ 0x88A8 /* 802.1ad VLAN stacking */ #define ETHERTYPE_LLDP 0x88CC /* Link Layer Discovery Protocol */ -#define ETHERTYPE_MACSEC 0x88e5 /* 802.1AE MAC Security */ -#define ETHERTYPE_PBB 0x88e7 /* 802.1Q Provider Backbone Bridges */ +#define ETHERTYPE_MACSEC 0x88E5 /* 802.1AE MAC Security */ +#define ETHERTYPE_PBB 0x88E7 /* 802.1Q Provider Backbone Bridges */ #define ETHERTYPE_FCOE 0x8906 /* Fibre Channel over Ethernet */ #define ETHERTYPE_LOOPBACK 0x9000 /* Loopback: used to test interfaces */ #define ETHERTYPE_8021Q9100 0x9100 /* IEEE 802.1Q stacking (proprietary) */ From owner-svn-src-all@freebsd.org Mon Feb 3 02:02:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 30C6A24025C; Mon, 3 Feb 2020 02:02:14 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 489rgB0Yvfz3QnS; Mon, 3 Feb 2020 02:02:14 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0E7F5215B1; Mon, 3 Feb 2020 02:02:14 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 01322Dno035235; Mon, 3 Feb 2020 02:02:13 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01322DQh035234; Mon, 3 Feb 2020 02:02:13 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <202002030202.01322DQh035234@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 3 Feb 2020 02:02:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357424 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 357424 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 02:02:14 -0000 Author: pfg Date: Mon Feb 3 02:02:13 2020 New Revision: 357424 URL: https://svnweb.freebsd.org/changeset/base/357424 Log: typo: Registration. Pointed by: Dikshie Fauzie Modified: head/sys/net/ethernet.h Modified: head/sys/net/ethernet.h ============================================================================== --- head/sys/net/ethernet.h Mon Feb 3 01:08:15 2020 (r357423) +++ head/sys/net/ethernet.h Mon Feb 3 02:02:13 2020 (r357424) @@ -100,7 +100,7 @@ struct ether_vlan_header { /* * Ethernet protocol types. * - * A public list is available from the IEEE Ragistration Authority: + * A public list is available from the IEEE Registration Authority: * https://standards.ieee.org/products-services/regauth/ * * NOTE: 0x0000-0x05DC (0..1500) are generally IEEE 802.3 length fields. From owner-svn-src-all@freebsd.org Mon Feb 3 05:19:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6E2DE2433BD; Mon, 3 Feb 2020 05:19:45 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 489x352H9Xz459j; Mon, 3 Feb 2020 05:19:45 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 499D623955; Mon, 3 Feb 2020 05:19:45 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0135Jj1k050125; Mon, 3 Feb 2020 05:19:45 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0135Jjqs050124; Mon, 3 Feb 2020 05:19:45 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202002030519.0135Jjqs050124@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 3 Feb 2020 05:19:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357425 - head/sys/netinet/libalias X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/netinet/libalias X-SVN-Commit-Revision: 357425 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 05:19:45 -0000 Author: cem Date: Mon Feb 3 05:19:44 2020 New Revision: 357425 URL: https://svnweb.freebsd.org/changeset/base/357425 Log: netinet/libalias: Fix typo in debug message No functional change. PR: 243831 Submitted by: Neel Chauhan Differential Revision: https://reviews.freebsd.org/D23365 Modified: head/sys/netinet/libalias/alias_db.c Modified: head/sys/netinet/libalias/alias_db.c ============================================================================== --- head/sys/netinet/libalias/alias_db.c Mon Feb 3 02:02:13 2020 (r357424) +++ head/sys/netinet/libalias/alias_db.c Mon Feb 3 05:19:44 2020 (r357425) @@ -664,7 +664,7 @@ GetNewPort(struct libalias *la, struct alias_link *lnk } #ifdef LIBALIAS_DEBUG - fprintf(stderr, "PacketAlias/GetnewPort(): "); + fprintf(stderr, "PacketAlias/GetNewPort(): "); fprintf(stderr, "could not find free port\n"); #endif From owner-svn-src-all@freebsd.org Mon Feb 3 05:38:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 47DA2243C97; Mon, 3 Feb 2020 05:38:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 489xT217hGz46fK; Mon, 3 Feb 2020 05:38:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1D69823CF3; Mon, 3 Feb 2020 05:38:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0135cj5M062163; Mon, 3 Feb 2020 05:38:45 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0135cjpM062162; Mon, 3 Feb 2020 05:38:45 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202002030538.0135cjpM062162@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 3 Feb 2020 05:38:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357426 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 357426 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 05:38:46 -0000 Author: imp Date: Mon Feb 3 05:38:45 2020 New Revision: 357426 URL: https://svnweb.freebsd.org/changeset/base/357426 Log: On powerpc, we use ofw_syscons for device sc. That references the default fonts. As a workaround, remove the static. vt is default on powerpc, but there's a few old macs that still fail with vt. sc is used as a work arouond for those machines, and the kernel fails to build w/o it. Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Feb 3 05:19:44 2020 (r357425) +++ head/sys/conf/files Mon Feb 3 05:38:45 2020 (r357426) @@ -35,7 +35,7 @@ feeder_rate_gen.h optional sound \ no-obj no-implicit-rule before-depend \ clean "feeder_rate_gen.h" font.h optional sc_dflt_font \ - compile-with "uudecode < ${SRCTOP}/share/syscons/fonts/${SC_DFLT_FONT}-8x16.fnt && file2c 'static u_char dflt_font_16[16*256] = {' '};' < ${SC_DFLT_FONT}-8x16 > font.h && uudecode < ${SRCTOP}/share/syscons/fonts/${SC_DFLT_FONT}-8x14.fnt && file2c 'static u_char dflt_font_14[14*256] = {' '};' < ${SC_DFLT_FONT}-8x14 >> font.h && uudecode < ${SRCTOP}/share/syscons/fonts/${SC_DFLT_FONT}-8x8.fnt && file2c 'static u_char dflt_font_8[8*256] = {' '};' < ${SC_DFLT_FONT}-8x8 >> font.h" \ + compile-with "uudecode < ${SRCTOP}/share/syscons/fonts/${SC_DFLT_FONT}-8x16.fnt && file2c 'u_char dflt_font_16[16*256] = {' '};' < ${SC_DFLT_FONT}-8x16 > font.h && uudecode < ${SRCTOP}/share/syscons/fonts/${SC_DFLT_FONT}-8x14.fnt && file2c 'u_char dflt_font_14[14*256] = {' '};' < ${SC_DFLT_FONT}-8x14 >> font.h && uudecode < ${SRCTOP}/share/syscons/fonts/${SC_DFLT_FONT}-8x8.fnt && file2c 'u_char dflt_font_8[8*256] = {' '};' < ${SC_DFLT_FONT}-8x8 >> font.h" \ no-obj no-implicit-rule before-depend \ clean "font.h ${SC_DFLT_FONT}-8x14 ${SC_DFLT_FONT}-8x16 ${SC_DFLT_FONT}-8x8" snd_fxdiv_gen.h optional sound \ From owner-svn-src-all@freebsd.org Mon Feb 3 10:45:10 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 41DC424886F; Mon, 3 Feb 2020 10:45:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48B4GZ13jDz4MKv; Mon, 3 Feb 2020 10:45:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F913275AA; Mon, 3 Feb 2020 10:45:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 013AjAuj047509; Mon, 3 Feb 2020 10:45:10 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 013AjAJA047508; Mon, 3 Feb 2020 10:45:10 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202002031045.013AjAJA047508@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 3 Feb 2020 10:45:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357427 - stable/12/sys/ofed/drivers/infiniband/ulp/ipoib X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/ofed/drivers/infiniband/ulp/ipoib X-SVN-Commit-Revision: 357427 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 10:45:10 -0000 Author: hselasky Date: Mon Feb 3 10:45:09 2020 New Revision: 357427 URL: https://svnweb.freebsd.org/changeset/base/357427 Log: MFC r356633: Make sure the VNET is properly set when reaping mbufs in ipoib. Else the following panic may happen: panic() icmp_error() ipoib_cm_mb_reap() linux_work_fn() taskqueue_run_locked() taskqueue_thread_loop() fork_exit() fork_trampoline() Submitted by: Andreas Kempe Sponsored by: Mellanox Technologies Modified: stable/12/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c ============================================================================== --- stable/12/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c Mon Feb 3 05:38:45 2020 (r357426) +++ stable/12/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c Mon Feb 3 10:45:09 2020 (r357427) @@ -1265,6 +1265,8 @@ static void ipoib_cm_mb_reap(struct work_struct *work) spin_lock_irqsave(&priv->lock, flags); + CURVNET_SET_QUIET(priv->dev->if_vnet); + for (;;) { IF_DEQUEUE(&priv->cm.mb_queue, mb); if (mb == NULL) @@ -1290,6 +1292,8 @@ static void ipoib_cm_mb_reap(struct work_struct *work) spin_lock_irqsave(&priv->lock, flags); } + + CURVNET_RESTORE(); spin_unlock_irqrestore(&priv->lock, flags); } From owner-svn-src-all@freebsd.org Mon Feb 3 10:46:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BEE9E248999; Mon, 3 Feb 2020 10:46:29 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48B4J53stJz4MWd; Mon, 3 Feb 2020 10:46:29 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 80384275AF; Mon, 3 Feb 2020 10:46:29 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 013AkTN2047629; Mon, 3 Feb 2020 10:46:29 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 013AkTJm047628; Mon, 3 Feb 2020 10:46:29 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202002031046.013AkTJm047628@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 3 Feb 2020 10:46:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r357428 - stable/11/sys/ofed/drivers/infiniband/ulp/ipoib X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/ofed/drivers/infiniband/ulp/ipoib X-SVN-Commit-Revision: 357428 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 10:46:29 -0000 Author: hselasky Date: Mon Feb 3 10:46:29 2020 New Revision: 357428 URL: https://svnweb.freebsd.org/changeset/base/357428 Log: MFC r356633: Make sure the VNET is properly set when reaping mbufs in ipoib. Else the following panic may happen: panic() icmp_error() ipoib_cm_mb_reap() linux_work_fn() taskqueue_run_locked() taskqueue_thread_loop() fork_exit() fork_trampoline() Submitted by: Andreas Kempe Sponsored by: Mellanox Technologies Modified: stable/11/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c ============================================================================== --- stable/11/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c Mon Feb 3 10:45:09 2020 (r357427) +++ stable/11/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c Mon Feb 3 10:46:29 2020 (r357428) @@ -1263,6 +1263,8 @@ static void ipoib_cm_mb_reap(struct work_struct *work) spin_lock_irqsave(&priv->lock, flags); + CURVNET_SET_QUIET(priv->dev->if_vnet); + for (;;) { IF_DEQUEUE(&priv->cm.mb_queue, mb); if (mb == NULL) @@ -1288,6 +1290,8 @@ static void ipoib_cm_mb_reap(struct work_struct *work) spin_lock_irqsave(&priv->lock, flags); } + + CURVNET_RESTORE(); spin_unlock_irqrestore(&priv->lock, flags); } From owner-svn-src-all@freebsd.org Mon Feb 3 10:47:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D626A248A35; Mon, 3 Feb 2020 10:47:44 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48B4KX5KcYz4Mft; Mon, 3 Feb 2020 10:47:44 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B234E275C6; Mon, 3 Feb 2020 10:47:44 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 013Alico047751; Mon, 3 Feb 2020 10:47:44 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 013AliLq047750; Mon, 3 Feb 2020 10:47:44 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202002031047.013AliLq047750@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 3 Feb 2020 10:47:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r357429 - stable/10/sys/ofed/drivers/infiniband/ulp/ipoib X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/10/sys/ofed/drivers/infiniband/ulp/ipoib X-SVN-Commit-Revision: 357429 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 10:47:44 -0000 Author: hselasky Date: Mon Feb 3 10:47:44 2020 New Revision: 357429 URL: https://svnweb.freebsd.org/changeset/base/357429 Log: MFC r356633: Make sure the VNET is properly set when reaping mbufs in ipoib. Else the following panic may happen: panic() icmp_error() ipoib_cm_mb_reap() linux_work_fn() taskqueue_run_locked() taskqueue_thread_loop() fork_exit() fork_trampoline() Submitted by: Andreas Kempe Sponsored by: Mellanox Technologies Modified: stable/10/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c ============================================================================== --- stable/10/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c Mon Feb 3 10:46:29 2020 (r357428) +++ stable/10/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c Mon Feb 3 10:47:44 2020 (r357429) @@ -1259,6 +1259,8 @@ static void ipoib_cm_mb_reap(struct work_struct *work) spin_lock_irqsave(&priv->lock, flags); + CURVNET_SET_QUIET(priv->dev->if_vnet); + for (;;) { IF_DEQUEUE(&priv->cm.mb_queue, mb); if (mb == NULL) @@ -1284,6 +1286,8 @@ static void ipoib_cm_mb_reap(struct work_struct *work) spin_lock_irqsave(&priv->lock, flags); } + + CURVNET_RESTORE(); spin_unlock_irqrestore(&priv->lock, flags); } From owner-svn-src-all@freebsd.org Mon Feb 3 10:49:18 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E2F1A248ACA; Mon, 3 Feb 2020 10:49:18 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48B4ML5pCSz4MnF; Mon, 3 Feb 2020 10:49:18 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C1A13275C7; Mon, 3 Feb 2020 10:49:18 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 013AnIPi047889; Mon, 3 Feb 2020 10:49:18 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 013AnIYN047886; Mon, 3 Feb 2020 10:49:18 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202002031049.013AnIYN047886@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 3 Feb 2020 10:49:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357430 - in stable/12/sys/dev/usb: . serial X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/12/sys/dev/usb: . serial X-SVN-Commit-Revision: 357430 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 10:49:19 -0000 Author: hselasky Date: Mon Feb 3 10:49:18 2020 New Revision: 357430 URL: https://svnweb.freebsd.org/changeset/base/357430 Log: MFC r356952: Add new USB ID to uslcom(4). Submitted by: Oleg Sharoyko PR: 243494 Sponsored by: Mellanox Technologies Modified: stable/12/sys/dev/usb/serial/uslcom.c stable/12/sys/dev/usb/usbdevs Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/usb/serial/uslcom.c ============================================================================== --- stable/12/sys/dev/usb/serial/uslcom.c Mon Feb 3 10:47:44 2020 (r357429) +++ stable/12/sys/dev/usb/serial/uslcom.c Mon Feb 3 10:49:18 2020 (r357430) @@ -313,6 +313,7 @@ static const STRUCT_USB_HOST_ID uslcom_devs[] = { USLCOM_DEV(SILABS, HAMLINKUSB), USLCOM_DEV(SILABS, HELICOM), USLCOM_DEV(SILABS, HUBZ), + USLCOM_DEV(SILABS, BV_AV2010_10), USLCOM_DEV(SILABS, IMS_USB_RS422), USLCOM_DEV(SILABS, INFINITY_MIC), USLCOM_DEV(SILABS, INGENI_ZIGBEE), Modified: stable/12/sys/dev/usb/usbdevs ============================================================================== --- stable/12/sys/dev/usb/usbdevs Mon Feb 3 10:47:44 2020 (r357429) +++ stable/12/sys/dev/usb/usbdevs Mon Feb 3 10:49:18 2020 (r357430) @@ -4339,6 +4339,7 @@ product SILABS AC_SERV_OBD 0x8665 AC-Services OBD Inte product SILABS MMB_ZIGBEE 0x88a4 MMB Networks ZigBee product SILABS INGENI_ZIGBEE 0x88a5 Planet Innovation Ingeni ZigBee product SILABS HUBZ 0x8a2a HubZ dual ZigBee and Z-Wave +product SILABS BV_AV2010_10 0x8b34 Bitron Video AV2010/10 ZigBee USB Stick product SILABS CP2102 0xea60 SILABS USB UART product SILABS CP210X_2 0xea61 CP210x Serial product SILABS CP210X_3 0xea70 CP210x Serial From owner-svn-src-all@freebsd.org Mon Feb 3 10:50:06 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7D2E0248B3F; Mon, 3 Feb 2020 10:50:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48B4NG2lGkz4Mvd; Mon, 3 Feb 2020 10:50:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 59925275CD; Mon, 3 Feb 2020 10:50:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 013Ao6qc048041; Mon, 3 Feb 2020 10:50:06 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 013Ao6bk048039; Mon, 3 Feb 2020 10:50:06 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202002031050.013Ao6bk048039@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 3 Feb 2020 10:50:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r357431 - in stable/11/sys/dev/usb: . serial X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys/dev/usb: . serial X-SVN-Commit-Revision: 357431 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 10:50:06 -0000 Author: hselasky Date: Mon Feb 3 10:50:05 2020 New Revision: 357431 URL: https://svnweb.freebsd.org/changeset/base/357431 Log: MFC r356952: Add new USB ID to uslcom(4). Submitted by: Oleg Sharoyko PR: 243494 Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/usb/serial/uslcom.c stable/11/sys/dev/usb/usbdevs Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/usb/serial/uslcom.c ============================================================================== --- stable/11/sys/dev/usb/serial/uslcom.c Mon Feb 3 10:49:18 2020 (r357430) +++ stable/11/sys/dev/usb/serial/uslcom.c Mon Feb 3 10:50:05 2020 (r357431) @@ -314,6 +314,7 @@ static const STRUCT_USB_HOST_ID uslcom_devs[] = { USLCOM_DEV(SILABS, HAMLINKUSB), USLCOM_DEV(SILABS, HELICOM), USLCOM_DEV(SILABS, HUBZ), + USLCOM_DEV(SILABS, BV_AV2010_10), USLCOM_DEV(SILABS, IMS_USB_RS422), USLCOM_DEV(SILABS, INFINITY_MIC), USLCOM_DEV(SILABS, INGENI_ZIGBEE), Modified: stable/11/sys/dev/usb/usbdevs ============================================================================== --- stable/11/sys/dev/usb/usbdevs Mon Feb 3 10:49:18 2020 (r357430) +++ stable/11/sys/dev/usb/usbdevs Mon Feb 3 10:50:05 2020 (r357431) @@ -4197,6 +4197,7 @@ product SILABS AC_SERV_OBD 0x8665 AC-Services OBD Inte product SILABS MMB_ZIGBEE 0x88a4 MMB Networks ZigBee product SILABS INGENI_ZIGBEE 0x88a5 Planet Innovation Ingeni ZigBee product SILABS HUBZ 0x8a2a HubZ dual ZigBee and Z-Wave +product SILABS BV_AV2010_10 0x8b34 Bitron Video AV2010/10 ZigBee USB Stick product SILABS CP2102 0xea60 SILABS USB UART product SILABS CP210X_2 0xea61 CP210x Serial product SILABS CP210X_3 0xea70 CP210x Serial From owner-svn-src-all@freebsd.org Mon Feb 3 10:50:53 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7B90A248BD8; Mon, 3 Feb 2020 10:50:53 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48B4P92mXDz4NCd; Mon, 3 Feb 2020 10:50:53 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5A612276F9; Mon, 3 Feb 2020 10:50:53 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 013Aor9A048149; Mon, 3 Feb 2020 10:50:53 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 013Aoqtn048145; Mon, 3 Feb 2020 10:50:52 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202002031050.013Aoqtn048145@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 3 Feb 2020 10:50:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r357432 - in stable/10/sys/dev/usb: . serial X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/10/sys/dev/usb: . serial X-SVN-Commit-Revision: 357432 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 10:50:53 -0000 Author: hselasky Date: Mon Feb 3 10:50:52 2020 New Revision: 357432 URL: https://svnweb.freebsd.org/changeset/base/357432 Log: MFC r356952: Add new USB ID to uslcom(4). Submitted by: Oleg Sharoyko PR: 243494 Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/usb/serial/uslcom.c stable/10/sys/dev/usb/usbdevs Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/serial/uslcom.c ============================================================================== --- stable/10/sys/dev/usb/serial/uslcom.c Mon Feb 3 10:50:05 2020 (r357431) +++ stable/10/sys/dev/usb/serial/uslcom.c Mon Feb 3 10:50:52 2020 (r357432) @@ -314,6 +314,7 @@ static const STRUCT_USB_HOST_ID uslcom_devs[] = { USLCOM_DEV(SILABS, HAMLINKUSB), USLCOM_DEV(SILABS, HELICOM), USLCOM_DEV(SILABS, HUBZ), + USLCOM_DEV(SILABS, BV_AV2010_10), USLCOM_DEV(SILABS, IMS_USB_RS422), USLCOM_DEV(SILABS, INFINITY_MIC), USLCOM_DEV(SILABS, INGENI_ZIGBEE), Modified: stable/10/sys/dev/usb/usbdevs ============================================================================== --- stable/10/sys/dev/usb/usbdevs Mon Feb 3 10:50:05 2020 (r357431) +++ stable/10/sys/dev/usb/usbdevs Mon Feb 3 10:50:52 2020 (r357432) @@ -4177,6 +4177,7 @@ product SILABS AC_SERV_OBD 0x8665 AC-Services OBD Inte product SILABS MMB_ZIGBEE 0x88a4 MMB Networks ZigBee product SILABS INGENI_ZIGBEE 0x88a5 Planet Innovation Ingeni ZigBee product SILABS HUBZ 0x8a2a HubZ dual ZigBee and Z-Wave +product SILABS BV_AV2010_10 0x8b34 Bitron Video AV2010/10 ZigBee USB Stick product SILABS CP2102 0xea60 SILABS USB UART product SILABS CP210X_2 0xea61 CP210x Serial product SILABS CP210X_3 0xea70 CP210x Serial From owner-svn-src-all@freebsd.org Mon Feb 3 10:53:04 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D632C248D99; Mon, 3 Feb 2020 10:53:04 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48B4Rh5KZQz4NSx; Mon, 3 Feb 2020 10:53:04 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B1FB9277A8; Mon, 3 Feb 2020 10:53:04 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 013Ar4Lp053554; Mon, 3 Feb 2020 10:53:04 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 013Ar4Ac053552; Mon, 3 Feb 2020 10:53:04 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202002031053.013Ar4Ac053552@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 3 Feb 2020 10:53:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357433 - in stable/12: stand/usb sys/modules/usb/template X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/12: stand/usb sys/modules/usb/template X-SVN-Commit-Revision: 357433 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 10:53:04 -0000 Author: hselasky Date: Mon Feb 3 10:53:03 2020 New Revision: 357433 URL: https://svnweb.freebsd.org/changeset/base/357433 Log: MFC r357041: Fix build of stand/usb . Sponsored by: Mellanox Technologies Modified: stable/12/stand/usb/usbcore.mk stable/12/sys/modules/usb/template/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/stand/usb/usbcore.mk ============================================================================== --- stable/12/stand/usb/usbcore.mk Mon Feb 3 10:50:52 2020 (r357432) +++ stable/12/stand/usb/usbcore.mk Mon Feb 3 10:53:03 2020 (r357433) @@ -1,7 +1,7 @@ # # $FreeBSD$ # -# Copyright (c) 2013 Hans Petter Selasky. +# Copyright (c) 2013-2020 Hans Petter Selasky. # Copyright (c) 2014 SRI International # All rights reserved. # @@ -162,6 +162,8 @@ KSRCS+= usb_template_audio.c KSRCS+= usb_template_phone.c KSRCS+= usb_template_serialnet.c KSRCS+= usb_template_midi.c +KSRCS+= usb_template_multi.c +KSRCS+= usb_template_cdceem.c # # USB mass storage support Modified: stable/12/sys/modules/usb/template/Makefile ============================================================================== --- stable/12/sys/modules/usb/template/Makefile Mon Feb 3 10:50:52 2020 (r357432) +++ stable/12/sys/modules/usb/template/Makefile Mon Feb 3 10:53:03 2020 (r357433) @@ -1,7 +1,7 @@ # # $FreeBSD$ # -# Copyright (c) 2008 Hans Petter Selasky. All rights reserved. +# Copyright (c) 2008-2020 Hans Petter Selasky. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -44,5 +44,10 @@ SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if. usb_template_midi.c \ usb_template_multi.c \ usb_template_cdceem.c + +# +# NOTE: +# Keep source list above in sync with stand/usb/usbcore.mk +# .include From owner-svn-src-all@freebsd.org Mon Feb 3 10:57:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BCCAD248E4D; Mon, 3 Feb 2020 10:57:39 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48B4Xz4ZZXz4Ngh; Mon, 3 Feb 2020 10:57:39 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 983B5277D2; Mon, 3 Feb 2020 10:57:39 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 013Avd2L053868; Mon, 3 Feb 2020 10:57:39 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 013Avbmc053859; Mon, 3 Feb 2020 10:57:37 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202002031057.013Avbmc053859@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 3 Feb 2020 10:57:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r357434 - stable/11/sys/dev/usb/template X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/usb/template X-SVN-Commit-Revision: 357434 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 10:57:39 -0000 Author: hselasky Date: Mon Feb 3 10:57:37 2020 New Revision: 357434 URL: https://svnweb.freebsd.org/changeset/base/357434 Log: MFC r328985: Give USB template SYSUNINIT()'s a uniq name to avoid symbol name collision when building stand/usb. Regression after r328194. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/usb/template/usb_template_audio.c stable/11/sys/dev/usb/template/usb_template_cdce.c stable/11/sys/dev/usb/template/usb_template_kbd.c stable/11/sys/dev/usb/template/usb_template_midi.c stable/11/sys/dev/usb/template/usb_template_modem.c stable/11/sys/dev/usb/template/usb_template_mouse.c stable/11/sys/dev/usb/template/usb_template_msc.c stable/11/sys/dev/usb/template/usb_template_mtp.c stable/11/sys/dev/usb/template/usb_template_phone.c stable/11/sys/dev/usb/template/usb_template_serialnet.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/usb/template/usb_template_audio.c ============================================================================== --- stable/11/sys/dev/usb/template/usb_template_audio.c Mon Feb 3 10:53:03 2020 (r357433) +++ stable/11/sys/dev/usb/template/usb_template_audio.c Mon Feb 3 10:57:37 2020 (r357434) @@ -473,4 +473,4 @@ audio_uninit(void *arg __unused) } SYSINIT(audio_init, SI_SUB_LOCK, SI_ORDER_FIRST, audio_init, NULL); -SYSUNINIT(audio_init, SI_SUB_LOCK, SI_ORDER_FIRST, audio_uninit, NULL); +SYSUNINIT(audio_uninit, SI_SUB_LOCK, SI_ORDER_FIRST, audio_uninit, NULL); Modified: stable/11/sys/dev/usb/template/usb_template_cdce.c ============================================================================== --- stable/11/sys/dev/usb/template/usb_template_cdce.c Mon Feb 3 10:53:03 2020 (r357433) +++ stable/11/sys/dev/usb/template/usb_template_cdce.c Mon Feb 3 10:57:37 2020 (r357434) @@ -346,4 +346,4 @@ eth_uninit(void *arg __unused) } SYSINIT(eth_init, SI_SUB_LOCK, SI_ORDER_FIRST, eth_init, NULL); -SYSUNINIT(eth_init, SI_SUB_LOCK, SI_ORDER_FIRST, eth_uninit, NULL); +SYSUNINIT(eth_uninit, SI_SUB_LOCK, SI_ORDER_FIRST, eth_uninit, NULL); Modified: stable/11/sys/dev/usb/template/usb_template_kbd.c ============================================================================== --- stable/11/sys/dev/usb/template/usb_template_kbd.c Mon Feb 3 10:53:03 2020 (r357433) +++ stable/11/sys/dev/usb/template/usb_template_kbd.c Mon Feb 3 10:57:37 2020 (r357434) @@ -287,4 +287,4 @@ kbd_uninit(void *arg __unused) } SYSINIT(kbd_init, SI_SUB_LOCK, SI_ORDER_FIRST, kbd_init, NULL); -SYSUNINIT(kbd_init, SI_SUB_LOCK, SI_ORDER_FIRST, kbd_uninit, NULL); +SYSUNINIT(kbd_uninit, SI_SUB_LOCK, SI_ORDER_FIRST, kbd_uninit, NULL); Modified: stable/11/sys/dev/usb/template/usb_template_midi.c ============================================================================== --- stable/11/sys/dev/usb/template/usb_template_midi.c Mon Feb 3 10:53:03 2020 (r357433) +++ stable/11/sys/dev/usb/template/usb_template_midi.c Mon Feb 3 10:57:37 2020 (r357434) @@ -309,4 +309,4 @@ midi_uninit(void *arg __unused) } SYSINIT(midi_init, SI_SUB_LOCK, SI_ORDER_FIRST, midi_init, NULL); -SYSUNINIT(midi_init, SI_SUB_LOCK, SI_ORDER_FIRST, midi_uninit, NULL); +SYSUNINIT(midi_uninit, SI_SUB_LOCK, SI_ORDER_FIRST, midi_uninit, NULL); Modified: stable/11/sys/dev/usb/template/usb_template_modem.c ============================================================================== --- stable/11/sys/dev/usb/template/usb_template_modem.c Mon Feb 3 10:53:03 2020 (r357433) +++ stable/11/sys/dev/usb/template/usb_template_modem.c Mon Feb 3 10:57:37 2020 (r357434) @@ -315,4 +315,4 @@ modem_uninit(void *arg __unused) } SYSINIT(modem_init, SI_SUB_LOCK, SI_ORDER_FIRST, modem_init, NULL); -SYSUNINIT(modem_init, SI_SUB_LOCK, SI_ORDER_FIRST, modem_uninit, NULL); +SYSUNINIT(modem_uninit, SI_SUB_LOCK, SI_ORDER_FIRST, modem_uninit, NULL); Modified: stable/11/sys/dev/usb/template/usb_template_mouse.c ============================================================================== --- stable/11/sys/dev/usb/template/usb_template_mouse.c Mon Feb 3 10:53:03 2020 (r357433) +++ stable/11/sys/dev/usb/template/usb_template_mouse.c Mon Feb 3 10:57:37 2020 (r357434) @@ -285,4 +285,4 @@ mouse_uninit(void *arg __unused) } SYSINIT(mouse_init, SI_SUB_LOCK, SI_ORDER_FIRST, mouse_init, NULL); -SYSUNINIT(mouse_init, SI_SUB_LOCK, SI_ORDER_FIRST, mouse_uninit, NULL); +SYSUNINIT(mouse_uninit, SI_SUB_LOCK, SI_ORDER_FIRST, mouse_uninit, NULL); Modified: stable/11/sys/dev/usb/template/usb_template_msc.c ============================================================================== --- stable/11/sys/dev/usb/template/usb_template_msc.c Mon Feb 3 10:53:03 2020 (r357433) +++ stable/11/sys/dev/usb/template/usb_template_msc.c Mon Feb 3 10:57:37 2020 (r357434) @@ -255,4 +255,4 @@ msc_uninit(void *arg __unused) } SYSINIT(msc_init, SI_SUB_LOCK, SI_ORDER_FIRST, msc_init, NULL); -SYSUNINIT(msc_init, SI_SUB_LOCK, SI_ORDER_FIRST, msc_uninit, NULL); +SYSUNINIT(msc_uninit, SI_SUB_LOCK, SI_ORDER_FIRST, msc_uninit, NULL); Modified: stable/11/sys/dev/usb/template/usb_template_mtp.c ============================================================================== --- stable/11/sys/dev/usb/template/usb_template_mtp.c Mon Feb 3 10:53:03 2020 (r357433) +++ stable/11/sys/dev/usb/template/usb_template_mtp.c Mon Feb 3 10:57:37 2020 (r357434) @@ -322,4 +322,4 @@ mtp_uninit(void *arg __unused) } SYSINIT(mtp_init, SI_SUB_LOCK, SI_ORDER_FIRST, mtp_init, NULL); -SYSUNINIT(mtp_init, SI_SUB_LOCK, SI_ORDER_FIRST, mtp_uninit, NULL); +SYSUNINIT(mtp_uninit, SI_SUB_LOCK, SI_ORDER_FIRST, mtp_uninit, NULL); Modified: stable/11/sys/dev/usb/template/usb_template_phone.c ============================================================================== --- stable/11/sys/dev/usb/template/usb_template_phone.c Mon Feb 3 10:53:03 2020 (r357433) +++ stable/11/sys/dev/usb/template/usb_template_phone.c Mon Feb 3 10:57:37 2020 (r357434) @@ -500,4 +500,4 @@ phone_uninit(void *arg __unused) } SYSINIT(phone_init, SI_SUB_LOCK, SI_ORDER_FIRST, phone_init, NULL); -SYSUNINIT(phone_init, SI_SUB_LOCK, SI_ORDER_FIRST, phone_uninit, NULL); +SYSUNINIT(phone_uninit, SI_SUB_LOCK, SI_ORDER_FIRST, phone_uninit, NULL); Modified: stable/11/sys/dev/usb/template/usb_template_serialnet.c ============================================================================== --- stable/11/sys/dev/usb/template/usb_template_serialnet.c Mon Feb 3 10:53:03 2020 (r357433) +++ stable/11/sys/dev/usb/template/usb_template_serialnet.c Mon Feb 3 10:57:37 2020 (r357434) @@ -456,4 +456,4 @@ serialnet_uninit(void *arg __unused) } SYSINIT(serialnet_init, SI_SUB_LOCK, SI_ORDER_FIRST, serialnet_init, NULL); -SYSUNINIT(serialnet_init, SI_SUB_LOCK, SI_ORDER_FIRST, serialnet_uninit, NULL); +SYSUNINIT(serialnet_uninit, SI_SUB_LOCK, SI_ORDER_FIRST, serialnet_uninit, NULL); From owner-svn-src-all@freebsd.org Mon Feb 3 10:59:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 13B15248ED0; Mon, 3 Feb 2020 10:59:28 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48B4b36qjBz4NpZ; Mon, 3 Feb 2020 10:59:27 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E50D6277D4; Mon, 3 Feb 2020 10:59:27 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 013AxR3d054003; Mon, 3 Feb 2020 10:59:27 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 013AxRYq054002; Mon, 3 Feb 2020 10:59:27 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202002031059.013AxRYq054002@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 3 Feb 2020 10:59:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357435 - stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 357435 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 10:59:28 -0000 Author: hselasky Date: Mon Feb 3 10:59:27 2020 New Revision: 357435 URL: https://svnweb.freebsd.org/changeset/base/357435 Log: MFC r357077: Implement mmget_not_zero() in the LinuxKPI. Submitted by: Austin Shafer Sponsored by: Mellanox Technologies Modified: stable/12/sys/compat/linuxkpi/common/include/linux/mm_types.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/mm_types.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/mm_types.h Mon Feb 3 10:57:37 2020 (r357434) +++ stable/12/sys/compat/linuxkpi/common/include/linux/mm_types.h Mon Feb 3 10:59:27 2020 (r357435) @@ -57,6 +57,12 @@ mmdrop(struct mm_struct *mm) linux_mm_dtor(mm); } +static inline bool +mmget_not_zero(struct mm_struct *mm) +{ + return (atomic_inc_not_zero(&mm->mm_users)); +} + static inline void mmput(struct mm_struct *mm) { From owner-svn-src-all@freebsd.org Mon Feb 3 11:00:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 39339248F53; Mon, 3 Feb 2020 11:00:25 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48B4c90p9sz4NxK; Mon, 3 Feb 2020 11:00:25 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 16D04277DE; Mon, 3 Feb 2020 11:00:25 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 013B0Oiq054182; Mon, 3 Feb 2020 11:00:24 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 013B0Om7054181; Mon, 3 Feb 2020 11:00:24 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202002031100.013B0Om7054181@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 3 Feb 2020 11:00:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r357436 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 357436 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 11:00:25 -0000 Author: hselasky Date: Mon Feb 3 11:00:24 2020 New Revision: 357436 URL: https://svnweb.freebsd.org/changeset/base/357436 Log: MFC r357077: Implement mmget_not_zero() in the LinuxKPI. Submitted by: Austin Shafer Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/mm_types.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/mm_types.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/mm_types.h Mon Feb 3 10:59:27 2020 (r357435) +++ stable/11/sys/compat/linuxkpi/common/include/linux/mm_types.h Mon Feb 3 11:00:24 2020 (r357436) @@ -55,6 +55,12 @@ mmdrop(struct mm_struct *mm) linux_mm_dtor(mm); } +static inline bool +mmget_not_zero(struct mm_struct *mm) +{ + return (atomic_inc_not_zero(&mm->mm_users)); +} + static inline void mmput(struct mm_struct *mm) { From owner-svn-src-all@freebsd.org Mon Feb 3 11:04:19 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 59E032491FB; Mon, 3 Feb 2020 11:04:19 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48B4hg1lWnz4PNm; Mon, 3 Feb 2020 11:04:19 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 37338279B0; Mon, 3 Feb 2020 11:04:19 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 013B4Jbw060038; Mon, 3 Feb 2020 11:04:19 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 013B4JVb060037; Mon, 3 Feb 2020 11:04:19 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202002031104.013B4JVb060037@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 3 Feb 2020 11:04:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357437 - stable/12/lib/libusb X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/lib/libusb X-SVN-Commit-Revision: 357437 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 11:04:19 -0000 Author: hselasky Date: Mon Feb 3 11:04:18 2020 New Revision: 357437 URL: https://svnweb.freebsd.org/changeset/base/357437 Log: MFC r357298: Add missing mutex unlock in failure case. Differential Revision: https://reviews.freebsd.org/D23430 Submitted by: cem Reported by: Coverity Coverity CID: 1368773 Sponsored by: Mellanox Technologies Modified: stable/12/lib/libusb/libusb10_hotplug.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libusb/libusb10_hotplug.c ============================================================================== --- stable/12/lib/libusb/libusb10_hotplug.c Mon Feb 3 11:00:24 2020 (r357436) +++ stable/12/lib/libusb/libusb10_hotplug.c Mon Feb 3 11:04:18 2020 (r357437) @@ -123,8 +123,10 @@ libusb_hotplug_scan(void *arg) TAILQ_INIT(&hotplug_devs); if (ctx->hotplug_handler != NO_THREAD) { - if (libusb_hotplug_enumerate(ctx, &hotplug_devs) < 0) + if (libusb_hotplug_enumerate(ctx, &hotplug_devs) < 0) { + HOTPLUG_UNLOCK(ctx); continue; + } } else { do_loop = 0; } From owner-svn-src-all@freebsd.org Mon Feb 3 11:05:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C442C249291; Mon, 3 Feb 2020 11:05:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48B4jk4t6Yz4PWd; Mon, 3 Feb 2020 11:05:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A2888279B2; Mon, 3 Feb 2020 11:05:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 013B5E2l060151; Mon, 3 Feb 2020 11:05:14 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 013B5EbA060150; Mon, 3 Feb 2020 11:05:14 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202002031105.013B5EbA060150@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 3 Feb 2020 11:05:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r357438 - stable/11/lib/libusb X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/lib/libusb X-SVN-Commit-Revision: 357438 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 11:05:14 -0000 Author: hselasky Date: Mon Feb 3 11:05:14 2020 New Revision: 357438 URL: https://svnweb.freebsd.org/changeset/base/357438 Log: MFC r357298: Add missing mutex unlock in failure case. Differential Revision: https://reviews.freebsd.org/D23430 Submitted by: cem Reported by: Coverity Coverity CID: 1368773 Sponsored by: Mellanox Technologies Modified: stable/11/lib/libusb/libusb10_hotplug.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libusb/libusb10_hotplug.c ============================================================================== --- stable/11/lib/libusb/libusb10_hotplug.c Mon Feb 3 11:04:18 2020 (r357437) +++ stable/11/lib/libusb/libusb10_hotplug.c Mon Feb 3 11:05:14 2020 (r357438) @@ -123,8 +123,10 @@ libusb_hotplug_scan(void *arg) TAILQ_INIT(&hotplug_devs); if (ctx->hotplug_handler != NO_THREAD) { - if (libusb_hotplug_enumerate(ctx, &hotplug_devs) < 0) + if (libusb_hotplug_enumerate(ctx, &hotplug_devs) < 0) { + HOTPLUG_UNLOCK(ctx); continue; + } } else { do_loop = 0; } From owner-svn-src-all@freebsd.org Mon Feb 3 11:05:59 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F031124930E; Mon, 3 Feb 2020 11:05:59 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48B4kb62khz4PfJ; Mon, 3 Feb 2020 11:05:59 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA335279B3; Mon, 3 Feb 2020 11:05:59 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 013B5xk3060240; Mon, 3 Feb 2020 11:05:59 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 013B5xaN060239; Mon, 3 Feb 2020 11:05:59 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202002031105.013B5xaN060239@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 3 Feb 2020 11:05:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r357439 - stable/10/lib/libusb X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/10/lib/libusb X-SVN-Commit-Revision: 357439 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 11:06:00 -0000 Author: hselasky Date: Mon Feb 3 11:05:59 2020 New Revision: 357439 URL: https://svnweb.freebsd.org/changeset/base/357439 Log: MFC r357298: Add missing mutex unlock in failure case. Differential Revision: https://reviews.freebsd.org/D23430 Submitted by: cem Reported by: Coverity Coverity CID: 1368773 Sponsored by: Mellanox Technologies Modified: stable/10/lib/libusb/libusb10_hotplug.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libusb/libusb10_hotplug.c ============================================================================== --- stable/10/lib/libusb/libusb10_hotplug.c Mon Feb 3 11:05:14 2020 (r357438) +++ stable/10/lib/libusb/libusb10_hotplug.c Mon Feb 3 11:05:59 2020 (r357439) @@ -123,8 +123,10 @@ libusb_hotplug_scan(void *arg) TAILQ_INIT(&hotplug_devs); if (ctx->hotplug_handler != NO_THREAD) { - if (libusb_hotplug_enumerate(ctx, &hotplug_devs) < 0) + if (libusb_hotplug_enumerate(ctx, &hotplug_devs) < 0) { + HOTPLUG_UNLOCK(ctx); continue; + } } else { do_loop = 0; } From owner-svn-src-all@freebsd.org Mon Feb 3 11:17:35 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0C1F32498E6; Mon, 3 Feb 2020 11:17:35 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48B4zy6SJ2z4QWj; Mon, 3 Feb 2020 11:17:34 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D387D27B79; Mon, 3 Feb 2020 11:17:34 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 013BHY0m066522; Mon, 3 Feb 2020 11:17:34 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 013BHYdw066521; Mon, 3 Feb 2020 11:17:34 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202002031117.013BHYdw066521@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 3 Feb 2020 11:17:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r357440 - stable/9/lib/libusb X-SVN-Group: stable-9 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/9/lib/libusb X-SVN-Commit-Revision: 357440 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 11:17:35 -0000 Author: hselasky Date: Mon Feb 3 11:17:34 2020 New Revision: 357440 URL: https://svnweb.freebsd.org/changeset/base/357440 Log: MFC r349409 and r349410: Fix support for LIBUSB_HOTPLUG_ENUMERATE in libusb. Currently all devices are enumerated regardless of of the LIBUSB_HOTPLUG_ENUMERATE flag. Make sure when the flag is not specified no arrival events are generated for currently enumerated devices. Sponsored by: Mellanox Technologies Modified: stable/9/lib/libusb/libusb10.h stable/9/lib/libusb/libusb10_hotplug.c Directory Properties: stable/9/lib/ (props changed) stable/9/lib/libusb/ (props changed) Modified: stable/9/lib/libusb/libusb10.h ============================================================================== --- stable/9/lib/libusb/libusb10.h Mon Feb 3 11:05:59 2020 (r357439) +++ stable/9/lib/libusb/libusb10.h Mon Feb 3 11:17:34 2020 (r357440) @@ -85,6 +85,8 @@ struct libusb_hotplug_callback_handle_struct { void *user_data; }; +TAILQ_HEAD(libusb_device_head, libusb_device); + struct libusb_context { int debug; int debug_fixed; @@ -102,7 +104,7 @@ struct libusb_context { TAILQ_HEAD(, libusb_super_pollfd) pollfds; TAILQ_HEAD(, libusb_super_transfer) tr_done; TAILQ_HEAD(, libusb_hotplug_callback_handle_struct) hotplug_cbh; - TAILQ_HEAD(, libusb_device) hotplug_devs; + struct libusb_device_head hotplug_devs; struct libusb_super_pollfd ctx_poll; Modified: stable/9/lib/libusb/libusb10_hotplug.c ============================================================================== --- stable/9/lib/libusb/libusb10_hotplug.c Mon Feb 3 11:05:59 2020 (r357439) +++ stable/9/lib/libusb/libusb10_hotplug.c Mon Feb 3 11:17:34 2020 (r357440) @@ -1,6 +1,6 @@ /* $FreeBSD$ */ /*- - * Copyright (c) 2016 Hans Petter Selasky. All rights reserved. + * Copyright (c) 2016-2019 Hans Petter Selasky. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -85,20 +85,35 @@ libusb_hotplug_filter(libusb_context *ctx, libusb_hotp return (pcbh->fn(ctx, dev, event, pcbh->user_data)); } +static int +libusb_hotplug_enumerate(libusb_context *ctx, struct libusb_device_head *phead) +{ + libusb_device **ppdev; + ssize_t count; + ssize_t x; + + count = libusb_get_device_list(ctx, &ppdev); + if (count < 0) + return (-1); + + for (x = 0; x != count; x++) + TAILQ_INSERT_TAIL(phead, ppdev[x], hotplug_entry); + + libusb_free_device_list(ppdev, 0); + return (0); +} + static void * libusb_hotplug_scan(void *arg) { - TAILQ_HEAD(, libusb_device) hotplug_devs; + struct libusb_device_head hotplug_devs; libusb_hotplug_callback_handle acbh; libusb_hotplug_callback_handle bcbh; libusb_context *ctx = arg; - libusb_device **ppdev; libusb_device *temp; libusb_device *adev; libusb_device *bdev; unsigned do_loop = 1; - ssize_t count; - ssize_t x; while (do_loop) { usleep(4000000); @@ -108,14 +123,8 @@ libusb_hotplug_scan(void *arg) TAILQ_INIT(&hotplug_devs); if (ctx->hotplug_handler != NO_THREAD) { - count = libusb_get_device_list(ctx, &ppdev); - if (count < 0) + if (libusb_hotplug_enumerate(ctx, &hotplug_devs) < 0) continue; - for (x = 0; x != count; x++) { - TAILQ_INSERT_TAIL(&hotplug_devs, ppdev[x], - hotplug_entry); - } - libusb_free_device_list(ppdev, 0); } else { do_loop = 0; } @@ -191,6 +200,8 @@ int libusb_hotplug_register_callback(libusb_context *c HOTPLUG_LOCK(ctx); if (ctx->hotplug_handler == NO_THREAD) { + libusb_hotplug_enumerate(ctx, &ctx->hotplug_devs); + if (pthread_create(&ctx->hotplug_handler, NULL, &libusb_hotplug_scan, ctx) != 0) ctx->hotplug_handler = NO_THREAD; From owner-svn-src-all@freebsd.org Mon Feb 3 11:18:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CABDB24996B; Mon, 3 Feb 2020 11:18:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48B50b3WMRz4Qdq; Mon, 3 Feb 2020 11:18:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 73EBF27B7A; Mon, 3 Feb 2020 11:18:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 013BI7AG066607; Mon, 3 Feb 2020 11:18:07 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 013BI7Fu066606; Mon, 3 Feb 2020 11:18:07 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202002031118.013BI7Fu066606@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 3 Feb 2020 11:18:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r357441 - stable/9/lib/libusb X-SVN-Group: stable-9 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/9/lib/libusb X-SVN-Commit-Revision: 357441 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 11:18:07 -0000 Author: hselasky Date: Mon Feb 3 11:18:07 2020 New Revision: 357441 URL: https://svnweb.freebsd.org/changeset/base/357441 Log: MFC r357298: Add missing mutex unlock in failure case. Differential Revision: https://reviews.freebsd.org/D23430 Submitted by: cem Reported by: Coverity Coverity CID: 1368773 Sponsored by: Mellanox Technologies Modified: stable/9/lib/libusb/libusb10_hotplug.c Directory Properties: stable/9/lib/ (props changed) stable/9/lib/libusb/ (props changed) Modified: stable/9/lib/libusb/libusb10_hotplug.c ============================================================================== --- stable/9/lib/libusb/libusb10_hotplug.c Mon Feb 3 11:17:34 2020 (r357440) +++ stable/9/lib/libusb/libusb10_hotplug.c Mon Feb 3 11:18:07 2020 (r357441) @@ -123,8 +123,10 @@ libusb_hotplug_scan(void *arg) TAILQ_INIT(&hotplug_devs); if (ctx->hotplug_handler != NO_THREAD) { - if (libusb_hotplug_enumerate(ctx, &hotplug_devs) < 0) + if (libusb_hotplug_enumerate(ctx, &hotplug_devs) < 0) { + HOTPLUG_UNLOCK(ctx); continue; + } } else { do_loop = 0; } From owner-svn-src-all@freebsd.org Mon Feb 3 11:33:34 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0C9C3249D46; Mon, 3 Feb 2020 11:33:34 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48B5LP6ZTjz4RPv; Mon, 3 Feb 2020 11:33:33 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DCEC627F04; Mon, 3 Feb 2020 11:33:33 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 013BXXsf078320; Mon, 3 Feb 2020 11:33:33 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 013BXXsL078319; Mon, 3 Feb 2020 11:33:33 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <202002031133.013BXXsL078319@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Mon, 3 Feb 2020 11:33:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357442 - head/stand/i386/libi386 X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/i386/libi386 X-SVN-Commit-Revision: 357442 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 11:33:34 -0000 Author: tsoome Date: Mon Feb 3 11:33:33 2020 New Revision: 357442 URL: https://svnweb.freebsd.org/changeset/base/357442 Log: loader: bc_add can not use any other probes than ah=0x4b CD boot is broken for some systems since bioscd and biosdisk merge. The issue is that we can not use anything else than int 13 ah=0x4b to query cd information. The patch does restore the same probe as was originally used in bioscd.c. Additionally extra buffer padding is used to avoid memory corruption caused by some systems. PR: 234031 Reported by: ultramage and others MFC after: 1 day Modified: head/stand/i386/libi386/biosdisk.c Modified: head/stand/i386/libi386/biosdisk.c ============================================================================== --- head/stand/i386/libi386/biosdisk.c Mon Feb 3 11:18:07 2020 (r357441) +++ head/stand/i386/libi386/biosdisk.c Mon Feb 3 11:33:33 2020 (r357442) @@ -98,6 +98,7 @@ struct specification_packet { uint16_t sp_sectorcount; uint16_t sp_cylsec; uint8_t sp_head; + uint8_t sp_dummy[16]; /* Avoid memory corruption */ }; /* @@ -372,54 +373,92 @@ cd_init(void) return (0); } -int -bc_add(int biosdev) +/* + * Information from bootable CD-ROM. + */ +static int +bd_get_diskinfo_cd(struct bdinfo *bd) { - bdinfo_t *bd; struct specification_packet bc_sp; - int nbcinfo = 0; + int ret = -1; - if (!STAILQ_EMPTY(&cdinfo)) - return (-1); + (void) memset(&bc_sp, 0, sizeof (bc_sp)); + /* Set sp_size as per specification. */ + bc_sp.sp_size = sizeof (bc_sp) - sizeof (bc_sp.sp_dummy); v86.ctl = V86_FLAGS; v86.addr = DISK_BIOS; v86.eax = CMD_CD_GET_STATUS; - v86.edx = biosdev; + v86.edx = bd->bd_unit; v86.ds = VTOPSEG(&bc_sp); v86.esi = VTOPOFF(&bc_sp); v86int(); - if ((v86.eax & 0xff00) != 0) - return (-1); - if ((bd = calloc(1, sizeof(*bd))) == NULL) - return (-1); + if ((v86.eax & 0xff00) == 0 && + bc_sp.sp_drive == bd->bd_unit) { + bd->bd_cyl = ((bc_sp.sp_cylsec & 0xc0) << 2) + + ((bc_sp.sp_cylsec & 0xff00) >> 8) + 1; + bd->bd_sec = bc_sp.sp_cylsec & 0x3f; + bd->bd_hds = bc_sp.sp_head + 1; + bd->bd_sectors = (uint64_t)bd->bd_cyl * bd->bd_hds * bd->bd_sec; - bd->bd_flags = BD_CDROM; - bd->bd_unit = biosdev; - bd->bd_sectorsize = 2048; + if (bc_sp.sp_bootmedia & 0x0F) { + /* Floppy or hard-disk emulation */ + bd->bd_sectorsize = BIOSDISK_SECSIZE; + return (-1); + } else { + bd->bd_sectorsize = 2048; + bd->bd_flags = BD_MODEEDD | BD_CDROM; + ret = 0; + } + } /* - * Ignore result from bd_int13probe(), we will use local - * workaround below. + * If this is the boot_drive, default to non-emulation bootable CD-ROM. */ - (void)bd_int13probe(bd); - - if (bd->bd_cyl == 0) { - bd->bd_cyl = ((bc_sp.sp_cylsec & 0xc0) << 2) + - ((bc_sp.sp_cylsec & 0xff00) >> 8) + 1; + if (ret != 0 && bd->bd_unit >= 0x88) { + bd->bd_cyl = 0; + bd->bd_hds = 1; + bd->bd_sec = 15; + bd->bd_sectorsize = 2048; + bd->bd_flags = BD_MODEEDD | BD_CDROM; + bd->bd_sectors = 0; + ret = 0; } - if (bd->bd_hds == 0) - bd->bd_hds = bc_sp.sp_head + 1; - if (bd->bd_sec == 0) - bd->bd_sec = bc_sp.sp_cylsec & 0x3f; - if (bd->bd_sectors == 0) - bd->bd_sectors = (uint64_t)bd->bd_cyl * bd->bd_hds * bd->bd_sec; - /* Still no size? use 7.961GB */ + /* + * Note we can not use bd_get_diskinfo_ext() nor bd_get_diskinfo_std() + * here - some systems do get hung with those. + */ + /* + * Still no size? use 7.961GB. The size does not really matter + * as long as it is reasonably large to make our reads to pass + * the sector count check. + */ if (bd->bd_sectors == 0) bd->bd_sectors = 4173824; + + return (ret); +} +int +bc_add(int biosdev) +{ + bdinfo_t *bd; + int nbcinfo = 0; + + if (!STAILQ_EMPTY(&cdinfo)) + return (-1); + + if ((bd = calloc(1, sizeof(*bd))) == NULL) + return (-1); + + bd->bd_unit = biosdev; + if (bd_get_diskinfo_cd(bd) < 0) { + free(bd); + return (-1); + } + STAILQ_INSERT_TAIL(&cdinfo, bd, bd_link); printf("BIOS CD is cd%d\n", nbcinfo); nbcinfo++; @@ -499,22 +538,32 @@ bd_get_diskinfo_std(struct bdinfo *bd) /* * Read EDD info. Return 0 on success, error otherwise. + * + * Avoid stack corruption on some systems by adding extra bytes to + * params block. */ static int bd_get_diskinfo_ext(struct bdinfo *bd) { - struct edd_params params; + struct disk_params { + struct edd_params head; + struct edd_device_path_v3 device_path; + uint8_t dummy[16]; + } __packed dparams; + struct edd_params *params; uint64_t total; + params = &dparams.head; + /* Get disk params */ - bzero(¶ms, sizeof(params)); - params.len = sizeof(params); + bzero(&dparams, sizeof(dparams)); + params->len = sizeof(struct edd_params_v3); v86.ctl = V86_FLAGS; v86.addr = DISK_BIOS; v86.eax = CMD_EXT_PARAM; v86.edx = bd->bd_unit; - v86.ds = VTOPSEG(¶ms); - v86.esi = VTOPOFF(¶ms); + v86.ds = VTOPSEG(&dparams); + v86.esi = VTOPOFF(&dparams); v86int(); if (V86_CY(v86.efl) && ((v86.eax & 0xff00) != 0)) @@ -526,20 +575,20 @@ bd_get_diskinfo_ext(struct bdinfo *bd) * powerof2(params.sector_size). * 16K is largest read buffer we can use at this time. */ - if (params.sector_size >= 512 && - params.sector_size <= 16384 && - (params.sector_size % BIOSDISK_SECSIZE) == 0) - bd->bd_sectorsize = params.sector_size; + if (params->sector_size >= 512 && + params->sector_size <= 16384 && + (params->sector_size % BIOSDISK_SECSIZE) == 0) + bd->bd_sectorsize = params->sector_size; - bd->bd_cyl = params.cylinders; - bd->bd_hds = params.heads; - bd->bd_sec = params.sectors_per_track; + bd->bd_cyl = params->cylinders; + bd->bd_hds = params->heads; + bd->bd_sec = params->sectors_per_track; - if (params.sectors != 0) { - total = params.sectors; + if (params->sectors != 0) { + total = params->sectors; } else { - total = (uint64_t)params.cylinders * - params.heads * params.sectors_per_track; + total = (uint64_t)params->cylinders * + params->heads * params->sectors_per_track; } bd->bd_sectors = total; @@ -556,6 +605,10 @@ bd_int13probe(bdinfo_t *bd) bd->bd_flags &= ~BD_NO_MEDIA; + if ((bd->bd_flags & BD_CDROM) != 0) { + return (bd_get_diskinfo_cd(bd) == 0); + } + edd = bd_check_extensions(bd->bd_unit); if (edd == 0) bd->bd_flags |= BD_MODEINT13; @@ -604,10 +657,6 @@ bd_int13probe(bdinfo_t *bd) } if (ret != 0) { - /* CD is special case, bc_add() has its own fallback. */ - if ((bd->bd_flags & BD_CDROM) != 0) - return (true); - if (bd->bd_sectors != 0 && edd != 0) { bd->bd_sec = 63; bd->bd_hds = 255; @@ -619,8 +668,6 @@ bd_int13probe(bdinfo_t *bd) if ((bd->bd_flags & BD_FLOPPY) != 0) dv_name = biosfd.dv_name; - else if ((bd->bd_flags & BD_CDROM) != 0) - dv_name = bioscd.dv_name; else dv_name = bioshd.dv_name; From owner-svn-src-all@freebsd.org Mon Feb 3 13:47:41 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D6AB524D187; Mon, 3 Feb 2020 13:47:41 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48B8K95LHnz4ZH6; Mon, 3 Feb 2020 13:47:41 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B29F01762; Mon, 3 Feb 2020 13:47:41 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 013DlfsP056458; Mon, 3 Feb 2020 13:47:41 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 013DlfWZ056457; Mon, 3 Feb 2020 13:47:41 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202002031347.013DlfWZ056457@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 3 Feb 2020 13:47:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357443 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 357443 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 13:47:41 -0000 Author: andrew Date: Mon Feb 3 13:47:41 2020 New Revision: 357443 URL: https://svnweb.freebsd.org/changeset/base/357443 Log: Disable the use of the quantum cache in the GICv3 ITS This uses UMA to allocate space. It causes issues when there are multiple ITS devices in the system where interrupts are not allocated from a low address on some interrupt controllers. Disabling the quantum cache fixes this on the Neoverse N1 SDP. MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/gicv3_its.c Modified: head/sys/arm64/arm64/gicv3_its.c ============================================================================== --- head/sys/arm64/arm64/gicv3_its.c Mon Feb 3 11:33:33 2020 (r357442) +++ head/sys/arm64/arm64/gicv3_its.c Mon Feb 3 13:47:41 2020 (r357443) @@ -800,7 +800,7 @@ gicv3_its_attach(device_t dev) * system. */ sc->sc_irq_alloc = vmem_create("GICv3 ITS IRQs", 0, - gicv3_get_nirqs(dev), 1, 1, M_FIRSTFIT | M_WAITOK); + gicv3_get_nirqs(dev), 1, 0, M_FIRSTFIT | M_WAITOK); sc->sc_irqs = malloc(sizeof(*sc->sc_irqs) * sc->sc_irq_length, M_GICV3_ITS, M_WAITOK | M_ZERO); From owner-svn-src-all@freebsd.org Mon Feb 3 13:50:16 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 306B324D22F; Mon, 3 Feb 2020 13:50:16 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48B8N80Xl6z4ZQh; Mon, 3 Feb 2020 13:50:16 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E7B231769; Mon, 3 Feb 2020 13:50:15 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 013DoFCO056649; Mon, 3 Feb 2020 13:50:15 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 013DoFvW056648; Mon, 3 Feb 2020 13:50:15 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202002031350.013DoFvW056648@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 3 Feb 2020 13:50:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357444 - head/gnu/lib/csu X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/gnu/lib/csu X-SVN-Commit-Revision: 357444 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 13:50:16 -0000 Author: emaste Date: Mon Feb 3 13:50:15 2020 New Revision: 357444 URL: https://svnweb.freebsd.org/changeset/base/357444 Log: remove stale gnu/lib/csu directory As of r357338 gnu/lib/csu is never used. Deleted: head/gnu/lib/csu/ From owner-svn-src-all@freebsd.org Mon Feb 3 13:50:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8021324D299; Mon, 3 Feb 2020 13:50:56 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48B8Nw2sdcz4ZZp; Mon, 3 Feb 2020 13:50:56 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5DC8E1796; Mon, 3 Feb 2020 13:50:56 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 013Dou8t057542; Mon, 3 Feb 2020 13:50:56 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 013DouAA057541; Mon, 3 Feb 2020 13:50:56 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202002031350.013DouAA057541@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 3 Feb 2020 13:50:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357445 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 357445 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 13:50:56 -0000 Author: andrew Date: Mon Feb 3 13:50:55 2020 New Revision: 357445 URL: https://svnweb.freebsd.org/changeset/base/357445 Log: Use a unique name for the GICv3 ITS vmem When there are multiple GICv3 ITS devices we don't know which vmem is for which device. Use device_get_nameunit to get a per-device name. MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/gicv3_its.c Modified: head/sys/arm64/arm64/gicv3_its.c ============================================================================== --- head/sys/arm64/arm64/gicv3_its.c Mon Feb 3 13:50:15 2020 (r357444) +++ head/sys/arm64/arm64/gicv3_its.c Mon Feb 3 13:50:55 2020 (r357445) @@ -799,7 +799,7 @@ gicv3_its_attach(device_t dev) * XXX: This assumes there are no other interrupt controllers in the * system. */ - sc->sc_irq_alloc = vmem_create("GICv3 ITS IRQs", 0, + sc->sc_irq_alloc = vmem_create(device_get_nameunit(dev), 0, gicv3_get_nirqs(dev), 1, 0, M_FIRSTFIT | M_WAITOK); sc->sc_irqs = malloc(sizeof(*sc->sc_irqs) * sc->sc_irq_length, From owner-svn-src-all@freebsd.org Mon Feb 3 14:25:34 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0C2E424DF3E; Mon, 3 Feb 2020 14:25:34 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48B98s6QlRz4cqy; Mon, 3 Feb 2020 14:25:33 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D7B0A1EFA; Mon, 3 Feb 2020 14:25:33 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 013EPXPr080709; Mon, 3 Feb 2020 14:25:33 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 013EPWtO080704; Mon, 3 Feb 2020 14:25:32 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202002031425.013EPWtO080704@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 3 Feb 2020 14:25:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357446 - in head/sys: fs/devfs fs/nullfs kern ufs/ffs vm X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: fs/devfs fs/nullfs kern ufs/ffs vm X-SVN-Commit-Revision: 357446 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 14:25:34 -0000 Author: mjg Date: Mon Feb 3 14:25:32 2020 New Revision: 357446 URL: https://svnweb.freebsd.org/changeset/base/357446 Log: Fix up various vnode-related asserts which did not dump the used vnode Modified: head/sys/fs/devfs/devfs_vnops.c head/sys/fs/nullfs/null_subr.c head/sys/kern/vfs_bio.c head/sys/ufs/ffs/ffs_vnops.c head/sys/vm/vnode_pager.c Modified: head/sys/fs/devfs/devfs_vnops.c ============================================================================== --- head/sys/fs/devfs/devfs_vnops.c Mon Feb 3 13:50:55 2020 (r357445) +++ head/sys/fs/devfs/devfs_vnops.c Mon Feb 3 14:25:32 2020 (r357446) @@ -479,8 +479,7 @@ loop: dev_refl(dev); /* XXX: v_rdev should be protect by vnode lock */ vp->v_rdev = dev; - KASSERT(vp->v_usecount == 1, - ("%s %d (%d)\n", __func__, __LINE__, vp->v_usecount)); + VNPASS(vp->v_usecount == 1, vp); dev->si_usecount++; /* Special casing of ttys for deadfs. Probably redundant. */ dsw = dev->si_devsw; Modified: head/sys/fs/nullfs/null_subr.c ============================================================================== --- head/sys/fs/nullfs/null_subr.c Mon Feb 3 13:50:55 2020 (r357445) +++ head/sys/fs/nullfs/null_subr.c Mon Feb 3 14:25:32 2020 (r357446) @@ -209,7 +209,7 @@ null_nodeget(mp, lowervp, vpp) int error; ASSERT_VOP_LOCKED(lowervp, "lowervp"); - KASSERT(lowervp->v_usecount >= 1, ("Unreferenced vnode %p", lowervp)); + VNPASS(lowervp->v_usecount > 0, lowervp); /* Lookup the hash firstly. */ *vpp = null_hashget(mp, lowervp); Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Mon Feb 3 13:50:55 2020 (r357445) +++ head/sys/kern/vfs_bio.c Mon Feb 3 14:25:32 2020 (r357446) @@ -2859,10 +2859,8 @@ vfs_vmio_iodone(struct buf *bp) REFCOUNT_COUNT(obj->paging_in_progress), bp->b_npages)); vp = bp->b_vp; - KASSERT(vp->v_holdcnt > 0, - ("vfs_vmio_iodone: vnode %p has zero hold count", vp)); - KASSERT(vp->v_object != NULL, - ("vfs_vmio_iodone: vnode %p has no vm_object", vp)); + VNPASS(vp->v_holdcnt > 0, vp); + VNPASS(vp->v_object != NULL, vp); foff = bp->b_offset; KASSERT(bp->b_offset != NOOFFSET, Modified: head/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vnops.c Mon Feb 3 13:50:55 2020 (r357445) +++ head/sys/ufs/ffs/ffs_vnops.c Mon Feb 3 14:25:32 2020 (r357446) @@ -441,8 +441,7 @@ ffs_lock(ap) flags = ap->a_flags; for (;;) { #ifdef DEBUG_VFS_LOCKS - KASSERT(vp->v_holdcnt != 0, - ("ffs_lock %p: zero hold count", vp)); + VNPASS(vp->v_holdcnt != 0, vp); #endif lkp = vp->v_vnlock; result = _lockmgr_args(lkp, flags, VI_MTX(vp), Modified: head/sys/vm/vnode_pager.c ============================================================================== --- head/sys/vm/vnode_pager.c Mon Feb 3 13:50:55 2020 (r357445) +++ head/sys/vm/vnode_pager.c Mon Feb 3 14:25:32 2020 (r357446) @@ -248,7 +248,7 @@ vnode_pager_alloc(void *handle, vm_ooffset_t size, vm_ vp = (struct vnode *)handle; ASSERT_VOP_LOCKED(vp, "vnode_pager_alloc"); - KASSERT(vp->v_usecount != 0, ("vnode_pager_alloc: no vnode reference")); + VNPASS(vp->v_usecount > 0, vp); retry: object = vp->v_object; From owner-svn-src-all@freebsd.org Mon Feb 3 14:28:32 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 39E1824DFE4; Mon, 3 Feb 2020 14:28:32 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48B9DJ0Y9jz4d1x; Mon, 3 Feb 2020 14:28:32 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0E2341F01; Mon, 3 Feb 2020 14:28:32 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 013ESV9A080883; Mon, 3 Feb 2020 14:28:31 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 013ESV5R080882; Mon, 3 Feb 2020 14:28:31 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202002031428.013ESV5R080882@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 3 Feb 2020 14:28:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357447 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 357447 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 14:28:32 -0000 Author: mjg Date: Mon Feb 3 14:28:31 2020 New Revision: 357447 URL: https://svnweb.freebsd.org/changeset/base/357447 Log: fd: fix f_count acquire in fget_unlocked The code was using a hand-rolled fcmpset loop, while in other places the same count is manipulated with the refcount API. This transferred from a stylistic issue into a bug after the API got extended to support flags. As a result the hand-rolled loop could bump the count high enough to set the bit flag. Another bump + refcount_release would then free the file prematurely. The bug is only present in -CURRENT. Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Mon Feb 3 14:25:32 2020 (r357446) +++ head/sys/kern/kern_descrip.c Mon Feb 3 14:28:31 2020 (r357447) @@ -2693,7 +2693,6 @@ fget_unlocked(struct filedesc *fdp, int fd, cap_rights #endif const struct fdescenttbl *fdt; struct file *fp; - u_int count; #ifdef CAPABILITIES seqc_t seq; cap_rights_t haverights; @@ -2729,27 +2728,27 @@ fget_unlocked(struct filedesc *fdp, int fd, cap_rights if (error != 0) return (error); #endif - count = fp->f_count; - retry: - if (count == 0) { + if (__predict_false(!refcount_acquire_if_not_zero(&fp->f_count))) { /* + * The count was found either saturated or zero. + * This re-read is not any more racy than using the + * return value from fcmpset. + */ + if (fp->f_count != 0) + return (EBADF); + /* * Force a reload. Other thread could reallocate the - * table before this fd was closed, so it possible that - * there is a stale fp pointer in cached version. + * table before this fd was closed, so it is possible + * that there is a stale fp pointer in cached version. */ fdt = (struct fdescenttbl *)atomic_load_ptr(&fdp->fd_files); continue; } - if (__predict_false(count + 1 < count)) - return (EBADF); - /* * Use an acquire barrier to force re-reading of fdt so it is * refreshed for verification. */ - if (__predict_false(atomic_fcmpset_acq_int(&fp->f_count, - &count, count + 1) == 0)) - goto retry; + atomic_thread_fence_acq(); fdt = fdp->fd_files; #ifdef CAPABILITIES if (seqc_consistent_nomb(fd_seqc(fdt, fd), seq)) From owner-svn-src-all@freebsd.org Mon Feb 3 14:38:19 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D4FF524E1E2; Mon, 3 Feb 2020 14:38:19 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48B9Rb54h9z4dVc; Mon, 3 Feb 2020 14:38:19 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A924620E8; Mon, 3 Feb 2020 14:38:19 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 013EcJPo086818; Mon, 3 Feb 2020 14:38:19 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 013EcJOY086817; Mon, 3 Feb 2020 14:38:19 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202002031438.013EcJOY086817@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 3 Feb 2020 14:38:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357448 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 357448 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 14:38:19 -0000 Author: andrew Date: Mon Feb 3 14:38:19 2020 New Revision: 357448 URL: https://svnweb.freebsd.org/changeset/base/357448 Log: Remove the GICv3 ITS irq and replace it with an ID In r357324 most of the use of gi_irq was moved to gi_lpi. Complete this with the last few places we need the IRQ value and create gi_id for the per-device value we need. MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/gicv3_its.c Modified: head/sys/arm64/arm64/gicv3_its.c ============================================================================== --- head/sys/arm64/arm64/gicv3_its.c Mon Feb 3 14:28:31 2020 (r357447) +++ head/sys/arm64/arm64/gicv3_its.c Mon Feb 3 14:38:19 2020 (r357448) @@ -223,7 +223,7 @@ struct its_col { struct gicv3_its_irqsrc { struct intr_irqsrc gi_isrc; - u_int gi_irq; + u_int gi_id; u_int gi_lpi; struct its_dev *gi_its_dev; }; @@ -806,7 +806,7 @@ gicv3_its_attach(device_t dev) M_GICV3_ITS, M_WAITOK | M_ZERO); name = device_get_nameunit(dev); for (i = 0; i < sc->sc_irq_length; i++) { - sc->sc_irqs[i].gi_irq = i; + sc->sc_irqs[i].gi_id = -1; sc->sc_irqs[i].gi_lpi = i + sc->sc_irq_base - GIC_FIRST_LPI; err = intr_isrc_register(&sc->sc_irqs[i].gi_isrc, dev, 0, "%s,%u", name, i); @@ -906,7 +906,7 @@ gicv3_its_pre_ithread(device_t dev, struct intr_irqsrc sc = device_get_softc(dev); girq = (struct gicv3_its_irqsrc *)isrc; gicv3_its_disable_intr(dev, isrc); - gic_icc_write(EOIR1, girq->gi_irq + sc->sc_irq_base); + gic_icc_write(EOIR1, girq->gi_lpi + GIC_FIRST_LPI); } static void @@ -924,7 +924,7 @@ gicv3_its_post_filter(device_t dev, struct intr_irqsrc sc = device_get_softc(dev); girq = (struct gicv3_its_irqsrc *)isrc; - gic_icc_write(EOIR1, girq->gi_irq + sc->sc_irq_base); + gic_icc_write(EOIR1, girq->gi_lpi + GIC_FIRST_LPI); } static int @@ -1135,6 +1135,7 @@ gicv3_its_alloc_msi(device_t dev, device_t child, int for (i = 0; i < count; i++, irq++) { its_dev->lpis.lpi_free--; girq = &sc->sc_irqs[irq]; + girq->gi_id = i; girq->gi_its_dev = its_dev; srcs[i] = (struct intr_irqsrc *)girq; @@ -1167,6 +1168,7 @@ gicv3_its_release_msi(device_t dev, device_t child, in its_dev->lpis.lpi_busy)); for (i = 0; i < count; i++) { girq = (struct gicv3_its_irqsrc *)isrc[i]; + girq->gi_id = -1; girq->gi_its_dev = NULL; } its_dev->lpis.lpi_busy -= count; @@ -1196,11 +1198,13 @@ gicv3_its_alloc_msix(device_t dev, device_t child, dev sc = device_get_softc(dev); irq = its_dev->lpis.lpi_base + its_dev->lpis.lpi_num - its_dev->lpis.lpi_free; - its_dev->lpis.lpi_free--; - its_dev->lpis.lpi_busy++; girq = &sc->sc_irqs[irq]; + girq->gi_id = its_dev->lpis.lpi_busy; girq->gi_its_dev = its_dev; + its_dev->lpis.lpi_free--; + its_dev->lpis.lpi_busy++; + /* Map the message to the given IRQ */ gicv3_its_select_cpu(dev, (struct intr_irqsrc *)girq); its_cmd_mapti(dev, girq); @@ -1227,6 +1231,7 @@ gicv3_its_release_msix(device_t dev, device_t child, s "were allocated: allocated %d", its_dev->lpis.lpi_busy)); girq = (struct gicv3_its_irqsrc *)isrc; girq->gi_its_dev = NULL; + girq->gi_id = -1; its_dev->lpis.lpi_busy--; if (its_dev->lpis.lpi_busy == 0) @@ -1246,7 +1251,7 @@ gicv3_its_map_msi(device_t dev, device_t child, struct girq = (struct gicv3_its_irqsrc *)isrc; *addr = vtophys(rman_get_virtual(sc->sc_its_res)) + GITS_TRANSLATER; - *data = girq->gi_irq - girq->gi_its_dev->lpis.lpi_base; + *data = girq->gi_id; return (0); } @@ -1581,7 +1586,7 @@ its_cmd_movi(device_t dev, struct gicv3_its_irqsrc *gi desc.cmd_type = ITS_CMD_MOVI; desc.cmd_desc_movi.its_dev = girq->gi_its_dev; desc.cmd_desc_movi.col = col; - desc.cmd_desc_movi.id = girq->gi_irq - girq->gi_its_dev->lpis.lpi_base; + desc.cmd_desc_movi.id = girq->gi_id; its_cmd_send(dev, &desc); } @@ -1619,9 +1624,9 @@ its_cmd_mapti(device_t dev, struct gicv3_its_irqsrc *g desc.cmd_desc_mapvi.its_dev = girq->gi_its_dev; desc.cmd_desc_mapvi.col = col; /* The EventID sent to the device */ - desc.cmd_desc_mapvi.id = girq->gi_irq - girq->gi_its_dev->lpis.lpi_base; + desc.cmd_desc_mapvi.id = girq->gi_id; /* The physical interrupt presented to softeware */ - desc.cmd_desc_mapvi.pid = girq->gi_irq + sc->sc_irq_base; + desc.cmd_desc_mapvi.pid = girq->gi_lpi + GIC_FIRST_LPI; its_cmd_send(dev, &desc); } @@ -1651,7 +1656,7 @@ its_cmd_inv(device_t dev, struct its_dev *its_dev, desc.cmd_type = ITS_CMD_INV; /* The EventID sent to the device */ - desc.cmd_desc_inv.pid = girq->gi_irq - its_dev->lpis.lpi_base; + desc.cmd_desc_inv.pid = girq->gi_id; desc.cmd_desc_inv.its_dev = its_dev; desc.cmd_desc_inv.col = col; From owner-svn-src-all@freebsd.org Mon Feb 3 15:22:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CF00924ED8B; Mon, 3 Feb 2020 15:22:46 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BBQt5qnGz3CGs; Mon, 3 Feb 2020 15:22:46 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C34842A5A; Mon, 3 Feb 2020 15:22:46 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 013FMkm4016907; Mon, 3 Feb 2020 15:22:46 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 013FMkPP016905; Mon, 3 Feb 2020 15:22:46 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202002031522.013FMkPP016905@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Mon, 3 Feb 2020 15:22:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357449 - head/usr.bin/units X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/usr.bin/units X-SVN-Commit-Revision: 357449 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 15:22:46 -0000 Author: 0mp (doc,ports committer) Date: Mon Feb 3 15:22:46 2020 New Revision: 357449 URL: https://svnweb.freebsd.org/changeset/base/357449 Log: units(1): Refactor the manual page and update usage information Changes to units.1: - Change the description to a more descriptive "conversion calculator". - Sort options. - Split the description into sections to make it easier to navigate the manual page. - Improve the description of various options. - Document the default value of the output format. - Use more mdoc macros for better readability. - Document the behavior of the PATH environmental variable. - Improve examples. - Add sections: EXIT STATUS, DIAGNOSTICS, and HISTORY. - Document that units(1) cannot convert negative values and it handles long unit lists poorly. - Update the documentation of the -V flag to match the implementation. units(1) prints its version and the units data file instead of its version and usage information. Changes to units.c: - Update usage information. - Sort longopts elements. This commit does not attempts to change the current behavior of units(1). What's left to do is probably defining a better versioning (at the moment units(1) always reports "FreeBSD units" as its version) and changing the behavior of the -V flag to only print version. Reviewed by: allanjude (earlier version), bcr Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D18977 Modified: head/usr.bin/units/units.1 head/usr.bin/units/units.c Modified: head/usr.bin/units/units.1 ============================================================================== --- head/usr.bin/units/units.1 Mon Feb 3 14:38:19 2020 (r357448) +++ head/usr.bin/units/units.1 Mon Feb 3 15:22:46 2020 (r357449) @@ -1,115 +1,126 @@ .\" $FreeBSD$ -.Dd August 12, 2017 +.Dd February 3, 2020 .Dt UNITS 1 .Os .Sh NAME .Nm units -.Nd conversion program +.Nd conversion calculator .Sh SYNOPSIS .Nm -.Op Fl f Ar filename -.Op Fl H Ar filename -.Op Fl qvUV -.Op Ar from-unit to-unit -.Sh OPTIONS +.Op Fl ehqtUVv +.Op Fl f Ar unitsfile +.Op Fl o Ar format +.Op Ar from to +.Sh DESCRIPTION +The +.Nm +program converts quantities expressed in various scales to +their equivalents in other scales. +It can only +handle multiplicative or affine scale changes. +.Pp +.Nm +can work interactively by prompting +the user for input +.Pq see Sx EXAMPLES +or non-interactively, providing a conversion for given arguments +.Ar from +and +.Ar to . +.Pp The following options are available: -.Bl -tag -width indent -.It Fl h \&No , Fl -help -Show an overview of options -.It Fl f Ar filename \&No , Fl -file Ar filename +.Bl -tag -width "from to" +.It Fl e , Fl -exponential +Same as +.Fl o +.Cm %6e +(see the description of the +.Fl o +flag). +.It Fl f Ar unitsfile , Fl -file Ar unitsfile Specify the name of the units data file to load. -.It Fl H Ar filename \&No , Fl -history Ar filename +This option may be specified multiple times. +.It Fl H Ar historyfile , Fl -history Ar historyfile Ignored, for compatibility with GNU units. -.It Fl e , Fl -exponential -Behave as if -o '%6e' was typed. -.It Fl q \&No , Fl -quiet +.It Fl h , Fl -help +Show an overview of options. +.It Fl o Ar format , Fl -output-format Ar format +Select the output format string by which numbers are printed. +Defaults to +.Dq Li %.8g . +.It Fl q , Fl -quiet Suppress prompting of the user for units and the display of statistics about the number of units loaded. -.It Fl U \&No , Fl -unitsfile -If the default unit file exists prints its location. -If not, print -.Qo -Units data file not found -.Qc -.It Fl t \&No , Fl -terse -Only print the result. This is used when calling +.It Fl t , Fl -terse +Only print the result. +This is used when calling .Nm from other programs for easy to parse results. -.It Fl v \&No , Fl -verbose +.It Fl U , Fl -unitsfile +Print the location of the default unit file if it exists. +Otherwise, print +.Dq Units data file not found . +.It Fl V , Fl -version +Print the version number +.Pq which is fixed at Dq Fx units , +the path to the units data file and exit. +.It Fl v , Fl -verbose Print the units in the conversion output. Be more verbose in general. -.It Fl o Ar format \&No , Fl -output-format Ar format -Select the output format string by which numbers are printed. -.It Fl V \&No , Fl -version -Print the version number, usage, and then exit. -.It Ar from-unit to-unit +.It Ar from to Allow a single unit conversion to be done directly from the command line. The program will not print prompts. -It will print out the -result of the single specified conversion. +It will print out the result of the single specified conversion. +Both arguments, i.e., +.Ar from +and +.Ar to , +can be just a unit +.Pq e.g., Dq Cm cm , +a quantity +.Pq e.g., Dq Cm 42 , +or a quantity with a unit +.Pq e.g., Dq Cm 42 cm .El -.Sh DESCRIPTION -The -.Nm -program converts quantities expressed in various scales to -their equivalents in other scales. -The -.Nm -program can only -handle multiplicative or affine scale changes. -It works interactively by prompting -the user for input: -.Bd -literal - You have: meters - You want: feet - * 3.2808399 - / 0.3048 - - You have: cm^3 - You want: gallons - * 0.00026417205 - / 3785.4118 - - You have: meters/s - You want: furlongs/fortnight - * 6012.8848 - / 0.00016630952 - - You have: 1|2 inch - You want: cm - * 1.27 - / 0.78740157 - - You have: 85 degF - You want: degC - 29.444444 -.Ed -.Pp -Powers of units can be specified using the '^' character as shown in -the example, or by simple concatenation: 'cm3' is equivalent to 'cm^3'. -Multiplication of units can be specified by using spaces, a dash or -an asterisk. -Division of units is indicated by the slash ('/'). -Note that multiplication has a higher precedence than division, -so 'm/s/s' is the same as 'm/s^2' or 'm/s s'. +.Ss Mathematical operators +.Bl -dash -compact +.It +Powers of units can be specified using the +.Dq Ic ^ +character as shown in the example, or by simple concatenation: +.Dq Ic cm3 +is +equivalent to +.Dq Ic cm^3 . +See the +.Sx BUGS +section +for details on the limitations of exponent values. +.It +Multiplication of units can be specified by using spaces +.Pq Dq " " , +a dash +.Pq Dq - +or an asterisk +.Pq Dq * . +.It +Division of units is indicated by the slash +.Pq Dq Ic / . +.It Division of numbers -must be indicated using the vertical bar ('|'). -To convert half a -meter, you would write '1|2 meter'. -If you write '1/2 meter' then the -units program would interpret that as equivalent to '0.5/meter'. -If you enter incompatible unit types, the units program will -print a message indicating that the units are not conformable and -it will display the reduced form for each unit: -.Bd -literal - You have: ergs/hour - You want: fathoms kg^2 / day - conformability error - 2.7777778e-11 kg m^2 / sec^3 - 2.1166667e-05 kg^2 m / sec -.Ed +must be indicated using the vertical bar +.Pq Dq Ic \&| Ns . +.El .Pp +Note that multiplication has a higher precedence than division, +so +.Dq Ic m/s/s +is the same as +.Dq Ic m/s^2 +or +.Dq Ic m/s s . +.Ss Units The conversion information is read from a units data file. The default file includes definitions for most familiar units, abbreviations and @@ -128,48 +139,165 @@ Some constants of nature included are: .It "au astronomical unit" .El .Pp -The unit 'pound' is a unit of mass. +The unit +.Dq Ic pound +is a unit of mass. Compound names are run together -so 'pound force' is a unit of force. -The unit 'ounce' is also a unit -of mass. -The fluid ounce is 'floz'. +so +.Dq Ic pound force +is a unit of force. +The unit +.Dq Ic ounce +is also a unit of mass. +The fluid ounce is +.Dq Ic floz . British units that differ from -their US counterparts are prefixed with 'br', and currency is prefixed -with its country name: 'belgiumfranc', 'britainpound'. +their US counterparts are prefixed with +.Dq br , +and currency is prefixed with its country name: +.Dq Ic belgiumfranc , +.Dq Ic britainpound . When searching for a unit, if the specified string does not appear exactly as a unit name, then .Nm -will try to remove a trailing 's' or a -trailing 'es' and check again for a match. -.Pp +will try to remove a trailing +.Dq s +or a trailing +.Dq es +and check again for a match. +.Ss Units file format To find out what units are available read the standard units file. If you want to add your own units you can supply your own file. A unit is specified on a single line by giving its name and an equivalence. Be careful to define new units in terms of old ones so that a reduction leads to the -primitive units which are marked with '!' characters. +primitive units which are marked with +.Dq \&! +characters. The .Nm program will not detect infinite loops that could be caused by careless unit definitions. Comments in the unit definition file -begin with a '#' or '/' character at the beginning of a line. +begin with a +.Dq # +or +.Dq / +character at the beginning of a line. .Pp Prefixes are defined in the same way as standard units, but with -a trailing dash at the end of the prefix name. +a trailing dash +.Pq Dq - +at the end of the prefix name. If a unit is not found -even after removing trailing 's' or 'es', then it will be checked -against the list of prefixes. +even after removing trailing +.Dq s +or +.Dq es , +then it will be checked against the list of prefixes. Prefixes will be removed until a legal base unit is identified. +.Sh ENVIRONMENT +.Bl -tag -width PATH +.It Ev PATH +The colon-separated list of root directories at which +.Nm +tries to find +.Pa /usr/share/misc/definitions.units . .Pp +For example if +.Ev PATH +is set to +.Dq Li /tmp:/:/usr/local , +no +.Fl f +flags are provided, and +.Pa /usr/share/misc/definitions.units +is missing then +.Nm +tries to open the following files as the default units file: +.Pa /tmp/usr/share/misc/definitions.units , +.Pa /usr/share/misc/definitions.units , +and +.Pa /usr/local/usr/share/misc/definitions.units . +.El +.Sh FILES +.Bl -tag -width /usr/share/misc/definitions.units -compact +.It Pa /usr/share/misc/definitions.units +The standard units file. +.El +.Sh EXIT STATUS +.Ex -std +.Sh EXAMPLES +.Bl -tag -width 0n +.It Sy Example 1 : No Interactive usage +.Pp +Here is an example of an interactive session where the user is prompted for +units: +.Bd -literal -offset 2n +.Li You have : Ic meters +.Li You want : Ic feet + * 3.2808399 + / 0.3048 + +.Li You have : Ic cm^3 +.Li You want : Ic gallons + * 0.00026417205 + / 3785.4118 + +.Li You have : Ic meters/s +.Li You want : Ic furlongs/fortnight + * 6012.8848 + / 0.00016630952 + +.Li You have : Ic 1|2 inch +.Li You want : Ic cm + * 1.27 + / 0.78740157 + +.Li You have : Ic 85 degF +.Li You want : Ic degC + 29.444444 +.Ed +.It Sy Example 2 : No Difference between Do Ic \&| Dc No and Do Ic / Dc No division +.Pp +The following command shows how to convert half a meter to centimeters. +.Bd -literal -offset 2n +.Li $ Ic units '1|2 meter' cm + * 50 + / 0.02 +.Ed +.Pp +.Nm +prints the expected result because the division operator for numbers +.Pq Dq Li \&| +was used. +.Pp +Using the division operator for units +.Pq Dq Li / +would result in an error: +.Bd -literal -offset 2n +.Li $ Ic units '1/2 meter' cm +conformability error + 0.5 / m + 0.01 m +.Ed +.Pp +It is because +.Nm +interprets +.Dq Ic 1/2 meter +as +.Dq Ic 0.5/meter , +which is not conformable to +.Dq Ic cm . +.It Sy Example 3 : No Simple units file Here is an example of a short units file that defines some basic -units. +units: .Pp -.Bl -column -offset indent -compact "minute" +.Bl -column -offset 2n -compact "minute" .It "m !a!" .It "sec !b!" .It "micro- 1e-6" @@ -179,21 +307,122 @@ units. .It "ft 12 inches" .It "mile 5280 ft" .El -.Sh FILES -.Bl -tag -width /usr/share/misc/definitions.units -compact -.It Pa /usr/share/misc/definitions.units -the standard units library +.It Sy Example 4 : No Viewing units and conversions of the default units file +The following shell one-liner allows the user to view the contents of the +default units file: +.Bd -literal -offset 2n +.Li $ Ic less \&"$(units -U)" +.Ed .El +.Sh DIAGNOSTICS +.Bl -diag +.It can't find units file '%s' +The default units file is not in its default location +.Pq see Sx FILES +and it is not present in any file tree starting with their roots at directories from +.Ev PATH +.Pq see Sx ENVIRONMENT . +.It cap_rights_limit\&() failed +See +.Xr capsicum 4 . +.It conformability error +It is not possible to reduce the given units to one common unit: +they are not conformable. +Instead of a conversion, +.Nm +will display the reduced form for each provided unit: +.Bd -literal -offset 2n +.Li You have : Ic ergs/hour +.Li You want : Ic fathoms kg^2 / day +conformability error + 2.7777778e-11 kg m^2 / sec^3 + 2.1166667e-05 kg^2 m / sec +.Ed +.It Could not initialize history +See +.Xr editline 3 . +.It dupstr +.Xr strdup 3 +failed. +.It memory for prefixes exceeded in line %d +Over 100 prefixes were defined. +.It memory for units exceeded in line %d +Over 1000 prefixes were defined. +.It memory overflow in unit reduction +The requested conversion involves too many units +.Pq see Sx BUGS . +.It redefinition of prefix '%s' on line %d ignored +.No "" +.It redefinition of unit '%s' on line %d ignored +.No "" +.It unexpected end of prefix on line %d +.No "" +.It unexpected end of unit on line %d +.No "" +.It Units data file not found +The default units file is missing. +.It unable to enter capability mode +See +.Xr capsicum 4 . +.It unable to open units file '%s' +One of the user-specified units files cannot be opened. +.It unit reduces to zero +.No "" +.It unknown unit '%s' +The provided unit cannot be found in the units file. +.It WARNING: conversion of non-proportional quantities. +.Nm +may fail to convert +.Ar from +to +.Ar to +because the units are not proportional. +The warning is printed when a quantity is a part of the +.Ar to +argument. +It can be illustrated on an example of conversion from Fahrenheit to Celsius: +.Bd -literal -offset 2n +.Li $ Ic units \&"degF" \&"degC" + (-> x*0.55555556g -17.777778g) + (<- y*1.8g 32g) +.Li $ Ic units \&"degF" \&"1 degC" +WARNING: conversion of non-proportional quantities. + (-> x*0.55555556g -17.777778g) + (<- y*1.8g 32g) +.Li $ Ic units \&"1 degF" \&"1 degC" +WARNING: conversion of non-proportional quantities. + -17.222222 +.Ed +.El +.Sh SEE ALSO +.Xr bc 1 +.Sh HISTORY +The +.Nm +first appeared in +.Nx +and was ported to +.Fx 2.2.0 . +.Pp +The manual page was significantly rewritten in +.Fx 13.0 +by +.An Mateusz Piotrowski Aq Mt 0mp@FreeBSD.org . .Sh AUTHORS .An Adrian Mariano Aq Mt adrian@cam.cornell.edu .Sh BUGS -The effect of including a '/' in a prefix is surprising. +The effect of including a +.Dq / +in a prefix is surprising. .Pp Exponents entered by the user can be only one digit. You can work around this by multiplying several terms. .Pp -The user must use | to indicate division of numbers and / to -indicate division of symbols. +The user must use +.Dq Ic \&| +to indicate division of numbers and +.Dq Ic / +to indicate division of symbols. This distinction should not be necessary. .Pp @@ -203,3 +432,30 @@ of the units converted and on the length of the data f The program should use a hash table to store units so that it does not take so long to load the units list and check for duplication. +.Pp +It is not possible to convert a negative value. +.Pp +The +.Nm +program +does not handle reductions of long lists of units very well: +.Bd -literal -offset 2n +.Li $ Ic units \&"$(yes m | head -n 154)" \&"$(yes cm | head -n 154)" + * 1e+308 + / 1e-308 +.Li $ Ic units \&"$(yes m | head -n 333)" \&"$(yes cm | head -n 333)" + * inf + / 0 +.Li $ Ic units \&"$(yes m | head -n 500)" \&"$(yes cm | head -n 500)" +units: memory overflow in unit reduction +conformability error + 1 m^500 + 1 centi cm^499 +.Li $ Ic units \&"$(yes m | head -n 501)" \&"$(yes cm | head -n 501)" +units: memory overflow in unit reduction +units: memory overflow in unit reduction +units: memory overflow in unit reduction +conformability error + 1 m^500 + 1 centi cm^499 +.Ed Modified: head/usr.bin/units/units.c ============================================================================== --- head/usr.bin/units/units.c Mon Feb 3 14:38:19 2020 (r357448) +++ head/usr.bin/units/units.c Mon Feb 3 15:22:46 2020 (r357449) @@ -731,21 +731,21 @@ static void __dead2 usage(void) { fprintf(stderr, - "usage: units [-f unitsfile] [-H historyfile] [-UVq] [from-unit to-unit]\n"); + "usage: units [-ehqtUVv] [-f unitsfile] [-o format] [from to]\n"); exit(3); } static struct option longopts[] = { - {"help", no_argument, NULL, 'h'}, {"exponential", no_argument, NULL, 'e'}, {"file", required_argument, NULL, 'f'}, {"history", required_argument, NULL, 'H'}, + {"help", no_argument, NULL, 'h'}, {"output-format", required_argument, NULL, 'o'}, {"quiet", no_argument, NULL, 'q'}, {"terse", no_argument, NULL, 't'}, {"unitsfile", no_argument, NULL, 'U'}, - {"verbose", no_argument, NULL, 'v'}, {"version", no_argument, NULL, 'V'}, + {"verbose", no_argument, NULL, 'v'}, { 0, 0, 0, 0 } }; From owner-svn-src-all@freebsd.org Mon Feb 3 16:41:40 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C16D6228323; Mon, 3 Feb 2020 16:41:40 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BD9w3H5Cz3HWp; Mon, 3 Feb 2020 16:41:40 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6BC7B3B8C; Mon, 3 Feb 2020 16:41:40 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 013GfeMU063225; Mon, 3 Feb 2020 16:41:40 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 013Gfe8g063224; Mon, 3 Feb 2020 16:41:40 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202002031641.013Gfe8g063224@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 3 Feb 2020 16:41:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357450 - head/contrib/elftoolchain/addr2line X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/contrib/elftoolchain/addr2line X-SVN-Commit-Revision: 357450 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 16:41:40 -0000 Author: markj Date: Mon Feb 3 16:41:40 2020 New Revision: 357450 URL: https://svnweb.freebsd.org/changeset/base/357450 Log: addr2line: Cache CU DIEs upon a successful address lookup. Previously, addr2line would sequentially search all CUs for each input address. For some uses, notably syzkaller's code coverage map generator, this was extremely slow. Add a CU cache into which entries are added following a successful lookup, and search the cache before falling back to a scan. When translating a large number of addresses this yields slightly better performance than GNU addr2line. Garbage-collect an unused hash table which appears to have been intended for the same purpose. A hash table doesn't seem particularly suitable since each CU spans a range of addresses. Submitted by: Tiger Gao MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D23418 Modified: head/contrib/elftoolchain/addr2line/addr2line.c Modified: head/contrib/elftoolchain/addr2line/addr2line.c ============================================================================== --- head/contrib/elftoolchain/addr2line/addr2line.c Mon Feb 3 15:22:46 2020 (r357449) +++ head/contrib/elftoolchain/addr2line/addr2line.c Mon Feb 3 16:41:40 2020 (r357450) @@ -25,6 +25,7 @@ */ #include +#include #include #include @@ -39,7 +40,6 @@ #include #include -#include "uthash.h" #include "_elftc.h" ELFTC_VCSID("$Id: addr2line.c 3499 2016-11-25 16:06:29Z emaste $"); @@ -57,13 +57,14 @@ struct Func { }; struct CU { + RB_ENTRY(CU) entry; Dwarf_Off off; Dwarf_Unsigned lopc; Dwarf_Unsigned hipc; char **srcfiles; Dwarf_Signed nsrcfiles; STAILQ_HEAD(, Func) funclist; - UT_hash_handle hh; + Dwarf_Die die; }; static struct option longopts[] = { @@ -80,11 +81,23 @@ static struct option longopts[] = { {"version", no_argument, NULL, 'V'}, {NULL, 0, NULL, 0} }; + static int demangle, func, base, inlines, print_addr, pretty_print; static char unknown[] = { '?', '?', '\0' }; static Dwarf_Addr section_base; -static struct CU *culist; +/* Need a new curlopc that stores last lopc value. */ +static Dwarf_Unsigned curlopc = ~0ULL; +static RB_HEAD(cutree, CU) head = RB_INITIALIZER(&head); +static int +lopccmp(struct CU *e1, struct CU *e2) +{ + return (e1->lopc < e2->lopc ? -1 : e1->lopc > e2->lopc); +} + +RB_PROTOTYPE(cutree, CU, entry, lopccmp); +RB_GENERATE(cutree, CU, entry, lopccmp) + #define USAGE_MESSAGE "\ Usage: %s [options] hexaddress...\n\ Map program addresses to source file names and line numbers.\n\n\ @@ -378,6 +391,26 @@ print_inlines(struct CU *cu, struct Func *f, Dwarf_Uns f->call_line); } +static struct CU * +culookup(Dwarf_Unsigned addr) +{ + struct CU find, *res; + + find.lopc = addr; + res = RB_NFIND(cutree, &head, &find); + if (res != NULL) { + if (res->lopc != addr) + res = RB_PREV(cutree, &head, res); + if (res != NULL && addr >= res->lopc && addr < res->hipc) + return (res); + } else { + res = RB_MAX(cutree, &head); + if (res != NULL && addr >= res->lopc && addr < res->hipc) + return (res); + } + return (NULL); +} + static void translate(Dwarf_Debug dbg, Elf *e, const char* addrstr) { @@ -400,11 +433,30 @@ translate(Dwarf_Debug dbg, Elf *e, const char* addrstr addr += section_base; lineno = 0; file = unknown; - cu = NULL; die = NULL; + ret = DW_DLV_OK; - while ((ret = dwarf_next_cu_header(dbg, NULL, NULL, NULL, NULL, NULL, - &de)) == DW_DLV_OK) { + cu = culookup(addr); + if (cu != NULL) { + die = cu->die; + goto status_ok; + } + + while (true) { + /* + * We resume the CU scan from the last place we found a match. + * Because when we have 2 sequential addresses, and the second + * one is of the next CU, it is faster to just go to the next CU + * instead of starting from the beginning. + */ + ret = dwarf_next_cu_header(dbg, NULL, NULL, NULL, NULL, NULL, + &de); + if (ret == DW_DLV_NO_ENTRY) { + if (curlopc == ~0ULL) + goto out; + ret = dwarf_next_cu_header(dbg, NULL, NULL, NULL, NULL, + NULL, &de); + } die = NULL; while (dwarf_siblingof(dbg, die, &ret_die, &de) == DW_DLV_OK) { if (die != NULL) @@ -420,12 +472,15 @@ translate(Dwarf_Debug dbg, Elf *e, const char* addrstr if (tag == DW_TAG_compile_unit) break; } + if (ret_die == NULL) { warnx("could not find DW_TAG_compile_unit die"); goto next_cu; } if (dwarf_attrval_unsigned(die, DW_AT_low_pc, &lopc, &de) == DW_DLV_OK) { + if (lopc == curlopc) + goto out; if (dwarf_attrval_unsigned(die, DW_AT_high_pc, &hipc, &de) == DW_DLV_OK) { /* @@ -440,31 +495,27 @@ translate(Dwarf_Debug dbg, Elf *e, const char* addrstr hipc = ~0ULL; } - /* - * Record the CU in the hash table for faster lookup - * later. - */ if (dwarf_dieoffset(die, &off, &de) != DW_DLV_OK) { warnx("dwarf_dieoffset failed: %s", dwarf_errmsg(de)); goto out; } - HASH_FIND(hh, culist, &off, sizeof(off), cu); - if (cu == NULL) { + + if (addr >= lopc && addr < hipc) { if ((cu = calloc(1, sizeof(*cu))) == NULL) err(EXIT_FAILURE, "calloc"); cu->off = off; cu->lopc = lopc; cu->hipc = hipc; + cu->die = die; STAILQ_INIT(&cu->funclist); - HASH_ADD(hh, culist, off, sizeof(off), cu); - } + RB_INSERT(cutree, &head, cu); - if (addr >= lopc && addr < hipc) + curlopc = lopc; break; + } } - - next_cu: +next_cu: if (die != NULL) { dwarf_dealloc(dbg, die, DW_DLA_DIE); die = NULL; @@ -474,6 +525,7 @@ translate(Dwarf_Debug dbg, Elf *e, const char* addrstr if (ret != DW_DLV_OK || die == NULL) goto out; +status_ok: switch (dwarf_srclines(die, &lbuf, &lcount, &de)) { case DW_DLV_OK: break; @@ -572,21 +624,6 @@ out: cu->srcfiles != NULL && f != NULL && f->inlined_caller != NULL) print_inlines(cu, f->inlined_caller, f->call_file, f->call_line); - - if (die != NULL) - dwarf_dealloc(dbg, die, DW_DLA_DIE); - - /* - * Reset internal CU pointer, so we will start from the first CU - * next round. - */ - while (ret != DW_DLV_NO_ENTRY) { - if (ret == DW_DLV_ERROR) - errx(EXIT_FAILURE, "dwarf_next_cu_header: %s", - dwarf_errmsg(de)); - ret = dwarf_next_cu_header(dbg, NULL, NULL, NULL, NULL, NULL, - &de); - } } static void From owner-svn-src-all@freebsd.org Mon Feb 3 17:06:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AFA88228C82; Mon, 3 Feb 2020 17:06:22 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BDkQ49CHz3Jk5; Mon, 3 Feb 2020 17:06:22 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8A29E403A; Mon, 3 Feb 2020 17:06:22 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 013H6Mko076861; Mon, 3 Feb 2020 17:06:22 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 013H6LRs076858; Mon, 3 Feb 2020 17:06:21 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202002031706.013H6LRs076858@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 3 Feb 2020 17:06:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357451 - head/sys/fs/tmpfs X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/fs/tmpfs X-SVN-Commit-Revision: 357451 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 17:06:22 -0000 Author: mjg Date: Mon Feb 3 17:06:21 2020 New Revision: 357451 URL: https://svnweb.freebsd.org/changeset/base/357451 Log: tmpfs: inline tmpfs_update It was generated to be just a jumping off point to tmpfs_itimes. While here provide a dedicated variant for getattr since we normally don't expect to need to the update from that caller. Modified: head/sys/fs/tmpfs/tmpfs.h head/sys/fs/tmpfs/tmpfs_subr.c head/sys/fs/tmpfs/tmpfs_vnops.c Modified: head/sys/fs/tmpfs/tmpfs.h ============================================================================== --- head/sys/fs/tmpfs/tmpfs.h Mon Feb 3 16:41:40 2020 (r357450) +++ head/sys/fs/tmpfs/tmpfs.h Mon Feb 3 17:06:21 2020 (r357451) @@ -450,13 +450,18 @@ void tmpfs_itimes(struct vnode *, const struct timespe void tmpfs_set_status(struct tmpfs_mount *tm, struct tmpfs_node *node, int status); -void tmpfs_update(struct vnode *); int tmpfs_truncate(struct vnode *, off_t); struct tmpfs_dirent *tmpfs_dir_first(struct tmpfs_node *dnode, struct tmpfs_dir_cursor *dc); struct tmpfs_dirent *tmpfs_dir_next(struct tmpfs_node *dnode, struct tmpfs_dir_cursor *dc); +static __inline void +tmpfs_update(struct vnode *vp) +{ + tmpfs_itimes(vp, NULL, NULL); +} + /* * Convenience macros to simplify some logical expressions. */ @@ -534,6 +539,20 @@ tmpfs_use_nc(struct vnode *vp) return (!(VFS_TO_TMPFS(vp->v_mount)->tm_nonc)); } + +static inline void +tmpfs_update_getattr(struct vnode *vp) +{ + struct tmpfs_node *node; + int update_flags; + + update_flags = TMPFS_NODE_ACCESSED | TMPFS_NODE_MODIFIED | TMPFS_NODE_CHANGED; + + node = VP_TO_TMPFS_NODE(vp); + if (__predict_false(node->tn_status & update_flags) != 0) + tmpfs_update(vp); +} + #endif /* _KERNEL */ #endif /* _FS_TMPFS_TMPFS_H_ */ Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Mon Feb 3 16:41:40 2020 (r357450) +++ head/sys/fs/tmpfs/tmpfs_subr.c Mon Feb 3 17:06:21 2020 (r357451) @@ -1889,13 +1889,6 @@ tmpfs_itimes(struct vnode *vp, const struct timespec * random_harvest_queue(node, sizeof(*node), RANDOM_FS_ATIME); } -void -tmpfs_update(struct vnode *vp) -{ - - tmpfs_itimes(vp, NULL, NULL); -} - int tmpfs_truncate(struct vnode *vp, off_t length) { Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Mon Feb 3 16:41:40 2020 (r357450) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Mon Feb 3 17:06:21 2020 (r357451) @@ -387,7 +387,7 @@ tmpfs_getattr(struct vop_getattr_args *v) node = VP_TO_TMPFS_NODE(vp); - tmpfs_update(vp); + tmpfs_update_getattr(vp); vap->va_type = vp->v_type; vap->va_mode = node->tn_mode; From owner-svn-src-all@freebsd.org Mon Feb 3 17:08:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DA280228D22; Mon, 3 Feb 2020 17:08:12 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BDmX5QVtz3Jt3; Mon, 3 Feb 2020 17:08:12 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B4C814051; Mon, 3 Feb 2020 17:08:12 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 013H8CsL076996; Mon, 3 Feb 2020 17:08:12 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 013H8CV7076993; Mon, 3 Feb 2020 17:08:12 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202002031708.013H8CV7076993@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 3 Feb 2020 17:08:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357452 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 357452 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 17:08:12 -0000 Author: mjg Date: Mon Feb 3 17:08:11 2020 New Revision: 357452 URL: https://svnweb.freebsd.org/changeset/base/357452 Log: capsicum: faster cap_rights_contains Instead of doing a 2 iteration loop (determined at runeimt), take advantage of the fact that the size is already known. While here provdie cap_check_inline so that fget_unlocked does not have to do a function call. Verified with the capsicum suite /usr/tests. Modified: head/sys/kern/kern_descrip.c head/sys/kern/subr_capability.c head/sys/kern/sys_capability.c head/sys/sys/capsicum.h Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Mon Feb 3 17:06:21 2020 (r357451) +++ head/sys/kern/kern_descrip.c Mon Feb 3 17:08:11 2020 (r357452) @@ -2724,7 +2724,7 @@ fget_unlocked(struct filedesc *fdp, int fd, cap_rights if (fp == NULL) return (EBADF); #ifdef CAPABILITIES - error = cap_check(&haverights, needrightsp); + error = cap_check_inline(&haverights, needrightsp); if (error != 0) return (error); #endif Modified: head/sys/kern/subr_capability.c ============================================================================== --- head/sys/kern/subr_capability.c Mon Feb 3 17:06:21 2020 (r357451) +++ head/sys/kern/subr_capability.c Mon Feb 3 17:08:11 2020 (r357452) @@ -394,25 +394,3 @@ cap_rights_remove(cap_rights_t *dst, const cap_rights_ return (dst); } - -bool -cap_rights_contains(const cap_rights_t *big, const cap_rights_t *little) -{ - unsigned int i, n; - - assert(CAPVER(big) == CAP_RIGHTS_VERSION_00); - assert(CAPVER(little) == CAP_RIGHTS_VERSION_00); - assert(CAPVER(big) == CAPVER(little)); - - n = CAPARSIZE(big); - assert(n >= CAPARSIZE_MIN && n <= CAPARSIZE_MAX); - - for (i = 0; i < n; i++) { - if ((big->cr_rights[i] & little->cr_rights[i]) != - little->cr_rights[i]) { - return (false); - } - } - - return (true); -} Modified: head/sys/kern/sys_capability.c ============================================================================== --- head/sys/kern/sys_capability.c Mon Feb 3 17:06:21 2020 (r357451) +++ head/sys/kern/sys_capability.c Mon Feb 3 17:08:11 2020 (r357452) @@ -179,6 +179,17 @@ cap_check(const cap_rights_t *havep, const cap_rights_ return (_cap_check(havep, needp, CAPFAIL_NOTCAPABLE)); } +int +cap_check_failed_notcapable(const cap_rights_t *havep, const cap_rights_t *needp) +{ + +#ifdef KTRACE + if (KTRPOINT(curthread, KTR_CAPFAIL)) + ktrcapfail(CAPFAIL_NOTCAPABLE, needp, havep); +#endif + return (ENOTCAPABLE); +} + /* * Convert capability rights into VM access flags. */ Modified: head/sys/sys/capsicum.h ============================================================================== --- head/sys/sys/capsicum.h Mon Feb 3 17:06:21 2020 (r357451) +++ head/sys/sys/capsicum.h Mon Feb 3 17:08:11 2020 (r357452) @@ -342,8 +342,37 @@ bool __cap_rights_is_set(const cap_rights_t *rights, . bool cap_rights_is_valid(const cap_rights_t *rights); cap_rights_t *cap_rights_merge(cap_rights_t *dst, const cap_rights_t *src); cap_rights_t *cap_rights_remove(cap_rights_t *dst, const cap_rights_t *src); -bool cap_rights_contains(const cap_rights_t *big, const cap_rights_t *little); void __cap_rights_sysinit(void *arg); + + +/* + * We only support one size to reduce branching. + */ +_Static_assert(CAP_RIGHTS_VERSION == CAP_RIGHTS_VERSION_00, + "unsupported version of capsicum rights"); + +static inline bool +cap_rights_contains(const cap_rights_t *big, const cap_rights_t *little) +{ + + if (__predict_true( + (big->cr_rights[0] & little->cr_rights[0]) == little->cr_rights[0] && + (big->cr_rights[1] & little->cr_rights[1]) == little->cr_rights[1])) + return (true); + return (false); +} + +int cap_check_failed_notcapable(const cap_rights_t *havep, + const cap_rights_t *needp); + +static inline int +cap_check_inline(const cap_rights_t *havep, const cap_rights_t *needp) +{ + + if (__predict_false(!cap_rights_contains(havep, needp))) + return (cap_check_failed_notcapable(havep, needp)); + return (0); +} __END_DECLS struct cap_rights_init_args { From owner-svn-src-all@freebsd.org Mon Feb 3 17:10:40 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CFF6E228DD4; Mon, 3 Feb 2020 17:10:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BDqN56Pmz3K4H; Mon, 3 Feb 2020 17:10:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA7384075; Mon, 3 Feb 2020 17:10:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 013HAefr079467; Mon, 3 Feb 2020 17:10:40 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 013HAe7c079466; Mon, 3 Feb 2020 17:10:40 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202002031710.013HAe7c079466@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 3 Feb 2020 17:10:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357453 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 357453 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 17:10:40 -0000 Author: mav Date: Mon Feb 3 17:10:40 2020 New Revision: 357453 URL: https://svnweb.freebsd.org/changeset/base/357453 Log: Unblock kstat.zfs.misc.dbufstats sysctls. It is not so much broken to hide it after we wasted time to collect it. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Mon Feb 3 17:08:11 2020 (r357452) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Mon Feb 3 17:10:40 2020 (r357453) @@ -747,6 +747,10 @@ dbuf_evict_thread(void *unused __unused) (void) cv_timedwait_hires(&dbuf_evict_cv, &dbuf_evict_lock, SEC2NSEC(1), MSEC2NSEC(1), 0); CALLB_CPR_SAFE_END(&cpr, &dbuf_evict_lock); +#ifdef __FreeBSD__ + if (dbuf_ksp != NULL) + dbuf_ksp->ks_update(dbuf_ksp, KSTAT_READ); +#endif } mutex_exit(&dbuf_evict_lock); @@ -880,18 +884,10 @@ retry: dbuf_cache_evict_thread = thread_create(NULL, 0, dbuf_evict_thread, NULL, 0, &p0, TS_RUN, minclsyspri); -#ifdef __linux__ - /* - * XXX FreeBSD's SPL lacks KSTAT_TYPE_NAMED support - TODO - */ dbuf_ksp = kstat_create("zfs", 0, "dbufstats", "misc", KSTAT_TYPE_NAMED, sizeof (dbuf_stats) / sizeof (kstat_named_t), KSTAT_FLAG_VIRTUAL); if (dbuf_ksp != NULL) { - dbuf_ksp->ks_data = &dbuf_stats; - dbuf_ksp->ks_update = dbuf_kstat_update; - kstat_install(dbuf_ksp); - for (i = 0; i < DN_MAX_LEVELS; i++) { snprintf(dbuf_stats.cache_levels[i].name, KSTAT_STRLEN, "cache_level_%d", i); @@ -902,8 +898,10 @@ retry: dbuf_stats.cache_levels_bytes[i].data_type = KSTAT_DATA_UINT64; } + dbuf_ksp->ks_data = &dbuf_stats; + dbuf_ksp->ks_update = dbuf_kstat_update; + kstat_install(dbuf_ksp); } -#endif } void From owner-svn-src-all@freebsd.org Mon Feb 3 17:34:58 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E236422957F; Mon, 3 Feb 2020 17:34:58 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BFMQ5kRzz3LLp; Mon, 3 Feb 2020 17:34:58 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB783460A; Mon, 3 Feb 2020 17:34:58 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 013HYwmg094621; Mon, 3 Feb 2020 17:34:58 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 013HYvvG094616; Mon, 3 Feb 2020 17:34:57 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202002031734.013HYvvG094616@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 3 Feb 2020 17:34:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357454 - in head/stand: . common ficl/sparc64 libofw libsa/sparc64 man sparc64 sparc64/boot1 sparc64/loader sparc64/zfsboot X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/stand: . common ficl/sparc64 libofw libsa/sparc64 man sparc64 sparc64/boot1 sparc64/loader sparc64/zfsboot X-SVN-Commit-Revision: 357454 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 17:34:58 -0000 Author: imp Date: Mon Feb 3 17:34:57 2020 New Revision: 357454 URL: https://svnweb.freebsd.org/changeset/base/357454 Log: Remove sparc64 support from the boot loader. Remove all the sparc64 specific bits, both files and ifdefs. Deleted: head/stand/ficl/sparc64/sysdep.c head/stand/ficl/sparc64/sysdep.h head/stand/libsa/sparc64/_setjmp.S head/stand/sparc64/Makefile head/stand/sparc64/Makefile.inc head/stand/sparc64/boot1/Makefile head/stand/sparc64/boot1/_start.s head/stand/sparc64/boot1/boot1.c head/stand/sparc64/loader/Makefile head/stand/sparc64/loader/help.sparc64 head/stand/sparc64/loader/locore.S head/stand/sparc64/loader/main.c head/stand/sparc64/loader/version head/stand/sparc64/zfsboot/Makefile Modified: head/stand/common/metadata.c head/stand/libofw/libofw.h head/stand/loader.mk head/stand/man/loader.8 Modified: head/stand/common/metadata.c ============================================================================== --- head/stand/common/metadata.c Mon Feb 3 17:10:40 2020 (r357453) +++ head/stand/common/metadata.c Mon Feb 3 17:34:57 2020 (r357454) @@ -49,56 +49,7 @@ __FBSDID("$FreeBSD$"); #include "geliboot.h" #endif -#if defined(__sparc64__) -#include - -extern struct tlb_entry *dtlb_store; -extern struct tlb_entry *itlb_store; - -extern int dtlb_slot; -extern int itlb_slot; - static int -md_bootserial(void) -{ - char buf[64]; - ihandle_t inst; - phandle_t input; - phandle_t node; - phandle_t output; - - if ((node = OF_finddevice("/options")) == -1) - return(-1); - if (OF_getprop(node, "input-device", buf, sizeof(buf)) == -1) - return(-1); - input = OF_finddevice(buf); - if (OF_getprop(node, "output-device", buf, sizeof(buf)) == -1) - return(-1); - output = OF_finddevice(buf); - if (input == -1 || output == -1 || - OF_getproplen(input, "keyboard") >= 0) { - if ((node = OF_finddevice("/chosen")) == -1) - return(-1); - if (OF_getprop(node, "stdin", &inst, sizeof(inst)) == -1) - return(-1); - if ((input = OF_instance_to_package(inst)) == -1) - return(-1); - if (OF_getprop(node, "stdout", &inst, sizeof(inst)) == -1) - return(-1); - if ((output = OF_instance_to_package(inst)) == -1) - return(-1); - } - if (input != output) - return(-1); - if (OF_getprop(input, "device_type", buf, sizeof(buf)) == -1) - return(-1); - if (strcmp(buf, "serial") != 0) - return(-1); - return(0); -} -#endif - -static int md_getboothowto(char *kargs) { int howto; @@ -106,15 +57,10 @@ md_getboothowto(char *kargs) /* Parse kargs */ howto = boot_parse_cmdline(kargs); howto |= boot_env_to_howto(); -#if defined(__sparc64__) - if (md_bootserial() != -1) - howto |= RB_SERIAL; -#else if (!strcmp(getenv("console"), "comconsole")) howto |= RB_SERIAL; if (!strcmp(getenv("console"), "nullconsole")) howto |= RB_MUTE; -#endif return(howto); } @@ -362,16 +308,6 @@ md_load_dual(char *args, vm_offset_t *modulep, vm_offs #ifdef LOADER_GELI_SUPPORT geli_export_key_metadata(kfp); #endif -#if defined(__sparc64__) - file_addmetadata(kfp, MODINFOMD_DTLB_SLOTS, - sizeof dtlb_slot, &dtlb_slot); - file_addmetadata(kfp, MODINFOMD_ITLB_SLOTS, - sizeof itlb_slot, &itlb_slot); - file_addmetadata(kfp, MODINFOMD_DTLB, - dtlb_slot * sizeof(*dtlb_store), dtlb_store); - file_addmetadata(kfp, MODINFOMD_ITLB, - itlb_slot * sizeof(*itlb_store), itlb_store); -#endif *modulep = addr; size = md_copymodules(0, kern64); @@ -411,15 +347,13 @@ md_load_dual(char *args, vm_offset_t *modulep, vm_offs return(0); } -#if !defined(__sparc64__) int md_load(char *args, vm_offset_t *modulep, vm_offset_t *dtb) { return (md_load_dual(args, modulep, dtb, 0)); } -#endif -#if defined(__mips__) || defined(__powerpc__) || defined(__sparc64__) +#if defined(__mips__) || defined(__powerpc__) int md_load64(char *args, vm_offset_t *modulep, vm_offset_t *dtb) { Modified: head/stand/libofw/libofw.h ============================================================================== --- head/stand/libofw/libofw.h Mon Feb 3 17:10:40 2020 (r357453) +++ head/stand/libofw/libofw.h Mon Feb 3 17:34:57 2020 (r357454) @@ -62,9 +62,7 @@ struct preloaded_file; struct file_format; /* MD code implementing MI interfaces */ -#if !defined(__sparc64__) vm_offset_t md_load(char *args, vm_offset_t *modulep, vm_offset_t *dtb); -#endif vm_offset_t md_load64(char *args, vm_offset_t *modulep, vm_offset_t *dtb); extern void reboot(void); Modified: head/stand/loader.mk ============================================================================== --- head/stand/loader.mk Mon Feb 3 17:10:40 2020 (r357453) +++ head/stand/loader.mk Mon Feb 3 17:34:57 2020 (r357454) @@ -19,9 +19,6 @@ SRCS+= load_elf32.c reloc_elf32.c SRCS+= load_elf32.c reloc_elf32.c SRCS+= load_elf64.c reloc_elf64.c SRCS+= metadata.c -.elif ${MACHINE_CPUARCH} == "sparc64" -SRCS+= load_elf64.c reloc_elf64.c -SRCS+= metadata.c .elif ${MACHINE_ARCH:Mmips64*} != "" SRCS+= load_elf64.c reloc_elf64.c SRCS+= metadata.c Modified: head/stand/man/loader.8 ============================================================================== --- head/stand/man/loader.8 Mon Feb 3 17:10:40 2020 (r357453) +++ head/stand/man/loader.8 Mon Feb 3 17:34:57 2020 (r357454) @@ -632,7 +632,7 @@ Modifies kernel option Limits the amount of KVM reserved for use by the buffer cache, specified in bytes. The default maximum is 200MB on i386, -and 400MB on amd64 and sparc64. +and 400MB on amd64. This parameter is used to prevent the buffer cache from eating too much KVM in large-memory machine configurations. From owner-svn-src-all@freebsd.org Mon Feb 3 17:35:19 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9EF5D2295F0; Mon, 3 Feb 2020 17:35:19 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BFMq4WLRz3LTg; Mon, 3 Feb 2020 17:35:19 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7CFEB460B; Mon, 3 Feb 2020 17:35:19 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 013HZJFf094738; Mon, 3 Feb 2020 17:35:19 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 013HZCAu094696; Mon, 3 Feb 2020 17:35:12 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202002031735.013HZCAu094696@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 3 Feb 2020 17:35:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357455 - in head: lib/libkvm sys sys/cam sys/cddl/compat/opensolaris/sys sys/cddl/contrib/opensolaris/common/lz4 sys/cddl/contrib/opensolaris/uts/common/sys sys/conf sys/contrib/ck/inc... X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: lib/libkvm sys sys/cam sys/cddl/compat/opensolaris/sys sys/cddl/contrib/opensolaris/common/lz4 sys/cddl/contrib/opensolaris/uts/common/sys sys/conf sys/contrib/ck/include sys/dev/ata sys/dev/... X-SVN-Commit-Revision: 357455 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 17:35:19 -0000 Author: imp Date: Mon Feb 3 17:35:11 2020 New Revision: 357455 URL: https://svnweb.freebsd.org/changeset/base/357455 Log: Remove sparc64 kernel support Remove all sparc64 specific files Remove all sparc64 ifdefs Removee indireeect sparc64 ifdefs Deleted: head/sys/conf/Makefile.sparc64 head/sys/conf/files.sparc64 head/sys/conf/ldscript.sparc64 head/sys/conf/options.sparc64 head/sys/dev/atkbdc/atkbdc_ebus.c head/sys/dev/auxio/auxio.c head/sys/dev/auxio/auxioreg.h head/sys/dev/esp/esp_sbus.c head/sys/dev/fb/creator.c head/sys/dev/fb/creator_vt.c head/sys/dev/fb/creatorreg.h head/sys/dev/fb/machfb.c head/sys/dev/fb/machfbreg.h head/sys/dev/gem/if_gem_sbus.c head/sys/dev/hme/if_hme_sbus.c head/sys/dev/hwpmc/hwpmc_sparc64.c head/sys/dev/isp/isp_sbus.c head/sys/dev/ispfw/asm_1000.h head/sys/dev/le/if_le_lebuffer.c head/sys/dev/le/if_le_ledma.c head/sys/dev/le/lebuffer_sbus.c head/sys/dev/pcf/envctrl.c head/sys/dev/pcf/pcf_ebus.c head/sys/dev/scc/scc_bfe_ebus.c head/sys/dev/scc/scc_bfe_sbus.c head/sys/dev/sound/sbus/apcdmareg.h head/sys/dev/sound/sbus/cs4231.c head/sys/dev/sound/sbus/cs4231.h head/sys/dev/uart/uart_bus_ebus.c head/sys/dev/uart/uart_cpu_sparc64.c head/sys/dev/uart/uart_kbd_sun.c head/sys/dev/uart/uart_kbd_sun.h head/sys/dev/uart/uart_kbd_sun_tables.h head/sys/modules/auxio/Makefile head/sys/modules/epic/Makefile head/sys/modules/sound/driver/audiocs/Makefile head/sys/sparc64/central/central.c head/sys/sparc64/conf/DEFAULTS head/sys/sparc64/conf/GENERIC head/sys/sparc64/conf/GENERIC-NODEBUG head/sys/sparc64/conf/GENERIC.hints head/sys/sparc64/conf/Makefile head/sys/sparc64/conf/NOTES head/sys/sparc64/ebus/ebus.c head/sys/sparc64/ebus/ebusreg.h head/sys/sparc64/ebus/epic.c head/sys/sparc64/fhc/clkbrd.c head/sys/sparc64/fhc/clkbrdreg.h head/sys/sparc64/fhc/fhc.c head/sys/sparc64/fhc/fhcreg.h head/sys/sparc64/include/_align.h head/sys/sparc64/include/_bus.h head/sys/sparc64/include/_inttypes.h head/sys/sparc64/include/_limits.h head/sys/sparc64/include/_stdint.h head/sys/sparc64/include/_types.h head/sys/sparc64/include/asi.h head/sys/sparc64/include/asm.h head/sys/sparc64/include/asmacros.h head/sys/sparc64/include/atomic.h head/sys/sparc64/include/bus.h head/sys/sparc64/include/bus_common.h head/sys/sparc64/include/bus_dma.h head/sys/sparc64/include/bus_private.h head/sys/sparc64/include/cache.h head/sys/sparc64/include/ccr.h head/sys/sparc64/include/clock.h head/sys/sparc64/include/cmt.h head/sys/sparc64/include/counter.h head/sys/sparc64/include/cpu.h head/sys/sparc64/include/cpufunc.h head/sys/sparc64/include/db_machdep.h head/sys/sparc64/include/dcr.h head/sys/sparc64/include/dump.h head/sys/sparc64/include/efi.h head/sys/sparc64/include/elf.h head/sys/sparc64/include/endian.h head/sys/sparc64/include/exec.h head/sys/sparc64/include/fireplane.h head/sys/sparc64/include/float.h head/sys/sparc64/include/floatingpoint.h head/sys/sparc64/include/fp.h head/sys/sparc64/include/frame.h head/sys/sparc64/include/fsr.h head/sys/sparc64/include/gdb_machdep.h head/sys/sparc64/include/idprom.h head/sys/sparc64/include/ieee.h head/sys/sparc64/include/ieeefp.h head/sys/sparc64/include/in_cksum.h head/sys/sparc64/include/instr.h head/sys/sparc64/include/intr_machdep.h head/sys/sparc64/include/iommureg.h head/sys/sparc64/include/iommuvar.h head/sys/sparc64/include/jbus.h head/sys/sparc64/include/kdb.h head/sys/sparc64/include/kerneldump.h head/sys/sparc64/include/ktr.h head/sys/sparc64/include/limits.h head/sys/sparc64/include/lsu.h head/sys/sparc64/include/mcntl.h head/sys/sparc64/include/md_var.h head/sys/sparc64/include/memdev.h head/sys/sparc64/include/metadata.h head/sys/sparc64/include/nexusvar.h head/sys/sparc64/include/ofw_machdep.h head/sys/sparc64/include/ofw_mem.h head/sys/sparc64/include/ofw_nexus.h head/sys/sparc64/include/param.h head/sys/sparc64/include/pcb.h head/sys/sparc64/include/pcpu.h head/sys/sparc64/include/pcpu_aux.h head/sys/sparc64/include/pmap.h head/sys/sparc64/include/pmc_mdep.h head/sys/sparc64/include/proc.h head/sys/sparc64/include/procctl.h head/sys/sparc64/include/profile.h head/sys/sparc64/include/pstate.h head/sys/sparc64/include/ptrace.h head/sys/sparc64/include/reg.h head/sys/sparc64/include/reloc.h head/sys/sparc64/include/resource.h head/sys/sparc64/include/runq.h head/sys/sparc64/include/sc_machdep.h head/sys/sparc64/include/setjmp.h head/sys/sparc64/include/sf_buf.h head/sys/sparc64/include/sigframe.h head/sys/sparc64/include/signal.h head/sys/sparc64/include/smp.h head/sys/sparc64/include/stack.h head/sys/sparc64/include/stdarg.h head/sys/sparc64/include/sysarch.h head/sys/sparc64/include/tick.h head/sys/sparc64/include/tlb.h head/sys/sparc64/include/trap.h head/sys/sparc64/include/tsb.h head/sys/sparc64/include/tstate.h head/sys/sparc64/include/tte.h head/sys/sparc64/include/ucontext.h head/sys/sparc64/include/upa.h head/sys/sparc64/include/utrap.h head/sys/sparc64/include/vdso.h head/sys/sparc64/include/ver.h head/sys/sparc64/include/vm.h head/sys/sparc64/include/vmparam.h head/sys/sparc64/include/watch.h head/sys/sparc64/include/wstate.h head/sys/sparc64/isa/isa.c head/sys/sparc64/isa/isa_dma.c head/sys/sparc64/isa/ofw_isa.c head/sys/sparc64/isa/ofw_isa.h head/sys/sparc64/pci/apb.c head/sys/sparc64/pci/fire.c head/sys/sparc64/pci/firereg.h head/sys/sparc64/pci/firevar.h head/sys/sparc64/pci/ofw_pci.c head/sys/sparc64/pci/ofw_pci.h head/sys/sparc64/pci/ofw_pci_if.m head/sys/sparc64/pci/ofw_pcib.c head/sys/sparc64/pci/ofw_pcib_subr.c head/sys/sparc64/pci/ofw_pcib_subr.h head/sys/sparc64/pci/ofw_pcibus.c head/sys/sparc64/pci/psycho.c head/sys/sparc64/pci/psychoreg.h head/sys/sparc64/pci/psychovar.h head/sys/sparc64/pci/sbbc.c head/sys/sparc64/pci/schizo.c head/sys/sparc64/pci/schizoreg.h head/sys/sparc64/pci/schizovar.h head/sys/sparc64/sbus/dma_sbus.c head/sys/sparc64/sbus/lsi64854.c head/sys/sparc64/sbus/lsi64854reg.h head/sys/sparc64/sbus/lsi64854var.h head/sys/sparc64/sbus/ofw_sbus.h head/sys/sparc64/sbus/sbus.c head/sys/sparc64/sbus/sbusreg.h head/sys/sparc64/sbus/sbusvar.h head/sys/sparc64/sparc64/ata_machdep.c head/sys/sparc64/sparc64/autoconf.c head/sys/sparc64/sparc64/bus_machdep.c head/sys/sparc64/sparc64/cache.c head/sys/sparc64/sparc64/cam_machdep.c head/sys/sparc64/sparc64/cheetah.c head/sys/sparc64/sparc64/clock.c head/sys/sparc64/sparc64/counter.c head/sys/sparc64/sparc64/db_disasm.c head/sys/sparc64/sparc64/db_hwwatch.c head/sys/sparc64/sparc64/db_interface.c head/sys/sparc64/sparc64/db_trace.c head/sys/sparc64/sparc64/dump_machdep.c head/sys/sparc64/sparc64/eeprom.c head/sys/sparc64/sparc64/elf_machdep.c head/sys/sparc64/sparc64/exception.S head/sys/sparc64/sparc64/gdb_machdep.c head/sys/sparc64/sparc64/genassym.c head/sys/sparc64/sparc64/identcpu.c head/sys/sparc64/sparc64/in_cksum.c head/sys/sparc64/sparc64/interrupt.S head/sys/sparc64/sparc64/intr_machdep.c head/sys/sparc64/sparc64/iommu.c head/sys/sparc64/sparc64/jbusppm.c head/sys/sparc64/sparc64/locore.S head/sys/sparc64/sparc64/machdep.c head/sys/sparc64/sparc64/mem.c head/sys/sparc64/sparc64/mp_exception.S head/sys/sparc64/sparc64/mp_locore.S head/sys/sparc64/sparc64/mp_machdep.c head/sys/sparc64/sparc64/nexus.c head/sys/sparc64/sparc64/ofw_machdep.c head/sys/sparc64/sparc64/pmap.c head/sys/sparc64/sparc64/prof_machdep.c head/sys/sparc64/sparc64/rtc.c head/sys/sparc64/sparc64/rwindow.c head/sys/sparc64/sparc64/sc_machdep.c head/sys/sparc64/sparc64/schppm.c head/sys/sparc64/sparc64/spitfire.c head/sys/sparc64/sparc64/ssm.c head/sys/sparc64/sparc64/stack_machdep.c head/sys/sparc64/sparc64/support.S head/sys/sparc64/sparc64/swtch.S head/sys/sparc64/sparc64/sys_machdep.c head/sys/sparc64/sparc64/tick.c head/sys/sparc64/sparc64/tlb.c head/sys/sparc64/sparc64/trap.c head/sys/sparc64/sparc64/tsb.c head/sys/sparc64/sparc64/uio_machdep.c head/sys/sparc64/sparc64/upa.c head/sys/sparc64/sparc64/vm_machdep.c head/sys/sparc64/sparc64/zeus.c Modified: head/lib/libkvm/Makefile head/sys/Makefile head/sys/cam/cam_xpt.c head/sys/cddl/compat/opensolaris/sys/atomic.h head/sys/cddl/contrib/opensolaris/common/lz4/lz4.c head/sys/cddl/contrib/opensolaris/uts/common/sys/asm_linkage.h head/sys/conf/NOTES head/sys/conf/files head/sys/conf/kern.mk head/sys/conf/kern.opts.mk head/sys/contrib/ck/include/ck_md.h head/sys/dev/ata/ata-pci.c head/sys/dev/ata/chipsets/ata-promise.c head/sys/dev/atkbdc/atkbd.c head/sys/dev/atkbdc/atkbdc.c head/sys/dev/bge/if_bge.c head/sys/dev/cas/if_cas.c head/sys/dev/dc/if_dc.c head/sys/dev/fb/fbreg.h head/sys/dev/firewire/sbp.c head/sys/dev/gem/if_gem_pci.c head/sys/dev/hme/if_hme_pci.c head/sys/dev/isp/isp_freebsd.h head/sys/dev/isp/isp_pci.c head/sys/dev/ispfw/ispfw.c head/sys/dev/mpt/mpt.h head/sys/dev/mpt/mpt_pci.c head/sys/dev/mthca/mthca_srq.c head/sys/dev/mxge/if_mxge_var.h head/sys/dev/ofw/openfirm.h head/sys/dev/proto/proto_core.c head/sys/dev/sfxge/common/efsys.h head/sys/dev/sound/pci/t4dwave.c head/sys/dev/sym/sym_hipd.c head/sys/dev/syscons/scgfbrndr.c head/sys/dev/syscons/schistory.c head/sys/dev/syscons/scterm-dumb.c head/sys/dev/syscons/scterm-sc.c head/sys/dev/syscons/scterm-teken.c head/sys/dev/syscons/scvtb.c head/sys/dev/syscons/syscons.c head/sys/dev/syscons/syscons.h head/sys/dev/vt/hw/fb/vt_early_fb.c head/sys/dev/vt/hw/ofwfb/ofwfb.c head/sys/kern/kern_exit.c head/sys/kern/kern_malloc.c head/sys/kern/subr_param.c head/sys/kern/subr_uio.c head/sys/kern/subr_witness.c head/sys/modules/Makefile head/sys/modules/bge/Makefile head/sys/modules/cas/Makefile head/sys/modules/esp/Makefile head/sys/modules/gem/Makefile head/sys/modules/hme/Makefile head/sys/modules/hwpmc/Makefile head/sys/modules/i2c/controllers/pcf/Makefile head/sys/modules/isp/Makefile head/sys/modules/ispfw/Makefile head/sys/modules/le/Makefile head/sys/modules/scc/Makefile head/sys/modules/sound/driver/Makefile head/sys/modules/syscons/Makefile head/sys/modules/uart/Makefile head/sys/sys/linker.h head/sys/vm/vm_kern.c Modified: head/lib/libkvm/Makefile ============================================================================== --- head/lib/libkvm/Makefile Mon Feb 3 17:34:57 2020 (r357454) +++ head/lib/libkvm/Makefile Mon Feb 3 17:35:11 2020 (r357455) @@ -19,8 +19,7 @@ SRCS= kvm.c kvm_cptime.c kvm_getloadavg.c \ kvm_minidump_mips.c \ kvm_powerpc.c kvm_powerpc64.c \ kvm_minidump_riscv.c \ - kvm_minidump_powerpc64.c kvm_minidump_powerpc64_hpt.c \ - kvm_sparc64.c + kvm_minidump_powerpc64.c kvm_minidump_powerpc64_hpt.c INCS= kvm.h LIBADD= elf Modified: head/sys/Makefile ============================================================================== --- head/sys/Makefile Mon Feb 3 17:34:57 2020 (r357454) +++ head/sys/Makefile Mon Feb 3 17:35:11 2020 (r357455) @@ -8,7 +8,7 @@ CSCOPEDIRS= bsm cam cddl compat conf contrib crypto dd rpc security sys ufs vm xdr xen ${CSCOPE_ARCHDIR} .if !defined(CSCOPE_ARCHDIR) .if defined(ALL_ARCH) -CSCOPE_ARCHDIR = amd64 arm arm64 i386 mips powerpc riscv sparc64 x86 +CSCOPE_ARCHDIR = amd64 arm arm64 i386 mips powerpc riscv x86 .else CSCOPE_ARCHDIR = ${MACHINE} .if ${MACHINE} != ${MACHINE_CPUARCH} Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Mon Feb 3 17:34:57 2020 (r357454) +++ head/sys/cam/cam_xpt.c Mon Feb 3 17:35:11 2020 (r357455) @@ -2716,17 +2716,6 @@ xpt_action_default(union ccb *start_ccb) start_ccb->ccb_h.status = CAM_REQ_CMP; break; } -#if defined(__sparc64__) - /* - * For sparc64, we may need adjust the geometry of large - * disks in order to fit the limitations of the 16-bit - * fields of the VTOC8 disk label. - */ - if (scsi_da_bios_params(&start_ccb->ccg) != 0) { - start_ccb->ccb_h.status = CAM_REQ_CMP; - break; - } -#endif goto call_sim; case XPT_ABORT: { Modified: head/sys/cddl/compat/opensolaris/sys/atomic.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/atomic.h Mon Feb 3 17:34:57 2020 (r357454) +++ head/sys/cddl/compat/opensolaris/sys/atomic.h Mon Feb 3 17:35:11 2020 (r357455) @@ -91,7 +91,6 @@ atomic_dec_32_nv(volatile uint32_t *target) return (atomic_add_32_nv(target, -1)); } -#ifndef __sparc64__ static inline uint32_t atomic_cas_32(volatile uint32_t *target, uint32_t cmp, uint32_t newval) { @@ -107,7 +106,6 @@ atomic_cas_32(volatile uint32_t *target, uint32_t cmp, #endif return (cmp); } -#endif #if defined(__LP64__) || defined(__mips_n32) || \ defined(ARM_HAVE_ATOMIC64) || defined(I386_HAVE_ATOMIC64) || \ @@ -124,7 +122,6 @@ atomic_add_64_nv(volatile uint64_t *target, int64_t de return (atomic_fetchadd_64(target, delta) + delta); } -#ifndef __sparc64__ static inline uint64_t atomic_cas_64(volatile uint64_t *target, uint64_t cmp, uint64_t newval) { @@ -140,7 +137,6 @@ atomic_cas_64(volatile uint64_t *target, uint64_t cmp, #endif return (cmp); } -#endif #endif static __inline void Modified: head/sys/cddl/contrib/opensolaris/common/lz4/lz4.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/common/lz4/lz4.c Mon Feb 3 17:34:57 2020 (r357454) +++ head/sys/cddl/contrib/opensolaris/common/lz4/lz4.c Mon Feb 3 17:35:11 2020 (r357455) @@ -246,16 +246,6 @@ lz4_decompress(void *s_start, void *d_start, size_t s_ #endif /* - * FreeBSD: can't use GCC's __builtin_ctz when using sparc64 because - * gcc currently rely on libcompiler_rt. - * - * TODO: revisit this when situation changes. - */ -#if defined(__sparc64__) -#define LZ4_FORCE_SW_BITCOUNT -#endif - -/* * Compiler Options */ #if __STDC_VERSION__ >= 199901L /* C99 */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/asm_linkage.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/asm_linkage.h Mon Feb 3 17:34:57 2020 (r357454) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/asm_linkage.h Mon Feb 3 17:35:11 2020 (r357455) @@ -41,11 +41,6 @@ extern "C" { #define ASM_ENTRY_ALIGN 16 -#elif defined(__sparc64__) - -/* GCC uses 32-byte function alignment for UltraSPARC CPUs. */ -#define ASM_ENTRY_ALIGN 32 - #else #error Unsupported architecture. Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Mon Feb 3 17:34:57 2020 (r357454) +++ head/sys/conf/NOTES Mon Feb 3 17:35:11 2020 (r357455) @@ -2045,8 +2045,6 @@ device sound # snd_ad1816: Analog Devices AD1816 ISA PnP/non-PnP. # snd_als4000: Avance Logic ALS4000 PCI. # snd_atiixp: ATI IXP 200/300/400 PCI. -# snd_audiocs: Crystal Semiconductor CS4231 SBus/EBus. Only -# for sparc64. # snd_cmi: CMedia CMI8338/CMI8738 PCI. # snd_cs4281: Crystal Semiconductor CS4281 PCI. # snd_csa: Crystal Semiconductor CS461x/428x PCI. (except @@ -2089,7 +2087,6 @@ device sound device snd_ad1816 device snd_als4000 device snd_atiixp -#device snd_audiocs device snd_cmi device snd_cs4281 device snd_csa Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Feb 3 17:34:57 2020 (r357454) +++ head/sys/conf/files Mon Feb 3 17:35:11 2020 (r357455) @@ -1743,7 +1743,6 @@ dev/fxp/if_fxp.c optional fxp dev/fxp/inphy.c optional fxp dev/gem/if_gem.c optional gem dev/gem/if_gem_pci.c optional gem pci -dev/gem/if_gem_sbus.c optional gem sbus dev/gpio/dwgpio/dwgpio.c optional gpio dwgpio fdt dev/gpio/dwgpio/dwgpio_bus.c optional gpio dwgpio fdt dev/gpio/dwgpio/dwgpio_if.m optional gpio dwgpio fdt @@ -1769,7 +1768,6 @@ dev/gpio/ofw_gpiobus.c optional fdt gpio dev/hifn/hifn7751.c optional hifn dev/hme/if_hme.c optional hme dev/hme/if_hme_pci.c optional hme pci -dev/hme/if_hme_sbus.c optional hme sbus dev/hptiop/hptiop.c optional hptiop scbus dev/hwpmc/hwpmc_logging.c optional hwpmc dev/hwpmc/hwpmc_mod.c optional hwpmc @@ -1885,7 +1883,6 @@ dev/isp/isp.c optional isp dev/isp/isp_freebsd.c optional isp dev/isp/isp_library.c optional isp dev/isp/isp_pci.c optional isp pci -dev/isp/isp_sbus.c optional isp sbus dev/isp/isp_target.c optional isp dev/ispfw/ispfw.c optional ispfw dev/iwi/if_iwi.c optional iwi @@ -3009,9 +3006,7 @@ rtwn-rtl8821aufw.fw optional rtwn-rtl8821aufw | rtwnf clean "rtwn-rtl8821aufw.fw" dev/safe/safe.c optional safe dev/scc/scc_if.m optional scc -dev/scc/scc_bfe_ebus.c optional scc ebus dev/scc/scc_bfe_quicc.c optional scc quicc -dev/scc/scc_bfe_sbus.c optional scc fhc | scc sbus dev/scc/scc_core.c optional scc dev/scc/scc_dev_quicc.c optional scc quicc dev/scc/scc_dev_sab82532.c optional scc @@ -3171,7 +3166,6 @@ dev/tws/tws_hdm.c optional tws dev/tws/tws_services.c optional tws dev/tws/tws_user.c optional tws dev/uart/uart_bus_acpi.c optional uart acpi -dev/uart/uart_bus_ebus.c optional uart ebus dev/uart/uart_bus_fdt.c optional uart fdt dev/uart/uart_bus_isa.c optional uart isa dev/uart/uart_bus_pccard.c optional uart pccard Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Mon Feb 3 17:34:57 2020 (r357454) +++ head/sys/conf/kern.mk Mon Feb 3 17:35:11 2020 (r357455) @@ -154,18 +154,6 @@ CFLAGS+= -mno-relax .endif # -# For sparc64 we want the medany code model so modules may be located -# anywhere in the 64-bit address space. We also tell GCC to use floating -# point emulation. This avoids using floating point registers for integer -# operations which it has a tendency to do. -# -.if ${MACHINE_CPUARCH} == "sparc64" -CFLAGS.clang+= -mcmodel=large -fno-dwarf2-cfi-asm -CFLAGS.gcc+= -mcmodel=medany -msoft-float -INLINE_LIMIT?= 15000 -.endif - -# # For AMD64, we explicitly prohibit the use of FPU, SSE and other SIMD # operations inside the kernel itself. These operations are exclusively # reserved for user applications. @@ -315,5 +303,4 @@ LD_EMULATION_powerpc= elf32ppc_fbsd LD_EMULATION_powerpcspe= elf32ppc_fbsd LD_EMULATION_powerpc64= elf64ppc_fbsd LD_EMULATION_riscv64= elf64lriscv -LD_EMULATION_sparc64= elf64_sparc_fbsd LD_EMULATION=${LD_EMULATION_${MACHINE_ARCH}} Modified: head/sys/conf/kern.opts.mk ============================================================================== --- head/sys/conf/kern.opts.mk Mon Feb 3 17:34:57 2020 (r357454) +++ head/sys/conf/kern.opts.mk Mon Feb 3 17:35:11 2020 (r357455) @@ -93,8 +93,8 @@ BROKEN_OPTIONS+= OFED BROKEN_OPTIONS+= KERNEL_RETPOLINE .endif -# EFI doesn't exist on mips, powerpc, sparc or riscv. -.if ${MACHINE:Mmips} || ${MACHINE:Mpowerpc} || ${MACHINE:Msparc64} || ${MACHINE:Mriscv} +# EFI doesn't exist on mips, powerpc, or riscv. +.if ${MACHINE:Mmips} || ${MACHINE:Mpowerpc} || ${MACHINE:Mriscv} BROKEN_OPTIONS+=EFI .endif Modified: head/sys/contrib/ck/include/ck_md.h ============================================================================== --- head/sys/contrib/ck/include/ck_md.h Mon Feb 3 17:34:57 2020 (r357454) +++ head/sys/contrib/ck/include/ck_md.h Mon Feb 3 17:35:11 2020 (r357455) @@ -114,9 +114,6 @@ net $ #define CK_MD_SSE_DISABLE 1 #elif defined(__amd64__) #define CK_MD_TSO -#elif defined(__sparc64__) && !defined(__sparcv9__) -#define __sparcv9__ -#define CK_MD_TSO #elif defined(__powerpc64__) && !defined(__ppc64__) #define __ppc64__ #elif defined(__powerpc__) && !defined(__ppc__) Modified: head/sys/dev/ata/ata-pci.c ============================================================================== --- head/sys/dev/ata/ata-pci.c Mon Feb 3 17:34:57 2020 (r357454) +++ head/sys/dev/ata/ata-pci.c Mon Feb 3 17:35:11 2020 (r357455) @@ -147,17 +147,9 @@ ata_pci_detach(device_t dev) if (ctlr->chipdeinit != NULL) ctlr->chipdeinit(dev); if (ctlr->r_res2) { -#ifdef __sparc64__ - bus_space_unmap(rman_get_bustag(ctlr->r_res2), - rman_get_bushandle(ctlr->r_res2), rman_get_size(ctlr->r_res2)); -#endif bus_release_resource(dev, ctlr->r_type2, ctlr->r_rid2, ctlr->r_res2); } if (ctlr->r_res1) { -#ifdef __sparc64__ - bus_space_unmap(rman_get_bustag(ctlr->r_res1), - rman_get_bushandle(ctlr->r_res1), rman_get_size(ctlr->r_res1)); -#endif bus_release_resource(dev, ctlr->r_type1, ctlr->r_rid1, ctlr->r_res1); } Modified: head/sys/dev/ata/chipsets/ata-promise.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-promise.c Mon Feb 3 17:34:57 2020 (r357454) +++ head/sys/dev/ata/chipsets/ata-promise.c Mon Feb 3 17:35:11 2020 (r357455) @@ -250,14 +250,6 @@ ata_promise_chipinit(device_t dev) &ctlr->r_rid1, RF_ACTIVE))) goto failnfree; -#ifdef __sparc64__ - if (ctlr->chip->cfg2 == PR_SX4X && - !bus_space_map(rman_get_bustag(ctlr->r_res1), - rman_get_bushandle(ctlr->r_res1), rman_get_size(ctlr->r_res1), - BUS_SPACE_MAP_LINEAR, NULL)) - goto failnfree; -#endif - ctlr->r_type2 = SYS_RES_MEMORY; ctlr->r_rid2 = PCIR_BAR(3); if (!(ctlr->r_res2 = bus_alloc_resource_any(dev, ctlr->r_type2, Modified: head/sys/dev/atkbdc/atkbd.c ============================================================================== --- head/sys/dev/atkbdc/atkbd.c Mon Feb 3 17:34:57 2020 (r357454) +++ head/sys/dev/atkbdc/atkbd.c Mon Feb 3 17:35:11 2020 (r357455) @@ -74,7 +74,6 @@ typedef struct atkbd_state { } atkbd_state_t; static void atkbd_timeout(void *arg); -static void atkbd_shutdown_final(void *v); static int atkbd_reset(KBDC kbdc, int flags, int c); #define HAS_QUIRK(p, q) (((atkbdc_softc_t *)(p))->quirks & q) @@ -151,9 +150,6 @@ atkbd_attach_unit(device_t dev, keyboard_t **kbd, int if (bootverbose) (*sw->diag)(*kbd, bootverbose); - EVENTHANDLER_REGISTER(shutdown_final, atkbd_shutdown_final, *kbd, - SHUTDOWN_PRI_DEFAULT); - return 0; } @@ -1148,30 +1144,6 @@ atkbd_poll(keyboard_t *kbd, int on) return 0; } -static void -atkbd_shutdown_final(void *v) -{ -#ifdef __sparc64__ - keyboard_t *kbd = v; - KBDC kbdc = ((atkbd_state_t *)kbd->kb_data)->kbdc; - - /* - * Turn off the translation in preparation for handing the keyboard - * over to the OFW as the OBP driver doesn't use translation and - * also doesn't disable it itself resulting in a broken keymap at - * the boot prompt. Also disable the aux port and the interrupts as - * the OBP driver doesn't use them, i.e. polls the keyboard. Not - * disabling the interrupts doesn't cause real problems but the - * responsiveness is a bit better when they are turned off. - */ - send_kbd_command(kbdc, KBDC_DISABLE_KBD); - set_controller_command_byte(kbdc, - KBD_AUX_CONTROL_BITS | KBD_KBD_CONTROL_BITS | KBD_TRANSLATION, - KBD_DISABLE_AUX_PORT | KBD_DISABLE_KBD_INT | KBD_ENABLE_KBD_PORT); - send_kbd_command(kbdc, KBDC_ENABLE_KBD); -#endif -} - static int atkbd_reset(KBDC kbdc, int flags, int c) { @@ -1467,14 +1439,6 @@ init_keyboard(KBDC kbdc, int *type, int flags) return EIO; } } - -#if defined(__sparc64__) - if (send_kbd_command_and_data( - kbdc, KBDC_SET_SCANCODE_SET, 2) != KBD_ACK) { - printf("atkbd: can't set translation.\n"); - } - c |= KBD_TRANSLATION; -#endif /* * Some keyboards require a SETLEDS command to be sent after Modified: head/sys/dev/atkbdc/atkbdc.c ============================================================================== --- head/sys/dev/atkbdc/atkbdc.c Mon Feb 3 17:34:57 2020 (r357454) +++ head/sys/dev/atkbdc/atkbdc.c Mon Feb 3 17:35:11 2020 (r357455) @@ -52,13 +52,7 @@ __FBSDID("$FreeBSD$"); #include -#ifdef __sparc64__ -#include -#include -#include -#else #include -#endif /* constants */ @@ -98,10 +92,6 @@ static atkbdc_softc_t *atkbdc_softc[MAXKBDC] = { &defa static int verbose = KBDIO_DEBUG; -#ifdef __sparc64__ -static struct bus_space_tag atkbdc_bst_store[MAXKBDC]; -#endif - /* function prototypes */ static int atkbdc_setup(atkbdc_softc_t *sc, bus_space_tag_t tag, @@ -197,55 +187,16 @@ atkbdc_configure(void) volatile int i; register_t flags; #endif -#ifdef __sparc64__ - char name[32]; - phandle_t chosen, node; - ihandle_t stdin; - bus_addr_t port0; - bus_addr_t port1; - int space; -#else int port0; int port1; -#endif /* XXX: tag should be passed from the caller */ #if defined(__amd64__) || defined(__i386__) tag = X86_BUS_SPACE_IO; -#elif defined(__sparc64__) - tag = &atkbdc_bst_store[0]; #else #error "define tag!" #endif -#ifdef __sparc64__ - if ((chosen = OF_finddevice("/chosen")) == -1) - return 0; - if (OF_getprop(chosen, "stdin", &stdin, sizeof(stdin)) == -1) - return 0; - if ((node = OF_instance_to_package(stdin)) == -1) - return 0; - if (OF_getprop(node, "name", name, sizeof(name)) == -1) - return 0; - name[sizeof(name) - 1] = '\0'; - if (strcmp(name, "kb_ps2") != 0) - return 0; - /* - * The stdin handle points to an instance of a PS/2 keyboard - * package but we want the 8042 controller, which is the parent - * of that keyboard node. - */ - if ((node = OF_parent(node)) == 0) - return 0; - if (OF_decode_addr(node, 0, &space, &port0) != 0) - return 0; - h0 = sparc64_fake_bustag(space, port0, tag); - bus_space_subregion(tag, h0, KBD_DATA_PORT, 1, &h0); - if (OF_decode_addr(node, 1, &space, &port1) != 0) - return 0; - h1 = sparc64_fake_bustag(space, port1, tag); - bus_space_subregion(tag, h1, KBD_STATUS_PORT, 1, &h1); -#else port0 = IO_KBD; resource_int_value("atkbdc", 0, "port", &port0); port1 = IO_KBD + KBD_STATUS_PORT; @@ -255,7 +206,6 @@ atkbdc_configure(void) #else h0 = (bus_space_handle_t)port0; h1 = (bus_space_handle_t)port1; -#endif #endif #if defined(__i386__) || defined(__amd64__) Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Mon Feb 3 17:34:57 2020 (r357454) +++ head/sys/dev/bge/if_bge.c Mon Feb 3 17:35:11 2020 (r357455) @@ -112,13 +112,6 @@ __FBSDID("$FreeBSD$"); #include "miidevs.h" #include -#ifdef __sparc64__ -#include -#include -#include -#include -#endif - #include #include @@ -557,47 +550,9 @@ static SYSCTL_NODE(_hw, OID_AUTO, bge, CTLFLAG_RD, 0, SYSCTL_INT(_hw_bge, OID_AUTO, allow_asf, CTLFLAG_RDTUN, &bge_allow_asf, 0, "Allow ASF mode if available"); -#define SPARC64_BLADE_1500_MODEL "SUNW,Sun-Blade-1500" -#define SPARC64_BLADE_1500_PATH_BGE "/pci@1f,700000/network@2" -#define SPARC64_BLADE_2500_MODEL "SUNW,Sun-Blade-2500" -#define SPARC64_BLADE_2500_PATH_BGE "/pci@1c,600000/network@3" -#define SPARC64_OFW_SUBVENDOR "subsystem-vendor-id" - static int bge_has_eaddr(struct bge_softc *sc) { -#ifdef __sparc64__ - char buf[sizeof(SPARC64_BLADE_1500_PATH_BGE)]; - device_t dev; - uint32_t subvendor; - - dev = sc->bge_dev; - - /* - * The on-board BGEs found in sun4u machines aren't fitted with - * an EEPROM which means that we have to obtain the MAC address - * via OFW and that some tests will always fail. We distinguish - * such BGEs by the subvendor ID, which also has to be obtained - * from OFW instead of the PCI configuration space as the latter - * indicates Broadcom as the subvendor of the netboot interface. - * For early Blade 1500 and 2500 we even have to check the OFW - * device path as the subvendor ID always defaults to Broadcom - * there. - */ - if (OF_getprop(ofw_bus_get_node(dev), SPARC64_OFW_SUBVENDOR, - &subvendor, sizeof(subvendor)) == sizeof(subvendor) && - (subvendor == FJTSU_VENDORID || subvendor == SUN_VENDORID)) - return (0); - memset(buf, 0, sizeof(buf)); - if (OF_package_to_path(ofw_bus_get_node(dev), buf, sizeof(buf)) > 0) { - if (strcmp(sparc64_model, SPARC64_BLADE_1500_MODEL) == 0 && - strcmp(buf, SPARC64_BLADE_1500_PATH_BGE) == 0) - return (0); - if (strcmp(sparc64_model, SPARC64_BLADE_2500_MODEL) == 0 && - strcmp(buf, SPARC64_BLADE_2500_PATH_BGE) == 0) - return (0); - } -#endif return (1); } @@ -6744,15 +6699,7 @@ bge_sysctl_mem_read(SYSCTL_HANDLER_ARGS) static int bge_get_eaddr_fw(struct bge_softc *sc, uint8_t ether_addr[]) { -#ifdef __sparc64__ - if (sc->bge_flags & BGE_FLAG_EADDR) - return (1); - - OF_getetheraddr(sc->bge_dev, ether_addr); - return (0); -#else return (1); -#endif } static int Modified: head/sys/dev/cas/if_cas.c ============================================================================== --- head/sys/dev/cas/if_cas.c Mon Feb 3 17:34:57 2020 (r357454) +++ head/sys/dev/cas/if_cas.c Mon Feb 3 17:35:11 2020 (r357455) @@ -78,7 +78,7 @@ __FBSDID("$FreeBSD$"); #include #include -#if defined(__powerpc__) || defined(__sparc64__) +#if defined(__powerpc__) #include #include #include @@ -1045,14 +1045,10 @@ cas_init_locked(struct cas_softc *sc) /* * Enable infinite bursts for revisions without PCI issues if - * applicable. Doing so greatly improves the TX performance on - * !__sparc64__ (on sparc64, setting CAS_INF_BURST improves TX - * performance only marginally but hurts RX throughput quite a bit). + * applicable. Doing so greatly improves the TX performance. */ CAS_WRITE_4(sc, CAS_INF_BURST, -#if !defined(__sparc64__) (sc->sc_flags & CAS_TABORT) == 0 ? CAS_INF_BURST_EN : -#endif 0); /* Set up interrupts. */ @@ -2652,7 +2648,7 @@ cas_pci_attach(device_t dev) char buf[sizeof(CAS_LOCAL_MAC_ADDRESS)]; struct cas_softc *sc; int i; -#if !(defined(__powerpc__) || defined(__sparc64__)) +#if !defined(__powerpc__) u_char enaddr[4][ETHER_ADDR_LEN]; u_int j, k, lma, pcs[4], phy; #endif @@ -2696,7 +2692,7 @@ cas_pci_attach(device_t dev) CAS_LOCK_INIT(sc, device_get_nameunit(dev)); -#if defined(__powerpc__) || defined(__sparc64__) +#if defined(__powerpc__) OF_getetheraddr(dev, sc->sc_enaddr); if (OF_getprop(ofw_bus_get_node(dev), CAS_PHY_INTERFACE, buf, sizeof(buf)) > 0 || OF_getprop(ofw_bus_get_node(dev), Modified: head/sys/dev/dc/if_dc.c ============================================================================== --- head/sys/dev/dc/if_dc.c Mon Feb 3 17:34:57 2020 (r357454) +++ head/sys/dev/dc/if_dc.c Mon Feb 3 17:35:11 2020 (r357455) @@ -135,11 +135,6 @@ __FBSDID("$FreeBSD$"); #include -#ifdef __sparc64__ -#include -#include -#endif - MODULE_DEPEND(dc, pci, 1, 1, 1); MODULE_DEPEND(dc, ether, 1, 1, 1); MODULE_DEPEND(dc, miibus, 1, 1, 1); @@ -2293,14 +2288,6 @@ dc_attach(device_t dev) break; case DC_TYPE_DM9102: dc_read_eeprom(sc, (caddr_t)&eaddr, DC_EE_NODEADDR, 3, 0); -#ifdef __sparc64__ - /* - * If this is an onboard dc(4) the station address read from - * the EEPROM is all zero and we have to get it from the FCode. - */ - if (eaddr[0] == 0 && (eaddr[1] & ~0xffff) == 0) - OF_getetheraddr(dev, (caddr_t)&eaddr); -#endif break; case DC_TYPE_21143: case DC_TYPE_ASIX: Modified: head/sys/dev/fb/fbreg.h ============================================================================== --- head/sys/dev/fb/fbreg.h Mon Feb 3 17:34:57 2020 (r357454) +++ head/sys/dev/fb/fbreg.h Mon Feb 3 17:35:11 2020 (r357455) @@ -51,13 +51,6 @@ copyw(uint16_t *src, uint16_t *dst, size_t size) #define bzero_io(d, c) bzero((void *)(d), (c)) #define fill_io(p, d, c) fill((p), (void *)(d), (c)) #define fillw_io(p, d, c) fillw((p), (void *)(d), (c)) -#elif defined(__sparc64__) -static __inline void -fillw(int val, uint16_t *buf, size_t size) -{ - while (size--) - *buf++ = val; -} #elif defined(__powerpc__) #define bcopy_io(s, d, c) ofwfb_bcopy((void *)(s), (void *)(d), (c)) @@ -102,7 +95,7 @@ fillw(int val, uint16_t *buf, size_t size) #define writew(a, v) (*(uint16_t*)(a) = (v)) #endif -#else /* !__i386__ && !__amd64__ && !__sparc64__ && !__powerpc__ */ +#else /* !__i386__ && !__amd64__ && !__powerpc__ */ #define bcopy_io(s, d, c) memcpy_io((d), (s), (c)) #define bcopy_toio(s, d, c) memcpy_toio((d), (void *)(s), (c)) #define bcopy_fromio(s, d, c) memcpy_fromio((void *)(d), (s), (c)) Modified: head/sys/dev/firewire/sbp.c ============================================================================== --- head/sys/dev/firewire/sbp.c Mon Feb 3 17:34:57 2020 (r357454) +++ head/sys/dev/firewire/sbp.c Mon Feb 3 17:35:11 2020 (r357455) @@ -134,11 +134,7 @@ SYSCTL_INT(_hw_firewire_sbp, OID_AUTO, tags, CTLFLAG_R #define NEED_RESPONSE 0 #define SBP_SEG_MAX rounddown(0xffff, PAGE_SIZE) -#ifdef __sparc64__ /* iommu */ -#define SBP_IND_MAX howmany(SBP_MAXPHYS, SBP_SEG_MAX) -#else #define SBP_IND_MAX howmany(SBP_MAXPHYS, PAGE_SIZE) -#endif struct sbp_ocb { STAILQ_ENTRY(sbp_ocb) ocb; union ccb *ccb; Modified: head/sys/dev/gem/if_gem_pci.c ============================================================================== --- head/sys/dev/gem/if_gem_pci.c Mon Feb 3 17:34:57 2020 (r357454) +++ head/sys/dev/gem/if_gem_pci.c Mon Feb 3 17:35:11 2020 (r357455) @@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include -#if defined(__powerpc__) || defined(__sparc64__) +#if defined(__powerpc__) #include #include #include @@ -149,7 +149,7 @@ gem_pci_attach(device_t dev) { struct gem_softc *sc; int i; -#if defined(__powerpc__) || defined(__sparc64__) +#if defined(__powerpc__) char buf[sizeof(GEM_SHARED_PINS)]; #else int j; @@ -215,7 +215,7 @@ gem_pci_attach(device_t dev) GEM_PCI_BIF_CNF_M66EN) != 0) sc->sc_flags |= GEM_PCI66; -#if defined(__powerpc__) || defined(__sparc64__) +#if defined(__powerpc__) OF_getetheraddr(dev, sc->sc_enaddr); if (OF_getprop(ofw_bus_get_node(dev), GEM_SHARED_PINS, buf, sizeof(buf)) > 0) { Modified: head/sys/dev/hme/if_hme_pci.c ============================================================================== --- head/sys/dev/hme/if_hme_pci.c Mon Feb 3 17:34:57 2020 (r357454) +++ head/sys/dev/hme/if_hme_pci.c Mon Feb 3 17:35:11 2020 (r357455) @@ -50,7 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include -#if defined(__powerpc__) || defined(__sparc64__) +#if defined(__powerpc__) #include #include #endif @@ -140,7 +140,7 @@ hme_pci_attach(device_t dev) bus_space_tag_t memt; bus_space_handle_t memh; int i, error = 0; -#if !(defined(__powerpc__) || defined(__sparc64__)) +#if !defined(__powerpc__) device_t *children, ebus_dev; struct resource *ebus_rres; int j, slot; @@ -197,7 +197,7 @@ hme_pci_attach(device_t dev) bus_space_subregion(memt, memh, 0x6000, 0x1000, &sc->sc_mach); bus_space_subregion(memt, memh, 0x7000, 0x1000, &sc->sc_mifh); -#if defined(__powerpc__) || defined(__sparc64__) +#if defined(__powerpc__) OF_getetheraddr(dev, sc->sc_enaddr); #else /* Modified: head/sys/dev/isp/isp_freebsd.h ============================================================================== --- head/sys/dev/isp/isp_freebsd.h Mon Feb 3 17:34:57 2020 (r357454) +++ head/sys/dev/isp/isp_freebsd.h Mon Feb 3 17:35:11 2020 (r357455) @@ -71,11 +71,7 @@ /* * Efficiency- get rid of SBus code && tests unless we need them. */ -#ifdef __sparc64__ -#define ISP_SBUS_SUPPORTED 1 -#else #define ISP_SBUS_SUPPORTED 0 -#endif #define ISP_IFLAGS INTR_TYPE_CAM | INTR_ENTROPY | INTR_MPSAFE Modified: head/sys/dev/isp/isp_pci.c ============================================================================== --- head/sys/dev/isp/isp_pci.c Mon Feb 3 17:34:57 2020 (r357454) +++ head/sys/dev/isp/isp_pci.c Mon Feb 3 17:35:11 2020 (r357455) @@ -48,12 +48,6 @@ __FBSDID("$FreeBSD$"); #include #include #include - -#ifdef __sparc64__ -#include -#include -#endif - #include static uint32_t isp_pci_rd_reg(ispsoftc_t *, int); @@ -493,11 +487,7 @@ isp_get_specific_options(device_t dev, int chan, ispso if (IS_FC(isp)) { ISP_FC_PC(isp, chan)->default_id = 109 - chan; } else { -#ifdef __sparc64__ - ISP_SPI_PC(isp, chan)->iid = OF_getscsinitid(dev); -#else ISP_SPI_PC(isp, chan)->iid = 7; -#endif } } else { if (IS_FC(isp)) { Modified: head/sys/dev/ispfw/ispfw.c ============================================================================== --- head/sys/dev/ispfw/ispfw.c Mon Feb 3 17:34:57 2020 (r357454) +++ head/sys/dev/ispfw/ispfw.c Mon Feb 3 17:35:11 2020 (r357455) @@ -39,9 +39,6 @@ __FBSDID("$FreeBSD$"); #include #if defined(ISP_ALL) || !defined(KLD_MODULE) -#ifdef __sparc64__ -#define ISP_1000 1 -#endif #define ISP_1040 1 #define ISP_1040_IT 1 #define ISP_1080 1 @@ -60,13 +57,6 @@ __FBSDID("$FreeBSD$"); #define MODULE_NAME "ispfw" #endif -#if defined(ISP_1000) -#ifdef __sparc64__ -#include -#else -#error "firmware not compatible with this platform" -#endif -#endif #if defined(ISP_1040) || defined(ISP_1040_IT) #include #endif @@ -95,9 +85,6 @@ __FBSDID("$FreeBSD$"); #include #endif -#if defined(ISP_1000) -static int isp_1000_loaded; -#endif #if defined(ISP_1040) static int isp_1040_loaded; #endif @@ -152,9 +139,6 @@ static int do_load_fw(void) { -#if defined(ISP_1000) - RMACRO(isp_1000); -#endif #if defined(ISP_1040) RMACRO(isp_1040); #endif @@ -190,9 +174,6 @@ do_unload_fw(void) { int error = 0; -#if defined(ISP_1000) - UMACRO(isp_1000); -#endif #if defined(ISP_1040) UMACRO(isp_1040); #endif @@ -240,8 +221,6 @@ static moduledata_t ispfw_mod = { }; #if defined(ISP_ALL) || !defined(KLD_MODULE) DECLARE_MODULE(ispfw, ispfw_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD); -#elif defined(ISP_1000) -DECLARE_MODULE(isp_1000, ispfw_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD); #elif defined(ISP_1040) DECLARE_MODULE(isp_1040, ispfw_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD); #elif defined(ISP_1080) Modified: head/sys/dev/mpt/mpt.h ============================================================================== --- head/sys/dev/mpt/mpt.h Mon Feb 3 17:34:57 2020 (r357454) +++ head/sys/dev/mpt/mpt.h Mon Feb 3 17:35:11 2020 (r357455) @@ -122,11 +122,6 @@ #include #include -#ifdef __sparc64__ -#include -#include -#endif - #include #include Modified: head/sys/dev/mpt/mpt_pci.c ============================================================================== --- head/sys/dev/mpt/mpt_pci.c Mon Feb 3 17:34:57 2020 (r357454) +++ head/sys/dev/mpt/mpt_pci.c Mon Feb 3 17:35:11 2020 (r357455) @@ -372,10 +372,6 @@ mpt_pci_attach(device_t dev) mpt->verbose = MPT_PRT_NONE; mpt->role = MPT_ROLE_NONE; mpt->mpt_ini_id = MPT_INI_ID_NONE; -#ifdef __sparc64__ - if (mpt->is_spi) - mpt->mpt_ini_id = OF_getscsinitid(dev); -#endif mpt_set_options(mpt); if (mpt->verbose == MPT_PRT_NONE) { mpt->verbose = MPT_PRT_WARN; Modified: head/sys/dev/mthca/mthca_srq.c ============================================================================== --- head/sys/dev/mthca/mthca_srq.c Mon Feb 3 17:34:57 2020 (r357454) +++ head/sys/dev/mthca/mthca_srq.c Mon Feb 3 17:35:11 2020 (r357455) @@ -115,16 +115,10 @@ static void mthca_arbel_init_srq_context(struct mthca_ struct mthca_srq *srq, struct mthca_arbel_srq_context *context) { - int logsize, max; + int logsize; memset(context, 0, sizeof *context); - - /* - * Put max in a temporary variable to work around gcc bug - * triggered by ilog2() on sparc64. - */ - max = srq->max; - logsize = ilog2(max); + logsize = ilog2(srq->max); context->state_logsize_srqn = cpu_to_be32(logsize << 24 | srq->srqn); context->lkey = cpu_to_be32(srq->mr.ibmr.lkey); context->db_index = cpu_to_be32(srq->db_index); Modified: head/sys/dev/mxge/if_mxge_var.h ============================================================================== --- head/sys/dev/mxge/if_mxge_var.h Mon Feb 3 17:34:57 2020 (r357454) +++ head/sys/dev/mxge/if_mxge_var.h Mon Feb 3 17:35:11 2020 (r357455) @@ -325,27 +325,6 @@ struct mxge_pkt_info { }; -/* implement our own memory barriers, since bus_space_barrier - cannot handle write-combining regions */ - -#if __FreeBSD_version < 800053 - -#if defined (__GNUC__) - #if #cpu(i386) || defined __i386 || defined i386 || defined __i386__ || #cpu(x86_64) || defined __x86_64__ - #define wmb() __asm__ __volatile__ ("sfence;": : :"memory") - #elif #cpu(sparc64) || defined sparc64 || defined __sparcv9 - #define wmb() __asm__ __volatile__ ("membar #MemIssue": : :"memory") - #elif #cpu(sparc) || defined sparc || defined __sparc__ - #define wmb() __asm__ __volatile__ ("stbar;": : :"memory") - #else - #define wmb() /* XXX just to make this compile */ - #endif -#else - #error "unknown compiler" -#endif - -#endif - static inline void mxge_pio_copy(volatile void *to_v, void *from_v, size_t size) { Modified: head/sys/dev/ofw/openfirm.h ============================================================================== --- head/sys/dev/ofw/openfirm.h Mon Feb 3 17:34:57 2020 (r357454) +++ head/sys/dev/ofw/openfirm.h Mon Feb 3 17:35:11 2020 (r357455) @@ -178,13 +178,10 @@ int OF_interpret(const char *cmd, int nreturns, ...); /* * Decode the Nth register property of the given device node and create a bus * space tag and handle for accessing it. This is for use in setting up things - * like early console output before newbus is available. The implementation is - * machine-dependent, and sparc uses a different function signature as well. + * like early console output before newbus is available. */ -#ifndef __sparc64__ int OF_decode_addr(phandle_t dev, int regno, bus_space_tag_t *ptag, bus_space_handle_t *phandle, bus_size_t *sz); -#endif #endif /* _KERNEL */ #endif /* _DEV_OPENFIRM_H_ */ Modified: head/sys/dev/proto/proto_core.c ============================================================================== --- head/sys/dev/proto/proto_core.c Mon Feb 3 17:34:57 2020 (r357454) +++ head/sys/dev/proto/proto_core.c Mon Feb 3 17:35:11 2020 (r357455) @@ -507,9 +507,7 @@ proto_mmap(struct cdev *cdev, vm_ooffset_t offset, vm_ if (offset >= r->r_size) return (EINVAL); *paddr = rman_get_start(r->r_d.res) + offset; -#ifndef __sparc64__ *memattr = VM_MEMATTR_UNCACHEABLE; -#endif break; case PROTO_RES_BUSDMA: if (!proto_busdma_mmap_allowed(r->r_d.busdma, offset)) Modified: head/sys/dev/sfxge/common/efsys.h ============================================================================== --- head/sys/dev/sfxge/common/efsys.h Mon Feb 3 17:34:57 2020 (r357454) +++ head/sys/dev/sfxge/common/efsys.h Mon Feb 3 17:35:11 2020 (r357455) @@ -130,26 +130,6 @@ prefetch_read_once(void *addr) : : "r" (addr)); } -#elif defined(__sparc64__) -static __inline void -prefetch_read_many(void *addr) -{ - - __asm__( - "prefetch [%0], 0" - : - : "r" (addr)); -} - -static __inline void -prefetch_read_once(void *addr) -{ - - __asm__( - "prefetch [%0], 1" - : - : "r" (addr)); -} #else static __inline void prefetch_read_many(void *addr) Modified: head/sys/dev/sound/pci/t4dwave.c ============================================================================== --- head/sys/dev/sound/pci/t4dwave.c Mon Feb 3 17:34:57 2020 (r357454) +++ head/sys/dev/sound/pci/t4dwave.c Mon Feb 3 17:35:11 2020 (r357455) @@ -829,11 +829,6 @@ tr_pci_attach(device_t dev) bus_addr_t lowaddr; int i, dacn; char status[SND_STATUSLEN]; -#ifdef __sparc64__ - device_t *children; - int nchildren; - u_int32_t data; -#endif tr = malloc(sizeof(*tr), M_DEVBUF, M_WAITOK | M_ZERO); tr->type = pci_get_devid(dev); @@ -900,34 +895,9 @@ tr_pci_attach(device_t dev) * using a low address of BUS_SPACE_MAXADDR_32BIT for both * we might end up with the play buffer being in the 32-bit * range while the record buffer isn't or vice versa. So we - * limit enabling the 31st bit to sparc64, where the IOMMU - * guarantees that we're using a 32-bit address (and in turn - * requires it). + * don't enabling the 31st bit. */ lowaddr = ALI_MAXADDR; -#ifdef __sparc64__ - if (device_get_children(device_get_parent(dev), &children, - &nchildren) == 0) { - for (i = 0; i < nchildren; i++) { - if (pci_get_devid(children[i]) == 0x153310b9) { - lowaddr = BUS_SPACE_MAXADDR_32BIT; - data = pci_read_config(children[i], - 0x7e, 1); - if (bootverbose) - device_printf(dev, - "M1533 0x7e: 0x%x -> ", - data); - data |= 0x1; - if (bootverbose) - printf("0x%x\n", data); - pci_write_config(children[i], 0x7e, - data, 1); - break; - } - } - } - free(children, M_TEMP); -#endif tr->hwchns = ALI_MAXHWCH; tr->bufsz = ALI_BUFSZ; } else { Modified: head/sys/dev/sym/sym_hipd.c ============================================================================== --- head/sys/dev/sym/sym_hipd.c Mon Feb 3 17:34:57 2020 (r357454) +++ head/sys/dev/sym/sym_hipd.c Mon Feb 3 17:35:11 2020 (r357455) @@ -90,11 +90,6 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef __sparc64__ -#include -#include -#endif - #include #include @@ -134,8 +129,6 @@ typedef u_int32_t u32; #define MEMORY_BARRIER() do { ; } while(0) #elif defined __powerpc__ #define MEMORY_BARRIER() __asm__ volatile("eieio; sync" : : : "memory") -#elif defined __sparc64__ -#define MEMORY_BARRIER() __asm__ volatile("membar #Sync" : : : "memory") #elif defined __arm__ #define MEMORY_BARRIER() dmb() #elif defined __aarch64__ @@ -2652,9 +2645,6 @@ static int sym_prepare_setting(hcb_p np, struct sym_nv */ np->myaddr = 255; sym_nvram_setup_host (np, nvram); -#ifdef __sparc64__ - np->myaddr = OF_getscsinitid(np->device); -#endif /* * Get SCSI addr of host adapter (set by bios?). Modified: head/sys/dev/syscons/scgfbrndr.c ============================================================================== --- head/sys/dev/syscons/scgfbrndr.c Mon Feb 3 17:34:57 2020 (r357454) +++ head/sys/dev/syscons/scgfbrndr.c Mon Feb 3 17:35:11 2020 (r357455) @@ -107,38 +107,11 @@ sc_rndr_sw_t grrndrsw = { #endif /* SC_NO_MODE_CHANGE */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Feb 3 17:47:15 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0FCF922996C; Mon, 3 Feb 2020 17:47:15 +0000 (UTC) (envelope-from chs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BFdZ6PNjz3Lyg; Mon, 3 Feb 2020 17:47:14 +0000 (UTC) (envelope-from chs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D271447CE; Mon, 3 Feb 2020 17:47:14 +0000 (UTC) (envelope-from chs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 013HlEbM001075; Mon, 3 Feb 2020 17:47:14 GMT (envelope-from chs@FreeBSD.org) Received: (from chs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 013HlEBR001073; Mon, 3 Feb 2020 17:47:14 GMT (envelope-from chs@FreeBSD.org) Message-Id: <202002031747.013HlEBR001073@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chs set sender to chs@FreeBSD.org using -f From: Chuck Silvers Date: Mon, 3 Feb 2020 17:47:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357456 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: chs X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 357456 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 17:47:15 -0000 Author: chs Date: Mon Feb 3 17:47:14 2020 New Revision: 357456 URL: https://svnweb.freebsd.org/changeset/base/357456 Log: With INVARIANTS, track all softdep dependency structures centrally so that we can find them in dumps. Approved by: mckusick (mentor) Sponsored by: Netflix Modified: head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ffs/softdep.h Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Mon Feb 3 17:35:11 2020 (r357455) +++ head/sys/ufs/ffs/ffs_softdep.c Mon Feb 3 17:47:14 2020 (r357456) @@ -1208,6 +1208,9 @@ workitem_free(item, type) ump->um_fs->fs_fsmnt, TYPENAME(item->wk_type))); atomic_subtract_long(&dep_current[item->wk_type], 1); ump->softdep_curdeps[item->wk_type] -= 1; +#ifdef INVARIANTS + LIST_REMOVE(item, wk_all); +#endif free(item, DtoM(type)); } @@ -1234,6 +1237,9 @@ workitem_alloc(item, type, mp) ump->softdep_curdeps[type] += 1; ump->softdep_deps++; ump->softdep_accdeps++; +#ifdef INVARIANTS + LIST_INSERT_HEAD(&ump->softdep_alldeps[type], item, wk_all); +#endif FREE_LOCK(ump); } @@ -2532,6 +2538,10 @@ softdep_mount(devvp, mp, fs, cred) ump->indir_hash_size = i - 1; for (i = 0; i <= ump->indir_hash_size; i++) TAILQ_INIT(&ump->indir_hashtbl[i]); +#ifdef INVARIANTS + for (i = 0; i <= D_LAST; i++) + LIST_INIT(&ump->softdep_alldeps[i]); +#endif ACQUIRE_GBLLOCK(&lk); TAILQ_INSERT_TAIL(&softdepmounts, sdp, sd_next); FREE_GBLLOCK(&lk); @@ -2638,10 +2648,14 @@ softdep_unmount(mp) ump->bmsafemap_hash_size); free(ump->indir_hashtbl, M_FREEWORK); #ifdef INVARIANTS - for (i = 0; i <= D_LAST; i++) + for (i = 0; i <= D_LAST; i++) { KASSERT(ump->softdep_curdeps[i] == 0, ("Unmount %s: Dep type %s != 0 (%ld)", ump->um_fs->fs_fsmnt, TYPENAME(i), ump->softdep_curdeps[i])); + KASSERT(LIST_EMPTY(&ump->softdep_alldeps[i]), + ("Unmount %s: Dep type %s not empty (%p)", ump->um_fs->fs_fsmnt, + TYPENAME(i), LIST_FIRST(&ump->softdep_alldeps[i]))); + } #endif free(ump->um_softdep, M_MOUNTDATA); } Modified: head/sys/ufs/ffs/softdep.h ============================================================================== --- head/sys/ufs/ffs/softdep.h Mon Feb 3 17:35:11 2020 (r357455) +++ head/sys/ufs/ffs/softdep.h Mon Feb 3 17:47:14 2020 (r357456) @@ -216,6 +216,7 @@ struct worklist { #ifdef INVARIANTS const char *wk_func; /* func where added / removed */ int wk_line; /* line where added / removed */ + LIST_ENTRY(worklist) wk_all; /* list of deps of this type */ #endif }; #define WK_DATA(wk) ((void *)(wk)) @@ -1073,6 +1074,9 @@ struct mount_softdeps { TAILQ_ENTRY(mount_softdeps) sd_next; /* List of softdep filesystem */ struct ufsmount *sd_ump; /* our ufsmount structure */ u_long sd_curdeps[D_LAST + 1]; /* count of current deps */ +#ifdef INVARIANTS + struct workhead sd_alldeps[D_LAST + 1];/* Lists of all deps */ +#endif }; /* * Flags for communicating with the syncer thread. @@ -1113,3 +1117,4 @@ struct mount_softdeps { #define softdep_flags um_softdep->sd_flags #define softdep_flushtd um_softdep->sd_flushtd #define softdep_curdeps um_softdep->sd_curdeps +#define softdep_alldeps um_softdep->sd_alldeps From owner-svn-src-all@freebsd.org Mon Feb 3 18:12:16 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 26FD6229EAA; Mon, 3 Feb 2020 18:12:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BGBS02jdz3N88; Mon, 3 Feb 2020 18:12:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-7.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 684CA1F3E8; Mon, 3 Feb 2020 18:12:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r357407 - head To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202002021137.012BbSwd008392@repo.freebsd.org> From: John Baldwin Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <0a69da73-cd11-5d27-0c53-4db4c837c4dc@FreeBSD.org> Date: Mon, 3 Feb 2020 10:12:10 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <202002021137.012BbSwd008392@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 18:12:16 -0000 On 2/2/20 3:37 AM, Warner Losh wrote: > Author: imp > Date: Sun Feb 2 11:37:27 2020 > New Revision: 357407 > URL: https://svnweb.freebsd.org/changeset/base/357407 > > Log: > Per the firm plan, start to remove sparc64 > > The sparc64 architecture is being removed from FreeBSD 13, starting > now. This removes it from the top level only. It is the only > architecture that didn't see substantial work after the call to get > things working with the external toolchain. > > Modified: > head/Makefile > head/Makefile.inc1 > > Modified: head/Makefile.inc1 > ============================================================================== > --- head/Makefile.inc1 Sun Feb 2 09:38:40 2020 (r357406) > +++ head/Makefile.inc1 Sun Feb 2 11:37:27 2020 (r357407) > @@ -2915,14 +2912,10 @@ _cddl_lib_libctf= cddl/lib/libctf > _cddl_lib= cddl/lib > cddl/lib/libctf__L: lib/libz__L > .endif > -# cddl/lib/libdtrace requires lib/libproc and lib/librtld_db; it's only built > -# on select architectures though (see cddl/lib/Makefile) The comment should stay, probably as: # cddl/lib/libdtrace requires lib/libproc and lib/librtld_db > -.if ${MACHINE_CPUARCH} != "sparc64" > _prebuild_libs+= lib/libprocstat lib/libproc lib/librtld_db > lib/libprocstat__L: lib/libelf__L lib/libkvm__L lib/libutil__L > lib/libproc__L: lib/libprocstat__L > lib/librtld_db__L: lib/libprocstat__L > -.endif -- John Baldwin From owner-svn-src-all@freebsd.org Mon Feb 3 18:20:59 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6037522A11B; Mon, 3 Feb 2020 18:20:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BGNW1ysdz3NN9; Mon, 3 Feb 2020 18:20:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-7.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id AECB51F3E9; Mon, 3 Feb 2020 18:20:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r357361 - in head/sys: kern sys ufs/ufs vm To: Mateusz Guzik , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202002010646.0116ktUk057327@repo.freebsd.org> From: John Baldwin Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <94dd2422-307b-9c06-ad84-d13d2e8a9fa4@FreeBSD.org> Date: Mon, 3 Feb 2020 10:20:54 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <202002010646.0116ktUk057327@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 18:20:59 -0000 On 1/31/20 10:46 PM, Mateusz Guzik wrote: > Author: mjg > Date: Sat Feb 1 06:46:55 2020 > New Revision: 357361 > URL: https://svnweb.freebsd.org/changeset/base/357361 > > Log: > vfs: replace VOP_MARKATIME with VOP_MMAPPED > > The routine is only provided by ufs and is only used on mmap and exec. > > Reviewed by: kib > Differential Revision: https://reviews.freebsd.org/D23422 > > Modified: > head/sys/kern/kern_exec.c > head/sys/kern/vfs_subr.c > head/sys/kern/vnode_if.src > head/sys/sys/vnode.h > head/sys/ufs/ufs/ufs_vnops.c > head/sys/vm/vm_mmap.c > > Modified: head/sys/ufs/ufs/ufs_vnops.c > ============================================================================== > --- head/sys/ufs/ufs/ufs_vnops.c Sat Feb 1 06:41:44 2020 (r357360) > +++ head/sys/ufs/ufs/ufs_vnops.c Sat Feb 1 06:46:55 2020 (r357361) > @@ -108,7 +108,7 @@ static vop_getattr_t ufs_getattr; > static vop_ioctl_t ufs_ioctl; > static vop_link_t ufs_link; > static int ufs_makeinode(int mode, struct vnode *, struct vnode **, struct componentname *, const char *); > -static vop_markatime_t ufs_markatime; > +static vop_mmapped_t ufs_mmapped; > static vop_mkdir_t ufs_mkdir; > static vop_mknod_t ufs_mknod; > static vop_open_t ufs_open; > @@ -676,19 +676,22 @@ out: > } > #endif /* UFS_ACL */ > > -/* > - * Mark this file's access time for update for vfs_mark_atime(). This > - * is called from execve() and mmap(). > - */ Why remove this comment rather than update it? It is largely still true and explains the purpose of the VOP (update the atime) which is now no longer obvious from the name. -- John Baldwin From owner-svn-src-all@freebsd.org Mon Feb 3 18:22:59 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6A20022A41A; Mon, 3 Feb 2020 18:22:59 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BGQq2kX9z3Nly; Mon, 3 Feb 2020 18:22:59 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 58CFC4F54; Mon, 3 Feb 2020 18:22:59 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 013IMxEB024647; Mon, 3 Feb 2020 18:22:59 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 013IMxkk024646; Mon, 3 Feb 2020 18:22:59 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202002031822.013IMxkk024646@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 3 Feb 2020 18:22:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357457 - head/sys/arm64/include X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/arm64/include X-SVN-Commit-Revision: 357457 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 18:22:59 -0000 Author: markj Date: Mon Feb 3 18:22:59 2020 New Revision: 357457 URL: https://svnweb.freebsd.org/changeset/base/357457 Log: Provide a single implementation for each of the arm64 atomic(9) ops. Parameterize the macros by type width as well as acq/rel semantics. This makes modifying the implementations much less tedious and error-prone and makes it easier to support alternate LSE-based implementations. No functional change intended. Reviewed by: andrew, kib MFC after: 1 month Sponsored by: The FreeBSD Foundation, Amazon (hardware) Differential Revision: https://reviews.freebsd.org/D23322 Modified: head/sys/arm64/include/atomic.h Modified: head/sys/arm64/include/atomic.h ============================================================================== --- head/sys/arm64/include/atomic.h Mon Feb 3 17:47:14 2020 (r357456) +++ head/sys/arm64/include/atomic.h Mon Feb 3 18:22:59 2020 (r357457) @@ -59,125 +59,79 @@ #include -#define ATOMIC_OP(op, asm_op, bar, a, l) \ +#define _ATOMIC_OP_IMPL(t, w, s, op, asm_op, bar, a, l) \ static __inline void \ -atomic_##op##_##bar##8(volatile uint8_t *p, uint8_t val) \ +atomic_##op##_##bar##t(volatile uint##t##_t *p, uint##t##_t val) \ { \ - uint8_t tmp; \ + uint##t##_t tmp; \ int res; \ \ __asm __volatile( \ - "1: ld"#a"xrb %w0, [%2] \n" \ - " "#asm_op" %w0, %w0, %w3 \n" \ - " st"#l"xrb %w1, %w0, [%2] \n" \ - " cbnz %w1, 1b \n" \ + "1: ld"#a"xr"#s" %"#w"0, [%2]\n" \ + " "#asm_op" %"#w"0, %"#w"0, %"#w"3\n" \ + " st"#l"xr"#s" %w1, %"#w"0, [%2]\n" \ + " cbnz %w1, 1b\n" \ : "=&r"(tmp), "=&r"(res) \ : "r" (p), "r" (val) \ : "memory" \ ); \ -} \ - \ -static __inline void \ -atomic_##op##_##bar##16(volatile uint16_t *p, uint16_t val) \ -{ \ - uint16_t tmp; \ - int res; \ - \ - __asm __volatile( \ - "1: ld"#a"xrh %w0, [%2] \n" \ - " "#asm_op" %w0, %w0, %w3 \n" \ - " st"#l"xrh %w1, %w0, [%2] \n" \ - " cbnz %w1, 1b \n" \ - : "=&r"(tmp), "=&r"(res) \ - : "r" (p), "r" (val) \ - : "memory" \ - ); \ -} \ - \ -static __inline void \ -atomic_##op##_##bar##32(volatile uint32_t *p, uint32_t val) \ -{ \ - uint32_t tmp; \ - int res; \ - \ - __asm __volatile( \ - "1: ld"#a"xr %w0, [%2] \n" \ - " "#asm_op" %w0, %w0, %w3 \n" \ - " st"#l"xr %w1, %w0, [%2] \n" \ - " cbnz %w1, 1b \n" \ - : "=&r"(tmp), "=&r"(res) \ - : "r" (p), "r" (val) \ - : "memory" \ - ); \ -} \ - \ -static __inline void \ -atomic_##op##_##bar##64(volatile uint64_t *p, uint64_t val) \ -{ \ - uint64_t tmp; \ - int res; \ - \ - __asm __volatile( \ - "1: ld"#a"xr %0, [%2] \n" \ - " "#asm_op" %0, %0, %3 \n" \ - " st"#l"xr %w1, %0, [%2] \n" \ - " cbnz %w1, 1b \n" \ - : "=&r"(tmp), "=&r"(res) \ - : "r" (p), "r" (val) \ - : "memory" \ - ); \ } -#define ATOMIC(op, asm_op) \ - ATOMIC_OP(op, asm_op, , , ) \ - ATOMIC_OP(op, asm_op, acq_, a, ) \ - ATOMIC_OP(op, asm_op, rel_, , l) \ +#define __ATOMIC_OP(op, asm_op, bar, a, l) \ + _ATOMIC_OP_IMPL(8, w, b, op, asm_op, bar, a, l) \ + _ATOMIC_OP_IMPL(16, w, h, op, asm_op, bar, a, l) \ + _ATOMIC_OP_IMPL(32, w, , op, asm_op, bar, a, l) \ + _ATOMIC_OP_IMPL(64, , , op, asm_op, bar, a, l) -ATOMIC(add, add) -ATOMIC(clear, bic) -ATOMIC(set, orr) -ATOMIC(subtract, sub) +#define _ATOMIC_OP(op, asm_op) \ + __ATOMIC_OP(op, asm_op, , , ) \ + __ATOMIC_OP(op, asm_op, acq_, a, ) \ + __ATOMIC_OP(op, asm_op, rel_, , l) -#define ATOMIC_FCMPSET(bar, a, l) \ +_ATOMIC_OP(add, add) +_ATOMIC_OP(clear, bic) +_ATOMIC_OP(set, orr) +_ATOMIC_OP(subtract, sub) + +#define _ATOMIC_CMPSET_IMPL(t, w, s, bar, a, l) \ static __inline int \ -atomic_fcmpset_##bar##8(volatile uint8_t *p, uint8_t *cmpval, \ - uint8_t newval) \ +atomic_cmpset_##bar##t(volatile uint##t##_t *p, uint##t##_t cmpval, \ + uint##t##_t newval) \ { \ - uint8_t tmp; \ - uint8_t _cmpval = *cmpval; \ + uint##t##_t tmp; \ int res; \ \ __asm __volatile( \ - "1: mov %w1, #1 \n" \ - " ld"#a"xrb %w0, [%2] \n" \ - " cmp %w0, %w3 \n" \ - " b.ne 2f \n" \ - " st"#l"xrb %w1, %w4, [%2]\n" \ + "1: mov %w1, #1\n" \ + " ld"#a"xr"#s" %"#w"0, [%2]\n" \ + " cmp %"#w"0, %"#w"3\n" \ + " b.ne 2f\n" \ + " st"#l"xr"#s" %w1, %"#w"4, [%2]\n" \ + " cbnz %w1, 1b\n" \ "2:" \ : "=&r"(tmp), "=&r"(res) \ - : "r" (p), "r" (_cmpval), "r" (newval) \ + : "r" (p), "r" (cmpval), "r" (newval) \ : "cc", "memory" \ ); \ - *cmpval = tmp; \ \ return (!res); \ } \ \ static __inline int \ -atomic_fcmpset_##bar##16(volatile uint16_t *p, uint16_t *cmpval, \ - uint16_t newval) \ +atomic_fcmpset_##bar##t(volatile uint##t##_t *p, uint##t##_t *cmpval, \ + uint##t##_t newval) \ { \ - uint16_t tmp; \ - uint16_t _cmpval = *cmpval; \ + uint##t##_t _cmpval, tmp; \ int res; \ \ + _cmpval = *cmpval; \ __asm __volatile( \ - "1: mov %w1, #1 \n" \ - " ld"#a"xrh %w0, [%2] \n" \ - " cmp %w0, %w3 \n" \ - " b.ne 2f \n" \ - " st"#l"xrh %w1, %w4, [%2] \n" \ - "2:" \ + " mov %w1, #1\n" \ + " ld"#a"xr"#s" %"#w"0, [%2]\n" \ + " cmp %"#w"0, %"#w"3\n" \ + " b.ne 1f\n" \ + " st"#l"xr"#s" %w1, %"#w"4, [%2]\n" \ + "1:" \ : "=&r"(tmp), "=&r"(res) \ : "r" (p), "r" (_cmpval), "r" (newval) \ : "cc", "memory" \ @@ -185,450 +139,145 @@ atomic_fcmpset_##bar##16(volatile uint16_t *p, uint16_ *cmpval = tmp; \ \ return (!res); \ -} \ - \ -static __inline int \ -atomic_fcmpset_##bar##32(volatile uint32_t *p, uint32_t *cmpval, \ - uint32_t newval) \ -{ \ - uint32_t tmp; \ - uint32_t _cmpval = *cmpval; \ - int res; \ - \ - __asm __volatile( \ - "1: mov %w1, #1 \n" \ - " ld"#a"xr %w0, [%2] \n" \ - " cmp %w0, %w3 \n" \ - " b.ne 2f \n" \ - " st"#l"xr %w1, %w4, [%2] \n" \ - "2:" \ - : "=&r"(tmp), "=&r"(res) \ - : "r" (p), "r" (_cmpval), "r" (newval) \ - : "cc", "memory" \ - ); \ - *cmpval = tmp; \ - \ - return (!res); \ -} \ - \ -static __inline int \ -atomic_fcmpset_##bar##64(volatile uint64_t *p, uint64_t *cmpval, \ - uint64_t newval) \ -{ \ - uint64_t tmp; \ - uint64_t _cmpval = *cmpval; \ - int res; \ - \ - __asm __volatile( \ - "1: mov %w1, #1 \n" \ - " ld"#a"xr %0, [%2] \n" \ - " cmp %0, %3 \n" \ - " b.ne 2f \n" \ - " st"#l"xr %w1, %4, [%2] \n" \ - "2:" \ - : "=&r"(tmp), "=&r"(res) \ - : "r" (p), "r" (_cmpval), "r" (newval) \ - : "cc", "memory" \ - ); \ - *cmpval = tmp; \ - \ - return (!res); \ } -ATOMIC_FCMPSET( , , ) -ATOMIC_FCMPSET(acq_, a, ) -ATOMIC_FCMPSET(rel_, ,l) +#define _ATOMIC_CMPSET(bar, a, l) \ + _ATOMIC_CMPSET_IMPL(8, w, b, bar, a, l) \ + _ATOMIC_CMPSET_IMPL(16, w, h, bar, a, l) \ + _ATOMIC_CMPSET_IMPL(32, w, , bar, a, l) \ + _ATOMIC_CMPSET_IMPL(64, , , bar, a, l) -#undef ATOMIC_FCMPSET +_ATOMIC_CMPSET( , , ) +_ATOMIC_CMPSET(acq_, a, ) +_ATOMIC_CMPSET(rel_, ,l) -#define ATOMIC_CMPSET(bar, a, l) \ -static __inline int \ -atomic_cmpset_##bar##8(volatile uint8_t *p, uint8_t cmpval, \ - uint8_t newval) \ +#define _ATOMIC_FETCHADD_IMPL(t, w) \ +static __inline uint##t##_t \ +atomic_fetchadd_##t(volatile uint##t##_t *p, uint##t##_t val) \ { \ - uint8_t tmp; \ + uint##t##_t tmp, ret; \ int res; \ \ __asm __volatile( \ - "1: mov %w1, #1 \n" \ - " ld"#a"xrb %w0, [%2] \n" \ - " cmp %w0, %w3 \n" \ - " b.ne 2f \n" \ - " st"#l"xrb %w1, %w4, [%2] \n" \ - " cbnz %w1, 1b \n" \ - "2:" \ - : "=&r"(tmp), "=&r"(res) \ - : "r" (p), "r" (cmpval), "r" (newval) \ - : "cc", "memory" \ + "1: ldxr %"#w"2, [%3]\n" \ + " add %"#w"0, %"#w"2, %"#w"4\n" \ + " stxr %w1, %"#w"0, [%3]\n" \ + " cbnz %w1, 1b\n" \ + : "=&r" (tmp), "=&r" (res), "=&r" (ret) \ + : "r" (p), "r" (val) \ + : "memory" \ ); \ \ - return (!res); \ -} \ - \ -static __inline int \ -atomic_cmpset_##bar##16(volatile uint16_t *p, uint16_t cmpval, \ - uint16_t newval) \ + return (ret); \ +} + +_ATOMIC_FETCHADD_IMPL(32, w) +_ATOMIC_FETCHADD_IMPL(64, ) + +#define _ATOMIC_SWAP_IMPL(t, w, zreg) \ +static __inline uint##t##_t \ +atomic_swap_##t(volatile uint##t##_t *p, uint##t##_t val) \ { \ - uint16_t tmp; \ + uint##t##_t ret; \ int res; \ \ __asm __volatile( \ - "1: mov %w1, #1 \n" \ - " ld"#a"xrh %w0, [%2] \n" \ - " cmp %w0, %w3 \n" \ - " b.ne 2f \n" \ - " st"#l"xrh %w1, %w4, [%2] \n" \ - " cbnz %w1, 1b \n" \ - "2:" \ - : "=&r"(tmp), "=&r"(res) \ - : "r" (p), "r" (cmpval), "r" (newval) \ - : "cc", "memory" \ + "1: ldxr %"#w"1, [%2]\n" \ + " stxr %w0, %"#w"3, [%2]\n" \ + " cbnz %w0, 1b\n" \ + : "=&r" (res), "=&r" (ret) \ + : "r" (p), "r" (val) \ + : "memory" \ ); \ \ - return (!res); \ + return (ret); \ } \ \ -static __inline int \ -atomic_cmpset_##bar##32(volatile uint32_t *p, uint32_t cmpval, \ - uint32_t newval) \ +static __inline uint##t##_t \ +atomic_readandclear_##t(volatile uint##t##_t *p) \ { \ - uint32_t tmp; \ + uint##t##_t ret; \ int res; \ \ __asm __volatile( \ - "1: mov %w1, #1 \n" \ - " ld"#a"xr %w0, [%2] \n" \ - " cmp %w0, %w3 \n" \ - " b.ne 2f \n" \ - " st"#l"xr %w1, %w4, [%2] \n" \ - " cbnz %w1, 1b \n" \ - "2:" \ - : "=&r"(tmp), "=&r"(res) \ - : "r" (p), "r" (cmpval), "r" (newval) \ - : "cc", "memory" \ + "1: ldxr %"#w"1, [%2]\n" \ + " stxr %w0, "#zreg", [%2]\n" \ + " cbnz %w0, 1b\n" \ + : "=&r" (res), "=&r" (ret) \ + : "r" (p) \ + : "memory" \ ); \ \ - return (!res); \ -} \ - \ + return (ret); \ +} + +_ATOMIC_SWAP_IMPL(32, w, wzr) +_ATOMIC_SWAP_IMPL(64, , xzr) + +#define _ATOMIC_TEST_OP_IMPL(t, w, op, asm_op) \ static __inline int \ -atomic_cmpset_##bar##64(volatile uint64_t *p, uint64_t cmpval, \ - uint64_t newval) \ +atomic_testand##op##_##t(volatile uint##t##_t *p, u_int val) \ { \ - uint64_t tmp; \ + uint##t##_t mask, old, tmp; \ int res; \ \ + mask = 1u << (val & 0x1f); \ __asm __volatile( \ - "1: mov %w1, #1 \n" \ - " ld"#a"xr %0, [%2] \n" \ - " cmp %0, %3 \n" \ - " b.ne 2f \n" \ - " st"#l"xr %w1, %4, [%2] \n" \ - " cbnz %w1, 1b \n" \ - "2:" \ - : "=&r"(tmp), "=&r"(res) \ - : "r" (p), "r" (cmpval), "r" (newval) \ - : "cc", "memory" \ + "1: ldxr %"#w"2, [%3]\n" \ + " "#asm_op" %"#w"0, %"#w"2, %"#w"4\n" \ + " stxr %w1, %"#w"0, [%3]\n" \ + " cbnz %w1, 1b\n" \ + : "=&r" (tmp), "=&r" (res), "=&r" (old) \ + : "r" (p), "r" (mask) \ + : "memory" \ ); \ \ - return (!res); \ + return ((old & mask) != 0); \ } -ATOMIC_CMPSET( , , ) -ATOMIC_CMPSET(acq_, a, ) -ATOMIC_CMPSET(rel_, ,l) +#define _ATOMIC_TEST_OP(op, asm_op) \ + _ATOMIC_TEST_OP_IMPL(32, w, op, asm_op) \ + _ATOMIC_TEST_OP_IMPL(64, , op, asm_op) -static __inline uint32_t -atomic_fetchadd_32(volatile uint32_t *p, uint32_t val) -{ - uint32_t tmp, ret; - int res; +_ATOMIC_TEST_OP(clear, bic) +_ATOMIC_TEST_OP(set, orr) - __asm __volatile( - "1: ldxr %w2, [%3] \n" - " add %w0, %w2, %w4 \n" - " stxr %w1, %w0, [%3] \n" - " cbnz %w1, 1b \n" - : "=&r"(tmp), "=&r"(res), "=&r"(ret) - : "r" (p), "r" (val) - : "memory" - ); - - return (ret); +#define _ATOMIC_LOAD_ACQ_IMPL(t, w, s) \ +static __inline uint##t##_t \ +atomic_load_acq_##t(volatile uint##t##_t *p) \ +{ \ + uint##t##_t ret; \ + \ + __asm __volatile( \ + "ldar"#s" %"#w"0, [%1]\n" \ + : "=&r" (ret) \ + : "r" (p) \ + : "memory"); \ + \ + return (ret); \ } -static __inline uint64_t -atomic_fetchadd_64(volatile uint64_t *p, uint64_t val) -{ - uint64_t tmp, ret; - int res; +_ATOMIC_LOAD_ACQ_IMPL(8, w, b) +_ATOMIC_LOAD_ACQ_IMPL(16, w, h) +_ATOMIC_LOAD_ACQ_IMPL(32, w, ) +_ATOMIC_LOAD_ACQ_IMPL(64, , ) - __asm __volatile( - "1: ldxr %2, [%3] \n" - " add %0, %2, %4 \n" - " stxr %w1, %0, [%3] \n" - " cbnz %w1, 1b \n" - : "=&r"(tmp), "=&r"(res), "=&r"(ret) - : "r" (p), "r" (val) - : "memory" - ); - - return (ret); +#define _ATOMIC_STORE_REL_IMPL(t, w, s) \ +static __inline void \ +atomic_store_rel_##t(volatile uint##t##_t *p, uint##t##_t val) \ +{ \ + __asm __volatile( \ + "stlr"#s" %"#w"0, [%1]\n" \ + : \ + : "r" (val), "r" (p) \ + : "memory"); \ } -static __inline uint32_t -atomic_readandclear_32(volatile uint32_t *p) -{ - uint32_t ret; - int res; +_ATOMIC_STORE_REL_IMPL(8, w, b) +_ATOMIC_STORE_REL_IMPL(16, w, h) +_ATOMIC_STORE_REL_IMPL(32, w, ) +_ATOMIC_STORE_REL_IMPL(64, , ) - __asm __volatile( - "1: ldxr %w1, [%2] \n" - " stxr %w0, wzr, [%2] \n" - " cbnz %w0, 1b \n" - : "=&r"(res), "=&r"(ret) - : "r" (p) - : "memory" - ); - - return (ret); -} - -static __inline uint64_t -atomic_readandclear_64(volatile uint64_t *p) -{ - uint64_t ret; - int res; - - __asm __volatile( - "1: ldxr %1, [%2] \n" - " stxr %w0, xzr, [%2] \n" - " cbnz %w0, 1b \n" - : "=&r"(res), "=&r"(ret) - : "r" (p) - : "memory" - ); - - return (ret); -} - -static __inline uint32_t -atomic_swap_32(volatile uint32_t *p, uint32_t val) -{ - uint32_t ret; - int res; - - __asm __volatile( - "1: ldxr %w0, [%2] \n" - " stxr %w1, %w3, [%2] \n" - " cbnz %w1, 1b \n" - : "=&r"(ret), "=&r"(res) - : "r" (p), "r" (val) - : "memory" - ); - - return (ret); -} - -static __inline uint64_t -atomic_swap_64(volatile uint64_t *p, uint64_t val) -{ - uint64_t ret; - int res; - - __asm __volatile( - "1: ldxr %0, [%2] \n" - " stxr %w1, %3, [%2] \n" - " cbnz %w1, 1b \n" - : "=&r"(ret), "=&r"(res) - : "r" (p), "r" (val) - : "memory" - ); - - return (ret); -} - -static __inline uint8_t -atomic_load_acq_8(volatile uint8_t *p) -{ - uint8_t ret; - - __asm __volatile( - "ldarb %w0, [%1] \n" - : "=&r" (ret) - : "r" (p) - : "memory"); - - return (ret); -} - -static __inline uint16_t -atomic_load_acq_16(volatile uint16_t *p) -{ - uint16_t ret; - - __asm __volatile( - "ldarh %w0, [%1] \n" - : "=&r" (ret) - : "r" (p) - : "memory"); - - return (ret); -} - -static __inline uint32_t -atomic_load_acq_32(volatile uint32_t *p) -{ - uint32_t ret; - - __asm __volatile( - "ldar %w0, [%1] \n" - : "=&r" (ret) - : "r" (p) - : "memory"); - - return (ret); -} - -static __inline uint64_t -atomic_load_acq_64(volatile uint64_t *p) -{ - uint64_t ret; - - __asm __volatile( - "ldar %0, [%1] \n" - : "=&r" (ret) - : "r" (p) - : "memory"); - - return (ret); -} - -static __inline void -atomic_store_rel_8(volatile uint8_t *p, uint8_t val) -{ - - __asm __volatile( - "stlrb %w0, [%1] \n" - : - : "r" (val), "r" (p) - : "memory"); -} - -static __inline void -atomic_store_rel_16(volatile uint16_t *p, uint16_t val) -{ - - __asm __volatile( - "stlrh %w0, [%1] \n" - : - : "r" (val), "r" (p) - : "memory"); -} - -static __inline void -atomic_store_rel_32(volatile uint32_t *p, uint32_t val) -{ - - __asm __volatile( - "stlr %w0, [%1] \n" - : - : "r" (val), "r" (p) - : "memory"); -} - -static __inline void -atomic_store_rel_64(volatile uint64_t *p, uint64_t val) -{ - - __asm __volatile( - "stlr %0, [%1] \n" - : - : "r" (val), "r" (p) - : "memory"); -} - -static __inline int -atomic_testandclear_32(volatile uint32_t *p, u_int val) -{ - uint32_t mask, old, tmp; - int res; - - mask = 1u << (val & 0x1f); - __asm __volatile( - "1: ldxr %w2, [%3] \n" - " bic %w0, %w2, %w4 \n" - " stxr %w1, %w0, [%3] \n" - " cbnz %w1, 1b \n" - : "=&r"(tmp), "=&r"(res), "=&r"(old) - : "r" (p), "r" (mask) - : "memory" - ); - - return ((old & mask) != 0); -} - -static __inline int -atomic_testandclear_64(volatile uint64_t *p, u_int val) -{ - uint64_t mask, old, tmp; - int res; - - mask = 1ul << (val & 0x1f); - __asm __volatile( - "1: ldxr %2, [%3] \n" - " bic %0, %2, %4 \n" - " stxr %w1, %0, [%3] \n" - " cbnz %w1, 1b \n" - : "=&r"(tmp), "=&r"(res), "=&r"(old) - : "r" (p), "r" (mask) - : "memory" - ); - - return ((old & mask) != 0); -} - -static __inline int -atomic_testandset_32(volatile uint32_t *p, u_int val) -{ - uint32_t mask, old, tmp; - int res; - - mask = 1u << (val & 0x1f); - __asm __volatile( - "1: ldxr %w2, [%3] \n" - " orr %w0, %w2, %w4 \n" - " stxr %w1, %w0, [%3] \n" - " cbnz %w1, 1b \n" - : "=&r"(tmp), "=&r"(res), "=&r"(old) - : "r" (p), "r" (mask) - : "memory" - ); - - return ((old & mask) != 0); -} - -static __inline int -atomic_testandset_64(volatile uint64_t *p, u_int val) -{ - uint64_t mask, old, tmp; - int res; - - mask = 1ul << (val & 0x1f); - __asm __volatile( - "1: ldxr %2, [%3] \n" - " orr %0, %2, %4 \n" - " stxr %w1, %0, [%3] \n" - " cbnz %w1, 1b \n" - : "=&r"(tmp), "=&r"(res), "=&r"(old) - : "r" (p), "r" (mask) - : "memory" - ); - - return ((old & mask) != 0); -} - - #define atomic_add_int atomic_add_32 #define atomic_fcmpset_int atomic_fcmpset_32 #define atomic_clear_int atomic_clear_32 @@ -742,4 +391,3 @@ atomic_thread_fence_seq_cst(void) #endif /* KCSAN && !KCSAN_RUNTIME */ #endif /* _MACHINE_ATOMIC_H_ */ - From owner-svn-src-all@freebsd.org Mon Feb 3 18:23:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E74EF22A48B; Mon, 3 Feb 2020 18:23:14 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BGR65vSwz3NtK; Mon, 3 Feb 2020 18:23:14 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C5D1F4F55; Mon, 3 Feb 2020 18:23:14 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 013INElk024703; Mon, 3 Feb 2020 18:23:14 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 013INEWY024702; Mon, 3 Feb 2020 18:23:14 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202002031823.013INEWY024702@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 3 Feb 2020 18:23:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357458 - head/sys/arm64/include X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/arm64/include X-SVN-Commit-Revision: 357458 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 18:23:15 -0000 Author: markj Date: Mon Feb 3 18:23:14 2020 New Revision: 357458 URL: https://svnweb.freebsd.org/changeset/base/357458 Log: Add wrappers for arm64 atomics. Add a _llsc suffix for the existing LL/SC-based implementations and add trivial wrappers. This is in preparation for supporting LSE-based atomic(9) implementations. No functional change intended. Reviewed by: andrew, kib MFC after: 1 month Sponsored by: The FreeBSD Foundation, Amazon (hardware) Differential Revision: https://reviews.freebsd.org/D23323 Modified: head/sys/arm64/include/atomic.h Modified: head/sys/arm64/include/atomic.h ============================================================================== --- head/sys/arm64/include/atomic.h Mon Feb 3 18:22:59 2020 (r357457) +++ head/sys/arm64/include/atomic.h Mon Feb 3 18:23:14 2020 (r357458) @@ -59,9 +59,12 @@ #include -#define _ATOMIC_OP_IMPL(t, w, s, op, asm_op, bar, a, l) \ +#define _ATOMIC_OP_PROTO(t, op, bar, flav) \ static __inline void \ -atomic_##op##_##bar##t(volatile uint##t##_t *p, uint##t##_t val) \ +atomic_##op##_##bar##t##flav(volatile uint##t##_t *p, uint##t##_t val) + +#define _ATOMIC_OP_IMPL(t, w, s, op, asm_op, bar, a, l) \ +_ATOMIC_OP_PROTO(t, op, bar, _llsc) \ { \ uint##t##_t tmp; \ int res; \ @@ -75,6 +78,11 @@ atomic_##op##_##bar##t(volatile uint##t##_t *p, uint## : "r" (p), "r" (val) \ : "memory" \ ); \ +} \ + \ +_ATOMIC_OP_PROTO(t, op, bar, ) \ +{ \ + atomic_##op##_##bar##t##_llsc(p, val); \ } #define __ATOMIC_OP(op, asm_op, bar, a, l) \ @@ -93,10 +101,18 @@ _ATOMIC_OP(clear, bic) _ATOMIC_OP(set, orr) _ATOMIC_OP(subtract, sub) -#define _ATOMIC_CMPSET_IMPL(t, w, s, bar, a, l) \ +#define _ATOMIC_CMPSET_PROTO(t, bar, flav) \ static __inline int \ -atomic_cmpset_##bar##t(volatile uint##t##_t *p, uint##t##_t cmpval, \ - uint##t##_t newval) \ +atomic_cmpset_##bar##t##flav(volatile uint##t##_t *p, \ + uint##t##_t cmpval, uint##t##_t newval) + +#define _ATOMIC_FCMPSET_PROTO(t, bar, flav) \ +static __inline int \ +atomic_fcmpset_##bar##t##flav(volatile uint##t##_t *p, \ + uint##t##_t *cmpval, uint##t##_t newval) + +#define _ATOMIC_CMPSET_IMPL(t, w, s, bar, a, l) \ +_ATOMIC_CMPSET_PROTO(t, bar, _llsc) \ { \ uint##t##_t tmp; \ int res; \ @@ -117,10 +133,13 @@ atomic_cmpset_##bar##t(volatile uint##t##_t *p, uint## return (!res); \ } \ \ -static __inline int \ -atomic_fcmpset_##bar##t(volatile uint##t##_t *p, uint##t##_t *cmpval, \ - uint##t##_t newval) \ +_ATOMIC_CMPSET_PROTO(t, bar, ) \ { \ + return (atomic_cmpset_##bar##t##_llsc(p, cmpval, newval)); \ +} \ + \ +_ATOMIC_FCMPSET_PROTO(t, bar, _llsc) \ +{ \ uint##t##_t _cmpval, tmp; \ int res; \ \ @@ -139,6 +158,11 @@ atomic_fcmpset_##bar##t(volatile uint##t##_t *p, uint# *cmpval = tmp; \ \ return (!res); \ +} \ + \ +_ATOMIC_FCMPSET_PROTO(t, bar, ) \ +{ \ + return (atomic_fcmpset_##bar##t##_llsc(p, cmpval, newval)); \ } #define _ATOMIC_CMPSET(bar, a, l) \ @@ -151,9 +175,12 @@ _ATOMIC_CMPSET( , , ) _ATOMIC_CMPSET(acq_, a, ) _ATOMIC_CMPSET(rel_, ,l) -#define _ATOMIC_FETCHADD_IMPL(t, w) \ +#define _ATOMIC_FETCHADD_PROTO(t, flav) \ static __inline uint##t##_t \ -atomic_fetchadd_##t(volatile uint##t##_t *p, uint##t##_t val) \ +atomic_fetchadd_##t##flav(volatile uint##t##_t *p, uint##t##_t val) + +#define _ATOMIC_FETCHADD_IMPL(t, w) \ +_ATOMIC_FETCHADD_PROTO(t, _llsc) \ { \ uint##t##_t tmp, ret; \ int res; \ @@ -169,14 +196,26 @@ atomic_fetchadd_##t(volatile uint##t##_t *p, uint##t## ); \ \ return (ret); \ +} \ + \ +_ATOMIC_FETCHADD_PROTO(t, ) \ +{ \ + return (atomic_fetchadd_##t##_llsc(p, val)); \ } _ATOMIC_FETCHADD_IMPL(32, w) _ATOMIC_FETCHADD_IMPL(64, ) -#define _ATOMIC_SWAP_IMPL(t, w, zreg) \ +#define _ATOMIC_SWAP_PROTO(t, flav) \ static __inline uint##t##_t \ -atomic_swap_##t(volatile uint##t##_t *p, uint##t##_t val) \ +atomic_swap_##t##flav(volatile uint##t##_t *p, uint##t##_t val) + +#define _ATOMIC_READANDCLEAR_PROTO(t, flav) \ +static __inline uint##t##_t \ +atomic_readandclear_##t##flav(volatile uint##t##_t *p) + +#define _ATOMIC_SWAP_IMPL(t, w, zreg) \ +_ATOMIC_SWAP_PROTO(t, _llsc) \ { \ uint##t##_t ret; \ int res; \ @@ -193,9 +232,13 @@ atomic_swap_##t(volatile uint##t##_t *p, uint##t##_t v return (ret); \ } \ \ -static __inline uint##t##_t \ -atomic_readandclear_##t(volatile uint##t##_t *p) \ +_ATOMIC_SWAP_PROTO(t, ) \ { \ + return (atomic_swap_##t##_llsc(p, val)); \ +} \ + \ +_ATOMIC_READANDCLEAR_PROTO(t, _llsc) \ +{ \ uint##t##_t ret; \ int res; \ \ @@ -209,14 +252,22 @@ atomic_readandclear_##t(volatile uint##t##_t *p) \ ); \ \ return (ret); \ +} \ + \ +_ATOMIC_READANDCLEAR_PROTO(t, ) \ +{ \ + return (atomic_readandclear_##t##_llsc(p)); \ } _ATOMIC_SWAP_IMPL(32, w, wzr) _ATOMIC_SWAP_IMPL(64, , xzr) -#define _ATOMIC_TEST_OP_IMPL(t, w, op, asm_op) \ +#define _ATOMIC_TEST_OP_PROTO(t, op, flav) \ static __inline int \ -atomic_testand##op##_##t(volatile uint##t##_t *p, u_int val) \ +atomic_testand##op##_##t##flav(volatile uint##t##_t *p, u_int val) + +#define _ATOMIC_TEST_OP_IMPL(t, w, op, asm_op) \ +_ATOMIC_TEST_OP_PROTO(t, op, _llsc) \ { \ uint##t##_t mask, old, tmp; \ int res; \ @@ -233,6 +284,11 @@ atomic_testand##op##_##t(volatile uint##t##_t *p, u_in ); \ \ return ((old & mask) != 0); \ +} \ + \ +_ATOMIC_TEST_OP_PROTO(t, op, ) \ +{ \ + return (atomic_testand##op##_##t##_llsc(p, val)); \ } #define _ATOMIC_TEST_OP(op, asm_op) \ @@ -389,5 +445,4 @@ atomic_thread_fence_seq_cst(void) } #endif /* KCSAN && !KCSAN_RUNTIME */ - #endif /* _MACHINE_ATOMIC_H_ */ From owner-svn-src-all@freebsd.org Mon Feb 3 18:23:35 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 99C6622A51E; Mon, 3 Feb 2020 18:23:35 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BGRW3d7Tz3P3Q; Mon, 3 Feb 2020 18:23:35 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 77A6A4F74; Mon, 3 Feb 2020 18:23:35 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 013INZiq024762; Mon, 3 Feb 2020 18:23:35 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 013INZD5024761; Mon, 3 Feb 2020 18:23:35 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202002031823.013INZD5024761@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 3 Feb 2020 18:23:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357459 - head/sys/arm64/include X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/arm64/include X-SVN-Commit-Revision: 357459 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 18:23:35 -0000 Author: markj Date: Mon Feb 3 18:23:35 2020 New Revision: 357459 URL: https://svnweb.freebsd.org/changeset/base/357459 Log: Add LSE-based atomic(9) implementations. These make use of the cas*, ld* and swp instructions added in ARMv8.1. Testing shows them to be significantly more performant than LL/SC-based implementations. No functional change here since the wrappers still unconditionally select the _llsc variants. Reviewed by: andrew, kib MFC after: 1 month Submitted by: Ali Saidi (original version) Differential Revision: https://reviews.freebsd.org/D23324 Modified: head/sys/arm64/include/atomic.h Modified: head/sys/arm64/include/atomic.h ============================================================================== --- head/sys/arm64/include/atomic.h Mon Feb 3 18:23:14 2020 (r357458) +++ head/sys/arm64/include/atomic.h Mon Feb 3 18:23:35 2020 (r357459) @@ -63,15 +63,16 @@ static __inline void \ atomic_##op##_##bar##t##flav(volatile uint##t##_t *p, uint##t##_t val) -#define _ATOMIC_OP_IMPL(t, w, s, op, asm_op, bar, a, l) \ +#define _ATOMIC_OP_IMPL(t, w, s, op, llsc_asm_op, lse_asm_op, pre, bar, a, l) \ _ATOMIC_OP_PROTO(t, op, bar, _llsc) \ { \ uint##t##_t tmp; \ int res; \ \ + pre; \ __asm __volatile( \ "1: ld"#a"xr"#s" %"#w"0, [%2]\n" \ - " "#asm_op" %"#w"0, %"#w"0, %"#w"3\n" \ + " "#llsc_asm_op" %"#w"0, %"#w"0, %"#w"3\n" \ " st"#l"xr"#s" %w1, %"#w"0, [%2]\n" \ " cbnz %w1, 1b\n" \ : "=&r"(tmp), "=&r"(res) \ @@ -80,26 +81,45 @@ _ATOMIC_OP_PROTO(t, op, bar, _llsc) \ ); \ } \ \ +_ATOMIC_OP_PROTO(t, op, bar, _lse) \ +{ \ + uint##t##_t tmp; \ + \ + pre; \ + __asm __volatile( \ + ".arch_extension lse\n" \ + "ld"#lse_asm_op#a#l#s" %"#w"2, %"#w"0, [%1]\n" \ + ".arch_extension nolse\n" \ + : "=r" (tmp) \ + : "r" (p), "r" (val) \ + : "memory" \ + ); \ +} \ + \ _ATOMIC_OP_PROTO(t, op, bar, ) \ { \ atomic_##op##_##bar##t##_llsc(p, val); \ } -#define __ATOMIC_OP(op, asm_op, bar, a, l) \ - _ATOMIC_OP_IMPL(8, w, b, op, asm_op, bar, a, l) \ - _ATOMIC_OP_IMPL(16, w, h, op, asm_op, bar, a, l) \ - _ATOMIC_OP_IMPL(32, w, , op, asm_op, bar, a, l) \ - _ATOMIC_OP_IMPL(64, , , op, asm_op, bar, a, l) +#define __ATOMIC_OP(op, llsc_asm_op, lse_asm_op, pre, bar, a, l) \ + _ATOMIC_OP_IMPL(8, w, b, op, llsc_asm_op, lse_asm_op, pre, \ + bar, a, l) \ + _ATOMIC_OP_IMPL(16, w, h, op, llsc_asm_op, lse_asm_op, pre, \ + bar, a, l) \ + _ATOMIC_OP_IMPL(32, w, , op, llsc_asm_op, lse_asm_op, pre, \ + bar, a, l) \ + _ATOMIC_OP_IMPL(64, , , op, llsc_asm_op, lse_asm_op, pre, \ + bar, a, l) -#define _ATOMIC_OP(op, asm_op) \ - __ATOMIC_OP(op, asm_op, , , ) \ - __ATOMIC_OP(op, asm_op, acq_, a, ) \ - __ATOMIC_OP(op, asm_op, rel_, , l) +#define _ATOMIC_OP(op, llsc_asm_op, lse_asm_op, pre) \ + __ATOMIC_OP(op, llsc_asm_op, lse_asm_op, pre, , , ) \ + __ATOMIC_OP(op, llsc_asm_op, lse_asm_op, pre, acq_, a, ) \ + __ATOMIC_OP(op, llsc_asm_op, lse_asm_op, pre, rel_, , l) -_ATOMIC_OP(add, add) -_ATOMIC_OP(clear, bic) -_ATOMIC_OP(set, orr) -_ATOMIC_OP(subtract, sub) +_ATOMIC_OP(add, add, add, ) +_ATOMIC_OP(clear, bic, clr, ) +_ATOMIC_OP(set, orr, set, ) +_ATOMIC_OP(subtract, add, add, val = -val) #define _ATOMIC_CMPSET_PROTO(t, bar, flav) \ static __inline int \ @@ -133,6 +153,26 @@ _ATOMIC_CMPSET_PROTO(t, bar, _llsc) \ return (!res); \ } \ \ +_ATOMIC_CMPSET_PROTO(t, bar, _lse) \ +{ \ + uint##t##_t oldval; \ + int res; \ + \ + oldval = cmpval; \ + __asm __volatile( \ + ".arch_extension lse\n" \ + "cas"#a#l#s" %"#w"1, %"#w"4, [%3]\n" \ + "cmp %"#w"1, %"#w"2\n" \ + "cset %w0, eq\n" \ + ".arch_extension nolse\n" \ + : "=r" (res), "+&r" (cmpval) \ + : "r" (oldval), "r" (p), "r" (newval) \ + : "cc", "memory" \ + ); \ + \ + return (res); \ +} \ + \ _ATOMIC_CMPSET_PROTO(t, bar, ) \ { \ return (atomic_cmpset_##bar##t##_llsc(p, cmpval, newval)); \ @@ -160,6 +200,27 @@ _ATOMIC_FCMPSET_PROTO(t, bar, _llsc) \ return (!res); \ } \ \ +_ATOMIC_FCMPSET_PROTO(t, bar, _lse) \ +{ \ + uint##t##_t _cmpval, tmp; \ + int res; \ + \ + _cmpval = tmp = *cmpval; \ + __asm __volatile( \ + ".arch_extension lse\n" \ + "cas"#a#l#s" %"#w"1, %"#w"4, [%3]\n" \ + "cmp %"#w"1, %"#w"2\n" \ + "cset %w0, eq\n" \ + ".arch_extension nolse\n" \ + : "=r" (res), "+&r" (tmp) \ + : "r" (_cmpval), "r" (p), "r" (newval) \ + : "cc", "memory" \ + ); \ + *cmpval = tmp; \ + \ + return (res); \ +} \ + \ _ATOMIC_FCMPSET_PROTO(t, bar, ) \ { \ return (atomic_fcmpset_##bar##t##_llsc(p, cmpval, newval)); \ @@ -182,7 +243,7 @@ atomic_fetchadd_##t##flav(volatile uint##t##_t *p, uin #define _ATOMIC_FETCHADD_IMPL(t, w) \ _ATOMIC_FETCHADD_PROTO(t, _llsc) \ { \ - uint##t##_t tmp, ret; \ + uint##t##_t ret, tmp; \ int res; \ \ __asm __volatile( \ @@ -198,6 +259,22 @@ _ATOMIC_FETCHADD_PROTO(t, _llsc) \ return (ret); \ } \ \ +_ATOMIC_FETCHADD_PROTO(t, _lse) \ +{ \ + uint##t##_t ret; \ + \ + __asm __volatile( \ + ".arch_extension lse\n" \ + "ldadd %"#w"2, %"#w"0, [%1]\n" \ + ".arch_extension nolse\n" \ + : "=r" (ret) \ + : "r" (p), "r" (val) \ + : "memory" \ + ); \ + \ + return (ret); \ +} \ + \ _ATOMIC_FETCHADD_PROTO(t, ) \ { \ return (atomic_fetchadd_##t##_llsc(p, val)); \ @@ -232,6 +309,22 @@ _ATOMIC_SWAP_PROTO(t, _llsc) \ return (ret); \ } \ \ +_ATOMIC_SWAP_PROTO(t, _lse) \ +{ \ + uint##t##_t ret; \ + \ + __asm __volatile( \ + ".arch_extension lse\n" \ + "swp %"#w"2, %"#w"0, [%1]\n" \ + ".arch_extension nolse\n" \ + : "=r" (ret) \ + : "r" (p), "r" (val) \ + : "memory" \ + ); \ + \ + return (ret); \ +} \ + \ _ATOMIC_SWAP_PROTO(t, ) \ { \ return (atomic_swap_##t##_llsc(p, val)); \ @@ -254,6 +347,11 @@ _ATOMIC_READANDCLEAR_PROTO(t, _llsc) \ return (ret); \ } \ \ +_ATOMIC_READANDCLEAR_PROTO(t, _lse) \ +{ \ + return (atomic_swap_##t##_lse(p, 0)); \ +} \ + \ _ATOMIC_READANDCLEAR_PROTO(t, ) \ { \ return (atomic_readandclear_##t##_llsc(p)); \ @@ -266,7 +364,7 @@ _ATOMIC_SWAP_IMPL(64, , xzr) static __inline int \ atomic_testand##op##_##t##flav(volatile uint##t##_t *p, u_int val) -#define _ATOMIC_TEST_OP_IMPL(t, w, op, asm_op) \ +#define _ATOMIC_TEST_OP_IMPL(t, w, op, llsc_asm_op, lse_asm_op) \ _ATOMIC_TEST_OP_PROTO(t, op, _llsc) \ { \ uint##t##_t mask, old, tmp; \ @@ -275,7 +373,7 @@ _ATOMIC_TEST_OP_PROTO(t, op, _llsc) \ mask = 1u << (val & 0x1f); \ __asm __volatile( \ "1: ldxr %"#w"2, [%3]\n" \ - " "#asm_op" %"#w"0, %"#w"2, %"#w"4\n" \ + " "#llsc_asm_op" %"#w"0, %"#w"2, %"#w"4\n" \ " stxr %w1, %"#w"0, [%3]\n" \ " cbnz %w1, 1b\n" \ : "=&r" (tmp), "=&r" (res), "=&r" (old) \ @@ -286,17 +384,34 @@ _ATOMIC_TEST_OP_PROTO(t, op, _llsc) \ return ((old & mask) != 0); \ } \ \ +_ATOMIC_TEST_OP_PROTO(t, op, _lse) \ +{ \ + uint##t##_t mask, old; \ + \ + mask = 1u << (val & 0x1f); \ + __asm __volatile( \ + ".arch_extension lse\n" \ + "ld"#lse_asm_op" %"#w"2, %"#w"0, [%1]\n" \ + ".arch_extension nolse\n" \ + : "=r" (old) \ + : "r" (p), "r" (mask) \ + : "memory" \ + ); \ + \ + return ((old & mask) != 0); \ +} \ + \ _ATOMIC_TEST_OP_PROTO(t, op, ) \ { \ return (atomic_testand##op##_##t##_llsc(p, val)); \ } -#define _ATOMIC_TEST_OP(op, asm_op) \ - _ATOMIC_TEST_OP_IMPL(32, w, op, asm_op) \ - _ATOMIC_TEST_OP_IMPL(64, , op, asm_op) +#define _ATOMIC_TEST_OP(op, llsc_asm_op, lse_asm_op) \ + _ATOMIC_TEST_OP_IMPL(32, w, op, llsc_asm_op, lse_asm_op) \ + _ATOMIC_TEST_OP_IMPL(64, , op, llsc_asm_op, lse_asm_op) -_ATOMIC_TEST_OP(clear, bic) -_ATOMIC_TEST_OP(set, orr) +_ATOMIC_TEST_OP(clear, bic, clr) +_ATOMIC_TEST_OP(set, orr, set) #define _ATOMIC_LOAD_ACQ_IMPL(t, w, s) \ static __inline uint##t##_t \ From owner-svn-src-all@freebsd.org Mon Feb 3 18:23:51 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C4E9B22A590; Mon, 3 Feb 2020 18:23:51 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BGRq4t1yz3PBS; Mon, 3 Feb 2020 18:23:51 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A281F4F84; Mon, 3 Feb 2020 18:23:51 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 013INphX024818; Mon, 3 Feb 2020 18:23:51 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 013INpAj024816; Mon, 3 Feb 2020 18:23:51 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202002031823.013INpAj024816@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 3 Feb 2020 18:23:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357460 - in head/sys: arm64/arm64 arm64/include conf X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: arm64/arm64 arm64/include conf X-SVN-Commit-Revision: 357460 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 18:23:51 -0000 Author: markj Date: Mon Feb 3 18:23:50 2020 New Revision: 357460 URL: https://svnweb.freebsd.org/changeset/base/357460 Log: Dynamically select LSE-based atomic(9)s on arm64. Once all CPUs are online, determine if they all support LSE atomics and set lse_supported to indicate this. For now the atomic(9) implementations are still always inlined, though it would be preferable to create out-of-line functions to avoid text bloat. This was not done here since big.little systems exist in which some CPUs implement LSE while others do not, and ifunc resolution must occur well before this scenario can be detected. It does seem unlikely that FreeBSD will ever run on such platforms, however, so converting atomic(9) to use ifuncs is probably a good next step. Add a LSE_ATOMICS arm64 kernel configuration option to unconditionally select LSE-based atomic(9) implementations when the target system is known. Reviewed by: andrew, kib MFC after: 1 month Sponsored by: The FreeBSD Foundation, Amazon (hardware) Differential Revision: https://reviews.freebsd.org/D23325 Modified: head/sys/arm64/arm64/identcpu.c head/sys/arm64/include/atomic.h head/sys/conf/options.arm64 Modified: head/sys/arm64/arm64/identcpu.c ============================================================================== --- head/sys/arm64/arm64/identcpu.c Mon Feb 3 18:23:35 2020 (r357459) +++ head/sys/arm64/arm64/identcpu.c Mon Feb 3 18:23:50 2020 (r357460) @@ -114,8 +114,8 @@ struct cpu_desc { uint64_t id_aa64pfr1; }; -struct cpu_desc cpu_desc[MAXCPU]; -struct cpu_desc user_cpu_desc; +static struct cpu_desc cpu_desc[MAXCPU]; +static struct cpu_desc user_cpu_desc; static u_int cpu_print_regs; #define PRINT_ID_AA64_AFR0 0x00000001 #define PRINT_ID_AA64_AFR1 0x00000002 @@ -961,6 +961,7 @@ update_user_regs(u_int cpu) /* HWCAP */ extern u_long elf_hwcap; +bool __read_frequently lse_supported = false; static void identify_cpu_sysinit(void *dummy __unused) @@ -975,7 +976,6 @@ identify_cpu_sysinit(void *dummy __unused) ID_AA64PFR0_FP_NONE | ID_AA64PFR0_EL1_64 | ID_AA64PFR0_EL0_64; user_cpu_desc.id_aa64dfr0 = ID_AA64DFR0_DebugVer_8; - CPU_FOREACH(cpu) { print_cpu_features(cpu); hwcap = parse_cpu_features_hwcap(cpu); @@ -985,6 +985,16 @@ identify_cpu_sysinit(void *dummy __unused) elf_hwcap &= hwcap; update_user_regs(cpu); } + + if ((elf_hwcap & HWCAP_ATOMICS) != 0) { + lse_supported = true; + if (bootverbose) + printf("Enabling LSE atomics in the kernel\n"); + } +#ifdef LSE_ATOMICS + if (!lse_supported) + panic("CPU does not support LSE atomic instructions"); +#endif install_undef_handler(true, user_mrs_handler); } Modified: head/sys/arm64/include/atomic.h ============================================================================== --- head/sys/arm64/include/atomic.h Mon Feb 3 18:23:35 2020 (r357459) +++ head/sys/arm64/include/atomic.h Mon Feb 3 18:23:50 2020 (r357460) @@ -59,6 +59,18 @@ #include +#ifdef _KERNEL +extern bool lse_supported; + +#ifdef LSE_ATOMICS +#define _ATOMIC_LSE_SUPPORTED 1 +#else +#define _ATOMIC_LSE_SUPPORTED lse_supported +#endif +#else +#define _ATOMIC_LSE_SUPPORTED 0 +#endif + #define _ATOMIC_OP_PROTO(t, op, bar, flav) \ static __inline void \ atomic_##op##_##bar##t##flav(volatile uint##t##_t *p, uint##t##_t val) @@ -98,7 +110,10 @@ _ATOMIC_OP_PROTO(t, op, bar, _lse) \ \ _ATOMIC_OP_PROTO(t, op, bar, ) \ { \ - atomic_##op##_##bar##t##_llsc(p, val); \ + if (_ATOMIC_LSE_SUPPORTED) \ + atomic_##op##_##bar##t##_lse(p, val); \ + else \ + atomic_##op##_##bar##t##_llsc(p, val); \ } #define __ATOMIC_OP(op, llsc_asm_op, lse_asm_op, pre, bar, a, l) \ @@ -175,7 +190,12 @@ _ATOMIC_CMPSET_PROTO(t, bar, _lse) \ \ _ATOMIC_CMPSET_PROTO(t, bar, ) \ { \ - return (atomic_cmpset_##bar##t##_llsc(p, cmpval, newval)); \ + if (_ATOMIC_LSE_SUPPORTED) \ + return (atomic_cmpset_##bar##t##_lse(p, cmpval, \ + newval)); \ + else \ + return (atomic_cmpset_##bar##t##_llsc(p, cmpval, \ + newval)); \ } \ \ _ATOMIC_FCMPSET_PROTO(t, bar, _llsc) \ @@ -223,7 +243,12 @@ _ATOMIC_FCMPSET_PROTO(t, bar, _lse) \ \ _ATOMIC_FCMPSET_PROTO(t, bar, ) \ { \ - return (atomic_fcmpset_##bar##t##_llsc(p, cmpval, newval)); \ + if (_ATOMIC_LSE_SUPPORTED) \ + return (atomic_fcmpset_##bar##t##_lse(p, cmpval, \ + newval)); \ + else \ + return (atomic_fcmpset_##bar##t##_llsc(p, cmpval, \ + newval)); \ } #define _ATOMIC_CMPSET(bar, a, l) \ @@ -277,7 +302,10 @@ _ATOMIC_FETCHADD_PROTO(t, _lse) \ \ _ATOMIC_FETCHADD_PROTO(t, ) \ { \ - return (atomic_fetchadd_##t##_llsc(p, val)); \ + if (_ATOMIC_LSE_SUPPORTED) \ + return (atomic_fetchadd_##t##_lse(p, val)); \ + else \ + return (atomic_fetchadd_##t##_llsc(p, val)); \ } _ATOMIC_FETCHADD_IMPL(32, w) @@ -327,7 +355,10 @@ _ATOMIC_SWAP_PROTO(t, _lse) \ \ _ATOMIC_SWAP_PROTO(t, ) \ { \ - return (atomic_swap_##t##_llsc(p, val)); \ + if (_ATOMIC_LSE_SUPPORTED) \ + return (atomic_swap_##t##_lse(p, val)); \ + else \ + return (atomic_swap_##t##_llsc(p, val)); \ } \ \ _ATOMIC_READANDCLEAR_PROTO(t, _llsc) \ @@ -354,7 +385,10 @@ _ATOMIC_READANDCLEAR_PROTO(t, _lse) \ \ _ATOMIC_READANDCLEAR_PROTO(t, ) \ { \ - return (atomic_readandclear_##t##_llsc(p)); \ + if (_ATOMIC_LSE_SUPPORTED) \ + return (atomic_readandclear_##t##_lse(p)); \ + else \ + return (atomic_readandclear_##t##_llsc(p)); \ } _ATOMIC_SWAP_IMPL(32, w, wzr) @@ -403,7 +437,10 @@ _ATOMIC_TEST_OP_PROTO(t, op, _lse) \ \ _ATOMIC_TEST_OP_PROTO(t, op, ) \ { \ - return (atomic_testand##op##_##t##_llsc(p, val)); \ + if (_ATOMIC_LSE_SUPPORTED) \ + return (atomic_testand##op##_##t##_lse(p, val)); \ + else \ + return (atomic_testand##op##_##t##_llsc(p, val)); \ } #define _ATOMIC_TEST_OP(op, llsc_asm_op, lse_asm_op) \ Modified: head/sys/conf/options.arm64 ============================================================================== --- head/sys/conf/options.arm64 Mon Feb 3 18:23:35 2020 (r357459) +++ head/sys/conf/options.arm64 Mon Feb 3 18:23:50 2020 (r357460) @@ -7,6 +7,7 @@ SOCDEV_VA opt_global.h THUNDERX_PASS_1_1_ERRATA opt_global.h VFP opt_global.h LINUX_BOOT_ABI opt_global.h +LSE_ATOMICS opt_global.h # Binary compatibility COMPAT_FREEBSD32 opt_global.h From owner-svn-src-all@freebsd.org Mon Feb 3 18:59:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F22A522B009; Mon, 3 Feb 2020 18:59:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BHDW6Clmz3Qm2; Mon, 3 Feb 2020 18:59:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D0BB75534; Mon, 3 Feb 2020 18:59:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 013Ix7dC042806; Mon, 3 Feb 2020 18:59:07 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 013Ix7HB042805; Mon, 3 Feb 2020 18:59:07 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202002031859.013Ix7HB042805@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 3 Feb 2020 18:59:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357461 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 357461 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 18:59:08 -0000 Author: kevans Date: Mon Feb 3 18:59:07 2020 New Revision: 357461 URL: https://svnweb.freebsd.org/changeset/base/357461 Log: namei: preserve errors from fget_cap_locked Most notably, we want to make sure we don't clobber any capabilities-related errors. This is a regression from r357412 (O_SEARCH) that was picked up by the capsicum tests. PR: 243839 Reviewed by: kib (committed form recommended by) Tested by: lwhsu Differential Revision: https://reviews.freebsd.org/D23479 Modified: head/sys/kern/vfs_lookup.c Modified: head/sys/kern/vfs_lookup.c ============================================================================== --- head/sys/kern/vfs_lookup.c Mon Feb 3 18:23:50 2020 (r357460) +++ head/sys/kern/vfs_lookup.c Mon Feb 3 18:59:07 2020 (r357461) @@ -452,8 +452,15 @@ namei(struct nameidata *ndp) */ error = fget_cap_locked(fdp, ndp->ni_dirfd, &rights, &dfp, &ndp->ni_filecaps); - if (error != 0 || dfp->f_ops == &badfileops || - dfp->f_vnode == NULL) { + if (error != 0) { + /* + * Preserve the error; it should either be EBADF + * or capability-related, both of which can be + * safely returned to the caller. + */ + } else if (dfp->f_ops == &badfileops) { + error = EBADF; + } else if (dfp->f_vnode == NULL) { error = ENOTDIR; } else { dp = dfp->f_vnode; From owner-svn-src-all@freebsd.org Mon Feb 3 19:08:36 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1050522B445; Mon, 3 Feb 2020 19:08:36 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BHRR6jlNz3RL5; Mon, 3 Feb 2020 19:08:35 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DFE5F5719; Mon, 3 Feb 2020 19:08:35 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 013J8ZlY049049; Mon, 3 Feb 2020 19:08:35 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 013J8ZvF049048; Mon, 3 Feb 2020 19:08:35 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202002031908.013J8ZvF049048@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 3 Feb 2020 19:08:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357462 - head/contrib/elftoolchain/addr2line X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/contrib/elftoolchain/addr2line X-SVN-Commit-Revision: 357462 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 19:08:36 -0000 Author: markj Date: Mon Feb 3 19:08:35 2020 New Revision: 357462 URL: https://svnweb.freebsd.org/changeset/base/357462 Log: addr2line: Avoid a name collision. The RB_ macros define functions with a parameter named head, and gcc warns about this. MFC with: r357450 Modified: head/contrib/elftoolchain/addr2line/addr2line.c Modified: head/contrib/elftoolchain/addr2line/addr2line.c ============================================================================== --- head/contrib/elftoolchain/addr2line/addr2line.c Mon Feb 3 18:59:07 2020 (r357461) +++ head/contrib/elftoolchain/addr2line/addr2line.c Mon Feb 3 19:08:35 2020 (r357462) @@ -87,7 +87,7 @@ static char unknown[] = { '?', '?', '\0' }; static Dwarf_Addr section_base; /* Need a new curlopc that stores last lopc value. */ static Dwarf_Unsigned curlopc = ~0ULL; -static RB_HEAD(cutree, CU) head = RB_INITIALIZER(&head); +static RB_HEAD(cutree, CU) cuhead = RB_INITIALIZER(&cuhead); static int lopccmp(struct CU *e1, struct CU *e2) @@ -397,14 +397,14 @@ culookup(Dwarf_Unsigned addr) struct CU find, *res; find.lopc = addr; - res = RB_NFIND(cutree, &head, &find); + res = RB_NFIND(cutree, &cuhead, &find); if (res != NULL) { if (res->lopc != addr) - res = RB_PREV(cutree, &head, res); + res = RB_PREV(cutree, &cuhead, res); if (res != NULL && addr >= res->lopc && addr < res->hipc) return (res); } else { - res = RB_MAX(cutree, &head); + res = RB_MAX(cutree, &cuhead); if (res != NULL && addr >= res->lopc && addr < res->hipc) return (res); } @@ -509,7 +509,7 @@ translate(Dwarf_Debug dbg, Elf *e, const char* addrstr cu->hipc = hipc; cu->die = die; STAILQ_INIT(&cu->funclist); - RB_INSERT(cutree, &head, cu); + RB_INSERT(cutree, &cuhead, cu); curlopc = lopc; break; From owner-svn-src-all@freebsd.org Mon Feb 3 19:29:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E944322BF9C; Mon, 3 Feb 2020 19:29:02 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BHv25wXvz3xq5; Mon, 3 Feb 2020 19:29:02 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C69845AC6; Mon, 3 Feb 2020 19:29:02 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 013JT22A061170; Mon, 3 Feb 2020 19:29:02 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 013JT2u8061169; Mon, 3 Feb 2020 19:29:02 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202002031929.013JT2u8061169@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 3 Feb 2020 19:29:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357463 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 357463 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 19:29:03 -0000 Author: markj Date: Mon Feb 3 19:29:02 2020 New Revision: 357463 URL: https://svnweb.freebsd.org/changeset/base/357463 Log: Disable the smallest UMA bucket size on 32-bit platforms. With r357314, sizeof(struct uma_bucket) grew to 16 bytes on 32-bit platforms, so BUCKET_SIZE(4) is 0. This resulted in the creation of a bucket zone for buckets with zero capacity. A more general fix is planned, but for now this bandaid allows 32-bit platforms to boot again. PR: 243837 Discussed with: jeff Reported by: pho, Jenkins via lwhsu Tested by: pho Sponsored by: The FreeBSD Foundation Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Mon Feb 3 19:08:35 2020 (r357462) +++ head/sys/vm/uma_core.c Mon Feb 3 19:29:02 2020 (r357463) @@ -239,7 +239,9 @@ struct uma_bucket_zone { #define BUCKET_MIN BUCKET_SIZE(4) struct uma_bucket_zone bucket_zones[] = { +#ifndef __ILP32__ { NULL, "4 Bucket", BUCKET_SIZE(4), 4096 }, +#endif { NULL, "6 Bucket", BUCKET_SIZE(6), 3072 }, { NULL, "8 Bucket", BUCKET_SIZE(8), 2048 }, { NULL, "12 Bucket", BUCKET_SIZE(12), 1536 }, From owner-svn-src-all@freebsd.org Mon Feb 3 19:36:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EF2CB22C419; Mon, 3 Feb 2020 19:36:24 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BJ3X62gDz3yVK; Mon, 3 Feb 2020 19:36:24 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA6955CA5; Mon, 3 Feb 2020 19:36:24 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 013JaOHZ068954; Mon, 3 Feb 2020 19:36:24 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 013JaOPc068953; Mon, 3 Feb 2020 19:36:24 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202002031936.013JaOPc068953@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 3 Feb 2020 19:36:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357464 - head/sys/dev/vt/hw/ofwfb X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/vt/hw/ofwfb X-SVN-Commit-Revision: 357464 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 19:36:25 -0000 Author: imp Date: Mon Feb 3 19:36:24 2020 New Revision: 357464 URL: https://svnweb.freebsd.org/changeset/base/357464 Log: Fix a stray 'e'from my last commit. Modified: head/sys/dev/vt/hw/ofwfb/ofwfb.c Modified: head/sys/dev/vt/hw/ofwfb/ofwfb.c ============================================================================== --- head/sys/dev/vt/hw/ofwfb/ofwfb.c Mon Feb 3 19:29:02 2020 (r357463) +++ head/sys/dev/vt/hw/ofwfb/ofwfb.c Mon Feb 3 19:36:24 2020 (r357464) @@ -1,4 +1,4 @@ -e/*- +/*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2011 Nathan Whitehorn From owner-svn-src-all@freebsd.org Mon Feb 3 20:46:31 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C36C322E5E8; Mon, 3 Feb 2020 20:46:31 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BKcR4stVz46rW; Mon, 3 Feb 2020 20:46:31 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A24DD69B4; Mon, 3 Feb 2020 20:46:31 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 013KkVwg021857; Mon, 3 Feb 2020 20:46:31 GMT (envelope-from phk@FreeBSD.org) Received: (from phk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 013KkVj4021856; Mon, 3 Feb 2020 20:46:31 GMT (envelope-from phk@FreeBSD.org) Message-Id: <202002032046.013KkVj4021856@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: phk set sender to phk@FreeBSD.org using -f From: Poul-Henning Kamp Date: Mon, 3 Feb 2020 20:46:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357465 - head/usr.bin/ministat X-SVN-Group: head X-SVN-Commit-Author: phk X-SVN-Commit-Paths: head/usr.bin/ministat X-SVN-Commit-Revision: 357465 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 20:46:31 -0000 Author: phk Date: Mon Feb 3 20:46:31 2020 New Revision: 357465 URL: https://svnweb.freebsd.org/changeset/base/357465 Log: Minor cleanups to allow handing vast datasets. Submitted by: dds Modified: head/usr.bin/ministat/ministat.c Modified: head/usr.bin/ministat/ministat.c ============================================================================== --- head/usr.bin/ministat/ministat.c Mon Feb 3 19:36:24 2020 (r357464) +++ head/usr.bin/ministat/ministat.c Mon Feb 3 20:46:31 2020 (r357465) @@ -142,9 +142,9 @@ static char symbol[MAX_DS] = { ' ', 'x', '+', '*', '%' struct dataset { char *name; double *points; - unsigned lpoints; + size_t lpoints; double sy, syy; - unsigned n; + size_t n; }; static struct dataset * @@ -202,7 +202,7 @@ Avg(const struct dataset *ds) static double Median(const struct dataset *ds) { - const unsigned m = ds->n / 2; + const size_t m = ds->n / 2; if ((ds->n % 2) == 0) return ((ds->points[m] + (ds->points[m - 1])) / 2); @@ -212,13 +212,13 @@ Median(const struct dataset *ds) static double Var(struct dataset *ds) { - unsigned n; + size_t z; const double a = Avg(ds); if (isnan(ds->syy)) { ds->syy = 0.0; - for (n = 0; n < ds->n; n++) - ds->syy += (ds->points[n] - a) * (ds->points[n] - a); + for (z = 0; z < ds->n; z++) + ds->syy += (ds->points[z] - a) * (ds->points[z] - a); } return (ds->syy / (ds->n - 1.0)); @@ -242,7 +242,7 @@ static void Vitals(struct dataset *ds, int flag) { - printf("%c %3d %13.8g %13.8g %13.8g %13.8g %13.8g", symbol[flag], + printf("%c %3zu %13.8g %13.8g %13.8g %13.8g %13.8g", symbol[flag], ds->n, Min(ds), Max(ds), Median(ds), Avg(ds), Stddev(ds)); printf("\n"); } @@ -252,13 +252,13 @@ Relative(struct dataset *ds, struct dataset *rs, int c { double spool, s, d, e, t; double re; - int i; + size_t z; - i = ds->n + rs->n - 2; - if (i > NSTUDENT) + z = ds->n + rs->n - 2; + if (z > NSTUDENT) t = student[0][confidx]; else - t = student[i][confidx]; + t = student[z][confidx]; spool = (ds->n - 1) * Var(ds) + (rs->n - 1) * Var(rs); spool /= ds->n + rs->n - 2; spool = sqrt(spool); @@ -272,7 +272,6 @@ Relative(struct dataset *ds, struct dataset *rs, int c re = t * sqrt(re); if (fabs(d) > e) { - printf("Difference at %.1f%% confidence\n", studentpct[confidx]); printf(" %g +/- %g\n", d, e); printf(" %g%% +/- %g%%\n", d * 100 / Avg(rs), re * 100 / Avg(rs)); @@ -290,7 +289,7 @@ struct plot { int width; double x0, dx; - int height; + size_t height; char *data; char **bar; int separate_bars; @@ -343,9 +342,11 @@ static void PlotSet(struct dataset *ds, int val) { struct plot *pl; - int i, j, m, x; - unsigned n; + int i, x; + size_t m, j, z; + size_t n; int bar; + double av, sd; pl = &plot; if (pl->span == 0) @@ -370,6 +371,7 @@ PlotSet(struct dataset *ds, int val) m = 1; i = -1; j = 0; + /* Set m to max(j) + 1, to allocate required memory */ for (n = 0; n < ds->n; n++) { x = (ds->points[n] - pl->x0) / pl->dx; if (x == i) { @@ -400,18 +402,20 @@ PlotSet(struct dataset *ds, int val) } pl->data[j * pl->width + x] |= val; } - if (!isnan(Stddev(ds))) { - x = ((Avg(ds) - Stddev(ds)) - pl->x0) / pl->dx; - m = ((Avg(ds) + Stddev(ds)) - pl->x0) / pl->dx; + av = Avg(ds); + sd = Stddev(ds); + if (!isnan(sd)) { + x = ((av - sd) - pl->x0) / pl->dx; + m = ((av + sd) - pl->x0) / pl->dx; pl->bar[bar][m] = '|'; pl->bar[bar][x] = '|'; - for (i = x + 1; i < m; i++) - if (pl->bar[bar][i] == 0) - pl->bar[bar][i] = '_'; + for (z = x + 1; z < m; z++) + if (pl->bar[bar][z] == 0) + pl->bar[bar][z] = '_'; } x = (Median(ds) - pl->x0) / pl->dx; pl->bar[bar][x] = 'M'; - x = (Avg(ds) - pl->x0) / pl->dx; + x = (av - pl->x0) / pl->dx; pl->bar[bar][x] = 'A'; } @@ -420,6 +424,7 @@ DumpPlot(void) { struct plot *pl; int i, j, k; + size_t z; pl = &plot; if (pl->span == 0) { @@ -432,10 +437,10 @@ DumpPlot(void) putchar('-'); putchar('+'); putchar('\n'); - for (i = 1; i < pl->height; i++) { + for (z = 1; z < pl->height; z++) { putchar('|'); for (j = 0; j < pl->width; j++) { - k = pl->data[(pl->height - i) * pl->width + j]; + k = pl->data[(pl->height - z) * pl->width + j]; if (k >= 0 && k < MAX_DS) putchar(symbol[k]); else From owner-svn-src-all@freebsd.org Mon Feb 3 20:48:58 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0BCC422E694; Mon, 3 Feb 2020 20:48:58 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BKgF6T8Kz4719; Mon, 3 Feb 2020 20:48:57 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D459D69B6; Mon, 3 Feb 2020 20:48:57 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 013KmvuS022017; Mon, 3 Feb 2020 20:48:57 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 013Kmv5Z022016; Mon, 3 Feb 2020 20:48:57 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202002032048.013Kmv5Z022016@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 3 Feb 2020 20:48:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357466 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 357466 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 20:48:58 -0000 Author: glebius Date: Mon Feb 3 20:48:57 2020 New Revision: 357466 URL: https://svnweb.freebsd.org/changeset/base/357466 Log: Couple protocol drain routines (frag6_drain and sctp_drain) may send packets. An unexpected behaviour for memory reclamation routine. Anyway, we need enter the network epoch for doing that. Modified: head/sys/kern/kern_mbuf.c Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Mon Feb 3 20:46:31 2020 (r357465) +++ head/sys/kern/kern_mbuf.c Mon Feb 3 20:48:57 2020 (r357466) @@ -829,15 +829,18 @@ mb_ctor_pack(void *mem, int size, void *arg, int how) static void mb_reclaim(uma_zone_t zone __unused, int pending __unused) { + struct epoch_tracker et; struct domain *dp; struct protosw *pr; WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK | WARN_PANIC, NULL, __func__); + NET_EPOCH_ENTER(et); for (dp = domains; dp != NULL; dp = dp->dom_next) for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++) if (pr->pr_drain != NULL) (*pr->pr_drain)(); + NET_EPOCH_EXIT(et); } /* From owner-svn-src-all@freebsd.org Mon Feb 3 22:26:01 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A4ECD230A4F; Mon, 3 Feb 2020 22:26:01 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BMqF3xX7z4Cwj; Mon, 3 Feb 2020 22:26:01 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8286D7C1E; Mon, 3 Feb 2020 22:26:01 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 013MQ1uj081412; Mon, 3 Feb 2020 22:26:01 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 013MQ0lx081409; Mon, 3 Feb 2020 22:26:00 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202002032226.013MQ0lx081409@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 3 Feb 2020 22:26:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357467 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 357467 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 22:26:01 -0000 Author: mjg Date: Mon Feb 3 22:26:00 2020 New Revision: 357467 URL: https://svnweb.freebsd.org/changeset/base/357467 Log: ktrace: provide ktrstat_error This eliminates a branch from its consumers trading it for an extra call if ktrace is enabled for curthread. Given that this is almost never true, the tradeoff is worth it. Modified: head/sys/kern/kern_descrip.c head/sys/kern/kern_ktrace.c head/sys/kern/vfs_syscalls.c head/sys/sys/ktrace.h Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Mon Feb 3 20:48:57 2020 (r357466) +++ head/sys/kern/kern_descrip.c Mon Feb 3 22:26:00 2020 (r357467) @@ -1445,16 +1445,14 @@ kern_fstat(struct thread *td, int fd, struct stat *sbp error = fo_stat(fp, sbp, td->td_ucred, td); fdrop(fp, td); #ifdef __STAT_TIME_T_EXT - if (error == 0) { - sbp->st_atim_ext = 0; - sbp->st_mtim_ext = 0; - sbp->st_ctim_ext = 0; - sbp->st_btim_ext = 0; - } + sbp->st_atim_ext = 0; + sbp->st_mtim_ext = 0; + sbp->st_ctim_ext = 0; + sbp->st_btim_ext = 0; #endif #ifdef KTRACE - if (error == 0 && KTRPOINT(td, KTR_STRUCT)) - ktrstat(sbp); + if (KTRPOINT(td, KTR_STRUCT)) + ktrstat_error(sbp, error); #endif return (error); } Modified: head/sys/kern/kern_ktrace.c ============================================================================== --- head/sys/kern/kern_ktrace.c Mon Feb 3 20:48:57 2020 (r357466) +++ head/sys/kern/kern_ktrace.c Mon Feb 3 22:26:00 2020 (r357467) @@ -779,6 +779,14 @@ ktrstruct(const char *name, const void *data, size_t d } void +ktrstruct_error(const char *name, const void *data, size_t datalen, int error) +{ + + if (error == 0) + ktrstruct(name, data, datalen); +} + +void ktrstructarray(const char *name, enum uio_seg seg, const void *data, int num_items, size_t struct_size) { Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Mon Feb 3 20:48:57 2020 (r357466) +++ head/sys/kern/vfs_syscalls.c Mon Feb 3 22:26:00 2020 (r357467) @@ -2349,8 +2349,6 @@ kern_statat(struct thread *td, int flag, int fd, const } NDFREE(&nd, NDF_ONLY_PNBUF); vput(nd.ni_vp); - if (error != 0) - return (error); #ifdef __STAT_TIME_T_EXT sbp->st_atim_ext = 0; sbp->st_mtim_ext = 0; @@ -2359,9 +2357,9 @@ kern_statat(struct thread *td, int flag, int fd, const #endif #ifdef KTRACE if (KTRPOINT(td, KTR_STRUCT)) - ktrstat(sbp); + ktrstat_error(sbp, error); #endif - return (0); + return (error); } #if defined(COMPAT_FREEBSD11) Modified: head/sys/sys/ktrace.h ============================================================================== --- head/sys/sys/ktrace.h Mon Feb 3 20:48:57 2020 (r357466) +++ head/sys/sys/ktrace.h Mon Feb 3 22:26:00 2020 (r357467) @@ -280,6 +280,7 @@ void ktrprocexit(struct thread *); void ktrprocfork(struct proc *, struct proc *); void ktruserret(struct thread *); void ktrstruct(const char *, const void *, size_t); +void ktrstruct_error(const char *, const void *, size_t, int); void ktrstructarray(const char *, enum uio_seg, const void *, int, size_t); void ktrcapfail(enum ktr_cap_fail_type, const cap_rights_t *, const cap_rights_t *); @@ -291,6 +292,8 @@ void ktrcapfail(enum ktr_cap_fail_type, const cap_righ ktrstruct("sockaddr", (s), ((struct sockaddr *)(s))->sa_len) #define ktrstat(s) \ ktrstruct("stat", (s), sizeof(struct stat)) +#define ktrstat_error(s, error) \ + ktrstruct_error("stat", (s), sizeof(struct stat), error) extern u_int ktr_geniosize; #else From owner-svn-src-all@freebsd.org Mon Feb 3 22:26:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 66A1F230AC6; Mon, 3 Feb 2020 22:26:30 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BMqp1yTDz4D48; Mon, 3 Feb 2020 22:26:30 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3E9947C1F; Mon, 3 Feb 2020 22:26:30 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 013MQUrA081474; Mon, 3 Feb 2020 22:26:30 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 013MQUrY081473; Mon, 3 Feb 2020 22:26:30 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202002032226.013MQUrY081473@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 3 Feb 2020 22:26:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357468 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 357468 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 22:26:30 -0000 Author: mjg Date: Mon Feb 3 22:26:29 2020 New Revision: 357468 URL: https://svnweb.freebsd.org/changeset/base/357468 Log: seqc: provide seqc_read_any Modified: head/sys/sys/seqc.h Modified: head/sys/sys/seqc.h ============================================================================== --- head/sys/sys/seqc.h Mon Feb 3 22:26:00 2020 (r357467) +++ head/sys/sys/seqc.h Mon Feb 3 22:26:29 2020 (r357468) @@ -72,6 +72,13 @@ seqc_write_end(seqc_t *seqcp) } static __inline seqc_t +seqc_read_any(const seqc_t *seqcp) +{ + + return (atomic_load_acq_int(__DECONST(seqc_t *, seqcp))); +} + +static __inline seqc_t seqc_read(const seqc_t *seqcp) { seqc_t ret; From owner-svn-src-all@freebsd.org Mon Feb 3 22:27:04 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 26A19230B3E; Mon, 3 Feb 2020 22:27:04 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BMrS0HP2z4DBm; Mon, 3 Feb 2020 22:27:04 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0521B7C20; Mon, 3 Feb 2020 22:27:04 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 013MR3Sx081556; Mon, 3 Feb 2020 22:27:03 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 013MR3KI081555; Mon, 3 Feb 2020 22:27:03 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202002032227.013MR3KI081555@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 3 Feb 2020 22:27:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357469 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 357469 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 22:27:04 -0000 Author: mjg Date: Mon Feb 3 22:27:03 2020 New Revision: 357469 URL: https://svnweb.freebsd.org/changeset/base/357469 Log: fd: remove the seq argument from fget routines It is almost always NULL. Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Mon Feb 3 22:26:29 2020 (r357468) +++ head/sys/kern/kern_descrip.c Mon Feb 3 22:27:03 2020 (r357469) @@ -2780,7 +2780,7 @@ fget_unlocked(struct filedesc *fdp, int fd, cap_rights */ static __inline int _fget(struct thread *td, int fd, struct file **fpp, int flags, - cap_rights_t *needrightsp, seqc_t *seqp) + cap_rights_t *needrightsp) { struct filedesc *fdp; struct file *fp; @@ -2788,7 +2788,7 @@ _fget(struct thread *td, int fd, struct file **fpp, in *fpp = NULL; fdp = td->td_proc->p_fd; - error = fget_unlocked(fdp, fd, needrightsp, &fp, seqp); + error = fget_unlocked(fdp, fd, needrightsp, &fp, NULL); if (__predict_false(error != 0)) return (error); if (__predict_false(fp->f_ops == &badfileops)) { @@ -2830,7 +2830,7 @@ int fget(struct thread *td, int fd, cap_rights_t *rightsp, struct file **fpp) { - return (_fget(td, fd, fpp, 0, rightsp, NULL)); + return (_fget(td, fd, fpp, 0, rightsp)); } int @@ -2839,19 +2839,24 @@ fget_mmap(struct thread *td, int fd, cap_rights_t *rig { int error; #ifndef CAPABILITIES - error = _fget(td, fd, fpp, 0, rightsp, NULL); + error = _fget(td, fd, fpp, 0, rightsp); if (maxprotp != NULL) *maxprotp = VM_PROT_ALL; #else cap_rights_t fdrights; - struct filedesc *fdp = td->td_proc->p_fd; + struct filedesc *fdp; seqc_t seq; + fdp = td->td_proc->p_fd; MPASS(cap_rights_is_set(rightsp, CAP_MMAP)); for (;;) { - error = _fget(td, fd, fpp, 0, rightsp, &seq); - if (error != 0) + error = fget_unlocked(fdp, fd, rightsp, fpp, &seq); + if (__predict_false(error != 0)) return (error); + if (__predict_false((*fpp)->f_ops == &badfileops)) { + fdrop(*fpp, td); + return (EBADF); + } if (maxprotp != NULL) fdrights = *cap_rights(fdp, fd); if (!fd_modified(fdp, fd, seq)) @@ -2872,14 +2877,14 @@ int fget_read(struct thread *td, int fd, cap_rights_t *rightsp, struct file **fpp) { - return (_fget(td, fd, fpp, FREAD, rightsp, NULL)); + return (_fget(td, fd, fpp, FREAD, rightsp)); } int fget_write(struct thread *td, int fd, cap_rights_t *rightsp, struct file **fpp) { - return (_fget(td, fd, fpp, FWRITE, rightsp, NULL)); + return (_fget(td, fd, fpp, FWRITE, rightsp)); } int @@ -2926,7 +2931,7 @@ _fgetvp(struct thread *td, int fd, int flags, cap_righ int error; *vpp = NULL; - error = _fget(td, fd, &fp, flags, needrightsp, NULL); + error = _fget(td, fd, &fp, flags, needrightsp); if (error != 0) return (error); if (fp->f_vnode == NULL) { From owner-svn-src-all@freebsd.org Mon Feb 3 22:27:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EDB15230BC9; Mon, 3 Feb 2020 22:27:56 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BMsS61fvz4DKb; Mon, 3 Feb 2020 22:27:56 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C930B7C21; Mon, 3 Feb 2020 22:27:56 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 013MRu8J081637; Mon, 3 Feb 2020 22:27:56 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 013MRtEl081631; Mon, 3 Feb 2020 22:27:55 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202002032227.013MRtEl081631@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 3 Feb 2020 22:27:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357470 - in head/sys: compat/linuxkpi/common/include/linux kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: compat/linuxkpi/common/include/linux kern sys X-SVN-Commit-Revision: 357470 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 22:27:57 -0000 Author: mjg Date: Mon Feb 3 22:27:55 2020 New Revision: 357470 URL: https://svnweb.freebsd.org/changeset/base/357470 Log: fd: remove the seq argument from fget_unlocked It is almost always NULL. Modified: head/sys/compat/linuxkpi/common/include/linux/file.h head/sys/kern/kern_descrip.c head/sys/kern/sys_generic.c head/sys/kern/tty.c head/sys/kern/vfs_syscalls.c head/sys/sys/filedesc.h Modified: head/sys/compat/linuxkpi/common/include/linux/file.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/file.h Mon Feb 3 22:27:03 2020 (r357469) +++ head/sys/compat/linuxkpi/common/include/linux/file.h Mon Feb 3 22:27:55 2020 (r357470) @@ -54,7 +54,7 @@ linux_fget(unsigned int fd) /* lookup file pointer by file descriptor index */ if (fget_unlocked(curthread->td_proc->p_fd, fd, - &cap_no_rights, &file, NULL) != 0) + &cap_no_rights, &file) != 0) return (NULL); /* check if file handle really belongs to us */ @@ -90,7 +90,7 @@ put_unused_fd(unsigned int fd) struct file *file; if (fget_unlocked(curthread->td_proc->p_fd, fd, - &cap_no_rights, &file, NULL) != 0) { + &cap_no_rights, &file) != 0) { return; } /* @@ -110,7 +110,7 @@ fd_install(unsigned int fd, struct linux_file *filp) struct file *file; if (fget_unlocked(curthread->td_proc->p_fd, fd, - &cap_no_rights, &file, NULL) != 0) { + &cap_no_rights, &file) != 0) { filp->_file = NULL; } else { filp->_file = file; Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Mon Feb 3 22:27:03 2020 (r357469) +++ head/sys/kern/kern_descrip.c Mon Feb 3 22:27:55 2020 (r357470) @@ -619,7 +619,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_ break; } - error = fget_unlocked(fdp, fd, &cap_flock_rights, &fp, NULL); + error = fget_unlocked(fdp, fd, &cap_flock_rights, &fp); if (error != 0) break; if (fp->f_type != DTYPE_VNODE) { @@ -706,7 +706,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_ * that the closing thread was a bit slower and that the * advisory lock succeeded before the close. */ - error = fget_unlocked(fdp, fd, &cap_no_rights, &fp2, NULL); + error = fget_unlocked(fdp, fd, &cap_no_rights, &fp2); if (error != 0) { fdrop(fp, td); break; @@ -724,7 +724,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_ break; case F_GETLK: - error = fget_unlocked(fdp, fd, &cap_flock_rights, &fp, NULL); + error = fget_unlocked(fdp, fd, &cap_flock_rights, &fp); if (error != 0) break; if (fp->f_type != DTYPE_VNODE) { @@ -758,7 +758,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_ break; case F_ADD_SEALS: - error = fget_unlocked(fdp, fd, &cap_no_rights, &fp, NULL); + error = fget_unlocked(fdp, fd, &cap_no_rights, &fp); if (error != 0) break; error = fo_add_seals(fp, arg); @@ -766,7 +766,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_ break; case F_GET_SEALS: - error = fget_unlocked(fdp, fd, &cap_no_rights, &fp, NULL); + error = fget_unlocked(fdp, fd, &cap_no_rights, &fp); if (error != 0) break; if (fo_get_seals(fp, &seals) == 0) @@ -780,7 +780,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_ arg = arg ? 128 * 1024: 0; /* FALLTHROUGH */ case F_READAHEAD: - error = fget_unlocked(fdp, fd, &cap_no_rights, &fp, NULL); + error = fget_unlocked(fdp, fd, &cap_no_rights, &fp); if (error != 0) break; if (fp->f_type != DTYPE_VNODE) { @@ -831,7 +831,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_ * horrible kludge facilitates the current behavior in a much * cheaper manner until someone(tm) sorts this out. */ - error = fget_unlocked(fdp, fd, &cap_no_rights, &fp, NULL); + error = fget_unlocked(fdp, fd, &cap_no_rights, &fp); if (error != 0) break; if (fp->f_type != DTYPE_VNODE) { @@ -2644,15 +2644,15 @@ fget_cap(struct thread *td, int fd, cap_rights_t *need struct filedesc *fdp = td->td_proc->p_fd; int error; #ifndef CAPABILITIES - error = fget_unlocked(fdp, fd, needrightsp, fpp, NULL); - if (error == 0 && havecapsp != NULL) + error = fget_unlocked(fdp, fd, needrightsp, fpp); + if (havecapsp != NULL && error == 0) filecaps_fill(havecapsp); #else struct file *fp; seqc_t seq; for (;;) { - error = fget_unlocked(fdp, fd, needrightsp, &fp, &seq); + error = fget_unlocked_seq(fdp, fd, needrightsp, &fp, &seq); if (error != 0) return (error); @@ -2683,7 +2683,7 @@ get_locked: } int -fget_unlocked(struct filedesc *fdp, int fd, cap_rights_t *needrightsp, +fget_unlocked_seq(struct filedesc *fdp, int fd, cap_rights_t *needrightsp, struct file **fpp, seqc_t *seqp) { #ifdef CAPABILITIES @@ -2788,7 +2788,7 @@ _fget(struct thread *td, int fd, struct file **fpp, in *fpp = NULL; fdp = td->td_proc->p_fd; - error = fget_unlocked(fdp, fd, needrightsp, &fp, NULL); + error = fget_unlocked(fdp, fd, needrightsp, &fp); if (__predict_false(error != 0)) return (error); if (__predict_false(fp->f_ops == &badfileops)) { @@ -2850,7 +2850,7 @@ fget_mmap(struct thread *td, int fd, cap_rights_t *rig fdp = td->td_proc->p_fd; MPASS(cap_rights_is_set(rightsp, CAP_MMAP)); for (;;) { - error = fget_unlocked(fdp, fd, rightsp, fpp, &seq); + error = fget_unlocked_seq(fdp, fd, rightsp, fpp, &seq); if (__predict_false(error != 0)) return (error); if (__predict_false((*fpp)->f_ops == &badfileops)) { @@ -2893,14 +2893,14 @@ fget_fcntl(struct thread *td, int fd, cap_rights_t *ri { struct filedesc *fdp = td->td_proc->p_fd; #ifndef CAPABILITIES - return (fget_unlocked(fdp, fd, rightsp, fpp, NULL)); + return (fget_unlocked(fdp, fd, rightsp, fpp)); #else int error; seqc_t seq; MPASS(cap_rights_is_set(rightsp, CAP_FCNTL)); for (;;) { - error = fget_unlocked(fdp, fd, rightsp, fpp, &seq); + error = fget_unlocked_seq(fdp, fd, rightsp, fpp, &seq); if (error != 0) return (error); error = cap_fcntl_check(fdp, fd, needfcntl); Modified: head/sys/kern/sys_generic.c ============================================================================== --- head/sys/kern/sys_generic.c Mon Feb 3 22:27:03 2020 (r357469) +++ head/sys/kern/sys_generic.c Mon Feb 3 22:27:55 2020 (r357470) @@ -1245,7 +1245,7 @@ static __inline int getselfd_cap(struct filedesc *fdp, int fd, struct file **fpp) { - return (fget_unlocked(fdp, fd, &cap_event_rights, fpp, NULL)); + return (fget_unlocked(fdp, fd, &cap_event_rights, fpp)); } /* Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Mon Feb 3 22:27:03 2020 (r357469) +++ head/sys/kern/tty.c Mon Feb 3 22:27:55 2020 (r357470) @@ -2059,7 +2059,7 @@ ttyhook_register(struct tty **rtp, struct proc *p, int /* Validate the file descriptor. */ fdp = p->p_fd; error = fget_unlocked(fdp, fd, cap_rights_init(&rights, CAP_TTYHOOK), - &fp, NULL); + &fp); if (error != 0) return (error); if (fp->f_ops == &badfileops) { Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Mon Feb 3 22:27:03 2020 (r357469) +++ head/sys/kern/vfs_syscalls.c Mon Feb 3 22:27:55 2020 (r357470) @@ -4173,7 +4173,7 @@ getvnode(struct thread *td, int fd, cap_rights_t *righ struct file *fp; int error; - error = fget_unlocked(td->td_proc->p_fd, fd, rightsp, &fp, NULL); + error = fget_unlocked(td->td_proc->p_fd, fd, rightsp, &fp); if (error != 0) return (error); Modified: head/sys/sys/filedesc.h ============================================================================== --- head/sys/sys/filedesc.h Mon Feb 3 22:27:03 2020 (r357469) +++ head/sys/sys/filedesc.h Mon Feb 3 22:27:55 2020 (r357470) @@ -204,8 +204,10 @@ int fget_cap(struct thread *td, int fd, cap_rights_t * struct file **fpp, struct filecaps *havecapsp); /* Return a referenced file from an unlocked descriptor. */ -int fget_unlocked(struct filedesc *fdp, int fd, cap_rights_t *needrightsp, +int fget_unlocked_seq(struct filedesc *fdp, int fd, cap_rights_t *needrightsp, struct file **fpp, seqc_t *seqp); +#define fget_unlocked(fdp, fd, needrightsp, fpp) \ + fget_unlocked_seq(fdp, fd, needrightsp, fpp, NULL) /* Requires a FILEDESC_{S,X}LOCK held and returns without a ref. */ static __inline struct file * From owner-svn-src-all@freebsd.org Mon Feb 3 22:32:50 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 493E0231051; Mon, 3 Feb 2020 22:32:50 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BMz61CMbz4Dpb; Mon, 3 Feb 2020 22:32:50 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 24ADD7DE4; Mon, 3 Feb 2020 22:32:50 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 013MWoUK087097; Mon, 3 Feb 2020 22:32:50 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 013MWn4v087095; Mon, 3 Feb 2020 22:32:49 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202002032232.013MWn4v087095@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 3 Feb 2020 22:32:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357471 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 357471 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 22:32:50 -0000 Author: mjg Date: Mon Feb 3 22:32:49 2020 New Revision: 357471 URL: https://svnweb.freebsd.org/changeset/base/357471 Log: fd: streamline fget_unlocked clang has the unfortunate property of paying little attention to prediction hints when faced with a loop spanning the majority of the rotuine. In particular fget_unlocked has an unlikely corner case where it starts almost from scratch. Faced with this clang generates a maze of taken jumps, whereas gcc produces jump-free code (in the expected case). Work around the problem by providing a variant which only tries once and resorts to calling the original code if anything goes wrong. While here note that the 'seq' parameter is almost never passed, thus the seldom users are redirected to call it directly. Modified: head/sys/kern/kern_descrip.c head/sys/sys/capsicum.h head/sys/sys/filedesc.h Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Mon Feb 3 22:27:55 2020 (r357470) +++ head/sys/kern/kern_descrip.c Mon Feb 3 22:32:49 2020 (r357471) @@ -2766,6 +2766,69 @@ fget_unlocked_seq(struct filedesc *fdp, int fd, cap_ri } /* + * See the comments in fget_unlocked_seq for an explanation of how this works. + * + * This is a simplified variant which bails out to the aforementioned routine + * if anything goes wrong. In practice this will only happens when userspace + * is racing with itself. + */ +int +fget_unlocked(struct filedesc *fdp, int fd, cap_rights_t *needrightsp, + struct file **fpp) +{ +#ifdef CAPABILITIES + const struct filedescent *fde; +#endif + const struct fdescenttbl *fdt; + struct file *fp; +#ifdef CAPABILITIES + seqc_t seq; + const cap_rights_t *haverights; +#endif + + fdt = fdp->fd_files; + if (__predict_false((u_int)fd >= fdt->fdt_nfiles)) + return (EBADF); +#ifdef CAPABILITIES + seq = seqc_read_any(fd_seqc(fdt, fd)); + if (__predict_false(seqc_in_modify(seq))) + goto out_fallback; + fde = &fdt->fdt_ofiles[fd]; + haverights = cap_rights_fde_inline(fde); + fp = fde->fde_file; +#else + fp = fdt->fdt_ofiles[fd].fde_file; +#endif + if (__predict_false(fp == NULL)) + goto out_fallback; +#ifdef CAPABILITIES + if (__predict_false(cap_check_inline_transient(haverights, needrightsp))) + goto out_fallback; +#endif + if (__predict_false(!refcount_acquire_if_not_zero(&fp->f_count))) + goto out_fallback; + + /* + * Use an acquire barrier to force re-reading of fdt so it is + * refreshed for verification. + */ + atomic_thread_fence_acq(); + fdt = fdp->fd_files; +#ifdef CAPABILITIES + if (__predict_false(!seqc_consistent_nomb(fd_seqc(fdt, fd), seq))) +#else + if (__predict_false(fp != fdt->fdt_ofiles[fd].fde_file)) +#endif + goto out_fdrop; + *fpp = fp; + return (0); +out_fdrop: + fdrop(fp, curthread); +out_fallback: + return (fget_unlocked_seq(fdp, fd, needrightsp, fpp, NULL)); +} + +/* * Extract the file pointer associated with the specified descriptor for the * current user process. * Modified: head/sys/sys/capsicum.h ============================================================================== --- head/sys/sys/capsicum.h Mon Feb 3 22:27:55 2020 (r357470) +++ head/sys/sys/capsicum.h Mon Feb 3 22:32:49 2020 (r357471) @@ -351,8 +351,14 @@ void __cap_rights_sysinit(void *arg); _Static_assert(CAP_RIGHTS_VERSION == CAP_RIGHTS_VERSION_00, "unsupported version of capsicum rights"); +/* + * Allow checking caps which are possibly getting modified at the same time. + * The caller is expected to determine whether the result is legitimate via + * other means, see fget_unlocked for an example. + */ + static inline bool -cap_rights_contains(const cap_rights_t *big, const cap_rights_t *little) +cap_rights_contains_transient(const cap_rights_t *big, const cap_rights_t *little) { if (__predict_true( @@ -362,6 +368,8 @@ cap_rights_contains(const cap_rights_t *big, const cap return (false); } +#define cap_rights_contains cap_rights_contains_transient + int cap_check_failed_notcapable(const cap_rights_t *havep, const cap_rights_t *needp); @@ -371,6 +379,15 @@ cap_check_inline(const cap_rights_t *havep, const cap_ if (__predict_false(!cap_rights_contains(havep, needp))) return (cap_check_failed_notcapable(havep, needp)); + return (0); +} + +static inline int +cap_check_inline_transient(const cap_rights_t *havep, const cap_rights_t *needp) +{ + + if (__predict_false(!cap_rights_contains(havep, needp))) + return (1); return (0); } Modified: head/sys/sys/filedesc.h ============================================================================== --- head/sys/sys/filedesc.h Mon Feb 3 22:27:55 2020 (r357470) +++ head/sys/sys/filedesc.h Mon Feb 3 22:32:49 2020 (r357471) @@ -206,8 +206,8 @@ int fget_cap(struct thread *td, int fd, cap_rights_t * /* Return a referenced file from an unlocked descriptor. */ int fget_unlocked_seq(struct filedesc *fdp, int fd, cap_rights_t *needrightsp, struct file **fpp, seqc_t *seqp); -#define fget_unlocked(fdp, fd, needrightsp, fpp) \ - fget_unlocked_seq(fdp, fd, needrightsp, fpp, NULL) +int fget_unlocked(struct filedesc *fdp, int fd, cap_rights_t *needrightsp, + struct file **fpp); /* Requires a FILEDESC_{S,X}LOCK held and returns without a ref. */ static __inline struct file * From owner-svn-src-all@freebsd.org Mon Feb 3 22:34:51 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9023523113D; Mon, 3 Feb 2020 22:34:51 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BN1R3Hb3z4Dy9; Mon, 3 Feb 2020 22:34:51 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 677C17DE8; Mon, 3 Feb 2020 22:34:51 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 013MYptO087253; Mon, 3 Feb 2020 22:34:51 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 013MYpo7087252; Mon, 3 Feb 2020 22:34:51 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202002032234.013MYpo7087252@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 3 Feb 2020 22:34:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357472 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 357472 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 22:34:51 -0000 Author: mjg Date: Mon Feb 3 22:34:50 2020 New Revision: 357472 URL: https://svnweb.freebsd.org/changeset/base/357472 Log: fd: partially unengrish the previous commit Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Mon Feb 3 22:32:49 2020 (r357471) +++ head/sys/kern/kern_descrip.c Mon Feb 3 22:34:50 2020 (r357472) @@ -2769,8 +2769,8 @@ fget_unlocked_seq(struct filedesc *fdp, int fd, cap_ri * See the comments in fget_unlocked_seq for an explanation of how this works. * * This is a simplified variant which bails out to the aforementioned routine - * if anything goes wrong. In practice this will only happens when userspace - * is racing with itself. + * if anything goes wrong. In practice this only happens when userspace is + * racing with itself. */ int fget_unlocked(struct filedesc *fdp, int fd, cap_rights_t *needrightsp, From owner-svn-src-all@freebsd.org Mon Feb 3 22:49:06 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1C81723152C; Mon, 3 Feb 2020 22:49:06 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BNKs6sT1z4FdF; Mon, 3 Feb 2020 22:49:05 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E1D687FB5; Mon, 3 Feb 2020 22:49:05 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 013Mn5dw093714; Mon, 3 Feb 2020 22:49:05 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 013Mn5E4093713; Mon, 3 Feb 2020 22:49:05 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202002032249.013Mn5E4093713@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 3 Feb 2020 22:49:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357473 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 357473 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 22:49:06 -0000 Author: markj Date: Mon Feb 3 22:49:05 2020 New Revision: 357473 URL: https://svnweb.freebsd.org/changeset/base/357473 Log: Fix the !SMP case in sched_add() after r355779. If the thread's lock is already that of the runqueue, don't recurse on the queue lock. Reviewed by: jeff, kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D23492 Modified: head/sys/kern/sched_ule.c Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Mon Feb 3 22:34:50 2020 (r357472) +++ head/sys/kern/sched_ule.c Mon Feb 3 22:49:05 2020 (r357473) @@ -2605,15 +2605,17 @@ sched_add(struct thread *td, int flags) sched_setpreempt(td); #else tdq = TDQ_SELF(); - TDQ_LOCK(tdq); /* * Now that the thread is moving to the run-queue, set the lock * to the scheduler's lock. */ - if ((flags & SRQ_HOLD) != 0) - td->td_lock = TDQ_LOCKPTR(tdq); - else - thread_lock_set(td, TDQ_LOCKPTR(tdq)); + if (td->td_lock != TDQ_LOCKPTR(tdq)) { + TDQ_LOCK(tdq); + if ((flags & SRQ_HOLD) != 0) + td->td_lock = TDQ_LOCKPTR(tdq); + else + thread_lock_set(td, TDQ_LOCKPTR(tdq)); + } tdq_add(tdq, td, flags); if (!(flags & SRQ_YIELDING)) sched_setpreempt(td); From owner-svn-src-all@freebsd.org Mon Feb 3 23:06:43 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5AA7F232603; Mon, 3 Feb 2020 23:06:43 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BNkC1jqDz4H8L; Mon, 3 Feb 2020 23:06:43 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 361C6835C; Mon, 3 Feb 2020 23:06:43 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 013N6hD2005482; Mon, 3 Feb 2020 23:06:43 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 013N6hru005481; Mon, 3 Feb 2020 23:06:43 GMT (envelope-from np@FreeBSD.org) Message-Id: <202002032306.013N6hru005481@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 3 Feb 2020 23:06:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357474 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 357474 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 23:06:43 -0000 Author: np Date: Mon Feb 3 23:06:42 2020 New Revision: 357474 URL: https://svnweb.freebsd.org/changeset/base/357474 Log: cxgbe(4): Only checksummed TCP should be considered for LRO. This avoids the per-packet nanouptime in tcp_lro_rx for traffic that's not even TCP. MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Mon Feb 3 22:49:05 2020 (r357473) +++ head/sys/dev/cxgbe/t4_sge.c Mon Feb 3 23:06:42 2020 (r357474) @@ -2040,7 +2040,9 @@ t4_eth_rx(struct sge_iq *iq, const struct rss_header * m0->m_pkthdr.numa_domain = ifp->if_numa_domain; #endif #if defined(INET) || defined(INET6) - if (iq->flags & IQ_LRO_ENABLED) { + if (iq->flags & IQ_LRO_ENABLED && + (M_HASHTYPE_GET(m0) == M_HASHTYPE_RSS_TCP_IPV4 || + M_HASHTYPE_GET(m0) == M_HASHTYPE_RSS_TCP_IPV6)) { if (sort_before_lro(lro)) { tcp_lro_queue_mbuf(lro, m0); return (0); /* queued for sort, then LRO */ From owner-svn-src-all@freebsd.org Mon Feb 3 23:25:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DA660232D1A; Mon, 3 Feb 2020 23:25:12 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BP7X5VTJz4JD9; Mon, 3 Feb 2020 23:25:12 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B7E4E8713; Mon, 3 Feb 2020 23:25:12 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 013NPCqE017212; Mon, 3 Feb 2020 23:25:12 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 013NPCfO017211; Mon, 3 Feb 2020 23:25:12 GMT (envelope-from np@FreeBSD.org) Message-Id: <202002032325.013NPCfO017211@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 3 Feb 2020 23:25:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357475 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 357475 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 23:25:12 -0000 Author: np Date: Mon Feb 3 23:25:12 2020 New Revision: 357475 URL: https://svnweb.freebsd.org/changeset/base/357475 Log: cxgbe(4): Initialize the rx buffer's metadata on first-use and not on allocation. refill_fl doesn't touch any part of a freshly allocated cluster after this change. MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Mon Feb 3 23:06:42 2020 (r357474) +++ head/sys/dev/cxgbe/adapter.h Mon Feb 3 23:25:12 2020 (r357475) @@ -327,7 +327,6 @@ struct cluster_layout { struct cluster_metadata { u_int refcount; - struct fl_sdesc *sd; /* For debug only. Could easily be stale */ }; struct fl_sdesc { Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Mon Feb 3 23:06:42 2020 (r357474) +++ head/sys/dev/cxgbe/t4_sge.c Mon Feb 3 23:25:12 2020 (r357475) @@ -1872,11 +1872,12 @@ get_scatter_segment(struct adapter *sc, struct sge_fl fr_offset == 0 ? M_PKTHDR | M_NOFREE : M_NOFREE)) return (NULL); fl->mbuf_inlined++; + if (sd->nmbuf++ == 0) { + clm->refcount = 1; + counter_u64_add(extfree_refs, 1); + } m_extaddref(m, payload, blen, &clm->refcount, rxb_free, swz->zone, sd->cl); - if (sd->nmbuf++ == 0) - counter_u64_add(extfree_refs, 1); - } else { /* @@ -1890,10 +1891,12 @@ get_scatter_segment(struct adapter *sc, struct sge_fl return (NULL); fl->mbuf_allocated++; if (clm != NULL) { + if (sd->nmbuf++ == 0) { + clm->refcount = 1; + counter_u64_add(extfree_refs, 1); + } m_extaddref(m, payload, blen, &clm->refcount, rxb_free, swz->zone, sd->cl); - if (sd->nmbuf++ == 0) - counter_u64_add(extfree_refs, 1); } else { m_cljset(m, sd->cl, swz->type); sd->cl = NULL; /* consumed, not a recycle candidate */ @@ -4401,7 +4404,7 @@ refill_fl(struct adapter *sc, struct sge_fl *fl, int n if (clm != NULL) MPASS(clm->refcount == 1); #endif - goto recycled_fast; + goto recycled; } /* @@ -4440,16 +4443,8 @@ alloc: sd->cl = cl; sd->cll = *cll; *d = htobe64(pa | cll->hwidx); - clm = cl_metadata(sc, fl, cll, cl); - if (clm != NULL) { recycled: -#ifdef INVARIANTS - clm->sd = sd; -#endif - clm->refcount = 1; - } sd->nmbuf = 0; -recycled_fast: d++; sd++; if (__predict_false(++fl->pidx % 8 == 0)) { From owner-svn-src-all@freebsd.org Mon Feb 3 23:30:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DD114232FAF; Mon, 3 Feb 2020 23:30:39 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BPFq5bgRz4JZQ; Mon, 3 Feb 2020 23:30:39 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB9968727; Mon, 3 Feb 2020 23:30:39 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 013NUdBd017523; Mon, 3 Feb 2020 23:30:39 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 013NUdT5017522; Mon, 3 Feb 2020 23:30:39 GMT (envelope-from np@FreeBSD.org) Message-Id: <202002032330.013NUdT5017522@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 3 Feb 2020 23:30:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357476 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 357476 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 23:30:39 -0000 Author: np Date: Mon Feb 3 23:30:39 2020 New Revision: 357476 URL: https://svnweb.freebsd.org/changeset/base/357476 Log: cxgbe(4): Do not use pack boundary > 512B unless it is explicitly requested. This is a tradeoff between PCIe efficiency during large packet rx and packing efficiency during small packet rx. MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Mon Feb 3 23:25:12 2020 (r357475) +++ head/sys/dev/cxgbe/t4_sge.c Mon Feb 3 23:30:39 2020 (r357476) @@ -589,6 +589,9 @@ t4_sge_extfree_refs(void) return (refs - rels); } +/* max 4096 */ +#define MAX_PACK_BOUNDARY 512 + static inline void setup_pad_and_pack_boundaries(struct adapter *sc) { @@ -635,7 +638,10 @@ setup_pad_and_pack_boundaries(struct adapter *sc) pack = fl_pack; if (fl_pack < 16 || fl_pack == 32 || fl_pack > 4096 || !powerof2(fl_pack)) { - pack = max(sc->params.pci.mps, CACHE_LINE_SIZE); + if (sc->params.pci.mps > MAX_PACK_BOUNDARY) + pack = MAX_PACK_BOUNDARY; + else + pack = max(sc->params.pci.mps, CACHE_LINE_SIZE); MPASS(powerof2(pack)); if (pack < 16) pack = 16; From owner-svn-src-all@freebsd.org Mon Feb 3 23:30:48 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 21DD9233136; Mon, 3 Feb 2020 23:30:48 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BPFz6fDxz4JhZ; Mon, 3 Feb 2020 23:30:47 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 79E678731; Mon, 3 Feb 2020 23:30:47 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 013NUl63018222; Mon, 3 Feb 2020 23:30:47 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 013NUlsH018221; Mon, 3 Feb 2020 23:30:47 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202002032330.013NUlsH018221@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Mon, 3 Feb 2020 23:30:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357477 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 357477 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 23:30:48 -0000 Author: 0mp (doc,ports committer) Date: Mon Feb 3 23:30:47 2020 New Revision: 357477 URL: https://svnweb.freebsd.org/changeset/base/357477 Log: Replace *-out with star-out to ease legibility "*-out" is a complex way of phrasing the fact, and it causes confusion for people. Submitted by: debdrup Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D23482 Modified: head/share/man/man7/security.7 Modified: head/share/man/man7/security.7 ============================================================================== --- head/share/man/man7/security.7 Mon Feb 3 23:30:39 2020 (r357476) +++ head/share/man/man7/security.7 Mon Feb 3 23:30:47 2020 (r357477) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 11, 2019 +.Dd February 4, 2020 .Dt SECURITY 7 .Os .Sh NAME @@ -272,8 +272,8 @@ also add an additional layer of protection to the key protecting the keypair when you create it with .Xr ssh-keygen 1 . Being able -to *-out the passwords for staff accounts also guarantees that staff members -can only log in through secure access methods that you have set up. +to star-out the passwords for staff accounts also guarantees that staff +members can only log in through secure access methods that you have set up. You can thus force all staff members to use secure, encrypted connections for all their sessions which closes an important hole used by many intruders: that From owner-svn-src-all@freebsd.org Mon Feb 3 23:40:27 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F0AA02332B3; Mon, 3 Feb 2020 23:40:27 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BPT765Nnz4K94; Mon, 3 Feb 2020 23:40:27 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CBC1F88FC; Mon, 3 Feb 2020 23:40:27 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 013NeRje023617; Mon, 3 Feb 2020 23:40:27 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 013NeRkP023616; Mon, 3 Feb 2020 23:40:27 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202002032340.013NeRkP023616@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Mon, 3 Feb 2020 23:40:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357478 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 357478 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 23:40:28 -0000 Author: 0mp (doc,ports committer) Date: Mon Feb 3 23:40:27 2020 New Revision: 357478 URL: https://svnweb.freebsd.org/changeset/base/357478 Log: ports.7: Update examples with install-missing-packages The ports framework recently grew support for installing dependencies with a dedicated target called "install-missing-packages". Let's retire the carefully constructed one-liner that was used for getting dependencies so far and use the official ports target instead. Reviewed by: bcr Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D23485 Modified: head/share/man/man7/ports.7 Modified: head/share/man/man7/ports.7 ============================================================================== --- head/share/man/man7/ports.7 Mon Feb 3 23:30:47 2020 (r357477) +++ head/share/man/man7/ports.7 Mon Feb 3 23:40:27 2020 (r357478) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 12, 2019 +.Dd February 4, 2020 .Dt PORTS 7 .Os .Sh NAME @@ -592,7 +592,7 @@ build its dependencies. Instead, the dependencies are downloaded via .Xr pkg 8 . .Bd -literal -offset 2n -.Li # Ic make missing | xargs pkg install --automatic --yes +.Li # Ic make install-missing-packages .Li # Ic make install .Ed .Pp From owner-svn-src-all@freebsd.org Mon Feb 3 23:50:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1D6FB2335D0; Mon, 3 Feb 2020 23:50:30 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BPhj6vnkz4Kj6; Mon, 3 Feb 2020 23:50:29 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E42A18ADC; Mon, 3 Feb 2020 23:50:29 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 013NoTHv029387; Mon, 3 Feb 2020 23:50:29 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 013NoTJK029385; Mon, 3 Feb 2020 23:50:29 GMT (envelope-from np@FreeBSD.org) Message-Id: <202002032350.013NoTJK029385@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 3 Feb 2020 23:50:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357479 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 357479 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 23:50:30 -0000 Author: np Date: Mon Feb 3 23:50:29 2020 New Revision: 357479 URL: https://svnweb.freebsd.org/changeset/base/357479 Log: cxgbe(4): Avoid ext_arg2 in rxb_free. ext_arg2 is the only item in the third cacheline in an mbuf and could be cold by the time rxb_free runs. Put the information needed by rxb_free in the same line as the refcount, which is very likely to be hot given that rxb_free runs when the refcount is decremented and reaches 0. MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Mon Feb 3 23:40:27 2020 (r357478) +++ head/sys/dev/cxgbe/adapter.h Mon Feb 3 23:50:29 2020 (r357479) @@ -326,6 +326,8 @@ struct cluster_layout { }; struct cluster_metadata { + uma_zone_t zone; + caddr_t cl; u_int refcount; }; Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Mon Feb 3 23:40:27 2020 (r357478) +++ head/sys/dev/cxgbe/t4_sge.c Mon Feb 3 23:50:29 2020 (r357479) @@ -1804,10 +1804,9 @@ cl_metadata(struct adapter *sc, struct sge_fl *fl, str static void rxb_free(struct mbuf *m) { - uma_zone_t zone = m->m_ext.ext_arg1; - void *cl = m->m_ext.ext_arg2; + struct cluster_metadata *clm = m->m_ext.ext_arg1; - uma_zfree(zone, cl); + uma_zfree(clm->zone, clm->cl); counter_u64_add(extfree_rels, 1); } @@ -1880,10 +1879,12 @@ get_scatter_segment(struct adapter *sc, struct sge_fl fl->mbuf_inlined++; if (sd->nmbuf++ == 0) { clm->refcount = 1; + clm->zone = swz->zone; + clm->cl = sd->cl; counter_u64_add(extfree_refs, 1); } - m_extaddref(m, payload, blen, &clm->refcount, rxb_free, - swz->zone, sd->cl); + m_extaddref(m, payload, blen, &clm->refcount, rxb_free, clm, + NULL); } else { /* @@ -1899,10 +1900,12 @@ get_scatter_segment(struct adapter *sc, struct sge_fl if (clm != NULL) { if (sd->nmbuf++ == 0) { clm->refcount = 1; + clm->zone = swz->zone; + clm->cl = sd->cl; counter_u64_add(extfree_refs, 1); } m_extaddref(m, payload, blen, &clm->refcount, - rxb_free, swz->zone, sd->cl); + rxb_free, clm, NULL); } else { m_cljset(m, sd->cl, swz->type); sd->cl = NULL; /* consumed, not a recycle candidate */ From owner-svn-src-all@freebsd.org Tue Feb 4 00:06:17 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 37F0F2340C9; Tue, 4 Feb 2020 00:06:17 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BQ2x0n62z4Lj4; Tue, 4 Feb 2020 00:06:17 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EDEC48E7E; Tue, 4 Feb 2020 00:06:16 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 01406GR0041223; Tue, 4 Feb 2020 00:06:16 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01406Ghl041221; Tue, 4 Feb 2020 00:06:16 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202002040006.01406Ghl041221@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Tue, 4 Feb 2020 00:06:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357480 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 357480 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 00:06:17 -0000 Author: arichardson Date: Tue Feb 4 00:06:16 2020 New Revision: 357480 URL: https://svnweb.freebsd.org/changeset/base/357480 Log: Set the LMA of the riscv kernel to the OpenSBI jump target by default This allows us to boot FreeBSD RISCV on QEMU using the -kernel command line options. When using that option, QEMU maps the kernel ELF file to the addresses specified in the LMAs in the program headers. Since version 4.2 QEMU ships with OpenSBI fw_jump by default so this allows booting FreeBSD using the following command line: qemu-system-riscv64 -bios default -kernel /.../boot/kernel/kernel -nographic -M virt Without this change the -kernel option cannot be used since the LMAs start at address zero and QEMU already maps a ROM to these low physical addresses. For targets that require a different kernel LMA the make variable KERNEL_LMA can be overwritten in the config file. For example, adding `makeoptions KERNEL_LMA=0xc0200000` will create an ELF file that will be loaded at 0xc0200000. Before: There are 4 program headers, starting at offset 64 Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align LOAD 0x001000 0xffffffc000000000 0x0000000000000000 0x75e598 0x8be318 RWE 0x1000 DYNAMIC 0x71fb20 0xffffffc00071eb20 0x000000000071eb20 0x000100 0x000100 RW 0x8 GNU_STACK 0x000000 0x0000000000000000 0x0000000000000000 0x000000 0x000000 RW 0x0 NOTE 0x693400 0xffffffc000692400 0x0000000000692400 0x000024 0x000024 R 0x4 After: There are 4 program headers, starting at offset 64 Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align LOAD 0x001000 0xffffffc000000000 0x0000000080200000 0x734198 0x893e18 RWE 0x1000 DYNAMIC 0x6f7810 0xffffffc0006f6810 0x00000000808f6810 0x000100 0x000100 RW 0x8 GNU_STACK 0x000000 0x0000000000000000 0x0000000000000000 0x000000 0x000000 RW 0x0 NOTE 0x66ca70 0xffffffc00066ba70 0x000000008086ba70 0x000024 0x000024 R 0x4 Reviewed By: br, mhorne (earlier version) Differential Revision: https://reviews.freebsd.org/D23436 Modified: head/sys/conf/Makefile.riscv head/sys/conf/ldscript.riscv Modified: head/sys/conf/Makefile.riscv ============================================================================== --- head/sys/conf/Makefile.riscv Mon Feb 3 23:50:29 2020 (r357479) +++ head/sys/conf/Makefile.riscv Tue Feb 4 00:06:16 2020 (r357480) @@ -28,8 +28,17 @@ S= ../../.. INCLUDES+= -I$S/contrib/libfdt +# Set the ELF LMA to the address that OpenSBI's fw_jump jumps to. This allows +# us to load the kernel with the -kernel flag in QEMU without having to embed +# it inside BBL or OpenSBI's fw_payload first. +# Note: For rv32 the start address is different (0x80400000). +# We set this value using --defsym rather than hardcoding it in ldscript.riscv +# so that different kernel configs can override the load address. +KERNEL_LMA?= 0x80200000 + SYSTEM_LD= @${LD} -N -m ${LD_EMULATION} -Bdynamic -T ${LDSCRIPT} ${_LDFLAGS} \ --no-warn-mismatch --warn-common --export-dynamic \ + --defsym='kernel_lma=${KERNEL_LMA}' \ --dynamic-linker /red/herring \ -o ${.TARGET} -X ${SYSTEM_OBJS} vers.o Modified: head/sys/conf/ldscript.riscv ============================================================================== --- head/sys/conf/ldscript.riscv Mon Feb 3 23:50:29 2020 (r357479) +++ head/sys/conf/ldscript.riscv Tue Feb 4 00:06:16 2020 (r357480) @@ -7,7 +7,8 @@ SECTIONS { /* Read-only sections, merged into text segment: */ . = kernbase; - .text : AT(ADDR(.text) - kernbase) + /* The load address kernel_lma is set using --defsym= on the command line. */ + .text : AT(kernel_lma) { *(.text) *(.stub) From owner-svn-src-all@freebsd.org Tue Feb 4 00:51:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3064C235BA2; Tue, 4 Feb 2020 00:51:12 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BR2m19ccz4Q56; Tue, 4 Feb 2020 00:51:12 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 235CF9654; Tue, 4 Feb 2020 00:51:12 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0140pClS069169; Tue, 4 Feb 2020 00:51:12 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0140pBXw069165; Tue, 4 Feb 2020 00:51:11 GMT (envelope-from np@FreeBSD.org) Message-Id: <202002040051.0140pBXw069165@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 4 Feb 2020 00:51:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357481 - in head: share/man/man4 sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head: share/man/man4 sys/dev/cxgbe X-SVN-Commit-Revision: 357481 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 00:51:12 -0000 Author: np Date: Tue Feb 4 00:51:10 2020 New Revision: 357481 URL: https://svnweb.freebsd.org/changeset/base/357481 Log: cxgbe(4): Retire the allow_mbufs_in_cluster optimization. This simplifies the driver's rx fast path as well as the bookkeeping code that tracks various rx buffer sizes and layouts. MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/share/man/man4/cxgbe.4 head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_netmap.c head/sys/dev/cxgbe/t4_sge.c Modified: head/share/man/man4/cxgbe.4 ============================================================================== --- head/share/man/man4/cxgbe.4 Tue Feb 4 00:06:16 2020 (r357480) +++ head/share/man/man4/cxgbe.4 Tue Feb 4 00:51:10 2020 (r357481) @@ -317,11 +317,6 @@ Allow the hardware to deliver multiple frames in the s opportunistically. The default is -1 which lets the driver decide. 0 or 1 explicitly disable or enable this feature. -.It Va hw.cxgbe.allow_mbufs_in_cluster -1 allows the driver to lay down one or more mbufs within the receive buffer -opportunistically. -This is the default. -0 prohibits the driver from doing so. .It Va hw.cxgbe.largest_rx_cluster .It Va hw.cxgbe.safest_rx_cluster Sizes of rx clusters. Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Tue Feb 4 00:06:16 2020 (r357480) +++ head/sys/dev/cxgbe/adapter.h Tue Feb 4 00:51:10 2020 (r357481) @@ -316,15 +316,6 @@ struct port_info { #define IS_MAIN_VI(vi) ((vi) == &((vi)->pi->vi[0])) -/* Where the cluster came from, how it has been carved up. */ -struct cluster_layout { - int8_t zidx; - int8_t hwidx; - uint16_t region1; /* mbufs laid out within this region */ - /* region2 is the DMA region */ - uint16_t region3; /* cluster_metadata within this region */ -}; - struct cluster_metadata { uma_zone_t zone; caddr_t cl; @@ -334,7 +325,8 @@ struct cluster_metadata { struct fl_sdesc { caddr_t cl; uint16_t nmbuf; /* # of driver originated mbufs with ref on cluster */ - struct cluster_layout cll; + int16_t moff; /* offset of metadata from cl */ + uint8_t zidx; }; struct tx_desc { @@ -466,20 +458,17 @@ struct sge_eq { char lockname[16]; }; -struct sw_zone_info { +struct rx_buf_info { uma_zone_t zone; /* zone that this cluster comes from */ - int size; /* size of cluster: 2K, 4K, 9K, 16K, etc. */ - int type; /* EXT_xxx type of the cluster */ - int8_t head_hwidx; - int8_t tail_hwidx; + uint16_t size1; /* same as size of cluster: 2K/4K/9K/16K. + * hwsize[hwidx1] = size1. No spare. */ + uint16_t size2; /* hwsize[hwidx2] = size2. + * spare in cluster = size1 - size2. */ + int8_t hwidx1; /* SGE bufsize idx for size1 */ + int8_t hwidx2; /* SGE bufsize idx for size2 */ + uint8_t type; /* EXT_xxx type of the cluster */ }; -struct hw_buf_info { - int8_t zidx; /* backpointer to zone; -ve means unused */ - int8_t next; /* next hwidx for this zone; -1 means no more */ - int size; -}; - enum { NUM_MEMWIN = 3, @@ -519,7 +508,8 @@ struct sge_fl { struct mtx fl_lock; __be64 *desc; /* KVA of descriptor ring, ptr to addresses */ struct fl_sdesc *sdesc; /* KVA of software descriptor ring */ - struct cluster_layout cll_def; /* default refill zone, layout */ + uint16_t zidx; /* refill zone idx */ + uint16_t safe_zidx; uint16_t lowat; /* # of buffers <= this means fl needs help */ int flags; uint16_t buf_boundary; @@ -537,8 +527,6 @@ struct sge_fl { u_int rx_offset; /* offset in fl buf (when buffer packing) */ volatile uint32_t *udb; - uint64_t mbuf_allocated;/* # of mbuf allocated from zone_mbuf */ - uint64_t mbuf_inlined; /* # of mbuf created within clusters */ uint64_t cl_allocated; /* # of clusters allocated */ uint64_t cl_recycled; /* # of clusters recycled */ uint64_t cl_fast_recycled; /* # of clusters recycled (fast) */ @@ -555,7 +543,6 @@ struct sge_fl { bus_dmamap_t desc_map; char lockname[16]; bus_addr_t ba; /* bus address of descriptor ring */ - struct cluster_layout cll_alt; /* alternate refill zone, layout */ }; struct mp_ring; @@ -781,10 +768,8 @@ struct sge { struct sge_iq **iqmap; /* iq->cntxt_id to iq mapping */ struct sge_eq **eqmap; /* eq->cntxt_id to eq mapping */ - int8_t safe_hwidx1; /* may not have room for metadata */ - int8_t safe_hwidx2; /* with room for metadata and maybe more */ - struct sw_zone_info sw_zone_info[SW_ZONE_SIZES]; - struct hw_buf_info hw_buf_info[SGE_FLBUF_SIZES]; + int8_t safe_zidx; + struct rx_buf_info rx_buf_info[SW_ZONE_SIZES]; }; struct devnames { Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Tue Feb 4 00:06:16 2020 (r357480) +++ head/sys/dev/cxgbe/t4_main.c Tue Feb 4 00:51:10 2020 (r357481) @@ -10291,8 +10291,6 @@ clear_stats(struct adapter *sc, u_int port_id) rxq->rxcsum = 0; rxq->vlan_extraction = 0; - rxq->fl.mbuf_allocated = 0; - rxq->fl.mbuf_inlined = 0; rxq->fl.cl_allocated = 0; rxq->fl.cl_recycled = 0; rxq->fl.cl_fast_recycled = 0; @@ -10334,8 +10332,6 @@ clear_stats(struct adapter *sc, u_int port_id) #endif #ifdef TCP_OFFLOAD for_each_ofld_rxq(vi, i, ofld_rxq) { - ofld_rxq->fl.mbuf_allocated = 0; - ofld_rxq->fl.mbuf_inlined = 0; ofld_rxq->fl.cl_allocated = 0; ofld_rxq->fl.cl_recycled = 0; ofld_rxq->fl.cl_fast_recycled = 0; Modified: head/sys/dev/cxgbe/t4_netmap.c ============================================================================== --- head/sys/dev/cxgbe/t4_netmap.c Tue Feb 4 00:06:16 2020 (r357480) +++ head/sys/dev/cxgbe/t4_netmap.c Tue Feb 4 00:51:10 2020 (r357481) @@ -345,7 +345,7 @@ cxgbe_netmap_on(struct adapter *sc, struct vi_info *vi struct sge_nm_rxq *nm_rxq; struct sge_nm_txq *nm_txq; int rc, i, j, hwidx, defq, nrssq; - struct hw_buf_info *hwb; + struct rx_buf_info *rxb; ASSERT_SYNCHRONIZED_OP(sc); @@ -353,17 +353,22 @@ cxgbe_netmap_on(struct adapter *sc, struct vi_info *vi (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) return (EAGAIN); - hwb = &sc->sge.hw_buf_info[0]; - for (i = 0; i < SGE_FLBUF_SIZES; i++, hwb++) { - if (hwb->size == NETMAP_BUF_SIZE(na)) + rxb = &sc->sge.rx_buf_info[0]; + for (i = 0; i < SW_ZONE_SIZES; i++, rxb++) { + if (rxb->size1 == NETMAP_BUF_SIZE(na)) { + hwidx = rxb->hwidx1; break; + } + if (rxb->size2 == NETMAP_BUF_SIZE(na)) { + hwidx = rxb->hwidx2; + break; + } } - if (i >= SGE_FLBUF_SIZES) { + if (i >= SW_ZONE_SIZES) { if_printf(ifp, "no hwidx for netmap buffer size %d.\n", NETMAP_BUF_SIZE(na)); return (ENXIO); } - hwidx = i; /* Must set caps before calling netmap_reset */ nm_set_native_flags(na); Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Tue Feb 4 00:06:16 2020 (r357480) +++ head/sys/dev/cxgbe/t4_sge.c Tue Feb 4 00:51:10 2020 (r357481) @@ -148,16 +148,6 @@ SYSCTL_INT(_hw_cxgbe, OID_AUTO, fl_pack, CTLFLAG_RDTUN "payload pack boundary (bytes)"); /* - * Allow the driver to create mbuf(s) in a cluster allocated for rx. - * 0: never; always allocate mbufs from the zone_mbuf UMA zone. - * 1: ok to create mbuf(s) within a cluster if there is room. - */ -static int allow_mbufs_in_cluster = 1; -SYSCTL_INT(_hw_cxgbe, OID_AUTO, allow_mbufs_in_cluster, CTLFLAG_RDTUN, - &allow_mbufs_in_cluster, 0, - "Allow driver to create mbufs within a rx cluster"); - -/* * Largest rx cluster size that the driver is allowed to allocate. */ static int largest_rx_cluster = MJUM16BYTES; @@ -284,8 +274,7 @@ static int refill_fl(struct adapter *, struct sge_fl * static void refill_sfl(void *); static int alloc_fl_sdesc(struct sge_fl *); static void free_fl_sdesc(struct adapter *, struct sge_fl *); -static void find_best_refill_source(struct adapter *, struct sge_fl *, int); -static void find_safe_refill_source(struct adapter *, struct sge_fl *); +static int find_refill_source(struct adapter *, int, bool); static void add_fl_to_sfl(struct adapter *, struct sge_fl *); static inline void get_pkt_gl(struct mbuf *, struct sglist *); @@ -670,24 +659,19 @@ setup_pad_and_pack_boundaries(struct adapter *sc) void t4_tweak_chip_settings(struct adapter *sc) { - int i; + int i, reg; uint32_t v, m; int intr_timer[SGE_NTIMERS] = {1, 5, 10, 50, 100, 200}; int timer_max = M_TIMERVALUE0 * 1000 / sc->params.vpd.cclk; int intr_pktcount[SGE_NCOUNTERS] = {1, 8, 16, 32}; /* 63 max */ uint16_t indsz = min(RX_COPY_THRESHOLD - 1, M_INDICATESIZE); - static int sge_flbuf_sizes[] = { + static int sw_buf_sizes[] = { MCLBYTES, #if MJUMPAGESIZE != MCLBYTES MJUMPAGESIZE, - MJUMPAGESIZE - CL_METADATA_SIZE, - MJUMPAGESIZE - 2 * MSIZE - CL_METADATA_SIZE, #endif MJUM9BYTES, - MJUM16BYTES, - MCLBYTES - MSIZE - CL_METADATA_SIZE, - MJUM9BYTES - CL_METADATA_SIZE, - MJUM16BYTES - CL_METADATA_SIZE, + MJUM16BYTES }; KASSERT(sc->flags & MASTER_PF, @@ -710,13 +694,16 @@ t4_tweak_chip_settings(struct adapter *sc) V_HOSTPAGESIZEPF7(PAGE_SHIFT - 10); t4_write_reg(sc, A_SGE_HOST_PAGE_SIZE, v); - KASSERT(nitems(sge_flbuf_sizes) <= SGE_FLBUF_SIZES, - ("%s: hw buffer size table too big", __func__)); t4_write_reg(sc, A_SGE_FL_BUFFER_SIZE0, 4096); t4_write_reg(sc, A_SGE_FL_BUFFER_SIZE1, 65536); - for (i = 0; i < min(nitems(sge_flbuf_sizes), SGE_FLBUF_SIZES); i++) { - t4_write_reg(sc, A_SGE_FL_BUFFER_SIZE15 - (4 * i), - sge_flbuf_sizes[i]); + reg = A_SGE_FL_BUFFER_SIZE2; + for (i = 0; i < nitems(sw_buf_sizes); i++) { + MPASS(reg <= A_SGE_FL_BUFFER_SIZE15); + t4_write_reg(sc, reg, sw_buf_sizes[i]); + reg += 4; + MPASS(reg <= A_SGE_FL_BUFFER_SIZE15); + t4_write_reg(sc, reg, sw_buf_sizes[i] - CL_METADATA_SIZE); + reg += 4; } v = V_THRESHOLD_0(intr_pktcount[0]) | V_THRESHOLD_1(intr_pktcount[1]) | @@ -793,11 +780,11 @@ t4_tweak_chip_settings(struct adapter *sc) } /* - * SGE wants the buffer to be at least 64B and then a multiple of 16. If - * padding is in use, the buffer's start and end need to be aligned to the pad - * boundary as well. We'll just make sure that the size is a multiple of the - * boundary here, it is up to the buffer allocation code to make sure the start - * of the buffer is aligned as well. + * SGE wants the buffer to be at least 64B and then a multiple of 16. Its + * address mut be 16B aligned. If padding is in use the buffer's start and end + * need to be aligned to the pad boundary as well. We'll just make sure that + * the size is a multiple of the pad boundary here, it is up to the buffer + * allocation code to make sure the start of the buffer is aligned. */ static inline int hwsz_ok(struct adapter *sc, int hwsz) @@ -826,8 +813,7 @@ t4_read_chip_settings(struct adapter *sc) MJUM9BYTES, MJUM16BYTES }; - struct sw_zone_info *swz, *safe_swz; - struct hw_buf_info *hwb; + struct rx_buf_info *rxb; m = F_RXPKTCPLMODE; v = F_RXPKTCPLMODE; @@ -846,114 +832,51 @@ t4_read_chip_settings(struct adapter *sc) rc = EINVAL; } - /* Filter out unusable hw buffer sizes entirely (mark with -2). */ - hwb = &s->hw_buf_info[0]; - for (i = 0; i < nitems(s->hw_buf_info); i++, hwb++) { - r = sc->params.sge.sge_fl_buffer_size[i]; - hwb->size = r; - hwb->zidx = hwsz_ok(sc, r) ? -1 : -2; - hwb->next = -1; - } + s->safe_zidx = -1; + rxb = &s->rx_buf_info[0]; + for (i = 0; i < SW_ZONE_SIZES; i++, rxb++) { + rxb->size1 = sw_buf_sizes[i]; + rxb->zone = m_getzone(rxb->size1); + rxb->type = m_gettype(rxb->size1); + rxb->size2 = 0; + rxb->hwidx1 = -1; + rxb->hwidx2 = -1; + for (j = 0; j < SGE_FLBUF_SIZES; j++) { + int hwsize = sp->sge_fl_buffer_size[j]; - /* - * Create a sorted list in decreasing order of hw buffer sizes (and so - * increasing order of spare area) for each software zone. - * - * If padding is enabled then the start and end of the buffer must align - * to the pad boundary; if packing is enabled then they must align with - * the pack boundary as well. Allocations from the cluster zones are - * aligned to min(size, 4K), so the buffer starts at that alignment and - * ends at hwb->size alignment. If mbuf inlining is allowed the - * starting alignment will be reduced to MSIZE and the driver will - * exercise appropriate caution when deciding on the best buffer layout - * to use. - */ - n = 0; /* no usable buffer size to begin with */ - swz = &s->sw_zone_info[0]; - safe_swz = NULL; - for (i = 0; i < SW_ZONE_SIZES; i++, swz++) { - int8_t head = -1, tail = -1; - - swz->size = sw_buf_sizes[i]; - swz->zone = m_getzone(swz->size); - swz->type = m_gettype(swz->size); - - if (swz->size < PAGE_SIZE) { - MPASS(powerof2(swz->size)); - if (fl_pad && (swz->size % sp->pad_boundary != 0)) + if (!hwsz_ok(sc, hwsize)) continue; - } - if (swz->size == safest_rx_cluster) - safe_swz = swz; + /* hwidx for size1 */ + if (rxb->hwidx1 == -1 && rxb->size1 == hwsize) + rxb->hwidx1 = j; - hwb = &s->hw_buf_info[0]; - for (j = 0; j < SGE_FLBUF_SIZES; j++, hwb++) { - if (hwb->zidx != -1 || hwb->size > swz->size) + /* hwidx for size2 (buffer packing) */ + if (rxb->size1 - CL_METADATA_SIZE < hwsize) continue; -#ifdef INVARIANTS - if (fl_pad) - MPASS(hwb->size % sp->pad_boundary == 0); -#endif - hwb->zidx = i; - if (head == -1) - head = tail = j; - else if (hwb->size < s->hw_buf_info[tail].size) { - s->hw_buf_info[tail].next = j; - tail = j; - } else { - int8_t *cur; - struct hw_buf_info *t; - - for (cur = &head; *cur != -1; cur = &t->next) { - t = &s->hw_buf_info[*cur]; - if (hwb->size == t->size) { - hwb->zidx = -2; - break; - } - if (hwb->size > t->size) { - hwb->next = *cur; - *cur = j; - break; - } + n = rxb->size1 - hwsize - CL_METADATA_SIZE; + if (n == 0) { + rxb->hwidx2 = j; + rxb->size2 = hwsize; + break; /* stop looking */ + } + if (rxb->hwidx2 != -1) { + if (n < sp->sge_fl_buffer_size[rxb->hwidx2] - + hwsize - CL_METADATA_SIZE) { + rxb->hwidx2 = j; + rxb->size2 = hwsize; } + } else if (n <= 2 * CL_METADATA_SIZE) { + rxb->hwidx2 = j; + rxb->size2 = hwsize; } } - swz->head_hwidx = head; - swz->tail_hwidx = tail; - - if (tail != -1) { - n++; - if (swz->size - s->hw_buf_info[tail].size >= - CL_METADATA_SIZE) - sc->flags |= BUF_PACKING_OK; - } + if (rxb->hwidx2 != -1) + sc->flags |= BUF_PACKING_OK; + if (s->safe_zidx == -1 && rxb->size1 == safest_rx_cluster) + s->safe_zidx = i; } - if (n == 0) { - device_printf(sc->dev, "no usable SGE FL buffer size.\n"); - rc = EINVAL; - } - s->safe_hwidx1 = -1; - s->safe_hwidx2 = -1; - if (safe_swz != NULL) { - s->safe_hwidx1 = safe_swz->head_hwidx; - for (i = safe_swz->head_hwidx; i != -1; i = hwb->next) { - int spare; - - hwb = &s->hw_buf_info[i]; -#ifdef INVARIANTS - if (fl_pad) - MPASS(hwb->size % sp->pad_boundary == 0); -#endif - spare = safe_swz->size - hwb->size; - if (spare >= CL_METADATA_SIZE) { - s->safe_hwidx2 = i; - break; - } - } - } - if (sc->flags & IS_VF) return (0); @@ -1012,7 +935,7 @@ t4_sge_sysctls(struct adapter *sc, struct sysctl_ctx_l struct sge_params *sp = &sc->params.sge; SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "buffer_sizes", - CTLTYPE_STRING | CTLFLAG_RD, &sc->sge, 0, sysctl_bufsizes, "A", + CTLTYPE_STRING | CTLFLAG_RD, sc, 0, sysctl_bufsizes, "A", "freelist buffer sizes"); SYSCTL_ADD_INT(ctx, children, OID_AUTO, "fl_pktshift", CTLFLAG_RD, @@ -1608,6 +1531,20 @@ last_flit_to_ns(struct adapter *sc, uint64_t lf) return (n * 1000000 / sc->params.vpd.cclk); } +static inline void +move_to_next_rxbuf(struct sge_fl *fl) +{ + + fl->rx_offset = 0; + if (__predict_false((++fl->cidx & 7) == 0)) { + uint16_t cidx = fl->cidx >> 3; + + if (__predict_false(cidx == fl->sidx)) + fl->cidx = cidx = 0; + fl->hw_cidx = cidx; + } +} + /* * Deals with interrupts on an iq+fl queue. */ @@ -1618,8 +1555,8 @@ service_iq_fl(struct sge_iq *iq, int budget) struct sge_fl *fl; struct adapter *sc = iq->adapter; struct iq_desc *d = &iq->desc[iq->cidx]; - int ndescs = 0, limit; - int rsp_type, refill, starved; + int ndescs, limit; + int rsp_type, starved; uint32_t lq; uint16_t fl_hw_cidx; struct mbuf *m0; @@ -1631,10 +1568,7 @@ service_iq_fl(struct sge_iq *iq, int budget) KASSERT(iq->state == IQS_BUSY, ("%s: iq %p not BUSY", __func__, iq)); MPASS(iq->flags & IQ_HAS_FL); - limit = budget ? budget : iq->qsize / 16; - fl = &rxq->fl; - fl_hw_cidx = fl->hw_cidx; /* stable snapshot */ - + ndescs = 0; #if defined(INET) || defined(INET6) if (iq->flags & IQ_ADJ_CREDIT) { MPASS(sort_before_lro(lro)); @@ -1652,22 +1586,34 @@ service_iq_fl(struct sge_iq *iq, int budget) MPASS((iq->flags & IQ_ADJ_CREDIT) == 0); #endif + limit = budget ? budget : iq->qsize / 16; + fl = &rxq->fl; + fl_hw_cidx = fl->hw_cidx; /* stable snapshot */ while ((d->rsp.u.type_gen & F_RSPD_GEN) == iq->gen) { rmb(); - refill = 0; m0 = NULL; rsp_type = G_RSPD_TYPE(d->rsp.u.type_gen); lq = be32toh(d->rsp.pldbuflen_qid); switch (rsp_type) { case X_RSPD_TYPE_FLBUF: + if (lq & F_RSPD_NEWBUF) { + if (fl->rx_offset > 0) + move_to_next_rxbuf(fl); + lq = G_RSPD_LEN(lq); + } + if (IDXDIFF(fl->hw_cidx, fl_hw_cidx, fl->sidx) > 4) { + FL_LOCK(fl); + refill_fl(sc, fl, 64); + FL_UNLOCK(fl); + fl_hw_cidx = fl->hw_cidx; + } m0 = get_fl_payload(sc, fl, lq); if (__predict_false(m0 == NULL)) goto out; - refill = IDXDIFF(fl->hw_cidx, fl_hw_cidx, fl->sidx) > 2; if (iq->flags & IQ_RX_TIMESTAMP) { /* @@ -1727,7 +1673,6 @@ service_iq_fl(struct sge_iq *iq, int budget) t4_write_reg(sc, sc->sge_gts_reg, V_CIDXINC(ndescs) | V_INGRESSQID(iq->cntxt_id) | V_SEINTARM(V_QINTR_TIMER_IDX(X_TIMERREG_UPDATE_CIDX))); - ndescs = 0; #if defined(INET) || defined(INET6) if (iq->flags & IQ_LRO_ENABLED && @@ -1736,20 +1681,10 @@ service_iq_fl(struct sge_iq *iq, int budget) tcp_lro_flush_inactive(lro, &lro_timeout); } #endif - if (budget) { - FL_LOCK(fl); - refill_fl(sc, fl, 32); - FL_UNLOCK(fl); - + if (budget) return (EINPROGRESS); - } + ndescs = 0; } - if (refill) { - FL_LOCK(fl); - refill_fl(sc, fl, 32); - FL_UNLOCK(fl); - fl_hw_cidx = fl->hw_cidx; - } } out: #if defined(INET) || defined(INET6) @@ -1777,28 +1712,11 @@ out: return (0); } -static inline int -cl_has_metadata(struct sge_fl *fl, struct cluster_layout *cll) -{ - int rc = fl->flags & FL_BUF_PACKING || cll->region1 > 0; - - if (rc) - MPASS(cll->region3 >= CL_METADATA_SIZE); - - return (rc); -} - static inline struct cluster_metadata * -cl_metadata(struct adapter *sc, struct sge_fl *fl, struct cluster_layout *cll, - caddr_t cl) +cl_metadata(struct fl_sdesc *sd) { - if (cl_has_metadata(fl, cll)) { - struct sw_zone_info *swz = &sc->sge.sw_zone_info[cll->zidx]; - - return ((struct cluster_metadata *)(cl + swz->size) - 1); - } - return (NULL); + return ((void *)(sd->cl + sd->moff)); } static void @@ -1811,14 +1729,11 @@ rxb_free(struct mbuf *m) } /* - * The mbuf returned by this function could be allocated from zone_mbuf or - * constructed in spare room in the cluster. - * - * The mbuf carries the payload in one of these ways - * a) frame inside the mbuf (mbuf from zone_mbuf) - * b) m_cljset (for clusters without metadata) zone_mbuf - * c) m_extaddref (cluster with metadata) inline mbuf - * d) m_extaddref (cluster with metadata) zone_mbuf + * The mbuf returned comes from zone_muf and carries the payload in one of these + * ways + * a) complete frame inside the mbuf + * b) m_cljset (for clusters without metadata) + * d) m_extaddref (cluster with metadata) */ static struct mbuf * get_scatter_segment(struct adapter *sc, struct sge_fl *fl, int fr_offset, @@ -1826,125 +1741,86 @@ get_scatter_segment(struct adapter *sc, struct sge_fl { struct mbuf *m; struct fl_sdesc *sd = &fl->sdesc[fl->cidx]; - struct cluster_layout *cll = &sd->cll; - struct sw_zone_info *swz = &sc->sge.sw_zone_info[cll->zidx]; - struct hw_buf_info *hwb = &sc->sge.hw_buf_info[cll->hwidx]; - struct cluster_metadata *clm = cl_metadata(sc, fl, cll, sd->cl); + struct rx_buf_info *rxb = &sc->sge.rx_buf_info[sd->zidx]; + struct cluster_metadata *clm; int len, blen; caddr_t payload; - blen = hwb->size - fl->rx_offset; /* max possible in this buf */ - len = min(remaining, blen); - payload = sd->cl + cll->region1 + fl->rx_offset; if (fl->flags & FL_BUF_PACKING) { - const u_int l = fr_offset + len; - const u_int pad = roundup2(l, fl->buf_boundary) - l; + u_int l, pad; - if (fl->rx_offset + len + pad < hwb->size) + blen = rxb->size2 - fl->rx_offset; /* max possible in this buf */ + len = min(remaining, blen); + payload = sd->cl + fl->rx_offset; + + l = fr_offset + len; + pad = roundup2(l, fl->buf_boundary) - l; + if (fl->rx_offset + len + pad < rxb->size2) blen = len + pad; - MPASS(fl->rx_offset + blen <= hwb->size); + MPASS(fl->rx_offset + blen <= rxb->size2); } else { MPASS(fl->rx_offset == 0); /* not packing */ + blen = rxb->size1; + len = min(remaining, blen); + payload = sd->cl; } - - if (sc->sc_do_rxcopy && len < RX_COPY_THRESHOLD) { - - /* - * Copy payload into a freshly allocated mbuf. - */ - - m = fr_offset == 0 ? - m_gethdr(M_NOWAIT, MT_DATA) : m_get(M_NOWAIT, MT_DATA); - if (m == NULL) + if (fr_offset == 0) { + m = m_gethdr(M_NOWAIT, MT_DATA); + if (__predict_false(m == NULL)) return (NULL); - fl->mbuf_allocated++; + m->m_pkthdr.len = remaining; + } else { + m = m_get(M_NOWAIT, MT_DATA); + if (__predict_false(m == NULL)) + return (NULL); + } + m->m_len = len; + if (sc->sc_do_rxcopy && len < RX_COPY_THRESHOLD) { /* copy data to mbuf */ bcopy(payload, mtod(m, caddr_t), len); - - } else if (sd->nmbuf * MSIZE < cll->region1) { - - /* - * There's spare room in the cluster for an mbuf. Create one - * and associate it with the payload that's in the cluster. - */ - - MPASS(clm != NULL); - m = (struct mbuf *)(sd->cl + sd->nmbuf * MSIZE); - /* No bzero required */ - if (m_init(m, M_NOWAIT, MT_DATA, - fr_offset == 0 ? M_PKTHDR | M_NOFREE : M_NOFREE)) - return (NULL); - fl->mbuf_inlined++; + if (fl->flags & FL_BUF_PACKING) { + fl->rx_offset += blen; + MPASS(fl->rx_offset <= rxb->size2); + if (fl->rx_offset < rxb->size2) + return (m); /* without advancing the cidx */ + } + } else if (fl->flags & FL_BUF_PACKING) { + clm = cl_metadata(sd); if (sd->nmbuf++ == 0) { clm->refcount = 1; - clm->zone = swz->zone; + clm->zone = rxb->zone; clm->cl = sd->cl; counter_u64_add(extfree_refs, 1); } m_extaddref(m, payload, blen, &clm->refcount, rxb_free, clm, NULL); - } else { - /* - * Grab an mbuf from zone_mbuf and associate it with the - * payload in the cluster. - */ - - m = fr_offset == 0 ? - m_gethdr(M_NOWAIT, MT_DATA) : m_get(M_NOWAIT, MT_DATA); - if (m == NULL) - return (NULL); - fl->mbuf_allocated++; - if (clm != NULL) { - if (sd->nmbuf++ == 0) { - clm->refcount = 1; - clm->zone = swz->zone; - clm->cl = sd->cl; - counter_u64_add(extfree_refs, 1); - } - m_extaddref(m, payload, blen, &clm->refcount, - rxb_free, clm, NULL); - } else { - m_cljset(m, sd->cl, swz->type); - sd->cl = NULL; /* consumed, not a recycle candidate */ - } - } - if (fr_offset == 0) - m->m_pkthdr.len = remaining; - m->m_len = len; - - if (fl->flags & FL_BUF_PACKING) { fl->rx_offset += blen; - MPASS(fl->rx_offset <= hwb->size); - if (fl->rx_offset < hwb->size) + MPASS(fl->rx_offset <= rxb->size2); + if (fl->rx_offset < rxb->size2) return (m); /* without advancing the cidx */ + } else { + m_cljset(m, sd->cl, rxb->type); + sd->cl = NULL; /* consumed, not a recycle candidate */ } - if (__predict_false(++fl->cidx % 8 == 0)) { - uint16_t cidx = fl->cidx / 8; + move_to_next_rxbuf(fl); - if (__predict_false(cidx == fl->sidx)) - fl->cidx = cidx = 0; - fl->hw_cidx = cidx; - } - fl->rx_offset = 0; - return (m); } static struct mbuf * -get_fl_payload(struct adapter *sc, struct sge_fl *fl, uint32_t len_newbuf) +get_fl_payload(struct adapter *sc, struct sge_fl *fl, const u_int plen) { struct mbuf *m0, *m, **pnext; u_int remaining; - const u_int total = G_RSPD_LEN(len_newbuf); if (__predict_false(fl->flags & FL_BUF_RESUME)) { M_ASSERTPKTHDR(fl->m0); - MPASS(fl->m0->m_pkthdr.len == total); - MPASS(fl->remaining < total); + MPASS(fl->m0->m_pkthdr.len == plen); + MPASS(fl->remaining < plen); m0 = fl->m0; pnext = fl->pnext; @@ -1953,31 +1829,20 @@ get_fl_payload(struct adapter *sc, struct sge_fl *fl, goto get_segment; } - if (fl->rx_offset > 0 && len_newbuf & F_RSPD_NEWBUF) { - fl->rx_offset = 0; - if (__predict_false(++fl->cidx % 8 == 0)) { - uint16_t cidx = fl->cidx / 8; - - if (__predict_false(cidx == fl->sidx)) - fl->cidx = cidx = 0; - fl->hw_cidx = cidx; - } - } - /* * Payload starts at rx_offset in the current hw buffer. Its length is * 'len' and it may span multiple hw buffers. */ - m0 = get_scatter_segment(sc, fl, 0, total); + m0 = get_scatter_segment(sc, fl, 0, plen); if (m0 == NULL) return (NULL); - remaining = total - m0->m_len; + remaining = plen - m0->m_len; pnext = &m0->m_next; while (remaining > 0) { get_segment: MPASS(fl->rx_offset == 0); - m = get_scatter_segment(sc, fl, total - remaining, remaining); + m = get_scatter_segment(sc, fl, plen - remaining, remaining); if (__predict_false(m == NULL)) { fl->m0 = m0; fl->pnext = pnext; @@ -2202,7 +2067,8 @@ t4_update_fl_bufsize(struct ifnet *ifp) fl = &rxq->fl; FL_LOCK(fl); - find_best_refill_source(sc, fl, maxp); + fl->zidx = find_refill_source(sc, maxp, + fl->flags & FL_BUF_PACKING); FL_UNLOCK(fl); } #ifdef TCP_OFFLOAD @@ -2210,7 +2076,8 @@ t4_update_fl_bufsize(struct ifnet *ifp) fl = &ofld_rxq->fl; FL_LOCK(fl); - find_best_refill_source(sc, fl, maxp); + fl->zidx = find_refill_source(sc, maxp, + fl->flags & FL_BUF_PACKING); FL_UNLOCK(fl); } #endif @@ -3096,8 +2963,8 @@ init_fl(struct adapter *sc, struct sge_fl *fl, int qsi ((!is_t4(sc) && buffer_packing) || /* T5+: enabled unless 0 */ (is_t4(sc) && buffer_packing == 1)))/* T4: disabled unless 1 */ fl->flags |= FL_BUF_PACKING; - find_best_refill_source(sc, fl, maxp); - find_safe_refill_source(sc, fl); + fl->zidx = find_refill_source(sc, maxp, fl->flags & FL_BUF_PACKING); + fl->safe_zidx = sc->sge.safe_zidx; } static inline void @@ -3459,10 +3326,6 @@ add_fl_sysctls(struct adapter *sc, struct sysctl_ctx_l } SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "pidx", CTLFLAG_RD, &fl->pidx, 0, "producer index"); - SYSCTL_ADD_UQUAD(ctx, children, OID_AUTO, "mbuf_allocated", - CTLFLAG_RD, &fl->mbuf_allocated, "# of mbuf allocated"); - SYSCTL_ADD_UQUAD(ctx, children, OID_AUTO, "mbuf_inlined", - CTLFLAG_RD, &fl->mbuf_inlined, "# of mbuf inlined in clusters"); SYSCTL_ADD_UQUAD(ctx, children, OID_AUTO, "cluster_allocated", CTLFLAG_RD, &fl->cl_allocated, "# of clusters allocated"); SYSCTL_ADD_UQUAD(ctx, children, OID_AUTO, "cluster_recycled", @@ -4347,7 +4210,7 @@ ring_fl_db(struct adapter *sc, struct sge_fl *fl) { uint32_t n, v; - n = IDXDIFF(fl->pidx / 8, fl->dbidx, fl->sidx); + n = IDXDIFF(fl->pidx >> 3, fl->dbidx, fl->sidx); MPASS(n > 0); wmb(); @@ -4373,8 +4236,7 @@ refill_fl(struct adapter *sc, struct sge_fl *fl, int n struct fl_sdesc *sd; uintptr_t pa; caddr_t cl; - struct cluster_layout *cll; - struct sw_zone_info *swz; + struct rx_buf_info *rxb; struct cluster_metadata *clm; uint16_t max_pidx; uint16_t hw_cidx = fl->hw_cidx; /* stable snapshot */ @@ -4392,8 +4254,6 @@ refill_fl(struct adapter *sc, struct sge_fl *fl, int n d = &fl->desc[fl->pidx]; sd = &fl->sdesc[fl->pidx]; - cll = &fl->cll_def; /* default layout */ - swz = &sc->sge.sw_zone_info[cll->zidx]; while (n > 0) { @@ -4408,11 +4268,6 @@ refill_fl(struct adapter *sc, struct sge_fl *fl, int n * fit within a single mbuf each. */ fl->cl_fast_recycled++; -#ifdef INVARIANTS - clm = cl_metadata(sc, fl, &sd->cll, sd->cl); - if (clm != NULL) - MPASS(clm->refcount == 1); -#endif goto recycled; } @@ -4421,7 +4276,7 @@ refill_fl(struct adapter *sc, struct sge_fl *fl, int n * without metadata always take the fast recycle path * when they're recycled. */ - clm = cl_metadata(sc, fl, &sd->cll, sd->cl); + clm = cl_metadata(sd); MPASS(clm != NULL); if (atomic_fetchadd_int(&clm->refcount, -1) == 1) { @@ -4432,32 +4287,34 @@ refill_fl(struct adapter *sc, struct sge_fl *fl, int n sd->cl = NULL; /* gave up my reference */ } MPASS(sd->cl == NULL); -alloc: - cl = uma_zalloc(swz->zone, M_NOWAIT); - if (__predict_false(cl == NULL)) { - if (cll == &fl->cll_alt || fl->cll_alt.zidx == -1 || - fl->cll_def.zidx == fl->cll_alt.zidx) + rxb = &sc->sge.rx_buf_info[fl->zidx]; + cl = uma_zalloc(rxb->zone, M_NOWAIT); + if (__predict_false(cl == NULL) && fl->zidx != fl->safe_zidx) { + rxb = &sc->sge.rx_buf_info[fl->safe_zidx]; + cl = uma_zalloc(rxb->zone, M_NOWAIT); + if (__predict_false(cl == NULL)) break; - - /* fall back to the safe zone */ - cll = &fl->cll_alt; - swz = &sc->sge.sw_zone_info[cll->zidx]; - goto alloc; } fl->cl_allocated++; n--; pa = pmap_kextract((vm_offset_t)cl); - pa += cll->region1; sd->cl = cl; - sd->cll = *cll; - *d = htobe64(pa | cll->hwidx); + sd->zidx = fl->zidx; + + if (fl->flags & FL_BUF_PACKING) { + *d = htobe64(pa | rxb->hwidx2); + sd->moff = rxb->size2; + } else { + *d = htobe64(pa | rxb->hwidx1); + sd->moff = 0; + } recycled: sd->nmbuf = 0; d++; sd++; - if (__predict_false(++fl->pidx % 8 == 0)) { - uint16_t pidx = fl->pidx / 8; + if (__predict_false((++fl->pidx & 7) == 0)) { + uint16_t pidx = fl->pidx >> 3; if (__predict_false(pidx == fl->sidx)) { fl->pidx = 0; @@ -4465,7 +4322,7 @@ recycled: sd = fl->sdesc; d = fl->desc; } - if (pidx == max_pidx) + if (n < 8 || pidx == max_pidx) break; if (IDXDIFF(pidx, fl->dbidx, fl->sidx) >= 4) @@ -4473,7 +4330,7 @@ recycled: } } - if (fl->pidx / 8 != fl->dbidx) + if ((fl->pidx >> 3) != fl->dbidx) ring_fl_db(sc, fl); return (FL_RUNNING_LOW(fl) && !(fl->flags & FL_STARVING)); @@ -4518,7 +4375,6 @@ free_fl_sdesc(struct adapter *sc, struct sge_fl *fl) { struct fl_sdesc *sd; struct cluster_metadata *clm; - struct cluster_layout *cll; int i; sd = fl->sdesc; @@ -4526,13 +4382,15 @@ free_fl_sdesc(struct adapter *sc, struct sge_fl *fl) if (sd->cl == NULL) continue; - cll = &sd->cll; - clm = cl_metadata(sc, fl, cll, sd->cl); if (sd->nmbuf == 0) - uma_zfree(sc->sge.sw_zone_info[cll->zidx].zone, sd->cl); - else if (clm && atomic_fetchadd_int(&clm->refcount, -1) == 1) { - uma_zfree(sc->sge.sw_zone_info[cll->zidx].zone, sd->cl); - counter_u64_add(extfree_rels, 1); + uma_zfree(sc->sge.rx_buf_info[sd->zidx].zone, sd->cl); + else if (fl->flags & FL_BUF_PACKING) { + clm = cl_metadata(sd); + if (atomic_fetchadd_int(&clm->refcount, -1) == 1) { + uma_zfree(sc->sge.rx_buf_info[sd->zidx].zone, + sd->cl); + counter_u64_add(extfree_rels, 1); + } } sd->cl = NULL; } @@ -5428,182 +5286,42 @@ get_flit(struct sglist_seg *segs, int nsegs, int idx) return (0); } -static void -find_best_refill_source(struct adapter *sc, struct sge_fl *fl, int maxp) +static int +find_refill_source(struct adapter *sc, int maxp, bool packing) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Feb 4 01:01:35 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BE161236118; Tue, 4 Feb 2020 01:01:35 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BRGl4k3xz4Qx8; Tue, 4 Feb 2020 01:01:35 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9D5269941; Tue, 4 Feb 2020 01:01:35 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 01411ZD2074439; Tue, 4 Feb 2020 01:01:35 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01411Z8P074438; Tue, 4 Feb 2020 01:01:35 GMT (envelope-from np@FreeBSD.org) Message-Id: <202002040101.01411Z8P074438@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 4 Feb 2020 01:01:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357482 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 357482 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 01:01:35 -0000 Author: np Date: Tue Feb 4 01:01:35 2020 New Revision: 357482 URL: https://svnweb.freebsd.org/changeset/base/357482 Log: cxgbe(4): Treat NIC rx as special and run its handler directly and not via the t4_cpl_handler dispatch table. MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Tue Feb 4 00:51:10 2020 (r357481) +++ head/sys/dev/cxgbe/t4_sge.c Tue Feb 4 01:01:35 2020 (r357482) @@ -219,7 +219,8 @@ struct sgl { static int service_iq(struct sge_iq *, int); static int service_iq_fl(struct sge_iq *, int); static struct mbuf *get_fl_payload(struct adapter *, struct sge_fl *, uint32_t); -static int t4_eth_rx(struct sge_iq *, const struct rss_header *, struct mbuf *); +static int eth_rx(struct adapter *, struct sge_rxq *, const struct iq_desc *, + u_int); static inline void init_iq(struct sge_iq *, struct adapter *, int, int, int); static inline void init_fl(struct adapter *, struct sge_fl *, int, int, char *); static inline void init_eq(struct adapter *, struct sge_eq *, int, int, uint8_t, @@ -550,7 +551,6 @@ t4_sge_modload(void) t4_register_cpl_handler(CPL_FW4_MSG, handle_fw_msg); t4_register_cpl_handler(CPL_FW6_MSG, handle_fw_msg); t4_register_cpl_handler(CPL_SGE_EGR_UPDATE, handle_sge_egr_update); - t4_register_cpl_handler(CPL_RX_PKT, t4_eth_rx); #ifdef RATELIMIT t4_register_shared_cpl_handler(CPL_FW4_ACK, ethofld_fw4_ack, CPL_COOKIE_ETHOFLD); @@ -1611,25 +1611,15 @@ service_iq_fl(struct sge_iq *iq, int budget) fl_hw_cidx = fl->hw_cidx; } + if (d->rss.opcode == CPL_RX_PKT) { + if (__predict_true(eth_rx(sc, rxq, d, lq) == 0)) + break; + goto out; + } m0 = get_fl_payload(sc, fl, lq); if (__predict_false(m0 == NULL)) goto out; - if (iq->flags & IQ_RX_TIMESTAMP) { - /* - * Fill up rcv_tstmp but do not set M_TSTMP. - * rcv_tstmp is not in the format that the - * kernel expects and we don't want to mislead - * it. For now this is only for custom code - * that knows how to interpret cxgbe's stamp. - */ - m0->m_pkthdr.rcv_tstmp = - last_flit_to_ns(sc, d->rsp.u.last_flit); -#ifdef notyet - m0->m_flags |= M_TSTMP; -#endif - } - /* fall through */ case X_RSPD_TYPE_CPL: @@ -1861,12 +1851,13 @@ get_segment: } static int -t4_eth_rx(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m0) +eth_rx(struct adapter *sc, struct sge_rxq *rxq, const struct iq_desc *d, + u_int plen) { - struct sge_rxq *rxq = iq_to_rxq(iq); + struct mbuf *m0; struct ifnet *ifp = rxq->ifp; - struct adapter *sc = iq->adapter; - const struct cpl_rx_pkt *cpl = (const void *)(rss + 1); + struct sge_fl *fl = &rxq->fl; + const struct cpl_rx_pkt *cpl; #if defined(INET) || defined(INET6) struct lro_ctrl *lro = &rxq->lro; #endif @@ -1877,17 +1868,20 @@ t4_eth_rx(struct sge_iq *iq, const struct rss_header * {M_HASHTYPE_RSS_UDP_IPV4, M_HASHTYPE_RSS_UDP_IPV6}, }; - KASSERT(m0 != NULL, ("%s: no payload with opcode %02x", __func__, - rss->opcode)); + MPASS(plen > sc->params.sge.fl_pktshift); + m0 = get_fl_payload(sc, fl, plen); + if (__predict_false(m0 == NULL)) + return (ENOMEM); m0->m_pkthdr.len -= sc->params.sge.fl_pktshift; m0->m_len -= sc->params.sge.fl_pktshift; m0->m_data += sc->params.sge.fl_pktshift; m0->m_pkthdr.rcvif = ifp; - M_HASHTYPE_SET(m0, sw_hashtype[rss->hash_type][rss->ipv6]); - m0->m_pkthdr.flowid = be32toh(rss->hash_val); + M_HASHTYPE_SET(m0, sw_hashtype[d->rss.hash_type][d->rss.ipv6]); + m0->m_pkthdr.flowid = be32toh(d->rss.hash_val); + cpl = (const void *)(&d->rss + 1); if (cpl->csum_calc && !(cpl->err_vec & sc->params.tp.err_vec_mask)) { if (ifp->if_capenable & IFCAP_RXCSUM && cpl->l2info & htobe32(F_RXF_IP)) { @@ -1913,11 +1907,26 @@ t4_eth_rx(struct sge_iq *iq, const struct rss_header * rxq->vlan_extraction++; } + if (rxq->iq.flags & IQ_RX_TIMESTAMP) { + /* + * Fill up rcv_tstmp but do not set M_TSTMP. + * rcv_tstmp is not in the format that the + * kernel expects and we don't want to mislead + * it. For now this is only for custom code + * that knows how to interpret cxgbe's stamp. + */ + m0->m_pkthdr.rcv_tstmp = + last_flit_to_ns(sc, d->rsp.u.last_flit); +#ifdef notyet + m0->m_flags |= M_TSTMP; +#endif + } + #ifdef NUMA m0->m_pkthdr.numa_domain = ifp->if_numa_domain; #endif #if defined(INET) || defined(INET6) - if (iq->flags & IQ_LRO_ENABLED && + if (rxq->iq.flags & IQ_LRO_ENABLED && (M_HASHTYPE_GET(m0) == M_HASHTYPE_RSS_TCP_IPV4 || M_HASHTYPE_GET(m0) == M_HASHTYPE_RSS_TCP_IPV6)) { if (sort_before_lro(lro)) { From owner-svn-src-all@freebsd.org Tue Feb 4 01:09:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1B69723621F; Tue, 4 Feb 2020 01:09:03 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BRRL71dqz4RJC; Tue, 4 Feb 2020 01:09:02 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EBFC499A9; Tue, 4 Feb 2020 01:09:02 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014192Vv078115; Tue, 4 Feb 2020 01:09:02 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014192iL078112; Tue, 4 Feb 2020 01:09:02 GMT (envelope-from np@FreeBSD.org) Message-Id: <202002040109.014192iL078112@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 4 Feb 2020 01:09:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357483 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 357483 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 01:09:03 -0000 Author: np Date: Tue Feb 4 01:09:02 2020 New Revision: 357483 URL: https://svnweb.freebsd.org/changeset/base/357483 Log: cxgbe(4): Add pfil(9) hooks to the driver's rx. MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Tue Feb 4 01:01:35 2020 (r357482) +++ head/sys/dev/cxgbe/adapter.h Tue Feb 4 01:09:02 2020 (r357483) @@ -54,6 +54,7 @@ #include #include #include +#include #include #include @@ -191,6 +192,7 @@ struct vi_info { struct port_info *pi; struct ifnet *ifp; + struct pfil_head *pfil; unsigned long flags; int if_flags; Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Tue Feb 4 01:01:35 2020 (r357482) +++ head/sys/dev/cxgbe/t4_main.c Tue Feb 4 01:09:02 2020 (r357483) @@ -1673,6 +1673,7 @@ cxgbe_vi_attach(device_t dev, struct vi_info *vi) { struct ifnet *ifp; struct sbuf *sb; + struct pfil_head_args pa; vi->xact_addr_filt = -1; callout_init(&vi->tick, 1); @@ -1768,6 +1769,12 @@ cxgbe_vi_attach(device_t dev, struct vi_info *vi) vi_sysctls(vi); + pa.pa_version = PFIL_VERSION; + pa.pa_flags = PFIL_IN; + pa.pa_type = PFIL_TYPE_ETHERNET; + pa.pa_headname = ifp->if_xname; + vi->pfil = pfil_head_register(&pa); + return (0); } @@ -1807,6 +1814,11 @@ static void cxgbe_vi_detach(struct vi_info *vi) { struct ifnet *ifp = vi->ifp; + + if (vi->pfil != NULL) { + pfil_head_unregister(vi->pfil); + vi->pfil = NULL; + } ether_ifdetach(ifp); Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Tue Feb 4 01:01:35 2020 (r357482) +++ head/sys/dev/cxgbe/t4_sge.c Tue Feb 4 01:09:02 2020 (r357483) @@ -1851,12 +1851,73 @@ get_segment: } static int +skip_scatter_segment(struct adapter *sc, struct sge_fl *fl, int fr_offset, + int remaining) +{ + struct fl_sdesc *sd = &fl->sdesc[fl->cidx]; + struct rx_buf_info *rxb = &sc->sge.rx_buf_info[sd->zidx]; + int len, blen; + + if (fl->flags & FL_BUF_PACKING) { + u_int l, pad; + + blen = rxb->size2 - fl->rx_offset; /* max possible in this buf */ + len = min(remaining, blen); + + l = fr_offset + len; + pad = roundup2(l, fl->buf_boundary) - l; + if (fl->rx_offset + len + pad < rxb->size2) + blen = len + pad; + fl->rx_offset += blen; + MPASS(fl->rx_offset <= rxb->size2); + if (fl->rx_offset < rxb->size2) + return (len); /* without advancing the cidx */ + } else { + MPASS(fl->rx_offset == 0); /* not packing */ + blen = rxb->size1; + len = min(remaining, blen); + } + move_to_next_rxbuf(fl); + return (len); +} + +static inline void +skip_fl_payload(struct adapter *sc, struct sge_fl *fl, int plen) +{ + int remaining, fr_offset, len; + + fr_offset = 0; + remaining = plen; + while (remaining > 0) { + len = skip_scatter_segment(sc, fl, fr_offset, remaining); + fr_offset += len; + remaining -= len; + } +} + +static inline int +get_segment_len(struct adapter *sc, struct sge_fl *fl, int plen) +{ + int len; + struct fl_sdesc *sd = &fl->sdesc[fl->cidx]; + struct rx_buf_info *rxb = &sc->sge.rx_buf_info[sd->zidx]; + + if (fl->flags & FL_BUF_PACKING) + len = rxb->size2 - fl->rx_offset; + else + len = rxb->size1; + + return (min(plen, len)); +} + +static int eth_rx(struct adapter *sc, struct sge_rxq *rxq, const struct iq_desc *d, u_int plen) { struct mbuf *m0; struct ifnet *ifp = rxq->ifp; struct sge_fl *fl = &rxq->fl; + struct vi_info *vi = ifp->if_softc; const struct cpl_rx_pkt *cpl; #if defined(INET) || defined(INET6) struct lro_ctrl *lro = &rxq->lro; @@ -1869,6 +1930,30 @@ eth_rx(struct adapter *sc, struct sge_rxq *rxq, const }; MPASS(plen > sc->params.sge.fl_pktshift); + if (vi->pfil != NULL && PFIL_HOOKED_IN(vi->pfil) && + __predict_true((fl->flags & FL_BUF_RESUME) == 0)) { + struct fl_sdesc *sd = &fl->sdesc[fl->cidx]; + caddr_t frame; + int rc, slen; + + slen = get_segment_len(sc, fl, plen) - + sc->params.sge.fl_pktshift; + frame = sd->cl + fl->rx_offset + sc->params.sge.fl_pktshift; + CURVNET_SET_QUIET(ifp->if_vnet); + rc = pfil_run_hooks(vi->pfil, frame, ifp, + slen | PFIL_MEMPTR | PFIL_IN, NULL); + CURVNET_RESTORE(); + if (rc == PFIL_DROPPED || rc == PFIL_CONSUMED) { + skip_fl_payload(sc, fl, plen); + return (0); + } + if (rc == PFIL_REALLOCED) { + skip_fl_payload(sc, fl, plen); + m0 = pfil_mem2mbuf(frame); + goto have_mbuf; + } + } + m0 = get_fl_payload(sc, fl, plen); if (__predict_false(m0 == NULL)) return (ENOMEM); @@ -1877,6 +1962,7 @@ eth_rx(struct adapter *sc, struct sge_rxq *rxq, const m0->m_len -= sc->params.sge.fl_pktshift; m0->m_data += sc->params.sge.fl_pktshift; +have_mbuf: m0->m_pkthdr.rcvif = ifp; M_HASHTYPE_SET(m0, sw_hashtype[d->rss.hash_type][d->rss.ipv6]); m0->m_pkthdr.flowid = be32toh(d->rss.hash_val); From owner-svn-src-all@freebsd.org Tue Feb 4 02:06:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2B7E9238A78; Tue, 4 Feb 2020 02:06:22 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BSjV0LrRz4VT8; Tue, 4 Feb 2020 02:06:22 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 07130A50C; Tue, 4 Feb 2020 02:06:22 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 01426LqL013942; Tue, 4 Feb 2020 02:06:21 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01426Lf3013941; Tue, 4 Feb 2020 02:06:21 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202002040206.01426Lf3013941@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 4 Feb 2020 02:06:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357484 - stable/12/sys/arm64/arm64 X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/arm64/arm64 X-SVN-Commit-Revision: 357484 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 02:06:22 -0000 Author: markj Date: Tue Feb 4 02:06:21 2020 New Revision: 357484 URL: https://svnweb.freebsd.org/changeset/base/357484 Log: MFC r356947: Add relocation handling required for -zifunc-noplt to work on arm64. Modified: stable/12/sys/arm64/arm64/elf_machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm64/arm64/elf_machdep.c ============================================================================== --- stable/12/sys/arm64/arm64/elf_machdep.c Tue Feb 4 01:09:02 2020 (r357483) +++ stable/12/sys/arm64/arm64/elf_machdep.c Tue Feb 4 02:06:21 2020 (r357484) @@ -122,6 +122,23 @@ elf_is_ifunc_reloc(Elf_Size r_info __unused) } static int +reloc_instr_imm(Elf32_Addr *where, Elf_Addr val, u_int msb, u_int lsb) +{ + + /* Check bounds: upper bits must be all ones or all zeros. */ + if ((uint64_t)((int64_t)val >> (msb + 1)) + 1 > 1) + return (-1); + val >>= lsb; + val &= (1 << (msb - lsb + 1)) - 1; + *where |= (Elf32_Addr)val; + return (0); +} + +/* + * Process a relocation. Support for some static relocations is required + * in order for the -zifunc-noplt optimization to work. + */ +static int elf_reloc_internal(linker_file_t lf, Elf_Addr relocbase, const void *data, int type, int local, elf_lookup_fn lookup) { @@ -156,10 +173,33 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas return (0); } + error = 0; switch (rtype) { case R_AARCH64_NONE: case R_AARCH64_RELATIVE: break; + case R_AARCH64_TSTBR14: + error = lookup(lf, symidx, 1, &addr); + if (error != 0) + return (-1); + error = reloc_instr_imm((Elf32_Addr *)where, + addr + addend - (Elf_Addr)where, 15, 2); + break; + case R_AARCH64_CONDBR19: + error = lookup(lf, symidx, 1, &addr); + if (error != 0) + return (-1); + error = reloc_instr_imm((Elf32_Addr *)where, + addr + addend - (Elf_Addr)where, 20, 2); + break; + case R_AARCH64_JUMP26: + case R_AARCH64_CALL26: + error = lookup(lf, symidx, 1, &addr); + if (error != 0) + return (-1); + error = reloc_instr_imm((Elf32_Addr *)where, + addr + addend - (Elf_Addr)where, 27, 2); + break; case R_AARCH64_ABS64: case R_AARCH64_GLOB_DAT: case R_AARCH64_JUMP_SLOT: @@ -178,7 +218,7 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas printf("kldload: unexpected relocation type %d\n", rtype); return (-1); } - return (0); + return (error); } int From owner-svn-src-all@freebsd.org Tue Feb 4 02:41:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 773CF239444; Tue, 4 Feb 2020 02:41:25 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BTTx2Px1z4X3c; Tue, 4 Feb 2020 02:41:25 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4DE72AAD6; Tue, 4 Feb 2020 02:41:25 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0142fPBY033791; Tue, 4 Feb 2020 02:41:25 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0142fOH8033790; Tue, 4 Feb 2020 02:41:24 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <202002040241.0142fOH8033790@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Tue, 4 Feb 2020 02:41:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357485 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 357485 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 02:41:25 -0000 Author: jeff Date: Tue Feb 4 02:41:24 2020 New Revision: 357485 URL: https://svnweb.freebsd.org/changeset/base/357485 Log: Use STAILQ instead of TAILQ for bucket lists. We only need FIFO behavior and this is more space efficient. Stop queueing recently used buckets to the head of the list. If the bucket goes to a different processor the cache coherency will be more expensive. We already try to encourage cache-hot behavior in the per-cpu layer. Reviewed by: rlibby Differential Revision: https://reviews.freebsd.org/D23493 Modified: head/sys/vm/uma_core.c head/sys/vm/uma_int.h Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Tue Feb 4 02:06:21 2020 (r357484) +++ head/sys/vm/uma_core.c Tue Feb 4 02:41:24 2020 (r357485) @@ -544,7 +544,7 @@ zone_fetch_bucket(uma_zone_t zone, uma_zone_domain_t z ZONE_LOCK_ASSERT(zone); - if ((bucket = TAILQ_FIRST(&zdom->uzd_buckets)) == NULL) + if ((bucket = STAILQ_FIRST(&zdom->uzd_buckets)) == NULL) return (NULL); if ((zone->uz_flags & UMA_ZONE_SMR) != 0 && @@ -555,7 +555,7 @@ zone_fetch_bucket(uma_zone_t zone, uma_zone_domain_t z dtor = (zone->uz_dtor != NULL) | UMA_ALWAYS_CTORDTOR; } MPASS(zdom->uzd_nitems >= bucket->ub_cnt); - TAILQ_REMOVE(&zdom->uzd_buckets, bucket, ub_link); + STAILQ_REMOVE_HEAD(&zdom->uzd_buckets, ub_link); zdom->uzd_nitems -= bucket->ub_cnt; if (zdom->uzd_imin > zdom->uzd_nitems) zdom->uzd_imin = zdom->uzd_nitems; @@ -583,10 +583,7 @@ zone_put_bucket(uma_zone_t zone, uma_zone_domain_t zdo KASSERT(!ws || zone->uz_bkt_count < zone->uz_bkt_max, ("%s: zone %p overflow", __func__, zone)); - if (ws && bucket->ub_seq == SMR_SEQ_INVALID) - TAILQ_INSERT_HEAD(&zdom->uzd_buckets, bucket, ub_link); - else - TAILQ_INSERT_TAIL(&zdom->uzd_buckets, bucket, ub_link); + STAILQ_INSERT_TAIL(&zdom->uzd_buckets, bucket, ub_link); zdom->uzd_nitems += bucket->ub_cnt; if (ws && zdom->uzd_imax < zdom->uzd_nitems) zdom->uzd_imax = zdom->uzd_nitems; @@ -1187,11 +1184,11 @@ bucket_cache_reclaim(uma_zone_t zone, bool drain) target = drain ? 0 : lmax(zdom->uzd_wss, zdom->uzd_nitems - zdom->uzd_imin); while (zdom->uzd_nitems > target) { - bucket = TAILQ_FIRST(&zdom->uzd_buckets); + bucket = STAILQ_FIRST(&zdom->uzd_buckets); if (bucket == NULL) break; tofree = bucket->ub_cnt; - TAILQ_REMOVE(&zdom->uzd_buckets, bucket, ub_link); + STAILQ_REMOVE_HEAD(&zdom->uzd_buckets, ub_link); zdom->uzd_nitems -= tofree; /* @@ -2365,7 +2362,7 @@ zone_ctor(void *mem, int size, void *udata, int flags) ZONE_CROSS_LOCK_INIT(zone); for (i = 0; i < vm_ndomains; i++) - TAILQ_INIT(&zone->uz_domain[i].uzd_buckets); + STAILQ_INIT(&zone->uz_domain[i].uzd_buckets); #ifdef INVARIANTS if (arg->uminit == trash_init && arg->fini == trash_fini) @@ -3930,7 +3927,7 @@ zone_free_cross(uma_zone_t zone, uma_bucket_t bucket, "uma_zfree: zone %s(%p) draining cross bucket %p", zone->uz_name, zone, bucket); - TAILQ_INIT(&fullbuckets); + STAILQ_INIT(&fullbuckets); /* * To avoid having ndomain * ndomain buckets for sorting we have a @@ -3949,19 +3946,19 @@ zone_free_cross(uma_zone_t zone, uma_bucket_t bucket, } zdom->uzd_cross->ub_bucket[zdom->uzd_cross->ub_cnt++] = item; if (zdom->uzd_cross->ub_cnt == zdom->uzd_cross->ub_entries) { - TAILQ_INSERT_HEAD(&fullbuckets, zdom->uzd_cross, + STAILQ_INSERT_HEAD(&fullbuckets, zdom->uzd_cross, ub_link); zdom->uzd_cross = NULL; } bucket->ub_cnt--; } ZONE_CROSS_UNLOCK(zone); - if (!TAILQ_EMPTY(&fullbuckets)) { + if (!STAILQ_EMPTY(&fullbuckets)) { ZONE_LOCK(zone); - while ((b = TAILQ_FIRST(&fullbuckets)) != NULL) { + while ((b = STAILQ_FIRST(&fullbuckets)) != NULL) { if ((zone->uz_flags & UMA_ZONE_SMR) != 0) bucket->ub_seq = smr_current(zone->uz_smr); - TAILQ_REMOVE(&fullbuckets, b, ub_link); + STAILQ_REMOVE_HEAD(&fullbuckets, ub_link); if (zone->uz_bkt_count >= zone->uz_bkt_max) { ZONE_UNLOCK(zone); bucket_drain(zone, b); Modified: head/sys/vm/uma_int.h ============================================================================== --- head/sys/vm/uma_int.h Tue Feb 4 02:06:21 2020 (r357484) +++ head/sys/vm/uma_int.h Tue Feb 4 02:41:24 2020 (r357485) @@ -245,7 +245,7 @@ struct uma_hash { * for use. */ struct uma_bucket { - TAILQ_ENTRY(uma_bucket) ub_link; /* Link into the zone */ + STAILQ_ENTRY(uma_bucket) ub_link; /* Link into the zone */ int16_t ub_cnt; /* Count of items in bucket. */ int16_t ub_entries; /* Max items. */ smr_seq_t ub_seq; /* SMR sequence number. */ @@ -462,7 +462,7 @@ slab_item_index(uma_slab_t slab, uma_keg_t keg, void * } #endif /* _KERNEL */ -TAILQ_HEAD(uma_bucketlist, uma_bucket); +STAILQ_HEAD(uma_bucketlist, uma_bucket); struct uma_zone_domain { struct uma_bucketlist uzd_buckets; /* full buckets */ From owner-svn-src-all@freebsd.org Tue Feb 4 02:42:55 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7DC07239602; Tue, 4 Feb 2020 02:42:55 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BTWg2hLsz4XFx; Tue, 4 Feb 2020 02:42:55 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 57556AC45; Tue, 4 Feb 2020 02:42:55 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0142gtKZ037586; Tue, 4 Feb 2020 02:42:55 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0142gthZ037585; Tue, 4 Feb 2020 02:42:55 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <202002040242.0142gthZ037585@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Tue, 4 Feb 2020 02:42:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357486 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 357486 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 02:42:55 -0000 Author: jeff Date: Tue Feb 4 02:42:54 2020 New Revision: 357486 URL: https://svnweb.freebsd.org/changeset/base/357486 Log: Fix a recursion on the thread lock by acquiring it after call rtp_to_pri(). Reported by: swills Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D23495 Modified: head/sys/kern/kern_thr.c Modified: head/sys/kern/kern_thr.c ============================================================================== --- head/sys/kern/kern_thr.c Tue Feb 4 02:41:24 2020 (r357485) +++ head/sys/kern/kern_thr.c Tue Feb 4 02:42:54 2020 (r357486) @@ -271,14 +271,12 @@ thread_create(struct thread *td, struct rtprio *rtp, tidhash_add(newtd); + /* ignore timesharing class */ + if (rtp != NULL && !(td->td_pri_class == PRI_TIMESHARE && + rtp->type == RTP_PRIO_NORMAL)) + rtp_to_pri(rtp, newtd); + thread_lock(newtd); - if (rtp != NULL) { - if (!(td->td_pri_class == PRI_TIMESHARE && - rtp->type == RTP_PRIO_NORMAL)) { - rtp_to_pri(rtp, newtd); - sched_prio(newtd, newtd->td_user_pri); - } /* ignore timesharing class */ - } TD_SET_CAN_RUN(newtd); sched_add(newtd, SRQ_BORING); From owner-svn-src-all@freebsd.org Tue Feb 4 02:44:53 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1742E239684; Tue, 4 Feb 2020 02:44:53 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BTYw6vYHz4XP2; Tue, 4 Feb 2020 02:44:52 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C9578AC4B; Tue, 4 Feb 2020 02:44:52 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0142iq30037750; Tue, 4 Feb 2020 02:44:52 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0142iqXE037749; Tue, 4 Feb 2020 02:44:52 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <202002040244.0142iqXE037749@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Tue, 4 Feb 2020 02:44:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357487 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 357487 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 02:44:53 -0000 Author: jeff Date: Tue Feb 4 02:44:52 2020 New Revision: 357487 URL: https://svnweb.freebsd.org/changeset/base/357487 Log: Implement a deferred write advancement feature that can be used to further amortize shared cacheline writes. Discussed with: rlibby Differential Revision: https://reviews.freebsd.org/D23462 Modified: head/sys/kern/subr_smr.c head/sys/sys/smr.h Modified: head/sys/kern/subr_smr.c ============================================================================== --- head/sys/kern/subr_smr.c Tue Feb 4 02:42:54 2020 (r357486) +++ head/sys/kern/subr_smr.c Tue Feb 4 02:44:52 2020 (r357487) @@ -209,6 +209,26 @@ smr_advance(smr_t smr) return (goal); } +smr_seq_t +smr_advance_deferred(smr_t smr, int limit) +{ + smr_seq_t goal; + smr_t csmr; + + critical_enter(); + csmr = zpcpu_get(smr); + if (++csmr->c_deferred >= limit) { + goal = SMR_SEQ_INVALID; + csmr->c_deferred = 0; + } else + goal = smr_shared_current(csmr->c_shared) + SMR_SEQ_INCR; + critical_exit(); + if (goal != SMR_SEQ_INVALID) + return (goal); + + return (smr_advance(smr)); +} + /* * Poll to determine whether all readers have observed the 'goal' write * sequence number. @@ -255,6 +275,17 @@ smr_poll(smr_t smr, smr_seq_t goal, bool wait) * c_seq can only reference time after this wr_seq. */ s_wr_seq = atomic_load_acq_int(&s->s_wr_seq); + + /* + * This may have come from a deferred advance. Consider one + * increment past the current wr_seq valid and make sure we + * have advanced far enough to succeed. We simply add to avoid + * an additional fence. + */ + if (goal == s_wr_seq + SMR_SEQ_INCR) { + atomic_add_int(&s->s_wr_seq, SMR_SEQ_INCR); + s_wr_seq = goal; + } /* * Detect whether the goal is valid and has already been observed. Modified: head/sys/sys/smr.h ============================================================================== --- head/sys/sys/smr.h Tue Feb 4 02:42:54 2020 (r357486) +++ head/sys/sys/smr.h Tue Feb 4 02:44:52 2020 (r357487) @@ -64,6 +64,7 @@ typedef struct smr_shared *smr_shared_t; struct smr { smr_seq_t c_seq; /* Current observed sequence. */ smr_shared_t c_shared; /* Shared SMR state. */ + int c_deferred; /* Deferred advance counter. */ }; /* @@ -144,6 +145,13 @@ smr_exit(smr_t smr) * required to ensure that all modifications are visible to readers. */ smr_seq_t smr_advance(smr_t smr); + +/* + * Advances the write sequence number only after N calls. Returns + * the correct goal for a wr_seq that has not yet occurred. Used to + * minimize shared cacheline invalidations for frequent writers. + */ +smr_seq_t smr_advance_deferred(smr_t smr, int limit); /* * Returns true if a goal sequence has been reached. If From owner-svn-src-all@freebsd.org Tue Feb 4 03:31:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 81AEB23A08D; Tue, 4 Feb 2020 03:31:29 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BVbj2tPqz4ZXk; Tue, 4 Feb 2020 03:31:29 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E074B591; Tue, 4 Feb 2020 03:31:29 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0143VTaV063936; Tue, 4 Feb 2020 03:31:29 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0143VSpp063933; Tue, 4 Feb 2020 03:31:28 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <202002040331.0143VSpp063933@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Tue, 4 Feb 2020 03:31:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357488 - stable/12/sys/dev/e1000 X-SVN-Group: stable-12 X-SVN-Commit-Author: gnn X-SVN-Commit-Paths: stable/12/sys/dev/e1000 X-SVN-Commit-Revision: 357488 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 03:31:29 -0000 Author: gnn Date: Tue Feb 4 03:31:28 2020 New Revision: 357488 URL: https://svnweb.freebsd.org/changeset/base/357488 Log: MFC 356913 Add support for latest Intel I219 device, supported in Lenovo Carbon X1 v7 Modified: stable/12/sys/dev/e1000/e1000_api.c stable/12/sys/dev/e1000/e1000_hw.h stable/12/sys/dev/e1000/if_em.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/e1000/e1000_api.c ============================================================================== --- stable/12/sys/dev/e1000/e1000_api.c Tue Feb 4 02:44:52 2020 (r357487) +++ stable/12/sys/dev/e1000/e1000_api.c Tue Feb 4 03:31:28 2020 (r357488) @@ -319,6 +319,7 @@ s32 e1000_set_mac_type(struct e1000_hw *hw) case E1000_DEV_ID_PCH_ICP_I219_V8: case E1000_DEV_ID_PCH_ICP_I219_LM9: case E1000_DEV_ID_PCH_ICP_I219_V9: + case E1000_DEV_ID_PCH_ICP_I219_V10: mac->type = e1000_pch_cnp; break; case E1000_DEV_ID_82575EB_COPPER: Modified: stable/12/sys/dev/e1000/e1000_hw.h ============================================================================== --- stable/12/sys/dev/e1000/e1000_hw.h Tue Feb 4 02:44:52 2020 (r357487) +++ stable/12/sys/dev/e1000/e1000_hw.h Tue Feb 4 03:31:28 2020 (r357488) @@ -155,6 +155,7 @@ struct e1000_hw; #define E1000_DEV_ID_PCH_ICP_I219_V8 0x15E0 #define E1000_DEV_ID_PCH_ICP_I219_LM9 0x15E1 #define E1000_DEV_ID_PCH_ICP_I219_V9 0x15E2 +#define E1000_DEV_ID_PCH_ICP_I219_V10 0x0D4F #define E1000_DEV_ID_82576 0x10C9 #define E1000_DEV_ID_82576_FIBER 0x10E6 #define E1000_DEV_ID_82576_SERDES 0x10E7 Modified: stable/12/sys/dev/e1000/if_em.c ============================================================================== --- stable/12/sys/dev/e1000/if_em.c Tue Feb 4 02:44:52 2020 (r357487) +++ stable/12/sys/dev/e1000/if_em.c Tue Feb 4 03:31:28 2020 (r357488) @@ -174,6 +174,7 @@ static pci_vendor_info_t em_vendor_info_array[] = PVID(0x8086, E1000_DEV_ID_PCH_ICP_I219_V8, "Intel(R) PRO/1000 Network Connection"), PVID(0x8086, E1000_DEV_ID_PCH_ICP_I219_LM9, "Intel(R) PRO/1000 Network Connection"), PVID(0x8086, E1000_DEV_ID_PCH_ICP_I219_V9, "Intel(R) PRO/1000 Network Connection"), + PVID(0x8086, E1000_DEV_ID_PCH_ICP_I219_V10, "Intel(R) PRO/1000 Network Connection"), /* required last entry */ PVID_END }; From owner-svn-src-all@freebsd.org Tue Feb 4 04:29:54 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A9F4823B5CD; Tue, 4 Feb 2020 04:29:54 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BWv640knz4cvT; Tue, 4 Feb 2020 04:29:54 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 84B86C0C7; Tue, 4 Feb 2020 04:29:54 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0144TsVY099100; Tue, 4 Feb 2020 04:29:54 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0144Ts6c099098; Tue, 4 Feb 2020 04:29:54 GMT (envelope-from kp@FreeBSD.org) Message-Id: <202002040429.0144Ts6c099098@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Tue, 4 Feb 2020 04:29:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r357489 - stable/11/tests/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/11/tests/sys/net X-SVN-Commit-Revision: 357489 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 04:29:54 -0000 Author: kp Date: Tue Feb 4 04:29:53 2020 New Revision: 357489 URL: https://svnweb.freebsd.org/changeset/base/357489 Log: MFC r357234, r357365, r357375: tests: Test for an epair panic if_epair abused the ifr_data field to insert its second interface in IFC_IFLIST. If userspace provides a value for ifr_data it would get dereferenced by the kernel leading to a panic. Reported by: Ilja Van Sprundel Added: stable/11/tests/sys/net/if_epair.c - copied, changed from r357234, head/tests/sys/net/if_epair.c Modified: stable/11/tests/sys/net/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/tests/sys/net/Makefile ============================================================================== --- stable/11/tests/sys/net/Makefile Tue Feb 4 03:31:28 2020 (r357488) +++ stable/11/tests/sys/net/Makefile Tue Feb 4 04:29:53 2020 (r357489) @@ -7,6 +7,7 @@ BINDIR= ${TESTSDIR} ATF_TESTS_SH+= if_lagg_test ATF_TESTS_SH+= if_clone_test +ATF_TESTS_C+= if_epair # The tests are written to be run in parallel, but doing so leads to random # panics. I think it's because the kernel's list of interfaces isn't properly @@ -14,7 +15,7 @@ ATF_TESTS_SH+= if_clone_test TEST_METADATA+= is_exclusive=true MAN= -PROG= randsleep +PROGS+= randsleep WARNS?= 6 Copied and modified: stable/11/tests/sys/net/if_epair.c (from r357234, head/tests/sys/net/if_epair.c) ============================================================================== --- head/tests/sys/net/if_epair.c Tue Jan 28 22:46:51 2020 (r357234, copy source) +++ stable/11/tests/sys/net/if_epair.c Tue Feb 4 04:29:53 2020 (r357489) @@ -25,17 +25,19 @@ * $FreeBSD$ */ +#include #include #include #include -#include #include #include #include +#include #include #include +#include #include @@ -51,7 +53,7 @@ ATF_TC_BODY(params, tc) int s; s = kldload("if_epair"); - if (s != 0) + if (s == -1 && errno != EEXIST) atf_tc_fail("Failed to load if_epair"); s = socket(AF_INET, SOCK_DGRAM, 0); From owner-svn-src-all@freebsd.org Tue Feb 4 04:29:55 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BD8EC23B5D3; Tue, 4 Feb 2020 04:29:55 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BWv74fYKz4cvV; Tue, 4 Feb 2020 04:29:55 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9AF79C0C8; Tue, 4 Feb 2020 04:29:55 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0144TtD0099145; Tue, 4 Feb 2020 04:29:55 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0144TtIQ099143; Tue, 4 Feb 2020 04:29:55 GMT (envelope-from kp@FreeBSD.org) Message-Id: <202002040429.0144TtIQ099143@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Tue, 4 Feb 2020 04:29:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357490 - stable/12/tests/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/12/tests/sys/net X-SVN-Commit-Revision: 357490 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 04:29:55 -0000 Author: kp Date: Tue Feb 4 04:29:54 2020 New Revision: 357490 URL: https://svnweb.freebsd.org/changeset/base/357490 Log: MFC r357234, r357365, r357375: tests: Test for an epair panic if_epair abused the ifr_data field to insert its second interface in IFC_IFLIST. If userspace provides a value for ifr_data it would get dereferenced by the kernel leading to a panic. Reported by: Ilja Van Sprundel Added: stable/12/tests/sys/net/if_epair.c - copied, changed from r357234, head/tests/sys/net/if_epair.c Modified: stable/12/tests/sys/net/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/tests/sys/net/Makefile ============================================================================== --- stable/12/tests/sys/net/Makefile Tue Feb 4 04:29:53 2020 (r357489) +++ stable/12/tests/sys/net/Makefile Tue Feb 4 04:29:54 2020 (r357490) @@ -8,6 +8,7 @@ BINDIR= ${TESTSDIR} ATF_TESTS_SH+= if_lagg_test ATF_TESTS_SH+= if_clone_test ATF_TESTS_SH+= if_tun_test +ATF_TESTS_C+= if_epair # The tests are written to be run in parallel, but doing so leads to random # panics. I think it's because the kernel's list of interfaces isn't properly @@ -15,7 +16,7 @@ ATF_TESTS_SH+= if_tun_test TEST_METADATA+= is_exclusive=true MAN= -PROG= randsleep +PROGS+= randsleep WARNS?= 6 Copied and modified: stable/12/tests/sys/net/if_epair.c (from r357234, head/tests/sys/net/if_epair.c) ============================================================================== --- head/tests/sys/net/if_epair.c Tue Jan 28 22:46:51 2020 (r357234, copy source) +++ stable/12/tests/sys/net/if_epair.c Tue Feb 4 04:29:54 2020 (r357490) @@ -25,17 +25,19 @@ * $FreeBSD$ */ +#include #include #include #include -#include #include #include #include +#include #include #include +#include #include @@ -51,7 +53,7 @@ ATF_TC_BODY(params, tc) int s; s = kldload("if_epair"); - if (s != 0) + if (s == -1 && errno != EEXIST) atf_tc_fail("Failed to load if_epair"); s = socket(AF_INET, SOCK_DGRAM, 0); From owner-svn-src-all@freebsd.org Tue Feb 4 05:20:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1967A23C118; Tue, 4 Feb 2020 05:20:44 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from smtp.imp.ch (smtp.imp.ch [IPv6:2001:4060:1:1001::13:198]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48BY1l3qcWz4fhm; Tue, 4 Feb 2020 05:20:43 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from [192.168.225.14] (dhclient-94.100.156.244.flashcable.ch [94.100.156.244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by fgznet.ch (Postfix) with ESMTPSA id 7AC39C4BCC; Tue, 4 Feb 2020 06:20:39 +0100 (CET) Subject: Re: svn commit: r357463 - head/sys/vm To: Mark Johnston , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202002031929.013JT2u8061169@repo.freebsd.org> From: Andreas Tobler Message-ID: Date: Tue, 4 Feb 2020 06:20:25 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:68.0) Gecko/20100101 Thunderbird/68.4.2 MIME-Version: 1.0 In-Reply-To: <202002031929.013JT2u8061169@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: Obelix Submit on 127.0.1.1 X-Rspamd-Queue-Id: 48BY1l3qcWz4fhm X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.98 / 15.00]; NEURAL_HAM_MEDIUM(-0.98)[-0.984,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 05:20:44 -0000 On 03.02.20 20:29, Mark Johnston wrote: > Author: markj > Date: Mon Feb 3 19:29:02 2020 > New Revision: 357463 > URL: https://svnweb.freebsd.org/changeset/base/357463 > > Log: > Disable the smallest UMA bucket size on 32-bit platforms. > > With r357314, sizeof(struct uma_bucket) grew to 16 bytes on 32-bit > platforms, so BUCKET_SIZE(4) is 0. This resulted in the creation of a > bucket zone for buckets with zero capacity. A more general fix is > planned, but for now this bandaid allows 32-bit platforms to boot again. Thanks, my wandquad is back to life. Andreas From owner-svn-src-all@freebsd.org Tue Feb 4 05:23:35 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 283B623C352; Tue, 4 Feb 2020 05:23:35 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BY5309nrz4gB6; Tue, 4 Feb 2020 05:23:35 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DD543CB75; Tue, 4 Feb 2020 05:23:34 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0145NYIx034312; Tue, 4 Feb 2020 05:23:34 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0145NYnd034311; Tue, 4 Feb 2020 05:23:34 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <202002040523.0145NYnd034311@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Tue, 4 Feb 2020 05:23:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357491 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 357491 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 05:23:35 -0000 Author: dchagin Date: Tue Feb 4 05:23:34 2020 New Revision: 357491 URL: https://svnweb.freebsd.org/changeset/base/357491 Log: linux_to_native_clockid() properly initializes nwhich variable (or return error), so don't initialize nwhich in declaration and remove stale comment from r161304. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D23339 MFC after: 2 weeks Modified: head/sys/compat/linux/linux_time.c Modified: head/sys/compat/linux/linux_time.c ============================================================================== --- head/sys/compat/linux/linux_time.c Tue Feb 4 04:29:54 2020 (r357490) +++ head/sys/compat/linux/linux_time.c Tue Feb 4 05:23:34 2020 (r357491) @@ -253,7 +253,7 @@ linux_clock_gettime(struct thread *td, struct linux_cl struct thread *targettd; struct proc *p; int error, clockwhich; - clockid_t nwhich = 0; /* XXX: GCC */ + clockid_t nwhich; pid_t pid; lwpid_t tid; @@ -382,7 +382,7 @@ linux_clock_settime(struct thread *td, struct linux_cl struct timespec ts; struct l_timespec lts; int error; - clockid_t nwhich = 0; /* XXX: GCC */ + clockid_t nwhich; LIN_SDT_PROBE2(time, linux_clock_settime, entry, args->which, args->tp); @@ -422,7 +422,7 @@ linux_clock_getres(struct thread *td, struct linux_clo struct timespec ts; struct l_timespec lts; int error, clockwhich; - clockid_t nwhich = 0; /* XXX: GCC */ + clockid_t nwhich; pid_t pid; lwpid_t tid; From owner-svn-src-all@freebsd.org Tue Feb 4 05:25:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0742123C416; Tue, 4 Feb 2020 05:25:52 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BY7g6Rnmz4gKh; Tue, 4 Feb 2020 05:25:51 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D8593CB7F; Tue, 4 Feb 2020 05:25:51 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0145Pp5Y034468; Tue, 4 Feb 2020 05:25:51 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0145Pppn034466; Tue, 4 Feb 2020 05:25:51 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <202002040525.0145Pppn034466@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Tue, 4 Feb 2020 05:25:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357492 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 357492 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 05:25:52 -0000 Author: dchagin Date: Tue Feb 4 05:25:51 2020 New Revision: 357492 URL: https://svnweb.freebsd.org/changeset/base/357492 Log: For code reuse in Linuxulator rename get_proccess_cputime() and get_thread_cputime() and add prototypes for it to . As both functions become a public interface add process lock assert to ensure that the process is not exiting under it. Fix whitespace nit while here. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D23340 MFC after 2 weeks Modified: head/sys/kern/kern_time.c head/sys/sys/syscallsubr.h Modified: head/sys/kern/kern_time.c ============================================================================== --- head/sys/kern/kern_time.c Tue Feb 4 05:23:34 2020 (r357491) +++ head/sys/kern/kern_time.c Tue Feb 4 05:25:51 2020 (r357492) @@ -242,7 +242,7 @@ sys_clock_gettime(struct thread *td, struct clock_gett return (error); } -static inline void +static inline void cputick2timespec(uint64_t runtime, struct timespec *ats) { runtime = cputick2usec(runtime); @@ -250,12 +250,15 @@ cputick2timespec(uint64_t runtime, struct timespec *at ats->tv_nsec = runtime % 1000000 * 1000; } -static void -get_thread_cputime(struct thread *targettd, struct timespec *ats) +void +kern_thread_cputime(struct thread *targettd, struct timespec *ats) { uint64_t runtime, curtime, switchtime; + struct proc *p; if (targettd == NULL) { /* current thread */ + p = curthread->td_proc; + PROC_LOCK_ASSERT(p, MA_OWNED); critical_enter(); switchtime = PCPU_GET(switchtime); curtime = cpu_ticks(); @@ -263,6 +266,8 @@ get_thread_cputime(struct thread *targettd, struct tim critical_exit(); runtime += curtime - switchtime; } else { + p = targettd->td_proc; + PROC_LOCK_ASSERT(p, MA_OWNED); thread_lock(targettd); runtime = targettd->td_runtime; thread_unlock(targettd); @@ -270,12 +275,13 @@ get_thread_cputime(struct thread *targettd, struct tim cputick2timespec(runtime, ats); } -static void -get_process_cputime(struct proc *targetp, struct timespec *ats) +void +kern_process_cputime(struct proc *targetp, struct timespec *ats) { uint64_t runtime; struct rusage ru; + PROC_LOCK_ASSERT(targetp, MA_OWNED); PROC_STATLOCK(targetp); rufetch(targetp, &ru); runtime = targetp->p_rux.rux_runtime; @@ -300,14 +306,14 @@ get_cputime(struct thread *td, clockid_t clock_id, str td2 = tdfind(tid, p->p_pid); if (td2 == NULL) return (EINVAL); - get_thread_cputime(td2, ats); + kern_thread_cputime(td2, ats); PROC_UNLOCK(td2->td_proc); } else { pid = clock_id & CPUCLOCK_ID_MASK; error = pget(pid, PGET_CANSEE, &p2); if (error != 0) return (EINVAL); - get_process_cputime(p2, ats); + kern_process_cputime(p2, ats); PROC_UNLOCK(p2); } return (0); @@ -360,11 +366,11 @@ kern_clock_gettime(struct thread *td, clockid_t clock_ ats->tv_nsec = 0; break; case CLOCK_THREAD_CPUTIME_ID: - get_thread_cputime(NULL, ats); + kern_thread_cputime(NULL, ats); break; case CLOCK_PROCESS_CPUTIME_ID: PROC_LOCK(p); - get_process_cputime(p, ats); + kern_process_cputime(p, ats); PROC_UNLOCK(p); break; default: Modified: head/sys/sys/syscallsubr.h ============================================================================== --- head/sys/sys/syscallsubr.h Tue Feb 4 05:23:34 2020 (r357491) +++ head/sys/sys/syscallsubr.h Tue Feb 4 05:25:51 2020 (r357492) @@ -91,6 +91,8 @@ int kern_clock_nanosleep(struct thread *td, clockid_t const struct timespec *rqtp, struct timespec *rmtp); int kern_clock_settime(struct thread *td, clockid_t clock_id, struct timespec *ats); +void kern_thread_cputime(struct thread *targettd, struct timespec *ats); +void kern_process_cputime(struct proc *targetp, struct timespec *ats); int kern_close(struct thread *td, int fd); int kern_connectat(struct thread *td, int dirfd, int fd, struct sockaddr *sa); From owner-svn-src-all@freebsd.org Tue Feb 4 05:27:05 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A54F223C4B7; Tue, 4 Feb 2020 05:27:05 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BY953xPvz4gSd; Tue, 4 Feb 2020 05:27:05 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 81A21CB89; Tue, 4 Feb 2020 05:27:05 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0145R5ps034575; Tue, 4 Feb 2020 05:27:05 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0145R5Zu034574; Tue, 4 Feb 2020 05:27:05 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <202002040527.0145R5Zu034574@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Tue, 4 Feb 2020 05:27:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357493 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 357493 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 05:27:05 -0000 Author: dchagin Date: Tue Feb 4 05:27:05 2020 New Revision: 357493 URL: https://svnweb.freebsd.org/changeset/base/357493 Log: Fix clock_gettime() and clock_getres() for cpu clocks: - handle the CLOCK_{PROCESS,THREAD}_CPUTIME_ID specified directly; - fix thread id calculation as in the Linuxulator we should convert the user supplied thread id to struct thread * by linux_tdfind(); - fix CPUCLOCK_SCHED case by using kern_{process,thread}_cputime() directly as native get_cputime() used by kern_clock_gettime() uses native tdfind()/pfind() to find proccess/thread. PR: 240990 Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D23341 MFC after: 2 weeks Modified: head/sys/compat/linux/linux_time.c Modified: head/sys/compat/linux/linux_time.c ============================================================================== --- head/sys/compat/linux/linux_time.c Tue Feb 4 05:25:51 2020 (r357492) +++ head/sys/compat/linux/linux_time.c Tue Feb 4 05:27:05 2020 (r357493) @@ -65,6 +65,7 @@ __KERNEL_RCSID(0, "$NetBSD: linux_time.c,v 1.14 2006/0 #endif #include +#include #include /* DTrace init */ @@ -203,6 +204,12 @@ linux_to_native_clockid(clockid_t *n, clockid_t l) case LINUX_CLOCK_MONOTONIC: *n = CLOCK_MONOTONIC; break; + case LINUX_CLOCK_PROCESS_CPUTIME_ID: + *n = CLOCK_PROCESS_CPUTIME_ID; + break; + case LINUX_CLOCK_THREAD_CPUTIME_ID: + *n = CLOCK_THREAD_CPUTIME_ID; + break; case LINUX_CLOCK_REALTIME_COARSE: *n = CLOCK_REALTIME_FAST; break; @@ -269,8 +276,13 @@ linux_clock_gettime(struct thread *td, struct linux_cl switch (nwhich) { case CLOCK_PROCESS_CPUTIME_ID: - clockwhich = LINUX_CPUCLOCK_WHICH(args->which); - pid = LINUX_CPUCLOCK_ID(args->which); + if (args->which < 0) { + clockwhich = LINUX_CPUCLOCK_WHICH(args->which); + pid = LINUX_CPUCLOCK_ID(args->which); + } else { + clockwhich = LINUX_CPUCLOCK_SCHED; + pid = 0; + } if (pid == 0) { p = td->td_proc; PROC_LOCK(p); @@ -296,12 +308,8 @@ linux_clock_gettime(struct thread *td, struct linux_cl TIMEVAL_TO_TIMESPEC(&ru.ru_utime, &tp); break; case LINUX_CPUCLOCK_SCHED: + kern_process_cputime(p, &tp); PROC_UNLOCK(p); - error = kern_clock_getcpuclockid2(td, pid, - CPUCLOCK_WHICH_PID, &nwhich); - if (error != 0) - return (EINVAL); - error = kern_clock_gettime(td, nwhich, &tp); break; default: PROC_UNLOCK(p); @@ -311,14 +319,19 @@ linux_clock_gettime(struct thread *td, struct linux_cl break; case CLOCK_THREAD_CPUTIME_ID: - clockwhich = LINUX_CPUCLOCK_WHICH(args->which); + if (args->which < 0) { + clockwhich = LINUX_CPUCLOCK_WHICH(args->which); + tid = LINUX_CPUCLOCK_ID(args->which); + } else { + clockwhich = LINUX_CPUCLOCK_SCHED; + tid = 0; + } p = td->td_proc; - tid = LINUX_CPUCLOCK_ID(args->which); if (tid == 0) { targettd = td; PROC_LOCK(p); } else { - targettd = tdfind(tid, p->p_pid); + targettd = linux_tdfind(td, tid, p->p_pid); if (targettd == NULL) return (EINVAL); } @@ -343,12 +356,10 @@ linux_clock_gettime(struct thread *td, struct linux_cl TIMEVAL_TO_TIMESPEC(&ru.ru_utime, &tp); break; case LINUX_CPUCLOCK_SCHED: - error = kern_clock_getcpuclockid2(td, tid, - CPUCLOCK_WHICH_TID, &nwhich); + if (td == targettd) + targettd = NULL; + kern_thread_cputime(targettd, &tp); PROC_UNLOCK(p); - if (error != 0) - return (EINVAL); - error = kern_clock_gettime(td, nwhich, &tp); break; default: PROC_UNLOCK(p); @@ -440,25 +451,27 @@ linux_clock_getres(struct thread *td, struct linux_clo * Check user supplied clock id in case of per-process * or thread-specific cpu-time clock. */ - switch (nwhich) { - case CLOCK_THREAD_CPUTIME_ID: - tid = LINUX_CPUCLOCK_ID(args->which); - if (tid != 0) { - p = td->td_proc; - if (tdfind(tid, p->p_pid) == NULL) - return (ESRCH); - PROC_UNLOCK(p); + if (args->which < 0) { + switch (nwhich) { + case CLOCK_THREAD_CPUTIME_ID: + tid = LINUX_CPUCLOCK_ID(args->which); + if (tid != 0) { + p = td->td_proc; + if (linux_tdfind(td, tid, p->p_pid) == NULL) + return (EINVAL); + PROC_UNLOCK(p); + } + break; + case CLOCK_PROCESS_CPUTIME_ID: + pid = LINUX_CPUCLOCK_ID(args->which); + if (pid != 0) { + error = pget(pid, PGET_CANSEE, &p); + if (error != 0) + return (EINVAL); + PROC_UNLOCK(p); + } + break; } - break; - case CLOCK_PROCESS_CPUTIME_ID: - pid = LINUX_CPUCLOCK_ID(args->which); - if (pid != 0) { - error = pget(pid, PGET_CANSEE, &p); - if (error != 0) - return (EINVAL); - PROC_UNLOCK(p); - } - break; } if (args->tp == NULL) { @@ -471,6 +484,20 @@ linux_clock_getres(struct thread *td, struct linux_clo case CLOCK_THREAD_CPUTIME_ID: case CLOCK_PROCESS_CPUTIME_ID: clockwhich = LINUX_CPUCLOCK_WHICH(args->which); + /* + * In both cases (when the clock id obtained by a call to + * clock_getcpuclockid() or using the clock + * ID CLOCK_PROCESS_CPUTIME_ID Linux hardcodes precision + * of clock. The same for the CLOCK_THREAD_CPUTIME_ID clock. + * + * See Linux posix_cpu_clock_getres() implementation. + */ + if (args->which > 0 || clockwhich == LINUX_CPUCLOCK_SCHED) { + ts.tv_sec = 0; + ts.tv_nsec = 1; + goto out; + } + switch (clockwhich) { case LINUX_CPUCLOCK_PROF: nwhich = CLOCK_PROF; @@ -478,8 +505,6 @@ linux_clock_getres(struct thread *td, struct linux_clo case LINUX_CPUCLOCK_VIRT: nwhich = CLOCK_VIRTUAL; break; - case LINUX_CPUCLOCK_SCHED: - break; default: return (EINVAL); } @@ -494,6 +519,8 @@ linux_clock_getres(struct thread *td, struct linux_clo LIN_SDT_PROBE1(time, linux_clock_getres, return, error); return (error); } + +out: error = native_to_linux_timespec(<s, &ts); if (error != 0) return (error); From owner-svn-src-all@freebsd.org Tue Feb 4 05:27:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5EE2123C568; Tue, 4 Feb 2020 05:27:46 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BY9t1vqmz4gdC; Tue, 4 Feb 2020 05:27:46 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3CB61CB99; Tue, 4 Feb 2020 05:27:46 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0145RksQ034662; Tue, 4 Feb 2020 05:27:46 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0145RkAH034661; Tue, 4 Feb 2020 05:27:46 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <202002040527.0145RkAH034661@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Tue, 4 Feb 2020 05:27:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357494 - head/lib/libmemstat X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/lib/libmemstat X-SVN-Commit-Revision: 357494 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 05:27:46 -0000 Author: jeff Date: Tue Feb 4 05:27:45 2020 New Revision: 357494 URL: https://svnweb.freebsd.org/changeset/base/357494 Log: Fix libmemstat_uma build after r357485. Submitted by: cy Modified: head/lib/libmemstat/memstat_uma.c Modified: head/lib/libmemstat/memstat_uma.c ============================================================================== --- head/lib/libmemstat/memstat_uma.c Tue Feb 4 05:27:05 2020 (r357493) +++ head/lib/libmemstat/memstat_uma.c Tue Feb 4 05:27:45 2020 (r357494) @@ -459,9 +459,9 @@ skip_percpu: if (ret != 0) continue; for (ubp = - TAILQ_FIRST(&uzd.uzd_buckets); + STAILQ_FIRST(&uzd.uzd_buckets); ubp != NULL; - ubp = TAILQ_NEXT(&ub, ub_link)) { + ubp = STAILQ_NEXT(&ub, ub_link)) { ret = kread(kvm, ubp, &ub, sizeof(ub), 0); if (ret != 0) From owner-svn-src-all@freebsd.org Tue Feb 4 07:15:34 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2866023E472; Tue, 4 Feb 2020 07:15:34 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BbZG0M20z4mPV; Tue, 4 Feb 2020 07:15:34 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 06E02DFEF; Tue, 4 Feb 2020 07:15:34 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0147FXRd003927; Tue, 4 Feb 2020 07:15:33 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0147FXxt003926; Tue, 4 Feb 2020 07:15:33 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <202002040715.0147FXxt003926@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Tue, 4 Feb 2020 07:15:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357495 - stable/12/stand/i386/libi386 X-SVN-Group: stable-12 X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: stable/12/stand/i386/libi386 X-SVN-Commit-Revision: 357495 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 07:15:34 -0000 Author: tsoome Date: Tue Feb 4 07:15:33 2020 New Revision: 357495 URL: https://svnweb.freebsd.org/changeset/base/357495 Log: MFC r357442: loader: bc_add can not use any other probes than ah=0x4b CD boot is broken for some systems since bioscd and biosdisk merge. The issue is that we can not use anything else than int 13 ah=0x4b to query cd information. The patch does restore the same probe as was originally used in bioscd.c. Additionally extra buffer padding is used to avoid memory corruption caused by some systems. PR: 234031 Reported by: ultramage and others Modified: stable/12/stand/i386/libi386/biosdisk.c Directory Properties: stable/12/ (props changed) Modified: stable/12/stand/i386/libi386/biosdisk.c ============================================================================== --- stable/12/stand/i386/libi386/biosdisk.c Tue Feb 4 05:27:45 2020 (r357494) +++ stable/12/stand/i386/libi386/biosdisk.c Tue Feb 4 07:15:33 2020 (r357495) @@ -82,6 +82,7 @@ struct specification_packet { uint16_t sp_sectorcount; uint16_t sp_cylsec; uint8_t sp_head; + uint8_t sp_dummy[16]; /* Avoid memory corruption */ }; /* @@ -356,54 +357,92 @@ cd_init(void) return (0); } -int -bc_add(int biosdev) +/* + * Information from bootable CD-ROM. + */ +static int +bd_get_diskinfo_cd(struct bdinfo *bd) { - bdinfo_t *bd; struct specification_packet bc_sp; - int nbcinfo = 0; + int ret = -1; - if (!STAILQ_EMPTY(&cdinfo)) - return (-1); + (void) memset(&bc_sp, 0, sizeof (bc_sp)); + /* Set sp_size as per specification. */ + bc_sp.sp_size = sizeof (bc_sp) - sizeof (bc_sp.sp_dummy); v86.ctl = V86_FLAGS; v86.addr = 0x13; v86.eax = 0x4b01; - v86.edx = biosdev; + v86.edx = bd->bd_unit; v86.ds = VTOPSEG(&bc_sp); v86.esi = VTOPOFF(&bc_sp); v86int(); - if ((v86.eax & 0xff00) != 0) - return (-1); - if ((bd = calloc(1, sizeof(*bd))) == NULL) - return (-1); + if ((v86.eax & 0xff00) == 0 && + bc_sp.sp_drive == bd->bd_unit) { + bd->bd_cyl = ((bc_sp.sp_cylsec & 0xc0) << 2) + + ((bc_sp.sp_cylsec & 0xff00) >> 8) + 1; + bd->bd_sec = bc_sp.sp_cylsec & 0x3f; + bd->bd_hds = bc_sp.sp_head + 1; + bd->bd_sectors = (uint64_t)bd->bd_cyl * bd->bd_hds * bd->bd_sec; - bd->bd_flags = BD_CDROM; - bd->bd_unit = biosdev; - bd->bd_sectorsize = 2048; + if (bc_sp.sp_bootmedia & 0x0F) { + /* Floppy or hard-disk emulation */ + bd->bd_sectorsize = BIOSDISK_SECSIZE; + return (-1); + } else { + bd->bd_sectorsize = 2048; + bd->bd_flags = BD_MODEEDD | BD_CDROM; + ret = 0; + } + } /* - * Ignore result from bd_int13probe(), we will use local - * workaround below. + * If this is the boot_drive, default to non-emulation bootable CD-ROM. */ - (void)bd_int13probe(bd); - - if (bd->bd_cyl == 0) { - bd->bd_cyl = ((bc_sp.sp_cylsec & 0xc0) << 2) + - ((bc_sp.sp_cylsec & 0xff00) >> 8) + 1; + if (ret != 0 && bd->bd_unit >= 0x88) { + bd->bd_cyl = 0; + bd->bd_hds = 1; + bd->bd_sec = 15; + bd->bd_sectorsize = 2048; + bd->bd_flags = BD_MODEEDD | BD_CDROM; + bd->bd_sectors = 0; + ret = 0; } - if (bd->bd_hds == 0) - bd->bd_hds = bc_sp.sp_head + 1; - if (bd->bd_sec == 0) - bd->bd_sec = bc_sp.sp_cylsec & 0x3f; - if (bd->bd_sectors == 0) - bd->bd_sectors = (uint64_t)bd->bd_cyl * bd->bd_hds * bd->bd_sec; - /* Still no size? use 7.961GB */ + /* + * Note we can not use bd_get_diskinfo_ext() nor bd_get_diskinfo_std() + * here - some systems do get hung with those. + */ + /* + * Still no size? use 7.961GB. The size does not really matter + * as long as it is reasonably large to make our reads to pass + * the sector count check. + */ if (bd->bd_sectors == 0) bd->bd_sectors = 4173824; + + return (ret); +} +int +bc_add(int biosdev) +{ + bdinfo_t *bd; + int nbcinfo = 0; + + if (!STAILQ_EMPTY(&cdinfo)) + return (-1); + + if ((bd = calloc(1, sizeof(*bd))) == NULL) + return (-1); + + bd->bd_unit = biosdev; + if (bd_get_diskinfo_cd(bd) < 0) { + free(bd); + return (-1); + } + STAILQ_INSERT_TAIL(&cdinfo, bd, bd_link); printf("BIOS CD is cd%d\n", nbcinfo); nbcinfo++; @@ -483,22 +522,32 @@ bd_get_diskinfo_std(struct bdinfo *bd) /* * Read EDD info. Return 0 on success, error otherwise. + * + * Avoid stack corruption on some systems by adding extra bytes to + * params block. */ static int bd_get_diskinfo_ext(struct bdinfo *bd) { - struct edd_params params; + struct disk_params { + struct edd_params head; + struct edd_device_path_v3 device_path; + uint8_t dummy[16]; + } __packed dparams; + struct edd_params *params; uint64_t total; + params = &dparams.head; + /* Get disk params */ - bzero(¶ms, sizeof(params)); - params.len = sizeof(params); + bzero(&dparams, sizeof(dparams)); + params->len = sizeof(struct edd_params_v3); v86.ctl = V86_FLAGS; v86.addr = 0x13; v86.eax = 0x4800; v86.edx = bd->bd_unit; - v86.ds = VTOPSEG(¶ms); - v86.esi = VTOPOFF(¶ms); + v86.ds = VTOPSEG(&dparams); + v86.esi = VTOPOFF(&dparams); v86int(); if (V86_CY(v86.efl) && ((v86.eax & 0xff00) != 0)) @@ -510,20 +559,20 @@ bd_get_diskinfo_ext(struct bdinfo *bd) * powerof2(params.sector_size). * 16K is largest read buffer we can use at this time. */ - if (params.sector_size >= 512 && - params.sector_size <= 16384 && - (params.sector_size % BIOSDISK_SECSIZE) == 0) - bd->bd_sectorsize = params.sector_size; + if (params->sector_size >= 512 && + params->sector_size <= 16384 && + (params->sector_size % BIOSDISK_SECSIZE) == 0) + bd->bd_sectorsize = params->sector_size; - bd->bd_cyl = params.cylinders; - bd->bd_hds = params.heads; - bd->bd_sec = params.sectors_per_track; + bd->bd_cyl = params->cylinders; + bd->bd_hds = params->heads; + bd->bd_sec = params->sectors_per_track; - if (params.sectors != 0) { - total = params.sectors; + if (params->sectors != 0) { + total = params->sectors; } else { - total = (uint64_t)params.cylinders * - params.heads * params.sectors_per_track; + total = (uint64_t)params->cylinders * + params->heads * params->sectors_per_track; } bd->bd_sectors = total; @@ -540,6 +589,10 @@ bd_int13probe(bdinfo_t *bd) bd->bd_flags &= ~BD_NO_MEDIA; + if ((bd->bd_flags & BD_CDROM) != 0) { + return (bd_get_diskinfo_cd(bd) == 0); + } + edd = bd_check_extensions(bd->bd_unit); if (edd == 0) bd->bd_flags |= BD_MODEINT13; @@ -588,10 +641,6 @@ bd_int13probe(bdinfo_t *bd) } if (ret != 0) { - /* CD is special case, bc_add() has its own fallback. */ - if ((bd->bd_flags & BD_CDROM) != 0) - return (true); - if (bd->bd_sectors != 0 && edd != 0) { bd->bd_sec = 63; bd->bd_hds = 255; @@ -603,8 +652,6 @@ bd_int13probe(bdinfo_t *bd) if ((bd->bd_flags & BD_FLOPPY) != 0) dv_name = biosfd.dv_name; - else if ((bd->bd_flags & BD_CDROM) != 0) - dv_name = bioscd.dv_name; else dv_name = bioshd.dv_name; From owner-svn-src-all@freebsd.org Tue Feb 4 07:18:49 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F0D4923E5E2; Tue, 4 Feb 2020 07:18:49 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Bbf168Dyz4mcl; Tue, 4 Feb 2020 07:18:49 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CE176E004; Tue, 4 Feb 2020 07:18:49 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0147InAV004152; Tue, 4 Feb 2020 07:18:49 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0147InIf004151; Tue, 4 Feb 2020 07:18:49 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <202002040718.0147InIf004151@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Tue, 4 Feb 2020 07:18:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r357496 - stable/11/stand/i386/libi386 X-SVN-Group: stable-11 X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: stable/11/stand/i386/libi386 X-SVN-Commit-Revision: 357496 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 07:18:50 -0000 Author: tsoome Date: Tue Feb 4 07:18:49 2020 New Revision: 357496 URL: https://svnweb.freebsd.org/changeset/base/357496 Log: MFC r357442: loader: bc_add can not use any other probes than ah=0x4b CD boot is broken for some systems since bioscd and biosdisk merge. The issue is that we can not use anything else than int 13 ah=0x4b to query cd information. The patch does restore the same probe as was originally used in bioscd.c. Additionally extra buffer padding is used to avoid memory corruption caused by some systems. PR: 234031 Reported by: ultramage and others Modified: stable/11/stand/i386/libi386/biosdisk.c Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/i386/libi386/biosdisk.c ============================================================================== --- stable/11/stand/i386/libi386/biosdisk.c Tue Feb 4 07:15:33 2020 (r357495) +++ stable/11/stand/i386/libi386/biosdisk.c Tue Feb 4 07:18:49 2020 (r357496) @@ -82,6 +82,7 @@ struct specification_packet { uint16_t sp_sectorcount; uint16_t sp_cylsec; uint8_t sp_head; + uint8_t sp_dummy[16]; /* Avoid memory corruption */ }; /* @@ -356,54 +357,92 @@ cd_init(void) return (0); } -int -bc_add(int biosdev) +/* + * Information from bootable CD-ROM. + */ +static int +bd_get_diskinfo_cd(struct bdinfo *bd) { - bdinfo_t *bd; struct specification_packet bc_sp; - int nbcinfo = 0; + int ret = -1; - if (!STAILQ_EMPTY(&cdinfo)) - return (-1); + (void) memset(&bc_sp, 0, sizeof (bc_sp)); + /* Set sp_size as per specification. */ + bc_sp.sp_size = sizeof (bc_sp) - sizeof (bc_sp.sp_dummy); v86.ctl = V86_FLAGS; v86.addr = 0x13; v86.eax = 0x4b01; - v86.edx = biosdev; + v86.edx = bd->bd_unit; v86.ds = VTOPSEG(&bc_sp); v86.esi = VTOPOFF(&bc_sp); v86int(); - if ((v86.eax & 0xff00) != 0) - return (-1); - if ((bd = calloc(1, sizeof(*bd))) == NULL) - return (-1); + if ((v86.eax & 0xff00) == 0 && + bc_sp.sp_drive == bd->bd_unit) { + bd->bd_cyl = ((bc_sp.sp_cylsec & 0xc0) << 2) + + ((bc_sp.sp_cylsec & 0xff00) >> 8) + 1; + bd->bd_sec = bc_sp.sp_cylsec & 0x3f; + bd->bd_hds = bc_sp.sp_head + 1; + bd->bd_sectors = (uint64_t)bd->bd_cyl * bd->bd_hds * bd->bd_sec; - bd->bd_flags = BD_CDROM; - bd->bd_unit = biosdev; - bd->bd_sectorsize = 2048; + if (bc_sp.sp_bootmedia & 0x0F) { + /* Floppy or hard-disk emulation */ + bd->bd_sectorsize = BIOSDISK_SECSIZE; + return (-1); + } else { + bd->bd_sectorsize = 2048; + bd->bd_flags = BD_MODEEDD | BD_CDROM; + ret = 0; + } + } /* - * Ignore result from bd_int13probe(), we will use local - * workaround below. + * If this is the boot_drive, default to non-emulation bootable CD-ROM. */ - (void)bd_int13probe(bd); - - if (bd->bd_cyl == 0) { - bd->bd_cyl = ((bc_sp.sp_cylsec & 0xc0) << 2) + - ((bc_sp.sp_cylsec & 0xff00) >> 8) + 1; + if (ret != 0 && bd->bd_unit >= 0x88) { + bd->bd_cyl = 0; + bd->bd_hds = 1; + bd->bd_sec = 15; + bd->bd_sectorsize = 2048; + bd->bd_flags = BD_MODEEDD | BD_CDROM; + bd->bd_sectors = 0; + ret = 0; } - if (bd->bd_hds == 0) - bd->bd_hds = bc_sp.sp_head + 1; - if (bd->bd_sec == 0) - bd->bd_sec = bc_sp.sp_cylsec & 0x3f; - if (bd->bd_sectors == 0) - bd->bd_sectors = (uint64_t)bd->bd_cyl * bd->bd_hds * bd->bd_sec; - /* Still no size? use 7.961GB */ + /* + * Note we can not use bd_get_diskinfo_ext() nor bd_get_diskinfo_std() + * here - some systems do get hung with those. + */ + /* + * Still no size? use 7.961GB. The size does not really matter + * as long as it is reasonably large to make our reads to pass + * the sector count check. + */ if (bd->bd_sectors == 0) bd->bd_sectors = 4173824; + + return (ret); +} +int +bc_add(int biosdev) +{ + bdinfo_t *bd; + int nbcinfo = 0; + + if (!STAILQ_EMPTY(&cdinfo)) + return (-1); + + if ((bd = calloc(1, sizeof(*bd))) == NULL) + return (-1); + + bd->bd_unit = biosdev; + if (bd_get_diskinfo_cd(bd) < 0) { + free(bd); + return (-1); + } + STAILQ_INSERT_TAIL(&cdinfo, bd, bd_link); printf("BIOS CD is cd%d\n", nbcinfo); nbcinfo++; @@ -483,22 +522,32 @@ bd_get_diskinfo_std(struct bdinfo *bd) /* * Read EDD info. Return 0 on success, error otherwise. + * + * Avoid stack corruption on some systems by adding extra bytes to + * params block. */ static int bd_get_diskinfo_ext(struct bdinfo *bd) { - struct edd_params params; + struct disk_params { + struct edd_params head; + struct edd_device_path_v3 device_path; + uint8_t dummy[16]; + } __packed dparams; + struct edd_params *params; uint64_t total; + params = &dparams.head; + /* Get disk params */ - bzero(¶ms, sizeof(params)); - params.len = sizeof(params); + bzero(&dparams, sizeof(dparams)); + params->len = sizeof(struct edd_params_v3); v86.ctl = V86_FLAGS; v86.addr = 0x13; v86.eax = 0x4800; v86.edx = bd->bd_unit; - v86.ds = VTOPSEG(¶ms); - v86.esi = VTOPOFF(¶ms); + v86.ds = VTOPSEG(&dparams); + v86.esi = VTOPOFF(&dparams); v86int(); if (V86_CY(v86.efl) && ((v86.eax & 0xff00) != 0)) @@ -510,20 +559,20 @@ bd_get_diskinfo_ext(struct bdinfo *bd) * powerof2(params.sector_size). * 16K is largest read buffer we can use at this time. */ - if (params.sector_size >= 512 && - params.sector_size <= 16384 && - (params.sector_size % BIOSDISK_SECSIZE) == 0) - bd->bd_sectorsize = params.sector_size; + if (params->sector_size >= 512 && + params->sector_size <= 16384 && + (params->sector_size % BIOSDISK_SECSIZE) == 0) + bd->bd_sectorsize = params->sector_size; - bd->bd_cyl = params.cylinders; - bd->bd_hds = params.heads; - bd->bd_sec = params.sectors_per_track; + bd->bd_cyl = params->cylinders; + bd->bd_hds = params->heads; + bd->bd_sec = params->sectors_per_track; - if (params.sectors != 0) { - total = params.sectors; + if (params->sectors != 0) { + total = params->sectors; } else { - total = (uint64_t)params.cylinders * - params.heads * params.sectors_per_track; + total = (uint64_t)params->cylinders * + params->heads * params->sectors_per_track; } bd->bd_sectors = total; @@ -540,6 +589,10 @@ bd_int13probe(bdinfo_t *bd) bd->bd_flags &= ~BD_NO_MEDIA; + if ((bd->bd_flags & BD_CDROM) != 0) { + return (bd_get_diskinfo_cd(bd) == 0); + } + edd = bd_check_extensions(bd->bd_unit); if (edd == 0) bd->bd_flags |= BD_MODEINT13; @@ -588,10 +641,6 @@ bd_int13probe(bdinfo_t *bd) } if (ret != 0) { - /* CD is special case, bc_add() has its own fallback. */ - if ((bd->bd_flags & BD_CDROM) != 0) - return (true); - if (bd->bd_sectors != 0 && edd != 0) { bd->bd_sec = 63; bd->bd_hds = 255; @@ -603,8 +652,6 @@ bd_int13probe(bdinfo_t *bd) if ((bd->bd_flags & BD_FLOPPY) != 0) dv_name = biosfd.dv_name; - else if ((bd->bd_flags & BD_CDROM) != 0) - dv_name = bioscd.dv_name; else dv_name = bioshd.dv_name; From owner-svn-src-all@freebsd.org Tue Feb 4 07:37:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6EF9923EF8E; Tue, 4 Feb 2020 07:37:56 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Bc44375Hz4njG; Tue, 4 Feb 2020 07:37:56 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 66632E3F2; Tue, 4 Feb 2020 07:37:56 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0147bur1016148; Tue, 4 Feb 2020 07:37:56 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0147btdC016145; Tue, 4 Feb 2020 07:37:55 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <202002040737.0147btdC016145@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Tue, 4 Feb 2020 07:37:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357497 - in head: stand/i386/zfsboot stand/libsa/zfs sys/cddl/boot/zfs X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: in head: stand/i386/zfsboot stand/libsa/zfs sys/cddl/boot/zfs X-SVN-Commit-Revision: 357497 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 07:37:56 -0000 Author: tsoome Date: Tue Feb 4 07:37:55 2020 New Revision: 357497 URL: https://svnweb.freebsd.org/changeset/base/357497 Log: loader: rewrite zfs reader zap code to use malloc First step on removing zfs_alloc. Reviewed by: delphij Differential Revision: https://reviews.freebsd.org/D23433 Modified: head/stand/i386/zfsboot/zfsboot.c head/stand/libsa/zfs/zfsimpl.c head/sys/cddl/boot/zfs/zfsimpl.h Modified: head/stand/i386/zfsboot/zfsboot.c ============================================================================== --- head/stand/i386/zfsboot/zfsboot.c Tue Feb 4 07:18:49 2020 (r357496) +++ head/stand/i386/zfsboot/zfsboot.c Tue Feb 4 07:37:55 2020 (r357497) @@ -317,31 +317,42 @@ static int vdev_read_pad2(vdev_t *vdev, char *buf, size_t size) { blkptr_t bp; - char *tmp = zap_scratch; + char *tmp; off_t off = offsetof(vdev_label_t, vl_pad2); + int rc; if (size > VDEV_PAD_SIZE) size = VDEV_PAD_SIZE; + tmp = malloc(size); + if (tmp == NULL) + return (ENOMEM); + BP_ZERO(&bp); BP_SET_LSIZE(&bp, VDEV_PAD_SIZE); BP_SET_PSIZE(&bp, VDEV_PAD_SIZE); BP_SET_CHECKSUM(&bp, ZIO_CHECKSUM_LABEL); BP_SET_COMPRESS(&bp, ZIO_COMPRESS_OFF); DVA_SET_OFFSET(BP_IDENTITY(&bp), off); - if (vdev_read_phys(vdev, &bp, tmp, off, 0)) - return (EIO); - memcpy(buf, tmp, size); - return (0); + rc = vdev_read_phys(vdev, &bp, tmp, off, 0); + if (rc == 0) + memcpy(buf, tmp, size); + free(buf); + return (rc); } static int vdev_clear_pad2(vdev_t *vdev) { - char *zeroes = zap_scratch; + char *zeroes; uint64_t *end; off_t off = offsetof(vdev_label_t, vl_pad2); + int rc; + zeroes = malloc(VDEV_PAD_SIZE); + if (zeroes == NULL) + return (ENOMEM); + memset(zeroes, 0, VDEV_PAD_SIZE); end = (uint64_t *)(zeroes + VDEV_PAD_SIZE); /* ZIO_CHECKSUM_LABEL magic and pre-calcualted checksum for all zeros */ @@ -350,9 +361,9 @@ vdev_clear_pad2(vdev_t *vdev) end[-3] = 0xaf909f1658aacefc; end[-2] = 0xcbd1ea57ff6db48b; end[-1] = 0x6ec692db0d465fab; - if (vdev_write(vdev, vdev->v_read_priv, off, zeroes, VDEV_PAD_SIZE)) - return (EIO); - return (0); + rc = vdev_write(vdev, vdev->v_read_priv, off, zeroes, VDEV_PAD_SIZE); + free(zeroes); + return (rc); } static void Modified: head/stand/libsa/zfs/zfsimpl.c ============================================================================== --- head/stand/libsa/zfs/zfsimpl.c Tue Feb 4 07:18:49 2020 (r357496) +++ head/stand/libsa/zfs/zfsimpl.c Tue Feb 4 07:37:55 2020 (r357497) @@ -138,7 +138,6 @@ static spa_list_t zfs_pools; static const dnode_phys_t *dnode_cache_obj; static uint64_t dnode_cache_bn; static char *dnode_cache_buf; -static char *zap_scratch; static char *zfs_temp_buf, *zfs_temp_end, *zfs_temp_ptr; #define TEMP_SIZE (1024 * 1024) @@ -172,7 +171,6 @@ zfs_init(void) zfs_temp_end = zfs_temp_buf + TEMP_SIZE; zfs_temp_ptr = zfs_temp_buf; dnode_cache_buf = malloc(SPA_MAXBLOCKSIZE); - zap_scratch = malloc(SPA_MAXBLOCKSIZE); zfs_init_crc(); } @@ -2300,22 +2298,17 @@ dnode_read(const spa_t *spa, const dnode_phys_t *dnode * scratch buffer contains the directory contents. */ static int -mzap_lookup(const dnode_phys_t *dnode, const char *name, uint64_t *value) +mzap_lookup(const mzap_phys_t *mz, size_t size, const char *name, + uint64_t *value) { - const mzap_phys_t *mz; const mzap_ent_phys_t *mze; - size_t size; int chunks, i; /* * Microzap objects use exactly one block. Read the whole * thing. */ - size = dnode->dn_datablkszsec * 512; - - mz = (const mzap_phys_t *) zap_scratch; chunks = size / MZAP_ENT_LEN - 1; - for (i = 0; i < chunks; i++) { mze = &mz->mz_chunk[i]; if (strcmp(mze->mze_name, name) == 0) { @@ -2458,89 +2451,166 @@ fzap_check_size(uint64_t integer_size, uint64_t num_in return (0); } -/* - * Lookup a value in a fatzap directory. Assumes that the zap scratch - * buffer contains the directory header. - */ +static void +zap_leaf_free(zap_leaf_t *leaf) +{ + free(leaf->l_phys); + free(leaf); +} + static int -fzap_lookup(const spa_t *spa, const dnode_phys_t *dnode, const char *name, - uint64_t integer_size, uint64_t num_integers, void *value) +zap_get_leaf_byblk(fat_zap_t *zap, uint64_t blk, zap_leaf_t **lp) { - int bsize = dnode->dn_datablkszsec << SPA_MINBLOCKSHIFT; - zap_phys_t zh = *(zap_phys_t *)zap_scratch; - fat_zap_t z; - uint64_t *ptrtbl; - uint64_t hash; - int rc; + int bs = FZAP_BLOCK_SHIFT(zap); + int err; - if (zh.zap_magic != ZAP_MAGIC) - return (EIO); + *lp = malloc(sizeof(**lp)); + if (*lp == NULL) + return (ENOMEM); - if ((rc = fzap_check_size(integer_size, num_integers)) != 0) - return (rc); + (*lp)->l_bs = bs; + (*lp)->l_phys = malloc(1 << bs); - z.zap_block_shift = ilog2(bsize); - z.zap_phys = (zap_phys_t *)zap_scratch; + if ((*lp)->l_phys == NULL) { + free(*lp); + return (ENOMEM); + } + err = dnode_read(zap->zap_spa, zap->zap_dnode, blk << bs, (*lp)->l_phys, + 1 << bs); + if (err != 0) { + zap_leaf_free(*lp); + } + return (err); +} - /* - * Figure out where the pointer table is and read it in if necessary. - */ - if (zh.zap_ptrtbl.zt_blk) { - rc = dnode_read(spa, dnode, zh.zap_ptrtbl.zt_blk * bsize, - zap_scratch, bsize); - if (rc) - return (rc); - ptrtbl = (uint64_t *)zap_scratch; +static int +zap_table_load(fat_zap_t *zap, zap_table_phys_t *tbl, uint64_t idx, + uint64_t *valp) +{ + int bs = FZAP_BLOCK_SHIFT(zap); + uint64_t blk = idx >> (bs - 3); + uint64_t off = idx & ((1 << (bs - 3)) - 1); + uint64_t *buf; + int rc; + + buf = malloc(1 << zap->zap_block_shift); + if (buf == NULL) + return (ENOMEM); + rc = dnode_read(zap->zap_spa, zap->zap_dnode, (tbl->zt_blk + blk) << bs, + buf, 1 << zap->zap_block_shift); + if (rc == 0) + *valp = buf[off]; + free(buf); + return (rc); +} + +static int +zap_idx_to_blk(fat_zap_t *zap, uint64_t idx, uint64_t *valp) +{ + if (zap->zap_phys->zap_ptrtbl.zt_numblks == 0) { + *valp = ZAP_EMBEDDED_PTRTBL_ENT(zap, idx); + return (0); } else { - ptrtbl = &ZAP_EMBEDDED_PTRTBL_ENT(&z, 0); + return (zap_table_load(zap, &zap->zap_phys->zap_ptrtbl, + idx, valp)); } +} - hash = zap_hash(zh.zap_salt, name); +#define ZAP_HASH_IDX(hash, n) (((n) == 0) ? 0 : ((hash) >> (64 - (n)))) +static int +zap_deref_leaf(fat_zap_t *zap, uint64_t h, zap_leaf_t **lp) +{ + uint64_t idx, blk; + int err; - zap_leaf_t zl; - zl.l_bs = z.zap_block_shift; + idx = ZAP_HASH_IDX(h, zap->zap_phys->zap_ptrtbl.zt_shift); + err = zap_idx_to_blk(zap, idx, &blk); + if (err != 0) + return (err); + return (zap_get_leaf_byblk(zap, blk, lp)); +} - off_t off = ptrtbl[hash >> (64 - zh.zap_ptrtbl.zt_shift)] << zl.l_bs; - zap_leaf_chunk_t *zc; +#define CHAIN_END 0xffff /* end of the chunk chain */ +#define LEAF_HASH(l, h) \ + ((ZAP_LEAF_HASH_NUMENTRIES(l)-1) & \ + ((h) >> \ + (64 - ZAP_LEAF_HASH_SHIFT(l) - (l)->l_phys->l_hdr.lh_prefix_len))) +#define LEAF_HASH_ENTPTR(l, h) (&(l)->l_phys->l_hash[LEAF_HASH(l, h)]) - rc = dnode_read(spa, dnode, off, zap_scratch, bsize); - if (rc) - return (rc); +static int +zap_leaf_lookup(zap_leaf_t *zl, uint64_t hash, const char *name, + uint64_t integer_size, uint64_t num_integers, void *value) +{ + int rc; + uint16_t *chunkp; + struct zap_leaf_entry *le; - zl.l_phys = (zap_leaf_phys_t *)zap_scratch; - /* * Make sure this chunk matches our hash. */ - if (zl.l_phys->l_hdr.lh_prefix_len > 0 && - zl.l_phys->l_hdr.lh_prefix != - hash >> (64 - zl.l_phys->l_hdr.lh_prefix_len)) - return (ENOENT); + if (zl->l_phys->l_hdr.lh_prefix_len > 0 && + zl->l_phys->l_hdr.lh_prefix != + hash >> (64 - zl->l_phys->l_hdr.lh_prefix_len)) + return (EIO); - /* - * Hash within the chunk to find our entry. - */ - int shift = (64 - ZAP_LEAF_HASH_SHIFT(&zl) - - zl.l_phys->l_hdr.lh_prefix_len); - int h = (hash >> shift) & ((1 << ZAP_LEAF_HASH_SHIFT(&zl)) - 1); - h = zl.l_phys->l_hash[h]; - if (h == 0xffff) - return (ENOENT); - zc = &ZAP_LEAF_CHUNK(&zl, h); - while (zc->l_entry.le_hash != hash) { - if (zc->l_entry.le_next == 0xffff) - return (ENOENT); - zc = &ZAP_LEAF_CHUNK(&zl, zc->l_entry.le_next); + rc = ENOENT; + for (chunkp = LEAF_HASH_ENTPTR(zl, hash); + *chunkp != CHAIN_END; chunkp = &le->le_next) { + zap_leaf_chunk_t *zc; + uint16_t chunk = *chunkp; + + le = ZAP_LEAF_ENTRY(zl, chunk); + if (le->le_hash != hash) + continue; + zc = &ZAP_LEAF_CHUNK(zl, chunk); + if (fzap_name_equal(zl, zc, name)) { + if (zc->l_entry.le_value_intlen > integer_size) { + rc = EINVAL; + } else { + fzap_leaf_array(zl, zc, integer_size, + num_integers, value); + rc = 0; + } + break; + } } - if (fzap_name_equal(&zl, zc, name)) { - if (zc->l_entry.le_value_intlen * zc->l_entry.le_value_numints > - integer_size * num_integers) - return (E2BIG); - fzap_leaf_array(&zl, zc, integer_size, num_integers, value); - return (0); - } + return (rc); +} - return (ENOENT); +/* + * Lookup a value in a fatzap directory. + */ +static int +fzap_lookup(const spa_t *spa, const dnode_phys_t *dnode, zap_phys_t *zh, + const char *name, uint64_t integer_size, uint64_t num_integers, + void *value) +{ + int bsize = dnode->dn_datablkszsec << SPA_MINBLOCKSHIFT; + fat_zap_t z; + zap_leaf_t *zl; + uint64_t hash; + int rc; + + if (zh->zap_magic != ZAP_MAGIC) + return (EIO); + + if ((rc = fzap_check_size(integer_size, num_integers)) != 0) + return (rc); + + z.zap_block_shift = ilog2(bsize); + z.zap_phys = zh; + z.zap_spa = spa; + z.zap_dnode = dnode; + + hash = zap_hash(zh->zap_salt, name); + rc = zap_deref_leaf(&z, hash, &zl); + if (rc != 0) + return (rc); + + rc = zap_leaf_lookup(zl, hash, name, integer_size, num_integers, value); + + zap_leaf_free(zl); + return (rc); } /* @@ -2551,74 +2621,80 @@ zap_lookup(const spa_t *spa, const dnode_phys_t *dnode uint64_t integer_size, uint64_t num_integers, void *value) { int rc; - uint64_t zap_type; + zap_phys_t *zap; size_t size = dnode->dn_datablkszsec << SPA_MINBLOCKSHIFT; - rc = dnode_read(spa, dnode, 0, zap_scratch, size); + zap = malloc(size); + if (zap == NULL) + return (ENOMEM); + + rc = dnode_read(spa, dnode, 0, zap, size); if (rc) - return (rc); + goto done; - zap_type = *(uint64_t *)zap_scratch; - if (zap_type == ZBT_MICRO) - return (mzap_lookup(dnode, name, value)); - else if (zap_type == ZBT_HEADER) { - return (fzap_lookup(spa, dnode, name, integer_size, - num_integers, value)); + switch (zap->zap_block_type) { + case ZBT_MICRO: + rc = mzap_lookup((const mzap_phys_t *)zap, size, name, value); + break; + case ZBT_HEADER: + rc = fzap_lookup(spa, dnode, zap, name, integer_size, + num_integers, value); + break; + default: + printf("ZFS: invalid zap_type=%" PRIx64 "\n", + zap->zap_block_type); + rc = EIO; } - printf("ZFS: invalid zap_type=%d\n", (int)zap_type); - return (EIO); +done: + free(zap); + return (rc); } /* - * List a microzap directory. Assumes that the zap scratch buffer contains - * the directory contents. + * List a microzap directory. */ static int -mzap_list(const dnode_phys_t *dnode, int (*callback)(const char *, uint64_t)) +mzap_list(const mzap_phys_t *mz, size_t size, + int (*callback)(const char *, uint64_t)) { - const mzap_phys_t *mz; const mzap_ent_phys_t *mze; - size_t size; int chunks, i, rc; /* * Microzap objects use exactly one block. Read the whole * thing. */ - size = dnode->dn_datablkszsec * 512; - mz = (const mzap_phys_t *) zap_scratch; + rc = 0; chunks = size / MZAP_ENT_LEN - 1; - for (i = 0; i < chunks; i++) { mze = &mz->mz_chunk[i]; if (mze->mze_name[0]) { rc = callback(mze->mze_name, mze->mze_value); if (rc != 0) - return (rc); + break; } } - return (0); + return (rc); } /* - * List a fatzap directory. Assumes that the zap scratch buffer contains - * the directory header. + * List a fatzap directory. */ static int -fzap_list(const spa_t *spa, const dnode_phys_t *dnode, +fzap_list(const spa_t *spa, const dnode_phys_t *dnode, zap_phys_t *zh, int (*callback)(const char *, uint64_t)) { int bsize = dnode->dn_datablkszsec << SPA_MINBLOCKSHIFT; - zap_phys_t zh = *(zap_phys_t *)zap_scratch; fat_zap_t z; - int i, j, rc; + uint64_t i; + int j, rc; - if (zh.zap_magic != ZAP_MAGIC) + if (zh->zap_magic != ZAP_MAGIC) return (EIO); z.zap_block_shift = ilog2(bsize); - z.zap_phys = (zap_phys_t *)zap_scratch; + z.zap_phys = zh; /* * This assumes that the leaf blocks start at block 1. The @@ -2626,16 +2702,20 @@ fzap_list(const spa_t *spa, const dnode_phys_t *dnode, */ zap_leaf_t zl; zl.l_bs = z.zap_block_shift; - for (i = 0; i < zh.zap_num_leafs; i++) { + zl.l_phys = malloc(bsize); + if (zl.l_phys == NULL) + return (ENOMEM); + + for (i = 0; i < zh->zap_num_leafs; i++) { off_t off = ((off_t)(i + 1)) << zl.l_bs; char name[256], *p; uint64_t value; - if (dnode_read(spa, dnode, off, zap_scratch, bsize)) + if (dnode_read(spa, dnode, off, zl.l_phys, bsize)) { + free(zl.l_phys); return (EIO); + } - zl.l_phys = (zap_leaf_phys_t *)zap_scratch; - for (j = 0; j < ZAP_LEAF_NUMCHUNKS(&zl); j++) { zap_leaf_chunk_t *zc, *nc; int namelen; @@ -2671,11 +2751,14 @@ fzap_list(const spa_t *spa, const dnode_phys_t *dnode, /* printf("%s 0x%jx\n", name, (uintmax_t)value); */ rc = callback((const char *)name, value); - if (rc != 0) + if (rc != 0) { + free(zl.l_phys); return (rc); + } } } + free(zl.l_phys); return (0); } @@ -2693,17 +2776,24 @@ static int zfs_printf(const char *name, uint64_t value static int zap_list(const spa_t *spa, const dnode_phys_t *dnode) { - uint64_t zap_type; + zap_phys_t *zap; size_t size = dnode->dn_datablkszsec * 512; + int rc; - if (dnode_read(spa, dnode, 0, zap_scratch, size)) - return (EIO); + zap = malloc(size); + if (zap == NULL) + return (ENOMEM); - zap_type = *(uint64_t *)zap_scratch; - if (zap_type == ZBT_MICRO) - return (mzap_list(dnode, zfs_printf)); - else - return (fzap_list(spa, dnode, zfs_printf)); + rc = dnode_read(spa, dnode, 0, zap, size); + if (rc == 0) { + if (zap->zap_block_type == ZBT_MICRO) + rc = mzap_list((const mzap_phys_t *)zap, size, + zfs_printf); + else + rc = fzap_list(spa, dnode, zap, zfs_printf); + } + free(zap); + return (rc); } static int @@ -2717,24 +2807,20 @@ objset_get_dnode(const spa_t *spa, const objset_phys_t dnode, sizeof(dnode_phys_t)); } +/* + * Lookup a name in a microzap directory. + */ static int -mzap_rlookup(const spa_t *spa, const dnode_phys_t *dnode, char *name, - uint64_t value) +mzap_rlookup(const mzap_phys_t *mz, size_t size, char *name, uint64_t value) { - const mzap_phys_t *mz; const mzap_ent_phys_t *mze; - size_t size; int chunks, i; /* * Microzap objects use exactly one block. Read the whole * thing. */ - size = dnode->dn_datablkszsec * 512; - - mz = (const mzap_phys_t *)zap_scratch; chunks = size / MZAP_ENT_LEN - 1; - for (i = 0; i < chunks; i++) { mze = &mz->mz_chunk[i]; if (value == mze->mze_value) { @@ -2772,19 +2858,19 @@ fzap_name_copy(const zap_leaf_t *zl, const zap_leaf_ch } static int -fzap_rlookup(const spa_t *spa, const dnode_phys_t *dnode, char *name, - uint64_t value) +fzap_rlookup(const spa_t *spa, const dnode_phys_t *dnode, zap_phys_t *zh, + char *name, uint64_t value) { int bsize = dnode->dn_datablkszsec << SPA_MINBLOCKSHIFT; - zap_phys_t zh = *(zap_phys_t *)zap_scratch; fat_zap_t z; - int i, j; + uint64_t i; + int j, rc; - if (zh.zap_magic != ZAP_MAGIC) + if (zh->zap_magic != ZAP_MAGIC) return (EIO); z.zap_block_shift = ilog2(bsize); - z.zap_phys = (zap_phys_t *)zap_scratch; + z.zap_phys = zh; /* * This assumes that the leaf blocks start at block 1. The @@ -2792,14 +2878,17 @@ fzap_rlookup(const spa_t *spa, const dnode_phys_t *dno */ zap_leaf_t zl; zl.l_bs = z.zap_block_shift; - for (i = 0; i < zh.zap_num_leafs; i++) { + zl.l_phys = malloc(bsize); + if (zl.l_phys == NULL) + return (ENOMEM); + + for (i = 0; i < zh->zap_num_leafs; i++) { off_t off = ((off_t)(i + 1)) << zl.l_bs; - if (dnode_read(spa, dnode, off, zap_scratch, bsize)) - return (EIO); + rc = dnode_read(spa, dnode, off, zl.l_phys, bsize); + if (rc != 0) + goto done; - zl.l_phys = (zap_leaf_phys_t *)zap_scratch; - for (j = 0; j < ZAP_LEAF_NUMCHUNKS(&zl); j++) { zap_leaf_chunk_t *zc; @@ -2812,31 +2901,39 @@ fzap_rlookup(const spa_t *spa, const dnode_phys_t *dno if (fzap_leaf_value(&zl, zc) == value) { fzap_name_copy(&zl, zc, name); - return (0); + goto done; } } } - return (ENOENT); + rc = ENOENT; +done: + free(zl.l_phys); + return (rc); } static int zap_rlookup(const spa_t *spa, const dnode_phys_t *dnode, char *name, uint64_t value) { - int rc; - uint64_t zap_type; + zap_phys_t *zap; size_t size = dnode->dn_datablkszsec * 512; + int rc; - rc = dnode_read(spa, dnode, 0, zap_scratch, size); - if (rc) - return (rc); + zap = malloc(size); + if (zap == NULL) + return (ENOMEM); - zap_type = *(uint64_t *)zap_scratch; - if (zap_type == ZBT_MICRO) - return (mzap_rlookup(spa, dnode, name, value)); - else - return (fzap_rlookup(spa, dnode, name, value)); + rc = dnode_read(spa, dnode, 0, zap, size); + if (rc == 0) { + if (zap->zap_block_type == ZBT_MICRO) + rc = mzap_rlookup((const mzap_phys_t *)zap, size, + name, value); + else + rc = fzap_rlookup(spa, dnode, zap, name, value); + } + free(zap); + return (rc); } static int @@ -2988,10 +3085,12 @@ int zfs_callback_dataset(const spa_t *spa, uint64_t objnum, int (*callback)(const char *, uint64_t)) { - uint64_t dir_obj, child_dir_zapobj, zap_type; + uint64_t dir_obj, child_dir_zapobj; dnode_phys_t child_dir_zap, dir, dataset; dsl_dataset_phys_t *ds; dsl_dir_phys_t *dd; + zap_phys_t *zap; + size_t size; int err; err = objset_get_dnode(spa, &spa->spa_mos, objnum, &dataset); @@ -3017,16 +3116,22 @@ zfs_callback_dataset(const spa_t *spa, uint64_t objnum return (err); } - err = dnode_read(spa, &child_dir_zap, 0, zap_scratch, - child_dir_zap.dn_datablkszsec * 512); - if (err != 0) - return (err); + size = child_dir_zap.dn_datablkszsec * 512; + zap = malloc(size); + if (zap != NULL) { + err = dnode_read(spa, &child_dir_zap, 0, zap, size); + if (err != 0) + goto done; - zap_type = *(uint64_t *)zap_scratch; - if (zap_type == ZBT_MICRO) - return (mzap_list(&child_dir_zap, callback)); - else - return (fzap_list(spa, &child_dir_zap, callback)); + if (zap->zap_block_type == ZBT_MICRO) + err = mzap_list((const mzap_phys_t *)zap, size, + callback); + else + err = fzap_list(spa, &child_dir_zap, zap, callback); + } +done: + free(zap); + return (err); } #endif @@ -3158,7 +3263,8 @@ static int check_mos_features(const spa_t *spa) { dnode_phys_t dir; - uint64_t objnum, zap_type; + zap_phys_t *zap; + uint64_t objnum; size_t size; int rc; @@ -3181,15 +3287,21 @@ check_mos_features(const spa_t *spa) return (EIO); size = dir.dn_datablkszsec * 512; - if (dnode_read(spa, &dir, 0, zap_scratch, size)) + zap = malloc(size); + if (zap == NULL) + return (ENOMEM); + + if (dnode_read(spa, &dir, 0, zap, size)) { + free(zap); return (EIO); + } - zap_type = *(uint64_t *)zap_scratch; - if (zap_type == ZBT_MICRO) - rc = mzap_list(&dir, check_feature); + if (zap->zap_block_type == ZBT_MICRO) + rc = mzap_list((const mzap_phys_t *)zap, size, check_feature); else - rc = fzap_list(spa, &dir, check_feature); + rc = fzap_list(spa, &dir, zap, check_feature); + free(zap); return (rc); } Modified: head/sys/cddl/boot/zfs/zfsimpl.h ============================================================================== --- head/sys/cddl/boot/zfs/zfsimpl.h Tue Feb 4 07:18:49 2020 (r357496) +++ head/sys/cddl/boot/zfs/zfsimpl.h Tue Feb 4 07:37:55 2020 (r357497) @@ -1174,7 +1174,7 @@ typedef enum dmu_objset_type { DMU_OST_NUMTYPES } dmu_objset_type_t; -#define ZAP_MAXVALUELEN (1024 * 8) +#define ZAP_MAXVALUELEN (1024 * 8) /* * header for all bonus and spill buffers. @@ -1333,8 +1333,7 @@ typedef struct dsl_dataset_phys { #define ZAP_HASHBITS 28 #define MZAP_ENT_LEN 64 #define MZAP_NAME_LEN (MZAP_ENT_LEN - 8 - 4 - 2) -#define MZAP_MAX_BLKSHIFT SPA_MAXBLOCKSHIFT -#define MZAP_MAX_BLKSZ (1 << MZAP_MAX_BLKSHIFT) +#define MZAP_MAX_BLKSZ SPA_OLD_MAXBLOCKSIZE typedef struct mzap_ent_phys { uint64_t mze_value; @@ -1346,7 +1345,8 @@ typedef struct mzap_ent_phys { typedef struct mzap_phys { uint64_t mz_block_type; /* ZBT_MICRO */ uint64_t mz_salt; - uint64_t mz_pad[6]; + uint64_t mz_normflags; + uint64_t mz_pad[5]; mzap_ent_phys_t mz_chunk[1]; /* actually variable size depending on block size */ } mzap_phys_t; @@ -1403,6 +1403,8 @@ typedef struct zap_phys { uint64_t zap_num_leafs; /* number of leafs */ uint64_t zap_num_entries; /* number of entries */ uint64_t zap_salt; /* salt to stir into hash function */ + uint64_t zap_normflags; /* flags for u8_textprep_str() */ + uint64_t zap_flags; /* zap_flags_t */ /* * This structure is followed by padding, and then the embedded * pointer table. The embedded pointer table takes up second @@ -1413,9 +1415,12 @@ typedef struct zap_phys { typedef struct zap_table_phys zap_table_phys_t; +struct spa; typedef struct fat_zap { int zap_block_shift; /* block size shift */ zap_phys_t *zap_phys; + const struct spa *zap_spa; + const dnode_phys_t *zap_dnode; } fat_zap_t; #define ZAP_LEAF_MAGIC 0x2AB1EAF From owner-svn-src-all@freebsd.org Tue Feb 4 09:12:13 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 033AA2410A7; Tue, 4 Feb 2020 09:12:13 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Bf8r635Cz4tD8; Tue, 4 Feb 2020 09:12:12 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C476CF66A; Tue, 4 Feb 2020 09:12:12 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0149CCIt075428; Tue, 4 Feb 2020 09:12:12 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0149CCYj075427; Tue, 4 Feb 2020 09:12:12 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202002040912.0149CCYj075427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 4 Feb 2020 09:12:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357498 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 357498 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 09:12:13 -0000 Author: imp Date: Tue Feb 4 09:12:12 2020 New Revision: 357498 URL: https://svnweb.freebsd.org/changeset/base/357498 Log: Bump __FreeBSD_version to 1300077 for r357455 sparc64 was removed, bump to reflect that. Pointy-hat-to: imp Noticed by: linimon@ Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Tue Feb 4 07:37:55 2020 (r357497) +++ head/sys/sys/param.h Tue Feb 4 09:12:12 2020 (r357498) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300076 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300077 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Tue Feb 4 12:33:00 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A740924546E; Tue, 4 Feb 2020 12:33:00 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BkcX3xSCz3Mgc; Tue, 4 Feb 2020 12:33:00 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8299F19D1B; Tue, 4 Feb 2020 12:33:00 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014CX0jx097607; Tue, 4 Feb 2020 12:33:00 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014CX0ie097606; Tue, 4 Feb 2020 12:33:00 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202002041233.014CX0ie097606@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 4 Feb 2020 12:33:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357499 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 357499 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 12:33:00 -0000 Author: andrew Date: Tue Feb 4 12:33:00 2020 New Revision: 357499 URL: https://svnweb.freebsd.org/changeset/base/357499 Log: Print useful debug data on unhandled kernel fault on arm64 When panicing because of an unhandled data abort from the kernel it is useful to know the register state and faulting address to aid debugging. Print these registers before calling panic. Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/trap.c Modified: head/sys/arm64/arm64/trap.c ============================================================================== --- head/sys/arm64/arm64/trap.c Tue Feb 4 09:12:12 2020 (r357498) +++ head/sys/arm64/arm64/trap.c Tue Feb 4 12:33:00 2020 (r357499) @@ -357,12 +357,15 @@ do_el1h_sync(struct thread *td, struct trapframe *fram far = READ_SPECIALREG(far_el1); dfsc = esr & ISS_DATA_DFSC_MASK; if (dfsc < nitems(abort_handlers) && - abort_handlers[dfsc] != NULL) + abort_handlers[dfsc] != NULL) { abort_handlers[dfsc](td, frame, esr, far, 0); - else + } else { + print_registers(frame); + printf(" far: %16lx\n", far); panic("Unhandled EL1 %s abort: %x", exception == EXCP_INSN_ABORT ? "instruction" : "data", dfsc); + } break; case EXCP_BRK: #ifdef KDTRACE_HOOKS From owner-svn-src-all@freebsd.org Tue Feb 4 12:34:17 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 46551245522; Tue, 4 Feb 2020 12:34:17 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Bkf11DPXz3MrJ; Tue, 4 Feb 2020 12:34:17 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 252E619D1C; Tue, 4 Feb 2020 12:34:17 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014CYHg1097720; Tue, 4 Feb 2020 12:34:17 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014CYGOk097719; Tue, 4 Feb 2020 12:34:16 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202002041234.014CYGOk097719@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 4 Feb 2020 12:34:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357500 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 357500 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 12:34:17 -0000 Author: tuexen Date: Tue Feb 4 12:34:16 2020 New Revision: 357500 URL: https://svnweb.freebsd.org/changeset/base/357500 Log: Improve numbering of debug information. Submitted by: Taylor Brandstetter MFC after: 1 week Modified: head/sys/netinet/sctp_constants.h head/sys/netinet/sctp_indata.c Modified: head/sys/netinet/sctp_constants.h ============================================================================== --- head/sys/netinet/sctp_constants.h Tue Feb 4 12:33:00 2020 (r357499) +++ head/sys/netinet/sctp_constants.h Tue Feb 4 12:34:16 2020 (r357500) @@ -807,7 +807,7 @@ __FBSDID("$FreeBSD$"); #define SCTP_LOC_33 0x00000021 #define SCTP_LOC_34 0x00000022 #define SCTP_LOC_35 0x00000023 - +#define SCTP_LOC_36 0x00000024 /* Free assoc codes */ #define SCTP_NORMAL_PROC 0 Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Tue Feb 4 12:33:00 2020 (r357499) +++ head/sys/netinet/sctp_indata.c Tue Feb 4 12:34:16 2020 (r357500) @@ -1754,7 +1754,7 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc * Need to send an abort since we had a empty data chunk. */ op_err = sctp_generate_no_user_data_cause(tsn); - stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_14; + stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_15; sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_flag = 1; return (0); @@ -1892,7 +1892,7 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc snprintf(msg, sizeof(msg), "Reassembly problem (MID=%8.8x)", mid); err_out: op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); - stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_15; + stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_16; sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_flag = 1; return (0); @@ -2041,7 +2041,7 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc (uint16_t)mid); } op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); - stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_16; + stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_17; sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_flag = 1; return (0); @@ -2613,7 +2613,7 @@ sctp_sack_check(struct sctp_tcb *stcb, int was_a_gap) if (SCTP_OS_TIMER_PENDING(&stcb->asoc.dack_timer.timer)) { sctp_timer_stop(SCTP_TIMER_TYPE_RECV, stcb->sctp_ep, stcb, NULL, - SCTP_FROM_SCTP_INDATA + SCTP_LOC_17); + SCTP_FROM_SCTP_INDATA + SCTP_LOC_18); } sctp_send_shutdown(stcb, ((stcb->asoc.alternate) ? stcb->asoc.alternate : stcb->asoc.primary_destination)); @@ -2766,7 +2766,7 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o snprintf(msg, sizeof(msg), "%s", "I-DATA chunk received when DATA was negotiated"); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); - stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_18; + stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_20; sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); return (2); } @@ -2777,7 +2777,7 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o snprintf(msg, sizeof(msg), "%s", "DATA chunk received when I-DATA was negotiated"); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); - stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_19; + stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_21; sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); return (2); } @@ -2802,7 +2802,7 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o ch->chunk_type == SCTP_DATA ? "DATA" : "I-DATA", chk_length); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); - stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_20; + stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_22; sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); return (2); } @@ -2891,7 +2891,7 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o snprintf(msg, sizeof(msg), "Chunk of length %u", chk_length); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); - stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_20; + stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_23; sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); return (2); } @@ -4041,7 +4041,7 @@ sctp_express_handle_sack(struct sctp_tcb *stcb, uint32 snprintf(msg, sizeof(msg), "Cum ack %8.8x greater or equal than TSN %8.8x", cumack, send_s); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); - stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_21; + stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_24; sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); return; } @@ -4237,7 +4237,7 @@ sctp_express_handle_sack(struct sctp_tcb *stcb, uint32 net->dest_state &= ~SCTP_ADDR_PF; sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, net, - SCTP_FROM_SCTP_INDATA + SCTP_LOC_22); + SCTP_FROM_SCTP_INDATA + SCTP_LOC_25); sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, net); asoc->cc_functions.sctp_cwnd_update_exit_pf(stcb, net); /* Done with this net */ @@ -4315,7 +4315,7 @@ again: } else if (SCTP_OS_TIMER_PENDING(&net->rxt_timer.timer)) { sctp_timer_stop(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, stcb, net, - SCTP_FROM_SCTP_INDATA + SCTP_LOC_23); + SCTP_FROM_SCTP_INDATA + SCTP_LOC_26); } } } @@ -4368,7 +4368,7 @@ again: *abort_now = 1; /* XXX */ op_err = sctp_generate_cause(SCTP_CAUSE_USER_INITIATED_ABT, ""); - stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_24; + stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_27; sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); return; } @@ -4578,7 +4578,7 @@ hopeless_peer: snprintf(msg, sizeof(msg), "Cum ack %8.8x greater or equal than TSN %8.8x", cum_ack, send_s); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); - stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_25; + stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_28; sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); return; } @@ -4610,7 +4610,7 @@ hopeless_peer: /* stop any timers */ TAILQ_FOREACH(net, &asoc->nets, sctp_next) { sctp_timer_stop(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, - stcb, net, SCTP_FROM_SCTP_INDATA + SCTP_LOC_26); + stcb, net, SCTP_FROM_SCTP_INDATA + SCTP_LOC_29); net->partial_bytes_acked = 0; net->flight_size = 0; } @@ -4810,14 +4810,14 @@ hopeless_peer: if (net->new_pseudo_cumack) sctp_timer_stop(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, stcb, net, - SCTP_FROM_SCTP_INDATA + SCTP_LOC_27); + SCTP_FROM_SCTP_INDATA + SCTP_LOC_30); } } else { if (accum_moved) { TAILQ_FOREACH(net, &asoc->nets, sctp_next) { sctp_timer_stop(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, - stcb, net, SCTP_FROM_SCTP_INDATA + SCTP_LOC_28); + stcb, net, SCTP_FROM_SCTP_INDATA + SCTP_LOC_31); } } } @@ -5000,7 +5000,7 @@ hopeless_peer: net->dest_state &= ~SCTP_ADDR_PF; sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, net, - SCTP_FROM_SCTP_INDATA + SCTP_LOC_29); + SCTP_FROM_SCTP_INDATA + SCTP_LOC_32); sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, net); asoc->cc_functions.sctp_cwnd_update_exit_pf(stcb, net); /* Done with this net */ @@ -5025,7 +5025,7 @@ hopeless_peer: /* stop all timers */ sctp_timer_stop(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, stcb, net, - SCTP_FROM_SCTP_INDATA + SCTP_LOC_30); + SCTP_FROM_SCTP_INDATA + SCTP_LOC_33); net->flight_size = 0; net->partial_bytes_acked = 0; } @@ -5063,7 +5063,7 @@ hopeless_peer: *abort_now = 1; /* XXX */ op_err = sctp_generate_cause(SCTP_CAUSE_USER_INITIATED_ABT, ""); - stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_24; + stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_34; sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); return; } @@ -5212,7 +5212,7 @@ again: } else if (SCTP_OS_TIMER_PENDING(&net->rxt_timer.timer)) { sctp_timer_stop(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, stcb, net, - SCTP_FROM_SCTP_INDATA + SCTP_LOC_32); + SCTP_FROM_SCTP_INDATA + SCTP_LOC_35); } } } @@ -5618,7 +5618,7 @@ sctp_handle_forward_tsn(struct sctp_tcb *stcb, "New cum ack %8.8x too high, highest TSN %8.8x", new_cum_tsn, asoc->highest_tsn_inside_map); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); - stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_33; + stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_36; sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); return; } From owner-svn-src-all@freebsd.org Tue Feb 4 13:34:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 368AB246B69 for ; Tue, 4 Feb 2020 13:34:11 +0000 (UTC) (envelope-from kenneth.wilson326@gmail.com) Received: from mail-oi1-x242.google.com (mail-oi1-x242.google.com [IPv6:2607:f8b0:4864:20::242]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Blz62VHzz3Qy3 for ; Tue, 4 Feb 2020 13:34:10 +0000 (UTC) (envelope-from kenneth.wilson326@gmail.com) Received: by mail-oi1-x242.google.com with SMTP id z2so18402533oih.6 for ; Tue, 04 Feb 2020 05:34:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:from:date:message-id:subject:to; bh=hP25pD291ZXhFIy4d07sO8zZeWLswFpQS6I6Hkf1i+s=; b=PHS1c+VmooJIQ6CaI09yQkGCg2Uz+xohS6a31clO2/L65x5g/Ze3HkPg4vgk75p3Nu dp5fpY2GYOSEM71j1FqikEfKJNrEPudf9TFMvFsNatGbi1hVZKmZwXH7CJMYlE0CTXBk Y5Fe9Q5eNNl9uAnIZ+0IjvQxzzOEoEMJeoTsY2RAdboxUhobdmfAOeHyMIWg1b4SxwJx F331rTvO3smIqxENSlE4BpoKB45SqWYrxWwKsbHdswIlnBFExr8NIVMDDxbZdIvLXH/W 8+6k/rCPDlPmxQGyziWOxDyqsx/dLr1TLo0sejx5KVCR521bcnQ7LPjG2EFprXN4xViQ 502w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:from:date:message-id:subject :to; bh=hP25pD291ZXhFIy4d07sO8zZeWLswFpQS6I6Hkf1i+s=; b=hX744OifiFXkAFzNkzD5SdomypyHb9bK+NesdXzbmHTa4PbBjmAAnqNH/Iqu2CvBGP kHs3kD0D+cEfjDtx+zW5MhuvUcAgJKlAx4Wy3+gCLu0K42twnVswIhwrTDlQhnnPVrYW vZCTO1GhzXK3thYejyXyAgNtHmQHAinGuMTjsC5KSGX1CALsSghtRc8AHKgh75VKy+BM ujV9wvrX/SWypMyn1ANP/bkepGltfUFnMfDTr/diz1o8xVEf2YfF20e1SZiLEimm+jeS YSXGdIIl6X6rVeX9XIDh6G1B+pORQwHer9lfJTHJshubdh2lUA66NttczpwFbb/zj4Uu K26A== X-Gm-Message-State: APjAAAV3GyiZgKZ78MivzpHtgbVxyi9X1Bc/bWhEcv3fedqm90uH6QKs J5zlxJOrzh45CBKsM9zA7GPZCpo+pobl+TMPJ/m+xA== X-Google-Smtp-Source: APXvYqxORQpej0mfZOh8QdJlqeeW18UsIsVXzZ2RxRMl7FZeR9z78vQwxQk2rbqfweC5VPikMDkjJgc0wQRTD78g7zc= X-Received: by 2002:aca:cc07:: with SMTP id c7mr3328580oig.165.1580823248324; Tue, 04 Feb 2020 05:34:08 -0800 (PST) Received: from 52669349336 named unknown by gmailapi.google.com with HTTPREST; Tue, 4 Feb 2020 14:34:06 +0100 MIME-Version: 1.0 Sender: Kenneth Wilson From: Kenneth Wilson Date: Tue, 4 Feb 2020 14:34:06 +0100 X-Google-Sender-Auth: DUWPXYFP9_jhqtRxxnpx4fKY4tY Message-ID: Subject: Re: Expand Your Business gcu-squad.org To: Svn-Src-All X-Rspamd-Queue-Id: 48Blz62VHzz3Qy3 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=PHS1c+Vm; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of kennethwilson326@gmail.com designates 2607:f8b0:4864:20::242 as permitted sender) smtp.mailfrom=kennethwilson326@gmail.com X-Spamd-Result: default: False [-2.00 / 15.00]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(0.00)[ip: (2.49), ipnet: 2607:f8b0::/32(-1.99), asn: 15169(-1.75), country: US(-0.05)]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; FAKE_REPLY(1.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; IP_SCORE_FREEMAIL(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_IN_DNSWL_NONE(0.00)[2.4.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; RCVD_TLS_ALL(0.00)[] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 13:34:11 -0000 Hello gcu-squad.org As we all know, a website is the first impression that a customer perceives about an organisation. Well we offer tailor made services to counteract all your web problems! We have been successful in increasing the website visibility of our clients in major search engine. *Below are the factors we keep in mind while promoting your website: * - Keeping your website error free allows search engine crawlers to index your website right away. - A well searched and analysed keyword palette for maximum optimisation. - Regular updates on various social media networks for brand promotion. - Excellent content places direct impression on the users for better information. Apart from the above mentioned activities, we offer many other additional improvements for your website. There=E2=80=99s been a lot to discuss and wo= rk out for better results on your site! Please feel free to reply me back for more information on our services and pricing. *Thanks & Regards* *Kenneth Wilson* *Digital Marketing Analyst*=E2=80=A6=E2=80=A6=E2=80=A6=E2=80=A6=E2=80=A6=E2= =80=A6=E2=80=A6=E2=80=A6=E2=80=A6=E2=80=A6=E2=80=A6=E2=80=A6=E2=80=A6=E2=80= =A6=E2=80=A6=E2=80=A6=E2=80=A6=E2=80=A6=E2=80=A6=E2=80=A6 Ps: You may ask us to =E2=80=9CRemove=E2=80=9D to stop further corresponden= ce. [image: beacon] From owner-svn-src-all@freebsd.org Tue Feb 4 14:01:08 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 86EFD247307; Tue, 4 Feb 2020 14:01:08 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BmZD2q6Kz3xVZ; Tue, 4 Feb 2020 14:01:08 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5BE5D1AD44; Tue, 4 Feb 2020 14:01:08 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014E18Cf048172; Tue, 4 Feb 2020 14:01:08 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014E17h4048168; Tue, 4 Feb 2020 14:01:07 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202002041401.014E17h4048168@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 4 Feb 2020 14:01:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357501 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 357501 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 14:01:08 -0000 Author: tuexen Date: Tue Feb 4 14:01:07 2020 New Revision: 357501 URL: https://svnweb.freebsd.org/changeset/base/357501 Log: Remove unused timer. Submitted by: Taylor Brandstetter Modified: head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_structs.h head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Tue Feb 4 12:34:16 2020 (r357500) +++ head/sys/netinet/sctp_pcb.c Tue Feb 4 14:01:07 2020 (r357501) @@ -2746,7 +2746,6 @@ sctp_move_pcb_and_assoc(struct sctp_inpcb *old_inp, st stcb->asoc.strreset_timer.ep = (void *)new_inp; stcb->asoc.shut_guard_timer.ep = (void *)new_inp; stcb->asoc.autoclose_timer.ep = (void *)new_inp; - stcb->asoc.delayed_event_timer.ep = (void *)new_inp; stcb->asoc.delete_prim_timer.ep = (void *)new_inp; /* now what about the nets? */ TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { @@ -4407,7 +4406,6 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockadd SCTP_OS_TIMER_INIT(&asoc->asconf_timer.timer); SCTP_OS_TIMER_INIT(&asoc->shut_guard_timer.timer); SCTP_OS_TIMER_INIT(&asoc->autoclose_timer.timer); - SCTP_OS_TIMER_INIT(&asoc->delayed_event_timer.timer); SCTP_OS_TIMER_INIT(&asoc->delete_prim_timer.timer); LIST_INSERT_HEAD(&inp->sctp_asoc_list, stcb, sctp_tcblist); @@ -4781,8 +4779,6 @@ sctp_free_assoc(struct sctp_inpcb *inp, struct sctp_tc asoc->autoclose_timer.self = NULL; (void)SCTP_OS_TIMER_STOP(&asoc->shut_guard_timer.timer); asoc->shut_guard_timer.self = NULL; - (void)SCTP_OS_TIMER_STOP(&asoc->delayed_event_timer.timer); - asoc->delayed_event_timer.self = NULL; /* Mobility adaptation */ (void)SCTP_OS_TIMER_STOP(&asoc->delete_prim_timer.timer); asoc->delete_prim_timer.self = NULL; @@ -4967,7 +4963,6 @@ sctp_free_assoc(struct sctp_inpcb *inp, struct sctp_tc (void)SCTP_OS_TIMER_STOP(&asoc->asconf_timer.timer); (void)SCTP_OS_TIMER_STOP(&asoc->shut_guard_timer.timer); (void)SCTP_OS_TIMER_STOP(&asoc->autoclose_timer.timer); - (void)SCTP_OS_TIMER_STOP(&asoc->delayed_event_timer.timer); TAILQ_FOREACH(net, &asoc->nets, sctp_next) { (void)SCTP_OS_TIMER_STOP(&net->rxt_timer.timer); (void)SCTP_OS_TIMER_STOP(&net->pmtu_timer.timer); Modified: head/sys/netinet/sctp_structs.h ============================================================================== --- head/sys/netinet/sctp_structs.h Tue Feb 4 12:34:16 2020 (r357500) +++ head/sys/netinet/sctp_structs.h Tue Feb 4 14:01:07 2020 (r357501) @@ -806,7 +806,6 @@ struct sctp_association { struct sctp_timer strreset_timer; /* stream reset */ struct sctp_timer shut_guard_timer; /* shutdown guard */ struct sctp_timer autoclose_timer; /* automatic close timer */ - struct sctp_timer delayed_event_timer; /* timer for delayed events */ struct sctp_timer delete_prim_timer; /* deleting primary dst */ /* list of restricted local addresses */ Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Tue Feb 4 12:34:16 2020 (r357500) +++ head/sys/netinet/sctputil.c Tue Feb 4 14:01:07 2020 (r357501) @@ -789,7 +789,6 @@ sctp_stop_timers_for_shutdown(struct sctp_tcb *stcb) (void)SCTP_OS_TIMER_STOP(&asoc->strreset_timer.timer); (void)SCTP_OS_TIMER_STOP(&asoc->asconf_timer.timer); (void)SCTP_OS_TIMER_STOP(&asoc->autoclose_timer.timer); - (void)SCTP_OS_TIMER_STOP(&asoc->delayed_event_timer.timer); TAILQ_FOREACH(net, &asoc->nets, sctp_next) { (void)SCTP_OS_TIMER_STOP(&net->pmtu_timer.timer); (void)SCTP_OS_TIMER_STOP(&net->hb_timer.timer); From owner-svn-src-all@freebsd.org Tue Feb 4 15:14:26 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 70542228A2E; Tue, 4 Feb 2020 15:14:26 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-il1-f172.google.com (mail-il1-f172.google.com [209.85.166.172]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BpBn1xXMz4250; Tue, 4 Feb 2020 15:14:25 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-il1-f172.google.com with SMTP id s85so12718925ill.11; Tue, 04 Feb 2020 07:14:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=sNAFYMAKqP9FcRzqz/9becCIrxz5Q1TS3DLDatRHNhI=; b=TmQyKAArJ5zWEw+ApV3CrLk8i3GdBhp0KWYsLyaOWC6Ec1ObKoac2tAAWsKdoNoZNP kpE3RG1971d80HtR6wCq8w1+G1GOHG3xJHo4qKP6F7z13xblHCzUrUDXqMLQ3wOr89iE B7yWz35U54G3hOdiIHmEdSagLPr/GeZx36WVtTwrT+7CHVu1AI24uhNEo1aIlMNkD298 SPSQzS4uHl2DayqB5psufsD93Z01qrYAtIphPL83Or3k99VTrlquinp7dp+pLpNSe5RU /46887C38V2Z4hvnML0yUZk+qskycWWJCoRP6nG+XWdwF3QmLMrPM09Hjq5gNBrGKME4 1drw== X-Gm-Message-State: APjAAAXRdHjgyjtCt5Wbw1ddX4Na1fPwCvedu+uBoyupwH13hJNZDU3S 9P9VSpDfwJ6gArbzE3jBzdWU7p6MVG3PjqnjbOMyZA== X-Google-Smtp-Source: APXvYqzShiHb4IqjufZo8UW+f5YQupy3ifQ4SKGPd366Qcvy+11RJdiTWZ6trz/KQhnO5jOR+ZwUgORM0VuQ2wxPvL8= X-Received: by 2002:a92:d982:: with SMTP id r2mr20345801iln.98.1580829263442; Tue, 04 Feb 2020 07:14:23 -0800 (PST) MIME-Version: 1.0 References: <202001290525.00T5PKKh017113@repo.freebsd.org> In-Reply-To: From: Ed Maste Date: Tue, 4 Feb 2020 10:14:11 -0500 Message-ID: Subject: Re: svn commit: r357246 - head/tests/sys/sys To: Conrad Meyer Cc: Li-Wen Hsu , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 48BpBn1xXMz4250 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of carpeddiem@gmail.com designates 209.85.166.172 as permitted sender) smtp.mailfrom=carpeddiem@gmail.com X-Spamd-Result: default: False [-4.35 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE(-2.35)[ip: (-6.94), ipnet: 209.85.128.0/17(-3.03), asn: 15169(-1.75), country: US(-0.05)]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[172.166.85.209.list.dnswl.org : 127.0.5.0]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[172.166.85.209.rep.mailspike.net : 127.0.0.17]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[emaste@freebsd.org,carpeddiem@gmail.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 15:14:26 -0000 On Wed, 29 Jan 2020 at 17:38, Conrad Meyer wrote: > > Hi Li-Wen, > > Thanks for the report. I went ahead and reverted it in r357273. Thanks Conrad. I agree that this should be cleaned up and I hope that someone can find time to take another look at this. From owner-svn-src-all@freebsd.org Tue Feb 4 15:53:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CB26C229D84; Tue, 4 Feb 2020 15:53:52 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Bq4J4jMtz44GW; Tue, 4 Feb 2020 15:53:52 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9CE7E1C283; Tue, 4 Feb 2020 15:53:52 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014Frqjx019326; Tue, 4 Feb 2020 15:53:52 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014Frqql019324; Tue, 4 Feb 2020 15:53:52 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202002041553.014Frqql019324@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 4 Feb 2020 15:53:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357502 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Commit-Revision: 357502 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 15:53:52 -0000 Author: mav Date: Tue Feb 4 15:53:51 2020 New Revision: 357502 URL: https://svnweb.freebsd.org/changeset/base/357502 Log: Few microoptimizations to dbuf layer. Move db_link into the same cache line as db_blkid and db_level. It allows significantly reduce avl_add() time in dbuf_create() on systems with large RAM and huge number of dbufs per dnode. Avoid few accesses to dbuf_caches[].size, which is highly congested under high IOPS and never stays in cache for a long time. Use local value we are receiving from zfs_refcount_add_many() any way. Remove cache_size_bytes_max bump from dbuf_evict_one(). I don't see a point to do it on dbuf eviction after we done it on insertion in dbuf_rele_and_unlock(). Reviewed by: mahrens, Brian Behlendorf MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Tue Feb 4 14:01:07 2020 (r357501) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Tue Feb 4 15:53:51 2020 (r357502) @@ -671,13 +671,6 @@ dbuf_cache_lowater_bytes(void) } static inline boolean_t -dbuf_cache_above_hiwater(void) -{ - return (zfs_refcount_count(&dbuf_caches[DB_DBUF_CACHE].size) > - dbuf_cache_hiwater_bytes()); -} - -static inline boolean_t dbuf_cache_above_lowater(void) { return (zfs_refcount_count(&dbuf_caches[DB_DBUF_CACHE].size) > @@ -717,8 +710,6 @@ dbuf_evict_one(void) ASSERT3U(db->db_caching_status, ==, DB_DBUF_CACHE); db->db_caching_status = DB_NO_CACHE; dbuf_destroy(db); - DBUF_STAT_MAX(cache_size_bytes_max, - zfs_refcount_count(&dbuf_caches[DB_DBUF_CACHE].size)); DBUF_STAT_BUMP(cache_total_evicts); } else { multilist_sublist_unlock(mls); @@ -778,16 +769,15 @@ dbuf_evict_thread(void *unused __unused) * dbuf cache using the callers context. */ static void -dbuf_evict_notify(void) +dbuf_evict_notify(uint64_t size) { /* * We check if we should evict without holding the dbuf_evict_lock, * because it's OK to occasionally make the wrong decision here, * and grabbing the lock results in massive lock contention. */ - if (zfs_refcount_count(&dbuf_caches[DB_DBUF_CACHE].size) > - dbuf_cache_max_bytes) { - if (dbuf_cache_above_hiwater()) + if (size > dbuf_cache_max_bytes) { + if (size > dbuf_cache_hiwater_bytes()) dbuf_evict_one(); cv_signal(&dbuf_evict_cv); } @@ -3186,6 +3176,7 @@ void dbuf_rele_and_unlock(dmu_buf_impl_t *db, void *tag, boolean_t evicting) { int64_t holds; + uint64_t size; ASSERT(MUTEX_HELD(&db->db_mtx)); DBUF_VERIFY(db); @@ -3282,15 +3273,14 @@ dbuf_rele_and_unlock(dmu_buf_impl_t *db, void *tag, bo db->db_caching_status = dcs; multilist_insert(dbuf_caches[dcs].cache, db); - (void) zfs_refcount_add_many( + size = zfs_refcount_add_many( &dbuf_caches[dcs].size, db->db.db_size, db); if (dcs == DB_DBUF_METADATA_CACHE) { DBUF_STAT_BUMP(metadata_cache_count); DBUF_STAT_MAX( metadata_cache_size_bytes_max, - zfs_refcount_count( - &dbuf_caches[dcs].size)); + size); } else { DBUF_STAT_BUMP( cache_levels[db->db_level]); @@ -3299,15 +3289,12 @@ dbuf_rele_and_unlock(dmu_buf_impl_t *db, void *tag, bo cache_levels_bytes[db->db_level], db->db.db_size); DBUF_STAT_MAX(cache_size_bytes_max, - zfs_refcount_count( - &dbuf_caches[dcs].size)); + size); } mutex_exit(&db->db_mtx); - if (db->db_caching_status == DB_DBUF_CACHE && - !evicting) { - dbuf_evict_notify(); - } + if (dcs == DB_DBUF_CACHE && !evicting) + dbuf_evict_notify(size); } if (do_arc_evict) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h Tue Feb 4 14:01:07 2020 (r357501) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h Tue Feb 4 15:53:51 2020 (r357502) @@ -189,6 +189,13 @@ typedef struct dmu_buf_impl { */ struct dmu_buf_impl *db_hash_next; + /* + * Our link on the owner dnodes's dn_dbufs list. + * Protected by its dn_dbufs_mtx. Should be on the same cache line + * as db_level and db_blkid for the best avl_add() performance. + */ + avl_node_t db_link; + /* our block number */ uint64_t db_blkid; @@ -229,12 +236,6 @@ typedef struct dmu_buf_impl { /* pointer to most recent dirty record for this buffer */ dbuf_dirty_record_t *db_last_dirty; - - /* - * Our link on the owner dnodes's dn_dbufs list. - * Protected by its dn_dbufs_mtx. - */ - avl_node_t db_link; /* Link in dbuf_cache or dbuf_metadata_cache */ multilist_node_t db_cache_link; From owner-svn-src-all@freebsd.org Tue Feb 4 16:01:06 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ED63322A074; Tue, 4 Feb 2020 16:01:06 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BqDf63BPz44fq; Tue, 4 Feb 2020 16:01:06 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CAE641C2E2; Tue, 4 Feb 2020 16:01:06 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014G16P3020500; Tue, 4 Feb 2020 16:01:06 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014G168c020498; Tue, 4 Feb 2020 16:01:06 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202002041601.014G168c020498@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 4 Feb 2020 16:01:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357503 - head/sys/amd64/linux X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/amd64/linux X-SVN-Commit-Revision: 357503 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 16:01:07 -0000 Author: trasz Date: Tue Feb 4 16:01:06 2020 New Revision: 357503 URL: https://svnweb.freebsd.org/changeset/base/357503 Log: Add missing linux(4) syscall entries. This fixes missing debug messages for some of the unimplemented syscalls, in particular the AIO-related ones. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D23231 Modified: head/sys/amd64/linux/linux_dummy.c head/sys/amd64/linux/syscalls.master Modified: head/sys/amd64/linux/linux_dummy.c ============================================================================== --- head/sys/amd64/linux/linux_dummy.c Tue Feb 4 15:53:51 2020 (r357502) +++ head/sys/amd64/linux/linux_dummy.c Tue Feb 4 16:01:06 2020 (r357503) @@ -53,9 +53,9 @@ UNIMPLEMENTED(getpmsg); UNIMPLEMENTED(nfsservctl); /* Added in Linux 2.2 removed in 3.1. */ UNIMPLEMENTED(putpmsg); UNIMPLEMENTED(query_module); /* Added in Linux 2.2 removed in 2.6. */ +UNIMPLEMENTED(tuxcall); UNIMPLEMENTED(security); UNIMPLEMENTED(set_thread_area); -UNIMPLEMENTED(tuxcall); UNIMPLEMENTED(uselib); UNIMPLEMENTED(vserver); @@ -64,14 +64,23 @@ DUMMY(setfsuid); DUMMY(setfsgid); DUMMY(sysfs); DUMMY(vhangup); +DUMMY(modify_ldt); DUMMY(pivot_root); DUMMY(adjtimex); DUMMY(swapoff); DUMMY(init_module); +DUMMY(ioperm); DUMMY(delete_module); DUMMY(quotactl); +DUMMY(readahead); +DUMMY(io_setup); +DUMMY(io_destroy); +DUMMY(io_getevents); +DUMMY(io_submit); +DUMMY(io_cancel); DUMMY(lookup_dcookie); DUMMY(remap_file_pages); +DUMMY(restart_syscall); DUMMY(semtimedop); DUMMY(mbind); DUMMY(get_mempolicy); Modified: head/sys/amd64/linux/syscalls.master ============================================================================== --- head/sys/amd64/linux/syscalls.master Tue Feb 4 15:53:51 2020 (r357502) +++ head/sys/amd64/linux/syscalls.master Tue Feb 4 16:01:06 2020 (r357503) @@ -304,7 +304,7 @@ 151 AUE_MLOCKALL NOPROTO { int mlockall(int how); } 152 AUE_MUNLOCKALL NOPROTO { int munlockall(void); } 153 AUE_NULL STD { int linux_vhangup(void); } -154 AUE_NULL UNIMPL modify_ldt +154 AUE_NULL STD { int linux_modify_ldt(void); } 155 AUE_PIVOT_ROOT STD { int linux_pivot_root(void); } 156 AUE_SYSCTL STD { int linux_sysctl( \ struct l___sysctl_args *args); } @@ -332,7 +332,7 @@ 171 AUE_SYSCTL STD { int linux_setdomainname(char *name, \ l_int len); } 172 AUE_NULL STD { int linux_iopl(l_uint level); } -173 AUE_NULL UNIMPL ioperm +173 AUE_NULL STD { int linux_ioperm(void); } 174 AUE_NULL UNIMPL create_module 175 AUE_NULL STD { int linux_init_module(void); } 176 AUE_NULL STD { int linux_delete_module(void); } @@ -346,7 +346,7 @@ 184 AUE_NULL UNIMPL tuxcall 185 AUE_NULL UNIMPL security 186 AUE_NULL STD { int linux_gettid(void); } -187 AUE_NULL UNIMPL linux_readahead +187 AUE_NULL STD { int linux_readahead(void); } 188 AUE_NULL STD { int linux_setxattr(void); } 189 AUE_NULL STD { int linux_lsetxattr(void); } 190 AUE_NULL STD { int linux_fsetxattr(void); } @@ -368,11 +368,11 @@ 204 AUE_NULL STD { int linux_sched_getaffinity(l_pid_t pid, l_uint len, \ l_ulong *user_mask_ptr); } 205 AUE_NULL UNIMPL set_thread_area -206 AUE_NULL UNIMPL linux_io_setup -207 AUE_NULL UNIMPL linux_io_destroy -208 AUE_NULL UNIMPL linux_io_getevents -209 AUE_NULL UNIMPL linux_io_submit -210 AUE_NULL UNIMPL linux_io_cancel +206 AUE_NULL STD { int linux_io_setup(void); } +207 AUE_NULL STD { int linux_io_destroy(void); } +208 AUE_NULL STD { int linux_io_getevents(void); } +209 AUE_NULL STD { int linux_io_submit(void); } +210 AUE_NULL STD { int linux_io_cancel(void); } 211 AUE_NULL UNIMPL get_thread_area 212 AUE_NULL STD { int linux_lookup_dcookie(void); } 213 AUE_NULL STD { int linux_epoll_create(l_int size); } @@ -382,7 +382,7 @@ 217 AUE_GETDIRENTRIES STD { int linux_getdents64(l_uint fd, \ void *dirent, l_uint count); } 218 AUE_NULL STD { int linux_set_tid_address(l_int *tidptr); } -219 AUE_NULL UNIMPL restart_syscall +219 AUE_NULL STD { int linux_restart_syscall(void); } 220 AUE_NULL STD { int linux_semtimedop(void); } 221 AUE_NULL STD { int linux_fadvise64(l_int fd, l_loff_t offset, \ l_size_t len, l_int advice); } From owner-svn-src-all@freebsd.org Tue Feb 4 16:02:06 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 05EE022A26C; Tue, 4 Feb 2020 16:02:06 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BqFp05rlz44rp; Tue, 4 Feb 2020 16:02:06 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D9A751C463; Tue, 4 Feb 2020 16:02:05 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014G25M3023891; Tue, 4 Feb 2020 16:02:05 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014G24g3023887; Tue, 4 Feb 2020 16:02:05 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202002041602.014G24g3023887@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 4 Feb 2020 16:02:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357504 - head/sys/amd64/linux X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/amd64/linux X-SVN-Commit-Revision: 357504 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 16:02:06 -0000 Author: trasz Date: Tue Feb 4 16:02:04 2020 New Revision: 357504 URL: https://svnweb.freebsd.org/changeset/base/357504 Log: Regen after r357503. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/amd64/linux/linux_proto.h head/sys/amd64/linux/linux_syscall.h head/sys/amd64/linux/linux_syscalls.c head/sys/amd64/linux/linux_sysent.c head/sys/amd64/linux/linux_systrace_args.c Modified: head/sys/amd64/linux/linux_proto.h ============================================================================== --- head/sys/amd64/linux/linux_proto.h Tue Feb 4 16:01:06 2020 (r357503) +++ head/sys/amd64/linux/linux_proto.h Tue Feb 4 16:02:04 2020 (r357504) @@ -551,6 +551,9 @@ struct linux_sched_rr_get_interval_args { struct linux_vhangup_args { register_t dummy; }; +struct linux_modify_ldt_args { + register_t dummy; +}; struct linux_pivot_root_args { register_t dummy; }; @@ -606,6 +609,9 @@ struct linux_setdomainname_args { struct linux_iopl_args { char level_l_[PADL_(l_uint)]; l_uint level; char level_r_[PADR_(l_uint)]; }; +struct linux_ioperm_args { + register_t dummy; +}; struct linux_init_module_args { register_t dummy; }; @@ -618,6 +624,9 @@ struct linux_quotactl_args { struct linux_gettid_args { register_t dummy; }; +struct linux_readahead_args { + register_t dummy; +}; struct linux_setxattr_args { register_t dummy; }; @@ -679,6 +688,21 @@ struct linux_sched_getaffinity_args { char len_l_[PADL_(l_uint)]; l_uint len; char len_r_[PADR_(l_uint)]; char user_mask_ptr_l_[PADL_(l_ulong *)]; l_ulong * user_mask_ptr; char user_mask_ptr_r_[PADR_(l_ulong *)]; }; +struct linux_io_setup_args { + register_t dummy; +}; +struct linux_io_destroy_args { + register_t dummy; +}; +struct linux_io_getevents_args { + register_t dummy; +}; +struct linux_io_submit_args { + register_t dummy; +}; +struct linux_io_cancel_args { + register_t dummy; +}; struct linux_lookup_dcookie_args { register_t dummy; }; @@ -696,6 +720,9 @@ struct linux_getdents64_args { struct linux_set_tid_address_args { char tidptr_l_[PADL_(l_int *)]; l_int * tidptr; char tidptr_r_[PADR_(l_int *)]; }; +struct linux_restart_syscall_args { + register_t dummy; +}; struct linux_semtimedop_args { register_t dummy; }; @@ -1360,6 +1387,7 @@ int linux_sched_get_priority_max(struct thread *, stru int linux_sched_get_priority_min(struct thread *, struct linux_sched_get_priority_min_args *); int linux_sched_rr_get_interval(struct thread *, struct linux_sched_rr_get_interval_args *); int linux_vhangup(struct thread *, struct linux_vhangup_args *); +int linux_modify_ldt(struct thread *, struct linux_modify_ldt_args *); int linux_pivot_root(struct thread *, struct linux_pivot_root_args *); int linux_sysctl(struct thread *, struct linux_sysctl_args *); int linux_prctl(struct thread *, struct linux_prctl_args *); @@ -1373,10 +1401,12 @@ int linux_reboot(struct thread *, struct linux_reboot_ int linux_sethostname(struct thread *, struct linux_sethostname_args *); int linux_setdomainname(struct thread *, struct linux_setdomainname_args *); int linux_iopl(struct thread *, struct linux_iopl_args *); +int linux_ioperm(struct thread *, struct linux_ioperm_args *); int linux_init_module(struct thread *, struct linux_init_module_args *); int linux_delete_module(struct thread *, struct linux_delete_module_args *); int linux_quotactl(struct thread *, struct linux_quotactl_args *); int linux_gettid(struct thread *, struct linux_gettid_args *); +int linux_readahead(struct thread *, struct linux_readahead_args *); int linux_setxattr(struct thread *, struct linux_setxattr_args *); int linux_lsetxattr(struct thread *, struct linux_lsetxattr_args *); int linux_fsetxattr(struct thread *, struct linux_fsetxattr_args *); @@ -1394,11 +1424,17 @@ int linux_time(struct thread *, struct linux_time_args int linux_sys_futex(struct thread *, struct linux_sys_futex_args *); int linux_sched_setaffinity(struct thread *, struct linux_sched_setaffinity_args *); int linux_sched_getaffinity(struct thread *, struct linux_sched_getaffinity_args *); +int linux_io_setup(struct thread *, struct linux_io_setup_args *); +int linux_io_destroy(struct thread *, struct linux_io_destroy_args *); +int linux_io_getevents(struct thread *, struct linux_io_getevents_args *); +int linux_io_submit(struct thread *, struct linux_io_submit_args *); +int linux_io_cancel(struct thread *, struct linux_io_cancel_args *); int linux_lookup_dcookie(struct thread *, struct linux_lookup_dcookie_args *); int linux_epoll_create(struct thread *, struct linux_epoll_create_args *); int linux_remap_file_pages(struct thread *, struct linux_remap_file_pages_args *); int linux_getdents64(struct thread *, struct linux_getdents64_args *); int linux_set_tid_address(struct thread *, struct linux_set_tid_address_args *); +int linux_restart_syscall(struct thread *, struct linux_restart_syscall_args *); int linux_semtimedop(struct thread *, struct linux_semtimedop_args *); int linux_fadvise64(struct thread *, struct linux_fadvise64_args *); int linux_timer_create(struct thread *, struct linux_timer_create_args *); @@ -1681,6 +1717,7 @@ int linux_io_uring_register(struct thread *, struct li #define LINUX_SYS_AUE_linux_sched_get_priority_min AUE_SCHED_GET_PRIORITY_MIN #define LINUX_SYS_AUE_linux_sched_rr_get_interval AUE_SCHED_RR_GET_INTERVAL #define LINUX_SYS_AUE_linux_vhangup AUE_NULL +#define LINUX_SYS_AUE_linux_modify_ldt AUE_NULL #define LINUX_SYS_AUE_linux_pivot_root AUE_PIVOT_ROOT #define LINUX_SYS_AUE_linux_sysctl AUE_SYSCTL #define LINUX_SYS_AUE_linux_prctl AUE_PRCTL @@ -1694,10 +1731,12 @@ int linux_io_uring_register(struct thread *, struct li #define LINUX_SYS_AUE_linux_sethostname AUE_SYSCTL #define LINUX_SYS_AUE_linux_setdomainname AUE_SYSCTL #define LINUX_SYS_AUE_linux_iopl AUE_NULL +#define LINUX_SYS_AUE_linux_ioperm AUE_NULL #define LINUX_SYS_AUE_linux_init_module AUE_NULL #define LINUX_SYS_AUE_linux_delete_module AUE_NULL #define LINUX_SYS_AUE_linux_quotactl AUE_QUOTACTL #define LINUX_SYS_AUE_linux_gettid AUE_NULL +#define LINUX_SYS_AUE_linux_readahead AUE_NULL #define LINUX_SYS_AUE_linux_setxattr AUE_NULL #define LINUX_SYS_AUE_linux_lsetxattr AUE_NULL #define LINUX_SYS_AUE_linux_fsetxattr AUE_NULL @@ -1715,11 +1754,17 @@ int linux_io_uring_register(struct thread *, struct li #define LINUX_SYS_AUE_linux_sys_futex AUE_NULL #define LINUX_SYS_AUE_linux_sched_setaffinity AUE_NULL #define LINUX_SYS_AUE_linux_sched_getaffinity AUE_NULL +#define LINUX_SYS_AUE_linux_io_setup AUE_NULL +#define LINUX_SYS_AUE_linux_io_destroy AUE_NULL +#define LINUX_SYS_AUE_linux_io_getevents AUE_NULL +#define LINUX_SYS_AUE_linux_io_submit AUE_NULL +#define LINUX_SYS_AUE_linux_io_cancel AUE_NULL #define LINUX_SYS_AUE_linux_lookup_dcookie AUE_NULL #define LINUX_SYS_AUE_linux_epoll_create AUE_NULL #define LINUX_SYS_AUE_linux_remap_file_pages AUE_NULL #define LINUX_SYS_AUE_linux_getdents64 AUE_GETDIRENTRIES #define LINUX_SYS_AUE_linux_set_tid_address AUE_NULL +#define LINUX_SYS_AUE_linux_restart_syscall AUE_NULL #define LINUX_SYS_AUE_linux_semtimedop AUE_NULL #define LINUX_SYS_AUE_linux_fadvise64 AUE_NULL #define LINUX_SYS_AUE_linux_timer_create AUE_NULL Modified: head/sys/amd64/linux/linux_syscall.h ============================================================================== --- head/sys/amd64/linux/linux_syscall.h Tue Feb 4 16:01:06 2020 (r357503) +++ head/sys/amd64/linux/linux_syscall.h Tue Feb 4 16:02:04 2020 (r357504) @@ -158,6 +158,7 @@ #define LINUX_SYS_mlockall 151 #define LINUX_SYS_munlockall 152 #define LINUX_SYS_linux_vhangup 153 +#define LINUX_SYS_linux_modify_ldt 154 #define LINUX_SYS_linux_pivot_root 155 #define LINUX_SYS_linux_sysctl 156 #define LINUX_SYS_linux_prctl 157 @@ -176,10 +177,12 @@ #define LINUX_SYS_linux_sethostname 170 #define LINUX_SYS_linux_setdomainname 171 #define LINUX_SYS_linux_iopl 172 +#define LINUX_SYS_linux_ioperm 173 #define LINUX_SYS_linux_init_module 175 #define LINUX_SYS_linux_delete_module 176 #define LINUX_SYS_linux_quotactl 179 #define LINUX_SYS_linux_gettid 186 +#define LINUX_SYS_linux_readahead 187 #define LINUX_SYS_linux_setxattr 188 #define LINUX_SYS_linux_lsetxattr 189 #define LINUX_SYS_linux_fsetxattr 190 @@ -197,11 +200,17 @@ #define LINUX_SYS_linux_sys_futex 202 #define LINUX_SYS_linux_sched_setaffinity 203 #define LINUX_SYS_linux_sched_getaffinity 204 +#define LINUX_SYS_linux_io_setup 206 +#define LINUX_SYS_linux_io_destroy 207 +#define LINUX_SYS_linux_io_getevents 208 +#define LINUX_SYS_linux_io_submit 209 +#define LINUX_SYS_linux_io_cancel 210 #define LINUX_SYS_linux_lookup_dcookie 212 #define LINUX_SYS_linux_epoll_create 213 #define LINUX_SYS_linux_remap_file_pages 216 #define LINUX_SYS_linux_getdents64 217 #define LINUX_SYS_linux_set_tid_address 218 +#define LINUX_SYS_linux_restart_syscall 219 #define LINUX_SYS_linux_semtimedop 220 #define LINUX_SYS_linux_fadvise64 221 #define LINUX_SYS_linux_timer_create 222 Modified: head/sys/amd64/linux/linux_syscalls.c ============================================================================== --- head/sys/amd64/linux/linux_syscalls.c Tue Feb 4 16:01:06 2020 (r357503) +++ head/sys/amd64/linux/linux_syscalls.c Tue Feb 4 16:02:04 2020 (r357504) @@ -161,7 +161,7 @@ const char *linux_syscallnames[] = { "mlockall", /* 151 = mlockall */ "munlockall", /* 152 = munlockall */ "linux_vhangup", /* 153 = linux_vhangup */ - "#154", /* 154 = modify_ldt */ + "linux_modify_ldt", /* 154 = linux_modify_ldt */ "linux_pivot_root", /* 155 = linux_pivot_root */ "linux_sysctl", /* 156 = linux_sysctl */ "linux_prctl", /* 157 = linux_prctl */ @@ -180,7 +180,7 @@ const char *linux_syscallnames[] = { "linux_sethostname", /* 170 = linux_sethostname */ "linux_setdomainname", /* 171 = linux_setdomainname */ "linux_iopl", /* 172 = linux_iopl */ - "#173", /* 173 = ioperm */ + "linux_ioperm", /* 173 = linux_ioperm */ "#174", /* 174 = create_module */ "linux_init_module", /* 175 = linux_init_module */ "linux_delete_module", /* 176 = linux_delete_module */ @@ -194,7 +194,7 @@ const char *linux_syscallnames[] = { "#184", /* 184 = tuxcall */ "#185", /* 185 = security */ "linux_gettid", /* 186 = linux_gettid */ - "#187", /* 187 = linux_readahead */ + "linux_readahead", /* 187 = linux_readahead */ "linux_setxattr", /* 188 = linux_setxattr */ "linux_lsetxattr", /* 189 = linux_lsetxattr */ "linux_fsetxattr", /* 190 = linux_fsetxattr */ @@ -213,11 +213,11 @@ const char *linux_syscallnames[] = { "linux_sched_setaffinity", /* 203 = linux_sched_setaffinity */ "linux_sched_getaffinity", /* 204 = linux_sched_getaffinity */ "#205", /* 205 = set_thread_area */ - "#206", /* 206 = linux_io_setup */ - "#207", /* 207 = linux_io_destroy */ - "#208", /* 208 = linux_io_getevents */ - "#209", /* 209 = linux_io_submit */ - "#210", /* 210 = linux_io_cancel */ + "linux_io_setup", /* 206 = linux_io_setup */ + "linux_io_destroy", /* 207 = linux_io_destroy */ + "linux_io_getevents", /* 208 = linux_io_getevents */ + "linux_io_submit", /* 209 = linux_io_submit */ + "linux_io_cancel", /* 210 = linux_io_cancel */ "#211", /* 211 = get_thread_area */ "linux_lookup_dcookie", /* 212 = linux_lookup_dcookie */ "linux_epoll_create", /* 213 = linux_epoll_create */ @@ -226,7 +226,7 @@ const char *linux_syscallnames[] = { "linux_remap_file_pages", /* 216 = linux_remap_file_pages */ "linux_getdents64", /* 217 = linux_getdents64 */ "linux_set_tid_address", /* 218 = linux_set_tid_address */ - "#219", /* 219 = restart_syscall */ + "linux_restart_syscall", /* 219 = linux_restart_syscall */ "linux_semtimedop", /* 220 = linux_semtimedop */ "linux_fadvise64", /* 221 = linux_fadvise64 */ "linux_timer_create", /* 222 = linux_timer_create */ Modified: head/sys/amd64/linux/linux_sysent.c ============================================================================== --- head/sys/amd64/linux/linux_sysent.c Tue Feb 4 16:01:06 2020 (r357503) +++ head/sys/amd64/linux/linux_sysent.c Tue Feb 4 16:02:04 2020 (r357504) @@ -171,7 +171,7 @@ struct sysent linux_sysent[] = { { AS(mlockall_args), (sy_call_t *)sys_mlockall, AUE_MLOCKALL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 151 = mlockall */ { 0, (sy_call_t *)sys_munlockall, AUE_MUNLOCKALL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 152 = munlockall */ { 0, (sy_call_t *)linux_vhangup, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 153 = linux_vhangup */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 154 = modify_ldt */ + { 0, (sy_call_t *)linux_modify_ldt, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 154 = linux_modify_ldt */ { 0, (sy_call_t *)linux_pivot_root, AUE_PIVOT_ROOT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 155 = linux_pivot_root */ { AS(linux_sysctl_args), (sy_call_t *)linux_sysctl, AUE_SYSCTL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 156 = linux_sysctl */ { AS(linux_prctl_args), (sy_call_t *)linux_prctl, AUE_PRCTL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 157 = linux_prctl */ @@ -190,7 +190,7 @@ struct sysent linux_sysent[] = { { AS(linux_sethostname_args), (sy_call_t *)linux_sethostname, AUE_SYSCTL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 170 = linux_sethostname */ { AS(linux_setdomainname_args), (sy_call_t *)linux_setdomainname, AUE_SYSCTL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 171 = linux_setdomainname */ { AS(linux_iopl_args), (sy_call_t *)linux_iopl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 172 = linux_iopl */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 173 = ioperm */ + { 0, (sy_call_t *)linux_ioperm, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 173 = linux_ioperm */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 174 = create_module */ { 0, (sy_call_t *)linux_init_module, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 175 = linux_init_module */ { 0, (sy_call_t *)linux_delete_module, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 176 = linux_delete_module */ @@ -204,7 +204,7 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 184 = tuxcall */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 185 = security */ { 0, (sy_call_t *)linux_gettid, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 186 = linux_gettid */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 187 = linux_readahead */ + { 0, (sy_call_t *)linux_readahead, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 187 = linux_readahead */ { 0, (sy_call_t *)linux_setxattr, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 188 = linux_setxattr */ { 0, (sy_call_t *)linux_lsetxattr, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 189 = linux_lsetxattr */ { 0, (sy_call_t *)linux_fsetxattr, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 190 = linux_fsetxattr */ @@ -223,11 +223,11 @@ struct sysent linux_sysent[] = { { AS(linux_sched_setaffinity_args), (sy_call_t *)linux_sched_setaffinity, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 203 = linux_sched_setaffinity */ { AS(linux_sched_getaffinity_args), (sy_call_t *)linux_sched_getaffinity, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 204 = linux_sched_getaffinity */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 205 = set_thread_area */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 206 = linux_io_setup */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 207 = linux_io_destroy */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 208 = linux_io_getevents */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 209 = linux_io_submit */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 210 = linux_io_cancel */ + { 0, (sy_call_t *)linux_io_setup, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 206 = linux_io_setup */ + { 0, (sy_call_t *)linux_io_destroy, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 207 = linux_io_destroy */ + { 0, (sy_call_t *)linux_io_getevents, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 208 = linux_io_getevents */ + { 0, (sy_call_t *)linux_io_submit, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 209 = linux_io_submit */ + { 0, (sy_call_t *)linux_io_cancel, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 210 = linux_io_cancel */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 211 = get_thread_area */ { 0, (sy_call_t *)linux_lookup_dcookie, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 212 = linux_lookup_dcookie */ { AS(linux_epoll_create_args), (sy_call_t *)linux_epoll_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 213 = linux_epoll_create */ @@ -236,7 +236,7 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)linux_remap_file_pages, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 216 = linux_remap_file_pages */ { AS(linux_getdents64_args), (sy_call_t *)linux_getdents64, AUE_GETDIRENTRIES, NULL, 0, 0, 0, SY_THR_STATIC }, /* 217 = linux_getdents64 */ { AS(linux_set_tid_address_args), (sy_call_t *)linux_set_tid_address, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 218 = linux_set_tid_address */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 219 = restart_syscall */ + { 0, (sy_call_t *)linux_restart_syscall, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 219 = linux_restart_syscall */ { 0, (sy_call_t *)linux_semtimedop, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 220 = linux_semtimedop */ { AS(linux_fadvise64_args), (sy_call_t *)linux_fadvise64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 221 = linux_fadvise64 */ { AS(linux_timer_create_args), (sy_call_t *)linux_timer_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 222 = linux_timer_create */ Modified: head/sys/amd64/linux/linux_systrace_args.c ============================================================================== --- head/sys/amd64/linux/linux_systrace_args.c Tue Feb 4 16:01:06 2020 (r357503) +++ head/sys/amd64/linux/linux_systrace_args.c Tue Feb 4 16:02:04 2020 (r357504) @@ -1261,6 +1261,11 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 0; break; } + /* linux_modify_ldt */ + case 154: { + *n_args = 0; + break; + } /* linux_pivot_root */ case 155: { *n_args = 0; @@ -1396,6 +1401,11 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 1; break; } + /* linux_ioperm */ + case 173: { + *n_args = 0; + break; + } /* linux_init_module */ case 175: { *n_args = 0; @@ -1416,6 +1426,11 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 0; break; } + /* linux_readahead */ + case 187: { + *n_args = 0; + break; + } /* linux_setxattr */ case 188: { *n_args = 0; @@ -1521,6 +1536,31 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 3; break; } + /* linux_io_setup */ + case 206: { + *n_args = 0; + break; + } + /* linux_io_destroy */ + case 207: { + *n_args = 0; + break; + } + /* linux_io_getevents */ + case 208: { + *n_args = 0; + break; + } + /* linux_io_submit */ + case 209: { + *n_args = 0; + break; + } + /* linux_io_cancel */ + case 210: { + *n_args = 0; + break; + } /* linux_lookup_dcookie */ case 212: { *n_args = 0; @@ -1554,6 +1594,11 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 1; break; } + /* linux_restart_syscall */ + case 219: { + *n_args = 0; + break; + } /* linux_semtimedop */ case 220: { *n_args = 0; @@ -4559,6 +4604,9 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d /* linux_vhangup */ case 153: break; + /* linux_modify_ldt */ + case 154: + break; /* linux_pivot_root */ case 155: break; @@ -4762,6 +4810,9 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; + /* linux_ioperm */ + case 173: + break; /* linux_init_module */ case 175: break; @@ -4774,6 +4825,9 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d /* linux_gettid */ case 186: break; + /* linux_readahead */ + case 187: + break; /* linux_setxattr */ case 188: break; @@ -4890,6 +4944,21 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; + /* linux_io_setup */ + case 206: + break; + /* linux_io_destroy */ + case 207: + break; + /* linux_io_getevents */ + case 208: + break; + /* linux_io_submit */ + case 209: + break; + /* linux_io_cancel */ + case 210: + break; /* linux_lookup_dcookie */ case 212: break; @@ -4932,6 +5001,9 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; + /* linux_restart_syscall */ + case 219: + break; /* linux_semtimedop */ case 220: break; @@ -7163,6 +7235,8 @@ systrace_return_setargdesc(int sysnum, int ndx, char * case 152: /* linux_vhangup */ case 153: + /* linux_modify_ldt */ + case 154: /* linux_pivot_root */ case 155: /* linux_sysctl */ @@ -7241,6 +7315,8 @@ systrace_return_setargdesc(int sysnum, int ndx, char * if (ndx == 0 || ndx == 1) p = "int"; break; + /* linux_ioperm */ + case 173: /* linux_init_module */ case 175: /* linux_delete_module */ @@ -7249,6 +7325,8 @@ systrace_return_setargdesc(int sysnum, int ndx, char * case 179: /* linux_gettid */ case 186: + /* linux_readahead */ + case 187: /* linux_setxattr */ case 188: /* linux_lsetxattr */ @@ -7298,6 +7376,16 @@ systrace_return_setargdesc(int sysnum, int ndx, char * if (ndx == 0 || ndx == 1) p = "int"; break; + /* linux_io_setup */ + case 206: + /* linux_io_destroy */ + case 207: + /* linux_io_getevents */ + case 208: + /* linux_io_submit */ + case 209: + /* linux_io_cancel */ + case 210: /* linux_lookup_dcookie */ case 212: /* linux_epoll_create */ @@ -7317,6 +7405,8 @@ systrace_return_setargdesc(int sysnum, int ndx, char * if (ndx == 0 || ndx == 1) p = "int"; break; + /* linux_restart_syscall */ + case 219: /* linux_semtimedop */ case 220: /* linux_fadvise64 */ From owner-svn-src-all@freebsd.org Tue Feb 4 17:08:00 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DFCC422C180; Tue, 4 Feb 2020 17:08:00 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Brjr5f3qz48sw; Tue, 4 Feb 2020 17:08:00 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BCEF81D037; Tue, 4 Feb 2020 17:08:00 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014H80mQ061647; Tue, 4 Feb 2020 17:08:00 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014H80Zq061646; Tue, 4 Feb 2020 17:08:00 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202002041708.014H80Zq061646@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 4 Feb 2020 17:08:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357505 - stable/12/sys/compat/linuxkpi/common/src X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/compat/linuxkpi/common/src X-SVN-Commit-Revision: 357505 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 17:08:00 -0000 Author: kib Date: Tue Feb 4 17:08:00 2020 New Revision: 357505 URL: https://svnweb.freebsd.org/changeset/base/357505 Log: MFC r357198: Provide support for fdevname(3) on linuxkpi-backed devices. For merge, compat32 support was left out. It is not yet present for FIODGNAME over native cdevs yet. Sponsored by: Mellanox Technologies Modified: stable/12/sys/compat/linuxkpi/common/src/linux_compat.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- stable/12/sys/compat/linuxkpi/common/src/linux_compat.c Tue Feb 4 16:02:04 2020 (r357504) +++ stable/12/sys/compat/linuxkpi/common/src/linux_compat.c Tue Feb 4 17:08:00 2020 (r357505) @@ -1530,7 +1530,9 @@ linux_file_ioctl(struct file *fp, u_long cmd, void *da struct linux_file *filp; const struct file_operations *fop; struct linux_cdev *ldev; - int error; + struct fiodgname_arg *fgn; + const char *p; + int error, i; error = 0; filp = (struct linux_file *)fp->f_data; @@ -1557,6 +1559,20 @@ linux_file_ioctl(struct file *fp, u_long cmd, void *da break; case FIOGETOWN: *(int *)data = fgetown(&filp->f_sigio); + break; + case FIODGNAME: + if (filp->f_cdev == NULL || filp->f_cdev->cdev == NULL) { + error = ENXIO; + break; + } + fgn = data; + p = devtoname(filp->f_cdev->cdev); + i = strlen(p) + 1; + if (i > fgn->len) { + error = EINVAL; + break; + } + error = copyout(p, fgn->buf, i); break; default: error = linux_file_ioctl_sub(fp, filp, fop, cmd, data, td); From owner-svn-src-all@freebsd.org Tue Feb 4 17:12:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0E0D822C43D; Tue, 4 Feb 2020 17:12:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Brpf6hnvz49TY; Tue, 4 Feb 2020 17:12:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E102D1D208; Tue, 4 Feb 2020 17:12:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014HCATx067490; Tue, 4 Feb 2020 17:12:10 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014HCApj067488; Tue, 4 Feb 2020 17:12:10 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202002041712.014HCApj067488@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 4 Feb 2020 17:12:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357506 - stable/12/sys/fs/nullfs X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/fs/nullfs X-SVN-Commit-Revision: 357506 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 17:12:11 -0000 Author: kib Date: Tue Feb 4 17:12:09 2020 New Revision: 357506 URL: https://svnweb.freebsd.org/changeset/base/357506 Log: MFC r357199, r357306: Save lower root vnode in nullfs mnt data instead of upper. Modified: stable/12/sys/fs/nullfs/null.h stable/12/sys/fs/nullfs/null_subr.c stable/12/sys/fs/nullfs/null_vfsops.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/fs/nullfs/null.h ============================================================================== --- stable/12/sys/fs/nullfs/null.h Tue Feb 4 17:08:00 2020 (r357505) +++ stable/12/sys/fs/nullfs/null.h Tue Feb 4 17:12:09 2020 (r357506) @@ -43,7 +43,7 @@ struct null_mount { struct mount *nullm_vfs; - struct vnode *nullm_rootvp; /* Reference to root null_node */ + struct vnode *nullm_lowerrootvp; /* Ref to lower root vnode */ uint64_t nullm_flags; }; Modified: stable/12/sys/fs/nullfs/null_subr.c ============================================================================== --- stable/12/sys/fs/nullfs/null_subr.c Tue Feb 4 17:08:00 2020 (r357505) +++ stable/12/sys/fs/nullfs/null_subr.c Tue Feb 4 17:12:09 2020 (r357506) @@ -256,6 +256,9 @@ null_nodeget(mp, lowervp, vpp) error = insmntque1(vp, mp, null_insmntque_dtr, xp); if (error != 0) return (error); + if (lowervp == MOUNTTONULLMOUNT(mp)->nullm_lowerrootvp) + vp->v_vflag |= VV_ROOT; + /* * Atomically insert our new node into the hash or vget existing * if someone else has beaten us to it. Modified: stable/12/sys/fs/nullfs/null_vfsops.c ============================================================================== --- stable/12/sys/fs/nullfs/null_vfsops.c Tue Feb 4 17:08:00 2020 (r357505) +++ stable/12/sys/fs/nullfs/null_vfsops.c Tue Feb 4 17:12:09 2020 (r357506) @@ -74,7 +74,7 @@ static vfs_extattrctl_t nullfs_extattrctl; static int nullfs_mount(struct mount *mp) { - struct vnode *lowerrootvp, *vp; + struct vnode *lowerrootvp; struct vnode *nullm_rootvp; struct null_mount *xmp; struct null_node *nn; @@ -158,36 +158,24 @@ nullfs_mount(struct mount *mp) M_NULLFSMNT, M_WAITOK | M_ZERO); /* - * Save reference to underlying FS + * Save pointer to underlying FS and the reference to the + * lower root vnode. */ xmp->nullm_vfs = lowerrootvp->v_mount; + vref(lowerrootvp); + xmp->nullm_lowerrootvp = lowerrootvp; + mp->mnt_data = xmp; /* - * Save reference. Each mount also holds - * a reference on the root vnode. + * Make sure the node alias worked. */ - error = null_nodeget(mp, lowerrootvp, &vp); - /* - * Make sure the node alias worked - */ - if (error) { + error = null_nodeget(mp, lowerrootvp, &nullm_rootvp); + if (error != 0) { + vrele(lowerrootvp); free(xmp, M_NULLFSMNT); return (error); } - /* - * Keep a held reference to the root vnode. - * It is vrele'd in nullfs_unmount. - */ - nullm_rootvp = vp; - nullm_rootvp->v_vflag |= VV_ROOT; - xmp->nullm_rootvp = nullm_rootvp; - - /* - * Unlock the node (either the lower or the alias) - */ - VOP_UNLOCK(vp, 0); - if (NULLVPTOLOWERVP(nullm_rootvp)->v_mount->mnt_flag & MNT_LOCAL) { MNT_ILOCK(mp); mp->mnt_flag |= MNT_LOCAL; @@ -209,7 +197,6 @@ nullfs_mount(struct mount *mp) mp->mnt_kern_flag |= lowerrootvp->v_mount->mnt_kern_flag & (MNTK_USES_BCACHE | MNTK_NO_IOPF | MNTK_UNMAPPED_BUFS); MNT_IUNLOCK(mp); - mp->mnt_data = xmp; vfs_getnewfsid(mp); if ((xmp->nullm_flags & NULLM_CACHE) != 0) { MNT_ILOCK(xmp->nullm_vfs); @@ -219,6 +206,7 @@ nullfs_mount(struct mount *mp) } vfs_mountedfrom(mp, target); + vput(nullm_rootvp); NULLFSDEBUG("nullfs_mount: lower %s, alias at %s\n", mp->mnt_stat.f_mntfromname, mp->mnt_stat.f_mntonname); @@ -235,7 +223,7 @@ nullfs_unmount(mp, mntflags) { struct null_mount *mntdata; struct mount *ump; - int error, flags, rootrefs; + int error, flags; NULLFSDEBUG("nullfs_unmount: mp = %p\n", (void *)mp); @@ -244,9 +232,9 @@ nullfs_unmount(mp, mntflags) else flags = 0; - for (rootrefs = 1;; rootrefs = 0) { + for (;;) { /* There is 1 extra root vnode reference (nullm_rootvp). */ - error = vflush(mp, rootrefs, flags, curthread); + error = vflush(mp, 0, flags, curthread); if (error) return (error); MNT_ILOCK(mp); @@ -273,6 +261,7 @@ nullfs_unmount(mp, mntflags) TAILQ_REMOVE(&ump->mnt_uppers, mp, mnt_upper_link); MNT_IUNLOCK(ump); } + vrele(mntdata->nullm_lowerrootvp); mp->mnt_data = NULL; free(mntdata, M_NULLFSMNT); return (0); @@ -285,21 +274,24 @@ nullfs_root(mp, flags, vpp) struct vnode **vpp; { struct vnode *vp; + struct null_mount *mntdata; + int error; - NULLFSDEBUG("nullfs_root(mp = %p, vp = %p->%p)\n", (void *)mp, - (void *)MOUNTTONULLMOUNT(mp)->nullm_rootvp, - (void *)NULLVPTOLOWERVP(MOUNTTONULLMOUNT(mp)->nullm_rootvp)); + mntdata = MOUNTTONULLMOUNT(mp); + NULLFSDEBUG("nullfs_root(mp = %p, vp = %p)\n", mp, + mntdata->nullm_lowerrootvp); - /* - * Return locked reference to root. - */ - vp = MOUNTTONULLMOUNT(mp)->nullm_rootvp; - VREF(vp); - - ASSERT_VOP_UNLOCKED(vp, "root vnode is locked"); - vn_lock(vp, flags | LK_RETRY); - *vpp = vp; - return 0; + error = vget(mntdata->nullm_lowerrootvp, (flags & ~LK_TYPE_MASK) | + LK_EXCLUSIVE, curthread); + if (error == 0) { + error = null_nodeget(mp, mntdata->nullm_lowerrootvp, &vp); + if (error == 0) { + if ((flags & LK_TYPE_MASK) == LK_SHARED) + vn_lock(vp, LK_DOWNGRADE | LK_RETRY); + *vpp = vp; + } + } + return (error); } static int From owner-svn-src-all@freebsd.org Tue Feb 4 17:15:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0B0C022C6D7; Tue, 4 Feb 2020 17:15:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Brtv6cfwz49mf; Tue, 4 Feb 2020 17:15:51 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DE1F31D22C; Tue, 4 Feb 2020 17:15:51 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014HFp80067867; Tue, 4 Feb 2020 17:15:51 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014HFp8T067866; Tue, 4 Feb 2020 17:15:51 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202002041715.014HFp8T067866@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 4 Feb 2020 17:15:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r357507 - stable/11/sys/compat/linuxkpi/common/src X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/src X-SVN-Commit-Revision: 357507 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 17:15:52 -0000 Author: kib Date: Tue Feb 4 17:15:51 2020 New Revision: 357507 URL: https://svnweb.freebsd.org/changeset/base/357507 Log: MFC r357198: Provide support for fdevname(3) on linuxkpi-backed devices. For merge, compat32 support was left out. It is not yet present for FIODGNAME over native cdevs yet. Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/src/linux_compat.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- stable/11/sys/compat/linuxkpi/common/src/linux_compat.c Tue Feb 4 17:12:09 2020 (r357506) +++ stable/11/sys/compat/linuxkpi/common/src/linux_compat.c Tue Feb 4 17:15:51 2020 (r357507) @@ -1530,7 +1530,9 @@ linux_file_ioctl(struct file *fp, u_long cmd, void *da struct linux_file *filp; const struct file_operations *fop; struct linux_cdev *ldev; - int error; + struct fiodgname_arg *fgn; + const char *p; + int error, i; error = 0; filp = (struct linux_file *)fp->f_data; @@ -1557,6 +1559,20 @@ linux_file_ioctl(struct file *fp, u_long cmd, void *da break; case FIOGETOWN: *(int *)data = fgetown(&filp->f_sigio); + break; + case FIODGNAME: + if (filp->f_cdev == NULL || filp->f_cdev->cdev == NULL) { + error = ENXIO; + break; + } + fgn = data; + p = devtoname(filp->f_cdev->cdev); + i = strlen(p) + 1; + if (i > fgn->len) { + error = EINVAL; + break; + } + error = copyout(p, fgn->buf, i); break; default: error = linux_file_ioctl_sub(fp, filp, fop, cmd, data, td); From owner-svn-src-all@freebsd.org Tue Feb 4 17:17:41 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8FB3122C7C7; Tue, 4 Feb 2020 17:17:41 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Brx13L48z49y5; Tue, 4 Feb 2020 17:17:41 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6DDB91D232; Tue, 4 Feb 2020 17:17:41 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014HHfdF068013; Tue, 4 Feb 2020 17:17:41 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014HHeqN068011; Tue, 4 Feb 2020 17:17:40 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202002041717.014HHeqN068011@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 4 Feb 2020 17:17:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r357508 - stable/11/sys/fs/nullfs X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/fs/nullfs X-SVN-Commit-Revision: 357508 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 17:17:41 -0000 Author: kib Date: Tue Feb 4 17:17:40 2020 New Revision: 357508 URL: https://svnweb.freebsd.org/changeset/base/357508 Log: MFC r357199, r357306: Save lower root vnode in nullfs mnt data instead of upper. Modified: stable/11/sys/fs/nullfs/null.h stable/11/sys/fs/nullfs/null_subr.c stable/11/sys/fs/nullfs/null_vfsops.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/nullfs/null.h ============================================================================== --- stable/11/sys/fs/nullfs/null.h Tue Feb 4 17:15:51 2020 (r357507) +++ stable/11/sys/fs/nullfs/null.h Tue Feb 4 17:17:40 2020 (r357508) @@ -41,7 +41,7 @@ struct null_mount { struct mount *nullm_vfs; - struct vnode *nullm_rootvp; /* Reference to root null_node */ + struct vnode *nullm_lowerrootvp; /* Ref to lower root vnode */ uint64_t nullm_flags; }; Modified: stable/11/sys/fs/nullfs/null_subr.c ============================================================================== --- stable/11/sys/fs/nullfs/null_subr.c Tue Feb 4 17:15:51 2020 (r357507) +++ stable/11/sys/fs/nullfs/null_subr.c Tue Feb 4 17:17:40 2020 (r357508) @@ -254,6 +254,9 @@ null_nodeget(mp, lowervp, vpp) error = insmntque1(vp, mp, null_insmntque_dtr, xp); if (error != 0) return (error); + if (lowervp == MOUNTTONULLMOUNT(mp)->nullm_lowerrootvp) + vp->v_vflag |= VV_ROOT; + /* * Atomically insert our new node into the hash or vget existing * if someone else has beaten us to it. Modified: stable/11/sys/fs/nullfs/null_vfsops.c ============================================================================== --- stable/11/sys/fs/nullfs/null_vfsops.c Tue Feb 4 17:15:51 2020 (r357507) +++ stable/11/sys/fs/nullfs/null_vfsops.c Tue Feb 4 17:17:40 2020 (r357508) @@ -72,7 +72,7 @@ static vfs_extattrctl_t nullfs_extattrctl; static int nullfs_mount(struct mount *mp) { - struct vnode *lowerrootvp, *vp; + struct vnode *lowerrootvp; struct vnode *nullm_rootvp; struct null_mount *xmp; struct thread *td = curthread; @@ -159,36 +159,24 @@ nullfs_mount(struct mount *mp) M_NULLFSMNT, M_WAITOK | M_ZERO); /* - * Save reference to underlying FS + * Save pointer to underlying FS and the reference to the + * lower root vnode. */ xmp->nullm_vfs = lowerrootvp->v_mount; + vref(lowerrootvp); + xmp->nullm_lowerrootvp = lowerrootvp; + mp->mnt_data = xmp; /* - * Save reference. Each mount also holds - * a reference on the root vnode. + * Make sure the node alias worked. */ - error = null_nodeget(mp, lowerrootvp, &vp); - /* - * Make sure the node alias worked - */ - if (error) { + error = null_nodeget(mp, lowerrootvp, &nullm_rootvp); + if (error != 0) { + vrele(lowerrootvp); free(xmp, M_NULLFSMNT); return (error); } - /* - * Keep a held reference to the root vnode. - * It is vrele'd in nullfs_unmount. - */ - nullm_rootvp = vp; - nullm_rootvp->v_vflag |= VV_ROOT; - xmp->nullm_rootvp = nullm_rootvp; - - /* - * Unlock the node (either the lower or the alias) - */ - VOP_UNLOCK(vp, 0); - if (NULLVPTOLOWERVP(nullm_rootvp)->v_mount->mnt_flag & MNT_LOCAL) { MNT_ILOCK(mp); mp->mnt_flag |= MNT_LOCAL; @@ -210,7 +198,6 @@ nullfs_mount(struct mount *mp) mp->mnt_kern_flag |= lowerrootvp->v_mount->mnt_kern_flag & (MNTK_USES_BCACHE | MNTK_NO_IOPF | MNTK_UNMAPPED_BUFS); MNT_IUNLOCK(mp); - mp->mnt_data = xmp; vfs_getnewfsid(mp); if ((xmp->nullm_flags & NULLM_CACHE) != 0) { MNT_ILOCK(xmp->nullm_vfs); @@ -220,6 +207,7 @@ nullfs_mount(struct mount *mp) } vfs_mountedfrom(mp, target); + vput(nullm_rootvp); NULLFSDEBUG("nullfs_mount: lower %s, alias at %s\n", mp->mnt_stat.f_mntfromname, mp->mnt_stat.f_mntonname); @@ -236,7 +224,7 @@ nullfs_unmount(mp, mntflags) { struct null_mount *mntdata; struct mount *ump; - int error, flags, rootrefs; + int error, flags; NULLFSDEBUG("nullfs_unmount: mp = %p\n", (void *)mp); @@ -245,9 +233,9 @@ nullfs_unmount(mp, mntflags) else flags = 0; - for (rootrefs = 1;; rootrefs = 0) { + for (;;) { /* There is 1 extra root vnode reference (nullm_rootvp). */ - error = vflush(mp, rootrefs, flags, curthread); + error = vflush(mp, 0, flags, curthread); if (error) return (error); MNT_ILOCK(mp); @@ -274,6 +262,7 @@ nullfs_unmount(mp, mntflags) TAILQ_REMOVE(&ump->mnt_uppers, mp, mnt_upper_link); MNT_IUNLOCK(ump); } + vrele(mntdata->nullm_lowerrootvp); mp->mnt_data = NULL; free(mntdata, M_NULLFSMNT); return (0); @@ -286,21 +275,24 @@ nullfs_root(mp, flags, vpp) struct vnode **vpp; { struct vnode *vp; + struct null_mount *mntdata; + int error; - NULLFSDEBUG("nullfs_root(mp = %p, vp = %p->%p)\n", (void *)mp, - (void *)MOUNTTONULLMOUNT(mp)->nullm_rootvp, - (void *)NULLVPTOLOWERVP(MOUNTTONULLMOUNT(mp)->nullm_rootvp)); + mntdata = MOUNTTONULLMOUNT(mp); + NULLFSDEBUG("nullfs_root(mp = %p, vp = %p)\n", mp, + mntdata->nullm_lowerrootvp); - /* - * Return locked reference to root. - */ - vp = MOUNTTONULLMOUNT(mp)->nullm_rootvp; - VREF(vp); - - ASSERT_VOP_UNLOCKED(vp, "root vnode is locked"); - vn_lock(vp, flags | LK_RETRY); - *vpp = vp; - return 0; + error = vget(mntdata->nullm_lowerrootvp, (flags & ~LK_TYPE_MASK) | + LK_EXCLUSIVE, curthread); + if (error == 0) { + error = null_nodeget(mp, mntdata->nullm_lowerrootvp, &vp); + if (error == 0) { + if ((flags & LK_TYPE_MASK) == LK_SHARED) + vn_lock(vp, LK_DOWNGRADE | LK_RETRY); + *vpp = vp; + } + } + return (error); } static int From owner-svn-src-all@freebsd.org Tue Feb 4 18:29:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8981222F2AE; Tue, 4 Feb 2020 18:29:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BtWR389Nz4Kfg; Tue, 4 Feb 2020 18:29:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 673B11DFF5; Tue, 4 Feb 2020 18:29:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014IT7IM016148; Tue, 4 Feb 2020 18:29:07 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014IT7pi016147; Tue, 4 Feb 2020 18:29:07 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202002041829.014IT7pi016147@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 4 Feb 2020 18:29:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357509 - head/sys/dev/atkbdc X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/atkbdc X-SVN-Commit-Revision: 357509 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 18:29:07 -0000 Author: kevans Date: Tue Feb 4 18:29:06 2020 New Revision: 357509 URL: https://svnweb.freebsd.org/changeset/base/357509 Log: psm: release resources on attach failure In exactly 1/3 cases we'll release resources on failure; touch up the other two to do so as well. Modified: head/sys/dev/atkbdc/psm.c Modified: head/sys/dev/atkbdc/psm.c ============================================================================== --- head/sys/dev/atkbdc/psm.c Tue Feb 4 17:17:40 2020 (r357508) +++ head/sys/dev/atkbdc/psm.c Tue Feb 4 18:29:06 2020 (r357509) @@ -1965,10 +1965,8 @@ psmattach(device_t dev) return (ENXIO); error = bus_setup_intr(dev, sc->intr, INTR_TYPE_TTY, NULL, psmintr, sc, &sc->ih); - if (error) { - bus_release_resource(dev, SYS_RES_IRQ, rid, sc->intr); - return (error); - } + if (error) + goto out; /* Done */ sc->dev = make_dev(&psm_cdevsw, 0, 0, 0, 0666, "psm%d", unit); @@ -1991,7 +1989,7 @@ psmattach(device_t dev) } if (error) - return (error); + goto out; #endif /* Some touchpad devices need full reinitialization after suspend. */ @@ -2032,7 +2030,10 @@ psmattach(device_t dev) if (bootverbose) --verbose; - return (0); +out: + if (error != 0) + bus_release_resource(dev, SYS_RES_IRQ, rid, sc->intr); + return (error); } static int From owner-svn-src-all@freebsd.org Tue Feb 4 18:45:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6037C22F89C; Tue, 4 Feb 2020 18:45:29 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BttK1y11z4Lf7; Tue, 4 Feb 2020 18:45:29 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3E08D1E3D7; Tue, 4 Feb 2020 18:45:29 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014IjTxL027923; Tue, 4 Feb 2020 18:45:29 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014IjT18027922; Tue, 4 Feb 2020 18:45:29 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202002041845.014IjT18027922@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 4 Feb 2020 18:45:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357510 - head/sys/dev/atkbdc X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/atkbdc X-SVN-Commit-Revision: 357510 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 18:45:29 -0000 Author: kevans Date: Tue Feb 4 18:45:28 2020 New Revision: 357510 URL: https://svnweb.freebsd.org/changeset/base/357510 Log: psm: use make_dev_s instead of make_dev This most importantly reduces duplication, but it also removes any potential race with usage of dev->si_drv1 since it's now set prior to the device being constructed enough to be accessible. Modified: head/sys/dev/atkbdc/psm.c Modified: head/sys/dev/atkbdc/psm.c ============================================================================== --- head/sys/dev/atkbdc/psm.c Tue Feb 4 18:29:06 2020 (r357509) +++ head/sys/dev/atkbdc/psm.c Tue Feb 4 18:45:28 2020 (r357510) @@ -1948,6 +1948,7 @@ psm_register_elantech(device_t dev) static int psmattach(device_t dev) { + struct make_dev_args mda; int unit = device_get_unit(dev); struct psm_softc *sc = device_get_softc(dev); int error; @@ -1969,11 +1970,16 @@ psmattach(device_t dev) goto out; /* Done */ - sc->dev = make_dev(&psm_cdevsw, 0, 0, 0, 0666, "psm%d", unit); - sc->dev->si_drv1 = sc; - sc->bdev = make_dev(&psm_cdevsw, 0, 0, 0, 0666, "bpsm%d", unit); - sc->bdev->si_drv1 = sc; + make_dev_args_init(&mda); + mda.mda_devsw = &psm_cdevsw; + mda.mda_mode = 0666; + mda.mda_si_drv1 = sc; + if ((error = make_dev_s(&mda, &sc->dev, "psm%d", unit)) != 0) + goto out; + if ((error = make_dev_s(&mda, &sc->bdev, "bpsm%d", unit)) != 0) + goto out; + #ifdef EVDEV_SUPPORT switch (sc->hw.model) { case MOUSE_MODEL_SYNAPTICS: @@ -2031,8 +2037,13 @@ psmattach(device_t dev) --verbose; out: - if (error != 0) + if (error != 0) { bus_release_resource(dev, SYS_RES_IRQ, rid, sc->intr); + if (sc->dev != NULL) + destroy_dev(sc->dev); + if (sc->bdev != NULL) + destroy_dev(sc->bdev); + } return (error); } From owner-svn-src-all@freebsd.org Tue Feb 4 18:52:26 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 680C322FBB7; Tue, 4 Feb 2020 18:52:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Bv2L2C8qz4M4K; Tue, 4 Feb 2020 18:52:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 46DA91E5A0; Tue, 4 Feb 2020 18:52:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014IqQmL033763; Tue, 4 Feb 2020 18:52:26 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014IqQF0033762; Tue, 4 Feb 2020 18:52:26 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202002041852.014IqQF0033762@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 4 Feb 2020 18:52:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357511 - head/sys/fs/tmpfs X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/fs/tmpfs X-SVN-Commit-Revision: 357511 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 18:52:26 -0000 Author: kib Date: Tue Feb 4 18:52:25 2020 New Revision: 357511 URL: https://svnweb.freebsd.org/changeset/base/357511 Log: tmpfs_mount update: simplify, cache the value of VFS_TO_TMPFS() calculation. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vfsops.c Tue Feb 4 18:45:28 2020 (r357510) +++ head/sys/fs/tmpfs/tmpfs_vfsops.c Tue Feb 4 18:52:25 2020 (r357511) @@ -346,6 +346,7 @@ tmpfs_mount(struct mount *mp) /* Only support update mounts for certain options. */ if (vfs_filteropt(mp->mnt_optnew, tmpfs_updateopts) != 0) return (EOPNOTSUPP); + tmp = VFS_TO_TMPFS(mp); if (vfs_getopt_size(mp->mnt_optnew, "size", &size_max) == 0) { /* * On-the-fly resizing is not supported (yet). We still @@ -354,17 +355,17 @@ tmpfs_mount(struct mount *mp) * parameter, say trying to change rw to ro or vice * versa, would cause vfs_filteropt() to bail. */ - if (size_max != VFS_TO_TMPFS(mp)->tm_size_max) + if (size_max != tmp->tm_size_max) return (EOPNOTSUPP); } if (vfs_flagopt(mp->mnt_optnew, "ro", NULL, 0) && - !(VFS_TO_TMPFS(mp)->tm_ronly)) { + !tmp->tm_ronly) { /* RW -> RO */ return (tmpfs_rw_to_ro(mp)); } else if (!vfs_flagopt(mp->mnt_optnew, "ro", NULL, 0) && - VFS_TO_TMPFS(mp)->tm_ronly) { + tmp->tm_ronly) { /* RO -> RW */ - VFS_TO_TMPFS(mp)->tm_ronly = 0; + tmp->tm_ronly = 0; MNT_ILOCK(mp); mp->mnt_flag &= ~MNT_RDONLY; MNT_IUNLOCK(mp); From owner-svn-src-all@freebsd.org Tue Feb 4 18:56:27 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 07D7522FE56; Tue, 4 Feb 2020 18:56:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Bv6y6NyFz4MHp; Tue, 4 Feb 2020 18:56:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D6A6D1E5B4; Tue, 4 Feb 2020 18:56:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014IuQSP034028; Tue, 4 Feb 2020 18:56:26 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014IuQwN034026; Tue, 4 Feb 2020 18:56:26 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202002041856.014IuQwN034026@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 4 Feb 2020 18:56:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357512 - in head/sys: cddl/compat/opensolaris/kern compat/cloudabi X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: cddl/compat/opensolaris/kern compat/cloudabi X-SVN-Commit-Revision: 357512 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 18:56:27 -0000 Author: kib Date: Tue Feb 4 18:56:26 2020 New Revision: 357512 URL: https://svnweb.freebsd.org/changeset/base/357512 Log: Add sys/systm.h to several places that use vm headers. It is needed (but not enough) to use e.g. KASSERT() in inline functions. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_vm.c head/sys/compat/cloudabi/cloudabi_vdso.c Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_vm.c ============================================================================== --- head/sys/cddl/compat/opensolaris/kern/opensolaris_vm.c Tue Feb 4 18:52:25 2020 (r357511) +++ head/sys/cddl/compat/opensolaris/kern/opensolaris_vm.c Tue Feb 4 18:56:26 2020 (r357512) @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include Modified: head/sys/compat/cloudabi/cloudabi_vdso.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_vdso.c Tue Feb 4 18:52:25 2020 (r357511) +++ head/sys/compat/cloudabi/cloudabi_vdso.c Tue Feb 4 18:56:26 2020 (r357512) @@ -26,7 +26,8 @@ #include __FBSDID("$FreeBSD$"); -#include +#include +#include #include #include #include From owner-svn-src-all@freebsd.org Tue Feb 4 19:01:18 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 81FA422FF99; Tue, 4 Feb 2020 19:01:18 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BvDZ2py3z4McS; Tue, 4 Feb 2020 19:01:18 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5BCA71E5FB; Tue, 4 Feb 2020 19:01:18 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014J1IOw037990; Tue, 4 Feb 2020 19:01:18 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014J1IJ1037989; Tue, 4 Feb 2020 19:01:18 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202002041901.014J1IJ1037989@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 4 Feb 2020 19:01:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357513 - stable/12/sbin/newfs_msdos X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: stable/12/sbin/newfs_msdos X-SVN-Commit-Revision: 357513 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 19:01:18 -0000 Author: dim Date: Tue Feb 4 19:01:17 2020 New Revision: 357513 URL: https://svnweb.freebsd.org/changeset/base/357513 Log: MFC r357227: Merge r357225 from the clang1000-import branch: Fix the following -Werror warning from clang 10.0.0 in newfs_msdos: sbin/newfs_msdos/newfs_msdos.c:181:2: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation] if (o.align) { ^ sbin/newfs_msdos/newfs_msdos.c:179:5: note: previous statement is here if (argc < 1 || argc > 2) ^ Modified: stable/12/sbin/newfs_msdos/newfs_msdos.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/newfs_msdos/newfs_msdos.c ============================================================================== --- stable/12/sbin/newfs_msdos/newfs_msdos.c Tue Feb 4 18:56:26 2020 (r357512) +++ stable/12/sbin/newfs_msdos/newfs_msdos.c Tue Feb 4 19:01:17 2020 (r357513) @@ -178,10 +178,10 @@ main(int argc, char *argv[]) argv += optind; if (argc < 1 || argc > 2) usage(); - if (o.align) { - if (o.reserved_sectors) - errx(1, "align (-A) is incompatible with -r"); - } + if (o.align) { + if (o.reserved_sectors) + errx(1, "align (-A) is incompatible with -r"); + } fname = *argv++; if (!o.create_size && !strchr(fname, '/')) { snprintf(buf, sizeof(buf), "%s%s", _PATH_DEV, fname); From owner-svn-src-all@freebsd.org Tue Feb 4 19:03:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 941A42301CA; Tue, 4 Feb 2020 19:03:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BvHG3SMdz4Mqb; Tue, 4 Feb 2020 19:03:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 71FAA1E77F; Tue, 4 Feb 2020 19:03:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014J3cXJ040035; Tue, 4 Feb 2020 19:03:38 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014J3cIZ040033; Tue, 4 Feb 2020 19:03:38 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202002041903.014J3cIZ040033@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 4 Feb 2020 19:03:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357514 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 357514 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 19:03:38 -0000 Author: kib Date: Tue Feb 4 19:03:37 2020 New Revision: 357514 URL: https://svnweb.freebsd.org/changeset/base/357514 Log: Enable vm_object_mightbedirty() and vm_object_page_clean() for swap objects backing tmpfs vnodes data. The clean scan is limited to only remove write permissions from the mapped pages of the objects. This fixes the issue that tmpfs vnode mtime is not updated from writes to the mmaped area after the initial page-in. Noted by: mjg Reviewed by: markj Discussed with: jeff Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D23432 Modified: head/sys/vm/vm_object.c head/sys/vm/vm_object.h Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Tue Feb 4 19:01:17 2020 (r357513) +++ head/sys/vm/vm_object.c Tue Feb 4 19:03:37 2020 (r357514) @@ -1017,6 +1017,10 @@ vm_object_page_remove_write(vm_page_t p, int flags, bo * write out pages with PGA_NOSYNC set (originally comes from MAP_NOSYNC), * leaving the object dirty. * + * For swap objects backing tmpfs regular files, do not flush anything, + * but remove write protection on the mapped pages to update mtime through + * mmaped writes. + * * When stuffing pages asynchronously, allow clustering. XXX we need a * synchronous clustering mode implementation. * @@ -1038,8 +1042,7 @@ vm_object_page_clean(vm_object_t object, vm_ooffset_t VM_OBJECT_ASSERT_WLOCKED(object); - if (object->type != OBJT_VNODE || !vm_object_mightbedirty(object) || - object->resident_page_count == 0) + if (!vm_object_mightbedirty(object) || object->resident_page_count == 0) return (TRUE); pagerflags = (flags & (OBJPC_SYNC | OBJPC_INVAL)) != 0 ? @@ -1072,32 +1075,36 @@ rescan: vm_page_xunbusy(p); continue; } + if (object->type == OBJT_VNODE) { + n = vm_object_page_collect_flush(object, p, pagerflags, + flags, &allclean, &eio); + if (eio) { + res = FALSE; + allclean = FALSE; + } + if (object->generation != curgeneration && + (flags & OBJPC_SYNC) != 0) + goto rescan; - n = vm_object_page_collect_flush(object, p, pagerflags, - flags, &allclean, &eio); - if (eio) { - res = FALSE; - allclean = FALSE; - } - if (object->generation != curgeneration && - (flags & OBJPC_SYNC) != 0) - goto rescan; - - /* - * If the VOP_PUTPAGES() did a truncated write, so - * that even the first page of the run is not fully - * written, vm_pageout_flush() returns 0 as the run - * length. Since the condition that caused truncated - * write may be permanent, e.g. exhausted free space, - * accepting n == 0 would cause an infinite loop. - * - * Forwarding the iterator leaves the unwritten page - * behind, but there is not much we can do there if - * filesystem refuses to write it. - */ - if (n == 0) { + /* + * If the VOP_PUTPAGES() did a truncated write, so + * that even the first page of the run is not fully + * written, vm_pageout_flush() returns 0 as the run + * length. Since the condition that caused truncated + * write may be permanent, e.g. exhausted free space, + * accepting n == 0 would cause an infinite loop. + * + * Forwarding the iterator leaves the unwritten page + * behind, but there is not much we can do there if + * filesystem refuses to write it. + */ + if (n == 0) { + n = 1; + allclean = FALSE; + } + } else { n = 1; - allclean = FALSE; + vm_page_xunbusy(p); } np = vm_page_find_least(object, pi + n); } @@ -1105,7 +1112,12 @@ rescan: VOP_FSYNC(vp, (pagerflags & VM_PAGER_PUT_SYNC) ? MNT_WAIT : 0); #endif - if (allclean) + /* + * Leave updating cleangeneration for tmpfs objects to tmpfs + * scan. It needs to update mtime, which happens for other + * filesystems during page writeouts. + */ + if (allclean && object->type == OBJT_VNODE) object->cleangeneration = curgeneration; return (res); } Modified: head/sys/vm/vm_object.h ============================================================================== --- head/sys/vm/vm_object.h Tue Feb 4 19:01:17 2020 (r357513) +++ head/sys/vm/vm_object.h Tue Feb 4 19:03:37 2020 (r357514) @@ -322,8 +322,15 @@ static __inline bool vm_object_mightbedirty(vm_object_t object) { - return (object->type == OBJT_VNODE && - object->generation != object->cleangeneration); + if (object->type != OBJT_VNODE) { + if ((object->flags & OBJ_TMPFS_NODE) == 0) + return (false); +#ifdef KASSERT + KASSERT(object->type == OBJT_SWAP, + ("TMPFS_NODE obj %p is not swap", object)); +#endif + } + return (object->generation != object->cleangeneration); } void vm_object_clear_flag(vm_object_t object, u_short bits); From owner-svn-src-all@freebsd.org Tue Feb 4 19:05:59 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B96372302CF; Tue, 4 Feb 2020 19:05:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BvKz4TH4z4N0F; Tue, 4 Feb 2020 19:05:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 90ABD1E786; Tue, 4 Feb 2020 19:05:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014J5xkN040191; Tue, 4 Feb 2020 19:05:59 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014J5xZ4040189; Tue, 4 Feb 2020 19:05:59 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202002041905.014J5xZ4040189@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 4 Feb 2020 19:05:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357515 - head/sys/fs/tmpfs X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/fs/tmpfs X-SVN-Commit-Revision: 357515 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 19:05:59 -0000 Author: kib Date: Tue Feb 4 19:05:58 2020 New Revision: 357515 URL: https://svnweb.freebsd.org/changeset/base/357515 Log: tmpfs: add nomtime mount option, which disables tracking mtime updates due to writes through the shared mapped areas backed by tmpfs files. This removes periodic scans which downgrades rw mapped pages to ro to note the writes. Suggested by: mjg Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D23432 Modified: head/sys/fs/tmpfs/tmpfs.h head/sys/fs/tmpfs/tmpfs_vfsops.c Modified: head/sys/fs/tmpfs/tmpfs.h ============================================================================== --- head/sys/fs/tmpfs/tmpfs.h Tue Feb 4 19:03:37 2020 (r357514) +++ head/sys/fs/tmpfs/tmpfs.h Tue Feb 4 19:05:58 2020 (r357515) @@ -382,6 +382,8 @@ struct tmpfs_mount { bool tm_ronly; /* Do not use namecache. */ bool tm_nonc; + /* Do not update mtime on writes through mmaped areas. */ + bool tm_nomtime; }; #define TMPFS_LOCK(tm) mtx_lock(&(tm)->tm_allnode_lock) #define TMPFS_UNLOCK(tm) mtx_unlock(&(tm)->tm_allnode_lock) Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vfsops.c Tue Feb 4 19:03:37 2020 (r357514) +++ head/sys/fs/tmpfs/tmpfs_vfsops.c Tue Feb 4 19:05:58 2020 (r357515) @@ -92,20 +92,19 @@ static void tmpfs_susp_clean(struct mount *); static const char *tmpfs_opts[] = { "from", "size", "maxfilesize", "inodes", "uid", "gid", "mode", "export", - "union", "nonc", NULL + "union", "nonc", "nomtime", NULL }; static const char *tmpfs_updateopts[] = { - "from", "export", "size", NULL + "from", "export", "nomtime", "size", NULL }; /* - * Handle updates of time from writes to mmaped regions. Use - * MNT_VNODE_FOREACH_ALL instead of MNT_VNODE_FOREACH_LAZY, since + * Handle updates of time from writes to mmaped regions, if allowed. + * Use MNT_VNODE_FOREACH_ALL instead of MNT_VNODE_FOREACH_LAZY, since * unmap of the tmpfs-backed vnode does not call vinactive(), due to - * vm object type is OBJT_SWAP. - * If lazy, only handle delayed update of mtime due to the writes to - * mapped files. + * vm object type is OBJT_SWAP. If lazy, only handle delayed update + * of mtime due to the writes to mapped files. */ static void tmpfs_update_mtime(struct mount *mp, bool lazy) @@ -113,6 +112,8 @@ tmpfs_update_mtime(struct mount *mp, bool lazy) struct vnode *vp, *mvp; struct vm_object *obj; + if (VFS_TO_TMPFS(mp)->tm_nomtime) + return; MNT_VNODE_FOREACH_ALL(vp, mp, mvp) { if (vp->v_type != VREG) { VI_UNLOCK(vp); @@ -327,7 +328,7 @@ tmpfs_mount(struct mount *mp) struct tmpfs_mount *tmp; struct tmpfs_node *root; int error; - bool nonc; + bool nomtime, nonc; /* Size counters. */ u_quad_t pages; off_t nodes_max, size_max, maxfilesize; @@ -370,6 +371,8 @@ tmpfs_mount(struct mount *mp) mp->mnt_flag &= ~MNT_RDONLY; MNT_IUNLOCK(mp); } + tmp->tm_nomtime = vfs_getopt(mp->mnt_optnew, "nomtime", NULL, + 0) == 0; return (0); } @@ -395,6 +398,7 @@ tmpfs_mount(struct mount *mp) if (vfs_getopt_size(mp->mnt_optnew, "maxfilesize", &maxfilesize) != 0) maxfilesize = 0; nonc = vfs_getopt(mp->mnt_optnew, "nonc", NULL, NULL) == 0; + nomtime = vfs_getopt(mp->mnt_optnew, "nomtime", NULL, NULL) == 0; /* Do not allow mounts if we do not have enough memory to preserve * the minimum reserved pages. */ @@ -441,6 +445,7 @@ tmpfs_mount(struct mount *mp) new_unrhdr64(&tmp->tm_ino_unr, 2); tmp->tm_ronly = (mp->mnt_flag & MNT_RDONLY) != 0; tmp->tm_nonc = nonc; + tmp->tm_nomtime = nomtime; /* Allocate the root node. */ error = tmpfs_alloc_node(mp, tmp, VDIR, root_uid, root_gid, From owner-svn-src-all@freebsd.org Tue Feb 4 19:15:58 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A2FB52307D1; Tue, 4 Feb 2020 19:15:58 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BvYV3r2tz4Ngl; Tue, 4 Feb 2020 19:15:58 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7EC371E98B; Tue, 4 Feb 2020 19:15:58 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014JFwIv046254; Tue, 4 Feb 2020 19:15:58 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014JFwXb046252; Tue, 4 Feb 2020 19:15:58 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202002041915.014JFwXb046252@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 4 Feb 2020 19:15:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r357516 - stable/11/sbin/newfs_msdos X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: stable/11/sbin/newfs_msdos X-SVN-Commit-Revision: 357516 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 19:15:58 -0000 Author: dim Date: Tue Feb 4 19:15:57 2020 New Revision: 357516 URL: https://svnweb.freebsd.org/changeset/base/357516 Log: MFC r351382 (by delphij): When creating a new FAT32 filesystem, use "unknown" (0xFFFFFFFF) for FSI_Nxt_Free instead of providing a wrong value. With this change, fsck_msdosfs would no longer complain about invalid FSInfo information. MFC r355317 (by delphij): newfs_msdos: -A is incompatible with -r, not -o. PR: 242314 Submitted by: Guy Yur MFC r357227: Merge r357225 from the clang1000-import branch: Fix the following -Werror warning from clang 10.0.0 in newfs_msdos: sbin/newfs_msdos/newfs_msdos.c:181:2: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation] if (o.align) { ^ sbin/newfs_msdos/newfs_msdos.c:179:5: note: previous statement is here if (argc < 1 || argc > 2) ^ Modified: stable/11/sbin/newfs_msdos/mkfs_msdos.c stable/11/sbin/newfs_msdos/newfs_msdos.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/newfs_msdos/mkfs_msdos.c ============================================================================== --- stable/11/sbin/newfs_msdos/mkfs_msdos.c Tue Feb 4 19:05:58 2020 (r357515) +++ stable/11/sbin/newfs_msdos/mkfs_msdos.c Tue Feb 4 19:15:57 2020 (r357516) @@ -715,7 +715,7 @@ mkfs_msdos(const char *fname, const char *dtype, const mk4(img, 0x41615252); mk4(img + MINBPS - 28, 0x61417272); mk4(img + MINBPS - 24, 0xffffffff); - mk4(img + MINBPS - 20, bpb.bpbRootClust); + mk4(img + MINBPS - 20, 0xffffffff); mk2(img + MINBPS - 2, DOSMAGIC); } else if (lsn >= bpb.bpbResSectors && lsn < dir && !((lsn - bpb.bpbResSectors) % Modified: stable/11/sbin/newfs_msdos/newfs_msdos.c ============================================================================== --- stable/11/sbin/newfs_msdos/newfs_msdos.c Tue Feb 4 19:05:58 2020 (r357515) +++ stable/11/sbin/newfs_msdos/newfs_msdos.c Tue Feb 4 19:15:57 2020 (r357516) @@ -178,10 +178,10 @@ main(int argc, char *argv[]) argv += optind; if (argc < 1 || argc > 2) usage(); - if (o.align) { - if (o.hidden_sectors_set) - errx(1, "align (-A) is incompatible with -r"); - } + if (o.align) { + if (o.reserved_sectors) + errx(1, "align (-A) is incompatible with -r"); + } fname = *argv++; if (!o.create_size && !strchr(fname, '/')) { snprintf(buf, sizeof(buf), "%s%s", _PATH_DEV, fname); From owner-svn-src-all@freebsd.org Tue Feb 4 19:19:17 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 460EB230895; Tue, 4 Feb 2020 19:19:17 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BvdK15Rrz4NqK; Tue, 4 Feb 2020 19:19:17 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from mousie.catspoiler.org (unknown [76.212.85.177]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: truckman) by smtp.freebsd.org (Postfix) with ESMTPSA id 610ADAB8F; Tue, 4 Feb 2020 19:19:16 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Date: Tue, 4 Feb 2020 11:19:14 -0800 (PST) From: Don Lewis Subject: Re: svn commit: r357407 - head To: Warner Losh cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <202002021137.012BbSwd008392@repo.freebsd.org> Message-ID: References: <202002021137.012BbSwd008392@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; CHARSET=us-ascii Content-Disposition: INLINE X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 19:19:17 -0000 On 2 Feb, Warner Losh wrote: > Author: imp > Date: Sun Feb 2 11:37:27 2020 > New Revision: 357407 > URL: https://svnweb.freebsd.org/changeset/base/357407 > > Log: > Per the firm plan, start to remove sparc64 > > The sparc64 architecture is being removed from FreeBSD 13, starting > now. This removes it from the top level only. It is the only > architecture that didn't see substantial work after the call to get > things working with the external toolchain. Sigh ... I finally got around to fixing the motherboard in my Ultra 10 over the weekend, bad CPU VRM caps. I'm currently upgrading to a more recent version of FreeBSD. It's taking a while since this beast is really slow. From owner-svn-src-all@freebsd.org Tue Feb 4 19:19:49 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 23D7223092D; Tue, 4 Feb 2020 19:19:49 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Bvdx09j9z4Nxn; Tue, 4 Feb 2020 19:19:49 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 012251E993; Tue, 4 Feb 2020 19:19:49 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014JJmRW046563; Tue, 4 Feb 2020 19:19:48 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014JJmkP046562; Tue, 4 Feb 2020 19:19:48 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202002041919.014JJmkP046562@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 4 Feb 2020 19:19:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r357517 - in stable: 10/libexec/rbootd 11/libexec/rbootd 12/libexec/rbootd X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 10/libexec/rbootd 11/libexec/rbootd 12/libexec/rbootd X-SVN-Commit-Revision: 357517 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 19:19:49 -0000 Author: dim Date: Tue Feb 4 19:19:48 2020 New Revision: 357517 URL: https://svnweb.freebsd.org/changeset/base/357517 Log: MFC r357223: Merge r357222 from the clang1000-import branch: Fix the following -Werror warning from clang 10.0.0 in rbootd: libexec/rbootd/rmpproto.c:335:49: error: multiple unsequenced modifications to 'filename' [-Werror,-Wunsequenced] filename = (filename = strrchr(filepath,'/'))? ++filename: filepath; ~ ^ Modified: stable/11/libexec/rbootd/rmpproto.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/libexec/rbootd/rmpproto.c stable/12/libexec/rbootd/rmpproto.c Directory Properties: stable/10/ (props changed) stable/12/ (props changed) Modified: stable/11/libexec/rbootd/rmpproto.c ============================================================================== --- stable/11/libexec/rbootd/rmpproto.c Tue Feb 4 19:15:57 2020 (r357516) +++ stable/11/libexec/rbootd/rmpproto.c Tue Feb 4 19:19:48 2020 (r357517) @@ -330,7 +330,8 @@ SendBootRepl(struct rmp_packet *req, RMPCONN *rconn, c * stripped file name and spoof the client into thinking that it * really got what it wanted. */ - filename = (filename = strrchr(filepath,'/'))? ++filename: filepath; + filename = strrchr(filepath,'/'); + filename = filename? filename + 1: filepath; /* * Check that this is a valid boot file name. From owner-svn-src-all@freebsd.org Tue Feb 4 19:19:48 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E2C45230929; Tue, 4 Feb 2020 19:19:48 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Bvdw5dcNz4Nxm; Tue, 4 Feb 2020 19:19:48 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BC9201E992; Tue, 4 Feb 2020 19:19:48 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014JJm0I046557; Tue, 4 Feb 2020 19:19:48 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014JJmNP046556; Tue, 4 Feb 2020 19:19:48 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202002041919.014JJmNP046556@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 4 Feb 2020 19:19:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357517 - in stable: 10/libexec/rbootd 11/libexec/rbootd 12/libexec/rbootd X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 10/libexec/rbootd 11/libexec/rbootd 12/libexec/rbootd X-SVN-Commit-Revision: 357517 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 19:19:49 -0000 Author: dim Date: Tue Feb 4 19:19:48 2020 New Revision: 357517 URL: https://svnweb.freebsd.org/changeset/base/357517 Log: MFC r357223: Merge r357222 from the clang1000-import branch: Fix the following -Werror warning from clang 10.0.0 in rbootd: libexec/rbootd/rmpproto.c:335:49: error: multiple unsequenced modifications to 'filename' [-Werror,-Wunsequenced] filename = (filename = strrchr(filepath,'/'))? ++filename: filepath; ~ ^ Modified: stable/12/libexec/rbootd/rmpproto.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/10/libexec/rbootd/rmpproto.c stable/11/libexec/rbootd/rmpproto.c Directory Properties: stable/10/ (props changed) stable/11/ (props changed) Modified: stable/12/libexec/rbootd/rmpproto.c ============================================================================== --- stable/12/libexec/rbootd/rmpproto.c Tue Feb 4 19:15:57 2020 (r357516) +++ stable/12/libexec/rbootd/rmpproto.c Tue Feb 4 19:19:48 2020 (r357517) @@ -332,7 +332,8 @@ SendBootRepl(struct rmp_packet *req, RMPCONN *rconn, c * stripped file name and spoof the client into thinking that it * really got what it wanted. */ - filename = (filename = strrchr(filepath,'/'))? ++filename: filepath; + filename = strrchr(filepath,'/'); + filename = filename? filename + 1: filepath; /* * Check that this is a valid boot file name. From owner-svn-src-all@freebsd.org Tue Feb 4 19:19:49 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7BBC823093D; Tue, 4 Feb 2020 19:19:49 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Bvdx2nQjz4Nxv; Tue, 4 Feb 2020 19:19:49 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 579E41E994; Tue, 4 Feb 2020 19:19:49 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014JJnMN046569; Tue, 4 Feb 2020 19:19:49 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014JJnSu046568; Tue, 4 Feb 2020 19:19:49 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202002041919.014JJnSu046568@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 4 Feb 2020 19:19:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r357517 - in stable: 10/libexec/rbootd 11/libexec/rbootd 12/libexec/rbootd X-SVN-Group: stable-10 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 10/libexec/rbootd 11/libexec/rbootd 12/libexec/rbootd X-SVN-Commit-Revision: 357517 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 19:19:49 -0000 Author: dim Date: Tue Feb 4 19:19:48 2020 New Revision: 357517 URL: https://svnweb.freebsd.org/changeset/base/357517 Log: MFC r357223: Merge r357222 from the clang1000-import branch: Fix the following -Werror warning from clang 10.0.0 in rbootd: libexec/rbootd/rmpproto.c:335:49: error: multiple unsequenced modifications to 'filename' [-Werror,-Wunsequenced] filename = (filename = strrchr(filepath,'/'))? ++filename: filepath; ~ ^ Modified: stable/10/libexec/rbootd/rmpproto.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/libexec/rbootd/rmpproto.c stable/12/libexec/rbootd/rmpproto.c Directory Properties: stable/11/ (props changed) stable/12/ (props changed) Modified: stable/10/libexec/rbootd/rmpproto.c ============================================================================== --- stable/10/libexec/rbootd/rmpproto.c Tue Feb 4 19:15:57 2020 (r357516) +++ stable/10/libexec/rbootd/rmpproto.c Tue Feb 4 19:19:48 2020 (r357517) @@ -330,7 +330,8 @@ SendBootRepl(struct rmp_packet *req, RMPCONN *rconn, c * stripped file name and spoof the client into thinking that it * really got what it wanted. */ - filename = (filename = strrchr(filepath,'/'))? ++filename: filepath; + filename = strrchr(filepath,'/'); + filename = filename? filename + 1: filepath; /* * Check that this is a valid boot file name. From owner-svn-src-all@freebsd.org Tue Feb 4 19:24:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2F0DB230FCB; Tue, 4 Feb 2020 19:24:11 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Bvkz0N5Fz4PfN; Tue, 4 Feb 2020 19:24:11 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 07FA51EB59; Tue, 4 Feb 2020 19:24:11 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014JOAIR052131; Tue, 4 Feb 2020 19:24:10 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014JOA06052130; Tue, 4 Feb 2020 19:24:10 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202002041924.014JOA06052130@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 4 Feb 2020 19:24:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357518 - in stable: 10/usr.bin/tip/tip 11/usr.bin/tip/tip 12/usr.bin/tip/tip X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 10/usr.bin/tip/tip 11/usr.bin/tip/tip 12/usr.bin/tip/tip X-SVN-Commit-Revision: 357518 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 19:24:11 -0000 Author: dim Date: Tue Feb 4 19:24:10 2020 New Revision: 357518 URL: https://svnweb.freebsd.org/changeset/base/357518 Log: MFC r357269: Merge r357267 from the clang1000-import branch: Fix the following -Werror warning from clang 10.0.0 in tip: usr.bin/tip/tip/tip.c:428:4: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation] if (gch == EOF) ^ usr.bin/tip/tip/tip.c:426:5: note: previous statement is here } else if (!cumode && gch == character(value(FORCE))) ^ The intent was to have the EOF check grouped with the getchar() call just above it. This was accidentally introduced in r354624. Modified: stable/12/usr.bin/tip/tip/tip.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/10/usr.bin/tip/tip/tip.c stable/11/usr.bin/tip/tip/tip.c Directory Properties: stable/10/ (props changed) stable/11/ (props changed) Modified: stable/12/usr.bin/tip/tip/tip.c ============================================================================== --- stable/12/usr.bin/tip/tip/tip.c Tue Feb 4 19:19:48 2020 (r357517) +++ stable/12/usr.bin/tip/tip/tip.c Tue Feb 4 19:24:10 2020 (r357518) @@ -423,11 +423,12 @@ tipin(void) if (boolean(value(HALFDUPLEX))) printf("\r\n"); continue; - } else if (!cumode && gch == character(value(FORCE))) + } else if (!cumode && gch == character(value(FORCE))) { gch = getchar(); if (gch == EOF) return; gch = gch & STRIP_PAR; + } bol = any(gch, value(EOL)); if (boolean(value(RAISE)) && islower(gch)) gch = toupper(gch); From owner-svn-src-all@freebsd.org Tue Feb 4 19:24:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9A683230FD8; Tue, 4 Feb 2020 19:24:11 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Bvkz3b1Nz4PfP; Tue, 4 Feb 2020 19:24:11 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7628B1EB5A; Tue, 4 Feb 2020 19:24:11 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014JOBYI052137; Tue, 4 Feb 2020 19:24:11 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014JOBRA052136; Tue, 4 Feb 2020 19:24:11 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202002041924.014JOBRA052136@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 4 Feb 2020 19:24:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r357518 - in stable: 10/usr.bin/tip/tip 11/usr.bin/tip/tip 12/usr.bin/tip/tip X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 10/usr.bin/tip/tip 11/usr.bin/tip/tip 12/usr.bin/tip/tip X-SVN-Commit-Revision: 357518 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 19:24:11 -0000 Author: dim Date: Tue Feb 4 19:24:10 2020 New Revision: 357518 URL: https://svnweb.freebsd.org/changeset/base/357518 Log: MFC r357269: Merge r357267 from the clang1000-import branch: Fix the following -Werror warning from clang 10.0.0 in tip: usr.bin/tip/tip/tip.c:428:4: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation] if (gch == EOF) ^ usr.bin/tip/tip/tip.c:426:5: note: previous statement is here } else if (!cumode && gch == character(value(FORCE))) ^ The intent was to have the EOF check grouped with the getchar() call just above it. This was accidentally introduced in r354624. Modified: stable/11/usr.bin/tip/tip/tip.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/usr.bin/tip/tip/tip.c stable/12/usr.bin/tip/tip/tip.c Directory Properties: stable/10/ (props changed) stable/12/ (props changed) Modified: stable/11/usr.bin/tip/tip/tip.c ============================================================================== --- stable/11/usr.bin/tip/tip/tip.c Tue Feb 4 19:19:48 2020 (r357517) +++ stable/11/usr.bin/tip/tip/tip.c Tue Feb 4 19:24:10 2020 (r357518) @@ -421,11 +421,12 @@ tipin(void) if (boolean(value(HALFDUPLEX))) printf("\r\n"); continue; - } else if (!cumode && gch == character(value(FORCE))) + } else if (!cumode && gch == character(value(FORCE))) { gch = getchar(); if (gch == EOF) return; gch = gch & STRIP_PAR; + } bol = any(gch, value(EOL)); if (boolean(value(RAISE)) && islower(gch)) gch = toupper(gch); From owner-svn-src-all@freebsd.org Tue Feb 4 19:24:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D3CAD230FE3; Tue, 4 Feb 2020 19:24:11 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Bvkz5HzJz4PfQ; Tue, 4 Feb 2020 19:24:11 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B10B11EB5B; Tue, 4 Feb 2020 19:24:11 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014JOBlw052144; Tue, 4 Feb 2020 19:24:11 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014JOBZi052143; Tue, 4 Feb 2020 19:24:11 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202002041924.014JOBZi052143@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 4 Feb 2020 19:24:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r357518 - in stable: 10/usr.bin/tip/tip 11/usr.bin/tip/tip 12/usr.bin/tip/tip X-SVN-Group: stable-10 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 10/usr.bin/tip/tip 11/usr.bin/tip/tip 12/usr.bin/tip/tip X-SVN-Commit-Revision: 357518 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 19:24:11 -0000 Author: dim Date: Tue Feb 4 19:24:10 2020 New Revision: 357518 URL: https://svnweb.freebsd.org/changeset/base/357518 Log: MFC r357269: Merge r357267 from the clang1000-import branch: Fix the following -Werror warning from clang 10.0.0 in tip: usr.bin/tip/tip/tip.c:428:4: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation] if (gch == EOF) ^ usr.bin/tip/tip/tip.c:426:5: note: previous statement is here } else if (!cumode && gch == character(value(FORCE))) ^ The intent was to have the EOF check grouped with the getchar() call just above it. This was accidentally introduced in r354624. Modified: stable/10/usr.bin/tip/tip/tip.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/usr.bin/tip/tip/tip.c stable/12/usr.bin/tip/tip/tip.c Directory Properties: stable/11/ (props changed) stable/12/ (props changed) Modified: stable/10/usr.bin/tip/tip/tip.c ============================================================================== --- stable/10/usr.bin/tip/tip/tip.c Tue Feb 4 19:19:48 2020 (r357517) +++ stable/10/usr.bin/tip/tip/tip.c Tue Feb 4 19:24:10 2020 (r357518) @@ -417,8 +417,9 @@ tipin(void) if (boolean(value(HALFDUPLEX))) printf("\r\n"); continue; - } else if (!cumode && gch == character(value(FORCE))) + } else if (!cumode && gch == character(value(FORCE))) { gch = getchar()&STRIP_PAR; + } bol = any(gch, value(EOL)); if (boolean(value(RAISE)) && islower(gch)) gch = toupper(gch); From owner-svn-src-all@freebsd.org Tue Feb 4 19:31:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8C545231373; Tue, 4 Feb 2020 19:31:02 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Bvtt3Cphz4Q9v; Tue, 4 Feb 2020 19:31:02 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 693211EBA4; Tue, 4 Feb 2020 19:31:02 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014JV2ud053518; Tue, 4 Feb 2020 19:31:02 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014JV2ox053517; Tue, 4 Feb 2020 19:31:02 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202002041931.014JV2ox053517@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 4 Feb 2020 19:31:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357519 - in stable: 10/usr.bin/procstat 11/usr.bin/procstat 12/usr.bin/procstat X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 10/usr.bin/procstat 11/usr.bin/procstat 12/usr.bin/procstat X-SVN-Commit-Revision: 357519 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 19:31:02 -0000 Author: dim Date: Tue Feb 4 19:31:01 2020 New Revision: 357519 URL: https://svnweb.freebsd.org/changeset/base/357519 Log: MFC r357268: Merge r357260 from the clang1000-import branch: Fix the following -Werror warning from clang 10.0.0 in procstat: usr.bin/procstat/procstat_sigs.c:79:3: error: misleading indentation; statement is not part of the previous 'else' [-Werror,-Wmisleading-indentation] xo_close_container(name); ^ usr.bin/procstat/procstat_sigs.c:77:4: note: previous statement is here } else ^ The intent was to group the xo_close_container() call to the previous snprintf() call. Modified: stable/12/usr.bin/procstat/procstat_sigs.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/10/usr.bin/procstat/procstat_sigs.c stable/11/usr.bin/procstat/procstat_sigs.c Directory Properties: stable/10/ (props changed) stable/11/ (props changed) Modified: stable/12/usr.bin/procstat/procstat_sigs.c ============================================================================== --- stable/12/usr.bin/procstat/procstat_sigs.c Tue Feb 4 19:24:10 2020 (r357518) +++ stable/12/usr.bin/procstat/procstat_sigs.c Tue Feb 4 19:31:01 2020 (r357519) @@ -74,9 +74,10 @@ procstat_close_signame(int sig) for (i = 0; name[i] != 0; i++) name[i] = toupper(name[i]); xo_close_container(name); - } else + } else { snprintf(name, 12, "%d", sig); xo_close_container(name); + } } static void From owner-svn-src-all@freebsd.org Tue Feb 4 19:31:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4EC53231379; Tue, 4 Feb 2020 19:31:03 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Bvtt5VMjz4Q9y; Tue, 4 Feb 2020 19:31:02 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B7EEA1EBA6; Tue, 4 Feb 2020 19:31:02 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014JV24u053524; Tue, 4 Feb 2020 19:31:02 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014JV2ZK053523; Tue, 4 Feb 2020 19:31:02 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202002041931.014JV2ZK053523@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 4 Feb 2020 19:31:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r357519 - in stable: 10/usr.bin/procstat 11/usr.bin/procstat 12/usr.bin/procstat X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 10/usr.bin/procstat 11/usr.bin/procstat 12/usr.bin/procstat X-SVN-Commit-Revision: 357519 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 19:31:03 -0000 Author: dim Date: Tue Feb 4 19:31:01 2020 New Revision: 357519 URL: https://svnweb.freebsd.org/changeset/base/357519 Log: MFC r357268: Merge r357260 from the clang1000-import branch: Fix the following -Werror warning from clang 10.0.0 in procstat: usr.bin/procstat/procstat_sigs.c:79:3: error: misleading indentation; statement is not part of the previous 'else' [-Werror,-Wmisleading-indentation] xo_close_container(name); ^ usr.bin/procstat/procstat_sigs.c:77:4: note: previous statement is here } else ^ The intent was to group the xo_close_container() call to the previous snprintf() call. Modified: stable/11/usr.bin/procstat/procstat_sigs.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/usr.bin/procstat/procstat_sigs.c stable/12/usr.bin/procstat/procstat_sigs.c Directory Properties: stable/10/ (props changed) stable/12/ (props changed) Modified: stable/11/usr.bin/procstat/procstat_sigs.c ============================================================================== --- stable/11/usr.bin/procstat/procstat_sigs.c Tue Feb 4 19:24:10 2020 (r357518) +++ stable/11/usr.bin/procstat/procstat_sigs.c Tue Feb 4 19:31:01 2020 (r357519) @@ -74,9 +74,10 @@ procstat_close_signame(int sig) for (i = 0; name[i] != 0; i++) name[i] = toupper(name[i]); xo_close_container(name); - } else + } else { snprintf(name, 12, "%d", sig); xo_close_container(name); + } } static void From owner-svn-src-all@freebsd.org Tue Feb 4 19:31:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4E7A8231378; Tue, 4 Feb 2020 19:31:03 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Bvtv0qhVz4QB1; Tue, 4 Feb 2020 19:31:03 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 17D4A1EBA7; Tue, 4 Feb 2020 19:31:03 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014JV2l7053530; Tue, 4 Feb 2020 19:31:02 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014JV2fv053529; Tue, 4 Feb 2020 19:31:02 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202002041931.014JV2fv053529@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 4 Feb 2020 19:31:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r357519 - in stable: 10/usr.bin/procstat 11/usr.bin/procstat 12/usr.bin/procstat X-SVN-Group: stable-10 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 10/usr.bin/procstat 11/usr.bin/procstat 12/usr.bin/procstat X-SVN-Commit-Revision: 357519 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 19:31:03 -0000 Author: dim Date: Tue Feb 4 19:31:01 2020 New Revision: 357519 URL: https://svnweb.freebsd.org/changeset/base/357519 Log: MFC r357268: Merge r357260 from the clang1000-import branch: Fix the following -Werror warning from clang 10.0.0 in procstat: usr.bin/procstat/procstat_sigs.c:79:3: error: misleading indentation; statement is not part of the previous 'else' [-Werror,-Wmisleading-indentation] xo_close_container(name); ^ usr.bin/procstat/procstat_sigs.c:77:4: note: previous statement is here } else ^ The intent was to group the xo_close_container() call to the previous snprintf() call. Modified: stable/10/usr.bin/procstat/procstat_sigs.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/usr.bin/procstat/procstat_sigs.c stable/12/usr.bin/procstat/procstat_sigs.c Directory Properties: stable/11/ (props changed) stable/12/ (props changed) Modified: stable/10/usr.bin/procstat/procstat_sigs.c ============================================================================== --- stable/10/usr.bin/procstat/procstat_sigs.c Tue Feb 4 19:24:10 2020 (r357518) +++ stable/10/usr.bin/procstat/procstat_sigs.c Tue Feb 4 19:31:01 2020 (r357519) @@ -52,8 +52,9 @@ procstat_print_signame(int sig) for (i = 0; name[i] != 0; i++) name[i] = toupper(name[i]); printf("%-7s ", name); - } else + } else { printf("%-7d ", sig); + } } static void From owner-svn-src-all@freebsd.org Tue Feb 4 19:32:49 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 771BC2316E7; Tue, 4 Feb 2020 19:32:49 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Bvwx0LRmz4QlS; Tue, 4 Feb 2020 19:32:48 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id 014JWdnn002705 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 4 Feb 2020 11:32:40 -0800 (PST) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id 014JWdhx002704; Tue, 4 Feb 2020 11:32:39 -0800 (PST) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Tue, 4 Feb 2020 11:32:39 -0800 From: Gleb Smirnoff To: Kristof Provost Cc: Ilja Van Sprundel , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r357233 - head/sys/net Message-ID: <20200204193239.GR1268@FreeBSD.org> References: <202001282244.00SMiPrb077446@repo.freebsd.org> <20200130163455.GH1268@FreeBSD.org> <3F7A5204-4437-4845-8E40-0BC5D1CD0A5B@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3F7A5204-4437-4845-8E40-0BC5D1CD0A5B@FreeBSD.org> User-Agent: Mutt/1.12.2 (2019-09-21) X-Rspamd-Queue-Id: 48Bvwx0LRmz4QlS X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-1.52 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.64)[-0.637,0]; ASN(0.00)[asn:27348, ipnet:162.251.186.0/24, country:US]; NEURAL_HAM_LONG(-0.89)[-0.888,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 19:32:49 -0000 Kristof, On Sat, Feb 01, 2020 at 07:26:48PM +0000, Kristof Provost wrote: K> > K> -/* The below interface used only by epair(4). */ K> > K> +/* The below interfaces are used only by epair(4). */ K> > K> +void if_clone_addif(struct if_clone *, struct ifnet *); K> > K> int if_clone_destroyif(struct if_clone *, struct ifnet *); K> > K> > IMHO, makes sense to move all these declaration into if_epair.c K> > itself. K> > K> Yeah, that does make sense. K> K> One minor issue is that it turns out that if_clone_destroyif() isn’t K> just used by if_epair, but also by the wifi code. K> K> How does this look? Yes, that's what I suggested. However, now given that net80211 also uses one of these methods, I'm not sure if isolating is a right move. In general, we consider if_clone KPI an internal one, don't we? I mean we don't expect 3rd party device drivers to use it. So may be it is fine that if_clone.h exposes those functions? If no, then we probably should hide both if_clone_addif and if_clone_destroyif away from if_clone.h and declare them as extern in epair and net80211. -- Gleb Smirnoff From owner-svn-src-all@freebsd.org Tue Feb 4 19:35:41 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2F3732317F3; Tue, 4 Feb 2020 19:35:41 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Bw0F0WnCz4Qx7; Tue, 4 Feb 2020 19:35:41 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0D3A81ED54; Tue, 4 Feb 2020 19:35:41 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014JZenw058285; Tue, 4 Feb 2020 19:35:40 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014JZelb058284; Tue, 4 Feb 2020 19:35:40 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202002041935.014JZelb058284@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 4 Feb 2020 19:35:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r357520 - in stable: 10/usr.sbin/bsnmpd/modules/snmp_bridge 11/usr.sbin/bsnmpd/modules/snmp_bridge 12/usr.sbin/bsnmpd/modules/snmp_bridge X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 10/usr.sbin/bsnmpd/modules/snmp_bridge 11/usr.sbin/bsnmpd/modules/snmp_bridge 12/usr.sbin/bsnmpd/modules/snmp_bridge X-SVN-Commit-Revision: 357520 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 19:35:41 -0000 Author: dim Date: Tue Feb 4 19:35:40 2020 New Revision: 357520 URL: https://svnweb.freebsd.org/changeset/base/357520 Log: MFC r357272: Merge r357271 from the clang1000-import branch: Fix the following -Werror warning from clang 10.0.0 in bsnmpd: usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c:1235:43: error: overlapping comparisons always evaluate to true [-Werror,-Wtautological-overlap-compare] begemotBridgeStpPortEnable_enabled || ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~ Work around it by casting the enum values to the type of val->v.integer. Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c stable/12/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c Directory Properties: stable/10/ (props changed) stable/12/ (props changed) Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c ============================================================================== --- stable/11/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c Tue Feb 4 19:31:01 2020 (r357519) +++ stable/11/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c Tue Feb 4 19:35:40 2020 (r357520) @@ -1231,9 +1231,9 @@ op_begemot_stp_port(struct snmp_context *ctx, struct s case LEAF_begemotBridgeStpPortEnable: if (val->v.integer != - begemotBridgeStpPortEnable_enabled || + (int32_t)begemotBridgeStpPortEnable_enabled || val->v.integer != - begemotBridgeStpPortEnable_disabled) + (int32_t)begemotBridgeStpPortEnable_disabled) return (SNMP_ERR_WRONG_VALUE); ctx->scratch->int1 = bp->enable; From owner-svn-src-all@freebsd.org Tue Feb 4 19:35:40 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D1D8C2317EE; Tue, 4 Feb 2020 19:35:40 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Bw0D596sz4Qx5; Tue, 4 Feb 2020 19:35:40 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AC8231ED53; Tue, 4 Feb 2020 19:35:40 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014JZenx058279; Tue, 4 Feb 2020 19:35:40 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014JZe2B058278; Tue, 4 Feb 2020 19:35:40 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202002041935.014JZe2B058278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 4 Feb 2020 19:35:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357520 - in stable: 10/usr.sbin/bsnmpd/modules/snmp_bridge 11/usr.sbin/bsnmpd/modules/snmp_bridge 12/usr.sbin/bsnmpd/modules/snmp_bridge X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 10/usr.sbin/bsnmpd/modules/snmp_bridge 11/usr.sbin/bsnmpd/modules/snmp_bridge 12/usr.sbin/bsnmpd/modules/snmp_bridge X-SVN-Commit-Revision: 357520 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 19:35:40 -0000 Author: dim Date: Tue Feb 4 19:35:40 2020 New Revision: 357520 URL: https://svnweb.freebsd.org/changeset/base/357520 Log: MFC r357272: Merge r357271 from the clang1000-import branch: Fix the following -Werror warning from clang 10.0.0 in bsnmpd: usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c:1235:43: error: overlapping comparisons always evaluate to true [-Werror,-Wtautological-overlap-compare] begemotBridgeStpPortEnable_enabled || ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~ Work around it by casting the enum values to the type of val->v.integer. Modified: stable/12/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c stable/11/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c Directory Properties: stable/10/ (props changed) stable/11/ (props changed) Modified: stable/12/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c ============================================================================== --- stable/12/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c Tue Feb 4 19:31:01 2020 (r357519) +++ stable/12/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c Tue Feb 4 19:35:40 2020 (r357520) @@ -1232,9 +1232,9 @@ op_begemot_stp_port(struct snmp_context *ctx, struct s case LEAF_begemotBridgeStpPortEnable: if (val->v.integer != - begemotBridgeStpPortEnable_enabled || + (int32_t)begemotBridgeStpPortEnable_enabled || val->v.integer != - begemotBridgeStpPortEnable_disabled) + (int32_t)begemotBridgeStpPortEnable_disabled) return (SNMP_ERR_WRONG_VALUE); ctx->scratch->int1 = bp->enable; From owner-svn-src-all@freebsd.org Tue Feb 4 19:35:41 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 83B3A2317FA; Tue, 4 Feb 2020 19:35:41 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Bw0F31PRz4QxD; Tue, 4 Feb 2020 19:35:41 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6153F1ED55; Tue, 4 Feb 2020 19:35:41 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014JZfJG058291; Tue, 4 Feb 2020 19:35:41 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014JZfC3058290; Tue, 4 Feb 2020 19:35:41 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202002041935.014JZfC3058290@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 4 Feb 2020 19:35:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r357520 - in stable: 10/usr.sbin/bsnmpd/modules/snmp_bridge 11/usr.sbin/bsnmpd/modules/snmp_bridge 12/usr.sbin/bsnmpd/modules/snmp_bridge X-SVN-Group: stable-10 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 10/usr.sbin/bsnmpd/modules/snmp_bridge 11/usr.sbin/bsnmpd/modules/snmp_bridge 12/usr.sbin/bsnmpd/modules/snmp_bridge X-SVN-Commit-Revision: 357520 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 19:35:41 -0000 Author: dim Date: Tue Feb 4 19:35:40 2020 New Revision: 357520 URL: https://svnweb.freebsd.org/changeset/base/357520 Log: MFC r357272: Merge r357271 from the clang1000-import branch: Fix the following -Werror warning from clang 10.0.0 in bsnmpd: usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c:1235:43: error: overlapping comparisons always evaluate to true [-Werror,-Wtautological-overlap-compare] begemotBridgeStpPortEnable_enabled || ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~ Work around it by casting the enum values to the type of val->v.integer. Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c stable/12/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c Directory Properties: stable/11/ (props changed) stable/12/ (props changed) Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c ============================================================================== --- stable/10/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c Tue Feb 4 19:31:01 2020 (r357519) +++ stable/10/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c Tue Feb 4 19:35:40 2020 (r357520) @@ -1229,9 +1229,9 @@ op_begemot_stp_port(struct snmp_context *ctx, struct s case LEAF_begemotBridgeStpPortEnable: if (val->v.integer != - begemotBridgeStpPortEnable_enabled || + (int32_t)begemotBridgeStpPortEnable_enabled || val->v.integer != - begemotBridgeStpPortEnable_disabled) + (int32_t)begemotBridgeStpPortEnable_disabled) return (SNMP_ERR_WRONG_VALUE); ctx->scratch->int1 = bp->enable; From owner-svn-src-all@freebsd.org Tue Feb 4 19:42:58 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 99CC2231BD9; Tue, 4 Feb 2020 19:42:58 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Bw8f3YJdz4Rbf; Tue, 4 Feb 2020 19:42:58 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 74F571EF18; Tue, 4 Feb 2020 19:42:58 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014Jgw8K064255; Tue, 4 Feb 2020 19:42:58 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014Jgw8B064253; Tue, 4 Feb 2020 19:42:58 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202002041942.014Jgw8B064253@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 4 Feb 2020 19:42:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357521 - in stable: 11/share/mk 11/usr.bin/lex 12/share/mk 12/usr.bin/lex X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/share/mk 11/usr.bin/lex 12/share/mk 12/usr.bin/lex X-SVN-Commit-Revision: 357521 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 19:42:58 -0000 Author: dim Date: Tue Feb 4 19:42:57 2020 New Revision: 357521 URL: https://svnweb.freebsd.org/changeset/base/357521 Log: MFC r357347: Merge r357345 from the clang1000-import branch: Disable new clang 10.0.0 warnings about misleading indentation in flex. As this is contributed code with very messy indentation, which will almost certainly never be upgraded, just disable the warning. Modified: stable/12/share/mk/bsd.sys.mk stable/12/usr.bin/lex/Makefile Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/share/mk/bsd.sys.mk stable/11/usr.bin/lex/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/12/share/mk/bsd.sys.mk ============================================================================== --- stable/12/share/mk/bsd.sys.mk Tue Feb 4 19:35:40 2020 (r357520) +++ stable/12/share/mk/bsd.sys.mk Tue Feb 4 19:42:57 2020 (r357521) @@ -108,6 +108,11 @@ CWARNFLAGS.clang+= -Wno-parentheses .if defined(NO_WARRAY_BOUNDS) CWARNFLAGS.clang+= -Wno-array-bounds .endif # NO_WARRAY_BOUNDS +.if defined(NO_WMISLEADING_INDENTATION) && \ + ((${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 100000) || \ + (${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 60100)) +CWARNFLAGS+= -Wno-misleading-indentation +.endif # NO_WMISLEADING_INDENTATION .endif # WARNS .if defined(FORMAT_AUDIT) @@ -151,8 +156,7 @@ CWARNFLAGS+= -Wno-error=address \ # GCC 6.1.0 .if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 60100 -CWARNFLAGS+= -Wno-error=misleading-indentation \ - -Wno-error=nonnull-compare \ +CWARNFLAGS+= -Wno-error=nonnull-compare \ -Wno-error=shift-negative-value \ -Wno-error=tautological-compare \ -Wno-error=unused-const-variable Modified: stable/12/usr.bin/lex/Makefile ============================================================================== --- stable/12/usr.bin/lex/Makefile Tue Feb 4 19:35:40 2020 (r357520) +++ stable/12/usr.bin/lex/Makefile Tue Feb 4 19:42:57 2020 (r357521) @@ -32,6 +32,8 @@ MLINKS+= lex.1 lex++.1 WARNS?= 3 +NO_WMISLEADING_INDENTATION= + CLEANFILES= scan.c skel.c GENFILES= parse.c parse.h scan.c skel.c From owner-svn-src-all@freebsd.org Tue Feb 4 19:42:59 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2CF2E231BE0; Tue, 4 Feb 2020 19:42:59 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Bw8g0HVCz4Rbg; Tue, 4 Feb 2020 19:42:59 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 051EE1EF19; Tue, 4 Feb 2020 19:42:59 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014Jgwfp064262; Tue, 4 Feb 2020 19:42:58 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014Jgwgu064260; Tue, 4 Feb 2020 19:42:58 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202002041942.014Jgwgu064260@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 4 Feb 2020 19:42:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r357521 - in stable: 11/share/mk 11/usr.bin/lex 12/share/mk 12/usr.bin/lex X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/share/mk 11/usr.bin/lex 12/share/mk 12/usr.bin/lex X-SVN-Commit-Revision: 357521 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 19:42:59 -0000 Author: dim Date: Tue Feb 4 19:42:57 2020 New Revision: 357521 URL: https://svnweb.freebsd.org/changeset/base/357521 Log: MFC r357347: Merge r357345 from the clang1000-import branch: Disable new clang 10.0.0 warnings about misleading indentation in flex. As this is contributed code with very messy indentation, which will almost certainly never be upgraded, just disable the warning. Modified: stable/11/share/mk/bsd.sys.mk stable/11/usr.bin/lex/Makefile Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/share/mk/bsd.sys.mk stable/12/usr.bin/lex/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/11/share/mk/bsd.sys.mk ============================================================================== --- stable/11/share/mk/bsd.sys.mk Tue Feb 4 19:35:40 2020 (r357520) +++ stable/11/share/mk/bsd.sys.mk Tue Feb 4 19:42:57 2020 (r357521) @@ -104,6 +104,11 @@ CWARNFLAGS.clang+= -Wno-parentheses .if defined(NO_WARRAY_BOUNDS) CWARNFLAGS.clang+= -Wno-array-bounds .endif # NO_WARRAY_BOUNDS +.if defined(NO_WMISLEADING_INDENTATION) && \ + ((${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 100000) || \ + (${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 60100)) +CWARNFLAGS+= -Wno-misleading-indentation +.endif # NO_WMISLEADING_INDENTATION .endif # WARNS .if defined(FORMAT_AUDIT) @@ -146,8 +151,7 @@ CWARNFLAGS+= -Wno-error=address \ # GCC 6.1.0 .if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 60100 -CWARNFLAGS+= -Wno-error=misleading-indentation \ - -Wno-error=nonnull-compare \ +CWARNFLAGS+= -Wno-error=nonnull-compare \ -Wno-error=shift-negative-value \ -Wno-error=tautological-compare \ -Wno-error=unused-const-variable Modified: stable/11/usr.bin/lex/Makefile ============================================================================== --- stable/11/usr.bin/lex/Makefile Tue Feb 4 19:35:40 2020 (r357520) +++ stable/11/usr.bin/lex/Makefile Tue Feb 4 19:42:57 2020 (r357521) @@ -32,6 +32,8 @@ MLINKS+= lex.1 lex++.1 WARNS?= 3 +NO_WMISLEADING_INDENTATION= + CLEANFILES= scan.c skel.c GENFILES= parse.c parse.h scan.c skel.c From owner-svn-src-all@freebsd.org Tue Feb 4 19:46:08 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 95975231D27; Tue, 4 Feb 2020 19:46:08 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BwDJ4F04z4RsL; Tue, 4 Feb 2020 19:46:08 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C58B1EF1E; Tue, 4 Feb 2020 19:46:08 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014Jk8Rc064544; Tue, 4 Feb 2020 19:46:08 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014Jjq5j064523; Tue, 4 Feb 2020 19:45:52 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202002041945.014Jjq5j064523@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 4 Feb 2020 19:45:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357522 - in head/contrib/sqlite3: . tea tea/generic tea/win X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in head/contrib/sqlite3: . tea tea/generic tea/win X-SVN-Commit-Revision: 357522 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 19:46:08 -0000 Author: cy Date: Tue Feb 4 19:45:51 2020 New Revision: 357522 URL: https://svnweb.freebsd.org/changeset/base/357522 Log: Revert r357201: downgrade sqlite3 from sqlite3-3.31.0 (3310000) to sqlite3-3.30.1 (3300100), as it causes svnlite segfaults on PowerPC, resulting in corruption. Reported by: Mark Millard Francis Little Modified: head/contrib/sqlite3/Makefile.msc head/contrib/sqlite3/configure head/contrib/sqlite3/configure.ac head/contrib/sqlite3/shell.c head/contrib/sqlite3/sqlite3.c head/contrib/sqlite3/sqlite3.h head/contrib/sqlite3/sqlite3ext.h head/contrib/sqlite3/tea/configure head/contrib/sqlite3/tea/configure.ac head/contrib/sqlite3/tea/generic/tclsqlite3.c head/contrib/sqlite3/tea/win/makefile.vc Modified: head/contrib/sqlite3/Makefile.msc ============================================================================== --- head/contrib/sqlite3/Makefile.msc Tue Feb 4 19:42:57 2020 (r357521) +++ head/contrib/sqlite3/Makefile.msc Tue Feb 4 19:45:51 2020 (r357522) @@ -210,12 +210,6 @@ OPTIMIZATIONS = 2 SESSION = 0 !ENDIF -# Set this to non-0 to enable support for the rbu extension. -# -!IFNDEF RBU -RBU = 0 -!ENDIF - # Set the source code file to be used by executables and libraries when # they need the amalgamation. # @@ -288,6 +282,7 @@ OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENAB OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_STMTVTAB=1 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DBPAGE_VTAB=1 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DBSTAT_VTAB=1 +OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_INTROSPECTION_PRAGMAS=1 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DESERIALIZE=1 !ENDIF OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_COLUMN_METADATA=1 @@ -301,13 +296,6 @@ OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENAB OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_PREUPDATE_HOOK=1 !ENDIF -# Should the rbu extension be enabled? If so, add compilation options -# to enable it. -# -!IF $(RBU)!=0 -OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_RBU=1 -!ENDIF - # These are the "extended" SQLite compilation options used when compiling for # the Windows 10 platform. # @@ -990,7 +978,7 @@ Replace.exe: sqlite3.def: Replace.exe $(LIBOBJ) echo EXPORTS > sqlite3.def dumpbin /all $(LIBOBJ) \ - | .\Replace.exe "^\s+/EXPORT:_?(sqlite3(?:session|changeset|changegroup|rebaser|rbu)?_[^@,]*)(?:@\d+|,DATA)?$$" $$1 true \ + | .\Replace.exe "^\s+/EXPORT:_?(sqlite3(?:session|changeset|changegroup|rebaser)?_[^@,]*)(?:@\d+|,DATA)?$$" $$1 true \ | sort >> sqlite3.def $(SQLITE3EXE): shell.c $(SHELL_CORE_DEP) $(LIBRESOBJS) $(SHELL_CORE_SRC) $(SQLITE3H) Modified: head/contrib/sqlite3/configure ============================================================================== --- head/contrib/sqlite3/configure Tue Feb 4 19:42:57 2020 (r357521) +++ head/contrib/sqlite3/configure Tue Feb 4 19:45:51 2020 (r357522) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for sqlite 3.31.0. +# Generated by GNU Autoconf 2.69 for sqlite 3.30.1. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.31.0' -PACKAGE_STRING='sqlite 3.31.0' +PACKAGE_VERSION='3.30.1' +PACKAGE_STRING='sqlite 3.30.1' PACKAGE_BUGREPORT='http://www.sqlite.org' PACKAGE_URL='' @@ -1341,7 +1341,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sqlite 3.31.0 to adapt to many kinds of systems. +\`configure' configures sqlite 3.30.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1412,7 +1412,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sqlite 3.31.0:";; + short | recursive ) echo "Configuration of sqlite 3.30.1:";; esac cat <<\_ACEOF @@ -1537,7 +1537,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sqlite configure 3.31.0 +sqlite configure 3.30.1 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1952,7 +1952,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sqlite $as_me 3.31.0, which was +It was created by sqlite $as_me 3.30.1, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2818,7 +2818,7 @@ fi # Define the identity of the package. PACKAGE='sqlite' - VERSION='3.31.0' + VERSION='3.30.1' cat >>confdefs.h <<_ACEOF @@ -13653,7 +13653,7 @@ else fi if test x"$enable_rtree" = "xyes"; then - BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_GEOPOLY" + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_RTREE" fi #----------------------------------------------------------------------- @@ -14438,7 +14438,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sqlite $as_me 3.31.0, which was +This file was extended by sqlite $as_me 3.30.1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14495,7 +14495,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -sqlite config.status 3.31.0 +sqlite config.status 3.30.1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: head/contrib/sqlite3/configure.ac ============================================================================== --- head/contrib/sqlite3/configure.ac Tue Feb 4 19:42:57 2020 (r357521) +++ head/contrib/sqlite3/configure.ac Tue Feb 4 19:45:51 2020 (r357522) @@ -10,7 +10,7 @@ # AC_PREREQ(2.61) -AC_INIT(sqlite, 3.31.0, http://www.sqlite.org) +AC_INIT(sqlite, 3.30.1, http://www.sqlite.org) AC_CONFIG_SRCDIR([sqlite3.c]) AC_CONFIG_AUX_DIR([.]) @@ -161,7 +161,7 @@ AC_ARG_ENABLE(rtree, [AS_HELP_STRING( [--enable-rtree], [include rtree support [default=yes]])], [], [enable_rtree=yes]) if test x"$enable_rtree" = "xyes"; then - BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_GEOPOLY" + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_RTREE" fi #----------------------------------------------------------------------- Modified: head/contrib/sqlite3/shell.c ============================================================================== --- head/contrib/sqlite3/shell.c Tue Feb 4 19:42:57 2020 (r357521) +++ head/contrib/sqlite3/shell.c Tue Feb 4 19:45:51 2020 (r357522) @@ -2007,23 +2007,19 @@ int sqlite3_shathree_init( int rc = SQLITE_OK; SQLITE_EXTENSION_INIT2(pApi); (void)pzErrMsg; /* Unused parameter */ - rc = sqlite3_create_function(db, "sha3", 1, - SQLITE_UTF8 | SQLITE_INNOCUOUS | SQLITE_DETERMINISTIC, - 0, sha3Func, 0, 0); + rc = sqlite3_create_function(db, "sha3", 1, SQLITE_UTF8, 0, + sha3Func, 0, 0); if( rc==SQLITE_OK ){ - rc = sqlite3_create_function(db, "sha3", 2, - SQLITE_UTF8 | SQLITE_INNOCUOUS | SQLITE_DETERMINISTIC, - 0, sha3Func, 0, 0); + rc = sqlite3_create_function(db, "sha3", 2, SQLITE_UTF8, 0, + sha3Func, 0, 0); } if( rc==SQLITE_OK ){ - rc = sqlite3_create_function(db, "sha3_query", 1, - SQLITE_UTF8 | SQLITE_DIRECTONLY, - 0, sha3QueryFunc, 0, 0); + rc = sqlite3_create_function(db, "sha3_query", 1, SQLITE_UTF8, 0, + sha3QueryFunc, 0, 0); } if( rc==SQLITE_OK ){ - rc = sqlite3_create_function(db, "sha3_query", 2, - SQLITE_UTF8 | SQLITE_DIRECTONLY, - 0, sha3QueryFunc, 0, 0); + rc = sqlite3_create_function(db, "sha3_query", 2, SQLITE_UTF8, 0, + sha3QueryFunc, 0, 0); } return rc; } @@ -2617,7 +2613,6 @@ static int fsdirConnect( pNew = (fsdir_tab*)sqlite3_malloc( sizeof(*pNew) ); if( pNew==0 ) return SQLITE_NOMEM; memset(pNew, 0, sizeof(*pNew)); - sqlite3_vtab_config(db, SQLITE_VTAB_DIRECTONLY); } *ppVtab = (sqlite3_vtab*)pNew; return rc; @@ -3011,12 +3006,10 @@ int sqlite3_fileio_init( int rc = SQLITE_OK; SQLITE_EXTENSION_INIT2(pApi); (void)pzErrMsg; /* Unused parameter */ - rc = sqlite3_create_function(db, "readfile", 1, - SQLITE_UTF8|SQLITE_DIRECTONLY, 0, + rc = sqlite3_create_function(db, "readfile", 1, SQLITE_UTF8, 0, readfileFunc, 0, 0); if( rc==SQLITE_OK ){ - rc = sqlite3_create_function(db, "writefile", -1, - SQLITE_UTF8|SQLITE_DIRECTONLY, 0, + rc = sqlite3_create_function(db, "writefile", -1, SQLITE_UTF8, 0, writefileFunc, 0, 0); } if( rc==SQLITE_OK ){ @@ -3151,7 +3144,6 @@ static int completionConnect( #define COMPLETION_COLUMN_WHOLELINE 2 /* Entire line seen so far */ #define COMPLETION_COLUMN_PHASE 3 /* ePhase - used for debugging only */ - sqlite3_vtab_config(db, SQLITE_VTAB_INNOCUOUS); rc = sqlite3_declare_vtab(db, "CREATE TABLE x(" " candidate TEXT," @@ -4586,7 +4578,6 @@ static int zipfileConnect( zipfileDequote(pNew->zFile); } } - sqlite3_vtab_config(db, SQLITE_VTAB_DIRECTONLY); *ppVtab = (sqlite3_vtab*)pNew; return rc; } @@ -5199,25 +5190,25 @@ static int zipfileDeflate( u8 **ppOut, int *pnOut, /* Output */ char **pzErr /* OUT: Error message */ ){ - int rc = SQLITE_OK; - sqlite3_int64 nAlloc; - z_stream str; + sqlite3_int64 nAlloc = compressBound(nIn); u8 *aOut; + int rc = SQLITE_OK; - memset(&str, 0, sizeof(str)); - str.next_in = (Bytef*)aIn; - str.avail_in = nIn; - deflateInit2(&str, 9, Z_DEFLATED, -15, 8, Z_DEFAULT_STRATEGY); - - nAlloc = deflateBound(&str, nIn); aOut = (u8*)sqlite3_malloc64(nAlloc); if( aOut==0 ){ rc = SQLITE_NOMEM; }else{ int res; + z_stream str; + memset(&str, 0, sizeof(str)); + str.next_in = (Bytef*)aIn; + str.avail_in = nIn; str.next_out = aOut; str.avail_out = nAlloc; + + deflateInit2(&str, 9, Z_DEFLATED, -15, 8, Z_DEFAULT_STRATEGY); res = deflate(&str, Z_FINISH); + if( res==Z_STREAM_END ){ *ppOut = aOut; *pnOut = (int)str.total_out; @@ -5526,10 +5517,10 @@ static int zipfileBestIndex( idx = i; } } - pIdxInfo->estimatedCost = 1000.0; if( idx>=0 ){ pIdxInfo->aConstraintUsage[idx].argvIndex = 1; pIdxInfo->aConstraintUsage[idx].omit = 1; + pIdxInfo->estimatedCost = 1000.0; pIdxInfo->idxNum = 1; }else if( unusable ){ return SQLITE_CONSTRAINT; @@ -5651,8 +5642,8 @@ static int zipfileGetMode( ** identical, ignoring any trailing '/' character in either path. */ static int zipfileComparePath(const char *zA, const char *zB, int nB){ int nA = (int)strlen(zA); - if( nA>0 && zA[nA-1]=='/' ) nA--; - if( nB>0 && zB[nB-1]=='/' ) nB--; + if( zA[nA-1]=='/' ) nA--; + if( zB[nB-1]=='/' ) nB--; if( nA==nB && memcmp(zA, zB, nA)==0 ) return 0; return 1; } @@ -5662,10 +5653,6 @@ static int zipfileBegin(sqlite3_vtab *pVtab){ int rc = SQLITE_OK; assert( pTab->pWriteFd==0 ); - if( pTab->zFile==0 || pTab->zFile[0]==0 ){ - pTab->base.zErrMsg = sqlite3_mprintf("zipfile: missing filename"); - return SQLITE_ERROR; - } /* Open a write fd on the file. Also load the entire central directory ** structure into memory. During the transaction any new file data is @@ -5840,7 +5827,6 @@ static int zipfileUpdate( if( rc==SQLITE_OK ){ zPath = (const char*)sqlite3_value_text(apVal[2]); - if( zPath==0 ) zPath = ""; nPath = (int)strlen(zPath); mTime = zipfileGetTime(apVal[4]); } @@ -5850,15 +5836,11 @@ static int zipfileUpdate( ** '/'. This appears to be required for compatibility with info-zip ** (the unzip command on unix). It does not create directories ** otherwise. */ - if( nPath<=0 || zPath[nPath-1]!='/' ){ + if( zPath[nPath-1]!='/' ){ zFree = sqlite3_mprintf("%s/", zPath); + if( zFree==0 ){ rc = SQLITE_NOMEM; } zPath = (const char*)zFree; - if( zFree==0 ){ - rc = SQLITE_NOMEM; - nPath = 0; - }else{ - nPath = (int)strlen(zPath); - } + nPath++; } } @@ -6251,19 +6233,19 @@ void zipfileStep(sqlite3_context *pCtx, int nVal, sqli ** at the end of the path. Or, if this is not a directory and the path ** ends in '/' it is an error. */ if( bIsDir==0 ){ - if( nName>0 && zName[nName-1]=='/' ){ + if( zName[nName-1]=='/' ){ zErr = sqlite3_mprintf("non-directory name must not end with /"); rc = SQLITE_ERROR; goto zipfile_step_out; } }else{ - if( nName==0 || zName[nName-1]!='/' ){ + if( zName[nName-1]!='/' ){ zName = zFree = sqlite3_mprintf("%s/", zName); + nName++; if( zName==0 ){ rc = SQLITE_NOMEM; goto zipfile_step_out; } - nName = (int)strlen(zName); }else{ while( nName>1 && zName[nName-2]=='/' ) nName--; } @@ -6519,12 +6501,10 @@ int sqlite3_sqlar_init( int rc = SQLITE_OK; SQLITE_EXTENSION_INIT2(pApi); (void)pzErrMsg; /* Unused parameter */ - rc = sqlite3_create_function(db, "sqlar_compress", 1, - SQLITE_UTF8|SQLITE_INNOCUOUS, 0, + rc = sqlite3_create_function(db, "sqlar_compress", 1, SQLITE_UTF8, 0, sqlarCompressFunc, 0, 0); if( rc==SQLITE_OK ){ - rc = sqlite3_create_function(db, "sqlar_uncompress", 2, - SQLITE_UTF8|SQLITE_INNOCUOUS, 0, + rc = sqlite3_create_function(db, "sqlar_uncompress", 2, SQLITE_UTF8, 0, sqlarUncompressFunc, 0, 0); } return rc; @@ -6545,8 +6525,8 @@ int sqlite3_sqlar_init( ** ************************************************************************* */ -#if !defined(SQLITEEXPERT_H) -#define SQLITEEXPERT_H 1 + + /* #include "sqlite3.h" */ typedef struct sqlite3expert sqlite3expert; @@ -6700,8 +6680,8 @@ const char *sqlite3_expert_report(sqlite3expert*, int */ void sqlite3_expert_destroy(sqlite3expert*); -#endif /* !defined(SQLITEEXPERT_H) */ + /************************* End ../ext/expert/sqlite3expert.h ********************/ /************************* Begin ../ext/expert/sqlite3expert.c ******************/ /* @@ -9586,7 +9566,6 @@ struct ShellState { int outCount; /* Revert to stdout when reaching zero */ int cnt; /* Number of records displayed so far */ int lineno; /* Line number of last line read from in */ - int openFlags; /* Additional flags to open. (SQLITE_OPEN_NOFOLLOW) */ FILE *in; /* Read commands from this stream */ FILE *out; /* Write results here */ FILE *traceOut; /* Output for sqlite3_trace() */ @@ -10421,22 +10400,19 @@ static int shell_callback( const int *colWidth; int showHdr; char *rowSep; - int nWidth; if( p->cMode==MODE_Column ){ colWidth = p->colWidth; - nWidth = ArraySize(p->colWidth); showHdr = p->showHeader; rowSep = p->rowSeparator; }else{ colWidth = aExplainWidths; - nWidth = ArraySize(aExplainWidths); showHdr = 1; rowSep = SEP_Row; } if( p->cnt++==0 ){ for(i=0; icolWidth) ){ w = colWidth[i]; }else{ w = 0; @@ -11326,9 +11302,6 @@ static void restore_debug_trace_modes(void){ /* Create the TEMP table used to store parameter bindings */ static void bind_table_init(ShellState *p){ int wrSchema = 0; - int defensiveMode = 0; - sqlite3_db_config(p->db, SQLITE_DBCONFIG_DEFENSIVE, -1, &defensiveMode); - sqlite3_db_config(p->db, SQLITE_DBCONFIG_DEFENSIVE, 0, 0); sqlite3_db_config(p->db, SQLITE_DBCONFIG_WRITABLE_SCHEMA, -1, &wrSchema); sqlite3_db_config(p->db, SQLITE_DBCONFIG_WRITABLE_SCHEMA, 1, 0); sqlite3_exec(p->db, @@ -11338,7 +11311,6 @@ static void bind_table_init(ShellState *p){ ") WITHOUT ROWID;", 0, 0, 0); sqlite3_db_config(p->db, SQLITE_DBCONFIG_WRITABLE_SCHEMA, wrSchema, 0); - sqlite3_db_config(p->db, SQLITE_DBCONFIG_DEFENSIVE, defensiveMode, 0); } /* @@ -12081,7 +12053,9 @@ static const char *(azHelp[]) = { ".excel Display the output of next command in spreadsheet", ".exit ?CODE? Exit this program with return-code CODE", ".expert EXPERIMENTAL. Suggest indexes for queries", - ".explain ?on|off|auto? Change the EXPLAIN formatting mode. Default: auto", +/* Because explain mode comes on automatically now, the ".explain" mode +** is removed from the help screen. It is still supported for legacy, however */ +/*".explain ?on|off|auto? Turn EXPLAIN output mode on or off",*/ ".filectrl CMD ... Run various sqlite3_file_control() operations", " Run \".filectrl\" with no arguments for details", ".fullschema ?--indent? Show schema and the content of sqlite_stat tables", @@ -12132,7 +12106,6 @@ static const char *(azHelp[]) = { " --maxsize N Maximum size for --hexdb or --deserialized database", #endif " --new Initialize FILE to an empty database", - " --nofollow Do not follow symbolic links", " --readonly Open FILE readonly", " --zip FILE is a ZIP archive", ".output ?FILE? Send output to FILE or stdout if FILE is omitted", @@ -12697,7 +12670,7 @@ static void open_db(ShellState *p, int openFlags){ switch( p->openMode ){ case SHELL_OPEN_APPENDVFS: { sqlite3_open_v2(p->zDbFilename, &p->db, - SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE|p->openFlags, "apndvfs"); + SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE, "apndvfs"); break; } case SHELL_OPEN_HEXDB: @@ -12710,14 +12683,12 @@ static void open_db(ShellState *p, int openFlags){ break; } case SHELL_OPEN_READONLY: { - sqlite3_open_v2(p->zDbFilename, &p->db, - SQLITE_OPEN_READONLY|p->openFlags, 0); + sqlite3_open_v2(p->zDbFilename, &p->db, SQLITE_OPEN_READONLY, 0); break; } case SHELL_OPEN_UNSPEC: case SHELL_OPEN_NORMAL: { - sqlite3_open_v2(p->zDbFilename, &p->db, - SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE|p->openFlags, 0); + sqlite3_open(p->zDbFilename, &p->db); break; } } @@ -13491,7 +13462,7 @@ static unsigned int get4byteInt(unsigned char *a){ } /* -** Implementation of the ".dbinfo" command. +** Implementation of the ".info" command. ** ** Return 1 on error, 2 to exit, and 0 otherwise. */ @@ -15728,22 +15699,20 @@ static int do_meta_command(char *zLine, ShellState *p) const char *zName; int op; } aDbConfig[] = { - { "defensive", SQLITE_DBCONFIG_DEFENSIVE }, - { "dqs_ddl", SQLITE_DBCONFIG_DQS_DDL }, - { "dqs_dml", SQLITE_DBCONFIG_DQS_DML }, { "enable_fkey", SQLITE_DBCONFIG_ENABLE_FKEY }, - { "enable_qpsg", SQLITE_DBCONFIG_ENABLE_QPSG }, { "enable_trigger", SQLITE_DBCONFIG_ENABLE_TRIGGER }, { "enable_view", SQLITE_DBCONFIG_ENABLE_VIEW }, { "fts3_tokenizer", SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER }, - { "legacy_alter_table", SQLITE_DBCONFIG_LEGACY_ALTER_TABLE }, - { "legacy_file_format", SQLITE_DBCONFIG_LEGACY_FILE_FORMAT }, { "load_extension", SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION }, { "no_ckpt_on_close", SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE }, - { "reset_database", SQLITE_DBCONFIG_RESET_DATABASE }, + { "enable_qpsg", SQLITE_DBCONFIG_ENABLE_QPSG }, { "trigger_eqp", SQLITE_DBCONFIG_TRIGGER_EQP }, - { "trusted_schema", SQLITE_DBCONFIG_TRUSTED_SCHEMA }, + { "reset_database", SQLITE_DBCONFIG_RESET_DATABASE }, + { "defensive", SQLITE_DBCONFIG_DEFENSIVE }, { "writable_schema", SQLITE_DBCONFIG_WRITABLE_SCHEMA }, + { "legacy_alter_table", SQLITE_DBCONFIG_LEGACY_ALTER_TABLE }, + { "dqs_dml", SQLITE_DBCONFIG_DQS_DML }, + { "dqs_ddl", SQLITE_DBCONFIG_DQS_DDL }, }; int ii, v; open_db(p, 0); @@ -15753,7 +15722,7 @@ static int do_meta_command(char *zLine, ShellState *p) sqlite3_db_config(p->db, aDbConfig[ii].op, booleanValue(azArg[2]), 0); } sqlite3_db_config(p->db, aDbConfig[ii].op, -1, &v); - utf8_printf(p->out, "%19s %s\n", aDbConfig[ii].zName, v ? "on" : "off"); + utf8_printf(p->out, "%18s %s\n", aDbConfig[ii].zName, v ? "on" : "off"); if( nArg>1 ) break; } if( nArg>1 && ii==ArraySize(aDbConfig) ){ @@ -16334,19 +16303,10 @@ static int do_meta_command(char *zLine, ShellState *p) char *zCollist = 0; sqlite3_stmt *pStmt; int tnum = 0; - int isWO = 0; /* True if making an imposter of a WITHOUT ROWID table */ - int lenPK = 0; /* Length of the PRIMARY KEY string for isWO tables */ int i; if( !(nArg==3 || (nArg==2 && sqlite3_stricmp(azArg[1],"off")==0)) ){ utf8_printf(stderr, "Usage: .imposter INDEX IMPOSTER\n" " .imposter off\n"); - /* Also allowed, but not documented: - ** - ** .imposter TABLE IMPOSTER - ** - ** where TABLE is a WITHOUT ROWID table. In that case, the - ** imposter is another WITHOUT ROWID table with the columns in - ** storage order. */ rc = 1; goto meta_command_exit; } @@ -16355,22 +16315,19 @@ static int do_meta_command(char *zLine, ShellState *p) sqlite3_test_control(SQLITE_TESTCTRL_IMPOSTER, p->db, "main", 0, 1); goto meta_command_exit; } - zSql = sqlite3_mprintf( - "SELECT rootpage, 0 FROM sqlite_master" - " WHERE name='%q' AND type='index'" - "UNION ALL " - "SELECT rootpage, 1 FROM sqlite_master" - " WHERE name='%q' AND type='table'" - " AND sql LIKE '%%without%%rowid%%'", - azArg[1], azArg[1] - ); + zSql = sqlite3_mprintf("SELECT rootpage FROM sqlite_master" + " WHERE name='%q' AND type='index'", azArg[1]); sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0); sqlite3_free(zSql); if( sqlite3_step(pStmt)==SQLITE_ROW ){ tnum = sqlite3_column_int(pStmt, 0); - isWO = sqlite3_column_int(pStmt, 1); } sqlite3_finalize(pStmt); + if( tnum==0 ){ + utf8_printf(stderr, "no such index: \"%s\"\n", azArg[1]); + rc = 1; + goto meta_command_exit; + } zSql = sqlite3_mprintf("PRAGMA index_xinfo='%q'", azArg[1]); rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0); sqlite3_free(zSql); @@ -16387,9 +16344,6 @@ static int do_meta_command(char *zLine, ShellState *p) zCol = zLabel; } } - if( isWO && lenPK==0 && sqlite3_column_int(pStmt,5)==0 && zCollist ){ - lenPK = (int)strlen(zCollist); - } if( zCollist==0 ){ zCollist = sqlite3_mprintf("\"%w\"", zCol); }else{ @@ -16397,16 +16351,9 @@ static int do_meta_command(char *zLine, ShellState *p) } } sqlite3_finalize(pStmt); - if( i==0 || tnum==0 ){ - utf8_printf(stderr, "no such index: \"%s\"\n", azArg[1]); - rc = 1; - sqlite3_free(zCollist); - goto meta_command_exit; - } - if( lenPK==0 ) lenPK = 100000; zSql = sqlite3_mprintf( - "CREATE TABLE \"%w\"(%s,PRIMARY KEY(%.*s))WITHOUT ROWID", - azArg[2], zCollist, lenPK, zCollist); + "CREATE TABLE \"%w\"(%s,PRIMARY KEY(%s))WITHOUT ROWID", + azArg[2], zCollist, zCollist); sqlite3_free(zCollist); rc = sqlite3_test_control(SQLITE_TESTCTRL_IMPOSTER, p->db, "main", 1, tnum); if( rc==SQLITE_OK ){ @@ -16417,8 +16364,7 @@ static int do_meta_command(char *zLine, ShellState *p) }else{ utf8_printf(stdout, "%s;\n", zSql); raw_printf(stdout, - "WARNING: writing to an imposter table will corrupt the \"%s\" %s!\n", - azArg[1], isWO ? "table" : "index" + "WARNING: writing to an imposter table will corrupt the index!\n" ); } }else{ @@ -16616,7 +16562,6 @@ static int do_meta_command(char *zLine, ShellState *p) sqlite3_free(p->zFreeOnClose); p->zFreeOnClose = 0; p->openMode = SHELL_OPEN_UNSPEC; - p->openFlags = 0; p->szMax = 0; /* Check for command-line arguments */ for(iName=1; iNameopenMode = SHELL_OPEN_APPENDVFS; }else if( optionMatch(z, "readonly") ){ p->openMode = SHELL_OPEN_READONLY; - }else if( optionMatch(z, "nofollow") ){ - p->openFlags |= SQLITE_OPEN_NOFOLLOW; #ifdef SQLITE_ENABLE_DESERIALIZE }else if( optionMatch(z, "deserialize") ){ p->openMode = SHELL_OPEN_DESERIALIZE; @@ -17789,7 +17732,7 @@ static int do_meta_command(char *zLine, ShellState *p) { "extra_schema_checks",SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS,"BOOLEAN" }, /*{ "fault_install", SQLITE_TESTCTRL_FAULT_INSTALL, "" },*/ { "imposter", SQLITE_TESTCTRL_IMPOSTER, "SCHEMA ON/OFF ROOTPAGE"}, - { "internal_functions", SQLITE_TESTCTRL_INTERNAL_FUNCTIONS, "" }, + { "internal_functions", SQLITE_TESTCTRL_INTERNAL_FUNCTIONS, "BOOLEAN" }, { "localtime_fault", SQLITE_TESTCTRL_LOCALTIME_FAULT,"BOOLEAN" }, { "never_corrupt", SQLITE_TESTCTRL_NEVER_CORRUPT, "BOOLEAN" }, { "optimizations", SQLITE_TESTCTRL_OPTIMIZATIONS, "DISABLE-MASK" }, @@ -17905,6 +17848,7 @@ static int do_meta_command(char *zLine, ShellState *p) /* sqlite3_test_control(int, int) */ case SQLITE_TESTCTRL_ASSERT: case SQLITE_TESTCTRL_ALWAYS: + case SQLITE_TESTCTRL_INTERNAL_FUNCTIONS: if( nArg==3 ){ int opt = booleanValue(azArg[2]); rc2 = sqlite3_test_control(testctrl, opt); @@ -17922,12 +17866,6 @@ static int do_meta_command(char *zLine, ShellState *p) } break; - /* sqlite3_test_control(sqlite3*) */ - case SQLITE_TESTCTRL_INTERNAL_FUNCTIONS: - rc2 = sqlite3_test_control(testctrl, p->db); - isOk = 3; - break; - case SQLITE_TESTCTRL_IMPOSTER: if( nArg==5 ){ rc2 = sqlite3_test_control(testctrl, p->db, @@ -18558,7 +18496,6 @@ static const char zOptions[] = " -multiplex enable the multiplexor VFS\n" #endif " -newline SEP set output row separator. Default: '\\n'\n" - " -nofollow refuse to open symbolic links to database files\n" " -nullvalue TEXT set text string for NULL values. Default ''\n" " -pagecache SIZE N use N slots of SZ bytes each for page cache memory\n" " -quote set output mode to 'quote'\n" @@ -18869,8 +18806,6 @@ int SQLITE_CDECL wmain(int argc, wchar_t **wargv){ #endif }else if( strcmp(z,"-readonly")==0 ){ data.openMode = SHELL_OPEN_READONLY; - }else if( strcmp(z,"-nofollow")==0 ){ - data.openFlags = SQLITE_OPEN_NOFOLLOW; #if !defined(SQLITE_OMIT_VIRTUALTABLE) && defined(SQLITE_HAVE_ZLIB) }else if( strncmp(z, "-A",2)==0 ){ /* All remaining command-line arguments are passed to the ".archive" @@ -18974,8 +18909,6 @@ int SQLITE_CDECL wmain(int argc, wchar_t **wargv){ #endif }else if( strcmp(z,"-readonly")==0 ){ data.openMode = SHELL_OPEN_READONLY; - }else if( strcmp(z,"-nofollow")==0 ){ - data.openFlags |= SQLITE_OPEN_NOFOLLOW; }else if( strcmp(z,"-ascii")==0 ){ data.mode = MODE_Ascii; sqlite3_snprintf(sizeof(data.colSeparator), data.colSeparator, Modified: head/contrib/sqlite3/sqlite3.c ============================================================================== --- head/contrib/sqlite3/sqlite3.c Tue Feb 4 19:42:57 2020 (r357521) +++ head/contrib/sqlite3/sqlite3.c Tue Feb 4 19:45:51 2020 (r357522) @@ -1,6 +1,6 @@ /****************************************************************************** ** This file is an amalgamation of many separate C source files from SQLite -** version 3.31.0. By combining all the individual C code files into this +** version 3.30.1. By combining all the individual C code files into this ** single large file, the entire code can be compiled as a single translation ** unit. This allows many compilers to do optimizations that would not be ** possible if the files were compiled separately. Performance improvements @@ -1165,9 +1165,9 @@ extern "C" { ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ -#define SQLITE_VERSION "3.31.0" -#define SQLITE_VERSION_NUMBER 3031000 -#define SQLITE_SOURCE_ID "2020-01-22 18:38:59 f6affdd41608946fcfcea914ece149038a8b25a62bbe719ed2561c649b86d824" +#define SQLITE_VERSION "3.30.1" +#define SQLITE_VERSION_NUMBER 3030001 +#define SQLITE_SOURCE_ID "2019-10-10 20:19:45 18db032d058f1436ce3dea84081f4ee5a0f2259ad97301d43c426bc7f3df1b0b" /* ** CAPI3REF: Run-Time Library Version Numbers @@ -1558,7 +1558,6 @@ SQLITE_API int sqlite3_exec( #define SQLITE_CANTOPEN_FULLPATH (SQLITE_CANTOPEN | (3<<8)) #define SQLITE_CANTOPEN_CONVPATH (SQLITE_CANTOPEN | (4<<8)) #define SQLITE_CANTOPEN_DIRTYWAL (SQLITE_CANTOPEN | (5<<8)) /* Not Used */ -#define SQLITE_CANTOPEN_SYMLINK (SQLITE_CANTOPEN | (6<<8)) #define SQLITE_CORRUPT_VTAB (SQLITE_CORRUPT | (1<<8)) #define SQLITE_CORRUPT_SEQUENCE (SQLITE_CORRUPT | (2<<8)) #define SQLITE_READONLY_RECOVERY (SQLITE_READONLY | (1<<8)) @@ -1578,13 +1577,11 @@ SQLITE_API int sqlite3_exec( #define SQLITE_CONSTRAINT_UNIQUE (SQLITE_CONSTRAINT | (8<<8)) #define SQLITE_CONSTRAINT_VTAB (SQLITE_CONSTRAINT | (9<<8)) #define SQLITE_CONSTRAINT_ROWID (SQLITE_CONSTRAINT |(10<<8)) -#define SQLITE_CONSTRAINT_PINNED (SQLITE_CONSTRAINT |(11<<8)) #define SQLITE_NOTICE_RECOVER_WAL (SQLITE_NOTICE | (1<<8)) #define SQLITE_NOTICE_RECOVER_ROLLBACK (SQLITE_NOTICE | (2<<8)) #define SQLITE_WARNING_AUTOINDEX (SQLITE_WARNING | (1<<8)) #define SQLITE_AUTH_USER (SQLITE_AUTH | (1<<8)) #define SQLITE_OK_LOAD_PERMANENTLY (SQLITE_OK | (1<<8)) -#define SQLITE_OK_SYMLINK (SQLITE_OK | (2<<8)) /* ** CAPI3REF: Flags For File Open Operations @@ -1613,7 +1610,6 @@ SQLITE_API int sqlite3_exec( #define SQLITE_OPEN_SHAREDCACHE 0x00020000 /* Ok for sqlite3_open_v2() */ #define SQLITE_OPEN_PRIVATECACHE 0x00040000 /* Ok for sqlite3_open_v2() */ #define SQLITE_OPEN_WAL 0x00080000 /* VFS only */ -#define SQLITE_OPEN_NOFOLLOW 0x01000000 /* Ok for sqlite3_open_v2() */ /* Reserved: 0x00F00000 */ @@ -2025,16 +2021,16 @@ struct sqlite3_io_methods { ** ^The [SQLITE_FCNTL_BUSYHANDLER] ** file-control may be invoked by SQLite on the database file handle ** shortly after it is opened in order to provide a custom VFS with access -** to the connection's busy-handler callback. The argument is of type (void**) +** to the connections busy-handler callback. The argument is of type (void **) ** - an array of two (void *) values. The first (void *) actually points -** to a function of type (int (*)(void *)). In order to invoke the connection's +** to a function of type (int (*)(void *)). In order to invoke the connections ** busy-handler, this function should be invoked with the second (void *) in ** the array as the only argument. If it returns non-zero, then the operation ** should be retried. If it returns zero, the custom VFS should abandon the ** current operation. ** **
  • [[SQLITE_FCNTL_TEMPFILENAME]] -** ^Applications can invoke the [SQLITE_FCNTL_TEMPFILENAME] file-control +** ^Application can invoke the [SQLITE_FCNTL_TEMPFILENAME] file-control ** to have SQLite generate a ** temporary filename using the same algorithm that is followed to generate ** temporary filenames for TEMP tables and other internal uses. The @@ -2147,18 +2143,12 @@ struct sqlite3_io_methods { ** not provide a mechanism to detect changes to MAIN only. Also, the ** [sqlite3_total_changes()] interface responds to internal changes only and ** omits changes made by other database connections. The -** [PRAGMA data_version] command provides a mechanism to detect changes to +** [PRAGMA data_version] command provide a mechanism to detect changes to ** a single attached database that occur due to other database connections, ** but omits changes implemented by the database connection on which it is ** called. This file control is the only mechanism to detect changes that ** happen either internally or externally and that are associated with ** a particular attached database. -** -**
  • [[SQLITE_FCNTL_CKPT_DONE]] -** The [SQLITE_FCNTL_CKPT_DONE] opcode is invoked from within a checkpoint -** in wal mode after the client has finished copying pages from the wal -** file to the database file, but before the *-shm file is updated to -** record the fact that the pages have been checkpointed. ** */ #define SQLITE_FCNTL_LOCKSTATE 1 @@ -2196,7 +2186,6 @@ struct sqlite3_io_methods { #define SQLITE_FCNTL_LOCK_TIMEOUT 34 #define SQLITE_FCNTL_DATA_VERSION 35 #define SQLITE_FCNTL_SIZE_LIMIT 36 -#define SQLITE_FCNTL_CKPT_DONE 37 /* deprecated names */ #define SQLITE_GET_LOCKPROXYFILE SQLITE_FCNTL_GET_LOCKPROXYFILE @@ -2242,10 +2231,10 @@ typedef struct sqlite3_api_routines sqlite3_api_routin ** to 3 with SQLite [version 3.7.6] on [dateof:3.7.6]. Additional fields ** may be appended to the sqlite3_vfs object and the iVersion value ** may increase again in future versions of SQLite. -** Note that due to an oversight, the structure -** of the sqlite3_vfs object changed in the transition from +** Note that the structure +** of the sqlite3_vfs object changes in the transition from ** SQLite [version 3.5.9] to [version 3.6.0] on [dateof:3.6.0] -** and yet the iVersion field was not increased. +** and yet the iVersion field was not modified. ** ** The szOsFile field is the size of the subclassed [sqlite3_file] ** structure used by this VFS. mxPathname is the maximum length of @@ -2336,7 +2325,7 @@ typedef struct sqlite3_api_routines sqlite3_api_routin ** for exclusive access. ** ** ^At least szOsFile bytes of memory are allocated by SQLite -** to hold the [sqlite3_file] structure passed as the third +** to hold the [sqlite3_file] structure passed as the third ** argument to xOpen. The xOpen method does not have to ** allocate the structure; it should just fill it in. Note that ** the xOpen method must set the sqlite3_file.pMethods to either @@ -2673,7 +2662,7 @@ SQLITE_API int sqlite3_db_config(sqlite3*, int op, ... ** that causes the corresponding memory allocation to fail. ** ** The xInit method initializes the memory allocator. For example, -** it might allocate any required mutexes or initialize internal data +** it might allocate any require mutexes or initialize internal data ** structures. The xShutdown method is invoked (indirectly) by ** [sqlite3_shutdown()] and should deallocate any resources acquired ** by xInit. The pAppData pointer is used as the only parameter to @@ -2795,7 +2784,6 @@ struct sqlite3_mem_methods { ** memory allocation statistics. ^(When memory allocation statistics are ** disabled, the following SQLite interfaces become non-operational: **
      -**
    • [sqlite3_hard_heap_limit64()] **
    • [sqlite3_memory_used()] **
    • [sqlite3_memory_highwater()] **
    • [sqlite3_soft_heap_limit64()] @@ -2814,7 +2802,7 @@ struct sqlite3_mem_methods { **
      ^The SQLITE_CONFIG_PAGECACHE option specifies a memory pool ** that SQLite can use for the database page cache with the default page ** cache implementation. -** This configuration option is a no-op if an application-defined page +** This configuration option is a no-op if an application-define page ** cache implementation is loaded using the [SQLITE_CONFIG_PCACHE2]. ** ^There are three arguments to SQLITE_CONFIG_PAGECACHE: A pointer to ** 8-byte aligned memory (pMem), the size of each page cache line (sz), @@ -3299,7 +3287,7 @@ struct sqlite3_mem_methods { ** [[SQLITE_DBCONFIG_DQS_DML]] **
      SQLITE_DBCONFIG_DQS_DML **
      The SQLITE_DBCONFIG_DQS_DML option activates or deactivates -** the legacy [double-quoted string literal] misfeature for DML statements +** the legacy [double-quoted string literal] misfeature for DML statement ** only, that is DELETE, INSERT, SELECT, and UPDATE statements. The ** default value of this setting is determined by the [-DSQLITE_DQS] ** compile-time option. @@ -3313,49 +3301,6 @@ struct sqlite3_mem_methods { ** default value of this setting is determined by the [-DSQLITE_DQS] ** compile-time option. **
      -** -** [[SQLITE_DBCONFIG_TRUSTED_SCHEMA]] -**
      SQLITE_DBCONFIG_TRUSTED_SCHEMA -**
      The SQLITE_DBCONFIG_TRUSTED_SCHEMA option tells SQLite to -** assume that database schemas (the contents of the [sqlite_master] tables) -** are untainted by malicious content. -** When the SQLITE_DBCONFIG_TRUSTED_SCHEMA option is disabled, SQLite -** takes additional defensive steps to protect the application from harm -** including: -**
        -**
      • Prohibit the use of SQL functions inside triggers, views, -** CHECK constraints, DEFAULT clauses, expression indexes, -** partial indexes, or generated columns -** unless those functions are tagged with [SQLITE_INNOCUOUS]. -**
      • Prohibit the use of virtual tables inside of triggers or views -** unless those virtual tables are tagged with [SQLITE_VTAB_INNOCUOUS]. -**
      -** This setting defaults to "on" for legacy compatibility, however -** all applications are advised to turn it off if possible. This setting -** can also be controlled using the [PRAGMA trusted_schema] statement. -**
      -** -** [[SQLITE_DBCONFIG_LEGACY_FILE_FORMAT]] -**
      SQLITE_DBCONFIG_LEGACY_FILE_FORMAT -**
      The SQLITE_DBCONFIG_LEGACY_FILE_FORMAT option activates or deactivates -** the legacy file format flag. When activated, this flag causes all newly -** created database file to have a schema format version number (the 4-byte -** integer found at offset 44 into the database header) of 1. This in turn -** means that the resulting database file will be readable and writable by -** any SQLite version back to 3.0.0 ([dateof:3.0.0]). Without this setting, -** newly created databases are generally not understandable by SQLite versions -** prior to 3.3.0 ([dateof:3.3.0]). As these words are written, there -** is now scarcely any need to generated database files that are compatible -** all the way back to version 3.0.0, and so this setting is of little -** practical use, but is provided so that SQLite can continue to claim the -** ability to generate new database files that are compatible with version -** 3.0.0. -**

      Note that when the SQLITE_DBCONFIG_LEGACY_FILE_FORMAT setting is on, -** the [VACUUM] command will fail with an obscure error when attempting to -** process a table with generated columns and a descending index. This is -** not considered a bug since SQLite versions 3.3.0 and earlier do not support -** either generated columns or decending indexes. -**

      ** */ #define SQLITE_DBCONFIG_MAINDBNAME 1000 /* const char* */ @@ -3374,9 +3319,7 @@ struct sqlite3_mem_methods { #define SQLITE_DBCONFIG_DQS_DML 1013 /* int int* */ #define SQLITE_DBCONFIG_DQS_DDL 1014 /* int int* */ #define SQLITE_DBCONFIG_ENABLE_VIEW 1015 /* int int* */ -#define SQLITE_DBCONFIG_LEGACY_FILE_FORMAT 1016 /* int int* */ -#define SQLITE_DBCONFIG_TRUSTED_SCHEMA 1017 /* int int* */ -#define SQLITE_DBCONFIG_MAX 1017 /* Largest DBCONFIG */ +#define SQLITE_DBCONFIG_MAX 1015 /* Largest DBCONFIG */ /* ** CAPI3REF: Enable Or Disable Extended Result Codes @@ -3582,7 +3525,7 @@ SQLITE_API int sqlite3_total_changes(sqlite3*); ** ^The sqlite3_interrupt(D) call is in effect until all currently running ** SQL statements on [database connection] D complete. ^Any new SQL statements ** that are started after the sqlite3_interrupt() call and before the -** running statement count reaches zero are interrupted as if they had been +** running statements reaches zero are interrupted as if they had been ** running prior to the sqlite3_interrupt() call. ^New SQL statements ** that are started after the running statement count reaches zero are ** not effected by the sqlite3_interrupt(). @@ -3750,9 +3693,9 @@ SQLITE_API int sqlite3_busy_timeout(sqlite3*, int ms); ** Cindy | 21 ** ** -** There are two columns (M==2) and three rows (N==3). Thus the +** There are two column (M==2) and three rows (N==3). Thus the ** result table has 8 entries. Suppose the result table is stored -** in an array named azResult. Then azResult holds this content: +** in an array names azResult. Then azResult holds this content: ** **
       **        azResult[0] = "Name";
      @@ -3845,7 +3788,7 @@ SQLITE_API char *sqlite3_vsnprintf(int,char*,const cha
       **
       ** The SQLite core uses these three routines for all of its own
       ** internal memory allocation needs. "Core" in the previous sentence
      -** does not include operating-system specific [VFS] implementation.  The
      +** does not include operating-system specific VFS implementation.  The
       ** Windows VFS uses native malloc() and free() for some operations.
       **
       ** ^The sqlite3_malloc() routine returns a pointer to a block
      @@ -3906,6 +3849,19 @@ SQLITE_API char *sqlite3_vsnprintf(int,char*,const cha
       ** 4 byte boundary if the [SQLITE_4_BYTE_ALIGNED_MALLOC] compile-time
       ** option is used.
       **
      +** In SQLite version 3.5.0 and 3.5.1, it was possible to define
      +** the SQLITE_OMIT_MEMORY_ALLOCATION which would cause the built-in
      +** implementation of these routines to be omitted.  That capability
      +** is no longer provided.  Only built-in memory allocators can be used.
      +**
      +** Prior to SQLite version 3.7.10, the Windows OS interface layer called
      +** the system malloc() and free() directly when converting
      +** filenames between the UTF-8 encoding used by SQLite
      +** and whatever filename encoding is used by the particular Windows
      +** installation.  Memory allocation errors were detected, but
      +** they were reported back as [SQLITE_CANTOPEN] or
      +** [SQLITE_IOERR] rather than [SQLITE_NOMEM].
      +**
       ** The pointer arguments to [sqlite3_free()] and [sqlite3_realloc()]
       ** must be either NULL or else pointers obtained from a prior
       ** invocation of [sqlite3_malloc()] or [sqlite3_realloc()] that have
      @@ -3954,7 +3910,7 @@ SQLITE_API sqlite3_int64 sqlite3_memory_highwater(int 
       ** SQLite contains a high-quality pseudo-random number generator (PRNG) used to
       ** select random [ROWID | ROWIDs] when inserting new records into a table that
       ** already uses the largest possible [ROWID].  The PRNG is also used for
      -** the built-in random() and randomblob() SQL functions.  This interface allows
      +** the build-in random() and randomblob() SQL functions.  This interface allows
       ** applications to access the same PRNG for other purposes.
       **
       ** ^A call to this routine stores N bytes of randomness into buffer P.
      @@ -4328,8 +4284,10 @@ SQLITE_API void sqlite3_progress_handler(sqlite3*, int
       ** The sqlite3_open_v2() interface works like sqlite3_open()
       ** except that it accepts two additional parameters for additional control
       ** over the new database connection.  ^(The flags parameter to
      -** sqlite3_open_v2() must include, at a minimum, one of the following
      -** three flag combinations:)^
      +** sqlite3_open_v2() can take one of
      +** the following three values, optionally combined with the 
      +** [SQLITE_OPEN_NOMUTEX], [SQLITE_OPEN_FULLMUTEX], [SQLITE_OPEN_SHAREDCACHE],
      +** [SQLITE_OPEN_PRIVATECACHE], and/or [SQLITE_OPEN_URI] flags:)^
       **
       ** 
      ** ^(
      [SQLITE_OPEN_READONLY]
      @@ -4347,51 +4305,23 @@ SQLITE_API void sqlite3_progress_handler(sqlite3*, int ** sqlite3_open() and sqlite3_open16().)^ **
      ** -** In addition to the required flags, the following optional flags are -** also supported: -** -**
      -** ^(
      [SQLITE_OPEN_URI]
      -**
      The filename can be interpreted as a URI if this flag is set.
      )^ -** -** ^(
      [SQLITE_OPEN_MEMORY]
      -**
      The database will be opened as an in-memory database. The database -** is named by the "filename" argument for the purposes of cache-sharing, -** if shared cache mode is enabled, but the "filename" is otherwise ignored. -**
      )^ -** *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Feb 4 19:46:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A5C43231DB9; Tue, 4 Feb 2020 19:46:29 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BwDj3xvTz4S28; Tue, 4 Feb 2020 19:46:29 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8224A1EF20; Tue, 4 Feb 2020 19:46:29 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014JkTb8064608; Tue, 4 Feb 2020 19:46:29 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014JkT5J064607; Tue, 4 Feb 2020 19:46:29 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202002041946.014JkT5J064607@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 4 Feb 2020 19:46:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357523 - in stable: 10/usr.sbin/bsnmpd/modules/snmp_pf 11/usr.sbin/bsnmpd/modules/snmp_pf 12/usr.sbin/bsnmpd/modules/snmp_pf X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 10/usr.sbin/bsnmpd/modules/snmp_pf 11/usr.sbin/bsnmpd/modules/snmp_pf 12/usr.sbin/bsnmpd/modules/snmp_pf X-SVN-Commit-Revision: 357523 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 19:46:29 -0000 Author: dim Date: Tue Feb 4 19:46:29 2020 New Revision: 357523 URL: https://svnweb.freebsd.org/changeset/base/357523 Log: MFC r357340: Merge r357339 from the clang1000-import branch: Fix the following -Werror warning from clang 10.0.0 in bsnmpd: usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c:1661:4: error: misleading indentation; statement is not part of the previous 'else' [-Werror,-Wmisleading-indentation] return (-1); ^ usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c:1658:5: note: previous statement is here } else ^ The intent was to group the return statement with the previous syslog() call. Modified: stable/12/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c stable/11/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c Directory Properties: stable/10/ (props changed) stable/11/ (props changed) Modified: stable/12/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c ============================================================================== --- stable/12/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c Tue Feb 4 19:45:51 2020 (r357522) +++ stable/12/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c Tue Feb 4 19:46:29 2020 (r357523) @@ -1655,10 +1655,11 @@ altq_is_enabled(int pfdev) syslog(LOG_INFO, "No ALTQ support in kernel\n" "ALTQ related functions disabled\n"); return (0); - } else + } else { syslog(LOG_ERR, "DIOCGETALTQS returned an error: %s", strerror(errno)); return (-1); + } } return (1); } From owner-svn-src-all@freebsd.org Tue Feb 4 19:46:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7393B231DCD; Tue, 4 Feb 2020 19:46:30 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BwDj6NfWz4S2B; Tue, 4 Feb 2020 19:46:29 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D62B01EF21; Tue, 4 Feb 2020 19:46:29 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014JkTfC064614; Tue, 4 Feb 2020 19:46:29 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014JkTjB064613; Tue, 4 Feb 2020 19:46:29 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202002041946.014JkTjB064613@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 4 Feb 2020 19:46:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r357523 - in stable: 10/usr.sbin/bsnmpd/modules/snmp_pf 11/usr.sbin/bsnmpd/modules/snmp_pf 12/usr.sbin/bsnmpd/modules/snmp_pf X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 10/usr.sbin/bsnmpd/modules/snmp_pf 11/usr.sbin/bsnmpd/modules/snmp_pf 12/usr.sbin/bsnmpd/modules/snmp_pf X-SVN-Commit-Revision: 357523 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 19:46:30 -0000 Author: dim Date: Tue Feb 4 19:46:29 2020 New Revision: 357523 URL: https://svnweb.freebsd.org/changeset/base/357523 Log: MFC r357340: Merge r357339 from the clang1000-import branch: Fix the following -Werror warning from clang 10.0.0 in bsnmpd: usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c:1661:4: error: misleading indentation; statement is not part of the previous 'else' [-Werror,-Wmisleading-indentation] return (-1); ^ usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c:1658:5: note: previous statement is here } else ^ The intent was to group the return statement with the previous syslog() call. Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c stable/12/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c Directory Properties: stable/10/ (props changed) stable/12/ (props changed) Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c ============================================================================== --- stable/11/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c Tue Feb 4 19:45:51 2020 (r357522) +++ stable/11/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c Tue Feb 4 19:46:29 2020 (r357523) @@ -1650,10 +1650,11 @@ altq_is_enabled(int pfdev) syslog(LOG_INFO, "No ALTQ support in kernel\n" "ALTQ related functions disabled\n"); return (0); - } else + } else { syslog(LOG_ERR, "DIOCGETALTQS returned an error: %s", strerror(errno)); return (-1); + } } return (1); } From owner-svn-src-all@freebsd.org Tue Feb 4 19:46:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B29F3231DD8; Tue, 4 Feb 2020 19:46:30 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BwDk3SRLz4S2C; Tue, 4 Feb 2020 19:46:30 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3694A1EF22; Tue, 4 Feb 2020 19:46:30 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014JkUFM064620; Tue, 4 Feb 2020 19:46:30 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014JkU1X064619; Tue, 4 Feb 2020 19:46:30 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202002041946.014JkU1X064619@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 4 Feb 2020 19:46:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r357523 - in stable: 10/usr.sbin/bsnmpd/modules/snmp_pf 11/usr.sbin/bsnmpd/modules/snmp_pf 12/usr.sbin/bsnmpd/modules/snmp_pf X-SVN-Group: stable-10 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 10/usr.sbin/bsnmpd/modules/snmp_pf 11/usr.sbin/bsnmpd/modules/snmp_pf 12/usr.sbin/bsnmpd/modules/snmp_pf X-SVN-Commit-Revision: 357523 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 19:46:30 -0000 Author: dim Date: Tue Feb 4 19:46:29 2020 New Revision: 357523 URL: https://svnweb.freebsd.org/changeset/base/357523 Log: MFC r357340: Merge r357339 from the clang1000-import branch: Fix the following -Werror warning from clang 10.0.0 in bsnmpd: usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c:1661:4: error: misleading indentation; statement is not part of the previous 'else' [-Werror,-Wmisleading-indentation] return (-1); ^ usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c:1658:5: note: previous statement is here } else ^ The intent was to group the return statement with the previous syslog() call. Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c stable/12/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c Directory Properties: stable/11/ (props changed) stable/12/ (props changed) Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c ============================================================================== --- stable/10/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c Tue Feb 4 19:45:51 2020 (r357522) +++ stable/10/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c Tue Feb 4 19:46:29 2020 (r357523) @@ -1648,10 +1648,11 @@ altq_is_enabled(int pfdev) syslog(LOG_INFO, "No ALTQ support in kernel\n" "ALTQ related functions disabled\n"); return (0); - } else + } else { syslog(LOG_ERR, "DIOCGETALTQS returned an error: %s", strerror(errno)); return (-1); + } } return (1); } From owner-svn-src-all@freebsd.org Tue Feb 4 19:51:27 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 31F742323D1; Tue, 4 Feb 2020 19:51:27 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BwLR0cRYz4Srn; Tue, 4 Feb 2020 19:51:27 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1037B1F09A; Tue, 4 Feb 2020 19:51:27 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014JpQPT066444; Tue, 4 Feb 2020 19:51:26 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014JpQCY066443; Tue, 4 Feb 2020 19:51:26 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202002041951.014JpQCY066443@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 4 Feb 2020 19:51:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357524 - stable/12/share/mk X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: stable/12/share/mk X-SVN-Commit-Revision: 357524 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 19:51:27 -0000 Author: dim Date: Tue Feb 4 19:51:26 2020 New Revision: 357524 URL: https://svnweb.freebsd.org/changeset/base/357524 Log: MFC r357346: Merge r357342 from the clang1000-import branch: Work around two -Werror warning issues in googletest, which have been solved upstream in the mean time. The first issue is because one of googletest's generated headers contain classes with a user-declared copy assignment operator, but rely on the generation by the compiler of an implicit copy constructor, which is now deprecated: /usr/obj/usr/src/amd64.amd64/tmp/usr/include/private/gtest/internal/gtest-param-util-generated.h:5284:8: error: definition of implicit copy constructor for 'CartesianProductHolder3, testing::internal::ValueArray3, testing::internal::ValueArray4 >' is deprecated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated-copy] void operator=(const CartesianProductHolder3& other); ^ /usr/obj/usr/src/amd64.amd64/tmp/usr/include/private/gtest/gtest-param-test.h:1277:10: note: in implicit copy constructor for 'testing::internal::CartesianProductHolder3, testing::internal::ValueArray3, testing::internal::ValueArray4 >' first required here return internal::CartesianProductHolder3( ^ /usr/src/tests/sys/fs/fusefs/io.cc:534:2: note: in instantiation of function template specialization 'testing::Combine, testing::internal::ValueArray3, testing::internal::ValueArray4 >' requested here Combine(Bool(), /* async read */ ^ For now, silence the warning using -Wno-deprecated-copy. The second issue is because one of the googlemock test programs attempts to use "unsigned wchar_t" and "signed wchar_t", which are non-standard and at best, hazily defined: contrib/googletest/googlemock/test/gmock-actions_test.cc:111:37: error: 'wchar_t' cannot be signed or unsigned [-Wsigned-unsigned-wchar] EXPECT_EQ(0U, BuiltInDefaultValue::Get()); ^ contrib/googletest/googlemock/test/gmock-actions_test.cc:112:36: error: 'wchar_t' cannot be signed or unsigned [-Wsigned-unsigned-wchar] EXPECT_EQ(0, BuiltInDefaultValue::Get()); ^ For now, silence the warning using -Wno-signed-unsigned-wchar. Modified: stable/12/share/mk/googletest.test.inc.mk Directory Properties: stable/12/ (props changed) Modified: stable/12/share/mk/googletest.test.inc.mk ============================================================================== --- stable/12/share/mk/googletest.test.inc.mk Tue Feb 4 19:46:29 2020 (r357523) +++ stable/12/share/mk/googletest.test.inc.mk Tue Feb 4 19:51:26 2020 (r357524) @@ -5,6 +5,18 @@ GTESTS_CXXFLAGS+= -DGTEST_HAS_PTHREAD=1 GTESTS_CXXFLAGS+= -DGTEST_HAS_STREAM_REDIRECTION=1 GTESTS_CXXFLAGS+= -frtti +.include + +.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 100000 +# Required until googletest is upgraded to a more recent version (after +# upstream commit efecb0bfa687cf87836494f5d62868485c00fb66). +GTESTS_CXXFLAGS+= -Wno-deprecated-copy + +# Required until googletest is upgraded to a more recent version (after +# upstream commit d44b137fd104dfffdcdea103f7de11b9eccc45c2). +GTESTS_CXXFLAGS+= -Wno-signed-unsigned-wchar +.endif + # XXX: src.libnames.mk should handle adding this directory for libgtest's, # libgmock's, etc, headers. CXXFLAGS+= -I${DESTDIR}${INCLUDEDIR}/private From owner-svn-src-all@freebsd.org Tue Feb 4 20:00:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6A18D23260F; Tue, 4 Feb 2020 20:00:46 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BwYB1rhvz4TGV; Tue, 4 Feb 2020 20:00:46 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3AC5A1F133; Tue, 4 Feb 2020 20:00:46 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014K0kFO071037; Tue, 4 Feb 2020 20:00:46 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014K0kmV071036; Tue, 4 Feb 2020 20:00:46 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202002042000.014K0kmV071036@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 4 Feb 2020 20:00:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357525 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 357525 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 20:00:46 -0000 Author: markj Date: Tue Feb 4 20:00:45 2020 New Revision: 357525 URL: https://svnweb.freebsd.org/changeset/base/357525 Log: Correct the malloc tag used when freeing the temporary semop(2) buffer. MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/sysv_sem.c Modified: head/sys/kern/sysv_sem.c ============================================================================== --- head/sys/kern/sysv_sem.c Tue Feb 4 19:51:26 2020 (r357524) +++ head/sys/kern/sysv_sem.c Tue Feb 4 20:00:45 2020 (r357525) @@ -1142,7 +1142,7 @@ sys_semop(struct thread *td, struct semop_args *uap) DPRINTF(("error = %d from copyin(%p, %p, %d)\n", error, uap->sops, sops, nsops * sizeof(sops[0]))); if (sops != small_sops) - free(sops, M_SEM); + free(sops, M_TEMP); return (error); } @@ -1393,7 +1393,7 @@ done: done2: mtx_unlock(sema_mtxp); if (sops != small_sops) - free(sops, M_SEM); + free(sops, M_TEMP); return (error); } From owner-svn-src-all@freebsd.org Tue Feb 4 20:09:26 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A2D3A2329B7; Tue, 4 Feb 2020 20:09:26 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BwlB3hg7z4Thd; Tue, 4 Feb 2020 20:09:26 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 79E741F30B; Tue, 4 Feb 2020 20:09:26 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014K9Qgv076894; Tue, 4 Feb 2020 20:09:26 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014K9QVJ076893; Tue, 4 Feb 2020 20:09:26 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202002042009.014K9QVJ076893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 4 Feb 2020 20:09:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357526 - in stable: 11/sys/dev/tpm 12/sys/dev/tpm X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/sys/dev/tpm 12/sys/dev/tpm X-SVN-Commit-Revision: 357526 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 20:09:26 -0000 Author: dim Date: Tue Feb 4 20:09:25 2020 New Revision: 357526 URL: https://svnweb.freebsd.org/changeset/base/357526 Log: MFC r357349: Merge r357348 from the clang 10.0.0 import branch: Disable new clang 10.0.0 warnings about converting the result of shift operations to a boolean in tpm(4): sys/dev/tpm/tpm_crb.c:301:32: error: converting the result of '<<' to a boolean; did you mean '(1 << (0)) != 0'? [-Werror,-Wint-in-bool-context] WR4(sc, TPM_CRB_CTRL_CANCEL, !TPM_CRB_CTRL_CANCEL_CMD); ^ sys/dev/tpm/tpm_crb.c:73:34: note: expanded from macro 'TPM_CRB_CTRL_CANCEL_CMD' #define TPM_CRB_CTRL_CANCEL_CMD BIT(0) ^ sys/dev/tpm/tpm20.h:60:19: note: expanded from macro 'BIT' #define BIT(x) (1 << (x)) ^ Such warnings can be useful in C++ contexts, but not so much in kernel drivers, where this type of bit twiddling is commonplace. So disable it for this case. MFC r357366: Revert r357349, since the clang 10.0.0 warning was actually correct, and the ! operator should have been a ~ instead: Merge r357348 from the clang 10.0.0 import branch: Disable new clang 10.0.0 warnings about converting the result of shift operations to a boolean in tpm(4): sys/dev/tpm/tpm_crb.c:301:32: error: converting the result of '<<' to a boolean; did you mean '(1 << (0)) != 0'? [-Werror,-Wint-in-bool-context] WR4(sc, TPM_CRB_CTRL_CANCEL, !TPM_CRB_CTRL_CANCEL_CMD); ^ sys/dev/tpm/tpm_crb.c:73:34: note: expanded from macro 'TPM_CRB_CTRL_CANCEL_CMD' #define TPM_CRB_CTRL_CANCEL_CMD BIT(0) ^ sys/dev/tpm/tpm20.h:60:19: note: expanded from macro 'BIT' #define BIT(x) (1 << (x)) ^ Such warnings can be useful in C++ contexts, but not so much in kernel drivers, where this type of bit twiddling is commonplace. So disable it for this case. Noticed by: cem MFC r357367: Fix new clang 10.0.0 warnings about converting the result of shift operations to a boolean in tpm(4): sys/dev/tpm/tpm_crb.c:301:32: error: converting the result of '<<' to a boolean; did you mean '(1 << (0)) != 0'? [-Werror,-Wint-in-bool-context] WR4(sc, TPM_CRB_CTRL_CANCEL, !TPM_CRB_CTRL_CANCEL_CMD); ^ sys/dev/tpm/tpm_crb.c:73:34: note: expanded from macro 'TPM_CRB_CTRL_CANCEL_CMD' #define TPM_CRB_CTRL_CANCEL_CMD BIT(0) ^ sys/dev/tpm/tpm20.h:60:19: note: expanded from macro 'BIT' #define BIT(x) (1 << (x)) ^ In this case, the intent was to clear the zeroth bit, and leave the rest unaffected. Therefore, the ~ operator should be used instead. Noticed by: cem MFC r357388: Amend r357367 by using register values from the TPM datasheet. As Ian Lepore noted, writing ~1 to a register might have a completely different effect than doing a regular read-modify-write operation. Follow the TCG_PC_Client_Platform_TPM_Profile_PTP_2.0_r1.03_v22 datasheet instead, and use the actual values mentioned there: (uint32_t)1 to cancel the command, (uint32_t)0 to clear the field. MFC r357391 (by kib): Fix build. Sponsored by: The FreeBSD Foundation Modified: stable/12/sys/dev/tpm/tpm_crb.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/dev/tpm/tpm_crb.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/dev/tpm/tpm_crb.c ============================================================================== --- stable/12/sys/dev/tpm/tpm_crb.c Tue Feb 4 20:00:45 2020 (r357525) +++ stable/12/sys/dev/tpm/tpm_crb.c Tue Feb 4 20:09:25 2020 (r357526) @@ -70,7 +70,8 @@ __FBSDID("$FreeBSD$"); #define TPM_CRB_CTRL_STS_ERR_BIT BIT(0) #define TPM_CRB_CTRL_STS_IDLE_BIT BIT(1) -#define TPM_CRB_CTRL_CANCEL_CMD BIT(0) +#define TPM_CRB_CTRL_CANCEL_CMD 0x1 +#define TPM_CRB_CTRL_CANCEL_CLEAR 0x0 #define TPM_CRB_CTRL_START_CMD BIT(0) @@ -299,7 +300,7 @@ tpmcrb_cancel_cmd(struct tpm_sc *sc) return (false); } - WR4(sc, TPM_CRB_CTRL_CANCEL, !TPM_CRB_CTRL_CANCEL_CMD); + WR4(sc, TPM_CRB_CTRL_CANCEL, TPM_CRB_CTRL_CANCEL_CLEAR); return (true); } @@ -331,7 +332,7 @@ tpmcrb_transmit(struct tpm_sc *sc, size_t length) return (EIO); } /* Clear cancellation bit */ - WR4(sc, TPM_CRB_CTRL_CANCEL, !TPM_CRB_CTRL_CANCEL_CMD); + WR4(sc, TPM_CRB_CTRL_CANCEL, TPM_CRB_CTRL_CANCEL_CLEAR); /* Switch device to idle state if necessary */ if (!(RD4(sc, TPM_CRB_CTRL_STS) & TPM_CRB_CTRL_STS_IDLE_BIT)) { From owner-svn-src-all@freebsd.org Tue Feb 4 20:09:26 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DA4E32329BC; Tue, 4 Feb 2020 20:09:26 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BwlB5Pycz4Thf; Tue, 4 Feb 2020 20:09:26 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B33881F30C; Tue, 4 Feb 2020 20:09:26 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014K9Q1l076900; Tue, 4 Feb 2020 20:09:26 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014K9Qh8076899; Tue, 4 Feb 2020 20:09:26 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202002042009.014K9Qh8076899@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 4 Feb 2020 20:09:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r357526 - in stable: 11/sys/dev/tpm 12/sys/dev/tpm X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/sys/dev/tpm 12/sys/dev/tpm X-SVN-Commit-Revision: 357526 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 20:09:27 -0000 Author: dim Date: Tue Feb 4 20:09:25 2020 New Revision: 357526 URL: https://svnweb.freebsd.org/changeset/base/357526 Log: MFC r357349: Merge r357348 from the clang 10.0.0 import branch: Disable new clang 10.0.0 warnings about converting the result of shift operations to a boolean in tpm(4): sys/dev/tpm/tpm_crb.c:301:32: error: converting the result of '<<' to a boolean; did you mean '(1 << (0)) != 0'? [-Werror,-Wint-in-bool-context] WR4(sc, TPM_CRB_CTRL_CANCEL, !TPM_CRB_CTRL_CANCEL_CMD); ^ sys/dev/tpm/tpm_crb.c:73:34: note: expanded from macro 'TPM_CRB_CTRL_CANCEL_CMD' #define TPM_CRB_CTRL_CANCEL_CMD BIT(0) ^ sys/dev/tpm/tpm20.h:60:19: note: expanded from macro 'BIT' #define BIT(x) (1 << (x)) ^ Such warnings can be useful in C++ contexts, but not so much in kernel drivers, where this type of bit twiddling is commonplace. So disable it for this case. MFC r357366: Revert r357349, since the clang 10.0.0 warning was actually correct, and the ! operator should have been a ~ instead: Merge r357348 from the clang 10.0.0 import branch: Disable new clang 10.0.0 warnings about converting the result of shift operations to a boolean in tpm(4): sys/dev/tpm/tpm_crb.c:301:32: error: converting the result of '<<' to a boolean; did you mean '(1 << (0)) != 0'? [-Werror,-Wint-in-bool-context] WR4(sc, TPM_CRB_CTRL_CANCEL, !TPM_CRB_CTRL_CANCEL_CMD); ^ sys/dev/tpm/tpm_crb.c:73:34: note: expanded from macro 'TPM_CRB_CTRL_CANCEL_CMD' #define TPM_CRB_CTRL_CANCEL_CMD BIT(0) ^ sys/dev/tpm/tpm20.h:60:19: note: expanded from macro 'BIT' #define BIT(x) (1 << (x)) ^ Such warnings can be useful in C++ contexts, but not so much in kernel drivers, where this type of bit twiddling is commonplace. So disable it for this case. Noticed by: cem MFC r357367: Fix new clang 10.0.0 warnings about converting the result of shift operations to a boolean in tpm(4): sys/dev/tpm/tpm_crb.c:301:32: error: converting the result of '<<' to a boolean; did you mean '(1 << (0)) != 0'? [-Werror,-Wint-in-bool-context] WR4(sc, TPM_CRB_CTRL_CANCEL, !TPM_CRB_CTRL_CANCEL_CMD); ^ sys/dev/tpm/tpm_crb.c:73:34: note: expanded from macro 'TPM_CRB_CTRL_CANCEL_CMD' #define TPM_CRB_CTRL_CANCEL_CMD BIT(0) ^ sys/dev/tpm/tpm20.h:60:19: note: expanded from macro 'BIT' #define BIT(x) (1 << (x)) ^ In this case, the intent was to clear the zeroth bit, and leave the rest unaffected. Therefore, the ~ operator should be used instead. Noticed by: cem MFC r357388: Amend r357367 by using register values from the TPM datasheet. As Ian Lepore noted, writing ~1 to a register might have a completely different effect than doing a regular read-modify-write operation. Follow the TCG_PC_Client_Platform_TPM_Profile_PTP_2.0_r1.03_v22 datasheet instead, and use the actual values mentioned there: (uint32_t)1 to cancel the command, (uint32_t)0 to clear the field. MFC r357391 (by kib): Fix build. Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/dev/tpm/tpm_crb.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/dev/tpm/tpm_crb.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/dev/tpm/tpm_crb.c ============================================================================== --- stable/11/sys/dev/tpm/tpm_crb.c Tue Feb 4 20:00:45 2020 (r357525) +++ stable/11/sys/dev/tpm/tpm_crb.c Tue Feb 4 20:09:25 2020 (r357526) @@ -70,7 +70,8 @@ __FBSDID("$FreeBSD$"); #define TPM_CRB_CTRL_STS_ERR_BIT BIT(0) #define TPM_CRB_CTRL_STS_IDLE_BIT BIT(1) -#define TPM_CRB_CTRL_CANCEL_CMD BIT(0) +#define TPM_CRB_CTRL_CANCEL_CMD 0x1 +#define TPM_CRB_CTRL_CANCEL_CLEAR 0x0 #define TPM_CRB_CTRL_START_CMD BIT(0) @@ -299,7 +300,7 @@ tpmcrb_cancel_cmd(struct tpm_sc *sc) return (false); } - WR4(sc, TPM_CRB_CTRL_CANCEL, !TPM_CRB_CTRL_CANCEL_CMD); + WR4(sc, TPM_CRB_CTRL_CANCEL, TPM_CRB_CTRL_CANCEL_CLEAR); return (true); } @@ -331,7 +332,7 @@ tpmcrb_transmit(struct tpm_sc *sc, size_t length) return (EIO); } /* Clear cancellation bit */ - WR4(sc, TPM_CRB_CTRL_CANCEL, !TPM_CRB_CTRL_CANCEL_CMD); + WR4(sc, TPM_CRB_CTRL_CANCEL, TPM_CRB_CTRL_CANCEL_CLEAR); /* Switch device to idle state if necessary */ if (!(RD4(sc, TPM_CRB_CTRL_STS) & TPM_CRB_CTRL_STS_IDLE_BIT)) { From owner-svn-src-all@freebsd.org Tue Feb 4 20:23:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 53DC4233126; Tue, 4 Feb 2020 20:23:46 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi1-f195.google.com (mail-oi1-f195.google.com [209.85.167.195]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Bx3k1Xg6z4Vm0; Tue, 4 Feb 2020 20:23:46 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-oi1-f195.google.com with SMTP id z2so19828752oih.6; Tue, 04 Feb 2020 12:23:46 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=sMHuECfHoBpRD8BM3i0CU+5WY7KxbBwNMAi4gw1wOVQ=; b=c/VqeoXt9yXlQ+G8dpfYiy9tx4PmHIOqsvWAx4SjVazANsEgypaX5DYQjtO/7n+OUu GmVLvKOGqr363hxqI3YSnp3UFu3Oq3REIJKbvF0iYNaEeRCCr7XpLRMH05F767u/uvtK H+/LfofOtkEl2EYHzMI2fjwnX6gI00ttC9Jt3K/K2sSJdL7QgAiSC4W2At1mpPTw6/pt YxPGZ0A/lQC18LQRK1/L79KFQRn6NcwLopMQg+Tu1+SOF2e4vlN3v6omaC4gYatQArG7 g+z4F5ZgGhhbblyqeh7oiay8dtr7vv1Bo8Yha66h0WY530U4ATYHFQmLULFVop0U4h72 pMnA== X-Gm-Message-State: APjAAAXciqFRmPVjAYI8SfRBiAIeKf4IV9ydyXdRFaWs4yn+0lctpEX8 EddUqsPHS01Dvicl6o7ZLlJHnddv X-Google-Smtp-Source: APXvYqz4wH2Ou6nNiBS2yWEUDRZ5PjJR5NfjnoT1tuTrgba2r1DVVUc9tANrnD3Oi2rrmftoi5t9aA== X-Received: by 2002:aca:ab52:: with SMTP id u79mr477798oie.145.1580847824745; Tue, 04 Feb 2020 12:23:44 -0800 (PST) Received: from mail-oi1-f180.google.com (mail-oi1-f180.google.com. [209.85.167.180]) by smtp.gmail.com with ESMTPSA id w196sm6470739oia.46.2020.02.04.12.23.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 04 Feb 2020 12:23:44 -0800 (PST) Received: by mail-oi1-f180.google.com with SMTP id i1so19808978oie.8; Tue, 04 Feb 2020 12:23:44 -0800 (PST) X-Received: by 2002:aca:3017:: with SMTP id w23mr514110oiw.152.1580847824231; Tue, 04 Feb 2020 12:23:44 -0800 (PST) MIME-Version: 1.0 References: <202002040525.0145Pppn034466@repo.freebsd.org> In-Reply-To: <202002040525.0145Pppn034466@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Tue, 4 Feb 2020 12:23:33 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r357492 - in head/sys: kern sys To: Dmitry Chagin Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 48Bx3k1Xg6z4Vm0 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 20:23:46 -0000 Hi Dmitry, This seems to trigger some panics via clock_gettime syscalls (native and 32-bit, reported by Syzkaller): panic: mutex process lock not owned at /syzkaller/managers/main/kernel/sys/kern/kern_time.c:261 cpuid = 0 time = 1580841963 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x47/frame 0xfffffe00244778c0 vpanic() at vpanic+0x1ce/frame 0xfffffe0024477930 panic() at panic+0x43/frame 0xfffffe0024477990 __mtx_assert() at __mtx_assert+0x196/frame 0xfffffe00244779d0 kern_thread_cputime() at kern_thread_cputime+0xaa/frame 0xfffffe0024477a20 kern_clock_gettime() at kern_clock_gettime+0x277/frame 0xfffffe0024477a80 sys_clock_gettime() at sys_clock_gettime+0x25/frame 0xfffffe0024477ab0 amd64_syscall() at amd64_syscall+0x499/frame 0xfffffe0024477bf0 panic: mutex process lock not owned at /syzkaller/managers/i386/kernel/sys/kern/kern_time.c:261 cpuid = 0 time = 1580847200 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x47/frame 0xfffffe00244a68b0 vpanic() at vpanic+0x1ce/frame 0xfffffe00244a6920 panic() at panic+0x43/frame 0xfffffe00244a6980 __mtx_assert() at __mtx_assert+0x196/frame 0xfffffe00244a69c0 kern_thread_cputime() at kern_thread_cputime+0xaa/frame 0xfffffe00244a6a10 kern_clock_gettime() at kern_clock_gettime+0x277/frame 0xfffffe00244a6a70 freebsd32_clock_gettime() at freebsd32_clock_gettime+0x25/frame 0xfffffe00244a6ab0 ia32_syscall() at ia32_syscall+0x48c/frame 0xfffffe00244a6bf0 Best, Conrad On Mon, Feb 3, 2020 at 9:25 PM Dmitry Chagin wrote: > > Author: dchagin > Date: Tue Feb 4 05:25:51 2020 > New Revision: 357492 > URL: https://svnweb.freebsd.org/changeset/base/357492 > > Log: > For code reuse in Linuxulator rename get_proccess_cputime() > and get_thread_cputime() and add prototypes for it to . > > As both functions become a public interface add process lock assert > to ensure that the process is not exiting under it. > > Fix whitespace nit while here. > > Reviewed by: kib > Differential Revision: https://reviews.freebsd.org/D23340 > MFC after 2 weeks > > Modified: > head/sys/kern/kern_time.c > head/sys/sys/syscallsubr.h > > Modified: head/sys/kern/kern_time.c > ============================================================================== > --- head/sys/kern/kern_time.c Tue Feb 4 05:23:34 2020 (r357491) > +++ head/sys/kern/kern_time.c Tue Feb 4 05:25:51 2020 (r357492) > @@ -242,7 +242,7 @@ sys_clock_gettime(struct thread *td, struct clock_gett > return (error); > } > > -static inline void > +static inline void > cputick2timespec(uint64_t runtime, struct timespec *ats) > { > runtime = cputick2usec(runtime); > @@ -250,12 +250,15 @@ cputick2timespec(uint64_t runtime, struct timespec *at > ats->tv_nsec = runtime % 1000000 * 1000; > } > > -static void > -get_thread_cputime(struct thread *targettd, struct timespec *ats) > +void > +kern_thread_cputime(struct thread *targettd, struct timespec *ats) > { > uint64_t runtime, curtime, switchtime; > + struct proc *p; > > if (targettd == NULL) { /* current thread */ > + p = curthread->td_proc; > + PROC_LOCK_ASSERT(p, MA_OWNED); > critical_enter(); > switchtime = PCPU_GET(switchtime); > curtime = cpu_ticks(); > @@ -263,6 +266,8 @@ get_thread_cputime(struct thread *targettd, struct tim > critical_exit(); > runtime += curtime - switchtime; > } else { > + p = targettd->td_proc; > + PROC_LOCK_ASSERT(p, MA_OWNED); > thread_lock(targettd); > runtime = targettd->td_runtime; > thread_unlock(targettd); > @@ -270,12 +275,13 @@ get_thread_cputime(struct thread *targettd, struct tim > cputick2timespec(runtime, ats); > } > > -static void > -get_process_cputime(struct proc *targetp, struct timespec *ats) > +void > +kern_process_cputime(struct proc *targetp, struct timespec *ats) > { > uint64_t runtime; > struct rusage ru; > > + PROC_LOCK_ASSERT(targetp, MA_OWNED); > PROC_STATLOCK(targetp); > rufetch(targetp, &ru); > runtime = targetp->p_rux.rux_runtime; > @@ -300,14 +306,14 @@ get_cputime(struct thread *td, clockid_t clock_id, str > td2 = tdfind(tid, p->p_pid); > if (td2 == NULL) > return (EINVAL); > - get_thread_cputime(td2, ats); > + kern_thread_cputime(td2, ats); > PROC_UNLOCK(td2->td_proc); > } else { > pid = clock_id & CPUCLOCK_ID_MASK; > error = pget(pid, PGET_CANSEE, &p2); > if (error != 0) > return (EINVAL); > - get_process_cputime(p2, ats); > + kern_process_cputime(p2, ats); > PROC_UNLOCK(p2); > } > return (0); > @@ -360,11 +366,11 @@ kern_clock_gettime(struct thread *td, clockid_t clock_ > ats->tv_nsec = 0; > break; > case CLOCK_THREAD_CPUTIME_ID: > - get_thread_cputime(NULL, ats); > + kern_thread_cputime(NULL, ats); > break; > case CLOCK_PROCESS_CPUTIME_ID: > PROC_LOCK(p); > - get_process_cputime(p, ats); > + kern_process_cputime(p, ats); > PROC_UNLOCK(p); > break; > default: > > Modified: head/sys/sys/syscallsubr.h > ============================================================================== > --- head/sys/sys/syscallsubr.h Tue Feb 4 05:23:34 2020 (r357491) > +++ head/sys/sys/syscallsubr.h Tue Feb 4 05:25:51 2020 (r357492) > @@ -91,6 +91,8 @@ int kern_clock_nanosleep(struct thread *td, clockid_t > const struct timespec *rqtp, struct timespec *rmtp); > int kern_clock_settime(struct thread *td, clockid_t clock_id, > struct timespec *ats); > +void kern_thread_cputime(struct thread *targettd, struct timespec *ats); > +void kern_process_cputime(struct proc *targetp, struct timespec *ats); > int kern_close(struct thread *td, int fd); > int kern_connectat(struct thread *td, int dirfd, int fd, > struct sockaddr *sa); From owner-svn-src-all@freebsd.org Tue Feb 4 20:28:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 521C6233332; Tue, 4 Feb 2020 20:28:07 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Bx8l1QtKz4W1n; Tue, 4 Feb 2020 20:28:07 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2C42B1F69E; Tue, 4 Feb 2020 20:28:07 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014KS76b088836; Tue, 4 Feb 2020 20:28:07 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014KS7TX088835; Tue, 4 Feb 2020 20:28:07 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <202002042028.014KS7TX088835@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Tue, 4 Feb 2020 20:28:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357527 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 357527 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 20:28:07 -0000 Author: jeff Date: Tue Feb 4 20:28:06 2020 New Revision: 357527 URL: https://svnweb.freebsd.org/changeset/base/357527 Log: Use literal bucket sizes for smaller buckets rather than the rounding system. Small bucket sizes already pack well even if they are an odd number of words. This prevents any potential new instances of the problem fixed in r357463 as well as making the system easier to understand. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D23494 Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Tue Feb 4 20:09:25 2020 (r357526) +++ head/sys/vm/uma_core.c Tue Feb 4 20:28:06 2020 (r357527) @@ -236,16 +236,15 @@ struct uma_bucket_zone { (((sizeof(void *) * (n)) - sizeof(struct uma_bucket)) / sizeof(void *)) #define BUCKET_MAX BUCKET_SIZE(256) -#define BUCKET_MIN BUCKET_SIZE(4) +#define BUCKET_MIN 2 struct uma_bucket_zone bucket_zones[] = { -#ifndef __ILP32__ - { NULL, "4 Bucket", BUCKET_SIZE(4), 4096 }, -#endif - { NULL, "6 Bucket", BUCKET_SIZE(6), 3072 }, - { NULL, "8 Bucket", BUCKET_SIZE(8), 2048 }, - { NULL, "12 Bucket", BUCKET_SIZE(12), 1536 }, - { NULL, "16 Bucket", BUCKET_SIZE(16), 1024 }, + /* Literal bucket sizes. */ + { NULL, "2 Bucket", 2, 4096 }, + { NULL, "4 Bucket", 4, 3072 }, + { NULL, "8 Bucket", 8, 2048 }, + { NULL, "16 Bucket", 16, 1024 }, + /* Rounded down power of 2 sizes for efficiency. */ { NULL, "32 Bucket", BUCKET_SIZE(32), 512 }, { NULL, "64 Bucket", BUCKET_SIZE(64), 256 }, { NULL, "128 Bucket", BUCKET_SIZE(128), 128 }, From owner-svn-src-all@freebsd.org Tue Feb 4 20:33:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 17BE62338FC; Tue, 4 Feb 2020 20:33:02 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BxGP6xNwz4WZ2; Tue, 4 Feb 2020 20:33:01 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E94A41F869; Tue, 4 Feb 2020 20:33:01 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014KX1pC094381; Tue, 4 Feb 2020 20:33:01 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014KX1An094378; Tue, 4 Feb 2020 20:33:01 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <202002042033.014KX1An094378@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Tue, 4 Feb 2020 20:33:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357528 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 357528 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 20:33:02 -0000 Author: jeff Date: Tue Feb 4 20:33:01 2020 New Revision: 357528 URL: https://svnweb.freebsd.org/changeset/base/357528 Log: Add an explicit busy state for free pages. This improves behavior with potential bugs that access freed pages as well as providing a path towards lockless page lookup. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D23444 Modified: head/sys/vm/vm_page.c head/sys/vm/vm_page.h Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Tue Feb 4 20:28:06 2020 (r357527) +++ head/sys/vm/vm_page.c Tue Feb 4 20:33:01 2020 (r357528) @@ -508,7 +508,7 @@ vm_page_init_page(vm_page_t m, vm_paddr_t pa, int segi m->object = NULL; m->ref_count = 0; - m->busy_lock = VPB_UNBUSIED; + m->busy_lock = VPB_FREED; m->flags = m->a.flags = 0; m->phys_addr = pa; m->a.queue = PQ_NONE; @@ -988,6 +988,8 @@ vm_page_sunbusy(vm_page_t m) x = m->busy_lock; for (;;) { + KASSERT(x != VPB_FREED, + ("vm_page_sunbusy: Unlocking freed page.")); if (VPB_SHARERS(x) > 1) { if (atomic_fcmpset_int(&m->busy_lock, &x, x - VPB_ONE_SHARER)) @@ -1155,6 +1157,17 @@ vm_page_xunbusy_hard_unchecked(vm_page_t m) vm_page_xunbusy_hard_tail(m); } +static void +vm_page_busy_free(vm_page_t m) +{ + u_int x; + + atomic_thread_fence_rel(); + x = atomic_swap_int(&m->busy_lock, VPB_FREED); + if ((x & VPB_BIT_WAITERS) != 0) + wakeup(m); +} + /* * vm_page_unhold_pages: * @@ -1249,7 +1262,8 @@ vm_page_putfake(vm_page_t m) KASSERT((m->oflags & VPO_UNMANAGED) != 0, ("managed %p", m)); KASSERT((m->flags & PG_FICTITIOUS) != 0, ("vm_page_putfake: bad page %p", m)); - vm_page_xunbusy(m); + vm_page_assert_xbusied(m); + vm_page_busy_free(m); uma_zfree(fakepg_zone, m); } @@ -2012,11 +2026,12 @@ found: m->a.flags = 0; m->oflags = object == NULL || (object->flags & OBJ_UNMANAGED) != 0 ? VPO_UNMANAGED : 0; - m->busy_lock = VPB_UNBUSIED; if ((req & (VM_ALLOC_NOBUSY | VM_ALLOC_NOOBJ | VM_ALLOC_SBUSY)) == 0) m->busy_lock = VPB_CURTHREAD_EXCLUSIVE; - if ((req & VM_ALLOC_SBUSY) != 0) + else if ((req & VM_ALLOC_SBUSY) != 0) m->busy_lock = VPB_SHARERS_WORD(1); + else + m->busy_lock = VPB_UNBUSIED; if (req & VM_ALLOC_WIRED) { vm_wire_add(1); m->ref_count = 1; @@ -2202,11 +2217,12 @@ found: flags |= PG_NODUMP; oflags = object == NULL || (object->flags & OBJ_UNMANAGED) != 0 ? VPO_UNMANAGED : 0; - busy_lock = VPB_UNBUSIED; if ((req & (VM_ALLOC_NOBUSY | VM_ALLOC_NOOBJ | VM_ALLOC_SBUSY)) == 0) busy_lock = VPB_CURTHREAD_EXCLUSIVE; - if ((req & VM_ALLOC_SBUSY) != 0) + else if ((req & VM_ALLOC_SBUSY) != 0) busy_lock = VPB_SHARERS_WORD(1); + else + busy_lock = VPB_UNBUSIED; if ((req & VM_ALLOC_WIRED) != 0) vm_wire_add(npages); if (object != NULL) { @@ -2268,7 +2284,7 @@ vm_page_alloc_check(vm_page_t m) ("page %p has unexpected queue %d, flags %#x", m, m->a.queue, (m->a.flags & PGA_QUEUE_STATE_MASK))); KASSERT(m->ref_count == 0, ("page %p has references", m)); - KASSERT(!vm_page_busied(m), ("page %p is busy", m)); + KASSERT(vm_page_busy_freed(m), ("page %p is not freed", m)); KASSERT(m->dirty == 0, ("page %p is dirty", m)); KASSERT(pmap_page_get_memattr(m) == VM_MEMATTR_DEFAULT, ("page %p has unexpected memattr %d", @@ -3592,9 +3608,6 @@ vm_page_free_prep(vm_page_t m) */ atomic_thread_fence_acq(); - if (vm_page_sbusied(m)) - panic("vm_page_free_prep: freeing shared busy page %p", m); - #if defined(DIAGNOSTIC) && defined(PHYS_TO_DMAP) if (PMAP_HAS_DMAP && (m->flags & PG_ZERO) != 0) { uint64_t *p; @@ -3621,7 +3634,7 @@ vm_page_free_prep(vm_page_t m) ((m->object->flags & OBJ_UNMANAGED) != 0), ("vm_page_free_prep: managed flag mismatch for page %p", m)); - vm_page_object_remove(m); + vm_page_assert_xbusied(m); /* * The object reference can be released without an atomic @@ -3631,13 +3644,13 @@ vm_page_free_prep(vm_page_t m) m->ref_count == VPRC_OBJREF, ("vm_page_free_prep: page %p has unexpected ref_count %u", m, m->ref_count)); + vm_page_object_remove(m); m->object = NULL; m->ref_count -= VPRC_OBJREF; - vm_page_xunbusy(m); - } + } else + vm_page_assert_unbusied(m); - if (vm_page_xbusied(m)) - panic("vm_page_free_prep: freeing exclusive busy page %p", m); + vm_page_busy_free(m); /* * If fictitious remove object association and Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Tue Feb 4 20:28:06 2020 (r357527) +++ head/sys/vm/vm_page.h Tue Feb 4 20:33:01 2020 (r357528) @@ -325,6 +325,9 @@ struct vm_page { #define VPB_UNBUSIED VPB_SHARERS_WORD(0) +/* Freed lock blocks both shared and exclusive. */ +#define VPB_FREED (0xffffffff - VPB_BIT_SHARED) + #define PQ_NONE 255 #define PQ_INACTIVE 0 #define PQ_ACTIVE 1 @@ -700,9 +703,11 @@ void vm_page_lock_assert_KBI(vm_page_t m, int a, const (m), __FILE__, __LINE__)) #define vm_page_assert_unbusied(m) \ - KASSERT(!vm_page_busied(m), \ - ("vm_page_assert_unbusied: page %p busy @ %s:%d", \ - (m), __FILE__, __LINE__)) + KASSERT((m->busy_lock & ~VPB_BIT_WAITERS) != \ + VPB_CURTHREAD_EXCLUSIVE, \ + ("vm_page_assert_xbusied: page %p busy_lock %#x owned" \ + " by me @ %s:%d", \ + (m), (m)->busy_lock, __FILE__, __LINE__)); \ #define vm_page_assert_xbusied_unchecked(m) do { \ KASSERT(vm_page_xbusied(m), \ @@ -729,6 +734,9 @@ void vm_page_lock_assert_KBI(vm_page_t m, int a, const #define vm_page_xbusied(m) \ (((m)->busy_lock & VPB_SINGLE_EXCLUSIVE) != 0) + +#define vm_page_busy_freed(m) \ + ((m)->busy_lock == VPB_FREED) #define vm_page_xbusy(m) do { \ if (!vm_page_tryxbusy(m)) \ From owner-svn-src-all@freebsd.org Tue Feb 4 20:40:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CDF3A233B95; Tue, 4 Feb 2020 20:40:46 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BxRL59H7z4WyC; Tue, 4 Feb 2020 20:40:46 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AC9E41F89F; Tue, 4 Feb 2020 20:40:46 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014Keknp096611; Tue, 4 Feb 2020 20:40:46 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014KekPF096609; Tue, 4 Feb 2020 20:40:46 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <202002042040.014KekPF096609@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Tue, 4 Feb 2020 20:40:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357529 - in head/sys/powerpc: aim booke powerpc X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: in head/sys/powerpc: aim booke powerpc X-SVN-Commit-Revision: 357529 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 20:40:46 -0000 Author: bdragon Date: Tue Feb 4 20:40:45 2020 New Revision: 357529 URL: https://svnweb.freebsd.org/changeset/base/357529 Log: [PowerPC] Fix VSX context handling In r356767, memcpy/memmove/bcopy optimizations were added to libc to improve performance. This exposed an existing kernel issue in VSX handling. The PSL_VSX flag was not being excluded from the psl_userstatic set, which meant that any thread that used these and then called swapcontext(3) would get an EINVAL error. Fixing this exposed a second issue - in r344123, the FPU was being forced off in set_mcontext(). However, this was neglecting to ensure VSX was turned off at the same time. While here, add some code comments to explain what's going on. Reviewed by: jhibbits, luporl (earlier rev), pkubaj (earlier rev) Sponsored by: Tag1 Consulting, Inc. Differential Revision: https://reviews.freebsd.org/D23497 Modified: head/sys/powerpc/aim/aim_machdep.c head/sys/powerpc/booke/booke_machdep.c head/sys/powerpc/powerpc/exec_machdep.c Modified: head/sys/powerpc/aim/aim_machdep.c ============================================================================== --- head/sys/powerpc/aim/aim_machdep.c Tue Feb 4 20:33:01 2020 (r357528) +++ head/sys/powerpc/aim/aim_machdep.c Tue Feb 4 20:40:45 2020 (r357529) @@ -251,8 +251,25 @@ aim_cpu_init(vm_offset_t toc) psl_userset32 = psl_userset & ~PSL_SF; #endif - /* Bits that users aren't allowed to change */ - psl_userstatic = ~(PSL_VEC | PSL_FP | PSL_FE0 | PSL_FE1); + /* + * Zeroed bits in this variable signify that the value of the bit + * in its position is allowed to vary between userspace contexts. + * + * All other bits are required to be identical for every userspace + * context. The actual *value* of the bit is determined by + * psl_userset and/or psl_userset32, and is not allowed to change. + * + * Remember to update this set when implementing support for + * *conditionally* enabling a processor facility. Failing to do + * this will cause swapcontext() in userspace to break when a + * process uses a conditionally-enabled facility. + * + * When *unconditionally* implementing support for a processor + * facility, update psl_userset / psl_userset32 instead. + * + * See the access control check in set_mcontext(). + */ + psl_userstatic = ~(PSL_VSX | PSL_VEC | PSL_FP | PSL_FE0 | PSL_FE1); /* * Mask bits from the SRR1 that aren't really the MSR: * Bits 1-4, 10-15 (ppc32), 33-36, 42-47 (ppc64) Modified: head/sys/powerpc/booke/booke_machdep.c ============================================================================== --- head/sys/powerpc/booke/booke_machdep.c Tue Feb 4 20:33:01 2020 (r357528) +++ head/sys/powerpc/booke/booke_machdep.c Tue Feb 4 20:40:45 2020 (r357529) @@ -222,6 +222,24 @@ booke_cpu_init(void) #ifdef __powerpc64__ psl_userset32 = psl_userset & ~PSL_CM; #endif + /* + * Zeroed bits in this variable signify that the value of the bit + * in its position is allowed to vary between userspace contexts. + * + * All other bits are required to be identical for every userspace + * context. The actual *value* of the bit is determined by + * psl_userset and/or psl_userset32, and is not allowed to change. + * + * Remember to update this set when implementing support for + * *conditionally* enabling a processor facility. Failing to do + * this will cause swapcontext() in userspace to break when a + * process uses a conditionally-enabled facility. + * + * When *unconditionally* implementing support for a processor + * facility, update psl_userset / psl_userset32 instead. + * + * See the access control check in set_mcontext(). + */ psl_userstatic = ~(PSL_VEC | PSL_FP | PSL_FE0 | PSL_FE1); pmap_mmu_install(MMU_TYPE_BOOKE, BUS_PROBE_GENERIC); Modified: head/sys/powerpc/powerpc/exec_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/exec_machdep.c Tue Feb 4 20:33:01 2020 (r357528) +++ head/sys/powerpc/powerpc/exec_machdep.c Tue Feb 4 20:40:45 2020 (r357529) @@ -463,7 +463,17 @@ set_mcontext(struct thread *td, mcontext_t *mcp) return (EINVAL); /* - * Don't let the user set privileged MSR bits + * Don't let the user change privileged MSR bits. + * + * psl_userstatic is used here to mask off any bits that can + * legitimately vary between user contexts (Floating point + * exception control and any facilities that we are using the + * "enable on first use" pattern with.) + * + * All other bits are required to match psl_userset(32). + * + * Remember to update the platform cpu_init code when implementing + * support for a new conditional facility! */ if ((mcp->mc_srr1 & psl_userstatic) != (tf->srr1 & psl_userstatic)) { return (EINVAL); @@ -480,9 +490,19 @@ set_mcontext(struct thread *td, mcontext_t *mcp) else tf->fixreg[2] = tls; - /* Disable FPU */ - tf->srr1 &= ~PSL_FP; - pcb->pcb_flags &= ~PCB_FPU; + /* + * Force the FPU back off to ensure the new context will not bypass + * the enable_fpu() setup code accidentally. + * + * This prevents an issue where a process that uses floating point + * inside a signal handler could end up in a state where the MSR + * did not match pcb_flags. + * + * Additionally, ensure VSX is disabled as well, as it is illegal + * to leave it turned on when FP or VEC are off. + */ + tf->srr1 &= ~(PSL_FP | PSL_VSX); + pcb->pcb_flags &= ~(PCB_FPU | PCB_VSX); if (mcp->mc_flags & _MC_FP_VALID) { /* enable_fpu() will happen lazily on a fault */ From owner-svn-src-all@freebsd.org Tue Feb 4 21:02:08 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9E21A2344FF; Tue, 4 Feb 2020 21:02:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Bxw03kVZz4YDH; Tue, 4 Feb 2020 21:02:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7B6BC1FDDC; Tue, 4 Feb 2020 21:02:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014L28Am011949; Tue, 4 Feb 2020 21:02:08 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014L28em011948; Tue, 4 Feb 2020 21:02:08 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202002042102.014L28em011948@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 4 Feb 2020 21:02:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357530 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 357530 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 21:02:08 -0000 Author: kib Date: Tue Feb 4 21:02:08 2020 New Revision: 357530 URL: https://svnweb.freebsd.org/changeset/base/357530 Log: Remove unneeded assert for curproc. Simplify. Reported by: syzkaller by markj Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_time.c Modified: head/sys/kern/kern_time.c ============================================================================== --- head/sys/kern/kern_time.c Tue Feb 4 20:40:45 2020 (r357529) +++ head/sys/kern/kern_time.c Tue Feb 4 21:02:08 2020 (r357530) @@ -254,11 +254,8 @@ void kern_thread_cputime(struct thread *targettd, struct timespec *ats) { uint64_t runtime, curtime, switchtime; - struct proc *p; if (targettd == NULL) { /* current thread */ - p = curthread->td_proc; - PROC_LOCK_ASSERT(p, MA_OWNED); critical_enter(); switchtime = PCPU_GET(switchtime); curtime = cpu_ticks(); @@ -266,8 +263,7 @@ kern_thread_cputime(struct thread *targettd, struct ti critical_exit(); runtime += curtime - switchtime; } else { - p = targettd->td_proc; - PROC_LOCK_ASSERT(p, MA_OWNED); + PROC_LOCK_ASSERT(targettd->td_proc, MA_OWNED); thread_lock(targettd); runtime = targettd->td_runtime; thread_unlock(targettd); From owner-svn-src-all@freebsd.org Tue Feb 4 21:08:13 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D988F234814; Tue, 4 Feb 2020 21:08:13 +0000 (UTC) (envelope-from chagin.dmitry@gmail.com) Received: from mail-io1-f45.google.com (mail-io1-f45.google.com [209.85.166.45]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48By315Sg4z4YZV; Tue, 4 Feb 2020 21:08:13 +0000 (UTC) (envelope-from chagin.dmitry@gmail.com) Received: by mail-io1-f45.google.com with SMTP id i11so22542535ioi.12; Tue, 04 Feb 2020 13:08:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lh+2iC79+DM+jYoV3oaDUI3hLJO0gQnNqbKZtO8kTP0=; b=breWKxf5X3lXkuVV6uvnee6BtrLdPThkPM6/jPhJqaZ06WrFLpU//FpEsyV6jrgSt1 6DYNy51Zi8T7zYYlc8xBtwhGscQjo4GFGpW8dHVV4Yi8iDeuaM1jJr3p81vdzanaaIE4 Q9acMEl+YCfYvXvXhNiK3rlq/Jm301Nk+peYdbHJtUgxrY4i+X8yKdZ03Oxr4hcnaE/G 6RmTA9tSt9lCNCzHL2tLptUQ7e1ZLyg8B9rTQe5tsZ22mT+qYA3V0KlAXNIVwOuVGkYZ sF6XaAdBu14FmnyV4wsNbnSdLIkNNsJOz6JsJrZGodLkHJ8SE4z14ZcFMgnlpR/41tog z5AA== X-Gm-Message-State: APjAAAWVeR+ZRWdUNM/pbRR3mAj9Pzbd+UxenBiX6nVlmD9JUlRLA8et 8i3XEGbr5QHy8y68oi+RufYKw0/3+xWKpBDcCI986sJg X-Google-Smtp-Source: APXvYqwPLMWQTHEgKnvesK3CTWq3peqkYP9yEaRFnUcpfOljDDNQNJM/ISaqfEW6S09KBnP3Y1qiu3mz+7x44ksGtTQ= X-Received: by 2002:a6b:6e05:: with SMTP id d5mr23886383ioh.90.1580850492407; Tue, 04 Feb 2020 13:08:12 -0800 (PST) MIME-Version: 1.0 References: <202002042102.014L28em011948@repo.freebsd.org> In-Reply-To: <202002042102.014L28em011948@repo.freebsd.org> From: Dmitry Chagin Date: Wed, 5 Feb 2020 00:08:01 +0300 Message-ID: Subject: Re: svn commit: r357530 - head/sys/kern To: Konstantin Belousov Cc: src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 48By315Sg4z4YZV X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 21:08:13 -0000 =D1=81=D1=80, 5 =D1=84=D0=B5=D0=B2=D1=80. 2020 =D0=B3. =D0=B2 00:02, Konsta= ntin Belousov : > Author: kib > Date: Tue Feb 4 21:02:08 2020 > New Revision: 357530 > URL: https://svnweb.freebsd.org/changeset/base/357530 > > Log: > Remove unneeded assert for curproc. Simplify. > > Reported by: syzkaller by markj > Sponsored by: The FreeBSD Foundation > > Modified: > head/sys/kern/kern_time.c > > Modified: head/sys/kern/kern_time.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/kern/kern_time.c Tue Feb 4 20:40:45 2020 (r357529) > +++ head/sys/kern/kern_time.c Tue Feb 4 21:02:08 2020 (r357530) > @@ -254,11 +254,8 @@ void > kern_thread_cputime(struct thread *targettd, struct timespec *ats) > { > uint64_t runtime, curtime, switchtime; > - struct proc *p; > > if (targettd =3D=3D NULL) { /* current thread */ > - p =3D curthread->td_proc; > - PROC_LOCK_ASSERT(p, MA_OWNED); > critical_enter(); > switchtime =3D PCPU_GET(switchtime); > curtime =3D cpu_ticks(); > @@ -266,8 +263,7 @@ kern_thread_cputime(struct thread *targettd, struct t= i > critical_exit(); > runtime +=3D curtime - switchtime; > } else { > - p =3D targettd->td_proc; > - PROC_LOCK_ASSERT(p, MA_OWNED); > + PROC_LOCK_ASSERT(targettd->td_proc, MA_OWNED); > thread_lock(targettd); > runtime =3D targettd->td_runtime; > thread_unlock(targettd); > 10x From owner-svn-src-all@freebsd.org Tue Feb 4 21:14:35 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3552D234AD8; Tue, 4 Feb 2020 21:14:35 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48ByBM0fbyz4Z13; Tue, 4 Feb 2020 21:14:35 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1185C1FFFB; Tue, 4 Feb 2020 21:14:35 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014LEYFU018717; Tue, 4 Feb 2020 21:14:34 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014LEY0x018716; Tue, 4 Feb 2020 21:14:34 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202002042114.014LEY0x018716@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 4 Feb 2020 21:14:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357531 - head/contrib/elftoolchain/libdwarf X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/contrib/elftoolchain/libdwarf X-SVN-Commit-Revision: 357531 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 21:14:35 -0000 Author: markj Date: Tue Feb 4 21:14:34 2020 New Revision: 357531 URL: https://svnweb.freebsd.org/changeset/base/357531 Log: libdwarf: Remove unnecessary NULL checks. All callers of _dwarf_add_expr() and _dwarf_expr_into_block() pass a non-NULL expr pointer, and these functions assume that expr is non-NULL anyway. CID: 1193305, 1193306 MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/contrib/elftoolchain/libdwarf/dwarf_pro_expr.c Modified: head/contrib/elftoolchain/libdwarf/dwarf_pro_expr.c ============================================================================== --- head/contrib/elftoolchain/libdwarf/dwarf_pro_expr.c Tue Feb 4 21:02:08 2020 (r357530) +++ head/contrib/elftoolchain/libdwarf/dwarf_pro_expr.c Tue Feb 4 21:14:34 2020 (r357531) @@ -36,10 +36,10 @@ _dwarf_add_expr(Dwarf_P_Expr expr, Dwarf_Small opcode, Dwarf_Debug dbg; int len; - dbg = expr != NULL ? expr->pe_dbg : NULL; + dbg = expr->pe_dbg; - if (_dwarf_loc_expr_add_atom(expr->pe_dbg, NULL, NULL, opcode, val1, - val2, &len, error) != DW_DLE_NONE) + if (_dwarf_loc_expr_add_atom(dbg, NULL, NULL, opcode, val1, val2, &len, + error) != DW_DLE_NONE) return (NULL); assert(len > 0); @@ -67,7 +67,7 @@ _dwarf_expr_into_block(Dwarf_P_Expr expr, Dwarf_Error Dwarf_Debug dbg; int len, pos, ret; - dbg = expr != NULL ? expr->pe_dbg : NULL; + dbg = expr->pe_dbg; if (expr->pe_block != NULL) { free(expr->pe_block); @@ -88,7 +88,7 @@ _dwarf_expr_into_block(Dwarf_P_Expr expr, Dwarf_Error pos = 0; STAILQ_FOREACH(ee, &expr->pe_eelist, ee_next) { assert((Dwarf_Unsigned) pos < expr->pe_length); - ret = _dwarf_loc_expr_add_atom(expr->pe_dbg, + ret = _dwarf_loc_expr_add_atom(dbg, &expr->pe_block[pos], &expr->pe_block[expr->pe_length], ee->ee_loc.lr_atom, ee->ee_loc.lr_number, ee->ee_loc.lr_number2, &len, error); From owner-svn-src-all@freebsd.org Tue Feb 4 21:14:54 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A5297234B44; Tue, 4 Feb 2020 21:14:54 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48ByBk3hg4z4Z7R; Tue, 4 Feb 2020 21:14:54 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7A03C1FFFC; Tue, 4 Feb 2020 21:14:54 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014LEs0k018776; Tue, 4 Feb 2020 21:14:54 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014LEs0O018775; Tue, 4 Feb 2020 21:14:54 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202002042114.014LEs0O018775@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 4 Feb 2020 21:14:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357532 - head/contrib/elftoolchain/libdwarf X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/contrib/elftoolchain/libdwarf X-SVN-Commit-Revision: 357532 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 21:14:54 -0000 Author: markj Date: Tue Feb 4 21:14:53 2020 New Revision: 357532 URL: https://svnweb.freebsd.org/changeset/base/357532 Log: libdwarf: Fix a possible memory leak in dwarf_add_AT_location_expr(). CID: 1193364 MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/contrib/elftoolchain/libdwarf/dwarf_pro_attr.c Modified: head/contrib/elftoolchain/libdwarf/dwarf_pro_attr.c ============================================================================== --- head/contrib/elftoolchain/libdwarf/dwarf_pro_attr.c Tue Feb 4 21:14:34 2020 (r357531) +++ head/contrib/elftoolchain/libdwarf/dwarf_pro_attr.c Tue Feb 4 21:14:53 2020 (r357532) @@ -46,8 +46,10 @@ dwarf_add_AT_location_expr(Dwarf_P_Debug dbg, Dwarf_P_ at->at_attrib = attr; at->at_expr = loc_expr; - if (_dwarf_expr_into_block(loc_expr, error) != DW_DLE_NONE) + if (_dwarf_expr_into_block(loc_expr, error) != DW_DLE_NONE) { + free(at); return (DW_DLV_BADADDR); + } at->u[0].u64 = loc_expr->pe_length; at->u[1].u8p = loc_expr->pe_block; if (loc_expr->pe_length <= UCHAR_MAX) From owner-svn-src-all@freebsd.org Tue Feb 4 21:15:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 356F3234BC3; Tue, 4 Feb 2020 21:15:12 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48ByC40HVbz4ZG0; Tue, 4 Feb 2020 21:15:12 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 04F751FFFD; Tue, 4 Feb 2020 21:15:12 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014LFBnv018850; Tue, 4 Feb 2020 21:15:11 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014LFB9Z018849; Tue, 4 Feb 2020 21:15:11 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202002042115.014LFB9Z018849@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 4 Feb 2020 21:15:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357533 - head/contrib/elftoolchain/libdwarf X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/contrib/elftoolchain/libdwarf X-SVN-Commit-Revision: 357533 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 21:15:12 -0000 Author: markj Date: Tue Feb 4 21:15:11 2020 New Revision: 357533 URL: https://svnweb.freebsd.org/changeset/base/357533 Log: libdwarf: Make an out-pointer of _dwarf_abbrev_add() mandatory. All callers pass a non-NULL pointer, and otherwise it was possible to leak memory if the abbrev was not added to a CU. CID: 1193365 MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/contrib/elftoolchain/libdwarf/libdwarf_abbrev.c Modified: head/contrib/elftoolchain/libdwarf/libdwarf_abbrev.c ============================================================================== --- head/contrib/elftoolchain/libdwarf/libdwarf_abbrev.c Tue Feb 4 21:14:53 2020 (r357532) +++ head/contrib/elftoolchain/libdwarf/libdwarf_abbrev.c Tue Feb 4 21:15:11 2020 (r357533) @@ -59,9 +59,7 @@ _dwarf_abbrev_add(Dwarf_CU cu, uint64_t entry, uint64_ HASH_ADD(ab_hh, cu->cu_abbrev_hash, ab_entry, sizeof(ab->ab_entry), ab); - if (abp != NULL) - *abp = ab; - + *abp = ab; return (DW_DLE_NONE); } From owner-svn-src-all@freebsd.org Tue Feb 4 21:15:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 05C5A234C4B; Tue, 4 Feb 2020 21:15:30 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48ByCP6S5Pz4ZNb; Tue, 4 Feb 2020 21:15:29 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D8D2A1FFFE; Tue, 4 Feb 2020 21:15:29 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014LFTvv018908; Tue, 4 Feb 2020 21:15:29 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014LFTCU018907; Tue, 4 Feb 2020 21:15:29 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202002042115.014LFTCU018907@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 4 Feb 2020 21:15:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357534 - head/contrib/elftoolchain/libdwarf X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/contrib/elftoolchain/libdwarf X-SVN-Commit-Revision: 357534 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 21:15:30 -0000 Author: markj Date: Tue Feb 4 21:15:29 2020 New Revision: 357534 URL: https://svnweb.freebsd.org/changeset/base/357534 Log: libdwarf: Fix a memory leak in _dwarf_frame_section_init(). If frame length validation failed we would leak memory. CID: 1193366 MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/contrib/elftoolchain/libdwarf/libdwarf_frame.c Modified: head/contrib/elftoolchain/libdwarf/libdwarf_frame.c ============================================================================== --- head/contrib/elftoolchain/libdwarf/libdwarf_frame.c Tue Feb 4 21:15:11 2020 (r357533) +++ head/contrib/elftoolchain/libdwarf/libdwarf_frame.c Tue Feb 4 21:15:29 2020 (r357534) @@ -468,9 +468,9 @@ _dwarf_frame_section_init(Dwarf_Debug dbg, Dwarf_Frame if (length > ds->ds_size - offset || (length == 0 && !eh_frame)) { - DWARF_SET_ERROR(dbg, error, - DW_DLE_DEBUG_FRAME_LENGTH_BAD); - return (DW_DLE_DEBUG_FRAME_LENGTH_BAD); + ret = DW_DLE_DEBUG_FRAME_LENGTH_BAD; + DWARF_SET_ERROR(dbg, error, ret); + goto fail_cleanup; } /* Check terminator for .eh_frame */ From owner-svn-src-all@freebsd.org Tue Feb 4 21:15:53 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4911B234CE7; Tue, 4 Feb 2020 21:15:53 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48ByCs0x1Cz4ZWM; Tue, 4 Feb 2020 21:15:53 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B2271FFFF; Tue, 4 Feb 2020 21:15:53 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014LFq96018969; Tue, 4 Feb 2020 21:15:52 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014LFqgQ018968; Tue, 4 Feb 2020 21:15:52 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202002042115.014LFqgQ018968@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 4 Feb 2020 21:15:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357535 - head/contrib/elftoolchain/libelftc X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/contrib/elftoolchain/libelftc X-SVN-Commit-Revision: 357535 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 21:15:53 -0000 Author: markj Date: Tue Feb 4 21:15:52 2020 New Revision: 357535 URL: https://svnweb.freebsd.org/changeset/base/357535 Log: libelftc: Fix memory leaks in the C++ demanglers. CID: 1262518, 1262519, 1262520, 1262529 MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/contrib/elftoolchain/libelftc/libelftc_dem_arm.c head/contrib/elftoolchain/libelftc/libelftc_dem_gnu2.c Modified: head/contrib/elftoolchain/libelftc/libelftc_dem_arm.c ============================================================================== --- head/contrib/elftoolchain/libelftc/libelftc_dem_arm.c Tue Feb 4 21:15:29 2020 (r357534) +++ head/contrib/elftoolchain/libelftc/libelftc_dem_arm.c Tue Feb 4 21:15:52 2020 (r357535) @@ -203,11 +203,13 @@ cpp_demangle_ARM(const char *org) break; if ((arg = vector_str_substr(&d.vec, arg_begin, d.vec.size - 1, - &arg_len)) == NULL) + &arg_len)) == NULL) goto clean; - if (vector_str_push(&d.arg, arg, arg_len) == false) + if (vector_str_push(&d.arg, arg, arg_len) == false) { + free(arg); goto clean; + } free(arg); @@ -956,7 +958,7 @@ read_op_user(struct demangle_data *d) goto clean; if (VEC_PUSH_STR(&d->vec, "::operator ") == false) - return (false); + goto clean; if (vector_str_push(&d->vec, to_str, to_len) == false) goto clean; Modified: head/contrib/elftoolchain/libelftc/libelftc_dem_gnu2.c ============================================================================== --- head/contrib/elftoolchain/libelftc/libelftc_dem_gnu2.c Tue Feb 4 21:15:29 2020 (r357534) +++ head/contrib/elftoolchain/libelftc/libelftc_dem_gnu2.c Tue Feb 4 21:15:52 2020 (r357535) @@ -216,11 +216,13 @@ cpp_demangle_gnu2(const char *org) break; if ((arg = vector_str_substr(&d.vec, arg_begin, d.vec.size - 1, - &arg_len)) == NULL) + &arg_len)) == NULL) goto clean; - if (vector_str_push(&d.arg, arg, arg_len) == false) + if (vector_str_push(&d.arg, arg, arg_len) == false) { + free(arg); goto clean; + } free(arg); From owner-svn-src-all@freebsd.org Tue Feb 4 21:16:17 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6AABE234D77; Tue, 4 Feb 2020 21:16:17 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48ByDK223wz4ZfB; Tue, 4 Feb 2020 21:16:17 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 26AE920001; Tue, 4 Feb 2020 21:16:17 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014LGHVm019032; Tue, 4 Feb 2020 21:16:17 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014LGGqV019030; Tue, 4 Feb 2020 21:16:16 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202002042116.014LGGqV019030@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 4 Feb 2020 21:16:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357536 - head/contrib/elftoolchain/libelftc X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/contrib/elftoolchain/libelftc X-SVN-Commit-Revision: 357536 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 21:16:17 -0000 Author: markj Date: Tue Feb 4 21:16:16 2020 New Revision: 357536 URL: https://svnweb.freebsd.org/changeset/base/357536 Log: libelftc: Add a missing check for an error from vector_str_init(). While here consistently use the same spelling for such checks. CID: 1376769 MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/contrib/elftoolchain/libelftc/libelftc_dem_arm.c head/contrib/elftoolchain/libelftc/libelftc_dem_gnu2.c head/contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c Modified: head/contrib/elftoolchain/libelftc/libelftc_dem_arm.c ============================================================================== --- head/contrib/elftoolchain/libelftc/libelftc_dem_arm.c Tue Feb 4 21:15:52 2020 (r357535) +++ head/contrib/elftoolchain/libelftc/libelftc_dem_arm.c Tue Feb 4 21:16:16 2020 (r357536) @@ -303,12 +303,11 @@ init_demangle_data(struct demangle_data *d) d->type = ENCODE_FUNC; - if (vector_str_init(&d->vec) == false) + if (!vector_str_init(&d->vec)) return (false); - if (vector_str_init(&d->arg) == false) { + if (!vector_str_init(&d->arg)) { vector_str_dest(&d->vec); - return (false); } Modified: head/contrib/elftoolchain/libelftc/libelftc_dem_gnu2.c ============================================================================== --- head/contrib/elftoolchain/libelftc/libelftc_dem_gnu2.c Tue Feb 4 21:15:52 2020 (r357535) +++ head/contrib/elftoolchain/libelftc/libelftc_dem_gnu2.c Tue Feb 4 21:16:16 2020 (r357536) @@ -389,12 +389,11 @@ init_demangle_data(struct demangle_data *d) d->type = ENCODE_FUNC; - if (vector_str_init(&d->vec) == false) + if (!vector_str_init(&d->vec)) return (false); - if (vector_str_init(&d->arg) == false) { + if (!vector_str_init(&d->arg)) { vector_str_dest(&d->vec); - return (false); } Modified: head/contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c ============================================================================== --- head/contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c Tue Feb 4 21:15:52 2020 (r357535) +++ head/contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c Tue Feb 4 21:16:16 2020 (r357536) @@ -1659,7 +1659,8 @@ cpp_demangle_read_local_name(struct cpp_demangle_data if (*(++ddata->cur) == '\0') return (0); - vector_str_init(&local_name); + if (!vector_str_init(&local_name)) + return (0); ddata->cur_output = &local_name; if (!cpp_demangle_read_encoding(ddata)) { @@ -3953,7 +3954,7 @@ vector_type_qualifier_init(struct vector_type_qualifie assert(v->q_container != NULL); - if (vector_str_init(&v->ext_name) == false) { + if (!vector_str_init(&v->ext_name)) { free(v->q_container); return (0); } From owner-svn-src-all@freebsd.org Tue Feb 4 21:16:41 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BBF13234E11; Tue, 4 Feb 2020 21:16:41 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48ByDn4510z4Zmx; Tue, 4 Feb 2020 21:16:41 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 876E420003; Tue, 4 Feb 2020 21:16:41 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014LGfBR019095; Tue, 4 Feb 2020 21:16:41 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014LGf9p019094; Tue, 4 Feb 2020 21:16:41 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202002042116.014LGf9p019094@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 4 Feb 2020 21:16:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357537 - head/contrib/elftoolchain/elfcopy X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/contrib/elftoolchain/elfcopy X-SVN-Commit-Revision: 357537 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 21:16:41 -0000 Author: markj Date: Tue Feb 4 21:16:41 2020 New Revision: 357537 URL: https://svnweb.freebsd.org/changeset/base/357537 Log: elfcopy: Handle multiple data descriptors properly. The code clearly meant to resize the buffer in the case where a section was backed by multiple data descriptors. In practice this shouldn't have been a problem since libelf would return a single data descriptor for each section in a newly opened file. CID: 1262522 MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/contrib/elftoolchain/elfcopy/sections.c Modified: head/contrib/elftoolchain/elfcopy/sections.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/sections.c Tue Feb 4 21:16:16 2020 (r357536) +++ head/contrib/elftoolchain/elfcopy/sections.c Tue Feb 4 21:16:41 2020 (r357537) @@ -1137,7 +1137,7 @@ read_section(struct section *s, size_t *size) if (b == NULL) b = malloc(id->d_size); else - b = malloc(sz + id->d_size); + b = realloc(b, sz + id->d_size); if (b == NULL) err(EXIT_FAILURE, "malloc or realloc failed"); From owner-svn-src-all@freebsd.org Tue Feb 4 21:16:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6D5D2234E95; Tue, 4 Feb 2020 21:16:57 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48ByF5240Xz4ZvH; Tue, 4 Feb 2020 21:16:57 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 424CF20004; Tue, 4 Feb 2020 21:16:57 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014LGvkE019148; Tue, 4 Feb 2020 21:16:57 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014LGvU4019147; Tue, 4 Feb 2020 21:16:57 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202002042116.014LGvU4019147@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 4 Feb 2020 21:16:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357538 - head/contrib/elftoolchain/elfcopy X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/contrib/elftoolchain/elfcopy X-SVN-Commit-Revision: 357538 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 21:16:57 -0000 Author: markj Date: Tue Feb 4 21:16:56 2020 New Revision: 357538 URL: https://svnweb.freebsd.org/changeset/base/357538 Log: elfcopy: Avoid leaking dst's fd when we fail to copy a file. We should really create the output file in the same directory as the destination file so that rename() works. This will be done in a future change as part of some work to run in capability mode. CID: 1262523 MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/contrib/elftoolchain/elfcopy/main.c Modified: head/contrib/elftoolchain/elfcopy/main.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/main.c Tue Feb 4 21:16:41 2020 (r357537) +++ head/contrib/elftoolchain/elfcopy/main.c Tue Feb 4 21:16:56 2020 (r357538) @@ -587,15 +587,19 @@ copy_from_tempfile(const char *src, const char *dst, i if ((tmpfd = open(dst, O_CREAT | O_TRUNC | O_WRONLY, 0755)) < 0) return (-1); - if (elftc_copyfile(infd, tmpfd) < 0) + if (elftc_copyfile(infd, tmpfd) < 0) { + (void) close(tmpfd); return (-1); + } /* * Remove the temporary file from the file system * namespace, and close its file descriptor. */ - if (unlink(src) < 0) + if (unlink(src) < 0) { + (void) close(tmpfd); return (-1); + } (void) close(infd); From owner-svn-src-all@freebsd.org Tue Feb 4 21:18:00 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5C098234F30; Tue, 4 Feb 2020 21:18:00 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48ByGJ18Shz4b3L; Tue, 4 Feb 2020 21:18:00 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 08E4120005; Tue, 4 Feb 2020 21:18:00 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014LHxwr019235; Tue, 4 Feb 2020 21:17:59 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014LHx1P019234; Tue, 4 Feb 2020 21:17:59 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202002042117.014LHx1P019234@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 4 Feb 2020 21:17:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357539 - head/contrib/elftoolchain/size X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/contrib/elftoolchain/size X-SVN-Commit-Revision: 357539 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 21:18:00 -0000 Author: markj Date: Tue Feb 4 21:17:59 2020 New Revision: 357539 URL: https://svnweb.freebsd.org/changeset/base/357539 Log: size: Avoid returning a stack pointer from xlatetom(). The callers only check whether the returned pointer is non-NULL, so this was harmless in practice, but change the return value to guard against the issue. CID: 1411597 MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/contrib/elftoolchain/size/size.c Modified: head/contrib/elftoolchain/size/size.c ============================================================================== --- head/contrib/elftoolchain/size/size.c Tue Feb 4 21:16:56 2020 (r357538) +++ head/contrib/elftoolchain/size/size.c Tue Feb 4 21:17:59 2020 (r357539) @@ -240,7 +240,7 @@ main(int argc, char **argv) return (rc); } -static Elf_Data * +static int xlatetom(Elf *elf, GElf_Ehdr *elfhdr, void *_src, void *_dst, Elf_Type type, size_t size) { @@ -253,7 +253,8 @@ xlatetom(Elf *elf, GElf_Ehdr *elfhdr, void *_src, void dst.d_buf = _dst; dst.d_version = elfhdr->e_version; dst.d_size = size; - return (gelf_xlatetom(elf, &dst, &src, elfhdr->e_ident[EI_DATA])); + return (gelf_xlatetom(elf, &dst, &src, elfhdr->e_ident[EI_DATA]) != + NULL ? 0 : 1); } #define NOTE_OFFSET_32(nhdr, namesz, offset) \ @@ -314,12 +315,12 @@ handle_core_note(Elf *elf, GElf_Ehdr *elfhdr, GElf_Phd while (data != NULL && offset + sizeof(Elf32_Nhdr) < segment_end) { nhdr = (Elf32_Nhdr *)(uintptr_t)((char*)data + offset); memset(&nhdr_l, 0, sizeof(Elf32_Nhdr)); - if (!xlatetom(elf, elfhdr, &nhdr->n_type, &nhdr_l.n_type, - ELF_T_WORD, sizeof(Elf32_Word)) || - !xlatetom(elf, elfhdr, &nhdr->n_descsz, &nhdr_l.n_descsz, - ELF_T_WORD, sizeof(Elf32_Word)) || - !xlatetom(elf, elfhdr, &nhdr->n_namesz, &nhdr_l.n_namesz, - ELF_T_WORD, sizeof(Elf32_Word))) + if (xlatetom(elf, elfhdr, &nhdr->n_type, &nhdr_l.n_type, + ELF_T_WORD, sizeof(Elf32_Word)) != 0 || + xlatetom(elf, elfhdr, &nhdr->n_descsz, &nhdr_l.n_descsz, + ELF_T_WORD, sizeof(Elf32_Word)) != 0 || + xlatetom(elf, elfhdr, &nhdr->n_namesz, &nhdr_l.n_namesz, + ELF_T_WORD, sizeof(Elf32_Word)) != 0) break; if (offset + sizeof(Elf32_Nhdr) + @@ -356,10 +357,10 @@ handle_core_note(Elf *elf, GElf_Ehdr *elfhdr, GElf_Phd pid = PID64(nhdr, nhdr_l.n_namesz, 40); } - xlatetom(elf, elfhdr, &raw_size, &raw_size, - ELF_T_WORD, sizeof(uint64_t)); - xlatetom(elf, elfhdr, &pid, &pid, ELF_T_WORD, - sizeof(pid_t)); + (void)xlatetom(elf, elfhdr, &raw_size, + &raw_size, ELF_T_WORD, sizeof(uint64_t)); + (void)xlatetom(elf, elfhdr, &pid, &pid, + ELF_T_WORD, sizeof(pid_t)); } if (raw_size != 0 && style == STYLE_SYSV) { From owner-svn-src-all@freebsd.org Tue Feb 4 21:18:17 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2C9EF234F98; Tue, 4 Feb 2020 21:18:17 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48ByGd08YHz4b9r; Tue, 4 Feb 2020 21:18:17 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0082D20006; Tue, 4 Feb 2020 21:18:17 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014LIGCg019295; Tue, 4 Feb 2020 21:18:16 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014LIGeb019294; Tue, 4 Feb 2020 21:18:16 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202002042118.014LIGeb019294@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 4 Feb 2020 21:18:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357540 - head/contrib/elftoolchain/readelf X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/contrib/elftoolchain/readelf X-SVN-Commit-Revision: 357540 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 21:18:17 -0000 Author: markj Date: Tue Feb 4 21:18:16 2020 New Revision: 357540 URL: https://svnweb.freebsd.org/changeset/base/357540 Log: readelf: Fix a double close of the input file. The caller of dump_object() is responsible for opening the file, let it be responsible for closing too. CID: 1411588 MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/contrib/elftoolchain/readelf/readelf.c Modified: head/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- head/contrib/elftoolchain/readelf/readelf.c Tue Feb 4 21:17:59 2020 (r357539) +++ head/contrib/elftoolchain/readelf/readelf.c Tue Feb 4 21:18:16 2020 (r357540) @@ -7247,7 +7247,6 @@ dump_object(struct readelf *re, int fd) done: elf_end(re->elf); - close(fd); } static void From owner-svn-src-all@freebsd.org Tue Feb 4 21:18:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 96481235036; Tue, 4 Feb 2020 21:18:38 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48ByH2335Nz4bJp; Tue, 4 Feb 2020 21:18:38 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6397920007; Tue, 4 Feb 2020 21:18:38 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014LIcvZ019355; Tue, 4 Feb 2020 21:18:38 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014LIc7Y019354; Tue, 4 Feb 2020 21:18:38 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202002042118.014LIc7Y019354@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 4 Feb 2020 21:18:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357541 - head/contrib/elftoolchain/readelf X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/contrib/elftoolchain/readelf X-SVN-Commit-Revision: 357541 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 21:18:38 -0000 Author: markj Date: Tue Feb 4 21:18:37 2020 New Revision: 357541 URL: https://svnweb.freebsd.org/changeset/base/357541 Log: readelf: Fix the check for an error from realloc(). Use err() instead of errx() while here, since realloc() sets errno. CID: 1401326 MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/contrib/elftoolchain/readelf/readelf.c Modified: head/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- head/contrib/elftoolchain/readelf/readelf.c Tue Feb 4 21:18:16 2020 (r357540) +++ head/contrib/elftoolchain/readelf/readelf.c Tue Feb 4 21:18:37 2020 (r357541) @@ -6298,8 +6298,8 @@ search_loclist_at(struct readelf *re, Dwarf_Die die, D if (*la_list_cap == *la_list_len) { *la_list = realloc(*la_list, *la_list_cap * 2 * sizeof(**la_list)); - if (la_list == NULL) - errx(EXIT_FAILURE, "realloc failed"); + if (*la_list == NULL) + err(EXIT_FAILURE, "realloc failed"); *la_list_cap *= 2; } la = &((*la_list)[*la_list_len]); From owner-svn-src-all@freebsd.org Tue Feb 4 21:18:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 67CFE2350CB; Tue, 4 Feb 2020 21:18:57 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48ByHP287bz4bRL; Tue, 4 Feb 2020 21:18:57 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 44A9B20008; Tue, 4 Feb 2020 21:18:57 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014LIvsM019415; Tue, 4 Feb 2020 21:18:57 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014LIvL0019414; Tue, 4 Feb 2020 21:18:57 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202002042118.014LIvL0019414@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 4 Feb 2020 21:18:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357542 - head/contrib/elftoolchain/readelf X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/contrib/elftoolchain/readelf X-SVN-Commit-Revision: 357542 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 21:18:57 -0000 Author: markj Date: Tue Feb 4 21:18:56 2020 New Revision: 357542 URL: https://svnweb.freebsd.org/changeset/base/357542 Log: readelf: Don't leak memory when dwarf_get_fde_info_for_all_regs() fails. CID: 1292493 MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/contrib/elftoolchain/readelf/readelf.c Modified: head/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- head/contrib/elftoolchain/readelf/readelf.c Tue Feb 4 21:18:37 2020 (r357541) +++ head/contrib/elftoolchain/readelf/readelf.c Tue Feb 4 21:18:56 2020 (r357542) @@ -5964,6 +5964,7 @@ dump_dwarf_frame_regtable(struct readelf *re, Dwarf_Fd for (; cur_pc < end_pc; cur_pc++) { if (dwarf_get_fde_info_for_all_regs(fde, cur_pc, &rt, &row_pc, &de) != DW_DLV_OK) { + free(vec); warnx("dwarf_get_fde_info_for_all_regs failed: %s\n", dwarf_errmsg(de)); return (-1); From owner-svn-src-all@freebsd.org Tue Feb 4 21:27:40 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4F7A723548F; Tue, 4 Feb 2020 21:27:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48ByTS1RKlz4bvq; Tue, 4 Feb 2020 21:27:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2C913201D5; Tue, 4 Feb 2020 21:27:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014LReXt025182; Tue, 4 Feb 2020 21:27:40 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014LRd5x025181; Tue, 4 Feb 2020 21:27:39 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202002042127.014LRd5x025181@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 4 Feb 2020 21:27:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357543 - in head: share/mk tools/build/options usr.sbin usr.sbin/simple_httpd X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: share/mk tools/build/options usr.sbin usr.sbin/simple_httpd X-SVN-Commit-Revision: 357543 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 21:27:40 -0000 Author: kevans Date: Tue Feb 4 21:27:39 2020 New Revision: 357543 URL: https://svnweb.freebsd.org/changeset/base/357543 Log: Remove simple_httpd simple_httpd was granted a reprieve from the picobsd removal based on having some reported user; it turns out this user isn't actually using the version in base and merging their changes would be difficult at this point, so the version in base will simply continue to rot. Retire it now, it may make a comeback to ports with the improved version. No notice issued because its current visibility has only been for ~3 months, and a notice has been previously issued about picobsd removal. Deleted: head/tools/build/options/WITHOUT_HTTPD head/tools/build/options/WITH_HTTPD head/usr.sbin/simple_httpd/ Modified: head/share/mk/src.opts.mk head/usr.sbin/Makefile Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Tue Feb 4 21:18:56 2020 (r357542) +++ head/share/mk/src.opts.mk Tue Feb 4 21:27:39 2020 (r357543) @@ -205,7 +205,6 @@ __DEFAULT_NO_OPTIONS = \ GNU_GREP_COMPAT \ GPL_DTC \ HESIOD \ - HTTPD \ LIBSOFT \ LOADER_FIREWIRE \ LOADER_FORCE_LE \ Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Tue Feb 4 21:18:56 2020 (r357542) +++ head/usr.sbin/Makefile Tue Feb 4 21:27:39 2020 (r357543) @@ -142,7 +142,6 @@ SUBDIR.${MK_FMTREE}+= fmtree SUBDIR.${MK_FREEBSD_UPDATE}+= freebsd-update SUBDIR.${MK_GSSAPI}+= gssd SUBDIR.${MK_GPIO}+= gpioctl -SUBDIR.${MK_HTTPD}+= simple_httpd SUBDIR.${MK_INET6}+= ip6addrctl SUBDIR.${MK_INET6}+= mld6query SUBDIR.${MK_INET6}+= ndp From owner-svn-src-all@freebsd.org Tue Feb 4 21:28:05 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0279B235529; Tue, 4 Feb 2020 21:28:05 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48ByTw5vtkz4c3R; Tue, 4 Feb 2020 21:28:04 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C6245201D7; Tue, 4 Feb 2020 21:28:04 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014LS4NB025246; Tue, 4 Feb 2020 21:28:04 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014LS4FK025245; Tue, 4 Feb 2020 21:28:04 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202002042128.014LS4FK025245@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 4 Feb 2020 21:28:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357544 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 357544 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 21:28:05 -0000 Author: kevans Date: Tue Feb 4 21:28:04 2020 New Revision: 357544 URL: https://svnweb.freebsd.org/changeset/base/357544 Log: src.conf(5): regen after r357543, HTTPD removal Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Tue Feb 4 21:27:39 2020 (r357543) +++ head/share/man/man5/src.conf.5 Tue Feb 4 21:28:04 2020 (r357544) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd January 31, 2020 +.Dd February 4, 2020 .Dt SRC.CONF 5 .Os .Sh NAME @@ -797,8 +797,6 @@ and related utilities. Set to build Hesiod support. .It Va WITHOUT_HTML Set to not build HTML docs. -.It Va WITH_HTTPD -Set to build and install simple_httpd .It Va WITHOUT_HYPERV Set to not build or install HyperV utilities. .Pp From owner-svn-src-all@freebsd.org Tue Feb 4 21:43:40 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 03D65235DDD; Tue, 4 Feb 2020 21:43:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Byqv6Jjxz4dB2; Tue, 4 Feb 2020 21:43:39 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D3D4D2057B; Tue, 4 Feb 2020 21:43:39 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014Lhd5H037379; Tue, 4 Feb 2020 21:43:39 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014LhdcW037378; Tue, 4 Feb 2020 21:43:39 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202002042143.014LhdcW037378@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 4 Feb 2020 21:43:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357545 - head X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 357545 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 21:43:40 -0000 Author: kevans Date: Tue Feb 4 21:43:39 2020 New Revision: 357545 URL: https://svnweb.freebsd.org/changeset/base/357545 Log: ObsoleteFiles: Update after simple_httpd removal There should have perhaps been an entry in OptionalObsoleteFiles for it before, but alas- let it be removed now with `make delete-old` if it was installed. Reported by: Oliver Pinter Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Tue Feb 4 21:28:04 2020 (r357544) +++ head/ObsoleteFiles.inc Tue Feb 4 21:43:39 2020 (r357545) @@ -36,6 +36,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20200204: simple_httpd removed +OLD_FILES+=usr/sbin/simple_httpd + # 20200127: vpo removed OLD_FILES+=usr/share/man/man4/imm.4.gz OLD_FILES+=usr/share/man/man4/vpo.4.gz From owner-svn-src-all@freebsd.org Tue Feb 4 22:39:58 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E302F237397; Tue, 4 Feb 2020 22:39:58 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48C04t5k4cz3CZh; Tue, 4 Feb 2020 22:39:58 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB5F520ED2; Tue, 4 Feb 2020 22:39:58 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014MdwTb068037; Tue, 4 Feb 2020 22:39:58 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014MdwZh068036; Tue, 4 Feb 2020 22:39:58 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <202002042239.014MdwZh068036@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Tue, 4 Feb 2020 22:39:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357546 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 357546 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 22:39:58 -0000 Author: rlibby Date: Tue Feb 4 22:39:58 2020 New Revision: 357546 URL: https://svnweb.freebsd.org/changeset/base/357546 Log: uma: pcpu_page_free needs to startup_free pages from startup_alloc After r357392, it is apparent that we do have some early-boot PCPU zones. Make it so we can safely free pages from them if they are actually used during early boot. Reviewed by: jeff, markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D23496 Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Tue Feb 4 21:43:39 2020 (r357545) +++ head/sys/vm/uma_core.c Tue Feb 4 22:39:58 2020 (r357546) @@ -1704,6 +1704,12 @@ pcpu_page_free(void *mem, vm_size_t size, uint8_t flag vm_page_t m; MPASS(size == (mp_maxid+1)*PAGE_SIZE); + + if ((flags & UMA_SLAB_BOOT) != 0) { + startup_free(mem, size); + return; + } + sva = (vm_offset_t)mem; for (curva = sva; curva < sva + size; curva += PAGE_SIZE) { paddr = pmap_kextract(curva); From owner-svn-src-all@freebsd.org Tue Feb 4 22:40:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A4390237412; Tue, 4 Feb 2020 22:40:12 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48C0583q0fz3CjM; Tue, 4 Feb 2020 22:40:12 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 52A4420EDA; Tue, 4 Feb 2020 22:40:12 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014MeCiH068136; Tue, 4 Feb 2020 22:40:12 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014MeBfO068132; Tue, 4 Feb 2020 22:40:11 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <202002042240.014MeBfO068132@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Tue, 4 Feb 2020 22:40:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357547 - in head: share/man/man9 sys/vm X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: in head: share/man/man9 sys/vm X-SVN-Commit-Revision: 357547 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 22:40:12 -0000 Author: rlibby Date: Tue Feb 4 22:40:11 2020 New Revision: 357547 URL: https://svnweb.freebsd.org/changeset/base/357547 Log: uma: add UMA_ZONE_CONTIG, and a default contig_alloc For now, copy the mbuf allocator. Reviewed by: jeff, markj (previous version) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D23237 Modified: head/share/man/man9/zone.9 head/sys/vm/uma.h head/sys/vm/uma_core.c head/sys/vm/uma_int.h Modified: head/share/man/man9/zone.9 ============================================================================== --- head/share/man/man9/zone.9 Tue Feb 4 22:39:58 2020 (r357546) +++ head/share/man/man9/zone.9 Tue Feb 4 22:40:11 2020 (r357547) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 8, 2020 +.Dd February 4, 2020 .Dt UMA 9 .Os .Sh NAME @@ -340,6 +340,10 @@ was allocated will cause mixing in per-CPU caches. See .Xr numa 4 for more details. +.It Dv UMA_ZONE_CONTIG +Items in this zone must be contiguous in physical address space. +Items will follow normal alignment constraints and may span page boundaries +between pages with contiguous physical addresses. .El .Pp Zones can be destroyed using @@ -465,12 +469,8 @@ and .Fn uma_zone_set_freef functions allow a zone's default slab allocation and free functions to be overridden. -This is useful if the zone's items have special memory allocation constraints. -For example, if multi-page objects are required to be physically contiguous, -an -.Fa allocf -function which requests contiguous memory from the kernel's page allocator -may be used. +This is useful if memory with special constraints such as attributes, +alignment, or address ranges must be used. .Pp The .Fn uma_zone_set_max Modified: head/sys/vm/uma.h ============================================================================== --- head/sys/vm/uma.h Tue Feb 4 22:39:58 2020 (r357546) +++ head/sys/vm/uma.h Tue Feb 4 22:40:11 2020 (r357547) @@ -236,6 +236,10 @@ uma_zone_t uma_zcache_create(char *name, int size, uma * overlap when adding new features. */ #define UMA_ZONE_ZINIT 0x0002 /* Initialize with zeros */ +#define UMA_ZONE_CONTIG 0x0004 /* + * Physical memory underlying an object + * must be contiguous. + */ #define UMA_ZONE_NOTOUCH 0x0008 /* UMA may not access the memory */ #define UMA_ZONE_MALLOC 0x0010 /* For use by malloc(9) only! */ #define UMA_ZONE_NOFREE 0x0020 /* Do not free slabs of this type! */ @@ -639,8 +643,7 @@ smr_t uma_zone_get_smr(uma_zone_t zone); #define UMA_SLAB_BOOT 0x01 /* Slab alloced from boot pages */ #define UMA_SLAB_KERNEL 0x04 /* Slab alloced from kmem */ #define UMA_SLAB_PRIV 0x08 /* Slab alloced from priv allocator */ -#define UMA_SLAB_OFFP 0x10 /* Slab is managed separately */ -/* 0x02, 0x40, and 0x80 are available */ +/* 0x02, 0x10, 0x40, and 0x80 are available */ /* * Used to pre-fill a zone with some number of items Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Tue Feb 4 22:39:58 2020 (r357546) +++ head/sys/vm/uma_core.c Tue Feb 4 22:40:11 2020 (r357547) @@ -271,6 +271,7 @@ static void *noobj_alloc(uma_zone_t, vm_size_t, int, u static void *page_alloc(uma_zone_t, vm_size_t, int, uint8_t *, int); static void *pcpu_page_alloc(uma_zone_t, vm_size_t, int, uint8_t *, int); static void *startup_alloc(uma_zone_t, vm_size_t, int, uint8_t *, int); +static void *contig_alloc(uma_zone_t, vm_size_t, int, uint8_t *, int); static void page_free(void *, vm_size_t, uint8_t); static void pcpu_page_free(void *, vm_size_t, uint8_t); static uma_slab_t keg_alloc_slab(uma_keg_t, uma_zone_t, int, int, int); @@ -1660,6 +1661,19 @@ noobj_alloc(uma_zone_t zone, vm_size_t bytes, int doma } /* + * Allocate physically contiguous pages. + */ +static void * +contig_alloc(uma_zone_t zone, vm_size_t bytes, int domain, uint8_t *pflag, + int wait) +{ + + *pflag = UMA_SLAB_KERNEL; + return ((void *)kmem_alloc_contig_domainset(DOMAINSET_FIXED(domain), + bytes, wait, 0, ~(vm_paddr_t)0, 1, 0, VM_MEMATTR_DEFAULT)); +} + +/* * Frees a number of pages to the system * * Arguments: @@ -1679,8 +1693,8 @@ page_free(void *mem, vm_size_t size, uint8_t flags) return; } - if ((flags & UMA_SLAB_KERNEL) == 0) - panic("UMA: page_free used with invalid flags %x", flags); + KASSERT((flags & UMA_SLAB_KERNEL) != 0, + ("UMA: page_free used with invalid flags %x", flags)); kmem_free((vm_offset_t)mem, size); } @@ -2044,6 +2058,8 @@ keg_ctor(void *mem, int size, void *udata, int flags) keg->uk_allocf = startup_alloc; else if (keg->uk_flags & UMA_ZONE_PCPU) keg->uk_allocf = pcpu_page_alloc; + else if ((keg->uk_flags & UMA_ZONE_CONTIG) != 0 && keg->uk_ppera > 1) + keg->uk_allocf = contig_alloc; else keg->uk_allocf = page_alloc; #ifdef UMA_MD_SMALL_ALLOC @@ -2105,10 +2121,17 @@ zone_kva_available(uma_zone_t zone, void *unused) if ((zone->uz_flags & UMA_ZFLAG_CACHE) != 0) return; KEG_GET(zone, keg); - if (keg->uk_flags & UMA_ZONE_PCPU) - keg->uk_allocf = pcpu_page_alloc; - else if (keg->uk_allocf == startup_alloc) - keg->uk_allocf = page_alloc; + + if (keg->uk_allocf == startup_alloc) { + /* Switch to the real allocator. */ + if (keg->uk_flags & UMA_ZONE_PCPU) + keg->uk_allocf = pcpu_page_alloc; + else if ((keg->uk_flags & UMA_ZONE_CONTIG) != 0 && + keg->uk_ppera > 1) + keg->uk_allocf = contig_alloc; + else + keg->uk_allocf = page_alloc; + } } static void Modified: head/sys/vm/uma_int.h ============================================================================== --- head/sys/vm/uma_int.h Tue Feb 4 22:39:58 2020 (r357546) +++ head/sys/vm/uma_int.h Tue Feb 4 22:40:11 2020 (r357547) @@ -200,6 +200,7 @@ "\6NOFREE" \ "\5MALLOC" \ "\4NOTOUCH" \ + "\3CONTIG" \ "\2ZINIT" /* From owner-svn-src-all@freebsd.org Tue Feb 4 22:40:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 75325237483; Tue, 4 Feb 2020 22:40:24 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48C05N2Vl6z3Crj; Tue, 4 Feb 2020 22:40:24 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5119B20EDB; Tue, 4 Feb 2020 22:40:24 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014MeOhd068199; Tue, 4 Feb 2020 22:40:24 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014MeNYk068193; Tue, 4 Feb 2020 22:40:23 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <202002042240.014MeNYk068193@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Tue, 4 Feb 2020 22:40:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357548 - in head/sys: i386/i386 kern powerpc/aim X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: in head/sys: i386/i386 kern powerpc/aim X-SVN-Commit-Revision: 357548 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 22:40:24 -0000 Author: rlibby Date: Tue Feb 4 22:40:23 2020 New Revision: 357548 URL: https://svnweb.freebsd.org/changeset/base/357548 Log: uma: convert mbuf_jumbo_alloc to UMA_ZONE_CONTIG & tag others Remove mbuf_jumbo_alloc and let large mbuf zones use the new uma default contig allocator (a copy of mbuf_jumbo_alloc). Tag other zones which require contiguous objects, even if they don't use the new default contig allocator, so that uma knows about their constraints. Reviewed by: jeff, markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D23238 Modified: head/sys/i386/i386/pmap.c head/sys/kern/kern_mbuf.c head/sys/powerpc/aim/slb.c Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Tue Feb 4 22:40:11 2020 (r357547) +++ head/sys/i386/i386/pmap.c Tue Feb 4 22:40:23 2020 (r357548) @@ -1064,7 +1064,7 @@ __CONCAT(PMTYPE, init)(void) #ifdef PMAP_PAE_COMP pdptzone = uma_zcreate("PDPT", NPGPTD * sizeof(pdpt_entry_t), NULL, NULL, NULL, NULL, (NPGPTD * sizeof(pdpt_entry_t)) - 1, - UMA_ZONE_VM | UMA_ZONE_NOFREE); + UMA_ZONE_CONTIG | UMA_ZONE_VM | UMA_ZONE_NOFREE); uma_zone_set_allocf(pdptzone, pmap_pdpt_allocf); #endif Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Tue Feb 4 22:40:11 2020 (r357547) +++ head/sys/kern/kern_mbuf.c Tue Feb 4 22:40:23 2020 (r357548) @@ -303,7 +303,6 @@ static void mb_dtor_pack(void *, int, void *); static int mb_zinit_pack(void *, int, int); static void mb_zfini_pack(void *, int); static void mb_reclaim(uma_zone_t, int); -static void *mbuf_jumbo_alloc(uma_zone_t, vm_size_t, int, uint8_t *, int); /* Ensure that MSIZE is a power of 2. */ CTASSERT((((MSIZE - 1) ^ MSIZE) + 1) >> 1 == MSIZE); @@ -323,7 +322,7 @@ mbuf_init(void *dummy) */ zone_mbuf = uma_zcreate(MBUF_MEM_NAME, MSIZE, mb_ctor_mbuf, mb_dtor_mbuf, NULL, NULL, - MSIZE - 1, UMA_ZONE_MAXBUCKET); + MSIZE - 1, UMA_ZONE_CONTIG | UMA_ZONE_MAXBUCKET); if (nmbufs > 0) nmbufs = uma_zone_set_max(zone_mbuf, nmbufs); uma_zone_set_warning(zone_mbuf, "kern.ipc.nmbufs limit reached"); @@ -331,7 +330,7 @@ mbuf_init(void *dummy) zone_clust = uma_zcreate(MBUF_CLUSTER_MEM_NAME, MCLBYTES, mb_ctor_clust, NULL, NULL, NULL, - UMA_ALIGN_PTR, 0); + UMA_ALIGN_PTR, UMA_ZONE_CONTIG); if (nmbclusters > 0) nmbclusters = uma_zone_set_max(zone_clust, nmbclusters); uma_zone_set_warning(zone_clust, "kern.ipc.nmbclusters limit reached"); @@ -343,7 +342,7 @@ mbuf_init(void *dummy) /* Make jumbo frame zone too. Page size, 9k and 16k. */ zone_jumbop = uma_zcreate(MBUF_JUMBOP_MEM_NAME, MJUMPAGESIZE, mb_ctor_clust, NULL, NULL, NULL, - UMA_ALIGN_PTR, 0); + UMA_ALIGN_PTR, UMA_ZONE_CONTIG); if (nmbjumbop > 0) nmbjumbop = uma_zone_set_max(zone_jumbop, nmbjumbop); uma_zone_set_warning(zone_jumbop, "kern.ipc.nmbjumbop limit reached"); @@ -351,8 +350,7 @@ mbuf_init(void *dummy) zone_jumbo9 = uma_zcreate(MBUF_JUMBO9_MEM_NAME, MJUM9BYTES, mb_ctor_clust, NULL, NULL, NULL, - UMA_ALIGN_PTR, 0); - uma_zone_set_allocf(zone_jumbo9, mbuf_jumbo_alloc); + UMA_ALIGN_PTR, UMA_ZONE_CONTIG); if (nmbjumbo9 > 0) nmbjumbo9 = uma_zone_set_max(zone_jumbo9, nmbjumbo9); uma_zone_set_warning(zone_jumbo9, "kern.ipc.nmbjumbo9 limit reached"); @@ -360,8 +358,7 @@ mbuf_init(void *dummy) zone_jumbo16 = uma_zcreate(MBUF_JUMBO16_MEM_NAME, MJUM16BYTES, mb_ctor_clust, NULL, NULL, NULL, - UMA_ALIGN_PTR, 0); - uma_zone_set_allocf(zone_jumbo16, mbuf_jumbo_alloc); + UMA_ALIGN_PTR, UMA_ZONE_CONTIG); if (nmbjumbo16 > 0) nmbjumbo16 = uma_zone_set_max(zone_jumbo16, nmbjumbo16); uma_zone_set_warning(zone_jumbo16, "kern.ipc.nmbjumbo16 limit reached"); @@ -613,24 +610,6 @@ debugnet_mbuf_reinit(int nmbuf, int nclust, int clsize } } #endif /* DEBUGNET */ - -/* - * UMA backend page allocator for the jumbo frame zones. - * - * Allocates kernel virtual memory that is backed by contiguous physical - * pages. - */ -static void * -mbuf_jumbo_alloc(uma_zone_t zone, vm_size_t bytes, int domain, uint8_t *flags, - int wait) -{ - - /* Inform UMA that this allocator uses kernel_map/object. */ - *flags = UMA_SLAB_KERNEL; - return ((void *)kmem_alloc_contig_domainset(DOMAINSET_FIXED(domain), - bytes, wait, (vm_paddr_t)0, ~(vm_paddr_t)0, 1, 0, - VM_MEMATTR_DEFAULT)); -} /* * Constructor for Mbuf master zone. Modified: head/sys/powerpc/aim/slb.c ============================================================================== --- head/sys/powerpc/aim/slb.c Tue Feb 4 22:40:11 2020 (r357547) +++ head/sys/powerpc/aim/slb.c Tue Feb 4 22:40:23 2020 (r357548) @@ -523,12 +523,18 @@ slb_uma_real_alloc(uma_zone_t zone, vm_size_t bytes, i static void slb_zone_init(void *dummy) { + uint32_t allocf_flags; + allocf_flags = 0; + if (platform_real_maxaddr() != VM_MAX_ADDRESS) + allocf_flags = UMA_ZONE_CONTIG; + slbt_zone = uma_zcreate("SLB tree node", sizeof(struct slbtnode), - NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM); + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, + allocf_flags | UMA_ZONE_VM); slb_cache_zone = uma_zcreate("SLB cache", (n_slbs + 1)*sizeof(struct slb *), NULL, NULL, NULL, NULL, - UMA_ALIGN_PTR, UMA_ZONE_VM); + UMA_ALIGN_PTR, allocf_flags | UMA_ZONE_VM); if (platform_real_maxaddr() != VM_MAX_ADDRESS) { uma_zone_set_allocf(slb_cache_zone, slb_uma_real_alloc); From owner-svn-src-all@freebsd.org Tue Feb 4 22:40:35 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3C6562374FB; Tue, 4 Feb 2020 22:40:35 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48C05b0jRFz3D3P; Tue, 4 Feb 2020 22:40:35 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1375B20EF2; Tue, 4 Feb 2020 22:40:35 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014MeYUN068256; Tue, 4 Feb 2020 22:40:34 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014MeYPI068255; Tue, 4 Feb 2020 22:40:34 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <202002042240.014MeYPI068255@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Tue, 4 Feb 2020 22:40:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357549 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 357549 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 22:40:35 -0000 Author: rlibby Date: Tue Feb 4 22:40:34 2020 New Revision: 357549 URL: https://svnweb.freebsd.org/changeset/base/357549 Log: uma: grow slabs to enforce minimum memory efficiency Memory efficiency can be poor with awkward item sizes (e.g. 1/2 or 1 page size + epsilon). In order to achieve a minimum memory efficiency, select a slab size with a potentially larger number of pages if it yields a lower portion of waste. This may mean using page_alloc instead of uma_small_alloc, which could be more costly. Discussed with: jeff, mckusick Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D23239 Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Tue Feb 4 22:40:23 2020 (r357548) +++ head/sys/vm/uma_core.c Tue Feb 4 22:40:34 2020 (r357549) @@ -1830,6 +1830,39 @@ slab_ipers(size_t size, int align) return (slab_ipers_hdr(size, rsize, UMA_SLAB_SIZE, true)); } +struct keg_layout_result { + u_int format; + u_int slabsize; + u_int ipers; + u_int eff; +}; + +static void +keg_layout_one(uma_keg_t keg, u_int rsize, u_int slabsize, u_int fmt, + struct keg_layout_result *kl) +{ + u_int total; + + kl->format = fmt; + kl->slabsize = slabsize; + + /* Handle INTERNAL as inline with an extra page. */ + if ((fmt & UMA_ZFLAG_INTERNAL) != 0) { + kl->format &= ~UMA_ZFLAG_INTERNAL; + kl->slabsize += PAGE_SIZE; + } + + kl->ipers = slab_ipers_hdr(keg->uk_size, rsize, kl->slabsize, + (fmt & UMA_ZFLAG_OFFPAGE) == 0); + + /* Account for memory used by an offpage slab header. */ + total = kl->slabsize; + if ((fmt & UMA_ZFLAG_OFFPAGE) != 0) + total += slabzone(kl->ipers)->uz_keg->uk_rsize; + + kl->eff = UMA_FRAC_FIXPT(kl->ipers * rsize, total); +} + /* * Determine the format of a uma keg. This determines where the slab header * will be placed (inline or offpage) and calculates ipers, rsize, and ppera. @@ -1843,15 +1876,14 @@ slab_ipers(size_t size, int align) static void keg_layout(uma_keg_t keg) { + struct keg_layout_result kl = {}, kl_tmp; + u_int fmts[2]; u_int alignsize; - u_int eff; - u_int eff_offpage; - u_int format; - u_int ipers; - u_int ipers_offpage; + u_int nfmt; u_int pages; u_int rsize; u_int slabsize; + u_int i, j; KASSERT((keg->uk_flags & UMA_ZONE_PCPU) == 0 || (keg->uk_size <= UMA_PCPU_ALLOC_SIZE && @@ -1866,8 +1898,6 @@ keg_layout(uma_keg_t keg) PRINT_UMA_ZFLAGS)); alignsize = keg->uk_align + 1; - format = 0; - ipers = 0; /* * Calculate the size of each allocation (rsize) according to @@ -1877,10 +1907,7 @@ keg_layout(uma_keg_t keg) rsize = MAX(keg->uk_size, UMA_SMALLEST_UNIT); rsize = roundup2(rsize, alignsize); - if ((keg->uk_flags & UMA_ZONE_PCPU) != 0) { - slabsize = UMA_PCPU_ALLOC_SIZE; - pages = mp_maxid + 1; - } else if ((keg->uk_flags & UMA_ZONE_CACHESPREAD) != 0) { + if ((keg->uk_flags & UMA_ZONE_CACHESPREAD) != 0) { /* * We want one item to start on every align boundary in a page. * To do this we will span pages. We will also extend the item @@ -1892,23 +1919,22 @@ keg_layout(uma_keg_t keg) slabsize = rsize * (PAGE_SIZE / alignsize); slabsize = MIN(slabsize, rsize * SLAB_MAX_SETSIZE); slabsize = MIN(slabsize, UMA_CACHESPREAD_MAX_SIZE); - pages = howmany(slabsize, PAGE_SIZE); - slabsize = ptoa(pages); + slabsize = round_page(slabsize); } else { /* - * Choose a slab size of as many pages as it takes to represent - * a single item. We will then try to fit as many additional - * items into the slab as possible. At some point, we may want - * to increase the slab size for awkward item sizes in order to - * increase efficiency. + * Start with a slab size of as many pages as it takes to + * represent a single item. We will try to fit as many + * additional items into the slab as possible. */ - pages = howmany(keg->uk_size, PAGE_SIZE); - slabsize = ptoa(pages); + slabsize = round_page(keg->uk_size); } + /* Build a list of all of the available formats for this keg. */ + nfmt = 0; + /* Evaluate an inline slab layout. */ if ((keg->uk_flags & (UMA_ZONE_NOTOUCH | UMA_ZONE_PCPU)) == 0) - ipers = slab_ipers_hdr(keg->uk_size, rsize, slabsize, true); + fmts[nfmt++] = 0; /* TODO: vm_page-embedded slab. */ @@ -1917,65 +1943,91 @@ keg_layout(uma_keg_t keg) * asked to not go to the VM for buckets. If we do this we * may end up going to the VM for slabs which we do not * want to do if we're UMA_ZFLAG_CACHEONLY as a result - * of UMA_ZONE_VM, which clearly forbids it. + * of UMA_ZONE_VM, which clearly forbids it. In those cases, + * evaluate a pseudo-format called INTERNAL which has an inline + * slab header and one extra page to guarantee that it fits. + * + * Otherwise, see if using an OFFPAGE slab will improve our + * efficiency. */ - if ((keg->uk_flags & - (UMA_ZFLAG_INTERNAL | UMA_ZFLAG_CACHEONLY)) != 0) { - if (ipers == 0) { - /* We need an extra page for the slab header. */ - pages++; - slabsize = ptoa(pages); - ipers = slab_ipers_hdr(keg->uk_size, rsize, slabsize, - true); - } - goto out; - } + if ((keg->uk_flags & (UMA_ZFLAG_INTERNAL | UMA_ZFLAG_CACHEONLY)) != 0) + fmts[nfmt++] = UMA_ZFLAG_INTERNAL; + else + fmts[nfmt++] = UMA_ZFLAG_OFFPAGE; /* - * See if using an OFFPAGE slab will improve our efficiency. - * Only do this if we are below our efficiency threshold. + * Choose a slab size and format which satisfy the minimum efficiency. + * Prefer the smallest slab size that meets the constraints. * - * XXX We could try growing slabsize to limit max waste as well. - * Historically this was not done because the VM could not - * efficiently handle contiguous allocations. + * Start with a minimum slab size, to accommodate CACHESPREAD. Then, + * for small items (up to PAGE_SIZE), the iteration increment is one + * page; and for large items, the increment is one item. */ - eff = UMA_FRAC_FIXPT(ipers * rsize, slabsize); - ipers_offpage = slab_ipers_hdr(keg->uk_size, rsize, slabsize, false); - eff_offpage = UMA_FRAC_FIXPT(ipers_offpage * rsize, - slabsize + slabzone(ipers_offpage)->uz_keg->uk_rsize); - if (ipers == 0 || (eff < UMA_MIN_EFF && eff < eff_offpage)) { - CTR5(KTR_UMA, "UMA decided we need offpage slab headers for " - "keg: %s(%p), minimum efficiency allowed = %u%%, " - "old efficiency = %u%%, offpage efficiency = %u%%", - keg->uk_name, keg, UMA_FIXPT_PCT(UMA_MIN_EFF), - UMA_FIXPT_PCT(eff), UMA_FIXPT_PCT(eff_offpage)); - format = UMA_ZFLAG_OFFPAGE; - ipers = ipers_offpage; + i = (slabsize + rsize - keg->uk_size) / MAX(PAGE_SIZE, rsize); + KASSERT(i >= 1, ("keg %s(%p) flags=0x%b slabsize=%u, rsize=%u, i=%u", + keg->uk_name, keg, keg->uk_flags, PRINT_UMA_ZFLAGS, slabsize, + rsize, i)); + for ( ; ; i++) { + slabsize = (rsize <= PAGE_SIZE) ? ptoa(i) : + round_page(rsize * (i - 1) + keg->uk_size); + + for (j = 0; j < nfmt; j++) { + /* Only if we have no viable format yet. */ + if ((fmts[j] & UMA_ZFLAG_INTERNAL) != 0 && + kl.ipers > 0) + continue; + + keg_layout_one(keg, rsize, slabsize, fmts[j], &kl_tmp); + if (kl_tmp.eff <= kl.eff) + continue; + + kl = kl_tmp; + + CTR6(KTR_UMA, "keg %s layout: format %#x " + "(ipers %u * rsize %u) / slabsize %#x = %u%% eff", + keg->uk_name, kl.format, kl.ipers, rsize, + kl.slabsize, UMA_FIXPT_PCT(kl.eff)); + + /* Stop when we reach the minimum efficiency. */ + if (kl.eff >= UMA_MIN_EFF) + break; + } + + if (kl.eff >= UMA_MIN_EFF || + slabsize >= SLAB_MAX_SETSIZE * rsize || + (keg->uk_flags & (UMA_ZONE_PCPU | UMA_ZONE_CONTIG)) != 0) + break; } -out: + pages = atop(kl.slabsize); + if ((keg->uk_flags & UMA_ZONE_PCPU) != 0) + pages *= mp_maxid + 1; + + keg->uk_rsize = rsize; + keg->uk_ipers = kl.ipers; + keg->uk_ppera = pages; + keg->uk_flags |= kl.format; + /* * How do we find the slab header if it is offpage or if not all item * start addresses are in the same page? We could solve the latter * case with vaddr alignment, but we don't. */ - if ((format & UMA_ZFLAG_OFFPAGE) != 0 || - (ipers - 1) * rsize >= PAGE_SIZE) { + if ((keg->uk_flags & UMA_ZFLAG_OFFPAGE) != 0 || + (keg->uk_ipers - 1) * rsize >= PAGE_SIZE) { if ((keg->uk_flags & UMA_ZONE_NOTPAGE) != 0) - format |= UMA_ZFLAG_HASH; + keg->uk_flags |= UMA_ZFLAG_HASH; else - format |= UMA_ZFLAG_VTOSLAB; + keg->uk_flags |= UMA_ZFLAG_VTOSLAB; } - keg->uk_ipers = ipers; - keg->uk_rsize = rsize; - keg->uk_flags |= format; - keg->uk_ppera = pages; + CTR6(KTR_UMA, "%s: keg=%s, flags=%#x, rsize=%u, ipers=%u, ppera=%u", - __func__, keg->uk_name, keg->uk_flags, rsize, ipers, pages); + __func__, keg->uk_name, keg->uk_flags, rsize, keg->uk_ipers, + pages); KASSERT(keg->uk_ipers > 0 && keg->uk_ipers <= SLAB_MAX_SETSIZE, ("%s: keg=%s, flags=0x%b, rsize=%u, ipers=%u, ppera=%u", __func__, - keg->uk_name, keg->uk_flags, PRINT_UMA_ZFLAGS, rsize, ipers, - pages)); + keg->uk_name, keg->uk_flags, PRINT_UMA_ZFLAGS, rsize, + keg->uk_ipers, pages)); } /* From owner-svn-src-all@freebsd.org Tue Feb 4 22:40:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 781B723756A; Tue, 4 Feb 2020 22:40:46 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48C05p2fLlz3DK2; Tue, 4 Feb 2020 22:40:46 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 552D821015; Tue, 4 Feb 2020 22:40:46 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014MekYF068958; Tue, 4 Feb 2020 22:40:46 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014MekRs068957; Tue, 4 Feb 2020 22:40:46 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <202002042240.014MekRs068957@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Tue, 4 Feb 2020 22:40:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357550 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 357550 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 22:40:46 -0000 Author: rlibby Date: Tue Feb 4 22:40:45 2020 New Revision: 357550 URL: https://svnweb.freebsd.org/changeset/base/357550 Log: uma: multipage chicken switch Add a switch to allow disabling multipage slabs, in order to facilitate measuring memory usage and performance effects. The tunable vm.debug.uma_multipage_slabs defaults to 1 and can be set to 0 to disable. The name may change soon. Reviewed by: markj (previous version) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D23487 Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Tue Feb 4 22:40:34 2020 (r357549) +++ head/sys/vm/uma_core.c Tue Feb 4 22:40:45 2020 (r357550) @@ -323,6 +323,9 @@ static int sysctl_handle_uma_zone_items(SYSCTL_HANDLER static uint64_t uma_zone_get_allocs(uma_zone_t zone); +static SYSCTL_NODE(_vm, OID_AUTO, debug, CTLFLAG_RD, 0, + "Memory allocation debugging"); + #ifdef INVARIANTS static uint64_t uma_keg_get_allocs(uma_keg_t zone); static inline struct noslabbits *slab_dbg_bits(uma_slab_t slab, uma_keg_t keg); @@ -332,9 +335,6 @@ static bool uma_dbg_zskip(uma_zone_t zone, void *mem); static void uma_dbg_free(uma_zone_t zone, uma_slab_t slab, void *item); static void uma_dbg_alloc(uma_zone_t zone, uma_slab_t slab, void *item); -static SYSCTL_NODE(_vm, OID_AUTO, debug, CTLFLAG_RD, 0, - "Memory allocation debugging"); - static u_int dbg_divisor = 1; SYSCTL_UINT(_vm_debug, OID_AUTO, divisor, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &dbg_divisor, 0, @@ -362,6 +362,12 @@ static int zone_warnings = 1; SYSCTL_INT(_vm, OID_AUTO, zone_warnings, CTLFLAG_RWTUN, &zone_warnings, 0, "Warn when UMA zones becomes full"); +static int multipage_slabs = 1; +TUNABLE_INT("vm.debug.uma_multipage_slabs", &multipage_slabs); +SYSCTL_INT(_vm_debug, OID_AUTO, uma_multipage_slabs, + CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &multipage_slabs, 0, + "UMA may choose larger slab sizes for better efficiency"); + /* * Select the slab zone for an offpage slab with the given maximum item count. */ @@ -1993,7 +1999,7 @@ keg_layout(uma_keg_t keg) break; } - if (kl.eff >= UMA_MIN_EFF || + if (kl.eff >= UMA_MIN_EFF || !multipage_slabs || slabsize >= SLAB_MAX_SETSIZE * rsize || (keg->uk_flags & (UMA_ZONE_PCPU | UMA_ZONE_CONTIG)) != 0) break; From owner-svn-src-all@freebsd.org Tue Feb 4 23:55:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 62BCF239034; Tue, 4 Feb 2020 23:55:22 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48C1lt1wbvz3Hpx; Tue, 4 Feb 2020 23:55:22 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3D23821DC4; Tue, 4 Feb 2020 23:55:22 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 014NtM4K015954; Tue, 4 Feb 2020 23:55:22 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 014NtMY2015953; Tue, 4 Feb 2020 23:55:22 GMT (envelope-from np@FreeBSD.org) Message-Id: <202002042355.014NtMY2015953@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 4 Feb 2020 23:55:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357551 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 357551 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2020 23:55:22 -0000 Author: np Date: Tue Feb 4 23:55:21 2020 New Revision: 357551 URL: https://svnweb.freebsd.org/changeset/base/357551 Log: cxgbe(4): Report accurate rx_buf_maxsize to netmap. MFC after: 2 weeks Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_netmap.c Modified: head/sys/dev/cxgbe/t4_netmap.c ============================================================================== --- head/sys/dev/cxgbe/t4_netmap.c Tue Feb 4 22:40:45 2020 (r357550) +++ head/sys/dev/cxgbe/t4_netmap.c Tue Feb 4 23:55:21 2020 (r357551) @@ -991,6 +991,7 @@ cxgbe_nm_attach(struct vi_info *vi) na.nm_register = cxgbe_netmap_reg; na.num_tx_rings = vi->nnmtxq; na.num_rx_rings = vi->nnmrxq; + na.rx_buf_maxsize = MAX_MTU; netmap_attach(&na); /* This adds IFCAP_NETMAP to if_capabilities */ } From owner-svn-src-all@freebsd.org Wed Feb 5 00:08:58 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A060A2396B4; Wed, 5 Feb 2020 00:08:58 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48C23Z3r08z3JRg; Wed, 5 Feb 2020 00:08:58 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7DCB521FA0; Wed, 5 Feb 2020 00:08:58 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 01508w1L021832; Wed, 5 Feb 2020 00:08:58 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01508wea021831; Wed, 5 Feb 2020 00:08:58 GMT (envelope-from np@FreeBSD.org) Message-Id: <202002050008.01508wea021831@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 5 Feb 2020 00:08:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357552 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 357552 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 00:08:58 -0000 Author: np Date: Wed Feb 5 00:08:58 2020 New Revision: 357552 URL: https://svnweb.freebsd.org/changeset/base/357552 Log: cxgbe(4): Allow nm_black_hole and nm_cong_drop to be set at any time. The cong_drop setting will apply to queues created after the setting is changed and not to existing queues. MFC after: 2 weeks Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_netmap.c Modified: head/sys/dev/cxgbe/t4_netmap.c ============================================================================== --- head/sys/dev/cxgbe/t4_netmap.c Tue Feb 4 23:55:21 2020 (r357551) +++ head/sys/dev/cxgbe/t4_netmap.c Wed Feb 5 00:08:58 2020 (r357552) @@ -63,7 +63,7 @@ extern int fl_pad; /* XXXNM */ * 2 = supermassive black hole (buffer packing enabled) */ int black_hole = 0; -SYSCTL_INT(_hw_cxgbe, OID_AUTO, nm_black_hole, CTLFLAG_RDTUN, &black_hole, 0, +SYSCTL_INT(_hw_cxgbe, OID_AUTO, nm_black_hole, CTLFLAG_RWTUN, &black_hole, 0, "Sink incoming packets."); int rx_ndesc = 256; @@ -85,7 +85,7 @@ SYSCTL_INT(_hw_cxgbe, OID_AUTO, nm_holdoff_tmr_idx, CT * 1: no backpressure, drop packets for the congested queue immediately. */ static int nm_cong_drop = 1; -SYSCTL_INT(_hw_cxgbe, OID_AUTO, nm_cong_drop, CTLFLAG_RDTUN, +SYSCTL_INT(_hw_cxgbe, OID_AUTO, nm_cong_drop, CTLFLAG_RWTUN, &nm_cong_drop, 0, "Congestion control for netmap rx queues (0 = backpressure, 1 = drop"); From owner-svn-src-all@freebsd.org Wed Feb 5 00:13:15 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A35EC2398F8; Wed, 5 Feb 2020 00:13:15 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48C28W3vmTz3Jrm; Wed, 5 Feb 2020 00:13:15 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 816722217B; Wed, 5 Feb 2020 00:13:15 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0150DFDb027901; Wed, 5 Feb 2020 00:13:15 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0150DFCC027900; Wed, 5 Feb 2020 00:13:15 GMT (envelope-from np@FreeBSD.org) Message-Id: <202002050013.0150DFCC027900@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 5 Feb 2020 00:13:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357553 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 357553 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 00:13:15 -0000 Author: np Date: Wed Feb 5 00:13:15 2020 New Revision: 357553 URL: https://svnweb.freebsd.org/changeset/base/357553 Log: cxgbe(4): Add a knob to allow netmap tx traffic to be checksummed by the hardware. hw.cxgbe.nm_txcsum=1 MFC after: 2 weeks Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_netmap.c Modified: head/sys/dev/cxgbe/t4_netmap.c ============================================================================== --- head/sys/dev/cxgbe/t4_netmap.c Wed Feb 5 00:08:58 2020 (r357552) +++ head/sys/dev/cxgbe/t4_netmap.c Wed Feb 5 00:13:15 2020 (r357553) @@ -110,6 +110,16 @@ static int nm_split_rss = 0; SYSCTL_INT(_hw_cxgbe, OID_AUTO, nm_split_rss, CTLFLAG_RWTUN, &nm_split_rss, 0, "Split the netmap rx queues into two groups."); +/* + * netmap(4) says "netmap does not use features such as checksum offloading, TCP + * segmentation offloading, encryption, VLAN encapsulation/decapsulation, etc." + * but this knob can be used to get the hardware to checksum all tx traffic + * anyway. + */ +static int nm_txcsum = 0; +SYSCTL_INT(_hw_cxgbe, OID_AUTO, nm_txcsum, CTLFLAG_RWTUN, + &nm_txcsum, 0, "Enable transmit checksum offloading."); + static int alloc_nm_rxq_hwq(struct vi_info *vi, struct sge_nm_rxq *nm_rxq, int cong) { @@ -696,13 +706,8 @@ cxgbe_nm_tx(struct adapter *sc, struct sge_nm_txq *nm_ cpl->ctrl0 = nm_txq->cpl_ctrl0; cpl->pack = 0; cpl->len = htobe16(slot->len); - /* - * netmap(4) says "netmap does not use features such as - * checksum offloading, TCP segmentation offloading, - * encryption, VLAN encapsulation/decapsulation, etc." - */ - cpl->ctrl1 = htobe64(F_TXPKT_IPCSUM_DIS | - F_TXPKT_L4CSUM_DIS); + cpl->ctrl1 = nm_txcsum ? 0 : + htobe64(F_TXPKT_IPCSUM_DIS | F_TXPKT_L4CSUM_DIS); usgl = (void *)(cpl + 1); usgl->cmd_nsge = htobe32(V_ULPTX_CMD(ULP_TX_SC_DSGL) | From owner-svn-src-all@freebsd.org Wed Feb 5 00:20:27 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1E22F239BC6; Wed, 5 Feb 2020 00:20:27 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48C2Jp73vPz3KCJ; Wed, 5 Feb 2020 00:20:26 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EDBEC2219B; Wed, 5 Feb 2020 00:20:26 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0150KQTb028311; Wed, 5 Feb 2020 00:20:26 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0150KQJV028310; Wed, 5 Feb 2020 00:20:26 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202002050020.0150KQJV028310@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 5 Feb 2020 00:20:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357554 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 357554 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 00:20:27 -0000 Author: mjg Date: Wed Feb 5 00:20:26 2020 New Revision: 357554 URL: https://svnweb.freebsd.org/changeset/base/357554 Log: fd: always nullify *fdp in fget* routines Some consumers depend on the pointer being NULL if an error is returned. The guarantee got broken in r357469. Reported by: https://syzkaller.appspot.com/bug?extid=0c9b05e2b727aae21eef Noted by: markj Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Wed Feb 5 00:13:15 2020 (r357553) +++ head/sys/kern/kern_descrip.c Wed Feb 5 00:20:26 2020 (r357554) @@ -2651,6 +2651,7 @@ fget_cap(struct thread *td, int fd, cap_rights_t *need struct file *fp; seqc_t seq; + *fpp = NULL; for (;;) { error = fget_unlocked_seq(fdp, fd, needrightsp, &fp, &seq); if (error != 0) @@ -2905,26 +2906,29 @@ fget_mmap(struct thread *td, int fd, cap_rights_t *rig error = _fget(td, fd, fpp, 0, rightsp); if (maxprotp != NULL) *maxprotp = VM_PROT_ALL; + return (error); #else cap_rights_t fdrights; struct filedesc *fdp; + struct file *fp; seqc_t seq; + *fpp = NULL; fdp = td->td_proc->p_fd; MPASS(cap_rights_is_set(rightsp, CAP_MMAP)); for (;;) { - error = fget_unlocked_seq(fdp, fd, rightsp, fpp, &seq); + error = fget_unlocked_seq(fdp, fd, rightsp, &fp, &seq); if (__predict_false(error != 0)) return (error); - if (__predict_false((*fpp)->f_ops == &badfileops)) { - fdrop(*fpp, td); + if (__predict_false(fp->f_ops == &badfileops)) { + fdrop(fp, td); return (EBADF); } if (maxprotp != NULL) fdrights = *cap_rights(fdp, fd); if (!fd_modified(fdp, fd, seq)) break; - fdrop(*fpp, td); + fdrop(fp, td); } /* @@ -2932,8 +2936,9 @@ fget_mmap(struct thread *td, int fd, cap_rights_t *rig */ if (maxprotp != NULL) *maxprotp = cap_rights_to_vmprot(&fdrights); + *fpp = fp; + return (0); #endif - return (error); } int @@ -2958,24 +2963,27 @@ fget_fcntl(struct thread *td, int fd, cap_rights_t *ri #ifndef CAPABILITIES return (fget_unlocked(fdp, fd, rightsp, fpp)); #else + struct file *fp; int error; seqc_t seq; + *fpp = NULL; MPASS(cap_rights_is_set(rightsp, CAP_FCNTL)); for (;;) { - error = fget_unlocked_seq(fdp, fd, rightsp, fpp, &seq); + error = fget_unlocked_seq(fdp, fd, rightsp, &fp, &seq); if (error != 0) return (error); error = cap_fcntl_check(fdp, fd, needfcntl); if (!fd_modified(fdp, fd, seq)) break; - fdrop(*fpp, td); + fdrop(fp, td); } if (error != 0) { - fdrop(*fpp, td); - *fpp = NULL; + fdrop(fp, td); + return (error); } - return (error); + *fpp = fp; + return (0); #endif } From owner-svn-src-all@freebsd.org Wed Feb 5 00:47:04 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8035323A54D; Wed, 5 Feb 2020 00:47:04 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48C2vX2rGjz3Lm8; Wed, 5 Feb 2020 00:47:04 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C75C22742; Wed, 5 Feb 2020 00:47:04 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0150l4GP046068; Wed, 5 Feb 2020 00:47:04 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0150l3KC046065; Wed, 5 Feb 2020 00:47:03 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202002050047.0150l3KC046065@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 5 Feb 2020 00:47:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357555 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 357555 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 00:47:04 -0000 Author: mav Date: Wed Feb 5 00:47:03 2020 New Revision: 357555 URL: https://svnweb.freebsd.org/changeset/base/357555 Log: MFC r356993: Update route MTUs for bridge, lagg and vlan interfaces. Those interfaces may implicitly change their MTU on addition of parent interface in addition to normal SIOCSIFMTU ioctl path, where the route MTUs are updated normally. Modified: stable/12/sys/net/if_bridge.c stable/12/sys/net/if_lagg.c stable/12/sys/net/if_vlan.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/if_bridge.c ============================================================================== --- stable/12/sys/net/if_bridge.c Wed Feb 5 00:20:26 2020 (r357554) +++ stable/12/sys/net/if_bridge.c Wed Feb 5 00:47:03 2020 (r357555) @@ -135,7 +135,15 @@ __FBSDID("$FreeBSD$"); #include +#ifdef INET6 /* + * XXX: declare here to avoid to include many inet6 related files.. + * should be more generalized? + */ +extern void nd6_setmtu(struct ifnet *); +#endif + +/* * Size of the route hash table. Must be a power of two. */ #ifndef BRIDGE_RTHASH_SIZE @@ -772,7 +780,7 @@ bridge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t da } args; struct ifdrv *ifd = (struct ifdrv *) data; const struct bridge_control *bc; - int error = 0; + int error = 0, oldmtu; switch (cmd) { @@ -818,11 +826,23 @@ bridge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t da break; } + oldmtu = ifp->if_mtu; BRIDGE_LOCK(sc); error = (*bc->bc_func)(sc, &args); BRIDGE_UNLOCK(sc); if (error) break; + + /* + * Bridge MTU may change during addition of the first port. + * If it did, do network layer specific procedure. + */ + if (ifp->if_mtu != oldmtu) { +#ifdef INET6 + nd6_setmtu(ifp); +#endif + rt_updatemtu(ifp); + } if (bc->bc_flags & BC_F_COPYOUT) error = copyout(&args, ifd->ifd_data, ifd->ifd_len); Modified: stable/12/sys/net/if_lagg.c ============================================================================== --- stable/12/sys/net/if_lagg.c Wed Feb 5 00:20:26 2020 (r357554) +++ stable/12/sys/net/if_lagg.c Wed Feb 5 00:47:03 2020 (r357555) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #if defined(INET) || defined(INET6) @@ -73,6 +74,14 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef INET6 +/* + * XXX: declare here to avoid to include many inet6 related files.. + * should be more generalized? + */ +extern void nd6_setmtu(struct ifnet *); +#endif + #define LAGG_RLOCK() struct epoch_tracker lagg_et; epoch_enter_preempt(net_epoch_preempt, &lagg_et) #define LAGG_RUNLOCK() epoch_exit_preempt(net_epoch_preempt, &lagg_et) #define LAGG_RLOCK_ASSERT() MPASS(in_epoch(net_epoch_preempt)) @@ -1152,7 +1161,7 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data struct ifnet *tpif; struct thread *td = curthread; char *buf, *outbuf; - int count, buflen, len, error = 0; + int count, buflen, len, error = 0, oldmtu; bzero(&rpbuf, sizeof(rpbuf)); @@ -1425,10 +1434,23 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data tpif->if_xname); } #endif + oldmtu = ifp->if_mtu; LAGG_XLOCK(sc); error = lagg_port_create(sc, tpif); LAGG_XUNLOCK(sc); if_rele(tpif); + + /* + * LAGG MTU may change during addition of the first port. + * If it did, do network layer specific procedure. + */ + if (ifp->if_mtu != oldmtu) { +#ifdef INET6 + nd6_setmtu(ifp); +#endif + rt_updatemtu(ifp); + } + VLAN_CAPABILITIES(ifp); break; case SIOCSLAGGDELPORT: Modified: stable/12/sys/net/if_vlan.c ============================================================================== --- stable/12/sys/net/if_vlan.c Wed Feb 5 00:20:26 2020 (r357554) +++ stable/12/sys/net/if_vlan.c Wed Feb 5 00:47:03 2020 (r357555) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" +#include "opt_inet6.h" #include "opt_vlan.h" #include "opt_ratelimit.h" @@ -74,6 +75,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #ifdef INET @@ -81,6 +83,14 @@ __FBSDID("$FreeBSD$"); #include #endif +#ifdef INET6 +/* + * XXX: declare here to avoid to include many inet6 related files.. + * should be more generalized? + */ +extern void nd6_setmtu(struct ifnet *); +#endif + #define VLAN_DEF_HWIDTH 4 #define VLAN_IFFLAGS (IFF_BROADCAST | IFF_MULTICAST) @@ -1731,7 +1741,7 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data struct ifvlan *ifv; struct ifvlantrunk *trunk; struct vlanreq vlr; - int error = 0; + int error = 0, oldmtu; ifr = (struct ifreq *)data; ifa = (struct ifaddr *) data; @@ -1825,8 +1835,20 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data error = ENOENT; break; } + oldmtu = ifp->if_mtu; error = vlan_config(ifv, p, vlr.vlr_tag); if_rele(p); + + /* + * VLAN MTU may change during addition of the vlandev. + * If it did, do network layer specific procedure. + */ + if (ifp->if_mtu != oldmtu) { +#ifdef INET6 + nd6_setmtu(ifp); +#endif + rt_updatemtu(ifp); + } break; case SIOCGETVLAN: From owner-svn-src-all@freebsd.org Wed Feb 5 02:30:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C814D23D20E; Wed, 5 Feb 2020 02:30:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48C5CB4tKSz3wbv; Wed, 5 Feb 2020 02:30:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A2C7A2396E; Wed, 5 Feb 2020 02:30:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0152Uk3o006919; Wed, 5 Feb 2020 02:30:46 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0152Ukbi006918; Wed, 5 Feb 2020 02:30:46 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202002050230.0152Ukbi006918@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 5 Feb 2020 02:30:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357556 - head/contrib/netbsd-tests/lib/libc/c063 X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/contrib/netbsd-tests/lib/libc/c063 X-SVN-Commit-Revision: 357556 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 02:30:46 -0000 Author: kevans Date: Wed Feb 5 02:30:46 2020 New Revision: 357556 URL: https://svnweb.freebsd.org/changeset/base/357556 Log: O_SEARCH tests: plug trivial fd leak Coverity correctly reports this as a resource leak. It's an admittedly minor one, but plug it anyways. This has been submitted upstream as misc/54939. CID: 978288 Modified: head/contrib/netbsd-tests/lib/libc/c063/t_o_search.c Modified: head/contrib/netbsd-tests/lib/libc/c063/t_o_search.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/c063/t_o_search.c Wed Feb 5 00:47:03 2020 (r357555) +++ head/contrib/netbsd-tests/lib/libc/c063/t_o_search.c Wed Feb 5 02:30:46 2020 (r357556) @@ -265,6 +265,7 @@ ATF_TC_BODY(o_search_notdir, tc) #endif ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) == -1); ATF_REQUIRE(errno == ENOTDIR); + ATF_REQUIRE(close(dfd) == 0); } #ifdef USE_O_SEARCH From owner-svn-src-all@freebsd.org Wed Feb 5 02:53:41 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7D4E223D8B2; Wed, 5 Feb 2020 02:53:41 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48C5jd2Vjlz3xl7; Wed, 5 Feb 2020 02:53:41 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5106E23ECF; Wed, 5 Feb 2020 02:53:41 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0152rfPr023538; Wed, 5 Feb 2020 02:53:41 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0152rf06023537; Wed, 5 Feb 2020 02:53:41 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202002050253.0152rf06023537@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 5 Feb 2020 02:53:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357557 - head/sys/netgraph X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/netgraph X-SVN-Commit-Revision: 357557 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 02:53:41 -0000 Author: glebius Date: Wed Feb 5 02:53:40 2020 New Revision: 357557 URL: https://svnweb.freebsd.org/changeset/base/357557 Log: netgraph(4) callouts need to be executed in the network epoch. Modified: head/sys/netgraph/ng_base.c Modified: head/sys/netgraph/ng_base.c ============================================================================== --- head/sys/netgraph/ng_base.c Wed Feb 5 02:30:46 2020 (r357556) +++ head/sys/netgraph/ng_base.c Wed Feb 5 02:53:40 2020 (r357557) @@ -3772,11 +3772,14 @@ ng_send_fn2(node_p node, hook_p hook, item_p pitem, ng static void ng_callout_trampoline(void *arg) { + struct epoch_tracker et; item_p item = arg; + NET_EPOCH_ENTER(et); CURVNET_SET(NGI_NODE(item)->nd_vnet); ng_snd_item(item, 0); CURVNET_RESTORE(); + NET_EPOCH_EXIT(et); } int From owner-svn-src-all@freebsd.org Wed Feb 5 03:06:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 25D4423DBFE; Wed, 5 Feb 2020 03:06:30 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48C60Q065bz3ydr; Wed, 5 Feb 2020 03:06:30 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F30112413E; Wed, 5 Feb 2020 03:06:29 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 01536TaZ031129; Wed, 5 Feb 2020 03:06:29 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01536TFg031127; Wed, 5 Feb 2020 03:06:29 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202002050306.01536TFg031127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 5 Feb 2020 03:06:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357558 - head/sys/netgraph X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/netgraph X-SVN-Commit-Revision: 357558 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 03:06:30 -0000 Author: glebius Date: Wed Feb 5 03:06:29 2020 New Revision: 357558 URL: https://svnweb.freebsd.org/changeset/base/357558 Log: Enter the network epoch when ng_socket sends data or control from user land to the netgraph and potentially further down the network stack. Modified: head/sys/netgraph/ng_socket.c Modified: head/sys/netgraph/ng_socket.c ============================================================================== --- head/sys/netgraph/ng_socket.c Wed Feb 5 02:53:40 2020 (r357557) +++ head/sys/netgraph/ng_socket.c Wed Feb 5 03:06:29 2020 (r357558) @@ -58,6 +58,8 @@ #include #include #include +#include +#include #include #include #include @@ -217,6 +219,7 @@ static int ngc_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *addr, struct mbuf *control, struct thread *td) { + struct epoch_tracker et; struct ngpcb *const pcbp = sotongpcb(so); struct ngsock *const priv = NG_NODE_PRIVATE(pcbp->sockdata->node); struct sockaddr_ng *const sap = (struct sockaddr_ng *) addr; @@ -335,7 +338,9 @@ ngc_send(struct socket *so, int flags, struct mbuf *m, item->apply = &apply; priv->error = -1; + NET_EPOCH_ENTER(et); error = ng_snd_item(item, 0); + NET_EPOCH_EXIT(et); mtx_lock(&priv->mtx); if (priv->error == -1) @@ -403,6 +408,7 @@ static int ngd_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *addr, struct mbuf *control, struct thread *td) { + struct epoch_tracker et; struct ngpcb *const pcbp = sotongpcb(so); struct sockaddr_ng *const sap = (struct sockaddr_ng *) addr; int len, error; @@ -459,7 +465,9 @@ ngd_send(struct socket *so, int flags, struct mbuf *m, } /* Send data. */ + NET_EPOCH_ENTER(et); NG_SEND_DATA_FLAGS(error, hook, m, NG_WAITOK); + NET_EPOCH_EXIT(et); release: if (control != NULL) From owner-svn-src-all@freebsd.org Wed Feb 5 03:07:21 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 999C223DC77; Wed, 5 Feb 2020 03:07:21 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48C61P1Vb1z3ymg; Wed, 5 Feb 2020 03:07:21 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2EB9724143; Wed, 5 Feb 2020 03:07:21 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 01537Lus031226; Wed, 5 Feb 2020 03:07:21 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01537LMZ031225; Wed, 5 Feb 2020 03:07:21 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202002050307.01537LMZ031225@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 5 Feb 2020 03:07:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357559 - head/sys/netgraph X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/netgraph X-SVN-Commit-Revision: 357559 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 03:07:21 -0000 Author: glebius Date: Wed Feb 5 03:07:20 2020 New Revision: 357559 URL: https://svnweb.freebsd.org/changeset/base/357559 Log: I doubt anybody in the world uses ng_device, but its write method should also enter the network epoch when sending data from user level to netgraph. Modified: head/sys/netgraph/ng_device.c Modified: head/sys/netgraph/ng_device.c ============================================================================== --- head/sys/netgraph/ng_device.c Wed Feb 5 03:06:29 2020 (r357558) +++ head/sys/netgraph/ng_device.c Wed Feb 5 03:07:20 2020 (r357559) @@ -46,6 +46,8 @@ #include #include #include +#include +#include #include #include #include @@ -454,6 +456,7 @@ ngdread(struct cdev *dev, struct uio *uio, int flag) static int ngdwrite(struct cdev *dev, struct uio *uio, int flag) { + struct epoch_tracker et; priv_p priv = (priv_p )dev->si_drv1; struct mbuf *m; int error = 0; @@ -469,7 +472,9 @@ ngdwrite(struct cdev *dev, struct uio *uio, int flag) if ((m = m_uiotombuf(uio, M_NOWAIT, 0, 0, M_PKTHDR)) == NULL) return (ENOBUFS); + NET_EPOCH_ENTER(et); NG_SEND_DATA_ONLY(error, priv->hook, m); + NET_EPOCH_EXIT(et); return (error); } From owner-svn-src-all@freebsd.org Wed Feb 5 04:17:16 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2FA7B23F32D; Wed, 5 Feb 2020 04:17:16 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48C7Z3677jz430h; Wed, 5 Feb 2020 04:17:15 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B37E724E6B; Wed, 5 Feb 2020 04:17:15 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0154HFaw072870; Wed, 5 Feb 2020 04:17:15 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0154HFgE072867; Wed, 5 Feb 2020 04:17:15 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202002050417.0154HFgE072867@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 5 Feb 2020 04:17:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357560 - in head: lib/libutil usr.bin/login X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: lib/libutil usr.bin/login X-SVN-Commit-Revision: 357560 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 04:17:16 -0000 Author: kevans Date: Wed Feb 5 04:17:14 2020 New Revision: 357560 URL: https://svnweb.freebsd.org/changeset/base/357560 Log: login.conf(5): split MAIL env var out into a "mail" capability This allows it to be easily suppressed in, e.g., the "daemon" class where it will not be properly expanded. This is a part of D21481. Submitted by: Andrew Gierth Modified: head/lib/libutil/login.conf.5 head/lib/libutil/login_class.c head/usr.bin/login/login.conf Modified: head/lib/libutil/login.conf.5 ============================================================================== --- head/lib/libutil/login.conf.5 Wed Feb 5 03:07:20 2020 (r357559) +++ head/lib/libutil/login.conf.5 Wed Feb 5 04:17:14 2020 (r357560) @@ -19,7 +19,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 8, 2011 +.Dd January 19, 2020 .Dt LOGIN.CONF 5 .Os .Sh NAME @@ -237,6 +237,7 @@ for details. .It "label string Default MAC policy; see" .Xr maclabel 7 . .It "lang string Set $LANG environment variable to the specified value." +.It "mail string Set $MAIL environment variable to the specified value." .It "manpath path Default search path for manpages." .It "nocheckmail bool false Display mail status at login." .It "nologin file If the file exists it will be displayed and" Modified: head/lib/libutil/login_class.c ============================================================================== --- head/lib/libutil/login_class.c Wed Feb 5 03:07:20 2020 (r357559) +++ head/lib/libutil/login_class.c Wed Feb 5 04:17:14 2020 (r357560) @@ -131,6 +131,7 @@ static struct login_vars { }, envars[] = { { "lang", "LANG", NULL, 1}, { "charset", "MM_CHARSET", NULL, 1}, + { "mail", "MAIL", NULL, 1}, { "timezone", "TZ", NULL, 1}, { "term", "TERM", NULL, 0}, { NULL, NULL, NULL, 0} Modified: head/usr.bin/login/login.conf ============================================================================== --- head/usr.bin/login/login.conf Wed Feb 5 03:07:20 2020 (r357559) +++ head/usr.bin/login/login.conf Wed Feb 5 04:17:14 2020 (r357560) @@ -26,7 +26,8 @@ default:\ :passwd_format=sha512:\ :copyright=/etc/COPYRIGHT:\ :welcome=/var/run/motd:\ - :setenv=MAIL=/var/mail/$,BLOCKSIZE=K:\ + :setenv=BLOCKSIZE=K:\ + :mail=/var/mail/$:\ :path=/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin ~/bin:\ :nologin=/var/run/nologin:\ :cputime=unlimited:\ @@ -61,6 +62,7 @@ xuser:\ staff:\ :tc=default: daemon:\ + :mail@:\ :memorylocked=128M:\ :tc=default: news:\ From owner-svn-src-all@freebsd.org Wed Feb 5 04:27:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A2E6923F624; Wed, 5 Feb 2020 04:27:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48C7nT2rSVz43Rp; Wed, 5 Feb 2020 04:27:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5712A25035; Wed, 5 Feb 2020 04:27:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0154R9C9079089; Wed, 5 Feb 2020 04:27:09 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0154R9lQ079088; Wed, 5 Feb 2020 04:27:09 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202002050427.0154R9lQ079088@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 5 Feb 2020 04:27:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357561 - head/usr.bin/login X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.bin/login X-SVN-Commit-Revision: 357561 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 04:27:09 -0000 Author: kevans Date: Wed Feb 5 04:27:08 2020 New Revision: 357561 URL: https://svnweb.freebsd.org/changeset/base/357561 Log: login.conf(5): set a default PATH for the daemon class This is a sensible default used by, e.g., cron(8), and useful if one wanted to honor it. This is a part of D21481. Submitted by: Andrew Gierth Modified: head/usr.bin/login/login.conf Modified: head/usr.bin/login/login.conf ============================================================================== --- head/usr.bin/login/login.conf Wed Feb 5 04:17:14 2020 (r357560) +++ head/usr.bin/login/login.conf Wed Feb 5 04:27:08 2020 (r357561) @@ -61,7 +61,13 @@ xuser:\ :tc=default: staff:\ :tc=default: + +# This PATH may be clobbered by individual applications. Notably, by default, +# rc(8), service(8), and cron(8) will all override it with a default PATH that +# may not include /usr/local/sbin and /usr/local/bin when starting services or +# jobs. daemon:\ + :path=/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin:\ :mail@:\ :memorylocked=128M:\ :tc=default: From owner-svn-src-all@freebsd.org Wed Feb 5 04:27:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7488023F69D; Wed, 5 Feb 2020 04:27:45 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48C7p91X6qz43ZJ; Wed, 5 Feb 2020 04:27:45 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2F7DB25037; Wed, 5 Feb 2020 04:27:45 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0154Rjjm079161; Wed, 5 Feb 2020 04:27:45 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0154RjGB079160; Wed, 5 Feb 2020 04:27:45 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202002050427.0154RjGB079160@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 5 Feb 2020 04:27:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357562 - head/sbin/init X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sbin/init X-SVN-Commit-Revision: 357562 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 04:27:45 -0000 Author: kevans Date: Wed Feb 5 04:27:44 2020 New Revision: 357562 URL: https://svnweb.freebsd.org/changeset/base/357562 Log: init(8): set environment variables from the "daemon" class as well Specifically, when running /etc/rc. This allows one to specify via login.conf(5) an environment that should be used when running services to ease, e.g., setting up env vars for an HTTP proxy consistently across cron and services alike. Future changes will extend cron(8)/service(8) to use environment vars pecified in login.conf(5) as well to promote a more cohesive experience. This is a part of D21481. Submitted by: Andrew Gierth Modified: head/sbin/init/init.c Modified: head/sbin/init/init.c ============================================================================== --- head/sbin/init/init.c Wed Feb 5 04:27:08 2020 (r357561) +++ head/sbin/init/init.c Wed Feb 5 04:27:44 2020 (r357562) @@ -2053,6 +2053,7 @@ setprocresources(const char *cname) login_cap_t *lc; if ((lc = login_getclassbyname(cname, NULL)) != NULL) { setusercontext(lc, (struct passwd*)NULL, 0, + LOGIN_SETENV | LOGIN_SETPRIORITY | LOGIN_SETRESOURCES | LOGIN_SETLOGINCLASS | LOGIN_SETCPUMASK); login_close(lc); From owner-svn-src-all@freebsd.org Wed Feb 5 04:29:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6A15B23F73B; Wed, 5 Feb 2020 04:29:56 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48C7rh1r56z43jw; Wed, 5 Feb 2020 04:29:56 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2152E2503C; Wed, 5 Feb 2020 04:29:56 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0154TuCr079436; Wed, 5 Feb 2020 04:29:56 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0154TtpJ079419; Wed, 5 Feb 2020 04:29:55 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202002050429.0154TtpJ079419@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 5 Feb 2020 04:29:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357563 - head/usr.bin/env X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.bin/env X-SVN-Commit-Revision: 357563 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 04:29:56 -0000 Author: kevans Date: Wed Feb 5 04:29:55 2020 New Revision: 357563 URL: https://svnweb.freebsd.org/changeset/base/357563 Log: env(1): grow -L user/class and -U user/class options This allows one to set the environment of the specified user either from login.conf alone (-L) or both login.conf and ~/.login_conf if present (-U). This is a supporting feature to allow service(8) to pull in the environment of the "daemon" class before invoking the rc script. This is a part of D21481. Submitted by: Andrew Gierth < andrew_tao173.riddles.org.uk> Modified: head/usr.bin/env/Makefile head/usr.bin/env/env.1 head/usr.bin/env/env.c Modified: head/usr.bin/env/Makefile ============================================================================== --- head/usr.bin/env/Makefile Wed Feb 5 04:27:44 2020 (r357562) +++ head/usr.bin/env/Makefile Wed Feb 5 04:29:55 2020 (r357563) @@ -4,4 +4,6 @@ PROG= env SRCS= env.c envopts.c +LIBADD= util + .include Modified: head/usr.bin/env/env.1 ============================================================================== --- head/usr.bin/env/env.1 Wed Feb 5 04:27:44 2020 (r357562) +++ head/usr.bin/env/env.1 Wed Feb 5 04:29:55 2020 (r357563) @@ -31,7 +31,7 @@ .\" From FreeBSD: src/usr.bin/printenv/printenv.1,v 1.17 2002/11/26 17:33:35 ru Exp .\" $FreeBSD$ .\" -.Dd November 7, 2019 +.Dd January 19, 2020 .Dt ENV 1 .Os .Sh NAME @@ -40,6 +40,7 @@ .Sh SYNOPSIS .Nm .Op Fl 0iv +.Op Fl L Ns | Ns Fl U Ar user Ns Op / Ns Ar class .Op Fl P Ar altpath .Op Fl S Ar string .Op Fl u Ar name @@ -76,6 +77,28 @@ The environment inherited by .Nm is ignored completely. +.\" -L | -U +.It Fl L | Fl U Ar user Ns Op / Ns Ar class +Add the environment variable definitions from +.Xr login.conf 5 +for the specified user and login class to the environment, after +processing any +.Fl i +or +.Fl u +options, but before processing any +.Ar name Ns = Ns Ar value +options. +If +.Fl L +is used, only the system-wide +.Pa /etc/login.conf.db +file is read; if +.Fl U +is used, then the specified user's +.Pa ~/.login_conf +is read as well. +The user may be specified by name or by uid. .\" -P .It Fl P Ar altpath Search the set of directories as specified by @@ -450,6 +473,7 @@ option as a synonym for .Xr printenv 1 , .Xr sh 1 , .Xr execvp 3 , +.Xr login.conf 5 , .Xr environ 7 .Sh STANDARDS The @@ -457,7 +481,7 @@ The utility conforms to .St -p1003.1-2001 . The -.Fl P , S , u +.Fl 0 , L , P , S , U , u and .Fl v options are non-standard extensions supported by @@ -474,6 +498,12 @@ and .Fl v options were added in .Fx 6.0 . +The +.Fl 0 , L +and +.Fl U +options were added in +.Fx 13.0 . .Sh BUGS The .Nm Modified: head/usr.bin/env/env.c ============================================================================== --- head/usr.bin/env/env.c Wed Feb 5 04:27:44 2020 (r357562) +++ head/usr.bin/env/env.c Wed Feb 5 04:29:55 2020 (r357563) @@ -44,11 +44,16 @@ static char sccsid[] = "@(#)env.c 8.3 (Berkeley) 4/2/9 #include __FBSDID("$FreeBSD$"); +#include + #include #include +#include +#include +#include #include -#include #include +#include #include #include "envopts.h" @@ -71,13 +76,23 @@ main(int argc, char **argv) { char *altpath, **ep, *p, **parg, term; char *cleanenv[1]; + char *login_class, *login_name; + struct passwd *pw; + login_cap_t *lc; + bool login_as_user; + uid_t uid; int ch, want_clear; int rtrn; altpath = NULL; + login_class = NULL; + login_name = NULL; + pw = NULL; + lc = NULL; + login_as_user = false; want_clear = 0; term = '\n'; - while ((ch = getopt(argc, argv, "-0iP:S:u:v")) != -1) + while ((ch = getopt(argc, argv, "-0iL:P:S:U:u:v")) != -1) switch(ch) { case '-': case 'i': @@ -86,6 +101,12 @@ main(int argc, char **argv) case '0': term = '\0'; break; + case 'U': + login_as_user = true; + /* FALLTHROUGH */ + case 'L': + login_name = optarg; + break; case 'P': altpath = strdup(optarg); break; @@ -119,6 +140,48 @@ main(int argc, char **argv) if (env_verbosity) fprintf(stderr, "#env clearing environ\n"); } + if (login_name != NULL) { + login_class = strchr(login_name, '/'); + if (login_class) + *login_class++ = '\0'; + pw = getpwnam(login_name); + if (pw == NULL) { + char *endp = NULL; + errno = 0; + uid = strtoul(login_name, &endp, 10); + if (errno == 0 && *endp == '\0') + pw = getpwuid(uid); + } + if (pw == NULL) + errx(EXIT_FAILURE, "no such user: %s", login_name); + if (login_class != NULL) { + lc = login_getclass(login_class); + if (lc == NULL) + errx(EXIT_FAILURE, "no such login class: %s", + login_class); + } else { + lc = login_getpwclass(pw); + if (lc == NULL) + errx(EXIT_FAILURE, "login_getpwclass failed"); + } + + /* + * This is not done with setusercontext() because that will + * try and use ~/.login_conf even when we don't want it to. + */ + setclassenvironment(lc, pw, 1); + setclassenvironment(lc, pw, 0); + if (login_as_user) { + login_close(lc); + if ((lc = login_getuserclass(pw)) != NULL) { + setclassenvironment(lc, pw, 1); + setclassenvironment(lc, pw, 0); + } + } + endpwent(); + if (lc != NULL) + login_close(lc); + } for (argv += optind; *argv && (p = strchr(*argv, '=')); ++argv) { if (env_verbosity) fprintf(stderr, "#env setenv:\t%s\n", *argv); @@ -154,7 +217,7 @@ static void usage(void) { (void)fprintf(stderr, - "usage: env [-0iv] [-P utilpath] [-S string] [-u name]\n" + "usage: env [-0iv] [-L|-U user[/class]] [-P utilpath] [-S string] [-u name]\n" " [name=value ...] [utility [argument ...]]\n"); exit(1); } From owner-svn-src-all@freebsd.org Wed Feb 5 04:32:50 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1F12D23F962; Wed, 5 Feb 2020 04:32:50 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48C7w160Nsz449g; Wed, 5 Feb 2020 04:32:49 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C889625213; Wed, 5 Feb 2020 04:32:49 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0154Wnbc084848; Wed, 5 Feb 2020 04:32:49 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0154WnaG084847; Wed, 5 Feb 2020 04:32:49 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202002050432.0154WnaG084847@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 5 Feb 2020 04:32:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357564 - head/usr.sbin/service X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.sbin/service X-SVN-Commit-Revision: 357564 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 04:32:50 -0000 Author: kevans Date: Wed Feb 5 04:32:49 2020 New Revision: 357564 URL: https://svnweb.freebsd.org/changeset/base/357564 Log: service(8): set the environment of the "daemon" class before invoking As mentioned in r357562, this gives the user a single place to configure environment variables that need to be used for various services -- the "daemon" class -- for, e.g., configuring a system-wide HTTP proxy. This is a part of D21481. Submitted by: Andrew Gierth Modified: head/usr.sbin/service/service.sh Modified: head/usr.sbin/service/service.sh ============================================================================== --- head/usr.sbin/service/service.sh Wed Feb 5 04:29:55 2020 (r357563) +++ head/usr.sbin/service/service.sh Wed Feb 5 04:32:49 2020 (r357564) @@ -165,7 +165,7 @@ cd / for dir in /etc/rc.d $local_startup; do if [ -x "$dir/$script" ]; then [ -n "$VERBOSE" ] && echo "$script is located in $dir" - exec env -i HOME=/ PATH=/sbin:/bin:/usr/sbin:/usr/bin $dir/$script "$@" + exec env -i -L 0/daemon HOME=/ PATH=/sbin:/bin:/usr/sbin:/usr/bin "$dir/$script" "$@" fi done From owner-svn-src-all@freebsd.org Wed Feb 5 04:35:55 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 42A4123FAAE; Wed, 5 Feb 2020 04:35:55 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48C7zZ6jx7z44PX; Wed, 5 Feb 2020 04:35:54 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E1C5F25217; Wed, 5 Feb 2020 04:35:54 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0154Zsxn085183; Wed, 5 Feb 2020 04:35:54 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0154ZscZ085181; Wed, 5 Feb 2020 04:35:54 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202002050435.0154ZscZ085181@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 5 Feb 2020 04:35:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357565 - in head/usr.sbin/cron: cron crontab X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/usr.sbin/cron: cron crontab X-SVN-Commit-Revision: 357565 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 04:35:55 -0000 Author: kevans Date: Wed Feb 5 04:35:54 2020 New Revision: 357565 URL: https://svnweb.freebsd.org/changeset/base/357565 Log: cron(8): set the environment variables of the user and/or login class Prior to processing environment variable set in the crontab file as those should be of higher precedent, pull in the user or login class environment. This is another supporting feature for allowing one to configure system-wide settings that may affect both regular cron jobs as well as services. This is the final part of D21481. Submitted by: Andrew Gierth Modified: head/usr.sbin/cron/cron/do_command.c head/usr.sbin/cron/crontab/crontab.5 Modified: head/usr.sbin/cron/cron/do_command.c ============================================================================== --- head/usr.sbin/cron/cron/do_command.c Wed Feb 5 04:32:49 2020 (r357564) +++ head/usr.sbin/cron/cron/do_command.c Wed Feb 5 04:35:54 2020 (r357565) @@ -43,6 +43,8 @@ static void child_process(entry *, user *), static WAIT_T wait_on_child(PID_T, const char *); +extern char *environ; + void do_command(e, u) entry *e; @@ -285,9 +287,11 @@ child_process(e, u) */ do_univ(u); + environ = NULL; + # if defined(LOGIN_CAP) - /* Set user's entire context, but skip the environment - * as cron provides a separate interface for this + /* Set user's entire context, but note that PATH will + * be overridden later */ if ((pwd = getpwnam(usernm)) == NULL) pwd = getpwuid(e->uid); @@ -299,7 +303,7 @@ child_process(e, u) } if (pwd && setusercontext(lc, pwd, e->uid, - LOGIN_SETALL & ~(LOGIN_SETPATH|LOGIN_SETENV)) == 0) + LOGIN_SETALL) == 0) (void) endpwent(); else { /* fall back to the old method */ @@ -342,7 +346,19 @@ child_process(e, u) */ { char *shell = env_get("SHELL", e->envp); + char **p; + /* Apply the environment from the entry, overriding existing + * values (this will always set PATH, LOGNAME, etc.) putenv + * should not fail unless malloc does. + */ + for (p = e->envp; *p; ++p) { + if (putenv(*p) != 0) { + warn("putenv"); + _exit(ERROR_EXIT); + } + } + # if DEBUGGING if (DebugFlags & DTEST) { fprintf(stderr, @@ -352,9 +368,8 @@ child_process(e, u) _exit(OK_EXIT); } # endif /*DEBUGGING*/ - execle(shell, shell, "-c", e->cmd, (char *)NULL, - e->envp); - warn("execle: couldn't exec `%s'", shell); + execl(shell, shell, "-c", e->cmd, (char *)NULL); + warn("execl: couldn't exec `%s'", shell); _exit(ERROR_EXIT); } break; Modified: head/usr.sbin/cron/crontab/crontab.5 ============================================================================== --- head/usr.sbin/cron/crontab/crontab.5 Wed Feb 5 04:32:49 2020 (r357564) +++ head/usr.sbin/cron/crontab/crontab.5 Wed Feb 5 04:35:54 2020 (r357565) @@ -17,7 +17,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 24, 2019 +.Dd January 19, 2020 .Dt CRONTAB 5 .Os .Sh NAME @@ -82,10 +82,18 @@ and are set from the .Pa /etc/passwd line of the crontab's owner. +In addition, the environment variables of the +user's login class, with the exception of +.Ev PATH , +will be set from +.Pa /etc/login.conf.db +and +.Pa ~/.login_conf . .Ev HOME , .Ev PATH and -.Ev SHELL +.Ev SHELL , +and any variables set from the login class, may be overridden by settings in the crontab; .Ev LOGNAME may not. From owner-svn-src-all@freebsd.org Wed Feb 5 04:43:58 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A900923FDE1; Wed, 5 Feb 2020 04:43:58 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48C88t3vYHz44xr; Wed, 5 Feb 2020 04:43:58 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 813D6253FD; Wed, 5 Feb 2020 04:43:58 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0154hw0X091234; Wed, 5 Feb 2020 04:43:58 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0154hwPl091233; Wed, 5 Feb 2020 04:43:58 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202002050443.0154hwPl091233@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 5 Feb 2020 04:43:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357566 - head X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 357566 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 04:43:58 -0000 Author: kevans Date: Wed Feb 5 04:43:58 2020 New Revision: 357566 URL: https://svnweb.freebsd.org/changeset/base/357566 Log: Add RELNOTES entry for various daemons pulling in environment variables Modified: head/RELNOTES Modified: head/RELNOTES ============================================================================== --- head/RELNOTES Wed Feb 5 04:35:54 2020 (r357565) +++ head/RELNOTES Wed Feb 5 04:43:58 2020 (r357566) @@ -10,6 +10,12 @@ newline. Entries should be separated by a newline. Changes to this file should not be MFCed. +r357560-r357565: + init(8), service(8), and cron(8) will now adopt user/class environment + variables (excluding PATH, by default, which will be overwritten) by + default. Notably, environment variables for all cron jobs and rc + services can now be set via login.conf(5). + r355677: Adds support for NFSv4.2 (RFC-7862) and Extended Attributes (RFC-8276) to the NFS client and server. From owner-svn-src-all@freebsd.org Wed Feb 5 05:00:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E70D12401E7; Wed, 5 Feb 2020 05:00:46 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48C8XG5vF3z45dJ; Wed, 5 Feb 2020 05:00:46 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.codepro.be", Issuer "Let's Encrypt Authority X3" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id AC084F003; Wed, 5 Feb 2020 05:00:46 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from [10.10.132.6] (unknown [IPv6:2603:3024:1548:3800:fd22:4b29:424a:6f13]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id E31CFECEA; Wed, 5 Feb 2020 06:00:43 +0100 (CET) From: "Kristof Provost" To: "Gleb Smirnoff" Cc: "Ilja Van Sprundel" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r357233 - head/sys/net Date: Tue, 04 Feb 2020 21:00:41 -0800 X-Mailer: MailMate (1.13.1r5671) Message-ID: <3B2A3254-35A4-41BF-A33A-4BD2C4610E71@FreeBSD.org> In-Reply-To: <20200204193239.GR1268@FreeBSD.org> References: <202001282244.00SMiPrb077446@repo.freebsd.org> <20200130163455.GH1268@FreeBSD.org> <3F7A5204-4437-4845-8E40-0BC5D1CD0A5B@FreeBSD.org> <20200204193239.GR1268@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 05:00:47 -0000 On 4 Feb 2020, at 11:32, Gleb Smirnoff wrote: > On Sat, Feb 01, 2020 at 07:26:48PM +0000, Kristof Provost wrote: > K> > K> -/* The below interface used only by epair(4). */ > K> > K> +/* The below interfaces are used only by epair(4). */ > K> > K> +void if_clone_addif(struct if_clone *, struct ifnet *); > K> > K> int if_clone_destroyif(struct if_clone *, struct ifnet *); > K> > > K> > IMHO, makes sense to move all these declaration into if_epair.c > K> > itself. > K> > > K> Yeah, that does make sense. > K> > K> One minor issue is that it turns out that if_clone_destroyif() > isn’t > K> just used by if_epair, but also by the wifi code. > K> > K> How does this look? > > Yes, that's what I suggested. However, now given that net80211 also > uses one of these methods, I'm not sure if isolating is a right move. > > In general, we consider if_clone KPI an internal one, don't we? I > mean we don't expect 3rd party device drivers to use it. So may be > it is fine that if_clone.h exposes those functions? It’s been this way for a long time, so .. yeah, I’m inclined to just leave it this way. Arguably we should change the if_clone API to be able to cope with the requirements of if_epair and net80211 as well, but that’s a far bigger project, if there’s even a sensible way to do so. Regards, Kristof From owner-svn-src-all@freebsd.org Wed Feb 5 05:42:42 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ECA1F240C84; Wed, 5 Feb 2020 05:42:42 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48C9Sf5wG5z47LH; Wed, 5 Feb 2020 05:42:42 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C65AA25ED5; Wed, 5 Feb 2020 05:42:42 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0155ggsJ026641; Wed, 5 Feb 2020 05:42:42 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0155ggEF026640; Wed, 5 Feb 2020 05:42:42 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <202002050542.0155ggEF026640@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Wed, 5 Feb 2020 05:42:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357567 - head/stand/i386/zfsboot X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/i386/zfsboot X-SVN-Commit-Revision: 357567 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 05:42:43 -0000 Author: tsoome Date: Wed Feb 5 05:42:42 2020 New Revision: 357567 URL: https://svnweb.freebsd.org/changeset/base/357567 Log: vdev_read_pad2: freeing wrong pointer Shoud free previously allocated tmp buffer instead. Issue introduced in r357497. Reported by: rpokala Modified: head/stand/i386/zfsboot/zfsboot.c Modified: head/stand/i386/zfsboot/zfsboot.c ============================================================================== --- head/stand/i386/zfsboot/zfsboot.c Wed Feb 5 04:43:58 2020 (r357566) +++ head/stand/i386/zfsboot/zfsboot.c Wed Feb 5 05:42:42 2020 (r357567) @@ -337,7 +337,7 @@ vdev_read_pad2(vdev_t *vdev, char *buf, size_t size) rc = vdev_read_phys(vdev, &bp, tmp, off, 0); if (rc == 0) memcpy(buf, tmp, size); - free(buf); + free(tmp); return (rc); } From owner-svn-src-all@freebsd.org Wed Feb 5 08:55:20 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 659D524444C; Wed, 5 Feb 2020 08:55:20 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CFkw2gDVz4GXP; Wed, 5 Feb 2020 08:55:20 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 566B01EC; Wed, 5 Feb 2020 08:55:20 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0158tKrJ045278; Wed, 5 Feb 2020 08:55:20 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0158tJuB045272; Wed, 5 Feb 2020 08:55:19 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202002050855.0158tJuB045272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 5 Feb 2020 08:55:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357568 - stable/12/sbin/fsck_msdosfs X-SVN-Group: stable-12 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/12/sbin/fsck_msdosfs X-SVN-Commit-Revision: 357568 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 08:55:20 -0000 Author: delphij Date: Wed Feb 5 08:55:19 2020 New Revision: 357568 URL: https://svnweb.freebsd.org/changeset/base/357568 Log: MFC r356249-r356250, r356313, r356434, r356657, r357421 r356249-r356250, r356313: Reduce memory footprint of fsck_msdosfs. This utility was initially written for FAT12/16, which were inherently small. When FAT32 support was added, the old data structure and algorithms remain used with minimal changes. With growing size of FAT32 media, the current data structure that requires 4 32-bit variables per each FAT32 table entry would consume up to 4 GiB of RAM, which can be too big for systems with limited RAM available. Address this by taking a different approach of validating the FAT. The FAT is essentially a set of linked lists of chains that was referenced by directory entries, and the checker needs to make sure that the linked chains of clusters do not have cross-linked chains, and every chain were referenced by one and only one directory entry. Instead of keeping track of the chain's 'head' cluster number, the size of the chain, the used status of the chain and the "next" pointer which is content of the FAT table, we create accessors for the FAT table data for the "next" pointer, and keep only one bit to indicate if the current cluster is a 'head' node of a cluster chain, in a bitmap. We further overhaul the FAT checker to find out the possible head nodes by excluding ones that are not (in other words, nodes that have some other nodes claiming them as the next node) instead of marking the head nodes for each node on the chain. This approach greatly reduced the complexiety of computation from O(N^2) worst case, to an O(N) scan for worst case. The file (cluster chain) length is not useful for the FAT checker, so don't bother to calculate them in the FAT checker and instead leave the task to the directory structure check, at which point we would have non-crossed cluster chains, and we are guaranteed that each cluster will be visited for at most one time. When checking the directory structures, we use the head node indicator to as the visited (used) flag: every cluster chain can only be referenced by one directory entry, so we clear them when calculating the length of the chain, and we can immediately tell if there are anomalies in the directory entry. As a result, the required RAM size is now 1 bit per each entry of the FAT table, plus memory needed to hold the FAT table in memory, instead of 16 bytes (=128 bits) per each entry. For FAT12 and FAT16, we will load the whole FAT table into memory as they are smaller than 128KiB, and for FAT32, we first attempt to mmap() it into memory, and when that fails, we would fall back to a simple LRU cache of 4 MiB of RAM. sbin/fsck_msdosfs/boot.c: - Added additional sanity checks for valid FAT32/FAT16/FAT12 cluster number. - FAT32: check if root directory starts with a valid cluster number, moved from dir.c. There is no point to proceed if the filesystem is already damaged beyond repair. sbin/fsck_msdosfs/check.c: - Combine phase 1 and phase 2, now that the readfat() is able to detect cross chains. sbin/fsck_msdosfs/dir.c: - Refactor code to use FAT accessor instead of accessing the internal representation of FAT table. - Make use of the cluster chain head bitmap. - Clarify and simplify directory entry check, remove unnecessary checks that are would be done at a later time (for example, whether the directory's second cluster is a valid one, which is examined more throughly in a later checkchain() and does not prevent us from proceeding further). sbin/fsck_msdosfs/dosfs.h: - Remove internal representation of FAT table, which is replaced by the head bitmap that is opaque to other code. - Added a special CLUST_DEAD cluster type to indicate errors. sbin/fsck_msdosfs/ext.h: - Added a flag that overrides mmap(2) setting. The corresponding command line option, -M is intentionally undocumented as we do not expect users to need it. - Added accessors for FAT table and convert existing interface to use it. sbin/fsck_msdosfs/fat.c: - Added head bitmap to represent whether a cluster is a head cluster. - Converted FAT internal representation to accessors. - Implemented a LRU cache for FAT32 when mmap(2) should not or can not be used. - _readfat: Attempt a mmap(2) and fall back to regular read for non-FAT32 file systems; use the LRU cache for FAT32 and prepopulate the cache with the first 4MiB of the entries. - readfat: Added support of head bitmap and use the population scan to detect bogus chains. - clusterdiff: removed, FATs are copied from the checked copy via writefat()/copyfat(). - checkchain: calculates the length of a cluster chain and make sure that it ends with a valid EOF marker. - clearchain: follow and clear a chain and maintain the free cluster count. - checklost: convert to use head bitmap. At the end of all other scans, the remaining 'head' nodes are leaders of lost cluster chains. sbin/fsck_msdosfs/fat.c: - Added a new -M option which is intentionally undocumented, to disable the use of mmap(). r356434: fsck_msdosfs.8: document -M. r356657: Tighten FAT checks and fix off-by-one error in corner case. sbin/fsck_msdosfs/fat.c: - readfat: * Only truncate out-of-range cluster pointers (1, or greater than NumClusters but smaller than CLUST_RSRVD), as the current cluster may contain some data. We can't fix reserved cluster pointers at this pass, because we do no know the potential cluster preceding it. * Accept valid cluster for head bitmap. This is a no-op, and mainly to improve code readability, because the 1 is already handled in the previous else if block. - truncate_at: absorbed into checkchain. - checkchain: save the previous node we have traversed in case that we have a chain that ends with a special (>= CLUST_RSRVD) cluster, or is free. In these cases, we need to truncate at the cluster preceding the current cluster, as the current cluster contains a marker instead of a next pointer and can not be changed to CLUST_EOF (the else case can happen if the user answered "no" at some point in readfat()). - clearchain: correct the iterator for next cluster so that we don't stop after clearing the first cluster. - checklost: If checkchain() thinks the chain have no cluster, it doesn't make sense to reconnect it, so don't bother asking. r357421: Diff reduction against NetBSD, no functional change. Relnotes: yes Modified: stable/12/sbin/fsck_msdosfs/boot.c stable/12/sbin/fsck_msdosfs/check.c stable/12/sbin/fsck_msdosfs/dir.c stable/12/sbin/fsck_msdosfs/dosfs.h stable/12/sbin/fsck_msdosfs/ext.h stable/12/sbin/fsck_msdosfs/fat.c stable/12/sbin/fsck_msdosfs/fsck_msdosfs.8 stable/12/sbin/fsck_msdosfs/main.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/fsck_msdosfs/boot.c ============================================================================== --- stable/12/sbin/fsck_msdosfs/boot.c Wed Feb 5 05:42:42 2020 (r357567) +++ stable/12/sbin/fsck_msdosfs/boot.c Wed Feb 5 08:55:19 2020 (r357568) @@ -28,7 +28,7 @@ #include #ifndef lint -__RCSID("$NetBSD: boot.c,v 1.21 2018/02/08 09:05:17 dholland Exp $"); +__RCSID("$NetBSD: boot.c,v 1.22 2020/01/11 16:29:07 christos Exp $"); static const char rcsid[] = "$FreeBSD$"; #endif /* not lint */ @@ -152,9 +152,6 @@ readboot(int dosfs, struct bootblock *boot) boot->NumSectors = boot->bpbHugeSectors; } - - - if (boot->flags & FAT32) { /* If the OEM Name field is EXFAT, it's not FAT32, so bail */ if (!memcmp(&block[3], "EXFAT ", 8)) { @@ -270,18 +267,36 @@ readboot(int dosfs, struct bootblock *boot) } /* - * The number of clusters is derived from available data sectors, divided - * by sectors per cluster. + * The number of clusters is derived from available data sectors, + * divided by sectors per cluster. */ - boot->NumClusters = (boot->NumSectors - boot->FirstCluster) / boot->bpbSecPerClust; + boot->NumClusters = + (boot->NumSectors - boot->FirstCluster) / boot->bpbSecPerClust; - if (boot->flags & FAT32) + if (boot->flags & FAT32) { + if (boot->NumClusters > (CLUST_RSRVD & CLUST32_MASK)) { + pfatal("Filesystem too big (%u clusters) for FAT32 partition", + boot->NumClusters); + return FSFATAL; + } + if (boot->NumClusters < (CLUST_RSRVD & CLUST16_MASK)) { + pfatal("Filesystem too small (%u clusters) for FAT32 partition", + boot->NumClusters); + return FSFATAL; + } boot->ClustMask = CLUST32_MASK; - else if (boot->NumClusters < (CLUST_RSRVD&CLUST12_MASK)) + + if (boot->bpbRootClust < CLUST_FIRST || + boot->bpbRootClust >= boot->NumClusters) { + pfatal("Root directory starts with cluster out of range(%u)", + boot->bpbRootClust); + return FSFATAL; + } + } else if (boot->NumClusters < (CLUST_RSRVD&CLUST12_MASK)) { boot->ClustMask = CLUST12_MASK; - else if (boot->NumClusters < (CLUST_RSRVD&CLUST16_MASK)) + } else if (boot->NumClusters < (CLUST_RSRVD&CLUST16_MASK)) { boot->ClustMask = CLUST16_MASK; - else { + } else { pfatal("Filesystem too big (%u clusters) for non-FAT32 partition", boot->NumClusters); return FSFATAL; @@ -306,8 +321,8 @@ readboot(int dosfs, struct bootblock *boot) } /* - * There are two reserved clusters. To avoid adding CLUST_FIRST every time - * when we perform boundary checks, we increment the NumClusters by 2, + * There are two reserved clusters. To avoid adding CLUST_FIRST every + * time we perform boundary checks, we increment the NumClusters by 2, * which is CLUST_FIRST to denote the first out-of-range cluster number. */ boot->NumClusters += CLUST_FIRST; Modified: stable/12/sbin/fsck_msdosfs/check.c ============================================================================== --- stable/12/sbin/fsck_msdosfs/check.c Wed Feb 5 05:42:42 2020 (r357567) +++ stable/12/sbin/fsck_msdosfs/check.c Wed Feb 5 08:55:19 2020 (r357568) @@ -47,9 +47,8 @@ checkfilesys(const char *fname) { int dosfs; struct bootblock boot; - struct fatEntry *fat = NULL; + struct fat_descriptor *fat = NULL; int finish_dosdirsection=0; - u_int i; int mod = 0; int ret = 8; @@ -88,65 +87,39 @@ checkfilesys(const char *fname) } if (!preen) { - if (boot.ValidFat < 0) - printf("** Phase 1 - Read and Compare FATs\n"); - else - printf("** Phase 1 - Read FAT\n"); + printf("** Phase 1 - Read FAT and checking connectivity\n"); } - mod |= readfat(dosfs, &boot, boot.ValidFat >= 0 ? boot.ValidFat : 0, &fat); + mod |= readfat(dosfs, &boot, &fat); if (mod & FSFATAL) { close(dosfs); return 8; } - if (boot.ValidFat < 0) - for (i = 1; i < boot.bpbFATs; i++) { - struct fatEntry *currentFat; - - mod |= readfat(dosfs, &boot, i, ¤tFat); - - if (mod & FSFATAL) - goto out; - - mod |= comparefat(&boot, fat, currentFat, i); - free(currentFat); - if (mod & FSFATAL) - goto out; - } - if (!preen) - printf("** Phase 2 - Check Cluster Chains\n"); + printf("** Phase 2 - Checking Directories\n"); - mod |= checkfat(&boot, fat); - if (mod & FSFATAL) - goto out; - /* delay writing FATs */ - - if (!preen) - printf("** Phase 3 - Checking Directories\n"); - - mod |= resetDosDirSection(&boot, fat); + mod |= resetDosDirSection(fat); finish_dosdirsection = 1; if (mod & FSFATAL) goto out; /* delay writing FATs */ - mod |= handleDirTree(dosfs, &boot, fat); + mod |= handleDirTree(fat); if (mod & FSFATAL) goto out; if (!preen) - printf("** Phase 4 - Checking for Lost Files\n"); + printf("** Phase 3 - Checking for Lost Files\n"); - mod |= checklost(dosfs, &boot, fat); + mod |= checklost(fat); if (mod & FSFATAL) goto out; /* now write the FATs */ - if (mod & (FSFATMOD|FSFIXFAT)) { + if (mod & FSFATMOD) { if (ask(1, "Update FATs")) { - mod |= writefat(dosfs, &boot, fat, mod & FSFIXFAT); + mod |= writefat(fat); if (mod & FSFATAL) goto out; } else @@ -170,7 +143,7 @@ checkfilesys(const char *fname) if (mod & FSDIRTY) { pwarn("MARKING FILE SYSTEM CLEAN\n"); - mod |= writefat(dosfs, &boot, fat, 1); + mod |= writefat(fat); } else { pwarn("\n***** FILE SYSTEM IS LEFT MARKED AS DIRTY *****\n"); mod |= FSERROR; /* file system not clean */ Modified: stable/12/sbin/fsck_msdosfs/dir.c ============================================================================== --- stable/12/sbin/fsck_msdosfs/dir.c Wed Feb 5 05:42:42 2020 (r357567) +++ stable/12/sbin/fsck_msdosfs/dir.c Wed Feb 5 08:55:19 2020 (r357568) @@ -1,6 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * + * Copyright (c) 2019 Google LLC * Copyright (C) 1995, 1996, 1997 Wolfgang Solfrank * Copyright (c) 1995 Martin Husemann * Some structure declaration borrowed from Paul Popelka @@ -95,14 +96,11 @@ static struct dirTodoNode *newDirTodo(void); static void freeDirTodo(struct dirTodoNode *); static char *fullpath(struct dosDirEntry *); static u_char calcShortSum(u_char *); -static int delete(int, struct bootblock *, struct fatEntry *, cl_t, int, - cl_t, int, int); -static int removede(int, struct bootblock *, struct fatEntry *, u_char *, - u_char *, cl_t, cl_t, cl_t, char *, int); -static int checksize(struct bootblock *, struct fatEntry *, u_char *, - struct dosDirEntry *); -static int readDosDirSection(int, struct bootblock *, struct fatEntry *, - struct dosDirEntry *); +static int delete(struct fat_descriptor *, cl_t, int, cl_t, int, int); +static int removede(struct fat_descriptor *, u_char *, u_char *, + cl_t, cl_t, cl_t, char *, int); +static int checksize(struct fat_descriptor *, u_char *, struct dosDirEntry *); +static int readDosDirSection(struct fat_descriptor *, struct dosDirEntry *); /* * Manage free dosDirEntry structures. @@ -116,7 +114,7 @@ newDosDirEntry(void) if (!(de = freede)) { if (!(de = malloc(sizeof *de))) - return 0; + return (NULL); } else freede = de->next; return de; @@ -193,7 +191,7 @@ fullpath(struct dosDirEntry *dir) /* * Calculate a checksum over an 8.3 alias name */ -static u_char +static inline u_char calcShortSum(u_char *p) { u_char sum = 0; @@ -221,21 +219,24 @@ static struct dosDirEntry *lostDir; * Init internal state for a new directory scan. */ int -resetDosDirSection(struct bootblock *boot, struct fatEntry *fat) +resetDosDirSection(struct fat_descriptor *fat) { - int b1, b2; + int rootdir_size, cluster_size; int ret = FSOK; size_t len; + struct bootblock *boot; - b1 = boot->bpbRootDirEnts * 32; - b2 = boot->bpbSecPerClust * boot->bpbBytesPerSec; + boot = fat_get_boot(fat); - if ((buffer = malloc(len = MAX(b1, b2))) == NULL) { + rootdir_size = boot->bpbRootDirEnts * 32; + cluster_size = boot->bpbSecPerClust * boot->bpbBytesPerSec; + + if ((buffer = malloc(len = MAX(rootdir_size, cluster_size))) == NULL) { perr("No space for directory buffer (%zu)", len); return FSFATAL; } - if ((delbuf = malloc(len = b2)) == NULL) { + if ((delbuf = malloc(len = cluster_size)) == NULL) { free(buffer); perr("No space for directory delbuf (%zu)", len); return FSFATAL; @@ -250,18 +251,10 @@ resetDosDirSection(struct bootblock *boot, struct fatE memset(rootDir, 0, sizeof *rootDir); if (boot->flags & FAT32) { - if (boot->bpbRootClust < CLUST_FIRST || - boot->bpbRootClust >= boot->NumClusters) { - pfatal("Root directory starts with cluster out of range(%u)", - boot->bpbRootClust); - return FSFATAL; - } - if (fat[boot->bpbRootClust].head != boot->bpbRootClust) { + if (!fat_is_cl_head(fat, boot->bpbRootClust)) { pfatal("Root directory doesn't start a cluster chain"); return FSFATAL; } - - fat[boot->bpbRootClust].flags |= FAT_USED; rootDir->head = boot->bpbRootClust; } @@ -302,16 +295,21 @@ finishDosDirSection(void) * Delete directory entries between startcl, startoff and endcl, endoff. */ static int -delete(int f, struct bootblock *boot, struct fatEntry *fat, cl_t startcl, +delete(struct fat_descriptor *fat, cl_t startcl, int startoff, cl_t endcl, int endoff, int notlast) { u_char *s, *e; off_t off; - int clsz = boot->bpbSecPerClust * boot->bpbBytesPerSec; + int clsz, fd; + struct bootblock *boot; + boot = fat_get_boot(fat); + fd = fat_get_fd(fat); + clsz = boot->bpbSecPerClust * boot->bpbBytesPerSec; + s = delbuf + startoff; e = delbuf + clsz; - while (startcl >= CLUST_FIRST && startcl < boot->NumClusters) { + while (fat_is_valid_cl(fat, startcl)) { if (startcl == endcl) { if (notlast) break; @@ -320,11 +318,11 @@ delete(int f, struct bootblock *boot, struct fatEntry off = (startcl - CLUST_FIRST) * boot->bpbSecPerClust + boot->FirstCluster; off *= boot->bpbBytesPerSec; - if (lseek(f, off, SEEK_SET) != off) { + if (lseek(fd, off, SEEK_SET) != off) { perr("Unable to lseek to %" PRId64, off); return FSFATAL; } - if (read(f, delbuf, clsz) != clsz) { + if (read(fd, delbuf, clsz) != clsz) { perr("Unable to read directory"); return FSFATAL; } @@ -332,25 +330,26 @@ delete(int f, struct bootblock *boot, struct fatEntry *s = SLOT_DELETED; s += 32; } - if (lseek(f, off, SEEK_SET) != off) { + if (lseek(fd, off, SEEK_SET) != off) { perr("Unable to lseek to %" PRId64, off); return FSFATAL; } - if (write(f, delbuf, clsz) != clsz) { + if (write(fd, delbuf, clsz) != clsz) { perr("Unable to write directory"); return FSFATAL; } if (startcl == endcl) break; - startcl = fat[startcl].next; + startcl = fat_get_cl_next(fat, startcl); s = delbuf; } return FSOK; } static int -removede(int f, struct bootblock *boot, struct fatEntry *fat, u_char *start, - u_char *end, cl_t startcl, cl_t endcl, cl_t curcl, char *path, int type) +removede(struct fat_descriptor *fat, u_char *start, + u_char *end, cl_t startcl, cl_t endcl, cl_t curcl, + char *path, int type) { switch (type) { case 0: @@ -366,14 +365,14 @@ removede(int f, struct bootblock *boot, struct fatEntr } if (ask(0, "Remove")) { if (startcl != curcl) { - if (delete(f, boot, fat, + if (delete(fat, startcl, start - buffer, endcl, end - buffer, endcl == curcl) == FSFATAL) return FSFATAL; start = buffer; } - /* startcl is < CLUST_FIRST for !fat32 root */ + /* startcl is < CLUST_FIRST for !FAT32 root */ if ((endcl == curcl) || (startcl < CLUST_FIRST)) for (; start < end; start += 32) *start = SLOT_DELETED; @@ -386,23 +385,37 @@ removede(int f, struct bootblock *boot, struct fatEntr * Check an in-memory file entry */ static int -checksize(struct bootblock *boot, struct fatEntry *fat, u_char *p, - struct dosDirEntry *dir) +checksize(struct fat_descriptor *fat, u_char *p, struct dosDirEntry *dir) { + int ret = FSOK; + size_t physicalSize; + struct bootblock *boot; + + boot = fat_get_boot(fat); + /* * Check size on ordinary files */ - u_int32_t physicalSize; - - if (dir->head == CLUST_FREE) + if (dir->head == CLUST_FREE) { physicalSize = 0; - else { - if (dir->head < CLUST_FIRST || dir->head >= boot->NumClusters) + } else { + if (!fat_is_valid_cl(fat, dir->head)) return FSERROR; - physicalSize = fat[dir->head].length * boot->ClusterSize; + ret = checkchain(fat, dir->head, &physicalSize); + /* + * Upon return, physicalSize would hold the chain length + * that checkchain() was able to validate, but if the user + * refused the proposed repair, it would be unsafe to + * proceed with directory entry fix, so bail out in that + * case. + */ + if (ret == FSERROR) { + return (FSERROR); + } + physicalSize *= boot->ClusterSize; } if (physicalSize < dir->size) { - pwarn("size of %s is %u, should at most be %u\n", + pwarn("size of %s is %u, should at most be %zu\n", fullpath(dir), dir->size, physicalSize); if (ask(1, "Truncate")) { dir->size = physicalSize; @@ -422,11 +435,10 @@ checksize(struct bootblock *boot, struct fatEntry *fat for (cl = dir->head, len = sz = 0; (sz += boot->ClusterSize) < dir->size; len++) - cl = fat[cl].next; - clearchain(boot, fat, fat[cl].next); - fat[cl].next = CLUST_EOF; - fat[dir->head].length = len; - return FSFATMOD; + cl = fat_get_cl_next(fat, cl); + clearchain(fat, fat_get_cl_next(fat, cl)); + ret = fat_set_cl_next(fat, cl, CLUST_EOF); + return (FSFATMOD | ret); } else return FSERROR; } @@ -442,15 +454,20 @@ static const u_char dotdot_name[11] = ".. "; * when we traverse into it. */ static int -check_subdirectory(int f, struct bootblock *boot, struct dosDirEntry *dir) +check_subdirectory(struct fat_descriptor *fat, struct dosDirEntry *dir) { u_char *buf, *cp; off_t off; cl_t cl; int retval = FSOK; + int fd; + struct bootblock *boot; + boot = fat_get_boot(fat); + fd = fat_get_fd(fat); + cl = dir->head; - if (dir->parent && (cl < CLUST_FIRST || cl >= boot->NumClusters)) { + if (dir->parent && !fat_is_valid_cl(fat, cl)) { return FSERROR; } @@ -474,8 +491,8 @@ check_subdirectory(int f, struct bootblock *boot, stru } off *= boot->bpbBytesPerSec; - if (lseek(f, off, SEEK_SET) != off || - read(f, buf, boot->bpbBytesPerSec) != (ssize_t)boot->bpbBytesPerSec) { + if (lseek(fd, off, SEEK_SET) != off || + read(fd, buf, boot->bpbBytesPerSec) != (ssize_t)boot->bpbBytesPerSec) { perr("Unable to read directory"); free(buf); return FSFATAL; @@ -509,22 +526,27 @@ check_subdirectory(int f, struct bootblock *boot, stru * - push directories onto the todo-stack */ static int -readDosDirSection(int f, struct bootblock *boot, struct fatEntry *fat, - struct dosDirEntry *dir) +readDosDirSection(struct fat_descriptor *fat, struct dosDirEntry *dir) { + struct bootblock *boot; struct dosDirEntry dirent, *d; u_char *p, *vallfn, *invlfn, *empty; off_t off; - int i, j, k, last; + int fd, i, j, k, iosize, entries; + bool is_legacyroot; cl_t cl, valcl = ~0, invcl = ~0, empcl = ~0; char *t; u_int lidx = 0; int shortSum; int mod = FSOK; + size_t dirclusters; #define THISMOD 0x8000 /* Only used within this routine */ + boot = fat_get_boot(fat); + fd = fat_get_fd(fat); + cl = dir->head; - if (dir->parent && (cl < CLUST_FIRST || cl >= boot->NumClusters)) { + if (dir->parent && (!fat_is_valid_cl(fat, cl))) { /* * Already handled somewhere else. */ @@ -532,24 +554,50 @@ readDosDirSection(int f, struct bootblock *boot, struc } shortSum = -1; vallfn = invlfn = empty = NULL; + + /* + * If we are checking the legacy root (for FAT12/FAT16), + * we will operate on the whole directory; otherwise, we + * will operate on one cluster at a time, and also take + * this opportunity to examine the chain. + * + * Derive how many entries we are going to encounter from + * the I/O size. + */ + is_legacyroot = (dir->parent == NULL && !(boot->flags & FAT32)); + if (is_legacyroot) { + iosize = boot->bpbRootDirEnts * 32; + entries = boot->bpbRootDirEnts; + } else { + iosize = boot->bpbSecPerClust * boot->bpbBytesPerSec; + entries = iosize / 32; + mod |= checkchain(fat, dir->head, &dirclusters); + } + do { - if (!(boot->flags & FAT32) && !dir->parent) { - last = boot->bpbRootDirEnts * 32; + if (is_legacyroot) { + /* + * Special case for FAT12/FAT16 root -- read + * in the whole root directory. + */ off = boot->bpbResSectors + boot->bpbFATs * boot->FATsecs; } else { - last = boot->bpbSecPerClust * boot->bpbBytesPerSec; + /* + * Otherwise, read in a cluster of the + * directory. + */ off = (cl - CLUST_FIRST) * boot->bpbSecPerClust + boot->FirstCluster; } off *= boot->bpbBytesPerSec; - if (lseek(f, off, SEEK_SET) != off - || read(f, buffer, last) != last) { + if (lseek(fd, off, SEEK_SET) != off || + read(fd, buffer, iosize) != iosize) { perr("Unable to read directory"); return FSFATAL; } - last /= 32; - for (p = buffer, i = 0; i < last; i++, p += 32) { + + for (p = buffer, i = 0; i < entries; i++, p += 32) { if (dir->fsckflags & DIREMPWARN) { *p = SLOT_EMPTY; continue; @@ -572,7 +620,7 @@ readDosDirSection(int f, struct bootblock *boot, struc u_char *q; dir->fsckflags &= ~DIREMPTY; - if (delete(f, boot, fat, + if (delete(fat, empcl, empty - buffer, cl, p - buffer, 1) == FSFATAL) return FSFATAL; @@ -701,7 +749,7 @@ readDosDirSection(int f, struct bootblock *boot, struc if (dirent.flags & ATTR_VOLUME) { if (vallfn || invlfn) { - mod |= removede(f, boot, fat, + mod |= removede(fat, invlfn ? invlfn : vallfn, p, invlfn ? invcl : valcl, -1, 0, fullpath(dir), 2); @@ -741,7 +789,7 @@ readDosDirSection(int f, struct bootblock *boot, struc dirent.next = dir->child; if (invlfn) { - mod |= k = removede(f, boot, fat, + mod |= k = removede(fat, invlfn, vallfn ? vallfn : p, invcl, vallfn ? valcl : cl, cl, fullpath(&dirent), 0); @@ -757,74 +805,61 @@ readDosDirSection(int f, struct bootblock *boot, struc vallfn = NULL; /* not used any longer */ invlfn = NULL; - if (dirent.size == 0 && !(dirent.flags & ATTR_DIRECTORY)) { - if (dirent.head != 0) { - pwarn("%s has clusters, but size 0\n", - fullpath(&dirent)); - if (ask(1, "Drop allocated clusters")) { - p[26] = p[27] = 0; - if (boot->ClustMask == CLUST32_MASK) - p[20] = p[21] = 0; - clearchain(boot, fat, dirent.head); - dirent.head = 0; - mod |= THISMOD|FSDIRMOD|FSFATMOD; - } else - mod |= FSERROR; + /* + * Check if the directory entry is sane. + * + * '.' and '..' are skipped, their sanity is + * checked somewhere else. + * + * For everything else, check if we have a new, + * valid cluster chain (beginning of a file or + * directory that was never previously claimed + * by another file) when it's a non-empty file + * or a directory. The sanity of the cluster + * chain is checked at a later time when we + * traverse into the directory, or examine the + * file's directory entry. + * + * The only possible fix is to delete the entry + * if it's a directory; for file, we have to + * truncate the size to 0. + */ + if (!(dirent.flags & ATTR_DIRECTORY) || + (strcmp(dirent.name, ".") != 0 && + strcmp(dirent.name, "..") != 0)) { + if ((dirent.size != 0 || (dirent.flags & ATTR_DIRECTORY)) && + ((!fat_is_valid_cl(fat, dirent.head) || + !fat_is_cl_head(fat, dirent.head)))) { + if (!fat_is_valid_cl(fat, dirent.head)) { + pwarn("%s starts with cluster out of range(%u)\n", + fullpath(&dirent), + dirent.head); + } else { + pwarn("%s doesn't start a new cluster chain\n", + fullpath(&dirent)); + } + + if (dirent.flags & ATTR_DIRECTORY) { + if (ask(0, "Remove")) { + *p = SLOT_DELETED; + mod |= THISMOD|FSDIRMOD; + } else + mod |= FSERROR; + continue; + } else { + if (ask(1, "Truncate")) { + p[28] = p[29] = p[30] = p[31] = 0; + p[26] = p[27] = 0; + if (boot->ClustMask == CLUST32_MASK) + p[20] = p[21] = 0; + dirent.size = 0; + dirent.head = 0; + mod |= THISMOD|FSDIRMOD; + } else + mod |= FSERROR; + } } - } else if (dirent.head == 0 - && !strcmp(dirent.name, "..") - && dir->parent /* XXX */ - && !dir->parent->parent) { - /* - * Do nothing, the parent is the root - */ - } else if (dirent.head < CLUST_FIRST - || dirent.head >= boot->NumClusters - || fat[dirent.head].next == CLUST_FREE - || (fat[dirent.head].next >= CLUST_RSRVD - && fat[dirent.head].next < CLUST_EOFS) - || fat[dirent.head].head != dirent.head) { - if (dirent.head == 0) - pwarn("%s has no clusters\n", - fullpath(&dirent)); - else if (dirent.head < CLUST_FIRST - || dirent.head >= boot->NumClusters) - pwarn("%s starts with cluster out of range(%u)\n", - fullpath(&dirent), - dirent.head); - else if (fat[dirent.head].next == CLUST_FREE) - pwarn("%s starts with free cluster\n", - fullpath(&dirent)); - else if (fat[dirent.head].next >= CLUST_RSRVD) - pwarn("%s starts with cluster marked %s\n", - fullpath(&dirent), - rsrvdcltype(fat[dirent.head].next)); - else - pwarn("%s doesn't start a cluster chain\n", - fullpath(&dirent)); - if (dirent.flags & ATTR_DIRECTORY) { - if (ask(0, "Remove")) { - *p = SLOT_DELETED; - mod |= THISMOD|FSDIRMOD; - } else - mod |= FSERROR; - continue; - } else { - if (ask(1, "Truncate")) { - p[28] = p[29] = p[30] = p[31] = 0; - p[26] = p[27] = 0; - if (boot->ClustMask == CLUST32_MASK) - p[20] = p[21] = 0; - dirent.size = 0; - mod |= THISMOD|FSDIRMOD; - } else - mod |= FSERROR; - } } - - if (dirent.head >= CLUST_FIRST && dirent.head < boot->NumClusters) - fat[dirent.head].flags |= FAT_USED; - if (dirent.flags & ATTR_DIRECTORY) { /* * gather more info for directories @@ -861,8 +896,7 @@ readDosDirSection(int f, struct bootblock *boot, struc mod |= FSERROR; } continue; - } - if (strcmp(dirent.name, "..") == 0) { + } else if (strcmp(dirent.name, "..") == 0) { if (dir->parent) { /* XXX */ if (!dir->parent->parent) { if (dirent.head) { @@ -908,7 +942,7 @@ readDosDirSection(int f, struct bootblock *boot, struc } else mod |= FSERROR; continue; - } else if ((check_subdirectory(f, boot, + } else if ((check_subdirectory(fat, &dirent) & FSERROR) == FSERROR) { /* * A subdirectory should have @@ -944,39 +978,43 @@ readDosDirSection(int f, struct bootblock *boot, struc n->dir = d; pendingDirectories = n; } else { - mod |= k = checksize(boot, fat, p, &dirent); + mod |= k = checksize(fat, p, &dirent); if (k & FSDIRMOD) mod |= THISMOD; } boot->NumFiles++; } - if (!(boot->flags & FAT32) && !dir->parent) + if (is_legacyroot) { + /* + * Don't bother to write back right now because + * we may continue to make modification to the + * non-FAT32 root directory below. + */ break; - - if (mod & THISMOD) { - last *= 32; - if (lseek(f, off, SEEK_SET) != off - || write(f, buffer, last) != last) { + } else if (mod & THISMOD) { + if (lseek(fd, off, SEEK_SET) != off + || write(fd, buffer, iosize) != iosize) { perr("Unable to write directory"); return FSFATAL; } mod &= ~THISMOD; } - } while ((cl = fat[cl].next) >= CLUST_FIRST && cl < boot->NumClusters); + } while (fat_is_valid_cl(fat, (cl = fat_get_cl_next(fat, cl)))); if (invlfn || vallfn) - mod |= removede(f, boot, fat, + mod |= removede(fat, invlfn ? invlfn : vallfn, p, invlfn ? invcl : valcl, -1, 0, fullpath(dir), 1); - /* The root directory of non fat32 filesystems is in a special - * area and may have been modified above without being written out. + /* + * The root directory of non-FAT32 filesystems is in a special + * area and may have been modified above removede() without + * being written out. */ - if ((mod & FSDIRMOD) && !(boot->flags & FAT32) && !dir->parent) { - last *= 32; - if (lseek(f, off, SEEK_SET) != off - || write(f, buffer, last) != last) { + if ((mod & FSDIRMOD) && is_legacyroot) { + if (lseek(fd, off, SEEK_SET) != off + || write(fd, buffer, iosize) != iosize) { perr("Unable to write directory"); return FSFATAL; } @@ -986,11 +1024,11 @@ readDosDirSection(int f, struct bootblock *boot, struc } int -handleDirTree(int dosfs, struct bootblock *boot, struct fatEntry *fat) +handleDirTree(struct fat_descriptor *fat) { int mod; - mod = readDosDirSection(dosfs, boot, fat, rootDir); + mod = readDosDirSection(fat, rootDir); if (mod & FSFATAL) return FSFATAL; @@ -1011,7 +1049,7 @@ handleDirTree(int dosfs, struct bootblock *boot, struc /* * handle subdirectory */ - mod |= readDosDirSection(dosfs, boot, fat, dir); + mod |= readDosDirSection(fat, dir); if (mod & FSFATAL) return FSFATAL; } @@ -1027,12 +1065,15 @@ static cl_t lfcl; static off_t lfoff; int -reconnect(int dosfs, struct bootblock *boot, struct fatEntry *fat, cl_t head) +reconnect(struct fat_descriptor *fat, cl_t head, size_t length) { + struct bootblock *boot = fat_get_boot(fat); struct dosDirEntry d; - int len; + int len, dosfs; u_char *p; + dosfs = fat_get_fd(fat); + if (!ask(1, "Reconnect")) return FSERROR; @@ -1063,7 +1104,7 @@ reconnect(int dosfs, struct bootblock *boot, struct fa break; if (p && p < lfbuf + boot->ClusterSize) break; - lfcl = p ? fat[lfcl].next : lostDir->head; + lfcl = p ? fat_get_cl_next(fat, lfcl) : lostDir->head; if (lfcl < CLUST_FIRST || lfcl >= boot->NumClusters) { /* Extend LOSTDIR? XXX */ pwarn("No space in %s\n", LOSTDIR); @@ -1088,7 +1129,7 @@ reconnect(int dosfs, struct bootblock *boot, struct fa len = snprintf(d.name, sizeof(d.name), "%u", head); d.flags = 0; d.head = head; - d.size = fat[head].length * boot->ClusterSize; + d.size = length * boot->ClusterSize; memcpy(p, d.name, len); memset(p + len, ' ', 11 - len); @@ -1103,7 +1144,6 @@ reconnect(int dosfs, struct bootblock *boot, struct fa p[29] = (u_char)(d.size >> 8); p[30] = (u_char)(d.size >> 16); p[31] = (u_char)(d.size >> 24); - fat[head].flags |= FAT_USED; if (lseek(dosfs, lfoff, SEEK_SET) != lfoff || (size_t)write(dosfs, lfbuf, boot->ClusterSize) != boot->ClusterSize) { perr("could not write LOST.DIR"); Modified: stable/12/sbin/fsck_msdosfs/dosfs.h ============================================================================== --- stable/12/sbin/fsck_msdosfs/dosfs.h Wed Feb 5 05:42:42 2020 (r357567) +++ stable/12/sbin/fsck_msdosfs/dosfs.h Wed Feb 5 08:55:19 2020 (r357568) @@ -83,19 +83,13 @@ struct bootblock { u_int NumBad; /* # of bad clusters */ }; -struct fatEntry { - cl_t next; /* pointer to next cluster */ - cl_t head; /* pointer to start of chain */ - u_int32_t length; /* number of clusters on chain */ - int flags; /* see below */ -}; - #define CLUST_FREE 0 /* 0 means cluster is free */ #define CLUST_FIRST 2 /* 2 is the minimum valid cluster number */ #define CLUST_RSRVD 0xfffffff6 /* start of reserved clusters */ #define CLUST_BAD 0xfffffff7 /* a cluster with a defect */ #define CLUST_EOFS 0xfffffff8 /* start of EOF indicators */ #define CLUST_EOF 0xffffffff /* standard value for last cluster */ +#define CLUST_DEAD 0xfdeadc0d /* error encountered */ /* * Masks for cluster values @@ -103,8 +97,6 @@ struct fatEntry { #define CLUST12_MASK 0xfff #define CLUST16_MASK 0xffff #define CLUST32_MASK 0xfffffff - -#define FAT_USED 1 /* This fat chain is used in a file */ #define DOSLONGNAMELEN 256 /* long name maximal length */ #define LRFIRST 0x40 /* first long name record */ Modified: stable/12/sbin/fsck_msdosfs/ext.h ============================================================================== --- stable/12/sbin/fsck_msdosfs/ext.h Wed Feb 5 05:42:42 2020 (r357567) +++ stable/12/sbin/fsck_msdosfs/ext.h Wed Feb 5 08:55:19 2020 (r357568) @@ -32,6 +32,8 @@ #include +#include + #include "dosfs.h" #define LOSTDIR "LOST.DIR" @@ -44,6 +46,7 @@ extern int alwaysyes; /* assume "yes" for all question extern int preen; /* we are preening */ extern int rdonly; /* device is opened read only (supersedes above) */ extern int skipclean; /* skip clean file systems if preening */ +extern int allow_mmap; /* allow the use of mmap() */ /* * function declarations @@ -72,7 +75,6 @@ int checkfilesys(const char *); #define FSERROR 8 /* Some unrecovered error remains */ #define FSFATAL 16 /* Some unrecoverable error occurred */ #define FSDIRTY 32 /* File system is dirty */ -#define FSFIXFAT 64 /* Fix file system FAT */ /* * read a boot block in a machine independent fashion and translate @@ -85,46 +87,53 @@ int readboot(int, struct bootblock *); */ int writefsinfo(int, struct bootblock *); -/* - * Read one of the FAT copies and return a pointer to the new - * allocated array holding our description of it. - */ -int readfat(int, struct bootblock *, u_int, struct fatEntry **); +/* Opaque type */ +struct fat_descriptor; -/* - * Check two FAT copies for consistency and merge changes into the - * first if necessary. - */ -int comparefat(struct bootblock *, struct fatEntry *, struct fatEntry *, u_int); +void fat_clear_cl_head(struct fat_descriptor *, cl_t); +bool fat_is_cl_head(struct fat_descriptor *, cl_t); +cl_t fat_get_cl_next(struct fat_descriptor *, cl_t); + +int fat_set_cl_next(struct fat_descriptor *, cl_t, cl_t); + +cl_t fat_allocate_cluster(struct fat_descriptor *fat); + +struct bootblock* fat_get_boot(struct fat_descriptor *); +int fat_get_fd(struct fat_descriptor *); +bool fat_is_valid_cl(struct fat_descriptor *, cl_t); + /* - * Check a FAT + * Read the FAT 0 and return a pointer to the newly allocated + * descriptor of it. */ -int checkfat(struct bootblock *, struct fatEntry *); +int readfat(int, struct bootblock *, struct fat_descriptor **); /* * Write back FAT entries */ -int writefat(int, struct bootblock *, struct fatEntry *, int); +int writefat(struct fat_descriptor *); /* * Read a directory */ -int resetDosDirSection(struct bootblock *, struct fatEntry *); +int resetDosDirSection(struct fat_descriptor *); void finishDosDirSection(void); -int handleDirTree(int, struct bootblock *, struct fatEntry *); +int handleDirTree(struct fat_descriptor *); /* * Cross-check routines run after everything is completely in memory */ +int checkchain(struct fat_descriptor *, cl_t, size_t *); + /* * Check for lost cluster chains */ -int checklost(int, struct bootblock *, struct fatEntry *); +int checklost(struct fat_descriptor *); /* * Try to reconnect a lost cluster chain */ -int reconnect(int, struct bootblock *, struct fatEntry *, cl_t); +int reconnect(struct fat_descriptor *, cl_t, size_t); void finishlf(void); /* @@ -138,6 +147,6 @@ const char *rsrvdcltype(cl_t); /* * Clear a cluster chain in a FAT */ -void clearchain(struct bootblock *, struct fatEntry *, cl_t); +void clearchain(struct fat_descriptor *, cl_t); #endif Modified: stable/12/sbin/fsck_msdosfs/fat.c ============================================================================== --- stable/12/sbin/fsck_msdosfs/fat.c Wed Feb 5 05:42:42 2020 (r357567) +++ stable/12/sbin/fsck_msdosfs/fat.c Wed Feb 5 08:55:19 2020 (r357568) @@ -1,6 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * + * Copyright (c) 2019 Google LLC * Copyright (C) 1995, 1996, 1997 Wolfgang Solfrank * Copyright (c) 1995 Martin Husemann * @@ -33,6 +34,14 @@ static const char rcsid[] = "$FreeBSD$"; #endif /* not lint */ +#include *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Feb 5 11:02:01 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 793FF2474EC; Wed, 5 Feb 2020 11:02:01 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CJY52gm5z4PMp; Wed, 5 Feb 2020 11:02:01 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 573BE199A; Wed, 5 Feb 2020 11:02:01 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 015B21N0025815; Wed, 5 Feb 2020 11:02:01 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 015B21wp025814; Wed, 5 Feb 2020 11:02:01 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <202002051102.015B21wp025814@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Wed, 5 Feb 2020 11:02:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357569 - head/stand/i386/zfsboot X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/i386/zfsboot X-SVN-Commit-Revision: 357569 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 11:02:01 -0000 Author: tsoome Date: Wed Feb 5 11:02:00 2020 New Revision: 357569 URL: https://svnweb.freebsd.org/changeset/base/357569 Log: zfsboot: vdev_read_pad2 does allocate buffer with wrong size vdev_read_pad2() does read VDEV_PAD_SIZE of data, and will copy size bytes of it, hence, we need buffer of VDEV_PAD_SIZE bytes. Issue introduced in r357497. Reported by: se Modified: head/stand/i386/zfsboot/zfsboot.c Modified: head/stand/i386/zfsboot/zfsboot.c ============================================================================== --- head/stand/i386/zfsboot/zfsboot.c Wed Feb 5 08:55:19 2020 (r357568) +++ head/stand/i386/zfsboot/zfsboot.c Wed Feb 5 11:02:00 2020 (r357569) @@ -324,7 +324,7 @@ vdev_read_pad2(vdev_t *vdev, char *buf, size_t size) if (size > VDEV_PAD_SIZE) size = VDEV_PAD_SIZE; - tmp = malloc(size); + tmp = malloc(VDEV_PAD_SIZE); if (tmp == NULL) return (ENOMEM); From owner-svn-src-all@freebsd.org Wed Feb 5 11:19:31 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 16BE5247C03; Wed, 5 Feb 2020 11:19:31 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48CJxG6ggsz4QXG; Wed, 5 Feb 2020 11:19:30 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1izIiM-000Jtw-PX; Wed, 05 Feb 2020 14:19:26 +0300 Date: Wed, 5 Feb 2020 14:19:26 +0300 From: Slawa Olhovchenkov To: Navdeep Parhar Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r357553 - head/sys/dev/cxgbe Message-ID: <20200205111926.GF8028@zxy.spb.ru> References: <202002050013.0150DFCC027900@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202002050013.0150DFCC027900@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-Rspamd-Queue-Id: 48CJxG6ggsz4QXG X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.99 / 15.00]; NEURAL_HAM_MEDIUM(-0.99)[-0.989,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 11:19:31 -0000 On Wed, Feb 05, 2020 at 12:13:15AM +0000, Navdeep Parhar wrote: > Author: np > Date: Wed Feb 5 00:13:15 2020 > New Revision: 357553 > URL: https://svnweb.freebsd.org/changeset/base/357553 > > Log: > cxgbe(4): Add a knob to allow netmap tx traffic to be checksummed by > the hardware. > > hw.cxgbe.nm_txcsum=1 Very interesting. Please, describe some more detail about using this feture (for example, set this before driver loading? first netmap open? any netmap open? on the fly?) From owner-svn-src-all@freebsd.org Wed Feb 5 11:34:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7F3C5248142; Wed, 5 Feb 2020 11:34:11 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CKGC2c25z4RNq; Wed, 5 Feb 2020 11:34:11 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 54B1B1F5A; Wed, 5 Feb 2020 11:34:11 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 015BYBUE050389; Wed, 5 Feb 2020 11:34:11 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 015BYBq4050388; Wed, 5 Feb 2020 11:34:11 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <202002051134.015BYBq4050388@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Wed, 5 Feb 2020 11:34:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357570 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: luporl X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 357570 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 11:34:11 -0000 Author: luporl Date: Wed Feb 5 11:34:10 2020 New Revision: 357570 URL: https://svnweb.freebsd.org/changeset/base/357570 Log: Add SYSCTL to get KERNBASE and relocated KERNBASE This change adds 2 new SYSCTLs, to retrieve the original and relocated KERNBASE values. This provides an easy, architecture independent way to calculate the running kernel displacement (current/load address minus original base address). The initial goal for this change is to add a new libkvm function that returns the kernel displacement, both for live kernels and crashdumps. This would in turn be used by kgdb to find out how to relocate kernel symbols (if needed). Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D23284 Modified: head/sys/kern/link_elf.c Modified: head/sys/kern/link_elf.c ============================================================================== --- head/sys/kern/link_elf.c Wed Feb 5 11:02:00 2020 (r357569) +++ head/sys/kern/link_elf.c Wed Feb 5 11:34:10 2020 (r357570) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -389,6 +390,13 @@ link_elf_link_common_finish(linker_file_t lf) extern vm_offset_t __startkernel, __endkernel; +static unsigned long kern_relbase = KERNBASE; + +SYSCTL_ULONG(_kern, OID_AUTO, base_address, CTLFLAG_RD, + SYSCTL_NULL_ULONG_PTR, KERNBASE, "Kernel base address"); +SYSCTL_ULONG(_kern, OID_AUTO, relbase_address, CTLFLAG_RD, + &kern_relbase, 0, "Kernel relocated base address"); + static void link_elf_init(void* arg) { @@ -431,6 +439,7 @@ link_elf_init(void* arg) #ifdef __powerpc__ linker_kernel_file->address = (caddr_t)__startkernel; linker_kernel_file->size = (intptr_t)(__endkernel - __startkernel); + kern_relbase = (unsigned long)__startkernel; #else linker_kernel_file->address += KERNBASE; linker_kernel_file->size = -(intptr_t)linker_kernel_file->address; From owner-svn-src-all@freebsd.org Wed Feb 5 13:08:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0BE3124A98E; Wed, 5 Feb 2020 13:08:25 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CMLw6dMFz4X3N; Wed, 5 Feb 2020 13:08:24 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DA6732FC7; Wed, 5 Feb 2020 13:08:24 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 015D8OYd009720; Wed, 5 Feb 2020 13:08:24 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 015D8OvR009719; Wed, 5 Feb 2020 13:08:24 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <202002051308.015D8OvR009719@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Wed, 5 Feb 2020 13:08:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357571 - head/stand/libsa/zfs X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/libsa/zfs X-SVN-Commit-Revision: 357571 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 13:08:25 -0000 Author: tsoome Date: Wed Feb 5 13:08:24 2020 New Revision: 357571 URL: https://svnweb.freebsd.org/changeset/base/357571 Log: followup on r357497: clean obsolete comment and use shift instead of multiplication Based on illumos review feedback: leftover comment, but also have consistent block size calculation and add missing else leg to if statement. Modified: head/stand/libsa/zfs/zfsimpl.c Modified: head/stand/libsa/zfs/zfsimpl.c ============================================================================== --- head/stand/libsa/zfs/zfsimpl.c Wed Feb 5 11:34:10 2020 (r357570) +++ head/stand/libsa/zfs/zfsimpl.c Wed Feb 5 13:08:24 2020 (r357571) @@ -2294,8 +2294,7 @@ dnode_read(const spa_t *spa, const dnode_phys_t *dnode } /* - * Lookup a value in a microzap directory. Assumes that the zap - * scratch buffer contains the directory contents. + * Lookup a value in a microzap directory. */ static int mzap_lookup(const mzap_phys_t *mz, size_t size, const char *name, @@ -2777,7 +2776,7 @@ static int zap_list(const spa_t *spa, const dnode_phys_t *dnode) { zap_phys_t *zap; - size_t size = dnode->dn_datablkszsec * 512; + size_t size = dnode->dn_datablkszsec << SPA_MINBLOCKSHIFT; int rc; zap = malloc(size); @@ -2917,7 +2916,7 @@ zap_rlookup(const spa_t *spa, const dnode_phys_t *dnod uint64_t value) { zap_phys_t *zap; - size_t size = dnode->dn_datablkszsec * 512; + size_t size = dnode->dn_datablkszsec << SPA_MINBLOCKSHIFT; int rc; zap = malloc(size); @@ -3116,7 +3115,7 @@ zfs_callback_dataset(const spa_t *spa, uint64_t objnum return (err); } - size = child_dir_zap.dn_datablkszsec * 512; + size = child_dir_zap.dn_datablkszsec << SPA_MINBLOCKSHIFT; zap = malloc(size); if (zap != NULL) { err = dnode_read(spa, &child_dir_zap, 0, zap, size); @@ -3128,6 +3127,8 @@ zfs_callback_dataset(const spa_t *spa, uint64_t objnum callback); else err = fzap_list(spa, &child_dir_zap, zap, callback); + } else { + err = ENOMEM; } done: free(zap); @@ -3286,7 +3287,7 @@ check_mos_features(const spa_t *spa) if (dir.dn_type != DMU_OTN_ZAP_METADATA) return (EIO); - size = dir.dn_datablkszsec * 512; + size = dir.dn_datablkszsec << SPA_MINBLOCKSHIFT; zap = malloc(size); if (zap == NULL) return (ENOMEM); From owner-svn-src-all@freebsd.org Wed Feb 5 14:00:27 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D6FAF24B8EC; Wed, 5 Feb 2020 14:00:27 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CNVz5JYyz4Zjv; Wed, 5 Feb 2020 14:00:27 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B16C33B3C; Wed, 5 Feb 2020 14:00:27 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 015E0RTt043747; Wed, 5 Feb 2020 14:00:27 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 015E0Roo043746; Wed, 5 Feb 2020 14:00:27 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202002051400.015E0Roo043746@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 5 Feb 2020 14:00:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357572 - head/usr.bin/wc X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.bin/wc X-SVN-Commit-Revision: 357572 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 14:00:27 -0000 Author: kevans Date: Wed Feb 5 14:00:27 2020 New Revision: 357572 URL: https://svnweb.freebsd.org/changeset/base/357572 Log: wc(1): account for possibility of file == NULL file could reasonably be NULL here if we we're using stdin. Albeit less likely in normal usage, one could actually hit either of these warnings on stdin. ubmitted by: sigsys@gmail.com MFC after: 3 days Modified: head/usr.bin/wc/wc.c Modified: head/usr.bin/wc/wc.c ============================================================================== --- head/usr.bin/wc/wc.c Wed Feb 5 13:08:24 2020 (r357571) +++ head/usr.bin/wc/wc.c Wed Feb 5 14:00:27 2020 (r357572) @@ -246,7 +246,7 @@ cnt(const char *file) */ if (doline == 0 && dolongline == 0) { if (fstat(fd, &sb)) { - xo_warn("%s: fstat", file); + xo_warn("%s: fstat", file != NULL ? file : "stdin"); (void)close(fd); return (1); } @@ -267,7 +267,7 @@ cnt(const char *file) */ while ((len = read(fd, buf, MAXBSIZE))) { if (len == -1) { - xo_warn("%s: read", file); + xo_warn("%s: read", file != NULL ? file : "stdin"); (void)close(fd); return (1); } From owner-svn-src-all@freebsd.org Wed Feb 5 16:09:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0613824DBE7; Wed, 5 Feb 2020 16:09:03 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CRML6Jhdz3CZM; Wed, 5 Feb 2020 16:09:02 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D3B7A5337; Wed, 5 Feb 2020 16:09:02 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 015G92lI027565; Wed, 5 Feb 2020 16:09:02 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 015G92Jw027564; Wed, 5 Feb 2020 16:09:02 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202002051609.015G92Jw027564@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 5 Feb 2020 16:09:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357573 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 357573 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 16:09:03 -0000 Author: markj Date: Wed Feb 5 16:09:02 2020 New Revision: 357573 URL: https://svnweb.freebsd.org/changeset/base/357573 Log: Fix map locking in the CLEAR_PKRU sysarch(2) handler. Reported and tested by: pho MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/amd64/amd64/sys_machdep.c Modified: head/sys/amd64/amd64/sys_machdep.c ============================================================================== --- head/sys/amd64/amd64/sys_machdep.c Wed Feb 5 14:00:27 2020 (r357572) +++ head/sys/amd64/amd64/sys_machdep.c Wed Feb 5 16:09:02 2020 (r357573) @@ -380,7 +380,7 @@ sysarch(struct thread *td, struct sysarch_args *uap) error = pmap_pkru_clear(PCPU_GET(curpmap), (vm_offset_t)a64pkru.addr, (vm_offset_t)a64pkru.addr + a64pkru.len); - vm_map_unlock(map); + vm_map_unlock_read(map); break; default: From owner-svn-src-all@freebsd.org Wed Feb 5 16:09:21 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BFB8824DC45; Wed, 5 Feb 2020 16:09:21 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CRMj4gSXz3Chx; Wed, 5 Feb 2020 16:09:21 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9AF74533B; Wed, 5 Feb 2020 16:09:21 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 015G9LEa027795; Wed, 5 Feb 2020 16:09:21 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 015G9Lug027794; Wed, 5 Feb 2020 16:09:21 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202002051609.015G9Lug027794@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 5 Feb 2020 16:09:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357574 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 357574 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 16:09:21 -0000 Author: markj Date: Wed Feb 5 16:09:21 2020 New Revision: 357574 URL: https://svnweb.freebsd.org/changeset/base/357574 Log: Avoid releasing object PIP in vn_sendfile() if no pages were grabbed. sendfile(2) optionally takes a set of headers that get prepended to the file data. If the request length is less than that of the headers, sendfile may not allocate an sfio structure, in which case its pointer is null and we should be careful not to dereference. This was introduced in r356902. Reported by: syzkaller Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_sendfile.c Modified: head/sys/kern/kern_sendfile.c ============================================================================== --- head/sys/kern/kern_sendfile.c Wed Feb 5 16:09:02 2020 (r357573) +++ head/sys/kern/kern_sendfile.c Wed Feb 5 16:09:21 2020 (r357574) @@ -1060,8 +1060,10 @@ prepend_header: * we can send data right now without the * PRUS_NOTREADY flag. */ - vm_object_pip_wakeup(sfio->obj); - free(sfio, M_TEMP); + if (sfio != NULL) { + vm_object_pip_wakeup(sfio->obj); + free(sfio, M_TEMP); + } #ifdef KERN_TLS if (tls != NULL && tls->mode == TCP_TLS_MODE_SW) { error = (*so->so_proto->pr_usrreqs->pru_send) From owner-svn-src-all@freebsd.org Wed Feb 5 16:09:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E191C24DD0F; Wed, 5 Feb 2020 16:09:44 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CRN85Ky4z3D10; Wed, 5 Feb 2020 16:09:44 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B21DA5340; Wed, 5 Feb 2020 16:09:44 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 015G9ipf027877; Wed, 5 Feb 2020 16:09:44 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 015G9iGF027876; Wed, 5 Feb 2020 16:09:44 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202002051609.015G9iGF027876@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 5 Feb 2020 16:09:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357575 - head/lib/libc/net X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/lib/libc/net X-SVN-Commit-Revision: 357575 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 16:09:44 -0000 Author: markj Date: Wed Feb 5 16:09:44 2020 New Revision: 357575 URL: https://svnweb.freebsd.org/changeset/base/357575 Log: Improve validation of the sockaddr length in iruserok_sa(). Negative numbers are not valid sockaddr lengths. PR: 243747 Submitted by: Andrew Reiter MFC after: 1 week Modified: head/lib/libc/net/rcmd.c Modified: head/lib/libc/net/rcmd.c ============================================================================== --- head/lib/libc/net/rcmd.c Wed Feb 5 16:09:21 2020 (r357574) +++ head/lib/libc/net/rcmd.c Wed Feb 5 16:09:44 2020 (r357575) @@ -438,8 +438,8 @@ iruserok_sa(const void *ra, int rlen, int superuser, c struct sockaddr_storage ss; /* avoid alignment issue */ - if (rlen > sizeof(ss)) - return(-1); + if (rlen <= 0 || rlen > sizeof(ss)) + return (-1); memcpy(&ss, ra, rlen); raddr = (struct sockaddr *)&ss; From owner-svn-src-all@freebsd.org Wed Feb 5 16:10:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CE37324DDA5; Wed, 5 Feb 2020 16:10:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CRNd4lMrz3D84; Wed, 5 Feb 2020 16:10:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9E28D5345; Wed, 5 Feb 2020 16:10:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 015GA9Ts028002; Wed, 5 Feb 2020 16:10:09 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 015GA9NU028001; Wed, 5 Feb 2020 16:10:09 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202002051610.015GA9NU028001@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 5 Feb 2020 16:10:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357576 - head/lib/libc/rpc X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/lib/libc/rpc X-SVN-Commit-Revision: 357576 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 16:10:09 -0000 Author: markj Date: Wed Feb 5 16:10:09 2020 New Revision: 357576 URL: https://svnweb.freebsd.org/changeset/base/357576 Log: Fix a use of an uninitialized pointer in xdr_rpcbs_rmtcalllist(). This appears to have been introduced in r173763. Also fix the confusing indentation that probably led to the bug in the first place. PR: 243759 Diagnosed by: martin@lispworks.com MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/lib/libc/rpc/rpcb_st_xdr.c Modified: head/lib/libc/rpc/rpcb_st_xdr.c ============================================================================== --- head/lib/libc/rpc/rpcb_st_xdr.c Wed Feb 5 16:09:44 2020 (r357575) +++ head/lib/libc/rpc/rpcb_st_xdr.c Wed Feb 5 16:10:09 2020 (r357576) @@ -54,29 +54,28 @@ xdr_rpcbs_addrlist(XDR *xdrs, rpcbs_addrlist *objp) { struct rpcbs_addrlist **pnext; - if (!xdr_rpcprog(xdrs, &objp->prog)) { + if (!xdr_rpcprog(xdrs, &objp->prog)) { return (FALSE); - } - if (!xdr_rpcvers(xdrs, &objp->vers)) { + } + if (!xdr_rpcvers(xdrs, &objp->vers)) { return (FALSE); - } - if (!xdr_int(xdrs, &objp->success)) { + } + if (!xdr_int(xdrs, &objp->success)) { return (FALSE); - } - if (!xdr_int(xdrs, &objp->failure)) { + } + if (!xdr_int(xdrs, &objp->failure)) { return (FALSE); - } - if (!xdr_string(xdrs, &objp->netid, RPC_MAXDATASIZE)) { + } + if (!xdr_string(xdrs, &objp->netid, RPC_MAXDATASIZE)) { return (FALSE); - } + } - pnext = &objp->next; - - if (!xdr_pointer(xdrs, (char **) pnext, + pnext = &objp->next; + if (!xdr_pointer(xdrs, (char **) pnext, sizeof (rpcbs_addrlist), (xdrproc_t)xdr_rpcbs_addrlist)) { return (FALSE); - } + } return (TRUE); } @@ -86,86 +85,86 @@ xdr_rpcbs_addrlist(XDR *xdrs, rpcbs_addrlist *objp) bool_t xdr_rpcbs_rmtcalllist(XDR *xdrs, rpcbs_rmtcalllist *objp) { - int32_t *buf; struct rpcbs_rmtcalllist **pnext; + int32_t *buf; + pnext = &objp->next; if (xdrs->x_op == XDR_ENCODE) { - buf = XDR_INLINE(xdrs, 6 * BYTES_PER_XDR_UNIT); - if (buf == NULL) { - if (!xdr_rpcprog(xdrs, &objp->prog)) { - return (FALSE); + buf = XDR_INLINE(xdrs, 6 * BYTES_PER_XDR_UNIT); + if (buf == NULL) { + if (!xdr_rpcprog(xdrs, &objp->prog)) { + return (FALSE); + } + if (!xdr_rpcvers(xdrs, &objp->vers)) { + return (FALSE); + } + if (!xdr_rpcproc(xdrs, &objp->proc)) { + return (FALSE); + } + if (!xdr_int(xdrs, &objp->success)) { + return (FALSE); + } + if (!xdr_int(xdrs, &objp->failure)) { + return (FALSE); + } + if (!xdr_int(xdrs, &objp->indirect)) { + return (FALSE); + } + } else { + IXDR_PUT_U_INT32(buf, objp->prog); + IXDR_PUT_U_INT32(buf, objp->vers); + IXDR_PUT_U_INT32(buf, objp->proc); + IXDR_PUT_INT32(buf, objp->success); + IXDR_PUT_INT32(buf, objp->failure); + IXDR_PUT_INT32(buf, objp->indirect); } - if (!xdr_rpcvers(xdrs, &objp->vers)) { + if (!xdr_string(xdrs, &objp->netid, RPC_MAXDATASIZE)) { return (FALSE); } - if (!xdr_rpcproc(xdrs, &objp->proc)) { + if (!xdr_pointer(xdrs, (char **) pnext, + sizeof (rpcbs_rmtcalllist), + (xdrproc_t)xdr_rpcbs_rmtcalllist)) { return (FALSE); } - if (!xdr_int(xdrs, &objp->success)) { - return (FALSE); - } - if (!xdr_int(xdrs, &objp->failure)) { - return (FALSE); - } - if (!xdr_int(xdrs, &objp->indirect)) { - return (FALSE); - } - } else { - IXDR_PUT_U_INT32(buf, objp->prog); - IXDR_PUT_U_INT32(buf, objp->vers); - IXDR_PUT_U_INT32(buf, objp->proc); - IXDR_PUT_INT32(buf, objp->success); - IXDR_PUT_INT32(buf, objp->failure); - IXDR_PUT_INT32(buf, objp->indirect); - } - if (!xdr_string(xdrs, &objp->netid, RPC_MAXDATASIZE)) { - return (FALSE); - } - pnext = &objp->next; - if (!xdr_pointer(xdrs, (char **) pnext, - sizeof (rpcbs_rmtcalllist), - (xdrproc_t)xdr_rpcbs_rmtcalllist)) { - return (FALSE); - } - return (TRUE); + return (TRUE); } else if (xdrs->x_op == XDR_DECODE) { - buf = XDR_INLINE(xdrs, 6 * BYTES_PER_XDR_UNIT); - if (buf == NULL) { - if (!xdr_rpcprog(xdrs, &objp->prog)) { - return (FALSE); + buf = XDR_INLINE(xdrs, 6 * BYTES_PER_XDR_UNIT); + if (buf == NULL) { + if (!xdr_rpcprog(xdrs, &objp->prog)) { + return (FALSE); + } + if (!xdr_rpcvers(xdrs, &objp->vers)) { + return (FALSE); + } + if (!xdr_rpcproc(xdrs, &objp->proc)) { + return (FALSE); + } + if (!xdr_int(xdrs, &objp->success)) { + return (FALSE); + } + if (!xdr_int(xdrs, &objp->failure)) { + return (FALSE); + } + if (!xdr_int(xdrs, &objp->indirect)) { + return (FALSE); + } + } else { + objp->prog = (rpcprog_t)IXDR_GET_U_INT32(buf); + objp->vers = (rpcvers_t)IXDR_GET_U_INT32(buf); + objp->proc = (rpcproc_t)IXDR_GET_U_INT32(buf); + objp->success = (int)IXDR_GET_INT32(buf); + objp->failure = (int)IXDR_GET_INT32(buf); + objp->indirect = (int)IXDR_GET_INT32(buf); } - if (!xdr_rpcvers(xdrs, &objp->vers)) { + if (!xdr_string(xdrs, &objp->netid, RPC_MAXDATASIZE)) { return (FALSE); } - if (!xdr_rpcproc(xdrs, &objp->proc)) { + if (!xdr_pointer(xdrs, (char **) pnext, + sizeof (rpcbs_rmtcalllist), + (xdrproc_t)xdr_rpcbs_rmtcalllist)) { return (FALSE); } - if (!xdr_int(xdrs, &objp->success)) { - return (FALSE); - } - if (!xdr_int(xdrs, &objp->failure)) { - return (FALSE); - } - if (!xdr_int(xdrs, &objp->indirect)) { - return (FALSE); - } - } else { - objp->prog = (rpcprog_t)IXDR_GET_U_INT32(buf); - objp->vers = (rpcvers_t)IXDR_GET_U_INT32(buf); - objp->proc = (rpcproc_t)IXDR_GET_U_INT32(buf); - objp->success = (int)IXDR_GET_INT32(buf); - objp->failure = (int)IXDR_GET_INT32(buf); - objp->indirect = (int)IXDR_GET_INT32(buf); - } - if (!xdr_string(xdrs, &objp->netid, RPC_MAXDATASIZE)) { - return (FALSE); - } - if (!xdr_pointer(xdrs, (char **) pnext, - sizeof (rpcbs_rmtcalllist), - (xdrproc_t)xdr_rpcbs_rmtcalllist)) { - return (FALSE); - } - return (TRUE); + return (TRUE); } if (!xdr_rpcprog(xdrs, &objp->prog)) { return (FALSE); From owner-svn-src-all@freebsd.org Wed Feb 5 16:53:04 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6A7AA24ED79; Wed, 5 Feb 2020 16:53:04 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CSL829WKz3GQ5; Wed, 5 Feb 2020 16:53:04 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 45B885C52; Wed, 5 Feb 2020 16:53:04 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 015Gr43P057840; Wed, 5 Feb 2020 16:53:04 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 015Gr2Mr057831; Wed, 5 Feb 2020 16:53:02 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202002051653.015Gr2Mr057831@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 5 Feb 2020 16:53:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357577 - in head/sys: amd64/linux amd64/linux32 arm/linux arm64/linux compat/linux i386/linux X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/sys: amd64/linux amd64/linux32 arm/linux arm64/linux compat/linux i386/linux X-SVN-Commit-Revision: 357577 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 16:53:04 -0000 Author: emaste Date: Wed Feb 5 16:53:02 2020 New Revision: 357577 URL: https://svnweb.freebsd.org/changeset/base/357577 Log: linuxulator: implement sendfile Submitted by: Bora Özarslan Submitted by: Yang Wang <2333@outlook.jp> Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D19917 Modified: head/sys/amd64/linux/linux_dummy.c head/sys/amd64/linux32/linux32_dummy.c head/sys/amd64/linux32/syscalls.master head/sys/arm/linux/syscalls.master head/sys/arm64/linux/linux_dummy.c head/sys/compat/linux/linux_socket.c head/sys/compat/linux/linux_socket.h head/sys/i386/linux/linux_dummy.c head/sys/i386/linux/syscalls.master Modified: head/sys/amd64/linux/linux_dummy.c ============================================================================== --- head/sys/amd64/linux/linux_dummy.c Wed Feb 5 16:10:09 2020 (r357576) +++ head/sys/amd64/linux/linux_dummy.c Wed Feb 5 16:53:02 2020 (r357577) @@ -59,7 +59,6 @@ UNIMPLEMENTED(set_thread_area); UNIMPLEMENTED(uselib); UNIMPLEMENTED(vserver); -DUMMY(sendfile); DUMMY(setfsuid); DUMMY(setfsgid); DUMMY(sysfs); Modified: head/sys/amd64/linux32/linux32_dummy.c ============================================================================== --- head/sys/amd64/linux32/linux32_dummy.c Wed Feb 5 16:10:09 2020 (r357576) +++ head/sys/amd64/linux32/linux32_dummy.c Wed Feb 5 16:53:02 2020 (r357577) @@ -72,7 +72,6 @@ DUMMY(delete_module); DUMMY(quotactl); DUMMY(bdflush); DUMMY(sysfs); -DUMMY(sendfile); DUMMY(setfsuid); DUMMY(setfsgid); DUMMY(pivot_root); Modified: head/sys/amd64/linux32/syscalls.master ============================================================================== --- head/sys/amd64/linux32/syscalls.master Wed Feb 5 16:10:09 2020 (r357576) +++ head/sys/amd64/linux32/syscalls.master Wed Feb 5 16:53:02 2020 (r357577) @@ -338,7 +338,8 @@ struct l_user_cap_data *datap); } 186 AUE_NULL STD { int linux_sigaltstack(l_stack_t *uss, \ l_stack_t *uoss); } -187 AUE_SENDFILE STD { int linux_sendfile(void); } +187 AUE_SENDFILE STD { int linux_sendfile(l_int out, l_int in, \ + l_long *offset, l_size_t count); } 188 AUE_GETPMSG UNIMPL getpmsg 189 AUE_PUTPMSG UNIMPL putpmsg 190 AUE_VFORK STD { int linux_vfork(void); } @@ -412,7 +413,8 @@ 236 AUE_NULL STD { int linux_lremovexattr(void); } 237 AUE_NULL STD { int linux_fremovexattr(void); } 238 AUE_NULL STD { int linux_tkill(int tid, int sig); } -239 AUE_SENDFILE UNIMPL linux_sendfile64 +239 AUE_SENDFILE STD { int linux_sendfile64(l_int out, l_int in, \ + l_loff_t *offset, l_size_t count); } 240 AUE_NULL STD { int linux_sys_futex(void *uaddr, int op, uint32_t val, \ struct l_timespec *timeout, uint32_t *uaddr2, uint32_t val3); } 241 AUE_NULL STD { int linux_sched_setaffinity(l_pid_t pid, l_uint len, \ Modified: head/sys/arm/linux/syscalls.master ============================================================================== --- head/sys/arm/linux/syscalls.master Wed Feb 5 16:10:09 2020 (r357576) +++ head/sys/arm/linux/syscalls.master Wed Feb 5 16:53:02 2020 (r357577) @@ -868,7 +868,12 @@ ); } 187 AUE_SENDFILE STD { - int linux_sendfile(void); + int linux_sendfile( + l_int out, + l_int in, + l_long *offset, + l_size_t count + ); } 188 AUE_NULL UNIMPL ; was getpmsg 189 AUE_NULL UNIMPL ; was putpmsg @@ -1090,7 +1095,14 @@ int sig ); } -239 AUE_SENDFILE UNIMPL linux_sendfile64 +239 AUE_SENDFILE STD { + int linux_sendfile64( + l_int out, + l_int in, + l_loff_t *offset, + l_size_t count + ); + } 240 AUE_NULL STD { int linux_sys_futex(void *uaddr, int op, Modified: head/sys/arm64/linux/linux_dummy.c ============================================================================== --- head/sys/arm64/linux/linux_dummy.c Wed Feb 5 16:10:09 2020 (r357576) +++ head/sys/arm64/linux/linux_dummy.c Wed Feb 5 16:53:02 2020 (r357577) @@ -64,7 +64,6 @@ UNIMPLEMENTED(tuxcall); UNIMPLEMENTED(uselib); UNIMPLEMENTED(vserver); -DUMMY(sendfile); DUMMY(setfsuid); DUMMY(setfsgid); DUMMY(vhangup); Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Wed Feb 5 16:10:09 2020 (r357576) +++ head/sys/compat/linux/linux_socket.c Wed Feb 5 16:53:02 2020 (r357577) @@ -49,9 +49,13 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include +#include +#include + #include #include #include @@ -1581,8 +1585,135 @@ out: return (error); } -#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) +static int +linux_sendfile_common(struct thread *td, l_int out, l_int in, + l_loff_t *offset, l_size_t count) +{ + off_t bytes_read; + int error; + l_loff_t current_offset; + struct file *fp; + AUDIT_ARG_FD(in); + error = fget_read(td, in, &cap_pread_rights, &fp); + if (error != 0) + return (error); + + if (offset != NULL) { + current_offset = *offset; + } else { + error = (fp->f_ops->fo_flags & DFLAG_SEEKABLE) != 0 ? + fo_seek(fp, 0, SEEK_CUR, td) : ESPIPE; + if (error != 0) + goto drop; + current_offset = td->td_uretoff.tdu_off; + } + + bytes_read = 0; + + /* Linux cannot have 0 count. */ + if (count <= 0 || current_offset < 0) { + error = EINVAL; + goto drop; + } + + error = fo_sendfile(fp, out, NULL, NULL, current_offset, count, + &bytes_read, 0, td); + if (error != 0) + goto drop; + current_offset += bytes_read; + + if (offset != NULL) { + *offset = current_offset; + } else { + error = fo_seek(fp, current_offset, SEEK_SET, td); + if (error != 0) + goto drop; + } + + td->td_retval[0] = (ssize_t)bytes_read; +drop: + fdrop(fp, td); + return (error); +} + +int +linux_sendfile(struct thread *td, struct linux_sendfile_args *arg) +{ + /* + * Differences between FreeBSD and Linux sendfile: + * - Linux doesn't send anything when count is 0 (FreeBSD uses 0 to + * mean send the whole file.) In linux_sendfile given fds are still + * checked for validity when the count is 0. + * - Linux can send to any fd whereas FreeBSD only supports sockets. + * The same restriction follows for linux_sendfile. + * - Linux doesn't have an equivalent for FreeBSD's flags and sf_hdtr. + * - Linux takes an offset pointer and updates it to the read location. + * FreeBSD takes in an offset and a 'bytes read' parameter which is + * only filled if it isn't NULL. We use this parameter to update the + * offset pointer if it exists. + * - Linux sendfile returns bytes read on success while FreeBSD + * returns 0. We use the 'bytes read' parameter to get this value. + */ + + l_loff_t offset64; + l_long offset; + int ret; + int error; + + if (arg->offset != NULL) { + error = copyin(arg->offset, &offset, sizeof(offset)); + if (error != 0) + return (error); + offset64 = (l_loff_t)offset; + } + + ret = linux_sendfile_common(td, arg->out, arg->in, + arg->offset != NULL ? &offset64 : NULL, arg->count); + + if (arg->offset != NULL) { +#if defined(__i386__) || defined(__arm__) || \ + (defined(__amd64__) && defined(COMPAT_LINUX32)) + if (offset64 > INT32_MAX) + return (EOVERFLOW); +#endif + offset = (l_long)offset64; + error = copyout(&offset, arg->offset, sizeof(offset)); + if (error != 0) + return (error); + } + + return (ret); +} + +#if defined(__i386__) || defined(__arm__) || \ + (defined(__amd64__) && defined(COMPAT_LINUX32)) + +int +linux_sendfile64(struct thread *td, struct linux_sendfile64_args *arg) +{ + l_loff_t offset; + int ret; + int error; + + if (arg->offset != NULL) { + error = copyin(arg->offset, &offset, sizeof(offset)); + if (error != 0) + return (error); + } + + ret = linux_sendfile_common(td, arg->out, arg->in, + arg->offset != NULL ? &offset : NULL, arg->count); + + if (arg->offset != NULL) { + error = copyout(&offset, arg->offset, sizeof(offset)); + if (error != 0) + return (error); + } + + return (ret); +} + /* Argument list sizes for linux_socketcall */ static const unsigned char lxs_args_cnt[] = { 0 /* unused*/, 3 /* socket */, @@ -1595,7 +1726,7 @@ static const unsigned char lxs_args_cnt[] = { 5 /* setsockopt */, 5 /* getsockopt */, 3 /* sendmsg */, 3 /* recvmsg */, 4 /* accept4 */, 5 /* recvmmsg */, - 4 /* sendmmsg */ + 4 /* sendmmsg */, 4 /* sendfile */ }; #define LINUX_ARGS_CNT (nitems(lxs_args_cnt) - 1) #define LINUX_ARG_SIZE(x) (lxs_args_cnt[x] * sizeof(l_ulong)) @@ -1664,9 +1795,11 @@ linux_socketcall(struct thread *td, struct linux_socke return (linux_recvmmsg(td, arg)); case LINUX_SENDMMSG: return (linux_sendmmsg(td, arg)); + case LINUX_SENDFILE: + return (linux_sendfile(td, arg)); } uprintf("LINUX: 'socket' typ=%d not implemented\n", args->what); return (ENOSYS); } -#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ +#endif /* __i386__ || __arm__ || (__amd64__ && COMPAT_LINUX32) */ Modified: head/sys/compat/linux/linux_socket.h ============================================================================== --- head/sys/compat/linux/linux_socket.h Wed Feb 5 16:10:09 2020 (r357576) +++ head/sys/compat/linux/linux_socket.h Wed Feb 5 16:53:02 2020 (r357577) @@ -132,7 +132,9 @@ struct l_ucred { uint32_t gid; }; -#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) +#if defined(__i386__) || defined(__arm__) || \ + (defined(__amd64__) && defined(COMPAT_LINUX32)) + struct linux_accept_args { register_t s; register_t addr; @@ -162,7 +164,9 @@ int linux_accept(struct thread *td, struct linux_accep #define LINUX_ACCEPT4 18 #define LINUX_RECVMMSG 19 #define LINUX_SENDMMSG 20 -#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ +#define LINUX_SENDFILE 21 + +#endif /* __i386__ || __arm__ || (__amd64__ && COMPAT_LINUX32) */ /* Socket defines */ #define LINUX_SOL_SOCKET 1 Modified: head/sys/i386/linux/linux_dummy.c ============================================================================== --- head/sys/i386/linux/linux_dummy.c Wed Feb 5 16:10:09 2020 (r357576) +++ head/sys/i386/linux/linux_dummy.c Wed Feb 5 16:53:02 2020 (r357577) @@ -75,7 +75,6 @@ DUMMY(quotactl); DUMMY(bdflush); DUMMY(sysfs); DUMMY(vm86); -DUMMY(sendfile); /* different semantics */ DUMMY(setfsuid); DUMMY(setfsgid); DUMMY(pivot_root); Modified: head/sys/i386/linux/syscalls.master ============================================================================== --- head/sys/i386/linux/syscalls.master Wed Feb 5 16:10:09 2020 (r357576) +++ head/sys/i386/linux/syscalls.master Wed Feb 5 16:53:02 2020 (r357577) @@ -341,7 +341,8 @@ struct l_user_cap_data *datap); } 186 AUE_NULL STD { int linux_sigaltstack(l_stack_t *uss, \ l_stack_t *uoss); } -187 AUE_SENDFILE STD { int linux_sendfile(void); } +187 AUE_SENDFILE STD { int linux_sendfile(l_int out, l_int in, \ + l_long *offset, l_size_t count); } 188 AUE_GETPMSG UNIMPL getpmsg 189 AUE_PUTPMSG UNIMPL putpmsg 190 AUE_VFORK STD { int linux_vfork(void); } @@ -415,7 +416,8 @@ 236 AUE_NULL STD { int linux_lremovexattr(void); } 237 AUE_NULL STD { int linux_fremovexattr(void); } 238 AUE_NULL STD { int linux_tkill(int tid, int sig); } -239 AUE_SENDFILE UNIMPL linux_sendfile64 +239 AUE_SENDFILE STD { int linux_sendfile64(l_int out, l_int in, \ + l_loff_t *offset, l_size_t count); } 240 AUE_NULL STD { int linux_sys_futex(void *uaddr, int op, uint32_t val, \ struct l_timespec *timeout, uint32_t *uaddr2, uint32_t val3); } 241 AUE_NULL STD { int linux_sched_setaffinity(l_pid_t pid, l_uint len, \ From owner-svn-src-all@freebsd.org Wed Feb 5 16:54:20 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6B37324EE1B; Wed, 5 Feb 2020 16:54:20 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CSMc2xjpz3GYY; Wed, 5 Feb 2020 16:54:20 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5FFF85C5F; Wed, 5 Feb 2020 16:54:20 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 015GsKvP057953; Wed, 5 Feb 2020 16:54:20 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 015GsHRQ057938; Wed, 5 Feb 2020 16:54:17 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202002051654.015GsHRQ057938@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 5 Feb 2020 16:54:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357578 - in head/sys: amd64/linux32 arm/linux i386/linux X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/sys: amd64/linux32 arm/linux i386/linux X-SVN-Commit-Revision: 357578 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 16:54:20 -0000 Author: emaste Date: Wed Feb 5 16:54:16 2020 New Revision: 357578 URL: https://svnweb.freebsd.org/changeset/base/357578 Log: regen linuxulator sysent after r357577 Modified: head/sys/amd64/linux32/linux32_proto.h head/sys/amd64/linux32/linux32_syscall.h head/sys/amd64/linux32/linux32_syscalls.c head/sys/amd64/linux32/linux32_sysent.c head/sys/amd64/linux32/linux32_systrace_args.c head/sys/arm/linux/linux_proto.h head/sys/arm/linux/linux_syscall.h head/sys/arm/linux/linux_syscalls.c head/sys/arm/linux/linux_sysent.c head/sys/arm/linux/linux_systrace_args.c head/sys/i386/linux/linux_proto.h head/sys/i386/linux/linux_syscall.h head/sys/i386/linux/linux_syscalls.c head/sys/i386/linux/linux_sysent.c head/sys/i386/linux/linux_systrace_args.c Modified: head/sys/amd64/linux32/linux32_proto.h ============================================================================== --- head/sys/amd64/linux32/linux32_proto.h Wed Feb 5 16:53:02 2020 (r357577) +++ head/sys/amd64/linux32/linux32_proto.h Wed Feb 5 16:54:16 2020 (r357578) @@ -606,7 +606,10 @@ struct linux_sigaltstack_args { char uoss_l_[PADL_(l_stack_t *)]; l_stack_t * uoss; char uoss_r_[PADR_(l_stack_t *)]; }; struct linux_sendfile_args { - register_t dummy; + char out_l_[PADL_(l_int)]; l_int out; char out_r_[PADR_(l_int)]; + char in_l_[PADL_(l_int)]; l_int in; char in_r_[PADR_(l_int)]; + char offset_l_[PADL_(l_long *)]; l_long * offset; char offset_r_[PADR_(l_long *)]; + char count_l_[PADL_(l_size_t)]; l_size_t count; char count_r_[PADR_(l_size_t)]; }; struct linux_vfork_args { register_t dummy; @@ -737,6 +740,12 @@ struct linux_tkill_args { char tid_l_[PADL_(int)]; int tid; char tid_r_[PADR_(int)]; char sig_l_[PADL_(int)]; int sig; char sig_r_[PADR_(int)]; }; +struct linux_sendfile64_args { + char out_l_[PADL_(l_int)]; l_int out; char out_r_[PADR_(l_int)]; + char in_l_[PADL_(l_int)]; l_int in; char in_r_[PADR_(l_int)]; + char offset_l_[PADL_(l_loff_t *)]; l_loff_t * offset; char offset_r_[PADR_(l_loff_t *)]; + char count_l_[PADL_(l_size_t)]; l_size_t count; char count_r_[PADR_(l_size_t)]; +}; struct linux_sys_futex_args { char uaddr_l_[PADL_(void *)]; void * uaddr; char uaddr_r_[PADR_(void *)]; char op_l_[PADL_(int)]; int op; char op_r_[PADR_(int)]; @@ -1698,6 +1707,7 @@ int linux_removexattr(struct thread *, struct linux_re int linux_lremovexattr(struct thread *, struct linux_lremovexattr_args *); int linux_fremovexattr(struct thread *, struct linux_fremovexattr_args *); int linux_tkill(struct thread *, struct linux_tkill_args *); +int linux_sendfile64(struct thread *, struct linux_sendfile64_args *); int linux_sys_futex(struct thread *, struct linux_sys_futex_args *); int linux_sched_setaffinity(struct thread *, struct linux_sched_setaffinity_args *); int linux_sched_getaffinity(struct thread *, struct linux_sched_getaffinity_args *); @@ -2092,6 +2102,7 @@ int linux_io_uring_register(struct thread *, struct li #define LINUX32_SYS_AUE_linux_lremovexattr AUE_NULL #define LINUX32_SYS_AUE_linux_fremovexattr AUE_NULL #define LINUX32_SYS_AUE_linux_tkill AUE_NULL +#define LINUX32_SYS_AUE_linux_sendfile64 AUE_SENDFILE #define LINUX32_SYS_AUE_linux_sys_futex AUE_NULL #define LINUX32_SYS_AUE_linux_sched_setaffinity AUE_NULL #define LINUX32_SYS_AUE_linux_sched_getaffinity AUE_NULL Modified: head/sys/amd64/linux32/linux32_syscall.h ============================================================================== --- head/sys/amd64/linux32/linux32_syscall.h Wed Feb 5 16:53:02 2020 (r357577) +++ head/sys/amd64/linux32/linux32_syscall.h Wed Feb 5 16:54:16 2020 (r357578) @@ -216,6 +216,7 @@ #define LINUX32_SYS_linux_lremovexattr 236 #define LINUX32_SYS_linux_fremovexattr 237 #define LINUX32_SYS_linux_tkill 238 +#define LINUX32_SYS_linux_sendfile64 239 #define LINUX32_SYS_linux_sys_futex 240 #define LINUX32_SYS_linux_sched_setaffinity 241 #define LINUX32_SYS_linux_sched_getaffinity 242 Modified: head/sys/amd64/linux32/linux32_syscalls.c ============================================================================== --- head/sys/amd64/linux32/linux32_syscalls.c Wed Feb 5 16:53:02 2020 (r357577) +++ head/sys/amd64/linux32/linux32_syscalls.c Wed Feb 5 16:54:16 2020 (r357578) @@ -246,7 +246,7 @@ const char *linux32_syscallnames[] = { "linux_lremovexattr", /* 236 = linux_lremovexattr */ "linux_fremovexattr", /* 237 = linux_fremovexattr */ "linux_tkill", /* 238 = linux_tkill */ - "#239", /* 239 = linux_sendfile64 */ + "linux_sendfile64", /* 239 = linux_sendfile64 */ "linux_sys_futex", /* 240 = linux_sys_futex */ "linux_sched_setaffinity", /* 241 = linux_sched_setaffinity */ "linux_sched_getaffinity", /* 242 = linux_sched_getaffinity */ Modified: head/sys/amd64/linux32/linux32_sysent.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysent.c Wed Feb 5 16:53:02 2020 (r357577) +++ head/sys/amd64/linux32/linux32_sysent.c Wed Feb 5 16:54:16 2020 (r357578) @@ -204,7 +204,7 @@ struct sysent linux32_sysent[] = { { AS(linux_capget_args), (sy_call_t *)linux_capget, AUE_CAPGET, NULL, 0, 0, 0, SY_THR_STATIC }, /* 184 = linux_capget */ { AS(linux_capset_args), (sy_call_t *)linux_capset, AUE_CAPSET, NULL, 0, 0, 0, SY_THR_STATIC }, /* 185 = linux_capset */ { AS(linux_sigaltstack_args), (sy_call_t *)linux_sigaltstack, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 186 = linux_sigaltstack */ - { 0, (sy_call_t *)linux_sendfile, AUE_SENDFILE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 187 = linux_sendfile */ + { AS(linux_sendfile_args), (sy_call_t *)linux_sendfile, AUE_SENDFILE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 187 = linux_sendfile */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 188 = getpmsg */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 189 = putpmsg */ { 0, (sy_call_t *)linux_vfork, AUE_VFORK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 190 = linux_vfork */ @@ -256,7 +256,7 @@ struct sysent linux32_sysent[] = { { 0, (sy_call_t *)linux_lremovexattr, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 236 = linux_lremovexattr */ { 0, (sy_call_t *)linux_fremovexattr, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 237 = linux_fremovexattr */ { AS(linux_tkill_args), (sy_call_t *)linux_tkill, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 238 = linux_tkill */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 239 = linux_sendfile64 */ + { AS(linux_sendfile64_args), (sy_call_t *)linux_sendfile64, AUE_SENDFILE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 239 = linux_sendfile64 */ { AS(linux_sys_futex_args), (sy_call_t *)linux_sys_futex, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 240 = linux_sys_futex */ { AS(linux_sched_setaffinity_args), (sy_call_t *)linux_sched_setaffinity, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 241 = linux_sched_setaffinity */ { AS(linux_sched_getaffinity_args), (sy_call_t *)linux_sched_getaffinity, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 242 = linux_sched_getaffinity */ Modified: head/sys/amd64/linux32/linux32_systrace_args.c ============================================================================== --- head/sys/amd64/linux32/linux32_systrace_args.c Wed Feb 5 16:53:02 2020 (r357577) +++ head/sys/amd64/linux32/linux32_systrace_args.c Wed Feb 5 16:54:16 2020 (r357578) @@ -1294,7 +1294,12 @@ systrace_args(int sysnum, void *params, uint64_t *uarg } /* linux_sendfile */ case 187: { - *n_args = 0; + struct linux_sendfile_args *p = params; + iarg[0] = p->out; /* l_int */ + iarg[1] = p->in; /* l_int */ + uarg[2] = (intptr_t) p->offset; /* l_long * */ + iarg[3] = p->count; /* l_size_t */ + *n_args = 4; break; } /* linux_vfork */ @@ -1620,6 +1625,16 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 2; break; } + /* linux_sendfile64 */ + case 239: { + struct linux_sendfile64_args *p = params; + iarg[0] = p->out; /* l_int */ + iarg[1] = p->in; /* l_int */ + uarg[2] = (intptr_t) p->offset; /* l_loff_t * */ + iarg[3] = p->count; /* l_size_t */ + *n_args = 4; + break; + } /* linux_sys_futex */ case 240: { struct linux_sys_futex_args *p = params; @@ -4987,6 +5002,22 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; /* linux_sendfile */ case 187: + switch(ndx) { + case 0: + p = "l_int"; + break; + case 1: + p = "l_int"; + break; + case 2: + p = "userland l_long *"; + break; + case 3: + p = "l_size_t"; + break; + default: + break; + }; break; /* linux_vfork */ case 190: @@ -5432,6 +5463,25 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; + /* linux_sendfile64 */ + case 239: + switch(ndx) { + case 0: + p = "l_int"; + break; + case 1: + p = "l_int"; + break; + case 2: + p = "userland l_loff_t *"; + break; + case 3: + p = "l_size_t"; + break; + default: + break; + }; + break; /* linux_sys_futex */ case 240: switch(ndx) { @@ -8305,6 +8355,9 @@ systrace_return_setargdesc(int sysnum, int ndx, char * break; /* linux_sendfile */ case 187: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_vfork */ case 190: /* linux_getrlimit */ @@ -8475,6 +8528,11 @@ systrace_return_setargdesc(int sysnum, int ndx, char * case 237: /* linux_tkill */ case 238: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_sendfile64 */ + case 239: if (ndx == 0 || ndx == 1) p = "int"; break; Modified: head/sys/arm/linux/linux_proto.h ============================================================================== --- head/sys/arm/linux/linux_proto.h Wed Feb 5 16:53:02 2020 (r357577) +++ head/sys/arm/linux/linux_proto.h Wed Feb 5 16:54:16 2020 (r357578) @@ -509,7 +509,10 @@ struct linux_sigaltstack_args { char uoss_l_[PADL_(l_stack_t *)]; l_stack_t * uoss; char uoss_r_[PADR_(l_stack_t *)]; }; struct linux_sendfile_args { - register_t dummy; + char out_l_[PADL_(l_int)]; l_int out; char out_r_[PADR_(l_int)]; + char in_l_[PADL_(l_int)]; l_int in; char in_r_[PADR_(l_int)]; + char offset_l_[PADL_(l_long *)]; l_long * offset; char offset_r_[PADR_(l_long *)]; + char count_l_[PADL_(l_size_t)]; l_size_t count; char count_r_[PADR_(l_size_t)]; }; struct linux_vfork_args { register_t dummy; @@ -638,6 +641,12 @@ struct linux_tkill_args { char tid_l_[PADL_(int)]; int tid; char tid_r_[PADR_(int)]; char sig_l_[PADL_(int)]; int sig; char sig_r_[PADR_(int)]; }; +struct linux_sendfile64_args { + char out_l_[PADL_(l_int)]; l_int out; char out_r_[PADR_(l_int)]; + char in_l_[PADL_(l_int)]; l_int in; char in_r_[PADR_(l_int)]; + char offset_l_[PADL_(l_loff_t *)]; l_loff_t * offset; char offset_r_[PADR_(l_loff_t *)]; + char count_l_[PADL_(l_size_t)]; l_size_t count; char count_r_[PADR_(l_size_t)]; +}; struct linux_sys_futex_args { char uaddr_l_[PADL_(void *)]; void * uaddr; char uaddr_r_[PADR_(void *)]; char op_l_[PADL_(int)]; int op; char op_r_[PADR_(int)]; @@ -1371,6 +1380,7 @@ int linux_removexattr(struct thread *, struct linux_re int linux_lremovexattr(struct thread *, struct linux_lremovexattr_args *); int linux_fremovexattr(struct thread *, struct linux_fremovexattr_args *); int linux_tkill(struct thread *, struct linux_tkill_args *); +int linux_sendfile64(struct thread *, struct linux_sendfile64_args *); int linux_sys_futex(struct thread *, struct linux_sys_futex_args *); int linux_sched_setaffinity(struct thread *, struct linux_sched_setaffinity_args *); int linux_sched_getaffinity(struct thread *, struct linux_sched_getaffinity_args *); @@ -1696,6 +1706,7 @@ int linux_set_tls(struct thread *, struct linux_set_tl #define LINUX_SYS_AUE_linux_lremovexattr AUE_NULL #define LINUX_SYS_AUE_linux_fremovexattr AUE_NULL #define LINUX_SYS_AUE_linux_tkill AUE_NULL +#define LINUX_SYS_AUE_linux_sendfile64 AUE_SENDFILE #define LINUX_SYS_AUE_linux_sys_futex AUE_NULL #define LINUX_SYS_AUE_linux_sched_setaffinity AUE_NULL #define LINUX_SYS_AUE_linux_sched_getaffinity AUE_NULL Modified: head/sys/arm/linux/linux_syscall.h ============================================================================== --- head/sys/arm/linux/linux_syscall.h Wed Feb 5 16:53:02 2020 (r357577) +++ head/sys/arm/linux/linux_syscall.h Wed Feb 5 16:54:16 2020 (r357578) @@ -195,6 +195,7 @@ #define LINUX_SYS_linux_lremovexattr 236 #define LINUX_SYS_linux_fremovexattr 237 #define LINUX_SYS_linux_tkill 238 +#define LINUX_SYS_linux_sendfile64 239 #define LINUX_SYS_linux_sys_futex 240 #define LINUX_SYS_linux_sched_setaffinity 241 #define LINUX_SYS_linux_sched_getaffinity 242 Modified: head/sys/arm/linux/linux_syscalls.c ============================================================================== --- head/sys/arm/linux/linux_syscalls.c Wed Feb 5 16:53:02 2020 (r357577) +++ head/sys/arm/linux/linux_syscalls.c Wed Feb 5 16:54:16 2020 (r357578) @@ -246,7 +246,7 @@ const char *linux_syscallnames[] = { "linux_lremovexattr", /* 236 = linux_lremovexattr */ "linux_fremovexattr", /* 237 = linux_fremovexattr */ "linux_tkill", /* 238 = linux_tkill */ - "#239", /* 239 = linux_sendfile64 */ + "linux_sendfile64", /* 239 = linux_sendfile64 */ "linux_sys_futex", /* 240 = linux_sys_futex */ "linux_sched_setaffinity", /* 241 = linux_sched_setaffinity */ "linux_sched_getaffinity", /* 242 = linux_sched_getaffinity */ Modified: head/sys/arm/linux/linux_sysent.c ============================================================================== --- head/sys/arm/linux/linux_sysent.c Wed Feb 5 16:53:02 2020 (r357577) +++ head/sys/arm/linux/linux_sysent.c Wed Feb 5 16:54:16 2020 (r357578) @@ -204,7 +204,7 @@ struct sysent linux_sysent[] = { { AS(linux_capget_args), (sy_call_t *)linux_capget, AUE_CAPGET, NULL, 0, 0, 0, SY_THR_STATIC }, /* 184 = linux_capget */ { AS(linux_capset_args), (sy_call_t *)linux_capset, AUE_CAPSET, NULL, 0, 0, 0, SY_THR_STATIC }, /* 185 = linux_capset */ { AS(linux_sigaltstack_args), (sy_call_t *)linux_sigaltstack, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 186 = linux_sigaltstack */ - { 0, (sy_call_t *)linux_sendfile, AUE_SENDFILE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 187 = linux_sendfile */ + { AS(linux_sendfile_args), (sy_call_t *)linux_sendfile, AUE_SENDFILE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 187 = linux_sendfile */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 188 = ; */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 189 = ; */ { 0, (sy_call_t *)linux_vfork, AUE_VFORK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 190 = linux_vfork */ @@ -256,7 +256,7 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)linux_lremovexattr, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 236 = linux_lremovexattr */ { 0, (sy_call_t *)linux_fremovexattr, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 237 = linux_fremovexattr */ { AS(linux_tkill_args), (sy_call_t *)linux_tkill, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 238 = linux_tkill */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 239 = linux_sendfile64 */ + { AS(linux_sendfile64_args), (sy_call_t *)linux_sendfile64, AUE_SENDFILE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 239 = linux_sendfile64 */ { AS(linux_sys_futex_args), (sy_call_t *)linux_sys_futex, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 240 = linux_sys_futex */ { AS(linux_sched_setaffinity_args), (sy_call_t *)linux_sched_setaffinity, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 241 = linux_sched_setaffinity */ { AS(linux_sched_getaffinity_args), (sy_call_t *)linux_sched_getaffinity, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 242 = linux_sched_getaffinity */ Modified: head/sys/arm/linux/linux_systrace_args.c ============================================================================== --- head/sys/arm/linux/linux_systrace_args.c Wed Feb 5 16:53:02 2020 (r357577) +++ head/sys/arm/linux/linux_systrace_args.c Wed Feb 5 16:54:16 2020 (r357578) @@ -1135,7 +1135,12 @@ systrace_args(int sysnum, void *params, uint64_t *uarg } /* linux_sendfile */ case 187: { - *n_args = 0; + struct linux_sendfile_args *p = params; + iarg[0] = p->out; /* l_int */ + iarg[1] = p->in; /* l_int */ + uarg[2] = (intptr_t) p->offset; /* l_long * */ + iarg[3] = p->count; /* l_size_t */ + *n_args = 4; break; } /* linux_vfork */ @@ -1459,6 +1464,16 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 2; break; } + /* linux_sendfile64 */ + case 239: { + struct linux_sendfile64_args *p = params; + iarg[0] = p->out; /* l_int */ + iarg[1] = p->in; /* l_int */ + uarg[2] = (intptr_t) p->offset; /* l_loff_t * */ + iarg[3] = p->count; /* l_size_t */ + *n_args = 4; + break; + } /* linux_sys_futex */ case 240: { struct linux_sys_futex_args *p = params; @@ -4248,6 +4263,22 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; /* linux_sendfile */ case 187: + switch(ndx) { + case 0: + p = "l_int"; + break; + case 1: + p = "l_int"; + break; + case 2: + p = "userland l_long *"; + break; + case 3: + p = "l_size_t"; + break; + default: + break; + }; break; /* linux_vfork */ case 190: @@ -4687,6 +4718,25 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; + /* linux_sendfile64 */ + case 239: + switch(ndx) { + case 0: + p = "l_int"; + break; + case 1: + p = "l_int"; + break; + case 2: + p = "userland l_loff_t *"; + break; + case 3: + p = "l_size_t"; + break; + default: + break; + }; + break; /* linux_sys_futex */ case 240: switch(ndx) { @@ -6978,6 +7028,9 @@ systrace_return_setargdesc(int sysnum, int ndx, char * break; /* linux_sendfile */ case 187: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_vfork */ case 190: /* linux_getrlimit */ @@ -7148,6 +7201,11 @@ systrace_return_setargdesc(int sysnum, int ndx, char * case 237: /* linux_tkill */ case 238: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_sendfile64 */ + case 239: if (ndx == 0 || ndx == 1) p = "int"; break; Modified: head/sys/i386/linux/linux_proto.h ============================================================================== --- head/sys/i386/linux/linux_proto.h Wed Feb 5 16:53:02 2020 (r357577) +++ head/sys/i386/linux/linux_proto.h Wed Feb 5 16:54:16 2020 (r357578) @@ -605,7 +605,10 @@ struct linux_sigaltstack_args { char uoss_l_[PADL_(l_stack_t *)]; l_stack_t * uoss; char uoss_r_[PADR_(l_stack_t *)]; }; struct linux_sendfile_args { - register_t dummy; + char out_l_[PADL_(l_int)]; l_int out; char out_r_[PADR_(l_int)]; + char in_l_[PADL_(l_int)]; l_int in; char in_r_[PADR_(l_int)]; + char offset_l_[PADL_(l_long *)]; l_long * offset; char offset_r_[PADR_(l_long *)]; + char count_l_[PADL_(l_size_t)]; l_size_t count; char count_r_[PADR_(l_size_t)]; }; struct linux_vfork_args { register_t dummy; @@ -734,6 +737,12 @@ struct linux_tkill_args { char tid_l_[PADL_(int)]; int tid; char tid_r_[PADR_(int)]; char sig_l_[PADL_(int)]; int sig; char sig_r_[PADR_(int)]; }; +struct linux_sendfile64_args { + char out_l_[PADL_(l_int)]; l_int out; char out_r_[PADR_(l_int)]; + char in_l_[PADL_(l_int)]; l_int in; char in_r_[PADR_(l_int)]; + char offset_l_[PADL_(l_loff_t *)]; l_loff_t * offset; char offset_r_[PADR_(l_loff_t *)]; + char count_l_[PADL_(l_size_t)]; l_size_t count; char count_r_[PADR_(l_size_t)]; +}; struct linux_sys_futex_args { char uaddr_l_[PADL_(void *)]; void * uaddr; char uaddr_r_[PADR_(void *)]; char op_l_[PADL_(int)]; int op; char op_r_[PADR_(int)]; @@ -1706,6 +1715,7 @@ int linux_removexattr(struct thread *, struct linux_re int linux_lremovexattr(struct thread *, struct linux_lremovexattr_args *); int linux_fremovexattr(struct thread *, struct linux_fremovexattr_args *); int linux_tkill(struct thread *, struct linux_tkill_args *); +int linux_sendfile64(struct thread *, struct linux_sendfile64_args *); int linux_sys_futex(struct thread *, struct linux_sys_futex_args *); int linux_sched_setaffinity(struct thread *, struct linux_sched_setaffinity_args *); int linux_sched_getaffinity(struct thread *, struct linux_sched_getaffinity_args *); @@ -2102,6 +2112,7 @@ int linux_io_uring_register(struct thread *, struct li #define LINUX_SYS_AUE_linux_lremovexattr AUE_NULL #define LINUX_SYS_AUE_linux_fremovexattr AUE_NULL #define LINUX_SYS_AUE_linux_tkill AUE_NULL +#define LINUX_SYS_AUE_linux_sendfile64 AUE_SENDFILE #define LINUX_SYS_AUE_linux_sys_futex AUE_NULL #define LINUX_SYS_AUE_linux_sched_setaffinity AUE_NULL #define LINUX_SYS_AUE_linux_sched_getaffinity AUE_NULL Modified: head/sys/i386/linux/linux_syscall.h ============================================================================== --- head/sys/i386/linux/linux_syscall.h Wed Feb 5 16:53:02 2020 (r357577) +++ head/sys/i386/linux/linux_syscall.h Wed Feb 5 16:54:16 2020 (r357578) @@ -222,6 +222,7 @@ #define LINUX_SYS_linux_lremovexattr 236 #define LINUX_SYS_linux_fremovexattr 237 #define LINUX_SYS_linux_tkill 238 +#define LINUX_SYS_linux_sendfile64 239 #define LINUX_SYS_linux_sys_futex 240 #define LINUX_SYS_linux_sched_setaffinity 241 #define LINUX_SYS_linux_sched_getaffinity 242 Modified: head/sys/i386/linux/linux_syscalls.c ============================================================================== --- head/sys/i386/linux/linux_syscalls.c Wed Feb 5 16:53:02 2020 (r357577) +++ head/sys/i386/linux/linux_syscalls.c Wed Feb 5 16:54:16 2020 (r357578) @@ -246,7 +246,7 @@ const char *linux_syscallnames[] = { "linux_lremovexattr", /* 236 = linux_lremovexattr */ "linux_fremovexattr", /* 237 = linux_fremovexattr */ "linux_tkill", /* 238 = linux_tkill */ - "#239", /* 239 = linux_sendfile64 */ + "linux_sendfile64", /* 239 = linux_sendfile64 */ "linux_sys_futex", /* 240 = linux_sys_futex */ "linux_sched_setaffinity", /* 241 = linux_sched_setaffinity */ "linux_sched_getaffinity", /* 242 = linux_sched_getaffinity */ Modified: head/sys/i386/linux/linux_sysent.c ============================================================================== --- head/sys/i386/linux/linux_sysent.c Wed Feb 5 16:53:02 2020 (r357577) +++ head/sys/i386/linux/linux_sysent.c Wed Feb 5 16:54:16 2020 (r357578) @@ -204,7 +204,7 @@ struct sysent linux_sysent[] = { { AS(linux_capget_args), (sy_call_t *)linux_capget, AUE_CAPGET, NULL, 0, 0, 0, SY_THR_STATIC }, /* 184 = linux_capget */ { AS(linux_capset_args), (sy_call_t *)linux_capset, AUE_CAPSET, NULL, 0, 0, 0, SY_THR_STATIC }, /* 185 = linux_capset */ { AS(linux_sigaltstack_args), (sy_call_t *)linux_sigaltstack, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 186 = linux_sigaltstack */ - { 0, (sy_call_t *)linux_sendfile, AUE_SENDFILE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 187 = linux_sendfile */ + { AS(linux_sendfile_args), (sy_call_t *)linux_sendfile, AUE_SENDFILE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 187 = linux_sendfile */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 188 = getpmsg */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 189 = putpmsg */ { 0, (sy_call_t *)linux_vfork, AUE_VFORK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 190 = linux_vfork */ @@ -256,7 +256,7 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)linux_lremovexattr, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 236 = linux_lremovexattr */ { 0, (sy_call_t *)linux_fremovexattr, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 237 = linux_fremovexattr */ { AS(linux_tkill_args), (sy_call_t *)linux_tkill, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 238 = linux_tkill */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 239 = linux_sendfile64 */ + { AS(linux_sendfile64_args), (sy_call_t *)linux_sendfile64, AUE_SENDFILE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 239 = linux_sendfile64 */ { AS(linux_sys_futex_args), (sy_call_t *)linux_sys_futex, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 240 = linux_sys_futex */ { AS(linux_sched_setaffinity_args), (sy_call_t *)linux_sched_setaffinity, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 241 = linux_sched_setaffinity */ { AS(linux_sched_getaffinity_args), (sy_call_t *)linux_sched_getaffinity, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 242 = linux_sched_getaffinity */ Modified: head/sys/i386/linux/linux_systrace_args.c ============================================================================== --- head/sys/i386/linux/linux_systrace_args.c Wed Feb 5 16:53:02 2020 (r357577) +++ head/sys/i386/linux/linux_systrace_args.c Wed Feb 5 16:54:16 2020 (r357578) @@ -1335,7 +1335,12 @@ systrace_args(int sysnum, void *params, uint64_t *uarg } /* linux_sendfile */ case 187: { - *n_args = 0; + struct linux_sendfile_args *p = params; + iarg[0] = p->out; /* l_int */ + iarg[1] = p->in; /* l_int */ + uarg[2] = (intptr_t) p->offset; /* l_long * */ + iarg[3] = p->count; /* l_size_t */ + *n_args = 4; break; } /* linux_vfork */ @@ -1659,6 +1664,16 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 2; break; } + /* linux_sendfile64 */ + case 239: { + struct linux_sendfile64_args *p = params; + iarg[0] = p->out; /* l_int */ + iarg[1] = p->in; /* l_int */ + uarg[2] = (intptr_t) p->offset; /* l_loff_t * */ + iarg[3] = p->count; /* l_size_t */ + *n_args = 4; + break; + } /* linux_sys_futex */ case 240: { struct linux_sys_futex_args *p = params; @@ -5107,6 +5122,22 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; /* linux_sendfile */ case 187: + switch(ndx) { + case 0: + p = "l_int"; + break; + case 1: + p = "l_int"; + break; + case 2: + p = "userland l_long *"; + break; + case 3: + p = "l_size_t"; + break; + default: + break; + }; break; /* linux_vfork */ case 190: @@ -5546,6 +5577,25 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; + /* linux_sendfile64 */ + case 239: + switch(ndx) { + case 0: + p = "l_int"; + break; + case 1: + p = "l_int"; + break; + case 2: + p = "userland l_loff_t *"; + break; + case 3: + p = "l_size_t"; + break; + default: + break; + }; + break; /* linux_sys_futex */ case 240: switch(ndx) { @@ -8516,6 +8566,9 @@ systrace_return_setargdesc(int sysnum, int ndx, char * break; /* linux_sendfile */ case 187: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_vfork */ case 190: /* linux_getrlimit */ @@ -8686,6 +8739,11 @@ systrace_return_setargdesc(int sysnum, int ndx, char * case 237: /* linux_tkill */ case 238: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_sendfile64 */ + case 239: if (ndx == 0 || ndx == 1) p = "int"; break; From owner-svn-src-all@freebsd.org Wed Feb 5 16:55:01 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0658524EE7E; Wed, 5 Feb 2020 16:55:01 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CSNN6Ppfz3GhF; Wed, 5 Feb 2020 16:55:00 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D724F5C62; Wed, 5 Feb 2020 16:55:00 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 015Gt08V058073; Wed, 5 Feb 2020 16:55:00 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 015Gt0fX058072; Wed, 5 Feb 2020 16:55:00 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202002051655.015Gt0fX058072@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 5 Feb 2020 16:55:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357579 - head/lib/libfetch X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/lib/libfetch X-SVN-Commit-Revision: 357579 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 16:55:01 -0000 Author: emaste Date: Wed Feb 5 16:55:00 2020 New Revision: 357579 URL: https://svnweb.freebsd.org/changeset/base/357579 Log: libfetch: disallow invalid escape sequences Per RFC1738 escape is "% hex hex"; other sequences do not form a valid URL. Suggested by: Matthew Dillon Reviewed by: Matthew Dillon MFC after: 1 week Modified: head/lib/libfetch/fetch.c Modified: head/lib/libfetch/fetch.c ============================================================================== --- head/lib/libfetch/fetch.c Wed Feb 5 16:54:16 2020 (r357578) +++ head/lib/libfetch/fetch.c Wed Feb 5 16:55:00 2020 (r357579) @@ -327,6 +327,9 @@ fetch_pctdecode(char *dst, const char *src, size_t dle (d2 = fetch_hexval(s[2])) >= 0 && (d1 > 0 || d2 > 0)) { c = d1 << 4 | d2; s += 2; + } else if (s[0] == '%') { + /* Invalid escape sequence. */ + return (NULL); } else { c = *s; } From owner-svn-src-all@freebsd.org Wed Feb 5 17:21:08 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7CEBC24F529 for ; Wed, 5 Feb 2020 17:21:08 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound3d.ore.mailhop.org (outbound3d.ore.mailhop.org [54.186.57.195]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48CSyX0hdlz3Hrr for ; Wed, 5 Feb 2020 17:21:07 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1580923267; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=oBMyiRd0f7JDo02BPQ43ZA8L1QptlE4fpgn1O9eBzJV29haAXXvVzfL3jQIFce9B9RNBxmG+7jLmw WgWXEktNunFrD6TQZESaAMb5Mp6NOgYBpIu/iuIxxtvNnZqvwF8UxpqAk+s8FmTqn3KHLIqrK2cULP kWrzOL/w1XgWA+v+dOEf5KRAkJAxHWvQ1gme64YI9WWQMoPlvvPpBdP2G63vAg376R/yqj9styVOPT MwfeR9L+ubB1elzZIUoM2aQ5NhP2ITAGaaTuc+dx27ZIK+rD6l77RDgsNKfqToxBx3KpzUeG5rFg+l J5B2VtD5TYtL5XJesW0A909fnl32zGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:dkim-signature:from; bh=OWoW8Y6NtUkqcDmw0Iy6ap8B9T2Jf451DzRmPVQESDg=; b=XWcaD4Z7VvsW0SZ3UFGU6QNPtSBIH2+hOZb2X89het5vaYKf6B2DzOvGZG8FVYWuBbOGz4lG57DNE 4nITOZCu47nYEd2dPb93tSz9qIRaU6TTS3eN0BhKtY6O2UbgYB+3pZdhOC5LWB199leFPpF4R9WXg4 kESpx4C5b7VH7usty8+PSFkpLKy3Zy7tXlzUXiQQvCfd2ulb98/1kNFFCleUUWFh/Oj4AfrvI7Ba25 9w+8IPHoMMIxIoJ1o8keKs/LVZIIXX2P02LRMSTz94ZG+kI0mMID8m3+PwMChkjc8ZmHHKPOkm+wtq 7Mk6TVx55m94vBS3T2JA0IhM61NCVfA== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:from; bh=OWoW8Y6NtUkqcDmw0Iy6ap8B9T2Jf451DzRmPVQESDg=; b=Y5xXLsyn9QjvQ85pl95wi9B08YY9BIHKLArPOC+vqXRYcskJ4PSjM3ZUeOxCw2qJPBtv4WJs+JIAW MHMxYBKLPUpwBvPnaMlfFf8apjQT6VRlJUhDbwhKOAeT6LM4/R3+YsNBI7Y1lxZLEe+wcEEK4wAKnx MjEFLzQpaT1TGTFUpVzAIGqvt/BfQws98gxl4hoi7ovWVtjkTD2jhyH+shIsQsqSKOslBt6d7JUtjw JExf70wHktKcCS0PO4Y204mNa+pr1R+S+JmPeNuGgrIS9y5uHnz+nAUFYLU3SZ0CIT8NXr3Ny5/80k 6i00RLOZTJBVl6p3No3BD4/0zEBEJow== X-MHO-RoutePath: aGlwcGll X-MHO-User: e3af3311-483b-11ea-b80d-052b4a66b6b2 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound3.ore.mailhop.org (Halon) with ESMTPSA id e3af3311-483b-11ea-b80d-052b4a66b6b2; Wed, 05 Feb 2020 17:21:05 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id 015HL4IJ046476; Wed, 5 Feb 2020 10:21:04 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1c19eca5b40aa7b70b0c18b7b52b540671cc50dd.camel@freebsd.org> Subject: Re: svn commit: r357566 - head From: Ian Lepore To: Kyle Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Wed, 05 Feb 2020 10:21:04 -0700 In-Reply-To: <202002050443.0154hwPl091233@repo.freebsd.org> References: <202002050443.0154hwPl091233@repo.freebsd.org> Content-Type: text/plain; charset="ASCII" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 48CSyX0hdlz3Hrr X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-1.85 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.87)[-0.868,0]; ASN(0.00)[asn:16509, ipnet:54.186.0.0/15, country:US]; NEURAL_HAM_LONG(-0.98)[-0.979,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 17:21:08 -0000 On Wed, 2020-02-05 at 04:43 +0000, Kyle Evans wrote: > Author: kevans > Date: Wed Feb 5 04:43:58 2020 > New Revision: 357566 > URL: https://svnweb.freebsd.org/changeset/base/357566 > > Log: > Add RELNOTES entry for various daemons pulling in environment variables > > Modified: > head/RELNOTES > > Modified: head/RELNOTES > ============================================================================== > --- head/RELNOTES Wed Feb 5 04:35:54 2020 (r357565) > +++ head/RELNOTES Wed Feb 5 04:43:58 2020 (r357566) > @@ -10,6 +10,12 @@ newline. Entries should be separated by a newline. > > Changes to this file should not be MFCed. > > +r357560-r357565: > + init(8), service(8), and cron(8) will now adopt user/class environment > + variables (excluding PATH, by default, which will be overwritten) by > + default. Notably, environment variables for all cron jobs and rc > + services can now be set via login.conf(5). > + > Unfortunately, the utility of this cool series of changes is mostly destroyed by the fact that PATH is the variable that could be most usefully set in login.conf for running daemons, specifically because it is set in 3 separate places now. -- Ian From owner-svn-src-all@freebsd.org Wed Feb 5 17:21:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6649224F6CD; Wed, 5 Feb 2020 17:21:37 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CSz528sYz3J3L; Wed, 5 Feb 2020 17:21:37 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4570F6084; Wed, 5 Feb 2020 17:21:37 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 015HLbbf074955; Wed, 5 Feb 2020 17:21:37 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 015HLb9Z074954; Wed, 5 Feb 2020 17:21:37 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202002051721.015HLb9Z074954@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 5 Feb 2020 17:21:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357580 - head/contrib/netbsd-tests/lib/libc/c063 X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/contrib/netbsd-tests/lib/libc/c063 X-SVN-Commit-Revision: 357580 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 17:21:37 -0000 Author: kevans Date: Wed Feb 5 17:21:36 2020 New Revision: 357580 URL: https://svnweb.freebsd.org/changeset/base/357580 Log: O_SEARCH test: drop O_SEARCH|O_RDWR local diff In FreeBSD's O_SEARCH implementation, O_SEARCH in conjunction with O_RDWR or O_WRONLY is explicitly rejected. In this case, O_RDWR was not necessary anyways as the file will get created with or without it. This was submitted upstream as misc/54940 and committed in rev 1.8 of the file. Modified: head/contrib/netbsd-tests/lib/libc/c063/t_o_search.c Modified: head/contrib/netbsd-tests/lib/libc/c063/t_o_search.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/c063/t_o_search.c Wed Feb 5 16:55:00 2020 (r357579) +++ head/contrib/netbsd-tests/lib/libc/c063/t_o_search.c Wed Feb 5 17:21:36 2020 (r357580) @@ -258,11 +258,7 @@ ATF_TC_BODY(o_search_notdir, tc) int fd; ATF_REQUIRE(mkdir(DIR, 0755) == 0); -#ifndef __FreeBSD__ - ATF_REQUIRE((dfd = open(FILE, O_CREAT|O_RDWR|O_SEARCH, 0644)) != -1); -#else ATF_REQUIRE((dfd = open(FILE, O_CREAT|O_SEARCH, 0644)) != -1); -#endif ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) == -1); ATF_REQUIRE(errno == ENOTDIR); ATF_REQUIRE(close(dfd) == 0); From owner-svn-src-all@freebsd.org Wed Feb 5 17:26:59 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3826524F859; Wed, 5 Feb 2020 17:26:59 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CT5H0lsRz3JRS; Wed, 5 Feb 2020 17:26:59 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qt1-f179.google.com (mail-qt1-f179.google.com [209.85.160.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 0BDB814889; Wed, 5 Feb 2020 17:26:59 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qt1-f179.google.com with SMTP id e25so2132467qtr.13; Wed, 05 Feb 2020 09:26:59 -0800 (PST) X-Gm-Message-State: APjAAAUvglrlvdhyjVcrQRlw/Jo+nE2eHmflzfP3dGQux1xqg7gx7ul3 1bhcr2kantDxLSJymMDJq3lLQiKEUQR3rhVEDQA= X-Google-Smtp-Source: APXvYqw6m9wJjCZkO6RKvCQuzgU9FzJ0hfqyZjjz0qfEt+BuuInvMcNJi6OBAELSueQiku/qvifE+FRkMXkOfhP1RY0= X-Received: by 2002:aed:3f70:: with SMTP id q45mr18264594qtf.310.1580923618220; Wed, 05 Feb 2020 09:26:58 -0800 (PST) MIME-Version: 1.0 References: <202002050443.0154hwPl091233@repo.freebsd.org> <1c19eca5b40aa7b70b0c18b7b52b540671cc50dd.camel@freebsd.org> In-Reply-To: <1c19eca5b40aa7b70b0c18b7b52b540671cc50dd.camel@freebsd.org> From: Kyle Evans Date: Wed, 5 Feb 2020 11:26:46 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r357566 - head To: Ian Lepore Cc: src-committers , svn-src-all , svn-src-head , Andrew Gierth , sigsys@gmail.com Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 17:26:59 -0000 On Wed, Feb 5, 2020 at 11:21 AM Ian Lepore wrote: > > On Wed, 2020-02-05 at 04:43 +0000, Kyle Evans wrote: > > Author: kevans > > Date: Wed Feb 5 04:43:58 2020 > > New Revision: 357566 > > URL: https://svnweb.freebsd.org/changeset/base/357566 > > > > Log: > > Add RELNOTES entry for various daemons pulling in environment variables > > > > Modified: > > head/RELNOTES > > > > Modified: head/RELNOTES > > ============================================================================== > > --- head/RELNOTES Wed Feb 5 04:35:54 2020 (r357565) > > +++ head/RELNOTES Wed Feb 5 04:43:58 2020 (r357566) > > @@ -10,6 +10,12 @@ newline. Entries should be separated by a newline. > > > > Changes to this file should not be MFCed. > > > > +r357560-r357565: > > + init(8), service(8), and cron(8) will now adopt user/class environment > > + variables (excluding PATH, by default, which will be overwritten) by > > + default. Notably, environment variables for all cron jobs and rc > > + services can now be set via login.conf(5). > > + > > > > Unfortunately, the utility of this cool series of changes is mostly > destroyed by the fact that PATH is the variable that could be most > usefully set in login.conf for running daemons, specifically because it > is set in 3 separate places now. > It is (and has been) set in each of them respectively, but the submitter (along with sigsys@gmail.com) have some idea to accept a hint in cron (and perhaps the others) from login.conf that it should accept PATH as well unless it's been explicitly set in the executing job. I've CC'd these two so they can expand on that or discuss as needed. Thanks, Kyle Evans From owner-svn-src-all@freebsd.org Wed Feb 5 18:24:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9F818228F14; Wed, 5 Feb 2020 18:24:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CVMf0rkCz3PDT; Wed, 5 Feb 2020 18:24:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F2F086E0C; Wed, 5 Feb 2020 18:24:29 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 015IOTSY014801; Wed, 5 Feb 2020 18:24:29 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 015IOS91014776; Wed, 5 Feb 2020 18:24:28 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202002051824.015IOS91014776@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 5 Feb 2020 18:24:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357581 - in stable/12/contrib/blacklist: bin diff lib X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in stable/12/contrib/blacklist: bin diff lib X-SVN-Commit-Revision: 357581 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 18:24:30 -0000 Author: emaste Date: Wed Feb 5 18:24:28 2020 New Revision: 357581 URL: https://svnweb.freebsd.org/changeset/base/357581 Log: MFC r354399: blacklist: update to NetBSD snapshot on 20191106 Sponsored by: The FreeBSD Foundation Modified: stable/12/contrib/blacklist/bin/blacklistctl.c stable/12/contrib/blacklist/bin/blacklistd.c stable/12/contrib/blacklist/bin/blacklistd.conf.5 stable/12/contrib/blacklist/bin/support.c stable/12/contrib/blacklist/diff/ssh.diff stable/12/contrib/blacklist/lib/Makefile stable/12/contrib/blacklist/lib/libblacklist.3 Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/blacklist/bin/blacklistctl.c ============================================================================== --- stable/12/contrib/blacklist/bin/blacklistctl.c Wed Feb 5 17:21:36 2020 (r357580) +++ stable/12/contrib/blacklist/bin/blacklistctl.c Wed Feb 5 18:24:28 2020 (r357581) @@ -1,4 +1,4 @@ -/* $NetBSD: blacklistctl.c,v 1.21 2016/11/02 03:15:07 jnemeth Exp $ */ +/* $NetBSD: blacklistctl.c,v 1.23 2018/05/24 19:21:01 christos Exp $ */ /*- * Copyright (c) 2015 The NetBSD Foundation, Inc. @@ -33,7 +33,7 @@ #endif #include -__RCSID("$NetBSD: blacklistctl.c,v 1.21 2016/11/02 03:15:07 jnemeth Exp $"); +__RCSID("$NetBSD: blacklistctl.c,v 1.23 2018/05/24 19:21:01 christos Exp $"); #include #include @@ -67,6 +67,15 @@ usage(int c) exit(EXIT_FAILURE); } +static const char * +star(char *buf, size_t len, int val) +{ + if (val == -1) + return "*"; + snprintf(buf, len, "%d", val); + return buf; +} + int main(int argc, char *argv[]) { @@ -128,9 +137,10 @@ main(int argc, char *argv[]) "address", remain ? "remaining time" : "last access"); for (i = 1; state_iterate(db, &c, &dbi, i) != 0; i = 0) { char buf[BUFSIZ]; + char mbuf[64], pbuf[64]; if (!all) { if (blocked) { - if (dbi.count < c.c_nfail) + if (c.c_nfail == -1 || dbi.count < c.c_nfail) continue; } else { if (dbi.count >= c.c_nfail) @@ -138,13 +148,20 @@ main(int argc, char *argv[]) } } sockaddr_snprintf(buf, sizeof(buf), "%a", (void *)&c.c_ss); - printf("%*.*s/%d:%d\t", wide, wide, buf, c.c_lmask, c.c_port); - if (remain) - fmtydhms(buf, sizeof(buf), - c.c_duration - (ts.tv_sec - dbi.last)); - else - fmttime(buf, sizeof(buf), dbi.last); - printf("%s\t%d/%d\t%-s\n", dbi.id, dbi.count, c.c_nfail, buf); + printf("%*.*s/%s:%s\t", wide, wide, buf, + star(mbuf, sizeof(mbuf), c.c_lmask), + star(pbuf, sizeof(pbuf), c.c_port)); + if (c.c_duration == -1) { + strlcpy(buf, "never", sizeof(buf)); + } else { + if (remain) + fmtydhms(buf, sizeof(buf), + c.c_duration - (ts.tv_sec - dbi.last)); + else + fmttime(buf, sizeof(buf), dbi.last); + } + printf("%s\t%d/%s\t%-s\n", dbi.id, dbi.count, + star(mbuf, sizeof(mbuf), c.c_nfail), buf); } state_close(db); return EXIT_SUCCESS; Modified: stable/12/contrib/blacklist/bin/blacklistd.c ============================================================================== --- stable/12/contrib/blacklist/bin/blacklistd.c Wed Feb 5 17:21:36 2020 (r357580) +++ stable/12/contrib/blacklist/bin/blacklistd.c Wed Feb 5 18:24:28 2020 (r357581) @@ -1,4 +1,4 @@ -/* $NetBSD: blacklistd.c,v 1.37 2017/02/18 00:26:16 christos Exp $ */ +/* $NetBSD: blacklistd.c,v 1.38 2019/02/27 02:20:18 christos Exp $ */ /*- * Copyright (c) 2015 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #include "config.h" #endif #include -__RCSID("$NetBSD: blacklistd.c,v 1.37 2017/02/18 00:26:16 christos Exp $"); +__RCSID("$NetBSD: blacklistd.c,v 1.38 2019/02/27 02:20:18 christos Exp $"); #include #include @@ -408,7 +408,6 @@ rules_restore(void) for (f = 1; state_iterate(state, &c, &dbi, f) == 1; f = 0) { if (dbi.id[0] == '\0') continue; - (void)run_change("rem", &c, dbi.id, 0); (void)run_change("add", &c, dbi.id, sizeof(dbi.id)); } } @@ -505,7 +504,8 @@ main(int argc, char *argv[]) conf_parse(configfile); if (flush) { rules_flush(); - flags |= O_TRUNC; + if (!restore) + flags |= O_TRUNC; } struct pollfd *pfd = NULL; @@ -536,8 +536,11 @@ main(int argc, char *argv[]) if (state == NULL) return EXIT_FAILURE; - if (restore) + if (restore) { + if (!flush) + rules_flush(); rules_restore(); + } if (!debug) { if (daemon(0, 0) == -1) Modified: stable/12/contrib/blacklist/bin/blacklistd.conf.5 ============================================================================== --- stable/12/contrib/blacklist/bin/blacklistd.conf.5 Wed Feb 5 17:21:36 2020 (r357580) +++ stable/12/contrib/blacklist/bin/blacklistd.conf.5 Wed Feb 5 18:24:28 2020 (r357581) @@ -1,4 +1,4 @@ -.\" $NetBSD: blacklistd.conf.5,v 1.5 2016/06/08 12:48:37 wiz Exp $ +.\" $NetBSD: blacklistd.conf.5,v 1.7 2017/06/07 13:50:57 wiz Exp $ .\" .\" Copyright (c) 2015 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 7, 2016 +.Dd June 5, 2017 .Dt BLACKLISTD.CONF 5 .Os .Sh NAME @@ -36,12 +36,13 @@ .Sh DESCRIPTION The .Nm -files contains configuration lines for -.Xr blacklistd 8 . -It contains one entry per line, and is similar to +files contains configuration entries for +.Xr blacklistd 8 +in a fashion similar to .Xr inetd.conf 5 . -There must be an entry for each field of the configuration file, with -entries for each field separated by a tab or a space. +Only one entry per line is permitted. +Every entry must have all fields populated. +Each field can be separated by a tab or a space. Comments are denoted by a .Dq # at the beginning of a line. @@ -109,7 +110,7 @@ The can be an IPv4 address in numeric format, an IPv6 address in numeric format and enclosed by square brackets, or an interface name. Mask modifiers are not allowed on interfaces because interfaces -have multiple address in different protocols where the mask has a different +can have multiple addresses in different protocols where the mask has a different size. .Pp The @@ -150,8 +151,8 @@ If the contains a .Dq / , the remaining portion of the name is interpreted as the mask to be -applied to the address specified in the rule, so one can block whole -subnets for a single rule violation. +applied to the address specified in the rule, causing a single rule violation to +block the entire subnet for the configured prefix. .Pp The .Va nfail @@ -176,10 +177,11 @@ for days. .Pp Matching is done first by checking the .Va local -rules one by one, from the most specific to the least specific. +rules individually, in the order of the most specific to the least specific. If a match is found, then the .Va remote -rules are applied, and if a match is found the +rules are applied. +The .Va name , .Va nfail , and @@ -191,15 +193,15 @@ rule that matched. The .Va remote rules can be used for whitelisting specific addresses, changing the mask -size, or the rule that the packet filter uses, the number of failed attempts, -or the blocked duration. +size, the rule that the packet filter uses, the number of failed attempts, +or the block duration. .Sh FILES .Bl -tag -width /etc/blacklistd.conf -compact .It Pa /etc/blacklistd.conf Configuration file. .El .Sh EXAMPLES -.Bd -literal -offset +.Bd -literal -offset 8n # Block ssh, after 3 attempts for 6 hours on the bnx0 interface [local] # location type proto owner name nfail duration Modified: stable/12/contrib/blacklist/bin/support.c ============================================================================== --- stable/12/contrib/blacklist/bin/support.c Wed Feb 5 17:21:36 2020 (r357580) +++ stable/12/contrib/blacklist/bin/support.c Wed Feb 5 18:24:28 2020 (r357581) @@ -1,4 +1,4 @@ -/* $NetBSD: support.c,v 1.8 2016/04/04 15:52:56 christos Exp $ */ +/* $NetBSD: support.c,v 1.9 2018/09/18 22:12:19 christos Exp $ */ /*- * Copyright (c) 2015 The NetBSD Foundation, Inc. @@ -33,7 +33,7 @@ #endif #include -__RCSID("$NetBSD: support.c,v 1.8 2016/04/04 15:52:56 christos Exp $"); +__RCSID("$NetBSD: support.c,v 1.9 2018/09/18 22:12:19 christos Exp $"); #include #include @@ -105,12 +105,16 @@ fmtydhms(char *b, size_t l, time_t t) s = t % 60; t /= 60; + m = t % 60; t /= 60; - h = t % 60; + + h = t % 24; t /= 24; - d = t % 24; - t /= 356; + + d = t % 365; + t /= 365; + y = t; z = 0; Modified: stable/12/contrib/blacklist/diff/ssh.diff ============================================================================== --- stable/12/contrib/blacklist/diff/ssh.diff Wed Feb 5 17:21:36 2020 (r357580) +++ stable/12/contrib/blacklist/diff/ssh.diff Wed Feb 5 18:24:28 2020 (r357581) @@ -1,6 +1,6 @@ --- /dev/null 2015-01-22 23:10:33.000000000 -0500 +++ dist/pfilter.c 2015-01-22 23:46:03.000000000 -0500 -@@ -0,0 +1,28 @@ +@@ -0,0 +1,32 @@ +#include "namespace.h" +#include "includes.h" +#include "ssh.h" @@ -28,6 +28,10 @@ + // XXX: 3? + fd = packet_connection_is_on_socket() ? packet_get_connection_in() : 3; + (void)blacklist_r(blstate, a, fd, "ssh"); ++ if (a == 0) { ++ blacklist_close(blstate); ++ blstate = NULL; ++ } +} --- /dev/null 2015-01-20 21:14:44.000000000 -0500 +++ dist/pfilter.h 2015-01-20 20:16:20.000000000 -0500 @@ -58,174 +62,89 @@ diff -u -u -r1.10 Makefile + +LDADD+= -lblacklist +DPADD+= ${LIBBLACKLIST} -Index: dist/auth.c -=================================================================== -RCS file: /cvsroot/src/crypto/external/bsd/openssh/dist/auth.c,v -retrieving revision 1.10 -diff -u -u -r1.10 auth.c ---- dist/auth.c 19 Oct 2014 16:30:58 -0000 1.10 -+++ dist/auth.c 22 Jan 2015 21:39:22 -0000 -@@ -62,6 +62,7 @@ - #include "monitor_wrap.h" - #include "krl.h" - #include "compat.h" -+#include "pfilter.h" - - #ifdef HAVE_LOGIN_CAP - #include -@@ -362,6 +363,8 @@ - compat20 ? "ssh2" : "ssh1", - authctxt->info != NULL ? ": " : "", - authctxt->info != NULL ? authctxt->info : ""); -+ if (!authctxt->postponed) -+ pfilter_notify(!authenticated); - free(authctxt->info); - authctxt->info = NULL; - } -Index: dist/sshd.c -=================================================================== -RCS file: /cvsroot/src/crypto/external/bsd/openssh/dist/sshd.c,v -retrieving revision 1.15 -diff -u -u -r1.15 sshd.c ---- dist/sshd.c 28 Oct 2014 21:36:16 -0000 1.15 -+++ dist/sshd.c 22 Jan 2015 21:39:22 -0000 -@@ -109,6 +109,7 @@ - #include "roaming.h" - #include "ssh-sandbox.h" - #include "version.h" -+#include "pfilter.h" - - #ifdef LIBWRAP - #include -@@ -364,6 +365,7 @@ - killpg(0, SIGTERM); - } - -+ pfilter_notify(1); - /* Log error and exit. */ - sigdie("Timeout before authentication for %s", get_remote_ipaddr()); - } -@@ -1160,6 +1162,7 @@ - for (i = 0; i < options.max_startups; i++) - startup_pipes[i] = -1; - -+ pfilter_init(); - /* - * Stay listening for connections until the system crashes or - * the daemon is killed with a signal. -Index: auth1.c -=================================================================== -RCS file: /cvsroot/src/crypto/external/bsd/openssh/dist/auth1.c,v -retrieving revision 1.9 -diff -u -u -r1.9 auth1.c ---- auth1.c 19 Oct 2014 16:30:58 -0000 1.9 -+++ auth1.c 14 Feb 2015 15:40:51 -0000 -@@ -41,6 +41,7 @@ +diff -ru openssh-7.7p1/auth-pam.c dist/auth-pam.c +--- openssh-7.7p1/auth-pam.c 2018-04-02 01:38:28.000000000 -0400 ++++ dist/auth-pam.c 2018-05-23 11:56:22.206661484 -0400 +@@ -103,6 +103,7 @@ + #include "ssh-gss.h" #endif #include "monitor_wrap.h" - #include "buffer.h" +#include "pfilter.h" - /* import */ extern ServerOptions options; -@@ -445,6 +446,7 @@ - else { - debug("do_authentication: invalid user %s", user); - authctxt->pw = fakepw(); -+ pfilter_notify(1); - } + extern Buffer loginmsg; +@@ -526,6 +527,7 @@ + ssh_msg_send(ctxt->pam_csock, PAM_MAXTRIES, &buffer); + else + ssh_msg_send(ctxt->pam_csock, PAM_AUTH_ERR, &buffer); ++ pfilter_notify(1); + buffer_free(&buffer); + pthread_exit(NULL); - /* Configuration may have changed as a result of Match */ -Index: auth2.c -=================================================================== -RCS file: /cvsroot/src/crypto/external/bsd/openssh/dist/auth2.c,v -retrieving revision 1.9 -diff -u -u -r1.9 auth2.c ---- auth2.c 19 Oct 2014 16:30:58 -0000 1.9 -+++ auth2.c 14 Feb 2015 15:40:51 -0000 -@@ -52,6 +52,7 @@ +@@ -804,6 +806,7 @@ + free(msg); + return (0); + } ++ pfilter_notify(1); + error("PAM: %s for %s%.100s from %.100s", msg, + sshpam_authctxt->valid ? "" : "illegal user ", + sshpam_authctxt->user, +diff -ru openssh-7.7p1/auth2.c dist/auth2.c +--- openssh-7.7p1/auth2.c 2018-04-02 01:38:28.000000000 -0400 ++++ dist/auth2.c 2018-05-23 11:57:31.022197317 -0400 +@@ -51,6 +51,7 @@ + #include "dispatch.h" #include "pathnames.h" #include "buffer.h" - #include "canohost.h" +#include "pfilter.h" #ifdef GSSAPI #include "ssh-gss.h" -@@ -256,6 +257,7 @@ +@@ -242,6 +243,7 @@ } else { - logit("input_userauth_request: invalid user %s", user); + /* Invalid user, fake password information */ authctxt->pw = fakepw(); + pfilter_notify(1); - } - #ifdef USE_PAM - if (options.use_pam) -Index: sshd.c -=================================================================== -RCS file: /cvsroot/src/crypto/external/bsd/openssh/dist/sshd.c,v -retrieving revision 1.16 -diff -u -r1.16 sshd.c ---- sshd.c 25 Jan 2015 15:52:44 -0000 1.16 -+++ sshd.c 14 Feb 2015 09:55:06 -0000 -@@ -628,6 +628,8 @@ - explicit_bzero(pw->pw_passwd, strlen(pw->pw_passwd)); - endpwent(); - -+ pfilter_init(); -+ - /* Change our root directory */ - if (chroot(_PATH_PRIVSEP_CHROOT_DIR) == -1) - fatal("chroot(\"%s\"): %s", _PATH_PRIVSEP_CHROOT_DIR, - -Index: auth-pam.c -=================================================================== -RCS file: /cvsroot/src/crypto/external/bsd/openssh/dist/auth-pam.c,v -retrieving revision 1.7 -diff -u -u -r1.7 auth-pam.c ---- auth-pam.c 3 Jul 2015 00:59:59 -0000 1.7 -+++ auth-pam.c 23 Jan 2016 00:01:16 -0000 -@@ -114,6 +114,7 @@ - #include "ssh-gss.h" + #ifdef SSH_AUDIT_EVENTS + PRIVSEP(audit_event(SSH_INVALID_USER)); #endif - #include "monitor_wrap.h" +Only in dist: pfilter.c +Only in dist: pfilter.h +diff -ru openssh-7.7p1/sshd.c dist/sshd.c +--- openssh-7.7p1/sshd.c 2018-04-02 01:38:28.000000000 -0400 ++++ dist/sshd.c 2018-05-23 11:59:39.573197347 -0400 +@@ -122,6 +122,7 @@ + #include "auth-options.h" + #include "version.h" + #include "ssherr.h" +#include "pfilter.h" - extern ServerOptions options; - extern Buffer loginmsg; -@@ -809,6 +810,7 @@ - free(msg); - return (0); - } -+ pfilter_notify(1); - error("PAM: %s for %s%.100s from %.100s", msg, - sshpam_authctxt->valid ? "" : "illegal user ", - sshpam_authctxt->user, -Index: auth.c -=================================================================== -RCS file: /cvsroot/src/crypto/external/bsd/openssh/dist/auth.c,v -retrieving revision 1.15 -diff -u -u -r1.15 auth.c ---- auth.c 21 Aug 2015 08:20:59 -0000 1.15 -+++ auth.c 23 Jan 2016 00:01:16 -0000 -@@ -656,6 +656,7 @@ + /* Re-exec fds */ + #define REEXEC_DEVCRYPTO_RESERVED_FD (STDERR_FILENO + 1) +@@ -346,6 +347,7 @@ + static void + grace_alarm_handler(int sig) + { ++ pfilter_notify(1); + if (use_privsep && pmonitor != NULL && pmonitor->m_pid > 0) + kill(pmonitor->m_pid, SIGALRM); - pw = getpwnam(user); - if (pw == NULL) { -+ pfilter_notify(1); - logit("Invalid user %.100s from %.100s", - user, get_remote_ipaddr()); - return (NULL); -Index: auth1.c -=================================================================== -RCS file: /cvsroot/src/crypto/external/bsd/openssh/dist/auth1.c,v -retrieving revision 1.12 -diff -u -u -r1.12 auth1.c ---- auth1.c 3 Jul 2015 00:59:59 -0000 1.12 -+++ auth1.c 23 Jan 2016 00:01:16 -0000 -@@ -376,6 +376,7 @@ - char *msg; - size_t len; +@@ -1835,6 +1837,8 @@ + if (test_flag) + exit(0); -+ pfilter_notify(1); - error("Access denied for user %s by PAM account " - "configuration", authctxt->user); - len = buffer_len(&loginmsg); ++ pfilter_init(); ++ + /* + * Clear out any supplemental groups we may have inherited. This + * prevents inadvertent creation of files with bad modes (in the +@@ -2280,6 +2284,9 @@ + { + struct ssh *ssh = active_state; /* XXX */ + ++ if (i == 255) ++ pfilter_notify(1); ++ + if (the_authctxt) { + do_cleanup(ssh, the_authctxt); + if (use_privsep && privsep_is_preauth && Modified: stable/12/contrib/blacklist/lib/Makefile ============================================================================== --- stable/12/contrib/blacklist/lib/Makefile Wed Feb 5 17:21:36 2020 (r357580) +++ stable/12/contrib/blacklist/lib/Makefile Wed Feb 5 18:24:28 2020 (r357581) @@ -1,11 +1,11 @@ -# $NetBSD: Makefile,v 1.6 2016/01/05 13:07:46 christos Exp $ +# $NetBSD: Makefile,v 1.7 2019/03/08 20:40:05 christos Exp $ .include USE_SHLIBDIR= yes CPPFLAGS+=-D_REENTRANT -LIBDPLIBS+=pthread ${NETBSDSRCDIR}/lib/libpthread +#LIBDPLIBS+=pthread ${NETBSDSRCDIR}/lib/libpthread LIB=blacklist SRCS=bl.c blacklist.c MAN=libblacklist.3 Modified: stable/12/contrib/blacklist/lib/libblacklist.3 ============================================================================== --- stable/12/contrib/blacklist/lib/libblacklist.3 Wed Feb 5 17:21:36 2020 (r357580) +++ stable/12/contrib/blacklist/lib/libblacklist.3 Wed Feb 5 18:24:28 2020 (r357581) @@ -1,4 +1,4 @@ -.\" $NetBSD: libblacklist.3,v 1.7 2017/02/04 23:33:56 wiz Exp $ +.\" $NetBSD: libblacklist.3,v 1.8 2017/10/22 10:31:57 abhinav Exp $ .\" .\" Copyright (c) 2015 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -35,7 +35,7 @@ .Nm blacklist_close , .Nm blacklist_r , .Nm blacklist , -.Nm blacklist_sa +.Nm blacklist_sa , .Nm blacklist_sa_r .Nd Blacklistd notification library .Sh LIBRARY From owner-svn-src-all@freebsd.org Wed Feb 5 18:26:51 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 54A65229148; Wed, 5 Feb 2020 18:26:51 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CVQM1X7Xz3PnL; Wed, 5 Feb 2020 18:26:51 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2F9826E13; Wed, 5 Feb 2020 18:26:51 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 015IQp1j015439; Wed, 5 Feb 2020 18:26:51 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 015IQp50015438; Wed, 5 Feb 2020 18:26:51 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202002051826.015IQp50015438@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 5 Feb 2020 18:26:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r357582 - stable/10/lib/libfetch X-SVN-Group: stable-10 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/10/lib/libfetch X-SVN-Commit-Revision: 357582 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 18:26:51 -0000 Author: emaste Date: Wed Feb 5 18:26:50 2020 New Revision: 357582 URL: https://svnweb.freebsd.org/changeset/base/357582 Log: MFC r357212: libfetch: fix urldecode buffer overrun Reported by: Duncan Overbruck Security: CVE-2020-7450 Modified: stable/10/lib/libfetch/fetch.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libfetch/fetch.c ============================================================================== --- stable/10/lib/libfetch/fetch.c Wed Feb 5 18:24:28 2020 (r357581) +++ stable/10/lib/libfetch/fetch.c Wed Feb 5 18:26:50 2020 (r357582) @@ -328,6 +328,8 @@ fetch_pctdecode(char *dst, const char *src, size_t dle } if (dlen-- > 0) *dst++ = c; + else + return (NULL); } return (s); } @@ -375,11 +377,15 @@ fetchParseURL(const char *URL) if (p && *p == '@') { /* username */ q = fetch_pctdecode(u->user, URL, URL_USERLEN); + if (q == NULL) + goto ouch; /* password */ - if (*q == ':') + if (*q == ':') { q = fetch_pctdecode(u->pwd, q + 1, URL_PWDLEN); - + if (q == NULL) + goto ouch; + } p++; } else { p = URL; From owner-svn-src-all@freebsd.org Wed Feb 5 18:35:18 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D58A8229473; Wed, 5 Feb 2020 18:35:18 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CVc6560Gz3QDw; Wed, 5 Feb 2020 18:35:18 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA7606FDF; Wed, 5 Feb 2020 18:35:18 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 015IZIXr021299; Wed, 5 Feb 2020 18:35:18 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 015IZIK8021298; Wed, 5 Feb 2020 18:35:18 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202002051835.015IZIK8021298@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 5 Feb 2020 18:35:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r357583 - vendor/NetBSD/tests/dist/lib/libc/c063 X-SVN-Group: vendor X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: vendor/NetBSD/tests/dist/lib/libc/c063 X-SVN-Commit-Revision: 357583 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 18:35:18 -0000 Author: kevans Date: Wed Feb 5 18:35:18 2020 New Revision: 357583 URL: https://svnweb.freebsd.org/changeset/base/357583 Log: netbsd-tests: import recently upstreamed O_SEARCH test fixes Modified: vendor/NetBSD/tests/dist/lib/libc/c063/t_o_search.c Modified: vendor/NetBSD/tests/dist/lib/libc/c063/t_o_search.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libc/c063/t_o_search.c Wed Feb 5 18:26:50 2020 (r357582) +++ vendor/NetBSD/tests/dist/lib/libc/c063/t_o_search.c Wed Feb 5 18:35:18 2020 (r357583) @@ -1,4 +1,4 @@ -/* $NetBSD: t_o_search.c,v 1.5 2017/01/10 22:25:01 christos Exp $ */ +/* $NetBSD: t_o_search.c,v 1.8 2020/02/05 17:13:24 martin Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_o_search.c,v 1.5 2017/01/10 22:25:01 christos Exp $"); +__RCSID("$NetBSD: t_o_search.c,v 1.8 2020/02/05 17:13:24 martin Exp $"); #include @@ -79,7 +79,7 @@ ATF_TC_BODY(o_search_perm1, tc) ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1); ATF_REQUIRE(close(fd) == 0); - ATF_REQUIRE(fchmod(dfd, 644) == 0); + ATF_REQUIRE(fchmod(dfd, 0644) == 0); ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) == -1); ATF_REQUIRE(errno == EACCES); @@ -109,12 +109,12 @@ ATF_TC_BODY(o_search_root_flag1, tc) ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1); ATF_REQUIRE(close(fd) == 0); - ATF_REQUIRE(fchmod(dfd, 644) == 0); + ATF_REQUIRE(fchmod(dfd, 0644) == 0); ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1); ATF_REQUIRE(close(fd) == 0); - ATF_REQUIRE(fchmod(dfd, 444) == 0); + ATF_REQUIRE(fchmod(dfd, 0444) == 0); ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1); @@ -141,12 +141,12 @@ ATF_TC_BODY(o_search_unpriv_flag1, tc) ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1); ATF_REQUIRE(close(fd) == 0); - ATF_REQUIRE(fchmod(dfd, 644) == 0); + ATF_REQUIRE(fchmod(dfd, 0644) == 0); ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1); ATF_REQUIRE(close(fd) == 0); - ATF_REQUIRE(fchmod(dfd, 444) == 0); + ATF_REQUIRE(fchmod(dfd, 0444) == 0); ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1); @@ -173,7 +173,7 @@ ATF_TC_BODY(o_search_perm2, tc) ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == 0); - ATF_REQUIRE(fchmod(dfd, 644) == 0); + ATF_REQUIRE(fchmod(dfd, 0644) == 0); ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == -1); ATF_REQUIRE(errno == EACCES); @@ -202,11 +202,11 @@ ATF_TC_BODY(o_search_root_flag2, tc) ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == 0); - ATF_REQUIRE(fchmod(dfd, 644) == 0); + ATF_REQUIRE(fchmod(dfd, 0644) == 0); ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == 0); - ATF_REQUIRE(fchmod(dfd, 444) == 0); + ATF_REQUIRE(fchmod(dfd, 0444) == 0); ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == 0); @@ -232,11 +232,11 @@ ATF_TC_BODY(o_search_unpriv_flag2, tc) ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == 0); - ATF_REQUIRE(fchmod(dfd, 644) == 0); + ATF_REQUIRE(fchmod(dfd, 0644) == 0); ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == 0); - ATF_REQUIRE(fchmod(dfd, 444) == 0); + ATF_REQUIRE(fchmod(dfd, 0444) == 0); ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == 0); @@ -257,9 +257,10 @@ ATF_TC_BODY(o_search_notdir, tc) int fd; ATF_REQUIRE(mkdir(DIR, 0755) == 0); - ATF_REQUIRE((dfd = open(FILE, O_CREAT|O_RDWR|O_SEARCH, 0644)) != -1); + ATF_REQUIRE((dfd = open(FILE, O_CREAT|O_SEARCH, 0644)) != -1); ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) == -1); ATF_REQUIRE(errno == ENOTDIR); + ATF_REQUIRE(close(dfd) == 0); } ATF_TP_ADD_TCS(tp) From owner-svn-src-all@freebsd.org Wed Feb 5 18:38:08 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A688D2295D1; Wed, 5 Feb 2020 18:38:08 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CVgN3xQTz3QTW; Wed, 5 Feb 2020 18:38:08 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6859A6FE4; Wed, 5 Feb 2020 18:38:08 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 015Ic8qO021770; Wed, 5 Feb 2020 18:38:08 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 015Ic8IP021769; Wed, 5 Feb 2020 18:38:08 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202002051838.015Ic8IP021769@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 5 Feb 2020 18:38:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357584 - head/contrib/netbsd-tests X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/contrib/netbsd-tests X-SVN-Commit-Revision: 357584 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 18:38:08 -0000 Author: kevans Date: Wed Feb 5 18:38:07 2020 New Revision: 357584 URL: https://svnweb.freebsd.org/changeset/base/357584 Log: Record-only MFV of r357583: netbsd-tests: import upstreamed changes The changes in question originated in FreeBSD/head; no further action is required. Modified: Directory Properties: head/contrib/netbsd-tests/ (props changed) From owner-svn-src-all@freebsd.org Wed Feb 5 19:06:06 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9AF7022AE52; Wed, 5 Feb 2020 19:06:06 +0000 (UTC) (envelope-from andrew@tao11.riddles.org.uk) Received: from lungold.riddles.org.uk (lungold.riddles.org.uk [82.68.208.19]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48CWHd5ZcHz40jZ; Wed, 5 Feb 2020 19:06:05 +0000 (UTC) (envelope-from andrew@tao11.riddles.org.uk) Received: from [192.168.127.1] (port=65054 helo=caithnard.riddles.org.uk) by lungold.riddles.org.uk with esmtp (Exim 4.92.3 (FreeBSD)) (envelope-from ) id 1izPzo-0008Jw-A7; Wed, 05 Feb 2020 19:05:56 +0000 Received: from localhost ([127.0.0.1]:31633 helo=caithnard.riddles.org.uk) by caithnard.riddles.org.uk with esmtp (Exim 4.92.3 (FreeBSD)) (envelope-from ) id 1izPzn-0002gN-KS; Wed, 05 Feb 2020 19:05:55 +0000 From: Andrew Gierth To: Kyle Evans Cc: Ian Lepore , src-committers , svn-src-all , svn-src-head , sigsys@gmail.com Subject: Re: svn commit: r357566 - head In-Reply-To: (Kyle Evans's message of "Wed, 5 Feb 2020 11:26:46 -0600") Message-ID: <874kw4ooqw.fsf@news-spur.riddles.org.uk> References: <202002050443.0154hwPl091233@repo.freebsd.org> <1c19eca5b40aa7b70b0c18b7b52b540671cc50dd.camel@freebsd.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (berkeley-unix) Date: Wed, 05 Feb 2020 19:05:55 +0000 MIME-Version: 1.0 Content-Type: text/plain X-Rspamd-Queue-Id: 48CWHd5ZcHz40jZ X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of andrew@tao11.riddles.org.uk has no SPF policy when checking 82.68.208.19) smtp.mailfrom=andrew@tao11.riddles.org.uk X-Spamd-Result: default: False [-1.07 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.97)[-0.974,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-0.77)[-0.767,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[riddles.org.uk]; AUTH_NA(1.00)[]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:13037, ipnet:82.68.0.0/14, country:GB]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-0.23)[ipnet: 82.68.0.0/14(-0.39), asn: 13037(-0.69), country: GB(-0.08)] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 19:06:06 -0000 >>>>> "Kyle" == Kyle Evans writes: >> Unfortunately, the utility of this cool series of changes is mostly >> destroyed by the fact that PATH is the variable that could be most >> usefully set in login.conf for running daemons, specifically because >> it is set in 3 separate places now. Kyle> It is (and has been) set in each of them respectively, but the Kyle> submitter (along with sigsys@gmail.com) have some idea to accept Kyle> a hint in cron (and perhaps the others) from login.conf that it Kyle> should accept PATH as well unless it's been explicitly set in the Kyle> executing job. Kyle> I've CC'd these two so they can expand on that or discuss as Kyle> needed. I'd be quite happy to go along with a proposal to unconditionally set PATH from login.conf in cron and elsewhere. (The idea of having a flag for it is just to avoid changing existing PATH behavior without an explicit admin choice, to head off arguments about security. If that's not an issue, then no need for the flag.) -- Andrew. From owner-svn-src-all@freebsd.org Wed Feb 5 19:08:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F1F8522AF3E; Wed, 5 Feb 2020 19:08:22 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CWLG4x7qz40s2; Wed, 5 Feb 2020 19:08:22 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A48097582; Wed, 5 Feb 2020 19:08:22 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 015J8MVY043755; Wed, 5 Feb 2020 19:08:22 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 015J8LC6043749; Wed, 5 Feb 2020 19:08:21 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202002051908.015J8LC6043749@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 5 Feb 2020 19:08:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357585 - in head/sys: amd64/include arm/include arm64/include i386/include powerpc/include riscv/include X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: amd64/include arm/include arm64/include i386/include powerpc/include riscv/include X-SVN-Commit-Revision: 357585 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 19:08:23 -0000 Author: markj Date: Wed Feb 5 19:08:21 2020 New Revision: 357585 URL: https://svnweb.freebsd.org/changeset/base/357585 Log: Define MAXCPU consistently between the kernel and KLDs. This reverts r177661. The change is no longer very useful since out-of-tree KLDs will be built to target SMP kernels anyway. Moveover it breaks the KBI in !SMP builds since cpuset_t's layout depends on the value of MAXCPU, and several kernel interfaces, notably smp_rendezvous_cpus(), take a cpuset_t as a parameter. PR: 243711 Reviewed by: jhb, kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D23512 Modified: head/sys/amd64/include/param.h head/sys/arm/include/param.h head/sys/arm64/include/param.h head/sys/i386/include/param.h head/sys/powerpc/include/param.h head/sys/riscv/include/param.h Modified: head/sys/amd64/include/param.h ============================================================================== --- head/sys/amd64/include/param.h Wed Feb 5 18:38:07 2020 (r357584) +++ head/sys/amd64/include/param.h Wed Feb 5 19:08:21 2020 (r357585) @@ -65,7 +65,7 @@ #define MACHINE_ARCH32 "i386" #endif -#if defined(SMP) || defined(KLD_MODULE) +#ifdef SMP #ifndef MAXCPU #define MAXCPU 256 #endif Modified: head/sys/arm/include/param.h ============================================================================== --- head/sys/arm/include/param.h Wed Feb 5 18:38:07 2020 (r357584) +++ head/sys/arm/include/param.h Wed Feb 5 19:08:21 2020 (r357585) @@ -75,13 +75,13 @@ #define MACHINE_ARCH "arm" _V_SUFFIX _EB_SUFFIX #endif -#if defined(SMP) || defined(KLD_MODULE) +#ifdef SMP #ifndef MAXCPU #define MAXCPU 4 #endif #else #define MAXCPU 1 -#endif /* SMP || KLD_MODULE */ +#endif #ifndef MAXMEMDOM #define MAXMEMDOM 1 Modified: head/sys/arm64/include/param.h ============================================================================== --- head/sys/arm64/include/param.h Wed Feb 5 18:38:07 2020 (r357584) +++ head/sys/arm64/include/param.h Wed Feb 5 19:08:21 2020 (r357585) @@ -54,13 +54,13 @@ #define MACHINE_ARCH32 "armv7" #endif -#if defined(SMP) || defined(KLD_MODULE) +#ifdef SMP #ifndef MAXCPU #define MAXCPU 256 #endif #else #define MAXCPU 1 -#endif /* SMP || KLD_MODULE */ +#endif #ifndef MAXMEMDOM #define MAXMEMDOM 2 Modified: head/sys/i386/include/param.h ============================================================================== --- head/sys/i386/include/param.h Wed Feb 5 18:38:07 2020 (r357584) +++ head/sys/i386/include/param.h Wed Feb 5 19:08:21 2020 (r357585) @@ -58,13 +58,13 @@ #endif #define MID_MACHINE MID_I386 -#if defined(SMP) || defined(KLD_MODULE) +#ifdef SMP #ifndef MAXCPU #define MAXCPU 32 #endif #else #define MAXCPU 1 -#endif /* SMP || KLD_MODULE */ +#endif #ifndef MAXMEMDOM #define MAXMEMDOM 1 Modified: head/sys/powerpc/include/param.h ============================================================================== --- head/sys/powerpc/include/param.h Wed Feb 5 18:38:07 2020 (r357584) +++ head/sys/powerpc/include/param.h Wed Feb 5 19:08:21 2020 (r357585) @@ -73,13 +73,13 @@ #endif #endif -#if defined(SMP) || defined(KLD_MODULE) +#ifdef SMP #ifndef MAXCPU #define MAXCPU 256 #endif #else #define MAXCPU 1 -#endif /* SMP || KLD_MODULE */ +#endif #ifndef MAXMEMDOM #define MAXMEMDOM 8 Modified: head/sys/riscv/include/param.h ============================================================================== --- head/sys/riscv/include/param.h Wed Feb 5 18:38:07 2020 (r357584) +++ head/sys/riscv/include/param.h Wed Feb 5 19:08:21 2020 (r357585) @@ -49,13 +49,13 @@ #define MACHINE_ARCH "riscv64" #endif -#if defined(SMP) || defined(KLD_MODULE) +#ifdef SMP #ifndef MAXCPU #define MAXCPU 16 #endif #else #define MAXCPU 1 -#endif /* SMP || KLD_MODULE */ +#endif #ifndef MAXMEMDOM #define MAXMEMDOM 1 From owner-svn-src-all@freebsd.org Wed Feb 5 19:08:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6D13222AFBE; Wed, 5 Feb 2020 19:08:46 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CWLk2CWWz4113; Wed, 5 Feb 2020 19:08:46 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 46FD0758C; Wed, 5 Feb 2020 19:08:46 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 015J8kuB043827; Wed, 5 Feb 2020 19:08:46 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 015J8jCV043825; Wed, 5 Feb 2020 19:08:45 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202002051908.015J8jCV043825@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 5 Feb 2020 19:08:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357586 - in head/sys/modules/dtrace: dtrace fasttrap X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys/modules/dtrace: dtrace fasttrap X-SVN-Commit-Revision: 357586 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 19:08:46 -0000 Author: markj Date: Wed Feb 5 19:08:45 2020 New Revision: 357586 URL: https://svnweb.freebsd.org/changeset/base/357586 Log: Stop compiling dtrace modules with -DSMP. I believe this is left over from when dtrace was being ported and developed out-of-tree. Now it just ensures that dtrace.ko and a non-SMP kernel have incompatible KBIs. PR: 243711 Sponsored by: The FreeBSD Foundation Modified: head/sys/modules/dtrace/dtrace/Makefile head/sys/modules/dtrace/fasttrap/Makefile Modified: head/sys/modules/dtrace/dtrace/Makefile ============================================================================== --- head/sys/modules/dtrace/dtrace/Makefile Wed Feb 5 19:08:21 2020 (r357585) +++ head/sys/modules/dtrace/dtrace/Makefile Wed Feb 5 19:08:45 2020 (r357586) @@ -47,8 +47,6 @@ CFLAGS+= -I${SYSDIR}/cddl/compat/opensolaris \ -I${SYSDIR}/cddl/contrib/opensolaris/common/util \ -I${SYSDIR} -DDIS_MEM -CFLAGS+= -DSMP - EXPORT_SYMS= dtrace_register \ dtrace_unregister \ dtrace_probe_lookup Modified: head/sys/modules/dtrace/fasttrap/Makefile ============================================================================== --- head/sys/modules/dtrace/fasttrap/Makefile Wed Feb 5 19:08:21 2020 (r357585) +++ head/sys/modules/dtrace/fasttrap/Makefile Wed Feb 5 19:08:45 2020 (r357586) @@ -24,8 +24,6 @@ CFLAGS+= -I${SYSDIR}/cddl/contrib/opensolaris/uts/powe .PATH: ${SYSDIR}/cddl/contrib/opensolaris/common/unicode SRCS+= u8_textprep.c -CFLAGS+= -DSMP - .include CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h From owner-svn-src-all@freebsd.org Wed Feb 5 19:11:08 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3617522B07A; Wed, 5 Feb 2020 19:11:08 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CWPS0jdjz41HY; Wed, 5 Feb 2020 19:11:08 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 13BA275CA; Wed, 5 Feb 2020 19:11:08 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 015JB7f8045424; Wed, 5 Feb 2020 19:11:07 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 015JB7WG045423; Wed, 5 Feb 2020 19:11:07 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <202002051911.015JB7WG045423@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 5 Feb 2020 19:11:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357587 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 357587 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 19:11:08 -0000 Author: pfg Date: Wed Feb 5 19:11:07 2020 New Revision: 357587 URL: https://svnweb.freebsd.org/changeset/base/357587 Log: ethernet: Add a couple more Ethertypes. Powerlink and Sercos III are used in automation. Both have been standardized and In the case of Ethernet Powerlink there is a BSD-licensed stack. Modified: head/sys/net/ethernet.h Modified: head/sys/net/ethernet.h ============================================================================== --- head/sys/net/ethernet.h Wed Feb 5 19:08:45 2020 (r357586) +++ head/sys/net/ethernet.h Wed Feb 5 19:11:07 2020 (r357587) @@ -356,7 +356,9 @@ struct ether_vlan_header { #define ETHERTYPE_AOE 0x88A2 /* ATA Protocol */ #define ETHERTYPE_ETHERCAT 0x88A4 /* EtherCat Protocol */ #define ETHERTYPE_QINQ 0x88A8 /* 802.1ad VLAN stacking */ +#define ETHERTYPE_POWERLINK 0x88AB /* Ethernet Powerlink (EPL) */ #define ETHERTYPE_LLDP 0x88CC /* Link Layer Discovery Protocol */ +#define ETHERTYPE_SERCOS 0x88CD /* SERCOS III Protocol */ #define ETHERTYPE_MACSEC 0x88E5 /* 802.1AE MAC Security */ #define ETHERTYPE_PBB 0x88E7 /* 802.1Q Provider Backbone Bridges */ #define ETHERTYPE_FCOE 0x8906 /* Fibre Channel over Ethernet */ From owner-svn-src-all@freebsd.org Wed Feb 5 19:15:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7EEE122B2B5; Wed, 5 Feb 2020 19:15:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CWVd2XLDz41Y8; Wed, 5 Feb 2020 19:15:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4D7107757; Wed, 5 Feb 2020 19:15:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 015JFbVP049692; Wed, 5 Feb 2020 19:15:37 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 015JFbqc049691; Wed, 5 Feb 2020 19:15:37 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202002051915.015JFbqc049691@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 5 Feb 2020 19:15:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357588 - head/sys/mips/beri X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/mips/beri X-SVN-Commit-Revision: 357588 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 19:15:37 -0000 Author: emaste Date: Wed Feb 5 19:15:36 2020 New Revision: 357588 URL: https://svnweb.freebsd.org/changeset/base/357588 Log: beri: correct kernel printf typo (From review D23453) Submitted by: Gordon Bergling Reviewed by: rwatson Modified: head/sys/mips/beri/beri_mp.c Modified: head/sys/mips/beri/beri_mp.c ============================================================================== --- head/sys/mips/beri/beri_mp.c Wed Feb 5 19:11:07 2020 (r357587) +++ head/sys/mips/beri/beri_mp.c Wed Feb 5 19:15:36 2020 (r357588) @@ -132,7 +132,7 @@ platform_cpu_mask(cpuset_t *mask) continue; } if (se->entry_addr != 1) { - printf("%s: CPU %d has uninitalized spin " + printf("%s: CPU %d has uninitialized spin " "entry\n", __func__, reg); continue; } From owner-svn-src-all@freebsd.org Wed Feb 5 19:18:04 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D8D0822B404; Wed, 5 Feb 2020 19:18:04 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CWYS5KS1z41l1; Wed, 5 Feb 2020 19:18:04 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 98596775E; Wed, 5 Feb 2020 19:18:04 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 015JI4sM049846; Wed, 5 Feb 2020 19:18:04 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 015JI405049845; Wed, 5 Feb 2020 19:18:04 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202002051918.015JI405049845@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 5 Feb 2020 19:18:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357589 - head/sys/sparc64 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/sparc64 X-SVN-Commit-Revision: 357589 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 19:18:04 -0000 Author: emaste Date: Wed Feb 5 19:18:04 2020 New Revision: 357589 URL: https://svnweb.freebsd.org/changeset/base/357589 Log: delete empty directories after r357455 Deleted: head/sys/sparc64/ From owner-svn-src-all@freebsd.org Wed Feb 5 19:20:05 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4C12022B528; Wed, 5 Feb 2020 19:20:05 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: from mail-qv1-f66.google.com (mail-qv1-f66.google.com [209.85.219.66]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CWbn1P72z41wL; Wed, 5 Feb 2020 19:20:04 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-qv1-f66.google.com with SMTP id o18so1669276qvf.1; Wed, 05 Feb 2020 11:20:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3+rHi1Z7Fry5UGRj3hTCJ0XWaG52Xk+tVIMcVxSPyXg=; b=TtJSqy15C568JLNqZqH0wK8wjGEm3fssDq/4PrlBn6CRP8hwSHCcgzNtLRTwM88BmX Td+xWPf3VUZ3ntj/D3+1G2y2UwfIp2o7nSrvI15Dbok2RyG9ob56RfJcq+Cf+DOKyiWE QIvygnfiVEIuaGqSawUBWFIvvbRK1K8xHCnyArXuclc0/No/girCsI3tw+83tVdg9MuI CQLHT1i6u8iiPP0iybOtt1WAxyMriM9S898SFKBPjcUnZUygAp5aFeap3klav4L19J+A uua69UW8fCXZi2FU3d4XAPq0J34CSgeFr0elG+dgXqD0DNR9dwXyjxIF32Qov7uFTbiR pvvw== X-Gm-Message-State: APjAAAWsbyS3GelYPKALnVf68hqNExhT6LgDLcf5Z55sw8K7240xdIJ1 ywXAtGf115fZY1YOudDYXbnruZhd X-Google-Smtp-Source: APXvYqz7g26BTNwHCQ8FD4l2YE4gcu+Dw9GjLiIUiYscoyrgnTHF9AQ2X8wVd8dl/IEaxVWQsdC4/g== X-Received: by 2002:a0c:fe8e:: with SMTP id d14mr33591498qvs.106.1580930403396; Wed, 05 Feb 2020 11:20:03 -0800 (PST) Received: from mail-qk1-f175.google.com (mail-qk1-f175.google.com. [209.85.222.175]) by smtp.gmail.com with ESMTPSA id d206sm294563qke.66.2020.02.05.11.20.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 05 Feb 2020 11:20:03 -0800 (PST) Received: by mail-qk1-f175.google.com with SMTP id b7so3011710qkl.7; Wed, 05 Feb 2020 11:20:03 -0800 (PST) X-Received: by 2002:a37:9c07:: with SMTP id f7mr35613914qke.103.1580930403107; Wed, 05 Feb 2020 11:20:03 -0800 (PST) MIME-Version: 1.0 References: <202002051908.015J8jCV043825@repo.freebsd.org> In-Reply-To: <202002051908.015J8jCV043825@repo.freebsd.org> From: Kyle Evans Date: Wed, 5 Feb 2020 13:19:51 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r357586 - in head/sys/modules/dtrace: dtrace fasttrap To: Mark Johnston Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 48CWbn1P72z41wL X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 19:20:05 -0000 On Wed, Feb 5, 2020 at 1:08 PM Mark Johnston wrote: > > Author: markj > Date: Wed Feb 5 19:08:45 2020 > New Revision: 357586 > URL: https://svnweb.freebsd.org/changeset/base/357586 > > Log: > Stop compiling dtrace modules with -DSMP. > > I believe this is left over from when dtrace was being ported and > developed out-of-tree. Now it just ensures that dtrace.ko and a non-SMP > kernel have incompatible KBIs. > > PR: 243711 > Sponsored by: The FreeBSD Foundation > This is another one that we should perhaps consider adding to opt_global.h in config.mk for independent builds... I suspect mips is the only primarily-UP arch left, so it probably fits in cleanly with the other mips-excepted defaults. From owner-svn-src-all@freebsd.org Wed Feb 5 19:35:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4A20622BC57; Wed, 5 Feb 2020 19:35:09 +0000 (UTC) (envelope-from sigsys@gmail.com) Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com [IPv6:2607:f8b0:4864:20::72a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CWx734Znz42pl; Wed, 5 Feb 2020 19:35:07 +0000 (UTC) (envelope-from sigsys@gmail.com) Received: by mail-qk1-x72a.google.com with SMTP id g3so3091440qka.1; Wed, 05 Feb 2020 11:35:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=wXeW6uFxa459uTxZN29SPaT++zwynWAyB1nmNU3fiM8=; b=UekfiZRjNCxNk1RPK+el6HTecOYDk7Gr2+9cMg1kqSayCU6HYwqAFv+/zX3X/GVdXF OZ5yJzh0eiD21cdpyZXlqlxp+afICJQb1V2ZK3GSi2Sah70EPu06dldMA/eRhPN1L2gW v4yU8ssPR52tf/oq4eo4GCL2P1Sn+NwLusrLkdvEhUmmQOJShp7ZdNnMLuHBCt6XLRMy Xve9sLYxpkKdMkpmyiYOvnfi4M48xD6TDtO4uwKrtKD4xNcQR4lKboma+oxQA7qhF/Uj XodkpalYiifN8CDfOKFcbNpUSjd39msHuFLx7qmx1t50uBKFRCtMGxP+M5T1Yh1FXKXJ CCDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=wXeW6uFxa459uTxZN29SPaT++zwynWAyB1nmNU3fiM8=; b=dKB6DBEu1ima+O4NYbU2UOh9yJm4ehOSX1sSKPGyfqAwjYjZlBBPlklEclMZuo0lQy H4VeBQ5KqDpNDGU2Ml1ah1Un3ftyid6R6qdt2ivqFzkbNcefZEg5Gs7R396a0DfvAjGi ciUjHbHsEct7MmkXNZ51S+8kbPtZCwsKzSgcZlMVyIlhbG5kxVNvNhf/fVKNRx2eVV8p 6g8mY9PIdmkOPwdQgK71sb/uyEPSBl6DtXQrYfjzZjs7DYjXvd5iCmxMqtR/8K3k3Edo wtGYoFxymI0HCoLBs5FaUsH5+meQLJ9HmP/7ZK5CyECn3ciuXXVYgSxdpCP1AJqBhyAy fhZA== X-Gm-Message-State: APjAAAW96K2cqmEMPIx0XXLLETq0mRqeikoFJxQ1tRDWT/EfMIooIrWn dKx/v1nSAVSKbTg94CquP+UoOtFO X-Google-Smtp-Source: APXvYqwuuosK1WP0a8nViV0KQWdGtU3zqfnqrc6dMG7XmrWY1AslBWzIAYMkzxPgGlmLzvTOjxvDUw== X-Received: by 2002:ae9:e50b:: with SMTP id w11mr35247678qkf.110.1580931306040; Wed, 05 Feb 2020 11:35:06 -0800 (PST) Received: from pavonis.lan ([38.133.25.146]) by smtp.gmail.com with ESMTPSA id b24sm370384qto.71.2020.02.05.11.35.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 05 Feb 2020 11:35:04 -0800 (PST) Subject: Re: svn commit: r357566 - head To: Andrew Gierth , Kyle Evans Cc: Ian Lepore , src-committers , svn-src-all , svn-src-head References: <202002050443.0154hwPl091233@repo.freebsd.org> <1c19eca5b40aa7b70b0c18b7b52b540671cc50dd.camel@freebsd.org> <874kw4ooqw.fsf@news-spur.riddles.org.uk> From: Mathieu Message-ID: <578cece7-90e4-afe3-b6e5-3b0961081942@gmail.com> Date: Wed, 5 Feb 2020 14:35:03 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.4.2 MIME-Version: 1.0 In-Reply-To: <874kw4ooqw.fsf@news-spur.riddles.org.uk> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Rspamd-Queue-Id: 48CWx734Znz42pl X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=UekfiZRj; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of sigsys@gmail.com designates 2607:f8b0:4864:20::72a as permitted sender) smtp.mailfrom=sigsys@gmail.com X-Spamd-Result: default: False [-3.00 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RECEIVED_SPAMHAUS_PBL(0.00)[146.25.133.38.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(0.00)[ip: (-9.26), ipnet: 2607:f8b0::/32(-1.98), asn: 15169(-1.74), country: US(-0.05)]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[a.2.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 19:35:09 -0000 On 2/5/20 2:05 PM, Andrew Gierth wrote: >>>>>> "Kyle" == Kyle Evans writes: > >> Unfortunately, the utility of this cool series of changes is mostly > >> destroyed by the fact that PATH is the variable that could be most > >> usefully set in login.conf for running daemons, specifically because > >> it is set in 3 separate places now. > > Kyle> It is (and has been) set in each of them respectively, but the > Kyle> submitter (along with sigsys@gmail.com) have some idea to accept > Kyle> a hint in cron (and perhaps the others) from login.conf that it > Kyle> should accept PATH as well unless it's been explicitly set in the > Kyle> executing job. > > Kyle> I've CC'd these two so they can expand on that or discuss as > Kyle> needed. > > I'd be quite happy to go along with a proposal to unconditionally set > PATH from login.conf in cron and elsewhere. > > (The idea of having a flag for it is just to avoid changing existing PATH > behavior without an explicit admin choice, to head off arguments about > security. If that's not an issue, then no need for the flag.) > If there are objections to using the "daemon" class's PATH for rc/service, there could be a new "system" class added that inherits from "daemon" configured with the traditional PATH that they override with (i.e. without /usr/local paths).  That would require no other changes to rc/service after modifying them to not always override PATH.  And leave only the cron issue. From owner-svn-src-all@freebsd.org Wed Feb 5 19:39:49 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1063C22BCF6; Wed, 5 Feb 2020 19:39:49 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CX2X6Tynz42yB; Wed, 5 Feb 2020 19:39:48 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BFEC67B48; Wed, 5 Feb 2020 19:39:48 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 015Jdmkk061775; Wed, 5 Feb 2020 19:39:48 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 015JdmPw061774; Wed, 5 Feb 2020 19:39:48 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <202002051939.015JdmPw061774@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Wed, 5 Feb 2020 19:39:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357590 - head/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Commit-Revision: 357590 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 19:39:49 -0000 Author: bdragon Date: Wed Feb 5 19:39:48 2020 New Revision: 357590 URL: https://svnweb.freebsd.org/changeset/base/357590 Log: [PowerPC] [DTrace] Add ELFv2 support in libdtrace PPC64 ELFv2 acts like a "normal" platform in that it no longer needs function descriptors. So, ensure we are only enabling them on ELFv1. Additionally, ELFv2 requires that the ELF header have a nonzero e_flags, so ensure that the synthesized ELF header in dt_link.c is setting it. Reviewed by: jhibbits, markj Approved by: gnn Differential Revision: https://reviews.freebsd.org/D22403 Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Wed Feb 5 19:18:04 2020 (r357589) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Wed Feb 5 19:39:48 2020 (r357590) @@ -687,6 +687,9 @@ dump_elf64(dtrace_hdl_t *dtp, const dof_hdr_t *dof, in #elif defined(__mips__) elf_file.ehdr.e_machine = EM_MIPS; #elif defined(__powerpc64__) +#if defined(_CALL_ELF) && _CALL_ELF == 2 + elf_file.ehdr.e_flags = 2; +#endif elf_file.ehdr.e_machine = EM_PPC64; #elif defined(__sparc) elf_file.ehdr.e_machine = EM_SPARCV9; @@ -1276,7 +1279,7 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *e static const char dt_symfmt[] = "%s%u.%s"; static const char dt_weaksymfmt[] = "%s.%s"; char probename[DTRACE_NAMELEN]; - int fd, i, ndx, eprobe, mod = 0; + int fd, i, ndx, eprobe, uses_funcdesc = 0, mod = 0; Elf *elf = NULL; GElf_Ehdr ehdr; Elf_Scn *scn_rel, *scn_sym, *scn_str, *scn_tgt; @@ -1328,6 +1331,9 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *e emachine1 = emachine2 = EM_MIPS; #elif defined(__powerpc__) emachine1 = emachine2 = EM_PPC64; +#if !defined(_CALL_ELF) || _CALL_ELF == 1 + uses_funcdesc = 1; +#endif #elif defined(__sparc) emachine1 = emachine2 = EM_SPARCV9; #elif defined(__i386) || defined(__amd64) @@ -1473,7 +1479,7 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *e continue; if (dt_symtab_lookup(data_sym, 0, isym, rela.r_offset, - shdr_rel.sh_info, &fsym, (emachine1 == EM_PPC64), + shdr_rel.sh_info, &fsym, uses_funcdesc, elf) != 0) { dt_strtab_destroy(strtab); goto err; @@ -1644,7 +1650,7 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *e if (dt_symtab_lookup(data_sym, osym, isym, rela.r_offset, shdr_rel.sh_info, &fsym, - (emachine1 == EM_PPC64), elf) == 0) { + uses_funcdesc, elf) == 0) { if (fsym.st_name > data_str->d_size) goto err; @@ -1653,7 +1659,7 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *e s = strchr(s, '.') + 1; } else if (dt_symtab_lookup(data_sym, 0, osym, rela.r_offset, shdr_rel.sh_info, &fsym, - (emachine1 == EM_PPC64), elf) == 0) { + uses_funcdesc, elf) == 0) { u_int bind; bind = GELF_ST_BIND(fsym.st_info) == STB_WEAK ? From owner-svn-src-all@freebsd.org Wed Feb 5 20:06:36 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3FED122C9E0; Wed, 5 Feb 2020 20:06:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CXdS0w1Jz44Xb; Wed, 5 Feb 2020 20:06:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 198D480E0; Wed, 5 Feb 2020 20:06:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 015K6Zdl081351; Wed, 5 Feb 2020 20:06:35 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 015K6ZOF081350; Wed, 5 Feb 2020 20:06:35 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202002052006.015K6ZOF081350@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 5 Feb 2020 20:06:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357591 - head/sys/riscv/include X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/riscv/include X-SVN-Commit-Revision: 357591 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 20:06:36 -0000 Author: jhb Date: Wed Feb 5 20:06:35 2020 New Revision: 357591 URL: https://svnweb.freebsd.org/changeset/base/357591 Log: Read the breakpoint instruction to determine its length in BKPT_SKIP. This fixes continuing from debug.kdb.enter=1 after enabling the use of compressed instructions since the compiler can emit the two byte c.ebreak instead of the 4 byte ebreak. Reviewed by: br MFC after: 1 week Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D23507 Modified: head/sys/riscv/include/db_machdep.h Modified: head/sys/riscv/include/db_machdep.h ============================================================================== --- head/sys/riscv/include/db_machdep.h Wed Feb 5 19:39:48 2020 (r357590) +++ head/sys/riscv/include/db_machdep.h Wed Feb 5 20:06:35 2020 (r357591) @@ -53,8 +53,14 @@ typedef long db_expr_t; #define BKPT_SIZE (INSN_SIZE) #define BKPT_SET(inst) (BKPT_INST) -#define BKPT_SKIP do { \ - kdb_frame->tf_sepc += BKPT_SIZE; \ +#define BKPT_SKIP do { \ + uint32_t _instr; \ + \ + _instr = db_get_value(PC_REGS(), sizeof(uint32_t), FALSE); \ + if ((_instr & 0x3) == 0x3) \ + kdb_frame->tf_sepc += 4; /* ebreak */ \ + else \ + kdb_frame->tf_sepc += 2; /* c.ebreak */ \ } while (0) #define db_clear_single_step kdb_cpu_clear_singlestep From owner-svn-src-all@freebsd.org Wed Feb 5 20:08:01 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E78E822CAA2; Wed, 5 Feb 2020 20:08:01 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CXg55wN9z44hv; Wed, 5 Feb 2020 20:08:01 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C5A6C80ED; Wed, 5 Feb 2020 20:08:01 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 015K81tv081582; Wed, 5 Feb 2020 20:08:01 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 015K81ek081579; Wed, 5 Feb 2020 20:08:01 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202002052008.015K81ek081579@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 5 Feb 2020 20:08:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357592 - in head: lib/libc share/mk X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head: lib/libc share/mk X-SVN-Commit-Revision: 357592 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 20:08:02 -0000 Author: emaste Date: Wed Feb 5 20:08:01 2020 New Revision: 357592 URL: https://svnweb.freebsd.org/changeset/base/357592 Log: libssp_nonshared: use only on i386 and ppc libssp_nonshared.a defines one symbol, __stack_chk_fail_local. This is used only on i386 and powerpc; other archs emit calls directly to __stack_chk_fail. Simplify linking on other archs by omitting it. PR: 242941 [exp-run] Modified: head/lib/libc/Makefile head/share/mk/src.libnames.mk Modified: head/lib/libc/Makefile ============================================================================== --- head/lib/libc/Makefile Wed Feb 5 20:06:35 2020 (r357591) +++ head/lib/libc/Makefile Wed Feb 5 20:08:01 2020 (r357592) @@ -31,7 +31,8 @@ CFLAGS+=-DNO__SCCSID -DNO__RCSID LIB=c SHLIB_MAJOR= 7 -.if ${MK_SSP} != "no" +.if ${MK_SSP} != "no" && \ + (${LIBC_ARCH} == "i386" || ${MACHINE_ARCH:Mpower*} != "") SHLIB_LDSCRIPT=libc.ldscript .else SHLIB_LDSCRIPT=libc_nossp.ldscript @@ -59,7 +60,8 @@ CFLAGS+=${CANCELPOINTS_CFLAGS} LDFLAGS+= -nodefaultlibs LIBADD+= compiler_rt -.if ${MK_SSP} != "no" +.if ${MK_SSP} != "no" && \ + (${LIBC_ARCH} == "i386" || ${MACHINE_ARCH:Mpower*} != "") LIBADD+= ssp_nonshared .endif Modified: head/share/mk/src.libnames.mk ============================================================================== --- head/share/mk/src.libnames.mk Wed Feb 5 20:06:35 2020 (r357591) +++ head/share/mk/src.libnames.mk Wed Feb 5 20:08:01 2020 (r357592) @@ -344,7 +344,8 @@ _DP_xo= util # The libc dependencies are not strictly needed but are defined to make the # assert happy. _DP_c= compiler_rt -.if ${MK_SSP} != "no" +.if ${MK_SSP} != "no" && \ + (${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH:Mpower*} != "") _DP_c+= ssp_nonshared .endif _DP_stats= sbuf pthread From owner-svn-src-all@freebsd.org Wed Feb 5 20:11:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6FCF922CC0A; Wed, 5 Feb 2020 20:11:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CXkj2P3Xz44xl; Wed, 5 Feb 2020 20:11:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4D6EB8147; Wed, 5 Feb 2020 20:11:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 015KB9ut084351; Wed, 5 Feb 2020 20:11:09 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 015KB9EB084350; Wed, 5 Feb 2020 20:11:09 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202002052011.015KB9EB084350@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 5 Feb 2020 20:11:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357593 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 357593 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 20:11:09 -0000 Author: jhb Date: Wed Feb 5 20:11:08 2020 New Revision: 357593 URL: https://svnweb.freebsd.org/changeset/base/357593 Log: Remove stale workaround for the htif console. In practice this discarded all characters entered at the DDB prompt. Reviewed by: br MFC after: 1 week Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D23509 Modified: head/sys/riscv/riscv/riscv_console.c Modified: head/sys/riscv/riscv/riscv_console.c ============================================================================== --- head/sys/riscv/riscv/riscv_console.c Wed Feb 5 20:08:01 2020 (r357592) +++ head/sys/riscv/riscv/riscv_console.c Wed Feb 5 20:11:08 2020 (r357593) @@ -206,20 +206,6 @@ riscv_cngetc(struct consdev *cp) { int ch; -#if defined(KDB) - /* - * RISCVTODO: BBL polls for console data on timer interrupt, - * but interrupts are turned off in KDB. - * So we currently do not have console in KDB. - */ - if (kdb_active) { - ch = sbi_console_getchar(); - while (ch) { - ch = sbi_console_getchar(); - } - } -#endif - ch = sbi_console_getchar(); if (ch > 0 && ch < 0xff) { #if defined(KDB) From owner-svn-src-all@freebsd.org Wed Feb 5 20:32:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B5F7022D5B8; Wed, 5 Feb 2020 20:32:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CYCT4Mn6z46bk; Wed, 5 Feb 2020 20:32:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 914BA86B4; Wed, 5 Feb 2020 20:32:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 015KWbc0001609; Wed, 5 Feb 2020 20:32:37 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 015KWbpN001608; Wed, 5 Feb 2020 20:32:37 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202002052032.015KWbpN001608@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 5 Feb 2020 20:32:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357594 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 357594 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 20:32:37 -0000 Author: jhb Date: Wed Feb 5 20:32:37 2020 New Revision: 357594 URL: https://svnweb.freebsd.org/changeset/base/357594 Log: Use csr_read() to read sstatus instead of inline assembly. While here, remove a local variable to avoid the CSR read in non-debug kernels. Reviewed by: mhorne MFC after: 1 week Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D23511 Modified: head/sys/riscv/riscv/trap.c Modified: head/sys/riscv/riscv/trap.c ============================================================================== --- head/sys/riscv/riscv/trap.c Wed Feb 5 20:11:08 2020 (r357593) +++ head/sys/riscv/riscv/trap.c Wed Feb 5 20:32:37 2020 (r357594) @@ -245,12 +245,10 @@ void do_trap_supervisor(struct trapframe *frame) { uint64_t exception; - uint64_t sstatus; /* Ensure we came from supervisor mode, interrupts disabled */ - __asm __volatile("csrr %0, sstatus" : "=&r" (sstatus)); - KASSERT((sstatus & (SSTATUS_SPP | SSTATUS_SIE)) == SSTATUS_SPP, - ("We must came from S mode with interrupts disabled")); + KASSERT((csr_read(sstatus) & (SSTATUS_SPP | SSTATUS_SIE)) == + SSTATUS_SPP, ("Came from S mode with interrupts enabled")); exception = (frame->tf_scause & EXCP_MASK); if (frame->tf_scause & EXCP_INTR) { @@ -305,7 +303,6 @@ do_trap_user(struct trapframe *frame) { uint64_t exception; struct thread *td; - uint64_t sstatus; struct pcb *pcb; td = curthread; @@ -313,9 +310,8 @@ do_trap_user(struct trapframe *frame) pcb = td->td_pcb; /* Ensure we came from usermode, interrupts disabled */ - __asm __volatile("csrr %0, sstatus" : "=&r" (sstatus)); - KASSERT((sstatus & (SSTATUS_SPP | SSTATUS_SIE)) == 0, - ("We must came from U mode with interrupts disabled")); + KASSERT((csr_read(sstatus) & (SSTATUS_SPP | SSTATUS_SIE)) == 0, + ("Came from U mode with interrupts enabled")); exception = (frame->tf_scause & EXCP_MASK); if (frame->tf_scause & EXCP_INTR) { From owner-svn-src-all@freebsd.org Wed Feb 5 20:34:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E669122D65B; Wed, 5 Feb 2020 20:34:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CYFV4nWXz46kg; Wed, 5 Feb 2020 20:34:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9F91186B9; Wed, 5 Feb 2020 20:34:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 015KYMq4001750; Wed, 5 Feb 2020 20:34:22 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 015KYMrW001749; Wed, 5 Feb 2020 20:34:22 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202002052034.015KYMrW001749@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 5 Feb 2020 20:34:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357595 - head/sys/riscv/include X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/riscv/include X-SVN-Commit-Revision: 357595 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 20:34:23 -0000 Author: jhb Date: Wed Feb 5 20:34:22 2020 New Revision: 357595 URL: https://svnweb.freebsd.org/changeset/base/357595 Log: Fix EXCP_MASK to include all relevant bits from scause. While cause codes higher than 16 are reserved, the exception code field of the register is defined to be all bits but the upper-most bit. Reviewed by: mhorne MFC after: 1 week Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D23510 Modified: head/sys/riscv/include/riscvreg.h Modified: head/sys/riscv/include/riscvreg.h ============================================================================== --- head/sys/riscv/include/riscvreg.h Wed Feb 5 20:32:37 2020 (r357594) +++ head/sys/riscv/include/riscvreg.h Wed Feb 5 20:34:22 2020 (r357595) @@ -37,8 +37,7 @@ #ifndef _MACHINE_RISCVREG_H_ #define _MACHINE_RISCVREG_H_ -#define EXCP_SHIFT 0 -#define EXCP_MASK (0xf << EXCP_SHIFT) +#define EXCP_MASK (~EXCP_INTR) #define EXCP_MISALIGNED_FETCH 0 #define EXCP_FAULT_FETCH 1 #define EXCP_ILLEGAL_INSTRUCTION 2 From owner-svn-src-all@freebsd.org Wed Feb 5 20:39:18 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E6D3222D7DF; Wed, 5 Feb 2020 20:39:18 +0000 (UTC) (envelope-from alfredo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CYMB5nRmz46wY; Wed, 5 Feb 2020 20:39:18 +0000 (UTC) (envelope-from alfredo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C1EA186F3; Wed, 5 Feb 2020 20:39:18 +0000 (UTC) (envelope-from alfredo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 015KdIdB002025; Wed, 5 Feb 2020 20:39:18 GMT (envelope-from alfredo@FreeBSD.org) Received: (from alfredo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 015KdIZt002024; Wed, 5 Feb 2020 20:39:18 GMT (envelope-from alfredo@FreeBSD.org) Message-Id: <202002052039.015KdIZt002024@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alfredo set sender to alfredo@FreeBSD.org using -f From: "Alfredo Dal'Ava Junior" Date: Wed, 5 Feb 2020 20:39:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357596 - head/sys/dev/virtio/pci X-SVN-Group: head X-SVN-Commit-Author: alfredo X-SVN-Commit-Paths: head/sys/dev/virtio/pci X-SVN-Commit-Revision: 357596 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 20:39:19 -0000 Author: alfredo Date: Wed Feb 5 20:39:18 2020 New Revision: 357596 URL: https://svnweb.freebsd.org/changeset/base/357596 Log: [virtio] Fix r/w to PCI configuration area on big endian platforms In legacy VirtIO drivers, the header must be PCI endianness (little) and the device-specific region is encoded in the native endian of the guest. This patch makes the access (read/write) to VirtIO header using the little endian order. Other read and write access are native endianness. This also sets the device's IO region as big endian if on big endian machine. PR: 205178 Submitted by: Andre Silva Reported by: Kenneth Salerno Reviewed by: bryanv, bdragon, luporl, alfredo Approved by: jhibbits (mentor) Differential Revision: https://reviews.freebsd.org/D23401 Modified: head/sys/dev/virtio/pci/virtio_pci.c Modified: head/sys/dev/virtio/pci/virtio_pci.c ============================================================================== --- head/sys/dev/virtio/pci/virtio_pci.c Wed Feb 5 20:34:22 2020 (r357595) +++ head/sys/dev/virtio/pci/virtio_pci.c Wed Feb 5 20:39:18 2020 (r357596) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -184,6 +185,17 @@ static void vtpci_config_intr(void *); #define vtpci_write_config_2(sc, o, v) bus_write_2((sc)->vtpci_res, (o), (v)) #define vtpci_write_config_4(sc, o, v) bus_write_4((sc)->vtpci_res, (o), (v)) +/* + * Legacy VirtIO header is always PCI endianness (little), so if we + * are in a BE machine we need to swap bytes from LE to BE when reading + * and from BE to LE when writing. + * If we are in a LE machine, there will be no swaps. + */ +#define vtpci_read_header_2(sc, o) le16toh(vtpci_read_config_2(sc, o)) +#define vtpci_read_header_4(sc, o) le32toh(vtpci_read_config_4(sc, o)) +#define vtpci_write_header_2(sc, o, v) vtpci_write_config_2(sc, o, (htole16(v))) +#define vtpci_write_header_4(sc, o, v) vtpci_write_config_4(sc, o, (htole32(v))) + /* Tunables. */ static int vtpci_disable_msix = 0; TUNABLE_INT("hw.virtio.pci.disable_msix", &vtpci_disable_msix); @@ -278,6 +290,17 @@ vtpci_attach(device_t dev) return (ENXIO); } +/* + * For legacy VirtIO, the device-specific configuration is guest + * endian, while the common configuration header is always + * PCI (little) endian and will be handled specifically in + * other parts of this file via functions + * 'vtpci_[read|write]_header_[2|4]' + */ +#if _BYTE_ORDER == _BIG_ENDIAN + rman_set_bustag(sc->vtpci_res, &bs_be_tag); +#endif + if (pci_find_cap(dev, PCIY_MSI, NULL) != 0) sc->vtpci_flags |= VTPCI_FLAG_NO_MSI; @@ -447,7 +470,7 @@ vtpci_negotiate_features(device_t dev, uint64_t child_ sc = device_get_softc(dev); - host_features = vtpci_read_config_4(sc, VIRTIO_PCI_HOST_FEATURES); + host_features = vtpci_read_header_4(sc, VIRTIO_PCI_HOST_FEATURES); vtpci_describe_features(sc, "host", host_features); /* @@ -459,7 +482,7 @@ vtpci_negotiate_features(device_t dev, uint64_t child_ sc->vtpci_features = features; vtpci_describe_features(sc, "negotiated", features); - vtpci_write_config_4(sc, VIRTIO_PCI_GUEST_FEATURES, features); + vtpci_write_header_4(sc, VIRTIO_PCI_GUEST_FEATURES, features); return (features); } @@ -502,7 +525,7 @@ vtpci_alloc_virtqueues(device_t dev, int flags, int nv info = &vq_info[idx]; vtpci_select_virtqueue(sc, idx); - size = vtpci_read_config_2(sc, VIRTIO_PCI_QUEUE_NUM); + size = vtpci_read_header_2(sc, VIRTIO_PCI_QUEUE_NUM); error = virtqueue_alloc(dev, idx, size, VIRTIO_PCI_VRING_ALIGN, ~(vm_paddr_t)0, info, &vq); @@ -512,7 +535,7 @@ vtpci_alloc_virtqueues(device_t dev, int flags, int nv break; } - vtpci_write_config_4(sc, VIRTIO_PCI_QUEUE_PFN, + vtpci_write_header_4(sc, VIRTIO_PCI_QUEUE_PFN, virtqueue_paddr(vq) >> VIRTIO_PCI_QUEUE_ADDR_SHIFT); vqx->vtv_vq = *info->vqai_vq = vq; @@ -646,7 +669,7 @@ vtpci_notify_virtqueue(device_t dev, uint16_t queue) sc = device_get_softc(dev); - vtpci_write_config_2(sc, VIRTIO_PCI_QUEUE_NOTIFY, queue); + vtpci_write_header_2(sc, VIRTIO_PCI_QUEUE_NOTIFY, queue); } static uint8_t @@ -1046,10 +1069,10 @@ vtpci_register_msix_vector(struct vtpci_softc *sc, int } else vector = VIRTIO_MSI_NO_VECTOR; - vtpci_write_config_2(sc, offset, vector); + vtpci_write_header_2(sc, offset, vector); /* Read vector to determine if the host had sufficient resources. */ - if (vtpci_read_config_2(sc, offset) != vector) { + if (vtpci_read_header_2(sc, offset) != vector) { device_printf(dev, "insufficient host resources for MSIX interrupts\n"); return (ENODEV); @@ -1112,13 +1135,13 @@ vtpci_reinit_virtqueue(struct vtpci_softc *sc, int idx KASSERT(vq != NULL, ("%s: vq %d not allocated", __func__, idx)); vtpci_select_virtqueue(sc, idx); - size = vtpci_read_config_2(sc, VIRTIO_PCI_QUEUE_NUM); + size = vtpci_read_header_2(sc, VIRTIO_PCI_QUEUE_NUM); error = virtqueue_reinit(vq, size); if (error) return (error); - vtpci_write_config_4(sc, VIRTIO_PCI_QUEUE_PFN, + vtpci_write_header_4(sc, VIRTIO_PCI_QUEUE_PFN, virtqueue_paddr(vq) >> VIRTIO_PCI_QUEUE_ADDR_SHIFT); return (0); @@ -1182,7 +1205,7 @@ vtpci_free_virtqueues(struct vtpci_softc *sc) vqx = &sc->vtpci_vqs[idx]; vtpci_select_virtqueue(sc, idx); - vtpci_write_config_4(sc, VIRTIO_PCI_QUEUE_PFN, 0); + vtpci_write_header_4(sc, VIRTIO_PCI_QUEUE_PFN, 0); virtqueue_free(vqx->vtv_vq); vqx->vtv_vq = NULL; @@ -1207,12 +1230,12 @@ vtpci_cleanup_setup_intr_attempt(struct vtpci_softc *s int idx; if (sc->vtpci_flags & VTPCI_FLAG_MSIX) { - vtpci_write_config_2(sc, VIRTIO_MSI_CONFIG_VECTOR, + vtpci_write_header_2(sc, VIRTIO_MSI_CONFIG_VECTOR, VIRTIO_MSI_NO_VECTOR); for (idx = 0; idx < sc->vtpci_nvqs; idx++) { vtpci_select_virtqueue(sc, idx); - vtpci_write_config_2(sc, VIRTIO_MSI_QUEUE_VECTOR, + vtpci_write_header_2(sc, VIRTIO_MSI_QUEUE_VECTOR, VIRTIO_MSI_NO_VECTOR); } } @@ -1235,7 +1258,7 @@ static void vtpci_select_virtqueue(struct vtpci_softc *sc, int idx) { - vtpci_write_config_2(sc, VIRTIO_PCI_QUEUE_SEL, idx); + vtpci_write_header_2(sc, VIRTIO_PCI_QUEUE_SEL, idx); } static void From owner-svn-src-all@freebsd.org Wed Feb 5 20:55:59 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D016F22E093; Wed, 5 Feb 2020 20:55:59 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CYkR59Tfz489F; Wed, 5 Feb 2020 20:55:59 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ACDA98B0A; Wed, 5 Feb 2020 20:55:59 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 015Ktxoh013929; Wed, 5 Feb 2020 20:55:59 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 015KtxbS013928; Wed, 5 Feb 2020 20:55:59 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202002052055.015KtxbS013928@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 5 Feb 2020 20:55:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r357597 - in stable: 11/usr.sbin/wpa/wpa_supplicant 12/usr.sbin/wpa/wpa_supplicant X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/usr.sbin/wpa/wpa_supplicant 12/usr.sbin/wpa/wpa_supplicant X-SVN-Commit-Revision: 357597 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 20:55:59 -0000 Author: cy Date: Wed Feb 5 20:55:59 2020 New Revision: 357597 URL: https://svnweb.freebsd.org/changeset/base/357597 Log: MFC r356949: Fix build when WITHOUT_WPA_SUPPLICANT_EAPOL option used. The build failure was discoved by Michael Dexter's recent Build Options Survey run, at https://callfortesting.org/results/bos-2020-01-16/\ WITHOUT_WPA_SUPPLICANT_EAPOL-small.txt. Reported by: Michael Dexter via emaste Modified: stable/11/usr.sbin/wpa/wpa_supplicant/Makefile Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/usr.sbin/wpa/wpa_supplicant/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/11/usr.sbin/wpa/wpa_supplicant/Makefile ============================================================================== --- stable/11/usr.sbin/wpa/wpa_supplicant/Makefile Wed Feb 5 20:39:18 2020 (r357596) +++ stable/11/usr.sbin/wpa/wpa_supplicant/Makefile Wed Feb 5 20:55:59 2020 (r357597) @@ -15,19 +15,15 @@ SRCS= base64.c bitfield.c blacklist.c bss.c cli.c comm ctrl_iface.c ctrl_iface_common.c ctrl_iface_unix.c \ dh_groups.c driver_bsd.c driver_common.c \ driver_ndis.c driver_wired.c driver_wired_common.c drivers.c \ - eap_register.c eap_wsc.c eap_wsc_common.c eloop.c \ - events.c gas.c gas_query.c hs20_supplicant.c \ + eap_register.c eloop.c \ + events.c gas.c gas_query.c \ http_client.c http_server.c \ httpread.c hw_features_common.c \ - ieee802_11_common.c interworking.c l2_packet_freebsd.c main.c \ + ieee802_11_common.c l2_packet_freebsd.c main.c \ notify.c offchannel.c op_classes.c os_unix.c pmksa_cache.c preauth.c \ - rrm.c scan.c upnp_xml.c uuid.c \ + rrm.c scan.c upnp_xml.c \ wmm_ac.c wpa.c wpa_common.c wpa_ctrl.c \ wpa_debug.c wpa_ft.c wpa_ie.c wpa_supplicant.c wpabuf.c wpas_glue.c \ - wps.c wps_attr_build.c wps_attr_parse.c wps_attr_process.c \ - wps_common.c wps_dev_attr.c wps_enrollee.c wps_registrar.c \ - wps_supplicant.c wps_upnp.c wps_upnp_ap.c wps_upnp_event.c \ - wps_upnp_ssdp.c wps_upnp_web.c \ Packet32.c MAN= wpa_supplicant.8 wpa_supplicant.conf.5 @@ -44,15 +40,12 @@ CFLAGS+=-DCONFIG_BACKEND_FILE \ -DCONFIG_DRIVER_NDIS \ -DCONFIG_DRIVER_WIRED \ -DCONFIG_GAS \ - -DCONFIG_HS20 \ -DCONFIG_IEEE80211R \ - -DCONFIG_INTERWORKING \ -DCONFIG_PEERKEY \ -DCONFIG_PRIVSEP \ -DCONFIG_SMARTCARD \ -DCONFIG_TERMINATE_ONLASTIF \ -DCONFIG_TLS=openssl \ - -DCONFIG_WPS \ -DCONFIG_WPS2 \ -DCONFIG_WPS_UPNP \ -DPKCS12_FUNCS @@ -66,7 +59,10 @@ LDADD+=${WPA_SUPPLICANT_LDADD} #LDFLAGS+=${WPA_SUPPLICANT_LDFLAGS} .if ${MK_WPA_SUPPLICANT_EAPOL} != "no" -CFLAGS+=-DEAP_GTC \ +CFLAGS+=-DCONFIG_WPS \ + -DCONFIG_HS20 \ + -DCONFIG_INTERWORKING \ + -DEAP_GTC \ -DEAP_LEAP \ -DEAP_MD5 \ -DEAP_MSCHAPv2 \ @@ -75,6 +71,7 @@ CFLAGS+=-DEAP_GTC \ -DEAP_PSK \ -DEAP_TLS \ -DEAP_TTLS \ + -DEAP_WSC \ -DIEEE8021X_EAPOL SRCS+= chap.c \ eap.c \ @@ -92,14 +89,23 @@ SRCS+= chap.c \ eap_tls.c \ eap_tls_common.c \ eap_ttls.c \ + eap_wsc.c \ eapol_supp_sm.c \ + eap_wsc_common.c \ + hs20_supplicant.c \ + interworking.c \ ms_funcs.c \ - mschapv2.c -TLS_FUNCS=y + mschapv2.c \ + uuid.c \ + wps.c wps_attr_build.c wps_attr_parse.c wps_attr_process.c \ + wps_common.c wps_dev_attr.c wps_enrollee.c wps_registrar.c \ + wps_supplicant.c wps_upnp.c wps_upnp_ap.c wps_upnp_event.c \ + wps_upnp_ssdp.c wps_upnp_web.c NEED_AES_EAX=y NEED_AES_ENCBLOCK=y NEED_AES_OMAC1=y .endif +TLS_FUNCS=y .if !empty(CFLAGS:M*-DEAP_AKA) SRCS+= eap_aka.c From owner-svn-src-all@freebsd.org Wed Feb 5 20:56:00 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2E17B22E097; Wed, 5 Feb 2020 20:56:00 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CYkS0SCQz489G; Wed, 5 Feb 2020 20:56:00 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0AF278B0B; Wed, 5 Feb 2020 20:56:00 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 015KtxE7013935; Wed, 5 Feb 2020 20:55:59 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 015KtxBm013934; Wed, 5 Feb 2020 20:55:59 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202002052055.015KtxBm013934@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 5 Feb 2020 20:55:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357597 - in stable: 11/usr.sbin/wpa/wpa_supplicant 12/usr.sbin/wpa/wpa_supplicant X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/usr.sbin/wpa/wpa_supplicant 12/usr.sbin/wpa/wpa_supplicant X-SVN-Commit-Revision: 357597 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 20:56:00 -0000 Author: cy Date: Wed Feb 5 20:55:59 2020 New Revision: 357597 URL: https://svnweb.freebsd.org/changeset/base/357597 Log: MFC r356949: Fix build when WITHOUT_WPA_SUPPLICANT_EAPOL option used. The build failure was discoved by Michael Dexter's recent Build Options Survey run, at https://callfortesting.org/results/bos-2020-01-16/\ WITHOUT_WPA_SUPPLICANT_EAPOL-small.txt. Reported by: Michael Dexter via emaste Modified: stable/12/usr.sbin/wpa/wpa_supplicant/Makefile Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/usr.sbin/wpa/wpa_supplicant/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/12/usr.sbin/wpa/wpa_supplicant/Makefile ============================================================================== --- stable/12/usr.sbin/wpa/wpa_supplicant/Makefile Wed Feb 5 20:39:18 2020 (r357596) +++ stable/12/usr.sbin/wpa/wpa_supplicant/Makefile Wed Feb 5 20:55:59 2020 (r357597) @@ -15,19 +15,15 @@ SRCS= base64.c bitfield.c blacklist.c bss.c cli.c comm ctrl_iface.c ctrl_iface_common.c ctrl_iface_unix.c \ dh_groups.c driver_bsd.c driver_common.c \ driver_ndis.c driver_wired.c driver_wired_common.c drivers.c \ - eap_register.c eap_wsc.c eap_wsc_common.c eloop.c \ - events.c gas.c gas_query.c hs20_supplicant.c \ + eap_register.c eloop.c \ + events.c gas.c gas_query.c \ http_client.c http_server.c \ httpread.c hw_features_common.c \ - ieee802_11_common.c interworking.c l2_packet_freebsd.c main.c \ + ieee802_11_common.c l2_packet_freebsd.c main.c \ notify.c offchannel.c op_classes.c os_unix.c pmksa_cache.c preauth.c \ - rrm.c scan.c upnp_xml.c uuid.c \ + rrm.c scan.c upnp_xml.c \ wmm_ac.c wpa.c wpa_common.c wpa_ctrl.c \ wpa_debug.c wpa_ft.c wpa_ie.c wpa_supplicant.c wpabuf.c wpas_glue.c \ - wps.c wps_attr_build.c wps_attr_parse.c wps_attr_process.c \ - wps_common.c wps_dev_attr.c wps_enrollee.c wps_registrar.c \ - wps_supplicant.c wps_upnp.c wps_upnp_ap.c wps_upnp_event.c \ - wps_upnp_ssdp.c wps_upnp_web.c \ Packet32.c MAN= wpa_supplicant.8 wpa_supplicant.conf.5 @@ -44,15 +40,12 @@ CFLAGS+=-DCONFIG_BACKEND_FILE \ -DCONFIG_DRIVER_NDIS \ -DCONFIG_DRIVER_WIRED \ -DCONFIG_GAS \ - -DCONFIG_HS20 \ -DCONFIG_IEEE80211R \ - -DCONFIG_INTERWORKING \ -DCONFIG_PEERKEY \ -DCONFIG_PRIVSEP \ -DCONFIG_SMARTCARD \ -DCONFIG_TERMINATE_ONLASTIF \ -DCONFIG_TLS=openssl \ - -DCONFIG_WPS \ -DCONFIG_WPS2 \ -DCONFIG_WPS_UPNP \ -DPKCS12_FUNCS @@ -66,7 +59,10 @@ LDADD+=${WPA_SUPPLICANT_LDADD} #LDFLAGS+=${WPA_SUPPLICANT_LDFLAGS} .if ${MK_WPA_SUPPLICANT_EAPOL} != "no" -CFLAGS+=-DEAP_GTC \ +CFLAGS+=-DCONFIG_WPS \ + -DCONFIG_HS20 \ + -DCONFIG_INTERWORKING \ + -DEAP_GTC \ -DEAP_LEAP \ -DEAP_MD5 \ -DEAP_MSCHAPv2 \ @@ -75,6 +71,7 @@ CFLAGS+=-DEAP_GTC \ -DEAP_PSK \ -DEAP_TLS \ -DEAP_TTLS \ + -DEAP_WSC \ -DIEEE8021X_EAPOL SRCS+= chap.c \ eap.c \ @@ -92,14 +89,23 @@ SRCS+= chap.c \ eap_tls.c \ eap_tls_common.c \ eap_ttls.c \ + eap_wsc.c \ eapol_supp_sm.c \ + eap_wsc_common.c \ + hs20_supplicant.c \ + interworking.c \ ms_funcs.c \ - mschapv2.c -TLS_FUNCS=y + mschapv2.c \ + uuid.c \ + wps.c wps_attr_build.c wps_attr_parse.c wps_attr_process.c \ + wps_common.c wps_dev_attr.c wps_enrollee.c wps_registrar.c \ + wps_supplicant.c wps_upnp.c wps_upnp_ap.c wps_upnp_event.c \ + wps_upnp_ssdp.c wps_upnp_web.c NEED_AES_EAX=y NEED_AES_ENCBLOCK=y NEED_AES_OMAC1=y .endif +TLS_FUNCS=y .if !empty(CFLAGS:M*-DEAP_AKA) SRCS+= eap_aka.c From owner-svn-src-all@freebsd.org Wed Feb 5 20:57:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A5F5F22E1DA; Wed, 5 Feb 2020 20:57:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CYmT3wKZz48Pn; Wed, 5 Feb 2020 20:57:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7D27B8B0C; Wed, 5 Feb 2020 20:57:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 015KvjrT014068; Wed, 5 Feb 2020 20:57:45 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 015KvjqF014067; Wed, 5 Feb 2020 20:57:45 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202002052057.015KvjqF014067@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 5 Feb 2020 20:57:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357598 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 357598 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 20:57:45 -0000 Author: markj Date: Wed Feb 5 20:57:45 2020 New Revision: 357598 URL: https://svnweb.freebsd.org/changeset/base/357598 Log: Define SMP for standalone module builds. Suggested and reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D23519 Modified: head/sys/conf/config.mk Modified: head/sys/conf/config.mk ============================================================================== --- head/sys/conf/config.mk Wed Feb 5 20:55:59 2020 (r357597) +++ head/sys/conf/config.mk Wed Feb 5 20:57:45 2020 (r357598) @@ -11,8 +11,9 @@ opt_global.h: touch ${.TARGET} .if ${MACHINE} != "mips" - @echo "#define VIMAGE 1" >> ${.TARGET} + @echo "#define SMP 1" >> ${.TARGET} @echo "#define MAC 1" >> ${.TARGET} + @echo "#define VIMAGE 1" >> ${.TARGET} .endif opt_bpf.h: echo "#define DEV_BPF 1" > ${.TARGET} From owner-svn-src-all@freebsd.org Wed Feb 5 21:05:53 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3285D22E67F; Wed, 5 Feb 2020 21:05:53 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CYxs0Y1Wz491s; Wed, 5 Feb 2020 21:05:53 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 099DE8CFE; Wed, 5 Feb 2020 21:05:53 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 015L5q8T020188; Wed, 5 Feb 2020 21:05:52 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 015L5q42020187; Wed, 5 Feb 2020 21:05:52 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <202002052105.015L5q42020187@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Wed, 5 Feb 2020 21:05:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357599 - stable/12/tools/build/mk X-SVN-Group: stable-12 X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: stable/12/tools/build/mk X-SVN-Commit-Revision: 357599 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 21:05:53 -0000 Author: oshogbo Date: Wed Feb 5 21:05:52 2020 New Revision: 357599 URL: https://svnweb.freebsd.org/changeset/base/357599 Log: MFCr356925: Those files are already removed in ObsoleteFiles. There is no need to remove them twice. PR: 242971 Modified: stable/12/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/12/ (props changed) Modified: stable/12/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/12/tools/build/mk/OptionalObsoleteFiles.inc Wed Feb 5 20:57:45 2020 (r357598) +++ stable/12/tools/build/mk/OptionalObsoleteFiles.inc Wed Feb 5 21:05:52 2020 (r357599) @@ -1129,43 +1129,7 @@ OLD_DIRS+=usr/tests/usr.bin/calendar .endif .if ${MK_CASPER} == no -OLD_FILES+=etc/casper/system.dns -OLD_FILES+=etc/casper/system.grp -OLD_FILES+=etc/casper/system.pwd -OLD_FILES+=etc/casper/system.random -OLD_FILES+=etc/casper/system.sysctl -OLD_FILES+=etc/rc.d/casperd -OLD_LIBS+=lib/libcapsicum.so.0 -OLD_LIBS+=lib/libcasper.so.0 -OLD_FILES+=libexec/casper/dns -OLD_FILES+=libexec/casper/grp -OLD_FILES+=libexec/casper/pwd -OLD_FILES+=libexec/casper/random -OLD_FILES+=libexec/casper/sysctl -OLD_FILES+=sbin/casper -OLD_FILES+=sbin/casperd -OLD_FILES+=usr/include/libcapsicum.h -OLD_FILES+=usr/include/libcapsicum_dns.h -OLD_FILES+=usr/include/libcapsicum_grp.h -OLD_FILES+=usr/include/libcapsicum_pwd.h -OLD_FILES+=usr/include/libcapsicum_random.h -OLD_FILES+=usr/include/libcapsicum_service.h -OLD_FILES+=usr/include/libcapsicum_sysctl.h OLD_FILES+=usr/include/libcasper.h -OLD_FILES+=usr/lib/libcapsicum.a -OLD_FILES+=usr/lib/libcapsicum.so -OLD_FILES+=usr/lib/libcapsicum_p.a -OLD_FILES+=usr/lib/libcasper.a -OLD_FILES+=usr/lib/libcasper.so -OLD_FILES+=usr/lib/libcasper_p.a -OLD_FILES+=usr/lib32/libcapsicum.a -OLD_FILES+=usr/lib32/libcapsicum.so -OLD_LIBS+=usr/lib32/libcapsicum.so.0 -OLD_FILES+=usr/lib32/libcapsicum_p.a -OLD_FILES+=usr/lib32/libcasper.a -OLD_FILES+=usr/lib32/libcasper.so -OLD_LIBS+=usr/lib32/libcasper.so.0 -OLD_FILES+=usr/lib32/libcasper_p.a OLD_FILES+=usr/share/man/man3/cap_clone.3.gz OLD_FILES+=usr/share/man/man3/cap_close.3.gz OLD_FILES+=usr/share/man/man3/cap_init.3.gz @@ -1178,8 +1142,6 @@ OLD_FILES+=usr/share/man/man3/cap_sock.3.gz OLD_FILES+=usr/share/man/man3/cap_unwrap.3.gz OLD_FILES+=usr/share/man/man3/cap_wrap.3.gz OLD_FILES+=usr/share/man/man3/cap_xfer_nvlist.3.gz -OLD_FILES+=usr/share/man/man3/libcapsicum.3.gz -OLD_FILES+=usr/share/man/man8/casperd.8.gz .endif .if ${MK_CCD} == no From owner-svn-src-all@freebsd.org Wed Feb 5 21:10:43 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1FA7D22E84A; Wed, 5 Feb 2020 21:10:43 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CZ3R04cyz49Gb; Wed, 5 Feb 2020 21:10:43 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F20B98D34; Wed, 5 Feb 2020 21:10:42 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 015LAggb020569; Wed, 5 Feb 2020 21:10:42 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 015LAgWH020568; Wed, 5 Feb 2020 21:10:42 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <202002052110.015LAgWH020568@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Wed, 5 Feb 2020 21:10:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357600 - stable/12/tools/build/mk X-SVN-Group: stable-12 X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: stable/12/tools/build/mk X-SVN-Commit-Revision: 357600 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 21:10:43 -0000 Author: oshogbo Date: Wed Feb 5 21:10:42 2020 New Revision: 357600 URL: https://svnweb.freebsd.org/changeset/base/357600 Log: MFCr356926: Even when the MK_CASPER is set to "no" we still want to install man pages and the headers. If the user decides to install the system without Casper support, then the Casper functions are mocked, but they still exist in the system. PR: 242971 Modified: stable/12/tools/build/mk/OptionalObsoleteFiles.inc Modified: stable/12/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/12/tools/build/mk/OptionalObsoleteFiles.inc Wed Feb 5 21:05:52 2020 (r357599) +++ stable/12/tools/build/mk/OptionalObsoleteFiles.inc Wed Feb 5 21:10:42 2020 (r357600) @@ -1129,19 +1129,6 @@ OLD_DIRS+=usr/tests/usr.bin/calendar .endif .if ${MK_CASPER} == no -OLD_FILES+=usr/include/libcasper.h -OLD_FILES+=usr/share/man/man3/cap_clone.3.gz -OLD_FILES+=usr/share/man/man3/cap_close.3.gz -OLD_FILES+=usr/share/man/man3/cap_init.3.gz -OLD_FILES+=usr/share/man/man3/cap_limit_get.3.gz -OLD_FILES+=usr/share/man/man3/cap_limit_set.3.gz -OLD_FILES+=usr/share/man/man3/cap_recv_nvlist.3.gz -OLD_FILES+=usr/share/man/man3/cap_send_nvlist.3.gz -OLD_FILES+=usr/share/man/man3/cap_service_open.3.gz -OLD_FILES+=usr/share/man/man3/cap_sock.3.gz -OLD_FILES+=usr/share/man/man3/cap_unwrap.3.gz -OLD_FILES+=usr/share/man/man3/cap_wrap.3.gz -OLD_FILES+=usr/share/man/man3/cap_xfer_nvlist.3.gz .endif .if ${MK_CCD} == no From owner-svn-src-all@freebsd.org Wed Feb 5 21:11:41 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 688EB22EABA; Wed, 5 Feb 2020 21:11:41 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CZ4Y2C5Lz49b3; Wed, 5 Feb 2020 21:11:41 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 469E08D91; Wed, 5 Feb 2020 21:11:41 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 015LBfZH022148; Wed, 5 Feb 2020 21:11:41 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 015LBfP6022147; Wed, 5 Feb 2020 21:11:41 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <202002052111.015LBfP6022147@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Wed, 5 Feb 2020 21:11:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357601 - stable/12/tools/build/mk X-SVN-Group: stable-12 X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: stable/12/tools/build/mk X-SVN-Commit-Revision: 357601 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 21:11:41 -0000 Author: oshogbo Date: Wed Feb 5 21:11:40 2020 New Revision: 357601 URL: https://svnweb.freebsd.org/changeset/base/357601 Log: MFCr356928: When MK_CASPER=no is set remove files which are not needed to run system. PR: 242971 Modified: stable/12/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/12/ (props changed) Modified: stable/12/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/12/tools/build/mk/OptionalObsoleteFiles.inc Wed Feb 5 21:10:42 2020 (r357600) +++ stable/12/tools/build/mk/OptionalObsoleteFiles.inc Wed Feb 5 21:11:40 2020 (r357601) @@ -1129,6 +1129,15 @@ OLD_DIRS+=usr/tests/usr.bin/calendar .endif .if ${MK_CASPER} == no +OLD_LIBS+=lib/libcasper.so.1 +OLD_LIBS+=lib/casper/libcap_dns.so.2 +OLD_LIBS+=lib/casper/libcap_fileargs.so.1 +OLD_LIBS+=lib/casper/libcap_grp.so.1 +OLD_LIBS+=lib/casper/libcap_net.so.1 +OLD_LIBS+=lib/casper/libcap_pwd.so.1 +OLD_LIBS+=lib/casper/libcap_sysctl.so.1 +OLD_LIBS+=lib/casper/libcap_sysctl.so.2 +OLD_LIBS+=lib/casper/libcap_syslog.so.1 .endif .if ${MK_CCD} == no From owner-svn-src-all@freebsd.org Wed Feb 5 21:14:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 081C422EE5C; Wed, 5 Feb 2020 21:14:28 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CZ7l6RxFz4B6f; Wed, 5 Feb 2020 21:14:27 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D88ED8EED; Wed, 5 Feb 2020 21:14:27 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 015LERgb026176; Wed, 5 Feb 2020 21:14:27 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 015LERZ8026175; Wed, 5 Feb 2020 21:14:27 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <202002052114.015LERZ8026175@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Wed, 5 Feb 2020 21:14:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r357602 - stable/11/tools/build/mk X-SVN-Group: stable-11 X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: stable/11/tools/build/mk X-SVN-Commit-Revision: 357602 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 21:14:28 -0000 Author: oshogbo Date: Wed Feb 5 21:14:27 2020 New Revision: 357602 URL: https://svnweb.freebsd.org/changeset/base/357602 Log: MFCr356925: Those files are already removed in ObsoleteFiles.\ There is no need to remove them twice. PR: 242971 Modified: stable/11/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/11/ (props changed) Modified: stable/11/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/11/tools/build/mk/OptionalObsoleteFiles.inc Wed Feb 5 21:11:40 2020 (r357601) +++ stable/11/tools/build/mk/OptionalObsoleteFiles.inc Wed Feb 5 21:14:27 2020 (r357602) @@ -1146,43 +1146,7 @@ OLD_DIRS+=usr/tests/usr.bin/calendar .endif .if ${MK_CASPER} == no -OLD_FILES+=etc/casper/system.dns -OLD_FILES+=etc/casper/system.grp -OLD_FILES+=etc/casper/system.pwd -OLD_FILES+=etc/casper/system.random -OLD_FILES+=etc/casper/system.sysctl -OLD_FILES+=etc/rc.d/casperd -OLD_LIBS+=lib/libcapsicum.so.0 -OLD_LIBS+=lib/libcasper.so.0 -OLD_FILES+=libexec/casper/dns -OLD_FILES+=libexec/casper/grp -OLD_FILES+=libexec/casper/pwd -OLD_FILES+=libexec/casper/random -OLD_FILES+=libexec/casper/sysctl -OLD_FILES+=sbin/casper -OLD_FILES+=sbin/casperd -OLD_FILES+=usr/include/libcapsicum.h -OLD_FILES+=usr/include/libcapsicum_dns.h -OLD_FILES+=usr/include/libcapsicum_grp.h -OLD_FILES+=usr/include/libcapsicum_pwd.h -OLD_FILES+=usr/include/libcapsicum_random.h -OLD_FILES+=usr/include/libcapsicum_service.h -OLD_FILES+=usr/include/libcapsicum_sysctl.h OLD_FILES+=usr/include/libcasper.h -OLD_FILES+=usr/lib/libcapsicum.a -OLD_FILES+=usr/lib/libcapsicum.so -OLD_FILES+=usr/lib/libcapsicum_p.a -OLD_FILES+=usr/lib/libcasper.a -OLD_FILES+=usr/lib/libcasper.so -OLD_FILES+=usr/lib/libcasper_p.a -OLD_FILES+=usr/lib32/libcapsicum.a -OLD_FILES+=usr/lib32/libcapsicum.so -OLD_LIBS+=usr/lib32/libcapsicum.so.0 -OLD_FILES+=usr/lib32/libcapsicum_p.a -OLD_FILES+=usr/lib32/libcasper.a -OLD_FILES+=usr/lib32/libcasper.so -OLD_LIBS+=usr/lib32/libcasper.so.0 -OLD_FILES+=usr/lib32/libcasper_p.a OLD_FILES+=usr/share/man/man3/cap_clone.3.gz OLD_FILES+=usr/share/man/man3/cap_close.3.gz OLD_FILES+=usr/share/man/man3/cap_init.3.gz @@ -1195,8 +1159,6 @@ OLD_FILES+=usr/share/man/man3/cap_sock.3.gz OLD_FILES+=usr/share/man/man3/cap_unwrap.3.gz OLD_FILES+=usr/share/man/man3/cap_wrap.3.gz OLD_FILES+=usr/share/man/man3/cap_xfer_nvlist.3.gz -OLD_FILES+=usr/share/man/man3/libcapsicum.3.gz -OLD_FILES+=usr/share/man/man8/casperd.8.gz .endif .if ${MK_CCD} == no From owner-svn-src-all@freebsd.org Wed Feb 5 21:15:55 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A5B4922EF8C; Wed, 5 Feb 2020 21:15:55 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CZ9R3tFsz4BJl; Wed, 5 Feb 2020 21:15:55 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 803CF8F0D; Wed, 5 Feb 2020 21:15:55 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 015LFtJT026334; Wed, 5 Feb 2020 21:15:55 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 015LFtjR026333; Wed, 5 Feb 2020 21:15:55 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <202002052115.015LFtjR026333@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Wed, 5 Feb 2020 21:15:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r357603 - stable/11/tools/build/mk X-SVN-Group: stable-11 X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: stable/11/tools/build/mk X-SVN-Commit-Revision: 357603 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 21:15:55 -0000 Author: oshogbo Date: Wed Feb 5 21:15:55 2020 New Revision: 357603 URL: https://svnweb.freebsd.org/changeset/base/357603 Log: MFCr356926: Even when the MK_CASPER is set to "no" we still want to install man pages and the headers. If the user decides to install the system without Casper support, then the Casper functions are mocked, but they still exist in the system. PR: 242971 Modified: stable/11/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/11/ (props changed) Modified: stable/11/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/11/tools/build/mk/OptionalObsoleteFiles.inc Wed Feb 5 21:14:27 2020 (r357602) +++ stable/11/tools/build/mk/OptionalObsoleteFiles.inc Wed Feb 5 21:15:55 2020 (r357603) @@ -1146,19 +1146,6 @@ OLD_DIRS+=usr/tests/usr.bin/calendar .endif .if ${MK_CASPER} == no -OLD_FILES+=usr/include/libcasper.h -OLD_FILES+=usr/share/man/man3/cap_clone.3.gz -OLD_FILES+=usr/share/man/man3/cap_close.3.gz -OLD_FILES+=usr/share/man/man3/cap_init.3.gz -OLD_FILES+=usr/share/man/man3/cap_limit_get.3.gz -OLD_FILES+=usr/share/man/man3/cap_limit_set.3.gz -OLD_FILES+=usr/share/man/man3/cap_recv_nvlist.3.gz -OLD_FILES+=usr/share/man/man3/cap_send_nvlist.3.gz -OLD_FILES+=usr/share/man/man3/cap_service_open.3.gz -OLD_FILES+=usr/share/man/man3/cap_sock.3.gz -OLD_FILES+=usr/share/man/man3/cap_unwrap.3.gz -OLD_FILES+=usr/share/man/man3/cap_wrap.3.gz -OLD_FILES+=usr/share/man/man3/cap_xfer_nvlist.3.gz .endif .if ${MK_CCD} == no From owner-svn-src-all@freebsd.org Wed Feb 5 21:16:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 553A122F08D; Wed, 5 Feb 2020 21:16:52 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CZBX1dL6z4BVF; Wed, 5 Feb 2020 21:16:52 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 32C648F2C; Wed, 5 Feb 2020 21:16:52 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 015LGpTj026464; Wed, 5 Feb 2020 21:16:51 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 015LGpAV026463; Wed, 5 Feb 2020 21:16:51 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <202002052116.015LGpAV026463@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Wed, 5 Feb 2020 21:16:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r357604 - stable/11/tools/build/mk X-SVN-Group: stable-11 X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: stable/11/tools/build/mk X-SVN-Commit-Revision: 357604 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 21:16:52 -0000 Author: oshogbo Date: Wed Feb 5 21:16:51 2020 New Revision: 357604 URL: https://svnweb.freebsd.org/changeset/base/357604 Log: MFCr356928: When MK_CASPER=no is set remove files which are not needed to run system. PR: 242971 Modified: stable/11/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/11/ (props changed) Modified: stable/11/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/11/tools/build/mk/OptionalObsoleteFiles.inc Wed Feb 5 21:15:55 2020 (r357603) +++ stable/11/tools/build/mk/OptionalObsoleteFiles.inc Wed Feb 5 21:16:51 2020 (r357604) @@ -1146,6 +1146,15 @@ OLD_DIRS+=usr/tests/usr.bin/calendar .endif .if ${MK_CASPER} == no +OLD_LIBS+=lib/libcasper.so.1 +OLD_LIBS+=lib/casper/libcap_dns.so.2 +OLD_LIBS+=lib/casper/libcap_fileargs.so.1 +OLD_LIBS+=lib/casper/libcap_grp.so.1 +OLD_LIBS+=lib/casper/libcap_net.so.1 +OLD_LIBS+=lib/casper/libcap_pwd.so.1 +OLD_LIBS+=lib/casper/libcap_sysctl.so.1 +OLD_LIBS+=lib/casper/libcap_sysctl.so.2 +OLD_LIBS+=lib/casper/libcap_syslog.so.1 .endif .if ${MK_CCD} == no From owner-svn-src-all@freebsd.org Wed Feb 5 21:30:32 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 528AE22F82B; Wed, 5 Feb 2020 21:30:32 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CZVJ1ZzYz4CkZ; Wed, 5 Feb 2020 21:30:32 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2F0E79132; Wed, 5 Feb 2020 21:30:32 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 015LUWfT032741; Wed, 5 Feb 2020 21:30:32 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 015LUVAE032739; Wed, 5 Feb 2020 21:30:31 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202002052130.015LUVAE032739@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 5 Feb 2020 21:30:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r357605 - in stable: 11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs 11/sys/fs/pseudofs 12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs 12/sys/fs/pseudofs X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs 11/sys/fs/pseudofs 12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs 12/sys/fs/pseudofs X-SVN-Commit-Revision: 357605 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 21:30:32 -0000 Author: kevans Date: Wed Feb 5 21:30:31 2020 New Revision: 357605 URL: https://svnweb.freebsd.org/changeset/base/357605 Log: MFC r357410-r357411: Avoid duplicating VEXEC checks in VOP_CACHEDLOOKUP r357410: pseudofs: don't do VEXEC check in VOP_CACHEDLOOKUP VOP_CACHEDLOOKUP should assume that the appropriate VEXEC check has been done in the caller (vfs_cache_lookup), so it does not belong here. r357411: zfs: light refactor to indicate cachedlookup in zfs_lookup If we come from VOP_CACHEDLOOKUP, we must skip the VEXEC check as it will have been done in the caller (vfs_cache_lookup). This is a part of D23247, which may skip the earlier VEXEC check as well if the root fd was opened with O_SEARCH. This one required slightly more work as zfs_lookup may also be called indirectly as VOP_LOOKUP or a couple of other places where we must do the check. Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c stable/11/sys/fs/pseudofs/pseudofs_vnops.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c stable/12/sys/fs/pseudofs/pseudofs_vnops.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Feb 5 21:16:51 2020 (r357604) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Feb 5 21:30:31 2020 (r357605) @@ -1525,7 +1525,7 @@ zfs_lookup_lock(vnode_t *dvp, vnode_t *vp, const char /* ARGSUSED */ static int zfs_lookup(vnode_t *dvp, char *nm, vnode_t **vpp, struct componentname *cnp, - int nameiop, cred_t *cr, kthread_t *td, int flags) + int nameiop, cred_t *cr, kthread_t *td, int flags, boolean_t cached) { znode_t *zdp = VTOZ(dvp); znode_t *zp; @@ -1597,9 +1597,12 @@ zfs_lookup(vnode_t *dvp, char *nm, vnode_t **vpp, stru /* * Check accessibility of directory. */ - if (error = zfs_zaccess(zdp, ACE_EXECUTE, 0, B_FALSE, cr)) { - ZFS_EXIT(zfsvfs); - return (error); + if (!cached) { + error = zfs_zaccess(zdp, ACE_EXECUTE, 0, B_FALSE, cr); + if (error != 0) { + ZFS_EXIT(zfsvfs); + return (error); + } } if (zfsvfs->z_utf8 && u8_validate(nm, strlen(nm), @@ -4941,12 +4944,7 @@ zfs_freebsd_access(ap) } static int -zfs_freebsd_lookup(ap) - struct vop_lookup_args /* { - struct vnode *a_dvp; - struct vnode **a_vpp; - struct componentname *a_cnp; - } */ *ap; +zfs_freebsd_lookup(struct vop_lookup_args *ap, boolean_t cached) { struct componentname *cnp = ap->a_cnp; char nm[NAME_MAX + 1]; @@ -4955,10 +4953,17 @@ zfs_freebsd_lookup(ap) strlcpy(nm, cnp->cn_nameptr, MIN(cnp->cn_namelen + 1, sizeof(nm))); return (zfs_lookup(ap->a_dvp, nm, ap->a_vpp, cnp, cnp->cn_nameiop, - cnp->cn_cred, cnp->cn_thread, 0)); + cnp->cn_cred, cnp->cn_thread, 0, cached)); } static int +zfs_freebsd_cachedlookup(struct vop_cachedlookup_args *ap) +{ + + return (zfs_freebsd_lookup((struct vop_lookup_args *)ap, B_TRUE)); +} + +static int zfs_cache_lookup(ap) struct vop_lookup_args /* { struct vnode *a_dvp; @@ -4972,7 +4977,7 @@ zfs_cache_lookup(ap) if (zfsvfs->z_use_namecache) return (vfs_cache_lookup(ap)); else - return (zfs_freebsd_lookup(ap)); + return (zfs_freebsd_lookup(ap, B_FALSE)); } static int @@ -5535,7 +5540,7 @@ vop_getextattr { ZFS_ENTER(zfsvfs); error = zfs_lookup(ap->a_vp, NULL, &xvp, NULL, 0, ap->a_cred, td, - LOOKUP_XATTR); + LOOKUP_XATTR, B_FALSE); if (error != 0) { ZFS_EXIT(zfsvfs); return (error); @@ -5604,7 +5609,7 @@ vop_deleteextattr { ZFS_ENTER(zfsvfs); error = zfs_lookup(ap->a_vp, NULL, &xvp, NULL, 0, ap->a_cred, td, - LOOKUP_XATTR); + LOOKUP_XATTR, B_FALSE); if (error != 0) { ZFS_EXIT(zfsvfs); return (error); @@ -5672,7 +5677,7 @@ vop_setextattr { ZFS_ENTER(zfsvfs); error = zfs_lookup(ap->a_vp, NULL, &xvp, NULL, 0, ap->a_cred, td, - LOOKUP_XATTR | CREATE_XATTR_DIR); + LOOKUP_XATTR | CREATE_XATTR_DIR, B_FALSE); if (error != 0) { ZFS_EXIT(zfsvfs); return (error); @@ -5749,7 +5754,7 @@ vop_listextattr { *sizep = 0; error = zfs_lookup(ap->a_vp, NULL, &xvp, NULL, 0, ap->a_cred, td, - LOOKUP_XATTR); + LOOKUP_XATTR, B_FALSE); if (error != 0) { ZFS_EXIT(zfsvfs); /* @@ -6007,7 +6012,7 @@ struct vop_vector zfs_vnodeops = { .vop_reclaim = zfs_freebsd_reclaim, .vop_access = zfs_freebsd_access, .vop_lookup = zfs_cache_lookup, - .vop_cachedlookup = zfs_freebsd_lookup, + .vop_cachedlookup = zfs_freebsd_cachedlookup, .vop_getattr = zfs_freebsd_getattr, .vop_setattr = zfs_freebsd_setattr, .vop_create = zfs_freebsd_create, Modified: stable/11/sys/fs/pseudofs/pseudofs_vnops.c ============================================================================== --- stable/11/sys/fs/pseudofs/pseudofs_vnops.c Wed Feb 5 21:16:51 2020 (r357604) +++ stable/11/sys/fs/pseudofs/pseudofs_vnops.c Wed Feb 5 21:30:31 2020 (r357605) @@ -446,10 +446,6 @@ pfs_lookup(struct vop_cachedlookup_args *va) PFS_RETURN (ENOTDIR); KASSERT_PN_IS_DIR(pd); - error = VOP_ACCESS(vn, VEXEC, cnp->cn_cred, cnp->cn_thread); - if (error) - PFS_RETURN (error); - /* * Don't support DELETE or RENAME. CREATE is supported so * that O_CREAT will work, but the lookup will still fail if From owner-svn-src-all@freebsd.org Wed Feb 5 21:30:32 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EFC8922F831; Wed, 5 Feb 2020 21:30:32 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CZVJ695lz4Ckv; Wed, 5 Feb 2020 21:30:32 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CEAFC9133; Wed, 5 Feb 2020 21:30:32 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 015LUWbW032748; Wed, 5 Feb 2020 21:30:32 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 015LUWbR032746; Wed, 5 Feb 2020 21:30:32 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202002052130.015LUWbR032746@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 5 Feb 2020 21:30:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357605 - in stable: 11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs 11/sys/fs/pseudofs 12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs 12/sys/fs/pseudofs X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs 11/sys/fs/pseudofs 12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs 12/sys/fs/pseudofs X-SVN-Commit-Revision: 357605 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 21:30:33 -0000 Author: kevans Date: Wed Feb 5 21:30:31 2020 New Revision: 357605 URL: https://svnweb.freebsd.org/changeset/base/357605 Log: MFC r357410-r357411: Avoid duplicating VEXEC checks in VOP_CACHEDLOOKUP r357410: pseudofs: don't do VEXEC check in VOP_CACHEDLOOKUP VOP_CACHEDLOOKUP should assume that the appropriate VEXEC check has been done in the caller (vfs_cache_lookup), so it does not belong here. r357411: zfs: light refactor to indicate cachedlookup in zfs_lookup If we come from VOP_CACHEDLOOKUP, we must skip the VEXEC check as it will have been done in the caller (vfs_cache_lookup). This is a part of D23247, which may skip the earlier VEXEC check as well if the root fd was opened with O_SEARCH. This one required slightly more work as zfs_lookup may also be called indirectly as VOP_LOOKUP or a couple of other places where we must do the check. Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c stable/12/sys/fs/pseudofs/pseudofs_vnops.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c stable/11/sys/fs/pseudofs/pseudofs_vnops.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Feb 5 21:16:51 2020 (r357604) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Feb 5 21:30:31 2020 (r357605) @@ -1520,7 +1520,7 @@ zfs_lookup_lock(vnode_t *dvp, vnode_t *vp, const char /* ARGSUSED */ static int zfs_lookup(vnode_t *dvp, char *nm, vnode_t **vpp, struct componentname *cnp, - int nameiop, cred_t *cr, kthread_t *td, int flags) + int nameiop, cred_t *cr, kthread_t *td, int flags, boolean_t cached) { znode_t *zdp = VTOZ(dvp); znode_t *zp; @@ -1592,9 +1592,12 @@ zfs_lookup(vnode_t *dvp, char *nm, vnode_t **vpp, stru /* * Check accessibility of directory. */ - if (error = zfs_zaccess(zdp, ACE_EXECUTE, 0, B_FALSE, cr)) { - ZFS_EXIT(zfsvfs); - return (error); + if (!cached) { + error = zfs_zaccess(zdp, ACE_EXECUTE, 0, B_FALSE, cr); + if (error != 0) { + ZFS_EXIT(zfsvfs); + return (error); + } } if (zfsvfs->z_utf8 && u8_validate(nm, strlen(nm), @@ -4939,12 +4942,7 @@ zfs_freebsd_access(ap) } static int -zfs_freebsd_lookup(ap) - struct vop_lookup_args /* { - struct vnode *a_dvp; - struct vnode **a_vpp; - struct componentname *a_cnp; - } */ *ap; +zfs_freebsd_lookup(struct vop_lookup_args *ap, boolean_t cached) { struct componentname *cnp = ap->a_cnp; char nm[NAME_MAX + 1]; @@ -4953,10 +4951,17 @@ zfs_freebsd_lookup(ap) strlcpy(nm, cnp->cn_nameptr, MIN(cnp->cn_namelen + 1, sizeof(nm))); return (zfs_lookup(ap->a_dvp, nm, ap->a_vpp, cnp, cnp->cn_nameiop, - cnp->cn_cred, cnp->cn_thread, 0)); + cnp->cn_cred, cnp->cn_thread, 0, cached)); } static int +zfs_freebsd_cachedlookup(struct vop_cachedlookup_args *ap) +{ + + return (zfs_freebsd_lookup((struct vop_lookup_args *)ap, B_TRUE)); +} + +static int zfs_cache_lookup(ap) struct vop_lookup_args /* { struct vnode *a_dvp; @@ -4970,7 +4975,7 @@ zfs_cache_lookup(ap) if (zfsvfs->z_use_namecache) return (vfs_cache_lookup(ap)); else - return (zfs_freebsd_lookup(ap)); + return (zfs_freebsd_lookup(ap, B_FALSE)); } static int @@ -5532,7 +5537,7 @@ vop_getextattr { ZFS_ENTER(zfsvfs); error = zfs_lookup(ap->a_vp, NULL, &xvp, NULL, 0, ap->a_cred, td, - LOOKUP_XATTR); + LOOKUP_XATTR, B_FALSE); if (error != 0) { ZFS_EXIT(zfsvfs); return (error); @@ -5601,7 +5606,7 @@ vop_deleteextattr { ZFS_ENTER(zfsvfs); error = zfs_lookup(ap->a_vp, NULL, &xvp, NULL, 0, ap->a_cred, td, - LOOKUP_XATTR); + LOOKUP_XATTR, B_FALSE); if (error != 0) { ZFS_EXIT(zfsvfs); return (error); @@ -5669,7 +5674,7 @@ vop_setextattr { ZFS_ENTER(zfsvfs); error = zfs_lookup(ap->a_vp, NULL, &xvp, NULL, 0, ap->a_cred, td, - LOOKUP_XATTR | CREATE_XATTR_DIR); + LOOKUP_XATTR | CREATE_XATTR_DIR, B_FALSE); if (error != 0) { ZFS_EXIT(zfsvfs); return (error); @@ -5746,7 +5751,7 @@ vop_listextattr { *sizep = 0; error = zfs_lookup(ap->a_vp, NULL, &xvp, NULL, 0, ap->a_cred, td, - LOOKUP_XATTR); + LOOKUP_XATTR, B_FALSE); if (error != 0) { ZFS_EXIT(zfsvfs); /* @@ -6005,7 +6010,7 @@ struct vop_vector zfs_vnodeops = { .vop_access = zfs_freebsd_access, .vop_allocate = VOP_EINVAL, .vop_lookup = zfs_cache_lookup, - .vop_cachedlookup = zfs_freebsd_lookup, + .vop_cachedlookup = zfs_freebsd_cachedlookup, .vop_getattr = zfs_freebsd_getattr, .vop_setattr = zfs_freebsd_setattr, .vop_create = zfs_freebsd_create, Modified: stable/12/sys/fs/pseudofs/pseudofs_vnops.c ============================================================================== --- stable/12/sys/fs/pseudofs/pseudofs_vnops.c Wed Feb 5 21:16:51 2020 (r357604) +++ stable/12/sys/fs/pseudofs/pseudofs_vnops.c Wed Feb 5 21:30:31 2020 (r357605) @@ -448,10 +448,6 @@ pfs_lookup(struct vop_cachedlookup_args *va) PFS_RETURN (ENOTDIR); KASSERT_PN_IS_DIR(pd); - error = VOP_ACCESS(vn, VEXEC, cnp->cn_cred, cnp->cn_thread); - if (error) - PFS_RETURN (error); - /* * Don't support DELETE or RENAME. CREATE is supported so * that O_CREAT will work, but the lookup will still fail if From owner-svn-src-all@freebsd.org Wed Feb 5 21:35:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7522422FCA2; Wed, 5 Feb 2020 21:35:03 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-vk1-xa43.google.com (mail-vk1-xa43.google.com [IPv6:2607:f8b0:4864:20::a43]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CZbV32V2z4DMn; Wed, 5 Feb 2020 21:35:02 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-vk1-xa43.google.com with SMTP id g7so1004168vkl.12; Wed, 05 Feb 2020 13:35:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LNCtBoeq8Qwqi1YJuPEhTl3bQ6FlHoHuehI57EFzovM=; b=Do3Cmd76hRvDJuUCxqRe13bKSCCvtdzFVnjJxcuaRXtfYQgU6pRdOnBUL9KRkr96uv joIi5BmoE3Uomu39hP3M+8xKs4ebuKA8ULtOoo2tw96aMRgV3TCTYY7eptxRGqUpemRo +nF89IPZ6cbkW0nAqx/BQ+GDZ+bB2v/bHQIQlce5yaMnSEBKtO/FeC52b01PIxDtDRU/ iv+jM3463hh89LNwbtJUkknBziXsa6/9Gw23fhm98LNLD4lrOZ6Y59lrrMsyQFhFv+yH mkJkKZT7lII35K0Hj5bFNqmhRxY2kk6BLjXyopVcC02nlnoiUOlALrfFp1mSaW7P2k3X txPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=LNCtBoeq8Qwqi1YJuPEhTl3bQ6FlHoHuehI57EFzovM=; b=ETErRE29icp5pPA41T202AHM1m1UTTA4ENNKmKPyxDg3liT12N8bRUgae2LqymYGPd mjcnL1K13q5fyBzlQ3Rj3f9URZlSnTGqcJExYYZn7lJltAChafEABWxmKJhRmc2jG6qx 564VXzan4lksjg/zrnSaqMQXmqDXzA5TYxXdQO7WPpMJNSe5NAYIZPwrIwpICGODn8vV o4R7yowqKjHld8V5CLhs5JDBHfJHUmQ7giIkMS7ZMJpzoccAyjAJG4sdgeJ4hHzTLJJQ 1erssjnOo74LIwsI3mSm+GG22TYiUUSP8zQoDPYIzUgkpS0Lsv59QGkOYaI1X/v3UyyZ fDjA== X-Gm-Message-State: APjAAAUqhuez2T8c6p3plzdqxfhMXRU81MHmRkVNzGCe7ceszSIlncxB DNvn/DYnUQdegnJ+Z7DjLTUWe+Et5TrOmGUM5FDCGjpk X-Google-Smtp-Source: APXvYqzDi3ZScoeXVG5EaADOnDvsNF1KoG3li4hDSBB82CTIgBQoez+65xVEstpOYQSJ1DxroWqFZmr4XzsWKZz49aQ= X-Received: by 2002:a1f:9c92:: with SMTP id f140mr3053718vke.87.1580938500347; Wed, 05 Feb 2020 13:35:00 -0800 (PST) MIME-Version: 1.0 References: <202002012036.011KaajV051873@repo.freebsd.org> In-Reply-To: <202002012036.011KaajV051873@repo.freebsd.org> From: Enji Cooper Date: Wed, 5 Feb 2020 13:34:48 -0800 Message-ID: Subject: Re: svn commit: r357384 - head/sys/kern To: Mateusz Guzik Cc: src-committers , svn-src-all , svn-src-head , Martin Matuska Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 48CZbV32V2z4DMn X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=Do3Cmd76; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of yaneurabeya@gmail.com designates 2607:f8b0:4864:20::a43 as permitted sender) smtp.mailfrom=yaneurabeya@gmail.com X-Spamd-Result: default: False [-3.00 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE_FREEMAIL(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; IP_SCORE(0.00)[ip: (2.52), ipnet: 2607:f8b0::/32(-1.98), asn: 15169(-1.74), country: US(-0.05)]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[3.4.a.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 21:35:03 -0000 On Sat, Feb 1, 2020 at 12:36 PM Mateusz Guzik wrote: > > Author: mjg > Date: Sat Feb 1 20:36:35 2020 > New Revision: 357384 > URL: https://svnweb.freebsd.org/changeset/base/357384 > > Log: > cache: remove vnode -> path lookup disablement > > It seems to be of little to no use even when debugging. > > Interested parties can resurrect it and gate compilation with a macro. Hi Mateusz, This orphans some other things in the kernel that should potentially be removed as well: $ grep -r 'debug\.disablefullpath' ~/svn/freebsd/src/sys/ sys/kern/kern_jail.c: /* proceed if sysctl debug.disablefullpath == 1 */ sys/kern/vfs_mount.c: /* debug.disablefullpath == 1 results in ENODEV */ Cheers, -Enji From owner-svn-src-all@freebsd.org Wed Feb 5 22:29:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 97502231133; Wed, 5 Feb 2020 22:29:02 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Cbnp3XH4z4Gmj; Wed, 5 Feb 2020 22:29:02 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5BD459C1E; Wed, 5 Feb 2020 22:29:02 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 015MT27w068967; Wed, 5 Feb 2020 22:29:02 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 015MT2n0068966; Wed, 5 Feb 2020 22:29:02 GMT (envelope-from np@FreeBSD.org) Message-Id: <202002052229.015MT2n0068966@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 5 Feb 2020 22:29:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357606 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 357606 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 22:29:02 -0000 Author: np Date: Wed Feb 5 22:29:01 2020 New Revision: 357606 URL: https://svnweb.freebsd.org/changeset/base/357606 Log: cxgbe(4): Add native netmap support to the main interface. This means that extra virtual interfaces (VIs) created with hw.cxgbe.num_vis are no longer required to use netmap. Use this tunable to enable native netmap support on the main interface: hw.cxgbe.native_netmap="3" There is no change in default behavior. Suggested by: jch@ MFC after: 2 weeks Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Wed Feb 5 21:30:31 2020 (r357605) +++ head/sys/dev/cxgbe/t4_main.c Wed Feb 5 22:29:01 2020 (r357606) @@ -401,6 +401,22 @@ SYSCTL_INT(_hw_cxgbe_toe_rexmt_backoff, OID_AUTO, 15, #endif #ifdef DEV_NETMAP +#define NN_MAIN_VI (1 << 0) /* Native netmap on the main VI */ +#define NN_EXTRA_VI (1 << 1) /* Native netmap on the extra VI(s) */ +static int t4_native_netmap = NN_EXTRA_VI; +SYSCTL_INT(_hw_cxgbe, OID_AUTO, native_netmap, CTLFLAG_RDTUN, &t4_native_netmap, + 0, "Native netmap support. bit 0 = main VI, bit 1 = extra VIs"); + +#define NNMTXQ 8 +static int t4_nnmtxq = -NNMTXQ; +SYSCTL_INT(_hw_cxgbe, OID_AUTO, nnmtxq, CTLFLAG_RDTUN, &t4_nnmtxq, 0, + "Number of netmap TX queues"); + +#define NNMRXQ 8 +static int t4_nnmrxq = -NNMRXQ; +SYSCTL_INT(_hw_cxgbe, OID_AUTO, nnmrxq, CTLFLAG_RDTUN, &t4_nnmrxq, 0, + "Number of netmap RX queues"); + #define NNMTXQ_VI 2 static int t4_nnmtxq_vi = -NNMTXQ_VI; SYSCTL_INT(_hw_cxgbe, OID_AUTO, nnmtxq_vi, CTLFLAG_RDTUN, &t4_nnmtxq_vi, 0, @@ -621,6 +637,8 @@ struct intrs_and_queues { uint16_t nrxq; /* # of NIC rxq's for each port */ uint16_t nofldtxq; /* # of TOE/ETHOFLD txq's for each port */ uint16_t nofldrxq; /* # of TOE rxq's for each port */ + uint16_t nnmtxq; /* # of netmap txq's */ + uint16_t nnmrxq; /* # of netmap rxq's */ /* The vcxgbe/vcxl interfaces use these and not the ones above. */ uint16_t ntxq_vi; /* # of NIC txq's */ @@ -1247,10 +1265,16 @@ t4_attach(device_t dev) } #endif #ifdef DEV_NETMAP - if (num_vis > 1) { - s->nnmrxq = nports * (num_vis - 1) * iaq.nnmrxq_vi; - s->nnmtxq = nports * (num_vis - 1) * iaq.nnmtxq_vi; + s->nnmrxq = 0; + s->nnmtxq = 0; + if (t4_native_netmap & NN_MAIN_VI) { + s->nnmrxq += nports * iaq.nnmrxq; + s->nnmtxq += nports * iaq.nnmtxq; } + if (num_vis > 1 && t4_native_netmap & NN_EXTRA_VI) { + s->nnmrxq += nports * (num_vis - 1) * iaq.nnmrxq_vi; + s->nnmtxq += nports * (num_vis - 1) * iaq.nnmtxq_vi; + } s->neq += s->nnmtxq + s->nnmrxq; s->niq += s->nnmrxq; @@ -1344,14 +1368,17 @@ t4_attach(device_t dev) ofld_rqidx += vi->nofldrxq; #endif #ifdef DEV_NETMAP - if (j > 0) { - vi->first_nm_rxq = nm_rqidx; - vi->first_nm_txq = nm_tqidx; + vi->first_nm_rxq = nm_rqidx; + vi->first_nm_txq = nm_tqidx; + if (j == 0) { + vi->nnmrxq = iaq.nnmrxq; + vi->nnmtxq = iaq.nnmtxq; + } else { vi->nnmrxq = iaq.nnmrxq_vi; vi->nnmtxq = iaq.nnmtxq_vi; - nm_rqidx += vi->nnmrxq; - nm_tqidx += vi->nnmtxq; } + nm_rqidx += vi->nnmrxq; + nm_tqidx += vi->nnmtxq; #endif } } @@ -3316,10 +3343,10 @@ fixup_devlog_params(struct adapter *sc) static void update_nirq(struct intrs_and_queues *iaq, int nports) { - int extra = T4_EXTRA_INTR; - iaq->nirq = extra; - iaq->nirq += nports * (iaq->nrxq + iaq->nofldrxq); + iaq->nirq = T4_EXTRA_INTR; + iaq->nirq += nports * max(iaq->nrxq, iaq->nnmrxq); + iaq->nirq += nports * iaq->nofldrxq; iaq->nirq += nports * (iaq->num_vis - 1) * max(iaq->nrxq_vi, iaq->nnmrxq_vi); iaq->nirq += nports * (iaq->num_vis - 1) * iaq->nofldrxq_vi; @@ -3358,8 +3385,14 @@ calculate_iaq(struct adapter *sc, struct intrs_and_que } #endif #ifdef DEV_NETMAP - iaq->nnmtxq_vi = t4_nnmtxq_vi; - iaq->nnmrxq_vi = t4_nnmrxq_vi; + if (t4_native_netmap & NN_MAIN_VI) { + iaq->nnmtxq = t4_nnmtxq; + iaq->nnmrxq = t4_nnmrxq; + } + if (t4_native_netmap & NN_EXTRA_VI) { + iaq->nnmtxq_vi = t4_nnmtxq_vi; + iaq->nnmrxq_vi = t4_nnmrxq_vi; + } #endif update_nirq(iaq, nports); @@ -3417,6 +3450,8 @@ calculate_iaq(struct adapter *sc, struct intrs_and_que do { iaq->nrxq--; } while (!powerof2(iaq->nrxq)); + if (iaq->nnmrxq > iaq->nrxq) + iaq->nnmrxq = iaq->nrxq; } if (iaq->nofldrxq > 1) iaq->nofldrxq >>= 1; @@ -3438,10 +3473,14 @@ calculate_iaq(struct adapter *sc, struct intrs_and_que device_printf(sc->dev, "running with minimal number of queues. " "itype %d, navail %u.\n", itype, navail); iaq->nirq = 1; - MPASS(iaq->nrxq == 1); + iaq->nrxq = 1; iaq->ntxq = 1; - if (iaq->nofldrxq > 1) + if (iaq->nofldrxq > 0) { + iaq->nofldrxq = 1; iaq->nofldtxq = 1; + } + iaq->nnmtxq = 0; + iaq->nnmrxq = 0; done: MPASS(iaq->num_vis > 0); if (iaq->num_vis > 1) { @@ -10892,6 +10931,8 @@ tweak_tunables(void) #endif #ifdef DEV_NETMAP + calculate_nqueues(&t4_nnmtxq, nc, NNMTXQ); + calculate_nqueues(&t4_nnmrxq, nc, NNMRXQ); calculate_nqueues(&t4_nnmtxq_vi, nc, NNMTXQ_VI); calculate_nqueues(&t4_nnmrxq_vi, nc, NNMRXQ_VI); #endif From owner-svn-src-all@freebsd.org Wed Feb 5 23:00:36 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D9E3023199C; Wed, 5 Feb 2020 23:00:36 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CcVC6Z54z4J2j; Wed, 5 Feb 2020 23:00:35 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: by mail-pf1-x443.google.com with SMTP id p14so1987296pfn.4; Wed, 05 Feb 2020 15:00:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=SZiEvVYMS6VTCfbxWDRtGO5F7S4t0UfhxJLYw17/tVo=; b=IEVYPNEAJKw5cjZP7rD8RlT0rRnvegZl1AL92vg2GM2fqHPCjoTjp+2QaZR25SC/ye B1y7aOW1vIBe66mYqsuo0wVRMY1a7tTLFtHacNFVR2qkSf4VGeHW9JSpTW4lgLEa+wJO OqdEGi6y/iyNa9cjL6ghRLCNZ24AAASTsifQZPhoAdpQ+Zzj4QvM8yhnCpS0JL9dqbfb zKYxDFHjbUUXpkYYl9ZcoG3ifBEn2iANRbx8GfAOURI1+HzpKzoDLxKUohF5nu6XbsYG w7NDDDJ12VgTWJWFd8lUIRMueXS56f8yGWAvy7jTgS2ZnX3AFAZCa0OQ7fLw/PWo31O3 faGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=SZiEvVYMS6VTCfbxWDRtGO5F7S4t0UfhxJLYw17/tVo=; b=HSNiGVZ2Rn6u9cqJgxhN/7pFro7V0Elwqw6JZ2vNd3JYRFxkGd4etJhFdW8kgVViP8 b9gb0Ys7bqV1NDmMc/AKZ6hQ1RenEVxhrySiangsP3DP+all2Jj/PpyQw9HoxNltu4m+ wwzqV+u7HYC2oR4WhlDPeG6Xwn5vAdqIrtHuZ285rBkbuuWqqKFB6AJDJeArrAxRmrXC SVIEZFJlyE50rAN2gw2uLMtoVSWYVVBXkhASqR2Fv3v0lJ27nCxIT4I3u5Hv2g6Dxc3r ifKBlQGBm+D80A5xvbhUN8lX2aUOZ5E3j0nTDOZhYV3awlv91Pn1d6+wl/1cipdgp/wB 5fLg== X-Gm-Message-State: APjAAAVOyxOXn+Q2hgry/X/tYALHGSZogfR9JwDXN3rA6IP7hMYsR78T MkaQHzbPE/G7wZ3mff7HFf84j/T3 X-Google-Smtp-Source: APXvYqwCcA1yqD4UV+YDsu1cCYu1sqCKpZS1liQpseWrzWtx0Ev1BwAEpqcLHKj1pH+I1TrRFIikSw== X-Received: by 2002:a63:36c2:: with SMTP id d185mr246286pga.59.1580943634051; Wed, 05 Feb 2020 15:00:34 -0800 (PST) Received: from [10.192.166.0] (stargate.chelsio.com. [12.32.117.8]) by smtp.googlemail.com with ESMTPSA id k3sm815382pgc.3.2020.02.05.15.00.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 05 Feb 2020 15:00:32 -0800 (PST) Sender: Navdeep Parhar Subject: Re: svn commit: r357553 - head/sys/dev/cxgbe To: Slawa Olhovchenkov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202002050013.0150DFCC027900@repo.freebsd.org> <20200205111926.GF8028@zxy.spb.ru> From: Navdeep Parhar Autocrypt: addr=np@FreeBSD.org; prefer-encrypt=mutual; keydata= mQGiBEosaGcRBACOXnXquGEW53BjpMt2jViod/TUf1xgjMekcbDxqOODPeX7eYfrwJ8G6BCN OpGjBmWDu/JcNj4Z+gmTilJ6WLZQ7ecFZfEeO91pt6ys0cyWh0xfO+/mT83D7W81S/kqrJBk QbBIdV6LumevdErHo272r8RcMELC4Ru87eRtX3hmEwCgnnGNJMpQFUfYTt5XE7nY0yQoeV8D /0OcWmJbEZWxX9O7AuliCe3zd2Dw0B4LB9SZ2Dis7+gpVd3xVgYnt5wRE9kM+ThgrMA/wqr8 07qmEG6bcfUsfwwGN9YUtNF3xAN07cXTs026sCIFNZK816PrThBzCgkwR7pDpkMzGWIBr8Wi XXy0eB+JlQ6UV4PEiXuZ5ulzP0b1A/9CZm3wJfrNC0r1gMyrfVedg4zwKU997bmPLGcYs+rW XDTI9CvMseOUYn4CoDZQCp/9zxuHK+VU7Y/w0c/hVE5ERACSn4SjN2unEDstK9njZBMHEPVk Ae/YvSG5cmc97SHlVE+eu/bbLKcvFb6rRLPOaVFQJMJA2VJEGWtYhvP7ZbQfTmF2ZGVlcCBQ YXJoYXIgPG5wQEZyZWVCU0Qub3JnPohgBBMRAgAgBQJKLGhnAhsDBgsJCAcDAgQVAggDBBYC AwECHgECF4AACgkQyrIrk6yriBL0MQCfUJOiS2PbJFDeiav1ylcXXwfpggAAoJRoS7GDENGy M4BzjJ4b0ptZqTLRuQINBEosaGcQCACFCWs47SL4DQA6bNDlVJu4w8wLf8uVOyatuGmdXX8Y /OTVQJgA3vS+ODNVJCxhKVlvhcn7bhBdGdWKS9K+lr8+eEvr4hf2bQpesoHC+uFgKyILkCBN L8raixbhysyq0pfZWWDJMyn+G42BG1yJJi+bykygdpYnbIVA8dYHmBibI8mkPKOHSohjXT1S RfGGn+l1w54OO4NlJhCXMkjTA/Z9Bt4XeaiR85uJi0UUfV8FGZHhgSvT+/P1xIvz+nytuehS P/QLXl13CtAG/nKVkAcZnsT/3NrJ4Z2r45k+c50Wrf210scAaBogrrV5eIHfNGgOANApN8+8 vj+aXO4pXRuXAAMFB/44ea8rd+P5N3OMrfuM8i91Qe1bJ+BIoroKPOr8jvCry0h3QpdfLKUN IgaqbS3JZeBJ8HHnWSGCF+o6H5gzRe1hvylPEclLPDCuPe7T746h9Mzejf2hNDJvOg+BuweD ZW4KhovVbdS+syJEvpGF4bO8qgHT2CKgruXSHbFetdQWbkM0rfMmTuo0GcR2BEVrPb/SPFv6 4ZZyAZzmnGO4vT1bzClnTzJixrDpH74M3vSEYegMB4KdbLYBi8Jx4QUKgVEhJHjJubKWX4et yU/uuehOC3xYrmr1UXvsom3U8r36Dvdo77Yr3dgDVXa7bolNx0TIhdWxZI+R4z9E75QY+/wg iEkEGBECAAkFAkosaGcCGwwACgkQyrIrk6yriBI+JQCfUxgyqGtzZvLh5Al7gsTmRc11PLwA niD3NfWGRcO2+9uxSSQqRH1ywC4n Message-ID: <06ca69ae-32f4-3488-480c-5c1a7c027612@FreeBSD.org> Date: Wed, 5 Feb 2020 15:00:31 -0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.4.2 MIME-Version: 1.0 In-Reply-To: <20200205111926.GF8028@zxy.spb.ru> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 48CcVC6Z54z4J2j X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=IEVYPNEA; dmarc=none; spf=pass (mx1.freebsd.org: domain of nparhar@gmail.com designates 2607:f8b0:4864:20::443 as permitted sender) smtp.mailfrom=nparhar@gmail.com X-Spamd-Result: default: False [-3.09 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCVD_IN_DNSWL_NONE(0.00)[3.4.4.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; IP_SCORE(-0.89)[ip: (-0.66), ipnet: 2607:f8b0::/32(-1.98), asn: 15169(-1.74), country: US(-0.05)]; FORGED_SENDER(0.30)[np@FreeBSD.org,nparhar@gmail.com]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[np@FreeBSD.org,nparhar@gmail.com]; MID_RHS_MATCH_FROM(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 23:00:36 -0000 On 2/5/20 3:19 AM, Slawa Olhovchenkov wrote: > On Wed, Feb 05, 2020 at 12:13:15AM +0000, Navdeep Parhar wrote: > >> Author: np >> Date: Wed Feb 5 00:13:15 2020 >> New Revision: 357553 >> URL: https://svnweb.freebsd.org/changeset/base/357553 >> >> Log: >> cxgbe(4): Add a knob to allow netmap tx traffic to be checksummed by >> the hardware. >> >> hw.cxgbe.nm_txcsum=1 > > Very interesting. > Please, describe some more detail about using this feture (for > example, set this before driver loading? first netmap open? any netmap > open? on the fly?) > If you set this to 1 then all netmap Tx traffic that is recognized as valid TCP/UDP on IP/IPv6 by the chip will get L3 and L4 checksums inserted in proper places automatically. This means a netmap application trying to send legitimate traffic doesn't have to calculate checksums in software. It is safe to change this at any time and it will take effect immediately. netmap(4) says that hw checksum should be disabled on the interface but cxgbe has always had a way to bypass this. It used to be via the normal csum capabilities of the interface but those sometimes caused confusion because they aren't supposed to be set with netmap so r355673 removed netmap tx checksumming. This rev brought it back with a driver-specific knob. Regards, Navdeep From owner-svn-src-all@freebsd.org Thu Feb 6 01:25:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EFA63234CD2; Thu, 6 Feb 2020 01:25:30 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CgjQ62h4z4QBG; Thu, 6 Feb 2020 01:25:30 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA8BFBEDF; Thu, 6 Feb 2020 01:25:30 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0161PU9d076254; Thu, 6 Feb 2020 01:25:30 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0161PUbK076253; Thu, 6 Feb 2020 01:25:30 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <202002060125.0161PUbK076253@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Thu, 6 Feb 2020 01:25:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357607 - head/sys/powerpc/powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/powerpc X-SVN-Commit-Revision: 357607 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 01:25:31 -0000 Author: jhibbits Date: Thu Feb 6 01:25:30 2020 New Revision: 357607 URL: https://svnweb.freebsd.org/changeset/base/357607 Log: powerpc: Fix altivec disabling in set_mcontext() We somewhat blindly copy the srr1 from the new context to the trap frame, but disable FPU and VSX unconditionally, relying on the trap to re-enable them. This works because the FPU manages the VSX extended FP registers, which is governed by the PCB_FPFREGS flag. However, with altivec, we would blindly disable PSL_VEC, without touching PCB_VEC. Handle this case by disabling altivec in both srr1 and pcb_flags, if the mcontext doesn't have _MC_AV_VALID set. Reported by: pkubaj Modified: head/sys/powerpc/powerpc/exec_machdep.c Modified: head/sys/powerpc/powerpc/exec_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/exec_machdep.c Wed Feb 5 22:29:01 2020 (r357606) +++ head/sys/powerpc/powerpc/exec_machdep.c Thu Feb 6 01:25:30 2020 (r357607) @@ -526,6 +526,9 @@ set_mcontext(struct thread *td, mcontext_t *mcp) pcb->pcb_vec.vscr = mcp->mc_vscr; pcb->pcb_vec.vrsave = mcp->mc_vrsave; memcpy(pcb->pcb_vec.vr, mcp->mc_avec, sizeof(mcp->mc_avec)); + } else { + tf->srr1 &= ~PSL_VEC; + pcb->pcb_flags &= ~PCB_VEC; } return (0); From owner-svn-src-all@freebsd.org Thu Feb 6 07:45:08 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 02A38245909; Thu, 6 Feb 2020 07:45:08 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Cr7R646lz3GPv; Thu, 6 Feb 2020 07:45:07 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C74771864B; Thu, 6 Feb 2020 07:45:07 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0167j7HG011559; Thu, 6 Feb 2020 07:45:07 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0167j7aW011558; Thu, 6 Feb 2020 07:45:07 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202002060745.0167j7aW011558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 6 Feb 2020 07:45:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r357608 - vendor/xz/dist/src/xz X-SVN-Group: vendor X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: vendor/xz/dist/src/xz X-SVN-Commit-Revision: 357608 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 07:45:08 -0000 Author: delphij Date: Thu Feb 6 07:45:07 2020 New Revision: 357608 URL: https://svnweb.freebsd.org/changeset/base/357608 Log: Apply a reduced version of upstream 353970510895f6a80adfe60cf71b70a95adfa8bc which implements memory limit in xz(1) when running in 32-bit mode. The change is applied directly in vendor area to ease future import. Modified: vendor/xz/dist/src/xz/hardware.c vendor/xz/dist/src/xz/xz.1 Modified: vendor/xz/dist/src/xz/hardware.c ============================================================================== --- vendor/xz/dist/src/xz/hardware.c Thu Feb 6 01:25:30 2020 (r357607) +++ vendor/xz/dist/src/xz/hardware.c Thu Feb 6 07:45:07 2020 (r357608) @@ -68,8 +68,38 @@ hardware_memlimit_set(uint64_t new_memlimit, new_memlimit = (uint32_t)new_memlimit * total_ram / 100; } - if (set_compress) + if (set_compress) { memlimit_compress = new_memlimit; + +#if SIZE_MAX == UINT32_MAX + // FIXME? + // + // When running a 32-bit xz on a system with a lot of RAM and + // using a percentage-based memory limit, the result can be + // bigger than the 32-bit address space. Limiting the limit + // below SIZE_MAX for compression (not decompression) makes + // xz lower the compression settings (or number of threads) + // to a level that *might* work. In practice it has worked + // when using a 64-bit kernel that gives full 4 GiB address + // space to 32-bit programs. In other situations this might + // still be too high, like 32-bit kernels that may give much + // less than 4 GiB to a single application. + // + // So this is an ugly hack but I will keep it here while + // it does more good than bad. + // + // Use a value less than SIZE_MAX so that there's some room + // for the xz program and so on. Don't use 4000 MiB because + // it could look like someone mixed up base-2 and base-10. + const uint64_t limit_max = UINT64_C(4020) << 20; + + // UINT64_MAX is a special case for the string "max" so + // that has to be handled specially. + if (memlimit_compress != UINT64_MAX + && memlimit_compress > limit_max) + memlimit_compress = limit_max; +#endif + } if (set_decompress) memlimit_decompress = new_memlimit; Modified: vendor/xz/dist/src/xz/xz.1 ============================================================================== --- vendor/xz/dist/src/xz/xz.1 Thu Feb 6 01:25:30 2020 (r357607) +++ vendor/xz/dist/src/xz/xz.1 Thu Feb 6 07:45:07 2020 (r357608) @@ -1005,6 +1005,25 @@ instead of until the details have been decided. .RE .IP "" +For 32-bit +.BR xz +there is a special case: if the +.I limit +would be over +.BR "4020\ MiB" , +the +.I limit +is set to +.BR "4020\ MiB" . +(The values +.B 0 +and +.B max +aren't affected by this. +A similar feature doesn't exist for decompression.) +This can be helpful when a 32-bit executable has access +to 4\ GiB address space while hopefully doing no harm in other situations. +.IP "" See also the section .BR "Memory usage" . .TP From owner-svn-src-all@freebsd.org Thu Feb 6 07:47:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7D7292459CC; Thu, 6 Feb 2020 07:47:29 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CrB92mf6z3GY5; Thu, 6 Feb 2020 07:47:29 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5A5881865B; Thu, 6 Feb 2020 07:47:29 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0167lTB4011788; Thu, 6 Feb 2020 07:47:29 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0167lSQR011785; Thu, 6 Feb 2020 07:47:28 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202002060747.0167lSQR011785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 6 Feb 2020 07:47:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357609 - in head/contrib/xz/src: common xz X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in head/contrib/xz/src: common xz X-SVN-Commit-Revision: 357609 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 07:47:29 -0000 Author: delphij Date: Thu Feb 6 07:47:28 2020 New Revision: 357609 URL: https://svnweb.freebsd.org/changeset/base/357609 Log: MFV r357608: Limit memory usage in xz(1) instead of in tuklib. Apply upstream 353970510895f6a80adfe60cf71b70a95adfa8bc to limit memory usage on 32-bit binary to 4020 MiB. Submitted by: Lasse Collin Reviewed by: kib, bcr Differential Revision: https://reviews.freebsd.org/D23474 Modified: head/contrib/xz/src/common/tuklib_physmem.c head/contrib/xz/src/xz/hardware.c head/contrib/xz/src/xz/xz.1 Directory Properties: head/contrib/xz/ (props changed) Modified: head/contrib/xz/src/common/tuklib_physmem.c ============================================================================== --- head/contrib/xz/src/common/tuklib_physmem.c Thu Feb 6 07:45:07 2020 (r357608) +++ head/contrib/xz/src/common/tuklib_physmem.c Thu Feb 6 07:47:28 2020 (r357609) @@ -45,7 +45,6 @@ # include #elif defined(TUKLIB_PHYSMEM_SYSCONF) -# include # include #elif defined(TUKLIB_PHYSMEM_SYSCTL) @@ -146,16 +145,13 @@ tuklib_physmem(void) #elif defined(TUKLIB_PHYSMEM_SYSCONF) const long pagesize = sysconf(_SC_PAGESIZE); const long pages = sysconf(_SC_PHYS_PAGES); - if (pagesize != -1 && pages != -1) { + if (pagesize != -1 && pages != -1) // According to docs, pagesize * pages can overflow. // Simple case is 32-bit box with 4 GiB or more RAM, // which may report exactly 4 GiB of RAM, and "long" // being 32-bit will overflow. Casting to uint64_t // hopefully avoids overflows in the near future. ret = (uint64_t)pagesize * (uint64_t)pages; - if (ret > SIZE_T_MAX) - ret = SIZE_T_MAX; - } #elif defined(TUKLIB_PHYSMEM_SYSCTL) int name[2] = { Modified: head/contrib/xz/src/xz/hardware.c ============================================================================== --- head/contrib/xz/src/xz/hardware.c Thu Feb 6 07:45:07 2020 (r357608) +++ head/contrib/xz/src/xz/hardware.c Thu Feb 6 07:47:28 2020 (r357609) @@ -68,8 +68,38 @@ hardware_memlimit_set(uint64_t new_memlimit, new_memlimit = (uint32_t)new_memlimit * total_ram / 100; } - if (set_compress) + if (set_compress) { memlimit_compress = new_memlimit; + +#if SIZE_MAX == UINT32_MAX + // FIXME? + // + // When running a 32-bit xz on a system with a lot of RAM and + // using a percentage-based memory limit, the result can be + // bigger than the 32-bit address space. Limiting the limit + // below SIZE_MAX for compression (not decompression) makes + // xz lower the compression settings (or number of threads) + // to a level that *might* work. In practice it has worked + // when using a 64-bit kernel that gives full 4 GiB address + // space to 32-bit programs. In other situations this might + // still be too high, like 32-bit kernels that may give much + // less than 4 GiB to a single application. + // + // So this is an ugly hack but I will keep it here while + // it does more good than bad. + // + // Use a value less than SIZE_MAX so that there's some room + // for the xz program and so on. Don't use 4000 MiB because + // it could look like someone mixed up base-2 and base-10. + const uint64_t limit_max = UINT64_C(4020) << 20; + + // UINT64_MAX is a special case for the string "max" so + // that has to be handled specially. + if (memlimit_compress != UINT64_MAX + && memlimit_compress > limit_max) + memlimit_compress = limit_max; +#endif + } if (set_decompress) memlimit_decompress = new_memlimit; Modified: head/contrib/xz/src/xz/xz.1 ============================================================================== --- head/contrib/xz/src/xz/xz.1 Thu Feb 6 07:45:07 2020 (r357608) +++ head/contrib/xz/src/xz/xz.1 Thu Feb 6 07:47:28 2020 (r357609) @@ -1005,6 +1005,25 @@ instead of until the details have been decided. .RE .IP "" +For 32-bit +.BR xz +there is a special case: if the +.I limit +would be over +.BR "4020\ MiB" , +the +.I limit +is set to +.BR "4020\ MiB" . +(The values +.B 0 +and +.B max +aren't affected by this. +A similar feature doesn't exist for decompression.) +This can be helpful when a 32-bit executable has access +to 4\ GiB address space while hopefully doing no harm in other situations. +.IP "" See also the section .BR "Memory usage" . .TP From owner-svn-src-all@freebsd.org Thu Feb 6 08:32:26 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 33D362463F9; Thu, 6 Feb 2020 08:32:26 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CsB20cDtz3JBQ; Thu, 6 Feb 2020 08:32:26 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1036518F64; Thu, 6 Feb 2020 08:32:26 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0168WPrn040511; Thu, 6 Feb 2020 08:32:25 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0168WPh4040508; Thu, 6 Feb 2020 08:32:25 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <202002060832.0168WPh4040508@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Thu, 6 Feb 2020 08:32:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357610 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 357610 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 08:32:26 -0000 Author: rlibby Date: Thu Feb 6 08:32:25 2020 New Revision: 357610 URL: https://svnweb.freebsd.org/changeset/base/357610 Log: uma: remove UMA_ZFLAG_CACHEONLY flag UMA_ZFLAG_CACHEONLY was essentially the same thing as UMA_ZONE_VM, but with a more confusing name. Remove the flag, make UMA_ZONE_VM an inherit flag, and replace all references. Reviewed by: markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D23516 Modified: head/sys/vm/uma.h head/sys/vm/uma_core.c head/sys/vm/uma_int.h Modified: head/sys/vm/uma.h ============================================================================== --- head/sys/vm/uma.h Thu Feb 6 07:47:28 2020 (r357609) +++ head/sys/vm/uma.h Thu Feb 6 08:32:25 2020 (r357610) @@ -288,8 +288,8 @@ uma_zone_t uma_zcache_create(char *name, int size, uma */ #define UMA_ZONE_INHERIT \ (UMA_ZONE_NOTOUCH | UMA_ZONE_MALLOC | UMA_ZONE_NOFREE | \ - UMA_ZONE_NOTPAGE | UMA_ZONE_PCPU | UMA_ZONE_FIRSTTOUCH | \ - UMA_ZONE_ROUNDROBIN) + UMA_ZONE_VM | UMA_ZONE_NOTPAGE | UMA_ZONE_PCPU | \ + UMA_ZONE_FIRSTTOUCH | UMA_ZONE_ROUNDROBIN) /* Definitions for align */ #define UMA_ALIGN_PTR (sizeof(void *) - 1) /* Alignment fit for ptr */ Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Thu Feb 6 07:47:28 2020 (r357609) +++ head/sys/vm/uma_core.c Thu Feb 6 08:32:25 2020 (r357610) @@ -493,7 +493,7 @@ bucket_alloc(uma_zone_t zone, void *udata, int flags) return (NULL); udata = (void *)((uintptr_t)udata | UMA_ZFLAG_BUCKET); } - if ((uintptr_t)udata & UMA_ZFLAG_CACHEONLY) + if (((uintptr_t)udata & UMA_ZONE_VM) != 0) flags |= M_NOVM; ubz = bucket_zone_lookup(zone->uz_bucket_size); if (ubz->ubz_zone == zone && (ubz + 1)->ubz_entries != 0) @@ -1897,8 +1897,7 @@ keg_layout(uma_keg_t keg) ("%s: cannot configure for PCPU: keg=%s, size=%u, flags=0x%b", __func__, keg->uk_name, keg->uk_size, keg->uk_flags, PRINT_UMA_ZFLAGS)); - KASSERT((keg->uk_flags & - (UMA_ZFLAG_INTERNAL | UMA_ZFLAG_CACHEONLY)) == 0 || + KASSERT((keg->uk_flags & (UMA_ZFLAG_INTERNAL | UMA_ZONE_VM)) == 0 || (keg->uk_flags & (UMA_ZONE_NOTOUCH | UMA_ZONE_PCPU)) == 0, ("%s: incompatible flags 0x%b", __func__, keg->uk_flags, PRINT_UMA_ZFLAGS)); @@ -1947,16 +1946,16 @@ keg_layout(uma_keg_t keg) /* * We can't do OFFPAGE if we're internal or if we've been * asked to not go to the VM for buckets. If we do this we - * may end up going to the VM for slabs which we do not - * want to do if we're UMA_ZFLAG_CACHEONLY as a result - * of UMA_ZONE_VM, which clearly forbids it. In those cases, - * evaluate a pseudo-format called INTERNAL which has an inline - * slab header and one extra page to guarantee that it fits. + * may end up going to the VM for slabs which we do not want + * to do if we're UMA_ZONE_VM, which clearly forbids it. + * In those cases, evaluate a pseudo-format called INTERNAL + * which has an inline slab header and one extra page to + * guarantee that it fits. * * Otherwise, see if using an OFFPAGE slab will improve our * efficiency. */ - if ((keg->uk_flags & (UMA_ZFLAG_INTERNAL | UMA_ZFLAG_CACHEONLY)) != 0) + if ((keg->uk_flags & (UMA_ZFLAG_INTERNAL | UMA_ZONE_VM)) != 0) fmts[nfmt++] = UMA_ZFLAG_INTERNAL; else fmts[nfmt++] = UMA_ZFLAG_OFFPAGE; @@ -2073,9 +2072,6 @@ keg_ctor(void *mem, int size, void *udata, int flags) zone = arg->zone; keg->uk_name = zone->uz_name; - if (arg->flags & UMA_ZONE_VM) - keg->uk_flags |= UMA_ZFLAG_CACHEONLY; - if (arg->flags & UMA_ZONE_ZINIT) keg->uk_init = zero_init; @@ -2461,8 +2457,6 @@ zone_ctor(void *mem, int size, void *udata, int flags) if (arg->import) { KASSERT((arg->flags & UMA_ZFLAG_CACHE) != 0, ("zone_ctor: Import specified for non-cache zone.")); - if (arg->flags & UMA_ZONE_VM) - arg->flags |= UMA_ZFLAG_CACHEONLY; zone->uz_flags = arg->flags; zone->uz_size = arg->size; zone->uz_import = arg->import; Modified: head/sys/vm/uma_int.h ============================================================================== --- head/sys/vm/uma_int.h Thu Feb 6 07:47:28 2020 (r357609) +++ head/sys/vm/uma_int.h Thu Feb 6 08:32:25 2020 (r357610) @@ -166,14 +166,12 @@ #define UMA_ZFLAG_BUCKET 0x10000000 /* Bucket zone. */ #define UMA_ZFLAG_INTERNAL 0x20000000 /* No offpage no PCPU. */ #define UMA_ZFLAG_TRASH 0x40000000 /* Add trash ctor/dtor. */ -#define UMA_ZFLAG_CACHEONLY 0x80000000 /* Don't ask VM for buckets. */ #define UMA_ZFLAG_INHERIT \ (UMA_ZFLAG_OFFPAGE | UMA_ZFLAG_HASH | UMA_ZFLAG_VTOSLAB | \ - UMA_ZFLAG_BUCKET | UMA_ZFLAG_INTERNAL | UMA_ZFLAG_CACHEONLY) + UMA_ZFLAG_BUCKET | UMA_ZFLAG_INTERNAL) #define PRINT_UMA_ZFLAGS "\20" \ - "\40CACHEONLY" \ "\37TRASH" \ "\36INTERNAL" \ "\35BUCKET" \ From owner-svn-src-all@freebsd.org Thu Feb 6 08:32:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CBF3324641B; Thu, 6 Feb 2020 08:32:30 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CsB650ndz3JF0; Thu, 6 Feb 2020 08:32:30 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B0A418F6E; Thu, 6 Feb 2020 08:32:30 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0168WUnD042095; Thu, 6 Feb 2020 08:32:30 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0168WUp8042094; Thu, 6 Feb 2020 08:32:30 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <202002060832.0168WUp8042094@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Thu, 6 Feb 2020 08:32:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357611 - head/libexec/rc/rc.d X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: head/libexec/rc/rc.d X-SVN-Commit-Revision: 357611 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 08:32:31 -0000 Author: rlibby Date: Thu Feb 6 08:32:30 2020 New Revision: 357611 URL: https://svnweb.freebsd.org/changeset/base/357611 Log: auditd_stop: wait_for_pids instead of sleeping It's faster and more reliable to wait_for_pids than to sleep 1. cem@ suggested just to remove auditd_stop() and use the rc.subr default stop action (SIGTERM instead of audit -t), which has a built-in wait_for_pids. That may be a better solution. Discussed with: cem Reviewed by: asomers Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D23223 Modified: head/libexec/rc/rc.d/auditd Modified: head/libexec/rc/rc.d/auditd ============================================================================== --- head/libexec/rc/rc.d/auditd Thu Feb 6 08:32:25 2020 (r357610) +++ head/libexec/rc/rc.d/auditd Thu Feb 6 08:32:30 2020 (r357611) @@ -26,7 +26,9 @@ auditd_stop() { /usr/sbin/audit -t - sleep 1 + if [ -n "$rc_pid" ]; then + wait_for_pids $rc_pid + fi } load_rc_config $name From owner-svn-src-all@freebsd.org Thu Feb 6 09:43:23 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A262A24765B for ; Thu, 6 Feb 2020 09:43:23 +0000 (UTC) (envelope-from campaign-indiatradedata-14483-333-1632121-svn-src-all=freebsd.org@email.indiatradedata.com) Received: from mm9.iaires.com (mm9.iaires.com [202.162.243.57]) by mx1.freebsd.org (Postfix) with ESMTP id 48Ctlv1kXMz3MHq for ; Thu, 6 Feb 2020 09:43:23 +0000 (UTC) (envelope-from campaign-indiatradedata-14483-333-1632121-svn-src-all=freebsd.org@email.indiatradedata.com) To: svn-src-all@freebsd.org From: Kawanpreet - trade data Reply-To: marketing@indiatradedata.com Subject: TURKEY CUSTOM TRADE DATABASE Message-ID: <20984271981632121@indiatradedata.com> Feedback-ID: 333:14483:20200206150154:nczc MIME-Version: 1.0 Date: Thu, 6 Feb 2020 15:13:23 +0530 X-Rspamd-Queue-Id: 48Ctlv1kXMz3MHq X-Spamd-Bar: ++++++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of campaign-indiatradedata-14483-333-1632121-svn-src-all=freebsd.org@email.indiatradedata.com designates 202.162.243.57 as permitted sender) smtp.mailfrom=campaign-indiatradedata-14483-333-1632121-svn-src-all=freebsd.org@email.indiatradedata.com X-Spamd-Result: default: False [6.13 / 15.00]; HAS_REPLYTO(0.00)[marketing@indiatradedata.com]; R_SPF_ALLOW(-0.20)[+ip4:202.162.224.0/19:c]; REPLYTO_ADDR_EQ_FROM(0.00)[]; TO_DN_NONE(0.00)[]; URI_COUNT_ODD(1.00)[1]; SUBJ_ALL_CAPS(2.10)[28]; FORGED_SENDER(0.00)[marketing@indiatradedata.com,campaign-indiatradedata-14483-333-1632121-svn-src-all=freebsd.org@email.indiatradedata.com]; RCVD_COUNT_ZERO(0.00)[0]; IP_SCORE(0.30)[asn: 33480(1.54), country: US(-0.05)]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:33480, ipnet:202.162.243.0/24, country:US]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FROM_NEQ_ENVFROM(0.00)[marketing@indiatradedata.com,campaign-indiatradedata-14483-333-1632121-svn-src-all=freebsd.org@email.indiatradedata.com]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; R_BAD_CTE_7BIT(1.05)[7bit,utf8]; HAS_PHPMAILER_SIG(0.00)[]; HAS_LIST_UNSUB(-0.01)[]; RCPT_COUNT_ONE(0.00)[1]; FORGED_SENDER_VERP_SRS(0.00)[]; NEURAL_SPAM_MEDIUM(0.99)[0.993,0]; DMARC_NA(0.00)[indiatradedata.com]; NEURAL_SPAM_LONG(1.00)[1.000,0]; ENVFROM_VERP(0.00)[]; GREYLIST(0.00)[pass,body] X-Spam: Yes Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 09:43:23 -0000 Hi, We Export Genius provide various countries Custom Trade Database. You can know your product global market through Import/Export actual shipments. This is most accurate source of information. We can now arrange some exclusive countries Trade database also – Turkey, Bangladesh, Kenya, Tanzania, Liberia, DR Congo, Philippines, Indonesia, CIS Countries, Latin America and many more… Please let me know if interested to get demo and more information Awaiting for your reply. Thanks & Regards Ms. Kawanpreet Kaur Mobile +91- 8586926573 Direct Telephone - +91-11-47048012/13/14 , Extension No. 110 Skype – Exportgenius4 From owner-svn-src-all@freebsd.org Thu Feb 6 10:10:43 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 00A39247DD6; Thu, 6 Feb 2020 10:10:43 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CvMQ6JSvz3NLN; Thu, 6 Feb 2020 10:10:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D3C2D1A003; Thu, 6 Feb 2020 10:10:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 016AAgdE099881; Thu, 6 Feb 2020 10:10:42 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 016AAgI5099880; Thu, 6 Feb 2020 10:10:42 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202002061010.016AAgI5099880@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 6 Feb 2020 10:10:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357612 - stable/12/sys/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/sys X-SVN-Commit-Revision: 357612 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 10:10:43 -0000 Author: hselasky Date: Thu Feb 6 10:10:42 2020 New Revision: 357612 URL: https://svnweb.freebsd.org/changeset/base/357612 Log: Bump FreeBSD version due to recent LinuxKPI changes. This is a direct commit. Sponsored by: Mellanox Technologies Modified: stable/12/sys/sys/param.h Modified: stable/12/sys/sys/param.h ============================================================================== --- stable/12/sys/sys/param.h Thu Feb 6 08:32:30 2020 (r357611) +++ stable/12/sys/sys/param.h Thu Feb 6 10:10:42 2020 (r357612) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1201511 /* Master, propagated to newvers */ +#define __FreeBSD_version 1201512 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Thu Feb 6 10:11:42 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 05EED247FC4; Thu, 6 Feb 2020 10:11:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CvNY640kz3NWs; Thu, 6 Feb 2020 10:11:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CB9281A15F; Thu, 6 Feb 2020 10:11:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 016ABfhp004589; Thu, 6 Feb 2020 10:11:41 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 016ABftn004588; Thu, 6 Feb 2020 10:11:41 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202002061011.016ABftn004588@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 6 Feb 2020 10:11:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r357613 - stable/11/sys/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/sys X-SVN-Commit-Revision: 357613 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 10:11:42 -0000 Author: hselasky Date: Thu Feb 6 10:11:41 2020 New Revision: 357613 URL: https://svnweb.freebsd.org/changeset/base/357613 Log: Bump FreeBSD version due to recent LinuxKPI changes. This is a direct commit. Sponsored by: Mellanox Technologies Modified: stable/11/sys/sys/param.h Modified: stable/11/sys/sys/param.h ============================================================================== --- stable/11/sys/sys/param.h Thu Feb 6 10:10:42 2020 (r357612) +++ stable/11/sys/sys/param.h Thu Feb 6 10:11:41 2020 (r357613) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1103507 /* Master, propagated to newvers */ +#define __FreeBSD_version 1103508 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Thu Feb 6 12:45:59 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5B64922B666; Thu, 6 Feb 2020 12:45:59 +0000 (UTC) (envelope-from kaktus@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Cypb1RSZz4134; Thu, 6 Feb 2020 12:45:59 +0000 (UTC) (envelope-from kaktus@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 283EE1BD11; Thu, 6 Feb 2020 12:45:59 +0000 (UTC) (envelope-from kaktus@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 016Cjxrw096377; Thu, 6 Feb 2020 12:45:59 GMT (envelope-from kaktus@FreeBSD.org) Received: (from kaktus@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 016CjwTi096374; Thu, 6 Feb 2020 12:45:58 GMT (envelope-from kaktus@FreeBSD.org) Message-Id: <202002061245.016CjwTi096374@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kaktus set sender to kaktus@FreeBSD.org using -f From: Pawel Biernacki Date: Thu, 6 Feb 2020 12:45:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357614 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: kaktus X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 357614 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 12:45:59 -0000 Author: kaktus Date: Thu Feb 6 12:45:58 2020 New Revision: 357614 URL: https://svnweb.freebsd.org/changeset/base/357614 Log: sysctl(9): add CTLFLAG_NEEDGIANT flag Add CTLFLAG_NEEDGIANT flag (modelled after D_NEEDGIANT) that will be used to mark sysctls that still require locking Giant. Rewrite sysctl_handle_string() to use internal locking instead of locking Giant. Mark SYSCTL_STRING, SYSCTL_OPAQUE and their variants as MPSAFE. Add infrastructure support for enforcing proper use of CTLFLAG_NEEDGIANT and CTLFLAG_MPSAFE flags with SYSCTL_PROC and SYSCTL_NODE, not enabled yet. Reviewed by: kib (mentor) Approved by: kib (mentor) Differential Revision: https://reviews.freebsd.org/D23378 Modified: head/sys/kern/kern_sysctl.c head/sys/sys/sysctl.h Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Thu Feb 6 10:11:41 2020 (r357613) +++ head/sys/kern/kern_sysctl.c Thu Feb 6 12:45:58 2020 (r357614) @@ -96,9 +96,13 @@ static MALLOC_DEFINE(M_SYSCTLTMP, "sysctltmp", "sysctl * The sysctlmemlock is used to limit the amount of user memory wired for * sysctl requests. This is implemented by serializing any userland * sysctl requests larger than a single page via an exclusive lock. + * + * The sysctlstringlock is used to protect concurrent access to writable + * string nodes in sysctl_handle_string(). */ static struct rmlock sysctllock; static struct sx __exclusive_cache_line sysctlmemlock; +static struct sx sysctlstringlock; #define SYSCTL_WLOCK() rm_wlock(&sysctllock) #define SYSCTL_WUNLOCK() rm_wunlock(&sysctllock) @@ -170,10 +174,16 @@ sysctl_root_handler_locked(struct sysctl_oid *oid, voi else SYSCTL_WUNLOCK(); - if (!(oid->oid_kind & CTLFLAG_MPSAFE)) + /* + * Treat set CTLFLAG_NEEDGIANT and unset CTLFLAG_MPSAFE flags the same, + * untill we're ready to remove all traces of Giant from sysctl(9). + */ + if ((oid->oid_kind & CTLFLAG_NEEDGIANT) || + (!(oid->oid_kind & CTLFLAG_MPSAFE))) mtx_lock(&Giant); error = oid->oid_handler(oid, arg1, arg2, req); - if (!(oid->oid_kind & CTLFLAG_MPSAFE)) + if ((oid->oid_kind & CTLFLAG_NEEDGIANT) || + (!(oid->oid_kind & CTLFLAG_MPSAFE))) mtx_unlock(&Giant); KFAIL_POINT_ERROR(_debug_fail_point, sysctl_running, error); @@ -917,6 +927,7 @@ sysctl_register_all(void *arg) struct sysctl_oid **oidp; sx_init(&sysctlmemlock, "sysctl mem"); + sx_init(&sysctlstringlock, "sysctl string handler"); SYSCTL_INIT(); SYSCTL_WLOCK(); SET_FOREACH(oidp, sysctl_set) @@ -1632,48 +1643,69 @@ sysctl_handle_64(SYSCTL_HANDLER_ARGS) int sysctl_handle_string(SYSCTL_HANDLER_ARGS) { + char *tmparg; size_t outlen; int error = 0, ro_string = 0; /* + * If the sysctl isn't writable, microoptimise and treat it as a + * const string. * A zero-length buffer indicates a fixed size read-only * string. In ddb, don't worry about trying to make a malloced * snapshot. */ - if (arg2 == 0 || kdb_active) { + if (!(oidp->oid_kind & CTLFLAG_WR) || arg2 == 0 || kdb_active) { arg2 = strlen((char *)arg1) + 1; ro_string = 1; } if (req->oldptr != NULL) { - char *tmparg; - if (ro_string) { tmparg = arg1; + outlen = strlen(tmparg) + 1; } else { - /* try to make a coherent snapshot of the string */ tmparg = malloc(arg2, M_SYSCTLTMP, M_WAITOK); + sx_slock(&sysctlstringlock); memcpy(tmparg, arg1, arg2); + sx_sunlock(&sysctlstringlock); + outlen = strlen(tmparg) + 1; } - outlen = strnlen(tmparg, arg2 - 1) + 1; error = SYSCTL_OUT(req, tmparg, outlen); if (!ro_string) free(tmparg, M_SYSCTLTMP); } else { - outlen = strnlen((char *)arg1, arg2 - 1) + 1; + if (!ro_string) + sx_slock(&sysctlstringlock); + outlen = strlen((char *)arg1) + 1; + if (!ro_string) + sx_sunlock(&sysctlstringlock); error = SYSCTL_OUT(req, NULL, outlen); } if (error || !req->newptr) return (error); - if ((req->newlen - req->newidx) >= arg2) { + if (req->newlen - req->newidx >= arg2 || + req->newlen - req->newidx <= 0) { error = EINVAL; } else { - arg2 = (req->newlen - req->newidx); - error = SYSCTL_IN(req, arg1, arg2); + arg2 = req->newlen - req->newidx; + tmparg = malloc(arg2, M_SYSCTLTMP, M_WAITOK); + + error = copyin((const char *)req->newptr + req->newidx, + tmparg, arg2); + if (error) { + free(tmparg, M_SYSCTLTMP); + return (error); + } + + sx_xlock(&sysctlstringlock); + memcpy(arg1, tmparg, arg2); ((char *)arg1)[arg2] = '\0'; + sx_xunlock(&sysctlstringlock); + free(tmparg, M_SYSCTLTMP); + req->newidx += arg2; } return (error); } Modified: head/sys/sys/sysctl.h ============================================================================== --- head/sys/sys/sysctl.h Thu Feb 6 10:11:41 2020 (r357613) +++ head/sys/sys/sysctl.h Thu Feb 6 12:45:58 2020 (r357614) @@ -105,6 +105,13 @@ struct ctlname { #define CTLFLAG_STATS 0x00002000 /* Statistics, not a tuneable */ #define CTLFLAG_NOFETCH 0x00001000 /* Don't fetch tunable from getenv() */ #define CTLFLAG_CAPRW (CTLFLAG_CAPRD|CTLFLAG_CAPWR) +/* + * This is transient flag to be used until all sysctl handlers are converted + * to not lock Giant. + * One, and only one of CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT is required + * for SYSCTL_PROC and SYSCTL_NODE. + */ +#define CTLFLAG_NEEDGIANT 0x00000800 /* Handler require Giant */ /* * Secure level. Note that CTLFLAG_SECURE == CTLFLAG_SECURE1. @@ -263,6 +270,14 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry); #define __DESCR(d) "" #endif +#ifdef notyet +#define SYSCTL_ENFORCE_FLAGS(x) \ + _Static_assert(((CTLFLAG_MPSAFE ^ CTLFLAG_NEEDGIANT) & (x)), \ + "Has to be either CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT") +#else +#define SYSCTL_ENFORCE_FLAGS(x) +#endif + /* This macro is only for internal use */ #define SYSCTL_OID_RAW(id, parent_child_head, nbr, name, kind, a1, a2, handler, fmt, descr, label) \ struct sysctl_oid id = { \ @@ -278,7 +293,8 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry); .oid_descr = __DESCR(descr), \ .oid_label = (label), \ }; \ - DATA_SET(sysctl_set, id) + DATA_SET(sysctl_set, id); \ + SYSCTL_ENFORCE_FLAGS(kind) /* This constructs a static "raw" MIB oid. */ #define SYSCTL_OID(parent, nbr, name, kind, a1, a2, handler, fmt, descr) \ @@ -297,7 +313,11 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry); nbr, #name, kind, a1, a2, handler, fmt, descr, label) #define SYSCTL_ADD_OID(ctx, parent, nbr, name, kind, a1, a2, handler, fmt, descr) \ - sysctl_add_oid(ctx, parent, nbr, name, kind, a1, a2, handler, fmt, __DESCR(descr), NULL) +({ \ + SYSCTL_ENFORCE_FLAGS(kind); \ + sysctl_add_oid(ctx, parent, nbr, name, kind, a1, a2,handler, \ + fmt, __DESCR(descr), NULL); \ +}) /* This constructs a root node from which other nodes can hang. */ #define SYSCTL_ROOT_NODE(nbr, name, access, handler, descr) \ @@ -325,6 +345,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry); ({ \ CTASSERT(((access) & CTLTYPE) == 0 || \ ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_NODE); \ + SYSCTL_ENFORCE_FLAGS(access); \ sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_NODE|(access), \ NULL, 0, handler, "N", __DESCR(descr), label); \ }) @@ -333,6 +354,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry); ({ \ CTASSERT(((access) & CTLTYPE) == 0 || \ ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_NODE); \ + SYSCTL_ENFORCE_FLAGS(access); \ sysctl_add_oid(ctx, &sysctl__children, nbr, name, \ CTLTYPE_NODE|(access), \ NULL, 0, handler, "N", __DESCR(descr), NULL); \ @@ -340,7 +362,8 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry); /* Oid for a string. len can be 0 to indicate '\0' termination. */ #define SYSCTL_STRING(parent, nbr, name, access, arg, len, descr) \ - SYSCTL_OID(parent, nbr, name, CTLTYPE_STRING|(access), \ + SYSCTL_OID(parent, nbr, name, \ + CTLTYPE_STRING | CTLFLAG_MPSAFE | (access), \ arg, len, sysctl_handle_string, "A", descr); \ CTASSERT(((access) & CTLTYPE) == 0 || \ ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_STRING) @@ -350,7 +373,8 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry); char *__arg = (arg); \ CTASSERT(((access) & CTLTYPE) == 0 || \ ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_STRING); \ - sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_STRING|(access), \ + sysctl_add_oid(ctx, parent, nbr, name, \ + CTLTYPE_STRING | CTLFLAG_MPSAFE | (access), \ __arg, len, sysctl_handle_string, "A", __DESCR(descr), \ NULL); \ }) @@ -741,7 +765,8 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry); /* Oid for an opaque object. Specified by a pointer and a length. */ #define SYSCTL_OPAQUE(parent, nbr, name, access, ptr, len, fmt, descr) \ - SYSCTL_OID(parent, nbr, name, CTLTYPE_OPAQUE|(access), \ + SYSCTL_OID(parent, nbr, name, \ + CTLTYPE_OPAQUE | CTLFLAG_MPSAFE | (access), \ ptr, len, sysctl_handle_opaque, fmt, descr); \ CTASSERT(((access) & CTLTYPE) == 0 || \ ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_OPAQUE) @@ -750,13 +775,15 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry); ({ \ CTASSERT(((access) & CTLTYPE) == 0 || \ ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_OPAQUE); \ - sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_OPAQUE|(access), \ + sysctl_add_oid(ctx, parent, nbr, name, \ + CTLTYPE_OPAQUE | CTLFLAG_MPSAFE | (access), \ ptr, len, sysctl_handle_opaque, fmt, __DESCR(descr), NULL); \ }) /* Oid for a struct. Specified by a pointer and a type. */ #define SYSCTL_STRUCT(parent, nbr, name, access, ptr, type, descr) \ - SYSCTL_OID(parent, nbr, name, CTLTYPE_OPAQUE|(access), \ + SYSCTL_OID(parent, nbr, name, \ + CTLTYPE_OPAQUE | CTLFLAG_MPSAFE | (access), \ ptr, sizeof(struct type), sysctl_handle_opaque, \ "S," #type, descr); \ CTASSERT(((access) & CTLTYPE) == 0 || \ @@ -766,7 +793,8 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry); ({ \ CTASSERT(((access) & CTLTYPE) == 0 || \ ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_OPAQUE); \ - sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_OPAQUE|(access), \ + sysctl_add_oid(ctx, parent, nbr, name, \ + CTLTYPE_OPAQUE | CTLFLAG_MPSAFE | (access), \ (ptr), sizeof(struct type), \ sysctl_handle_opaque, "S," #type, __DESCR(descr), NULL); \ }) @@ -780,6 +808,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry); #define SYSCTL_ADD_PROC(ctx, parent, nbr, name, access, ptr, arg, handler, fmt, descr) \ ({ \ CTASSERT(((access) & CTLTYPE) != 0); \ + SYSCTL_ENFORCE_FLAGS(access); \ sysctl_add_oid(ctx, parent, nbr, name, (access), \ (ptr), (arg), (handler), (fmt), __DESCR(descr), NULL); \ }) From owner-svn-src-all@freebsd.org Thu Feb 6 13:22:01 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CA18B22BFB3; Thu, 6 Feb 2020 13:22:01 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Czc940cVz42ng; Thu, 6 Feb 2020 13:22:01 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8464C1C44E; Thu, 6 Feb 2020 13:22:01 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 016DM19j018578; Thu, 6 Feb 2020 13:22:01 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 016DLxOM018542; Thu, 6 Feb 2020 13:21:59 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <202002061321.016DLxOM018542@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Thu, 6 Feb 2020 13:21:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357615 - in head: lib/libkvm sys/sys X-SVN-Group: head X-SVN-Commit-Author: luporl X-SVN-Commit-Paths: in head: lib/libkvm sys/sys X-SVN-Commit-Revision: 357615 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 13:22:01 -0000 Author: luporl Date: Thu Feb 6 13:21:59 2020 New Revision: 357615 URL: https://svnweb.freebsd.org/changeset/base/357615 Log: Implement kvm_kerndisp This change adds a new libkvm function, kvm_kerndisp(), that can be used to retrieve the kernel displacement, that is the difference between the kernel's base virtual address at run time and the kernel base virtual address specified in the kernel image file. This will be used by kgdb, to properly relocate kernel symbols, when needed. Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D23285 Added: head/lib/libkvm/kvm_kerndisp.3 (contents, props changed) Modified: head/lib/libkvm/Makefile head/lib/libkvm/kvm.3 head/lib/libkvm/kvm.c head/lib/libkvm/kvm.h head/lib/libkvm/kvm_minidump_powerpc64.c head/lib/libkvm/kvm_private.h head/sys/sys/types.h Modified: head/lib/libkvm/Makefile ============================================================================== --- head/lib/libkvm/Makefile Thu Feb 6 12:45:58 2020 (r357614) +++ head/lib/libkvm/Makefile Thu Feb 6 13:21:59 2020 (r357615) @@ -25,8 +25,8 @@ INCS= kvm.h LIBADD= elf MAN= kvm.3 kvm_getcptime.3 kvm_geterr.3 kvm_getloadavg.3 \ - kvm_getpcpu.3 kvm_getprocs.3 kvm_getswapinfo.3 kvm_native.3 \ - kvm_nlist.3 kvm_open.3 kvm_read.3 + kvm_getpcpu.3 kvm_getprocs.3 kvm_getswapinfo.3 kvm_kerndisp.3 \ + kvm_native.3 kvm_nlist.3 kvm_open.3 kvm_read.3 MLINKS+=kvm_getpcpu.3 kvm_getmaxcpu.3 \ kvm_getpcpu.3 kvm_dpcpu_setcpu.3 \ Modified: head/lib/libkvm/kvm.3 ============================================================================== --- head/lib/libkvm/kvm.3 Thu Feb 6 12:45:58 2020 (r357614) +++ head/lib/libkvm/kvm.3 Thu Feb 6 13:21:59 2020 (r357615) @@ -32,7 +32,7 @@ .\" @(#)kvm.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd April 30, 2016 +.Dd February 5, 2020 .Dt KVM 3 .Os .Sh NAME @@ -133,7 +133,8 @@ respectively. Finally, only a limited subset of operations are supported for non-native crash dumps: .Fn kvm_close , -.Fn kvm_geterr +.Fn kvm_geterr , +.Fn kvm_kerndisp , .Fn kvm_open2 , .Fn kvm_native , .Fn kvm_nlist2 , @@ -147,6 +148,7 @@ and .Xr kvm_getloadavg 3 , .Xr kvm_getprocs 3 , .Xr kvm_getswapinfo 3 , +.Xr kvm_kerndisp 3 , .Xr kvm_native 3 , .Xr kvm_nlist 3 , .Xr kvm_nlist2 3 , Modified: head/lib/libkvm/kvm.c ============================================================================== --- head/lib/libkvm/kvm.c Thu Feb 6 12:45:58 2020 (r357614) +++ head/lib/libkvm/kvm.c Thu Feb 6 13:21:59 2020 (r357615) @@ -46,6 +46,7 @@ __SCCSID("@(#)kvm.c 8.2 (Berkeley) 2/13/94"); #include #include #include +#include #include #include @@ -498,4 +499,33 @@ kvm_walk_pages(kvm_t *kd, kvm_walk_pages_cb_t *cb, voi return (0); return (kd->arch->ka_walk_pages(kd, cb, closure)); +} + +kssize_t +kvm_kerndisp(kvm_t *kd) +{ + unsigned long kernbase, rel_kernbase; + size_t kernbase_len = sizeof(kernbase); + size_t rel_kernbase_len = sizeof(rel_kernbase); + + if (ISALIVE(kd)) { + if (sysctlbyname("kern.base_address", &kernbase, + &kernbase_len, NULL, 0) == -1) { + _kvm_syserr(kd, kd->program, + "failed to get kernel base address"); + return (0); + } + if (sysctlbyname("kern.relbase_address", &rel_kernbase, + &rel_kernbase_len, NULL, 0) == -1) { + _kvm_syserr(kd, kd->program, + "failed to get relocated kernel base address"); + return (0); + } + return (rel_kernbase - kernbase); + } + + if (kd->arch->ka_kerndisp == NULL) + return (0); + + return (kd->arch->ka_kerndisp(kd)); } Modified: head/lib/libkvm/kvm.h ============================================================================== --- head/lib/libkvm/kvm.h Thu Feb 6 12:45:58 2020 (r357614) +++ head/lib/libkvm/kvm.h Thu Feb 6 13:21:59 2020 (r357615) @@ -124,6 +124,7 @@ ssize_t kvm_read(kvm_t *, unsigned long, void *, siz ssize_t kvm_read_zpcpu(kvm_t *, unsigned long, void *, size_t, int); ssize_t kvm_read2(kvm_t *, kvaddr_t, void *, size_t); ssize_t kvm_write(kvm_t *, unsigned long, const void *, size_t); +kssize_t kvm_kerndisp(kvm_t *); typedef int kvm_walk_pages_cb_t(struct kvm_page *, void *); int kvm_walk_pages(kvm_t *, kvm_walk_pages_cb_t *, void *); Added: head/lib/libkvm/kvm_kerndisp.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libkvm/kvm_kerndisp.3 Thu Feb 6 13:21:59 2020 (r357615) @@ -0,0 +1,57 @@ +.\" +.\" Copyright (c) 2020 Leandro Lupori +.\" +.\" 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$ +.\" +.Dd February 5, 2020 +.Dt KVM_KERNDISP 3 +.Os +.Sh NAME +.Nm kvm_kerndisp +.Nd get kernel displacement +.Sh LIBRARY +.Lb libkvm +.Sh SYNOPSIS +.In kvm.h +.Ft kssize_t +.Fn kvm_kerndisp "kvm_t *kd" +.Sh DESCRIPTION +.Fn kvm_kerndisp +returns the number of bytes by which the kernel referenced by +.Fa kd +is displaced. +This is the difference between the kernel's base virtual address at run time +and the kernel base virtual address specified in the kernel image file. +.Pp +Note that if the kernel is moved to a lower memory address, +the displacement will be negative. +.Sh RETURN VALUES +.Fn kvm_kerndisp +returns the number of bytes by which the kernel is displaced. +If the kernel is not displaced or if it is not possible to find the +displacement then 0 is returned. +.Sh SEE ALSO +.Xr kvm 3 , +.Xr kvm_close 3 , +.Xr kvm_open 3 Modified: head/lib/libkvm/kvm_minidump_powerpc64.c ============================================================================== --- head/lib/libkvm/kvm_minidump_powerpc64.c Thu Feb 6 12:45:58 2020 (r357614) +++ head/lib/libkvm/kvm_minidump_powerpc64.c Thu Feb 6 13:21:59 2020 (r357615) @@ -184,6 +184,12 @@ _powerpc64_native(kvm_t *kd __unused) #endif } +static kssize_t +_powerpc64_kerndisp(kvm_t *kd) +{ + return (kd->vmst->hdr.startkernel - PPC64_KERNBASE); +} + static int _powerpc64_minidump_walk_pages(kvm_t *kd, kvm_walk_pages_cb_t *cb, void *arg) { @@ -197,6 +203,7 @@ static struct kvm_arch kvm_powerpc64_minidump = { .ka_kvatop = _powerpc64_minidump_kvatop, .ka_walk_pages = _powerpc64_minidump_walk_pages, .ka_native = _powerpc64_native, + .ka_kerndisp = _powerpc64_kerndisp, }; KVM_ARCH(kvm_powerpc64_minidump); Modified: head/lib/libkvm/kvm_private.h ============================================================================== --- head/lib/libkvm/kvm_private.h Thu Feb 6 12:45:58 2020 (r357614) +++ head/lib/libkvm/kvm_private.h Thu Feb 6 13:21:59 2020 (r357615) @@ -47,6 +47,7 @@ struct kvm_arch { int (*ka_kvatop)(kvm_t *, kvaddr_t, off_t *); int (*ka_native)(kvm_t *); int (*ka_walk_pages)(kvm_t *, kvm_walk_pages_cb_t *, void *); + kssize_t (*ka_kerndisp)(kvm_t *); }; #define KVM_ARCH(ka) DATA_SET(kvm_arch, ka) Modified: head/sys/sys/types.h ============================================================================== --- head/sys/sys/types.h Thu Feb 6 12:45:58 2020 (r357614) +++ head/sys/sys/types.h Thu Feb 6 13:21:59 2020 (r357615) @@ -260,6 +260,7 @@ typedef struct cap_rights cap_rights_t; typedef __uint64_t kpaddr_t; typedef __uint64_t kvaddr_t; typedef __uint64_t ksize_t; +typedef __int64_t kssize_t; typedef __vm_offset_t vm_offset_t; typedef __uint64_t vm_ooffset_t; From owner-svn-src-all@freebsd.org Thu Feb 6 14:02:48 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1862A22CF75; Thu, 6 Feb 2020 14:02:48 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48D0WC6zdNz44kK; Thu, 6 Feb 2020 14:02:47 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EA78D1CBC3; Thu, 6 Feb 2020 14:02:47 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 016E2lq2043950; Thu, 6 Feb 2020 14:02:47 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 016E2lqW043949; Thu, 6 Feb 2020 14:02:47 GMT (envelope-from royger@FreeBSD.org) Message-Id: <202002061402.016E2lqW043949@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Thu, 6 Feb 2020 14:02:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357616 - head/sys/dev/xen/console X-SVN-Group: head X-SVN-Commit-Author: royger X-SVN-Commit-Paths: head/sys/dev/xen/console X-SVN-Commit-Revision: 357616 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 14:02:48 -0000 Author: royger Date: Thu Feb 6 14:02:47 2020 New Revision: 357616 URL: https://svnweb.freebsd.org/changeset/base/357616 Log: xen/console: fix priority of Xen console Currently the Xen console is always attached with priority CN_REMOTE (highest), which means that when booting with a single console the Xen console will take preference over the VGA for example, and that's not intended unless the user has also selected to use a serial console. Fix this by lowering the priority of the Xen console to NORMAL unless the user has selected to use a serial console. This keeps the usual FreeBSD behavior of outputting to the internal consoles (ie: VGA) when booted as a Xen dom0. MFC after: 3 days Sponsored by: Citrix Systems R&D Modified: head/sys/dev/xen/console/xen_console.c Modified: head/sys/dev/xen/console/xen_console.c ============================================================================== --- head/sys/dev/xen/console/xen_console.c Thu Feb 6 13:21:59 2020 (r357615) +++ head/sys/dev/xen/console/xen_console.c Thu Feb 6 14:02:47 2020 (r357616) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -590,7 +591,7 @@ xencons_cnprobe(struct consdev *cp) if (!xen_domain()) return; - cp->cn_pri = CN_REMOTE; + cp->cn_pri = (boothowto & RB_SERIAL) ? CN_REMOTE : CN_NORMAL; sprintf(cp->cn_name, "%s0", driver_name); } From owner-svn-src-all@freebsd.org Thu Feb 6 14:13:34 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 51F3222D60D; Thu, 6 Feb 2020 14:13:34 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48D0lf1Vgnz45QB; Thu, 6 Feb 2020 14:13:34 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2EA951CD88; Thu, 6 Feb 2020 14:13:34 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 016EDXIY050139; Thu, 6 Feb 2020 14:13:33 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 016EDXig050136; Thu, 6 Feb 2020 14:13:33 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202002061413.016EDXig050136@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 6 Feb 2020 14:13:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357617 - head/tools/build/options X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/tools/build/options X-SVN-Commit-Revision: 357617 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 14:13:34 -0000 Author: emaste Date: Thu Feb 6 14:13:33 2020 New Revision: 357617 URL: https://svnweb.freebsd.org/changeset/base/357617 Log: Update WITH_/WITHOUT_BINUTILS_BOOTSTRAP descriptions Use of binutils is being incrementally reduced. The specific binutils are listed in the WITH_BINUTILS and WITHOUT_BINUTILS descriptions; there is no need to list the specific tools again in the descriptions for the _BOOTSTRAP options. MFC after: 1 week Modified: head/tools/build/options/WITHOUT_BINUTILS_BOOTSTRAP head/tools/build/options/WITH_BINUTILS_BOOTSTRAP Modified: head/tools/build/options/WITHOUT_BINUTILS_BOOTSTRAP ============================================================================== --- head/tools/build/options/WITHOUT_BINUTILS_BOOTSTRAP Thu Feb 6 14:02:47 2020 (r357616) +++ head/tools/build/options/WITHOUT_BINUTILS_BOOTSTRAP Thu Feb 6 14:13:33 2020 (r357617) @@ -1,3 +1,3 @@ .\" $FreeBSD$ -Do not build binutils (as, ld.bfd, and objdump) +Do not build GNU binutils as part of the bootstrap process. Modified: head/tools/build/options/WITH_BINUTILS_BOOTSTRAP ============================================================================== --- head/tools/build/options/WITH_BINUTILS_BOOTSTRAP Thu Feb 6 14:02:47 2020 (r357616) +++ head/tools/build/options/WITH_BINUTILS_BOOTSTRAP Thu Feb 6 14:13:33 2020 (r357617) @@ -1,3 +1,3 @@ .\" $FreeBSD$ -Build binutils (as on i386 and amd64, objdump, and ld on powerpc) +Build GNU binutils as part of the bootstrap process. From owner-svn-src-all@freebsd.org Thu Feb 6 14:18:48 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9777722D6EC; Thu, 6 Feb 2020 14:18:48 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48D0sh4D7vz45bC; Thu, 6 Feb 2020 14:18:48 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 878C41CD8A; Thu, 6 Feb 2020 14:18:48 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 016EImTs050420; Thu, 6 Feb 2020 14:18:48 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 016EImGG050419; Thu, 6 Feb 2020 14:18:48 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202002061418.016EImGG050419@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 6 Feb 2020 14:18:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357618 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 357618 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 14:18:48 -0000 Author: emaste Date: Thu Feb 6 14:18:48 2020 New Revision: 357618 URL: https://svnweb.freebsd.org/changeset/base/357618 Log: src.conf.5: regen after r357617, BINUTILS_BOOTSTRAP description update Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Thu Feb 6 14:13:33 2020 (r357617) +++ head/share/man/man5/src.conf.5 Thu Feb 6 14:18:48 2020 (r357618) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd February 4, 2020 +.Dd February 6, 2020 .Dt SRC.CONF 5 .Os .Sh NAME @@ -198,15 +198,15 @@ and on powerpc as part of the normal system build. .Pp This is a default setting on -amd64/amd64, arm/armv6, arm/armv7, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. +amd64/amd64, arm/armv6, arm/armv7, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc and powerpc/powerpc64. .It Va WITHOUT_BINUTILS_BOOTSTRAP -Do not build binutils (as, ld.bfd, and objdump) +Do not build GNU binutils as part of the bootstrap process. .Pp This is a default setting on -arm/armv6, arm/armv7, arm64/aarch64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +arm/armv6, arm/armv7, arm64/aarch64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_BINUTILS_BOOTSTRAP -Build binutils (as on i386 and amd64, objdump, and ld on powerpc) +Build GNU binutils as part of the bootstrap process. .Pp This is a default setting on @@ -344,9 +344,6 @@ When set, it enforces these options: .El .It Va WITHOUT_CLANG Set to not build the Clang C/C++ compiler during the regular phase of the build. -.Pp -This is a default setting on -sparc64/sparc64. When set, it enforces these options: .Pp .Bl -item -compact @@ -357,11 +354,6 @@ When set, it enforces these options: .It .Va WITHOUT_LLVM_COV .El -.It Va WITH_CLANG -Set to build the Clang C/C++ compiler during the normal phase of the build. -.Pp -This is a default setting on -amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64 and riscv/riscv64sf. .It Va WITHOUT_CLANG_BOOTSTRAP Set to not build the Clang C/C++ compiler during the bootstrap phase of the build. @@ -369,7 +361,7 @@ To be able to build the system, either gcc or clang bo enabled unless an alternate compiler is provided via XCC. .Pp This is a default setting on -mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64. +mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf. .It Va WITH_CLANG_BOOTSTRAP Set to build the Clang C/C++ compiler during the bootstrap phase of the build. .Pp @@ -381,15 +373,6 @@ clang-format. .It Va WITHOUT_CLANG_FULL Set to avoid building the ARCMigrate, Rewriter and StaticAnalyzer components of the Clang C/C++ compiler. -.Pp -This is a default setting on -sparc64/sparc64. -.It Va WITH_CLANG_FULL -Set to build the ARCMigrate, Rewriter and StaticAnalyzer components of the -Clang C/C++ compiler. -.Pp -This is a default setting on -amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64 and riscv/riscv64sf. .It Va WITHOUT_CLANG_IS_CC Do not install links to the Clang C/C++ compiler as .Pa /usr/bin/cc , @@ -401,7 +384,7 @@ If is set then links to the GCC C/C++ compiler will be installed instead. .Pp This is a default setting on -mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64. +mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf. .It Va WITH_CLANG_IS_CC Install links to the Clang C/C++ compiler as .Pa /usr/bin/cc , @@ -489,7 +472,7 @@ Set to build .Xr cxgbetool 8 .Pp This is a default setting on -amd64/amd64, arm64/aarch64, i386/i386, powerpc/powerpc64 and sparc64/sparc64. +amd64/amd64, arm64/aarch64, i386/i386 and powerpc/powerpc64. .It Va WITHOUT_CXX Set to not build .Xr c++ 1 @@ -646,7 +629,7 @@ and .Xr efivar 8 . .Pp This is a default setting on -mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_EFI Set to build .Xr efivar 3 @@ -737,28 +720,12 @@ Set to build .Xr gdb 1 . .Pp This is a default setting on -amd64/amd64, arm/armv6, arm/armv7, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. +amd64/amd64, arm/armv6, arm/armv7, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc and powerpc/powerpc64. .It Va WITHOUT_GDB_LIBEXEC Set to install .Xr gdb 1 into .Pa /usr/bin . -.Pp -This is a default setting on -sparc64/sparc64. -.It Va WITH_GDB_LIBEXEC -Set to install -.Xr gdb 1 -into -.Pa /usr/libexec . -This permits -.Xr gdb 1 -to be used as a fallback for -.Xr crashinfo 8 -if a newer version is not installed. -.Pp -This is a default setting on -amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_GNUCXX Build the GNU C++ stack (g++, libstdc++). This option is deprecated and will be removed before @@ -801,7 +768,7 @@ Set to not build HTML docs. Set to not build or install HyperV utilities. .Pp This is a default setting on -arm/armv6, arm/armv7, arm64/aarch64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +arm/armv6, arm/armv7, arm64/aarch64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_HYPERV Set to build or install HyperV utilities. .Pp @@ -955,7 +922,7 @@ On 64-bit platforms, set to not build 32-bit library s runtime linker. .Pp This is a default setting on -arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mipsn32, mips/mipselhf, mips/mipshf, powerpc/powerpc, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mipsn32, mips/mipselhf, mips/mipshf, powerpc/powerpc, riscv/riscv64 and riscv/riscv64sf. .It Va WITHOUT_LIBCPLUSPLUS Set to avoid building libcxxrt and libc++. .It Va WITHOUT_LIBPTHREAD @@ -979,19 +946,11 @@ Set to not build the library. .It Va WITHOUT_LLD Set to not build LLVM's lld linker. -.Pp -This is a default setting on -sparc64/sparc64. -.It Va WITH_LLD -Set to build LLVM's lld linker. -.Pp -This is a default setting on -amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64 and riscv/riscv64sf. .It Va WITHOUT_LLDB Set to not build the LLDB debugger. .Pp This is a default setting on -arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_LLDB Set to build the LLDB debugger. .Pp @@ -1004,7 +963,7 @@ To be able to build the system, either Binutils or LLD enabled unless an alternate linker is provided via XLD. .Pp This is a default setting on -mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc and sparc64/sparc64. +mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and powerpc/powerpc. .It Va WITH_LLD_BOOTSTRAP Set to build the LLD linker during the bootstrap phase of the build, and use it during buildworld and buildkernel. @@ -1015,7 +974,7 @@ amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386 Set to use GNU binutils ld as the system linker, instead of LLVM's LLD. .Pp This is a default setting on -mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc and sparc64/sparc64. +mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and powerpc/powerpc. .It Va WITH_LLD_IS_LD Set to use LLVM's LLD as the system linker, instead of GNU binutils ld. .Pp @@ -1025,26 +984,8 @@ amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386 Set to not build the .Xr llvm-cov 1 tool. -.Pp -This is a default setting on -sparc64/sparc64. -.It Va WITH_LLVM_COV -Set to build the -.Xr llvm-cov 1 -tool. -.Pp -This is a default setting on -amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64 and riscv/riscv64sf. .It Va WITHOUT_LLVM_LIBUNWIND Set to use GCC's stack unwinder (instead of LLVM's libunwind). -.Pp -This is a default setting on -sparc64/sparc64. -.It Va WITH_LLVM_LIBUNWIND -Set to use LLVM's libunwind stack unwinder (instead of GCC's unwinder). -.Pp -This is a default setting on -amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64 and riscv/riscv64sf. .It Va WITHOUT_LLVM_TARGET_AARCH64 Set to not build LLVM target support for AArch64. The @@ -1131,7 +1072,7 @@ endian mode. Disable inclusion of GELI crypto support in the boot chain binaries. .Pp This is a default setting on -powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. +powerpc/powerpc and powerpc/powerpc64. .It Va WITH_LOADER_GELI Set to build GELI bootloader support. .Pp @@ -1141,7 +1082,7 @@ amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386 Set to not build LUA bindings for the boot loader. .Pp This is a default setting on -powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. +powerpc/powerpc and powerpc/powerpc64. .It Va WITH_LOADER_LUA Set to build LUA bindings for the boot loader. .Pp @@ -1156,12 +1097,12 @@ amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386 Set to build openfirmware bootloader components. .Pp This is a default setting on -powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. +powerpc/powerpc and powerpc/powerpc64. .It Va WITHOUT_LOADER_UBOOT Disable building of ubldr. .Pp This is a default setting on -amd64/amd64, arm64/aarch64, i386/i386, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +amd64/amd64, arm64/aarch64, i386/i386, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_LOADER_UBOOT Set to build ubldr. .Pp @@ -1332,7 +1273,7 @@ Set to build .Xr mlx5tool 8 .Pp This is a default setting on -amd64/amd64, arm64/aarch64, i386/i386, powerpc/powerpc64 and sparc64/sparc64. +amd64/amd64, arm64/aarch64, i386/i386 and powerpc/powerpc64. .It Va WITHOUT_NDIS Set to not build programs and libraries related to NDIS emulation support. @@ -1397,7 +1338,7 @@ and related programs. Set to not build nvme related tools and kernel modules. .Pp This is a default setting on -arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_NVME Set to build nvme related tools and kernel modules. @@ -1418,7 +1359,7 @@ Enable building openldap support for kerberos. Set to not build LLVM's OpenMP runtime. .Pp This is a default setting on -arm/armv6, arm/armv7, arm64/aarch64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +arm/armv6, arm/armv7, arm64/aarch64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_OPENMP Set to build LLVM's OpenMP runtime. .Pp @@ -1517,7 +1458,7 @@ Set to build profiled libraries for use with .Xr gprof 8 . .Pp This is a default setting on -amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mipsn32, mips/mipselhf, mips/mipshf, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mipsn32, mips/mipselhf, mips/mipshf, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64 and riscv/riscv64sf. .It Va WITHOUT_QUOTAS Set to not build .Xr quota 1 @@ -1607,7 +1548,7 @@ mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mi Set to build world with propolice stack smashing protection. .Pp This is a default setting on -amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_STAGING Enable staging of files to a stage tree. This can be best thought of as auto-install to From owner-svn-src-all@freebsd.org Thu Feb 6 14:31:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9A60622DA33; Thu, 6 Feb 2020 14:31:29 +0000 (UTC) (envelope-from pizzamig@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48D18K3PYtz46Vr; Thu, 6 Feb 2020 14:31:29 +0000 (UTC) (envelope-from pizzamig@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 701AE1D0D7; Thu, 6 Feb 2020 14:31:29 +0000 (UTC) (envelope-from pizzamig@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 016EVTwj059452; Thu, 6 Feb 2020 14:31:29 GMT (envelope-from pizzamig@FreeBSD.org) Received: (from pizzamig@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 016EVTHd059451; Thu, 6 Feb 2020 14:31:29 GMT (envelope-from pizzamig@FreeBSD.org) Message-Id: <202002061431.016EVTHd059451@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pizzamig set sender to pizzamig@FreeBSD.org using -f From: Luca Pizzamiglio Date: Thu, 6 Feb 2020 14:31:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357619 - head/usr.sbin/mixer/tests X-SVN-Group: head X-SVN-Commit-Author: pizzamig X-SVN-Commit-Paths: head/usr.sbin/mixer/tests X-SVN-Commit-Revision: 357619 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 14:31:29 -0000 Author: pizzamig (ports committer) Date: Thu Feb 6 14:31:29 2020 New Revision: 357619 URL: https://svnweb.freebsd.org/changeset/base/357619 Log: mixer: call the cleanup function in a test The set_empty_value test has a cleanup function, but is not called. Fix it Reviewed by: 0mp Approved by: kp Differential Revision: https://reviews.freebsd.org/D23498 Modified: head/usr.sbin/mixer/tests/mixer_test.sh Modified: head/usr.sbin/mixer/tests/mixer_test.sh ============================================================================== --- head/usr.sbin/mixer/tests/mixer_test.sh Thu Feb 6 14:18:48 2020 (r357618) +++ head/usr.sbin/mixer/tests/mixer_test.sh Thu Feb 6 14:31:29 2020 (r357619) @@ -93,7 +93,7 @@ S_flag_cleanup() restore_mixer_vol } -atf_test_case set_empty_value +atf_test_case set_empty_value cleanup set_empty_value_head() { atf_set "descr" "Verify that mixer returns when the provided " \ From owner-svn-src-all@freebsd.org Thu Feb 6 16:22:17 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9395222F87D; Thu, 6 Feb 2020 16:22:17 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48D3c93LYmz4CWC; Thu, 6 Feb 2020 16:22:17 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6DFAE1E618; Thu, 6 Feb 2020 16:22:17 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 016GMHeL027974; Thu, 6 Feb 2020 16:22:17 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 016GMHcT027972; Thu, 6 Feb 2020 16:22:17 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202002061622.016GMHcT027972@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 6 Feb 2020 16:22:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357620 - in stable/12: share/man/man4 sys/dev/ppbus X-SVN-Group: stable-12 X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in stable/12: share/man/man4 sys/dev/ppbus X-SVN-Commit-Revision: 357620 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 16:22:17 -0000 Author: imp Date: Thu Feb 6 16:22:16 2020 New Revision: 357620 URL: https://svnweb.freebsd.org/changeset/base/357620 Log: MFC r357393 However, fix the wording to match the same that we used elsewhere in the NIC deprecation efforts. It was bogus when I committed to to -current. Modified: stable/12/share/man/man4/vpo.4 stable/12/sys/dev/ppbus/vpo.c Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/vpo.4 ============================================================================== --- stable/12/share/man/man4/vpo.4 Thu Feb 6 14:31:29 2020 (r357619) +++ stable/12/share/man/man4/vpo.4 Thu Feb 6 16:22:16 2020 (r357620) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 14, 2004 +.Dd December 21, 2019 .Dt VPO 4 .Os .Sh NAME @@ -39,6 +39,12 @@ For one or more SCSI busses: The .Nm driver provide access to parallel port Iomega Zip and Jaz drives. +.Sh DEPRECATION NOTICE +The +.Nm +driver is not present in +.Fx 13.0 +and later. .Sh HARDWARE The .Nm Modified: stable/12/sys/dev/ppbus/vpo.c ============================================================================== --- stable/12/sys/dev/ppbus/vpo.c Thu Feb 6 14:31:29 2020 (r357619) +++ stable/12/sys/dev/ppbus/vpo.c Thu Feb 6 16:22:16 2020 (r357620) @@ -126,6 +126,7 @@ vpo_probe(device_t dev) return (error); } ppb_unlock(ppbus); + gone_in_dev(dev, 13, "Hardware no longer relevant"); return (0); } From owner-svn-src-all@freebsd.org Thu Feb 6 16:31:00 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 412E722FD3C; Thu, 6 Feb 2020 16:31:00 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk1-x731.google.com (mail-qk1-x731.google.com [IPv6:2607:f8b0:4864:20::731]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48D3pC2mkHz4D57; Thu, 6 Feb 2020 16:30:58 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qk1-x731.google.com with SMTP id x82so6105465qkb.8; Thu, 06 Feb 2020 08:30:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=PJ6tbkfhkenOO72bVEIqtA9q8YdChu97SBfV5CyRhTo=; b=RFGbLnjkh8hDc52tAVZjwzWEnawtXsAqeVkI63UUHmSjrOAPe7DwpE7pY8bGL/QRNQ 1eQKgV+DjHcuD/U+jypFTMUagRmkgMS0b/dHaw/AwjaQC76Y63E9vOM2Z2+egtHglV68 F2crIIOKV5bStLms/Hs3YB1NPErZFjhZGj9u/oYQqflOIu5PG1xQyju9LoX8SLxouTZo CGDV09tb7x6IxzTxRaBHqdHNEGOdk+j51px1gzlwodLhN2fQbYUBHlR3pIyuk25BUgBE 8kHVMakgeAKEZKc7wSgdt4WgVSncEH0OMDD+EYV2LSbW8dE9K8Y/bQzRMk17AyZRYImE 2h+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=PJ6tbkfhkenOO72bVEIqtA9q8YdChu97SBfV5CyRhTo=; b=LjtwqrlYZMSfqdipg2LEaC1umhD+rxoh2+zEqpcv5+l2ewnBLab8JQxHIZ5SHt6EMp zz+Ud05xED0crbBq5vwdDECHHZC+zgY8WlogtMi2sxM4sIcaLifYaW5pzPvj6VDZ8Ca/ qmRDw2znXc1KPII2I6gW1AYiY8zix9Fm7vNeIhmpjbInpIGST53aXPyZQ/txOs5X6Vfc wLLTEIIpYqgZQBHHlu5IgCwPtqj0xxJPz00vEPAnBezGGRsU4LCEuaDjMCVevcBBgcJA pCX2t1sdwTxE8px3cZY3pZE9C034WmpPvci2FmWvLgQN9VKPpVPLWF4dOn6E7rQWM7A/ NH+w== X-Gm-Message-State: APjAAAVr0ux+2XOe6hudCLh09kzP9HiXzeOFV8Wzd561vm48/7lf9onh LnGMUaEHXNTzGpN83BqT3IEgzPqk X-Google-Smtp-Source: APXvYqx9T4kxWOb9diqt7+51BmYJGefN7cN3bUWghRogRRUege9+6tctjKrMIt8FO3z2lfy7d+uRxA== X-Received: by 2002:a37:f518:: with SMTP id l24mr3064183qkk.441.1581006657663; Thu, 06 Feb 2020 08:30:57 -0800 (PST) Received: from spy (ip-45-3-14-96.user.start.ca. [45.3.14.96]) by smtp.gmail.com with ESMTPSA id d25sm1614988qka.39.2020.02.06.08.30.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Feb 2020 08:30:56 -0800 (PST) Sender: Mark Johnston Date: Thu, 6 Feb 2020 11:30:55 -0500 From: Mark Johnston To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r356818 - in head/sys/geom: . concat eli gate journal linux_lvm mirror nop part raid raid3 shsec stripe Message-ID: <20200206163055.GB60144@spy> References: <202001170115.00H1FtSu082373@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202001170115.00H1FtSu082373@repo.freebsd.org> X-Rspamd-Queue-Id: 48D3pC2mkHz4D57 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=RFGbLnjk; dmarc=none; spf=pass (mx1.freebsd.org: domain of markjdb@gmail.com designates 2607:f8b0:4864:20::731 as permitted sender) smtp.mailfrom=markjdb@gmail.com X-Spamd-Result: default: False [-4.29 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[freebsd.org]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-2.59)[ip: (-9.20), ipnet: 2607:f8b0::/32(-1.97), asn: 15169(-1.74), country: US(-0.05)]; DKIM_TRACE(0.00)[gmail.com:+]; RCVD_IN_DNSWL_NONE(0.00)[1.3.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; MID_RHS_NOT_FQDN(0.50)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 16:31:00 -0000 On Fri, Jan 17, 2020 at 01:15:55AM +0000, Warner Losh wrote: > Author: imp > Date: Fri Jan 17 01:15:55 2020 > New Revision: 356818 > URL: https://svnweb.freebsd.org/changeset/base/356818 > > Log: > Pass BIO_SPEEDUP through all the geom layers > > While some geom layers pass unknown commands down, not all do. For the ones that > don't, pass BIO_SPEEDUP down to the providers that constittue the geom, as > applicable. No changes to vinum or virstor because I was unsure how to add this > support, and I'm also unsure how to test these. gvinum doesn't implement > BIO_FLUSH either, so it may just be poorly maintained. gvirstor is for testing > and not supportig BIO_SPEEDUP is fine. > > Reviewed by: chs > Differential Revision: https://reviews.freebsd.org/D23183 Hi Warner, BIO_SPEEDUP triggers an assertion failure in virtblk, as found by syzkaller. I'm not sure how best to handle it - I don't think there's anything the driver can really do with BIO_SPEEDUP, so it could be dropped, but maybe it's unexpected that it's made it to this layer in the first place. http://syzkaller.backtrace.io:8080/file?name=crashes%2f1e84321d4576307b788b7c3e4526facc7d10a46c%2freport0 From owner-svn-src-all@freebsd.org Thu Feb 6 16:37:05 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7100F22FE81; Thu, 6 Feb 2020 16:37:05 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi1-f170.google.com (mail-oi1-f170.google.com [209.85.167.170]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48D3xF2RJpz4Dhv; Thu, 6 Feb 2020 16:37:05 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-oi1-f170.google.com with SMTP id i1so5193843oie.8; Thu, 06 Feb 2020 08:37:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=p/B4m4ujEYtxzn2pFIzTHOi1n4Z89BZROEX4d3i6/YE=; b=PUuV4TEuL0jv1zBJsYKXTakAwIG2AHW8930n34KJmxIelOZt70vfME4M4qPBkfG1Gp MtXyQjDpYo8HINfA4KhpiJ6CT2tOBdrNZ5iTph7A5xST2tYhECBXny6tFGOXMnw36yvI 2gQggH2dG7dbkq5rcyKY38/wmaZvQZBBI4GNPdRnXDGDoJwyPFxWlSY2DYInSXjS8DhI IGn9bIr5oeVcR7cvf1EfA2FJQZDmx0+LulSZl28aN74c0NOvBT5yQt/xUr9hvBBYoGoh lDWkekMrGK1ox4iOdiHKDnEDT71Em+Zs4HoSGq0tx/jbBPC235dVo/Z3KaPnLAaZAxN4 8wKw== X-Gm-Message-State: APjAAAUV53c0Pogu4JW51lg5zyiL3GPCu1Rq3A0gxRRUuIemFQAb0g12 Bxh8PiX9yAdfLJl2Grxtk7B89crS X-Google-Smtp-Source: APXvYqzv51lGg2VE+uYnxzI0L+UqW6Xs7//1ST7QhM6PCGfN69UAhBBQ1W7QkRQniainlt+VReO0dA== X-Received: by 2002:a05:6808:8e1:: with SMTP id d1mr7499238oic.68.1581007024096; Thu, 06 Feb 2020 08:37:04 -0800 (PST) Received: from mail-ot1-f46.google.com (mail-ot1-f46.google.com. [209.85.210.46]) by smtp.gmail.com with ESMTPSA id x22sm23025otk.23.2020.02.06.08.37.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 06 Feb 2020 08:37:03 -0800 (PST) Received: by mail-ot1-f46.google.com with SMTP id b18so6095232otp.0; Thu, 06 Feb 2020 08:37:03 -0800 (PST) X-Received: by 2002:a05:6830:15d2:: with SMTP id j18mr178169otr.216.1581007023414; Thu, 06 Feb 2020 08:37:03 -0800 (PST) MIME-Version: 1.0 References: <202002061245.016CjwTi096374@repo.freebsd.org> In-Reply-To: <202002061245.016CjwTi096374@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Thu, 6 Feb 2020 08:36:52 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r357614 - in head/sys: kern sys To: Pawel Biernacki Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 48D3xF2RJpz4Dhv X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 16:37:05 -0000 Hi Pawel, I don't think the (notyet) static assertion is quite right. On Thu, Feb 6, 2020 at 4:46 AM Pawel Biernacki wrote: > > Author: kaktus > Date: Thu Feb 6 12:45:58 2020 > New Revision: 357614 > URL: https://svnweb.freebsd.org/changeset/base/357614 > > Log: > sysctl(9): add CTLFLAG_NEEDGIANT flag > ... > Modified: head/sys/sys/sysctl.h > ============================================================================== > --- head/sys/sys/sysctl.h Thu Feb 6 10:11:41 2020 (r357613) > +++ head/sys/sys/sysctl.h Thu Feb 6 12:45:58 2020 (r357614) > @@ -105,6 +105,13 @@ struct ctlname { > ... > + * One, and only one of CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT is required > + * for SYSCTL_PROC and SYSCTL_NODE. > ... > @@ -263,6 +270,14 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry); > #define __DESCR(d) "" > #endif > > +#ifdef notyet > +#define SYSCTL_ENFORCE_FLAGS(x) \ > + _Static_assert(((CTLFLAG_MPSAFE ^ CTLFLAG_NEEDGIANT) & (x)), \ > + "Has to be either CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT") The current (notyet) assertion checks for one or both flags being set, but you want to disallow both being set. The XOR operator here is meaningless; it is the same as OR for different bit flags. That would be something like: #define _CTLFLAG_MUTUALLY_EXCLUSIVE (CTLFLAG_MPSAFE | CTLFLAG_NEEDGIANT); #define SYSCTL_ENFORCE_FLAGS(x) do { \ _Static_assert(((x) & _CTLFLAG_MUTUALLY_EXCLUSIVE) != 0 && \ ((x) & _CTLFLAG_MUTUALLY_EXCLUSIVE) != _CTLFLAG_MUTUALLY_EXCLUSIVE, \ "Must set exactly one of CTLFLAG_MPSAFE, CTLFLAG_NEEDGIANT"); \ } while (0) Best, Conrad From owner-svn-src-all@freebsd.org Thu Feb 6 16:38:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1288522FF54; Thu, 6 Feb 2020 16:38:03 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48D3yL5VDxz4DsB; Thu, 6 Feb 2020 16:38:02 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B7E401E84B; Thu, 6 Feb 2020 16:38:02 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 016Gc2Ca034943; Thu, 6 Feb 2020 16:38:02 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 016Gc2SN034942; Thu, 6 Feb 2020 16:38:02 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202002061638.016Gc2SN034942@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 6 Feb 2020 16:38:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357621 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 357621 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 16:38:03 -0000 Author: imp Date: Thu Feb 6 16:38:02 2020 New Revision: 357621 URL: https://svnweb.freebsd.org/changeset/base/357621 Log: 'is now deprecated' -> 'is deprecated' Man pages are written in a more timeless voice than news flashes, so adopt the language to what we do elsewhere. Modified: head/share/man/man5/make.conf.5 Modified: head/share/man/man5/make.conf.5 ============================================================================== --- head/share/man/man5/make.conf.5 Thu Feb 6 16:22:16 2020 (r357620) +++ head/share/man/man5/make.conf.5 Thu Feb 6 16:38:02 2020 (r357621) @@ -574,7 +574,7 @@ Use with caution as a make install will overwrite any .Pa /etc/mail/sendmail.cf . Note that .Va SENDMAIL_CF -is now deprecated. +is deprecated. .It Va SENDMAIL_SET_USER_ID .Pq Vt bool If set, install From owner-svn-src-all@freebsd.org Thu Feb 6 16:38:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A8C5F22FF77; Thu, 6 Feb 2020 16:38:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48D3yR2rsQz4DwP; Thu, 6 Feb 2020 16:38:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5BD6C1E84C; Thu, 6 Feb 2020 16:38:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 016Gc7Ck034997; Thu, 6 Feb 2020 16:38:07 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 016Gc7cF034996; Thu, 6 Feb 2020 16:38:07 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202002061638.016Gc7cF034996@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 6 Feb 2020 16:38:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357622 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 357622 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 16:38:07 -0000 Author: imp Date: Thu Feb 6 16:38:06 2020 New Revision: 357622 URL: https://svnweb.freebsd.org/changeset/base/357622 Log: Avoid the phrase 'now deprecated' Reword this construct to be more consistent with normal man page language. Modified: head/share/man/man5/rc.conf.5 Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Thu Feb 6 16:38:02 2020 (r357621) +++ head/share/man/man5/rc.conf.5 Thu Feb 6 16:38:06 2020 (r357622) @@ -1317,12 +1317,12 @@ ifconfig_em0_alias3="inet 192.0.2.1-5/28" .Pp and so on. .Pp -Note that +Note that deprecated .Va ipv4_addrs_ Ns Aq Ar interface variable was supported for IPv4 CIDR address notation. -It is now deprecated because the functionality was integrated into +The .Va ifconfig_ Ns Ao Ar interface Ac Ns Va _alias Ns Aq Ar n -though +variable replaces it, though .Va ipv4_addrs_ Ns Aq Ar interface is still supported for backward compatibility. .Pp From owner-svn-src-all@freebsd.org Thu Feb 6 16:43:31 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2B73523024D; Thu, 6 Feb 2020 16:43:31 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48D44g0NKyz4FPH; Thu, 6 Feb 2020 16:43:30 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [62.141.129.235]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 0A59D260338; Thu, 6 Feb 2020 17:43:27 +0100 (CET) Subject: Re: svn commit: r357614 - in head/sys: kern sys To: Pawel Biernacki , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202002061245.016CjwTi096374@repo.freebsd.org> From: Hans Petter Selasky Message-ID: Date: Thu, 6 Feb 2020 17:41:52 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: <202002061245.016CjwTi096374@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 48D44g0NKyz4FPH X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 16:43:31 -0000 On 2020-02-06 13:45, Pawel Biernacki wrote: > +#ifdef notyet > +#define SYSCTL_ENFORCE_FLAGS(x) \ > + _Static_assert(((CTLFLAG_MPSAFE ^ CTLFLAG_NEEDGIANT) & (x)), \ > + "Has to be either CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT") > +#else > +#define SYSCTL_ENFORCE_FLAGS(x) > +#endif Like cem@ pointed out, either you expand the XOR via OR or you can also do it like this: (((x) & CTLFLAG_MPSAFE) != 0) ^ (((x) & CTLFLAG_NEEDGIANT) != 0) which avoids having to define another macro. --HPS From owner-svn-src-all@freebsd.org Thu Feb 6 17:51:49 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 42A79231ECF; Thu, 6 Feb 2020 17:51:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48D5bT180mz4Kqd; Thu, 6 Feb 2020 17:51:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 228D81F742; Thu, 6 Feb 2020 17:51:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 016Hpn19080772; Thu, 6 Feb 2020 17:51:49 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 016HpnA5080771; Thu, 6 Feb 2020 17:51:49 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202002061751.016HpnA5080771@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 6 Feb 2020 17:51:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357623 - head X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 357623 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 17:51:49 -0000 Author: imp Date: Thu Feb 6 17:51:48 2020 New Revision: 357623 URL: https://svnweb.freebsd.org/changeset/base/357623 Log: Restore missing comment I was overly agressive about removing the entire comment. It was still valid, except the part about being only for some architectures. Reviewed by: emaste Differenial Revision: https://reviews.freebsd.org/D23523 Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Feb 6 16:38:06 2020 (r357622) +++ head/Makefile.inc1 Thu Feb 6 17:51:48 2020 (r357623) @@ -2912,6 +2912,7 @@ _cddl_lib_libctf= cddl/lib/libctf _cddl_lib= cddl/lib cddl/lib/libctf__L: lib/libz__L .endif +# cddl/lib/libdtrace requires lib/libproc and lib/librtld_db _prebuild_libs+= lib/libprocstat lib/libproc lib/librtld_db lib/libprocstat__L: lib/libelf__L lib/libkvm__L lib/libutil__L lib/libproc__L: lib/libprocstat__L From owner-svn-src-all@freebsd.org Thu Feb 6 17:52:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4411C231F43; Thu, 6 Feb 2020 17:52:03 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48D5bl18z5z4KyW; Thu, 6 Feb 2020 17:52:03 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 21F441F756; Thu, 6 Feb 2020 17:52:03 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 016Hq3OT080836; Thu, 6 Feb 2020 17:52:03 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 016Hq3oS080835; Thu, 6 Feb 2020 17:52:03 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202002061752.016Hq3oS080835@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 6 Feb 2020 17:52:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357624 - in head/sbin: . sunlabel X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sbin: . sunlabel X-SVN-Commit-Revision: 357624 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 17:52:03 -0000 Author: imp Date: Thu Feb 6 17:52:02 2020 New Revision: 357624 URL: https://svnweb.freebsd.org/changeset/base/357624 Log: No need to make sunlabel anymore It was only built on sparc64. Since it wasn't a general tool on other architectures, no need to keep it around for another release. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D23524 Deleted: head/sbin/Makefile.sparc64 head/sbin/sunlabel/Makefile head/sbin/sunlabel/Makefile.depend head/sbin/sunlabel/runtest.sh head/sbin/sunlabel/sun_disklabel.h head/sbin/sunlabel/sunlabel.8 head/sbin/sunlabel/sunlabel.c head/sbin/sunlabel/sunlabel_enc.c From owner-svn-src-all@freebsd.org Thu Feb 6 17:52:08 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0EF81231F71; Thu, 6 Feb 2020 17:52:08 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48D5bq66dDz4L3Y; Thu, 6 Feb 2020 17:52:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A52DE1F765; Thu, 6 Feb 2020 17:52:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 016Hq7W4080887; Thu, 6 Feb 2020 17:52:07 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 016Hq7sH080886; Thu, 6 Feb 2020 17:52:07 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202002061752.016Hq7sH080886@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 6 Feb 2020 17:52:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357625 - head/usr.bin X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.bin X-SVN-Commit-Revision: 357625 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 17:52:08 -0000 Author: imp Date: Thu Feb 6 17:52:07 2020 New Revision: 357625 URL: https://svnweb.freebsd.org/changeset/base/357625 Log: No need to have a special sparc64 list here. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D23525 Deleted: head/usr.bin/Makefile.sparc64 From owner-svn-src-all@freebsd.org Thu Feb 6 17:52:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8A7C1231FAC; Thu, 6 Feb 2020 17:52:12 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48D5bw1RDvz4L7k; Thu, 6 Feb 2020 17:52:12 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1826F1F76E; Thu, 6 Feb 2020 17:52:12 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 016HqBfB083409; Thu, 6 Feb 2020 17:52:11 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 016HqBI3083408; Thu, 6 Feb 2020 17:52:11 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202002061752.016HqBI3083408@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 6 Feb 2020 17:52:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357626 - head/usr.bin/elf2aout X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.bin/elf2aout X-SVN-Commit-Revision: 357626 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 17:52:12 -0000 Author: imp Date: Thu Feb 6 17:52:11 2020 New Revision: 357626 URL: https://svnweb.freebsd.org/changeset/base/357626 Log: Mark elf2aout as deprecated. Only sparc64 used this, so we will be removing it from FreeBSD 13. Add the usual deprecation notice in a MFC-able way. Reviewed by: emaste, rgrimes Differential Revision: https://reviews.freebsd.org/D23526 Modified: head/usr.bin/elf2aout/elf2aout.1 Modified: head/usr.bin/elf2aout/elf2aout.1 ============================================================================== --- head/usr.bin/elf2aout/elf2aout.1 Thu Feb 6 17:52:07 2020 (r357625) +++ head/usr.bin/elf2aout/elf2aout.1 Thu Feb 6 17:52:11 2020 (r357626) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 23, 2008 +.Dd February 6, 2020 .Dt ELF2AOUT 1 .Os .Sh NAME @@ -46,6 +46,12 @@ and this utility is designed to accommodate. If .Ar infile is not in ELF format, an error message will be presented. +.Sh DEPRECATION NOTICE +The +.Nm +utility is not present in +.Fx 13.0 +and later. .Sh SEE ALSO .Xr elf 3 , .Xr a.out 5 From owner-svn-src-all@freebsd.org Thu Feb 6 17:52:17 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 08354232149; Thu, 6 Feb 2020 17:52:17 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48D5c066Gfz4LGW; Thu, 6 Feb 2020 17:52:16 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BEF8D1F777; Thu, 6 Feb 2020 17:52:16 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 016HqGMq083466; Thu, 6 Feb 2020 17:52:16 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 016HqGju083464; Thu, 6 Feb 2020 17:52:16 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202002061752.016HqGju083464@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 6 Feb 2020 17:52:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357627 - in head: . usr.bin usr.bin/elf2aout X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: . usr.bin usr.bin/elf2aout X-SVN-Commit-Revision: 357627 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 17:52:17 -0000 Author: imp Date: Thu Feb 6 17:52:16 2020 New Revision: 357627 URL: https://svnweb.freebsd.org/changeset/base/357627 Log: Remove elf2aout Remove the long obsolete elf2aout utility. Should any ports need to know when this left the tree, use 1300077 as the revision so we avoid multiple bumps for the sparc64 removal. Reviewed by: brooks@, emaste@ Differential Revision: https://reviews.freebsd.org/D23527 Deleted: head/usr.bin/elf2aout/Makefile head/usr.bin/elf2aout/Makefile.depend head/usr.bin/elf2aout/elf2aout.1 head/usr.bin/elf2aout/elf2aout.c Modified: head/ObsoleteFiles.inc head/usr.bin/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Thu Feb 6 17:52:11 2020 (r357626) +++ head/ObsoleteFiles.inc Thu Feb 6 17:52:16 2020 (r357627) @@ -36,6 +36,10 @@ # xargs -n1 | sort | uniq -d; # done +# 20200206: Remove elf2aout +OLD_FILES+=usr/bin/elf2aout +OLD_FILES+=usr/share/man/man1/elf2aout.1.gz + # 20200204: simple_httpd removed OLD_FILES+=usr/sbin/simple_httpd Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Thu Feb 6 17:52:11 2020 (r357626) +++ head/usr.bin/Makefile Thu Feb 6 17:52:16 2020 (r357627) @@ -31,7 +31,6 @@ SUBDIR= alias \ diff \ dirname \ du \ - elf2aout \ elfdump \ enigma \ env \ From owner-svn-src-all@freebsd.org Thu Feb 6 17:57:08 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 433FE232328; Thu, 6 Feb 2020 17:57:08 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48D5jb6zr1z4Lg0; Thu, 6 Feb 2020 17:57:07 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 016Hv0tO003310; Thu, 6 Feb 2020 09:57:00 -0800 (PST) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 016Hv0bV003309; Thu, 6 Feb 2020 09:57:00 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202002061757.016Hv0bV003309@gndrsh.dnsmgr.net> Subject: Re: svn commit: r357624 - in head/sbin: . sunlabel In-Reply-To: <202002061752.016Hq3oS080835@repo.freebsd.org> To: Warner Losh Date: Thu, 6 Feb 2020 09:57:00 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 48D5jb6zr1z4Lg0 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 17:57:08 -0000 > Author: imp > Date: Thu Feb 6 17:52:02 2020 > New Revision: 357624 > URL: https://svnweb.freebsd.org/changeset/base/357624 > > Log: > No need to make sunlabel anymore > > It was only built on sparc64. Since it wasn't a general tool on other > architectures, no need to keep it around for another release. > > Reviewed by: emaste > Differential Revision: https://reviews.freebsd.org/D23524 Should not this whole sparc64 removal have had some deprecation notices put in and merged back to 11 and 12 to give users a pro-active notice that it is gone_in(13)? > Deleted: > head/sbin/Makefile.sparc64 > head/sbin/sunlabel/Makefile > head/sbin/sunlabel/Makefile.depend > head/sbin/sunlabel/runtest.sh > head/sbin/sunlabel/sun_disklabel.h > head/sbin/sunlabel/sunlabel.8 > head/sbin/sunlabel/sunlabel.c > head/sbin/sunlabel/sunlabel_enc.c > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Thu Feb 6 18:00:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E714023249D; Thu, 6 Feb 2020 18:00:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48D5np5pJgz4Lsp; Thu, 6 Feb 2020 18:00:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C26F31F809; Thu, 6 Feb 2020 18:00:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 016I0knV086264; Thu, 6 Feb 2020 18:00:46 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 016I0kVv086263; Thu, 6 Feb 2020 18:00:46 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202002061800.016I0kVv086263@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 6 Feb 2020 18:00:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357628 - head X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 357628 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 18:00:47 -0000 Author: imp Date: Thu Feb 6 18:00:46 2020 New Revision: 357628 URL: https://svnweb.freebsd.org/changeset/base/357628 Log: Add relnotes entries for armv5 and sparc64 being removed. These commits lacked the proper relnotes entries in the commit message. Modified: head/RELNOTES Modified: head/RELNOTES ============================================================================== --- head/RELNOTES Thu Feb 6 17:52:16 2020 (r357627) +++ head/RELNOTES Thu Feb 6 18:00:46 2020 (r357628) @@ -16,6 +16,9 @@ r357560-r357565: default. Notably, environment variables for all cron jobs and rc services can now be set via login.conf(5). +r357455: + sparc64 has been removed from FreeBSD. + r355677: Adds support for NFSv4.2 (RFC-7862) and Extended Attributes (RFC-8276) to the NFS client and server. @@ -37,6 +40,9 @@ r355677: server. Setting vfs.nfsd.server_max_minorversion4 to 0 or 1 will disable NFSv4.2 on the server. + +r356263: + armv5 support has been removed from FreeBSD. r354517: iwm(4) now supports most Intel 9260, 9460 and 9560 Wi-Fi devices. From owner-svn-src-all@freebsd.org Thu Feb 6 18:00:51 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 760732324C6; Thu, 6 Feb 2020 18:00:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48D5nv2dzRz4LvM; Thu, 6 Feb 2020 18:00:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 560741F814; Thu, 6 Feb 2020 18:00:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 016I0ppY086318; Thu, 6 Feb 2020 18:00:51 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 016I0pWs086317; Thu, 6 Feb 2020 18:00:51 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202002061800.016I0pWs086317@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 6 Feb 2020 18:00:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357629 - head X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 357629 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 18:00:51 -0000 Author: imp Date: Thu Feb 6 18:00:50 2020 New Revision: 357629 URL: https://svnweb.freebsd.org/changeset/base/357629 Log: Add elf2aout removal After committing, I noticed elf2aout commit missed the relnotes yes. It's unlikely to be interesting, since it's just part of sparc64 removal and quite niche, but it was installed on all FreeBSD machines. Modified: head/RELNOTES Modified: head/RELNOTES ============================================================================== --- head/RELNOTES Thu Feb 6 18:00:46 2020 (r357628) +++ head/RELNOTES Thu Feb 6 18:00:50 2020 (r357629) @@ -10,6 +10,9 @@ newline. Entries should be separated by a newline. Changes to this file should not be MFCed. +r357627: + remove elf2aout. + r357560-r357565: init(8), service(8), and cron(8) will now adopt user/class environment variables (excluding PATH, by default, which will be overwritten) by From owner-svn-src-all@freebsd.org Thu Feb 6 18:02:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B3E4A232711; Thu, 6 Feb 2020 18:02:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48D5qy4K5Xz4MLp; Thu, 6 Feb 2020 18:02:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8F7A61F9AF; Thu, 6 Feb 2020 18:02:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 016I2caY089439; Thu, 6 Feb 2020 18:02:38 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 016I2cVu089438; Thu, 6 Feb 2020 18:02:38 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202002061802.016I2cVu089438@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 6 Feb 2020 18:02:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357630 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 357630 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 18:02:38 -0000 Author: jhb Date: Thu Feb 6 18:02:38 2020 New Revision: 357630 URL: https://svnweb.freebsd.org/changeset/base/357630 Log: Fix DDB to unwind across exception frames. While here, add an extra line of information for exceptions and interrupts and compress the per-frame line down to one line to match other architectures. Reviewed by: mhorne, br MFC after: 1 week Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D23508 Modified: head/sys/riscv/riscv/db_trace.c Modified: head/sys/riscv/riscv/db_trace.c ============================================================================== --- head/sys/riscv/riscv/db_trace.c Thu Feb 6 18:00:50 2020 (r357629) +++ head/sys/riscv/riscv/db_trace.c Thu Feb 6 18:02:38 2020 (r357630) @@ -2,6 +2,7 @@ * Copyright (c) 2015 The FreeBSD Foundation * Copyright (c) 2016 Ruslan Bukin * All rights reserved. + * Copyright (c) 2020 John Baldwin * * Portions of this software were developed by Semihalf under * the sponsorship of the FreeBSD Foundation. @@ -38,15 +39,18 @@ #include __FBSDID("$FreeBSD$"); + #include -#include #include -#include +#include + #include #include +#include #include #include +#include void db_md_list_watchpoints() @@ -80,9 +84,6 @@ db_stack_trace_cmd(struct unwind_state *frame) while (1) { pc = frame->pc; - if (unwind_frame(frame) < 0) - break; - sym = db_search_symbol(pc, DB_STGY_ANY, &offset); if (sym == C_DB_SYM_NULL) { value = 0; @@ -94,11 +95,32 @@ db_stack_trace_cmd(struct unwind_state *frame) db_printsym(frame->pc, DB_STGY_PROC); db_printf("\n"); - db_printf("\t pc = 0x%016lx ra = 0x%016lx\n", - pc, frame->pc); - db_printf("\t sp = 0x%016lx fp = 0x%016lx\n", - frame->sp, frame->fp); - db_printf("\n"); + if (strcmp(name, "cpu_exception_handler_supervisor") == 0 || + strcmp(name, "cpu_exception_handler_user") == 0) { + struct trapframe *tf; + + tf = (struct trapframe *)(uintptr_t)frame->sp; + + if (tf->tf_scause & EXCP_INTR) + db_printf("--- interrupt %ld\n", + tf->tf_scause & EXCP_MASK); + else + db_printf("--- exception %ld, tval = %#lx\n", + tf->tf_scause & EXCP_MASK, + tf->tf_stval); + frame->sp = (uint64_t)tf->tf_sp; + frame->fp = (uint64_t)tf->tf_s[0]; + frame->pc = (uint64_t)tf->tf_sepc; + if (!INKERNEL(frame->fp)) + break; + continue; + } + + if (strcmp(name, "fork_trampoline") == 0) + break; + + if (unwind_frame(frame) < 0) + break; } } From owner-svn-src-all@freebsd.org Thu Feb 6 18:04:16 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AEBBE2327A7; Thu, 6 Feb 2020 18:04:16 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48D5sr4GnZz4MVZ; Thu, 6 Feb 2020 18:04:16 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8DE6C1F9BA; Thu, 6 Feb 2020 18:04:16 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 016I4GmA089556; Thu, 6 Feb 2020 18:04:16 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 016I4Gx8089554; Thu, 6 Feb 2020 18:04:16 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <202002061804.016I4Gx8089554@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 6 Feb 2020 18:04:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357631 - head/usr.sbin/fstyp X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/usr.sbin/fstyp X-SVN-Commit-Revision: 357631 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 18:04:16 -0000 Author: pfg Date: Thu Feb 6 18:04:15 2020 New Revision: 357631 URL: https://svnweb.freebsd.org/changeset/base/357631 Log: fstyp: sync HAMMER1/2 detection support with DragonFly BSD. Submitted by: Tomohiro Kusumi PR: 243929 Modified: head/usr.sbin/fstyp/hammer.c head/usr.sbin/fstyp/hammer2.c Modified: head/usr.sbin/fstyp/hammer.c ============================================================================== --- head/usr.sbin/fstyp/hammer.c Thu Feb 6 18:02:38 2020 (r357630) +++ head/usr.sbin/fstyp/hammer.c Thu Feb 6 18:04:15 2020 (r357631) @@ -1,5 +1,6 @@ /*- - * Copyright (c) 2016 The DragonFly Project + * Copyright (c) 2016-2019 The DragonFly Project + * Copyright (c) 2016-2019 Tomohiro Kusumi * All rights reserved. * * This software was developed by Edward Tomasz Napierala under sponsorship @@ -43,7 +44,7 @@ __FBSDID("$FreeBSD$"); #include "fstyp.h" static hammer_volume_ondisk_t -__read_ondisk(FILE *fp) +read_ondisk(FILE *fp) { hammer_volume_ondisk_t ondisk; @@ -55,7 +56,7 @@ __read_ondisk(FILE *fp) } static int -__test_ondisk(const hammer_volume_ondisk_t ondisk) +test_ondisk(const hammer_volume_ondisk_t ondisk) { static int count = 0; static hammer_uuid_t fsid, fstype; @@ -97,23 +98,23 @@ fstyp_hammer(FILE *fp, char *label, size_t size) hammer_volume_ondisk_t ondisk; int error = 1; - ondisk = __read_ondisk(fp); + ondisk = read_ondisk(fp); if (ondisk->vol_no != HAMMER_ROOT_VOLNO) - goto done; + goto fail; if (ondisk->vol_count != 1) - goto done; - if (__test_ondisk(ondisk)) - goto done; + goto fail; + if (test_ondisk(ondisk)) + goto fail; strlcpy(label, ondisk->vol_label, size); error = 0; -done: +fail: free(ondisk); return (error); } static int -__test_volume(const char *volpath) +test_volume(const char *volpath) { hammer_volume_ondisk_t ondisk; FILE *fp; @@ -122,13 +123,13 @@ __test_volume(const char *volpath) if ((fp = fopen(volpath, "r")) == NULL) err(1, "failed to open %s", volpath); - ondisk = __read_ondisk(fp); + ondisk = read_ondisk(fp); fclose(fp); - if (__test_ondisk(ondisk)) - goto done; + if (test_ondisk(ondisk)) + goto fail; volno = ondisk->vol_no; -done: +fail: free(ondisk); return (volno); } @@ -136,51 +137,60 @@ done: static int __fsvtyp_hammer(const char *blkdevs, char *label, size_t size, int partial) { - hammer_volume_ondisk_t ondisk; + hammer_volume_ondisk_t ondisk = NULL; FILE *fp; char *dup, *p, *volpath, x[HAMMER_MAX_VOLUMES]; int i, volno, error = 1; + if (!blkdevs) + goto fail; + memset(x, 0, sizeof(x)); dup = strdup(blkdevs); p = dup; + volpath = NULL; + volno = -1; while (p) { volpath = p; if ((p = strchr(p, ':')) != NULL) *p++ = '\0'; - if ((volno = __test_volume(volpath)) == -1) + if ((volno = test_volume(volpath)) == -1) break; + assert(volno >= 0); + assert(volno < HAMMER_MAX_VOLUMES); x[volno]++; } + if (!volpath) + err(1, "invalid path %s", blkdevs); if ((fp = fopen(volpath, "r")) == NULL) err(1, "failed to open %s", volpath); - ondisk = __read_ondisk(fp); + ondisk = read_ondisk(fp); fclose(fp); free(dup); if (volno == -1) - goto done; + goto fail; if (partial) goto success; for (i = 0; i < HAMMER_MAX_VOLUMES; i++) if (x[i] > 1) - goto done; + goto fail; for (i = 0; i < HAMMER_MAX_VOLUMES; i++) if (x[i] == 0) break; if (ondisk->vol_count != i) - goto done; + goto fail; for (; i < HAMMER_MAX_VOLUMES; i++) if (x[i] != 0) - goto done; + goto fail; success: strlcpy(label, ondisk->vol_label, size); error = 0; -done: +fail: free(ondisk); return (error); } Modified: head/usr.sbin/fstyp/hammer2.c ============================================================================== --- head/usr.sbin/fstyp/hammer2.c Thu Feb 6 18:02:38 2020 (r357630) +++ head/usr.sbin/fstyp/hammer2.c Thu Feb 6 18:04:15 2020 (r357631) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2017-2019 The DragonFly Project + * Copyright (c) 2017-2019 Tomohiro Kusumi * All rights reserved. * * This software was developed by Edward Tomasz Napierala under sponsorship @@ -32,8 +33,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include +#include #include @@ -42,7 +45,7 @@ __FBSDID("$FreeBSD$"); #include "fstyp.h" static hammer2_volume_data_t* -__read_voldata(FILE *fp) +read_voldata(FILE *fp) { hammer2_volume_data_t *voldata; @@ -54,7 +57,7 @@ __read_voldata(FILE *fp) } static int -__test_voldata(const hammer2_volume_data_t *voldata) +test_voldata(const hammer2_volume_data_t *voldata) { if (voldata->magic != HAMMER2_VOLUME_ID_HBO && voldata->magic != HAMMER2_VOLUME_ID_ABO) @@ -63,14 +66,152 @@ __test_voldata(const hammer2_volume_data_t *voldata) return (0); } +static hammer2_media_data_t* +read_media(FILE *fp, const hammer2_blockref_t *bref, size_t *media_bytes) +{ + hammer2_media_data_t *media; + hammer2_off_t io_off, io_base; + size_t bytes, io_bytes, boff; + + bytes = (bref->data_off & HAMMER2_OFF_MASK_RADIX); + if (bytes) + bytes = (size_t)1 << bytes; + *media_bytes = bytes; + + if (!bytes) { + warnx("blockref has no data"); + return (NULL); + } + + io_off = bref->data_off & ~HAMMER2_OFF_MASK_RADIX; + io_base = io_off & ~(hammer2_off_t)(HAMMER2_MINIOSIZE - 1); + boff = io_off - io_base; + + io_bytes = HAMMER2_MINIOSIZE; + while (io_bytes + boff < bytes) + io_bytes <<= 1; + + if (io_bytes > sizeof(hammer2_media_data_t)) { + warnx("invalid I/O bytes"); + return (NULL); + } + + if (fseek(fp, io_base, SEEK_SET) == -1) { + warnx("failed to seek media"); + return (NULL); + } + media = read_buf(fp, io_base, io_bytes); + if (media == NULL) { + warnx("failed to read media"); + return (NULL); + } + if (boff) + memcpy(media, (char *)media + boff, bytes); + + return (media); +} + static int -__read_label(FILE *fp, char *label, size_t size) +find_pfs(FILE *fp, const hammer2_blockref_t *bref, const char *pfs, bool *res) { + hammer2_media_data_t *media; + hammer2_inode_data_t ipdata; + hammer2_blockref_t *bscan; + size_t bytes; + int i, bcount; + + media = read_media(fp, bref, &bytes); + if (media == NULL) + return (-1); + + switch (bref->type) { + case HAMMER2_BREF_TYPE_INODE: + ipdata = media->ipdata; + if (ipdata.meta.pfs_type & HAMMER2_PFSTYPE_SUPROOT) { + bscan = &ipdata.u.blockset.blockref[0]; + bcount = HAMMER2_SET_COUNT; + } else { + bscan = NULL; + bcount = 0; + if (ipdata.meta.op_flags & HAMMER2_OPFLAG_PFSROOT) { + if (memchr(ipdata.filename, 0, + sizeof(ipdata.filename))) { + if (!strcmp( + (const char*)ipdata.filename, pfs)) + *res = true; + } else { + if (strlen(pfs) > 0 && + !memcmp(ipdata.filename, pfs, + strlen(pfs))) + *res = true; + } + } else + assert(0); + } + break; + case HAMMER2_BREF_TYPE_INDIRECT: + bscan = &media->npdata[0]; + bcount = bytes / sizeof(hammer2_blockref_t); + break; + default: + bscan = NULL; + bcount = 0; + break; + } + + for (i = 0; i < bcount; ++i) { + if (bscan[i].type != HAMMER2_BREF_TYPE_EMPTY) { + if (find_pfs(fp, &bscan[i], pfs, res) == -1) { + free(media); + return (-1); + } + } + } + free(media); + + return (0); +} + +static char* +extract_device_name(const char *devpath) +{ + char *p, *head; + + if (!devpath) + return NULL; + + p = strdup(devpath); + head = p; + + p = strchr(p, '@'); + if (p) + *p = 0; + + p = strrchr(head, '/'); + if (p) { + p++; + if (*p == 0) { + free(head); + return NULL; + } + p = strdup(p); + free(head); + return p; + } + + return head; +} + +static int +read_label(FILE *fp, char *label, size_t size) +{ hammer2_blockref_t broot, best, *bref; hammer2_media_data_t *vols[HAMMER2_NUM_VOLHDRS], *media; - hammer2_off_t io_off, io_base; - size_t bytes, io_bytes, boff; - int i, best_i, error = 0; + size_t bytes; + bool res = false; + int i, best_i, error = 1; + const char *pfs; + char *devname; best_i = -1; memset(&best, 0, sizeof(best)); @@ -90,40 +231,39 @@ __read_label(FILE *fp, char *label, size_t size) bref = &vols[best_i]->voldata.sroot_blockset.blockref[0]; if (bref->type != HAMMER2_BREF_TYPE_INODE) { - warnx("Superroot blockref type is not inode"); - error = 2; - goto done; + warnx("blockref type is not inode"); + goto fail; } - bytes = bref->data_off & HAMMER2_OFF_MASK_RADIX; - if (bytes) - bytes = (size_t)1 << bytes; - if (bytes != sizeof(hammer2_inode_data_t)) { - warnx("Superroot blockref size does not match inode size"); - error = 3; - goto done; + media = read_media(fp, bref, &bytes); + if (media == NULL) { + goto fail; } - io_off = bref->data_off & ~HAMMER2_OFF_MASK_RADIX; - io_base = io_off & ~(hammer2_off_t)(HAMMER2_MINIOSIZE - 1); - boff = io_off - io_base; + pfs = ""; + devname = extract_device_name(NULL); + assert(!devname); /* Currently always NULL in FreeBSD. */ - io_bytes = HAMMER2_MINIOSIZE; - while (io_bytes + boff < bytes) - io_bytes <<= 1; - if (io_bytes > sizeof(*media)) { - warnx("Invalid I/O bytes"); - error = 4; - goto done; + /* Add device name to help support multiple autofs -media mounts. */ + if (find_pfs(fp, bref, pfs, &res) == 0 && res) { + if (devname) + snprintf(label, size, "%s_%s", pfs, devname); + else + strlcpy(label, pfs, size); + } else { + memset(label, 0, size); + memcpy(label, media->ipdata.filename, + sizeof(media->ipdata.filename)); + if (devname) { + strlcat(label, "_", size); + strlcat(label, devname, size); + } } - - media = read_buf(fp, io_base, io_bytes); - if (boff) - memcpy(media, (char*)media + boff, bytes); - - strlcpy(label, (char*)media->ipdata.filename, size); + if (devname) + free(devname); free(media); -done: + error = 0; +fail: for (i = 0; i < HAMMER2_NUM_VOLHDRS; i++) free(vols[i]); @@ -136,12 +276,12 @@ fstyp_hammer2(FILE *fp, char *label, size_t size) hammer2_volume_data_t *voldata; int error = 1; - voldata = __read_voldata(fp); - if (__test_voldata(voldata)) - goto done; + voldata = read_voldata(fp); + if (test_voldata(voldata)) + goto fail; - error = __read_label(fp, label, size); -done: + error = read_label(fp, label, size); +fail: free(voldata); return (error); } From owner-svn-src-all@freebsd.org Thu Feb 6 18:04:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 48370232845; Thu, 6 Feb 2020 18:04:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48D5tQ1Dtqz4Mdk; Thu, 6 Feb 2020 18:04:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 257D21F9BC; Thu, 6 Feb 2020 18:04:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 016I4kvE089637; Thu, 6 Feb 2020 18:04:46 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 016I4jtJ089635; Thu, 6 Feb 2020 18:04:45 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202002061804.016I4jtJ089635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 6 Feb 2020 18:04:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357632 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 357632 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 18:04:46 -0000 Author: jhb Date: Thu Feb 6 18:04:45 2020 New Revision: 357632 URL: https://svnweb.freebsd.org/changeset/base/357632 Log: Use the context created in makectx() for stack traces. Always use the kdb_thr_ctx() for db_trace_thread() as on other architectures. Initialize pcb_ra to be the sepc from the saved trapframe rather than the saved ra to avoid skipping a frame. Reviewed by: mhorne, br MFC after: 1 week Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D23513 Modified: head/sys/riscv/riscv/db_trace.c head/sys/riscv/riscv/machdep.c Modified: head/sys/riscv/riscv/db_trace.c ============================================================================== --- head/sys/riscv/riscv/db_trace.c Thu Feb 6 18:04:15 2020 (r357631) +++ head/sys/riscv/riscv/db_trace.c Thu Feb 6 18:04:45 2020 (r357632) @@ -130,15 +130,12 @@ db_trace_thread(struct thread *thr, int count) struct unwind_state frame; struct pcb *ctx; - if (thr != curthread) { - ctx = kdb_thr_ctx(thr); + ctx = kdb_thr_ctx(thr); - frame.sp = (uint64_t)ctx->pcb_sp; - frame.fp = (uint64_t)ctx->pcb_s[0]; - frame.pc = (uint64_t)ctx->pcb_ra; - db_stack_trace_cmd(&frame); - } else - db_trace_self(); + frame.sp = (uint64_t)ctx->pcb_sp; + frame.fp = (uint64_t)ctx->pcb_s[0]; + frame.pc = (uint64_t)ctx->pcb_ra; + db_stack_trace_cmd(&frame); return (0); } Modified: head/sys/riscv/riscv/machdep.c ============================================================================== --- head/sys/riscv/riscv/machdep.c Thu Feb 6 18:04:15 2020 (r357631) +++ head/sys/riscv/riscv/machdep.c Thu Feb 6 18:04:45 2020 (r357632) @@ -571,7 +571,7 @@ makectx(struct trapframe *tf, struct pcb *pcb) memcpy(pcb->pcb_s, tf->tf_s, sizeof(tf->tf_s)); - pcb->pcb_ra = tf->tf_ra; + pcb->pcb_ra = tf->tf_sepc; pcb->pcb_sp = tf->tf_sp; pcb->pcb_gp = tf->tf_gp; pcb->pcb_tp = tf->tf_tp; From owner-svn-src-all@freebsd.org Thu Feb 6 18:09:41 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E57F12329C4 for ; Thu, 6 Feb 2020 18:09:41 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x842.google.com (mail-qt1-x842.google.com [IPv6:2607:f8b0:4864:20::842]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48D605199qz4Myf for ; Thu, 6 Feb 2020 18:09:40 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x842.google.com with SMTP id w47so5212881qtk.4 for ; Thu, 06 Feb 2020 10:09:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=pYem1egin+g0ls7S6yKVa+eDOePcoa3GTNPpr85Ktfc=; b=HFK63i8x3rvjRKqjGmm0hblWUxu3F6/iOy6xRd8qno8f4bwzh+xVVl5pTiVQ+BJWJ1 4WHvs06gw1GWDe4tka0uKx2cc7QaUe++dmb6uCDpVbsMmZHXoej1uH2Km5kCckaBV1br oxmbcg3tMIEfwLhfbsnuIw6F8MchPG1uclwr6ghlxXFAXbMtpNZH+YU5kszBPjjOGlx9 uvsKascqTEo98KV9S0TfuqQCJs8TRkga3CoSSEd8GAnJjnzXJDPvxBXeNe0HJ6vXSkoP cLdxOXsORPWrl1ziahyHHIoBOBO5kWrnLJdoS9uzw9m3+Ne25V2vK5ZJQ4uKqf2Wj6cV ym0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=pYem1egin+g0ls7S6yKVa+eDOePcoa3GTNPpr85Ktfc=; b=PnS6KQT0B64ZrAdFmsCuN0wi8PNvS/cmfI7Q5EIs3eD3XHa6zPdBJjOt3DvWl1ysT1 KYN1BfRWYzxKasMEaMkDyPNs+jsOMM0az5aC1D/3fajYhCNVoElDz1CIYp6UYzXFURiY jjqBMDiYed2ItHixPg72w4K+H2oqWJERjBiyx0yRAbZblLZNYHHM2dtRqSFwA8kb4H09 1/72Of8I5tLXrDP34SdPTOrRfZNINnJFuH9tdOCVQyFk16w8BF5UmtEplOxVBWLYaCsD bPEawscnezvrOx3NQUr9mfg91sAeJplvLndv/M95axEqW3s1dAUFYKEgBfMhjdKaz73Y haPA== X-Gm-Message-State: APjAAAX6ehP56dnB73WxwdYskyTF0oGhUX75k7sTUtsQu5sc1gU1BHNc Rbq0lWnleLHExRzqTIJTOhEkO0AG8OL0D7PZ5vb1Xccd X-Google-Smtp-Source: APXvYqwTXdKixrMb/Iku8QWjY2EKtX3cHvh+3e7wMUnMy1HW7ZWDYLNsyGAPTY4/HCKXEfhYogMOD6FKM8LN6uYYDbU= X-Received: by 2002:ac8:78c:: with SMTP id l12mr3792701qth.187.1581012580306; Thu, 06 Feb 2020 10:09:40 -0800 (PST) MIME-Version: 1.0 References: <202002061752.016Hq3oS080835@repo.freebsd.org> <202002061757.016Hv0bV003309@gndrsh.dnsmgr.net> In-Reply-To: <202002061757.016Hv0bV003309@gndrsh.dnsmgr.net> From: Warner Losh Date: Thu, 6 Feb 2020 11:09:29 -0700 Message-ID: Subject: Re: svn commit: r357624 - in head/sbin: . sunlabel To: "Rodney W. Grimes" Cc: Warner Losh , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 48D605199qz4Myf X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=HFK63i8x; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::842) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-2.39 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[2.4.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-0.39)[ip: (1.82), ipnet: 2607:f8b0::/32(-1.97), asn: 15169(-1.74), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 18:09:42 -0000 On Thu, Feb 6, 2020 at 10:57 AM Rodney W. Grimes wrote: > > Author: imp > > Date: Thu Feb 6 17:52:02 2020 > > New Revision: 357624 > > URL: https://svnweb.freebsd.org/changeset/base/357624 > > > > Log: > > No need to make sunlabel anymore > > > > It was only built on sparc64. Since it wasn't a general tool on other > > architectures, no need to keep it around for another release. > > > > Reviewed by: emaste > > Differential Revision: https://reviews.freebsd.org/D23524 > > Should not this whole sparc64 removal have had some deprecation notices > put in and merged back to 11 and 12 to give users a pro-active notice > that it is gone_in(13)? > We should definitely put it in the 11 and 12 release notes. That's a good idea. We can put a printf in the kernel so everybody sees it on boot. I'll make that change, though I don't think gone_in is quite right there (I'll check before I commit). This should cover all bases. For all the utilities that are installed on all the platforms I'll do it (like I did for elf2aout), but for utilities that are only on sparc64, I have no plans to do it. They are covered by the general 'sparc64 is removed in FreeBSD 13.0'. I think this is a reasonable compromise that catches the corner cases where people are using a utility not on sparc64, but that we're removing it while saving a little bit of work which is rather tedious and error prone for a utility that one could not reasonably expect to be in 13. It's the MFC bit that makes this somewhat tedious because we normally do those days later... Warner From owner-svn-src-all@freebsd.org Thu Feb 6 18:26:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C26D9233360; Thu, 6 Feb 2020 18:26:37 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48D6Mc2JhJz4PKj; Thu, 6 Feb 2020 18:26:35 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 016IQXUY003477; Thu, 6 Feb 2020 10:26:33 -0800 (PST) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 016IQXI8003476; Thu, 6 Feb 2020 10:26:33 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202002061826.016IQXI8003476@gndrsh.dnsmgr.net> Subject: Re: svn commit: r357624 - in head/sbin: . sunlabel In-Reply-To: To: Warner Losh Date: Thu, 6 Feb 2020 10:26:33 -0800 (PST) CC: "Rodney W. Grimes" , Warner Losh , src-committers , svn-src-all , svn-src-head Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 48D6Mc2JhJz4PKj X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd@gndrsh.dnsmgr.net has no SPF policy when checking 69.59.192.140) smtp.mailfrom=freebsd@gndrsh.dnsmgr.net X-Spamd-Result: default: False [0.88 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; NEURAL_HAM_MEDIUM(-0.71)[-0.706,0]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[dnsmgr.net]; AUTH_NA(1.00)[]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; NEURAL_SPAM_LONG(0.65)[0.649,0]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(0.03)[ip: (0.13), ipnet: 69.59.192.0/19(0.07), asn: 13868(0.03), country: US(-0.05)]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 18:26:37 -0000 > On Thu, Feb 6, 2020 at 10:57 AM Rodney W. Grimes > wrote: > > > > Author: imp > > > Date: Thu Feb 6 17:52:02 2020 > > > New Revision: 357624 > > > URL: https://svnweb.freebsd.org/changeset/base/357624 > > > > > > Log: > > > No need to make sunlabel anymore > > > > > > It was only built on sparc64. Since it wasn't a general tool on other > > > architectures, no need to keep it around for another release. > > > > > > Reviewed by: emaste > > > Differential Revision: https://reviews.freebsd.org/D23524 > > > > Should not this whole sparc64 removal have had some deprecation notices > > put in and merged back to 11 and 12 to give users a pro-active notice > > that it is gone_in(13)? > > > > We should definitely put it in the 11 and 12 release notes. That's a good > idea. Random thought, dont pay it too much attention but: DEPRECATED sitting next to RELNOTES? Or even a specific section in RELNOTES? Thought that is not suppose to be MFC'ed. > We can put a printf in the kernel so everybody sees it on boot. I'll make > that change, though I don't think gone_in is quite right there (I'll check > before I commit). This should cover all bases. > > For all the utilities that are installed on all the platforms I'll do it > (like I did for elf2aout), but for utilities that are only on sparc64, I > have no plans to do it. They are covered by the general 'sparc64 is removed > in FreeBSD 13.0'. I think this is a reasonable compromise that catches the > corner cases where people are using a utility not on sparc64, but that > we're removing it while saving a little bit of work which is rather tedious > and error prone for a utility that one could not reasonably expect to be in > 13. That seems a reasonble best effort to me. > It's the MFC bit that makes this somewhat tedious because we normally > do those days later... That shouldnt effect it as long as the MFC'able commit is done first, then the removal commit. > Warner -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Thu Feb 6 18:31:27 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D1CE6233635; Thu, 6 Feb 2020 18:31:27 +0000 (UTC) (envelope-from pawel.biernacki@gmail.com) Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48D6TB4chmz4Pbd; Thu, 6 Feb 2020 18:31:26 +0000 (UTC) (envelope-from pawel.biernacki@gmail.com) Received: by mail-lj1-x235.google.com with SMTP id v17so7181574ljg.4; Thu, 06 Feb 2020 10:31:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=2pySyBOffS6Rk8g1h5Jni6VtF9XTRLxus5pSr6zuX34=; b=gysNMDPLGQdpPWO3GtfnZksaOZL0iraN0lQDUxEhZRTGHy3XfvPVY0jXvP1Pu+JFCq N8ywYPI/vChyxUg8oEYI3ZW3prJqWMEBpKiLPC7wcZNnpmxkvMxaSxJdD/LTCWvRgcmC 895pSAc3SkhlOYRQ+mVb6DzKBPx5qb+N2dodAfsCC9cbAa/g4N/BXLQsd7CsTbTgYJSh rLVlVeFXjAHiGVbGkx1VJohLPGcPFTws0TIgdAg6JuHXe5GmC4ja2Ue6I0PQdiW7ZmVE Ybq0sIohp0hf4xiGbxIb/rhsnr1RAFHM+TrK/8rIlQ3CFNWgi50Rwbjwd18btiD9nYHC x73w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=2pySyBOffS6Rk8g1h5Jni6VtF9XTRLxus5pSr6zuX34=; b=f0cyOJ1kDJp6g3kJ4MOAw9DCbwumsC3F7T7nHP8dz6YbnoQungymM+q2Gx5dP03R+q WDRyo9oFiulBEbU0+IJlQu0kJnaYuUEQUgIuLcVTvYrgFPLawgqRx9Esg9OZFToO1X5B ieDVBo0M/3/kVklMzf7jBmGvlczxuufWalPppCe4MHhFnQW9h3otXf1i6FQh3GTXEw27 247/7Wm0zIL8WcKdYQuG4vFnQPrqJbPoGz2G8SNiN++laVeiwyNCpkDiHIgUI4RjNzbO lM3PI4Ne/u85+4PUoPB98UWT4Jna8sG+aDzIAqLth9cG2010KLNpji8edNaHHAZpMbna jl8Q== X-Gm-Message-State: APjAAAVijMSxx6L2mEkdh47nATgb7rhKMMN57DIXPAWr0p+tw/w9sfX9 3C3fA5zEfa26Ffh35boMgFMaT95wuDE= X-Google-Smtp-Source: APXvYqwJnHWLYq228W4mTHohxd4cQDuH8xImkOtu4WrewI8APqz+yzx0Yh8Rpf3biXxeTYvdTYly+A== X-Received: by 2002:a2e:b04b:: with SMTP id d11mr2881710ljl.248.1581013884331; Thu, 06 Feb 2020 10:31:24 -0800 (PST) Received: from [172.20.0.153] (193-106-244-222.noc.fibertech.net.pl. [193.106.244.222]) by smtp.gmail.com with ESMTPSA id a8sm54675ljn.74.2020.02.06.10.31.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Feb 2020 10:31:23 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.60.0.2.5\)) Subject: Re: svn commit: r357614 - in head/sys: kern sys From: =?utf-8?Q?Pawe=C5=82_Biernacki?= In-Reply-To: Date: Thu, 6 Feb 2020 19:31:22 +0100 Cc: Pawel Biernacki , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <98C8A90D-84F5-4E10-B982-DDF95B8912D2@gmail.com> References: <202002061245.016CjwTi096374@repo.freebsd.org> To: Hans Petter Selasky X-Mailer: Apple Mail (2.3608.60.0.2.5) X-Rspamd-Queue-Id: 48D6TB4chmz4Pbd X-Spamd-Bar: +++++ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=gysNMDPL; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of pawelbiernacki@gmail.com designates 2a00:1450:4864:20::235 as permitted sender) smtp.mailfrom=pawelbiernacki@gmail.com X-Spamd-Result: default: False [5.78 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(0.00)[+ip6:2a00:1450:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MV_CASE(0.50)[]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(0.00)[gmail.com,none]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; TAGGED_FROM(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; RECEIVED_SPAMHAUS_XBL(5.00)[222.244.106.193.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.4]; R_DKIM_ALLOW(0.00)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-0.52)[-0.515,0]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(0.00)[ip: (-9.39), ipnet: 2a00:1450::/32(-2.49), asn: 15169(-1.74), country: US(-0.05)]; IP_SCORE_FREEMAIL(0.00)[]; BAD_REP_POLICIES(0.10)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(0.80)[0.797,0]; RCVD_IN_DNSWL_NONE(0.00)[5.3.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 18:31:27 -0000 Thanks, will be fixed before enabling it. > On 6 Feb 2020, at 17:41, Hans Petter Selasky wrote: >=20 > On 2020-02-06 13:45, Pawel Biernacki wrote: >> +#ifdef notyet >> +#define SYSCTL_ENFORCE_FLAGS(x) = \ >> + _Static_assert(((CTLFLAG_MPSAFE ^ CTLFLAG_NEEDGIANT) & (x)), = \ >> + "Has to be either CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT") >> +#else >> +#define SYSCTL_ENFORCE_FLAGS(x) >> +#endif >=20 > Like cem@ pointed out, either you expand the XOR via OR or you can = also do it like this: >=20 > (((x) & CTLFLAG_MPSAFE) !=3D 0) ^ (((x) & CTLFLAG_NEEDGIANT) !=3D 0) >=20 > which avoids having to define another macro. >=20 > --HPS From owner-svn-src-all@freebsd.org Thu Feb 6 18:37:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EE5602339A3; Thu, 6 Feb 2020 18:37:39 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48D6cM3RYDz4QDp; Thu, 6 Feb 2020 18:37:39 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7158D1FF74; Thu, 6 Feb 2020 18:37:39 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 016Ibdrd011994; Thu, 6 Feb 2020 18:37:39 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 016Ibdbe011993; Thu, 6 Feb 2020 18:37:39 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202002061837.016Ibdbe011993@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 6 Feb 2020 18:37:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357633 - in stable: 11/secure/caroot/blacklisted 12/secure/caroot/blacklisted X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/secure/caroot/blacklisted 12/secure/caroot/blacklisted X-SVN-Commit-Revision: 357633 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 18:37:40 -0000 Author: kevans Date: Thu Feb 6 18:37:38 2020 New Revision: 357633 URL: https://svnweb.freebsd.org/changeset/base/357633 Log: MFC r357193: caroot: blacklisted: automatically pick up *.pem in the tree This kind of automagica got picked up in trusted/ prior to the initial commit, but never got applied over in blacklisted. Ideally no one will be using blacklisted/ to store arbitrary certs that they don't intend to blacklist, so we should just install anything that's in here rather than force consumer to first copy cert into place and then modify the file listing in the Makefile. Wise man once say: "it is better to restrict too much, than not enough. sometimes." Modified: stable/12/secure/caroot/blacklisted/Makefile Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/secure/caroot/blacklisted/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/12/secure/caroot/blacklisted/Makefile ============================================================================== --- stable/12/secure/caroot/blacklisted/Makefile Thu Feb 6 18:04:45 2020 (r357632) +++ stable/12/secure/caroot/blacklisted/Makefile Thu Feb 6 18:37:38 2020 (r357633) @@ -2,6 +2,8 @@ BINDIR= /usr/share/certs/blacklisted -FILES= +BLACKLISTED_CERTS!= ls ${.CURDIR}/*.pem 2> /dev/null || true + +FILES+= ${BLACKLISTED_CERTS} .include From owner-svn-src-all@freebsd.org Thu Feb 6 18:37:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3E007233999; Thu, 6 Feb 2020 18:37:39 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48D6cM0xsQz4QDl; Thu, 6 Feb 2020 18:37:39 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1BB991FF73; Thu, 6 Feb 2020 18:37:39 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 016IbcPY011988; Thu, 6 Feb 2020 18:37:38 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 016Ibcti011987; Thu, 6 Feb 2020 18:37:38 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202002061837.016Ibcti011987@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 6 Feb 2020 18:37:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r357633 - in stable: 11/secure/caroot/blacklisted 12/secure/caroot/blacklisted X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/secure/caroot/blacklisted 12/secure/caroot/blacklisted X-SVN-Commit-Revision: 357633 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 18:37:39 -0000 Author: kevans Date: Thu Feb 6 18:37:38 2020 New Revision: 357633 URL: https://svnweb.freebsd.org/changeset/base/357633 Log: MFC r357193: caroot: blacklisted: automatically pick up *.pem in the tree This kind of automagica got picked up in trusted/ prior to the initial commit, but never got applied over in blacklisted. Ideally no one will be using blacklisted/ to store arbitrary certs that they don't intend to blacklist, so we should just install anything that's in here rather than force consumer to first copy cert into place and then modify the file listing in the Makefile. Wise man once say: "it is better to restrict too much, than not enough. sometimes." Modified: stable/11/secure/caroot/blacklisted/Makefile Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/secure/caroot/blacklisted/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/11/secure/caroot/blacklisted/Makefile ============================================================================== --- stable/11/secure/caroot/blacklisted/Makefile Thu Feb 6 18:04:45 2020 (r357632) +++ stable/11/secure/caroot/blacklisted/Makefile Thu Feb 6 18:37:38 2020 (r357633) @@ -2,6 +2,8 @@ BINDIR= /usr/share/certs/blacklisted -FILES= +BLACKLISTED_CERTS!= ls ${.CURDIR}/*.pem 2> /dev/null || true + +FILES+= ${BLACKLISTED_CERTS} .include From owner-svn-src-all@freebsd.org Thu Feb 6 18:40:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 94C14233B86; Thu, 6 Feb 2020 18:40:37 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48D6gn3VfMz4Qfg; Thu, 6 Feb 2020 18:40:37 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 735461FF8B; Thu, 6 Feb 2020 18:40:37 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 016Iebe6012248; Thu, 6 Feb 2020 18:40:37 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 016IebBU012247; Thu, 6 Feb 2020 18:40:37 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202002061840.016IebBU012247@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 6 Feb 2020 18:40:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r357634 - in stable: 11/contrib/netbsd-tests/lib/libc/c063 12/contrib/netbsd-tests/lib/libc/c063 X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/contrib/netbsd-tests/lib/libc/c063 12/contrib/netbsd-tests/lib/libc/c063 X-SVN-Commit-Revision: 357634 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 18:40:37 -0000 Author: kevans Date: Thu Feb 6 18:40:37 2020 New Revision: 357634 URL: https://svnweb.freebsd.org/changeset/base/357634 Log: MFC r357195, r357556: O_SEARCH test fixes r357195: netbsd-tests: libc: use correct modes in O_SEARCH tests The current code clearly intended for these to be octal based on the values used, but the octal prefix was forgotten. Add it now for correctness, but note that we don't currently execute these tests. This has been submitted upstream as misc/54902, so I've omitted the standard FreeBSD markers that we tend to put into netbsd-tests for upstream-candidate identification. r357556: O_SEARCH tests: plug trivial fd leak Coverity correctly reports this as a resource leak. It's an admittedly minor one, but plug it anyways. This has been submitted upstream as misc/54939. Modified: stable/11/contrib/netbsd-tests/lib/libc/c063/t_o_search.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/contrib/netbsd-tests/lib/libc/c063/t_o_search.c Directory Properties: stable/12/ (props changed) Modified: stable/11/contrib/netbsd-tests/lib/libc/c063/t_o_search.c ============================================================================== --- stable/11/contrib/netbsd-tests/lib/libc/c063/t_o_search.c Thu Feb 6 18:37:38 2020 (r357633) +++ stable/11/contrib/netbsd-tests/lib/libc/c063/t_o_search.c Thu Feb 6 18:40:37 2020 (r357634) @@ -79,7 +79,7 @@ ATF_TC_BODY(o_search_perm1, tc) ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1); ATF_REQUIRE(close(fd) == 0); - ATF_REQUIRE(fchmod(dfd, 644) == 0); + ATF_REQUIRE(fchmod(dfd, 0644) == 0); ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) == -1); ATF_REQUIRE(errno == EACCES); @@ -109,12 +109,12 @@ ATF_TC_BODY(o_search_root_flag1, tc) ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1); ATF_REQUIRE(close(fd) == 0); - ATF_REQUIRE(fchmod(dfd, 644) == 0); + ATF_REQUIRE(fchmod(dfd, 0644) == 0); ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1); ATF_REQUIRE(close(fd) == 0); - ATF_REQUIRE(fchmod(dfd, 444) == 0); + ATF_REQUIRE(fchmod(dfd, 0444) == 0); ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1); @@ -141,12 +141,12 @@ ATF_TC_BODY(o_search_unpriv_flag1, tc) ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1); ATF_REQUIRE(close(fd) == 0); - ATF_REQUIRE(fchmod(dfd, 644) == 0); + ATF_REQUIRE(fchmod(dfd, 0644) == 0); ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1); ATF_REQUIRE(close(fd) == 0); - ATF_REQUIRE(fchmod(dfd, 444) == 0); + ATF_REQUIRE(fchmod(dfd, 0444) == 0); ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1); @@ -173,7 +173,7 @@ ATF_TC_BODY(o_search_perm2, tc) ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == 0); - ATF_REQUIRE(fchmod(dfd, 644) == 0); + ATF_REQUIRE(fchmod(dfd, 0644) == 0); ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == -1); ATF_REQUIRE(errno == EACCES); @@ -202,11 +202,11 @@ ATF_TC_BODY(o_search_root_flag2, tc) ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == 0); - ATF_REQUIRE(fchmod(dfd, 644) == 0); + ATF_REQUIRE(fchmod(dfd, 0644) == 0); ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == 0); - ATF_REQUIRE(fchmod(dfd, 444) == 0); + ATF_REQUIRE(fchmod(dfd, 0444) == 0); ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == 0); @@ -232,11 +232,11 @@ ATF_TC_BODY(o_search_unpriv_flag2, tc) ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == 0); - ATF_REQUIRE(fchmod(dfd, 644) == 0); + ATF_REQUIRE(fchmod(dfd, 0644) == 0); ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == 0); - ATF_REQUIRE(fchmod(dfd, 444) == 0); + ATF_REQUIRE(fchmod(dfd, 0444) == 0); ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == 0); @@ -260,6 +260,7 @@ ATF_TC_BODY(o_search_notdir, tc) ATF_REQUIRE((dfd = open(FILE, O_CREAT|O_RDWR|O_SEARCH, 0644)) != -1); ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) == -1); ATF_REQUIRE(errno == ENOTDIR); + ATF_REQUIRE(close(dfd) == 0); } ATF_TP_ADD_TCS(tp) From owner-svn-src-all@freebsd.org Thu Feb 6 18:40:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E5ECD233B8A; Thu, 6 Feb 2020 18:40:37 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48D6gn5sFQz4Qfl; Thu, 6 Feb 2020 18:40:37 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C46261FF8D; Thu, 6 Feb 2020 18:40:37 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 016IebJa012254; Thu, 6 Feb 2020 18:40:37 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 016Iebmd012253; Thu, 6 Feb 2020 18:40:37 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202002061840.016Iebmd012253@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 6 Feb 2020 18:40:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357634 - in stable: 11/contrib/netbsd-tests/lib/libc/c063 12/contrib/netbsd-tests/lib/libc/c063 X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/contrib/netbsd-tests/lib/libc/c063 12/contrib/netbsd-tests/lib/libc/c063 X-SVN-Commit-Revision: 357634 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 18:40:38 -0000 Author: kevans Date: Thu Feb 6 18:40:37 2020 New Revision: 357634 URL: https://svnweb.freebsd.org/changeset/base/357634 Log: MFC r357195, r357556: O_SEARCH test fixes r357195: netbsd-tests: libc: use correct modes in O_SEARCH tests The current code clearly intended for these to be octal based on the values used, but the octal prefix was forgotten. Add it now for correctness, but note that we don't currently execute these tests. This has been submitted upstream as misc/54902, so I've omitted the standard FreeBSD markers that we tend to put into netbsd-tests for upstream-candidate identification. r357556: O_SEARCH tests: plug trivial fd leak Coverity correctly reports this as a resource leak. It's an admittedly minor one, but plug it anyways. This has been submitted upstream as misc/54939. Modified: stable/12/contrib/netbsd-tests/lib/libc/c063/t_o_search.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/contrib/netbsd-tests/lib/libc/c063/t_o_search.c Directory Properties: stable/11/ (props changed) Modified: stable/12/contrib/netbsd-tests/lib/libc/c063/t_o_search.c ============================================================================== --- stable/12/contrib/netbsd-tests/lib/libc/c063/t_o_search.c Thu Feb 6 18:37:38 2020 (r357633) +++ stable/12/contrib/netbsd-tests/lib/libc/c063/t_o_search.c Thu Feb 6 18:40:37 2020 (r357634) @@ -79,7 +79,7 @@ ATF_TC_BODY(o_search_perm1, tc) ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1); ATF_REQUIRE(close(fd) == 0); - ATF_REQUIRE(fchmod(dfd, 644) == 0); + ATF_REQUIRE(fchmod(dfd, 0644) == 0); ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) == -1); ATF_REQUIRE(errno == EACCES); @@ -109,12 +109,12 @@ ATF_TC_BODY(o_search_root_flag1, tc) ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1); ATF_REQUIRE(close(fd) == 0); - ATF_REQUIRE(fchmod(dfd, 644) == 0); + ATF_REQUIRE(fchmod(dfd, 0644) == 0); ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1); ATF_REQUIRE(close(fd) == 0); - ATF_REQUIRE(fchmod(dfd, 444) == 0); + ATF_REQUIRE(fchmod(dfd, 0444) == 0); ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1); @@ -141,12 +141,12 @@ ATF_TC_BODY(o_search_unpriv_flag1, tc) ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1); ATF_REQUIRE(close(fd) == 0); - ATF_REQUIRE(fchmod(dfd, 644) == 0); + ATF_REQUIRE(fchmod(dfd, 0644) == 0); ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1); ATF_REQUIRE(close(fd) == 0); - ATF_REQUIRE(fchmod(dfd, 444) == 0); + ATF_REQUIRE(fchmod(dfd, 0444) == 0); ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1); @@ -173,7 +173,7 @@ ATF_TC_BODY(o_search_perm2, tc) ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == 0); - ATF_REQUIRE(fchmod(dfd, 644) == 0); + ATF_REQUIRE(fchmod(dfd, 0644) == 0); ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == -1); ATF_REQUIRE(errno == EACCES); @@ -202,11 +202,11 @@ ATF_TC_BODY(o_search_root_flag2, tc) ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == 0); - ATF_REQUIRE(fchmod(dfd, 644) == 0); + ATF_REQUIRE(fchmod(dfd, 0644) == 0); ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == 0); - ATF_REQUIRE(fchmod(dfd, 444) == 0); + ATF_REQUIRE(fchmod(dfd, 0444) == 0); ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == 0); @@ -232,11 +232,11 @@ ATF_TC_BODY(o_search_unpriv_flag2, tc) ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == 0); - ATF_REQUIRE(fchmod(dfd, 644) == 0); + ATF_REQUIRE(fchmod(dfd, 0644) == 0); ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == 0); - ATF_REQUIRE(fchmod(dfd, 444) == 0); + ATF_REQUIRE(fchmod(dfd, 0444) == 0); ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == 0); @@ -260,6 +260,7 @@ ATF_TC_BODY(o_search_notdir, tc) ATF_REQUIRE((dfd = open(FILE, O_CREAT|O_RDWR|O_SEARCH, 0644)) != -1); ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) == -1); ATF_REQUIRE(errno == ENOTDIR); + ATF_REQUIRE(close(dfd) == 0); } ATF_TP_ADD_TCS(tp) From owner-svn-src-all@freebsd.org Thu Feb 6 18:48:13 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 570FB233ECA; Thu, 6 Feb 2020 18:48:13 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48D6rY1cn0z4RDC; Thu, 6 Feb 2020 18:48:13 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 32A7E20144; Thu, 6 Feb 2020 18:48:13 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 016ImDx2018176; Thu, 6 Feb 2020 18:48:13 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 016ImD01018175; Thu, 6 Feb 2020 18:48:13 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202002061848.016ImD01018175@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 6 Feb 2020 18:48:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r357635 - vendor/NetBSD/tests/dist/lib/libc/c063 X-SVN-Group: vendor X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: vendor/NetBSD/tests/dist/lib/libc/c063 X-SVN-Commit-Revision: 357635 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 18:48:13 -0000 Author: kevans Date: Thu Feb 6 18:48:12 2020 New Revision: 357635 URL: https://svnweb.freebsd.org/changeset/base/357635 Log: NetBSD-tests: import v1.9 of the O_SEARCH tests This completes the rest of our local changes going upstream. Modified: vendor/NetBSD/tests/dist/lib/libc/c063/t_o_search.c Modified: vendor/NetBSD/tests/dist/lib/libc/c063/t_o_search.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libc/c063/t_o_search.c Thu Feb 6 18:40:37 2020 (r357634) +++ vendor/NetBSD/tests/dist/lib/libc/c063/t_o_search.c Thu Feb 6 18:48:12 2020 (r357635) @@ -1,4 +1,4 @@ -/* $NetBSD: t_o_search.c,v 1.8 2020/02/05 17:13:24 martin Exp $ */ +/* $NetBSD: t_o_search.c,v 1.9 2020/02/06 12:18:06 martin Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -29,13 +29,14 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_o_search.c,v 1.8 2020/02/05 17:13:24 martin Exp $"); +__RCSID("$NetBSD: t_o_search.c,v 1.9 2020/02/06 12:18:06 martin Exp $"); #include -#include +#include #include +#include #include #include #include @@ -50,7 +51,7 @@ __RCSID("$NetBSD: t_o_search.c,v 1.8 2020/02/05 17:13: * until a decision is reached about the semantics of O_SEARCH and a * non-broken implementation is available. */ -#if (O_MASK & O_SEARCH) != 0 +#if defined(__FreeBSD__) || (O_MASK & O_SEARCH) != 0 #define USE_O_SEARCH #endif @@ -263,6 +264,70 @@ ATF_TC_BODY(o_search_notdir, tc) ATF_REQUIRE(close(dfd) == 0); } +#ifdef USE_O_SEARCH +ATF_TC(o_search_nord); +ATF_TC_HEAD(o_search_nord, tc) +{ + atf_tc_set_md_var(tc, "descr", "See that openat succeeds with no read permission"); + atf_tc_set_md_var(tc, "require.user", "unprivileged"); +} +ATF_TC_BODY(o_search_nord, tc) +{ + int dfd, fd; + + ATF_REQUIRE(mkdir(DIR, 0755) == 0); + ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1); + ATF_REQUIRE(close(fd) == 0); + + ATF_REQUIRE(chmod(DIR, 0100) == 0); + ATF_REQUIRE((dfd = open(DIR, O_SEARCH, 0)) != -1); + + ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) != -1); + + ATF_REQUIRE(close(dfd) == 0); +} + +ATF_TC(o_search_getdents); +ATF_TC_HEAD(o_search_getdents, tc) +{ + atf_tc_set_md_var(tc, "descr", "See that O_SEARCH forbids getdents"); +} +ATF_TC_BODY(o_search_getdents, tc) +{ + char buf[1024]; + int dfd; + + ATF_REQUIRE(mkdir(DIR, 0755) == 0); + ATF_REQUIRE((dfd = open(DIR, O_SEARCH, 0)) != -1); + ATF_REQUIRE(getdents(dfd, buf, sizeof(buf)) < 0); + ATF_REQUIRE(close(dfd) == 0); +} + +ATF_TC(o_search_revokex); +ATF_TC_HEAD(o_search_revokex, tc) +{ + atf_tc_set_md_var(tc, "descr", "See that *at behaves after chmod -x"); + atf_tc_set_md_var(tc, "require.user", "unprivileged"); +} +ATF_TC_BODY(o_search_revokex, tc) +{ + int dfd, fd; + struct stat sb; + + ATF_REQUIRE(mkdir(DIR, 0755) == 0); + ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1); + ATF_REQUIRE(close(fd) == 0); + + ATF_REQUIRE((dfd = open(DIR, O_SEARCH, 0)) != -1); + + /* Drop permissions. The kernel must still not check the exec bit. */ + ATF_REQUIRE(chmod(DIR, 0000) == 0); + ATF_REQUIRE(fstatat(dfd, BASEFILE, &sb, 0) == 0); + + ATF_REQUIRE(close(dfd) == 0); +} +#endif /* USE_O_SEARCH */ + ATF_TP_ADD_TCS(tp) { @@ -277,6 +342,11 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, o_search_unpriv_flag2); #endif ATF_TP_ADD_TC(tp, o_search_notdir); +#ifdef USE_O_SEARCH + ATF_TP_ADD_TC(tp, o_search_nord); + ATF_TP_ADD_TC(tp, o_search_getdents); + ATF_TP_ADD_TC(tp, o_search_revokex); +#endif return atf_no_error(); } From owner-svn-src-all@freebsd.org Thu Feb 6 18:51:36 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B5BEE234018; Thu, 6 Feb 2020 18:51:36 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48D6wS4Kb6z4Rby; Thu, 6 Feb 2020 18:51:36 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8FC6F202BF; Thu, 6 Feb 2020 18:51:36 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 016IpaZK022163; Thu, 6 Feb 2020 18:51:36 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 016IpaEt022162; Thu, 6 Feb 2020 18:51:36 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202002061851.016IpaEt022162@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 6 Feb 2020 18:51:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357636 - head/contrib/netbsd-tests/lib/libc/c063 X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/contrib/netbsd-tests/lib/libc/c063 X-SVN-Commit-Revision: 357636 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 18:51:36 -0000 Author: kevans Date: Thu Feb 6 18:51:36 2020 New Revision: 357636 URL: https://svnweb.freebsd.org/changeset/base/357636 Log: MFV r357635: imnport v1.9 of the O_SEARCH tests The RCSID data was wrong, so this is effectively a record-only merge with correction of said data. No further changes should be needed in this area, as we've now upstreamed our local changes to this specific test. Modified: head/contrib/netbsd-tests/lib/libc/c063/t_o_search.c Directory Properties: head/contrib/netbsd-tests/ (props changed) Modified: head/contrib/netbsd-tests/lib/libc/c063/t_o_search.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/c063/t_o_search.c Thu Feb 6 18:48:12 2020 (r357635) +++ head/contrib/netbsd-tests/lib/libc/c063/t_o_search.c Thu Feb 6 18:51:36 2020 (r357636) @@ -1,4 +1,4 @@ -/* $NetBSD: t_o_search.c,v 1.5 2017/01/10 22:25:01 christos Exp $ */ +/* $NetBSD: t_o_search.c,v 1.9 2020/02/06 12:18:06 martin Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_o_search.c,v 1.5 2017/01/10 22:25:01 christos Exp $"); +__RCSID("$NetBSD: t_o_search.c,v 1.9 2020/02/06 12:18:06 martin Exp $"); #include From owner-svn-src-all@freebsd.org Thu Feb 6 20:10:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8FBB323920A; Thu, 6 Feb 2020 20:10:22 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48D8gL33Qhz4cC6; Thu, 6 Feb 2020 20:10:22 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6402C2101A; Thu, 6 Feb 2020 20:10:22 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 016KAMHk072437; Thu, 6 Feb 2020 20:10:22 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 016KAMMX072436; Thu, 6 Feb 2020 20:10:22 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <202002062010.016KAMMX072436@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Thu, 6 Feb 2020 20:10:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357637 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 357637 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 20:10:22 -0000 Author: jeff Date: Thu Feb 6 20:10:21 2020 New Revision: 357637 URL: https://svnweb.freebsd.org/changeset/base/357637 Log: Add some global counters for SMR. These may eventually become per-smr counters. In my stress test there is only one poll for every 15,000 frees. This means we are effectively amortizing the cache coherency overhead even with very high write rates (3M/s/core). Reviewed by: markj, rlibby Differential Revision: https://reviews.freebsd.org/D23463 Modified: head/sys/kern/subr_smr.c Modified: head/sys/kern/subr_smr.c ============================================================================== --- head/sys/kern/subr_smr.c Thu Feb 6 18:51:36 2020 (r357636) +++ head/sys/kern/subr_smr.c Thu Feb 6 20:10:21 2020 (r357637) @@ -30,11 +30,13 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include +#include #include #include #include +#include #include @@ -162,6 +164,17 @@ static uma_zone_t smr_zone; #define SMR_SEQ_MAX_ADVANCE SMR_SEQ_MAX_DELTA / 2 #endif +static SYSCTL_NODE(_debug, OID_AUTO, smr, CTLFLAG_RW, NULL, "SMR Stats"); +static counter_u64_t advance = EARLY_COUNTER; +SYSCTL_COUNTER_U64(_debug_smr, OID_AUTO, advance, CTLFLAG_RD, &advance, ""); +static counter_u64_t advance_wait = EARLY_COUNTER; +SYSCTL_COUNTER_U64(_debug_smr, OID_AUTO, advance_wait, CTLFLAG_RD, &advance_wait, ""); +static counter_u64_t poll = EARLY_COUNTER; +SYSCTL_COUNTER_U64(_debug_smr, OID_AUTO, poll, CTLFLAG_RD, &poll, ""); +static counter_u64_t poll_scan = EARLY_COUNTER; +SYSCTL_COUNTER_U64(_debug_smr, OID_AUTO, poll_scan, CTLFLAG_RD, &poll_scan, ""); + + /* * Advance the write sequence and return the new value for use as the * wait goal. This guarantees that any changes made by the calling @@ -197,14 +210,17 @@ smr_advance(smr_t smr) */ s = zpcpu_get(smr)->c_shared; goal = atomic_fetchadd_int(&s->s_wr_seq, SMR_SEQ_INCR) + SMR_SEQ_INCR; + counter_u64_add(advance, 1); /* * Force a synchronization here if the goal is getting too * far ahead of the read sequence number. This keeps the * wrap detecting arithmetic working in pathological cases. */ - if (goal - atomic_load_int(&s->s_rd_seq) >= SMR_SEQ_MAX_DELTA) + if (goal - atomic_load_int(&s->s_rd_seq) >= SMR_SEQ_MAX_DELTA) { + counter_u64_add(advance_wait, 1); smr_wait(smr, goal - SMR_SEQ_MAX_ADVANCE); + } return (goal); } @@ -263,6 +279,7 @@ smr_poll(smr_t smr, smr_seq_t goal, bool wait) success = true; critical_enter(); s = zpcpu_get(smr)->c_shared; + counter_u64_add_protected(poll, 1); /* * Acquire barrier loads s_wr_seq after s_rd_seq so that we can not @@ -306,6 +323,7 @@ smr_poll(smr_t smr, smr_seq_t goal, bool wait) * gone inactive. Keep track of the oldest sequence currently * active as rd_seq. */ + counter_u64_add_protected(poll_scan, 1); rd_seq = s_wr_seq; CPU_FOREACH(i) { c = zpcpu_get_cpu(smr, i); @@ -366,7 +384,7 @@ smr_poll(smr_t smr, smr_seq_t goal, bool wait) s_rd_seq = atomic_load_int(&s->s_rd_seq); do { if (SMR_SEQ_LEQ(rd_seq, s_rd_seq)) - break; + goto out; } while (atomic_fcmpset_int(&s->s_rd_seq, &s_rd_seq, rd_seq) == 0); out: @@ -426,3 +444,14 @@ smr_init(void) smr_zone = uma_zcreate("SMR CPU", sizeof(struct smr), NULL, NULL, NULL, NULL, (CACHE_LINE_SIZE * 2) - 1, UMA_ZONE_PCPU); } + +static void +smr_init_counters(void *unused) +{ + + advance = counter_u64_alloc(M_WAITOK); + advance_wait = counter_u64_alloc(M_WAITOK); + poll = counter_u64_alloc(M_WAITOK); + poll_scan = counter_u64_alloc(M_WAITOK); +} +SYSINIT(smr_counters, SI_SUB_CPU, SI_ORDER_ANY, smr_init_counters, NULL); From owner-svn-src-all@freebsd.org Thu Feb 6 20:18:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E57CD2397B0; Thu, 6 Feb 2020 20:18:45 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48D8s15rwVz4d21; Thu, 6 Feb 2020 20:18:45 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C3EF52120F; Thu, 6 Feb 2020 20:18:45 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 016KIjcs078284; Thu, 6 Feb 2020 20:18:45 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 016KIjFO078283; Thu, 6 Feb 2020 20:18:45 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202002062018.016KIjFO078283@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Thu, 6 Feb 2020 20:18:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357638 - head/usr.sbin/bsdinstall X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/usr.sbin/bsdinstall X-SVN-Commit-Revision: 357638 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 20:18:46 -0000 Author: 0mp (doc,ports committer) Date: Thu Feb 6 20:18:45 2020 New Revision: 357638 URL: https://svnweb.freebsd.org/changeset/base/357638 Log: Improve documentation of bootconfig and PARTITIONS - Mention bootconfig target in TARGETS section. - Document PARTITIONS variable, which is only mentioned in the examples, but doesn't have its own point. Submitted by: arrowd@ Reviewed by: bcr Approved by: bcr (mentor) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D22927 Modified: head/usr.sbin/bsdinstall/bsdinstall.8 Modified: head/usr.sbin/bsdinstall/bsdinstall.8 ============================================================================== --- head/usr.sbin/bsdinstall/bsdinstall.8 Thu Feb 6 20:10:21 2020 (r357637) +++ head/usr.sbin/bsdinstall/bsdinstall.8 Thu Feb 6 20:18:45 2020 (r357638) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 21, 2019 +.Dd February 6, 2020 .Dt BSDINSTALL 8 .Os .Sh NAME @@ -118,6 +118,8 @@ is set, also configures the network interfaces of the Provides the installer's interactive guided disk partitioner for single-disk installations. Defaults to UFS. +.It Cm bootconfig +Detects an appropriate partition and installs UEFI boot loader files. .It Cm zfsboot Provides a ZFS-only automatic interactive disk partitioner. Creates a single @@ -266,6 +268,15 @@ Default: .It Ev DISTRIBUTIONS The set of distributions to install, e.g., "base.txz kernel.txz ports.txz". Default: unset +.It Ev PARTITIONS +The partitioning of the disk onto which the system is being installed. +See +.Cm scriptedpart +of +the +.Sx TARGETS +section for format details. +Default: unset .It Ev BSDINSTALL_DISTDIR The directory in which the distribution files can be found (or to which they should be downloaded). @@ -443,6 +454,7 @@ PARTITIONS=ada0 DISTRIBUTIONS="kernel.txz base.txz" #!/bin/sh +gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 ada0 sysrc ifconfig_em0=DHCP sysrc sshd_enable=YES pkg install puppet From owner-svn-src-all@freebsd.org Thu Feb 6 20:32:54 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 39148239FAA; Thu, 6 Feb 2020 20:32:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48D99L0N4Rz4f0j; Thu, 6 Feb 2020 20:32:53 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DAB49215FD; Thu, 6 Feb 2020 20:32:53 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 016KWrSD089710; Thu, 6 Feb 2020 20:32:53 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 016KWrhr089709; Thu, 6 Feb 2020 20:32:53 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202002062032.016KWrhr089709@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 6 Feb 2020 20:32:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357639 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Commit-Revision: 357639 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 20:32:54 -0000 Author: mav Date: Thu Feb 6 20:32:53 2020 New Revision: 357639 URL: https://svnweb.freebsd.org/changeset/base/357639 Log: Reduce number of atomic_add() calls in aggsum. Previous code used 4 atomics to do aggsum_flush_bucket() and 2 more to re-borrow after the flush. But since asc_borrowed and asc_delta are accessed only while holding asc_lock, it makes no any sense to modify as_lower_bound and as_upper_bound in multiple steps. Instead of that the new code uses only 2 atomics in all the cases, one per as_*_bound variable. I think even that is overkill, simple atomic store and load could be used here, since all modifications are done under the as_lock, but there are no such primitives in ZFS code now. While there, make borrow code consider previous borrow value, so that on mixed request patterns reduce chance of needing to borrow again if much larger request follows tiny one that needed borrow. Also reduce as_numbuckets from uint64_t to u_int. It makes no sense to use so large division operation on every aggsum_add(). Reviewed by: Brian Behlendorf, Paul Dagnelie MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/aggsum.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/aggsum.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/aggsum.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/aggsum.c Thu Feb 6 20:18:45 2020 (r357638) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/aggsum.c Thu Feb 6 20:32:53 2020 (r357639) @@ -125,13 +125,11 @@ aggsum_flush_bucket(aggsum_t *as, struct aggsum_bucket * We use atomic instructions for this because we read the upper and * lower bounds without the lock, so we need stores to be atomic. */ - atomic_add_64((volatile uint64_t *)&as->as_lower_bound, asb->asc_delta); - atomic_add_64((volatile uint64_t *)&as->as_upper_bound, asb->asc_delta); - asb->asc_delta = 0; - atomic_add_64((volatile uint64_t *)&as->as_upper_bound, - -asb->asc_borrowed); atomic_add_64((volatile uint64_t *)&as->as_lower_bound, - asb->asc_borrowed); + asb->asc_delta + asb->asc_borrowed); + atomic_add_64((volatile uint64_t *)&as->as_upper_bound, + asb->asc_delta - asb->asc_borrowed); + asb->asc_delta = 0; asb->asc_borrowed = 0; } @@ -163,40 +161,43 @@ aggsum_value(aggsum_t *as) return (rv); } -static void -aggsum_borrow(aggsum_t *as, int64_t delta, struct aggsum_bucket *asb) -{ - int64_t abs_delta = (delta < 0 ? -delta : delta); - mutex_enter(&as->as_lock); - mutex_enter(&asb->asc_lock); - - aggsum_flush_bucket(as, asb); - - atomic_add_64((volatile uint64_t *)&as->as_upper_bound, abs_delta); - atomic_add_64((volatile uint64_t *)&as->as_lower_bound, -abs_delta); - asb->asc_borrowed = abs_delta; - - mutex_exit(&asb->asc_lock); - mutex_exit(&as->as_lock); -} - void aggsum_add(aggsum_t *as, int64_t delta) { struct aggsum_bucket *asb = &as->as_buckets[CPU_SEQID % as->as_numbuckets]; + int64_t borrow; - for (;;) { - mutex_enter(&asb->asc_lock); - if (asb->asc_delta + delta <= (int64_t)asb->asc_borrowed && - asb->asc_delta + delta >= -(int64_t)asb->asc_borrowed) { - asb->asc_delta += delta; - mutex_exit(&asb->asc_lock); - return; - } + /* Try fast path if we already borrowed enough before. */ + mutex_enter(&asb->asc_lock); + if (asb->asc_delta + delta <= (int64_t)asb->asc_borrowed && + asb->asc_delta + delta >= -(int64_t)asb->asc_borrowed) { + asb->asc_delta += delta; mutex_exit(&asb->asc_lock); - aggsum_borrow(as, delta * aggsum_borrow_multiplier, asb); + return; } + mutex_exit(&asb->asc_lock); + + /* + * We haven't borrowed enough. Take the global lock and borrow + * considering what is requested now and what we borrowed before. + */ + borrow = (delta < 0 ? -delta : delta) * aggsum_borrow_multiplier; + mutex_enter(&as->as_lock); + mutex_enter(&asb->asc_lock); + delta += asb->asc_delta; + asb->asc_delta = 0; + if (borrow >= asb->asc_borrowed) + borrow -= asb->asc_borrowed; + else + borrow = (borrow - (int64_t)asb->asc_borrowed) / 4; + asb->asc_borrowed += borrow; + atomic_add_64((volatile uint64_t *)&as->as_lower_bound, + delta - borrow); + atomic_add_64((volatile uint64_t *)&as->as_upper_bound, + delta + borrow); + mutex_exit(&asb->asc_lock); + mutex_exit(&as->as_lock); } /* Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/aggsum.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/aggsum.h Thu Feb 6 20:18:45 2020 (r357638) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/aggsum.h Thu Feb 6 20:32:53 2020 (r357639) @@ -39,7 +39,7 @@ typedef struct aggsum { kmutex_t as_lock; int64_t as_lower_bound; int64_t as_upper_bound; - uint64_t as_numbuckets; + uint_t as_numbuckets; aggsum_bucket_t *as_buckets; } aggsum_t; From owner-svn-src-all@freebsd.org Thu Feb 6 20:47:51 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 441D023A7D9; Thu, 6 Feb 2020 20:47:51 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48D9Vb0tv0z4gFx; Thu, 6 Feb 2020 20:47:51 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 15694217F6; Thu, 6 Feb 2020 20:47:51 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 016KloZ3096684; Thu, 6 Feb 2020 20:47:50 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 016Klo4x096683; Thu, 6 Feb 2020 20:47:50 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <202002062047.016Klo4x096683@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Thu, 6 Feb 2020 20:47:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357640 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 357640 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 20:47:51 -0000 Author: jeff Date: Thu Feb 6 20:47:50 2020 New Revision: 357640 URL: https://svnweb.freebsd.org/changeset/base/357640 Log: Temporarily force IFF_NEEDSEPOCH until drivers have been resolved. Recent network epoch changes have left some drivers unexpectedly broken and there is not yet a consensus on the correct fix. This is patch is a minor performance impact until we can agree on the correct path forward. Reviewed by: core, network, imp, glebius, hselasky Differential Revision: https://reviews.freebsd.org/D23515 Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Thu Feb 6 20:32:53 2020 (r357639) +++ head/sys/net/if.c Thu Feb 6 20:47:50 2020 (r357640) @@ -546,6 +546,8 @@ if_alloc_domain(u_char type, int numa_domain) #ifdef VIMAGE ifp->if_vnet = curvnet; #endif + /* XXX */ + ifp->if_flags |= IFF_NEEDSEPOCH; if (if_com_alloc[type] != NULL) { ifp->if_l2com = if_com_alloc[type](type, ifp); if (ifp->if_l2com == NULL) { @@ -4152,7 +4154,8 @@ if_setdrvflags(if_t ifp, int flags) int if_setflags(if_t ifp, int flags) { - ((struct ifnet *)ifp)->if_flags = flags; + /* XXX Temporary */ + ((struct ifnet *)ifp)->if_flags = flags | IFF_NEEDSEPOCH; return (0); } From owner-svn-src-all@freebsd.org Thu Feb 6 20:51:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C6CC523AA35; Thu, 6 Feb 2020 20:51:46 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48D9b64tGXz3C4V; Thu, 6 Feb 2020 20:51:46 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A2B53218A0; Thu, 6 Feb 2020 20:51:46 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 016KpksH000138; Thu, 6 Feb 2020 20:51:46 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 016KpkjY000137; Thu, 6 Feb 2020 20:51:46 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <202002062051.016KpkjY000137@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Thu, 6 Feb 2020 20:51:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357641 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 357641 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 20:51:46 -0000 Author: jeff Date: Thu Feb 6 20:51:46 2020 New Revision: 357641 URL: https://svnweb.freebsd.org/changeset/base/357641 Log: Fix a race in smr_advance() that could result in unnecessary poll calls. This was relatively harmless but surprising to see in counters. The race occurred when rd_seq was read after the goal was updated and we incorrectly calculated the delta between them. Reviewed by: rlibby Differential Revision: https://reviews.freebsd.org/D23464 Modified: head/sys/kern/subr_smr.c Modified: head/sys/kern/subr_smr.c ============================================================================== --- head/sys/kern/subr_smr.c Thu Feb 6 20:47:50 2020 (r357640) +++ head/sys/kern/subr_smr.c Thu Feb 6 20:51:46 2020 (r357641) @@ -160,7 +160,7 @@ static uma_zone_t smr_zone; #define SMR_SEQ_INCR (UINT_MAX / 10000) #define SMR_SEQ_INIT (UINT_MAX - 100000) /* Force extra polls to test the integer overflow detection. */ -#define SMR_SEQ_MAX_DELTA (1000) +#define SMR_SEQ_MAX_DELTA (SMR_SEQ_INCR * 32) #define SMR_SEQ_MAX_ADVANCE SMR_SEQ_MAX_DELTA / 2 #endif @@ -188,7 +188,7 @@ smr_seq_t smr_advance(smr_t smr) { smr_shared_t s; - smr_seq_t goal; + smr_seq_t goal, s_rd_seq; /* * It is illegal to enter while in an smr section. @@ -203,12 +203,18 @@ smr_advance(smr_t smr) atomic_thread_fence_rel(); /* + * Load the current read seq before incrementing the goal so + * we are guaranteed it is always < goal. + */ + s = zpcpu_get(smr)->c_shared; + s_rd_seq = atomic_load_acq_int(&s->s_rd_seq); + + /* * Increment the shared write sequence by 2. Since it is * initialized to 1 this means the only valid values are * odd and an observed value of 0 in a particular CPU means * it is not currently in a read section. */ - s = zpcpu_get(smr)->c_shared; goal = atomic_fetchadd_int(&s->s_wr_seq, SMR_SEQ_INCR) + SMR_SEQ_INCR; counter_u64_add(advance, 1); @@ -217,7 +223,7 @@ smr_advance(smr_t smr) * far ahead of the read sequence number. This keeps the * wrap detecting arithmetic working in pathological cases. */ - if (goal - atomic_load_int(&s->s_rd_seq) >= SMR_SEQ_MAX_DELTA) { + if (SMR_SEQ_DELTA(goal, s_rd_seq) >= SMR_SEQ_MAX_DELTA) { counter_u64_add(advance_wait, 1); smr_wait(smr, goal - SMR_SEQ_MAX_ADVANCE); } From owner-svn-src-all@freebsd.org Thu Feb 6 21:01:21 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0084A23AD2F; Thu, 6 Feb 2020 21:01:21 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48D9p85bBRz3CrN; Thu, 6 Feb 2020 21:01:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB10721A71; Thu, 6 Feb 2020 21:01:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 016L1KP2004702; Thu, 6 Feb 2020 21:01:20 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 016L1Jua004697; Thu, 6 Feb 2020 21:01:19 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202002062101.016L1Jua004697@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 6 Feb 2020 21:01:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357642 - in head/sys/modules: ix ixv lio oce vmm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys/modules: ix ixv lio oce vmm X-SVN-Commit-Revision: 357642 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 21:01:21 -0000 Author: markj Date: Thu Feb 6 21:01:19 2020 New Revision: 357642 URL: https://svnweb.freebsd.org/changeset/base/357642 Log: Remove more manual additions of -DSMP. Since r357598 this should no longer be necessary. Modified: head/sys/modules/ix/Makefile head/sys/modules/ixv/Makefile head/sys/modules/lio/Makefile head/sys/modules/oce/Makefile head/sys/modules/vmm/Makefile Modified: head/sys/modules/ix/Makefile ============================================================================== --- head/sys/modules/ix/Makefile Thu Feb 6 20:51:46 2020 (r357641) +++ head/sys/modules/ix/Makefile Thu Feb 6 21:01:19 2020 (r357642) @@ -10,6 +10,6 @@ SRCS += if_ix.c if_bypass.c if_fdir.c if_sriov.c ix SRCS += ixgbe_common.c ixgbe_api.c ixgbe_phy.c ixgbe_mbx.c ixgbe_vf.c SRCS += ixgbe_dcb.c ixgbe_dcb_82598.c ixgbe_dcb_82599.c SRCS += ixgbe_82598.c ixgbe_82599.c ixgbe_x540.c ixgbe_x550.c -CFLAGS+= -I${SRCTOP}/sys/dev/ixgbe -DSMP +CFLAGS+= -I${SRCTOP}/sys/dev/ixgbe .include Modified: head/sys/modules/ixv/Makefile ============================================================================== --- head/sys/modules/ixv/Makefile Thu Feb 6 20:51:46 2020 (r357641) +++ head/sys/modules/ixv/Makefile Thu Feb 6 21:01:19 2020 (r357642) @@ -10,6 +10,6 @@ SRCS += if_ixv.c if_fdir.c ix_txrx.c ixgbe_osdep.c SRCS += ixgbe_common.c ixgbe_api.c ixgbe_phy.c ixgbe_mbx.c ixgbe_vf.c SRCS += ixgbe_dcb.c ixgbe_dcb_82598.c ixgbe_dcb_82599.c SRCS += ixgbe_82598.c ixgbe_82599.c ixgbe_x540.c ixgbe_x550.c -CFLAGS+= -I${SRCTOP}/sys/dev/ixgbe -DSMP +CFLAGS+= -I${SRCTOP}/sys/dev/ixgbe .include Modified: head/sys/modules/lio/Makefile ============================================================================== --- head/sys/modules/lio/Makefile Thu Feb 6 20:51:46 2020 (r357641) +++ head/sys/modules/lio/Makefile Thu Feb 6 21:01:19 2020 (r357642) @@ -7,7 +7,6 @@ KMOD = if_lio CFLAGS += -I${.CURDIR}/../../dev/liquidio CFLAGS += -I${.CURDIR}/../../dev/liquidio/base -CFLAGS += -DSMP SRCS = device_if.h bus_if.h pci_if.h vnode_if.h opt_inet.h opt_inet6.h SRCS += vnode_if_newproto.h vnode_if_typedef.h Modified: head/sys/modules/oce/Makefile ============================================================================== --- head/sys/modules/oce/Makefile Thu Feb 6 20:51:46 2020 (r357641) +++ head/sys/modules/oce/Makefile Thu Feb 6 21:01:19 2020 (r357642) @@ -7,7 +7,7 @@ KMOD = if_oce SRCS = oce_if.c oce_hw.c oce_mbox.c oce_util.c oce_queue.c oce_sysctl.c SRCS += bus_if.h device_if.h pci_if.h opt_inet.h opt_inet6.h -CFLAGS+= -I${SRCTOP}/sys/dev/oce -DSMP +CFLAGS+= -I${SRCTOP}/sys/dev/oce # uncomment for lock profiling statistics #CFLAGS += -DLOCK_PROFILING Modified: head/sys/modules/vmm/Makefile ============================================================================== --- head/sys/modules/vmm/Makefile Thu Feb 6 20:51:46 2020 (r357641) +++ head/sys/modules/vmm/Makefile Thu Feb 6 21:01:19 2020 (r357642) @@ -6,7 +6,7 @@ SRCS= opt_acpi.h opt_ddb.h device_if.h bus_if.h pci_if DPSRCS+= vmx_assym.h svm_assym.h DPSRCS+= vmx_genassym.c svm_genassym.c offset.inc -CFLAGS+= -DVMM_KEEP_STATS -DSMP +CFLAGS+= -DVMM_KEEP_STATS CFLAGS+= -I${SRCTOP}/sys/amd64/vmm CFLAGS+= -I${SRCTOP}/sys/amd64/vmm/io CFLAGS+= -I${SRCTOP}/sys/amd64/vmm/intel From owner-svn-src-all@freebsd.org Thu Feb 6 21:10:27 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B487523B150; Thu, 6 Feb 2020 21:10:27 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48DB0f6nLhz3DTt; Thu, 6 Feb 2020 21:10:26 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id 016LAJMj072516 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 6 Feb 2020 23:10:22 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 016LAJMj072516 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id 016LAJDo072489; Thu, 6 Feb 2020 23:10:19 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 6 Feb 2020 23:10:19 +0200 From: Konstantin Belousov To: Hans Petter Selasky Cc: Pawel Biernacki , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r357614 - in head/sys: kern sys Message-ID: <20200206211019.GS4808@kib.kiev.ua> References: <202002061245.016CjwTi096374@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 48DB0f6nLhz3DTt X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=gmail.com (policy=none); spf=softfail (mx1.freebsd.org: 2001:470:d5e7:1::1 is neither permitted nor denied by domain of kostikbel@gmail.com) smtp.mailfrom=kostikbel@gmail.com X-Spamd-Result: default: False [-2.00 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; RCPT_COUNT_FIVE(0.00)[5]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; IP_SCORE(0.00)[ip: (-3.17), ipnet: 2001:470::/32(-4.66), asn: 6939(-3.58), country: US(-0.05)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; FREEMAIL_ENVFROM(0.00)[gmail.com]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 21:10:27 -0000 On Thu, Feb 06, 2020 at 05:41:52PM +0100, Hans Petter Selasky wrote: > On 2020-02-06 13:45, Pawel Biernacki wrote: > > +#ifdef notyet > > +#define SYSCTL_ENFORCE_FLAGS(x) \ > > + _Static_assert(((CTLFLAG_MPSAFE ^ CTLFLAG_NEEDGIANT) & (x)), \ > > + "Has to be either CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT") > > +#else > > +#define SYSCTL_ENFORCE_FLAGS(x) > > +#endif > > Like cem@ pointed out, either you expand the XOR via OR or you can also do > it like this: > > (((x) & CTLFLAG_MPSAFE) != 0) ^ (((x) & CTLFLAG_NEEDGIANT) != 0) The intent was to do exactly this, xor the bools. > > which avoids having to define another macro. > > --HPS From owner-svn-src-all@freebsd.org Thu Feb 6 21:46:15 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BB70D23BD49; Thu, 6 Feb 2020 21:46:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48DBnz4X26z3GcX; Thu, 6 Feb 2020 21:46:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 96AE8223E4; Thu, 6 Feb 2020 21:46:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 016LkFGN032760; Thu, 6 Feb 2020 21:46:15 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 016LkFFT032759; Thu, 6 Feb 2020 21:46:15 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202002062146.016LkFFT032759@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 6 Feb 2020 21:46:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357643 - head/lib/libc/riscv/gen X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/lib/libc/riscv/gen X-SVN-Commit-Revision: 357643 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 21:46:15 -0000 Author: jhb Date: Thu Feb 6 21:46:15 2020 New Revision: 357643 URL: https://svnweb.freebsd.org/changeset/base/357643 Log: Tidy the _set_tp function for RISC-V. - Use a constant for the offset instead of a magic number. - Use an addi instruction that writes to tp directly instead of a mv that writes the result of a compiler-generated addi. Reviewed by: mhorne MFC after: 1 week Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D23521 Modified: head/lib/libc/riscv/gen/_set_tp.c Modified: head/lib/libc/riscv/gen/_set_tp.c ============================================================================== --- head/lib/libc/riscv/gen/_set_tp.c Thu Feb 6 21:01:19 2020 (r357642) +++ head/lib/libc/riscv/gen/_set_tp.c Thu Feb 6 21:46:15 2020 (r357643) @@ -38,13 +38,14 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include +/* NB: size of 'struct tcb'. */ +#define TP_OFFSET (sizeof(void *) * 2) + void _set_tp(void *tp) { - __asm __volatile("mv tp, %0" :: "r"((char*)tp + 0x10)); + __asm __volatile("addi tp, %0, %1" :: "r" (tp), "I" (TP_OFFSET)); } From owner-svn-src-all@freebsd.org Thu Feb 6 23:41:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D804C23E079; Thu, 6 Feb 2020 23:41:14 +0000 (UTC) (envelope-from Michael.Tuexen@macmic.franken.de) Received: from drew.franken.de (mail-n.franken.de [193.175.24.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48DFLf5RRrz3Mq4; Thu, 6 Feb 2020 23:41:13 +0000 (UTC) (envelope-from Michael.Tuexen@macmic.franken.de) Received: from [IPv6:2a02:8109:1140:c3d:28c8:d917:f323:1c4d] (unknown [IPv6:2a02:8109:1140:c3d:28c8:d917:f323:1c4d]) (Authenticated sender: macmic) by drew.franken.de (Postfix) with ESMTPSA id F02BF721E280D; Fri, 7 Feb 2020 00:41:09 +0100 (CET) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.60.0.2.5\)) Subject: Re: svn commit: r357641 - head/sys/kern From: Michael Tuexen In-Reply-To: <202002062051.016KpkjY000137@repo.freebsd.org> Date: Fri, 7 Feb 2020 00:41:09 +0100 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <7AE9BE83-5240-4708-81B9-989DCF398940@macmic.franken.de> References: <202002062051.016KpkjY000137@repo.freebsd.org> To: Jeff Roberson X-Mailer: Apple Mail (2.3608.60.0.2.5) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-Rspamd-Queue-Id: 48DFLf5RRrz3Mq4 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.99 / 15.00]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 23:41:14 -0000 > On 6. Feb 2020, at 21:51, Jeff Roberson wrote: >=20 > Author: jeff > Date: Thu Feb 6 20:51:46 2020 > New Revision: 357641 > URL: https://svnweb.freebsd.org/changeset/base/357641 >=20 > Log: > Fix a race in smr_advance() that could result in unnecessary poll = calls. >=20 > This was relatively harmless but surprising to see in counters. The > race occurred when rd_seq was read after the goal was updated and we > incorrectly calculated the delta between them. >=20 > Reviewed by: rlibby > Differential Revision: https://reviews.freebsd.org/D23464 >=20 > Modified: > head/sys/kern/subr_smr.c >=20 > Modified: head/sys/kern/subr_smr.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/kern/subr_smr.c Thu Feb 6 20:47:50 2020 = (r357640) > +++ head/sys/kern/subr_smr.c Thu Feb 6 20:51:46 2020 = (r357641) > @@ -160,7 +160,7 @@ static uma_zone_t smr_zone; > #define SMR_SEQ_INCR (UINT_MAX / 10000) > #define SMR_SEQ_INIT (UINT_MAX - 100000) > /* Force extra polls to test the integer overflow detection. */ > -#define SMR_SEQ_MAX_DELTA (1000) > +#define SMR_SEQ_MAX_DELTA (SMR_SEQ_INCR * 32) > #define SMR_SEQ_MAX_ADVANCE SMR_SEQ_MAX_DELTA / 2 > #endif >=20 > @@ -188,7 +188,7 @@ smr_seq_t > smr_advance(smr_t smr) > { > smr_shared_t s; > - smr_seq_t goal; > + smr_seq_t goal, s_rd_seq; >=20 > /* > * It is illegal to enter while in an smr section. > @@ -203,12 +203,18 @@ smr_advance(smr_t smr) > atomic_thread_fence_rel(); >=20 > /* > + * Load the current read seq before incrementing the goal so > + * we are guaranteed it is always < goal. > + */ > + s =3D zpcpu_get(smr)->c_shared; > + s_rd_seq =3D atomic_load_acq_int(&s->s_rd_seq); > + > + /* > * Increment the shared write sequence by 2. Since it is > * initialized to 1 this means the only valid values are > * odd and an observed value of 0 in a particular CPU means > * it is not currently in a read section. > */ > - s =3D zpcpu_get(smr)->c_shared; > goal =3D atomic_fetchadd_int(&s->s_wr_seq, SMR_SEQ_INCR) + = SMR_SEQ_INCR; > counter_u64_add(advance, 1); >=20 > @@ -217,7 +223,7 @@ smr_advance(smr_t smr) > * far ahead of the read sequence number. This keeps the > * wrap detecting arithmetic working in pathological cases. > */ > - if (goal - atomic_load_int(&s->s_rd_seq) >=3D SMR_SEQ_MAX_DELTA) = { > + if (SMR_SEQ_DELTA(goal, s_rd_seq) >=3D SMR_SEQ_MAX_DELTA) { SMR_SEQ_DELTA is not defined, therefore compilation fails. Best regards Michael > counter_u64_add(advance_wait, 1); > smr_wait(smr, goal - SMR_SEQ_MAX_ADVANCE); > } From owner-svn-src-all@freebsd.org Thu Feb 6 23:45:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C08B923E3EF; Thu, 6 Feb 2020 23:45:56 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48DFS44bxfz3NH9; Thu, 6 Feb 2020 23:45:56 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from freefall.freebsd.org (static-71-168-218-4.cmdnnj.fios.verizon.net [71.168.218.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jkim/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 884052A5EF; Thu, 6 Feb 2020 23:45:56 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Subject: Re: svn commit: r357641 - head/sys/kern To: Michael Tuexen , Jeff Roberson Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202002062051.016KpkjY000137@repo.freebsd.org> <7AE9BE83-5240-4708-81B9-989DCF398940@macmic.franken.de> From: Jung-uk Kim Autocrypt: addr=jkim@FreeBSD.org; prefer-encrypt=mutual; keydata= mQENBFJBztUBCAChqNyGqmFuNo0U7MBzsD+q/G6Cv0l7LGVrOAsgh34M8wIWhD+tztDWMVfn AhxNDd0ceCj2bYOe67sTQxAScEcbt2FfvPOLp9MEXb9qohZj172Gwkk7dnhOhZZKhVGVZKM4 NcsuBDUzgf4f3Vdzj4wg6WlqplnTZo8lPE4hZWvZHoFIyunPTJWenybeV1xnxK7JkUdSvQR0 fA59RfTTECMwTrSEfYGUnxIDBraxJ7Ecs/0hGQ7sljIj8WBvlRDU5fU1xfF35aw56T8POQRq F4E6RVJW3YGuTpSwgtGZOTfygcLRhAiq3dFC3JNLaTVTpM8PjOinJyt9AU6RoITGOKwDABEB AAG0Hkp1bmctdWsgS2ltIDxqa2ltQEZyZWVCU0Qub3JnPokBPQQTAQoAJwUCUkHO1QIbAwUJ E0/POwULCQgHAwUVCgkICwUWAgMBAAIeAQIXgAAKCRB8n5Ym/NvxRqyzB/wL7QtsIpeGfGIA ZPMtgXMucM3NWzomyQMln2j2efUkDKthzh9jBxgF53TjOr7imwIt0PT2k1bqctPrq5IRqnu9 mGroqaCLE3LG2/E3jEaao4k9PO6efwlioyivUo5NrqIQOQ4k3EAXw7d2y0Dk1VpTgdMrnUAB hj7lGlLqS4ydcrf24DdbCRGdEQwqd9DBeBgbWynxAJMgbZBhYVEyIHuQKkJ8qY0ibIPXXuF0 KYDeH0qUHtWV2K3srNyPtymUkBQD84Pl1GWRYx05XdUHDmnX0JV3lg0BfYJZgZv0ehPQrMfY Fd9abTkf9FHQYz1JtsC8wUuRgqElRd6+YAGf8Tt9uQENBFJBztUBCADLtSrP44El2VoJmH14 OFrlOgxzZnbn+Y/Gf1k12mJBiR+A+pBeRLD50p7AiTrjHRxO3cHcl9Dh0uf1VSbXgp8Or0ye iP/86fZPd4k5HXNmDTLL0HecPE08SCqGZ0W8vllQrokB1QxxRUB+fFMPJyMCjDAZ7P9fFTOS dTw1bJSTtOD8Sx8MpZUa9ti06bXFlVYDlaqSdgk181SSx+ZbSKkQR8CIMARlHwiLsa3Z9q9O EJr20HPyxe0AlTvwvFndH61hg7ds63eRvglwRnNON28VXO/lvKXq7Br/CiiyhFdKfINIx2Z5 htYq22tgGTW7mBURbIKoECFBTX9Lv6BXz6w9ABEBAAGJASUEGAEKAA8FAlJBztUCGwwFCRNP zzsACgkQfJ+WJvzb8UZcJQf+IsTCxUEqY7W/pT84sMg5/QD3s6ufTRncvq14fEOxCNq1Rf4Q 9P+tOFa8GZfKDGB2BFGIrW7uT5mlmKdK1vO6ZIA930y5kUsnCmBUEBJkE2ciSQk01aB/1o62 Q3Gk/F6BwtNY9OXiqF7AcAo+K/BMIaqb26QKeh+IIgK1NN9dQiq3ByTbl4zpGZa6MmsnnRTu mzGKt2nkz7vBzH6+hZp1OzGZikgjjhYWVFoJo1dvf/rv4obs0ZJEqFPQs/1Qa1dbkKBv6odB XJpPH0ssOluTY24d1XxTiKTwmWvHeQkOKRAIfD7VTtF4TesoZYkf7hsh3e3VwXhptSLFnEOi WwYofg== Message-ID: <0a518d40-063a-c6d2-e974-0f976600196b@FreeBSD.org> Date: Thu, 6 Feb 2020 18:45:51 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.4.2 MIME-Version: 1.0 In-Reply-To: <7AE9BE83-5240-4708-81B9-989DCF398940@macmic.franken.de> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Rtt1v3CWJSnKhITqQYFNbjPB66tUdp2Uk" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 23:45:56 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Rtt1v3CWJSnKhITqQYFNbjPB66tUdp2Uk Content-Type: multipart/mixed; boundary="6cqrPkMlZL8wLtuUmSQX9VAUd7ctxRTZU" --6cqrPkMlZL8wLtuUmSQX9VAUd7ctxRTZU Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 2/6/20, Michael Tuexen wrote: >=20 >=20 >> On 6. Feb 2020, at 21:51, Jeff Roberson wrote: >> >> Author: jeff >> Date: Thu Feb 6 20:51:46 2020 >> New Revision: 357641 >> URL: https://svnweb.freebsd.org/changeset/base/357641 >> >> Log: >> Fix a race in smr_advance() that could result in unnecessary poll cal= ls. >> >> This was relatively harmless but surprising to see in counters. The >> race occurred when rd_seq was read after the goal was updated and we >> incorrectly calculated the delta between them. >> >> Reviewed by: rlibby >> Differential Revision: https://reviews.freebsd.org/D23464 >> >> Modified: >> head/sys/kern/subr_smr.c >> >> Modified: head/sys/kern/subr_smr.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/sys/kern/subr_smr.c Thu Feb 6 20:47:50 2020 (r357640) >> +++ head/sys/kern/subr_smr.c Thu Feb 6 20:51:46 2020 (r357641) >> @@ -160,7 +160,7 @@ static uma_zone_t smr_zone; >> #define SMR_SEQ_INCR (UINT_MAX / 10000) >> #define SMR_SEQ_INIT (UINT_MAX - 100000) >> /* Force extra polls to test the integer overflow detection. */ >> -#define SMR_SEQ_MAX_DELTA (1000) >> +#define SMR_SEQ_MAX_DELTA (SMR_SEQ_INCR * 32) >> #define SMR_SEQ_MAX_ADVANCE SMR_SEQ_MAX_DELTA / 2 >> #endif >> >> @@ -188,7 +188,7 @@ smr_seq_t >> smr_advance(smr_t smr) >> { >> smr_shared_t s; >> - smr_seq_t goal; >> + smr_seq_t goal, s_rd_seq; >> >> /* >> * It is illegal to enter while in an smr section. >> @@ -203,12 +203,18 @@ smr_advance(smr_t smr) >> atomic_thread_fence_rel(); >> >> /* >> + * Load the current read seq before incrementing the goal so >> + * we are guaranteed it is always < goal. >> + */ >> + s =3D zpcpu_get(smr)->c_shared; >> + s_rd_seq =3D atomic_load_acq_int(&s->s_rd_seq); >> + >> + /* >> * Increment the shared write sequence by 2. Since it is >> * initialized to 1 this means the only valid values are >> * odd and an observed value of 0 in a particular CPU means >> * it is not currently in a read section. >> */ >> - s =3D zpcpu_get(smr)->c_shared; >> goal =3D atomic_fetchadd_int(&s->s_wr_seq, SMR_SEQ_INCR) + SMR_SEQ_IN= CR; >> counter_u64_add(advance, 1); >> >> @@ -217,7 +223,7 @@ smr_advance(smr_t smr) >> * far ahead of the read sequence number. This keeps the >> * wrap detecting arithmetic working in pathological cases. >> */ >> - if (goal - atomic_load_int(&s->s_rd_seq) >=3D SMR_SEQ_MAX_DELTA) { >> + if (SMR_SEQ_DELTA(goal, s_rd_seq) >=3D SMR_SEQ_MAX_DELTA) { > SMR_SEQ_DELTA is not defined, therefore compilation fails. https://reviews.freebsd.org/D23464#516866 https://reviews.freebsd.org/D23464#516881 Jung-uk Kim > Best regards > Michael >> counter_u64_add(advance_wait, 1); >> smr_wait(smr, goal - SMR_SEQ_MAX_ADVANCE); >> } --6cqrPkMlZL8wLtuUmSQX9VAUd7ctxRTZU-- --Rtt1v3CWJSnKhITqQYFNbjPB66tUdp2Uk Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEl1bqgKaRyqfWXu/CfJ+WJvzb8UYFAl48pTQACgkQfJ+WJvzb 8UaazQgAkVny0K6ZT+ZtG5lH+9M/Uky1NRDwqLQv6IJxcTY5IfsJ/M+so21nKJch Bfl4Tt4Cjr7HOI3sa8qbX3JnqkdF/85aENgcUFFj7WjifeWTzKn/I9is9NQBIuML PMQ7txvN2BriLyc0cgOeyhlI4PgiVtcGWXBv0vQuCOik4J6TIYZvei2bqoFVKjN3 MAbYlkvj0jm3QdlsKhKLrlxYbVs/QF04+WyVUcsibiGi/h/nLQ6ILBKDzsyQUzEr LVDG1CX3wJDObxz/4kdgVQZTPkNZk6j58hqqzdyiEbnue2YN6UXXmP2HlZwHUenZ d4F6q1zaKE7xi7qFJI5cAuSiHDfKGg== =Gyf4 -----END PGP SIGNATURE----- --Rtt1v3CWJSnKhITqQYFNbjPB66tUdp2Uk-- From owner-svn-src-all@freebsd.org Fri Feb 7 00:47:58 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DFDED23F3B0; Fri, 7 Feb 2020 00:47:58 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48DGqf5gc9z3QKS; Fri, 7 Feb 2020 00:47:58 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B912924515; Fri, 7 Feb 2020 00:47:58 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0170lwB7039544; Fri, 7 Feb 2020 00:47:58 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0170lw0p039543; Fri, 7 Feb 2020 00:47:58 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <202002070047.0170lw0p039543@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Fri, 7 Feb 2020 00:47:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357644 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 357644 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2020 00:47:58 -0000 Author: rlibby Date: Fri Feb 7 00:47:58 2020 New Revision: 357644 URL: https://svnweb.freebsd.org/changeset/base/357644 Log: smr.h: fix build after r357641 r357641 missed committing the change to sys/sys/smr.h. Reported by: jkim Submitted by: jeff Reviewed by: rlibby Differential Revision: https://reviews.freebsd.org/D23464 Modified: head/sys/sys/smr.h Modified: head/sys/sys/smr.h ============================================================================== --- head/sys/sys/smr.h Thu Feb 6 21:46:15 2020 (r357643) +++ head/sys/sys/smr.h Fri Feb 7 00:47:58 2020 (r357644) @@ -49,6 +49,7 @@ #define SMR_SEQ_LEQ(a, b) ((int32_t)((a)-(b)) <= 0) #define SMR_SEQ_GT(a, b) ((int32_t)((a)-(b)) > 0) #define SMR_SEQ_GEQ(a, b) ((int32_t)((a)-(b)) >= 0) +#define SMR_SEQ_DELTA(a, b) ((int32_t)((a)-(b))) #define SMR_SEQ_INVALID 0 From owner-svn-src-all@freebsd.org Fri Feb 7 08:36:42 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BBC50246AAE; Fri, 7 Feb 2020 08:36:42 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48DTDV48Zkz4HFq; Fri, 7 Feb 2020 08:36:42 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 88BBB1BB1; Fri, 7 Feb 2020 08:36:42 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0178ag7L020806; Fri, 7 Feb 2020 08:36:42 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0178aguW020804; Fri, 7 Feb 2020 08:36:42 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <202002070836.0178aguW020804@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 7 Feb 2020 08:36:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r357645 - in vendor/ncurses/dist: . Ada95 Ada95/doc Ada95/gen Ada95/include Ada95/package Ada95/package/debian Ada95/samples Ada95/src c++ doc doc/html doc/html/ada doc/html/ada/files d... X-SVN-Group: vendor X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: in vendor/ncurses/dist: . Ada95 Ada95/doc Ada95/gen Ada95/include Ada95/package Ada95/package/debian Ada95/samples Ada95/src c++ doc doc/html doc/html/ada doc/html/ada/files doc/html/ada/funcs doc/htm... X-SVN-Commit-Revision: 357645 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2020 08:36:42 -0000 Author: bapt Date: Fri Feb 7 08:36:41 2020 New Revision: 357645 URL: https://svnweb.freebsd.org/changeset/base/357645 Log: Vendor import ncurses 6.1-20200118 Added: vendor/ncurses/dist/Ada95/samples/sample-explanation.adb_p vendor/ncurses/dist/Ada95/src/c_threaded_variables.c (contents, props changed) vendor/ncurses/dist/Ada95/src/c_threaded_variables.h (contents, props changed) vendor/ncurses/dist/Ada95/src/library-cfg.sh (contents, props changed) vendor/ncurses/dist/Ada95/src/library.gpr.in (contents, props changed) vendor/ncurses/dist/VERSION vendor/ncurses/dist/doc/html/ada/terminal_interface-curses_constants__ads.htm vendor/ncurses/dist/doc/html/man/adacurses6-config.1.html (contents, props changed) vendor/ncurses/dist/doc/html/man/ncurses6-config.1.html (contents, props changed) vendor/ncurses/dist/doc/html/man/new_pair.3x.html (contents, props changed) vendor/ncurses/dist/doc/html/man/scr_dump.5.html (contents, props changed) vendor/ncurses/dist/doc/html/man/user_caps.5.html (contents, props changed) vendor/ncurses/dist/include/Caps-ncurses vendor/ncurses/dist/man/new_pair.3x vendor/ncurses/dist/man/scr_dump.5 (contents, props changed) vendor/ncurses/dist/man/user_caps.5 (contents, props changed) vendor/ncurses/dist/misc/magic vendor/ncurses/dist/ncurses/base/new_pair.c (contents, props changed) vendor/ncurses/dist/ncurses/new_pair.h (contents, props changed) vendor/ncurses/dist/ncurses/report_offsets.c (contents, props changed) vendor/ncurses/dist/ncurses/tinfo/MKuserdefs.sh (contents, props changed) vendor/ncurses/dist/package/debian-mingw/mingw32-ncurses6.lintian-overrides vendor/ncurses/dist/package/debian-mingw64/mingw64-ncurses6.lintian-overrides vendor/ncurses/dist/package/debian/ncurses6.lintian-overrides vendor/ncurses/dist/package/debian/ncurses6.triggers vendor/ncurses/dist/package/debian/ncursest6.lintian-overrides vendor/ncurses/dist/package/debian/ncursest6.triggers vendor/ncurses/dist/package/ncurses.map vendor/ncurses/dist/package/ncurses.sym vendor/ncurses/dist/package/ncursest.map vendor/ncurses/dist/package/ncursest.spec vendor/ncurses/dist/package/ncursest.sym vendor/ncurses/dist/package/ncursestw.map vendor/ncurses/dist/package/ncursestw.sym vendor/ncurses/dist/package/ncursesw.map vendor/ncurses/dist/package/ncursesw.sym vendor/ncurses/dist/progs/clear_cmd.c (contents, props changed) vendor/ncurses/dist/progs/clear_cmd.h (contents, props changed) vendor/ncurses/dist/progs/reset_cmd.c (contents, props changed) vendor/ncurses/dist/progs/reset_cmd.h (contents, props changed) vendor/ncurses/dist/progs/tparm_type.c (contents, props changed) vendor/ncurses/dist/progs/tparm_type.h (contents, props changed) vendor/ncurses/dist/progs/tty_settings.c (contents, props changed) vendor/ncurses/dist/progs/tty_settings.h (contents, props changed) vendor/ncurses/dist/test/bulgarian-utf8-tabs.txt (contents, props changed) vendor/ncurses/dist/test/color_content.c (contents, props changed) vendor/ncurses/dist/test/demo_new_pair.c (contents, props changed) vendor/ncurses/dist/test/demo_tabs.c (contents, props changed) vendor/ncurses/dist/test/dots_curses.c (contents, props changed) vendor/ncurses/dist/test/dots_xcurses.c (contents, props changed) vendor/ncurses/dist/test/dump_window.c (contents, props changed) vendor/ncurses/dist/test/dump_window.h (contents, props changed) vendor/ncurses/dist/test/escherknot.xbm vendor/ncurses/dist/test/extended_color.c (contents, props changed) vendor/ncurses/dist/test/list_keys.c (contents, props changed) vendor/ncurses/dist/test/mensetmanus.xbm vendor/ncurses/dist/test/mini.xterm_48x48.xpm (contents, props changed) vendor/ncurses/dist/test/package/debian-mingw/ vendor/ncurses/dist/test/package/debian-mingw/compat vendor/ncurses/dist/test/package/debian-mingw/control vendor/ncurses/dist/test/package/debian-mingw/copyright vendor/ncurses/dist/test/package/debian-mingw/docs vendor/ncurses/dist/test/package/debian-mingw/rules (contents, props changed) vendor/ncurses/dist/test/package/debian-mingw/source/ vendor/ncurses/dist/test/package/debian-mingw/source/format vendor/ncurses/dist/test/package/debian-mingw/watch vendor/ncurses/dist/test/package/debian-mingw64/ vendor/ncurses/dist/test/package/debian-mingw64/compat vendor/ncurses/dist/test/package/debian-mingw64/control vendor/ncurses/dist/test/package/debian-mingw64/copyright vendor/ncurses/dist/test/package/debian-mingw64/docs vendor/ncurses/dist/test/package/debian-mingw64/rules (contents, props changed) vendor/ncurses/dist/test/package/debian-mingw64/source/ vendor/ncurses/dist/test/package/debian-mingw64/source/format vendor/ncurses/dist/test/package/debian-mingw64/watch vendor/ncurses/dist/test/padview.c (contents, props changed) vendor/ncurses/dist/test/pair_content.c (contents, props changed) vendor/ncurses/dist/test/parse_rgb.h (contents, props changed) vendor/ncurses/dist/test/picsmap.c (contents, props changed) vendor/ncurses/dist/test/picsmap.h (contents, props changed) vendor/ncurses/dist/test/popup_msg.c (contents, props changed) vendor/ncurses/dist/test/popup_msg.h (contents, props changed) vendor/ncurses/dist/test/sp_tinfo.c (contents, props changed) vendor/ncurses/dist/test/terminal.xbm vendor/ncurses/dist/test/test_setupterm.c (contents, props changed) vendor/ncurses/dist/test/test_sgr.c (contents, props changed) vendor/ncurses/dist/test/test_termattrs.c (contents, props changed) vendor/ncurses/dist/test/tput-colorcube (contents, props changed) vendor/ncurses/dist/test/tput-initc (contents, props changed) vendor/ncurses/dist/test/widechars-utf8-tabs.txt (contents, props changed) vendor/ncurses/dist/test/xterm-color_48x48.xpm (contents, props changed) Deleted: vendor/ncurses/dist/Ada95/samples/sample-explanation.adb vendor/ncurses/dist/Ada95/src/library.gpr vendor/ncurses/dist/doc/html/man/adacurses-config.1.html vendor/ncurses/dist/doc/html/man/ncurses5-config.1.html Modified: vendor/ncurses/dist/ANNOUNCE vendor/ncurses/dist/AUTHORS vendor/ncurses/dist/Ada95/Makefile.in vendor/ncurses/dist/Ada95/README vendor/ncurses/dist/Ada95/aclocal.m4 vendor/ncurses/dist/Ada95/configure vendor/ncurses/dist/Ada95/configure.in vendor/ncurses/dist/Ada95/doc/Makefile.in vendor/ncurses/dist/Ada95/gen/Makefile.in vendor/ncurses/dist/Ada95/gen/adacurses-config.in vendor/ncurses/dist/Ada95/gen/gen.c vendor/ncurses/dist/Ada95/gen/html.m4 vendor/ncurses/dist/Ada95/gen/terminal_interface-curses-aux.ads.m4 vendor/ncurses/dist/Ada95/gen/terminal_interface-curses-forms-field_types.ads.m4 vendor/ncurses/dist/Ada95/gen/terminal_interface-curses-forms.ads.m4 vendor/ncurses/dist/Ada95/gen/terminal_interface-curses-menus.ads.m4 vendor/ncurses/dist/Ada95/gen/terminal_interface-curses-mouse.ads.m4 vendor/ncurses/dist/Ada95/gen/terminal_interface-curses-panels.ads.m4 vendor/ncurses/dist/Ada95/gen/terminal_interface-curses-trace.ads.m4 vendor/ncurses/dist/Ada95/gen/terminal_interface-curses.adb.m4 vendor/ncurses/dist/Ada95/gen/terminal_interface-curses.ads.m4 vendor/ncurses/dist/Ada95/include/MKncurses_def.sh vendor/ncurses/dist/Ada95/include/Makefile.in vendor/ncurses/dist/Ada95/include/ncurses_cfg.hin vendor/ncurses/dist/Ada95/make-tar.sh vendor/ncurses/dist/Ada95/package/AdaCurses-doc.spec vendor/ncurses/dist/Ada95/package/AdaCurses.spec vendor/ncurses/dist/Ada95/package/debian/compat vendor/ncurses/dist/Ada95/package/debian/control vendor/ncurses/dist/Ada95/package/debian/copyright vendor/ncurses/dist/Ada95/package/debian/rules vendor/ncurses/dist/Ada95/package/debian/watch vendor/ncurses/dist/Ada95/samples/Makefile.in vendor/ncurses/dist/Ada95/samples/ncurses2-acs_and_scroll.adb vendor/ncurses/dist/Ada95/samples/ncurses2-demo_forms.adb vendor/ncurses/dist/Ada95/samples/ncurses2-demo_pad.adb vendor/ncurses/dist/Ada95/samples/ncurses2-demo_panels.adb vendor/ncurses/dist/Ada95/samples/ncurses2-getch_test.adb vendor/ncurses/dist/Ada95/samples/ncurses2-m.adb vendor/ncurses/dist/Ada95/samples/ncurses2-overlap_test.adb vendor/ncurses/dist/Ada95/samples/ncurses2-slk_test.adb vendor/ncurses/dist/Ada95/samples/ncurses2-trace_set.adb vendor/ncurses/dist/Ada95/samples/ncurses2-util.adb vendor/ncurses/dist/Ada95/samples/rain.ads vendor/ncurses/dist/Ada95/samples/sample-curses_demo-attributes.adb vendor/ncurses/dist/Ada95/samples/sample-curses_demo-attributes.ads vendor/ncurses/dist/Ada95/samples/sample-curses_demo-mouse.ads vendor/ncurses/dist/Ada95/samples/sample-curses_demo.ads vendor/ncurses/dist/Ada95/samples/sample-form_demo.ads vendor/ncurses/dist/Ada95/samples/sample-header_handler.adb vendor/ncurses/dist/Ada95/samples/sample-header_handler.ads vendor/ncurses/dist/Ada95/samples/sample-keyboard_handler.ads vendor/ncurses/dist/Ada95/samples/sample-manifest.ads vendor/ncurses/dist/Ada95/samples/sample-menu_demo.ads vendor/ncurses/dist/Ada95/samples/sample-text_io_demo.adb vendor/ncurses/dist/Ada95/samples/sample-text_io_demo.ads vendor/ncurses/dist/Ada95/samples/sample.ads vendor/ncurses/dist/Ada95/samples/status.adb vendor/ncurses/dist/Ada95/samples/status.ads vendor/ncurses/dist/Ada95/samples/tour.adb vendor/ncurses/dist/Ada95/samples/tour.ads vendor/ncurses/dist/Ada95/src/Makefile.in vendor/ncurses/dist/Ada95/src/c_varargs_to_ada.c vendor/ncurses/dist/Ada95/src/c_varargs_to_ada.h vendor/ncurses/dist/Ada95/src/ncurses_compat.c vendor/ncurses/dist/Ada95/src/terminal_interface-curses-forms-field_types-alpha.adb vendor/ncurses/dist/Ada95/src/terminal_interface-curses-forms-field_types-alphanumeric.adb vendor/ncurses/dist/Ada95/src/terminal_interface-curses-forms-field_types-enumeration-ada.ads vendor/ncurses/dist/Ada95/src/terminal_interface-curses-forms-field_types-enumeration.adb vendor/ncurses/dist/Ada95/src/terminal_interface-curses-forms-field_types-enumeration.ads vendor/ncurses/dist/Ada95/src/terminal_interface-curses-forms-field_types-intfield.adb vendor/ncurses/dist/Ada95/src/terminal_interface-curses-forms-field_types-ipv4_address.adb vendor/ncurses/dist/Ada95/src/terminal_interface-curses-forms-field_types-numeric.adb vendor/ncurses/dist/Ada95/src/terminal_interface-curses-forms-field_types-regexp.adb vendor/ncurses/dist/Ada95/src/terminal_interface-curses-forms-field_types-user-choice.adb vendor/ncurses/dist/Ada95/src/terminal_interface-curses-forms-field_types-user.adb vendor/ncurses/dist/Ada95/src/terminal_interface-curses-forms-field_types.adb vendor/ncurses/dist/Ada95/src/terminal_interface-curses-forms-field_user_data.adb vendor/ncurses/dist/Ada95/src/terminal_interface-curses-forms-form_user_data.adb vendor/ncurses/dist/Ada95/src/terminal_interface-curses-forms.adb vendor/ncurses/dist/Ada95/src/terminal_interface-curses-menus-item_user_data.adb vendor/ncurses/dist/Ada95/src/terminal_interface-curses-menus-menu_user_data.adb vendor/ncurses/dist/Ada95/src/terminal_interface-curses-menus.adb vendor/ncurses/dist/Ada95/src/terminal_interface-curses-mouse.adb vendor/ncurses/dist/Ada95/src/terminal_interface-curses-putwin.adb vendor/ncurses/dist/Ada95/src/terminal_interface-curses-putwin.ads vendor/ncurses/dist/Ada95/src/terminal_interface-curses-termcap.ads vendor/ncurses/dist/Ada95/src/terminal_interface-curses-terminfo.ads vendor/ncurses/dist/Ada95/src/terminal_interface-curses-text_io.adb vendor/ncurses/dist/Ada95/src/terminal_interface-curses-trace.adb_p vendor/ncurses/dist/COPYING vendor/ncurses/dist/INSTALL vendor/ncurses/dist/MANIFEST vendor/ncurses/dist/Makefile.in vendor/ncurses/dist/NEWS vendor/ncurses/dist/README vendor/ncurses/dist/README.emx vendor/ncurses/dist/aclocal.m4 vendor/ncurses/dist/announce.html.in vendor/ncurses/dist/c++/Makefile.in vendor/ncurses/dist/c++/cursesapp.cc vendor/ncurses/dist/c++/cursesapp.h vendor/ncurses/dist/c++/cursesf.cc vendor/ncurses/dist/c++/cursesf.h vendor/ncurses/dist/c++/cursesm.cc vendor/ncurses/dist/c++/cursesm.h vendor/ncurses/dist/c++/cursesmain.cc vendor/ncurses/dist/c++/cursesp.cc vendor/ncurses/dist/c++/cursesp.h vendor/ncurses/dist/c++/cursesw.cc vendor/ncurses/dist/c++/cursesw.h vendor/ncurses/dist/c++/cursslk.cc vendor/ncurses/dist/c++/cursslk.h vendor/ncurses/dist/c++/demo.cc vendor/ncurses/dist/c++/etip.h.in vendor/ncurses/dist/c++/internal.h vendor/ncurses/dist/config.guess vendor/ncurses/dist/config.sub vendor/ncurses/dist/configure vendor/ncurses/dist/configure.in vendor/ncurses/dist/dist.mk vendor/ncurses/dist/doc/hackguide.doc vendor/ncurses/dist/doc/html/Ada95.html vendor/ncurses/dist/doc/html/NCURSES-Programming-HOWTO.html vendor/ncurses/dist/doc/html/ada/files/T.htm vendor/ncurses/dist/doc/html/ada/funcs/A.htm vendor/ncurses/dist/doc/html/ada/funcs/B.htm vendor/ncurses/dist/doc/html/ada/funcs/C.htm vendor/ncurses/dist/doc/html/ada/funcs/D.htm vendor/ncurses/dist/doc/html/ada/funcs/E.htm vendor/ncurses/dist/doc/html/ada/funcs/F.htm vendor/ncurses/dist/doc/html/ada/funcs/G.htm vendor/ncurses/dist/doc/html/ada/funcs/H.htm vendor/ncurses/dist/doc/html/ada/funcs/I.htm vendor/ncurses/dist/doc/html/ada/funcs/K.htm vendor/ncurses/dist/doc/html/ada/funcs/L.htm vendor/ncurses/dist/doc/html/ada/funcs/M.htm vendor/ncurses/dist/doc/html/ada/funcs/N.htm vendor/ncurses/dist/doc/html/ada/funcs/O.htm vendor/ncurses/dist/doc/html/ada/funcs/P.htm vendor/ncurses/dist/doc/html/ada/funcs/R.htm vendor/ncurses/dist/doc/html/ada/funcs/S.htm vendor/ncurses/dist/doc/html/ada/funcs/T.htm vendor/ncurses/dist/doc/html/ada/funcs/U.htm vendor/ncurses/dist/doc/html/ada/funcs/V.htm vendor/ncurses/dist/doc/html/ada/funcs/W.htm vendor/ncurses/dist/doc/html/ada/main.htm vendor/ncurses/dist/doc/html/ada/table.html vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-aux__adb.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-aux__ads.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-forms-field_types-alpha__adb.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-forms-field_types-alpha__ads.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-forms-field_types-alphanumeric__adb.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-forms-field_types-alphanumeric__ads.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration-ada__adb.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration-ada__ads.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration__adb.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration__ads.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-forms-field_types-intfield__adb.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-forms-field_types-intfield__ads.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-forms-field_types-ipv4_address__adb.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-forms-field_types-ipv4_address__ads.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-forms-field_types-numeric__adb.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-forms-field_types-numeric__ads.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-forms-field_types-regexp__adb.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-forms-field_types-regexp__ads.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-forms-field_types-user-choice__adb.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-forms-field_types-user-choice__ads.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-forms-field_types-user__adb.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-forms-field_types-user__ads.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-forms-field_types__adb.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-forms-field_types__ads.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-forms-field_user_data__adb.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-forms-field_user_data__ads.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-forms-form_user_data__adb.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-forms-form_user_data__ads.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-forms__adb.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-forms__ads.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-menus-item_user_data__adb.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-menus-item_user_data__ads.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-menus-menu_user_data__adb.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-menus-menu_user_data__ads.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-menus__adb.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-menus__ads.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-mouse__adb.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-mouse__ads.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-panels-user_data__adb.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-panels-user_data__ads.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-panels__adb.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-panels__ads.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-putwin__adb.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-putwin__ads.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-termcap__adb.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-termcap__ads.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-terminfo__adb.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-terminfo__ads.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-text_io-aux__adb.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-text_io-aux__ads.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-text_io-complex_io__adb.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-text_io-complex_io__ads.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-text_io-decimal_io__adb.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-text_io-decimal_io__ads.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-text_io-enumeration_io__adb.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-text_io-enumeration_io__ads.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-text_io-fixed_io__adb.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-text_io-fixed_io__ads.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-text_io-float_io__adb.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-text_io-float_io__ads.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-text_io-integer_io__adb.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-text_io-integer_io__ads.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-text_io-modular_io__adb.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-text_io-modular_io__ads.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-text_io__adb.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-text_io__ads.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-trace__adb.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses-trace__ads.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses__adb.htm vendor/ncurses/dist/doc/html/ada/terminal_interface-curses__ads.htm vendor/ncurses/dist/doc/html/announce.html vendor/ncurses/dist/doc/html/hackguide.html vendor/ncurses/dist/doc/html/index.html vendor/ncurses/dist/doc/html/man/captoinfo.1m.html vendor/ncurses/dist/doc/html/man/clear.1.html vendor/ncurses/dist/doc/html/man/curs_add_wch.3x.html vendor/ncurses/dist/doc/html/man/curs_add_wchstr.3x.html vendor/ncurses/dist/doc/html/man/curs_addch.3x.html vendor/ncurses/dist/doc/html/man/curs_addchstr.3x.html vendor/ncurses/dist/doc/html/man/curs_addstr.3x.html vendor/ncurses/dist/doc/html/man/curs_addwstr.3x.html vendor/ncurses/dist/doc/html/man/curs_attr.3x.html vendor/ncurses/dist/doc/html/man/curs_beep.3x.html vendor/ncurses/dist/doc/html/man/curs_bkgd.3x.html vendor/ncurses/dist/doc/html/man/curs_bkgrnd.3x.html vendor/ncurses/dist/doc/html/man/curs_border.3x.html vendor/ncurses/dist/doc/html/man/curs_border_set.3x.html vendor/ncurses/dist/doc/html/man/curs_clear.3x.html vendor/ncurses/dist/doc/html/man/curs_color.3x.html vendor/ncurses/dist/doc/html/man/curs_delch.3x.html vendor/ncurses/dist/doc/html/man/curs_deleteln.3x.html vendor/ncurses/dist/doc/html/man/curs_extend.3x.html vendor/ncurses/dist/doc/html/man/curs_get_wch.3x.html vendor/ncurses/dist/doc/html/man/curs_get_wstr.3x.html vendor/ncurses/dist/doc/html/man/curs_getcchar.3x.html vendor/ncurses/dist/doc/html/man/curs_getch.3x.html vendor/ncurses/dist/doc/html/man/curs_getstr.3x.html vendor/ncurses/dist/doc/html/man/curs_getyx.3x.html vendor/ncurses/dist/doc/html/man/curs_in_wch.3x.html vendor/ncurses/dist/doc/html/man/curs_in_wchstr.3x.html vendor/ncurses/dist/doc/html/man/curs_inch.3x.html vendor/ncurses/dist/doc/html/man/curs_inchstr.3x.html vendor/ncurses/dist/doc/html/man/curs_initscr.3x.html vendor/ncurses/dist/doc/html/man/curs_inopts.3x.html vendor/ncurses/dist/doc/html/man/curs_ins_wch.3x.html vendor/ncurses/dist/doc/html/man/curs_ins_wstr.3x.html vendor/ncurses/dist/doc/html/man/curs_insch.3x.html vendor/ncurses/dist/doc/html/man/curs_insstr.3x.html vendor/ncurses/dist/doc/html/man/curs_instr.3x.html vendor/ncurses/dist/doc/html/man/curs_inwstr.3x.html vendor/ncurses/dist/doc/html/man/curs_kernel.3x.html vendor/ncurses/dist/doc/html/man/curs_legacy.3x.html vendor/ncurses/dist/doc/html/man/curs_memleaks.3x.html vendor/ncurses/dist/doc/html/man/curs_mouse.3x.html vendor/ncurses/dist/doc/html/man/curs_move.3x.html vendor/ncurses/dist/doc/html/man/curs_opaque.3x.html vendor/ncurses/dist/doc/html/man/curs_outopts.3x.html vendor/ncurses/dist/doc/html/man/curs_overlay.3x.html vendor/ncurses/dist/doc/html/man/curs_pad.3x.html vendor/ncurses/dist/doc/html/man/curs_print.3x.html vendor/ncurses/dist/doc/html/man/curs_printw.3x.html vendor/ncurses/dist/doc/html/man/curs_refresh.3x.html vendor/ncurses/dist/doc/html/man/curs_scanw.3x.html vendor/ncurses/dist/doc/html/man/curs_scr_dump.3x.html vendor/ncurses/dist/doc/html/man/curs_scroll.3x.html vendor/ncurses/dist/doc/html/man/curs_slk.3x.html vendor/ncurses/dist/doc/html/man/curs_sp_funcs.3x.html vendor/ncurses/dist/doc/html/man/curs_termattrs.3x.html vendor/ncurses/dist/doc/html/man/curs_termcap.3x.html vendor/ncurses/dist/doc/html/man/curs_terminfo.3x.html vendor/ncurses/dist/doc/html/man/curs_threads.3x.html vendor/ncurses/dist/doc/html/man/curs_touch.3x.html vendor/ncurses/dist/doc/html/man/curs_trace.3x.html vendor/ncurses/dist/doc/html/man/curs_util.3x.html vendor/ncurses/dist/doc/html/man/curs_variables.3x.html vendor/ncurses/dist/doc/html/man/curs_window.3x.html vendor/ncurses/dist/doc/html/man/default_colors.3x.html vendor/ncurses/dist/doc/html/man/define_key.3x.html vendor/ncurses/dist/doc/html/man/form.3x.html vendor/ncurses/dist/doc/html/man/form_cursor.3x.html vendor/ncurses/dist/doc/html/man/form_data.3x.html vendor/ncurses/dist/doc/html/man/form_driver.3x.html vendor/ncurses/dist/doc/html/man/form_field.3x.html vendor/ncurses/dist/doc/html/man/form_field_attributes.3x.html vendor/ncurses/dist/doc/html/man/form_field_buffer.3x.html vendor/ncurses/dist/doc/html/man/form_field_info.3x.html vendor/ncurses/dist/doc/html/man/form_field_just.3x.html vendor/ncurses/dist/doc/html/man/form_field_new.3x.html vendor/ncurses/dist/doc/html/man/form_field_opts.3x.html vendor/ncurses/dist/doc/html/man/form_field_userptr.3x.html vendor/ncurses/dist/doc/html/man/form_field_validation.3x.html vendor/ncurses/dist/doc/html/man/form_fieldtype.3x.html vendor/ncurses/dist/doc/html/man/form_hook.3x.html vendor/ncurses/dist/doc/html/man/form_new.3x.html vendor/ncurses/dist/doc/html/man/form_new_page.3x.html vendor/ncurses/dist/doc/html/man/form_opts.3x.html vendor/ncurses/dist/doc/html/man/form_page.3x.html vendor/ncurses/dist/doc/html/man/form_post.3x.html vendor/ncurses/dist/doc/html/man/form_requestname.3x.html vendor/ncurses/dist/doc/html/man/form_userptr.3x.html vendor/ncurses/dist/doc/html/man/form_variables.3x.html vendor/ncurses/dist/doc/html/man/form_win.3x.html vendor/ncurses/dist/doc/html/man/index.html vendor/ncurses/dist/doc/html/man/infocmp.1m.html vendor/ncurses/dist/doc/html/man/infotocap.1m.html vendor/ncurses/dist/doc/html/man/key_defined.3x.html vendor/ncurses/dist/doc/html/man/keybound.3x.html vendor/ncurses/dist/doc/html/man/keyok.3x.html vendor/ncurses/dist/doc/html/man/legacy_coding.3x.html vendor/ncurses/dist/doc/html/man/menu.3x.html vendor/ncurses/dist/doc/html/man/menu_attributes.3x.html vendor/ncurses/dist/doc/html/man/menu_cursor.3x.html vendor/ncurses/dist/doc/html/man/menu_driver.3x.html vendor/ncurses/dist/doc/html/man/menu_format.3x.html vendor/ncurses/dist/doc/html/man/menu_hook.3x.html vendor/ncurses/dist/doc/html/man/menu_items.3x.html vendor/ncurses/dist/doc/html/man/menu_mark.3x.html vendor/ncurses/dist/doc/html/man/menu_new.3x.html vendor/ncurses/dist/doc/html/man/menu_opts.3x.html vendor/ncurses/dist/doc/html/man/menu_pattern.3x.html vendor/ncurses/dist/doc/html/man/menu_post.3x.html vendor/ncurses/dist/doc/html/man/menu_requestname.3x.html vendor/ncurses/dist/doc/html/man/menu_spacing.3x.html vendor/ncurses/dist/doc/html/man/menu_userptr.3x.html vendor/ncurses/dist/doc/html/man/menu_win.3x.html vendor/ncurses/dist/doc/html/man/mitem_current.3x.html vendor/ncurses/dist/doc/html/man/mitem_name.3x.html vendor/ncurses/dist/doc/html/man/mitem_new.3x.html vendor/ncurses/dist/doc/html/man/mitem_opts.3x.html vendor/ncurses/dist/doc/html/man/mitem_userptr.3x.html vendor/ncurses/dist/doc/html/man/mitem_value.3x.html vendor/ncurses/dist/doc/html/man/mitem_visible.3x.html vendor/ncurses/dist/doc/html/man/ncurses.3x.html vendor/ncurses/dist/doc/html/man/panel.3x.html vendor/ncurses/dist/doc/html/man/resizeterm.3x.html vendor/ncurses/dist/doc/html/man/tabs.1.html vendor/ncurses/dist/doc/html/man/term.5.html vendor/ncurses/dist/doc/html/man/term.7.html vendor/ncurses/dist/doc/html/man/term_variables.3x.html vendor/ncurses/dist/doc/html/man/terminfo.5.html vendor/ncurses/dist/doc/html/man/tic.1m.html vendor/ncurses/dist/doc/html/man/toe.1m.html vendor/ncurses/dist/doc/html/man/tput.1.html vendor/ncurses/dist/doc/html/man/tset.1.html vendor/ncurses/dist/doc/html/man/wresize.3x.html vendor/ncurses/dist/doc/html/ncurses-intro.html vendor/ncurses/dist/doc/ncurses-intro.doc vendor/ncurses/dist/form/Makefile.in vendor/ncurses/dist/form/f_trace.c vendor/ncurses/dist/form/fld_arg.c vendor/ncurses/dist/form/fld_attr.c vendor/ncurses/dist/form/fld_current.c vendor/ncurses/dist/form/fld_def.c vendor/ncurses/dist/form/fld_ftchoice.c vendor/ncurses/dist/form/fld_max.c vendor/ncurses/dist/form/fld_newftyp.c vendor/ncurses/dist/form/form.h vendor/ncurses/dist/form/form.priv.h vendor/ncurses/dist/form/frm_driver.c vendor/ncurses/dist/form/frm_hook.c vendor/ncurses/dist/form/frm_post.c vendor/ncurses/dist/form/frm_req_name.c vendor/ncurses/dist/form/fty_generic.c vendor/ncurses/dist/form/fty_num.c vendor/ncurses/dist/form/fty_regex.c vendor/ncurses/dist/form/llib-lform vendor/ncurses/dist/form/llib-lformt vendor/ncurses/dist/form/llib-lformtw vendor/ncurses/dist/form/llib-lformw vendor/ncurses/dist/include/Caps vendor/ncurses/dist/include/Caps.aix4 vendor/ncurses/dist/include/Caps.hpux11 vendor/ncurses/dist/include/Caps.keys vendor/ncurses/dist/include/Caps.osf1r5 vendor/ncurses/dist/include/Caps.uwin vendor/ncurses/dist/include/MKhashsize.sh vendor/ncurses/dist/include/MKkey_defs.sh vendor/ncurses/dist/include/MKncurses_def.sh vendor/ncurses/dist/include/MKparametrized.sh vendor/ncurses/dist/include/MKterm.h.awk.in vendor/ncurses/dist/include/Makefile.in vendor/ncurses/dist/include/curses.h.in vendor/ncurses/dist/include/curses.tail vendor/ncurses/dist/include/curses.wide vendor/ncurses/dist/include/edit_cfg.sh vendor/ncurses/dist/include/hashed_db.h vendor/ncurses/dist/include/nc_alloc.h vendor/ncurses/dist/include/nc_mingw.h vendor/ncurses/dist/include/nc_panel.h vendor/ncurses/dist/include/nc_string.h vendor/ncurses/dist/include/nc_termios.h vendor/ncurses/dist/include/nc_tparm.h vendor/ncurses/dist/include/ncurses_cfg.hin vendor/ncurses/dist/include/ncurses_defs vendor/ncurses/dist/include/ncurses_dll.h.in vendor/ncurses/dist/include/ncurses_mingw.h vendor/ncurses/dist/include/term_entry.h vendor/ncurses/dist/include/termcap.h.in vendor/ncurses/dist/include/tic.h vendor/ncurses/dist/man/MKada_config.in vendor/ncurses/dist/man/MKterminfo.sh vendor/ncurses/dist/man/Makefile.in vendor/ncurses/dist/man/captoinfo.1m vendor/ncurses/dist/man/clear.1 vendor/ncurses/dist/man/curs_add_wch.3x vendor/ncurses/dist/man/curs_add_wchstr.3x vendor/ncurses/dist/man/curs_addch.3x vendor/ncurses/dist/man/curs_addchstr.3x vendor/ncurses/dist/man/curs_addstr.3x vendor/ncurses/dist/man/curs_addwstr.3x vendor/ncurses/dist/man/curs_attr.3x vendor/ncurses/dist/man/curs_beep.3x vendor/ncurses/dist/man/curs_bkgd.3x vendor/ncurses/dist/man/curs_bkgrnd.3x vendor/ncurses/dist/man/curs_border.3x vendor/ncurses/dist/man/curs_border_set.3x vendor/ncurses/dist/man/curs_clear.3x vendor/ncurses/dist/man/curs_color.3x vendor/ncurses/dist/man/curs_delch.3x vendor/ncurses/dist/man/curs_deleteln.3x vendor/ncurses/dist/man/curs_extend.3x vendor/ncurses/dist/man/curs_get_wch.3x vendor/ncurses/dist/man/curs_get_wstr.3x vendor/ncurses/dist/man/curs_getcchar.3x vendor/ncurses/dist/man/curs_getch.3x vendor/ncurses/dist/man/curs_getstr.3x vendor/ncurses/dist/man/curs_in_wch.3x vendor/ncurses/dist/man/curs_in_wchstr.3x vendor/ncurses/dist/man/curs_inch.3x vendor/ncurses/dist/man/curs_inchstr.3x vendor/ncurses/dist/man/curs_initscr.3x vendor/ncurses/dist/man/curs_inopts.3x vendor/ncurses/dist/man/curs_ins_wch.3x vendor/ncurses/dist/man/curs_ins_wstr.3x vendor/ncurses/dist/man/curs_insch.3x vendor/ncurses/dist/man/curs_insstr.3x vendor/ncurses/dist/man/curs_instr.3x vendor/ncurses/dist/man/curs_inwstr.3x vendor/ncurses/dist/man/curs_kernel.3x vendor/ncurses/dist/man/curs_legacy.3x vendor/ncurses/dist/man/curs_memleaks.3x vendor/ncurses/dist/man/curs_mouse.3x vendor/ncurses/dist/man/curs_move.3x vendor/ncurses/dist/man/curs_opaque.3x vendor/ncurses/dist/man/curs_outopts.3x vendor/ncurses/dist/man/curs_overlay.3x vendor/ncurses/dist/man/curs_pad.3x vendor/ncurses/dist/man/curs_print.3x vendor/ncurses/dist/man/curs_printw.3x vendor/ncurses/dist/man/curs_refresh.3x vendor/ncurses/dist/man/curs_scanw.3x vendor/ncurses/dist/man/curs_scr_dump.3x vendor/ncurses/dist/man/curs_scroll.3x vendor/ncurses/dist/man/curs_slk.3x vendor/ncurses/dist/man/curs_sp_funcs.3x vendor/ncurses/dist/man/curs_termattrs.3x vendor/ncurses/dist/man/curs_termcap.3x vendor/ncurses/dist/man/curs_terminfo.3x vendor/ncurses/dist/man/curs_threads.3x vendor/ncurses/dist/man/curs_touch.3x vendor/ncurses/dist/man/curs_trace.3x vendor/ncurses/dist/man/curs_util.3x vendor/ncurses/dist/man/curs_variables.3x vendor/ncurses/dist/man/curs_window.3x vendor/ncurses/dist/man/default_colors.3x vendor/ncurses/dist/man/define_key.3x vendor/ncurses/dist/man/form.3x vendor/ncurses/dist/man/form_cursor.3x vendor/ncurses/dist/man/form_data.3x vendor/ncurses/dist/man/form_driver.3x vendor/ncurses/dist/man/form_field.3x vendor/ncurses/dist/man/form_field_attributes.3x vendor/ncurses/dist/man/form_field_buffer.3x vendor/ncurses/dist/man/form_field_info.3x vendor/ncurses/dist/man/form_field_just.3x vendor/ncurses/dist/man/form_field_new.3x vendor/ncurses/dist/man/form_field_opts.3x vendor/ncurses/dist/man/form_field_userptr.3x vendor/ncurses/dist/man/form_field_validation.3x vendor/ncurses/dist/man/form_fieldtype.3x vendor/ncurses/dist/man/form_hook.3x vendor/ncurses/dist/man/form_new.3x vendor/ncurses/dist/man/form_new_page.3x vendor/ncurses/dist/man/form_opts.3x vendor/ncurses/dist/man/form_page.3x vendor/ncurses/dist/man/form_post.3x vendor/ncurses/dist/man/form_requestname.3x vendor/ncurses/dist/man/form_userptr.3x vendor/ncurses/dist/man/form_variables.3x vendor/ncurses/dist/man/form_win.3x vendor/ncurses/dist/man/infocmp.1m vendor/ncurses/dist/man/infotocap.1m vendor/ncurses/dist/man/key_defined.3x vendor/ncurses/dist/man/keybound.3x vendor/ncurses/dist/man/keyok.3x vendor/ncurses/dist/man/legacy_coding.3x vendor/ncurses/dist/man/make_sed.sh vendor/ncurses/dist/man/man_db.renames vendor/ncurses/dist/man/manhtml.aliases vendor/ncurses/dist/man/manhtml.externs vendor/ncurses/dist/man/menu.3x vendor/ncurses/dist/man/menu_attributes.3x vendor/ncurses/dist/man/menu_cursor.3x vendor/ncurses/dist/man/menu_driver.3x vendor/ncurses/dist/man/menu_format.3x vendor/ncurses/dist/man/menu_hook.3x vendor/ncurses/dist/man/menu_items.3x vendor/ncurses/dist/man/menu_mark.3x vendor/ncurses/dist/man/menu_new.3x vendor/ncurses/dist/man/menu_opts.3x vendor/ncurses/dist/man/menu_pattern.3x vendor/ncurses/dist/man/menu_post.3x vendor/ncurses/dist/man/menu_requestname.3x vendor/ncurses/dist/man/menu_spacing.3x vendor/ncurses/dist/man/menu_userptr.3x vendor/ncurses/dist/man/menu_win.3x vendor/ncurses/dist/man/mitem_current.3x vendor/ncurses/dist/man/mitem_name.3x vendor/ncurses/dist/man/mitem_new.3x vendor/ncurses/dist/man/mitem_opts.3x vendor/ncurses/dist/man/mitem_userptr.3x vendor/ncurses/dist/man/mitem_value.3x vendor/ncurses/dist/man/mitem_visible.3x vendor/ncurses/dist/man/ncurses.3x vendor/ncurses/dist/man/panel.3x vendor/ncurses/dist/man/resizeterm.3x vendor/ncurses/dist/man/tabs.1 vendor/ncurses/dist/man/term.5 vendor/ncurses/dist/man/term.7 vendor/ncurses/dist/man/term_variables.3x vendor/ncurses/dist/man/terminfo.head vendor/ncurses/dist/man/terminfo.tail vendor/ncurses/dist/man/tic.1m vendor/ncurses/dist/man/toe.1m vendor/ncurses/dist/man/tput.1 vendor/ncurses/dist/man/tset.1 vendor/ncurses/dist/man/wresize.3x vendor/ncurses/dist/menu/Makefile.in vendor/ncurses/dist/menu/llib-lmenu vendor/ncurses/dist/menu/llib-lmenut vendor/ncurses/dist/menu/llib-lmenutw vendor/ncurses/dist/menu/llib-lmenuw vendor/ncurses/dist/menu/m_driver.c vendor/ncurses/dist/menu/m_global.c vendor/ncurses/dist/menu/m_hook.c vendor/ncurses/dist/menu/m_item_use.c vendor/ncurses/dist/menu/m_req_name.c vendor/ncurses/dist/menu/m_trace.c vendor/ncurses/dist/menu/m_userptr.c vendor/ncurses/dist/menu/menu.h vendor/ncurses/dist/menu/menu.priv.h vendor/ncurses/dist/misc/Makefile.in vendor/ncurses/dist/misc/emx.src vendor/ncurses/dist/misc/gen-pkgconfig.in vendor/ncurses/dist/misc/ncurses-config.in vendor/ncurses/dist/misc/run_tic.in vendor/ncurses/dist/misc/shlib vendor/ncurses/dist/misc/tdlint vendor/ncurses/dist/misc/terminfo.src vendor/ncurses/dist/mk-1st.awk vendor/ncurses/dist/ncurses/Makefile.in vendor/ncurses/dist/ncurses/README.IZ vendor/ncurses/dist/ncurses/SigAction.h vendor/ncurses/dist/ncurses/base/MKkeyname.awk vendor/ncurses/dist/ncurses/base/MKlib_gen.sh vendor/ncurses/dist/ncurses/base/MKunctrl.awk vendor/ncurses/dist/ncurses/base/define_key.c vendor/ncurses/dist/ncurses/base/keyok.c vendor/ncurses/dist/ncurses/base/lib_addch.c vendor/ncurses/dist/ncurses/base/lib_addstr.c vendor/ncurses/dist/ncurses/base/lib_beep.c vendor/ncurses/dist/ncurses/base/lib_bkgd.c vendor/ncurses/dist/ncurses/base/lib_box.c vendor/ncurses/dist/ncurses/base/lib_chgat.c vendor/ncurses/dist/ncurses/base/lib_color.c vendor/ncurses/dist/ncurses/base/lib_colorset.c vendor/ncurses/dist/ncurses/base/lib_dft_fgbg.c vendor/ncurses/dist/ncurses/base/lib_driver.c vendor/ncurses/dist/ncurses/base/lib_endwin.c vendor/ncurses/dist/ncurses/base/lib_erase.c vendor/ncurses/dist/ncurses/base/lib_flash.c vendor/ncurses/dist/ncurses/base/lib_freeall.c vendor/ncurses/dist/ncurses/base/lib_getch.c vendor/ncurses/dist/ncurses/base/lib_getstr.c vendor/ncurses/dist/ncurses/base/lib_hline.c vendor/ncurses/dist/ncurses/base/lib_inchstr.c vendor/ncurses/dist/ncurses/base/lib_initscr.c vendor/ncurses/dist/ncurses/base/lib_insch.c vendor/ncurses/dist/ncurses/base/lib_insnstr.c vendor/ncurses/dist/ncurses/base/lib_instr.c vendor/ncurses/dist/ncurses/base/lib_isendwin.c vendor/ncurses/dist/ncurses/base/lib_mouse.c vendor/ncurses/dist/ncurses/base/lib_newterm.c vendor/ncurses/dist/ncurses/base/lib_newwin.c vendor/ncurses/dist/ncurses/base/lib_overlay.c vendor/ncurses/dist/ncurses/base/lib_pad.c vendor/ncurses/dist/ncurses/base/lib_printw.c vendor/ncurses/dist/ncurses/base/lib_restart.c vendor/ncurses/dist/ncurses/base/lib_scanw.c vendor/ncurses/dist/ncurses/base/lib_screen.c vendor/ncurses/dist/ncurses/base/lib_scroll.c vendor/ncurses/dist/ncurses/base/lib_set_term.c vendor/ncurses/dist/ncurses/base/lib_slkatr_set.c vendor/ncurses/dist/ncurses/base/lib_slkcolor.c vendor/ncurses/dist/ncurses/base/lib_slkinit.c vendor/ncurses/dist/ncurses/base/lib_slkrefr.c vendor/ncurses/dist/ncurses/base/lib_slkset.c vendor/ncurses/dist/ncurses/base/lib_touch.c vendor/ncurses/dist/ncurses/base/lib_vline.c vendor/ncurses/dist/ncurses/base/lib_window.c vendor/ncurses/dist/ncurses/base/resizeterm.c vendor/ncurses/dist/ncurses/base/safe_sprintf.c vendor/ncurses/dist/ncurses/base/use_window.c vendor/ncurses/dist/ncurses/base/wresize.c vendor/ncurses/dist/ncurses/build.priv.h vendor/ncurses/dist/ncurses/curses.priv.h vendor/ncurses/dist/ncurses/fifo_defs.h vendor/ncurses/dist/ncurses/llib-lncurses vendor/ncurses/dist/ncurses/llib-lncursest vendor/ncurses/dist/ncurses/llib-lncursestw vendor/ncurses/dist/ncurses/llib-lncursesw vendor/ncurses/dist/ncurses/llib-ltic vendor/ncurses/dist/ncurses/llib-ltict vendor/ncurses/dist/ncurses/llib-ltictw vendor/ncurses/dist/ncurses/llib-lticw vendor/ncurses/dist/ncurses/llib-ltinfo vendor/ncurses/dist/ncurses/llib-ltinfot vendor/ncurses/dist/ncurses/llib-ltinfotw vendor/ncurses/dist/ncurses/llib-ltinfow vendor/ncurses/dist/ncurses/modules vendor/ncurses/dist/ncurses/tinfo/MKcaptab.sh vendor/ncurses/dist/ncurses/tinfo/MKcodes.awk vendor/ncurses/dist/ncurses/tinfo/MKfallback.sh vendor/ncurses/dist/ncurses/tinfo/MKkeys_list.sh vendor/ncurses/dist/ncurses/tinfo/MKnames.awk vendor/ncurses/dist/ncurses/tinfo/access.c vendor/ncurses/dist/ncurses/tinfo/add_tries.c vendor/ncurses/dist/ncurses/tinfo/alloc_entry.c vendor/ncurses/dist/ncurses/tinfo/alloc_ttype.c vendor/ncurses/dist/ncurses/tinfo/captoinfo.c vendor/ncurses/dist/ncurses/tinfo/comp_error.c vendor/ncurses/dist/ncurses/tinfo/comp_expand.c vendor/ncurses/dist/ncurses/tinfo/comp_hash.c vendor/ncurses/dist/ncurses/tinfo/comp_parse.c vendor/ncurses/dist/ncurses/tinfo/comp_scan.c vendor/ncurses/dist/ncurses/tinfo/db_iterator.c vendor/ncurses/dist/ncurses/tinfo/entries.c vendor/ncurses/dist/ncurses/tinfo/free_ttype.c vendor/ncurses/dist/ncurses/tinfo/getenv_num.c vendor/ncurses/dist/ncurses/tinfo/hashed_db.c vendor/ncurses/dist/ncurses/tinfo/home_terminfo.c vendor/ncurses/dist/ncurses/tinfo/init_keytry.c vendor/ncurses/dist/ncurses/tinfo/lib_acs.c vendor/ncurses/dist/ncurses/tinfo/lib_baudrate.c vendor/ncurses/dist/ncurses/tinfo/lib_cur_term.c vendor/ncurses/dist/ncurses/tinfo/lib_data.c vendor/ncurses/dist/ncurses/tinfo/lib_longname.c vendor/ncurses/dist/ncurses/tinfo/lib_napms.c vendor/ncurses/dist/ncurses/tinfo/lib_options.c vendor/ncurses/dist/ncurses/tinfo/lib_print.c vendor/ncurses/dist/ncurses/tinfo/lib_raw.c vendor/ncurses/dist/ncurses/tinfo/lib_setup.c vendor/ncurses/dist/ncurses/tinfo/lib_termcap.c vendor/ncurses/dist/ncurses/tinfo/lib_tgoto.c vendor/ncurses/dist/ncurses/tinfo/lib_ti.c vendor/ncurses/dist/ncurses/tinfo/lib_tparm.c vendor/ncurses/dist/ncurses/tinfo/lib_tputs.c vendor/ncurses/dist/ncurses/tinfo/lib_ttyflags.c vendor/ncurses/dist/ncurses/tinfo/make_hash.c vendor/ncurses/dist/ncurses/tinfo/make_keys.c vendor/ncurses/dist/ncurses/tinfo/name_match.c vendor/ncurses/dist/ncurses/tinfo/obsolete.c vendor/ncurses/dist/ncurses/tinfo/parse_entry.c vendor/ncurses/dist/ncurses/tinfo/read_entry.c vendor/ncurses/dist/ncurses/tinfo/read_termcap.c vendor/ncurses/dist/ncurses/tinfo/strings.c vendor/ncurses/dist/ncurses/tinfo/tinfo_driver.c vendor/ncurses/dist/ncurses/tinfo/trim_sgr0.c vendor/ncurses/dist/ncurses/tinfo/use_screen.c vendor/ncurses/dist/ncurses/tinfo/write_entry.c vendor/ncurses/dist/ncurses/trace/lib_trace.c vendor/ncurses/dist/ncurses/trace/lib_traceatr.c vendor/ncurses/dist/ncurses/trace/lib_tracebits.c vendor/ncurses/dist/ncurses/trace/lib_tracedmp.c vendor/ncurses/dist/ncurses/trace/lib_tracemse.c vendor/ncurses/dist/ncurses/trace/trace_xnames.c vendor/ncurses/dist/ncurses/trace/visbuf.c vendor/ncurses/dist/ncurses/tty/MKexpanded.sh vendor/ncurses/dist/ncurses/tty/hardscroll.c vendor/ncurses/dist/ncurses/tty/hashmap.c vendor/ncurses/dist/ncurses/tty/lib_mvcur.c vendor/ncurses/dist/ncurses/tty/lib_tstp.c vendor/ncurses/dist/ncurses/tty/lib_twait.c vendor/ncurses/dist/ncurses/tty/lib_vidattr.c vendor/ncurses/dist/ncurses/tty/tty_update.c vendor/ncurses/dist/ncurses/widechar/charable.c vendor/ncurses/dist/ncurses/widechar/lib_add_wch.c vendor/ncurses/dist/ncurses/widechar/lib_cchar.c vendor/ncurses/dist/ncurses/widechar/lib_get_wch.c vendor/ncurses/dist/ncurses/widechar/lib_get_wstr.c vendor/ncurses/dist/ncurses/widechar/lib_hline_set.c vendor/ncurses/dist/ncurses/widechar/lib_in_wch.c vendor/ncurses/dist/ncurses/widechar/lib_ins_wch.c vendor/ncurses/dist/ncurses/widechar/lib_inwstr.c vendor/ncurses/dist/ncurses/widechar/lib_key_name.c vendor/ncurses/dist/ncurses/widechar/lib_slk_wset.c vendor/ncurses/dist/ncurses/widechar/lib_unget_wch.c vendor/ncurses/dist/ncurses/widechar/lib_vid_attr.c vendor/ncurses/dist/ncurses/widechar/lib_vline_set.c vendor/ncurses/dist/ncurses/widechar/lib_wacs.c vendor/ncurses/dist/ncurses/widechar/widechars.c vendor/ncurses/dist/ncurses/win32con/gettimeofday.c vendor/ncurses/dist/ncurses/win32con/win_driver.c vendor/ncurses/dist/package/debian-mingw/changelog vendor/ncurses/dist/package/debian-mingw/compat vendor/ncurses/dist/package/debian-mingw/control vendor/ncurses/dist/package/debian-mingw/copyright vendor/ncurses/dist/package/debian-mingw/rules vendor/ncurses/dist/package/debian-mingw/source/format vendor/ncurses/dist/package/debian-mingw/watch vendor/ncurses/dist/package/debian-mingw64/changelog vendor/ncurses/dist/package/debian-mingw64/compat vendor/ncurses/dist/package/debian-mingw64/control vendor/ncurses/dist/package/debian-mingw64/copyright vendor/ncurses/dist/package/debian-mingw64/rules vendor/ncurses/dist/package/debian-mingw64/source/format vendor/ncurses/dist/package/debian-mingw64/watch vendor/ncurses/dist/package/debian/changelog vendor/ncurses/dist/package/debian/compat vendor/ncurses/dist/package/debian/control vendor/ncurses/dist/package/debian/copyright vendor/ncurses/dist/package/debian/rules vendor/ncurses/dist/package/debian/source/format vendor/ncurses/dist/package/debian/watch vendor/ncurses/dist/package/mingw-ncurses.nsi vendor/ncurses/dist/package/mingw-ncurses.spec vendor/ncurses/dist/package/ncurses.spec vendor/ncurses/dist/panel/Makefile.in vendor/ncurses/dist/panel/llib-lpanel vendor/ncurses/dist/panel/llib-lpanelt vendor/ncurses/dist/panel/llib-lpaneltw vendor/ncurses/dist/panel/llib-lpanelw vendor/ncurses/dist/panel/panel.h vendor/ncurses/dist/panel/panel.priv.h vendor/ncurses/dist/progs/MKtermsort.sh vendor/ncurses/dist/progs/Makefile.in vendor/ncurses/dist/progs/capconvert vendor/ncurses/dist/progs/clear.c vendor/ncurses/dist/progs/dump_entry.c vendor/ncurses/dist/progs/dump_entry.h vendor/ncurses/dist/progs/infocmp.c vendor/ncurses/dist/progs/modules vendor/ncurses/dist/progs/progs.priv.h vendor/ncurses/dist/progs/tabs.c vendor/ncurses/dist/progs/tic.c vendor/ncurses/dist/progs/toe.c vendor/ncurses/dist/progs/tput.c vendor/ncurses/dist/progs/tset.c vendor/ncurses/dist/test/Makefile.in vendor/ncurses/dist/test/README vendor/ncurses/dist/test/aclocal.m4 vendor/ncurses/dist/test/background.c vendor/ncurses/dist/test/blue.c vendor/ncurses/dist/test/bs.c vendor/ncurses/dist/test/cardfile.c vendor/ncurses/dist/test/chgat.c vendor/ncurses/dist/test/clip_printw.c vendor/ncurses/dist/test/color_name.h vendor/ncurses/dist/test/color_set.c vendor/ncurses/dist/test/configure vendor/ncurses/dist/test/configure.in vendor/ncurses/dist/test/demo_altkeys.c vendor/ncurses/dist/test/demo_defkey.c vendor/ncurses/dist/test/demo_forms.c vendor/ncurses/dist/test/demo_keyok.c vendor/ncurses/dist/test/demo_menus.c vendor/ncurses/dist/test/demo_panels.c vendor/ncurses/dist/test/demo_termcap.c vendor/ncurses/dist/test/demo_terminfo.c vendor/ncurses/dist/test/ditto.c vendor/ncurses/dist/test/dots.c vendor/ncurses/dist/test/dots_mvcur.c vendor/ncurses/dist/test/dots_termcap.c vendor/ncurses/dist/test/echochar.c vendor/ncurses/dist/test/edit_field.c vendor/ncurses/dist/test/edit_field.h vendor/ncurses/dist/test/filter.c vendor/ncurses/dist/test/firework.c vendor/ncurses/dist/test/firstlast.c vendor/ncurses/dist/test/foldkeys.c vendor/ncurses/dist/test/form_driver_w.c vendor/ncurses/dist/test/gdc.6 vendor/ncurses/dist/test/gdc.c vendor/ncurses/dist/test/hanoi.c vendor/ncurses/dist/test/hashtest.c vendor/ncurses/dist/test/inch_wide.c vendor/ncurses/dist/test/inchs.c vendor/ncurses/dist/test/ins_wide.c vendor/ncurses/dist/test/insdelln.c vendor/ncurses/dist/test/inserts.c vendor/ncurses/dist/test/key_names.c vendor/ncurses/dist/test/knight.c vendor/ncurses/dist/test/linedata.h vendor/ncurses/dist/test/lrtest.c vendor/ncurses/dist/test/make-tar.sh vendor/ncurses/dist/test/mk-test.awk vendor/ncurses/dist/test/modules vendor/ncurses/dist/test/movewindow.c vendor/ncurses/dist/test/ncurses.c vendor/ncurses/dist/test/newdemo.c vendor/ncurses/dist/test/package/debian/compat vendor/ncurses/dist/test/package/debian/control vendor/ncurses/dist/test/package/debian/copyright vendor/ncurses/dist/test/package/debian/rules vendor/ncurses/dist/test/package/debian/watch vendor/ncurses/dist/test/package/mingw-ncurses-examples.spec vendor/ncurses/dist/test/package/ncurses-examples.spec vendor/ncurses/dist/test/programs vendor/ncurses/dist/test/railroad.c vendor/ncurses/dist/test/rain.c vendor/ncurses/dist/test/redraw.c vendor/ncurses/dist/test/savescreen.c vendor/ncurses/dist/test/savescreen.sh vendor/ncurses/dist/test/tclock.c vendor/ncurses/dist/test/test.priv.h vendor/ncurses/dist/test/test_add_wchstr.c vendor/ncurses/dist/test/test_addchstr.c vendor/ncurses/dist/test/test_addstr.c vendor/ncurses/dist/test/test_addwstr.c vendor/ncurses/dist/test/test_arrays.c vendor/ncurses/dist/test/test_get_wstr.c vendor/ncurses/dist/test/test_getstr.c vendor/ncurses/dist/test/test_instr.c vendor/ncurses/dist/test/test_inwstr.c vendor/ncurses/dist/test/test_vid_puts.c vendor/ncurses/dist/test/test_vidputs.c vendor/ncurses/dist/test/testaddch.c vendor/ncurses/dist/test/testcurs.c vendor/ncurses/dist/test/testscanw.c vendor/ncurses/dist/test/tracemunch vendor/ncurses/dist/test/view.c vendor/ncurses/dist/test/widechars.h vendor/ncurses/dist/test/worm.c vendor/ncurses/dist/test/xmas.c vendor/ncurses/dist/test/xterm-16color.dat vendor/ncurses/dist/test/xterm-256color.dat vendor/ncurses/dist/test/xterm-88color.dat Modified: vendor/ncurses/dist/ANNOUNCE ============================================================================== --- vendor/ncurses/dist/ANNOUNCE Fri Feb 7 00:47:58 2020 (r357644) +++ vendor/ncurses/dist/ANNOUNCE Fri Feb 7 08:36:41 2020 (r357645) @@ -1,79 +1,943 @@ - Announcing ncurses 5.9 + Announcing ncurses 6.1 +Overview + The ncurses (new curses) library is a free software emulation of - curses in System V Release 4.0, and more. It uses terminfo format, - supports pads and color and multiple highlights and forms characters - and function-key mapping, and has all the other SYSV-curses - enhancements over BSD curses. + curses in System V Release 4.0 (SVr4), and more. It uses terminfo + format, supports pads and color and multiple highlights and forms + characters and function-key mapping, and has all the other SVr4-curses + enhancements over BSD curses. SVr4 curses became the basis of X/Open + Curses. In mid-June 1995, the maintainer of 4.4BSD curses declared that he - considered 4.4BSD curses obsolete, and encouraged the keepers of Unix + considered 4.4BSD curses obsolete, and encouraged the keepers of unix releases such as BSD/OS, FreeBSD and NetBSD to switch over to ncurses. - The ncurses code was developed under GNU/Linux. It has been in use for - some time with OpenBSD as the system curses library, and on FreeBSD - and NetBSD as an external package. It should port easily to any - ANSI/POSIX-conforming UNIX. It has even been ported to OS/2 Warp! + Since 1995, ncurses has been ported to many systems: + * It is used in almost every system based on the Linux kernel (aside + from some embedded applications). + * It is used as the system curses library on OpenBSD, FreeBSD and + OSX. + * It is used in environments such as Cygwin and MinGW. The first of + these was EMX on OS/2 Warp. + * It is used (though usually not as the system curses) on all of the + vendor unix systems, e.g., AIX, HP-UX, IRIX64, SCO, Solaris, + Tru64. + * It should work readily on any ANSI/POSIX-conforming unix. The distribution includes the library and support utilities, including - a terminfo compiler tic(1), a decompiler infocmp(1), clear(1), - tput(1), tset(1), and a termcap conversion tool captoinfo(1). Full - manual pages are provided for the library and tools. + * [1]captoinfo, a termcap conversion tool + * [2]clear, utility for clearing the screen + * [3]infocmp, the terminfo decompiler + * [4]tabs, set tabs on a terminal + * [5]tic, the terminfo compiler + * [6]toe, list (table of) terminfo entries + * [7]tput, utility for retrieving terminal capabilities in shell + scripts + * [8]tset, to initialize the terminal - The ncurses distribution is available via anonymous FTP at the GNU - distribution site [1]ftp://ftp.gnu.org/gnu/ncurses/ . - It is also available at [2]ftp://invisible-island.net/ncurses/ . + Full manual pages are provided for the library and tools. - Release Notes + The ncurses distribution is available at ncurses' [9]homepage: - This release is designed to be upward compatible from ncurses 5.0 - through 5.8; very few applications will require recompilation, - depending on the platform. These are the highlights from the - change-log since ncurses 5.8 release. + [10]ftp://ftp.invisible-island.net/ncurses/ or + [11]https://invisible-mirror.net/archives/ncurses/ . - This is a bug-fix release, correcting a small number of urgent - problems in the ncurses library from the 5.8 release. + It is also available via anonymous FTP at the GNU distribution site - It also improves the Ada95 binding: - * fixes a longstanding portability problem with its use of the - [3]set_field_type function. Because that function uses - variable-length argument lists, its interface with gnat does not - work with certain platforms. - * improves configurability and portability, particularly when built - separately from the main ncurses tree. The 5.8 release introduced - scripts which can be used to construct separate tarballs for the - Ada95 and ncurses examples. - Those were a proof of concept. For the 5.9 release, those scripts - are augmented with rpm- and dpkg-scripts used in test builds - against a variety of gnat- and system ncurses versions as old as - gnat 3.15 and ncurses 5.4 (see snapshots and systems tested - [4]here. - * additional improvements were made for portability of the ncurses - examples, adding rpm- and dpkg-scripts for test-builds. See - [5]this page for snapshots and other information. + [12]ftp://ftp.gnu.org/gnu/ncurses/ . - Features of Ncurses +Release Notes - The ncurses package is fully compatible with SVr4 (System V Release 4) - curses: - * All 257 of the SVr4 calls have been implemented (and are - documented). - * Full support for SVr4 curses features including keyboard mapping, - color, forms-drawing with ACS characters, and automatic - recognition of keypad and function keys. - * An emulation of the SVr4 panels library, supporting a stack of - windows with backing store, is included. - * An emulation of the SVr4 menus library, supporting a uniform but - flexible interface for menu programming, is included. - * An emulation of the SVr4 form library, supporting data collection - through on-screen forms, is included. - * Binary terminfo entries generated by the ncurses tic(1) - implementation are bit-for-bit-compatible with the entry format - SVr4 curses uses. - * The utilities have options to allow you to filter terminfo entries - for use with less capable curses/terminfo versions such as the - HP/UX and AIX ports. + These notes are for ncurses 6.1, released January 27, 2018. + This release is designed to be source-compatible with ncurses 5.0 + through 6.0; providing extensions to the application binary interface + (ABI). Although the source can still be configured to support the + ncurses 5 ABI, the intent of the release is to provide extensions to + the ncurses 6 ABI: + * improve integration of tput and tset + * provide support for extended numeric capabilities. + + There are, of course, numerous other improvements, listed in this + announcement. + + The release notes also mention some bug-fixes, but are focused on new + features and improvements to existing features since ncurses 6.0 + release. + + Library improvements + + New features + + The improved integration of tput and tset made only small changes to + the libraries. However, supporting extended numeric capabilities + required a few changes: + * The TERMINAL structure in is now opaque. Doing that + allowed making the structure larger, to hold the extended numeric + data. + A few applications required changes during development of + ncurses 6.1 because those applications misused the members of that + structure, e.g., directly modifying it rather than using + [13]def_prog_mode. + * Having made TERMINAL opaque (and because none of the library + functions use anything except a pointer to TERMINAL), it was + possible to increase the size of the structure, adding to the end. + Existing applications which were linked to the ncurses 6.0 + high-level (ncurses, ncursesw) and low-level (tinfo, tinfo) + libraries should not require re-linking since the binary interface + did not change, nor did the structure offsets with TERMINAL + change. + A few applications use the inner TERMTYPE structure's offsets to + refer to terminfo capabilities within that structure. Again, those + do not require modification because their offsets within TERMINAL + did not change. + * When configured for wide-characters, i.e., "ncursesw" the TERMINAL + structure is extended. + The new data in TERMINAL holds the same information as TERMTYPE, + but with larger numbers ("int" versus "short"). It is named + TERMTYPE2. + The library uses this structure internally in preference to + TERMTYPE, referring to TERMTYPE only to initialize it for + applications that use the capabilities defined in + * When configured for 8-bit (narrow) characters, the TERMTYPE2 + structure is not used. + * The updated application binary interface is 6.1.20171230 (used for + new [14]versioned symbols), although the interface changes were + developed several months previously. + + The motivation for making this extension came from noticing that + [15]termcap applications could (though not [16]realistically) use + larger numbers than would fit in 16-bits, and the fact that the number + of color pairs for a 256-color xterm could not be expressed in + terminfo (i.e., 32767 versus 65536). Also, a few terminals support + direct-colors, which could use the extension. + + Generally speaking, applications that use internal details of a + library are unsupported. There was exactly one exception for ncurses: + the tack program used the internal details of TERMINAL, because it + provides an ncurses-specific feature for interactively modifying a + terminfo description and writing the updated description to a + text-file. It was possible to not only separate tack from these + [17]internal details of ncurses, but to generalize it so that the + program works with Unix curses (omitting the ncurses-specific + feature). That was released as [18]tack 1.08 in July 2017. + + While making changes to tack to eliminate its dependency upon ncurses + internals, the publicly-visible details of those internals were + reviewed, and some symbols were moved to private header files, while + others were marked explicitly as ncurses internals. Future releases of + ncurses may eliminate some of those symbols (such as those used by + tack 1.07) because they are neither part of the API or the ABI. + + Using the TERMTYPE2 extended numeric capabilities, it is possible to + support both color pair values and color values past 32767. Taking + compatibility into account, developers readily understand that neither + function signatures nor structure offsets change. Also, existing + functions have to operate with the extended numbers. Most of that work + is internal to the library. For the external interfaces, a hybrid + approach was used: + * X/Open Curses defined function prototypes such as wattr_set with + an unused parameter, for "future" use. After 25 years, the future + is here: ncurses uses the parameter to augment color pair values + as described in the [19]manual page. + * Other functions such as those defining color pairs did not have a + corresponding reserved parameter. For those, ncurses defines + extended versions such as init_extended_pair (versus init_pair), + init_extended_color (versus init_color). + + Additionally, to improve performance other changes (and extensions) + are provided in this release: + * Several new functions simplify management of large sets of color + pairs: reset_color_pairs, alloc_pair, find_pair and free_pair. + * New "RGB" extension capability for direct-color support is used to + improve performance of color_content. + * The internal colorpair_t is now a struct, eliminating an internal + 8-bit limit on colors + * Allocation for SCREEN's color-pair table starts small, grows on + demand up to the limit given in the terminal description. + * setcchar and getcchar now treat a negative color-pair as an error. + + Other improvements + + These are new or revised features: + * modify c++/etip.h.in to accommodate deprecation of throw and + throws in c++17 + * add new function unfocus_current_field + * add option to preserve leading whitespace in form fields + * add a macro for is_linetouched and adjust the function's return + value to make it possible for most applications to check for an + error-return. + * add build-time utility report_offsets to help show when the + various configurations of tinfo library are compatible or not. + + These were done to limit or ultimately deprecate features: + * drop two symbols obsoleted in 2004: _nc_check_termtype, and + _nc_resolve_uses + * move _nc_tracebits, _tracedump and _tracemouse to curses.priv.h, + since they are not part of the suggested ABI6. + * mark some structs in form/menu/panel libraries as potentially + opaque without modifying API/ABI. + * ifdef'd header-file definition of mouse_trafo with + NCURSES_NOMACROS + * remove initialization-check for calling napms in the term-driver + configuration; none is needed. + * modify trace to avoid overwriting existing file + + These are improvements to existing features: + * modify make_hash to allow building with address-sanitizer, + assuming that --disable-leaks is configured. + * move SCREEN field for use_tioctl data before the ncursesw fields, + and limit that to the sp-funcs configuration to improve termlib + compatibility + * modify db-iterator: + + ignore zero-length files in db-iterator; these are useful for + instance to suppress $HOME/.terminfo when not wanted. + + modify update_getenv to ensure that environment variables + which are not initially set will be checked later if an + application happens to set them + * modify _nc_outc_wrapper to use the standard output if the screen + was not initialized, rather than returning an error. + * improve checks for low-level terminfo functions when the terminal + has not been initialized. + * modify set_curterm to update ttytype[] data used by longname/p> + * modify _nc_get_screensize to allow for use_env and use_tioctl + state to be per-screen when sp-funcs are configured, better + matching the behavior when using the term-driver configuration. + * remove an early-return from _nc_do_color, which can interfere with + data needed by bkgd when ncurses is configured with extended + colors + * incorporate A_COLOR mask into COLOR_PAIR, in case user application + provides an out-of-range pair number + * modify logic for endwin-state to be able to detect the case where + the screen was never initialized, using that to trigger a flush of + ncurses' buffer for mvcur, e.g., in the sample program dots_mvcur + for the term-driver configuration. + + These are corrections to existing features: + * fixes for writing extended color pairs in putwin. + * modify no-leaks code for lib_cur_term.c to account for the tgetent + cache. + * amend handling of the repeat_char capability in EmitRange to avoid + scope creep: translate the character to the alternate character + set when the alternate character set is enabled, and do not use + repeat_char for characters past 255. + * improve wide-character implementation of myADDNSTR in + frm_driver.c, which was inconsistent with the normal + implementation. + * modify winnstr and winchnstr to return error if the output pointer + is null, as well as adding a null pointer check of the window + pointer for better compatibility with other implementations. + * modify setupterm to save original tty-modes so that erasechar + works as expected. Also modify _nc_setupscreen to avoid redundant + calls to get original tty-modes. + * modify wattr_set and wattr_get to return ERR if win-parameter is + null, as documented. + * correct order of initialization for traces in use_env and + use_tioctl versus first _tracef calls. + * correct parameters for copywin call in _nc_Synchronize_Attributes + * flush the standard output in _nc_flush for the case where SP is + zero, e.g., when called via putp. This fixes a scenario where + "tput flash" did not work after changes in 20130112. + * amend internal use of tputs to consistently use the number of + lines affected, e.g., for insert/delete character operations. + While merging terminfo source early in 1995, several descriptions + used the "*" proportional delay for these operations, prompting a + change in doupdate. + * correct return-value of extended putwin. + * double-width multibyte characters were not counted properly in + winsnstr and wins_nwstr. + * amend fix for _nc_ripoffline from 20091031 to make test/ditto.c + work in threaded configuration. + * modify _nc_viscbuf2 and _tracecchar_t2 to trace wide-characters as + a whole rather than their multibyte equivalents. + * minor fix in wadd_wchnstr to ensure that each cell has nonzero + width. + * move PUTC_INIT calls next to wcrtomb calls, to avoid carry-over of + error status when processing Unicode values which are not mapped. + * add missing assignment in lib_getch.c to make notimeout work + + Program improvements + + While reviewing user feedback, it became apparent that the differences + between [20]reset (an alias for tset) and "tput reset" were confusing: + * one ([21]tset) updated the terminal modes, but used only part of + the terminfo capabilities for initialization, while + * the other ([22]tput) used all of the terminal capabilities while + neglecting the terminal modes. + + On further investigation, it turned out that the differences were + largely an accident due to the way those programs had evolved. + + This release eliminates the unnecessary differences, using the same + approach for tput's init (initialization), reset and clear operations + as the separate [23]reset and [24]clear programs. Doing this does not + change the command-line options; existing scripts are unaffected. + + These are the user-visible changes for the three programs (tput, tset + and clear): + * add the terminal-mode parts of "reset" (aka tset) to the "tput + reset" command, making the two almost the same except for + window-size. + * improve tput's check for being called as "init" or "reset" to + allow for transformed names. + * add "clear" as a possible link/alias to tput. + * amend changes for tput to reset tty modes to "sane" if the program + is run as "reset", like tset. Likewise, ensure that tset sends + either reset- or init-strings. + * add -x option to clear/tput to make the E3 extension optional + * add functionality of "tset -w" to tput, like the "-c" feature this + is not optional in tput. + * add options -T and -V to clear command for compatibility with + tput. + * drop long-obsolete "-n" option from tset. + * modify tset's assignment to TERM in its output to reflect the name + by which the terminal description is found, rather than the + primary name. That was an unnecessary part from the initial + conversion of tset from termcap to terminfo. The termcap library + in 4.3BSD did this to avoid using the short 2-character name + * remove a restriction in tput's support for termcap names which + omitted capabilities normally not shown in termcap translations + * add usage message to clear command + * improve usage messages for tset and tput. + + Other user-visible improvements and new features include: + * modify tic/infocmp display of numeric values to use hexadecimal + when they are "close" to a power of two, making the result more + readable. + * add "-W" option to tic/infocmp to force long strings to wrap. + + This is in addition to the "-w" option which attempts to fit + capabilities into a given line-length. + + If "-f" option splits line, do not further split it with + "-W". + + Begin a new line when adding "use=" after a wrapped line. + * add "-q" option to infocmp to suppress the "Reconstructed from" + comment from the header, and a corresponding option to tic to + suppress all comments from the "tic -I" output. + * Sorted options in usage message for infocmp, to make it simpler to + see unused letters. + * Updated usage message for tic, adding "-0" option. + * add infocmp/tic "-Q" option, which allows one to dump the compiled + form of the terminal entry, in hexadecimal or base64: + + A "b64:" prefix in the TERMINFO variable tells the terminfo + reader to use base64 according to RFC-3548 as well as + RFC-4648 url/filename-safe format. + + A "hex:" prefix tells the terminfo reader to accept + hexadecimal data as generated by "infocmp -0qQ1". + + Other less-visible improvements and new features include: + * modify utility headers such as tic.h to make it clearer which are + externals that are used by tack. + * add "reset" to list of programs whose names might change in + manpages due to program-transformation configure options. + * modify "-T" option of clear and tput to call use_tioctl to obtain + the operating system's notion of the screensize if possible. + * add check in tput for init/reset operands to ensure those use a + terminal. + * modify programs clear, tabs, tput and tset to pass the actual tty + file descriptor to setupterm rather than the standard output or + error, making padding work. + * change tset's initialization to allow it to get settings from the + standard input as well as /dev/tty, to be more effective when + output or error are redirected. + * amend check in tput, tabs and clear to allow those to use the + database-only features in cron if a "-T" option gives a suitable + terminal name. + * improve error message from tset/reset when both stderr/stdout are + redirected to a file or pipe. + + Several of the less apparent features deal with translation of + terminfo to termcap (and the reverse), with corresponding checks by + tic: + * modify check in fmt_entry to handle a cancelled reset string. Make + similar fixes in other parts of dump_entry.c and tput.c + * correct read of terminfo entry in which all strings are absent or + explicitly cancelled. Before this fix, the result was that all + were treated as only absent. + * modify infocmp to suppress mixture of absent/cancelled + capabilities that would only show as "NULL, NULL", unless the "-q" + option is used, e.g., to show "-, @" or "@, -". + * correct a warning from tic about keys which are the same, to skip + over missing/cancelled values. + * add check in tic for use of bold, etc., video attributes in the + color capabilities, accounting whether the feature is listed in + ncv. + * add check in tic for unnecessary use of "2" to denote a shifted + special key. + * improve check in tic for delays by also warning about beep/flash + when a delay is not embedded, or if those use the VT100 reverse + video escape without using a delay. + * improve checks in trim_sgr0, comp_parse.c and parse_entry.c, for + cancelled string capabilities. + * add check in tic for some syntax errors of delays, as well as use + of proportional delays for non-line capabilities. + * add check in tic for conflict between ritm, rmso, rmul versus + sgr0. + * add check in _nc_parse_entry for invalid entry name, setting the + name to "invalid" to avoid problems storing entries. + * improve _nc_tparm_analyze, using that to extend the checks made by + tic for reporting inconsistencies between the expected number of + parameters for a capability and the actual. + * remove tic warning about "^?" in string capabilities, which was + marked as an extension; however all Unix implementations support + this and X/Open Curses does not address it. On the other hand, + [25]BSD termcap did not support this feature (until the + [26]mid-1990s). + in _nc_infotocap, added a check to ensure that terminfo "^?" is + not written to termcap. + * modify sscanf calls in _nc_infotocap for patterns "%{number}%+%c" + and "%'char'%+%c" to check that the final character is really "c", + avoiding a case in icl6404 which cannot be converted to termcap. + * in _nc_tic_expand and _nc_infotocap, improved string-length check + when deciding whether to use "^X" or "\xxx" format for control + characters, to make the output of tic/infocmp more predictable. + * limited termcap "%d" width to 2 digits on input, and use "%2" in + preference to "%02" on output. + * correct terminfo/termcap conversion of "%02" and "%03" into "%2" + and "%3"; the result repeated the last character. + + Examples + + Along with the library and utilities, many improvements were made to + the [27]ncurses-examples. + + These changes were made to demonstrate new extensions in ncurses: + * add demo_new_pair program, to demonstrate [28]alloc_pair, + [29]find_pair and [30]free_pair functions. + This program iterates over the possible color combinations, + allocating or initializing color pairs. For best results, choose + screen-width dividing evenly into the number of colors. e.g., + + 32x64,32x128 256 colors + 24x44,24x88 88 colors + 32x64,24x128 16 colors + + * add extended_color program, like the older color_set program, but + using the extended color functions, with and without the + SP-functions interface. + * add picsmap program to fill in some testing issues not met by + dots, using this as the third example in a comparison of the + [31]ncurses versus slang libraries. + The program can directly read X bitmap and pixmap files, + displaying a picture. It can read other image files using + ImageMagick's convert program to translate the image into text. + For 16-, 88- and 256-color terminal descriptions, picsmap can load + a palette file which tells it which color palette entries to use. + For direct-colors, the terminal descriptions use the RGB extension + capability. + + There are other new example programs and a few scripts: + * add dots_xcurses program to illustrate a different approach used + for extended colors which can be contrasted with dots_curses. + * add list_keys program show function keys for one or more terminal + descriptions. It uses ncurses's convention of modifiers for + special keys, based on xterm. + * add padview program, to compare pads with direct updates in the + view program. + * add sp_tinfo program to exercise the SP-functions extension of the + low-level terminfo library. + * add test-programs for termattrs and term_attrs functions. + * add test_sgr program to exercise all combinations of the sgr + capability. + * add tput-colorcube demo script, imitating xterm's 88- and + 256-color scripts using tput. + * add tput-initc script to demonstrate how tput may be used to + initialize a color palette from a data file. + + A variety of improvements were made to existing programs, both new + features as well as options added to make the set of programs more + consistent. + + The ncurses program is the largest; a proportionately large number of + changes were made to it: + * modify a/A screens to make exiting on an escape character depend + on the start of keypad and timeout modes, to allow better testing + of function-keys. + add "t" toggle for notimeout function. + * modify layout of b/B screens to allow for additional annotation on + the right margin; some terminals with partial support did not + display well. + * modify c/C screens to allow for extended color pairs. + add z/Z zoom feature to make extended color pairs easier to test. + modify test-screens to take advantage of wide screens, reducing + the number of lines used for 88- and 256-colors. + * modify "d" edit-color screen to optionally read xterm color + palette directly from terminal, as well as handling KEY_RESIZE and + screen-repainting with control/L and control/R. + * add examples to "F" screen for WACS_D_PLUS and WACS_T_PLUS. + * improve "g" screen, correcting ifdef which made the legend not + reflect changes to keypad- and scroll-modes. Added check for + return-value of putwin. + * make "s" test easier to understand which subtests are available + add a corresponding "S" wide-character overlap test-screen. + * add "v" screen to show baudrate and other values. + + These changes were made to the other examples: + * modify blue program to use Unicode values for card-glyphs when + available, as well as improving the check for CP437 and CP850. + * improve demo_menus program, allowing mouse-click on the + menu-headers to switch the active menu. This requires a new + extension option O_MOUSE_MENU to tell the menu driver to put mouse + events which do not apply to the active menu back into the queue + so that the application can handle the event. + * correct logic in demo_terminfo program for "-f" option + * modify ditto program to allow $XTERM_PROG environment variable to + override "xterm" as the name of the program to run in the threaded + configuration. + * add several options to the "dots" test-programs. + * modify filter program: + + illustrate an alternative to getnstr, that polls for input + while updating a clock on the right margin as well as + responding to window size-changes. + + adapt logic used in [32]dialog [33]"--keep-tite" option for + filter program as the "-a" option. When set, filter attempts + to suppress the alternate screen. + * modify knight program to provide the "slow" solution for small + screens using "R", noting that Warnsdorf's method is easily done + with "a". + * modify the savescreen program to add test patterns that exercise + 88-, 256-, etc., colors. + * add options to test_arrays, for selecting termcap vs terminfo, + etc. + * modify the view program: + + expand tabs using the ncurses library rather than in the + test-program. + + eliminate the "-n" option by simply reading the whole file. + + implement page up/down commands. + + remove the very old SIGWINCH example; just use KEY_RESIZE. + * improve animation in xmas program by adding a time-delay in + blinkit. + * modify several test-programs which call use_default_colors to + consistently do this only if the "-d" option is given. + * modify the install-rule for ncurses-examples to put the data files + in the data directory, e.g., /usr/share/ncurses-examples. + * modify several test programs to use new popup_msgs function, + adapted from the help-screen used in the edit_field program. + * modify test data for xterm palettes to use the newer + color4/color12 values. + * improve the tracemunch script: + + show screenXX pointers and thread identifiers as names. + + chang address-parameters of add_wch, color_content and + pair_content to dummy parameters. + + Terminal database + + There are several new terminal descriptions: + + dumb-emacs-ansi, dvtm, dvtm-256color, fbterm, iterm2, linux-m1 + minitel entries, putty-noapp, viewdata, and vt100+4bsd + building-block. + + xterm+noalt, xterm+titlestack, xterm+alt1049, xterm+alt+title + building blocks and xterm+direct, xterm+indirect, xterm-direct. + from [34]xterm patch #331. + + several other "-direct" descriptions to address the differences of + other terminal emulators versus xterm-direct. + + There are many changes to existing terminal descriptions. Some were + updates to several descriptions: + * use xterm+sm+1006 in several terminal descriptions which were + validated as supporting the extended mouse feature for their + respective terminal emulators. + * corrected sgr/sgr0 strings in a few cases reported by tic, making + those correspond to the non-sgr settings where they differ, but + otherwise use ECMA-48 consistently. + * add 0.1sec mandatory delay to flash capabilities using the VT100 + reverse-video control + + while others affected specific descriptions. These were retested, to + take into account new/undocumented changes by their developers: + + iterm, minitel, st, viewdata, nsterm + + while these are specific fixes based on user reports, or warnings from + tic: + + [35]ansi building blocks + + + restored rmir/smir in ansi+idc to better match original + ansiterm+idc, add alias ansiterm + + [36]icl6402 + + + corrected missing comma-separator between string capabilities + in icl6402 and m2-nam + + [37]interix + + + updated using tack and SFU with Windows 7 Ultimate. + + used ^? for kdch1 + + [38]linux + + + made linux3.0 entry the default linux entry + + modify linux2.6 entry to improve line-drawing so that the + linux3.0 entry can be used in non-UTF-8 mode + + omitted selection of ISO-8859-1 for G0 in enacs capability + from linux2.6 entry, to avoid conflict with the user-defined + mapping. The reset feature uses ISO-8859-1 in any case. + + modify flash capability for linux and wyse entries to put the + delay between the reverse/normal escapes rather than after + + modify linux-16color to not mask dim, standout or reverse + with the ncv capability + + [39]pccon entries + + + fixed some inconsistencies in the pccon* entries + + add bold to pccon+sgr+acs and pccon-base + + add keys f12-f124 to pccon+keys + + [40]tmux + + + corrected sgr string, which used screen's "standout" code + rather than the standard code. + + add settings corresponding to xterm-keys option to reflect + upcoming change to make that option "on" by default + + uncanceled Ms + + [41]vt100 + + + modify vt100 rs2 string to reset vt52 mode and scrolling + regions + + corrected rs2 string for vt100-nam + + made minor fixes for vt100+4bsd, e.g., delay in sgr for + consistency + + [42]vte + + + moved SGR 24 and 27 from vte-2014 to vte-2012 + + add a few capabilities fixed in recent VTE development + + [43]xterm + + + add rep to xterm-new, available since [44]late 1996. + + modify xterm+256color and xterm+256setaf to use correct + number of color pairs. + + modify rs1 for xterm-16color, xterm-88color and + xterm-256color to reset palette using oc string as in linux + entry. + + add rs1 capability to xterm-256color + + add oc capability to xterm+256color, allowing palette reset + for xterm + + add op to xterm+256setaf + + modify xterm-r5, xterm-r6 and xterm-xf86-v32 to use xterm+kbs + to match [45]xterm #272, reflecting packager's changes + + used ANSI reply for u8 in xterm-new, to reflect vt220-style + responses that could be returned. + + made xterm-pcolor sgr consistent with other capabilities + + A few entries use extensions (user-defined terminal capabilities): + * add rmxx/smxx ECMA-48 strikeout extension to tmux and xterm-basic + * used RGB capability in new *-direct entries to denote direct-color + feature. + + Documentation + + As usual, this release + * improves documentation by describing new features, + * attempts to improve the description of features which users have + found confusing + * fills in overlooked descriptions of features which were described + in the [46]NEWS file but treated sketchily in manual pages. + + In particular, + * Since the underlying features for [47]tset, [48]tput, and + [49]clear have been better integrated, the documentation now + includes information on how those tools evolved. + In addition to explaining the improved integration of the tools, + the manual pages made it easier to see how the tools are similar + and how they are different. + * The addch manual page has additional information on + [50]portability and differences from other implementations. + * The discussion of color-pairs in the attributes manual page is + improved in its [51]history section. + * The documentation of the chtype, cchar_t types and the attribute + values which can be stored in those types, in particular the + [52]history and [53]portability sections of the attributes manual + page, has been improved. + * improve discussion of [54]portability in the mouse manual. + * The pad manual page has a section on the [55]origin and + portability of pads. + * Differences between SVr4 and X/Open Curses soft-keys are discussed + in a new section on [56]portability. + * There are updated/improved notes on portability in the + [57]resizeterm and [58]wresize manual pages. + + In addition to providing background information to explain these + features and show how they evolved, there are corrections, + clarifications, etc.: + * add note in the [59]addch manual about line-drawing when it + depends upon UTF-8. + * improve discussion of line-drawing characters in the [60]add_wch + manual. + * explain in [61]clear's manual page that it writes to the standard + output. + * improve description of [62]endwin. + * improve discussion of field validation in the [63]form driver + manual page. + * clarify the use of wint_t vs wchar_t in [64]get_wstr manual page. + * clarify in the [65]getch manual that the keypad mode affects an + application's ability to read KEY_MOUSE codes, but does not affect + KEY_RESIZE. + trim some obsolete/incorrect wording about EINTR from the getch + manual page + improve manual pages for [66]getch and [67]get_wch to point out + that they might return user-defined values which have no + predefined names in + * improve description of the -R option in the [68]infocmp manual + page + * clarify in the [69]resizeterm manual page how KEY_RESIZE is pushed + onto the input stream. + * document return value of [70]use_extended_names + * document differences in [71]ESCDELAY versus AIX's implementation + in the variables manual page. + * The _nc_free_tinfo function is now documented in the + [72]memory-leaks manual page, because it could be used in tack for + memory-leak checking. + * add a note to the [73]tic manual page about -W versus -f options. + * improve terminfo manual description of [74]terminfo syntax. + improve terminfo manual page discussion of [75]control- and + graphics- characters. + improve [76]color-handling section in terminfo manual page + * clarify description in [77]tput manual page regarding support for + termcap names + update [78]tput manual page to reflect changes to manipulate + terminal modes by sharing functions with tset. + * clarify in manual pages that the optional verbose option level of + [79]tic and [80]infocmp is available only when ncurses is + configured for tracing. + * improve manual page description of [81]tset/reset versus + window-size. + * improve description of [82]tgoto parameters + + There are new manual pages: + * [83]user_caps documents the terminfo extensions used by ncurses. + * [84]scr_dump documents the screen-dump format. + + Some of the improvements are more subtle, relating to the way the + information is presented: + * Made minor fixes to manpage NAME/SYNOPSIS sections to consistently + use rule that either all functions which are prototyped in + SYNOPSIS are listed in the NAME section, or the manual-page name + is the sole item listed in the NAME section. The latter is used to + reduce clutter, e.g., for the top-level library manual pages as + well as for certain feature-pages such as [85]SP-funcs and + [86]threading. + * improve manual pages for utilities with respect to POSIX versus + X/Open Curses. + * improve organization of the [87]attributes and [88]color manual + pages. + + Interesting bug-fixes + + * modify toe to not exit if unable to read a terminal description, + e.g., if there is a permission problem. + * correct 20100515 change for weak signals versus sigprocmask + * work around Ada tool-breakage in Debian 9 and later by invoking + gprconfig to specify the C compiler to be used by gnatmake, and + conditionally suppressing Library_Options line for static + libraries. + * There were, as well, several bug-fixes to handle illegal input for + tic. Because those did not correspond to useful terminal + descriptions, most users are unaffected. + + Configuration changes + + Major changes + + This release provides a new binary format for terminal descriptions + that use extended numeric capabilities. Applications built with the + wide-character ncursesw library can use these extended numbers. + * This includes utilities such as tic and infocmp, because (as noted + in [89]New features), the feature relies upon an extension to the + low-level tinfo library. + * A few software packagers use a configuration option of ncurses + which allows the low-level tinfo library to be shared between the + high-level ncurses and ncursesw libraries. This new feature was + designed to work in that configuration as well. + + Other applications (i.e., using the 8-bit ncurses library) which read + the extended terminal descriptions see those numeric capabilities set + to the maximum value for a signed 16-bit number. + + Older versions of ncurses' tic accept out-of-range numeric + capabilities, storing those as the maximum value for a signed 16-bit + number. Other implementations of curses (mentioned in the discussion + of [90]picsmap) give zero for these out-of-range capabilities. + + Configuration options + + These changes provide support for tack 1.08, released in [91]July + 2017: + * add --without-tack configure option to refine --with-progs + configure option. Normally tack is built outside the ncurses tree, + but a few packagers combine it during the build. If term_entry.h + is installed, there is no advantage to in-tree builds. + * adjust configure-script to define HAVE_CURSES_DATA_BOOLNAMES + symbol needed for tack 1.08 when built in-tree. Rather than + relying upon internal "_nc_" functions, tack now uses the boolean, + number and string capability name-arrays provided by ncurses and + SVr4 Unix curses. It still uses term_entry.h for the definitions + of the extended capability arrays. + * add dependency upon ncurses_cfg.h to tic's header-files; any + program using tic-library will have to supply this file. Legacy + tack versions supply this file; ongoing tack development has + dropped the dependency upon tic-library and new releases will not + be affected. + + Other changes to the configure-script and generated files include + * add configure options to disable checks for form, menu and panel + libraries so that ncurses-examples can be built with non-SVr4 + curses implementations. + * add configure option --enable-opaque-curses for ncurses library + and similar options for the other libraries. + * add configure option --disable-wattr-macros for use in cases where + one wants to use the same headers for ncurses5/ncurses6 + development, by suppressing the wattr* macros which differ due to + the introduction of extended colors + * modify configure macro for shared-library rules to use -Wl,-rpath + rather than -rpath to work around a bug in scons + * improve ncurses-examples' configure script to define as needed + NCURSES_WIDECHAR for platforms where _XOPEN_SOURCE_EXTENDED does + not work. Also modified the test program to ensure that if + building with ncurses, that the cchar_t type is checked, since + that is normally (since [92]20111030) ifdef'd depending on this + test. + * modify configure script to handle the case where tic-library is + renamed, but the --with-debug option is used by itself without + normal or shared libraries + * modify editing script which generates resulting.map to work with + the clang configuration on recent FreeBSD, which gives an error on + an empty "local" section. + * improve configure check for setting the WILDCARD_SYMS variable; on + ppc64 the variable is in the Data section rather than Text. + * correct result of configure option --without-fallbacks, which + caused FALLBACK_LIST to be set to "no" + * modify --with-pkg-config-libdir option to make it possible to + install ".pc" files even if pkg-config is not found. Limit this + change, to suppress the actual install if it is not overridden to + a valid directory at install time. + * disallow "no" as a possible value for --with-shlib-version option, + overlooked in cleanup-changes for [93]20000708. + + Portability + + Many of the portability changes are implemented via the configure + script: + * improve configure script's CF_CC_ENV_FLAGS macro to allow for + compiler wrappers such as ccache. This change moves only the + preprocessor, optimization and warning flags to CPPFLAGS and + CFLAGS, leaving the residue in CC. That happens to work for gcc's + various "model" options, but may require tuning for other + compilers. + * modify ncurses-examples' configure script to use pkg-config for + the extra form/menu/panel libraries, to be more consistent with + the handling of the curses/ncurses library. + * add configuration checks to build with [94]NetBSD curses, which + for example lacks [95]use_env. + * change ncurses-examples to use attr_t vs chtype to follow X/Open + documentation more closely since Solaris xpg4-curses uses + different values for WA_xxx vs A_xxx that rely on attr_t being an + unsigned short. Tru64 aka OSF1, HPUX, AIX did as ncurses does, + equating the two sets. + * modify several test programs to reflect that ncurses honors + existing signal handlers in initscr, while other implementations + do not. + * add configure check for openpty to ncurses-examples' configure + script, for ditto. + * improve check for working poll function by using posix_openpt as a + fallback in case there is no valid terminal on the standard input + * modify ncurses-examples' configure script to check for pthread + dependency of ncursest or ncursestw library when building the + ncurses examples, e.g., in case weak symbols are used. + * add checks in ncurses-examples' configure script for some + functions neither in 4.3BSD curses, nor based on X/Open Curses: + + modify a loop limit in firework.c to work around absense of + limit checks in some libraries. + + fill the last row of a window with "?" in firstlast if waddch + does not return ERR on the lower-right corner. + * build-fixes for the Portland Group (PGI) compilers + + accept whitespace in sed expression for generating expanded.c + + modify configure check that g++ compiler warnings are not + used. + + add configure check for -fPIC option needed for shared + libraries. + * modify configure script for clang as used on FreeBSD, to work + around clang's differences in exit codes vs gcc. + * fixes for configure/build using clang on OSX + + do not redefine "inline" in ncurses_cfg.h; this was + originally to solve a problem with gcc/g++, but is aggravated + by clang's misuse of symbols to pretend it is gcc. + + add braces to configure script to prevent unwanted addition + of "-lstdc++" option to the CXXLIBS symbol. + + improve/update test-program used for checking existence of + stdc++ library. + + if $CXXLIBS is set, the linkage test uses that in addition to + $LIBS. + * fixes for OS/2: + + use button instead of kbuf[0] in EMX-specific part of + lib_mouse.c + + support building with libtool on OS/2 + + use stdc++ library with OS/2 kLIBC + + clear configure script's cf_XOPEN_SOURCE for OS/2, to work + with its header files + * add "newer" baudrate symbols to the [96]baudrate function in the + ncurses library as well as to a corresponding table in tset. + * modify ncurses-examples savescreen to work with AIX and HPUX. + * define WIN32_LEAN_AND_MEAN for MinGW port, making builds faster. + * add a configure check for wcwidth versus the ncurses line-drawing + characters, to use in special-casing systems such as Solaris. + Solaris, however, requires a special case that maps Unicode + line-drawing characters into the acsc string for non-Unicode + locales. Solaris also has a misconfigured wcwidth which marks all + of the line drawing characters as double-width. + * string-hacks (non-standard): + + fix configure script to record when strlcat is found on + OpenBSD. + + add --enable-string-hacks option to ncurses-examples' + configure script. + + completed string-hacks for sprintf, etc., including the + ncurses-examples programs. + + make --enable-string-hacks option work with Debian by + checking for the "bsd" library and its associated + "" header. + * workaround for Debian's antique/unmaintained version of mawk: + + see Debian #65617, which was fixed in mawk's upstream + releases in [97]2009. + + related fixes when building link_test. + _________________________________________________________________ + +Features of ncurses + + The ncurses package is fully upward-compatible with SVr4 (System V + Release 4) curses: + * All of the SVr4 calls have been implemented (and are documented). + * ncurses supports all of the for SVr4 curses features including + keyboard mapping, color, forms-drawing with ACS characters, and + automatic recognition of keypad and function keys. + * ncurses provides these SVr4 add-on libraries (not part of X/Open + Curses): + + the panels library, supporting a stack of windows with + backing store. + + the menus library, supporting a uniform but flexible + interface for menu programming. + + the form library, supporting data collection through + on-screen forms. + * ncurses's terminal database is fully compatible with that used by + SVr4 curses. + + ncurses supports user-defined capabilities which it can see, + but which are hidden from SVr4 curses applications using the + same terminal database. + + It can be optionally configured to match the format used in + related systems such as AIX and Tru64. + + Alternatively, ncurses can be configured to use hashed + databases rather than the directory of files used by SVr4 + curses. + * The ncurses utilities have options to allow you to filter terminfo *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Feb 7 08:39:01 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A2AD4246B73; Fri, 7 Feb 2020 08:39:01 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48DTH93jchz4HNf; Fri, 7 Feb 2020 08:39:01 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C0F01BB2; Fri, 7 Feb 2020 08:39:01 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0178d17F020926; Fri, 7 Feb 2020 08:39:01 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0178d1an020925; Fri, 7 Feb 2020 08:39:01 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <202002070839.0178d1an020925@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 7 Feb 2020 08:39:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r357646 - vendor/ncurses/6.1-20200118 X-SVN-Group: vendor X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: vendor/ncurses/6.1-20200118 X-SVN-Commit-Revision: 357646 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2020 08:39:01 -0000 Author: bapt Date: Fri Feb 7 08:39:00 2020 New Revision: 357646 URL: https://svnweb.freebsd.org/changeset/base/357646 Log: Tag import of ncurses 6.1-20200118 Added: vendor/ncurses/6.1-20200118/ - copied from r357645, vendor/ncurses/dist/ From owner-svn-src-all@freebsd.org Fri Feb 7 09:22:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5A48B2476E8; Fri, 7 Feb 2020 09:22:14 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48DVF22Wc8z4KSS; Fri, 7 Feb 2020 09:22:14 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5116824E1; Fri, 7 Feb 2020 09:22:14 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0179METi051117; Fri, 7 Feb 2020 09:22:14 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0179M9up051074; Fri, 7 Feb 2020 09:22:09 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <202002070922.0179M9up051074@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Fri, 7 Feb 2020 09:22:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357647 - in head/sys: cam/ata cam/mmc cam/nvme cam/scsi dev/aac dev/altera/avgen dev/altera/sdcard dev/amr dev/cfi dev/flash dev/ida dev/ips dev/mfi dev/mlx dev/mmc dev/nvme dev/pst de... X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: in head/sys: cam/ata cam/mmc cam/nvme cam/scsi dev/aac dev/altera/avgen dev/altera/sdcard dev/amr dev/cfi dev/flash dev/ida dev/ips dev/mfi dev/mlx dev/mmc dev/nvme dev/pst dev/twe dev/virtio/block de... X-SVN-Commit-Revision: 357647 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2020 09:22:14 -0000 Author: scottl Date: Fri Feb 7 09:22:08 2020 New Revision: 357647 URL: https://svnweb.freebsd.org/changeset/base/357647 Log: Ever since the block layer expanded its command syntax beyond just BIO_READ and BIO_WRITE, we've handled this expanded syntax poorly in drivers when the driver doesn't support a particular command. Do a sweep and fix that. Reported by: imp Modified: head/sys/cam/ata/ata_da.c head/sys/cam/mmc/mmc_da.c head/sys/cam/nvme/nvme_da.c head/sys/cam/scsi/scsi_cd.c head/sys/cam/scsi/scsi_da.c head/sys/cam/scsi/scsi_sa.c head/sys/dev/aac/aac_disk.c head/sys/dev/altera/avgen/altera_avgen.c head/sys/dev/altera/sdcard/altera_sdcard_io.c head/sys/dev/amr/amr.c head/sys/dev/cfi/cfi_disk.c head/sys/dev/flash/at45d.c head/sys/dev/flash/mx25l.c head/sys/dev/flash/n25q.c head/sys/dev/ida/ida_disk.c head/sys/dev/ips/ips_disk.c head/sys/dev/mfi/mfi.c head/sys/dev/mlx/mlx_disk.c head/sys/dev/mmc/mmcsd.c head/sys/dev/nvme/nvme_ns.c head/sys/dev/pst/pst-raid.c head/sys/dev/twe/twe.c head/sys/dev/virtio/block/virtio_blk.c head/sys/dev/xen/blkfront/blkfront.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Fri Feb 7 08:39:00 2020 (r357646) +++ head/sys/cam/ata/ata_da.c Fri Feb 7 09:22:08 2020 (r357647) @@ -2430,6 +2430,10 @@ adastart(struct cam_periph *periph, union ccb *start_c } break; } + default: + biofinish(bp, NULL, EOPNOTSUPP); + xpt_release_ccb(start_ccb); + return; } start_ccb->ccb_h.ccb_state = ADA_CCB_BUFFER_IO; start_ccb->ccb_h.flags |= CAM_UNLOCKED; Modified: head/sys/cam/mmc/mmc_da.c ============================================================================== --- head/sys/cam/mmc/mmc_da.c Fri Feb 7 08:39:00 2020 (r357646) +++ head/sys/cam/mmc/mmc_da.c Fri Feb 7 09:22:08 2020 (r357647) @@ -1834,6 +1834,10 @@ sddastart(struct cam_periph *periph, union ccb *start_ CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("BIO_DELETE\n")); sddaschedule(periph); break; + default: + biofinish(bp, NULL, EOPNOTSUPP); + xpt_release_ccb(start_ccb); + return; } start_ccb->ccb_h.ccb_bp = bp; softc->outstanding_cmds++; Modified: head/sys/cam/nvme/nvme_da.c ============================================================================== --- head/sys/cam/nvme/nvme_da.c Fri Feb 7 08:39:00 2020 (r357646) +++ head/sys/cam/nvme/nvme_da.c Fri Feb 7 09:22:08 2020 (r357647) @@ -994,6 +994,11 @@ ndastart(struct cam_periph *periph, union ccb *start_c case BIO_FLUSH: nda_nvme_flush(softc, nvmeio); break; + default: + biofinish(bp, NULL, EOPNOTSUPP); + xpt_release_ccb(start_ccb); + ndaschedule(periph); + return; } start_ccb->ccb_state = NDA_CCB_BUFFER_IO; start_ccb->ccb_bp = bp; Modified: head/sys/cam/scsi/scsi_cd.c ============================================================================== --- head/sys/cam/scsi/scsi_cd.c Fri Feb 7 08:39:00 2020 (r357646) +++ head/sys/cam/scsi/scsi_cd.c Fri Feb 7 09:22:08 2020 (r357647) @@ -927,6 +927,13 @@ cdstart(struct cam_periph *periph, union ccb *start_cc } bioq_remove(&softc->bio_queue, bp); + if ((bp->bio_cmd != BIO_READ) && + (bp->bio_cmd != BIO_WRITE)) { + biofinish(bp, NULL, EOPNOTSUPP); + xpt_release_ccb(start_ccb); + return; + } + scsi_read_write(&start_ccb->csio, /*retries*/ cd_retry_count, /* cbfcnp */ cddone, Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Fri Feb 7 08:39:00 2020 (r357646) +++ head/sys/cam/scsi/scsi_da.c Fri Feb 7 09:22:08 2020 (r357647) @@ -3381,6 +3381,10 @@ more: } break; } + default: + biofinish(bp, NULL, EOPNOTSUPP); + xpt_release_ccb(start_ccb); + return; } start_ccb->ccb_h.ccb_state = DA_CCB_BUFFER_IO; start_ccb->ccb_h.flags |= CAM_UNLOCKED; Modified: head/sys/cam/scsi/scsi_sa.c ============================================================================== --- head/sys/cam/scsi/scsi_sa.c Fri Feb 7 08:39:00 2020 (r357646) +++ head/sys/cam/scsi/scsi_sa.c Fri Feb 7 09:22:08 2020 (r357647) @@ -2683,6 +2683,12 @@ again: bioq_remove(&softc->bio_queue, bp); softc->queue_count--; + if ((bp->bio_cmd != BIO_READ) && + (bp->bio_cmd != BIO_WRITE)) { + biofinish(bp, NULL, EOPNOTSUPP); + xpt_release_ccb(start_ccb); + return; + } length = bp->bio_bcount; if ((softc->flags & SA_FLAG_FIXED) != 0) { Modified: head/sys/dev/aac/aac_disk.c ============================================================================== --- head/sys/dev/aac/aac_disk.c Fri Feb 7 08:39:00 2020 (r357646) +++ head/sys/dev/aac/aac_disk.c Fri Feb 7 09:22:08 2020 (r357647) @@ -163,6 +163,11 @@ aac_disk_strategy(struct bio *bp) return; } + if ((bp->bio_cmd != BIO_READ) && (bp->bio_cmd != BIO_WRITE)) { + biofinish(bp, NULL, EOPNOTSUPP); + return; + } + /* perform accounting */ /* pass the bio to the controller - it can work out who we are */ Modified: head/sys/dev/altera/avgen/altera_avgen.c ============================================================================== --- head/sys/dev/altera/avgen/altera_avgen.c Fri Feb 7 08:39:00 2020 (r357646) +++ head/sys/dev/altera/avgen/altera_avgen.c Fri Feb 7 09:22:08 2020 (r357647) @@ -252,11 +252,13 @@ altera_avgen_disk_strategy(struct bio *bp) void *data; long bcount; daddr_t pblkno; + int error; sc = bp->bio_disk->d_drv1; data = bp->bio_data; bcount = bp->bio_bcount; pblkno = bp->bio_pblkno; + error = 0; /* * Serialize block reads / writes. @@ -265,7 +267,7 @@ altera_avgen_disk_strategy(struct bio *bp) switch (bp->bio_cmd) { case BIO_READ: if (!(sc->avg_flags & ALTERA_AVALON_FLAG_GEOM_READ)) { - biofinish(bp, NULL, EIO); + error = EROFS; break; } switch (sc->avg_width) { @@ -324,11 +326,11 @@ altera_avgen_disk_strategy(struct bio *bp) break; default: - panic("%s: unsupported I/O operation %d", __func__, - bp->bio_cmd); + error = EOPNOTSUPP; + break; } mtx_unlock(&sc->avg_disk_mtx); - biofinish(bp, NULL, 0); + biofinish(bp, NULL, error); } static int Modified: head/sys/dev/altera/sdcard/altera_sdcard_io.c ============================================================================== --- head/sys/dev/altera/sdcard/altera_sdcard_io.c Fri Feb 7 08:39:00 2020 (r357646) +++ head/sys/dev/altera/sdcard/altera_sdcard_io.c Fri Feb 7 09:22:08 2020 (r357647) @@ -293,27 +293,27 @@ recheck: } static void -altera_sdcard_io_start_internal(struct altera_sdcard_softc *sc, struct bio *bp) +altera_sdcard_io_start_internal(struct altera_sdcard_softc *sc, struct bio **bp) { - switch (bp->bio_cmd) { + switch (*bp->bio_cmd) { case BIO_READ: - altera_sdcard_write_cmd_arg(sc, bp->bio_pblkno * + altera_sdcard_write_cmd_arg(sc, *bp->bio_pblkno * ALTERA_SDCARD_SECTORSIZE); altera_sdcard_write_cmd(sc, ALTERA_SDCARD_CMD_READ_BLOCK); break; case BIO_WRITE: - altera_sdcard_write_rxtx_buffer(sc, bp->bio_data, - bp->bio_bcount); - altera_sdcard_write_cmd_arg(sc, bp->bio_pblkno * + altera_sdcard_write_rxtx_buffer(sc, *bp->bio_data, + *bp->bio_bcount); + altera_sdcard_write_cmd_arg(sc, *bp->bio_pblkno * ALTERA_SDCARD_SECTORSIZE); altera_sdcard_write_cmd(sc, ALTERA_SDCARD_CMD_WRITE_BLOCK); break; default: - panic("%s: unsupported I/O operation %d", __func__, - bp->bio_cmd); + biofinish(*bp, NULL, EOPNOTSUPP); + *bp = NULL; } } @@ -332,8 +332,8 @@ altera_sdcard_io_start(struct altera_sdcard_softc *sc, */ KASSERT(bp->bio_bcount == ALTERA_SDCARD_SECTORSIZE, ("%s: I/O size not %d", __func__, ALTERA_SDCARD_SECTORSIZE)); - altera_sdcard_io_start_internal(sc, bp); - sc->as_currentbio = bp; + altera_sdcard_io_start_internal(sc, &bp); + sc->as_currentbio = *bp; sc->as_retriesleft = ALTERA_SDCARD_RETRY_LIMIT; } @@ -406,7 +406,7 @@ altera_sdcard_io_complete(struct altera_sdcard_softc * */ if (sc->as_retriesleft != 0) { sc->as_flags |= ALTERA_SDCARD_FLAG_IOERROR; - altera_sdcard_io_start_internal(sc, bp); + altera_sdcard_io_start_internal(sc, &bp); return (0); } sc->as_flags &= ~ALTERA_SDCARD_FLAG_IOERROR; Modified: head/sys/dev/amr/amr.c ============================================================================== --- head/sys/dev/amr/amr.c Fri Feb 7 08:39:00 2020 (r357646) +++ head/sys/dev/amr/amr.c Fri Feb 7 09:22:08 2020 (r357647) @@ -1315,6 +1315,10 @@ amr_bio_command(struct amr_softc *sc, struct amr_comma ac->ac_flags |= AMR_CMD_PRIORITY | AMR_CMD_DATAOUT; cmd = AMR_CMD_FLUSH; break; + default: + biofinish(bio, NULL, EOPNOTSUPP); + amr_releasecmd(ac); + return (0); } amrd = (struct amrd_softc *)bio->bio_disk->d_drv1; driveno = amrd->amrd_drive - sc->amr_drive; Modified: head/sys/dev/cfi/cfi_disk.c ============================================================================== --- head/sys/dev/cfi/cfi_disk.c Fri Feb 7 08:39:00 2020 (r357646) +++ head/sys/dev/cfi/cfi_disk.c Fri Feb 7 09:22:08 2020 (r357647) @@ -315,8 +315,10 @@ cfi_disk_strategy(struct bio *bp) { struct cfi_disk_softc *sc = bp->bio_disk->d_drv1; - if (sc == NULL) - goto invalid; + if (sc == NULL) { + biofinish(bp, NULL, EINVAL); + return; + } if (bp->bio_bcount == 0) { bp->bio_resid = bp->bio_bcount; biodone(bp); @@ -330,13 +332,11 @@ cfi_disk_strategy(struct bio *bp) bioq_insert_tail(&sc->bioq, bp); mtx_unlock(&sc->qlock); taskqueue_enqueue(sc->tq, &sc->iotask); - return; + break; + default: + biofinish(bp, NULL, EOPNOTSUPP); + break; } - /* fall thru... */ -invalid: - bp->bio_flags |= BIO_ERROR; - bp->bio_error = EINVAL; - biodone(bp); } static int Modified: head/sys/dev/flash/at45d.c ============================================================================== --- head/sys/dev/flash/at45d.c Fri Feb 7 08:39:00 2020 (r357646) +++ head/sys/dev/flash/at45d.c Fri Feb 7 09:22:08 2020 (r357647) @@ -493,7 +493,7 @@ at45d_task(void *arg) len = sc->pagesize - offset; break; default: - berr = EINVAL; + berr = EOPNOTSUPP; goto out; } Modified: head/sys/dev/flash/mx25l.c ============================================================================== --- head/sys/dev/flash/mx25l.c Fri Feb 7 08:39:00 2020 (r357646) +++ head/sys/dev/flash/mx25l.c Fri Feb 7 09:22:08 2020 (r357647) @@ -658,7 +658,7 @@ mx25l_task(void *arg) bp->bio_data, bp->bio_bcount); break; default: - bp->bio_error = EINVAL; + bp->bio_error = EOPNOTSUPP; } Modified: head/sys/dev/flash/n25q.c ============================================================================== --- head/sys/dev/flash/n25q.c Fri Feb 7 08:39:00 2020 (r357646) +++ head/sys/dev/flash/n25q.c Fri Feb 7 09:22:08 2020 (r357647) @@ -462,7 +462,7 @@ n25q_task(void *arg) bp->bio_data, bp->bio_bcount); break; default: - bp->bio_error = EINVAL; + bp->bio_error = EOPNOTSUPP; } biodone(bp); Modified: head/sys/dev/ida/ida_disk.c ============================================================================== --- head/sys/dev/ida/ida_disk.c Fri Feb 7 08:39:00 2020 (r357646) +++ head/sys/dev/ida/ida_disk.c Fri Feb 7 09:22:08 2020 (r357647) @@ -106,6 +106,11 @@ idad_strategy(struct bio *bp) goto bad; } + if ((bp->bio_cmd != BIO_READ) && (bp->bio_cmd != BIO_WRITE)) { + bp->bio_error = EOPNOTSUPP; + goto bad; + } + bp->bio_driver1 = drv; ida_submit_buf(drv->controller, bp); return; Modified: head/sys/dev/ips/ips_disk.c ============================================================================== --- head/sys/dev/ips/ips_disk.c Fri Feb 7 08:39:00 2020 (r357646) +++ head/sys/dev/ips/ips_disk.c Fri Feb 7 09:22:08 2020 (r357647) @@ -109,6 +109,13 @@ static void ipsd_strategy(struct bio *iobuf) dsc = iobuf->bio_disk->d_drv1; DEVICE_PRINTF(8,dsc->dev,"in strategy\n"); iobuf->bio_driver1 = (void *)(uintptr_t)dsc->sc->drives[dsc->disk_number].drivenum; + + if ((iobuf->bio_cmd != BIO_READ) && + (iobuf->bio_cmd != BIO_WRITE)) { + biofinish(iobuf, NULL, EOPNOTSUPP); + return; + } + mtx_lock(&dsc->sc->queue_mtx); bioq_insert_tail(&dsc->sc->queue, iobuf); ips_start_io_request(dsc->sc); Modified: head/sys/dev/mfi/mfi.c ============================================================================== --- head/sys/dev/mfi/mfi.c Fri Feb 7 08:39:00 2020 (r357646) +++ head/sys/dev/mfi/mfi.c Fri Feb 7 09:22:08 2020 (r357647) @@ -2152,7 +2152,9 @@ mfi_build_syspdio(struct mfi_softc *sc, struct bio *bi break; default: /* TODO: what about BIO_DELETE??? */ - panic("Unsupported bio command %x\n", bio->bio_cmd); + biofinish(bio, NULL, EOPNOTSUPP); + mfi_enqueue_free(cm); + return (NULL); } /* Cheat with the sector length to avoid a non-constant division */ @@ -2211,7 +2213,9 @@ mfi_build_ldio(struct mfi_softc *sc, struct bio *bio) break; default: /* TODO: what about BIO_DELETE??? */ - panic("Unsupported bio command %x\n", bio->bio_cmd); + biofinish(bio, NULL, EOPNOTSUPP); + mfi_enqueue_free(cm); + return (NULL); } /* Cheat with the sector length to avoid a non-constant division */ Modified: head/sys/dev/mlx/mlx_disk.c ============================================================================== --- head/sys/dev/mlx/mlx_disk.c Fri Feb 7 08:39:00 2020 (r357646) +++ head/sys/dev/mlx/mlx_disk.c Fri Feb 7 09:22:08 2020 (r357647) @@ -157,6 +157,11 @@ mlxd_strategy(struct bio *bp) goto bad; } + if ((bp->bio_cmd != BIO_READ) && (bp->bio_cmd != BIO_WRITE)) { + bp->bio_error = EOPNOTSUPP; + goto bad; + } + /* XXX may only be temporarily offline - sleep? */ MLX_IO_LOCK(sc->mlxd_controller); if (sc->mlxd_drive->ms_state == MLX_SYSD_OFFLINE) { Modified: head/sys/dev/mmc/mmcsd.c ============================================================================== --- head/sys/dev/mmc/mmcsd.c Fri Feb 7 08:39:00 2020 (r357646) +++ head/sys/dev/mmc/mmcsd.c Fri Feb 7 09:22:08 2020 (r357647) @@ -1431,7 +1431,7 @@ mmcsd_task(void *arg) struct mmcsd_softc *sc; struct bio *bp; device_t dev, mmcbus; - int err, sz; + int bio_error, err, sz; part = arg; sc = part->sc; @@ -1482,11 +1482,14 @@ mmcsd_task(void *arg) block = mmcsd_rw(part, bp); } else if (bp->bio_cmd == BIO_DELETE) { block = mmcsd_delete(part, bp); + } else { + bio_error = EOPNOTSUPP; + goto release; } release: MMCBUS_RELEASE_BUS(mmcbus, dev); if (block < end) { - bp->bio_error = EIO; + bp->bio_error = (bio_error == 0) ? EIO : bio_error; bp->bio_resid = (end - block) * sz; bp->bio_flags |= BIO_ERROR; } else { Modified: head/sys/dev/nvme/nvme_ns.c ============================================================================== --- head/sys/dev/nvme/nvme_ns.c Fri Feb 7 08:39:00 2020 (r357646) +++ head/sys/dev/nvme/nvme_ns.c Fri Feb 7 09:22:08 2020 (r357647) @@ -488,7 +488,7 @@ nvme_ns_bio_process(struct nvme_namespace *ns, struct free(dsm_range, M_NVME); break; default: - err = EIO; + err = EOPNOTSUPP; break; } Modified: head/sys/dev/pst/pst-raid.c ============================================================================== --- head/sys/dev/pst/pst-raid.c Fri Feb 7 08:39:00 2020 (r357646) +++ head/sys/dev/pst/pst-raid.c Fri Feb 7 09:22:08 2020 (r357647) @@ -214,6 +214,7 @@ pst_start(struct pst_softc *psc) struct pst_request *request; struct bio *bp; u_int32_t mfa; + int error; if (psc->iop->outstanding < (I2O_IOP_OUTBOUND_FRAME_COUNT - 1) && (bp = bioq_first(&psc->queue))) { @@ -231,8 +232,8 @@ pst_start(struct pst_softc *psc) request->psc = psc; request->mfa = mfa; request->bp = bp; - if (pst_rw(request)) { - biofinish(request->bp, NULL, EIO); + if ((error = pst_rw(request)) != 0) { + biofinish(request->bp, NULL, error); iop_free_mfa(request->psc->iop, request->mfa); psc->iop->outstanding--; free(request, M_PSTRAID); @@ -286,7 +287,7 @@ pst_rw(struct pst_request *request) break; default: printf("pst: unknown command type 0x%02x\n", request->bp->bio_cmd); - return -1; + return EOPNOTSUPP; } msg->initiator_context = (u_int32_t)pst_done; msg->transaction_context = (u_int32_t)request; @@ -296,7 +297,7 @@ pst_rw(struct pst_request *request) if (!iop_create_sgl((struct i2o_basic_message *)msg, request->bp->bio_data, request->bp->bio_bcount, sgl_flag)) - return -1; + return EIO; request->psc->iop->reg->iqueue = request->mfa; @@ -309,6 +310,7 @@ static void pst_timeout(void *arg) { struct pst_request *request; + int error; request = arg; printf("pst: timeout mfa=0x%08x cmd=0x%02x\n", @@ -321,9 +323,9 @@ pst_timeout(void *arg) request->psc->iop->outstanding--; return; } - if (pst_rw(request)) { + if ((error = pst_rw(request)) != 0) { iop_free_mfa(request->psc->iop, request->mfa); - biofinish(request->bp, NULL, EIO); + biofinish(request->bp, NULL, error); request->psc->iop->outstanding--; } } Modified: head/sys/dev/twe/twe.c ============================================================================== --- head/sys/dev/twe/twe.c Fri Feb 7 08:39:00 2020 (r357646) +++ head/sys/dev/twe/twe.c Fri Feb 7 09:22:08 2020 (r357647) @@ -439,9 +439,13 @@ twe_startio(struct twe_softc *sc) if (bp->bio_cmd == BIO_READ) { tr->tr_flags |= TWE_CMD_DATAIN; cmd->io.opcode = TWE_OP_READ; - } else { + } else if (bp->bio_cmd == BIO_WRITE) { tr->tr_flags |= TWE_CMD_DATAOUT; cmd->io.opcode = TWE_OP_WRITE; + } else { + twe_release_request(tr); + biofinish(bp, NULL, EOPNOTSUPP); + break; } /* build a suitable I/O command (assumes 512-byte rounded transfers) */ Modified: head/sys/dev/virtio/block/virtio_blk.c ============================================================================== --- head/sys/dev/virtio/block/virtio_blk.c Fri Feb 7 08:39:00 2020 (r357646) +++ head/sys/dev/virtio/block/virtio_blk.c Fri Feb 7 09:22:08 2020 (r357647) @@ -549,6 +549,12 @@ vtblk_strategy(struct bio *bp) return; } + if ((bp->bio_cmd != BIO_READ) && (bp->bio_cmd != BIO_WRITE) && + (bp->bio_cmd != BIO_FLUSH)) { + vtblk_bio_done(sc, bp, EOPNOTSUPP); + return; + } + VTBLK_LOCK(sc); if (sc->vtblk_flags & VTBLK_FLAG_DETACH) { Modified: head/sys/dev/xen/blkfront/blkfront.c ============================================================================== --- head/sys/dev/xen/blkfront/blkfront.c Fri Feb 7 08:39:00 2020 (r357646) +++ head/sys/dev/xen/blkfront/blkfront.c Fri Feb 7 09:22:08 2020 (r357647) @@ -399,7 +399,9 @@ xbd_bio_command(struct xbd_softc *sc) panic("flush request, but no flush support available"); break; default: - panic("unknown bio command %d", bp->bio_cmd); + biofinish(bp, NULL, EOPNOTSUPP); + xbd_enqueue_cm(cm, XBD_Q_FREE); + return (NULL); } return (cm); From owner-svn-src-all@freebsd.org Fri Feb 7 10:17:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BCEC02484F5; Fri, 7 Feb 2020 10:17:14 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48DWSV5NgXz4MkH; Fri, 7 Feb 2020 10:17:14 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B41282EA9; Fri, 7 Feb 2020 10:17:14 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 017AHEZU086592; Fri, 7 Feb 2020 10:17:14 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 017AHD6g086587; Fri, 7 Feb 2020 10:17:13 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <202002071017.017AHD6g086587@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 7 Feb 2020 10:17:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357648 - in head/usr.bin/diff: . tests X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: in head/usr.bin/diff: . tests X-SVN-Commit-Revision: 357648 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2020 10:17:14 -0000 Author: bapt Date: Fri Feb 7 10:17:13 2020 New Revision: 357648 URL: https://svnweb.freebsd.org/changeset/base/357648 Log: diff: implement -y (--side-by-side) along with -W and --suppress-common-lines PR: 219933 Submitted by: fehmi noyan isi MFC after: 3 weeks Modified: head/usr.bin/diff/diff.1 head/usr.bin/diff/diff.c head/usr.bin/diff/diff.h head/usr.bin/diff/diffreg.c head/usr.bin/diff/tests/diff_test.sh Modified: head/usr.bin/diff/diff.1 ============================================================================== --- head/usr.bin/diff/diff.1 Fri Feb 7 09:22:08 2020 (r357647) +++ head/usr.bin/diff/diff.1 Fri Feb 7 10:17:13 2020 (r357648) @@ -30,7 +30,7 @@ .\" @(#)diff.1 8.1 (Berkeley) 6/30/93 .\" $FreeBSD$ .\" -.Dd August 18, 2018 +.Dd February 07, 2020 .Dt DIFF 1 .Os .Sh NAME @@ -41,7 +41,7 @@ .Op Fl aBbdipTtw .Oo .Fl c | e | f | -.Fl n | q | u +.Fl n | q | u | y .Oc .Op Fl -brief .Op Fl -changed-group-format Ar GFMT @@ -182,6 +182,21 @@ .Op Fl x Ar pattern | Fl -exclude Ar pattern .Ek .Ar dir1 dir2 +.Nm diff +.Op Fl aBbditwW +.Op --expand-tabs +.Op --ignore-all-blanks +.Op --ignore-blank-lines +.Op --ignore-case +.Op --minimal +.Op --no-ignore-file-name-case +.Op --strip-trailing-cr +.Op --suppress-common-lines +.Op --tabsize +.Op --text +.Op --width +.Fl y | Fl -side-by-side +.Ar file1 file2 .Sh DESCRIPTION The .Nm @@ -284,7 +299,21 @@ However, unlike with .Fl c , all lines to be changed (added and/or removed) are present in a single section. +.It Fl y Fl -side-by-side +Output in two columns with a marker between them. The marker can be one +of the following: +.Pp +.Bl -tag -width Ds -offset indent -compact +.It space +Corresponding lines are identical. +.It '|' +Corresponding lines are different. +.It '<' +Files differ and only the first file contains the line. +.It '>' +Files differ and only the second file contains the line. .El +.El .Pp Comparison options: .Bl -tag -width Ds @@ -362,6 +391,10 @@ E.g., .Dq if (\ \&a == b \&) will compare equal to .Dq if(a==b) . +.It Fl W Ar number Fl -width Ar number +Output at most +.Ar number +columns when using side by side format. The default value is 130. .It Fl -changed-group-format Ar GFMT Format input groups in the provided .Pp @@ -382,7 +415,9 @@ default diff output stub option for compatibility with GNU diff .It Fl -strip-trailing-cr strip carriage return on input files -.It Fl tabsize Ar number +.It Fl -suppress-common-lines +Do not output common lines when using the side by side format +.It Fl -tabsize Ar number Number of spaces representing a tab (default 8) .El .Pp Modified: head/usr.bin/diff/diff.c ============================================================================== --- head/usr.bin/diff/diff.c Fri Feb 7 09:22:08 2020 (r357647) +++ head/usr.bin/diff/diff.c Fri Feb 7 10:17:13 2020 (r357648) @@ -37,16 +37,16 @@ __FBSDID("$FreeBSD$"); #include "diff.h" #include "xmalloc.h" -int lflag, Nflag, Pflag, rflag, sflag, Tflag, cflag; -int diff_format, diff_context, status, ignore_file_case; -int tabsize = 8; +int lflag, Nflag, Pflag, rflag, sflag, Tflag, cflag, Wflag; +int diff_format, diff_context, status, ignore_file_case, suppress_common; +int tabsize = 8, width = 130; char *start, *ifdefname, *diffargs, *label[2], *ignore_pats; char *group_format = NULL; struct stat stb1, stb2; struct excludes *excludes_list; regex_t ignore_re; -#define OPTIONS "0123456789aBbC:cdD:efHhI:iL:lnNPpqrS:sTtU:uwX:x:" +#define OPTIONS "0123456789aBbC:cdD:efHhI:iL:lnNPpqrS:sTtU:uwW:X:x:y" enum { OPT_TSIZE = CHAR_MAX + 1, OPT_STRIPCR, @@ -55,6 +55,7 @@ enum { OPT_NORMAL, OPT_HORIZON_LINES, OPT_CHANGED_GROUP_FORMAT, + OPT_SUPPRESS_COMMON, }; static struct option longopts[] = { @@ -83,8 +84,10 @@ static struct option longopts[] = { { "initial-tab", no_argument, 0, 'T' }, { "unified", optional_argument, 0, 'U' }, { "ignore-all-space", no_argument, 0, 'w' }, + { "width", required_argument, 0, 'W' }, { "exclude", required_argument, 0, 'x' }, { "exclude-from", required_argument, 0, 'X' }, + { "side-by-side", no_argument, NULL, 'y' }, { "ignore-file-name-case", no_argument, NULL, OPT_IGN_FN_CASE }, { "horizon-lines", required_argument, NULL, OPT_HORIZON_LINES }, { "no-ignore-file-name-case", no_argument, NULL, OPT_NO_IGN_FN_CASE }, @@ -92,6 +95,7 @@ static struct option longopts[] = { { "strip-trailing-cr", no_argument, NULL, OPT_STRIPCR }, { "tabsize", optional_argument, NULL, OPT_TSIZE }, { "changed-group-format", required_argument, NULL, OPT_CHANGED_GROUP_FORMAT}, + { "suppress-common-lines", no_argument, NULL, OPT_SUPPRESS_COMMON }, { NULL, 0, 0, '\0'} }; @@ -230,12 +234,23 @@ main(int argc, char **argv) case 'w': dflags |= D_IGNOREBLANKS; break; + case 'W': + Wflag = 1; + width = (int) strtonum(optarg, 1, INT_MAX, &errstr); + if (errstr) { + warnx("Invalid argument for width"); + usage(); + } + break; case 'X': read_excludes_file(optarg); break; case 'x': push_excludes(optarg); break; + case 'y': + diff_format = D_SIDEBYSIDE; + break; case OPT_CHANGED_GROUP_FORMAT: diff_format = D_GFORMAT; group_format = optarg; @@ -261,6 +276,9 @@ main(int argc, char **argv) case OPT_STRIPCR: dflags |= D_STRIPCR; break; + case OPT_SUPPRESS_COMMON: + suppress_common = 1; + break; default: usage(); break; @@ -464,7 +482,12 @@ usage(void) " -U number file1 file2\n" " diff [-aBbdilNPprsTtw] [-c | -e | -f | -n | -q | -u] [--ignore-case]\n" " [--no-ignore-case] [--normal] [--tabsize] [-I pattern] [-L label]\n" - " [-S name] [-X file] [-x pattern] dir1 dir2\n"); + " [-S name] [-X file] [-x pattern] dir1 dir2\n" + " diff [-aBbditwW] [--expand-tabs] [--ignore-all-blanks]\n" + " [--ignore-blank-lines] [--ignore-case] [--minimal]\n" + " [--no-ignore-file-name-case] [--strip-trailing-cr]\n" + " [--suppress-common-lines] [--tabsize] [--text] [--width]\n" + " -y | --side-by-side file1 file2\n"); exit(2); } Modified: head/usr.bin/diff/diff.h ============================================================================== --- head/usr.bin/diff/diff.h Fri Feb 7 09:22:08 2020 (r357647) +++ head/usr.bin/diff/diff.h Fri Feb 7 10:17:13 2020 (r357648) @@ -48,6 +48,7 @@ lines and no trailing . */ #define D_BRIEF 6 /* Say if the files differ */ #define D_GFORMAT 7 /* Diff with defined changed group format */ +#define D_SIDEBYSIDE 8 /* Side by side */ /* * Output flags @@ -85,9 +86,10 @@ struct excludes { struct excludes *next; }; -extern int lflag, Nflag, Pflag, rflag, sflag, Tflag, cflag; +extern int lflag, Nflag, Pflag, rflag, sflag, Tflag, cflag, Wflag; extern int diff_format, diff_context, status, ignore_file_case; -extern int tabsize; +extern int suppress_common; +extern int tabsize, width; extern char *start, *ifdefname, *diffargs, *label[2], *ignore_pats; extern char *group_format; extern struct stat stb1, stb2; Modified: head/usr.bin/diff/diffreg.c ============================================================================== --- head/usr.bin/diff/diffreg.c Fri Feb 7 09:22:08 2020 (r357647) +++ head/usr.bin/diff/diffreg.c Fri Feb 7 10:17:13 2020 (r357648) @@ -181,6 +181,7 @@ struct context_vec { }; #define diff_output printf +#define MIN_PAD 1 static FILE *opentemp(const char *); static void output(char *, FILE *, char *, FILE *, int); static void check(FILE *, FILE *, int); @@ -196,6 +197,7 @@ static void unsort(struct line *, int, int *); static void change(char *, FILE *, char *, FILE *, int, int, int, int, int *); static void sort(struct line *, int); static void print_header(const char *, const char *); +static void print_space(int, int, int); static bool ignoreline_pattern(char *); static bool ignoreline(char *, bool); static int asciifile(FILE *); @@ -220,6 +222,8 @@ static int len[2]; static int pref, suff; /* length of prefix and suffix */ static int slen[2]; static int anychange; +static int hw, padding; /* half width and padding */ +static int edoffset; static long *ixnew; /* will be overlaid on file[1] */ static long *ixold; /* will be overlaid on klist */ static struct cand *clist; /* merely a free storage pot for candidates */ @@ -263,6 +267,22 @@ diffreg(char *file1, char *file2, int flags, int capsi lastline = 0; lastmatchline = 0; context_vec_ptr = context_vec_start - 1; + + /* + * hw excludes padding and make sure when -t is not used, + * the second column always starts from the closest tab stop + */ + if (diff_format == D_SIDEBYSIDE) { + hw = width >> 1; + padding = tabsize - (hw % tabsize); + if ((flags & D_EXPANDTABS) != 0 || (padding % tabsize == 0)) + padding = MIN_PAD; + + hw = (width >> 1) - + ((padding == MIN_PAD) ? (padding << 1) : padding) - 1; + } + + if (flags & D_IGNORECASE) chrtran = cup2low; else @@ -865,7 +885,7 @@ skipline(FILE *f) static void output(char *file1, FILE *f1, char *file2, FILE *f2, int flags) { - int m, i0, i1, j0, j1; + int i, j, m, i0, i1, j0, j1, nc; rewind(f1); rewind(f2); @@ -874,15 +894,55 @@ output(char *file1, FILE *f1, char *file2, FILE *f2, i J[m + 1] = len[1] + 1; if (diff_format != D_EDIT) { for (i0 = 1; i0 <= m; i0 = i1 + 1) { - while (i0 <= m && J[i0] == J[i0 - 1] + 1) + while (i0 <= m && J[i0] == J[i0 - 1] + 1){ + if (diff_format == D_SIDEBYSIDE && + suppress_common != 1) { + nc = fetch(ixold, i0, i0, f1, '\0', + 1, flags); + print_space(nc, + (hw - nc) + (padding << 1) + 1, + flags); + fetch(ixnew, J[i0], J[i0], f2, '\0', + 0, flags); + diff_output("\n"); + } i0++; + } j0 = J[i0 - 1] + 1; i1 = i0 - 1; while (i1 < m && J[i1 + 1] == 0) i1++; j1 = J[i1 + 1] - 1; J[i1] = j1; - change(file1, f1, file2, f2, i0, i1, j0, j1, &flags); + + /* + * When using side-by-side, lines from both of the + * files are printed. The algorithm used by diff(1) + * identifies the ranges in which two files differ. + * See the change() function below. + * The for loop below consumes the shorter range, + * whereas one of the while loops deals with the + * longer one. + */ + if (diff_format == D_SIDEBYSIDE) { + for (i=i0, j=j0; i<=i1 && j<=j1; i++, j++) + change(file1, f1, file2, f2, i, i, + j, j, &flags); + + while (i <= i1) { + change(file1, f1, file2, f2, + i, i, j+1, j, &flags); + i++; + } + + while (j <= j1) { + change(file1, f1, file2, f2, + i+1, i, j, j, &flags); + j++; + } + } else + change(file1, f1, file2, f2, i0, i1, j0, + j1, &flags); } } else { for (i0 = m; i0 >= 1; i0 = i1 - 1) { @@ -987,7 +1047,7 @@ change(char *file1, FILE *f1, char *file2, FILE *f2, i { static size_t max_context = 64; long curpos; - int i, nc, f; + int i, nc; const char *walk; bool skip_blanks; @@ -1116,27 +1176,38 @@ proceed: diff_output("%c", *walk); } } + if (diff_format == D_SIDEBYSIDE) { + if (a > b) { + print_space(0, hw + padding , *pflags); + } else { + nc = fetch(ixold, a, b, f1, '\0', 1, *pflags); + print_space(nc, hw - nc + padding, *pflags); + } + diff_output("%c", (a>b)? '>' : ((c>d)? '<' : '|')); + print_space(hw + padding + 1 , padding, *pflags); + fetch(ixnew, c, d, f2, '\0', 0, *pflags); + diff_output("\n"); + } if (diff_format == D_NORMAL || diff_format == D_IFDEF) { fetch(ixold, a, b, f1, '<', 1, *pflags); if (a <= b && c <= d && diff_format == D_NORMAL) diff_output("---\n"); } - f = 0; - if (diff_format != D_GFORMAT) - f = fetch(ixnew, c, d, f2, diff_format == D_NORMAL ? '>' : '\0', 0, *pflags); - if (f != 0 && diff_format == D_EDIT) { + if (diff_format != D_GFORMAT && diff_format != D_SIDEBYSIDE) + fetch(ixnew, c, d, f2, diff_format == D_NORMAL ? '>' : '\0', 0, *pflags); + if (edoffset != 0 && diff_format == D_EDIT) { /* - * A non-zero return value for D_EDIT indicates that the + * A non-zero edoffset value for D_EDIT indicates that the * last line printed was a bare dot (".") that has been * escaped as ".." to prevent ed(1) from misinterpreting * it. We have to add a substitute command to change this * back and restart where we left off. */ diff_output(".\n"); - diff_output("%ds/.//\n", a + f - 1); - b = a + f - 1; + diff_output("%ds/.//\n", a + edoffset - 1); + b = a + edoffset - 1; a = b + 1; - c += f; + c += edoffset; goto restart; } if ((diff_format == D_EDIT || diff_format == D_REVERSE) && c <= d) @@ -1150,9 +1221,10 @@ proceed: static int fetch(long *f, int a, int b, FILE *lb, int ch, int oldfile, int flags) { - int i, j, c, lastc, col, nc; - int newcol; + int i, j, c, lastc, col, nc, newcol; + edoffset = 0; + nc = 0; /* * When doing #ifdef's, copy down to current line * if this is the first file, so that stuff makes it to output. @@ -1180,12 +1252,15 @@ fetch(long *f, int a, int b, FILE *lb, int ch, int old } for (i = a; i <= b; i++) { fseek(lb, f[i - 1], SEEK_SET); - nc = f[i] - f[i - 1]; - if ((diff_format != D_IFDEF && diff_format != D_GFORMAT) && + nc = (f[i] - f[i - 1]); + if (diff_format == D_SIDEBYSIDE && hw < nc) + nc = hw; + if ((diff_format != D_IFDEF && diff_format != D_GFORMAT) && ch != '\0') { diff_output("%c", ch); - if (Tflag && (diff_format == D_NORMAL || diff_format == D_CONTEXT - || diff_format == D_UNIFIED)) + if (Tflag && (diff_format == D_NORMAL || + diff_format == D_CONTEXT || + diff_format == D_UNIFIED)) diff_output("\t"); else if (diff_format != D_UNIFIED) diff_output(" "); @@ -1193,38 +1268,68 @@ fetch(long *f, int a, int b, FILE *lb, int ch, int old col = 0; for (j = 0, lastc = '\0'; j < nc; j++, lastc = c) { if ((c = getc(lb)) == EOF) { - if (diff_format == D_EDIT || diff_format == D_REVERSE || + if (diff_format == D_EDIT || + diff_format == D_REVERSE || diff_format == D_NREVERSE) warnx("No newline at end of file"); else diff_output("\n\\ No newline at end of " "file\n"); - return (0); + return col; } - if (c == '\t' && (flags & D_EXPANDTABS)) { - newcol = ((col/tabsize)+1)*tabsize; - do { - diff_output(" "); - } while (++col < newcol); + /* + * when using --side-by-side, col needs to be increased + * in any case to keep the columns aligned + */ + if (c == '\t') { + if (flags & D_EXPANDTABS) { + newcol = ((col/tabsize)+1)*tabsize; + do { + if (diff_format == D_SIDEBYSIDE) + j++; + diff_output(" "); + } while (++col < newcol && j < nc); + } else { + if (diff_format == D_SIDEBYSIDE) { + if ((j + tabsize) > nc) { + diff_output("%*s", + nc - j,""); + j = col = nc; + } else { + diff_output("\t"); + col += tabsize - 1; + j += tabsize - 1; + } + } else { + diff_output("\t"); + col++; + } + } } else { if (diff_format == D_EDIT && j == 1 && c == '\n' && lastc == '.') { /* * Don't print a bare "." line * since that will confuse ed(1). - * Print ".." instead and return, - * giving the caller an offset - * from which to restart. + * Print ".." instead and set the, + * global variable edoffset to an + * offset from which to restart. + * The caller must check the value + * of edoffset */ diff_output(".\n"); - return (i - a + 1); + edoffset = i - a + 1; + return edoffset; } - diff_output("%c", c); - col++; + /* when side-by-side, do not print a newline */ + if (diff_format != D_SIDEBYSIDE || c != '\n') { + diff_output("%c", c); + col++; + } } } } - return (0); + return col; } /* @@ -1577,4 +1682,26 @@ print_header(const char *file1, const char *file2) else diff_output("%s %s\t%s\n", diff_format == D_CONTEXT ? "---" : "+++", file2, buf2); -} +} + +/* + * Prints n number of space characters either by using tab + * or single space characters. + * nc is the preceding number of characters + */ +static void +print_space(int nc, int n, int flags) { + int i, col; + + col = n; + if ((flags & D_EXPANDTABS) == 0) { + /* first tabstop may be closer than tabsize */ + i = tabsize - (nc % tabsize); + while (col >= tabsize) { + diff_output("\t"); + col -= i; + i = tabsize; + } + } + diff_output("%*s", col, ""); +} \ No newline at end of file Modified: head/usr.bin/diff/tests/diff_test.sh ============================================================================== --- head/usr.bin/diff/tests/diff_test.sh Fri Feb 7 09:22:08 2020 (r357647) +++ head/usr.bin/diff/tests/diff_test.sh Fri Feb 7 10:17:13 2020 (r357648) @@ -103,8 +103,6 @@ group_format_body() side_by_side_body() { - atf_expect_fail "--side-by-side not currently implemented (bug # 219933)" - atf_check -o save:A printf "A\nB\nC\n" atf_check -o save:B printf "D\nB\nE\n" From owner-svn-src-all@freebsd.org Fri Feb 7 10:18:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7FD3E2485AC; Fri, 7 Feb 2020 10:18:02 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48DWTQ2nL7z4MtG; Fri, 7 Feb 2020 10:18:02 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5AE2B2EAB; Fri, 7 Feb 2020 10:18:02 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 017AI2OM086685; Fri, 7 Feb 2020 10:18:02 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 017AI2t9086684; Fri, 7 Feb 2020 10:18:02 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <202002071018.017AI2t9086684@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 7 Feb 2020 10:18:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357649 - head/usr.bin/diff X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/usr.bin/diff X-SVN-Commit-Revision: 357649 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2020 10:18:02 -0000 Author: bapt Date: Fri Feb 7 10:18:01 2020 New Revision: 357649 URL: https://svnweb.freebsd.org/changeset/base/357649 Log: Update diff(1) TODO removing what has been implemented Modified: head/usr.bin/diff/TODO Modified: head/usr.bin/diff/TODO ============================================================================== --- head/usr.bin/diff/TODO Fri Feb 7 10:17:13 2020 (r357648) +++ head/usr.bin/diff/TODO Fri Feb 7 10:18:01 2020 (r357649) @@ -1,9 +1,3 @@ --y: - * soc implemented it via calling sdiff directly, but some options are - incompatible so it is fragile - * just recommend the user to run sdiff directly and do not implement it - * make a libsdiff and use that directly to avoid duplicating the code - to be implemented: --horizon-lines --ignore-tab-expansion @@ -13,5 +7,3 @@ Will probably be not implemented: --GTYPE-group-format (partially implement - minimal) --LTYPE-line-format --help (We have a manpage already) ---suppress-common-lines: depends on -y (won't be implemented, as it conflicts -the way sdiff expects it and in any case we have sdiff for that feature) From owner-svn-src-all@freebsd.org Fri Feb 7 11:48:26 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C86B224A24D; Fri, 7 Feb 2020 11:48:26 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48DYTk4qjhz4SHP; Fri, 7 Feb 2020 11:48:26 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A0DD8423E; Fri, 7 Feb 2020 11:48:26 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 017BmQd3041232; Fri, 7 Feb 2020 11:48:26 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 017BmQcM041231; Fri, 7 Feb 2020 11:48:26 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <202002071148.017BmQcM041231@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Fri, 7 Feb 2020 11:48:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357650 - head/usr.sbin/mpsutil X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: head/usr.sbin/mpsutil X-SVN-Commit-Revision: 357650 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2020 11:48:26 -0000 Author: scottl Date: Fri Feb 7 11:48:26 2020 New Revision: 357650 URL: https://svnweb.freebsd.org/changeset/base/357650 Log: Touch up some of the iocfacts fields Modified: head/usr.sbin/mpsutil/mps_show.c Modified: head/usr.sbin/mpsutil/mps_show.c ============================================================================== --- head/usr.sbin/mpsutil/mps_show.c Fri Feb 7 10:18:01 2020 (r357649) +++ head/usr.sbin/mpsutil/mps_show.c Fri Feb 7 11:48:26 2020 (r357650) @@ -225,7 +225,7 @@ show_iocfacts(int ac, char **av) bzero(tmpbuf, sizeof(tmpbuf)); mps_parse_flags(facts->IOCCapabilities, IOCCAP, tmpbuf, sizeof(tmpbuf)); - printf(" MsgVersion: %02d.%02d\n", + printf(" MsgVersion: %d.%d\n", facts->MsgVersion >> 8, facts->MsgVersion & 0xff); printf(" MsgLength: %d\n", facts->MsgLength); printf(" Function: 0x%x\n", facts->Function); @@ -246,7 +246,9 @@ show_iocfacts(int ac, char **av) printf(" ProductID: 0x%x\n", facts->ProductID); printf(" IOCCapabilities: 0x%x %s\n", facts->IOCCapabilities, tmpbuf); - printf(" FWVersion: 0x%08x\n", facts->FWVersion.Word); + printf(" FWVersion: %02d.%02d.%02d.%02d\n", + facts->FWVersion.Struct.Major, facts->FWVersion.Struct.Minor, + facts->FWVersion.Struct.Unit, facts->FWVersion.Struct.Dev); printf(" IOCRequestFrameSize: %d\n", facts->IOCRequestFrameSize); printf(" MaxInitiators: %d\n", facts->MaxInitiators); printf(" MaxTargets: %d\n", facts->MaxTargets); From owner-svn-src-all@freebsd.org Fri Feb 7 12:15:41 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9851E24B4D1; Fri, 7 Feb 2020 12:15:41 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48DZ593Vlmz4TqP; Fri, 7 Feb 2020 12:15:41 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 55EC947B2; Fri, 7 Feb 2020 12:15:41 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 017CFfkO059170; Fri, 7 Feb 2020 12:15:41 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 017CFeRX059165; Fri, 7 Feb 2020 12:15:40 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <202002071215.017CFeRX059165@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Fri, 7 Feb 2020 12:15:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357651 - in head: sys/dev/mpr sys/dev/mps usr.sbin/mpsutil X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: in head: sys/dev/mpr sys/dev/mps usr.sbin/mpsutil X-SVN-Commit-Revision: 357651 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2020 12:15:41 -0000 Author: scottl Date: Fri Feb 7 12:15:39 2020 New Revision: 357651 URL: https://svnweb.freebsd.org/changeset/base/357651 Log: Advertise the MPI Message Version that's contained in the IOCFacts message in the sysctl block for the driver. mpsutil/mprutil needs this so it can know how big of a buffer to allocate when requesting the IOCFacts from the controller. This eliminates the kernel console messages about wrong allocation sizes. Reported by: imp Modified: head/sys/dev/mpr/mpr.c head/sys/dev/mpr/mprvar.h head/sys/dev/mps/mps.c head/sys/dev/mps/mpsvar.h head/usr.sbin/mpsutil/mps_cmd.c Modified: head/sys/dev/mpr/mpr.c ============================================================================== --- head/sys/dev/mpr/mpr.c Fri Feb 7 11:48:26 2020 (r357650) +++ head/sys/dev/mpr/mpr.c Fri Feb 7 12:15:39 2020 (r357651) @@ -520,6 +520,12 @@ mpr_iocfacts_allocate(struct mpr_softc *sc, uint8_t at sc->facts->FWVersion.Struct.Unit, sc->facts->FWVersion.Struct.Dev); + snprintf(sc->msg_version, sizeof(sc->msg_version), "%d.%d", + (sc->facts->MsgVersion & MPI2_IOCFACTS_MSGVERSION_MAJOR_MASK) >> + MPI2_IOCFACTS_MSGVERSION_MAJOR_SHIFT, + (sc->facts->MsgVersion & MPI2_IOCFACTS_MSGVERSION_MINOR_MASK) >> + MPI2_IOCFACTS_MSGVERSION_MINOR_SHIFT); + mpr_dprint(sc, MPR_INFO, "Firmware: %s, Driver: %s\n", sc->fw_version, MPR_DRIVER_VERSION); mpr_dprint(sc, MPR_INFO, @@ -1833,12 +1839,16 @@ mpr_setup_sysctl(struct mpr_softc *sc) "Total number of event frames allocated"); SYSCTL_ADD_STRING(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), - OID_AUTO, "firmware_version", CTLFLAG_RW, sc->fw_version, + OID_AUTO, "firmware_version", CTLFLAG_RD, sc->fw_version, strlen(sc->fw_version), "firmware version"); SYSCTL_ADD_STRING(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), - OID_AUTO, "driver_version", CTLFLAG_RW, MPR_DRIVER_VERSION, + OID_AUTO, "driver_version", CTLFLAG_RD, MPR_DRIVER_VERSION, strlen(MPR_DRIVER_VERSION), "driver version"); + + SYSCTL_ADD_STRING(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), + OID_AUTO, "msg_version", CTLFLAG_RD, sc->msg_version, + strlen(sc->msg_version), "message interface version"); SYSCTL_ADD_INT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, "io_cmds_active", CTLFLAG_RD, Modified: head/sys/dev/mpr/mprvar.h ============================================================================== --- head/sys/dev/mpr/mprvar.h Fri Feb 7 11:48:26 2020 (r357650) +++ head/sys/dev/mpr/mprvar.h Fri Feb 7 12:15:39 2020 (r357651) @@ -372,6 +372,7 @@ struct mpr_softc { struct sysctl_ctx_list sysctl_ctx; struct sysctl_oid *sysctl_tree; char fw_version[16]; + char msg_version[8]; struct mpr_command *commands; struct mpr_chain *chains; struct mpr_prp_page *prps; Modified: head/sys/dev/mps/mps.c ============================================================================== --- head/sys/dev/mps/mps.c Fri Feb 7 11:48:26 2020 (r357650) +++ head/sys/dev/mps/mps.c Fri Feb 7 12:15:39 2020 (r357651) @@ -498,6 +498,12 @@ mps_iocfacts_allocate(struct mps_softc *sc, uint8_t at sc->facts->FWVersion.Struct.Unit, sc->facts->FWVersion.Struct.Dev); + snprintf(sc->msg_version, sizeof(sc->msg_version), "%d.%d", + (sc->facts->MsgVersion & MPI2_IOCFACTS_MSGVERSION_MAJOR_MASK) >> + MPI2_IOCFACTS_MSGVERSION_MAJOR_SHIFT, + (sc->facts->MsgVersion & MPI2_IOCFACTS_MSGVERSION_MINOR_MASK) >> + MPI2_IOCFACTS_MSGVERSION_MINOR_SHIFT); + mps_dprint(sc, MPS_INFO, "Firmware: %s, Driver: %s\n", sc->fw_version, MPS_DRIVER_VERSION); mps_dprint(sc, MPS_INFO, "IOCCapabilities: %b\n", @@ -1742,12 +1748,16 @@ mps_setup_sysctl(struct mps_softc *sc) "Total number of event frames allocated"); SYSCTL_ADD_STRING(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), - OID_AUTO, "firmware_version", CTLFLAG_RW, sc->fw_version, + OID_AUTO, "firmware_version", CTLFLAG_RD, sc->fw_version, strlen(sc->fw_version), "firmware version"); SYSCTL_ADD_STRING(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), - OID_AUTO, "driver_version", CTLFLAG_RW, MPS_DRIVER_VERSION, + OID_AUTO, "driver_version", CTLFLAG_RD, MPS_DRIVER_VERSION, strlen(MPS_DRIVER_VERSION), "driver version"); + + SYSCTL_ADD_STRING(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), + OID_AUTO, "msg_version", CTLFLAG_RD, sc->msg_version, + strlen(sc->msg_version), "message interface version"); SYSCTL_ADD_INT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, "io_cmds_active", CTLFLAG_RD, Modified: head/sys/dev/mps/mpsvar.h ============================================================================== --- head/sys/dev/mps/mpsvar.h Fri Feb 7 11:48:26 2020 (r357650) +++ head/sys/dev/mps/mpsvar.h Fri Feb 7 12:15:39 2020 (r357651) @@ -330,6 +330,7 @@ struct mps_softc { struct sysctl_ctx_list sysctl_ctx; struct sysctl_oid *sysctl_tree; char fw_version[16]; + char msg_version[8]; struct mps_command *commands; struct mps_chain *chains; struct callout periodic; Modified: head/usr.sbin/mpsutil/mps_cmd.c ============================================================================== --- head/usr.sbin/mpsutil/mps_cmd.c Fri Feb 7 11:48:26 2020 (r357650) +++ head/usr.sbin/mpsutil/mps_cmd.c Fri Feb 7 12:15:39 2020 (r357651) @@ -724,23 +724,36 @@ mps_get_iocfacts(int fd) { MPI2_IOC_FACTS_REPLY *facts; MPI2_IOC_FACTS_REQUEST req; + char msgver[8], sysctlname[128]; + size_t len, factslen; int error; - facts = malloc(sizeof(MPI2_IOC_FACTS_REPLY)); + snprintf(sysctlname, sizeof(sysctlname), "dev.%s.%d.msg_version", + is_mps ? "mps" : "mpr", mps_unit); + + factslen = sizeof(MPI2_IOC_FACTS_REPLY); + len = sizeof(msgver); + error = sysctlbyname(sysctlname, msgver, &len, NULL, 0); + if (error == 0) { + if (strncmp(msgver, "2.6", sizeof(msgver)) == 0) + factslen += 4; + } + + facts = malloc(factslen); if (facts == NULL) { errno = ENOMEM; return (NULL); } - bzero(&req, sizeof(MPI2_IOC_FACTS_REQUEST)); + bzero(&req, factslen); req.Function = MPI2_FUNCTION_IOC_FACTS; #if 1 error = mps_pass_command(fd, &req, sizeof(MPI2_IOC_FACTS_REQUEST), - facts, sizeof(MPI2_IOC_FACTS_REPLY), NULL, 0, NULL, 0, 10); + facts, factslen, NULL, 0, NULL, 0, 10); #else error = mps_user_command(fd, &req, sizeof(MPI2_IOC_FACTS_REQUEST), - facts, sizeof(MPI2_IOC_FACTS_REPLY), NULL, 0, 0); + facts, factslen, NULL, 0, 0); #endif if (error) { free(facts); From owner-svn-src-all@freebsd.org Fri Feb 7 12:26:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E8D7024BB07; Fri, 7 Feb 2020 12:26:38 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48DZKp5yNrz4VYn; Fri, 7 Feb 2020 12:26:38 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C7BA249A9; Fri, 7 Feb 2020 12:26:38 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 017CQcot065259; Fri, 7 Feb 2020 12:26:38 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 017CQcJO065258; Fri, 7 Feb 2020 12:26:38 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <202002071226.017CQcJO065258@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 7 Feb 2020 12:26:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357652 - head/usr.bin/diff X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/usr.bin/diff X-SVN-Commit-Revision: 357652 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2020 12:26:39 -0000 Author: bapt Date: Fri Feb 7 12:26:38 2020 New Revision: 357652 URL: https://svnweb.freebsd.org/changeset/base/357652 Log: Fix most of the style warnings Modified: head/usr.bin/diff/diff.1 Modified: head/usr.bin/diff/diff.1 ============================================================================== --- head/usr.bin/diff/diff.1 Fri Feb 7 12:15:39 2020 (r357651) +++ head/usr.bin/diff/diff.1 Fri Feb 7 12:26:38 2020 (r357652) @@ -30,7 +30,7 @@ .\" @(#)diff.1 8.1 (Berkeley) 6/30/93 .\" $FreeBSD$ .\" -.Dd February 07, 2020 +.Dd February 7, 2020 .Dt DIFF 1 .Os .Sh NAME @@ -232,7 +232,7 @@ are marked with those added to .Ar file2 are marked -.Sq \+\ \& . +.Sq +\ \& . Lines which are changed from one file to the other are marked in both files with .Sq !\ \& . @@ -300,11 +300,12 @@ However, unlike with all lines to be changed (added and/or removed) are present in a single section. .It Fl y Fl -side-by-side -Output in two columns with a marker between them. The marker can be one +Output in two columns with a marker between them. +The marker can be one of the following: .Pp .Bl -tag -width Ds -offset indent -compact -.It space +.It space Corresponding lines are identical. .It '|' Corresponding lines are different. @@ -318,9 +319,7 @@ Files differ and only the second file contains the lin Comparison options: .Bl -tag -width Ds .It Fl a -text -Treat all files as -.Tn ASCII -text. +Treat all files as ASCII text. Normally .Nm will simply print @@ -394,7 +393,8 @@ will compare equal to .It Fl W Ar number Fl -width Ar number Output at most .Ar number -columns when using side by side format. The default value is 130. +columns when using side by side format. +The default value is 130. .It Fl -changed-group-format Ar GFMT Format input groups in the provided .Pp @@ -473,9 +473,8 @@ Binary files which differ, common subdirectories, and files which appear in only one directory are described as such. In directory mode only regular files and directories are compared. -If a non-regular file such as a device special file or -.Tn FIFO -is encountered, a diagnostic message is printed. +If a non-regular file such as a device special file or FIFO is encountered, +a diagnostic message is printed. .Pp If only one of .Ar file1 @@ -596,7 +595,7 @@ pairs (where num1 = num2) are abbreviated as a single number. .Sh FILES .Bl -tag -width /tmp/diff.XXXXXXXX -compact -.It Pa /tmp/diff. Ns Ar XXXXXXXX +.It Pa /tmp/diff.XXXXXXXX Temporary file used when comparing a device or the standard input. Note that the temporary file is unlinked as soon as it is created so it will not show up in a directory listing. From owner-svn-src-all@freebsd.org Fri Feb 7 14:36:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8B1EF24DDA7; Fri, 7 Feb 2020 14:36:30 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48DdCf2zN5z4cLB; Fri, 7 Feb 2020 14:36:30 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5CDC36184; Fri, 7 Feb 2020 14:36:30 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 017EaUI2043633; Fri, 7 Feb 2020 14:36:30 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 017EaTO7043628; Fri, 7 Feb 2020 14:36:29 GMT (envelope-from br@FreeBSD.org) Message-Id: <202002071436.017EaTO7043628@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Fri, 7 Feb 2020 14:36:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357653 - in head/sys/dev: xdma xilinx X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys/dev: xdma xilinx X-SVN-Commit-Revision: 357653 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2020 14:36:30 -0000 Author: br Date: Fri Feb 7 14:36:28 2020 New Revision: 357653 URL: https://svnweb.freebsd.org/changeset/base/357653 Log: Fix xae(4) driver attachement on the Government Furnished Equipment (GFE) riscv cores. GFE cores come with standard DTS file that lacks standard 'dmas =' property, which means xae(4) could not find a DMA controller to use. The 'dmas' property could not be added to the DTS file because the ethernet controller and DMA engine parts in Linux are implemented in a single driver. Instead of 'dmas' property the standard Xilinx 'axistream-connected' property is provided, so fallback to use it instead. Suggested by: James Clarke Reviewed by: James Clarke Sponsored by: DARPA, AFRL Modified: head/sys/dev/xdma/xdma.c head/sys/dev/xdma/xdma.h head/sys/dev/xilinx/axidma.c head/sys/dev/xilinx/axidma.h head/sys/dev/xilinx/if_xae.c Modified: head/sys/dev/xdma/xdma.c ============================================================================== --- head/sys/dev/xdma/xdma.c Fri Feb 7 12:26:38 2020 (r357652) +++ head/sys/dev/xdma/xdma.c Fri Feb 7 14:36:28 2020 (r357653) @@ -511,6 +511,24 @@ xdma_ofw_get(device_t dev, const char *prop) #endif /* + * Allocate xdma controller. + */ +xdma_controller_t * +xdma_get(device_t dev, device_t dma_dev) +{ + xdma_controller_t *xdma; + + xdma = malloc(sizeof(struct xdma_controller), + M_XDMA, M_WAITOK | M_ZERO); + xdma->dev = dev; + xdma->dma_dev = dma_dev; + + TAILQ_INIT(&xdma->channels); + + return (xdma); +} + +/* * Free xDMA controller object. */ int Modified: head/sys/dev/xdma/xdma.h ============================================================================== --- head/sys/dev/xdma/xdma.h Fri Feb 7 12:26:38 2020 (r357652) +++ head/sys/dev/xdma/xdma.h Fri Feb 7 14:36:28 2020 (r357653) @@ -231,6 +231,7 @@ static MALLOC_DEFINE(M_XDMA, "xdma", "xDMA framework") /* xDMA controller ops */ xdma_controller_t *xdma_ofw_get(device_t dev, const char *prop); +xdma_controller_t *xdma_get(device_t dev, device_t dma_dev); int xdma_put(xdma_controller_t *xdma); vmem_t * xdma_get_memory(device_t dev); void xdma_put_memory(vmem_t *vmem); Modified: head/sys/dev/xilinx/axidma.c ============================================================================== --- head/sys/dev/xilinx/axidma.c Fri Feb 7 12:26:38 2020 (r357652) +++ head/sys/dev/xilinx/axidma.c Fri Feb 7 14:36:28 2020 (r357653) @@ -61,6 +61,15 @@ __FBSDID("$FreeBSD$"); #include "xdma_if.h" +#define READ4(_sc, _reg) \ + bus_space_read_4(_sc->bst, _sc->bsh, _reg) +#define WRITE4(_sc, _reg, _val) \ + bus_space_write_4(_sc->bst, _sc->bsh, _reg, _val) +#define READ8(_sc, _reg) \ + bus_space_read_8(_sc->bst, _sc->bsh, _reg) +#define WRITE8(_sc, _reg, _val) \ + bus_space_write_8(_sc->bst, _sc->bsh, _reg, _val) + #define AXIDMA_DEBUG #undef AXIDMA_DEBUG @@ -70,16 +79,7 @@ __FBSDID("$FreeBSD$"); #define dprintf(fmt, ...) #endif -#define AXIDMA_NCHANNELS 2 -#define AXIDMA_DESCS_NUM 512 -#define AXIDMA_TX_CHAN 0 -#define AXIDMA_RX_CHAN 1 - extern struct bus_space memmap_bus; - -struct axidma_fdt_data { - int id; -}; struct axidma_channel { struct axidma_softc *sc; Modified: head/sys/dev/xilinx/axidma.h ============================================================================== --- head/sys/dev/xilinx/axidma.h Fri Feb 7 12:26:38 2020 (r357652) +++ head/sys/dev/xilinx/axidma.h Fri Feb 7 14:36:28 2020 (r357653) @@ -60,14 +60,10 @@ #define AXI_TAILDESC_MSB(n) (0x14 + 0x30 * (n)) /* Tail Descriptor Pointer. Upper 32 bits of address. */ #define AXI_SG_CTL 0x2C /* Scatter/Gather User and Cache */ -#define READ4(_sc, _reg) \ - bus_space_read_4(_sc->bst, _sc->bsh, _reg) -#define WRITE4(_sc, _reg, _val) \ - bus_space_write_4(_sc->bst, _sc->bsh, _reg, _val) -#define READ8(_sc, _reg) \ - bus_space_read_8(_sc->bst, _sc->bsh, _reg) -#define WRITE8(_sc, _reg, _val) \ - bus_space_write_8(_sc->bst, _sc->bsh, _reg, _val) +#define AXIDMA_NCHANNELS 2 +#define AXIDMA_DESCS_NUM 512 +#define AXIDMA_TX_CHAN 0 +#define AXIDMA_RX_CHAN 1 struct axidma_desc { uint32_t next; @@ -91,6 +87,10 @@ struct axidma_desc { uint32_t app3; uint32_t app4; uint32_t reserved[3]; +}; + +struct axidma_fdt_data { + int id; }; #endif /* !_DEV_XILINX_AXIDMA_H_ */ Modified: head/sys/dev/xilinx/if_xae.c ============================================================================== --- head/sys/dev/xilinx/if_xae.c Fri Feb 7 12:26:38 2020 (r357652) +++ head/sys/dev/xilinx/if_xae.c Fri Feb 7 14:36:28 2020 (r357653) @@ -64,6 +64,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include "miibus_if.h" #define READ4(_sc, _reg) \ @@ -775,6 +777,68 @@ xae_phy_fixup(struct xae_softc *sc) } static int +get_xdma_std(struct xae_softc *sc) +{ + + sc->xdma_tx = xdma_ofw_get(sc->dev, "tx"); + if (sc->xdma_tx == NULL) + return (ENXIO); + + sc->xdma_rx = xdma_ofw_get(sc->dev, "rx"); + if (sc->xdma_rx == NULL) { + xdma_put(sc->xdma_tx); + return (ENXIO); + } + + return (0); +} + +static int +get_xdma_axistream(struct xae_softc *sc) +{ + struct axidma_fdt_data *data; + device_t dma_dev; + phandle_t node; + pcell_t prop; + size_t len; + + node = ofw_bus_get_node(sc->dev); + len = OF_getencprop(node, "axistream-connected", &prop, sizeof(prop)); + if (len != sizeof(prop)) { + device_printf(sc->dev, + "%s: Couldn't get axistream-connected prop.\n", __func__); + return (ENXIO); + } + dma_dev = OF_device_from_xref(prop); + if (dma_dev == NULL) { + device_printf(sc->dev, "Could not get DMA device by xref.\n"); + return (ENXIO); + } + + sc->xdma_tx = xdma_get(sc->dev, dma_dev); + if (sc->xdma_tx == NULL) { + device_printf(sc->dev, "Could not find DMA controller.\n"); + return (ENXIO); + } + data = malloc(sizeof(struct axidma_fdt_data), + M_DEVBUF, (M_WAITOK | M_ZERO)); + data->id = AXIDMA_TX_CHAN; + sc->xdma_tx->data = data; + + sc->xdma_rx = xdma_get(sc->dev, dma_dev); + if (sc->xdma_rx == NULL) { + device_printf(sc->dev, "Could not find DMA controller.\n"); + return (ENXIO); + } + data = malloc(sizeof(struct axidma_fdt_data), + M_DEVBUF, (M_WAITOK | M_ZERO)); + data->id = AXIDMA_RX_CHAN; + sc->xdma_rx->data = data; + + return (0); +} + +static int setup_xdma(struct xae_softc *sc) { device_t dev; @@ -784,15 +848,16 @@ setup_xdma(struct xae_softc *sc) dev = sc->dev; /* Get xDMA controller */ - sc->xdma_tx = xdma_ofw_get(sc->dev, "tx"); - if (sc->xdma_tx == NULL) { - device_printf(dev, "Could not find DMA controller.\n"); - return (ENXIO); + error = get_xdma_std(sc); + + if (error) { + device_printf(sc->dev, + "Fallback to axistream-connected property\n"); + error = get_xdma_axistream(sc); } - sc->xdma_rx = xdma_ofw_get(sc->dev, "rx"); - if (sc->xdma_rx == NULL) { - device_printf(dev, "Could not find DMA controller.\n"); + if (error) { + device_printf(dev, "Could not find xDMA controllers.\n"); return (ENXIO); } From owner-svn-src-all@freebsd.org Fri Feb 7 15:14:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 79BA124EA67; Fri, 7 Feb 2020 15:14:30 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Df3V2b8Jz4fDT; Fri, 7 Feb 2020 15:14:30 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5403568C5; Fri, 7 Feb 2020 15:14:30 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 017FEUjr067177; Fri, 7 Feb 2020 15:14:30 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 017FETub067173; Fri, 7 Feb 2020 15:14:29 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <202002071514.017FETub067173@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 7 Feb 2020 15:14:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357654 - in head: lib/libc/xdr sys/xdr X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: in head: lib/libc/xdr sys/xdr X-SVN-Commit-Revision: 357654 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2020 15:14:30 -0000 Author: pfg Date: Fri Feb 7 15:14:29 2020 New Revision: 357654 URL: https://svnweb.freebsd.org/changeset/base/357654 Log: typo: s/impelmentation/implementation/. No functional change Modified: head/lib/libc/xdr/xdr_array.c head/lib/libc/xdr/xdr_reference.c head/sys/xdr/xdr_array.c head/sys/xdr/xdr_reference.c Modified: head/lib/libc/xdr/xdr_array.c ============================================================================== --- head/lib/libc/xdr/xdr_array.c Fri Feb 7 14:36:28 2020 (r357653) +++ head/lib/libc/xdr/xdr_array.c Fri Feb 7 15:14:29 2020 (r357654) @@ -41,7 +41,7 @@ static char *sccsid = "@(#)xdr_array.c 2.1 88/07/29 4. __FBSDID("$FreeBSD$"); /* - * xdr_array.c, Generic XDR routines impelmentation. + * xdr_array.c, Generic XDR routines implementation. * * These are the "non-trivial" xdr primitives used to serialize and de-serialize * arrays. See xdr.h for more info on the interface to xdr. Modified: head/lib/libc/xdr/xdr_reference.c ============================================================================== --- head/lib/libc/xdr/xdr_reference.c Fri Feb 7 14:36:28 2020 (r357653) +++ head/lib/libc/xdr/xdr_reference.c Fri Feb 7 15:14:29 2020 (r357654) @@ -41,7 +41,7 @@ static char *sccsid = "@(#)xdr_reference.c 2.1 88/07/2 __FBSDID("$FreeBSD$"); /* - * xdr_reference.c, Generic XDR routines impelmentation. + * xdr_reference.c, Generic XDR routines implementation. * * These are the "non-trivial" xdr primitives used to serialize and de-serialize * "pointers". See xdr.h for more info on the interface to xdr. Modified: head/sys/xdr/xdr_array.c ============================================================================== --- head/sys/xdr/xdr_array.c Fri Feb 7 14:36:28 2020 (r357653) +++ head/sys/xdr/xdr_array.c Fri Feb 7 15:14:29 2020 (r357654) @@ -37,7 +37,7 @@ static char *sccsid = "@(#)xdr_array.c 2.1 88/07/29 4. __FBSDID("$FreeBSD$"); /* - * xdr_array.c, Generic XDR routines impelmentation. + * xdr_array.c, Generic XDR routines implementation. * * Copyright (C) 1984, Sun Microsystems, Inc. * Modified: head/sys/xdr/xdr_reference.c ============================================================================== --- head/sys/xdr/xdr_reference.c Fri Feb 7 14:36:28 2020 (r357653) +++ head/sys/xdr/xdr_reference.c Fri Feb 7 15:14:29 2020 (r357654) @@ -37,7 +37,7 @@ static char *sccsid = "@(#)xdr_reference.c 2.1 88/07/2 __FBSDID("$FreeBSD$"); /* - * xdr_reference.c, Generic XDR routines impelmentation. + * xdr_reference.c, Generic XDR routines implementation. * * Copyright (C) 1987, Sun Microsystems, Inc. * From owner-svn-src-all@freebsd.org Fri Feb 7 15:16:05 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 343BB24EB20; Fri, 7 Feb 2020 15:16:05 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Df5K000vz4fS1; Fri, 7 Feb 2020 15:16:04 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EE9A368C7; Fri, 7 Feb 2020 15:16:04 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 017FG4JJ067423; Fri, 7 Feb 2020 15:16:04 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 017FG43k067422; Fri, 7 Feb 2020 15:16:04 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <202002071516.017FG43k067422@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 7 Feb 2020 15:16:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357655 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 357655 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2020 15:16:05 -0000 Author: pfg Date: Fri Feb 7 15:16:04 2020 New Revision: 357655 URL: https://svnweb.freebsd.org/changeset/base/357655 Log: typo: stray spaces. No functional change Modified: head/sys/net/ethernet.h Modified: head/sys/net/ethernet.h ============================================================================== --- head/sys/net/ethernet.h Fri Feb 7 15:14:29 2020 (r357654) +++ head/sys/net/ethernet.h Fri Feb 7 15:16:04 2020 (r357655) @@ -344,7 +344,7 @@ struct ether_vlan_header { #define ETHERTYPE_SLOW 0x8809 /* 802.3ad link aggregation (LACP) */ #define ETHERTYPE_PPP 0x880B /* PPP (obsolete by PPPoE) */ #define ETHERTYPE_HITACHI 0x8820 /* Hitachi Cable (Optoelectronic Systems Laboratory) */ -#define ETHERTYPE_TEST 0x8822 /* Network Conformance Testing */ +#define ETHERTYPE_TEST 0x8822 /* Network Conformance Testing */ #define ETHERTYPE_MPLS 0x8847 /* MPLS Unicast */ #define ETHERTYPE_MPLS_MCAST 0x8848 /* MPLS Multicast */ #define ETHERTYPE_AXIS 0x8856 /* Axis Communications AB proprietary bootstrap/config */ From owner-svn-src-all@freebsd.org Fri Feb 7 15:27:58 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 43EAC24ED48; Fri, 7 Feb 2020 15:27:58 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48DfM20qqkz4ftr; Fri, 7 Feb 2020 15:27:58 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 137326A8E; Fri, 7 Feb 2020 15:27:58 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 017FRvdp073831; Fri, 7 Feb 2020 15:27:57 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 017FRvgd073830; Fri, 7 Feb 2020 15:27:57 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202002071527.017FRvgd073830@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 7 Feb 2020 15:27:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r357656 - stable/11/sys/dev/acpica X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/dev/acpica X-SVN-Commit-Revision: 357656 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2020 15:27:58 -0000 Author: mav Date: Fri Feb 7 15:27:57 2020 New Revision: 357656 URL: https://svnweb.freebsd.org/changeset/base/357656 Log: MFC r326956 (by cem): Implement ACPI CPU support when Processor object is not present By the ACPI standard (ACPI 5 chapter 8.4 Declaring Processors) Processors can be implemented in 2 distinct ways: * Through a Processor object type (which provides P_BLK) * Through a Device object type Prior to this change, the FreeBSD driver only supported the former. AMD Epyc / Poweredge systems we are testing both implement the latter only. Add the missing support. Because P_BLK is not defined in the device object case, C-states entering must be completely controlled via _CST methods rather than P_LVL2/3. John Baldwin points out that ACPI 6.0 formally deprecates the Processor keyword, so eventually processors will only be enumerated as Device objects. Modified: stable/11/sys/dev/acpica/acpi_cpu.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/acpica/acpi_cpu.c ============================================================================== --- stable/11/sys/dev/acpica/acpi_cpu.c Fri Feb 7 15:16:04 2020 (r357655) +++ stable/11/sys/dev/acpica/acpi_cpu.c Fri Feb 7 15:27:57 2020 (r357656) @@ -140,6 +140,8 @@ struct acpi_cpu_device { #define CST_FFH_MWAIT_HW_COORD 0x0001 #define CST_FFH_MWAIT_BM_AVOID 0x0002 +#define CPUDEV_DEVICE_ID "ACPI0007" + /* Allow users to ignore processor orders in MADT. */ static int cpu_unordered; SYSCTL_INT(_debug_acpi, OID_AUTO, cpu_unordered, CTLFLAG_RDTUN, @@ -236,44 +238,61 @@ MODULE_DEPEND(cpu, acpi, 1, 1, 1); static int acpi_cpu_probe(device_t dev) { + static char *cpudev_ids[] = { CPUDEV_DEVICE_ID, NULL }; int acpi_id, cpu_id; ACPI_BUFFER buf; ACPI_HANDLE handle; ACPI_OBJECT *obj; ACPI_STATUS status; + ACPI_OBJECT_TYPE type; - if (acpi_disabled("cpu") || acpi_get_type(dev) != ACPI_TYPE_PROCESSOR || - acpi_cpu_disabled) + if (acpi_disabled("cpu") || acpi_cpu_disabled) return (ENXIO); + type = acpi_get_type(dev); + if (type != ACPI_TYPE_PROCESSOR && type != ACPI_TYPE_DEVICE) + return (ENXIO); + if (type == ACPI_TYPE_DEVICE && + ACPI_ID_PROBE(device_get_parent(dev), dev, cpudev_ids) == NULL) + return (ENXIO); handle = acpi_get_handle(dev); if (cpu_softc == NULL) cpu_softc = malloc(sizeof(struct acpi_cpu_softc *) * (mp_maxid + 1), M_TEMP /* XXX */, M_WAITOK | M_ZERO); - /* Get our Processor object. */ - buf.Pointer = NULL; - buf.Length = ACPI_ALLOCATE_BUFFER; - status = AcpiEvaluateObject(handle, NULL, NULL, &buf); - if (ACPI_FAILURE(status)) { - device_printf(dev, "probe failed to get Processor obj - %s\n", - AcpiFormatException(status)); - return (ENXIO); - } - obj = (ACPI_OBJECT *)buf.Pointer; - if (obj->Type != ACPI_TYPE_PROCESSOR) { - device_printf(dev, "Processor object has bad type %d\n", obj->Type); + if (type == ACPI_TYPE_PROCESSOR) { + /* Get our Processor object. */ + buf.Pointer = NULL; + buf.Length = ACPI_ALLOCATE_BUFFER; + status = AcpiEvaluateObject(handle, NULL, NULL, &buf); + if (ACPI_FAILURE(status)) { + device_printf(dev, "probe failed to get Processor obj - %s\n", + AcpiFormatException(status)); + return (ENXIO); + } + obj = (ACPI_OBJECT *)buf.Pointer; + if (obj->Type != ACPI_TYPE_PROCESSOR) { + device_printf(dev, "Processor object has bad type %d\n", + obj->Type); + AcpiOsFree(obj); + return (ENXIO); + } + + /* + * Find the processor associated with our unit. We could use the + * ProcId as a key, however, some boxes do not have the same values + * in their Processor object as the ProcId values in the MADT. + */ + acpi_id = obj->Processor.ProcId; AcpiOsFree(obj); - return (ENXIO); + } else { + status = acpi_GetInteger(handle, "_UID", &acpi_id); + if (ACPI_FAILURE(status)) { + device_printf(dev, "Device object has bad value - %s\n", + AcpiFormatException(status)); + return (ENXIO); + } } - - /* - * Find the processor associated with our unit. We could use the - * ProcId as a key, however, some boxes do not have the same values - * in their Processor object as the ProcId values in the MADT. - */ - acpi_id = obj->Processor.ProcId; - AcpiOsFree(obj); if (acpi_pcpu_get_id(dev, &acpi_id, &cpu_id) != 0) return (ENXIO); @@ -325,19 +344,32 @@ acpi_cpu_attach(device_t dev) cpu_smi_cmd = AcpiGbl_FADT.SmiCommand; cpu_cst_cnt = AcpiGbl_FADT.CstControl; - buf.Pointer = NULL; - buf.Length = ACPI_ALLOCATE_BUFFER; - status = AcpiEvaluateObject(sc->cpu_handle, NULL, NULL, &buf); - if (ACPI_FAILURE(status)) { - device_printf(dev, "attach failed to get Processor obj - %s\n", - AcpiFormatException(status)); - return (ENXIO); + if (acpi_get_type(dev) == ACPI_TYPE_PROCESSOR) { + buf.Pointer = NULL; + buf.Length = ACPI_ALLOCATE_BUFFER; + status = AcpiEvaluateObject(sc->cpu_handle, NULL, NULL, &buf); + if (ACPI_FAILURE(status)) { + device_printf(dev, "attach failed to get Processor obj - %s\n", + AcpiFormatException(status)); + return (ENXIO); + } + obj = (ACPI_OBJECT *)buf.Pointer; + sc->cpu_p_blk = obj->Processor.PblkAddress; + sc->cpu_p_blk_len = obj->Processor.PblkLength; + sc->cpu_acpi_id = obj->Processor.ProcId; + AcpiOsFree(obj); + } else { + KASSERT(acpi_get_type(dev) == ACPI_TYPE_DEVICE, + ("Unexpected ACPI object")); + status = acpi_GetInteger(sc->cpu_handle, "_UID", &sc->cpu_acpi_id); + if (ACPI_FAILURE(status)) { + device_printf(dev, "Device object has bad value - %s\n", + AcpiFormatException(status)); + return (ENXIO); + } + sc->cpu_p_blk = 0; + sc->cpu_p_blk_len = 0; } - obj = (ACPI_OBJECT *)buf.Pointer; - sc->cpu_p_blk = obj->Processor.PblkAddress; - sc->cpu_p_blk_len = obj->Processor.PblkLength; - sc->cpu_acpi_id = obj->Processor.ProcId; - AcpiOsFree(obj); ACPI_DEBUG_PRINT((ACPI_DB_INFO, "acpi_cpu%d: P_BLK at %#x/%d\n", device_get_unit(dev), sc->cpu_p_blk, sc->cpu_p_blk_len)); From owner-svn-src-all@freebsd.org Fri Feb 7 15:50:48 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7C0A124F316; Fri, 7 Feb 2020 15:50:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48DfsN2pJ0z3CRr; Fri, 7 Feb 2020 15:50:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5A0CF6E58; Fri, 7 Feb 2020 15:50:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 017FomlO085742; Fri, 7 Feb 2020 15:50:48 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 017Fol6V085739; Fri, 7 Feb 2020 15:50:47 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202002071550.017Fol6V085739@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 7 Feb 2020 15:50:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357657 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Commit-Revision: 357657 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2020 15:50:48 -0000 Author: mav Date: Fri Feb 7 15:50:47 2020 New Revision: 357657 URL: https://svnweb.freebsd.org/changeset/base/357657 Log: Remove duplicate dbufs accounting. Since AVL already has embedded element counter, use dn_dbufs_count only for dbufs not counted there (bonus buffers) and just add them. This removes two atomics per dbuf life cycle. According to profiler it reduces time spent by dbuf_destroy() inside bottlenecked dbuf_evict_thread() from 13.36% to 9.20% of the core. This counter is used only on illumos, so for FreeBSD it was just a waste of time. MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Fri Feb 7 15:27:57 2020 (r357656) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Fri Feb 7 15:50:47 2020 (r357657) @@ -2375,7 +2375,6 @@ dbuf_destroy(dmu_buf_impl_t *db) if (needlock) mutex_enter(&dn->dn_dbufs_mtx); avl_remove(&dn->dn_dbufs, db); - atomic_dec_32(&dn->dn_dbufs_count); membar_producer(); DB_DNODE_EXIT(db); if (needlock) @@ -2600,7 +2599,6 @@ dbuf_create(dnode_t *dn, uint8_t level, uint64_t blkid ASSERT(dn->dn_object == DMU_META_DNODE_OBJECT || zfs_refcount_count(&dn->dn_holds) > 0); (void) zfs_refcount_add(&dn->dn_holds, db); - atomic_inc_32(&dn->dn_dbufs_count); dprintf_dbuf(db, "db=%p\n", db); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Fri Feb 7 15:27:57 2020 (r357656) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Fri Feb 7 15:50:47 2020 (r357657) @@ -998,7 +998,7 @@ dnode_move(void *buf, void *newbuf, size_t size, void */ refcount = zfs_refcount_count(&odn->dn_holds); ASSERT(refcount >= 0); - dbufs = odn->dn_dbufs_count; + dbufs = DN_DBUFS_COUNT(odn); /* We can't have more dbufs than dnode holds. */ ASSERT3U(dbufs, <=, refcount); @@ -1025,7 +1025,7 @@ dnode_move(void *buf, void *newbuf, size_t size, void list_link_replace(&odn->dn_link, &ndn->dn_link); /* If the dnode was safe to move, the refcount cannot have changed. */ ASSERT(refcount == zfs_refcount_count(&ndn->dn_holds)); - ASSERT(dbufs == ndn->dn_dbufs_count); + ASSERT(dbufs == DN_DBUFS_COUNT(ndn)); zrl_exit(&ndn->dn_handle->dnh_zrlock); /* handle has moved */ mutex_exit(&os->os_lock); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h Fri Feb 7 15:27:57 2020 (r357656) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h Fri Feb 7 15:50:47 2020 (r357657) @@ -346,6 +346,13 @@ struct dnode { }; /* + * Since AVL already has embedded element counter, use dn_dbufs_count + * only for dbufs not counted there (bonus buffers) and just add them. + */ +#define DN_DBUFS_COUNT(dn) ((dn)->dn_dbufs_count + \ + avl_numnodes(&(dn)->dn_dbufs)) + +/* * Adds a level of indirection between the dbuf and the dnode to avoid * iterating descendent dbufs in dnode_move(). Handles are not allocated * individually, but as an array of child dnodes in dnode_hold_impl(). From owner-svn-src-all@freebsd.org Fri Feb 7 16:22:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DD4E324FD31; Fri, 7 Feb 2020 16:22:02 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48DgYQ5bZyz3FHK; Fri, 7 Feb 2020 16:22:02 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB6B57651; Fri, 7 Feb 2020 16:22:02 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 017GM2ep006078; Fri, 7 Feb 2020 16:22:02 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 017GM2UI006077; Fri, 7 Feb 2020 16:22:02 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202002071622.017GM2UI006077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 7 Feb 2020 16:22:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357658 - head/sys/amd64/include X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/amd64/include X-SVN-Commit-Revision: 357658 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2020 16:22:02 -0000 Author: mjg Date: Fri Feb 7 16:22:02 2020 New Revision: 357658 URL: https://svnweb.freebsd.org/changeset/base/357658 Log: amd64: clean up counter(9) - stop open-coding access to per-cpu data, use common macros instead - consistently use counter_t type where appropriate Modified: head/sys/amd64/include/counter.h Modified: head/sys/amd64/include/counter.h ============================================================================== --- head/sys/amd64/include/counter.h Fri Feb 7 15:50:47 2020 (r357657) +++ head/sys/amd64/include/counter.h Fri Feb 7 16:22:02 2020 (r357658) @@ -40,21 +40,21 @@ #ifdef IN_SUBR_COUNTER_C static inline uint64_t -counter_u64_read_one(uint64_t *p, int cpu) +counter_u64_read_one(counter_u64_t c, int cpu) { - return (*(uint64_t *)((char *)p + UMA_PCPU_ALLOC_SIZE * cpu)); + return (*zpcpu_get_cpu(c, cpu)); } static inline uint64_t -counter_u64_fetch_inline(uint64_t *p) +counter_u64_fetch_inline(uint64_t *c) { uint64_t r; - int i; + int cpu; r = 0; - CPU_FOREACH(i) - r += counter_u64_read_one((uint64_t *)p, i); + CPU_FOREACH(cpu) + r += counter_u64_read_one(c, cpu); return (r); } @@ -62,9 +62,10 @@ counter_u64_fetch_inline(uint64_t *p) static void counter_u64_zero_one_cpu(void *arg) { + counter_u64_t c; - *((uint64_t *)((char *)arg + UMA_PCPU_ALLOC_SIZE * - PCPU_GET(cpuid))) = 0; + c = arg; + *(zpcpu_get(c)) = 0; } static inline void From owner-svn-src-all@freebsd.org Fri Feb 7 17:47:08 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C328E2294D8; Fri, 7 Feb 2020 17:47:08 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48DjRc4qpPz3Jsk; Fri, 7 Feb 2020 17:47:08 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9C8D38539; Fri, 7 Feb 2020 17:47:08 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 017Hl8Kt057187; Fri, 7 Feb 2020 17:47:08 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 017Hl8ms057186; Fri, 7 Feb 2020 17:47:08 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202002071747.017Hl8ms057186@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 7 Feb 2020 17:47:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357659 - head/sys/geom X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/geom X-SVN-Commit-Revision: 357659 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2020 17:47:08 -0000 Author: imp Date: Fri Feb 7 17:47:08 2020 New Revision: 357659 URL: https://svnweb.freebsd.org/changeset/base/357659 Log: Supress not supported message For the moment, supress the operation not supported messages at this level. In the fullness of time, we will have better error tracking so we can diagnose issues in the future. Reviewed by: scottl@ Modified: head/sys/geom/geom_vfs.c Modified: head/sys/geom/geom_vfs.c ============================================================================== --- head/sys/geom/geom_vfs.c Fri Feb 7 16:22:02 2020 (r357658) +++ head/sys/geom/geom_vfs.c Fri Feb 7 17:47:08 2020 (r357659) @@ -139,7 +139,7 @@ g_vfs_done(struct bio *bip) cp = bip->bio_from; sc = cp->geom->softc; - if (bip->bio_error) + if (bip->bio_error && bip->bio_error != EOPNOTSUPP) g_print_bio("g_vfs_done():", bip, "error = %d", bip->bio_error); bp->b_error = bip->bio_error; From owner-svn-src-all@freebsd.org Fri Feb 7 18:21:33 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1520722A2FD for ; Fri, 7 Feb 2020 18:21:33 +0000 (UTC) (envelope-from christina.evans@globaltradeshowleads.com) Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48DkCJ4GMDz3LvN for ; Fri, 7 Feb 2020 18:21:32 +0000 (UTC) (envelope-from christina.evans@globaltradeshowleads.com) Received: by mail-pf1-x441.google.com with SMTP id s1so167998pfh.10 for ; Fri, 07 Feb 2020 10:21:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:return-receipt-to:from:to:subject:date :message-id:mime-version:thread-index:importance:content-language :sensitivity:disposition-notification-to; bh=S64vCMs2g08XU+0lCI9jWIkxlYs+ENDZf3d8MB1koxg=; b=QmE/lUm/ipRx6fU8BdFMQYHTY2ORk+cZ1hgKqWtwFMpuqimH5AS4kCOKesXoSquhpu XrKnrVkv5fnSSEjXOYTJeMIf77/T/D5YOYTOWCpxgygPMW60xjXXnHc5zRGxGUS8FIi0 axsmf+Lg52FamjMRgeSlNyCekJvLjbVFSWcMIhP8A+dNaN5abuDf7YEAq85v0SNtm4QD pG+BztIuiKmjvfB2YxGN4OvXtUwxx5twIDataADKCbuWq6/vrH4ZV6GYMvgCzLS15LDV DFm240XaizXCy8pKcGn6/2KNKLjWROC+IxDl4CL5nEbU/Bw434VemxQUTbOPsR6wxjy2 I3+g== X-Gm-Message-State: APjAAAUP8nO5QldAApUj1vvo5hpZUqIFZT3Cj1tvt1Et8DQxvCSIL+0Q J5fgznbXs0wYYlDpdLOIV1CU0S189Q== X-Google-Smtp-Source: APXvYqxtN9eMltoWAZVO4XuIl8IYddLfPtgszHOF7Clz+T0vi57OdaemrB7nxZyr+MxPK69nONSy8g== X-Received: by 2002:a63:f142:: with SMTP id o2mr485301pgk.181.1581099690936; Fri, 07 Feb 2020 10:21:30 -0800 (PST) Received: from EMS2 ([122.172.166.242]) by smtp.gmail.com with ESMTPSA id s7sm3441919pjk.22.2020.02.07.10.21.26 for (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 07 Feb 2020 10:21:30 -0800 (PST) From: "Christina Evans" To: Subject: Southern California 2020 Linux Expo Emails Date: Fri, 7 Feb 2020 13:17:26 -0500 Message-ID: MIME-Version: 1.0 X-Priority: 1 (Highest) X-MSMail-Priority: High X-Mailer: Microsoft Outlook 14.0 Thread-Index: AdXd4tbnsF5oPaUBT8ypasPi/OoJ5g== Importance: High Content-Language: en-us Sensitivity: Company-Confidential X-Rspamd-Queue-Id: 48DkCJ4GMDz3LvN X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.38 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[globaltradeshowleads-com.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; HFILTER_FROMHOST_NORESOLVE_MX(0.50)[globaltradeshowleads.com]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-0.88)[ip: (-0.62), ipnet: 2607:f8b0::/32(-1.97), asn: 15169(-1.74), country: US(-0.05)]; DKIM_TRACE(0.00)[globaltradeshowleads-com.20150623.gappssmtp.com:+]; DMARC_POLICY_ALLOW(-0.50)[globaltradeshowleads.com,quarantine]; RCVD_IN_DNSWL_NONE(0.00)[1.4.4.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; HAS_X_PRIO_ONE(0.00)[1]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[242.166.172.122.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.10] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2020 18:21:33 -0000 Hi Good Morning, Would you be interested in acquiring Southern California 2020 Linux Expo Attendees complete List? Just pick a number that best describes your response, 1. Yes, I'm interested & Send counts and cost of attendees list. 2. No - Opt-Out -Not interested Who Attends: CEOs, CTOs, CIOs, IT Directors & Managers, Students Decision makers and more. All contacts are provided with: Contact Name, Title, Company Name, Website, Physical Address, Phone Number, Fax Number, SIC, Industry type, Employees, Direct Emails and Verification results. Let me know if you are interested so that I can provide you the cost and additional details. Sincerely, Christina Evans | Expo Coordinator 609-27O-DCGO If you don't want to receive further emails please revert with "Take Out" in the subject. From owner-svn-src-all@freebsd.org Fri Feb 7 19:00:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4829622AC0F; Fri, 7 Feb 2020 19:00:44 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Dl4X141tz3N5H; Fri, 7 Feb 2020 19:00:44 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1FD9B9214; Fri, 7 Feb 2020 19:00:44 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 017J0i5W099803; Fri, 7 Feb 2020 19:00:44 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 017J0h44099799; Fri, 7 Feb 2020 19:00:43 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202002071900.017J0h44099799@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 7 Feb 2020 19:00:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r357660 - in stable: 11/share/man/man4 11/sys/fs/devfs 11/sys/kern 12/share/man/man4 12/sys/fs/devfs 12/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/share/man/man4 11/sys/fs/devfs 11/sys/kern 12/share/man/man4 12/sys/fs/devfs 12/sys/kern X-SVN-Commit-Revision: 357660 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2020 19:00:44 -0000 Author: kevans Date: Fri Feb 7 19:00:43 2020 New Revision: 357660 URL: https://svnweb.freebsd.org/changeset/base/357660 Log: MFC r355248: tty: implement TIOCNOTTY Generally, it's preferred that an application fork/setsid if it doesn't want to keep its controlling TTY, but it could be that a debugger is trying to steal it instead -- so it would hook in, drop the controlling TTY, then do some magic to set things up again. In this case, TIOCNOTTY is quite handy and still respected by at least OpenBSD, NetBSD, and Linux as far as I can tell. I've dropped the note about obsoletion, as I intend to support TIOCNOTTY as long as it doesn't impose a major burden. Modified: stable/11/share/man/man4/tty.4 stable/11/sys/fs/devfs/devfs_vnops.c stable/11/sys/kern/tty.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/share/man/man4/tty.4 stable/12/sys/fs/devfs/devfs_vnops.c stable/12/sys/kern/tty.c Directory Properties: stable/12/ (props changed) Modified: stable/11/share/man/man4/tty.4 ============================================================================== --- stable/11/share/man/man4/tty.4 Fri Feb 7 17:47:08 2020 (r357659) +++ stable/11/share/man/man4/tty.4 Fri Feb 7 19:00:43 2020 (r357660) @@ -28,7 +28,7 @@ .\" @(#)tty.4 8.3 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd January 11, 2017 +.Dd November 27, 2019 .Dt TTY 4 .Os .Sh NAME @@ -196,7 +196,6 @@ Simulate typed input. Pretend as if the terminal received the character pointed to by .Fa cp . .It Dv TIOCNOTTY Fa void -This call is obsolete but left for compatibility. In the past, when a process that did not have a controlling terminal (see .Em The Controlling Terminal in @@ -205,7 +204,7 @@ first opened a terminal device, it acquired that termi controlling terminal. For some programs this was a hazard as they did not want a controlling terminal in the first place, and this -provided a mechanism to disassociate the controlling terminal from +provides a mechanism to disassociate the controlling terminal from the calling process. It .Em must @@ -230,6 +229,14 @@ system call which will place the process into its own has the effect of disassociating it from the controlling terminal. This is the new and preferred method for programs to lose their controlling terminal. +.Pp +However, environmental restrictions may prohibit the process from being able to +.Fn fork +and call the +.Fn setsid +system call to disassociate it from the controlling terminal. +In this case, it must use +.Dv TIOCNOTTY . .It Dv TIOCSTOP Fa void Stop output on the terminal (like typing ^S at the keyboard). .It Dv TIOCSTART Fa void Modified: stable/11/sys/fs/devfs/devfs_vnops.c ============================================================================== --- stable/11/sys/fs/devfs/devfs_vnops.c Fri Feb 7 17:47:08 2020 (r357659) +++ stable/11/sys/fs/devfs/devfs_vnops.c Fri Feb 7 19:00:43 2020 (r357660) @@ -785,9 +785,16 @@ devfs_ioctl_f(struct file *fp, u_long com, void *data, if (error == 0 && com == TIOCSCTTY) { vp = fp->f_vnode; - /* Do nothing if reassigning same control tty */ + /* + * Do nothing if reassigning same control tty, or if the + * control tty has already disappeared. If it disappeared, + * it's because we were racing with TIOCNOTTY. TIOCNOTTY + * already took care of releasing the old vnode and we have + * nothing left to do. + */ sx_slock(&proctree_lock); - if (td->td_proc->p_session->s_ttyvp == vp) { + if (td->td_proc->p_session->s_ttyvp == vp || + td->td_proc->p_session->s_ttyp == NULL) { sx_sunlock(&proctree_lock); return (0); } Modified: stable/11/sys/kern/tty.c ============================================================================== --- stable/11/sys/kern/tty.c Fri Feb 7 17:47:08 2020 (r357659) +++ stable/11/sys/kern/tty.c Fri Feb 7 19:00:43 2020 (r357660) @@ -1184,6 +1184,71 @@ tty_rel_gone(struct tty *tp) tty_rel_free(tp); } +static int +tty_drop_ctty(struct tty *tp, struct proc *p) +{ + struct session *session; + struct vnode *vp; + + /* + * This looks terrible, but it's generally safe as long as the tty + * hasn't gone away while we had the lock dropped. All of our sanity + * checking that this operation is OK happens after we've picked it back + * up, so other state changes are generally not fatal and the potential + * for this particular operation to happen out-of-order in a + * multithreaded scenario is likely a non-issue. + */ + tty_unlock(tp); + sx_xlock(&proctree_lock); + tty_lock(tp); + if (tty_gone(tp)) { + sx_xunlock(&proctree_lock); + return (ENODEV); + } + + /* + * If the session doesn't have a controlling TTY, or if we weren't + * invoked on the controlling TTY, we'll return ENOIOCTL as we've + * historically done. + */ + session = p->p_session; + if (session->s_ttyp == NULL || session->s_ttyp != tp) { + sx_xunlock(&proctree_lock); + return (ENOTTY); + } + + if (!SESS_LEADER(p)) { + sx_xunlock(&proctree_lock); + return (EPERM); + } + + PROC_LOCK(p); + SESS_LOCK(session); + vp = session->s_ttyvp; + session->s_ttyp = NULL; + session->s_ttyvp = NULL; + session->s_ttydp = NULL; + SESS_UNLOCK(session); + + tp->t_sessioncnt--; + p->p_flag &= ~P_CONTROLT; + PROC_UNLOCK(p); + sx_xunlock(&proctree_lock); + + /* + * If we did have a vnode, release our reference. Ordinarily we manage + * these at the devfs layer, but we can't necessarily know that we were + * invoked on the vnode referenced in the session (i.e. the vnode we + * hold a reference to). We explicitly don't check VBAD/VI_DOOMED here + * to avoid a vnode leak -- in circumstances elsewhere where we'd hit a + * VI_DOOMED vnode, release has been deferred until the controlling TTY + * is either changed or released. + */ + if (vp != NULL) + vrele(vp); + return (0); +} + /* * Exposing information about current TTY's through sysctl */ @@ -1698,6 +1763,8 @@ tty_generic_ioctl(struct tty *tp, u_long cmd, void *da MPASS(tp->t_session); *(int *)data = tp->t_session->s_sid; return (0); + case TIOCNOTTY: + return (tty_drop_ctty(tp, td->td_proc)); case TIOCSCTTY: { struct proc *p = td->td_proc; From owner-svn-src-all@freebsd.org Fri Feb 7 19:00:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 02D3D22AC18; Fri, 7 Feb 2020 19:00:45 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Dl4X6Lhrz3N5L; Fri, 7 Feb 2020 19:00:44 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D50A89217; Fri, 7 Feb 2020 19:00:44 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 017J0iDV099811; Fri, 7 Feb 2020 19:00:44 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 017J0i7H099809; Fri, 7 Feb 2020 19:00:44 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202002071900.017J0i7H099809@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 7 Feb 2020 19:00:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357660 - in stable: 11/share/man/man4 11/sys/fs/devfs 11/sys/kern 12/share/man/man4 12/sys/fs/devfs 12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/share/man/man4 11/sys/fs/devfs 11/sys/kern 12/share/man/man4 12/sys/fs/devfs 12/sys/kern X-SVN-Commit-Revision: 357660 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2020 19:00:45 -0000 Author: kevans Date: Fri Feb 7 19:00:43 2020 New Revision: 357660 URL: https://svnweb.freebsd.org/changeset/base/357660 Log: MFC r355248: tty: implement TIOCNOTTY Generally, it's preferred that an application fork/setsid if it doesn't want to keep its controlling TTY, but it could be that a debugger is trying to steal it instead -- so it would hook in, drop the controlling TTY, then do some magic to set things up again. In this case, TIOCNOTTY is quite handy and still respected by at least OpenBSD, NetBSD, and Linux as far as I can tell. I've dropped the note about obsoletion, as I intend to support TIOCNOTTY as long as it doesn't impose a major burden. Modified: stable/12/share/man/man4/tty.4 stable/12/sys/fs/devfs/devfs_vnops.c stable/12/sys/kern/tty.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/share/man/man4/tty.4 stable/11/sys/fs/devfs/devfs_vnops.c stable/11/sys/kern/tty.c Directory Properties: stable/11/ (props changed) Modified: stable/12/share/man/man4/tty.4 ============================================================================== --- stable/12/share/man/man4/tty.4 Fri Feb 7 17:47:08 2020 (r357659) +++ stable/12/share/man/man4/tty.4 Fri Feb 7 19:00:43 2020 (r357660) @@ -28,7 +28,7 @@ .\" @(#)tty.4 8.3 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd January 11, 2017 +.Dd November 27, 2019 .Dt TTY 4 .Os .Sh NAME @@ -194,7 +194,6 @@ Simulate typed input. Pretend as if the terminal received the character pointed to by .Fa cp . .It Dv TIOCNOTTY Fa void -This call is obsolete but left for compatibility. In the past, when a process that did not have a controlling terminal (see .Em The Controlling Terminal in @@ -203,7 +202,7 @@ first opened a terminal device, it acquired that termi controlling terminal. For some programs this was a hazard as they did not want a controlling terminal in the first place, and this -provided a mechanism to disassociate the controlling terminal from +provides a mechanism to disassociate the controlling terminal from the calling process. It .Em must @@ -228,6 +227,14 @@ system call which will place the process into its own has the effect of disassociating it from the controlling terminal. This is the new and preferred method for programs to lose their controlling terminal. +.Pp +However, environmental restrictions may prohibit the process from being able to +.Fn fork +and call the +.Fn setsid +system call to disassociate it from the controlling terminal. +In this case, it must use +.Dv TIOCNOTTY . .It Dv TIOCSTOP Fa void Stop output on the terminal (like typing ^S at the keyboard). .It Dv TIOCSTART Fa void Modified: stable/12/sys/fs/devfs/devfs_vnops.c ============================================================================== --- stable/12/sys/fs/devfs/devfs_vnops.c Fri Feb 7 17:47:08 2020 (r357659) +++ stable/12/sys/fs/devfs/devfs_vnops.c Fri Feb 7 19:00:43 2020 (r357660) @@ -802,9 +802,16 @@ out: error = ENOTTY; if (error == 0 && com == TIOCSCTTY) { - /* Do nothing if reassigning same control tty */ + /* + * Do nothing if reassigning same control tty, or if the + * control tty has already disappeared. If it disappeared, + * it's because we were racing with TIOCNOTTY. TIOCNOTTY + * already took care of releasing the old vnode and we have + * nothing left to do. + */ sx_slock(&proctree_lock); - if (td->td_proc->p_session->s_ttyvp == vp) { + if (td->td_proc->p_session->s_ttyvp == vp || + td->td_proc->p_session->s_ttyp == NULL) { sx_sunlock(&proctree_lock); return (0); } Modified: stable/12/sys/kern/tty.c ============================================================================== --- stable/12/sys/kern/tty.c Fri Feb 7 17:47:08 2020 (r357659) +++ stable/12/sys/kern/tty.c Fri Feb 7 19:00:43 2020 (r357660) @@ -1185,6 +1185,71 @@ tty_rel_gone(struct tty *tp) tty_rel_free(tp); } +static int +tty_drop_ctty(struct tty *tp, struct proc *p) +{ + struct session *session; + struct vnode *vp; + + /* + * This looks terrible, but it's generally safe as long as the tty + * hasn't gone away while we had the lock dropped. All of our sanity + * checking that this operation is OK happens after we've picked it back + * up, so other state changes are generally not fatal and the potential + * for this particular operation to happen out-of-order in a + * multithreaded scenario is likely a non-issue. + */ + tty_unlock(tp); + sx_xlock(&proctree_lock); + tty_lock(tp); + if (tty_gone(tp)) { + sx_xunlock(&proctree_lock); + return (ENODEV); + } + + /* + * If the session doesn't have a controlling TTY, or if we weren't + * invoked on the controlling TTY, we'll return ENOIOCTL as we've + * historically done. + */ + session = p->p_session; + if (session->s_ttyp == NULL || session->s_ttyp != tp) { + sx_xunlock(&proctree_lock); + return (ENOTTY); + } + + if (!SESS_LEADER(p)) { + sx_xunlock(&proctree_lock); + return (EPERM); + } + + PROC_LOCK(p); + SESS_LOCK(session); + vp = session->s_ttyvp; + session->s_ttyp = NULL; + session->s_ttyvp = NULL; + session->s_ttydp = NULL; + SESS_UNLOCK(session); + + tp->t_sessioncnt--; + p->p_flag &= ~P_CONTROLT; + PROC_UNLOCK(p); + sx_xunlock(&proctree_lock); + + /* + * If we did have a vnode, release our reference. Ordinarily we manage + * these at the devfs layer, but we can't necessarily know that we were + * invoked on the vnode referenced in the session (i.e. the vnode we + * hold a reference to). We explicitly don't check VBAD/VI_DOOMED here + * to avoid a vnode leak -- in circumstances elsewhere where we'd hit a + * VI_DOOMED vnode, release has been deferred until the controlling TTY + * is either changed or released. + */ + if (vp != NULL) + vrele(vp); + return (0); +} + /* * Exposing information about current TTY's through sysctl */ @@ -1699,6 +1764,8 @@ tty_generic_ioctl(struct tty *tp, u_long cmd, void *da MPASS(tp->t_session); *(int *)data = tp->t_session->s_sid; return (0); + case TIOCNOTTY: + return (tty_drop_ctty(tp, td->td_proc)); case TIOCSCTTY: { struct proc *p = td->td_proc; From owner-svn-src-all@freebsd.org Fri Feb 7 19:04:27 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B679322AF5C; Fri, 7 Feb 2020 19:04:27 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Dl8q4PtYz3NYh; Fri, 7 Feb 2020 19:04:27 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8E31693D8; Fri, 7 Feb 2020 19:04:27 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 017J4RIi004907; Fri, 7 Feb 2020 19:04:27 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 017J4Rsf004906; Fri, 7 Feb 2020 19:04:27 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202002071904.017J4Rsf004906@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 7 Feb 2020 19:04:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357661 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 357661 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2020 19:04:27 -0000 Author: dim Date: Fri Feb 7 19:04:27 2020 New Revision: 357661 URL: https://svnweb.freebsd.org/changeset/base/357661 Log: Correctly recognize linker versions greater than 10.0. MFC after: 3 days Modified: head/share/mk/bsd.linker.mk Modified: head/share/mk/bsd.linker.mk ============================================================================== --- head/share/mk/bsd.linker.mk Fri Feb 7 19:00:43 2020 (r357660) +++ head/share/mk/bsd.linker.mk Fri Feb 7 19:04:27 2020 (r357661) @@ -65,7 +65,7 @@ _ld_version!= (${${ld}} --version || echo none) | sed .if ${_ld_version:[1..2]} == "GNU ld" ${X_}LINKER_TYPE= bfd ${X_}LINKER_FREEBSD_VERSION= 0 -_v= ${_ld_version:M[1-9].[0-9]*:[1]} +_v= ${_ld_version:M[1-9]*.[0-9]*:[1]} .elif ${_ld_version:[1]} == "LLD" ${X_}LINKER_TYPE= lld _v= ${_ld_version:[2]} @@ -77,7 +77,7 @@ ${X_}LINKER_FREEBSD_VERSION!= \ ${X_}LINKER_TYPE= bfd _v= 2.17.50 .endif -${X_}LINKER_VERSION!= echo "${_v:M[1-9].[0-9]*}" | \ +${X_}LINKER_VERSION!= echo "${_v:M[1-9]*.[0-9]*}" | \ awk -F. '{print $$1 * 10000 + $$2 * 100 + $$3;}' .undef _ld_version .undef _v From owner-svn-src-all@freebsd.org Fri Feb 7 19:26:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 04DD622BDB1; Fri, 7 Feb 2020 19:26:28 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48DlfC5GJqz3Q4X; Fri, 7 Feb 2020 19:26:27 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AFE33977D; Fri, 7 Feb 2020 19:26:27 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 017JQRrV016992; Fri, 7 Feb 2020 19:26:27 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 017JQRq0016989; Fri, 7 Feb 2020 19:26:27 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <202002071926.017JQRq0016989@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Fri, 7 Feb 2020 19:26:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357663 - in head: share/man/man4 sys/dev/netmap X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: in head: share/man/man4 sys/dev/netmap X-SVN-Commit-Revision: 357663 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2020 19:26:28 -0000 Author: vmaffione Date: Fri Feb 7 19:26:26 2020 New Revision: 357663 URL: https://svnweb.freebsd.org/changeset/base/357663 Log: netmap: improve netmap(4) and vale(4) man pages Clean up obsolete sysctl descriptions and add missing ones. PR: 243838 Reviewed by: bcr MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D23546 Modified: head/share/man/man4/netmap.4 head/share/man/man4/vale.4 head/sys/dev/netmap/netmap_kern.h Modified: head/share/man/man4/netmap.4 ============================================================================== --- head/share/man/man4/netmap.4 Fri Feb 7 19:08:37 2020 (r357662) +++ head/share/man/man4/netmap.4 Fri Feb 7 19:26:26 2020 (r357663) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 8, 2019 +.Dd February 6, 2020 .Dt NETMAP 4 .Os .Sh NAME @@ -694,7 +694,7 @@ or are called with a write event (POLLOUT/wfdset) or a full ring. .Pp When registering a virtual interface that is dynamically created to a -.Xr vale 4 +.Nm VALE switch, we can specify the desired number of rings (1 by default, and currently up to 16) on it using nr_tx_rings and nr_rx_rings fields. .It Dv NIOCTXSYNC @@ -861,8 +861,10 @@ The sysctl variable .Va dev.netmap.admode globally controls how netmap mode is implemented. .Sh SYSCTL VARIABLES AND MODULE PARAMETERS -Some aspect of the operation of +Some aspects of the operation of .Nm +and +.Nm VALE are controlled through sysctl variables on .Fx .Em ( dev.netmap.* ) @@ -883,15 +885,14 @@ Number of rings used for emulated netmap mode Ring size used for emulated netmap mode .It Va dev.netmap.generic_mit: 100000 Controls interrupt moderation for emulated mode -.It Va dev.netmap.mmap_unreg: 0 .It Va dev.netmap.fwd: 0 Forces NS_FORWARD mode -.It Va dev.netmap.flags: 0 .It Va dev.netmap.txsync_retry: 2 +Number of txsync loops in the +.Nm VALE +flush function .It Va dev.netmap.no_pendintr: 1 Forces recovery of transmit buffers on system calls -.It Va dev.netmap.mitigate: 1 -Propagates interrupt mitigation to user processes .It Va dev.netmap.no_timestamp: 0 Disables the update of the timestamp in the netmap ring .It Va dev.netmap.verbose: 0 @@ -914,6 +915,18 @@ as it impacts the total amount of memory used by netma .It Va dev.netmap.if_curr_num: 0 .It Va dev.netmap.if_curr_size: 0 Actual values in use. +.It Va dev.netmap.priv_buf_num: 4098 +.It Va dev.netmap.priv_buf_size: 2048 +.It Va dev.netmap.priv_ring_num: 4 +.It Va dev.netmap.priv_ring_size: 20480 +.It Va dev.netmap.priv_if_num: 2 +.It Va dev.netmap.priv_if_size: 1024 +Sizes and number of objects (netmap_if, netmap_ring, buffers) +for private memory regions. +A separate memory region is used for each +.Nm VALE +port and each pair of +.Nm netmap pipes . .It Va dev.netmap.bridge_batch: 1024 Batch size used when moving packets across a .Nm VALE Modified: head/share/man/man4/vale.4 ============================================================================== --- head/share/man/man4/vale.4 Fri Feb 7 19:08:37 2020 (r357662) +++ head/share/man/man4/vale.4 Fri Feb 7 19:26:26 2020 (r357663) @@ -28,7 +28,7 @@ .\" $FreeBSD$ .\" $Id: $ .\" -.Dd January 9, 2019 +.Dd February 6, 2020 .Dt VALE 4 .Os .Sh NAME @@ -77,21 +77,13 @@ See for details on the API. .Ss LIMITS .Nm -currently supports up to 4 switches, 16 ports per switch, with -1024 buffers per port. -These hard limits will be -changed to sysctl variables in future releases. +currently supports up to 8 switches, with 254 ports per switch. .Sh SYSCTL VARIABLES +See +.Xr netmap 4 +for a list of sysctl variables that affect .Nm -uses the following sysctl variables to control operation: -.Bl -tag -width dev.netmap.verbose -.It dev.netmap.bridge_batch -The maximum number of packets processed internally -in each iteration. -Defaults to 1024, use lower values to trade latency -with throughput. -.It dev.netmap.verbose -Set to non-zero values to enable in-kernel diagnostics. +bridges. .El .Sh EXAMPLES Create one switch, with a traffic generator connected to one Modified: head/sys/dev/netmap/netmap_kern.h ============================================================================== --- head/sys/dev/netmap/netmap_kern.h Fri Feb 7 19:08:37 2020 (r357662) +++ head/sys/dev/netmap/netmap_kern.h Fri Feb 7 19:26:26 2020 (r357663) @@ -1591,7 +1591,6 @@ int netmap_adapter_put(struct netmap_adapter *na); #define NETMAP_BUF_BASE(_na) ((_na)->na_lut.lut[0].vaddr) #define NETMAP_BUF_SIZE(_na) ((_na)->na_lut.objsize) extern int netmap_no_pendintr; -extern int netmap_mitigate; extern int netmap_verbose; #ifdef CONFIG_NETMAP_DEBUG extern int netmap_debug; /* for debugging */ @@ -1613,7 +1612,6 @@ enum { /* debug flags }; extern int netmap_txsync_retry; -extern int netmap_flags; extern int netmap_generic_hwcsum; extern int netmap_generic_mit; extern int netmap_generic_ringsize; From owner-svn-src-all@freebsd.org Fri Feb 7 19:53:10 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4A68722C909; Fri, 7 Feb 2020 19:53:10 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48DmF21KBGz3xJ4; Fri, 7 Feb 2020 19:53:10 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2881C9D65; Fri, 7 Feb 2020 19:53:10 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 017JrALs035743; Fri, 7 Feb 2020 19:53:10 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 017Jr76s035728; Fri, 7 Feb 2020 19:53:07 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202002071953.017Jr76s035728@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 7 Feb 2020 19:53:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357664 - in head: sys/dev/ixl sys/dev/le sys/dev/pms/RefTisa/discovery/dm sys/dev/ppbus sys/dev/puc sys/dev/usb/net sys/netinet sys/netinet/netdump sys/netinet/tcp_stacks sys/opencrypt... X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head: sys/dev/ixl sys/dev/le sys/dev/pms/RefTisa/discovery/dm sys/dev/ppbus sys/dev/puc sys/dev/usb/net sys/netinet sys/netinet/netdump sys/netinet/tcp_stacks sys/opencrypto usr.bin/truss usr.sbin/... X-SVN-Commit-Revision: 357664 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2020 19:53:10 -0000 Author: emaste Date: Fri Feb 7 19:53:07 2020 New Revision: 357664 URL: https://svnweb.freebsd.org/changeset/base/357664 Log: Miscellaneous typo fixes Submitted by: Gordon Bergling Differential Revision: https://reviews.freebsd.org/D23453 Modified: head/sys/dev/ixl/if_iavf.c head/sys/dev/le/lancevar.h head/sys/dev/pms/RefTisa/discovery/dm/dmdisc.c head/sys/dev/ppbus/lpt.c head/sys/dev/puc/pucdata.c head/sys/dev/usb/net/if_axe.c head/sys/netinet/netdump/netdump_client.c head/sys/netinet/tcp_sack.c head/sys/netinet/tcp_stacks/bbr.c head/sys/netinet/tcp_stacks/tcp_bbr.h head/sys/opencrypto/xform_enc.h head/usr.bin/truss/syscalls.c head/usr.sbin/bsdconfig/share/media/network.subr Modified: head/sys/dev/ixl/if_iavf.c ============================================================================== --- head/sys/dev/ixl/if_iavf.c Fri Feb 7 19:26:26 2020 (r357663) +++ head/sys/dev/ixl/if_iavf.c Fri Feb 7 19:53:07 2020 (r357664) @@ -705,7 +705,7 @@ iavf_if_init(if_ctx_t ctx) } /* - * iavf_attach() helper function; initalizes the admin queue + * iavf_attach() helper function; initializes the admin queue * and attempts to establish contact with the PF by * retrying the initial "API version" message several times * or until the PF responds. Modified: head/sys/dev/le/lancevar.h ============================================================================== --- head/sys/dev/le/lancevar.h Fri Feb 7 19:26:26 2020 (r357663) +++ head/sys/dev/le/lancevar.h Fri Feb 7 19:53:07 2020 (r357664) @@ -198,7 +198,7 @@ ether_cmp(void *one, void *two) diff |= *a++ - *b++; #else /* - * Most modern CPUs do better with a single expresion. + * Most modern CPUs do better with a single expression. * Note that short-cut evaluation is NOT helpful here, * because it just makes the code longer, not faster! */ Modified: head/sys/dev/pms/RefTisa/discovery/dm/dmdisc.c ============================================================================== --- head/sys/dev/pms/RefTisa/discovery/dm/dmdisc.c Fri Feb 7 19:26:26 2020 (r357663) +++ head/sys/dev/pms/RefTisa/discovery/dm/dmdisc.c Fri Feb 7 19:53:07 2020 (r357664) @@ -5618,7 +5618,7 @@ dmSubReportRemovals( } - /* this function is called at the end of discovery; reinitalizes oneDeviceData->reported */ + /* this function is called at the end of discovery; reinitializes oneDeviceData->reported */ oneDeviceData->reported = agFALSE; return; } @@ -5661,7 +5661,7 @@ dmSubReportChanges( } - /* this function is called at the end of discovery; reinitalizes oneDeviceData->reported */ + /* this function is called at the end of discovery; reinitializes oneDeviceData->reported */ oneDeviceData->reported = agFALSE; return; } Modified: head/sys/dev/ppbus/lpt.c ============================================================================== --- head/sys/dev/ppbus/lpt.c Fri Feb 7 19:26:26 2020 (r357663) +++ head/sys/dev/ppbus/lpt.c Fri Feb 7 19:53:07 2020 (r357664) @@ -272,7 +272,7 @@ lpt_port_test(device_t ppbus, u_char data, u_char mask * * 2) You should be able to write to and read back the same value * to the control port lower 5 bits, the upper 3 bits are reserved - * per the IBM PC technical reference manauls and different boards + * per the IBM PC technical reference manuals and different boards * do different things with them. Do an alternating zeros, alternating * ones, walking zero, and walking one test to check for stuck bits. * Modified: head/sys/dev/puc/pucdata.c ============================================================================== --- head/sys/dev/puc/pucdata.c Fri Feb 7 19:26:26 2020 (r357663) +++ head/sys/dev/puc/pucdata.c Fri Feb 7 19:53:07 2020 (r357664) @@ -708,7 +708,7 @@ const struct puc_cfg puc_pci_devices[] = { * The Advantech PCI-1602 Rev. A use the first two ports of an Oxford * Semiconductor OXuPCI954. Note these boards have a hardware bug in * that they drive the RS-422/485 transmitters after power-on until a - * driver initalizes the UARTs. + * driver initializes the UARTs. */ { 0x13fe, 0x1600, 0x1602, 0x0002, "Advantech PCI-1602 Rev. A", Modified: head/sys/dev/usb/net/if_axe.c ============================================================================== --- head/sys/dev/usb/net/if_axe.c Fri Feb 7 19:26:26 2020 (r357663) +++ head/sys/dev/usb/net/if_axe.c Fri Feb 7 19:53:07 2020 (r357664) @@ -63,7 +63,7 @@ __FBSDID("$FreeBSD$"); * to send any packets. * * Note that this device appears to only support loading the station - * address via autload from the EEPROM (i.e. there's no way to manaully + * address via autload from the EEPROM (i.e. there's no way to manually * set it). * * (Adam Weinberger wanted me to name this driver if_gir.c.) Modified: head/sys/netinet/netdump/netdump_client.c ============================================================================== --- head/sys/netinet/netdump/netdump_client.c Fri Feb 7 19:26:26 2020 (r357663) +++ head/sys/netinet/netdump/netdump_client.c Fri Feb 7 19:53:07 2020 (r357664) @@ -277,7 +277,7 @@ netdump_dumper(void *priv __unused, void *virtual, } /* - * Perform any initalization needed prior to transmitting the kernel core. + * Perform any initialization needed prior to transmitting the kernel core. */ static int netdump_start(struct dumperinfo *di) Modified: head/sys/netinet/tcp_sack.c ============================================================================== --- head/sys/netinet/tcp_sack.c Fri Feb 7 19:26:26 2020 (r357663) +++ head/sys/netinet/tcp_sack.c Fri Feb 7 19:53:07 2020 (r357664) @@ -238,7 +238,7 @@ tcp_update_dsack_list(struct tcpcb *tp, tcp_seq rcv_st } j = 0; for (i = 0; i < n; i++) { - /* we can end up with a stale inital entry */ + /* we can end up with a stale initial entry */ if (SEQ_LT(saved_blks[i].start, saved_blks[i].end)) { tp->sackblks[j++] = saved_blks[i]; } Modified: head/sys/netinet/tcp_stacks/bbr.c ============================================================================== --- head/sys/netinet/tcp_stacks/bbr.c Fri Feb 7 19:26:26 2020 (r357663) +++ head/sys/netinet/tcp_stacks/bbr.c Fri Feb 7 19:53:07 2020 (r357664) @@ -5856,7 +5856,7 @@ tcp_bbr_tso_size_check(struct tcp_bbr *bbr, uint32_t c /* * Not enough data has been acknowledged to make a * judgement unless we are hardware TLS. Set up - * the inital TSO based on if we are sending a + * the initial TSO based on if we are sending a * full IW at once or not. */ if (bbr->rc_use_google) @@ -12361,7 +12361,7 @@ bbr_output_wtime(struct tcpcb *tp, const struct timeva if (IS_FASTOPEN(tp->t_flags) && ((tp->t_state == TCPS_SYN_RECEIVED) || (tp->t_state == TCPS_SYN_SENT)) && - SEQ_GT(tp->snd_max, tp->snd_una) && /* inital SYN or SYN|ACK sent */ + SEQ_GT(tp->snd_max, tp->snd_una) && /* initial SYN or SYN|ACK sent */ (tp->t_rxtshift == 0)) { /* not a retransmit */ return (0); } Modified: head/sys/netinet/tcp_stacks/tcp_bbr.h ============================================================================== --- head/sys/netinet/tcp_stacks/tcp_bbr.h Fri Feb 7 19:26:26 2020 (r357663) +++ head/sys/netinet/tcp_stacks/tcp_bbr.h Fri Feb 7 19:53:07 2020 (r357664) @@ -598,7 +598,7 @@ struct bbr_control { uint32_t rc_reorder_ts; /* Last time we saw reordering Lock(a) */ uint32_t rc_init_rwnd; /* Initial rwnd when we transitioned */ /*- --- - * used only inital and close + * used only initial and close */ uint32_t rc_high_rwnd; /* Highest rwnd seen */ uint32_t rc_lowest_rtt; /* Smallest RTT we have seen */ Modified: head/sys/opencrypto/xform_enc.h ============================================================================== --- head/sys/opencrypto/xform_enc.h Fri Feb 7 19:26:26 2020 (r357663) +++ head/sys/opencrypto/xform_enc.h Fri Feb 7 19:53:07 2020 (r357664) @@ -88,7 +88,7 @@ extern struct enc_xform enc_xform_ccm; struct aes_icm_ctx { u_int32_t ac_ek[4*(RIJNDAEL_MAXNR + 1)]; - /* ac_block is initalized to IV */ + /* ac_block is initialized to IV */ u_int8_t ac_block[AESICM_BLOCKSIZE]; int ac_nr; }; Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Fri Feb 7 19:26:26 2020 (r357663) +++ head/usr.bin/truss/syscalls.c Fri Feb 7 19:53:07 2020 (r357664) @@ -908,7 +908,7 @@ print_mask_arg32(bool (*decoder)(FILE *, uint32_t, uin * Add argument padding to subsequent system calls after Quad * syscall arguments as needed. This used to be done by hand in the * decoded_syscalls table which was ugly and error prone. It is - * simpler to do the fixup of offsets at initalization time than when + * simpler to do the fixup of offsets at initialization time than when * decoding arguments. */ static void Modified: head/usr.sbin/bsdconfig/share/media/network.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/network.subr Fri Feb 7 19:26:26 2020 (r357663) +++ head/usr.sbin/bsdconfig/share/media/network.subr Fri Feb 7 19:53:07 2020 (r357664) @@ -51,7 +51,7 @@ NETWORK_INITIALIZED= # initialized and returns success. # # The variables (from variable.subr) used to initialize the network are as -# follows (all of which are configured either automatically or manaully): +# follows (all of which are configured either automatically or manually): # # VAR_IFCONFIG + device_name (e.g., `ifconfig_em0') # Automatically populated but can be overridden in a script. This From owner-svn-src-all@freebsd.org Fri Feb 7 21:36:15 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5E84A22E653; Fri, 7 Feb 2020 21:36:15 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48DpWz1vBZz42s6; Fri, 7 Feb 2020 21:36:15 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3C7B2AFB7; Fri, 7 Feb 2020 21:36:15 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 017LaF54095910; Fri, 7 Feb 2020 21:36:15 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 017LaFFZ095909; Fri, 7 Feb 2020 21:36:15 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202002072136.017LaFFZ095909@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 7 Feb 2020 21:36:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357665 - head/sys/geom/eli X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/geom/eli X-SVN-Commit-Revision: 357665 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2020 21:36:15 -0000 Author: kevans Date: Fri Feb 7 21:36:14 2020 New Revision: 357665 URL: https://svnweb.freebsd.org/changeset/base/357665 Log: geli taste: allow GELIBOOT tagged providers as well Currently the installer will tag geliboot partitions with both BOOT and GELIBOOT; the former allows the kernel to taste it at boot, while the latter is what loaders keys off of. However, it seems reasonable to assume that if a provider's been tagged with GELIBOOT that the kernel should also take that as a hint to taste/attach at boot. This would allow us to stop tagging GELIBOOT partitions with BOOT in bsdinstall, but I'm not sure that there's a compelling reason to do so any time soon. Reviewed by: oshogbo Differential Revision: https://reviews.freebsd.org/D23387 Modified: head/sys/geom/eli/g_eli.c Modified: head/sys/geom/eli/g_eli.c ============================================================================== --- head/sys/geom/eli/g_eli.c Fri Feb 7 19:53:07 2020 (r357664) +++ head/sys/geom/eli/g_eli.c Fri Feb 7 21:36:14 2020 (r357665) @@ -1169,7 +1169,8 @@ g_eli_taste(struct g_class *mp, struct g_provider *pp, if (md.md_provsize != pp->mediasize) return (NULL); /* Should we attach it on boot? */ - if (!(md.md_flags & G_ELI_FLAG_BOOT)) + if (!(md.md_flags & G_ELI_FLAG_BOOT) && + !(md.md_flags & G_ELI_FLAG_GELIBOOT)) return (NULL); if (md.md_keys == 0x00) { G_ELI_DEBUG(0, "No valid keys on %s.", pp->name); From owner-svn-src-all@freebsd.org Fri Feb 7 21:55:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EEFE222F2A6; Fri, 7 Feb 2020 21:55:45 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48DpyT64X0z440y; Fri, 7 Feb 2020 21:55:45 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C6DC3B360; Fri, 7 Feb 2020 21:55:45 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 017Ltjcu007949; Fri, 7 Feb 2020 21:55:45 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 017Ltjv1007948; Fri, 7 Feb 2020 21:55:45 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202002072155.017Ltjv1007948@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 7 Feb 2020 21:55:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r357666 - in stable: 11/sys/dev/atkbdc 12/sys/dev/atkbdc X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/sys/dev/atkbdc 12/sys/dev/atkbdc X-SVN-Commit-Revision: 357666 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2020 21:55:46 -0000 Author: kevans Date: Fri Feb 7 21:55:45 2020 New Revision: 357666 URL: https://svnweb.freebsd.org/changeset/base/357666 Log: MFC r357509-r357510: small psm cleanup r357509: psm: release resources on attach failure In exactly 1/3 cases we'll release resources on failure; touch up the other two to do so as well. r357510: psm: use make_dev_s instead of make_dev This most importantly reduces duplication, but it also removes any potential race with usage of dev->si_drv1 since it's now set prior to the device being constructed enough to be accessible. Modified: stable/11/sys/dev/atkbdc/psm.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/dev/atkbdc/psm.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/dev/atkbdc/psm.c ============================================================================== --- stable/11/sys/dev/atkbdc/psm.c Fri Feb 7 21:36:14 2020 (r357665) +++ stable/11/sys/dev/atkbdc/psm.c Fri Feb 7 21:55:45 2020 (r357666) @@ -1940,6 +1940,7 @@ psm_register_elantech(device_t dev) static int psmattach(device_t dev) { + struct make_dev_args mda; int unit = device_get_unit(dev); struct psm_softc *sc = device_get_softc(dev); int error; @@ -1957,17 +1958,20 @@ psmattach(device_t dev) return (ENXIO); error = bus_setup_intr(dev, sc->intr, INTR_TYPE_TTY, NULL, psmintr, sc, &sc->ih); - if (error) { - bus_release_resource(dev, SYS_RES_IRQ, rid, sc->intr); - return (error); - } + if (error) + goto out; /* Done */ - sc->dev = make_dev(&psm_cdevsw, 0, 0, 0, 0666, "psm%d", unit); - sc->dev->si_drv1 = sc; - sc->bdev = make_dev(&psm_cdevsw, 0, 0, 0, 0666, "bpsm%d", unit); - sc->bdev->si_drv1 = sc; + make_dev_args_init(&mda); + mda.mda_devsw = &psm_cdevsw; + mda.mda_mode = 0666; + mda.mda_si_drv1 = sc; + if ((error = make_dev_s(&mda, &sc->dev, "psm%d", unit)) != 0) + goto out; + if ((error = make_dev_s(&mda, &sc->bdev, "bpsm%d", unit)) != 0) + goto out; + #ifdef EVDEV_SUPPORT switch (sc->hw.model) { case MOUSE_MODEL_SYNAPTICS: @@ -1983,7 +1987,7 @@ psmattach(device_t dev) } if (error) - return (error); + goto out; #endif /* Some touchpad devices need full reinitialization after suspend. */ @@ -2024,7 +2028,15 @@ psmattach(device_t dev) if (bootverbose) --verbose; - return (0); +out: + if (error != 0) { + bus_release_resource(dev, SYS_RES_IRQ, rid, sc->intr); + if (sc->dev != NULL) + destroy_dev(sc->dev); + if (sc->bdev != NULL) + destroy_dev(sc->bdev); + } + return (error); } static int From owner-svn-src-all@freebsd.org Fri Feb 7 21:55:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5949B22F2AB; Fri, 7 Feb 2020 21:55:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48DpyV1lBnz4410; Fri, 7 Feb 2020 21:55:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3706FB361; Fri, 7 Feb 2020 21:55:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 017LtjTe007955; Fri, 7 Feb 2020 21:55:45 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 017Ltjco007954; Fri, 7 Feb 2020 21:55:45 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202002072155.017Ltjco007954@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 7 Feb 2020 21:55:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357666 - in stable: 11/sys/dev/atkbdc 12/sys/dev/atkbdc X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/sys/dev/atkbdc 12/sys/dev/atkbdc X-SVN-Commit-Revision: 357666 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2020 21:55:46 -0000 Author: kevans Date: Fri Feb 7 21:55:45 2020 New Revision: 357666 URL: https://svnweb.freebsd.org/changeset/base/357666 Log: MFC r357509-r357510: small psm cleanup r357509: psm: release resources on attach failure In exactly 1/3 cases we'll release resources on failure; touch up the other two to do so as well. r357510: psm: use make_dev_s instead of make_dev This most importantly reduces duplication, but it also removes any potential race with usage of dev->si_drv1 since it's now set prior to the device being constructed enough to be accessible. Modified: stable/12/sys/dev/atkbdc/psm.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/dev/atkbdc/psm.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/dev/atkbdc/psm.c ============================================================================== --- stable/12/sys/dev/atkbdc/psm.c Fri Feb 7 21:36:14 2020 (r357665) +++ stable/12/sys/dev/atkbdc/psm.c Fri Feb 7 21:55:45 2020 (r357666) @@ -1945,6 +1945,7 @@ psm_register_elantech(device_t dev) static int psmattach(device_t dev) { + struct make_dev_args mda; int unit = device_get_unit(dev); struct psm_softc *sc = device_get_softc(dev); int error; @@ -1962,17 +1963,20 @@ psmattach(device_t dev) return (ENXIO); error = bus_setup_intr(dev, sc->intr, INTR_TYPE_TTY, NULL, psmintr, sc, &sc->ih); - if (error) { - bus_release_resource(dev, SYS_RES_IRQ, rid, sc->intr); - return (error); - } + if (error) + goto out; /* Done */ - sc->dev = make_dev(&psm_cdevsw, 0, 0, 0, 0666, "psm%d", unit); - sc->dev->si_drv1 = sc; - sc->bdev = make_dev(&psm_cdevsw, 0, 0, 0, 0666, "bpsm%d", unit); - sc->bdev->si_drv1 = sc; + make_dev_args_init(&mda); + mda.mda_devsw = &psm_cdevsw; + mda.mda_mode = 0666; + mda.mda_si_drv1 = sc; + if ((error = make_dev_s(&mda, &sc->dev, "psm%d", unit)) != 0) + goto out; + if ((error = make_dev_s(&mda, &sc->bdev, "bpsm%d", unit)) != 0) + goto out; + #ifdef EVDEV_SUPPORT switch (sc->hw.model) { case MOUSE_MODEL_SYNAPTICS: @@ -1988,7 +1992,7 @@ psmattach(device_t dev) } if (error) - return (error); + goto out; #endif /* Some touchpad devices need full reinitialization after suspend. */ @@ -2029,7 +2033,15 @@ psmattach(device_t dev) if (bootverbose) --verbose; - return (0); +out: + if (error != 0) { + bus_release_resource(dev, SYS_RES_IRQ, rid, sc->intr); + if (sc->dev != NULL) + destroy_dev(sc->dev); + if (sc->bdev != NULL) + destroy_dev(sc->bdev); + } + return (error); } static int From owner-svn-src-all@freebsd.org Fri Feb 7 21:57:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C57D222F3F4; Fri, 7 Feb 2020 21:57:29 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Dq0T4rk7z44FV; Fri, 7 Feb 2020 21:57:29 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A1BB2B363; Fri, 7 Feb 2020 21:57:29 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 017LvTsj008111; Fri, 7 Feb 2020 21:57:29 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 017LvRsY008101; Fri, 7 Feb 2020 21:57:27 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202002072157.017LvRsY008101@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 7 Feb 2020 21:57:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r357667 - in stable: 11/lib/libbe 11/lib/libbe/tests 11/sbin/bectl 12/lib/libbe 12/lib/libbe/tests 12/sbin/bectl X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/lib/libbe 11/lib/libbe/tests 11/sbin/bectl 12/lib/libbe 12/lib/libbe/tests 12/sbin/bectl X-SVN-Commit-Revision: 357667 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2020 21:57:29 -0000 Author: kevans Date: Fri Feb 7 21:57:27 2020 New Revision: 357667 URL: https://svnweb.freebsd.org/changeset/base/357667 Log: MFC r357067: Drop "All Rights Reserved" from all libbe/bectl files Modified: stable/11/lib/libbe/be.c stable/11/lib/libbe/be.h stable/11/lib/libbe/be_access.c stable/11/lib/libbe/be_error.c stable/11/lib/libbe/be_impl.h stable/11/lib/libbe/be_info.c stable/11/lib/libbe/libbe.3 stable/11/lib/libbe/tests/target_prog.c stable/11/sbin/bectl/bectl.8 stable/11/sbin/bectl/bectl.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/lib/libbe/be.c stable/12/lib/libbe/be.h stable/12/lib/libbe/be_access.c stable/12/lib/libbe/be_error.c stable/12/lib/libbe/be_impl.h stable/12/lib/libbe/be_info.c stable/12/lib/libbe/libbe.3 stable/12/lib/libbe/tests/target_prog.c stable/12/sbin/bectl/bectl.8 stable/12/sbin/bectl/bectl.c Directory Properties: stable/12/ (props changed) Modified: stable/11/lib/libbe/be.c ============================================================================== --- stable/11/lib/libbe/be.c Fri Feb 7 21:55:45 2020 (r357666) +++ stable/11/lib/libbe/be.c Fri Feb 7 21:57:27 2020 (r357667) @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2017 Kyle J. Kneitinger - * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/11/lib/libbe/be.h ============================================================================== --- stable/11/lib/libbe/be.h Fri Feb 7 21:55:45 2020 (r357666) +++ stable/11/lib/libbe/be.h Fri Feb 7 21:57:27 2020 (r357667) @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2017 Kyle J. Kneitinger - * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/11/lib/libbe/be_access.c ============================================================================== --- stable/11/lib/libbe/be_access.c Fri Feb 7 21:55:45 2020 (r357666) +++ stable/11/lib/libbe/be_access.c Fri Feb 7 21:57:27 2020 (r357667) @@ -4,7 +4,6 @@ * Copyright (c) 2017 Kyle J. Kneitinger * Copyright (c) 2018 Kyle Evans * Copyright (c) 2019 Wes Maag - * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/11/lib/libbe/be_error.c ============================================================================== --- stable/11/lib/libbe/be_error.c Fri Feb 7 21:55:45 2020 (r357666) +++ stable/11/lib/libbe/be_error.c Fri Feb 7 21:57:27 2020 (r357667) @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2017 Kyle J. Kneitinger - * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/11/lib/libbe/be_impl.h ============================================================================== --- stable/11/lib/libbe/be_impl.h Fri Feb 7 21:55:45 2020 (r357666) +++ stable/11/lib/libbe/be_impl.h Fri Feb 7 21:57:27 2020 (r357667) @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2017 Kyle J. Kneitinger - * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/11/lib/libbe/be_info.c ============================================================================== --- stable/11/lib/libbe/be_info.c Fri Feb 7 21:55:45 2020 (r357666) +++ stable/11/lib/libbe/be_info.c Fri Feb 7 21:57:27 2020 (r357667) @@ -3,7 +3,6 @@ * * Copyright (c) 2017 Kyle J. Kneitinger * Copyright (c) 2018 Kyle Evans - * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/11/lib/libbe/libbe.3 ============================================================================== --- stable/11/lib/libbe/libbe.3 Fri Feb 7 21:55:45 2020 (r357666) +++ stable/11/lib/libbe/libbe.3 Fri Feb 7 21:57:27 2020 (r357667) @@ -2,7 +2,6 @@ .\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD .\" .\" Copyright (c) 2017 Kyle Kneitinger -.\" All rights reserved. .\" Copyright (c) 2018 Kyle Evans .\" .\" Redistribution and use in source and binary forms, with or without Modified: stable/11/lib/libbe/tests/target_prog.c ============================================================================== --- stable/11/lib/libbe/tests/target_prog.c Fri Feb 7 21:55:45 2020 (r357666) +++ stable/11/lib/libbe/tests/target_prog.c Fri Feb 7 21:57:27 2020 (r357667) @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2019 Rob Wing - * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/11/sbin/bectl/bectl.8 ============================================================================== --- stable/11/sbin/bectl/bectl.8 Fri Feb 7 21:55:45 2020 (r357666) +++ stable/11/sbin/bectl/bectl.8 Fri Feb 7 21:57:27 2020 (r357667) @@ -2,7 +2,6 @@ .\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD .\" .\" Copyright (c) 2017 Kyle J. Kneitinger -.\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions Modified: stable/11/sbin/bectl/bectl.c ============================================================================== --- stable/11/sbin/bectl/bectl.c Fri Feb 7 21:55:45 2020 (r357666) +++ stable/11/sbin/bectl/bectl.c Fri Feb 7 21:57:27 2020 (r357667) @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2017 Kyle J. Kneitinger - * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions From owner-svn-src-all@freebsd.org Fri Feb 7 21:57:32 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2B35822F419; Fri, 7 Feb 2020 21:57:32 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Dq0X0PfZz44FZ; Fri, 7 Feb 2020 21:57:32 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 092E8B364; Fri, 7 Feb 2020 21:57:32 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 017LvV7a008128; Fri, 7 Feb 2020 21:57:31 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 017LvT5o008116; Fri, 7 Feb 2020 21:57:29 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202002072157.017LvT5o008116@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 7 Feb 2020 21:57:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357667 - in stable: 11/lib/libbe 11/lib/libbe/tests 11/sbin/bectl 12/lib/libbe 12/lib/libbe/tests 12/sbin/bectl X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/lib/libbe 11/lib/libbe/tests 11/sbin/bectl 12/lib/libbe 12/lib/libbe/tests 12/sbin/bectl X-SVN-Commit-Revision: 357667 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2020 21:57:32 -0000 Author: kevans Date: Fri Feb 7 21:57:27 2020 New Revision: 357667 URL: https://svnweb.freebsd.org/changeset/base/357667 Log: MFC r357067: Drop "All Rights Reserved" from all libbe/bectl files Modified: stable/12/lib/libbe/be.c stable/12/lib/libbe/be.h stable/12/lib/libbe/be_access.c stable/12/lib/libbe/be_error.c stable/12/lib/libbe/be_impl.h stable/12/lib/libbe/be_info.c stable/12/lib/libbe/libbe.3 stable/12/lib/libbe/tests/target_prog.c stable/12/sbin/bectl/bectl.8 stable/12/sbin/bectl/bectl.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/lib/libbe/be.c stable/11/lib/libbe/be.h stable/11/lib/libbe/be_access.c stable/11/lib/libbe/be_error.c stable/11/lib/libbe/be_impl.h stable/11/lib/libbe/be_info.c stable/11/lib/libbe/libbe.3 stable/11/lib/libbe/tests/target_prog.c stable/11/sbin/bectl/bectl.8 stable/11/sbin/bectl/bectl.c Directory Properties: stable/11/ (props changed) Modified: stable/12/lib/libbe/be.c ============================================================================== --- stable/12/lib/libbe/be.c Fri Feb 7 21:55:45 2020 (r357666) +++ stable/12/lib/libbe/be.c Fri Feb 7 21:57:27 2020 (r357667) @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2017 Kyle J. Kneitinger - * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/12/lib/libbe/be.h ============================================================================== --- stable/12/lib/libbe/be.h Fri Feb 7 21:55:45 2020 (r357666) +++ stable/12/lib/libbe/be.h Fri Feb 7 21:57:27 2020 (r357667) @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2017 Kyle J. Kneitinger - * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/12/lib/libbe/be_access.c ============================================================================== --- stable/12/lib/libbe/be_access.c Fri Feb 7 21:55:45 2020 (r357666) +++ stable/12/lib/libbe/be_access.c Fri Feb 7 21:57:27 2020 (r357667) @@ -4,7 +4,6 @@ * Copyright (c) 2017 Kyle J. Kneitinger * Copyright (c) 2018 Kyle Evans * Copyright (c) 2019 Wes Maag - * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/12/lib/libbe/be_error.c ============================================================================== --- stable/12/lib/libbe/be_error.c Fri Feb 7 21:55:45 2020 (r357666) +++ stable/12/lib/libbe/be_error.c Fri Feb 7 21:57:27 2020 (r357667) @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2017 Kyle J. Kneitinger - * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/12/lib/libbe/be_impl.h ============================================================================== --- stable/12/lib/libbe/be_impl.h Fri Feb 7 21:55:45 2020 (r357666) +++ stable/12/lib/libbe/be_impl.h Fri Feb 7 21:57:27 2020 (r357667) @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2017 Kyle J. Kneitinger - * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/12/lib/libbe/be_info.c ============================================================================== --- stable/12/lib/libbe/be_info.c Fri Feb 7 21:55:45 2020 (r357666) +++ stable/12/lib/libbe/be_info.c Fri Feb 7 21:57:27 2020 (r357667) @@ -3,7 +3,6 @@ * * Copyright (c) 2017 Kyle J. Kneitinger * Copyright (c) 2018 Kyle Evans - * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/12/lib/libbe/libbe.3 ============================================================================== --- stable/12/lib/libbe/libbe.3 Fri Feb 7 21:55:45 2020 (r357666) +++ stable/12/lib/libbe/libbe.3 Fri Feb 7 21:57:27 2020 (r357667) @@ -2,7 +2,6 @@ .\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD .\" .\" Copyright (c) 2017 Kyle Kneitinger -.\" All rights reserved. .\" Copyright (c) 2018 Kyle Evans .\" .\" Redistribution and use in source and binary forms, with or without Modified: stable/12/lib/libbe/tests/target_prog.c ============================================================================== --- stable/12/lib/libbe/tests/target_prog.c Fri Feb 7 21:55:45 2020 (r357666) +++ stable/12/lib/libbe/tests/target_prog.c Fri Feb 7 21:57:27 2020 (r357667) @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2019 Rob Wing - * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/12/sbin/bectl/bectl.8 ============================================================================== --- stable/12/sbin/bectl/bectl.8 Fri Feb 7 21:55:45 2020 (r357666) +++ stable/12/sbin/bectl/bectl.8 Fri Feb 7 21:57:27 2020 (r357667) @@ -2,7 +2,6 @@ .\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD .\" .\" Copyright (c) 2017 Kyle J. Kneitinger -.\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions Modified: stable/12/sbin/bectl/bectl.c ============================================================================== --- stable/12/sbin/bectl/bectl.c Fri Feb 7 21:55:45 2020 (r357666) +++ stable/12/sbin/bectl/bectl.c Fri Feb 7 21:57:27 2020 (r357667) @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2017 Kyle J. Kneitinger - * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions From owner-svn-src-all@freebsd.org Fri Feb 7 22:21:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6E58922FC96; Fri, 7 Feb 2020 22:21:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48DqXT2N87z45S9; Fri, 7 Feb 2020 22:21:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4C5A7B7B6; Fri, 7 Feb 2020 22:21:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 017MLjLQ023236; Fri, 7 Feb 2020 22:21:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 017MLjX5023235; Fri, 7 Feb 2020 22:21:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202002072221.017MLjX5023235@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 7 Feb 2020 22:21:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357668 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 357668 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2020 22:21:45 -0000 Author: kib Date: Fri Feb 7 22:21:44 2020 New Revision: 357668 URL: https://svnweb.freebsd.org/changeset/base/357668 Log: linux futex_put(): do not touch futex after dropping our reference. Reported and tested by: Steve Roome Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/compat/linux/linux_futex.c Modified: head/sys/compat/linux/linux_futex.c ============================================================================== --- head/sys/compat/linux/linux_futex.c Fri Feb 7 21:57:27 2020 (r357667) +++ head/sys/compat/linux/linux_futex.c Fri Feb 7 22:21:44 2020 (r357668) @@ -329,9 +329,9 @@ futex_put(struct futex *f, struct waiting_proc *wp) f->f_key.shared); LINUX_CTR3(sys_futex, "futex_put uaddr %p ref %d shared %d", f->f_uaddr, f->f_refcount, f->f_key.shared); - FUTEXES_UNLOCK; if (FUTEX_LOCKED(f)) futex_unlock(f); + FUTEXES_UNLOCK; LIN_SDT_PROBE0(futex, futex_put, return); } From owner-svn-src-all@freebsd.org Fri Feb 7 22:26:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 772BD22FD73; Fri, 7 Feb 2020 22:26:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Dqdc2XH3z45f4; Fri, 7 Feb 2020 22:26:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 51F8CB90B; Fri, 7 Feb 2020 22:26:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 017MQCRl025817; Fri, 7 Feb 2020 22:26:12 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 017MQCnX025816; Fri, 7 Feb 2020 22:26:12 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202002072226.017MQCnX025816@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 7 Feb 2020 22:26:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357669 - head/sys/dev/acpica X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/dev/acpica X-SVN-Commit-Revision: 357669 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2020 22:26:12 -0000 Author: kib Date: Fri Feb 7 22:26:11 2020 New Revision: 357669 URL: https://svnweb.freebsd.org/changeset/base/357669 Log: acpi_hpet: Add Hygon Dhyana support. Submitted by: Pu Wen MFC after: 1 week Differential revision: https://reviews.freebsd.org/D23555 Modified: head/sys/dev/acpica/acpi_hpet.c Modified: head/sys/dev/acpica/acpi_hpet.c ============================================================================== --- head/sys/dev/acpica/acpi_hpet.c Fri Feb 7 22:21:44 2020 (r357668) +++ head/sys/dev/acpica/acpi_hpet.c Fri Feb 7 22:26:11 2020 (r357669) @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$"); #define HPET_VENDID_AMD 0x4353 #define HPET_VENDID_AMD2 0x1022 +#define HPET_VENDID_HYGON 0x1d94 #define HPET_VENDID_INTEL 0x8086 #define HPET_VENDID_NVIDIA 0x10de #define HPET_VENDID_SW 0x1166 @@ -606,7 +607,8 @@ hpet_attach(device_t dev) * properly, that makes it very unreliable - it freezes after any * interrupt loss. Avoid legacy IRQs for AMD. */ - if (vendor == HPET_VENDID_AMD || vendor == HPET_VENDID_AMD2) + if (vendor == HPET_VENDID_AMD || vendor == HPET_VENDID_AMD2 || + vendor == HPET_VENDID_HYGON) sc->allowed_irqs = 0x00000000; /* * NVidia MCP5x chipsets have number of unexplained interrupt From owner-svn-src-all@freebsd.org Fri Feb 7 22:28:05 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D354222FE80; Fri, 7 Feb 2020 22:28:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Dqgn5CTLz45p9; Fri, 7 Feb 2020 22:28:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ADF8AB913; Fri, 7 Feb 2020 22:28:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 017MS52X025941; Fri, 7 Feb 2020 22:28:05 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 017MS4wX025938; Fri, 7 Feb 2020 22:28:04 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202002072228.017MS4wX025938@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 7 Feb 2020 22:28:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357670 - in head: lib/libpmc lib/libpmc/pmu-events/arch/x86 sys/dev/hwpmc X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head: lib/libpmc lib/libpmc/pmu-events/arch/x86 sys/dev/hwpmc X-SVN-Commit-Revision: 357670 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2020 22:28:05 -0000 Author: kib Date: Fri Feb 7 22:28:04 2020 New Revision: 357670 URL: https://svnweb.freebsd.org/changeset/base/357670 Log: pmc: Add Hygon Dhyana support. To make the PMC tool pmcstat working properly on Hygon platform, add support for Hygon Dhyana family 18h by using the PMC initialization code path of AMD family 17h. Submitted by: Pu Wen MFC after: 1 week Differential revision: https://reviews.freebsd.org/D23562 Modified: head/lib/libpmc/libpmc_pmu_util.c head/lib/libpmc/pmu-events/arch/x86/mapfile.csv head/sys/dev/hwpmc/hwpmc_amd.c head/sys/dev/hwpmc/hwpmc_x86.c Modified: head/lib/libpmc/libpmc_pmu_util.c ============================================================================== --- head/lib/libpmc/libpmc_pmu_util.c Fri Feb 7 22:26:11 2020 (r357669) +++ head/lib/libpmc/libpmc_pmu_util.c Fri Feb 7 22:28:04 2020 (r357670) @@ -103,7 +103,8 @@ pmu_events_mfr(void) free(buf); return (PMU_INVALID); } - if (strcasestr(buf, "AuthenticAMD") != NULL) + if (strcasestr(buf, "AuthenticAMD") != NULL || + strcasestr(buf, "HygonGenuine") != NULL) mfr = PMU_AMD; else if (strcasestr(buf, "GenuineIntel") != NULL) mfr = PMU_INTEL; Modified: head/lib/libpmc/pmu-events/arch/x86/mapfile.csv ============================================================================== --- head/lib/libpmc/pmu-events/arch/x86/mapfile.csv Fri Feb 7 22:26:11 2020 (r357669) +++ head/lib/libpmc/pmu-events/arch/x86/mapfile.csv Fri Feb 7 22:28:04 2020 (r357670) @@ -41,3 +41,4 @@ AuthenticAMD-23-02,v1,amdfam17h,core AuthenticAMD-23-03,v1,amdfam17h,core AuthenticAMD-23-04,v1,amdfam17h,core AuthenticAMD-23-05,v1,amdfam17h,core +HygonGenuine-24-00,v1,amdfam17h,core Modified: head/sys/dev/hwpmc/hwpmc_amd.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_amd.c Fri Feb 7 22:26:11 2020 (r357669) +++ head/sys/dev/hwpmc/hwpmc_amd.c Fri Feb 7 22:28:04 2020 (r357670) @@ -1089,6 +1089,9 @@ pmc_amd_initialize(void) if (CPUID_TO_FAMILY(cpu_id) == 0x17) snprintf(pmc_cpuid, sizeof(pmc_cpuid), "AuthenticAMD-%d-%02X", CPUID_TO_FAMILY(cpu_id), model); + if (CPUID_TO_FAMILY(cpu_id) == 0x18) + snprintf(pmc_cpuid, sizeof(pmc_cpuid), "HygonGenuine-%d-%02X", + CPUID_TO_FAMILY(cpu_id), model); switch (cpu_id & 0xF00) { #if defined(__i386__) Modified: head/sys/dev/hwpmc/hwpmc_x86.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_x86.c Fri Feb 7 22:26:11 2020 (r357669) +++ head/sys/dev/hwpmc/hwpmc_x86.c Fri Feb 7 22:28:04 2020 (r357670) @@ -248,7 +248,8 @@ pmc_md_initialize() struct pmc_mdep *md; /* determine the CPU kind */ - if (cpu_vendor_id == CPU_VENDOR_AMD) + if (cpu_vendor_id == CPU_VENDOR_AMD || + cpu_vendor_id == CPU_VENDOR_HYGON) md = pmc_amd_initialize(); else if (cpu_vendor_id == CPU_VENDOR_INTEL) md = pmc_intel_initialize(); @@ -271,7 +272,8 @@ pmc_md_finalize(struct pmc_mdep *md) { lapic_disable_pmc(); - if (cpu_vendor_id == CPU_VENDOR_AMD) + if (cpu_vendor_id == CPU_VENDOR_AMD || + cpu_vendor_id == CPU_VENDOR_HYGON) pmc_amd_finalize(md); else if (cpu_vendor_id == CPU_VENDOR_INTEL) pmc_intel_finalize(md); From owner-svn-src-all@freebsd.org Fri Feb 7 22:36:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 70D8C230125; Fri, 7 Feb 2020 22:36:38 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Dqsf2RR6z46Tn; Fri, 7 Feb 2020 22:36:38 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2FF4DBC86; Fri, 7 Feb 2020 22:36:38 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 017MabOU031988; Fri, 7 Feb 2020 22:36:37 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 017Mab5R031987; Fri, 7 Feb 2020 22:36:37 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202002072236.017Mab5R031987@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 7 Feb 2020 22:36:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357671 - head/contrib/netbsd-tests/lib/libc/c063 X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/contrib/netbsd-tests/lib/libc/c063 X-SVN-Commit-Revision: 357671 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2020 22:36:38 -0000 Author: kevans Date: Fri Feb 7 22:36:37 2020 New Revision: 357671 URL: https://svnweb.freebsd.org/changeset/base/357671 Log: O_SEARCH test: mark revokex an expected fail on NFS The revokex test does not work when the scratch directory is created on NFS. Given the nature of NFS, it likely can never work without looking like a security hole since O_SEARCH would rely on the server knowing that the directory did have +x at the time of open and that it's OK for it to have been revoked based on POSIX specification for O_SEARCH. This does mean that O_SEARCH is only partially functional on NFS in general, but I suspect the execute bit getting revoked in the process is likely not common. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D23573 Modified: head/contrib/netbsd-tests/lib/libc/c063/t_o_search.c Modified: head/contrib/netbsd-tests/lib/libc/c063/t_o_search.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/c063/t_o_search.c Fri Feb 7 22:28:04 2020 (r357670) +++ head/contrib/netbsd-tests/lib/libc/c063/t_o_search.c Fri Feb 7 22:36:37 2020 (r357671) @@ -34,6 +34,11 @@ __RCSID("$NetBSD: t_o_search.c,v 1.9 2020/02/06 12:18: #include #include +#ifdef __FreeBSD__ +#include +#else +#include +#endif #include #include @@ -322,6 +327,23 @@ ATF_TC_BODY(o_search_revokex, tc) /* Drop permissions. The kernel must still not check the exec bit. */ ATF_REQUIRE(chmod(DIR, 0000) == 0); + { + const char *fstypename; +#ifdef __FreeBSD__ + struct statfs st; + + fstatfs(dfd, &st); + fstypename = st.f_fstypename; +#else + struct statvfs vst; + + fstatvfs(dfd, &vst); + fstypename = vst.f_fstypename; +#endif + if (strcmp(fstypename, "nfs") == 0) + atf_tc_expect_fail( + "NFS protocol cannot observe O_SEARCH semantics"); + } ATF_REQUIRE(fstatat(dfd, BASEFILE, &sb, 0) == 0); ATF_REQUIRE(close(dfd) == 0); From owner-svn-src-all@freebsd.org Fri Feb 7 22:43:59 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5F6062303E4; Fri, 7 Feb 2020 22:43:59 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Dr271y94z46ss; Fri, 7 Feb 2020 22:43:59 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3E44ABE65; Fri, 7 Feb 2020 22:43:59 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 017MhxHv037777; Fri, 7 Feb 2020 22:43:59 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 017MhxsS037776; Fri, 7 Feb 2020 22:43:59 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202002072243.017MhxsS037776@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 7 Feb 2020 22:43:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357672 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 357672 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2020 22:43:59 -0000 Author: mjg Date: Fri Feb 7 22:43:58 2020 New Revision: 357672 URL: https://svnweb.freebsd.org/changeset/base/357672 Log: Add zpcpu_{set,add,sub}_protected. The _protected suffix follows counter(9). Modified: head/sys/sys/pcpu.h Modified: head/sys/sys/pcpu.h ============================================================================== --- head/sys/sys/pcpu.h Fri Feb 7 22:36:37 2020 (r357671) +++ head/sys/sys/pcpu.h Fri Feb 7 22:43:58 2020 (r357672) @@ -256,6 +256,24 @@ extern struct pcpu *cpuid_to_pcpu[]; _old; \ }) +#define zpcpu_set_protected(base, val) ({ \ + MPASS(curthread->td_critnest > 0); \ + __typeof(val) *_ptr = zpcpu_get(base); \ + *_ptr = (val); \ +}) + +#define zpcpu_add_protected(base, val) ({ \ + MPASS(curthread->td_critnest > 0); \ + __typeof(val) *_ptr = zpcpu_get(base); \ + *_ptr += (val); \ +}) + +#define zpcpu_sub_protected(base, val) ({ \ + MPASS(curthread->td_critnest > 0); \ + __typeof(val) *_ptr = zpcpu_get(base); \ + *_ptr -= (val); \ +}) + /* * Machine dependent callouts. cpu_pcpu_init() is responsible for * initializing machine dependent fields of struct pcpu, and From owner-svn-src-all@freebsd.org Fri Feb 7 22:44:42 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0E7FC230494; Fri, 7 Feb 2020 22:44:42 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Dr2x6HJyz471S; Fri, 7 Feb 2020 22:44:41 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B8C03BE66; Fri, 7 Feb 2020 22:44:41 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 017Mifgh037888; Fri, 7 Feb 2020 22:44:41 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 017MifN1037887; Fri, 7 Feb 2020 22:44:41 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202002072244.017MifN1037887@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 7 Feb 2020 22:44:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357673 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 357673 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2020 22:44:42 -0000 Author: mjg Date: Fri Feb 7 22:44:41 2020 New Revision: 357673 URL: https://svnweb.freebsd.org/changeset/base/357673 Log: rms: use newly added zpcpu routines instead of direct access where appropriate Modified: head/sys/kern/kern_rmlock.c Modified: head/sys/kern/kern_rmlock.c ============================================================================== --- head/sys/kern/kern_rmlock.c Fri Feb 7 22:43:58 2020 (r357672) +++ head/sys/kern/kern_rmlock.c Fri Feb 7 22:44:41 2020 (r357673) @@ -900,60 +900,56 @@ static void __noinline rms_rlock_fallback(struct rmslock *rms) { - (*zpcpu_get(rms->readers_influx)) = 0; + zpcpu_set_protected(rms->readers_influx, 0); critical_exit(); mtx_lock(&rms->mtx); MPASS(*zpcpu_get(rms->readers_pcpu) == 0); while (rms->writers > 0) msleep(&rms->readers, &rms->mtx, PUSER - 1, mtx_name(&rms->mtx), 0); - (*zpcpu_get(rms->readers_pcpu))++; + critical_enter(); + zpcpu_add_protected(rms->readers_pcpu, 1); mtx_unlock(&rms->mtx); + critical_exit(); } void rms_rlock(struct rmslock *rms) { - int *influx; WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, __func__); critical_enter(); - influx = zpcpu_get(rms->readers_influx); + zpcpu_set_protected(rms->readers_influx, 1); __compiler_membar(); - *influx = 1; - __compiler_membar(); if (__predict_false(rms->writers > 0)) { rms_rlock_fallback(rms); return; } __compiler_membar(); - (*zpcpu_get(rms->readers_pcpu))++; + zpcpu_add_protected(rms->readers_pcpu, 1); __compiler_membar(); - *influx = 0; + zpcpu_set_protected(rms->readers_influx, 0); critical_exit(); } int rms_try_rlock(struct rmslock *rms) { - int *influx; critical_enter(); - influx = zpcpu_get(rms->readers_influx); + zpcpu_set_protected(rms->readers_influx, 1); __compiler_membar(); - *influx = 1; - __compiler_membar(); if (__predict_false(rms->writers > 0)) { __compiler_membar(); - *influx = 0; + zpcpu_set_protected(rms->readers_influx, 0); critical_exit(); return (0); } __compiler_membar(); - (*zpcpu_get(rms->readers_pcpu))++; + zpcpu_add_protected(rms->readers_pcpu, 1); __compiler_membar(); - *influx = 0; + zpcpu_set_protected(rms->readers_influx, 0); critical_exit(); return (1); } @@ -962,7 +958,7 @@ static void __noinline rms_runlock_fallback(struct rmslock *rms) { - (*zpcpu_get(rms->readers_influx)) = 0; + zpcpu_set_protected(rms->readers_influx, 0); critical_exit(); mtx_lock(&rms->mtx); @@ -978,21 +974,18 @@ rms_runlock_fallback(struct rmslock *rms) void rms_runlock(struct rmslock *rms) { - int *influx; critical_enter(); - influx = zpcpu_get(rms->readers_influx); + zpcpu_set_protected(rms->readers_influx, 1); __compiler_membar(); - *influx = 1; - __compiler_membar(); if (__predict_false(rms->writers > 0)) { rms_runlock_fallback(rms); return; } __compiler_membar(); - (*zpcpu_get(rms->readers_pcpu))--; + zpcpu_sub_protected(rms->readers_pcpu, 1); __compiler_membar(); - *influx = 0; + zpcpu_set_protected(rms->readers_influx, 0); critical_exit(); } From owner-svn-src-all@freebsd.org Fri Feb 7 22:45:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E1C9B230525; Fri, 7 Feb 2020 22:45:09 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Dr3T5fCyz477v; Fri, 7 Feb 2020 22:45:09 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BD128BE68; Fri, 7 Feb 2020 22:45:09 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 017Mj9iB037976; Fri, 7 Feb 2020 22:45:09 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 017Mj91v037975; Fri, 7 Feb 2020 22:45:09 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202002072245.017Mj91v037975@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 7 Feb 2020 22:45:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357674 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 357674 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2020 22:45:09 -0000 Author: mjg Date: Fri Feb 7 22:45:09 2020 New Revision: 357674 URL: https://svnweb.freebsd.org/changeset/base/357674 Log: vfs: use newly added zpcpu routines instead of direct access where appropriate Modified: head/sys/sys/mount.h Modified: head/sys/sys/mount.h ============================================================================== --- head/sys/sys/mount.h Fri Feb 7 22:44:41 2020 (r357673) +++ head/sys/sys/mount.h Fri Feb 7 22:45:09 2020 (r357674) @@ -1001,14 +1001,14 @@ int vfs_mount_fetch_counter(struct mount *, enum mount */ #define vfs_op_thread_entered(mp) ({ \ MPASS(curthread->td_critnest > 0); \ - *(int *)zpcpu_get(mp->mnt_thread_in_ops_pcpu) == 1; \ + *zpcpu_get(mp->mnt_thread_in_ops_pcpu) == 1; \ }) #define vfs_op_thread_enter(mp) ({ \ bool _retval = true; \ critical_enter(); \ MPASS(!vfs_op_thread_entered(mp)); \ - *(int *)zpcpu_get(mp->mnt_thread_in_ops_pcpu) = 1; \ + zpcpu_set_protected(mp->mnt_thread_in_ops_pcpu, 1); \ atomic_thread_fence_seq_cst(); \ if (__predict_false(mp->mnt_vfs_ops > 0)) { \ vfs_op_thread_exit(mp); \ @@ -1020,18 +1020,18 @@ int vfs_mount_fetch_counter(struct mount *, enum mount #define vfs_op_thread_exit(mp) do { \ MPASS(vfs_op_thread_entered(mp)); \ atomic_thread_fence_rel(); \ - *(int *)zpcpu_get(mp->mnt_thread_in_ops_pcpu) = 0; \ + zpcpu_set_protected(mp->mnt_thread_in_ops_pcpu, 0); \ critical_exit(); \ } while (0) #define vfs_mp_count_add_pcpu(mp, count, val) do { \ MPASS(vfs_op_thread_entered(mp)); \ - (*(int *)zpcpu_get(mp->mnt_##count##_pcpu)) += val; \ + zpcpu_add_protected(mp->mnt_##count##_pcpu, val); \ } while (0) #define vfs_mp_count_sub_pcpu(mp, count, val) do { \ MPASS(vfs_op_thread_entered(mp)); \ - (*(int *)zpcpu_get(mp->mnt_##count##_pcpu)) -= val; \ + zpcpu_sub_protected(mp->mnt_##count##_pcpu, val); \ } while (0) #else /* !_KERNEL */ From owner-svn-src-all@freebsd.org Sat Feb 8 13:25:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DAE002426FF; Sat, 8 Feb 2020 13:25:39 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48FCbR5QN6z3L5h; Sat, 8 Feb 2020 13:25:39 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B48BE1E0AC; Sat, 8 Feb 2020 13:25:39 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 018DPdoo066273; Sat, 8 Feb 2020 13:25:39 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 018DPdO3066272; Sat, 8 Feb 2020 13:25:39 GMT (envelope-from mw@FreeBSD.org) Message-Id: <202002081325.018DPdO3066272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Sat, 8 Feb 2020 13:25:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357675 - head/sys/dev/neta X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/neta X-SVN-Commit-Revision: 357675 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Feb 2020 13:25:39 -0000 Author: mw Date: Sat Feb 8 13:25:39 2020 New Revision: 357675 URL: https://svnweb.freebsd.org/changeset/base/357675 Log: Destroy RX DMA tag on detach in mvneta driver This patch fixes deinitialization sequence of the mvneta driver by adding missing bus_dma_tag_destroy call. Submitted by: Kornel Duleba Obtained from: Semihalf MFC after: 1 week Sponsored by: Stormshield Modified: head/sys/dev/neta/if_mvneta.c Modified: head/sys/dev/neta/if_mvneta.c ============================================================================== --- head/sys/dev/neta/if_mvneta.c Fri Feb 7 22:45:09 2020 (r357674) +++ head/sys/dev/neta/if_mvneta.c Sat Feb 8 13:25:39 2020 (r357675) @@ -874,6 +874,8 @@ mvneta_detach(device_t dev) bus_dma_tag_destroy(sc->rx_dtag); if (sc->txmbuf_dtag != NULL) bus_dma_tag_destroy(sc->txmbuf_dtag); + if (sc->rxbuf_dtag != NULL) + bus_dma_tag_destroy(sc->rxbuf_dtag); bus_release_resources(dev, res_spec, sc->res); return (0); From owner-svn-src-all@freebsd.org Sat Feb 8 13:33:48 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BB9E724299F; Sat, 8 Feb 2020 13:33:48 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48FCmr4NZbz3LWD; Sat, 8 Feb 2020 13:33:48 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 91B481E285; Sat, 8 Feb 2020 13:33:48 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 018DXmvU072183; Sat, 8 Feb 2020 13:33:48 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 018DXmVK072180; Sat, 8 Feb 2020 13:33:48 GMT (envelope-from mw@FreeBSD.org) Message-Id: <202002081333.018DXmVK072180@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Sat, 8 Feb 2020 13:33:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357676 - head/sys/dev/neta X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/neta X-SVN-Commit-Revision: 357676 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Feb 2020 13:33:48 -0000 Author: mw Date: Sat Feb 8 13:33:47 2020 New Revision: 357676 URL: https://svnweb.freebsd.org/changeset/base/357676 Log: Implement jumbo frame support in mvneta driver This patch introduces processing of the frames up to 9kB by the mvneta driver. Some versions of this NIC limit TX checksum offloading, depending on the frame size, so add appropriate handling of this feature. Submitted by: Kornel Duleba Obtained from: Semihalf Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D23225 Modified: head/sys/dev/neta/if_mvneta.c head/sys/dev/neta/if_mvneta_fdt.c head/sys/dev/neta/if_mvnetavar.h Modified: head/sys/dev/neta/if_mvneta.c ============================================================================== --- head/sys/dev/neta/if_mvneta.c Sat Feb 8 13:25:39 2020 (r357675) +++ head/sys/dev/neta/if_mvneta.c Sat Feb 8 13:33:47 2020 (r357676) @@ -483,9 +483,9 @@ mvneta_dma_create(struct mvneta_softc *sc) BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filtfunc, filtfuncarg */ - MVNETA_PACKET_SIZE, /* maxsize */ + MVNETA_MAX_FRAME, /* maxsize */ MVNETA_TX_SEGLIMIT, /* nsegments */ - MVNETA_PACKET_SIZE, /* maxsegsz */ + MVNETA_MAX_FRAME, /* maxsegsz */ BUS_DMA_ALLOCNOW, /* flags */ NULL, NULL, /* lockfunc, lockfuncarg */ &sc->txmbuf_dtag); @@ -533,8 +533,8 @@ mvneta_dma_create(struct mvneta_softc *sc) BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filtfunc, filtfuncarg */ - MVNETA_PACKET_SIZE, 1, /* maxsize, nsegments */ - MVNETA_PACKET_SIZE, /* maxsegsz */ + MVNETA_MAX_FRAME, 1, /* maxsize, nsegments */ + MVNETA_MAX_FRAME, /* maxsegsz */ 0, /* flags */ NULL, NULL, /* lockfunc, lockfuncarg */ &sc->rxbuf_dtag); /* dmat */ @@ -674,6 +674,8 @@ mvneta_attach(device_t self) ifp->if_hwassist = CSUM_IP | CSUM_TCP | CSUM_UDP; + sc->rx_frame_size = MCLBYTES; /* ether_ifattach() always sets normal mtu */ + /* * Device DMA Buffer allocation. * Handles resource deallocation in case of failure. @@ -1158,7 +1160,7 @@ mvneta_initreg(struct ifnet *ifp) /* Port MAC Control set 0 */ reg = MVNETA_PMACC0_MUSTSET; /* must write 0x1 */ reg &= ~MVNETA_PMACC0_PORTEN; /* port is still disabled */ - reg |= MVNETA_PMACC0_FRAMESIZELIMIT(MVNETA_MAX_FRAME); + reg |= MVNETA_PMACC0_FRAMESIZELIMIT(ifp->if_mtu + MVNETA_ETHER_SIZE); MVNETA_WRITE(sc, MVNETA_PMACC0, reg); /* Port MAC Control set 2 */ @@ -1525,7 +1527,7 @@ mvneta_rx_queue_init(struct ifnet *ifp, int q) MVNETA_WRITE(sc, MVNETA_PRXDQA(q), rx->desc_pa); /* Rx buffer size and descriptor ring size */ - reg = MVNETA_PRXDQS_BUFFERSIZE(MVNETA_PACKET_SIZE >> 3); + reg = MVNETA_PRXDQS_BUFFERSIZE(sc->rx_frame_size >> 3); reg |= MVNETA_PRXDQS_DESCRIPTORSQUEUESIZE(MVNETA_RX_RING_CNT); MVNETA_WRITE(sc, MVNETA_PRXDQS(q), reg); #ifdef MVNETA_KTR @@ -2103,7 +2105,7 @@ mvneta_ioctl(struct ifnet *ifp, u_long cmd, caddr_t da mvneta_sc_unlock(sc); break; case SIOCSIFCAP: - if (ifp->if_mtu > MVNETA_MAX_CSUM_MTU && + if (ifp->if_mtu > sc->tx_csum_limit && ifr->ifr_reqcap & IFCAP_TXCSUM) ifr->ifr_reqcap &= ~IFCAP_TXCSUM; mask = ifp->if_capenable ^ ifr->ifr_reqcap; @@ -2157,7 +2159,12 @@ mvneta_ioctl(struct ifnet *ifp, u_long cmd, caddr_t da } else { ifp->if_mtu = ifr->ifr_mtu; mvneta_sc_lock(sc); - if (ifp->if_mtu > MVNETA_MAX_CSUM_MTU) { + if (ifp->if_mtu + MVNETA_ETHER_SIZE <= MCLBYTES) { + sc->rx_frame_size = MCLBYTES; + } else { + sc->rx_frame_size = MJUM9BYTES; + } + if (ifp->if_mtu > sc->tx_csum_limit) { ifp->if_capenable &= ~IFCAP_TXCSUM; ifp->if_hwassist = 0; } else { @@ -2167,8 +2174,25 @@ mvneta_ioctl(struct ifnet *ifp, u_long cmd, caddr_t da } if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - /* Trigger reinitialize sequence */ + /* Stop hardware */ mvneta_stop_locked(sc); + /* + * Reinitialize RX queues. + * We need to update RX descriptor size. + */ + for (q = 0; q < MVNETA_RX_QNUM_MAX; q++) { + mvneta_rx_lockq(sc, q); + if (mvneta_rx_queue_init(ifp, q) != 0) { + device_printf(sc->dev, + "initialization failed:" + " cannot initialize queue\n"); + mvneta_rx_unlockq(sc, q); + error = ENOBUFS; + break; + } + mvneta_rx_unlockq(sc, q); + } + /* Trigger reinitialization */ mvneta_init_locked(sc); } mvneta_sc_unlock(sc); @@ -2214,6 +2238,8 @@ mvneta_init_locked(void *arg) /* Enable port */ reg = MVNETA_READ(sc, MVNETA_PMACC0); reg |= MVNETA_PMACC0_PORTEN; + reg &= ~MVNETA_PMACC0_FRAMESIZELIMIT_MASK; + reg |= MVNETA_PMACC0_FRAMESIZELIMIT(ifp->if_mtu + MVNETA_ETHER_SIZE); MVNETA_WRITE(sc, MVNETA_PMACC0, reg); /* Allow access to each TXQ/RXQ from both CPU's */ @@ -2801,6 +2827,10 @@ mvneta_tx_set_csumflag(struct ifnet *ifp, iphl = ipoff = 0; csum_flags = ifp->if_hwassist & m->m_pkthdr.csum_flags; eh = mtod(m, struct ether_header *); + + if (csum_flags == 0) + return; + switch (ntohs(eh->ether_type)) { case ETHERTYPE_IP: ipoff = ETHER_HDR_LEN; @@ -3158,7 +3188,7 @@ mvneta_rx_queue_refill(struct mvneta_softc *sc, int q) for (npkt = 0; npkt < refill; npkt++) { rxbuf = &rx->rxbuf[rx->cpu]; - m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); + m = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, sc->rx_frame_size); if (__predict_false(m == NULL)) { error = ENOBUFS; break; Modified: head/sys/dev/neta/if_mvneta_fdt.c ============================================================================== --- head/sys/dev/neta/if_mvneta_fdt.c Sat Feb 8 13:25:39 2020 (r357675) +++ head/sys/dev/neta/if_mvneta_fdt.c Sat Feb 8 13:33:47 2020 (r357676) @@ -106,12 +106,33 @@ mvneta_fdt_probe(device_t dev) static int mvneta_fdt_attach(device_t dev) { + struct mvneta_softc *sc; + uint32_t tx_csum_limit; int err; + sc = device_get_softc(dev); + /* Try to fetch PHY information from FDT */ err = mvneta_fdt_phy_acquire(dev); if (err != 0) return (err); + + if (ofw_bus_is_compatible(dev, "marvell,armada-370-neta")) { + tx_csum_limit = MVNETA_A370_MAX_CSUM_MTU; + } else { + tx_csum_limit = MVNETA_A3700_MAX_CSUM_MTU; + } + + if (ofw_bus_has_prop(dev, "tx-csum-limit")) { + err = OF_getprop(ofw_bus_get_node(dev), "tx-csum-limit", + &tx_csum_limit, sizeof(tx_csum_limit)); + if (err <= 0) { + device_printf(dev, + "Failed to acquire tx-csum-limit property\n"); + return (ENXIO); + } + } + sc->tx_csum_limit = tx_csum_limit; return (mvneta_attach(dev)); } Modified: head/sys/dev/neta/if_mvnetavar.h ============================================================================== --- head/sys/dev/neta/if_mvnetavar.h Sat Feb 8 13:25:39 2020 (r357675) +++ head/sys/dev/neta/if_mvnetavar.h Sat Feb 8 13:33:47 2020 (r357676) @@ -32,15 +32,12 @@ #define _IF_MVNETAVAR_H_ #include -#define MVNETA_HWHEADER_SIZE 2 /* Marvell Header */ -#define MVNETA_ETHER_SIZE 22 /* Maximum ether size */ -#define MVNETA_MAX_CSUM_MTU 1600 /* Port1,2 hw limit */ +#define MVNETA_HWHEADER_SIZE 2 /* Marvell Header */ +#define MVNETA_ETHER_SIZE 22 /* Maximum ether size */ +#define MVNETA_A370_MAX_CSUM_MTU 1600 /* Max frame len for TX csum */ +#define MVNETA_A3700_MAX_CSUM_MTU 9600 -/* - * Limit support for frame up to hw csum limit - * until jumbo frame support is added. - */ -#define MVNETA_MAX_FRAME (MVNETA_MAX_CSUM_MTU + MVNETA_ETHER_SIZE) +#define MVNETA_MAX_FRAME (MJUM9BYTES) /* * Default limit of queue length @@ -54,7 +51,6 @@ #define MVNETA_BUFRING_SIZE 1024 #define MVNETA_PACKET_OFFSET 64 -#define MVNETA_PACKET_SIZE MCLBYTES #define MVNETA_RXTH_COUNT 128 #define MVNETA_RX_REFILL_COUNT 8 @@ -268,6 +264,8 @@ struct mvneta_softc { struct ifnet *ifp; uint32_t mvneta_if_flags; uint32_t mvneta_media; + uint32_t tx_csum_limit; + uint32_t rx_frame_size; int phy_attached; enum mvneta_phy_mode phy_mode; From owner-svn-src-all@freebsd.org Sat Feb 8 13:35:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2B3DE242A3E; Sat, 8 Feb 2020 13:35:57 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48FCqK0LD5z3LfH; Sat, 8 Feb 2020 13:35:57 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 025E91E28A; Sat, 8 Feb 2020 13:35:57 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 018DZuf9072335; Sat, 8 Feb 2020 13:35:56 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 018DZuN9072334; Sat, 8 Feb 2020 13:35:56 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202002081335.018DZuN9072334@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 8 Feb 2020 13:35:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357677 - head/sys/arm64/linux X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/linux X-SVN-Commit-Revision: 357677 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Feb 2020 13:35:57 -0000 Author: andrew Date: Sat Feb 8 13:35:56 2020 New Revision: 357677 URL: https://svnweb.freebsd.org/changeset/base/357677 Log: Implement the Linux/arm64 VDSO gettimeofday and clock_gettime These are used by Centos 7 and will be needed for the emulators/linux_base-c7 port. Sponsored by: DARPA, AFRL Modified: head/sys/arm64/linux/linux_locore.asm Modified: head/sys/arm64/linux/linux_locore.asm ============================================================================== --- head/sys/arm64/linux/linux_locore.asm Sat Feb 8 13:33:47 2020 (r357676) +++ head/sys/arm64/linux/linux_locore.asm Sat Feb 8 13:35:56 2020 (r357677) @@ -2,6 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (C) 2018 Turing Robotic Industries Inc. + * Copyright (C) 2020 Andrew Turner * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -33,6 +34,8 @@ #include +#include + .data .globl linux_platform @@ -46,11 +49,13 @@ ENTRY(__kernel_rt_sigreturn) ret ENTRY(__kernel_gettimeofday) - brk #0 /* LINUXTODO: implement __kernel_gettimeofday */ + ldr x8, =LINUX_SYS_gettimeofday + svc #0 ret ENTRY(__kernel_clock_gettime) - brk #0 /* LINUXTODO: implement __kernel_clock_gettime */ + ldr x8, =LINUX_SYS_linux_clock_gettime + svc #0 ret ENTRY(__kernel_clock_getres) From owner-svn-src-all@freebsd.org Sat Feb 8 15:06:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0868F2441CE; Sat, 8 Feb 2020 15:06:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48FFqL6PRrz3QZ1; Sat, 8 Feb 2020 15:06:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D6FCD1F2EB; Sat, 8 Feb 2020 15:06:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 018F66MG027529; Sat, 8 Feb 2020 15:06:06 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 018F663b027528; Sat, 8 Feb 2020 15:06:06 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202002081506.018F663b027528@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 8 Feb 2020 15:06:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357678 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 357678 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Feb 2020 15:06:07 -0000 Author: kib Date: Sat Feb 8 15:06:06 2020 New Revision: 357678 URL: https://svnweb.freebsd.org/changeset/base/357678 Log: Correct the function name in the comment. Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/kern/kern_thread.c Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Sat Feb 8 13:35:56 2020 (r357677) +++ head/sys/kern/kern_thread.c Sat Feb 8 15:06:06 2020 (r357678) @@ -1085,7 +1085,7 @@ thread_suspend_check(int return_instead) * Typically, when retrying due to casueword(9) failure (rv == 1), we * should handle the stop requests there, with exception of cases when * the thread owns a kernel resource, for instance busied the umtx - * key, or when functions return immediately if casueword_check_susp() + * key, or when functions return immediately if thread_check_susp() * returned non-zero. On the other hand, retrying the whole lock * operation, we better not stop there but delegate the handling to * ast. From owner-svn-src-all@freebsd.org Sat Feb 8 15:51:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4DB2A244C3D; Sat, 8 Feb 2020 15:51:09 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48FGqK1RLTz3xV6; Sat, 8 Feb 2020 15:51:09 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2C9271FB4F; Sat, 8 Feb 2020 15:51:09 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 018Fp9Gw054311; Sat, 8 Feb 2020 15:51:09 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 018Fp8vI054303; Sat, 8 Feb 2020 15:51:08 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202002081551.018Fp8vI054303@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 8 Feb 2020 15:51:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357679 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 357679 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Feb 2020 15:51:09 -0000 Author: mjg Date: Sat Feb 8 15:51:08 2020 New Revision: 357679 URL: https://svnweb.freebsd.org/changeset/base/357679 Log: vfs: remove now useless ENODEV handling from vn_fullpath consumers Noted by: ngie Modified: head/sys/kern/kern_jail.c head/sys/kern/vfs_mount.c Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Sat Feb 8 15:06:06 2020 (r357678) +++ head/sys/kern/kern_jail.c Sat Feb 8 15:51:08 2020 (r357679) @@ -490,7 +490,6 @@ kern_jail_set(struct thread *td, struct uio *optuio, i int gotchildmax, gotenforce, gothid, gotrsnum, gotslevel; int jid, jsys, len, level; int childmax, osreldt, rsnum, slevel; - int fullpath_disabled; #if defined(INET) || defined(INET6) int ii, ij; #endif @@ -894,7 +893,6 @@ kern_jail_set(struct thread *td, struct uio *optuio, i } } - fullpath_disabled = 0; root = NULL; error = vfs_getopt(opts, "path", (void **)&path, &len); if (error == ENOENT) @@ -922,13 +920,8 @@ kern_jail_set(struct thread *td, struct uio *optuio, i g_path = malloc(MAXPATHLEN, M_TEMP, M_WAITOK); strlcpy(g_path, path, MAXPATHLEN); error = vn_path_to_global_path(td, root, g_path, MAXPATHLEN); - if (error == 0) + if (error == 0) { path = g_path; - else if (error == ENODEV) { - /* proceed if sysctl debug.disablefullpath == 1 */ - fullpath_disabled = 1; - if (len < 2 || (len == 2 && path[0] == '/')) - path = NULL; } else { /* exit on other errors */ goto done_free; @@ -939,15 +932,6 @@ kern_jail_set(struct thread *td, struct uio *optuio, i goto done_free; } VOP_UNLOCK(root); - if (fullpath_disabled) { - /* Leave room for a real-root full pathname. */ - if (len + (path[0] == '/' && strcmp(mypr->pr_path, "/") - ? strlen(mypr->pr_path) : 0) > MAXPATHLEN) { - error = ENAMETOOLONG; - vrele(root); - goto done_free; - } - } } /* @@ -1652,12 +1636,7 @@ kern_jail_set(struct thread *td, struct uio *optuio, i } if (path != NULL) { /* Try to keep a real-rooted full pathname. */ - if (fullpath_disabled && path[0] == '/' && - strcmp(mypr->pr_path, "/")) - snprintf(pr->pr_path, sizeof(pr->pr_path), "%s%s", - mypr->pr_path, path); - else - strlcpy(pr->pr_path, path, sizeof(pr->pr_path)); + strlcpy(pr->pr_path, path, sizeof(pr->pr_path)); pr->pr_root = root; } if (PR_HOST & ch_flags & ~pr_flags) { Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Sat Feb 8 15:06:06 2020 (r357678) +++ head/sys/kern/vfs_mount.c Sat Feb 8 15:51:08 2020 (r357679) @@ -1266,8 +1266,7 @@ vfs_domount( pathbuf = malloc(MNAMELEN, M_TEMP, M_WAITOK); strcpy(pathbuf, fspath); error = vn_path_to_global_path(td, vp, pathbuf, MNAMELEN); - /* debug.disablefullpath == 1 results in ENODEV */ - if (error == 0 || error == ENODEV) { + if (error == 0) { error = vfs_domount_first(td, vfsp, pathbuf, vp, fsflags, optlist); } @@ -1346,7 +1345,7 @@ kern_unmount(struct thread *td, const char *path, int NDFREE(&nd, NDF_ONLY_PNBUF); error = vn_path_to_global_path(td, nd.ni_vp, pathbuf, MNAMELEN); - if (error == 0 || error == ENODEV) + if (error == 0) vput(nd.ni_vp); } mtx_lock(&mountlist_mtx); From owner-svn-src-all@freebsd.org Sat Feb 8 15:52:21 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9ADBC244E06; Sat, 8 Feb 2020 15:52:21 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48FGrj3jPYz3xj0; Sat, 8 Feb 2020 15:52:21 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7AA241FBE9; Sat, 8 Feb 2020 15:52:21 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 018FqLhB055866; Sat, 8 Feb 2020 15:52:21 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 018FqLm5055864; Sat, 8 Feb 2020 15:52:21 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202002081552.018FqLm5055864@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 8 Feb 2020 15:52:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357680 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 357680 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Feb 2020 15:52:21 -0000 Author: mjg Date: Sat Feb 8 15:52:20 2020 New Revision: 357680 URL: https://svnweb.freebsd.org/changeset/base/357680 Log: vfs: tidy up vget_finish and vn_lock - remove assertion which duplicates vn_lock - use VNPASS instead of retyping the failure - report what flags were passed if panicking on them Modified: head/sys/kern/vfs_subr.c head/sys/kern/vfs_vnops.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sat Feb 8 15:51:08 2020 (r357679) +++ head/sys/kern/vfs_subr.c Sat Feb 8 15:52:20 2020 (r357680) @@ -2889,19 +2889,12 @@ vget_finish(struct vnode *vp, int flags, enum vgetstat { int error, old; - VNASSERT((flags & LK_TYPE_MASK) != 0, vp, - ("%s: invalid lock operation", __func__)); - if ((flags & LK_INTERLOCK) != 0) ASSERT_VI_LOCKED(vp, __func__); else ASSERT_VI_UNLOCKED(vp, __func__); - VNASSERT(vp->v_holdcnt > 0, vp, ("%s: vnode not held", __func__)); - if (vs == VGET_USECOUNT) { - VNASSERT(vp->v_usecount > 0, vp, - ("%s: vnode without usecount when VGET_USECOUNT was passed", - __func__)); - } + VNPASS(vp->v_holdcnt > 0, vp); + VNPASS(vs == VGET_HOLDCNT || vp->v_usecount > 0, vp); error = vn_lock(vp, flags); if (__predict_false(error != 0)) { @@ -2914,9 +2907,8 @@ vget_finish(struct vnode *vp, int flags, enum vgetstat return (error); } - if (vs == VGET_USECOUNT) { + if (vs == VGET_USECOUNT) return (0); - } if (__predict_false(vp->v_type == VCHR)) return (vget_finish_vchr(vp)); Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Sat Feb 8 15:51:08 2020 (r357679) +++ head/sys/kern/vfs_vnops.c Sat Feb 8 15:52:20 2020 (r357680) @@ -1606,8 +1606,9 @@ _vn_lock(struct vnode *vp, int flags, char *file, int { int error; - VNASSERT((flags & LK_TYPE_MASK) != 0, vp, ("vn_lock: no locktype")); - VNASSERT(vp->v_holdcnt != 0, vp, ("vn_lock: zero hold count")); + VNASSERT((flags & LK_TYPE_MASK) != 0, vp, + ("vn_lock: no locktype (%d passed)", flags)); + VNPASS(vp->v_holdcnt > 0, vp); error = VOP_LOCK1(vp, flags, file, line); if (__predict_false(error != 0 || VN_IS_DOOMED(vp))) return (_vn_lock_fallback(vp, flags, file, line, error)); From owner-svn-src-all@freebsd.org Sat Feb 8 20:56:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C555924B7A7; Sat, 8 Feb 2020 20:56:38 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48FPbp4ph8z4Hbc; Sat, 8 Feb 2020 20:56:38 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A04302338B; Sat, 8 Feb 2020 20:56:38 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 018Kucae041215; Sat, 8 Feb 2020 20:56:38 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 018Kucaa041214; Sat, 8 Feb 2020 20:56:38 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <202002082056.018Kucaa041214@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 8 Feb 2020 20:56:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357681 - head/lib/libc/string X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/lib/libc/string X-SVN-Commit-Revision: 357681 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Feb 2020 20:56:38 -0000 Author: eadler Date: Sat Feb 8 20:56:38 2020 New Revision: 357681 URL: https://svnweb.freebsd.org/changeset/base/357681 Log: memset.3: fix a a duplicate word Modified: head/lib/libc/string/memset.3 Modified: head/lib/libc/string/memset.3 ============================================================================== --- head/lib/libc/string/memset.3 Sat Feb 8 15:52:20 2020 (r357680) +++ head/lib/libc/string/memset.3 Sat Feb 8 20:56:38 2020 (r357681) @@ -63,7 +63,7 @@ Undefined behaviour from .Fn memset , resulting from storage overflow, will occur if .Fa len -is greater than the the length of buffer +is greater than the length of buffer .Fa dest . The behaviour is also undefined if .Fa dest From owner-svn-src-all@freebsd.org Sat Feb 8 21:02:21 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0A1AB24BA3B; Sat, 8 Feb 2020 21:02:21 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48FPkN5V2zz4J36; Sat, 8 Feb 2020 21:02:20 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A7D1F23543; Sat, 8 Feb 2020 21:02:20 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 018L2Kiq047053; Sat, 8 Feb 2020 21:02:20 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 018L2KSA047052; Sat, 8 Feb 2020 21:02:20 GMT (envelope-from br@FreeBSD.org) Message-Id: <202002082102.018L2KSA047052@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Sat, 8 Feb 2020 21:02:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357682 - head/sys/dev/xdma X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/dev/xdma X-SVN-Commit-Revision: 357682 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Feb 2020 21:02:21 -0000 Author: br Date: Sat Feb 8 21:02:20 2020 New Revision: 357682 URL: https://svnweb.freebsd.org/changeset/base/357682 Log: Fix a KASSERT since chained mbufs are accepted by the xdma bounce buffer loader. m_copydata() will copy entire chain to a single buffer. Sponsored by: DARPA, AFRL Modified: head/sys/dev/xdma/xdma_sg.c Modified: head/sys/dev/xdma/xdma_sg.c ============================================================================== --- head/sys/dev/xdma/xdma_sg.c Sat Feb 8 20:56:38 2020 (r357681) +++ head/sys/dev/xdma/xdma_sg.c Sat Feb 8 21:02:20 2020 (r357682) @@ -498,7 +498,7 @@ _xdma_load_data(xdma_channel_t *xchan, struct xdma_req m = xr->m; - KASSERT(xchan->caps & XCHAN_CAP_NOSEG, + KASSERT(xchan->caps & (XCHAN_CAP_NOSEG | XCHAN_CAP_BOUNCE), ("Handling segmented data is not implemented here.")); nsegs = 1; From owner-svn-src-all@freebsd.org Sat Feb 8 21:17:49 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 005F224C05C; Sat, 8 Feb 2020 21:17:49 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48FQ4D6BLfz4JtT; Sat, 8 Feb 2020 21:17:48 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA4B723747; Sat, 8 Feb 2020 21:17:48 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 018LHmcp053115; Sat, 8 Feb 2020 21:17:48 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 018LHmnh053114; Sat, 8 Feb 2020 21:17:48 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <202002082117.018LHmnh053114@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 8 Feb 2020 21:17:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357683 - head/lib/libc/string X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/lib/libc/string X-SVN-Commit-Revision: 357683 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Feb 2020 21:17:49 -0000 Author: eadler Date: Sat Feb 8 21:17:48 2020 New Revision: 357683 URL: https://svnweb.freebsd.org/changeset/base/357683 Log: memset.3: better fix previous typo Upon re-reading the whole sentence this is a better fix. MFC with: r357681 Modified: head/lib/libc/string/memset.3 Modified: head/lib/libc/string/memset.3 ============================================================================== --- head/lib/libc/string/memset.3 Sat Feb 8 21:02:20 2020 (r357682) +++ head/lib/libc/string/memset.3 Sat Feb 8 21:17:48 2020 (r357683) @@ -63,8 +63,9 @@ Undefined behaviour from .Fn memset , resulting from storage overflow, will occur if .Fa len -is greater than the length of buffer -.Fa dest . +is greater than the length of the +.Fa dest +buffer. The behaviour is also undefined if .Fa dest is an invalid pointer. From owner-svn-src-all@freebsd.org Sat Feb 8 21:55:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 22C8924C917; Sat, 8 Feb 2020 21:55:57 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48FQwD6zRdz4LTH; Sat, 8 Feb 2020 21:55:56 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E5D7B23F2B; Sat, 8 Feb 2020 21:55:56 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 018Ltuj6076691; Sat, 8 Feb 2020 21:55:56 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 018LtukS076689; Sat, 8 Feb 2020 21:55:56 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202002082155.018LtukS076689@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 8 Feb 2020 21:55:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357684 - in stable/12/sys: kern sys X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/12/sys: kern sys X-SVN-Commit-Revision: 357684 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Feb 2020 21:55:57 -0000 Author: mav Date: Sat Feb 8 21:55:56 2020 New Revision: 357684 URL: https://svnweb.freebsd.org/changeset/base/357684 Log: MFC r353678 (by avg): provide a way to assign taskqueue threads to a kernel process This can be used to group all threads belonging to a single logical entity under a common kernel process. I am planning to use the new interface for ZFS threads. Modified: stable/12/sys/kern/subr_taskqueue.c stable/12/sys/sys/taskqueue.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/subr_taskqueue.c ============================================================================== --- stable/12/sys/kern/subr_taskqueue.c Sat Feb 8 21:17:48 2020 (r357683) +++ stable/12/sys/kern/subr_taskqueue.c Sat Feb 8 21:55:56 2020 (r357684) @@ -649,7 +649,7 @@ taskqueue_swi_giant_run(void *dummy) static int _taskqueue_start_threads(struct taskqueue **tqp, int count, int pri, - cpuset_t *mask, const char *name, va_list ap) + cpuset_t *mask, struct proc *p, const char *name, va_list ap) { char ktname[MAXCOMLEN + 1]; struct thread *td; @@ -671,10 +671,10 @@ _taskqueue_start_threads(struct taskqueue **tqp, int c for (i = 0; i < count; i++) { if (count == 1) - error = kthread_add(taskqueue_thread_loop, tqp, NULL, + error = kthread_add(taskqueue_thread_loop, tqp, p, &tq->tq_threads[i], RFSTOPPED, 0, "%s", ktname); else - error = kthread_add(taskqueue_thread_loop, tqp, NULL, + error = kthread_add(taskqueue_thread_loop, tqp, p, &tq->tq_threads[i], RFSTOPPED, 0, "%s_%d", ktname, i); if (error) { @@ -724,12 +724,25 @@ taskqueue_start_threads(struct taskqueue **tqp, int co int error; va_start(ap, name); - error = _taskqueue_start_threads(tqp, count, pri, NULL, name, ap); + error = _taskqueue_start_threads(tqp, count, pri, NULL, NULL, name, ap); va_end(ap); return (error); } int +taskqueue_start_threads_in_proc(struct taskqueue **tqp, int count, int pri, + struct proc *proc, const char *name, ...) +{ + va_list ap; + int error; + + va_start(ap, name); + error = _taskqueue_start_threads(tqp, count, pri, NULL, proc, name, ap); + va_end(ap); + return (error); +} + +int taskqueue_start_threads_cpuset(struct taskqueue **tqp, int count, int pri, cpuset_t *mask, const char *name, ...) { @@ -737,7 +750,7 @@ taskqueue_start_threads_cpuset(struct taskqueue **tqp, int error; va_start(ap, name); - error = _taskqueue_start_threads(tqp, count, pri, mask, name, ap); + error = _taskqueue_start_threads(tqp, count, pri, mask, NULL, name, ap); va_end(ap); return (error); } Modified: stable/12/sys/sys/taskqueue.h ============================================================================== --- stable/12/sys/sys/taskqueue.h Sat Feb 8 21:17:48 2020 (r357683) +++ stable/12/sys/sys/taskqueue.h Sat Feb 8 21:55:56 2020 (r357684) @@ -42,6 +42,7 @@ struct taskqueue; struct taskqgroup; +struct proc; struct thread; struct timeout_task { @@ -75,7 +76,9 @@ struct taskqueue *taskqueue_create(const char *name, i taskqueue_enqueue_fn enqueue, void *context); int taskqueue_start_threads(struct taskqueue **tqp, int count, int pri, - const char *name, ...) __printflike(4, 5); + const char *name, ...) __printflike(4, 5); +int taskqueue_start_threads_in_proc(struct taskqueue **tqp, int count, + int pri, struct proc *p, const char *name, ...) __printflike(5, 6); int taskqueue_start_threads_cpuset(struct taskqueue **tqp, int count, int pri, cpuset_t *mask, const char *name, ...) __printflike(5, 6); int taskqueue_enqueue(struct taskqueue *queue, struct task *task); From owner-svn-src-all@freebsd.org Sat Feb 8 21:59:47 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8DEEE24C9C3; Sat, 8 Feb 2020 21:59:47 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48FR0g2w2Sz4Lbw; Sat, 8 Feb 2020 21:59:47 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5AC2C23F2C; Sat, 8 Feb 2020 21:59:47 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 018Lxlm2076900; Sat, 8 Feb 2020 21:59:47 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 018LxlQ8076899; Sat, 8 Feb 2020 21:59:47 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202002082159.018LxlQ8076899@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 8 Feb 2020 21:59:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357685 - head/sys/cam/ctl X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cam/ctl X-SVN-Commit-Revision: 357685 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Feb 2020 21:59:47 -0000 Author: mav Date: Sat Feb 8 21:59:46 2020 New Revision: 357685 URL: https://svnweb.freebsd.org/changeset/base/357685 Log: Bind CTL backends taskqueues to the CTL process. MFC after: 2 weeks Modified: head/sys/cam/ctl/ctl_backend_block.c head/sys/cam/ctl/ctl_backend_ramdisk.c Modified: head/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_block.c Sat Feb 8 21:55:56 2020 (r357684) +++ head/sys/cam/ctl/ctl_backend_block.c Sat Feb 8 21:59:46 2020 (r357685) @@ -2367,9 +2367,10 @@ ctl_be_block_create(struct ctl_be_block_softc *softc, * device, he can specify that when the LUN is created, or change * the tunable/sysctl to alter the default number of threads. */ - retval = taskqueue_start_threads(&be_lun->io_taskqueue, + retval = taskqueue_start_threads_in_proc(&be_lun->io_taskqueue, /*num threads*/num_threads, /*priority*/PUSER, + /*proc*/control_softc->ctl_proc, /*thread name*/ "%s taskq", be_lun->lunname); Modified: head/sys/cam/ctl/ctl_backend_ramdisk.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_ramdisk.c Sat Feb 8 21:55:56 2020 (r357684) +++ head/sys/cam/ctl/ctl_backend_ramdisk.c Sat Feb 8 21:59:46 2020 (r357685) @@ -1147,9 +1147,10 @@ ctl_backend_ramdisk_create(struct ctl_be_ramdisk_softc goto bailout_error; } - retval = taskqueue_start_threads(&be_lun->io_taskqueue, + retval = taskqueue_start_threads_in_proc(&be_lun->io_taskqueue, /*num threads*/1, /*priority*/PUSER, + /*proc*/control_softc->ctl_proc, /*thread name*/ "%s taskq", be_lun->lunname); if (retval != 0) From owner-svn-src-all@freebsd.org Sat Feb 8 23:07:32 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 129A824DF69; Sat, 8 Feb 2020 23:07:32 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48FSVq5mpDz4PYB; Sat, 8 Feb 2020 23:07:31 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C0C6424BFF; Sat, 8 Feb 2020 23:07:31 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 018N7Vnl018382; Sat, 8 Feb 2020 23:07:31 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 018N7UEL018374; Sat, 8 Feb 2020 23:07:30 GMT (envelope-from br@FreeBSD.org) Message-Id: <202002082307.018N7UEL018374@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Sat, 8 Feb 2020 23:07:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357686 - in head/sys: dev/altera/atse dev/flash dev/xdma dev/xilinx mips/ingenic X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys: dev/altera/atse dev/flash dev/xdma dev/xilinx mips/ingenic X-SVN-Commit-Revision: 357686 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Feb 2020 23:07:32 -0000 Author: br Date: Sat Feb 8 23:07:29 2020 New Revision: 357686 URL: https://svnweb.freebsd.org/changeset/base/357686 Log: Enter the network epoch in the xdma interrupt handler if required by a peripheral device driver. Sponsored by: DARPA, AFRL Modified: head/sys/dev/altera/atse/if_atse.c head/sys/dev/flash/cqspi.c head/sys/dev/xdma/xdma.c head/sys/dev/xdma/xdma.h head/sys/dev/xdma/xdma_fdt_test.c head/sys/dev/xilinx/if_xae.c head/sys/mips/ingenic/jz4780_aic.c Modified: head/sys/dev/altera/atse/if_atse.c ============================================================================== --- head/sys/dev/altera/atse/if_atse.c Sat Feb 8 21:59:46 2020 (r357685) +++ head/sys/dev/altera/atse/if_atse.c Sat Feb 8 23:07:29 2020 (r357686) @@ -1293,7 +1293,8 @@ atse_attach(device_t dev) } /* Setup interrupt handler. */ - error = xdma_setup_intr(sc->xchan_tx, atse_xdma_tx_intr, sc, &sc->ih_tx); + error = xdma_setup_intr(sc->xchan_tx, 0, + atse_xdma_tx_intr, sc, &sc->ih_tx); if (error) { device_printf(sc->dev, "Can't setup xDMA interrupt handler.\n"); @@ -1324,7 +1325,8 @@ atse_attach(device_t dev) } /* Setup interrupt handler. */ - error = xdma_setup_intr(sc->xchan_rx, atse_xdma_rx_intr, sc, &sc->ih_rx); + error = xdma_setup_intr(sc->xchan_rx, XDMA_INTR_NET, + atse_xdma_rx_intr, sc, &sc->ih_rx); if (error) { device_printf(sc->dev, "Can't setup xDMA interrupt handler.\n"); @@ -1381,8 +1383,7 @@ atse_attach(device_t dev) } ifp->if_softc = sc; if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST | - IFF_NEEDSEPOCH; + ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = atse_ioctl; ifp->if_transmit = atse_transmit; ifp->if_qflush = atse_qflush; Modified: head/sys/dev/flash/cqspi.c ============================================================================== --- head/sys/dev/flash/cqspi.c Sat Feb 8 21:59:46 2020 (r357685) +++ head/sys/dev/flash/cqspi.c Sat Feb 8 23:07:29 2020 (r357686) @@ -705,7 +705,7 @@ cqspi_attach(device_t dev) } /* Setup xDMA interrupt handlers. */ - error = xdma_setup_intr(sc->xchan_tx, cqspi_xdma_tx_intr, + error = xdma_setup_intr(sc->xchan_tx, 0, cqspi_xdma_tx_intr, sc, &sc->ih_tx); if (error) { device_printf(sc->dev, @@ -713,7 +713,7 @@ cqspi_attach(device_t dev) return (ENXIO); } - error = xdma_setup_intr(sc->xchan_rx, cqspi_xdma_rx_intr, + error = xdma_setup_intr(sc->xchan_rx, 0, cqspi_xdma_rx_intr, sc, &sc->ih_rx); if (error) { device_printf(sc->dev, Modified: head/sys/dev/xdma/xdma.c ============================================================================== --- head/sys/dev/xdma/xdma.c Sat Feb 8 21:59:46 2020 (r357685) +++ head/sys/dev/xdma/xdma.c Sat Feb 8 23:07:29 2020 (r357686) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -203,7 +204,7 @@ xdma_channel_free(xdma_channel_t *xchan) } int -xdma_setup_intr(xdma_channel_t *xchan, +xdma_setup_intr(xdma_channel_t *xchan, int flags, int (*cb)(void *, xdma_transfer_status_t *), void *arg, void **ihandler) { @@ -224,6 +225,7 @@ xdma_setup_intr(xdma_channel_t *xchan, ih = malloc(sizeof(struct xdma_intr_handler), M_XDMA, M_WAITOK | M_ZERO); + ih->flags = flags; ih->cb = cb; ih->cb_user = arg; @@ -325,13 +327,20 @@ xdma_callback(xdma_channel_t *xchan, xdma_transfer_sta struct xdma_intr_handler *ih_tmp; struct xdma_intr_handler *ih; xdma_controller_t *xdma; + struct epoch_tracker et; xdma = xchan->xdma; KASSERT(xdma != NULL, ("xdma is NULL")); - TAILQ_FOREACH_SAFE(ih, &xchan->ie_handlers, ih_next, ih_tmp) - if (ih->cb != NULL) + TAILQ_FOREACH_SAFE(ih, &xchan->ie_handlers, ih_next, ih_tmp) { + if (ih->cb != NULL) { + if (ih->flags & XDMA_INTR_NET) + NET_EPOCH_ENTER(et); ih->cb(ih->cb_user, status); + if (ih->flags & XDMA_INTR_NET) + NET_EPOCH_EXIT(et); + } + } if (xchan->flags & XCHAN_TYPE_SG) xdma_queue_submit(xchan); Modified: head/sys/dev/xdma/xdma.h ============================================================================== --- head/sys/dev/xdma/xdma.h Sat Feb 8 21:59:46 2020 (r357685) +++ head/sys/dev/xdma/xdma.h Sat Feb 8 23:07:29 2020 (r357686) @@ -195,6 +195,8 @@ typedef struct xdma_channel xdma_channel_t; struct xdma_intr_handler { int (*cb)(void *cb_user, xdma_transfer_status_t *status); + int flags; +#define XDMA_INTR_NET (1 << 0) void *cb_user; TAILQ_ENTRY(xdma_intr_handler) ih_next; }; @@ -275,7 +277,7 @@ uint32_t xdma_mbuf_chain_count(struct mbuf *m0); int xdma_control(xdma_channel_t *xchan, enum xdma_command cmd); /* Interrupt callback */ -int xdma_setup_intr(xdma_channel_t *xchan, int (*cb)(void *, +int xdma_setup_intr(xdma_channel_t *xchan, int flags, int (*cb)(void *, xdma_transfer_status_t *), void *arg, void **); int xdma_teardown_intr(xdma_channel_t *xchan, struct xdma_intr_handler *ih); int xdma_teardown_all_intr(xdma_channel_t *xchan); Modified: head/sys/dev/xdma/xdma_fdt_test.c ============================================================================== --- head/sys/dev/xdma/xdma_fdt_test.c Sat Feb 8 21:59:46 2020 (r357685) +++ head/sys/dev/xdma/xdma_fdt_test.c Sat Feb 8 23:07:29 2020 (r357686) @@ -217,7 +217,7 @@ xdmatest_test(struct xdmatest_softc *sc) } /* Setup callback. */ - err = xdma_setup_intr(sc->xchan, xdmatest_intr, sc, &sc->ih); + err = xdma_setup_intr(sc->xchan, 0, xdmatest_intr, sc, &sc->ih); if (err) { device_printf(sc->dev, "Can't setup xDMA interrupt handler.\n"); return (-1); Modified: head/sys/dev/xilinx/if_xae.c ============================================================================== --- head/sys/dev/xilinx/if_xae.c Sat Feb 8 21:59:46 2020 (r357685) +++ head/sys/dev/xilinx/if_xae.c Sat Feb 8 23:07:29 2020 (r357686) @@ -869,7 +869,7 @@ setup_xdma(struct xae_softc *sc) } /* Setup interrupt handler. */ - error = xdma_setup_intr(sc->xchan_tx, + error = xdma_setup_intr(sc->xchan_tx, 0, xae_xdma_tx_intr, sc, &sc->ih_tx); if (error) { device_printf(sc->dev, @@ -885,7 +885,7 @@ setup_xdma(struct xae_softc *sc) } /* Setup interrupt handler. */ - error = xdma_setup_intr(sc->xchan_rx, + error = xdma_setup_intr(sc->xchan_rx, XDMA_INTR_NET, xae_xdma_rx_intr, sc, &sc->ih_rx); if (error) { device_printf(sc->dev, Modified: head/sys/mips/ingenic/jz4780_aic.c ============================================================================== --- head/sys/mips/ingenic/jz4780_aic.c Sat Feb 8 21:59:46 2020 (r357685) +++ head/sys/mips/ingenic/jz4780_aic.c Sat Feb 8 23:07:29 2020 (r357686) @@ -744,7 +744,7 @@ aic_attach(device_t dev) pcm_setflags(dev, pcm_getflags(dev) | SD_F_MPSAFE); /* Setup interrupt handler. */ - err = xdma_setup_intr(sc->xchan, aic_intr, scp, &sc->ih); + err = xdma_setup_intr(sc->xchan, 0, aic_intr, scp, &sc->ih); if (err) { device_printf(sc->dev, "Can't setup xDMA interrupt handler.\n");