svn commit: r344460 - head/usr.sbin/vidcontrol

2019-02-21 Thread Bruce Evans
Author: bde
Date: Fri Feb 22 07:00:23 2019
New Revision: 344460
URL: https://svnweb.freebsd.org/changeset/base/344460

Log:
  Oops, actually fix warnings from -Wpointer-sign.

Modified:
  head/usr.sbin/vidcontrol/vidcontrol.c

Modified: head/usr.sbin/vidcontrol/vidcontrol.c
==
--- head/usr.sbin/vidcontrol/vidcontrol.c   Fri Feb 22 06:57:46 2019
(r344459)
+++ head/usr.sbin/vidcontrol/vidcontrol.c   Fri Feb 22 07:00:23 2019
(r344460)
@@ -1390,8 +1390,8 @@ get_terminal_emulator(int i, struct term_info *tip)
tip->ti_index = i;
if (ioctl(0, CONS_GETTERM, tip) == 0)
return (1);
-   strlcpy((unsigned char *)tip->ti_name, "unknown", sizeof(tip->ti_name));
-   strlcpy((unsigned char *)tip->ti_desc, "unknown", sizeof(tip->ti_desc));
+   strlcpy((char *)tip->ti_name, "unknown", sizeof(tip->ti_name));
+   strlcpy((char *)tip->ti_desc, "unknown", sizeof(tip->ti_desc));
return (0);
 }
 
@@ -1415,7 +1415,7 @@ set_terminal_emulator(const char *name)
struct term_info old_ti, ti;
 
get_terminal_emulator(0, _ti);
-   strlcpy((unsigned char *)ti.ti_name, name, sizeof(ti.ti_name));
+   strlcpy((char *)ti.ti_name, name, sizeof(ti.ti_name));
if (ioctl(0, CONS_SETTERM, ) != 0)
warn("SETTERM '%s'", name);
get_terminal_emulator(0, );
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r344459 - head/usr.sbin/vidcontrol

2019-02-21 Thread Bruce Evans
Author: bde
Date: Fri Feb 22 06:57:46 2019
New Revision: 344459
URL: https://svnweb.freebsd.org/changeset/base/344459

Log:
  Fix warnings from -Wpointer-sign.

Modified:
  head/usr.sbin/vidcontrol/vidcontrol.c

Modified: head/usr.sbin/vidcontrol/vidcontrol.c
==
--- head/usr.sbin/vidcontrol/vidcontrol.c   Fri Feb 22 06:41:47 2019
(r344458)
+++ head/usr.sbin/vidcontrol/vidcontrol.c   Fri Feb 22 06:57:46 2019
(r344459)
@@ -1390,8 +1390,8 @@ get_terminal_emulator(int i, struct term_info *tip)
tip->ti_index = i;
if (ioctl(0, CONS_GETTERM, tip) == 0)
return (1);
-   strlcpy(tip->ti_name, "unknown", sizeof(tip->ti_name));
-   strlcpy(tip->ti_desc, "unknown", sizeof(tip->ti_desc));
+   strlcpy((unsigned char *)tip->ti_name, "unknown", sizeof(tip->ti_name));
+   strlcpy((unsigned char *)tip->ti_desc, "unknown", sizeof(tip->ti_desc));
return (0);
 }
 
@@ -1415,7 +1415,7 @@ set_terminal_emulator(const char *name)
struct term_info old_ti, ti;
 
get_terminal_emulator(0, _ti);
-   strlcpy(ti.ti_name, name, sizeof(ti.ti_name));
+   strlcpy((unsigned char *)ti.ti_name, name, sizeof(ti.ti_name));
if (ioctl(0, CONS_SETTERM, ) != 0)
warn("SETTERM '%s'", name);
get_terminal_emulator(0, );
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r344458 - in head: share/man/man4 sys/conf usr.sbin/vidcontrol

2019-02-21 Thread Bruce Evans
Author: bde
Date: Fri Feb 22 06:41:47 2019
New Revision: 344458
URL: https://svnweb.freebsd.org/changeset/base/344458

Log:
  Connect the restored dumb and sc terminal emulators to the kernel build.
  Add or fix options to control static and dynamic configuration.  Keep
  the default of scteken, but default to statically configuring all available
  emulators (now 3 instead of 1).
  
  The dumb emulator is almost usable.  libedit and libreadline handle
  dumb terminals perfectly for at least shell history.  less(1) works
  as well as possible except on exit.  But curses programs make messes.
  The dumb emulator has strange color support, with 2 dumb colors for
  normal output but fancy colorization for the cursor, mouse pointer and
  (with a non-dumb initial emulator) for low-level console output.
  
  Using the sc emulator instead of the default of scteken fixes at least
  the following bugs:
  - NUL is a printing character in cons25 but not in teken
  - teken doesn't support fixed colors for "reverse" video.
  - The best versions of sc are about 10 times faster than scteken (for
printing to the frame buffer).  This version is only about 5 times
faster.
  
  Fix configuration features:
  - make SC_DFLT_TERM (for setting the initial emulator) a normal option.
  
  Add configuration features:
  - negative options SC_NO_TERM_* for omitting emulators in the static config.
Modules for emulators might work, but I don't know of any
  - vidcontrol -e shows the available emulators
  - vidcontrol -E  sets the active emulator.

Modified:
  head/share/man/man4/syscons.4
  head/sys/conf/NOTES
  head/sys/conf/files
  head/sys/conf/options
  head/usr.sbin/vidcontrol/vidcontrol.1
  head/usr.sbin/vidcontrol/vidcontrol.c

Modified: head/share/man/man4/syscons.4
==
--- head/share/man/man4/syscons.4   Fri Feb 22 04:52:12 2019
(r344457)
+++ head/share/man/man4/syscons.4   Fri Feb 22 06:41:47 2019
(r344458)
@@ -38,6 +38,7 @@
 .Cd "options SC_ALT_MOUSE_IMAGE"
 .Cd "options SC_CUT_SEPCHARS=_characters_"
 .Cd "options SC_CUT_SPACES2TABS"
+.Cd "options SC_DFLT_TERM"
 .Cd "options SC_DISABLE_KDBKEY"
 .Cd "options SC_DISABLE_REBOOT"
 .Cd "options SC_HISTORY_SIZE=N"
@@ -48,6 +49,9 @@
 .Cd "options SC_NO_PALETTE_LOADING"
 .Cd "options SC_NO_SUSPEND_VTYSWITCH"
 .Cd "options SC_NO_SYSMOUSE"
+.Cd "options SC_NO_TERM_DUMB"
+.Cd "options SC_NO_TERM_SC"
+.Cd "options SC_NO_TERM_SCTEKEN"
 .Cd "options SC_PIXEL_MODE"
 .Cd "options SC_TWOBUTTON_MOUSE"
 .Cd "options SC_NORM_ATTR=_attribute_"
@@ -285,6 +289,8 @@ This options instructs the driver to convert leading s
 when copying data into cut buffer.
 This might be useful to preserve
 indentation when copying tab-indented text.
+.It Dv SC_DFLT_TERM=_name_
+This option specifies the name of the preferred terminal emulator.
 .It Dv SC_DISABLE_KDBKEY
 This option disables the ``debug'' key combination (by default, it is
 .Dv Alt-Esc ,
@@ -409,6 +415,15 @@ will fail if this option is defined.
 This option implies the
 .Dv SC_NO_CUTPASTE
 option too.
+.It Dv SC_NO_TERM_DUMB
+.It Dv SC_NO_TERM_SC
+.It Dv SC_NO_TERM_SCTEKEN
+These options remove the
+.Qq dumb ,
+.Qq sc ,
+and
+.Qq scteken 
+terminal emulators, respectively.
 .El
 .Ss Driver Flags
 The following driver flags can be used to control the

Modified: head/sys/conf/NOTES
==
--- head/sys/conf/NOTES Fri Feb 22 04:52:12 2019(r344457)
+++ head/sys/conf/NOTES Fri Feb 22 06:41:47 2019(r344458)
@@ -1488,6 +1488,7 @@ options   MAXCONS=16  # number of virtual 
consoles
 optionsSC_ALT_MOUSE_IMAGE  # simplified mouse cursor in text mode
 optionsSC_DFLT_FONT# compile font in
 makeoptionsSC_DFLT_FONT=cp850
+optionsSC_DFLT_TERM=\"sc\" # default terminal emulator
 optionsSC_DISABLE_KDBKEY   # disable `debug' key
 optionsSC_DISABLE_REBOOT   # disable reboot key sequence
 optionsSC_HISTORY_SIZE=200 # number of history buffer lines
@@ -1518,6 +1519,9 @@ options   SC_NO_HISTORY
 optionsSC_NO_MODE_CHANGE
 optionsSC_NO_SYSMOUSE
 optionsSC_NO_SUSPEND_VTYSWITCH
+#!options  SC_NO_TERM_DUMB
+#!options  SC_NO_TERM_SC
+#!options  SC_NO_TERM_SCTEKEN
 
 # `flags' for sc
 #  0x80Put the video card in the VESA 800x600 dots, 16 color mode

Modified: head/sys/conf/files
==
--- head/sys/conf/files Fri Feb 22 04:52:12 2019(r344457)
+++ head/sys/conf/files Fri Feb 22 06:41:47 2019(r344458)
@@ -3133,7 +3133,9 @@ dev/syscons/rain/rain_saver.c optional rain_saver
 dev/syscons/schistory.coptional sc
 dev/syscons/scmouse.c  optional sc
 dev/syscons/scterm.c   optional sc
-dev/syscons/scterm-teken.c optional sc

Re: svn commit: r344455 - in stable/11: . stand

2019-02-21 Thread Rodney W. Grimes
> Author: kevans
> Date: Fri Feb 22 03:10:24 2019
> New Revision: 344455
> URL: https://svnweb.freebsd.org/changeset/base/344455
> 
> Log:
>   Direct commit for some clarification/correction
>   
>   The notice in UPDATING stated the wrong direction for the link.
>   
>   Additionally, it's decidedly not a bad idea to throw in a comment mandating
>   that the ordering of LOADER_DEFAULT_INTERP bits remains the same in this
>   branch. This makes it even more obvious from diff review (against head) that
>   this difference is intentional and creates merge conflicts if someone tries
>   to apply the original commit manually.  I suspect this won't be a problem
>   given the set of people that maintain loader bits in stable/11, but it does
>   offer a peace of mind.
>   
>   Reported by:rgrimes

Thank you, but you still missed the missing .

> 
> Modified:
>   stable/11/UPDATING
>   stable/11/stand/defs.mk
> 
> Modified: stable/11/UPDATING
> ==
> --- stable/11/UPDATINGThu Feb 21 23:53:52 2019(r344454)
> +++ stable/11/UPDATINGFri Feb 22 03:10:24 2019(r344455)
> @@ -22,7 +22,7 @@ from older version of current across the gcc/clang cut
>   in build(7), may be used to control which interpreter flavor is used in
>   the default loader to be installed.  For systems where Lua and Forth
>   coexist, this switch can also be made on a running system by creating a
> - link from /boot/loader_${flavor}{,efi} to /boot/loader{,.efi} rather
> + link from /boot/loader{,.efi} to /boot/loader_${flavor}{,efi} rather
 ^.efi?

>   than requiring a rebuild.
>  
>   The default flavor in this branch will remain Forth.  As indicated in
> 
> Modified: stable/11/stand/defs.mk
> ==
> --- stable/11/stand/defs.mk   Thu Feb 21 23:53:52 2019(r344454)
> +++ stable/11/stand/defs.mk   Fri Feb 22 03:10:24 2019(r344455)
> @@ -156,6 +156,8 @@ CFLAGS+=  -mlittle-endian
>  #
>  # Have a sensible default
>  #
> +# XXX Do not change the ordering of this chain in this branch.  4th must 
> remain
> +# the default for the lifetime of stable/11.
>  .if ${MK_FORTH} == "yes"
>  LOADER_DEFAULT_INTERP?=4th
>  .elif ${MK_LOADER_LUA} == "yes"
> 
> 

-- 
Rod Grimes rgri...@freebsd.org
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r344451 - head/usr.sbin/nfsd

2019-02-21 Thread Bruce Evans

On Thu, 21 Feb 2019, Sean Eric Fagan wrote:


Log:
 Fix the usage error I introduced in r344192.

 Specifically, I put the new option line in the wrong place, and then fixed
 up the rest without realizing it.  This puts the usage statement back to
 what it was, with an additional line for the new -V option.


This restores the misformatting of the output.

Usage messages should have the same formatting as the man page.  Not to
mention they should have the same options.


Modified: head/usr.sbin/nfsd/nfsd.c
==
--- head/usr.sbin/nfsd/nfsd.c   Thu Feb 21 22:49:21 2019(r344450)
+++ head/usr.sbin/nfsd/nfsd.c   Thu Feb 21 22:49:39 2019(r344451)
@@ -189,9 +189,9 @@ main(int argc, char **argv)
"usage:\n"
"  nfsd [-ardtue] [-h bindip]\n"


Misformatting starts here.  man(1) output has a 5-column left margin
without "usage: ".  Normal usage messages use a 7-column left margin
as needed to fit "usage: " before the command name on the same line.


"   [-n numservers] [--minthreads #] [--maxthreads #]\n"
-   "   [-p/--pnfs dsserver0:/dsserver0-mounted-on-dir,...,\n"
-   "   [-V virtual_hostname]\n"
-   "   dsserverN:/dsserverN-mounted-on-dir] [-m mirrorlevel]\n";
+   "   [-p/--pnfs dsserver0:/dsserver0-mounted-on-dir,...,"
+   "dsserverN:/dsserverN-mounted-on-dir] [-m mirrorlevel]\n"


This is the worst misformatting.


+   "   [-V virtual_hostname]\n";
while ((ch = getopt_long(argc, argv, getopt_shortopts, longopts,
)) != -1)
switch (ch) {


The man(1) output is:

XX  nfsd [-ardute] [-n num_servers] [-h bindip] [-p pnfs_setup]
XX   [-m mirror_level] [-V virtual_hostname] [--maxthreads max_threads]
XX   [--minthreads min_threads]

This is missing the --pnfs and -V options.

The usage messge is:

XX usage:
XX   nfsd [-ardtue] [-h bindip]
XX[-n numservers] [--minthreads #] [--maxthreads #]
XX[-p/--pnfs 
dsserver0:/dsserver0-mounted-on-dir,...,dsserverN:/dsserverN-mounted-on-dir] 
[-m mirrorlevel]
XX[-V virtual_hostname]

Other bugs in the usage message:
- the -n option is unsorted
- the name of the arg for the -n option is different
- the --minthreads and --maxthreads options are sorted backwards
- the name of the arg for --minthreads and --maxthreads is different and
  unusual.  Man pages cannot use the abbreviation '#' for a number since
  this is not unique.
- the arg for the -p/--pnfs option is a description, not a name.  This is
  also unsuitable for the synopsis in man pages
- the description of the arg for the -p/--pnfs option is too long.  man(1)
  would make a different mess of formatting a single long token.
- the description for -p/-pnfs is not normally formatted.  cp(1) gave an
  example of normal formatting for lists, but this was and is broken too.
  It was "src1 ... srcN directory" and is now "source_file ... target
  directory".  The old version is apparently carefully abbreviated to fit
  on 1 line, but " srcN" is redundant if N > 1 and a syntax error if
  N == 1.  nfsd has the same syntax error and this helps mess up the
  formatting.  cp leaves a space between the arg names and the ellipsis.
  The commas in the nfsd arg are needed to give a single token, but are
  especially hard to format and to describe in a more formal syntax.
  nfsd's man page doesn't attempt to give a more formal syntax.  The
  current version of cp(1) fixes the redundant/wrong srcN, but expands
  the arg names and misformats the resulting long line only in the usage
  message.  The separate tokens allow man(1) to split the line at a bad
  place, but it somehow splits early so as to not split in the middle of
  related tokens.

  I found misformatting in man output in additions to vidcontrol(1)
  yesterday.  It needs to start a new line for the -f arg after adding
  args before -f, but splits in between the option and the arg.  This
  seems to be because the -f option has a complicated fairly formal
  syntax involving lots of square brackets and the man page source uses
  lots of markup to express this, and this confuses man(1).

- there isn't even a newline after the long description for -p/--pnfs
  gives a too-long line
- the -m option is unsorted
- the name of the arg for the -m option is different.

I seem to have lost my synopsis/usage checker.  Here is a quick
re-implementation:

XX #!/bin/sh
XX 
XX name=$1
XX 
XX IFS= synopsis=$(man $name | col -bx | awk '{

XX  if (match($1, "SYNOPSIS")) {
XX  state = 1
XX  next
XX  } else if (state == 0)
XX  next
XX  else if (length($0) == 0)
XX  exit
XX  if (state == 1) {
XX  print "usage: " substr($0, 6)
XX  state = 2
XX  } else
XX  print "  " $0
XX }')
XX IFS= usage=$($name -? --help 2>&1 

Re: svn commit: r344414 - stable/11

2019-02-21 Thread Kyle Evans
On Thu, Feb 21, 2019 at 10:41 AM Rodney W. Grimes
 wrote:
>
> > > On Feb 21, 2019, at 04:43, Kyle Evans  wrote:
> > >
> > > On Thu, Feb 21, 2019 at 12:16 AM Rodney W. Grimes
> > >  wrote:
> > >>
> > >>> Author: kevans
> > >>> Date: Thu Feb 21 03:22:20 2019
> > >>> New Revision: 344414
> > >>> URL: https://svnweb.freebsd.org/changeset/base/344414
> > >>>
> > >>> Log:
> > >>>  MFC (RECORD ONLY) r338050: Loader default interpreter flip
> > >>>
> > >>>  The default interpreter for stable/11 is 4th; this will never and can 
> > >>> never
> > >>>  change. Record MFC of r338050 to proactively prevent any accidents in 
> > >>> future
> > >>>  batching of MFCs.
> > >>>
> > >>> Modified:
> > >>> Directory Properties:
> > >>>  stable/11/   (props changed)
> > >>
> > >> Does it make sense to do a direct commit to stable/11
> > >> marking the line that does this flip with a
> > >> "Do not change this in the stable/11 branch"
> > >> so that someone does not try to manually merge
> > >> the change if they happen to notice the code
> > >> is different?
> > >
> > > I'll chew on it for a little bit. It's fairly clear what the
> > > ramifications of swapping those lines around are, even from diff
> > > review, and I'd like to assume no one would willfully do it if they
> > > put a couple seconds thought into what they were about to commit.
> >
> > Kyle,
> > I think what you did makes sense. I?ve done this and I?ve
> > seen others do similar in the past.
> I concur, what he did do makes perfect since.
>
> > As someone who?s merged code in from others, I appreciate
> > measures like this, which would prevent me from breaking a
> > stable branch by accident.
>
> I am just wondering about a second safety belt,
> as the current one just makes a svn merge -c338050 a silent nop,
> but in no way stops someone from manually applying the diff.
>
> We have people that are very good with svn and would know how
> to investigate the nop, and we have people who can barely
> manage to do a merge with proper mergeinfo.
>

After mulling it over, I went ahead and committed the result in
r344455. I still don't necessarily think it'll be a problem, but I
certainly don't object to more safety belts and peace of mind --
especially since it's a subtle change to flip the ordering that might
not be easy to catch at a glance without the ugly warning nearby.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r344456 - head/sys/arm/allwinner

2019-02-21 Thread Ganbold Tsagaankhuu
Author: ganbold
Date: Fri Feb 22 03:11:27 2019
New Revision: 344456
URL: https://svnweb.freebsd.org/changeset/base/344456

Log:
  Add base to the warning threshold.

Modified:
  head/sys/arm/allwinner/axp81x.c

Modified: head/sys/arm/allwinner/axp81x.c
==
--- head/sys/arm/allwinner/axp81x.c Fri Feb 22 03:10:24 2019
(r344455)
+++ head/sys/arm/allwinner/axp81x.c Fri Feb 22 03:11:27 2019
(r344456)
@@ -195,8 +195,9 @@ MALLOC_DEFINE(M_AXP8XX_REG, "AXP8xx regulator", "AXP8x
 #defineAXP_BAT_COULOMB_LO  0xe3
 
 #defineAXP_BAT_CAP_WARN0xe6
-#define AXP_BAT_CAP_WARN_LV1   0xf0/* Bits 4, 5, 6, 7 */
-#define AXP_BAT_CAP_WARN_LV2   0xf /* Bits 0, 1, 2, 3 */
+#define AXP_BAT_CAP_WARN_LV1   0xf0/* Bits 4, 5, 6, 7 */
+#define AXP_BAP_CAP_WARN_LV1BASE   5   /* 5-20%, 1% per step */
+#define AXP_BAT_CAP_WARN_LV2   0xf /* Bits 0, 1, 2, 3 */
 
 /* Sensor conversion macros */
 #defineAXP_SENSOR_BAT_H(hi)((hi) << 4)
@@ -1527,6 +1528,7 @@ axp8xx_attach(device_t dev)
/* Get thresholds */
if (axp8xx_read(dev, AXP_BAT_CAP_WARN, , 1) == 0) {
sc->warn_thres = (val & AXP_BAT_CAP_WARN_LV1) >> 4;
+   sc->warn_thres += AXP_BAP_CAP_WARN_LV1BASE;
sc->shut_thres = (val & AXP_BAT_CAP_WARN_LV2);
if (bootverbose) {
device_printf(dev,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r344455 - in stable/11: . stand

2019-02-21 Thread Kyle Evans
Author: kevans
Date: Fri Feb 22 03:10:24 2019
New Revision: 344455
URL: https://svnweb.freebsd.org/changeset/base/344455

Log:
  Direct commit for some clarification/correction
  
  The notice in UPDATING stated the wrong direction for the link.
  
  Additionally, it's decidedly not a bad idea to throw in a comment mandating
  that the ordering of LOADER_DEFAULT_INTERP bits remains the same in this
  branch. This makes it even more obvious from diff review (against head) that
  this difference is intentional and creates merge conflicts if someone tries
  to apply the original commit manually.  I suspect this won't be a problem
  given the set of people that maintain loader bits in stable/11, but it does
  offer a peace of mind.
  
  Reported by:  rgrimes

Modified:
  stable/11/UPDATING
  stable/11/stand/defs.mk

Modified: stable/11/UPDATING
==
--- stable/11/UPDATING  Thu Feb 21 23:53:52 2019(r344454)
+++ stable/11/UPDATING  Fri Feb 22 03:10:24 2019(r344455)
@@ -22,7 +22,7 @@ from older version of current across the gcc/clang cut
in build(7), may be used to control which interpreter flavor is used in
the default loader to be installed.  For systems where Lua and Forth
coexist, this switch can also be made on a running system by creating a
-   link from /boot/loader_${flavor}{,efi} to /boot/loader{,.efi} rather
+   link from /boot/loader{,.efi} to /boot/loader_${flavor}{,efi} rather
than requiring a rebuild.
 
The default flavor in this branch will remain Forth.  As indicated in

Modified: stable/11/stand/defs.mk
==
--- stable/11/stand/defs.mk Thu Feb 21 23:53:52 2019(r344454)
+++ stable/11/stand/defs.mk Fri Feb 22 03:10:24 2019(r344455)
@@ -156,6 +156,8 @@ CFLAGS+=-mlittle-endian
 #
 # Have a sensible default
 #
+# XXX Do not change the ordering of this chain in this branch.  4th must remain
+# the default for the lifetime of stable/11.
 .if ${MK_FORTH} == "yes"
 LOADER_DEFAULT_INTERP?=4th
 .elif ${MK_LOADER_LUA} == "yes"
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r344452 - in head/sys/cddl: contrib/opensolaris/uts/common/dtrace contrib/opensolaris/uts/intel/dtrace dev/dtrace

2019-02-21 Thread Conrad Meyer
Thanks Mark!

Prior to this change, if you used userspace dtrace enough, eventually
you would get a spurious SIGTRAP on a process, which has the default
behavior of dumping core.  Perhaps understandably, people balk at
random core files lying around.  Or at dtrace killing their programs.
This patch should address that long-standing problem.

An easy repro scenario was described in the differential:

> It's possible to reproduce this by, for example, calling strlen()
> in a loop, probing every instruction in strlen(), and killing dtrace(1).


On Thu, Feb 21, 2019 at 2:54 PM Mark Johnston  wrote:
>
> Author: markj
> Date: Thu Feb 21 22:54:17 2019
> New Revision: 344452
> URL: https://svnweb.freebsd.org/changeset/base/344452
>
> Log:
>   Fix a tracepoint lookup race in fasttrap_pid_probe().
>
>   fasttrap hooks the userspace breakpoint handler; the hook looks up the
>   breakpoint address in a hash table of tracepoints.  It is possible for
>   the tracepoint to be removed by a different thread in between the
>   breakpoint trap and the hash table lookup, in which case SIGTRAP gets
>   delivered to the target process.  Fix the problem by adding a
>   per-process generation counter that gets incremented when a tracepoint
>   belonging to that process is removed.  Then, when a lookup fails, the
>   trapping instruction is restarted if the thread's counter doesn't match
>   that of the process.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r344454 - in stable: 11/tools/build/mk 12/tools/build/mk

2019-02-21 Thread Andriy Voskoboinyk
Author: avos
Date: Thu Feb 21 23:53:52 2019
New Revision: 344454
URL: https://svnweb.freebsd.org/changeset/base/344454

Log:
  MFC r344201:
  Remove vi(1)-related files via 'make delete-old' when WITHOUT_VI=1 is set.

Modified:
  stable/12/tools/build/mk/OptionalObsoleteFiles.inc
Directory Properties:
  stable/12/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/tools/build/mk/OptionalObsoleteFiles.inc
Directory Properties:
  stable/11/   (props changed)

Modified: stable/12/tools/build/mk/OptionalObsoleteFiles.inc
==
--- stable/12/tools/build/mk/OptionalObsoleteFiles.inc  Thu Feb 21 22:56:54 
2019(r344453)
+++ stable/12/tools/build/mk/OptionalObsoleteFiles.inc  Thu Feb 21 23:53:52 
2019(r344454)
@@ -9720,6 +9720,32 @@ OLD_FILES+=usr/share/man/man8/lastlogin.8.gz
 OLD_FILES+=usr/share/man/man8/utx.8.gz
 .endif
 
+.if ${MK_VI} == no
+OLD_FILES+=etc/rc.d/virecover
+OLD_FILES+=rescue/ex
+OLD_FILES+=rescue/vi
+OLD_FILES+=usr/bin/ex
+OLD_FILES+=usr/bin/nex
+OLD_FILES+=usr/bin/nvi
+OLD_FILES+=usr/bin/nview
+OLD_FILES+=usr/bin/vi
+OLD_FILES+=usr/bin/view
+OLD_FILES+=usr/share/man/man1/ex.1.gz
+OLD_FILES+=usr/share/man/man1/nex.1.gz
+OLD_FILES+=usr/share/man/man1/nvi.1.gz
+OLD_FILES+=usr/share/man/man1/nview.1.gz
+OLD_FILES+=usr/share/man/man1/vi.1.gz
+OLD_FILES+=usr/share/man/man1/view.1.gz
+.  if exists(${DESTDIR}/usr/share/vi)
+VI_DIRS!=find ${DESTDIR}/usr/share/vi -type d \
+| sed -e 's,^${DESTDIR}/,,'; echo
+VI_FILES!=find ${DESTDIR}/usr/share/vi \! -type d \
+| sed -e 's,^${DESTDIR}/,,'; echo
+OLD_DIRS+=${VI_DIRS}
+OLD_FILES+=${VI_FILES}
+.  endif
+.endif
+
 .if ${MK_WIRELESS} == no
 OLD_FILES+=etc/regdomain.xml
 OLD_FILES+=etc/rc.d/hostapd
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r344454 - in stable: 11/tools/build/mk 12/tools/build/mk

2019-02-21 Thread Andriy Voskoboinyk
Author: avos
Date: Thu Feb 21 23:53:52 2019
New Revision: 344454
URL: https://svnweb.freebsd.org/changeset/base/344454

Log:
  MFC r344201:
  Remove vi(1)-related files via 'make delete-old' when WITHOUT_VI=1 is set.

Modified:
  stable/11/tools/build/mk/OptionalObsoleteFiles.inc
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/12/tools/build/mk/OptionalObsoleteFiles.inc
Directory Properties:
  stable/12/   (props changed)

Modified: stable/11/tools/build/mk/OptionalObsoleteFiles.inc
==
--- stable/11/tools/build/mk/OptionalObsoleteFiles.inc  Thu Feb 21 22:56:54 
2019(r344453)
+++ stable/11/tools/build/mk/OptionalObsoleteFiles.inc  Thu Feb 21 23:53:52 
2019(r344454)
@@ -9339,6 +9339,32 @@ OLD_FILES+=usr/share/man/man8/lastlogin.8.gz
 OLD_FILES+=usr/share/man/man8/utx.8.gz
 .endif
 
+.if ${MK_VI} == no
+OLD_FILES+=etc/rc.d/virecover
+OLD_FILES+=rescue/ex
+OLD_FILES+=rescue/vi
+OLD_FILES+=usr/bin/ex
+OLD_FILES+=usr/bin/nex
+OLD_FILES+=usr/bin/nvi
+OLD_FILES+=usr/bin/nview
+OLD_FILES+=usr/bin/vi
+OLD_FILES+=usr/bin/view
+OLD_FILES+=usr/share/man/man1/ex.1.gz
+OLD_FILES+=usr/share/man/man1/nex.1.gz
+OLD_FILES+=usr/share/man/man1/nvi.1.gz
+OLD_FILES+=usr/share/man/man1/nview.1.gz
+OLD_FILES+=usr/share/man/man1/vi.1.gz
+OLD_FILES+=usr/share/man/man1/view.1.gz
+.  if exists(${DESTDIR}/usr/share/vi)
+VI_DIRS!=find ${DESTDIR}/usr/share/vi -type d \
+| sed -e 's,^${DESTDIR}/,,'; echo
+VI_FILES!=find ${DESTDIR}/usr/share/vi \! -type d \
+| sed -e 's,^${DESTDIR}/,,'; echo
+OLD_DIRS+=${VI_DIRS}
+OLD_FILES+=${VI_FILES}
+.  endif
+.endif
+
 .if ${MK_WIRELESS} == no
 OLD_FILES+=etc/regdomain.xml
 OLD_FILES+=etc/rc.d/hostapd
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r344453 - head/sys/cddl/contrib/opensolaris/uts/intel/dtrace

2019-02-21 Thread Mark Johnston
Author: markj
Date: Thu Feb 21 22:56:54 2019
New Revision: 344453
URL: https://svnweb.freebsd.org/changeset/base/344453

Log:
  Commit a missing piece of r344452.
  
  MFC with: r344452

Modified:
  head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c

Modified: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c
==
--- head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c   Thu Feb 
21 22:54:17 2019(r344452)
+++ head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c   Thu Feb 
21 22:56:54 2019(r344453)
@@ -1080,7 +1080,11 @@ fasttrap_pid_probe(struct trapframe *tf)
 * been removed, and retry the instruction.
 */
curthread->t_fasttrap_tp_gen = gen;
+#ifdef __amd64
tf->tf_rip = pc;
+#else
+   tf->tf_eip = pc;
+#endif
return (0);
}
return (-1);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r344452 - in head/sys/cddl: contrib/opensolaris/uts/common/dtrace contrib/opensolaris/uts/intel/dtrace dev/dtrace

2019-02-21 Thread Mark Johnston
Author: markj
Date: Thu Feb 21 22:54:17 2019
New Revision: 344452
URL: https://svnweb.freebsd.org/changeset/base/344452

Log:
  Fix a tracepoint lookup race in fasttrap_pid_probe().
  
  fasttrap hooks the userspace breakpoint handler; the hook looks up the
  breakpoint address in a hash table of tracepoints.  It is possible for
  the tracepoint to be removed by a different thread in between the
  breakpoint trap and the hash table lookup, in which case SIGTRAP gets
  delivered to the target process.  Fix the problem by adding a
  per-process generation counter that gets incremented when a tracepoint
  belonging to that process is removed.  Then, when a lookup fails, the
  trapping instruction is restarted if the thread's counter doesn't match
  that of the process.
  
  Reviewed by:  cem
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D19273

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c
  head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c
  head/sys/cddl/dev/dtrace/dtrace_cddl.h

Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c  Thu Feb 
21 22:49:39 2019(r344451)
+++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c  Thu Feb 
21 22:54:17 2019(r344452)
@@ -1089,6 +1089,8 @@ fasttrap_tracepoint_disable(proc_t *p, fasttrap_probe_
ASSERT(p->p_proc_flag & P_PR_LOCK);
 #endif
p->p_dtrace_count--;
+
+   atomic_add_rel_64(>p_fasttrap_tp_gen, 1);
}
 
/*

Modified: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c
==
--- head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c   Thu Feb 
21 22:49:39 2019(r344451)
+++ head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c   Thu Feb 
21 22:54:17 2019(r344452)
@@ -967,6 +967,7 @@ fasttrap_pid_probe(struct trapframe *tf)
struct reg reg, *rp;
proc_t *p = curproc, *pp;
struct rm_priotracker tracker;
+   uint64_t gen;
uintptr_t pc;
uintptr_t new_pc = 0;
fasttrap_bucket_t *bucket;
@@ -1026,8 +1027,22 @@ fasttrap_pid_probe(struct trapframe *tf)
while (pp->p_vmspace == pp->p_pptr->p_vmspace)
pp = pp->p_pptr;
pid = pp->p_pid;
+   if (pp != p) {
+   PROC_LOCK(pp);
+   if ((pp->p_flag & P_WEXIT) != 0) {
+   /*
+* This can happen if the child was created with
+* rfork(2).  Userspace tracing cannot work reliably in
+* such a scenario, but we can at least try.
+*/
+   PROC_UNLOCK(pp);
+   sx_sunlock(_lock);
+   return (-1);
+   }
+   _PHOLD_LITE(pp);
+   PROC_UNLOCK(pp);
+   }
sx_sunlock(_lock);
-   pp = NULL;
 
rm_rlock(_tp_lock, );
 #endif
@@ -1051,11 +1066,28 @@ fasttrap_pid_probe(struct trapframe *tf)
if (tp == NULL) {
 #ifdef illumos
mutex_exit(pid_mtx);
+   return (-1);
 #else
rm_runlock(_tp_lock, );
-#endif
+   gen = atomic_load_acq_64(>p_fasttrap_tp_gen);
+   if (pp != p)
+   PRELE(pp);
+   if (curthread->t_fasttrap_tp_gen != gen) {
+   /*
+* At least one tracepoint associated with this PID has
+* been removed from the table since #BP was raised.
+* Speculate that we hit a tracepoint that has since
+* been removed, and retry the instruction.
+*/
+   curthread->t_fasttrap_tp_gen = gen;
+   tf->tf_rip = pc;
+   return (0);
+   }
return (-1);
+#endif
}
+   if (pp != p)
+   PRELE(pp);
 
/*
 * Set the program counter to the address of the traced instruction

Modified: head/sys/cddl/dev/dtrace/dtrace_cddl.h
==
--- head/sys/cddl/dev/dtrace/dtrace_cddl.h  Thu Feb 21 22:49:39 2019
(r344451)
+++ head/sys/cddl/dev/dtrace/dtrace_cddl.h  Thu Feb 21 22:54:17 2019
(r344452)
@@ -37,7 +37,7 @@ typedef struct kdtrace_proc {
u_int64_t   p_dtrace_count; /* Number of DTrace tracepoints 
*/
void*p_dtrace_helpers;  /* DTrace helpers, if any */
int p_dtrace_model;
-
+   uint64_tp_fasttrap_tp_gen;  /* 

svn commit: r344451 - head/usr.sbin/nfsd

2019-02-21 Thread Sean Eric Fagan
Author: sef
Date: Thu Feb 21 22:49:39 2019
New Revision: 344451
URL: https://svnweb.freebsd.org/changeset/base/344451

Log:
  Fix the usage error I introduced in r344192.
  
  Specifically, I put the new option line in the wrong place, and then fixed
  up the rest without realizing it.  This puts the usage statement back to
  what it was, with an additional line for the new -V option.
  
  Reported by:  mav
  Sponsored by: iXsystems Inc.

Modified:
  head/usr.sbin/nfsd/nfsd.c

Modified: head/usr.sbin/nfsd/nfsd.c
==
--- head/usr.sbin/nfsd/nfsd.c   Thu Feb 21 22:49:21 2019(r344450)
+++ head/usr.sbin/nfsd/nfsd.c   Thu Feb 21 22:49:39 2019(r344451)
@@ -189,9 +189,9 @@ main(int argc, char **argv)
"usage:\n"
"  nfsd [-ardtue] [-h bindip]\n"
"   [-n numservers] [--minthreads #] [--maxthreads #]\n"
-   "   [-p/--pnfs dsserver0:/dsserver0-mounted-on-dir,...,\n"
-   "   [-V virtual_hostname]\n"
-   "   dsserverN:/dsserverN-mounted-on-dir] [-m mirrorlevel]\n";
+   "   [-p/--pnfs dsserver0:/dsserver0-mounted-on-dir,...,"
+   "dsserverN:/dsserverN-mounted-on-dir] [-m mirrorlevel]\n"
+   "   [-V virtual_hostname]\n";
while ((ch = getopt_long(argc, argv, getopt_shortopts, longopts,
)) != -1)
switch (ch) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r344450 - head/sys/modules/dtrace

2019-02-21 Thread Mark Johnston
Author: markj
Date: Thu Feb 21 22:49:21 2019
New Revision: 344450
URL: https://svnweb.freebsd.org/changeset/base/344450

Log:
  Disconnect fasttrap from the 32-bit powerpc build.
  
  An upcoming bug fix requires 64-bit atomics, which aren't implemented on
  powerpc.  The powerpc port of fasttrap is incomplete anyway and doesn't
  get loaded by dtraceall.ko on powerpc because of a missing dependency;
  it's presumed that it's effectively unused.
  
  Discussed with:   jhibbits
  MFC after:2 weeks

Modified:
  head/sys/modules/dtrace/Makefile

Modified: head/sys/modules/dtrace/Makefile
==
--- head/sys/modules/dtrace/MakefileThu Feb 21 22:45:54 2019
(r39)
+++ head/sys/modules/dtrace/MakefileThu Feb 21 22:49:21 2019
(r344450)
@@ -19,9 +19,6 @@ SUBDIR+=  fasttrap fbt systrace_linux
 .if ${MACHINE_CPUARCH} == "amd64"
 SUBDIR+=   systrace_linux32
 .endif
-.if ${MACHINE_CPUARCH} == "powerpc"
-SUBDIR+=   fbt fasttrap
-.endif
 .if ${MACHINE_CPUARCH} == "amd64" || \
 ${MACHINE_CPUARCH} == "aarch64" || \
 ${MACHINE_ARCH} == "mips64" || \
@@ -31,7 +28,9 @@ SUBDIR+=  systrace_freebsd32
 .if ${MACHINE_CPUARCH} == "aarch64" || \
 ${MACHINE_CPUARCH} == "arm" || \
 ${MACHINE_CPUARCH} == "mips" || \
+${MACHINE_CPUARCH} == "powerpc" || \
 ${MACHINE_CPUARCH} == "riscv"
 SUBDIR+=   fbt
 .endif
+
 .include 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r344449 - head/crypto/openssh

2019-02-21 Thread Ed Maste
Author: emaste
Date: Thu Feb 21 22:45:54 2019
New Revision: 39
URL: https://svnweb.freebsd.org/changeset/base/39

Log:
  scp: validate filenames provided by server against wildcard in client
  
  OpenSSH-portable commits:
  
  check in scp client that filenames sent during remote->local directory
  copies satisfy the wildcard specified by the user.
  
  This checking provides some protection against a malicious server
  sending unexpected filenames, but it comes at a risk of rejecting wanted
  files due to differences between client and server wildcard expansion rules.
  
  For this reason, this also adds a new -T flag to disable the check.
  
  reported by Harry Sintonen
  fix approach suggested by markus@;
  has been in snaps for ~1wk courtesy deraadt@
  
  OpenBSD-Commit-ID: 00f44b50d2be8e321973f3c6d014260f8f7a8eda
  
  Minor patch conflict (getopt) resolved.
  
  Obtained from: OpenSSH-portable 391ffc4b9d31fa1f4ad566499fef9176ff8a07dc
  
  scp: add -T to usage();
  
  OpenBSD-Commit-ID: a7ae14d9436c64e1bd05022329187ea3a0ce1899
  
  Obtained from: OpenSSH-portable 2c21b75a7be6ebdcbceaebb43157c48dbb36f3d8
  
  PR:   234965
  Approved by:  des
  MFC after:3 days
  Obtained from:OpenSSH-portable 391ffc4b9d, 2c21b75a7b
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D19076

Modified:
  head/crypto/openssh/scp.1
  head/crypto/openssh/scp.c
Directory Properties:
  head/crypto/openssh/   (props changed)

Modified: head/crypto/openssh/scp.1
==
--- head/crypto/openssh/scp.1   Thu Feb 21 21:33:27 2019(r38)
+++ head/crypto/openssh/scp.1   Thu Feb 21 22:45:54 2019(r39)
@@ -18,7 +18,7 @@
 .Nd secure copy (remote file copy program)
 .Sh SYNOPSIS
 .Nm scp
-.Op Fl 346BCpqrv
+.Op Fl 346BCpqrTv
 .Op Fl c Ar cipher
 .Op Fl F Ar ssh_config
 .Op Fl i Ar identity_file
@@ -207,6 +207,16 @@ to use for the encrypted connection.
 The program must understand
 .Xr ssh 1
 options.
+.It Fl T
+Disable strict filename checking.
+By default when copying files from a remote host to a local directory
+.Nm
+checks that the received filenames match those requested on the command-line
+to prevent the remote end from sending unexpected or unwanted files.
+Because of differences in how various operating systems and shells interpret
+filename wildcards, these checks may cause wanted files to be rejected.
+This option disables these checks at the expense of fully trusting that
+the server will not send unexpected filenames.
 .It Fl v
 Verbose mode.
 Causes

Modified: head/crypto/openssh/scp.c
==
--- head/crypto/openssh/scp.c   Thu Feb 21 21:33:27 2019(r38)
+++ head/crypto/openssh/scp.c   Thu Feb 21 22:45:54 2019(r39)
@@ -1,4 +1,4 @@
-/* $OpenBSD: scp.c,v 1.197 2018/06/01 04:31:48 dtucker Exp $ */
+/* $OpenBSD: scp.c,v 1.203 2019/01/27 07:14:11 jmc Exp $ */
 /*
  * scp - secure remote copy.  This is basically patched BSD rcp which
  * uses ssh to do the data transfer (instead of using rcmd).
@@ -94,6 +94,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -375,14 +376,14 @@ void verifydir(char *);
 struct passwd *pwd;
 uid_t userid;
 int errs, remin, remout;
-int pflag, iamremote, iamrecursive, targetshouldbedirectory;
+int Tflag, pflag, iamremote, iamrecursive, targetshouldbedirectory;
 
 #defineCMDNEEDS64
 char cmd[CMDNEEDS];/* must hold "rcp -r -p -d\0" */
 
 int response(void);
 void rsource(char *, struct stat *);
-void sink(int, char *[]);
+void sink(int, char *[], const char *);
 void source(int, char *[]);
 void tolocal(int, char *[]);
 void toremote(int, char *[]);
@@ -421,8 +422,9 @@ main(int argc, char **argv)
addargs(, "-oRemoteCommand=none");
addargs(, "-oRequestTTY=no");
 
-   fflag = tflag = 0;
-   while ((ch = getopt(argc, argv, "dfl:prtvBCc:i:P:q12346S:o:F:")) != -1)
+   fflag = Tflag = tflag = 0;
+   while ((ch = getopt(argc, argv,
+   "dfl:prtTvBCc:i:P:q12346S:o:F:")) != -1) {
switch (ch) {
/* User-visible flags. */
case '1':
@@ -501,9 +503,13 @@ main(int argc, char **argv)
setmode(0, O_BINARY);
 #endif
break;
+   case 'T':
+   Tflag = 1;
+   break;
default:
usage();
}
+   }
argc -= optind;
argv += optind;
 
@@ -534,7 +540,7 @@ main(int argc, char **argv)
}
if (tflag) {
/* Receive data. */
-   sink(argc, argv);
+   sink(argc, argv, NULL);
exit(errs != 0);
}
if (argc < 2)
@@ -791,7 +797,7 @@ tolocal(int argc, char **argv)

Re: svn commit: r344368 - head/sys/netinet

2019-02-21 Thread Michael Tuexen
> On 21. Feb 2019, at 09:32, Kubilay Kocak  wrote:
> 
> On 21/02/2019 5:03 am, Michael Tuexen wrote:
>> Author: tuexen
>> Date: Wed Feb 20 18:03:43 2019
>> New Revision: 344368
>> URL: https://svnweb.freebsd.org/changeset/base/344368
>> Log:
>>   Reduce the TCP initial retransmission timeout from 3 seconds to
>>   1 second as allowed by RFC 6298.
>>  Reviewed by:kbowling@, Richard Scheffenegger
>>   Sponsored by:  Netflix, Inc.
>>   Differential Revision: https://reviews.freebsd.org/D18941
>> Modified:
>>   head/sys/netinet/tcp_syncache.c
>>   head/sys/netinet/tcp_timer.h
>> Modified: head/sys/netinet/tcp_syncache.c
>> ==
>> --- head/sys/netinet/tcp_syncache.c  Wed Feb 20 17:56:38 2019
>> (r344367)
>> +++ head/sys/netinet/tcp_syncache.c  Wed Feb 20 18:03:43 2019
>> (r344368)
>> @@ -159,7 +159,7 @@ static intsyncookie_cmp(struct in_conninfo *inc, 
>> str
>>   *  tcp_backoff[1] +
>>   *  tcp_backoff[2] +
>>   *  tcp_backoff[3]) + 3 * tcp_rexmit_slop,
>> - * 3000 ms * (1 + 2 + 4 + 8) +  3 * 200 ms = 45600 ms,
>> + * 1000 ms * (1 + 2 + 4 + 8) +  3 * 200 ms = 15600 ms,
>>   * the odds are that the user has given up attempting to connect by then.
>>   */
>>  #define SYNCACHE_MAXREXMTS  3
>> Modified: head/sys/netinet/tcp_timer.h
>> ==
>> --- head/sys/netinet/tcp_timer.h Wed Feb 20 17:56:38 2019
>> (r344367)
>> +++ head/sys/netinet/tcp_timer.h Wed Feb 20 18:03:43 2019
>> (r344368)
>> @@ -77,7 +77,7 @@
>>  #define TCPTV_MSL   ( 30*hz)/* max seg lifetime 
>> (hah!) */
>>  #define TCPTV_SRTTBASE  0   /* base roundtrip time;
>> if 0, no idea yet */
>> -#define TCPTV_RTOBASE   (  3*hz)/* assumed RTO if no 
>> info */
>> +#define TCPTV_RTOBASE   (  1*hz)/* assumed RTO if no 
>> info */
>>#define   TCPTV_PERSMIN   (  5*hz)/* minimum persist 
>> interval */
>>  #define TCPTV_PERSMAX   ( 60*hz)/* maximum persist 
>> interval */
>> ___
> 
> Any way this can be a run-time tunable?
Will implement this and add you to the review.

Best regards
Michael
> 

___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r344446 - head/usr.sbin/bhyve

2019-02-21 Thread Rodney W. Grimes
> > Author: jkim
> > Date: Thu Feb 21 21:15:49 2019
> > New Revision: 36
> > URL: https://svnweb.freebsd.org/changeset/base/36
> > 
> > Log:
> >   Catch up with ACPICA 20190215.
> >   
> >   PR:   235922
> > 
> > Modified:
> >   head/usr.sbin/bhyve/acpi.c
> > 
> > Modified: head/usr.sbin/bhyve/acpi.c
> > ==
> > --- head/usr.sbin/bhyve/acpi.c  Thu Feb 21 19:19:30 2019
> > (r35)
> > +++ head/usr.sbin/bhyve/acpi.c  Thu Feb 21 21:15:49 2019
> > (r36)
> > @@ -256,6 +256,7 @@ basl_fwrite_madt(FILE *fp)
> > EFPRINTF(fp, "[0001]\t\tLocal Apic ID : %02x\n", i);
> > EFPRINTF(fp, "[0004]\t\tFlags (decoded below) : 0001\n");
> > EFPRINTF(fp, "\t\t\tProcessor Enabled : 1\n");
> > +   EFPRINTF(fp, "\t\t\tRuntime Online Capable : 0\n");
> > EFPRINTF(fp, "\n");
> > }
> 
> This is wrong, this is a version 1.0 MADT table,
> that version does NOT have this value.

Let me guess.. this does not change the table generated,
it only makes the iasl compiler happy about what we are
feeding it?  If so, just ignore my statement above, and sorry
for the noise.  If not how do we actually fix this so that
the table is not changed.

-- 
Rod Grimes rgri...@freebsd.org
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r344446 - head/usr.sbin/bhyve

2019-02-21 Thread Rodney W. Grimes
[ Charset UTF-8 unsupported, converting... ]
> Author: jkim
> Date: Thu Feb 21 21:15:49 2019
> New Revision: 36
> URL: https://svnweb.freebsd.org/changeset/base/36
> 
> Log:
>   Catch up with ACPICA 20190215.
>   
>   PR: 235922
> 
> Modified:
>   head/usr.sbin/bhyve/acpi.c
> 
> Modified: head/usr.sbin/bhyve/acpi.c
> ==
> --- head/usr.sbin/bhyve/acpi.cThu Feb 21 19:19:30 2019
> (r35)
> +++ head/usr.sbin/bhyve/acpi.cThu Feb 21 21:15:49 2019
> (r36)
> @@ -256,6 +256,7 @@ basl_fwrite_madt(FILE *fp)
>   EFPRINTF(fp, "[0001]\t\tLocal Apic ID : %02x\n", i);
>   EFPRINTF(fp, "[0004]\t\tFlags (decoded below) : 0001\n");
>   EFPRINTF(fp, "\t\t\tProcessor Enabled : 1\n");
> + EFPRINTF(fp, "\t\t\tRuntime Online Capable : 0\n");
>   EFPRINTF(fp, "\n");
>   }

This is wrong, this is a version 1.0 MADT table,
that version does NOT have this value.


-- 
Rod Grimes rgri...@freebsd.org
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r344448 - head/sys/contrib/dev/acpica/components/utilities

2019-02-21 Thread Jung-uk Kim
Author: jkim
Date: Thu Feb 21 21:33:27 2019
New Revision: 38
URL: https://svnweb.freebsd.org/changeset/base/38

Log:
  MFV:  r37
  
  Fix missing comma in array declaration.

Modified:
  head/sys/contrib/dev/acpica/components/utilities/utdecode.c
Directory Properties:
  head/sys/contrib/dev/acpica/   (props changed)

Modified: head/sys/contrib/dev/acpica/components/utilities/utdecode.c
==
--- head/sys/contrib/dev/acpica/components/utilities/utdecode.c Thu Feb 21 
21:31:47 2019(r37)
+++ head/sys/contrib/dev/acpica/components/utilities/utdecode.c Thu Feb 21 
21:33:27 2019(r38)
@@ -632,7 +632,7 @@ static const char   *AcpiGbl_GenericNotify[ACP
 /* 0B */ "System Locality Update",
 /* 0C */ "Reserved (was previously Shutdown Request)",  /* Reserved in 
ACPI 6.0 */
 /* 0D */ "System Resource Affinity Update",
-/* 0E */ "Heterogeneous Memory Attributes Update"   /* ACPI 6.2 */
+/* 0E */ "Heterogeneous Memory Attributes Update",  /* ACPI 6.2 */
 /* 0F */ "Error Disconnect Recover" /* ACPI 6.3 */
 };
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r344447 - vendor-sys/acpica/dist/source/components/utilities

2019-02-21 Thread Jung-uk Kim
Author: jkim
Date: Thu Feb 21 21:31:47 2019
New Revision: 37
URL: https://svnweb.freebsd.org/changeset/base/37

Log:
  Fix missing comma in array declaration.
  
  https://github.com/acpica/acpica/commit/113286

Modified:
  vendor-sys/acpica/dist/source/components/utilities/utdecode.c

Modified: vendor-sys/acpica/dist/source/components/utilities/utdecode.c
==
--- vendor-sys/acpica/dist/source/components/utilities/utdecode.c   Thu Feb 
21 21:15:49 2019(r36)
+++ vendor-sys/acpica/dist/source/components/utilities/utdecode.c   Thu Feb 
21 21:31:47 2019(r37)
@@ -632,7 +632,7 @@ static const char   *AcpiGbl_GenericNotify[ACP
 /* 0B */ "System Locality Update",
 /* 0C */ "Reserved (was previously Shutdown Request)",  /* Reserved in 
ACPI 6.0 */
 /* 0D */ "System Resource Affinity Update",
-/* 0E */ "Heterogeneous Memory Attributes Update"   /* ACPI 6.2 */
+/* 0E */ "Heterogeneous Memory Attributes Update",  /* ACPI 6.2 */
 /* 0F */ "Error Disconnect Recover" /* ACPI 6.3 */
 };
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r344446 - head/usr.sbin/bhyve

2019-02-21 Thread Rodney W. Grimes
> Author: jkim
> Date: Thu Feb 21 21:15:49 2019
> New Revision: 36
> URL: https://svnweb.freebsd.org/changeset/base/36
> 
> Log:
>   Catch up with ACPICA 20190215.
>   
>   PR: 235922
> 
> Modified:
>   head/usr.sbin/bhyve/acpi.c
> 
> Modified: head/usr.sbin/bhyve/acpi.c
> ==
> --- head/usr.sbin/bhyve/acpi.cThu Feb 21 19:19:30 2019
> (r35)
> +++ head/usr.sbin/bhyve/acpi.cThu Feb 21 21:15:49 2019
> (r36)
> @@ -256,6 +256,7 @@ basl_fwrite_madt(FILE *fp)
>   EFPRINTF(fp, "[0001]\t\tLocal Apic ID : %02x\n", i);
>   EFPRINTF(fp, "[0004]\t\tFlags (decoded below) : 0001\n");
>   EFPRINTF(fp, "\t\t\tProcessor Enabled : 1\n");
> + EFPRINTF(fp, "\t\t\tRuntime Online Capable : 0\n");
>   EFPRINTF(fp, "\n");

Hang on, acpi tables have version numbers, why is this needed,
we did not change versions of acpi in bhyve.

Isnt this a new item added by a new version?

-- 
Rod Grimes rgri...@freebsd.org
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r344446 - head/usr.sbin/bhyve

2019-02-21 Thread Jung-uk Kim
Author: jkim
Date: Thu Feb 21 21:15:49 2019
New Revision: 36
URL: https://svnweb.freebsd.org/changeset/base/36

Log:
  Catch up with ACPICA 20190215.
  
  PR:   235922

Modified:
  head/usr.sbin/bhyve/acpi.c

Modified: head/usr.sbin/bhyve/acpi.c
==
--- head/usr.sbin/bhyve/acpi.c  Thu Feb 21 19:19:30 2019(r35)
+++ head/usr.sbin/bhyve/acpi.c  Thu Feb 21 21:15:49 2019(r36)
@@ -256,6 +256,7 @@ basl_fwrite_madt(FILE *fp)
EFPRINTF(fp, "[0001]\t\tLocal Apic ID : %02x\n", i);
EFPRINTF(fp, "[0004]\t\tFlags (decoded below) : 0001\n");
EFPRINTF(fp, "\t\t\tProcessor Enabled : 1\n");
+   EFPRINTF(fp, "\t\t\tRuntime Online Capable : 0\n");
EFPRINTF(fp, "\n");
}
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r344445 - head/sys/dev/syscons

2019-02-21 Thread Bruce Evans
Author: bde
Date: Thu Feb 21 19:19:30 2019
New Revision: 35
URL: https://svnweb.freebsd.org/changeset/base/35

Log:
  Fix the dumb and sc terminal emulators to compile and work.
  
  First remove ifdefs of the unsupported option SC_DUMB_TERMINAL which
  prevented building using both in the same kernel and broke regression
  tests.  This option will be replaced by per-emulator supported options.
  
  The dumb emulator rotted with KSE in r83366, but usually compiled since
  it is ifdefed to nothing unless SC_DUMB_TERMINAL is defined.  The type
  of an unused function parameter changed.
  
  Both emulators rotted when 2 new methods were added while the emulators
  were removed.  Only null methods are needed, but null function pointers
  give panics instead.
  
  The wildcard in the default for the unsupported option SC_DFLT_TERM
  never really worked.  It tends to prefer the dumb emulator when multiple
  emulators are configured.  Change it to prefer scteken for compatibility.

Modified:
  head/sys/dev/syscons/scterm-dumb.c
  head/sys/dev/syscons/scterm-sc.c
  head/sys/dev/syscons/syscons.h

Modified: head/sys/dev/syscons/scterm-dumb.c
==
--- head/sys/dev/syscons/scterm-dumb.c  Thu Feb 21 18:41:41 2019
(r34)
+++ head/sys/dev/syscons/scterm-dumb.c  Thu Feb 21 19:19:30 2019
(r35)
@@ -31,6 +31,8 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
+#include 
 #include 
 
 #if defined(__sparc64__) || defined(__powerpc__)
@@ -42,8 +44,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#ifdef SC_DUMB_TERMINAL
-
 /* dumb terminal emulator */
 
 static sc_term_init_t  dumb_init;
@@ -53,6 +53,8 @@ static sc_term_ioctl_tdumb_ioctl;
 static sc_term_clear_t dumb_clear;
 static sc_term_input_t dumb_input;
 static voiddumb_nop(void);
+static sc_term_fkeystr_t   dumb_fkeystr;
+static sc_term_sync_t  dumb_sync;
 
 static sc_term_sw_t sc_term_dumb = {
{ NULL, NULL },
@@ -70,6 +72,8 @@ static sc_term_sw_t sc_term_dumb = {
dumb_clear,
(sc_term_notify_t *)dumb_nop,
dumb_input,
+   dumb_fkeystr,
+   dumb_sync,
 };
 
 SCTERM_MODULE(dumb, sc_term_dumb);
@@ -108,7 +112,7 @@ dumb_puts(scr_stat *scp, u_char *buf, int len)
 
 static int
 dumb_ioctl(scr_stat *scp, struct tty *tp, u_long cmd, caddr_t data,
-  int flag, struct proc *p)
+  struct thread *td)
 {
vid_info_t *vi;
 
@@ -146,10 +150,19 @@ dumb_input(scr_stat *scp, int c, struct tty *tp)
return FALSE;
 }
 
+static const char *
+dumb_fkeystr(scr_stat *scp, int c)
+{
+   return (NULL);
+}
+
 static void
+dumb_sync(scr_stat *scp)
+{
+}
+
+static void
 dumb_nop(void)
 {
/* nothing */
 }
-
-#endif /* SC_DUMB_TERMINAL */

Modified: head/sys/dev/syscons/scterm-sc.c
==
--- head/sys/dev/syscons/scterm-sc.cThu Feb 21 18:41:41 2019
(r34)
+++ head/sys/dev/syscons/scterm-sc.cThu Feb 21 19:19:30 2019
(r35)
@@ -45,8 +45,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#ifndef SC_DUMB_TERMINAL
-
 #define MAX_ESC_PAR5
 
 /* attribute flags */
@@ -89,6 +87,8 @@ static sc_term_default_attr_t scterm_default_attr;
 static sc_term_clear_t scterm_clear;
 static sc_term_notify_tscterm_notify;
 static sc_term_input_t scterm_input;
+static sc_term_fkeystr_t   scterm_fkeystr;
+static sc_term_sync_t  scterm_sync;
 
 static sc_term_sw_t sc_term_sc = {
{ NULL, NULL },
@@ -106,6 +106,8 @@ static sc_term_sw_t sc_term_sc = {
scterm_clear,
scterm_notify,
scterm_input,
+   scterm_fkeystr,
+   scterm_sync,
 };
 
 SCTERM_MODULE(sc, sc_term_sc);
@@ -780,6 +782,17 @@ scterm_input(scr_stat *scp, int c, struct tty *tp)
return FALSE;
 }
 
+static const char *
+scterm_fkeystr(scr_stat *scp, int c)
+{
+   return (NULL);
+}
+
+static void
+scterm_sync(scr_stat *scp)
+{
+}
+
 /*
  * Calculate hardware attributes word using logical attributes mask and
  * hardware colors
@@ -807,5 +820,3 @@ mask2attr(term_stat *tcp)
 
return (attr << 8);
 }
-
-#endif /* SC_DUMB_TERMINAL */

Modified: head/sys/dev/syscons/syscons.h
==
--- head/sys/dev/syscons/syscons.h  Thu Feb 21 18:41:41 2019
(r34)
+++ head/sys/dev/syscons/syscons.h  Thu Feb 21 19:19:30 2019
(r35)
@@ -378,7 +378,7 @@ typedef struct sc_ttysoftc {
 /* terminal emulator */
 
 #ifndef SC_DFLT_TERM
-#define SC_DFLT_TERM   "*" /* any */
+#define SC_DFLT_TERM   "scteken"
 #endif
 
 typedef intsc_term_init_t(scr_stat *scp, void **tcp, int code);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to 

Re: svn commit: r344099 - head/sys/net

2019-02-21 Thread Hans Petter Selasky

Hi,

On 2/21/19 7:28 PM, John Baldwin wrote:

On 2/21/19 7:29 AM, Randall Stewart wrote:



On Feb 13, 2019, at 1:10 PM, John Baldwin  wrote:

On 2/13/19 10:03 AM, Randall Stewart wrote:

oh and one other thing..

It was*not*  a random IFP.. it was the IFP to the lagg.

I.e. an alloc() was done to the lagg.. and the free was
done back to the same IFP (that provided the allocate).

Yes, that's wrong.  Suppose the route changes so that my traffic is now over
em0 instead of lagg0 (where em0 isn't a member of the lagg), how do you
expect if_lagg_free to invoke em0's free routine?  In your case it does,
but only by accident.  It doesn't work in the other case I described which
is if you have non-lagg interfaces and a route moves from cc0 to em0.  In
that case your existing code that is using the wrong ifp will just panic.

These aren't real alloc routines as the lagg and vlan ones don't allocate
anything, they pass along the request to the child and the child allocates
the tag.  Only ifnet's that actually allocate tags should need to free them,
and you should be using tag->ifp to as the ifp whose if_snd_tag_free works.

But thats what the lagg’s routine does, use the tag sent in
to find the real ifp (where the tag was allocated) and call
the if_snd_tag_free() on that.

Its not an accident it works, it calls the free of the actual
interface where the allocation came from.

I don’t see how it would panic.

My point is that your calling code should do this.

Suppose I have a socket over cc0.  It allocates a send tag.  Later, the
connection is rerouted over em0 and em(4) doesn't support send tags at all.
If you use the ifp from the route to free the tag, you will try to use
em's if_snd_tag_free routine and that will be NULL and panic.  The fix is
that you shouldn't be using the route ifp to free the tag, only to note that
the tag is stale, so something like:

ifp = route.rt_ifp;
if (ifp != m->m_snd_tag->ifp) {
   /* Need to free tag. */
   tag = m->m_snd_tag;
   
   /* Free mbuf or clear tag or whatever */


   tag->ifp->if_snd_tag_free(tag);
}

if_snd_tag_free should always be called from 'tag->ifp' as that's the ifp
that owns that tag and knows how to free it.

Your patch happens to work for the case of the route going over a lagg and
the connection switching between lagg ports only because you've made the
lagg routine do what the calling code should be doing in the first place.


I haven't seen Randall's code, but unless he is using the same ifp to 
free the send that that was used to allocate it, then John is right. The 
send tag already contains an interface pointer, that should be used when 
freeing it.


--HPS
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r344444 - in head/contrib/llvm/tools/lld/ELF: . Arch

2019-02-21 Thread Dimitry Andric
Author: dim
Date: Thu Feb 21 18:41:41 2019
New Revision: 34
URL: https://svnweb.freebsd.org/changeset/base/34

Log:
  Pull in r353299 from upstream lld trunk (by George Rimar):
  
Recommit r353293 "[LLD][ELF] - Set DF_STATIC_TLS flag for i386 target."
  
With the following changes:
1) Compilation fix:
std::atomic HasStaticTlsModel = false; ->
std::atomic HasStaticTlsModel{false};
  
2) Adjusted the comment in code.
  
Initial commit message:
  
DF_STATIC_TLS flag indicates that the shared object or executable
contains code using a static thread-local storage scheme.
  
Patch checks if IE/LE relocations were used to check if the code uses
a static model. If so it sets the DF_STATIC_TLS flag.
  
Differential revision: https://reviews.llvm.org/D57749
  
  Pull in r353378 from upstream lld trunk (by George Rimar):
  
[LLD][ELF] - Set DF_STATIC_TLS flag for X64 target
  
This is the same as D57749, but for x64 target.
  
"ELF Handling For Thread-Local Storage" p41 says
(https://www.akkadia.org/drepper/tls.pdf):
R_X86_64_GOTTPOFF relocation is used for IE TLS models.
Hence if linker sees this relocation we should add DF_STATIC_TLS flag.
  
Differential revision: https://reviews.llvm.org/D57821
  
  This adds support to lld for the DF_STATIC_TLS flag in shared objects,
  which signals to the dynamic linker that the shared object requires
  static thread local storage.
  
  See also: https://reviews.freebsd.org/D19072
  MFC after:1 week

Modified:
  head/contrib/llvm/tools/lld/ELF/Arch/X86.cpp
  head/contrib/llvm/tools/lld/ELF/Arch/X86_64.cpp
  head/contrib/llvm/tools/lld/ELF/Config.h
  head/contrib/llvm/tools/lld/ELF/SyntheticSections.cpp

Modified: head/contrib/llvm/tools/lld/ELF/Arch/X86.cpp
==
--- head/contrib/llvm/tools/lld/ELF/Arch/X86.cppThu Feb 21 17:31:33 
2019(r33)
+++ head/contrib/llvm/tools/lld/ELF/Arch/X86.cppThu Feb 21 18:41:41 
2019(r34)
@@ -70,6 +70,14 @@ static bool hasBaseReg(uint8_t ModRM) { return (ModRM 
 
 RelExpr X86::getRelExpr(RelType Type, const Symbol ,
 const uint8_t *Loc) const {
+  // There are 4 different TLS variable models with varying degrees of
+  // flexibility and performance. LocalExec and InitialExec models are fast but
+  // less-flexible models. If they are in use, we set DF_STATIC_TLS flag in the
+  // dynamic section to let runtime know about that.
+  if (Type == R_386_TLS_LE || Type == R_386_TLS_LE_32 || Type == R_386_TLS_IE 
||
+  Type == R_386_TLS_GOTIE)
+Config->HasStaticTlsModel = true;
+
   switch (Type) {
   case R_386_8:
   case R_386_16:

Modified: head/contrib/llvm/tools/lld/ELF/Arch/X86_64.cpp
==
--- head/contrib/llvm/tools/lld/ELF/Arch/X86_64.cpp Thu Feb 21 17:31:33 
2019(r33)
+++ head/contrib/llvm/tools/lld/ELF/Arch/X86_64.cpp Thu Feb 21 18:41:41 
2019(r34)
@@ -76,6 +76,9 @@ template  X86_64::X86_64() {
 template 
 RelExpr X86_64::getRelExpr(RelType Type, const Symbol ,
  const uint8_t *Loc) const {
+  if (Type == R_X86_64_GOTTPOFF)
+Config->HasStaticTlsModel = true;
+
   switch (Type) {
   case R_X86_64_8:
   case R_X86_64_16:

Modified: head/contrib/llvm/tools/lld/ELF/Config.h
==
--- head/contrib/llvm/tools/lld/ELF/Config.hThu Feb 21 17:31:33 2019
(r33)
+++ head/contrib/llvm/tools/lld/ELF/Config.hThu Feb 21 18:41:41 2019
(r34)
@@ -18,6 +18,7 @@
 #include "llvm/Support/CachePruning.h"
 #include "llvm/Support/CodeGen.h"
 #include "llvm/Support/Endian.h"
+#include 
 #include 
 
 namespace lld {
@@ -81,6 +82,7 @@ struct VersionDefinition {
 // and such fields have the same name as the corresponding options.
 // Most fields are initialized by the driver.
 struct Configuration {
+  std::atomic HasStaticTlsModel{false};
   uint8_t OSABI = 0;
   llvm::CachePruningPolicy ThinLTOCachePolicy;
   llvm::StringMap SectionStartMap;

Modified: head/contrib/llvm/tools/lld/ELF/SyntheticSections.cpp
==
--- head/contrib/llvm/tools/lld/ELF/SyntheticSections.cpp   Thu Feb 21 
17:31:33 2019(r33)
+++ head/contrib/llvm/tools/lld/ELF/SyntheticSections.cpp   Thu Feb 21 
18:41:41 2019(r34)
@@ -1282,6 +1282,8 @@ template  void DynamicSection::final
   }
   if (!Config->ZText)
 DtFlags |= DF_TEXTREL;
+  if (Config->HasStaticTlsModel)
+DtFlags |= DF_STATIC_TLS;
 
   if (DtFlags)
 addInt(DT_FLAGS, DtFlags);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to 

Re: svn commit: r344099 - head/sys/net

2019-02-21 Thread John Baldwin
On 2/21/19 7:29 AM, Randall Stewart wrote:
> 
> 
>> On Feb 13, 2019, at 1:10 PM, John Baldwin  wrote:
>>
>> On 2/13/19 10:03 AM, Randall Stewart wrote:
>>> oh and one other thing..
>>>
>>> It was *not* a random IFP.. it was the IFP to the lagg.
>>>
>>> I.e. an alloc() was done to the lagg.. and the free was
>>> done back to the same IFP (that provided the allocate).
>>
>> Yes, that's wrong.  Suppose the route changes so that my traffic is now over
>> em0 instead of lagg0 (where em0 isn't a member of the lagg), how do you
>> expect if_lagg_free to invoke em0's free routine?  In your case it does,
>> but only by accident.  It doesn't work in the other case I described which
>> is if you have non-lagg interfaces and a route moves from cc0 to em0.  In
>> that case your existing code that is using the wrong ifp will just panic.
>>
>> These aren't real alloc routines as the lagg and vlan ones don't allocate
>> anything, they pass along the request to the child and the child allocates
>> the tag.  Only ifnet's that actually allocate tags should need to free them,
>> and you should be using tag->ifp to as the ifp whose if_snd_tag_free works.
> 
> But thats what the lagg’s routine does, use the tag sent in
> to find the real ifp (where the tag was allocated) and call
> the if_snd_tag_free() on that.
> 
> Its not an accident it works, it calls the free of the actual
> interface where the allocation came from.
> 
> I don’t see how it would panic.

My point is that your calling code should do this.

Suppose I have a socket over cc0.  It allocates a send tag.  Later, the
connection is rerouted over em0 and em(4) doesn't support send tags at all.
If you use the ifp from the route to free the tag, you will try to use
em's if_snd_tag_free routine and that will be NULL and panic.  The fix is
that you shouldn't be using the route ifp to free the tag, only to note that
the tag is stale, so something like:

   ifp = route.rt_ifp;
   if (ifp != m->m_snd_tag->ifp) {
  /* Need to free tag. */
  tag = m->m_snd_tag;
  
  /* Free mbuf or clear tag or whatever */

  tag->ifp->if_snd_tag_free(tag);
   }

if_snd_tag_free should always be called from 'tag->ifp' as that's the ifp
that owns that tag and knows how to free it.

Your patch happens to work for the case of the route going over a lagg and
the connection switching between lagg ports only because you've made the
lagg routine do what the calling code should be doing in the first place.

-- 
John Baldwin


___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r344389 - head/usr.sbin/newsyslog

2019-02-21 Thread John Baldwin
On 2/20/19 9:20 PM, Warner Losh wrote:
> On Wed, Feb 20, 2019, 9:59 PM Enji Cooper  
>>
>>> On Feb 20, 2019, at 5:17 PM, Bruce Evans  wrote:
>>>
>>> On Wed, 20 Feb 2019, David Bright wrote:
>>>
 Log:
 Complete fix for CID 1007454, CID 1007453: Resource leak in newsyslog

 The result of a strdup() was stored in a global variable and not freed
 before program exit. This is a follow-up to r343906. That change
>>>
>>> This was an especially large bug in Coverity.  Understanding that exit(3)
>>> exits is about the first thing to understand for a checker.
>>>
>>> Now it is also a style bug in the source code.
>>>
 attempted to plug these resource leaks but managed to miss a code path
 on which the leak still occurs. Plug the leak on that path, too.
>>>
 Modified: head/usr.sbin/newsyslog/newsyslog.c

>> ==
 --- head/usr.sbin/newsyslog/newsyslog.c  Wed Feb 20 21:24:56 2019
>>   (r344388)
 +++ head/usr.sbin/newsyslog/newsyslog.c  Wed Feb 20 22:05:44 2019
>>   (r344389)
 @@ -793,6 +793,9 @@ usage(void)
  fprintf(stderr,
  "usage: newsyslog [-CFNPnrsv] [-a directory] [-d directory]
>> [-f config_file]\n"
  " [-S pidfile] [-t timefmt] [[-R tagname] file
>> ...]\n");
 +/* Free global dynamically-allocated storage. */
 +free(timefnamefmt);
 +free(requestor);
  exit(1);
 }
>>>
>>> There was no leak here.  exit(3) frees storage much more finally than
>>> free(3).
>>>
>>> It is especially obvious that there is no leak here, since the exit() is
>>> 1-2 lines later than the frees.
>>>
>>> In theory, exit() might fail because it tries to allocate 100 MB more
>>> storage but wouldn't fail if 100 bytes are freed here (applications can
>>> easily do this foot shooting by allocating without freeing in atexit()
>>> destructors).  In practice, even allocation failures "can't happen",
>>> except in programs that use setrlimit followed but foot shooting to test
>>> the limits.  setrlimit is now broken for this purpose, since it doesn't
>>> limit allocations done using mmap() instead of break(), and malloc() now
>>> uses mmap().
>>>
>>> If coverity understood this and wanted to spam you with warnings, then it
>>> would not warn about this, but would warn about more important things
>> like
>>> failure to fflush() or fclose() or check for or handle errors for all
>>> open streams before calling exit().  Also, if all callers of usage() are
>>> not understood, for failures to switch stderr to unbuffered mode before
>>> using it in usage().
>>>
>>> The error reporting is even harder to do if stderr is not available.
>>> Windowing systems and even curses need to do lots more cleanup _before_
>>> exit() and it may be difficult to clean up enough to print error messages
>>> using the windowing system.
>>
>> I agree with Bruce. Items like these should be ignored in the Coverity UI
>> as false positives with reasoning, like “global variables; freed on exit”.
>>
>> As others have noted in past mailing threads, freeing variables on exit
>> can cause applications to hang for a period of time, while the memory is
>> being reclaimed. I think it’s best to ignore these kinds of allocations on
>> exit to avoid introducing unnecessary complexity in the program, as they’re
>> benign issues.
>>
> 
> 
> It's been a long running debate since 92 or so when purify came out and
> this problem started to be found. In the last 25 years the question hasn't
> been settled. I tend to think it's a waste of time, though I get that
> issues like this create a lot of false positives.

I'm +1 on Bruce's point on this.  I find it similar to the recent spate of
adding pointless '__dead2' annotations to usage functions that unconditionally
call exit() (and thus are already inferred as __dead2 by any compiler
written in this millenium)

-- 
John Baldwin


___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r344437 - head/sys/dev/ntb/ntb_hw

2019-02-21 Thread Enji Cooper

> On Feb 21, 2019, at 10:19 AM, Alexander Motin  wrote:
> 
> On 21.02.2019 13:13, Enji Cooper wrote:
>> 
>>> On Feb 21, 2019, at 6:10 AM, Alexander Motin  wrote:
>>> 
>>> Author: mav
>>> Date: Thu Feb 21 14:10:14 2019
>>> New Revision: 344437
>>> URL: https://svnweb.freebsd.org/changeset/base/344437
>>> 
>>> Log:
>>> Allow I/OAT of present Xeon E5/E7 to work thorugh PLX NTB.
>>> 
>>> Its a hack, we can't know/list all DMA engines, but this covers all
>>> I/OAT of Xeon E5/E7 at least from Sandy Bridge till Skylake I saw.
>>> 
>>> MFC after:  1 week
>>> Sponsored by:   iXsystems, Inc.
>>> 
>>> Modified:
>>> head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c
>>> 
>>> Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c
>>> ==
>>> --- head/sys/dev/ntb/ntb_hw/ntb_hw_plx.cThu Feb 21 12:13:27 2019
>>> (r344436)
>>> +++ head/sys/dev/ntb/ntb_hw/ntb_hw_plx.cThu Feb 21 14:10:14 2019
>>> (r344437)
>>> @@ -202,16 +202,24 @@ ntb_plx_init(device_t dev)
>>> if (sc->alut)
>>> PNTX_WRITE(sc, 0xc94, 0);
>>> 
>>> -   /* Enable Link Interface LUT entries 0/1 for peer 0/1. */
>>> -   PNTX_WRITE(sc, 0xdb4, 0x00090001);
>>> +   /* Enable all Link Interface LUT entries for peer. */
>>> +   for (i = 0; i < 32; i += 2) {
>> 
>>  Is `32` written down in the NTB spec somewhere? Should it be a #define, 
>> or should it be programmatically adjusted based on the CPU?
> 
> It is a property of the hardware, it has 32 LUT entries.

Cool! I was thinking that this is probably a number that can change in the 
future, as processor designs evolve.

> #define would be good indeed, but the code is already full of other numeric 
> constants.

Yes, but it would make the code more readable/easier to reason through. That’s 
where my concern is coming from.

Also, thank you very much for working on this :).

Cheers!
-Enji
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r344437 - head/sys/dev/ntb/ntb_hw

2019-02-21 Thread Alexander Motin
On 21.02.2019 13:13, Enji Cooper wrote:
> 
>> On Feb 21, 2019, at 6:10 AM, Alexander Motin  wrote:
>>
>> Author: mav
>> Date: Thu Feb 21 14:10:14 2019
>> New Revision: 344437
>> URL: https://svnweb.freebsd.org/changeset/base/344437
>>
>> Log:
>>  Allow I/OAT of present Xeon E5/E7 to work thorugh PLX NTB.
>>
>>  Its a hack, we can't know/list all DMA engines, but this covers all
>>  I/OAT of Xeon E5/E7 at least from Sandy Bridge till Skylake I saw.
>>
>>  MFC after:  1 week
>>  Sponsored by:   iXsystems, Inc.
>>
>> Modified:
>>  head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c
>>
>> Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c
>> ==
>> --- head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c Thu Feb 21 12:13:27 2019
>> (r344436)
>> +++ head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c Thu Feb 21 14:10:14 2019
>> (r344437)
>> @@ -202,16 +202,24 @@ ntb_plx_init(device_t dev)
>>  if (sc->alut)
>>  PNTX_WRITE(sc, 0xc94, 0);
>>
>> -/* Enable Link Interface LUT entries 0/1 for peer 0/1. */
>> -PNTX_WRITE(sc, 0xdb4, 0x00090001);
>> +/* Enable all Link Interface LUT entries for peer. */
>> +for (i = 0; i < 32; i += 2) {
> 
>   Is `32` written down in the NTB spec somewhere? Should it be a #define, 
> or should it be programmatically adjusted based on the CPU?

It is a property of the hardware, it has 32 LUT entries.  #define would
be good indeed, but the code is already full of other numeric constants.

-- 
Alexander Motin
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r344437 - head/sys/dev/ntb/ntb_hw

2019-02-21 Thread Enji Cooper


> On Feb 21, 2019, at 6:10 AM, Alexander Motin  wrote:
> 
> Author: mav
> Date: Thu Feb 21 14:10:14 2019
> New Revision: 344437
> URL: https://svnweb.freebsd.org/changeset/base/344437
> 
> Log:
>  Allow I/OAT of present Xeon E5/E7 to work thorugh PLX NTB.
> 
>  Its a hack, we can't know/list all DMA engines, but this covers all
>  I/OAT of Xeon E5/E7 at least from Sandy Bridge till Skylake I saw.
> 
>  MFC after:   1 week
>  Sponsored by:iXsystems, Inc.
> 
> Modified:
>  head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c
> 
> Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c
> ==
> --- head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c  Thu Feb 21 12:13:27 2019
> (r344436)
> +++ head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c  Thu Feb 21 14:10:14 2019
> (r344437)
> @@ -202,16 +202,24 @@ ntb_plx_init(device_t dev)
>   if (sc->alut)
>   PNTX_WRITE(sc, 0xc94, 0);
> 
> - /* Enable Link Interface LUT entries 0/1 for peer 0/1. */
> - PNTX_WRITE(sc, 0xdb4, 0x00090001);
> + /* Enable all Link Interface LUT entries for peer. */
> + for (i = 0; i < 32; i += 2) {

Is `32` written down in the NTB spec somewhere? Should it be a #define, 
or should it be programmatically adjusted based on the CPU?
Thank you!
-Enji
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r344443 - head/sys/conf

2019-02-21 Thread Bruce Evans
Author: bde
Date: Thu Feb 21 17:31:33 2019
New Revision: 33
URL: https://svnweb.freebsd.org/changeset/base/33

Log:
  Move scterm_teken.c from 6 MD files lists to the MI files list so that it
  is easier to configure.  It is MI, unlike some of the other syscons files
  already in the MI list.
  
  Move scvtb.c similarly.  It is needed whenever sc is configured, and is
  more MI than most of the files already in the MI list.
  
  This only changes the combined list for arm64 and mips.  These arches
  already cannot build sc or even NOTES.

Modified:
  head/sys/conf/files
  head/sys/conf/files.amd64
  head/sys/conf/files.arm
  head/sys/conf/files.i386
  head/sys/conf/files.mips
  head/sys/conf/files.powerpc
  head/sys/conf/files.sparc64

Modified: head/sys/conf/files
==
--- head/sys/conf/files Thu Feb 21 17:27:37 2019(r32)
+++ head/sys/conf/files Thu Feb 21 17:31:33 2019(r33)
@@ -3133,7 +3133,9 @@ dev/syscons/rain/rain_saver.c optional rain_saver
 dev/syscons/schistory.coptional sc
 dev/syscons/scmouse.c  optional sc
 dev/syscons/scterm.c   optional sc
+dev/syscons/scterm-teken.c optional sc
 dev/syscons/scvidctl.c optional sc
+dev/syscons/scvtb.coptional sc
 dev/syscons/snake/snake_saver.coptional snake_saver
 dev/syscons/star/star_saver.c  optional star_saver
 dev/syscons/syscons.c  optional sc

Modified: head/sys/conf/files.amd64
==
--- head/sys/conf/files.amd64   Thu Feb 21 17:27:37 2019(r32)
+++ head/sys/conf/files.amd64   Thu Feb 21 17:31:33 2019(r33)
@@ -486,10 +486,8 @@ dev/smartpqi/smartpqi_sis.c optional   smartpqi
 dev/smartpqi/smartpqi_tag.c optional   smartpqi
 dev/speaker/spkr.c optionalspeaker
 dev/syscons/apm/apm_saver.coptionalapm_saver apm
-dev/syscons/scterm-teken.c optionalsc
 dev/syscons/scvesactl.coptionalsc vga vesa
 dev/syscons/scvgarndr.coptionalsc vga
-dev/syscons/scvtb.coptionalsc
 dev/tpm/tpm.c  optionaltpm
 dev/tpm/tpm20.coptionaltpm
 dev/tpm/tpm_crb.c  optionaltpm acpi

Modified: head/sys/conf/files.arm
==
--- head/sys/conf/files.arm Thu Feb 21 17:27:37 2019(r32)
+++ head/sys/conf/files.arm Thu Feb 21 17:31:33 2019(r33)
@@ -132,8 +132,6 @@ dev/pci/pci_host_generic_fdt.c  optional
pci_host_gener
 dev/psci/psci.coptionalpsci
 dev/psci/psci_arm.Soptionalpsci
 dev/syscons/scgfbrndr.coptionalsc
-dev/syscons/scterm-teken.c optionalsc
-dev/syscons/scvtb.coptionalsc
 dev/uart/uart_cpu_fdt.coptionaluart fdt
 
 font.h optionalsc  \

Modified: head/sys/conf/files.i386
==
--- head/sys/conf/files.i386Thu Feb 21 17:27:37 2019(r32)
+++ head/sys/conf/files.i386Thu Feb 21 17:31:33 2019(r33)
@@ -309,10 +309,8 @@ dev/sio/sio_pci.c  optional sio pci
 dev/sio/sio_puc.c  optional sio puc
 dev/speaker/spkr.c optional speaker
 dev/syscons/apm/apm_saver.coptional apm_saver apm
-dev/syscons/scterm-teken.c optional sc
 dev/syscons/scvesactl.coptional sc vga vesa
 dev/syscons/scvgarndr.coptional sc vga
-dev/syscons/scvtb.coptional sc
 dev/tpm/tpm.c  optional tpm
 dev/tpm/tpm_acpi.c optional tpm acpi
 dev/tpm/tpm_isa.c  optional tpm isa

Modified: head/sys/conf/files.mips
==
--- head/sys/conf/files.mipsThu Feb 21 17:27:37 2019(r32)
+++ head/sys/conf/files.mipsThu Feb 21 17:31:33 2019(r33)
@@ -75,8 +75,6 @@ dev/cfe/cfe_env.c optionalcfe_env
 # syscons support
 dev/fb/fb.coptionalsc
 dev/syscons/scgfbrndr.coptionalsc
-dev/syscons/scterm-teken.c optionalsc
-dev/syscons/scvtb.coptionalsc
 mips/mips/sc_machdep.c optionalsc
 
 # FDT support

Modified: head/sys/conf/files.powerpc
==
--- head/sys/conf/files.powerpc Thu Feb 21 17:27:37 2019(r32)
+++ head/sys/conf/files.powerpc Thu Feb 21 17:31:33 2019(r33)
@@ -74,8 +74,6 @@ dev/sound/macio/onyx.c 

svn commit: r344442 - stable/11/release/arm

2019-02-21 Thread Glen Barber
Author: gjb
Date: Thu Feb 21 17:27:37 2019
New Revision: 32
URL: https://svnweb.freebsd.org/changeset/base/32

Log:
  Update the stable/11 arm SoC IMAGE_SIZE to 3072M as build
  failures were encountered due to the target filesystem
  running out of space during the installkernel target.
  
  The 3072M size is used as it is consistent with head and
  stable/12 image sizes, and build failures due to a full
  filesystem have been common enough to justify making the
  default size the same across all supported branches in
  order to avoid such surprises.
  
  This is a direct commit to stable/11, as there are several
  changes between several size bumps that are unrelated or
  unnecessary in this branch.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/11/release/arm/BANANAPI.conf
  stable/11/release/arm/BEAGLEBONE.conf
  stable/11/release/arm/CUBIEBOARD.conf
  stable/11/release/arm/CUBIEBOARD2.conf
  stable/11/release/arm/CUBOX-HUMMINGBOARD.conf
  stable/11/release/arm/GUMSTIX.conf
  stable/11/release/arm/PANDABOARD.conf
  stable/11/release/arm/RPI-B.conf
  stable/11/release/arm/RPI2.conf
  stable/11/release/arm/WANDBOARD.conf

Modified: stable/11/release/arm/BANANAPI.conf
==
--- stable/11/release/arm/BANANAPI.conf Thu Feb 21 16:47:36 2019
(r31)
+++ stable/11/release/arm/BANANAPI.conf Thu Feb 21 17:27:37 2019
(r32)
@@ -9,7 +9,7 @@ EMBEDDEDBUILD=1
 EMBEDDEDPORTS="sysutils/u-boot-bananapi"
 FAT_SIZE="50m -b 1m"
 FAT_TYPE="16"
-IMAGE_SIZE="1G"
+IMAGE_SIZE="3072M"
 KERNEL="ALLWINNER"
 MD_ARGS="-x 63 -y 255"
 NODOC=1

Modified: stable/11/release/arm/BEAGLEBONE.conf
==
--- stable/11/release/arm/BEAGLEBONE.conf   Thu Feb 21 16:47:36 2019
(r31)
+++ stable/11/release/arm/BEAGLEBONE.conf   Thu Feb 21 17:27:37 2019
(r32)
@@ -9,7 +9,7 @@ EMBEDDEDBUILD=1
 EMBEDDEDPORTS="sysutils/u-boot-beaglebone"
 FAT_SIZE="50m"
 FAT_TYPE="16"
-IMAGE_SIZE="1G"
+IMAGE_SIZE="3072M"
 KERNEL="BEAGLEBONE"
 MD_ARGS="-x 63 -y 255"
 NODOC=1

Modified: stable/11/release/arm/CUBIEBOARD.conf
==
--- stable/11/release/arm/CUBIEBOARD.conf   Thu Feb 21 16:47:36 2019
(r31)
+++ stable/11/release/arm/CUBIEBOARD.conf   Thu Feb 21 17:27:37 2019
(r32)
@@ -9,7 +9,7 @@ EMBEDDEDBUILD=1
 EMBEDDEDPORTS="sysutils/u-boot-cubieboard"
 FAT_SIZE="50m -b 1m"
 FAT_TYPE="16"
-IMAGE_SIZE="1G"
+IMAGE_SIZE="3072M"
 KERNEL="ALLWINNER_UP"
 MD_ARGS="-x 63 -y 255"
 NODOC=1

Modified: stable/11/release/arm/CUBIEBOARD2.conf
==
--- stable/11/release/arm/CUBIEBOARD2.conf  Thu Feb 21 16:47:36 2019
(r31)
+++ stable/11/release/arm/CUBIEBOARD2.conf  Thu Feb 21 17:27:37 2019
(r32)
@@ -9,7 +9,7 @@ EMBEDDEDBUILD=1
 EMBEDDEDPORTS="sysutils/u-boot-cubieboard2"
 FAT_SIZE="50m -b 1m"
 FAT_TYPE="16"
-IMAGE_SIZE="1G"
+IMAGE_SIZE="3072M"
 KERNEL="ALLWINNER"
 MD_ARGS="-x 63 -y 255"
 NODOC=1

Modified: stable/11/release/arm/CUBOX-HUMMINGBOARD.conf
==
--- stable/11/release/arm/CUBOX-HUMMINGBOARD.conf   Thu Feb 21 16:47:36 
2019(r31)
+++ stable/11/release/arm/CUBOX-HUMMINGBOARD.conf   Thu Feb 21 17:27:37 
2019(r32)
@@ -9,7 +9,7 @@ EMBEDDEDBUILD=1
 EMBEDDEDPORTS="sysutils/u-boot-cubox-hummingboard"
 FAT_SIZE="50m -b 16384"
 FAT_TYPE="16"
-IMAGE_SIZE="1536M"
+IMAGE_SIZE="3072M"
 KERNEL="IMX6"
 MD_ARGS="-x 63 -y 255"
 NODOC=1

Modified: stable/11/release/arm/GUMSTIX.conf
==
--- stable/11/release/arm/GUMSTIX.conf  Thu Feb 21 16:47:36 2019
(r31)
+++ stable/11/release/arm/GUMSTIX.conf  Thu Feb 21 17:27:37 2019
(r32)
@@ -9,7 +9,7 @@ EMBEDDEDBUILD=1
 EMBEDDEDPORTS="sysutils/u-boot-duovero"
 FAT_SIZE="50m"
 FAT_TYPE="16"
-IMAGE_SIZE="1G"
+IMAGE_SIZE="3072M"
 KERNEL="GUMSTIX"
 MD_ARGS="-x 63 -y 255"
 NODOC=1

Modified: stable/11/release/arm/PANDABOARD.conf
==
--- stable/11/release/arm/PANDABOARD.conf   Thu Feb 21 16:47:36 2019
(r31)
+++ stable/11/release/arm/PANDABOARD.conf   Thu Feb 21 17:27:37 2019
(r32)
@@ -9,7 +9,7 @@ EMBEDDEDBUILD=1
 EMBEDDEDPORTS="sysutils/u-boot-pandaboard"
 FAT_SIZE="50m"
 FAT_TYPE="16"
-IMAGE_SIZE="1G"
+IMAGE_SIZE="3072M"
 KERNEL="PANDABOARD"
 MD_ARGS="-x 63 -y 255"
 NODOC=1

Modified: stable/11/release/arm/RPI-B.conf
==
--- stable/11/release/arm/RPI-B.confThu Feb 21 16:47:36 2019
(r31)
+++ stable/11/release/arm/RPI-B.confThu Feb 21 17:27:37 

svn commit: r344441 - head/sys/dev/ioat

2019-02-21 Thread Alexander Motin
Author: mav
Date: Thu Feb 21 16:47:36 2019
New Revision: 31
URL: https://svnweb.freebsd.org/changeset/base/31

Log:
  Fix few issues in ioat(4) driver.
  
   - Do not explicitly count active descriptors.  It allows hardware reset
  to happen while device is still referenced, plus simplifies locking.
   - Do not stop/start callout each time the queue becomes empty.  Let it
  run to completion and rearm if needed, that is much cheaper then to touch
  it every time, plus also simplifies locking.
   - Decouple submit and cleanup locks, making driver reentrant.
   - Avoid memory mapped status register read on every interrupt.
   - Improve locking during device attach/detach.
   - Remove some no longer used variables.
  
  Reviewed by:  cem
  MFC after:1 week
  Sponsored by: iXsystems, Inc.
  Differential Revision:https://reviews.freebsd.org/D19231

Modified:
  head/sys/dev/ioat/ioat.c
  head/sys/dev/ioat/ioat_internal.h

Modified: head/sys/dev/ioat/ioat.c
==
--- head/sys/dev/ioat/ioat.cThu Feb 21 15:44:32 2019(r30)
+++ head/sys/dev/ioat/ioat.cThu Feb 21 16:47:36 2019(r31)
@@ -1,6 +1,7 @@
 /*-
  * Copyright (C) 2012 Intel Corporation
  * All rights reserved.
+ * Copyright (C) 2018 Alexander Motin 
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -62,7 +63,6 @@ __FBSDID("$FreeBSD$");
 #ifndefBUS_SPACE_MAXADDR_40BIT
 #defineBUS_SPACE_MAXADDR_40BIT 0xFFULL
 #endif
-#defineIOAT_REFLK  (>submit_lock)
 
 static int ioat_probe(device_t device);
 static int ioat_attach(device_t device);
@@ -77,7 +77,7 @@ static void ioat_dmamap_cb(void *arg, bus_dma_segment_
 static void ioat_interrupt_handler(void *arg);
 static boolean_t ioat_model_resets_msix(struct ioat_softc *ioat);
 static int chanerr_to_errno(uint32_t);
-static void ioat_process_events(struct ioat_softc *ioat);
+static void ioat_process_events(struct ioat_softc *ioat, boolean_t intr);
 static inline uint32_t ioat_get_active(struct ioat_softc *ioat);
 static inline uint32_t ioat_get_ring_space(struct ioat_softc *ioat);
 static void ioat_free_ring(struct ioat_softc *, uint32_t size,
@@ -97,15 +97,8 @@ static int ioat_reset_hw(struct ioat_softc *ioat);
 static void ioat_reset_hw_task(void *, int);
 static void ioat_setup_sysctl(device_t device);
 static int sysctl_handle_reset(SYSCTL_HANDLER_ARGS);
-static inline struct ioat_softc *ioat_get(struct ioat_softc *,
-enum ioat_ref_kind);
-static inline void ioat_put(struct ioat_softc *, enum ioat_ref_kind);
-static inline void _ioat_putn(struct ioat_softc *, uint32_t,
-enum ioat_ref_kind, boolean_t);
-static inline void ioat_putn(struct ioat_softc *, uint32_t,
-enum ioat_ref_kind);
-static inline void ioat_putn_locked(struct ioat_softc *, uint32_t,
-enum ioat_ref_kind);
+static void ioat_get(struct ioat_softc *);
+static void ioat_put(struct ioat_softc *);
 static void ioat_drain_locked(struct ioat_softc *);
 
 #defineioat_log_message(v, ...) do {   
\
@@ -157,6 +150,8 @@ static struct ioat_softc *ioat_channel[IOAT_MAX_CHANNE
 static unsigned ioat_channel_index = 0;
 SYSCTL_UINT(_hw_ioat, OID_AUTO, channels, CTLFLAG_RD, _channel_index, 0,
 "Number of IOAT channels attached");
+static struct mtx ioat_list_mtx;
+MTX_SYSINIT(ioat_list_mtx, _list_mtx, "ioat list mtx", MTX_DEF);
 
 static struct _pcsid
 {
@@ -266,7 +261,7 @@ static int
 ioat_attach(device_t device)
 {
struct ioat_softc *ioat;
-   int error;
+   int error, i;
 
ioat = DEVICE2SOFTC(device);
ioat->device = device;
@@ -297,11 +292,26 @@ ioat_attach(device_t device)
if (error != 0)
goto err;
 
-   ioat_process_events(ioat);
+   ioat_process_events(ioat, FALSE);
ioat_setup_sysctl(device);
 
-   ioat->chan_idx = ioat_channel_index;
-   ioat_channel[ioat_channel_index++] = ioat;
+   mtx_lock(_list_mtx);
+   for (i = 0; i < IOAT_MAX_CHANNELS; i++) {
+   if (ioat_channel[i] == NULL)
+   break;
+   }
+   if (i >= IOAT_MAX_CHANNELS) {
+   mtx_unlock(_list_mtx);
+   device_printf(device, "Too many I/OAT devices in system\n");
+   error = ENXIO;
+   goto err;
+   }
+   ioat->chan_idx = i;
+   ioat_channel[i] = ioat;
+   if (i >= ioat_channel_index)
+   ioat_channel_index = i + 1;
+   mtx_unlock(_list_mtx);
+
ioat_test_attach();
 
 err:
@@ -317,19 +327,28 @@ ioat_detach(device_t device)
 
ioat = DEVICE2SOFTC(device);
 
+   mtx_lock(_list_mtx);
+   ioat_channel[ioat->chan_idx] = NULL;
+   while (ioat_channel_index > 0 &&
+   ioat_channel[ioat_channel_index - 1] == NULL)
+   ioat_channel_index--;
+   

Re: svn commit: r344414 - stable/11

2019-02-21 Thread Rodney W. Grimes
> > On Feb 21, 2019, at 04:43, Kyle Evans  wrote:
> > 
> > On Thu, Feb 21, 2019 at 12:16 AM Rodney W. Grimes
> >  wrote:
> >> 
> >>> Author: kevans
> >>> Date: Thu Feb 21 03:22:20 2019
> >>> New Revision: 344414
> >>> URL: https://svnweb.freebsd.org/changeset/base/344414
> >>> 
> >>> Log:
> >>>  MFC (RECORD ONLY) r338050: Loader default interpreter flip
> >>> 
> >>>  The default interpreter for stable/11 is 4th; this will never and can 
> >>> never
> >>>  change. Record MFC of r338050 to proactively prevent any accidents in 
> >>> future
> >>>  batching of MFCs.
> >>> 
> >>> Modified:
> >>> Directory Properties:
> >>>  stable/11/   (props changed)
> >> 
> >> Does it make sense to do a direct commit to stable/11
> >> marking the line that does this flip with a
> >> "Do not change this in the stable/11 branch"
> >> so that someone does not try to manually merge
> >> the change if they happen to notice the code
> >> is different?
> > 
> > I'll chew on it for a little bit. It's fairly clear what the
> > ramifications of swapping those lines around are, even from diff
> > review, and I'd like to assume no one would willfully do it if they
> > put a couple seconds thought into what they were about to commit.
> 
> Kyle,
> I think what you did makes sense. I?ve done this and I?ve
> seen others do similar in the past. 
I concur, what he did do makes perfect since.

> As someone who?s merged code in from others, I appreciate
> measures like this, which would prevent me from breaking a
> stable branch by accident.

I am just wondering about a second safety belt,
as the current one just makes a svn merge -c338050 a silent nop,
but in no way stops someone from manually applying the diff.

We have people that are very good with svn and would know how
to investigate the nop, and we have people who can barely
manage to do a merge with proper mergeinfo.

> Thanks!
> -Enji
-- 
Rod Grimes rgri...@freebsd.org
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r344414 - stable/11

2019-02-21 Thread Enji Cooper

> On Feb 21, 2019, at 04:43, Kyle Evans  wrote:
> 
> On Thu, Feb 21, 2019 at 12:16 AM Rodney W. Grimes
>  wrote:
>> 
>>> Author: kevans
>>> Date: Thu Feb 21 03:22:20 2019
>>> New Revision: 344414
>>> URL: https://svnweb.freebsd.org/changeset/base/344414
>>> 
>>> Log:
>>>  MFC (RECORD ONLY) r338050: Loader default interpreter flip
>>> 
>>>  The default interpreter for stable/11 is 4th; this will never and can never
>>>  change. Record MFC of r338050 to proactively prevent any accidents in 
>>> future
>>>  batching of MFCs.
>>> 
>>> Modified:
>>> Directory Properties:
>>>  stable/11/   (props changed)
>> 
>> Does it make sense to do a direct commit to stable/11
>> marking the line that does this flip with a
>> "Do not change this in the stable/11 branch"
>> so that someone does not try to manually merge
>> the change if they happen to notice the code
>> is different?
> 
> I'll chew on it for a little bit. It's fairly clear what the
> ramifications of swapping those lines around are, even from diff
> review, and I'd like to assume no one would willfully do it if they
> put a couple seconds thought into what they were about to commit.

Kyle,
I think what you did makes sense. I’ve done this and I’ve seen others do 
similar in the past. 
As someone who’s merged code in from others, I appreciate measures like 
this, which would prevent me from breaking a stable branch by accident.
Thanks!
-Enji
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r344440 - head/sys/vm

2019-02-21 Thread Mark Johnston
Author: markj
Date: Thu Feb 21 15:44:32 2019
New Revision: 30
URL: https://svnweb.freebsd.org/changeset/base/30

Log:
  Clear pointers to indicate that the respective locks are released.
  
  This fixes a problem in r344231: vm_pageout_launder() may scan two
  queues when swap is disabled.
  
  Reported by:  pho
  MFC with: r344231

Modified:
  head/sys/vm/vm_pageout.c

Modified: head/sys/vm/vm_pageout.c
==
--- head/sys/vm/vm_pageout.cThu Feb 21 15:31:01 2019(r344439)
+++ head/sys/vm/vm_pageout.cThu Feb 21 15:44:32 2019(r30)
@@ -893,10 +893,14 @@ free_page:
object = NULL;
}
}
-   if (mtx != NULL)
+   if (mtx != NULL) {
mtx_unlock(mtx);
-   if (object != NULL)
+   mtx = NULL;
+   }
+   if (object != NULL) {
VM_OBJECT_WUNLOCK(object);
+   object = NULL;
+   }
vm_pagequeue_lock(pq);
vm_pageout_end_scan();
vm_pagequeue_unlock(pq);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r344439 - svnadmin/conf

2019-02-21 Thread Mark Johnston
Author: markj
Date: Thu Feb 21 15:31:01 2019
New Revision: 344439
URL: https://svnweb.freebsd.org/changeset/base/344439

Log:
  Release lwhsu from mentorship.
  
  Discussed with:   emaste

Modified:
  svnadmin/conf/mentors

Modified: svnadmin/conf/mentors
==
--- svnadmin/conf/mentors   Thu Feb 21 15:08:25 2019(r344438)
+++ svnadmin/conf/mentors   Thu Feb 21 15:31:01 2019(r344439)
@@ -23,7 +23,6 @@ jkh   rwatson
 jwdrmacklem
 kadesaiken Co-mentor: scottl, ambrisko
 leitao jhibbitsCo-mentor: nwhitehorn
-lwhsu  markj   Co-mentor: emaste
 mahrensmckusick
 miwi   araujo
 mjoras rstone
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r344099 - head/sys/net

2019-02-21 Thread Randall Stewart via svn-src-all


> On Feb 13, 2019, at 1:10 PM, John Baldwin  wrote:
> 
> On 2/13/19 10:03 AM, Randall Stewart wrote:
>> oh and one other thing..
>> 
>> It was *not* a random IFP.. it was the IFP to the lagg.
>> 
>> I.e. an alloc() was done to the lagg.. and the free was
>> done back to the same IFP (that provided the allocate).
> 
> Yes, that's wrong.  Suppose the route changes so that my traffic is now over
> em0 instead of lagg0 (where em0 isn't a member of the lagg), how do you
> expect if_lagg_free to invoke em0's free routine?  In your case it does,
> but only by accident.  It doesn't work in the other case I described which
> is if you have non-lagg interfaces and a route moves from cc0 to em0.  In
> that case your existing code that is using the wrong ifp will just panic.
> 
> These aren't real alloc routines as the lagg and vlan ones don't allocate
> anything, they pass along the request to the child and the child allocates
> the tag.  Only ifnet's that actually allocate tags should need to free them,
> and you should be using tag->ifp to as the ifp whose if_snd_tag_free works.

But thats what the lagg’s routine does, use the tag sent in
to find the real ifp (where the tag was allocated) and call
the if_snd_tag_free() on that.

Its not an accident it works, it calls the free of the actual
interface where the allocation came from.

I don’t see how it would panic.

R

> 
>> R
>> 
>>> On Feb 13, 2019, at 1:02 PM, Randall Stewart  wrote:
>>> 
>>> I disagree. If you define an alloc it is only
>>> reciprocal that you should define a free.
>>> 
>>> The code in question that hit this was changed (its in a version
>>> of rack that has the rate-limit and TLS code).. but I think these
>>> things *should* be balanced.. if you provide an Allocate, you
>>> should also provide a Free… 
>>> 
>>> R
>>> 
>>> 
 On Feb 13, 2019, at 12:09 PM, John Baldwin  wrote:
 
 On 2/13/19 6:57 AM, Randall Stewart wrote:
> Author: rrs
> Date: Wed Feb 13 14:57:59 2019
> New Revision: 344099
> URL: https://svnweb.freebsd.org/changeset/base/344099
> 
> Log:
> This commit adds the missing release mechanism for the
> ratelimiting code. The two modules (lagg and vlan) did have
> allocation routines, and even though they are indirect (and
> vector down to the underlying interfaces) they both need to
> have a free routine (that also vectors down to the actual interface).
> 
> Sponsored by: Netflix Inc.
> Differential Revision:https://reviews.freebsd.org/D19032
 
 Hmm, I don't understand why you'd ever invoke if_snd_tag_free from anything
 but 'tag->ifp' rather than some other ifp.  What if the route for a 
 connection
 moves so that a tag allocated on cc0 is now on a route that goes over em0?
 You can't expect em0 to have an if_snd_tag_free routine that will know to
 go invoke cxgbe's snd_tag_free.  I think you should always be using
 'tag->ifp->if_snd_tag_free' to free tags and never using any other ifp.
 
 That is, I think this should be reverted and that instead you need to fix
 the code invoking if_snd_tag_free to invoke it on the tag's ifp instead of
 some random other ifp.
 
 -- 
 John Baldwin
 
 
>>> 
>>> --
>>> Randall Stewart
>>> r...@netflix.com
>>> 
>>> 
>>> 
>> 
>> --
>> Randall Stewart
>> r...@netflix.com
>> 
>> 
>> 
> 
> 
> -- 
> John Baldwin

--
Randall Stewart
r...@netflix.com



___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r344438 - in head/usr.bin/svn: . svn svnadmin svnbench svndumpfilter svnfsfs svnlook svnmucc svnrdump svnserve svnsync svnversion

2019-02-21 Thread Ed Maste
Author: emaste
Date: Thu Feb 21 15:08:25 2019
New Revision: 344438
URL: https://svnweb.freebsd.org/changeset/base/344438

Log:
  svn: support building with WITH_PIE
  
  Subversion builds and links against its own .a archives using local
  rules, so did not benefit from with the WITH_PIE library support added
  in r344179.  Apply the same _pie suffix locally.
  
  Reviewed by:  cem
  Differential Revision:https://reviews.freebsd.org/D19246

Modified:
  head/usr.bin/svn/Makefile.inc
  head/usr.bin/svn/svn/Makefile
  head/usr.bin/svn/svnadmin/Makefile
  head/usr.bin/svn/svnbench/Makefile
  head/usr.bin/svn/svndumpfilter/Makefile
  head/usr.bin/svn/svnfsfs/Makefile
  head/usr.bin/svn/svnlook/Makefile
  head/usr.bin/svn/svnmucc/Makefile
  head/usr.bin/svn/svnrdump/Makefile
  head/usr.bin/svn/svnserve/Makefile
  head/usr.bin/svn/svnsync/Makefile
  head/usr.bin/svn/svnversion/Makefile

Modified: head/usr.bin/svn/Makefile.inc
==
--- head/usr.bin/svn/Makefile.inc   Thu Feb 21 14:10:14 2019
(r344437)
+++ head/usr.bin/svn/Makefile.inc   Thu Feb 21 15:08:25 2019
(r344438)
@@ -2,13 +2,14 @@
 
 .include 
 
-MK_PIE:=   no  # Explicit libXXX.a references
-
 .if ${MK_SVN} == "yes"
 SVNLITE?=
 .else
 SVNLITE?=  lite
 .endif
+.if ${MK_PIE} != "no"
+PIE_SUFFIX=_pie
+.endif
 
 PACKAGE=   svn
 
@@ -40,23 +41,23 @@ LIBSVN_REPOSDIR=${.OBJDIR:H}/lib/libsvn_repos
 LIBSVN_SUBRDIR=${.OBJDIR:H}/lib/libsvn_subr
 LIBSVN_WCDIR=  ${.OBJDIR:H}/lib/libsvn_wc
 
-LIBAPR=${LIBAPRDIR}/libapr.a
-LIBAPR_UTIL=   ${LIBAPR_UTILDIR}/libapr-util.a
-LIBSERF=   ${LIBSERFDIR}/libserf.a
+LIBAPR=${LIBAPRDIR}/libapr${PIE_SUFFIX}.a
+LIBAPR_UTIL=   ${LIBAPR_UTILDIR}/libapr-util${PIE_SUFFIX}.a
+LIBSERF=   ${LIBSERFDIR}/libserf${PIE_SUFFIX}.a
 
-LIBSVN_CLIENT= ${LIBSVN_CLIENTDIR}/libsvn_client.a
-LIBSVN_DELTA=  ${LIBSVN_DELTADIR}/libsvn_delta.a
-LIBSVN_DIFF=   ${LIBSVN_DIFFDIR}/libsvn_diff.a
-LIBSVN_FS= ${LIBSVN_FSDIR}/libsvn_fs.a
-LIBSVN_FS_FS=  ${LIBSVN_FS_FSDIR}/libsvn_fs_fs.a
-LIBSVN_FS_UTIL=${LIBSVN_FS_UTILDIR}/libsvn_fs_util.a
-LIBSVN_FS_X=   ${LIBSVN_FS_XDIR}/libsvn_fs_x.a
-LIBSVN_RA= ${LIBSVN_RADIR}/libsvn_ra.a
-LIBSVN_RA_LOCAL=   ${LIBSVN_RA_LOCALDIR}/libsvn_ra_local.a
-LIBSVN_RA_SVN= ${LIBSVN_RA_SVNDIR}/libsvn_ra_svn.a
-LIBSVN_RA_SERF=${LIBSVN_RA_SERFDIR}/libsvn_ra_serf.a
-LIBSVN_REPOS=  ${LIBSVN_REPOSDIR}/libsvn_repos.a
-LIBSVN_SUBR=   ${LIBSVN_SUBRDIR}/libsvn_subr.a
-LIBSVN_WC= ${LIBSVN_WCDIR}/libsvn_wc.a
+LIBSVN_CLIENT= ${LIBSVN_CLIENTDIR}/libsvn_client${PIE_SUFFIX}.a
+LIBSVN_DELTA=  ${LIBSVN_DELTADIR}/libsvn_delta${PIE_SUFFIX}.a
+LIBSVN_DIFF=   ${LIBSVN_DIFFDIR}/libsvn_diff${PIE_SUFFIX}.a
+LIBSVN_FS= ${LIBSVN_FSDIR}/libsvn_fs${PIE_SUFFIX}.a
+LIBSVN_FS_FS=  ${LIBSVN_FS_FSDIR}/libsvn_fs_fs${PIE_SUFFIX}.a
+LIBSVN_FS_UTIL=
${LIBSVN_FS_UTILDIR}/libsvn_fs_util${PIE_SUFFIX}.a
+LIBSVN_FS_X=   ${LIBSVN_FS_XDIR}/libsvn_fs_x${PIE_SUFFIX}.a
+LIBSVN_RA= ${LIBSVN_RADIR}/libsvn_ra${PIE_SUFFIX}.a
+LIBSVN_RA_LOCAL=   ${LIBSVN_RA_LOCALDIR}/libsvn_ra_local${PIE_SUFFIX}.a
+LIBSVN_RA_SVN= ${LIBSVN_RA_SVNDIR}/libsvn_ra_svn${PIE_SUFFIX}.a
+LIBSVN_RA_SERF=
${LIBSVN_RA_SERFDIR}/libsvn_ra_serf${PIE_SUFFIX}.a
+LIBSVN_REPOS=  ${LIBSVN_REPOSDIR}/libsvn_repos${PIE_SUFFIX}.a
+LIBSVN_SUBR=   ${LIBSVN_SUBRDIR}/libsvn_subr${PIE_SUFFIX}.a
+LIBSVN_WC= ${LIBSVN_WCDIR}/libsvn_wc${PIE_SUFFIX}.a
 
 .endif

Modified: head/usr.bin/svn/svn/Makefile
==
--- head/usr.bin/svn/svn/Makefile   Thu Feb 21 14:10:14 2019
(r344437)
+++ head/usr.bin/svn/svn/Makefile   Thu Feb 21 15:08:25 2019
(r344438)
@@ -26,23 +26,23 @@ CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H}
-I${APRU}/include/private \
-I${APRU}/include
 
-LDADD= -L${LIBSVN_CLIENTDIR} -lsvn_client \
-   -L${LIBSVN_WCDIR} -lsvn_wc \
-   -L${LIBSVN_RADIR} -lsvn_ra \
-   -L${LIBSVN_RA_LOCALDIR} -lsvn_ra_local \
-   -L${LIBSVN_RA_SVNDIR} -lsvn_ra_svn \
-   -L${LIBSVN_RA_SERFDIR} -lsvn_ra_serf \
-   -L${LIBSVN_REPOSDIR} -lsvn_repos \
-   -L${LIBSVN_FSDIR} -lsvn_fs \
-   -L${LIBSVN_FS_FSDIR} -lsvn_fs_fs \
-   -L${LIBSVN_FS_XDIR} -lsvn_fs_x \
-   -L${LIBSVN_FS_UTILDIR} -lsvn_fs_util \
-   -L${LIBSVN_DELTADIR} -lsvn_delta \
-   -L${LIBSVN_DIFFDIR} -lsvn_diff \
-   -L${LIBSVN_SUBRDIR} -lsvn_subr \
-   -L${LIBSERFDIR} -lserf \
-   -L${LIBAPR_UTILDIR} -lapr-util \
-   -L${LIBAPRDIR} -lapr
+LDADD= -L${LIBSVN_CLIENTDIR} -lsvn_client${PIE_SUFFIX} \
+  

svn commit: r344437 - head/sys/dev/ntb/ntb_hw

2019-02-21 Thread Alexander Motin
Author: mav
Date: Thu Feb 21 14:10:14 2019
New Revision: 344437
URL: https://svnweb.freebsd.org/changeset/base/344437

Log:
  Allow I/OAT of present Xeon E5/E7 to work thorugh PLX NTB.
  
  Its a hack, we can't know/list all DMA engines, but this covers all
  I/OAT of Xeon E5/E7 at least from Sandy Bridge till Skylake I saw.
  
  MFC after:1 week
  Sponsored by: iXsystems, Inc.

Modified:
  head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c

Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c
==
--- head/sys/dev/ntb/ntb_hw/ntb_hw_plx.cThu Feb 21 12:13:27 2019
(r344436)
+++ head/sys/dev/ntb/ntb_hw/ntb_hw_plx.cThu Feb 21 14:10:14 2019
(r344437)
@@ -202,16 +202,24 @@ ntb_plx_init(device_t dev)
if (sc->alut)
PNTX_WRITE(sc, 0xc94, 0);
 
-   /* Enable Link Interface LUT entries 0/1 for peer 0/1. */
-   PNTX_WRITE(sc, 0xdb4, 0x00090001);
+   /* Enable all Link Interface LUT entries for peer. */
+   for (i = 0; i < 32; i += 2) {
+   PNTX_WRITE(sc, 0xdb4 + i * 2,
+   0x00010001 | ((i + 1) << 19) | (i << 3));
+   }
}
 
/*
-* Enable Virtual Interface LUT entry 0 for 0:0.0 and
-* entry 1 for our Requester ID reported by chip.
+* Enable Virtual Interface LUT entry 0 for 0:0.*.
+* entry 1 for our Requester ID reported by the chip,
+* entries 2-5 for 0/64/128/192:4.* of I/OAT DMA engines.
+* XXX: Its a hack, we can't know all DMA engines, but this covers all
+* I/OAT of Xeon E5/E7 at least from Sandy Bridge till Skylake I saw.
 */
val = (NTX_READ(sc, 0xc90) << 16) | 0x00010001;
NTX_WRITE(sc, sc->link ? 0xdb4 : 0xd94, val);
+   NTX_WRITE(sc, sc->link ? 0xdb8 : 0xd98, 0x40210021);
+   NTX_WRITE(sc, sc->link ? 0xdbc : 0xd9c, 0xc0218021);
 
/* Set Link to Virtual address translation. */
for (i = 0; i < sc->mw_count; i++) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r344414 - stable/11

2019-02-21 Thread Kyle Evans
On Thu, Feb 21, 2019 at 12:16 AM Rodney W. Grimes
 wrote:
>
> > Author: kevans
> > Date: Thu Feb 21 03:22:20 2019
> > New Revision: 344414
> > URL: https://svnweb.freebsd.org/changeset/base/344414
> >
> > Log:
> >   MFC (RECORD ONLY) r338050: Loader default interpreter flip
> >
> >   The default interpreter for stable/11 is 4th; this will never and can 
> > never
> >   change. Record MFC of r338050 to proactively prevent any accidents in 
> > future
> >   batching of MFCs.
> >
> > Modified:
> > Directory Properties:
> >   stable/11/   (props changed)
>
> Does it make sense to do a direct commit to stable/11
> marking the line that does this flip with a
> "Do not change this in the stable/11 branch"
> so that someone does not try to manually merge
> the change if they happen to notice the code
> is different?
>

I'll chew on it for a little bit. It's fairly clear what the
ramifications of swapping those lines around are, even from diff
review, and I'd like to assume no one would willfully do it if they
put a couple seconds thought into what they were about to commit.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r344418 - stable/11

2019-02-21 Thread Kyle Evans
On Thu, Feb 21, 2019 at 12:20 AM Rodney W. Grimes
 wrote:
>
> > Author: kevans
> > Date: Thu Feb 21 03:48:39 2019
> > New Revision: 344418
> > URL: https://svnweb.freebsd.org/changeset/base/344418
> >
> > Log:
> >   Direct commit for post-mortem UPDATING update regarding lualoader
> >
> >   Indicate that it's been merged (after some delay since lua came back to 
> > this
> >   branch) and how one can test lua, both by swapping build knobs and 
> > creating
> >   links in /boot.
> >
> > Modified:
> >   stable/11/UPDATING
> >
> > Modified: stable/11/UPDATING
> > ==
> > --- stable/11/UPDATINGThu Feb 21 03:39:51 2019(r344417)
> > +++ stable/11/UPDATINGThu Feb 21 03:48:39 2019(r344418)
> > @@ -17,6 +17,20 @@ the tip of head, and then rebuild without this option.
> >  from older version of current across the gcc/clang cutover is a bit 
> > fragile.
> >
> >  20190220:
> > + Co-existance for Forth and Lua interpreters in bootloaders has now 
> > been
> > + merged to ease testing of lualoader.  LOADER_DEFAULT_INTERP, 
> > documented
> > + in build(7), may be used to control which interpreter flavor is used 
> > in
> > + the default loader to be installed.  For systems where Lua and Forth
> > + coexist, this switch can also be made on a running system by creating 
> > a
> > + link from /boot/loader_${flavor}{,efi} to /boot/loader{,.efi} rather
>   ^. missing
> And is not the direction of that link reversed?
> /boot/loader_${,.efi} -> /boot/loader_${flavor}{,.efi}
> is what I would expect the link to be for this.
>

Whoops. Will fix shortly, thanks!

Kyle Evans
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r344436 - in stable/12/lib/libc: . amd64/gen i386/gen x86/gen

2019-02-21 Thread Konstantin Belousov
Author: kib
Date: Thu Feb 21 12:13:27 2019
New Revision: 344436
URL: https://svnweb.freebsd.org/changeset/base/344436

Log:
  MFC r344120:
  Unify i386 and amd64 getcontextx.c, and use ifuncs while there.

Added:
  stable/12/lib/libc/x86/gen/
 - copied from r344120, head/lib/libc/x86/gen/
Deleted:
  stable/12/lib/libc/amd64/gen/getcontextx.c
  stable/12/lib/libc/i386/gen/getcontextx.c
Modified:
  stable/12/lib/libc/Makefile
  stable/12/lib/libc/amd64/gen/Makefile.inc
  stable/12/lib/libc/i386/gen/Makefile.inc
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/lib/libc/Makefile
==
--- stable/12/lib/libc/Makefile Thu Feb 21 12:10:56 2019(r344435)
+++ stable/12/lib/libc/Makefile Thu Feb 21 12:13:27 2019(r344436)
@@ -120,6 +120,7 @@ NOASM=
 .endif
 .if ${LIBC_ARCH} == "i386" || ${LIBC_ARCH} == "amd64"
 .include "${LIBC_SRCTOP}/x86/sys/Makefile.inc"
+.include "${LIBC_SRCTOP}/x86/gen/Makefile.inc"
 .endif
 .if ${MK_NIS} != "no"
 CFLAGS+= -DYP

Modified: stable/12/lib/libc/amd64/gen/Makefile.inc
==
--- stable/12/lib/libc/amd64/gen/Makefile.inc   Thu Feb 21 12:10:56 2019
(r344435)
+++ stable/12/lib/libc/amd64/gen/Makefile.inc   Thu Feb 21 12:13:27 2019
(r344436)
@@ -2,7 +2,7 @@
 # $FreeBSD$
 
 SRCS+= _setjmp.S _set_tp.c rfork_thread.S setjmp.S sigsetjmp.S \
-   fabs.S getcontextx.c \
+   fabs.S \
infinity.c ldexp.c makecontext.c signalcontext.c \
flt_rounds.c fpgetmask.c fpsetmask.c fpgetprec.c fpsetprec.c \
fpgetround.c fpsetround.c fpgetsticky.c

Modified: stable/12/lib/libc/i386/gen/Makefile.inc
==
--- stable/12/lib/libc/i386/gen/Makefile.incThu Feb 21 12:10:56 2019
(r344435)
+++ stable/12/lib/libc/i386/gen/Makefile.incThu Feb 21 12:13:27 2019
(r344436)
@@ -2,5 +2,5 @@
 # $FreeBSD$
 
 SRCS+= _ctx_start.S _setjmp.S _set_tp.c fabs.S \
-   flt_rounds.c getcontextx.c infinity.c ldexp.c makecontext.c \
+   flt_rounds.c infinity.c ldexp.c makecontext.c \
rfork_thread.S setjmp.S signalcontext.c sigsetjmp.S
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r344435 - stable/12/lib/libc/x86/sys

2019-02-21 Thread Konstantin Belousov
Author: kib
Date: Thu Feb 21 12:10:56 2019
New Revision: 344435
URL: https://svnweb.freebsd.org/changeset/base/344435

Log:
  MFC r344119:
  x86 __vdso_gettc(): use machine/cpufunc.h function for CPUID.

Modified:
  stable/12/lib/libc/x86/sys/__vdso_gettc.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/lib/libc/x86/sys/__vdso_gettc.c
==
--- stable/12/lib/libc/x86/sys/__vdso_gettc.c   Thu Feb 21 12:09:04 2019
(r344434)
+++ stable/12/lib/libc/x86/sys/__vdso_gettc.c   Thu Feb 21 12:10:56 2019
(r344435)
@@ -54,31 +54,6 @@ __FBSDID("$FreeBSD$");
 #include "libc_private.h"
 
 static void
-cpuidp(u_int leaf, u_int p[4])
-{
-
-   __asm __volatile(
-#if defined(__i386__)
-   "   pushl   %%ebx\n"
-#endif
-   "   cpuid\n"
-#if defined(__i386__)
-   "   movl%%ebx,%1\n"
-   "   popl%%ebx"
-#endif
-   : "=a" (p[0]),
-#if defined(__i386__)
-   "=r" (p[1]),
-#elif defined(__amd64__)
-   "=b" (p[1]),
-#else
-#error "Arch"
-#endif
-   "=c" (p[2]), "=d" (p[3])
-   :  "0" (leaf));
-}
-
-static void
 rdtsc_mb_lfence(void)
 {
 
@@ -100,12 +75,12 @@ rdtsc_mb_none(void)
 DEFINE_UIFUNC(static, void, rdtsc_mb, (void), static)
 {
u_int p[4];
-   /* Not a typo, string matches our cpuidp() registers use. */
+   /* Not a typo, string matches our do_cpuid() registers use. */
static const char intel_id[] = "GenuntelineI";
 
if ((cpu_feature & CPUID_SSE2) == 0)
return (rdtsc_mb_none);
-   cpuidp(0, p);
+   do_cpuid(0, p);
return (memcmp(p + 1, intel_id, sizeof(intel_id) - 1) == 0 ?
rdtsc_mb_lfence : rdtsc_mb_mfence);
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r344434 - stable/12/sys/i386/include

2019-02-21 Thread Konstantin Belousov
Author: kib
Date: Thu Feb 21 12:09:04 2019
New Revision: 344434
URL: https://svnweb.freebsd.org/changeset/base/344434

Log:
  MFC r344118:
  Provide userspace versions of do_cpuid() and cpuid_count() on i386.

Modified:
  stable/12/sys/i386/include/cpufunc.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/i386/include/cpufunc.h
==
--- stable/12/sys/i386/include/cpufunc.hThu Feb 21 10:35:32 2019
(r344433)
+++ stable/12/sys/i386/include/cpufunc.hThu Feb 21 12:09:04 2019
(r344434)
@@ -108,21 +108,47 @@ disable_intr(void)
__asm __volatile("cli" : : : "memory");
 }
 
+#ifdef _KERNEL
 static __inline void
 do_cpuid(u_int ax, u_int *p)
 {
__asm __volatile("cpuid"
-: "=a" (p[0]), "=b" (p[1]), "=c" (p[2]), "=d" (p[3])
-:  "0" (ax));
+   : "=a" (p[0]), "=b" (p[1]), "=c" (p[2]), "=d" (p[3])
+   :  "0" (ax));
 }
 
 static __inline void
 cpuid_count(u_int ax, u_int cx, u_int *p)
 {
__asm __volatile("cpuid"
-: "=a" (p[0]), "=b" (p[1]), "=c" (p[2]), "=d" (p[3])
-:  "0" (ax), "c" (cx));
+   : "=a" (p[0]), "=b" (p[1]), "=c" (p[2]), "=d" (p[3])
+   :  "0" (ax), "c" (cx));
 }
+#else
+static __inline void
+do_cpuid(u_int ax, u_int *p)
+{
+   __asm __volatile(
+   "pushl\t%%ebx\n\t"
+   "cpuid\n\t"
+   "movl\t%%ebx,%1\n\t"
+   "popl\t%%ebx"
+   : "=a" (p[0]), "=DS" (p[1]), "=c" (p[2]), "=d" (p[3])
+   :  "0" (ax));
+}
+
+static __inline void
+cpuid_count(u_int ax, u_int cx, u_int *p)
+{
+   __asm __volatile(
+   "pushl\t%%ebx\n\t"
+   "cpuid\n\t"
+   "movl\t%%ebx,%1\n\t"
+   "popl\t%%ebx"
+   : "=a" (p[0]), "=DS" (p[1]), "=c" (p[2]), "=d" (p[3])
+   :  "0" (ax), "c" (cx));
+}
+#endif
 
 static __inline void
 enable_intr(void)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r344433 - head/sys/netinet

2019-02-21 Thread Michael Tuexen
Author: tuexen
Date: Thu Feb 21 10:35:32 2019
New Revision: 344433
URL: https://svnweb.freebsd.org/changeset/base/344433

Log:
  The receive buffer autoscaling for TCP is based on a linear growth, which
  is acceptable in the congestion avoidance phase, but not during slow start.
  The MTU is is also not taken into account.
  Use a method instead, which is based on exponential growth working also in
  slow start and being independent from the MTU.
  
  This is joint work with rrs@.
  
  Reviewed by:  rrs@, Richard Scheffenegger
  Sponsored by: Netflix, Inc.
  Differential Revision:https://reviews.freebsd.org/D18375

Modified:
  head/sys/netinet/tcp_input.c

Modified: head/sys/netinet/tcp_input.c
==
--- head/sys/netinet/tcp_input.cThu Feb 21 10:11:15 2019
(r344432)
+++ head/sys/netinet/tcp_input.cThu Feb 21 10:35:32 2019
(r344433)
@@ -212,11 +212,6 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, recvbuf_auto, CTLF
 _NAME(tcp_do_autorcvbuf), 0,
 "Enable automatic receive buffer sizing");
 
-VNET_DEFINE(int, tcp_autorcvbuf_inc) = 16*1024;
-SYSCTL_INT(_net_inet_tcp, OID_AUTO, recvbuf_inc, CTLFLAG_VNET | CTLFLAG_RW,
-_NAME(tcp_autorcvbuf_inc), 0,
-"Incrementor step size of automatic receive buffer");
-
 VNET_DEFINE(int, tcp_autorcvbuf_max) = 2*1024*1024;
 SYSCTL_INT(_net_inet_tcp, OID_AUTO, recvbuf_max, CTLFLAG_VNET | CTLFLAG_RW,
 _NAME(tcp_autorcvbuf_max), 0,
@@ -1449,13 +1444,16 @@ drop:
  * The criteria to step up the receive buffer one notch are:
  *  1. Application has not set receive buffer size with
  * SO_RCVBUF. Setting SO_RCVBUF clears SB_AUTOSIZE.
- *  2. the number of bytes received during the time it takes
- * one timestamp to be reflected back to us (the RTT);
- *  3. received bytes per RTT is within seven eighth of the
- * current socket buffer size;
- *  4. receive buffer size has not hit maximal automatic size;
+ *  2. the number of bytes received during 1/2 of an sRTT
+ * is at least 3/8 of the current socket buffer size.
+ *  3. receive buffer size has not hit maximal automatic size;
  *
- * This algorithm does one step per RTT at most and only if
+ * If all of the criteria are met we increaset the socket buffer
+ * by a 1/2 (bounded by the max). This allows us to keep ahead
+ * of slow-start but also makes it so our peer never gets limited
+ * by our rwnd which we then open up causing a burst.
+ *
+ * This algorithm does two steps per RTT at most and only if
  * we receive a bulk stream w/o packet losses or reorderings.
  * Shrinking the buffer during idle times is not necessary as
  * it doesn't consume any memory when idle.
@@ -1472,11 +1470,10 @@ tcp_autorcvbuf(struct mbuf *m, struct tcphdr *th, stru
if (V_tcp_do_autorcvbuf && (so->so_rcv.sb_flags & SB_AUTOSIZE) &&
tp->t_srtt != 0 && tp->rfbuf_ts != 0 &&
TCP_TS_TO_TICKS(tcp_ts_getticks() - tp->rfbuf_ts) >
-   (tp->t_srtt >> TCP_RTT_SHIFT)) {
-   if (tp->rfbuf_cnt > (so->so_rcv.sb_hiwat / 8 * 7) &&
+   ((tp->t_srtt >> TCP_RTT_SHIFT)/2)) {
+   if (tp->rfbuf_cnt > ((so->so_rcv.sb_hiwat / 2)/ 4 * 3) &&
so->so_rcv.sb_hiwat < V_tcp_autorcvbuf_max) {
-   newsize = min(so->so_rcv.sb_hiwat +
-   V_tcp_autorcvbuf_inc, V_tcp_autorcvbuf_max);
+   newsize = min((so->so_rcv.sb_hiwat + 
(so->so_rcv.sb_hiwat/2)), V_tcp_autorcvbuf_max);
}
TCP_PROBE6(receive__autoresize, NULL, tp, m, tp, th, newsize);
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r344432 - in head: sys/kern tests/sys/kern

2019-02-21 Thread Andrew Turner
Author: andrew
Date: Thu Feb 21 10:11:15 2019
New Revision: 344432
URL: https://svnweb.freebsd.org/changeset/base/344432

Log:
  Allow the kcov buffer to be mmaped multiple times.
  
  After r344391 this restriction is no longer needed.
  
  Sponsored by: DARPA, AFRL

Modified:
  head/sys/kern/kern_kcov.c
  head/tests/sys/kern/kcov.c

Modified: head/sys/kern/kern_kcov.c
==
--- head/sys/kern/kern_kcov.c   Thu Feb 21 09:54:57 2019(r344431)
+++ head/sys/kern/kern_kcov.c   Thu Feb 21 10:11:15 2019(r344432)
@@ -127,7 +127,6 @@ struct kcov_info {
size_t  bufsize;/* (o) */
kcov_state_tstate;  /* (s) */
int mode;   /* (l) */
-   boolmmap;
 };
 
 /* Prototypes */
@@ -303,7 +302,6 @@ kcov_open(struct cdev *dev, int oflags, int devtype, s
info->state = KCOV_STATE_OPEN;
info->thread = NULL;
info->mode = -1;
-   info->mmap = false;
 
if ((error = devfs_set_cdevpriv(info, kcov_mmap_cleanup)) != 0)
kcov_mmap_cleanup(info);
@@ -344,12 +342,10 @@ kcov_mmap_single(struct cdev *dev, vm_ooffset_t *offse
if ((error = devfs_get_cdevpriv((void **))) != 0)
return (error);
 
-   if (info->kvaddr == 0 || size / KCOV_ELEMENT_SIZE != info->entries ||
-   info->mmap != false)
+   if (info->kvaddr == 0 || size / KCOV_ELEMENT_SIZE != info->entries)
return (EINVAL);
 
vm_object_reference(info->bufobj);
-   info->mmap = true;
*offset = 0;
*object = info->bufobj;
return (0);

Modified: head/tests/sys/kern/kcov.c
==
--- head/tests/sys/kern/kcov.c  Thu Feb 21 09:54:57 2019(r344431)
+++ head/tests/sys/kern/kcov.c  Thu Feb 21 10:11:15 2019(r344432)
@@ -80,7 +80,7 @@ ATF_TC_BODY(kcov_bufsize, tc)
 ATF_TC_WITHOUT_HEAD(kcov_mmap);
 ATF_TC_BODY(kcov_mmap, tc)
 {
-   void *data;
+   void *data1, *data2;
int fd;
 
fd = open_kcov();
@@ -95,12 +95,18 @@ ATF_TC_BODY(kcov_mmap, tc)
fd, 0) == MAP_FAILED);
ATF_CHECK(mmap(NULL, 3 * PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED,
fd, 0) == MAP_FAILED);
-   ATF_REQUIRE((data = mmap(NULL, 2 * PAGE_SIZE, PROT_READ | PROT_WRITE,
+   ATF_REQUIRE((data1 = mmap(NULL, 2 * PAGE_SIZE, PROT_READ | PROT_WRITE,
MAP_SHARED, fd, 0)) != MAP_FAILED);
-   ATF_CHECK(mmap(NULL, 2 * PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED,
-   fd, 0) == MAP_FAILED);
+   ATF_REQUIRE((data2 = mmap(NULL, 2 * PAGE_SIZE, PROT_READ | PROT_WRITE,
+   MAP_SHARED, fd, 0)) != MAP_FAILED);
 
-   munmap(data, 2 * PAGE_SIZE);
+   *(uint64_t *)data1 = 0x123456789abcdeful;
+   ATF_REQUIRE(*(uint64_t *)data2 == 0x123456789abcdefull);
+   *(uint64_t *)data2 = 0xfedcba9876543210ul;
+   ATF_REQUIRE(*(uint64_t *)data1 == 0xfedcba9876543210ull);
+
+   munmap(data1, 2 * PAGE_SIZE);
+   munmap(data2, 2 * PAGE_SIZE);
 
close(fd);
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r344430 - in stable: 11/sys/conf 11/sys/dev/ata 12/sys/conf 12/sys/dev/ata

2019-02-21 Thread Andriy Voskoboinyk
Author: avos
Date: Thu Feb 21 09:54:10 2019
New Revision: 344430
URL: https://svnweb.freebsd.org/changeset/base/344430

Log:
  MFC r344198:
  GC ATA_REQUEST_TIMEOUT option remnants
  
  It was removed from code in r249083 and from sys/conf/options in r249213.
  
  PR:   193935, 222170

Modified:
  stable/11/sys/conf/NOTES
  stable/11/sys/dev/ata/ata-all.h
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/12/sys/conf/NOTES
  stable/12/sys/dev/ata/ata-all.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/11/sys/conf/NOTES
==
--- stable/11/sys/conf/NOTESThu Feb 21 09:43:14 2019(r344429)
+++ stable/11/sys/conf/NOTESThu Feb 21 09:54:10 2019(r344430)
@@ -1785,14 +1785,6 @@ hint.ata.1.port="0x170"
 hint.ata.1.irq="15"
 
 #
-# The following options are valid on the ATA driver:
-#
-# ATA_REQUEST_TIMEOUT: the number of seconds to wait for an ATA request
-#  before timing out.
-
-#options   ATA_REQUEST_TIMEOUT=10
-
-#
 # Standard floppy disk controllers and floppy tapes, supports
 # the Y-E DATA External FDD (PC Card)
 #

Modified: stable/11/sys/dev/ata/ata-all.h
==
--- stable/11/sys/dev/ata/ata-all.h Thu Feb 21 09:43:14 2019
(r344429)
+++ stable/11/sys/dev/ata/ata-all.h Thu Feb 21 09:54:10 2019
(r344430)
@@ -207,10 +207,6 @@
 #define ATA_OP_FINISHED 1
 #define ATA_MAX_28BIT_LBA   268435455UL
 
-#ifndefATA_REQUEST_TIMEOUT
-#defineATA_REQUEST_TIMEOUT 10
-#endif
-
 /* structure used for composite atomic operations */
 #define MAX_COMPOSITES  32  /* u_int32_t bits */
 struct ata_composite {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r344430 - in stable: 11/sys/conf 11/sys/dev/ata 12/sys/conf 12/sys/dev/ata

2019-02-21 Thread Andriy Voskoboinyk
Author: avos
Date: Thu Feb 21 09:54:10 2019
New Revision: 344430
URL: https://svnweb.freebsd.org/changeset/base/344430

Log:
  MFC r344198:
  GC ATA_REQUEST_TIMEOUT option remnants
  
  It was removed from code in r249083 and from sys/conf/options in r249213.
  
  PR:   193935, 222170

Modified:
  stable/12/sys/conf/NOTES
  stable/12/sys/dev/ata/ata-all.h
Directory Properties:
  stable/12/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/sys/conf/NOTES
  stable/11/sys/dev/ata/ata-all.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/12/sys/conf/NOTES
==
--- stable/12/sys/conf/NOTESThu Feb 21 09:43:14 2019(r344429)
+++ stable/12/sys/conf/NOTESThu Feb 21 09:54:10 2019(r344430)
@@ -1813,14 +1813,6 @@ hint.ata.1.port="0x170"
 hint.ata.1.irq="15"
 
 #
-# The following options are valid on the ATA driver:
-#
-# ATA_REQUEST_TIMEOUT: the number of seconds to wait for an ATA request
-#  before timing out.
-
-#options   ATA_REQUEST_TIMEOUT=10
-
-#
 # Standard floppy disk controllers and floppy tapes, supports
 # the Y-E DATA External FDD (PC Card)
 #

Modified: stable/12/sys/dev/ata/ata-all.h
==
--- stable/12/sys/dev/ata/ata-all.h Thu Feb 21 09:43:14 2019
(r344429)
+++ stable/12/sys/dev/ata/ata-all.h Thu Feb 21 09:54:10 2019
(r344430)
@@ -203,10 +203,6 @@
 #define ATA_OP_FINISHED 1
 #define ATA_MAX_28BIT_LBA   268435455UL
 
-#ifndefATA_REQUEST_TIMEOUT
-#defineATA_REQUEST_TIMEOUT 10
-#endif
-
 /* structure used for composite atomic operations */
 #define MAX_COMPOSITES  32  /* u_int32_t bits */
 struct ata_composite {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r344431 - in stable/10/sys: conf dev/ata

2019-02-21 Thread Andriy Voskoboinyk
Author: avos
Date: Thu Feb 21 09:54:57 2019
New Revision: 344431
URL: https://svnweb.freebsd.org/changeset/base/344431

Log:
  MFC r344198:
  GC ATA_REQUEST_TIMEOUT option remnants
  
  It was removed from code in r249083 and from sys/conf/options in r249213.
  
  PR:   193935, 222170

Modified:
  stable/10/sys/conf/NOTES
  stable/10/sys/dev/ata/ata-all.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/conf/NOTES
==
--- stable/10/sys/conf/NOTESThu Feb 21 09:54:10 2019(r344430)
+++ stable/10/sys/conf/NOTESThu Feb 21 09:54:57 2019(r344431)
@@ -1765,11 +1765,8 @@ hint.ata.1.irq="15"
 #
 # ATA_STATIC_ID:   controller numbering is static ie depends on location
 #  else the device numbers are dynamically allocated.
-# ATA_REQUEST_TIMEOUT: the number of seconds to wait for an ATA request
-#  before timing out.
 
 optionsATA_STATIC_ID
-#options   ATA_REQUEST_TIMEOUT=10
 
 #
 # Standard floppy disk controllers and floppy tapes, supports

Modified: stable/10/sys/dev/ata/ata-all.h
==
--- stable/10/sys/dev/ata/ata-all.h Thu Feb 21 09:54:10 2019
(r344430)
+++ stable/10/sys/dev/ata/ata-all.h Thu Feb 21 09:54:57 2019
(r344431)
@@ -207,10 +207,6 @@
 #define ATA_OP_FINISHED 1
 #define ATA_MAX_28BIT_LBA   268435455UL
 
-#ifndefATA_REQUEST_TIMEOUT
-#defineATA_REQUEST_TIMEOUT 10
-#endif
-
 /* structure used for composite atomic operations */
 #define MAX_COMPOSITES  32  /* u_int32_t bits */
 struct ata_composite {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r344429 - head/tests/sys/kern

2019-02-21 Thread Andrew Turner
Author: andrew
Date: Thu Feb 21 09:43:14 2019
New Revision: 344429
URL: https://svnweb.freebsd.org/changeset/base/344429

Log:
  Use KCOV_ENTRY_SIZE for the entry size.
  
  Previously it was sizeof(uint64_t). While this is currently true, it may
  not be on all future architectures.
  
  Sponsored by: DARPA, AFRL

Modified:
  head/tests/sys/kern/kcov.c

Modified: head/tests/sys/kern/kcov.c
==
--- head/tests/sys/kern/kcov.c  Thu Feb 21 09:34:47 2019(r344428)
+++ head/tests/sys/kern/kcov.c  Thu Feb 21 09:43:14 2019(r344429)
@@ -89,7 +89,7 @@ ATF_TC_BODY(kcov_mmap, tc)
fd, 0) == MAP_FAILED);
 
ATF_REQUIRE(ioctl(fd, KIOSETBUFSIZE,
-   2 * PAGE_SIZE / sizeof(uint64_t)) == 0);
+   2 * PAGE_SIZE / KCOV_ENTRY_SIZE) == 0);
 
ATF_CHECK(mmap(NULL, PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED,
fd, 0) == MAP_FAILED);
@@ -113,7 +113,7 @@ ATF_TC_BODY(kcov_mmap_no_munmap, tc)
 
fd = open_kcov();
 
-   ATF_REQUIRE(ioctl(fd, KIOSETBUFSIZE, PAGE_SIZE / sizeof(uint64_t)) ==0);
+   ATF_REQUIRE(ioctl(fd, KIOSETBUFSIZE, PAGE_SIZE / KCOV_ENTRY_SIZE) == 0);
 
ATF_CHECK(mmap(NULL, PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED,
fd, 0) != MAP_FAILED);
@@ -128,7 +128,7 @@ ATF_TC_BODY(kcov_mmap_no_munmap_no_close, tc)
 
fd = open_kcov();
 
-   ATF_REQUIRE(ioctl(fd, KIOSETBUFSIZE, PAGE_SIZE / sizeof(uint64_t)) ==0);
+   ATF_REQUIRE(ioctl(fd, KIOSETBUFSIZE, PAGE_SIZE / KCOV_ENTRY_SIZE) == 0);
 
ATF_CHECK(mmap(NULL, PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED,
fd, 0) != MAP_FAILED);
@@ -144,7 +144,7 @@ kcov_mmap_enable_thread(void *data)
fd = open_kcov();
*(int *)data = fd;
 
-   ATF_REQUIRE(ioctl(fd, KIOSETBUFSIZE, PAGE_SIZE / sizeof(uint64_t)) ==0);
+   ATF_REQUIRE(ioctl(fd, KIOSETBUFSIZE, PAGE_SIZE / KCOV_ENTRY_SIZE) == 0);
ATF_CHECK(mmap(NULL, PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED,
fd, 0) != MAP_FAILED);
ATF_CHECK(ioctl(fd, KIOENABLE, KCOV_MODE_TRACE_PC) == 0);
@@ -180,7 +180,7 @@ ATF_TC_BODY(kcov_enable, tc)
 
ATF_CHECK(ioctl(fd, KIOENABLE, KCOV_MODE_TRACE_PC) == -1);
 
-   ATF_REQUIRE(ioctl(fd, KIOSETBUFSIZE, PAGE_SIZE / sizeof(uint64_t)) ==0);
+   ATF_REQUIRE(ioctl(fd, KIOSETBUFSIZE, PAGE_SIZE / KCOV_ENTRY_SIZE) == 0);
 
/* We need to enable before disable */
ATF_CHECK(ioctl(fd, KIODISABLE, 0) == -1);
@@ -208,7 +208,7 @@ ATF_TC_BODY(kcov_enable_no_disable, tc)
int fd;
 
fd = open_kcov();
-   ATF_REQUIRE(ioctl(fd, KIOSETBUFSIZE, PAGE_SIZE / sizeof(uint64_t)) ==0);
+   ATF_REQUIRE(ioctl(fd, KIOSETBUFSIZE, PAGE_SIZE / KCOV_ENTRY_SIZE) == 0);
ATF_CHECK(ioctl(fd, KIOENABLE, KCOV_MODE_TRACE_PC) == 0);
close(fd);
 }
@@ -219,7 +219,7 @@ ATF_TC_BODY(kcov_enable_no_disable_no_close, tc)
int fd;
 
fd = open_kcov();
-   ATF_REQUIRE(ioctl(fd, KIOSETBUFSIZE, PAGE_SIZE / sizeof(uint64_t)) ==0);
+   ATF_REQUIRE(ioctl(fd, KIOSETBUFSIZE, PAGE_SIZE / KCOV_ENTRY_SIZE) == 0);
ATF_CHECK(ioctl(fd, KIOENABLE, KCOV_MODE_TRACE_PC) == 0);
 }
 
@@ -232,7 +232,7 @@ common_head(int *fdp)
fd = open_kcov();
 
ATF_REQUIRE_MSG(ioctl(fd, KIOSETBUFSIZE,
-   PAGE_SIZE / sizeof(uint64_t)) == 0,
+   PAGE_SIZE / KCOV_ENTRY_SIZE) == 0,
"Unable to set the kcov buffer size");
 
data = mmap(NULL, PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r344428 - head/sys/netinet

2019-02-21 Thread Michael Tuexen
Author: tuexen
Date: Thu Feb 21 09:34:47 2019
New Revision: 344428
URL: https://svnweb.freebsd.org/changeset/base/344428

Log:
  This patch addresses an issue brought up by bz@ in D18968:
  When TCP_REASS_LOGGING is defined, a NULL pointer dereference would happen,
  if user data was received during the TCP handshake and BB logging is used.
  
  A KASSERT is also added to detect tcp_reass() calls with illegal parameter
  combinations.
  
  Reported by:  bz@
  Reviewed by:  rrs@
  MFC after:3 days
  Sponsored by: Netflix, Inc.
  Differential Revision:https://reviews.freebsd.org/D19254

Modified:
  head/sys/netinet/tcp_reass.c

Modified: head/sys/netinet/tcp_reass.c
==
--- head/sys/netinet/tcp_reass.cThu Feb 21 08:37:39 2019
(r344427)
+++ head/sys/netinet/tcp_reass.cThu Feb 21 09:34:47 2019
(r344428)
@@ -542,6 +542,10 @@ tcp_reass(struct tcpcb *tp, struct tcphdr *th, tcp_seq
 * and should be rewritten (see NetBSD for optimizations).
 */
 
+   KASSERT(th == NULL || (seq_start != NULL && tlenp != NULL),
+   ("tcp_reass called with illegal parameter combination "
+"(tp=%p, th=%p, seq_start=%p, tlenp=%p, m=%p)",
+tp, th, seq_start, tlenp, m));
/*
 * Call with th==NULL after become established to
 * force pre-ESTABLISHED data up to user socket.
@@ -1062,12 +1066,20 @@ present:
} else {
 #ifdef TCP_REASS_LOGGING
tcp_reass_log_new_in(tp, q->tqe_start, q->tqe_len, 
q->tqe_m, TCP_R_LOG_READ, q);
-   tcp_log_reassm(tp, q, NULL, th->th_seq, *tlenp, 
TCP_R_LOG_READ, 1);
+   if (th != NULL) {
+   tcp_log_reassm(tp, q, NULL, th->th_seq, *tlenp, 
TCP_R_LOG_READ, 1);
+   } else {
+   tcp_log_reassm(tp, q, NULL, 0, 0, 
TCP_R_LOG_READ, 1);
+   }
 #endif
sbappendstream_locked(>so_rcv, q->tqe_m, 0);
}
 #ifdef TCP_REASS_LOGGING
-   tcp_log_reassm(tp, q, NULL, th->th_seq, *tlenp, TCP_R_LOG_READ, 
2);
+   if (th != NULL) {
+   tcp_log_reassm(tp, q, NULL, th->th_seq, *tlenp, 
TCP_R_LOG_READ, 2);
+   } else {
+   tcp_log_reassm(tp, q, NULL, 0, 0, TCP_R_LOG_READ, 2);
+   }
 #endif
KASSERT(tp->t_segqmbuflen >= q->tqe_mbuf_cnt,
("tp:%p seg queue goes negative", tp));
@@ -1083,7 +1095,11 @@ present:
  tp, >t_segq, tp->t_segqmbuflen);
 #else
 #ifdef TCP_REASS_LOGGING
-   tcp_log_reassm(tp, NULL, NULL, th->th_seq, *tlenp, 
TCP_R_LOG_ZERO, 0);
+   if (th != NULL) {
+   tcp_log_reassm(tp, NULL, NULL, th->th_seq, *tlenp, 
TCP_R_LOG_ZERO, 0);
+   } else {
+   tcp_log_reassm(tp, NULL, NULL, 0, 0, TCP_R_LOG_ZERO, 0);
+   }
 #endif
tp->t_segqmbuflen = 0;
 #endif
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r344368 - head/sys/netinet

2019-02-21 Thread Michael Tuexen
> On 21. Feb 2019, at 09:32, Kubilay Kocak  wrote:
> 
> On 21/02/2019 5:03 am, Michael Tuexen wrote:
>> Author: tuexen
>> Date: Wed Feb 20 18:03:43 2019
>> New Revision: 344368
>> URL: https://svnweb.freebsd.org/changeset/base/344368
>> Log:
>>   Reduce the TCP initial retransmission timeout from 3 seconds to
>>   1 second as allowed by RFC 6298.
>>  Reviewed by:kbowling@, Richard Scheffenegger
>>   Sponsored by:  Netflix, Inc.
>>   Differential Revision: https://reviews.freebsd.org/D18941
>> Modified:
>>   head/sys/netinet/tcp_syncache.c
>>   head/sys/netinet/tcp_timer.h
>> Modified: head/sys/netinet/tcp_syncache.c
>> ==
>> --- head/sys/netinet/tcp_syncache.c  Wed Feb 20 17:56:38 2019
>> (r344367)
>> +++ head/sys/netinet/tcp_syncache.c  Wed Feb 20 18:03:43 2019
>> (r344368)
>> @@ -159,7 +159,7 @@ static intsyncookie_cmp(struct in_conninfo *inc, 
>> str
>>   *  tcp_backoff[1] +
>>   *  tcp_backoff[2] +
>>   *  tcp_backoff[3]) + 3 * tcp_rexmit_slop,
>> - * 3000 ms * (1 + 2 + 4 + 8) +  3 * 200 ms = 45600 ms,
>> + * 1000 ms * (1 + 2 + 4 + 8) +  3 * 200 ms = 15600 ms,
>>   * the odds are that the user has given up attempting to connect by then.
>>   */
>>  #define SYNCACHE_MAXREXMTS  3
>> Modified: head/sys/netinet/tcp_timer.h
>> ==
>> --- head/sys/netinet/tcp_timer.h Wed Feb 20 17:56:38 2019
>> (r344367)
>> +++ head/sys/netinet/tcp_timer.h Wed Feb 20 18:03:43 2019
>> (r344368)
>> @@ -77,7 +77,7 @@
>>  #define TCPTV_MSL   ( 30*hz)/* max seg lifetime 
>> (hah!) */
>>  #define TCPTV_SRTTBASE  0   /* base roundtrip time;
>> if 0, no idea yet */
>> -#define TCPTV_RTOBASE   (  3*hz)/* assumed RTO if no 
>> info */
>> +#define TCPTV_RTOBASE   (  1*hz)/* assumed RTO if no 
>> info */
>>#define   TCPTV_PERSMIN   (  5*hz)/* minimum persist 
>> interval */
>>  #define TCPTV_PERSMAX   ( 60*hz)/* maximum persist 
>> interval */
>> ___
> 
> Any way this can be a run-time tunable?
That is definitely possible. However, changing the default should be separate
from making it sysctl-able.

I'll bring this up in the bi-weekly transport call and see what others think.

Best regards
Michael
> 

___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r344427 - head/sys/dev/syscons

2019-02-21 Thread Bruce Evans
Author: bde
Date: Thu Feb 21 08:37:39 2019
New Revision: 344427
URL: https://svnweb.freebsd.org/changeset/base/344427

Log:
  Restore syscons' terminal emulators.  The trivial fixes to make them compile
  will be committed later.
  
  The "sc" emulator has the advantages of full support for cons25 and running
  about 8 times faster than teken (for writing to the frame buffer).
  
  The "dumb" emulator has the advantage of being simple.
  
  Runtime choice of the emulator is good, but compile time choice is bad.

Added:
 - copied unchanged from r186680, head/sys/dev/syscons/scterm-dumb.c
 - copied unchanged from r186680, head/sys/dev/syscons/scterm-sc.c
 - copied unchanged from r186680, head/sys/dev/syscons/sctermvar.h
Directory Properties:
  head/sys/dev/syscons/scterm-dumb.c   (props changed)
  head/sys/dev/syscons/scterm-sc.c   (props changed)
  head/sys/dev/syscons/sctermvar.h   (props changed)

Copied: head/sys/dev/syscons/scterm-dumb.c (from r186680, 
head/sys/dev/syscons/scterm-dumb.c)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/syscons/scterm-dumb.c  Thu Feb 21 08:37:39 2019
(r344427, copy of r186680, head/sys/dev/syscons/scterm-dumb.c)
@@ -0,0 +1,155 @@
+/*-
+ * Copyright (c) 1999 Kazutaka YOKOTA 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer as
+ *the first lines of this file unmodified.
+ * 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 AUTHORS ``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 AUTHORS 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.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include "opt_syscons.h"
+
+#include 
+#include 
+#include 
+
+#if defined(__sparc64__) || defined(__powerpc__)
+#include 
+#else
+#include 
+#endif
+
+#include 
+#include 
+
+#ifdef SC_DUMB_TERMINAL
+
+/* dumb terminal emulator */
+
+static sc_term_init_t  dumb_init;
+static sc_term_term_t  dumb_term;
+static sc_term_puts_t  dumb_puts;
+static sc_term_ioctl_t dumb_ioctl;
+static sc_term_clear_t dumb_clear;
+static sc_term_input_t dumb_input;
+static voiddumb_nop(void);
+
+static sc_term_sw_t sc_term_dumb = {
+   { NULL, NULL },
+   "dumb", /* emulator name */
+   "dumb terminal",/* description */
+   "*",/* matching renderer */
+   0,  /* softc size */
+   0,
+   dumb_init,
+   dumb_term,
+   dumb_puts,
+   dumb_ioctl,
+   (sc_term_reset_t *)dumb_nop,
+   (sc_term_default_attr_t *)dumb_nop,
+   dumb_clear,
+   (sc_term_notify_t *)dumb_nop,
+   dumb_input,
+};
+
+SCTERM_MODULE(dumb, sc_term_dumb);
+
+static int
+dumb_init(scr_stat *scp, void **softc, int code)
+{
+   switch (code) {
+   case SC_TE_COLD_INIT:
+   ++sc_term_dumb.te_refcount;
+   break;
+   case SC_TE_WARM_INIT:
+   break;
+   }
+   return 0;
+}
+
+static int
+dumb_term(scr_stat *scp, void **softc)
+{
+   --sc_term_dumb.te_refcount;
+   return 0;
+}
+
+static void
+dumb_puts(scr_stat *scp, u_char *buf, int len)
+{
+   while (len > 0) {
+   ++scp->sc->write_in_progress;
+   sc_term_gen_print(scp, , , SC_NORM_ATTR << 8);
+   sc_term_gen_scroll(scp, scp->sc->scr_map[0x20],
+  SC_NORM_ATTR << 8);
+   --scp->sc->write_in_progress;
+   }
+}
+
+static int
+dumb_ioctl(scr_stat *scp, struct tty *tp, u_long cmd, caddr_t data,
+  int flag, struct proc *p)
+{
+   vid_info_t *vi;
+
+   switch (cmd) {
+   case GIO_ATTR:  /* get current attributes */
+   *(int*)data = SC_NORM_ATTR;
+   return 0;
+   case CONS_GETINFO:  /* get current (virtual) console info */
+   vi = 

Re: svn commit: r344368 - head/sys/netinet

2019-02-21 Thread Kubilay Kocak

On 21/02/2019 5:03 am, Michael Tuexen wrote:

Author: tuexen
Date: Wed Feb 20 18:03:43 2019
New Revision: 344368
URL: https://svnweb.freebsd.org/changeset/base/344368

Log:
   Reduce the TCP initial retransmission timeout from 3 seconds to
   1 second as allowed by RFC 6298.
   
   Reviewed by:		kbowling@, Richard Scheffenegger

   Sponsored by:Netflix, Inc.
   Differential Revision:   https://reviews.freebsd.org/D18941

Modified:
   head/sys/netinet/tcp_syncache.c
   head/sys/netinet/tcp_timer.h

Modified: head/sys/netinet/tcp_syncache.c
==
--- head/sys/netinet/tcp_syncache.c Wed Feb 20 17:56:38 2019
(r344367)
+++ head/sys/netinet/tcp_syncache.c Wed Feb 20 18:03:43 2019
(r344368)
@@ -159,7 +159,7 @@ static int   syncookie_cmp(struct in_conninfo *inc, str
   *  tcp_backoff[1] +
   *  tcp_backoff[2] +
   *  tcp_backoff[3]) + 3 * tcp_rexmit_slop,
- * 3000 ms * (1 + 2 + 4 + 8) +  3 * 200 ms = 45600 ms,
+ * 1000 ms * (1 + 2 + 4 + 8) +  3 * 200 ms = 15600 ms,
   * the odds are that the user has given up attempting to connect by then.
   */
  #define SYNCACHE_MAXREXMTS3

Modified: head/sys/netinet/tcp_timer.h
==
--- head/sys/netinet/tcp_timer.hWed Feb 20 17:56:38 2019
(r344367)
+++ head/sys/netinet/tcp_timer.hWed Feb 20 18:03:43 2019
(r344368)
@@ -77,7 +77,7 @@
  #define   TCPTV_MSL   ( 30*hz)/* max seg lifetime 
(hah!) */
  #define   TCPTV_SRTTBASE  0   /* base roundtrip time;
   if 0, no idea yet */
-#defineTCPTV_RTOBASE   (  3*hz)/* assumed RTO if no 
info */
+#defineTCPTV_RTOBASE   (  1*hz)/* assumed RTO if no 
info */
  
  #define	TCPTV_PERSMIN	(  5*hz)		/* minimum persist interval */

  #define   TCPTV_PERSMAX   ( 60*hz)/* maximum persist 
interval */
___


Any way this can be a run-time tunable?

___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"