svn commit: r363236 - head/sys/mips/atheros

2020-07-15 Thread Adrian Chadd
Author: adrian
Date: Wed Jul 15 19:34:19 2020
New Revision: 363236
URL: https://svnweb.freebsd.org/changeset/base/363236

Log:
  [ar71xx] fix watchdog to work on subsequent SoCs
  
  The AR9341 AHB runs at 225MHz, much faster than the 33MHz of the
  AR71xx AHB.  So not only is the math going to do weird things, it
  will also wrap rather than being clamped.
  
  So:
  
  * clamp! don't wrap!
  * tidy up some debugging
  * add an option to throw an NMI rather than reset!
  
  Tested:
  
  * AR9341 SoC (TP-Link TL-WDR4300), patting/not patting the watchdog!

Modified:
  head/sys/mips/atheros/ar71xx_wdog.c

Modified: head/sys/mips/atheros/ar71xx_wdog.c
==
--- head/sys/mips/atheros/ar71xx_wdog.c Wed Jul 15 18:49:00 2020
(r363235)
+++ head/sys/mips/atheros/ar71xx_wdog.c Wed Jul 15 19:34:19 2020
(r363236)
@@ -50,6 +50,7 @@ struct ar71xx_wdog_softc {
device_t dev;
int armed;
int reboot_from_watchdog;
+   int watchdog_nmi;
int debug;
 };
 
@@ -58,32 +59,54 @@ ar71xx_wdog_watchdog_fn(void *private, u_int cmd, int 
 {
struct ar71xx_wdog_softc *sc = private;
uint64_t timer_val;
+   int action;
 
+   action = RST_WDOG_ACTION_RESET;
+   if (sc->watchdog_nmi != 0)
+   action = RST_WDOG_ACTION_NMI;
+
cmd &= WD_INTERVAL;
if (sc->debug)
-   device_printf(sc->dev, "ar71xx_wdog_watchdog_fn: cmd: %x\n", 
cmd);
+   device_printf(sc->dev, "%s: : cmd: %x\n", __func__, cmd);
if (cmd > 0) {
timer_val = (uint64_t)(1ULL << cmd) * ar71xx_ahb_freq() /
10;
+
+   /*
+* Clamp the timer value in case we overflow.
+*/
+   if (timer_val > 0x)
+   timer_val = 0x;
if (sc->debug)
-   device_printf(sc->dev, "ar71xx_wdog_watchdog_fn: 
programming timer: %jx\n", (uintmax_t) timer_val);
+   device_printf(sc->dev, "%s: programming timer: %jx\n",
+   __func__, (uintmax_t) timer_val);
/*
-* Load timer with large enough value to prevent spurious
-* reset
+* Make sure the watchdog is set to NOACTION and give it
+* time to take.
 */
-   ATH_WRITE_REG(AR71XX_RST_WDOG_TIMER, 
-   ar71xx_ahb_freq() * 10);
-   ATH_WRITE_REG(AR71XX_RST_WDOG_CONTROL, 
-   RST_WDOG_ACTION_RESET);
-   ATH_WRITE_REG(AR71XX_RST_WDOG_TIMER, 
-   (timer_val & 0x));
+   ATH_WRITE_REG(AR71XX_RST_WDOG_CONTROL, 
RST_WDOG_ACTION_NOACTION);
+   wmb();
+   DELAY(100);
+
+   /*
+* Update the timer value.  It's already clamped at this
+* point so we don't have to wrap/clamp it here.
+*/
+   ATH_WRITE_REG(AR71XX_RST_WDOG_TIMER, timer_val);
+   wmb();
+   DELAY(100);
+
+   /*
+* And now, arm.
+*/
+   ATH_WRITE_REG(AR71XX_RST_WDOG_CONTROL, action);
sc->armed = 1;
*error = 0;
} else {
if (sc->debug)
-   device_printf(sc->dev, "ar71xx_wdog_watchdog_fn: 
disarming\n");
+   device_printf(sc->dev, "%s: disarming\n", __func__);
if (sc->armed) {
-   ATH_WRITE_REG(AR71XX_RST_WDOG_CONTROL, 
+   ATH_WRITE_REG(AR71XX_RST_WDOG_CONTROL,
RST_WDOG_ACTION_NOACTION);
sc->armed = 0;
}
@@ -109,6 +132,9 @@ ar71xx_wdog_sysctl(device_t dev)
 SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
 "debug", CTLFLAG_RW, >debug, 0,
 "enable watchdog debugging");
+SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
+"nmi", CTLFLAG_RW, >watchdog_nmi, 0,
+"watchdog triggers NMI instead of reset");
 SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
 "armed", CTLFLAG_RD, >armed, 0,
 "whether the watchdog is armed");
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r363235 - head/crypto/openssh

2020-07-15 Thread Ed Maste
Author: emaste
Date: Wed Jul 15 18:49:00 2020
New Revision: 363235
URL: https://svnweb.freebsd.org/changeset/base/363235

Log:
  openssh: refer to OpenSSL not SSLeay, part 2
  
  This change was made upstream between 7.9p1 and 8.0p1.  We've made local
  changes in the same places for handling the version_addendum; apply the
  SSLeay_version to OpenSSL_version change in advance of importing 8.0p1.
  This should have been part of r363225.
  
  Obtained from:OpenSSH-portable a65784c9f9c5
  MFC with: r363225
  Sponsored by: The FreeBSD Foundation

Modified:
  head/crypto/openssh/sshd.c
  head/crypto/openssh/version.h

Modified: head/crypto/openssh/sshd.c
==
--- head/crypto/openssh/sshd.c  Wed Jul 15 18:32:09 2020(r363234)
+++ head/crypto/openssh/sshd.c  Wed Jul 15 18:49:00 2020(r363235)
@@ -1749,7 +1749,7 @@ main(int ac, char **av)
 
debug("sshd version %s, %s", SSH_VERSION,
 #ifdef WITH_OPENSSL
-   OpenSSL_version(SSLEAY_VERSION)
+   OpenSSL_version(OPENSSL_VERSION)
 #else
"without OpenSSL"
 #endif

Modified: head/crypto/openssh/version.h
==
--- head/crypto/openssh/version.h   Wed Jul 15 18:32:09 2020
(r363234)
+++ head/crypto/openssh/version.h   Wed Jul 15 18:49:00 2020
(r363235)
@@ -9,7 +9,7 @@
 #define SSH_VERSION_FREEBSD"FreeBSD-20200214"
 
 #ifdef WITH_OPENSSL
-#define OPENSSL_VERSION_STRING OpenSSL_version(SSLEAY_VERSION)
+#define OPENSSL_VERSION_STRING OpenSSL_version(OPENSSL_VERSION)
 #else
 #define OPENSSL_VERSION_STRING "without OpenSSL"
 #endif
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r363234 - head

2020-07-15 Thread Gregory Neil Shapiro
Author: gshapiro
Date: Wed Jul 15 18:32:09 2020
New Revision: 363234
URL: https://svnweb.freebsd.org/changeset/base/363234

Log:
  Note the merge of sendmail 8.16.1 from vendor "branch"

Modified:
  head/RELNOTES

Modified: head/RELNOTES
==
--- head/RELNOTES   Wed Jul 15 18:28:54 2020(r363233)
+++ head/RELNOTES   Wed Jul 15 18:32:09 2020(r363234)
@@ -10,6 +10,9 @@ newline.  Entries should be separated by a newline.
 
 Changes to this file should not be MFCed.
 
+r363233:
+   Merge sendmail 8.16.1: See contrib/sendmail/RELEASE_NOTES for details.
+
 r363180:
The safexcel(4) crypto offload driver has been added.
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r363233 - in head: contrib/sendmail contrib/sendmail/cf contrib/sendmail/cf/cf contrib/sendmail/cf/feature contrib/sendmail/cf/m4 contrib/sendmail/cf/ostype contrib/sendmail/contrib con...

2020-07-15 Thread Gregory Neil Shapiro
Author: gshapiro
Date: Wed Jul 15 18:28:54 2020
New Revision: 363233
URL: https://svnweb.freebsd.org/changeset/base/363233

Log:
  Merge sendmail 8.16.1 to HEAD: See contrib/sendmail/RELEASE_NOTES for details
  Includes build infrastructure & config updates required for changes in 8.16.1
  
  MFC after:5 days

Added:
 - copied unchanged from r363203, 
vendor/sendmail/dist/cf/feature/blocklist_recipients.m4
 - copied unchanged from r363203, 
vendor/sendmail/dist/cf/feature/check_cert_altnames.m4
 - copied unchanged from r363203, 
vendor/sendmail/dist/cf/feature/tls_failures.m4
  head/contrib/sendmail/include/sm/notify.h
 - copied unchanged from r363203, vendor/sendmail/dist/include/sm/notify.h
  head/contrib/sendmail/libsm/notify.c
 - copied, changed from r363203, vendor/sendmail/dist/libsm/notify.c
  head/contrib/sendmail/libsm/t-notify.c
 - copied unchanged from r363203, vendor/sendmail/dist/libsm/t-notify.c
  head/contrib/sendmail/libsmdb/smcdb.c
 - copied unchanged from r363203, vendor/sendmail/dist/libsmdb/smcdb.c
  head/contrib/sendmail/src/ratectrl.h
 - copied unchanged from r363203, vendor/sendmail/dist/src/ratectrl.h
  head/contrib/sendmail/src/tls.h
 - copied unchanged from r363203, vendor/sendmail/dist/src/tls.h
  head/contrib/sendmail/src/tlsh.c
 - copied unchanged from r363203, vendor/sendmail/dist/src/tlsh.c
Directory Properties:
  head/contrib/sendmail/cf/feature/blocklist_recipients.m4   (props changed)
  head/contrib/sendmail/cf/feature/check_cert_altnames.m4   (props changed)
  head/contrib/sendmail/cf/feature/tls_failures.m4   (props changed)
Modified:
  head/contrib/sendmail/CACerts
  head/contrib/sendmail/FREEBSD-upgrade
  head/contrib/sendmail/KNOWNBUGS
  head/contrib/sendmail/LICENSE
  head/contrib/sendmail/PGPKEYS
  head/contrib/sendmail/README
  head/contrib/sendmail/RELEASE_NOTES
  head/contrib/sendmail/cf/README
  head/contrib/sendmail/cf/cf/Makefile
  head/contrib/sendmail/cf/cf/knecht.mc
  head/contrib/sendmail/cf/cf/submit.cf
  head/contrib/sendmail/cf/feature/bcc.m4
  head/contrib/sendmail/cf/feature/blacklist_recipients.m4
  head/contrib/sendmail/cf/feature/dnsbl.m4
  head/contrib/sendmail/cf/feature/enhdnsbl.m4
  head/contrib/sendmail/cf/m4/cfhead.m4
  head/contrib/sendmail/cf/m4/proto.m4
  head/contrib/sendmail/cf/m4/version.m4
  head/contrib/sendmail/cf/ostype/hpux10.m4
  head/contrib/sendmail/cf/ostype/hpux9.m4
  head/contrib/sendmail/contrib/cidrexpand
  head/contrib/sendmail/contrib/dnsblaccess.m4
  head/contrib/sendmail/contrib/expn.pl
  head/contrib/sendmail/contrib/mmuegel
  head/contrib/sendmail/doc/op/op.me
  head/contrib/sendmail/editmap/Makefile
  head/contrib/sendmail/editmap/editmap.c
  head/contrib/sendmail/include/libmilter/mfapi.h
  head/contrib/sendmail/include/libmilter/mfdef.h
  head/contrib/sendmail/include/libsmdb/smdb.h
  head/contrib/sendmail/include/sendmail/pathnames.h
  head/contrib/sendmail/include/sendmail/sendmail.h
  head/contrib/sendmail/include/sm/assert.h
  head/contrib/sendmail/include/sm/bdb.h
  head/contrib/sendmail/include/sm/cdefs.h
  head/contrib/sendmail/include/sm/clock.h
  head/contrib/sendmail/include/sm/conf.h
  head/contrib/sendmail/include/sm/config.h
  head/contrib/sendmail/include/sm/debug.h
  head/contrib/sendmail/include/sm/errstring.h
  head/contrib/sendmail/include/sm/gen.h
  head/contrib/sendmail/include/sm/heap.h
  head/contrib/sendmail/include/sm/io.h
  head/contrib/sendmail/include/sm/ldap.h
  head/contrib/sendmail/include/sm/limits.h
  head/contrib/sendmail/include/sm/os/sm_os_freebsd.h
  head/contrib/sendmail/include/sm/rpool.h
  head/contrib/sendmail/include/sm/sem.h
  head/contrib/sendmail/include/sm/shm.h
  head/contrib/sendmail/include/sm/string.h
  head/contrib/sendmail/include/sm/test.h
  head/contrib/sendmail/include/sm/types.h
  head/contrib/sendmail/include/sm/varargs.h
  head/contrib/sendmail/include/sm/xtrap.h
  head/contrib/sendmail/libmilter/Makefile
  head/contrib/sendmail/libmilter/README
  head/contrib/sendmail/libmilter/comm.c
  head/contrib/sendmail/libmilter/docs/api.html
  head/contrib/sendmail/libmilter/docs/design.html
  head/contrib/sendmail/libmilter/docs/index.html
  head/contrib/sendmail/libmilter/docs/installation.html
  head/contrib/sendmail/libmilter/docs/overview.html
  head/contrib/sendmail/libmilter/docs/sample.html
  head/contrib/sendmail/libmilter/docs/smfi_addheader.html
  head/contrib/sendmail/libmilter/docs/smfi_addrcpt.html
  head/contrib/sendmail/libmilter/docs/smfi_addrcpt_par.html
  head/contrib/sendmail/libmilter/docs/smfi_chgfrom.html
  head/contrib/sendmail/libmilter/docs/smfi_chgheader.html
  head/contrib/sendmail/libmilter/docs/smfi_delrcpt.html
  head/contrib/sendmail/libmilter/docs/smfi_getpriv.html
  head/contrib/sendmail/libmilter/docs/smfi_getsymval.html
  head/contrib/sendmail/libmilter/docs/smfi_insheader.html
  head/contrib/sendmail/libmilter/docs/smfi_main.html
  

Re: svn commit: r363178 - head/contrib/mandoc

2020-07-15 Thread Ed Maste
On Wed, 15 Jul 2020 at 14:11, Rodney W. Grimes
 wrote:
>
> The only thing that was added, and herein reverted was incorrect
> information that apropos and makewhatis first appeared in FreeBSD 11,
> conflicting the much richer HISTORY already present in this manual page.

It seems that including history as it relates to FreeBSD would be a
suitable addition to this section. Just "This version of the .Nm
utility..." instead of "The .Nm utility" would be fine?

> Why reply to my thank you and not the commit that did the revert?

Sorry, I just replied to the end of the thread.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r363178 - head/contrib/mandoc

2020-07-15 Thread Rodney W. Grimes
> On Tue, 14 Jul 2020 at 12:47, Rodney W. Grimes
>  wrote:
> >
> > > Author: gbe (doc committer)
> > > Date: Tue Jul 14 12:02:30 2020
> > > New Revision: 363178
> > > URL: https://svnweb.freebsd.org/changeset/base/363178
> > >
> > > Log:
> > >   Revert r362809: Mention FreeBSD in the HISTORY sections of apropos(1) 
> > > and makewhatis(8).
> >
> > Thank you
> 
> This seems like a regression - information about when a certain
> utility (or a different implementation thereof) appeared in FreeBSD
> seems like useful and relevant information.

The only thing that was added, and herein reverted was incorrect
information that apropos and makewhatis first appeared in FreeBSD 11,
conflicting the much richer HISTORY already present in this manual page.

Please read the full manual page and make comments if you then feel they are 
needed.

Why reply to my thank you and not the commit that did the revert?
 
Rod Grimes rgri...@freebsd.org
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r363232 - head/sys/modules/dtb/allwinner

2020-07-15 Thread Andriy Gapon
Author: avg
Date: Wed Jul 15 18:04:01 2020
New Revision: 363232
URL: https://svnweb.freebsd.org/changeset/base/363232

Log:
  build DTS for Orange Pi PC Plus as well
  
  Reviewed by:  manu
  MFC after:1 week

Modified:
  head/sys/modules/dtb/allwinner/Makefile

Modified: head/sys/modules/dtb/allwinner/Makefile
==
--- head/sys/modules/dtb/allwinner/Makefile Wed Jul 15 17:34:08 2020
(r363231)
+++ head/sys/modules/dtb/allwinner/Makefile Wed Jul 15 18:04:01 2020
(r363232)
@@ -21,6 +21,7 @@ DTS=  \
sun8i-h3-nanopi-neo.dts \
sun8i-h3-orangepi-one.dts \
sun8i-h3-orangepi-pc.dts \
+   sun8i-h3-orangepi-pc-plus.dts \
sun8i-h3-orangepi-plus2e.dts
 
 DTSO=  sun8i-a83t-sid.dtso \
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r363229 - head/lib/libmd

2020-07-15 Thread Alex Richardson
Author: arichardson
Date: Wed Jul 15 17:24:34 2020
New Revision: 363229
URL: https://svnweb.freebsd.org/changeset/base/363229

Log:
  Remove warning that is no longer accurate after r361853
  
  We now build the skein assembly with clangs integrated assembler.
  
  Reviewed By:  emaste
  Differential Revision: https://reviews.freebsd.org/D25664

Modified:
  head/lib/libmd/Makefile

Modified: head/lib/libmd/Makefile
==
--- head/lib/libmd/Makefile Wed Jul 15 17:05:37 2020(r363228)
+++ head/lib/libmd/Makefile Wed Jul 15 17:24:34 2020(r363229)
@@ -121,8 +121,6 @@ CFLAGS+= -DRMD160_ASM
 ACFLAGS+= -DSKEIN_LOOP=0
 SRCS+= skein_block_asm.S
 CFLAGS+= -DSKEIN_ASM -DSKEIN_USE_ASM=1792 # list of block functions to replace 
with assembly: 256+512+1024 = 1792
-.else
-.warning as not available: not using optimized Skein asm
 .endif
 .if exists(${MACHINE_ARCH}/sha.S) || exists(${MACHINE_ARCH}/rmd160.S) || 
exists(${MACHINE_ARCH}/skein_block_asm.S)
 ACFLAGS+= -DELF -Wa,--noexecstack
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r363230 - head/usr.bin/xinstall

2020-07-15 Thread Alex Richardson
Author: arichardson
Date: Wed Jul 15 17:24:39 2020
New Revision: 363230
URL: https://svnweb.freebsd.org/changeset/base/363230

Log:
  Allow install(1)'s create_tempfile() to work on Linux hosts
  
  GLibc expects six 'X' characters in the mkstemp template argument and
  will return EINVAL otherwise.
  
  Reviewed By:  emaste, imp, mjg
  Differential Revision: https://reviews.freebsd.org/D25662

Modified:
  head/usr.bin/xinstall/install.1
  head/usr.bin/xinstall/xinstall.c

Modified: head/usr.bin/xinstall/install.1
==
--- head/usr.bin/xinstall/install.1 Wed Jul 15 17:24:34 2020
(r363229)
+++ head/usr.bin/xinstall/install.1 Wed Jul 15 17:24:39 2020
(r363230)
@@ -301,8 +301,8 @@ This is mainly for use in debugging the
 .Fx
 Ports Collection.
 .Sh FILES
-.Bl -tag -width "INS@" -compact
-.It Pa INS@
+.Bl -tag -width "INS@XX" -compact
+.It Pa INS@XX
 If either
 .Fl S
 option is specified, or the
@@ -312,9 +312,9 @@ or
 option is used in conjunction with the
 .Fl s
 option, temporary files named
-.Pa INS@ ,
+.Pa INS@XX ,
 where
-.Pa 
+.Pa XX
 is decided by
 .Xr mkstemp 3 ,
 are created in the target directory.

Modified: head/usr.bin/xinstall/xinstall.c
==
--- head/usr.bin/xinstall/xinstall.cWed Jul 15 17:24:34 2020
(r363229)
+++ head/usr.bin/xinstall/xinstall.cWed Jul 15 17:24:39 2020
(r363230)
@@ -1161,7 +1161,7 @@ create_tempfile(const char *path, char *temp, size_t t
p++;
else
p = temp;
-   (void)strncpy(p, "INS@", [tsize - 1] - p);
+   (void)strncpy(p, "INS@XX", [tsize - 1] - p);
temp[tsize - 1] = '\0';
return (mkstemp(temp));
 }
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r363228 - head/lib/libc/gen

2020-07-15 Thread Brooks Davis
Author: brooks
Date: Wed Jul 15 17:05:37 2020
New Revision: 363228
URL: https://svnweb.freebsd.org/changeset/base/363228

Log:
  Don't imply that all action values can be OR'd.
  
  This is neither POSIX compliant nor what the implementation does.
  This could be allowed by changing the value of TCSAFLUSH from 2 to 3,
  but that doesn't seem worthwhile after 25+ years.
  
  Reviewed by:  imp
  MFC after:1 week
  Sponsored by: DARPA
  Differential Revision:https://reviews.freebsd.org/D25659

Modified:
  head/lib/libc/gen/tcsetattr.3

Modified: head/lib/libc/gen/tcsetattr.3
==
--- head/lib/libc/gen/tcsetattr.3   Wed Jul 15 16:12:00 2020
(r363227)
+++ head/lib/libc/gen/tcsetattr.3   Wed Jul 15 17:05:37 2020
(r363228)
@@ -28,7 +28,7 @@
 .\"@(#)tcsetattr.3 8.3 (Berkeley) 1/2/94
 .\" $FreeBSD$
 .\"
-.Dd January 2, 1994
+.Dd July 15, 2020
 .Dt TCSETATTR 3
 .Os
 .Sh NAME
@@ -221,8 +221,7 @@ termios structure referenced by
 .Fa t .
 The
 .Fa action
-argument is created by
-.Em or Ns 'ing
+argument is one of
 the following values, as specified in the include file
 .In termios.h .
 .Bl -tag -width "TCSADRAIN"
@@ -240,18 +239,20 @@ The change occurs after all output written to
 .Fa fd
 has been transmitted to the terminal.
 Additionally, any input that has been received but not read is discarded.
-.It Fa TCSASOFT
-If this value is
-.Em or Ns 'ed
-into the
+.El
+.Pp
+The
 .Fa action
-value, the values of the
+may be modified by
+.Em or Ns 'ing
+in
+.Fa TCSASOFT
+which causes the values of the
 .Va c_cflag ,
 .Va c_ispeed ,
 and
 .Va c_ospeed
-fields are ignored.
-.El
+fields to be ignored.
 .Pp
 The 0 baud rate is used to terminate the connection.
 If 0 is specified as the output speed to the function
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r363227 - head/sys/i386/i386

2020-07-15 Thread Konstantin Belousov
Author: kib
Date: Wed Jul 15 16:12:00 2020
New Revision: 363227
URL: https://svnweb.freebsd.org/changeset/base/363227

Log:
  Improve description of the vector argument for i386 
smp_targeted_tlb_shootdown().
  
  Submitted by: alc
  MFC after:20 days

Modified:
  head/sys/i386/i386/mp_machdep.c

Modified: head/sys/i386/i386/mp_machdep.c
==
--- head/sys/i386/i386/mp_machdep.c Wed Jul 15 15:40:46 2020
(r363226)
+++ head/sys/i386/i386/mp_machdep.c Wed Jul 15 16:12:00 2020
(r363227)
@@ -481,9 +481,10 @@ volatile uint32_t smp_tlb_generation;
 /*
  * Used by pmap to request cache or TLB invalidation on local and
  * remote processors.  Mask provides the set of remote CPUs which are
- * to be signalled with the invalidation IPI, specified by vector.  As
- * an optimization, the curcpu_cb callback is invoked on the calling
- * CPU while waiting for remote CPUs to complete the operation.
+ * to be signalled with the invalidation IPI.  Vector specifies which
+ * invalidation IPI is used.  As an optimization, the curcpu_cb
+ * callback is invoked on the calling CPU while waiting for remote
+ * CPUs to complete the operation.
  *
  * The callback function is called unconditionally on the caller's
  * underlying processor, even when this processor is not set in the
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r363225 - head/crypto/openssh

2020-07-15 Thread Ed Maste
Author: emaste
Date: Wed Jul 15 15:35:26 2020
New Revision: 363225
URL: https://svnweb.freebsd.org/changeset/base/363225

Log:
  openssh: refer to OpenSSL not SSLeay
  
  This change was made upstream between 7.9p1 and 8.0p1.  We've made local
  changes in the same places for handling the version_addendum; apply the
  SSLeay_version to OpenSSL_version change in advance of importing 8.0p1.
  
  Obtained from:OpenSSH-portable a65784c9f9c5
  Sponsored by: The FreeBSD Foundation

Modified:
  head/crypto/openssh/sshd.c
  head/crypto/openssh/version.h

Modified: head/crypto/openssh/sshd.c
==
--- head/crypto/openssh/sshd.c  Wed Jul 15 14:38:15 2020(r363224)
+++ head/crypto/openssh/sshd.c  Wed Jul 15 15:35:26 2020(r363225)
@@ -1749,7 +1749,7 @@ main(int ac, char **av)
 
debug("sshd version %s, %s", SSH_VERSION,
 #ifdef WITH_OPENSSL
-   SSLeay_version(SSLEAY_VERSION)
+   OpenSSL_version(SSLEAY_VERSION)
 #else
"without OpenSSL"
 #endif

Modified: head/crypto/openssh/version.h
==
--- head/crypto/openssh/version.h   Wed Jul 15 14:38:15 2020
(r363224)
+++ head/crypto/openssh/version.h   Wed Jul 15 15:35:26 2020
(r363225)
@@ -9,7 +9,7 @@
 #define SSH_VERSION_FREEBSD"FreeBSD-20200214"
 
 #ifdef WITH_OPENSSL
-#define OPENSSL_VERSION_STRING SSLeay_version(SSLEAY_VERSION)
+#define OPENSSL_VERSION_STRING OpenSSL_version(SSLEAY_VERSION)
 #else
 #define OPENSSL_VERSION_STRING "without OpenSSL"
 #endif
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r363224 - head/cddl/contrib/opensolaris/cmd/zpool

2020-07-15 Thread Allan Jude
Author: allanjude
Date: Wed Jul 15 14:38:15 2020
New Revision: 363224
URL: https://svnweb.freebsd.org/changeset/base/363224

Log:
  zpool-features(7): Note that the boot loader has support for large_blocks
  
  Since r304321 (-current: Aug 18, 2016) and r328866 (stable/11: Feb 5, 2018)
  the FreeBSD loader has supported reading from datasets with the
  large_blocks feature active.
  
  PR:   247992
  Reported by:  Anton Saietskii 
  MFC after:2 weeks
  Sponsored by: Klara Inc.

Modified:
  head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7

Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7
==
--- head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7Wed Jul 15 
14:27:23 2020(r363223)
+++ head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7Wed Jul 15 
14:38:15 2020(r363224)
@@ -521,10 +521,9 @@ property has been set larger than 128KB, and will retu
 once all filesystems that have ever had their recordsize larger than 128KB
 are destroyed.
 .Pp
-Please note that booting from datasets that have recordsize greater than
-128KB is
-.Em NOT
-supported by the
+Booting from datasets that use the
+.Sy large_block
+feature is supported by the
 .Fx
 boot loader.
 .It Sy large_dnode
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r363223 - head/share/man/man4

2020-07-15 Thread Allan Jude
Author: allanjude
Date: Wed Jul 15 14:27:23 2020
New Revision: 363223
URL: https://svnweb.freebsd.org/changeset/base/363223

Log:
  vlan(4): Minor grammar corrections
  
  Note: date not bumped because "content" was not changed, just inserted some
  missing words.
  
  PR:   248001
  Submitted by: Jose Luis Duran 
  MFC after:2 weeks
  Sponsored by: Klara Inc.

Modified:
  head/share/man/man4/vxlan.4

Modified: head/share/man/man4/vxlan.4
==
--- head/share/man/man4/vxlan.4 Wed Jul 15 13:43:48 2020(r363222)
+++ head/share/man/man4/vxlan.4 Wed Jul 15 14:27:23 2020(r363223)
@@ -80,7 +80,7 @@ The
 driver creates a pseudo Ethernet network interface
 that supports the usual network
 .Xr ioctl 2 Ns s
-and is thus can be used with
+and thus can be used with
 .Xr ifconfig 8
 like any other Ethernet interface.
 The
@@ -89,7 +89,7 @@ interface encapsulates the Ethernet frame
 by prepending IP/UDP and
 .Nm
 headers.
-Thus, the encapsulated (inner) frame is able to transmitted
+Thus, the encapsulated (inner) frame is able to be transmitted
 over a routed, Layer 3 network to the remote host.
 .Pp
 The
@@ -102,7 +102,7 @@ When in multicast mode,
 the interface joins an IP multicast group,
 and receives packets sent to the group address,
 and transmits packets to either the multicast group address,
-or directly the remote host if there is an appropriate
+or directly to the remote host if there is an appropriate
 forwarding table entry.
 .Pp
 When the
@@ -155,7 +155,7 @@ The maximum number of entries in the table is configur
 .Xr ifconfig 8
 .Cm vxlanmaxaddr
 command.
-Stale entries in the table periodically pruned.
+Stale entries in the table are periodically pruned.
 The timeout is configurable with the
 .Xr ifconfig 8
 .Cm vxlantimeout
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r363222 - head/sys/powerpc/aim

2020-07-15 Thread Leandro Lupori
Author: luporl
Date: Wed Jul 15 13:43:48 2020
New Revision: 363222
URL: https://svnweb.freebsd.org/changeset/base/363222

Log:
  [PowerPC] Use PVO_PADDR to get the PA from PVO
  
  Use PVO_PADDR macro to get the physical address from a PVO, instead of
  explicitly ANDing pvo_pte.pa with LPTE_RPGN where it is needed.  Besides
  improving readability, this is needed to support superpages (D25237), where
  the steps to get the PA from a PVO are different.
  
  Reviewed by:  markj
  Sponsored by: Eldorado Research Institute (eldorado.org.br)
  Differential Revision:https://reviews.freebsd.org/D25654

Modified:
  head/sys/powerpc/aim/mmu_oea64.c

Modified: head/sys/powerpc/aim/mmu_oea64.c
==
--- head/sys/powerpc/aim/mmu_oea64.cWed Jul 15 13:26:15 2020
(r363221)
+++ head/sys/powerpc/aim/mmu_oea64.cWed Jul 15 13:43:48 2020
(r363222)
@@ -108,6 +108,9 @@ uintptr_t moea64_get_unique_vsid(void);
 #defineVSID_TO_HASH(vsid)  (((vsid) >> 4) & 0xf)
 #defineVSID_HASH_MASK  0x007fULL
 
+/* Get physical address from PVO. */
+#definePVO_PADDR(pvo)  ((pvo)->pvo_pte.pa & LPTE_RPGN)
+
 /*
  * Locking semantics:
  *
@@ -1207,7 +1210,7 @@ moea64_unwire(pmap_t pm, vm_offset_t sva, vm_offset_t 
(pvo->pvo_pte.prot & VM_PROT_WRITE)) {
if (refchg < 0)
refchg = LPTE_CHG;
-   m = PHYS_TO_VM_PAGE(pvo->pvo_pte.pa & LPTE_RPGN);
+   m = PHYS_TO_VM_PAGE(PVO_PADDR(pvo));
 
refchg |= atomic_readandclear_32(>md.mdpg_attrs);
if (refchg & LPTE_CHG)
@@ -1615,7 +1618,7 @@ moea64_extract(pmap_t pm, vm_offset_t va)
if (pvo == NULL)
pa = 0;
else
-   pa = (pvo->pvo_pte.pa & LPTE_RPGN) | (va - PVO_VADDR(pvo));
+   pa = PVO_PADDR(pvo) | (va - PVO_VADDR(pvo));
PMAP_UNLOCK(pm);
 
return (pa);
@@ -1636,7 +1639,7 @@ moea64_extract_and_hold(pmap_t pmap, vm_offset_t va, v
PMAP_LOCK(pmap);
pvo = moea64_pvo_find_va(pmap, va & ~ADDR_POFF);
if (pvo != NULL && (pvo->pvo_pte.prot & prot) == prot) {
-   m = PHYS_TO_VM_PAGE(pvo->pvo_pte.pa & LPTE_RPGN);
+   m = PHYS_TO_VM_PAGE(PVO_PADDR(pvo));
if (!vm_page_wire_mapped(m))
m = NULL;
}
@@ -1943,7 +1946,7 @@ moea64_kextract(vm_offset_t va)
pvo = moea64_pvo_find_va(kernel_pmap, va);
KASSERT(pvo != NULL, ("moea64_kextract: no addr found for %#" PRIxPTR,
va));
-   pa = (pvo->pvo_pte.pa & LPTE_RPGN) | (va - PVO_VADDR(pvo));
+   pa = PVO_PADDR(pvo) | (va - PVO_VADDR(pvo));
PMAP_UNLOCK(kernel_pmap);
return (pa);
 }
@@ -2269,7 +2272,7 @@ moea64_pvo_protect( pmap_t pm, struct pvo_entry *pvo, 
 */
oldprot = pvo->pvo_pte.prot;
pvo->pvo_pte.prot = prot;
-   pg = PHYS_TO_VM_PAGE(pvo->pvo_pte.pa & LPTE_RPGN);
+   pg = PHYS_TO_VM_PAGE(PVO_PADDR(pvo));
 
/*
 * If the PVO is in the page table, update mapping
@@ -2284,7 +2287,7 @@ moea64_pvo_protect( pmap_t pm, struct pvo_entry *pvo, 
if ((pg->oflags & VPO_UNMANAGED) == 0)
vm_page_aflag_set(pg, PGA_EXECUTABLE);
moea64_syncicache(pm, PVO_VADDR(pvo),
-   pvo->pvo_pte.pa & LPTE_RPGN, PAGE_SIZE);
+   PVO_PADDR(pvo), PAGE_SIZE);
}
 
/*
@@ -2648,7 +2651,7 @@ moea64_pvo_remove_from_pmap(struct pvo_entry *pvo)
/* Send RC bits to VM */
if ((pvo->pvo_vaddr & PVO_MANAGED) &&
(pvo->pvo_pte.prot & VM_PROT_WRITE)) {
-   pg = PHYS_TO_VM_PAGE(pvo->pvo_pte.pa & LPTE_RPGN);
+   pg = PHYS_TO_VM_PAGE(PVO_PADDR(pvo));
if (pg != NULL) {
refchg |= atomic_readandclear_32(>md.mdpg_attrs);
if (refchg & LPTE_CHG)
@@ -2674,7 +2677,7 @@ moea64_pvo_remove_from_page_locked(struct pvo_entry *p
/*
 * Update vm about page writeability/executability if managed
 */
-   PV_LOCKASSERT(pvo->pvo_pte.pa & LPTE_RPGN);
+   PV_LOCKASSERT(PVO_PADDR(pvo));
if (pvo->pvo_vaddr & PVO_MANAGED) {
if (m != NULL) {
LIST_REMOVE(pvo, pvo_vlink);
@@ -2694,11 +2697,11 @@ moea64_pvo_remove_from_page(struct pvo_entry *pvo)
vm_page_t pg = NULL;
 
if (pvo->pvo_vaddr & PVO_MANAGED)
-   pg = PHYS_TO_VM_PAGE(pvo->pvo_pte.pa & LPTE_RPGN);
+   pg = PHYS_TO_VM_PAGE(PVO_PADDR(pvo));
 
-   PV_LOCK(pvo->pvo_pte.pa & LPTE_RPGN);
+   PV_LOCK(PVO_PADDR(pvo));
moea64_pvo_remove_from_page_locked(pvo, pg);
-   PV_UNLOCK(pvo->pvo_pte.pa & LPTE_RPGN);
+   PV_UNLOCK(PVO_PADDR(pvo));
 }
 
 static struct pvo_entry *
@@ 

svn commit: r363221 - head/contrib/ofed/libibverbs/examples

2020-07-15 Thread Eric van Gyzen
Author: vangyzen
Date: Wed Jul 15 13:26:15 2020
New Revision: 363221
URL: https://svnweb.freebsd.org/changeset/base/363221

Log:
  Fix style in r363220
  
  Apply the style change Kostik suggested in the review.
  
  Reported by:  kib
  MFC after:2 weeks
  X-MFC with:   r363220
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D25676

Modified:
  head/contrib/ofed/libibverbs/examples/rc_pingpong.c
  head/contrib/ofed/libibverbs/examples/srq_pingpong.c
  head/contrib/ofed/libibverbs/examples/uc_pingpong.c
  head/contrib/ofed/libibverbs/examples/ud_pingpong.c
  head/contrib/ofed/libibverbs/examples/xsrq_pingpong.c

Modified: head/contrib/ofed/libibverbs/examples/rc_pingpong.c
==
--- head/contrib/ofed/libibverbs/examples/rc_pingpong.c Wed Jul 15 13:17:16 
2020(r363220)
+++ head/contrib/ofed/libibverbs/examples/rc_pingpong.c Wed Jul 15 13:26:15 
2020(r363221)
@@ -273,7 +273,7 @@ static struct pingpong_dest *pp_server_exch_dest(struc
return NULL;
}
 
-   if (listen(sockfd, 1)) {
+   if (listen(sockfd, 1) < 0) {
perror("listen() failed");
close(sockfd);
return NULL;

Modified: head/contrib/ofed/libibverbs/examples/srq_pingpong.c
==
--- head/contrib/ofed/libibverbs/examples/srq_pingpong.cWed Jul 15 
13:17:16 2020(r363220)
+++ head/contrib/ofed/libibverbs/examples/srq_pingpong.cWed Jul 15 
13:26:15 2020(r363221)
@@ -283,7 +283,7 @@ static struct pingpong_dest *pp_server_exch_dest(struc
return NULL;
}
 
-   if (listen(sockfd, 1)) {
+   if (listen(sockfd, 1) < 0) {
perror("listen() failed");
close(sockfd);
return NULL;

Modified: head/contrib/ofed/libibverbs/examples/uc_pingpong.c
==
--- head/contrib/ofed/libibverbs/examples/uc_pingpong.c Wed Jul 15 13:17:16 
2020(r363220)
+++ head/contrib/ofed/libibverbs/examples/uc_pingpong.c Wed Jul 15 13:26:15 
2020(r363221)
@@ -247,7 +247,7 @@ static struct pingpong_dest *pp_server_exch_dest(struc
return NULL;
}
 
-   if (listen(sockfd, 1)) {
+   if (listen(sockfd, 1) < 0) {
perror("listen() failed");
close(sockfd);
return NULL;

Modified: head/contrib/ofed/libibverbs/examples/ud_pingpong.c
==
--- head/contrib/ofed/libibverbs/examples/ud_pingpong.c Wed Jul 15 13:17:16 
2020(r363220)
+++ head/contrib/ofed/libibverbs/examples/ud_pingpong.c Wed Jul 15 13:26:15 
2020(r363221)
@@ -245,7 +245,7 @@ static struct pingpong_dest *pp_server_exch_dest(struc
return NULL;
}
 
-   if (listen(sockfd, 1)) {
+   if (listen(sockfd, 1) < 0) {
perror("listen() failed");
close(sockfd);
return NULL;

Modified: head/contrib/ofed/libibverbs/examples/xsrq_pingpong.c
==
--- head/contrib/ofed/libibverbs/examples/xsrq_pingpong.c   Wed Jul 15 
13:17:16 2020(r363220)
+++ head/contrib/ofed/libibverbs/examples/xsrq_pingpong.c   Wed Jul 15 
13:26:15 2020(r363221)
@@ -630,7 +630,7 @@ static int pp_server_connect(int port)
return 1;
}
 
-   if (listen(sockfd, ctx.num_clients)) {
+   if (listen(sockfd, ctx.num_clients) < 0) {
perror("listen() failed");
close(sockfd);
return 1;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r363220 - in head/contrib/ofed: infiniband-diags/src libibumad libibverbs libibverbs/examples libmlx5 librdmacm/examples opensm/opensm

2020-07-15 Thread Eric van Gyzen
Author: vangyzen
Date: Wed Jul 15 13:17:16 2020
New Revision: 363220
URL: https://svnweb.freebsd.org/changeset/base/363220

Log:
  Fix Coverity issues in OFED
  
  read_ibdiag_config NULL deref
  read_ibdiag_config mem leak
  ib_mad_inv_field_str Missing comma in a string array initialization
  print_node_header NULL deref
  diff_node_ports copy-paste error
  ibportstate.c main() missing break in switch
  set_thresholds NULL ptr deref
  dump_unicast_tables leaks mapnd
  umad_cm_attr_str dead code
  __ibv_close_device close(-1)
  check return value of listen()
  mlx5 bitmap.h - bad bit shift - UB
  get_dst_addr check return value of inet_pton
  osm_perfmgr_init check return value of cl_spinlock_init
  osm_port_new memory leak on error path
  sa_mad_ctrl_rcv_callback missing break in switch case
  
  I did not include CID numbers because these were found by an internal
  run at Isilon.
  
  Reviewed by:  cem kib
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D25676

Modified:
  head/contrib/ofed/infiniband-diags/src/ibdiag_common.c
  head/contrib/ofed/infiniband-diags/src/ibdiag_sa.c
  head/contrib/ofed/infiniband-diags/src/iblinkinfo.c
  head/contrib/ofed/infiniband-diags/src/ibportstate.c
  head/contrib/ofed/infiniband-diags/src/ibqueryerrors.c
  head/contrib/ofed/infiniband-diags/src/ibroute.c
  head/contrib/ofed/libibumad/umad_str.c
  head/contrib/ofed/libibverbs/device.c
  head/contrib/ofed/libibverbs/examples/rc_pingpong.c
  head/contrib/ofed/libibverbs/examples/srq_pingpong.c
  head/contrib/ofed/libibverbs/examples/uc_pingpong.c
  head/contrib/ofed/libibverbs/examples/ud_pingpong.c
  head/contrib/ofed/libibverbs/examples/xsrq_pingpong.c
  head/contrib/ofed/libmlx5/bitmap.h
  head/contrib/ofed/librdmacm/examples/mckey.c
  head/contrib/ofed/opensm/opensm/osm_perfmgr.c
  head/contrib/ofed/opensm/opensm/osm_port.c
  head/contrib/ofed/opensm/opensm/osm_sa_mad_ctrl.c

Modified: head/contrib/ofed/infiniband-diags/src/ibdiag_common.c
==
--- head/contrib/ofed/infiniband-diags/src/ibdiag_common.c  Wed Jul 15 
12:08:06 2020(r363219)
+++ head/contrib/ofed/infiniband-diags/src/ibdiag_common.c  Wed Jul 15 
13:17:16 2020(r363220)
@@ -120,6 +120,7 @@ static inline int val_str_true(const char *val_str)
 void read_ibdiag_config(const char *file)
 {
char buf[1024];
+   char orig_buf[1024];
FILE *config_fd = NULL;
char *p_prefix, *p_last;
char *name;
@@ -142,8 +143,14 @@ void read_ibdiag_config(const char *file)
if (*p_prefix == '#')
continue; /* ignore comment lines */
 
+   strlcpy(orig_buf, buf, sizeof(orig_buf));
name = strtok_r(p_prefix, "=", _last);
val_str = strtok_r(NULL, "\n", _last);
+   if (!name || !val_str) {
+   fprintf(stderr, "%s: malformed line in \"%s\":\n%s\n",
+   prog_name, file, orig_buf);
+   continue;
+   }
 
if (strncmp(name, "CA", strlen("CA")) == 0) {
free(ibd_ca);
@@ -165,6 +172,7 @@ void read_ibdiag_config(const char *file)
ibd_sakey = strtoull(val_str, 0, 0);
} else if (strncmp(name, "nd_format",
   strlen("nd_format")) == 0) {
+   free(ibd_nd_format);
ibd_nd_format = strdup(val_str);
}
}

Modified: head/contrib/ofed/infiniband-diags/src/ibdiag_sa.c
==
--- head/contrib/ofed/infiniband-diags/src/ibdiag_sa.c  Wed Jul 15 12:08:06 
2020(r363219)
+++ head/contrib/ofed/infiniband-diags/src/ibdiag_sa.c  Wed Jul 15 13:17:16 
2020(r363220)
@@ -222,7 +222,7 @@ static const char *ib_mad_inv_field_str[] = {
"MAD Reserved",
"MAD Reserved",
"MAD Reserved",
-   "MAD Invalid value in Attribute field(s) or Attribute Modifier"
+   "MAD Invalid value in Attribute field(s) or Attribute Modifier",
"MAD UNKNOWN ERROR"
 };
 #define MAD_ERR_UNKNOWN (ARR_SIZE(ib_mad_inv_field_str) - 1)

Modified: head/contrib/ofed/infiniband-diags/src/iblinkinfo.c
==
--- head/contrib/ofed/infiniband-diags/src/iblinkinfo.c Wed Jul 15 12:08:06 
2020(r363219)
+++ head/contrib/ofed/infiniband-diags/src/iblinkinfo.c Wed Jul 15 13:17:16 
2020(r363220)
@@ -293,7 +293,8 @@ void print_node_header(ibnd_node_t *node, int *out_hea
printf("%s%s: %s:\n",
out_prefix ? out_prefix : "",
nodetype_str(node), remap);
-   (*out_header_flag)++;
+   if (out_header_flag)
+

svn commit: r363219 - head/tools/build

2020-07-15 Thread Alex Richardson
Author: arichardson
Date: Wed Jul 15 12:08:06 2020
New Revision: 363219
URL: https://svnweb.freebsd.org/changeset/base/363219

Log:
  Fix BUILD_WITH_STRICT_TMPPATH builds
  
  We need dd in $PATH for some of the MK_BOOT code and some tests also use it.
  
  Obtained from:CheriBSD

Modified:
  head/tools/build/Makefile

Modified: head/tools/build/Makefile
==
--- head/tools/build/Makefile   Wed Jul 15 12:07:59 2020(r363218)
+++ head/tools/build/Makefile   Wed Jul 15 12:08:06 2020(r363219)
@@ -105,7 +105,7 @@ SYSINCS+=   ${SRCTOP}/sys/sys/font.h
 
 # basic commands: It is fine to use the host version for all of these even on
 # Linux/MacOS since we only use flags that are supported by all of them.
-_host_tools_to_symlink=basename bzip2 bunzip2 chmod chown cmp comm cp 
date \
+_host_tools_to_symlink=basename bzip2 bunzip2 chmod chown cmp comm cp 
date dd \
dirname echo env false find fmt gzip gunzip head hostname id ln ls \
mkdir mv nice patch rm realpath sh sleep stat tee touch tr true uname \
uniq wc which
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r363218 - in head/usr.bin/localedef: . bootstrap

2020-07-15 Thread Alex Richardson
Author: arichardson
Date: Wed Jul 15 12:07:59 2020
New Revision: 363218
URL: https://svnweb.freebsd.org/changeset/base/363218

Log:
  Allow bootstrapping localdef on non-FreeBSD systems
  
  The current localedef simply assumes that the locale headers on build system
  are compatible with those on the target system which is not necessarily true.
  It generally works on FreeBSD (as long as we don't change the locale headers),
  but Linux and macOS provide completely different locale headers.
  
  This change adds new bootstrap headers that namespace certain xlocale
  structures defined or used by in the headers that localdef needs.
  This is required since system headers *must* be able to include the "real"
  locale headers for printf(), etc., but we also want to access the target
  systems's internal locale structures.
  
  Reviewed By: yuripv, brooks
  Differential Revision: https://reviews.freebsd.org/D25229

Added:
  head/usr.bin/localedef/bootstrap/
  head/usr.bin/localedef/bootstrap/_ctype.h   (contents, props changed)
  head/usr.bin/localedef/bootstrap/bootstrap_xlocale_private.h   (contents, 
props changed)
  head/usr.bin/localedef/bootstrap/collate.h   (contents, props changed)
  head/usr.bin/localedef/bootstrap/ctype.h   (contents, props changed)
  head/usr.bin/localedef/bootstrap/limits.h   (contents, props changed)
  head/usr.bin/localedef/bootstrap/lmessages.h   (contents, props changed)
  head/usr.bin/localedef/bootstrap/lmonetary.h   (contents, props changed)
  head/usr.bin/localedef/bootstrap/lnumeric.h   (contents, props changed)
  head/usr.bin/localedef/bootstrap/namespace.h   (contents, props changed)
  head/usr.bin/localedef/bootstrap/timelocal.h   (contents, props changed)
  head/usr.bin/localedef/bootstrap/un-namespace.h   (contents, props changed)
  head/usr.bin/localedef/bootstrap/xlocale.h   (contents, props changed)
Modified:
  head/usr.bin/localedef/Makefile
  head/usr.bin/localedef/collate.c
  head/usr.bin/localedef/ctype.c

Modified: head/usr.bin/localedef/Makefile
==
--- head/usr.bin/localedef/Makefile Wed Jul 15 12:07:53 2020
(r363217)
+++ head/usr.bin/localedef/Makefile Wed Jul 15 12:07:59 2020
(r363218)
@@ -20,6 +20,9 @@ parser.h: parser.y
 IGNORE_PRAGMA= yes
 
 CFLAGS+=   -I. -I${.CURDIR}
+.if defined(BOOTSTRAPPING)
+CFLAGS+=   -I${.CURDIR}/bootstrap
+.endif
 CFLAGS+=   -I${SRCTOP}/lib/libc/locale
 CFLAGS+=   -I${SRCTOP}/lib/libc/stdtime
 

Added: head/usr.bin/localedef/bootstrap/_ctype.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.bin/localedef/bootstrap/_ctype.h   Wed Jul 15 12:07:59 2020
(r363218)
@@ -0,0 +1,48 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright 2018-2020 Alex Richardson 
+ *
+ * This software was developed by SRI International and the University of
+ * Cambridge Computer Laboratory (Department of Computer Science and
+ * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the
+ * DARPA SSITH research programme.
+ *
+ * This software was developed by SRI International and the University of
+ * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237)
+ * ("CTSRD"), as part of the DARPA CRASH research programme.
+ *
+ * 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$
+ */
+
+/*
+ * We have to ensure that we use the same constants as the target system when
+ * bootstrapping localedef so that we generate compatible databases.
+ */
+#ifndef __FreeBSD__
+typedefint __ct_rune_t;/* arg type for ctype 

svn commit: r363217 - head/usr.bin/localedef

2020-07-15 Thread Alex Richardson
Author: arichardson
Date: Wed Jul 15 12:07:53 2020
New Revision: 363217
URL: https://svnweb.freebsd.org/changeset/base/363217

Log:
  Add missing newline and return in localedef error message
  
  I hit those error messages when using a localedef built against headers
  that don't match the target system (cross-building from a Linux host).
  This problem will be fixed in the next commit.

Modified:
  head/usr.bin/localedef/collate.c

Modified: head/usr.bin/localedef/collate.c
==
--- head/usr.bin/localedef/collate.cWed Jul 15 12:07:47 2020
(r363216)
+++ head/usr.bin/localedef/collate.cWed Jul 15 12:07:53 2020
(r363217)
@@ -850,7 +850,8 @@ void
 add_order_directive(void)
 {
if (collinfo.directive_count >= COLL_WEIGHTS_MAX) {
-   fprintf(stderr,"too many directives (max %d)", 
COLL_WEIGHTS_MAX);
+   fprintf(stderr, "too many directives (max %d)\n", 
COLL_WEIGHTS_MAX);
+   return;
}
collinfo.directive_count++;
 }
@@ -859,7 +860,7 @@ static void
 add_order_pri(int32_t ref)
 {
if (curr_weight >= NUM_WT) {
-   fprintf(stderr,"too many weights (max %d)", NUM_WT);
+   fprintf(stderr, "too many weights (max %d)\n", NUM_WT);
return;
}
order_weights[curr_weight] = ref;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r363216 - head/lib/libpmc

2020-07-15 Thread Alex Richardson
Author: arichardson
Date: Wed Jul 15 12:07:47 2020
New Revision: 363216
URL: https://svnweb.freebsd.org/changeset/base/363216

Log:
  Avoid rebuilding libpmc in every incremental rebuild
  
  Generate libpmc_events.c in a temporary file first and only overwrite it
  if the files are actually different.
  This avoids compiling and relinking the different variants of libpmc on
  every incremental build.
  
  Reviewed By:  jhb
  Differential Revision: https://reviews.freebsd.org/D24784

Modified:
  head/lib/libpmc/Makefile

Modified: head/lib/libpmc/Makefile
==
--- head/lib/libpmc/MakefileWed Jul 15 10:24:39 2020(r363215)
+++ head/lib/libpmc/MakefileWed Jul 15 12:07:47 2020(r363216)
@@ -32,9 +32,13 @@ SUBDIR+= pmu-events
 .endif
 .endif
 
-libpmc_events.c: ${JEVENTS}
-   ${JEVENTS} ${EVENT_ARCH} ${.CURDIR}/pmu-events/arch libpmc_events.c
-SRCS+= libpmc_events.c
+libpmc_events.c: ${JEVENTS} .META
+   ${JEVENTS} ${EVENT_ARCH} ${.CURDIR}/pmu-events/arch ${.TARGET}.tmp
+   if [ ! -e ${.TARGET} ] || ! cmp -s ${.TARGET} ${.TARGET}.tmp; then \
+   mv -f ${.TARGET}.tmp ${.TARGET}; \
+   fi
+CLEANFILES+=   libpmc_events.c libpmc_events.c.tmp
+SRCS+= libpmc_events.c
 .endif
 
 WARNS?=3
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r363215 - head/sys/kern

2020-07-15 Thread Mateusz Guzik
Author: mjg
Date: Wed Jul 15 10:24:39 2020
New Revision: 363215
URL: https://svnweb.freebsd.org/changeset/base/363215

Log:
  poll: factor fd lookup out of scan and rescan

Modified:
  head/sys/kern/sys_generic.c

Modified: head/sys/kern/sys_generic.c
==
--- head/sys/kern/sys_generic.c Wed Jul 15 10:24:04 2020(r363214)
+++ head/sys/kern/sys_generic.c Wed Jul 15 10:24:39 2020(r363215)
@@ -1476,7 +1476,50 @@ sys_ppoll(struct thread *td, struct ppoll_args *uap)
return (kern_poll(td, uap->fds, uap->nfds, tsp, ssp));
 }
 
+#ifdef CAPABILITIES
 static int
+poll_fget(struct filedesc *fdp, int fd, struct file **fpp)
+{
+   const struct filedescent *fde;
+   const struct fdescenttbl *fdt;
+   const cap_rights_t *haverights;
+   struct file *fp;
+   int error;
+
+   if (__predict_false(fd >= fdp->fd_nfiles))
+   return (EBADF);
+
+   fdt = fdp->fd_files;
+   fde = >fdt_ofiles[fd];
+   fp = fde->fde_file;
+   if (__predict_false(fp == NULL))
+   return (EBADF);
+   haverights = cap_rights_fde_inline(fde);
+   error = cap_check_inline(haverights, _event_rights);
+   if (__predict_false(error != 0))
+   return (EBADF);
+   *fpp = fp;
+   return (0);
+}
+#else
+static int
+poll_fget(struct filedesc *fdp, int fd, struct file **fpp)
+{
+   struct file *fp;
+
+   if (__predict_false(fd >= fdp->fd_nfiles))
+   return (EBADF);
+
+   fp = fdp->fd_ofiles[fd].fde_file;
+   if (__predict_false(fp == NULL))
+   return (EBADF);
+
+   *fpp = fp;
+   return (0);
+}
+#endif
+
+static int
 pollrescan(struct thread *td)
 {
struct seltd *stp;
@@ -1499,19 +1542,11 @@ pollrescan(struct thread *td)
/* If the selinfo wasn't cleared the event didn't fire. */
if (si != NULL)
continue;
-   fp = fdp->fd_ofiles[fd->fd].fde_file;
-#ifdef CAPABILITIES
-   if (fp == NULL ||
-   cap_check(cap_rights(fdp, fd->fd), _event_rights) != 0)
-#else
-   if (fp == NULL)
-#endif
-   {
+   if (poll_fget(fdp, fd->fd, ) != 0) {
fd->revents = POLLNVAL;
n++;
continue;
}
-
/*
 * Note: backend also returns POLLHUP and
 * POLLERR if appropriate.
@@ -1550,47 +1585,39 @@ pollout(struct thread *td, struct pollfd *fds, struct 
 static int
 pollscan(struct thread *td, struct pollfd *fds, u_int nfd)
 {
-   struct filedesc *fdp = td->td_proc->p_fd;
+   struct filedesc *fdp;
struct file *fp;
-   int i, n = 0;
+   int i, n;
 
+   n = 0;
+   fdp = td->td_proc->p_fd;
FILEDESC_SLOCK(fdp);
for (i = 0; i < nfd; i++, fds++) {
-   if (fds->fd >= fdp->fd_nfiles) {
+   if (fds->fd < 0) {
+   fds->revents = 0;
+   continue;
+   }
+   if (poll_fget(fdp, fds->fd, ) != 0) {
fds->revents = POLLNVAL;
n++;
-   } else if (fds->fd < 0) {
-   fds->revents = 0;
-   } else {
-   fp = fdp->fd_ofiles[fds->fd].fde_file;
-#ifdef CAPABILITIES
-   if (fp == NULL ||
-   cap_check(cap_rights(fdp, fds->fd), 
_event_rights) != 0)
-#else
-   if (fp == NULL)
-#endif
-   {
-   fds->revents = POLLNVAL;
-   n++;
-   } else {
-   /*
-* Note: backend also returns POLLHUP and
-* POLLERR if appropriate.
-*/
-   selfdalloc(td, fds);
-   fds->revents = fo_poll(fp, fds->events,
-   td->td_ucred, td);
-   /*
-* POSIX requires POLLOUT to be never
-* set simultaneously with POLLHUP.
-*/
-   if ((fds->revents & POLLHUP) != 0)
-   fds->revents &= ~POLLOUT;
-
-   if (fds->revents != 0)
-   n++;
-   }
+   continue;
}
+   /*
+* Note: backend also returns POLLHUP and
+* POLLERR if appropriate.
+*/
+   selfdalloc(td, fds);
+   fds->revents = fo_poll(fp, fds->events,
+   td->td_ucred, td);
+   /*
+  

svn commit: r363214 - in head/sys: kern sys

2020-07-15 Thread Mateusz Guzik
Author: mjg
Date: Wed Jul 15 10:24:04 2020
New Revision: 363214
URL: https://svnweb.freebsd.org/changeset/base/363214

Log:
  fd: remove fd_lastfile
  
  It keeps recalculated way more often than it is needed.
  
  Provide a routine (fdlastfile) to get it if necessary.
  
  Consumers may be better off with a bitmap iterator instead.

Modified:
  head/sys/kern/init_main.c
  head/sys/kern/kern_descrip.c
  head/sys/kern/kern_exec.c
  head/sys/kern/kern_fork.c
  head/sys/kern/sys_generic.c
  head/sys/sys/filedesc.h

Modified: head/sys/kern/init_main.c
==
--- head/sys/kern/init_main.c   Wed Jul 15 10:14:00 2020(r363213)
+++ head/sys/kern/init_main.c   Wed Jul 15 10:24:04 2020(r363214)
@@ -558,7 +558,7 @@ proc0_init(void *dummy __unused)
siginit();
 
/* Create the file descriptor table. */
-   p->p_fd = fdinit(NULL, false);
+   p->p_fd = fdinit(NULL, false, NULL);
p->p_fdtol = NULL;
 
/* Create the limits structures. */

Modified: head/sys/kern/kern_descrip.c
==
--- head/sys/kern/kern_descrip.cWed Jul 15 10:14:00 2020
(r363213)
+++ head/sys/kern/kern_descrip.cWed Jul 15 10:24:04 2020
(r363214)
@@ -108,7 +108,6 @@ static __read_mostly smr_t pwd_smr;
 static int closefp(struct filedesc *fdp, int fd, struct file *fp,
struct thread *td, int holdleaders);
 static int fd_first_free(struct filedesc *fdp, int low, int size);
-static int fd_last_used(struct filedesc *fdp, int size);
 static voidfdgrowtable(struct filedesc *fdp, int nfd);
 static voidfdgrowtable_exp(struct filedesc *fdp, int nfd);
 static voidfdunused(struct filedesc *fdp, int fd);
@@ -213,29 +212,32 @@ fd_first_free(struct filedesc *fdp, int low, int size)
 }
 
 /*
- * Find the highest non-zero bit in the given bitmap, starting at 0 and
- * not exceeding size - 1. Return -1 if not found.
+ * Find the last used fd.
+ *
+ * Call this variant if fdp can't be modified by anyone else (e.g, during 
exec).
+ * Otherwise use fdlastfile.
  */
-static int
-fd_last_used(struct filedesc *fdp, int size)
+int
+fdlastfile_single(struct filedesc *fdp)
 {
NDSLOTTYPE *map = fdp->fd_map;
-   NDSLOTTYPE mask;
int off, minoff;
 
-   off = NDSLOT(size);
-   if (size % NDENTRIES) {
-   mask = ~(~(NDSLOTTYPE)0 << (size % NDENTRIES));
-   if ((mask &= map[off]) != 0)
-   return (off * NDENTRIES + flsl(mask) - 1);
-   --off;
-   }
+   off = NDSLOT(fdp->fd_nfiles - 1);
for (minoff = NDSLOT(0); off >= minoff; --off)
if (map[off] != 0)
return (off * NDENTRIES + flsl(map[off]) - 1);
return (-1);
 }
 
+int
+fdlastfile(struct filedesc *fdp)
+{
+
+   FILEDESC_LOCK_ASSERT(fdp);
+   return (fdlastfile_single(fdp));
+}
+
 static int
 fdisused(struct filedesc *fdp, int fd)
 {
@@ -265,8 +267,6 @@ fdused(struct filedesc *fdp, int fd)
FILEDESC_XLOCK_ASSERT(fdp);
 
fdused_init(fdp, fd);
-   if (fd > fdp->fd_lastfile)
-   fdp->fd_lastfile = fd;
if (fd == fdp->fd_freefile)
fdp->fd_freefile++;
 }
@@ -287,8 +287,6 @@ fdunused(struct filedesc *fdp, int fd)
fdp->fd_map[NDSLOT(fd)] &= ~NDBIT(fd);
if (fd < fdp->fd_freefile)
fdp->fd_freefile = fd;
-   if (fd == fdp->fd_lastfile)
-   fdp->fd_lastfile = fd_last_used(fdp, fd);
 }
 
 /*
@@ -1317,7 +1315,7 @@ int
 kern_close_range(struct thread *td, u_int lowfd, u_int highfd)
 {
struct filedesc *fdp;
-   int fd, ret;
+   int fd, ret, lastfile;
 
ret = 0;
fdp = td->td_proc->p_fd;
@@ -1335,14 +1333,15 @@ kern_close_range(struct thread *td, u_int lowfd, u_int
}
 
/*
-* If fdp->fd_lastfile == -1, we're dealing with either a fresh file
+* If lastfile == -1, we're dealing with either a fresh file
 * table or one in which every fd has been closed.  Just return
 * successful; there's nothing left to do.
 */
-   if (fdp->fd_lastfile == -1)
+   lastfile = fdlastfile(fdp);
+   if (lastfile == -1)
goto out;
-   /* Clamped to [lowfd, fd_lastfile] */
-   highfd = MIN(highfd, fdp->fd_lastfile);
+   /* Clamped to [lowfd, lastfile] */
+   highfd = MIN(highfd, lastfile);
for (fd = lowfd; fd <= highfd; fd++) {
if (fdp->fd_ofiles[fd].fde_file != NULL) {
FILEDESC_SUNLOCK(fdp);
@@ -1741,14 +1740,6 @@ fdgrowtable(struct filedesc *fdp, int nfd)
int nnfiles, onfiles;
NDSLOTTYPE *nmap, *omap;
 
-   /*
-* If lastfile is -1 this struct filedesc was just allocated and we are
-* growing it to accommodate for the one we are going to copy 

svn commit: r363212 - head/lib/libprocstat

2020-07-15 Thread Mateusz Guzik
Author: mjg
Date: Wed Jul 15 10:13:23 2020
New Revision: 363212
URL: https://svnweb.freebsd.org/changeset/base/363212

Log:
  libprocstat: fix kvm filedesc access after introduction of fdescenttbl

Modified:
  head/lib/libprocstat/libprocstat.c

Modified: head/lib/libprocstat/libprocstat.c
==
--- head/lib/libprocstat/libprocstat.c  Wed Jul 15 09:48:36 2020
(r363211)
+++ head/lib/libprocstat/libprocstat.c  Wed Jul 15 10:13:23 2020
(r363212)
@@ -459,6 +459,7 @@ procstat_getfiles_kvm(struct procstat *procstat, struc
 {
struct file file;
struct filedesc filed;
+   struct fdescenttbl *fdt;
struct pwd pwd;
unsigned long pwd_addr;
struct vm_map_entry vmentry;
@@ -467,13 +468,14 @@ procstat_getfiles_kvm(struct procstat *procstat, struc
vm_map_entry_t entryp;
vm_object_t objp;
struct vnode *vp;
-   struct filedescent *ofiles;
struct filestat *entry;
struct filestat_list *head;
kvm_t *kd;
void *data;
-   int i, fflags;
+   int fflags;
+   unsigned int i;
int prot, type;
+   size_t fdt_size;
unsigned int nfiles;
bool haspwd;
 
@@ -553,26 +555,31 @@ procstat_getfiles_kvm(struct procstat *procstat, struc
STAILQ_INSERT_TAIL(head, entry, next);
}
 
-   nfiles = filed.fd_lastfile + 1;
-   ofiles = malloc(nfiles * sizeof(struct filedescent));
-   if (ofiles == NULL) {
-   warn("malloc(%zu)", nfiles * sizeof(struct filedescent));
+   if (!kvm_read_all(kd, (unsigned long)filed.fd_files, ,
+   sizeof(nfiles))) {
+   warnx("can't read fd_files at %p", (void *)filed.fd_files);
+   return (NULL);
+   }
+
+   fdt_size = sizeof(*fdt) + nfiles * sizeof(struct filedescent);
+   fdt = malloc(fdt_size);
+   if (fdt == NULL) {
+   warn("malloc(%zu)", fdt_size);
goto do_mmapped;
}
-   if (!kvm_read_all(kd, (unsigned long)filed.fd_ofiles, ofiles,
-   nfiles * sizeof(struct filedescent))) {
-   warnx("cannot read file structures at %p",
-   (void *)filed.fd_ofiles);
-   free(ofiles);
+   if (!kvm_read_all(kd, (unsigned long)filed.fd_files, fdt, fdt_size)) {
+   warnx("cannot read file structures at %p", (void 
*)filed.fd_files);
+   free(fdt);
goto do_mmapped;
}
-   for (i = 0; i <= filed.fd_lastfile; i++) {
-   if (ofiles[i].fde_file == NULL)
+   for (i = 0; i < nfiles; i++) {
+   if (fdt->fdt_ofiles[i].fde_file == NULL) {
continue;
-   if (!kvm_read_all(kd, (unsigned long)ofiles[i].fde_file, ,
+   }
+   if (!kvm_read_all(kd, (unsigned 
long)fdt->fdt_ofiles[i].fde_file, ,
sizeof(struct file))) {
warnx("can't read file %d at %p", i,
-   (void *)ofiles[i].fde_file);
+   (void *)fdt->fdt_ofiles[i].fde_file);
continue;
}
switch (file.f_type) {
@@ -623,7 +630,7 @@ procstat_getfiles_kvm(struct procstat *procstat, struc
if (entry != NULL)
STAILQ_INSERT_TAIL(head, entry, next);
}
-   free(ofiles);
+   free(fdt);
 
 do_mmapped:
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r363213 - head/sys/kern

2020-07-15 Thread Mateusz Guzik
Author: mjg
Date: Wed Jul 15 10:14:00 2020
New Revision: 363213
URL: https://svnweb.freebsd.org/changeset/base/363213

Log:
  fd: add obvious branch predictions to fdalloc

Modified:
  head/sys/kern/kern_descrip.c

Modified: head/sys/kern/kern_descrip.c
==
--- head/sys/kern/kern_descrip.cWed Jul 15 10:13:23 2020
(r363212)
+++ head/sys/kern/kern_descrip.cWed Jul 15 10:14:00 2020
(r363213)
@@ -1847,9 +1847,9 @@ fdalloc(struct thread *td, int minfd, int *result)
 * If none is found, grow the file table.
 */
fd = fd_first_free(fdp, minfd, fdp->fd_nfiles);
-   if (fd >= maxfd)
+   if (__predict_false(fd >= maxfd))
return (EMFILE);
-   if (fd >= fdp->fd_nfiles) {
+   if (__predict_false(fd >= fdp->fd_nfiles)) {
allocfd = min(fd * 2, maxfd);
 #ifdef RACCT
if (RACCT_ENABLED()) {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r363211 - head/sys/amd64/amd64

2020-07-15 Thread Konstantin Belousov
Author: kib
Date: Wed Jul 15 09:48:36 2020
New Revision: 363211
URL: https://svnweb.freebsd.org/changeset/base/363211

Log:
  Grammar and typo fixes.
  
  Submitted by: alc
  MFC after:20 days

Modified:
  head/sys/amd64/amd64/mp_machdep.c

Modified: head/sys/amd64/amd64/mp_machdep.c
==
--- head/sys/amd64/amd64/mp_machdep.c   Wed Jul 15 01:26:28 2020
(r363210)
+++ head/sys/amd64/amd64/mp_machdep.c   Wed Jul 15 09:48:36 2020
(r363211)
@@ -203,7 +203,7 @@ cpu_mp_start(void)
cpu_apic_ids[i] = -1;
}
 
-   /* Install an inter-CPU IPI for for cache and TLB invalidations. */
+   /* Install an inter-CPU IPI for cache and TLB invalidations. */
setidt(IPI_INVLOP, pti ? IDTVEC(invlop_pti) : IDTVEC(invlop),
SDT_SYSIGT, SEL_KPL, 0);
 
@@ -557,7 +557,7 @@ static enum invl_op_codes invl_op_pg;
  * at location (cpu, my_cpuid) for each target cpu.  After that IPI is
  * sent to all targets which scan for zeroed scoreboard generation
  * words.  Upon finding such word the shootdown data is read from
- * corresponding cpu' pcpu, and generation is set.  Meantime initiator
+ * corresponding cpu's pcpu, and generation is set.  Meantime initiator
  * loops waiting for all zeroed generations in scoreboard to update.
  */
 static uint32_t *invl_scoreboard;
@@ -654,8 +654,8 @@ smp_targeted_tlb_shootdown(cpuset_t mask, pmap_t pmap,
 
/*
 * Initiator must have interrupts enabled, which prevents
-* non-invalidation IPIs, that takes smp_ipi_mtx spinlock,
-* from deadlocking with as.  On the other hand, preemption
+* non-invalidation IPIs that take smp_ipi_mtx spinlock,
+* from deadlocking with us.  On the other hand, preemption
 * must be disabled to pin initiator to the instance of the
 * pcpu pc_smp_tlb data and scoreboard line.
 */
@@ -687,7 +687,7 @@ smp_targeted_tlb_shootdown(cpuset_t mask, pmap_t pmap,
/*
 * IPI acts as a fence between writing to the scoreboard above
 * (zeroing slot) and reading from it below (wait for
-* acknowledge).
+* acknowledgment).
 */
if (CPU_ISFULLSET()) {
ipi_all_but_self(IPI_INVLOP);
@@ -1080,7 +1080,7 @@ invlop_handler(void)
 
/*
 * This acquire fence and its corresponding release
-* fence in smp_targeted_tlb_shootdown(), is between
+* fence in smp_targeted_tlb_shootdown() is between
 * reading zero scoreboard slot and accessing PCPU of
 * initiator for pc_smp_tlb values.
 */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"