Re: svn commit: r365984 - head/usr.bin/calendar/calendars

2020-09-22 Thread Andriy Gapon
On 22/09/2020 23:40, Scott Long wrote:
> Second, there’s a vibe in parts of this thread that are passive-aggressively
> disrespectful to Greg.  I encourage those who might feel some personal
> frustration towards Greg to talk to him directly.  The Core team can help with
> that communication if needed.  Otherwise, it’s not not appropriate and not
> welcome on the mailing lists.  If you don’t feel it’s important enough to
> resolve in a professional manner, then please keep it to yourself.

That was me.
I apologized to Greg directly.  And I want to do the same in public.
It was inappropriate.  I apologize.

-- 
Andriy Gapon
___
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: r366063 - head/sys/powerpc/ofw

2020-09-22 Thread Brandon Bergren
Author: bdragon
Date: Wed Sep 23 04:09:02 2020
New Revision: 366063
URL: https://svnweb.freebsd.org/changeset/base/366063

Log:
  [PowerPC64LE] Fix RTAS LE calls in pseries.
  
  Similar to OPAL calls, switch to big endian to do calls to RTAS.
  
  (Missed this one when I was doing the bulk commit of PowerPC64LE support.)
  
  Sponsored by: Tag1 Consulting, Inc.

Modified:
  head/sys/powerpc/ofw/ofwcall64.S
  head/sys/powerpc/ofw/rtas.c

Modified: head/sys/powerpc/ofw/ofwcall64.S
==
--- head/sys/powerpc/ofw/ofwcall64.SWed Sep 23 03:19:20 2020
(r366062)
+++ head/sys/powerpc/ofw/ofwcall64.SWed Sep 23 04:09:02 2020
(r366063)
@@ -296,9 +296,29 @@ ASENTRY_NOPROF(rtascall)
std %r6,16(%r1) /* Save MSR */
std %r9,24(%r1) /* Save reference PC for high 32 bits */
 
+#ifdef __LITTLE_ENDIAN__
+   /* Atomic context switch w/ endian change */
+   li  %r7, 0
+   mtmsrd  %r7, 1  /* Clear PSL_EE|PSL_RI */
+   addis   %r7,%r2,TOC_REF(rtasmsr)@ha
+   ld  %r7,TOC_REF(rtasmsr)@l(%r7)
+   ld  %r7,0(%r7)
+   mtsrr0  %r5
+   mtsrr1  %r7
+   LOAD_LR_NIA
+1:
+   mflr%r5
+   addi%r5, %r5, (2f-1b)
+   mtlr%r5
+   li  %r5, 0
+   rfid
+2:
+   RETURN_TO_NATIVE_ENDIAN
+#else
/* Finally, branch to RTAS */
mtctr   %r5
bctrl
+#endif
 
/* 
 * Reload stack pointer, MSR, reg PC from the reg save area in r1. We

Modified: head/sys/powerpc/ofw/rtas.c
==
--- head/sys/powerpc/ofw/rtas.c Wed Sep 23 03:19:20 2020(r366062)
+++ head/sys/powerpc/ofw/rtas.c Wed Sep 23 04:09:02 2020(r366063)
@@ -29,6 +29,7 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include 
 #include 
 #include 
 #include 
@@ -90,7 +91,7 @@ rtas_setup(void *junk)
 
/* RTAS must be called with everything turned off in MSR */
rtasmsr = mfmsr();
-   rtasmsr &= ~(PSL_IR | PSL_DR | PSL_EE | PSL_SE);
+   rtasmsr &= ~(PSL_IR | PSL_DR | PSL_EE | PSL_SE | PSL_LE);
#ifdef __powerpc64__
rtasmsr &= ~PSL_SF;
#endif
@@ -215,17 +216,17 @@ rtas_call_method(cell_t token, int nargs, int nreturns
if (!rtas_exists() || nargs + nreturns > 12)
return (-1);
 
-   args.token = token;
+   args.token = htobe32(token);
va_start(ap, nreturns);
 
mtx_lock_spin(_mtx);
rtas_bounce_offset = 0;
 
-   args.nargs = nargs;
-   args.nreturns = nreturns;
+   args.nargs = htobe32(nargs);
+   args.nreturns = htobe32(nreturns);
 
for (n = 0; n < nargs; n++)
-   args.args_n_results[n] = va_arg(ap, cell_t);
+   args.args_n_results[n] = htobe32(va_arg(ap, cell_t));
 
argsptr = rtas_real_map(, sizeof(args));
 
@@ -250,7 +251,7 @@ rtas_call_method(cell_t token, int nargs, int nreturns
return (result);
 
for (n = nargs; n < nargs + nreturns; n++)
-   *va_arg(ap, cell_t *) = args.args_n_results[n];
+   *va_arg(ap, cell_t *) = be32toh(args.args_n_results[n]);
return (result);
 }
 
___
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: r366062 - head/sys/sys

2020-09-22 Thread Brandon Bergren
Author: bdragon
Date: Wed Sep 23 03:19:20 2020
New Revision: 366062
URL: https://svnweb.freebsd.org/changeset/base/366062

Log:
  __FreeBSD_version bump for introduction of the powerpc64le arch.
  
  Although this is technically not a breaking change, I believe it is best
  to have a fresh version to use to define where the starting point was
  here.

Modified:
  head/sys/sys/param.h

Modified: head/sys/sys/param.h
==
--- head/sys/sys/param.hWed Sep 23 03:12:58 2020(r366061)
+++ head/sys/sys/param.hWed Sep 23 03:19:20 2020(r366062)
@@ -60,7 +60,7 @@
  * in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1300115  /* Master, propagated to newvers */
+#define __FreeBSD_version 1300116  /* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
___
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: r366061 - head/share/man/man7

2020-09-22 Thread Brandon Bergren
Author: bdragon
Date: Wed Sep 23 03:12:58 2020
New Revision: 366061
URL: https://svnweb.freebsd.org/changeset/base/366061

Log:
  arch(7): PowerPC64LE architecture definition
  
  Document the new powerpc64le arch's initial specifications.
  
  Certain things are subject to change while this is experimental. The most
  likely change is that long double may switch to quad, dependent on POWER8
  emulation assistance for __float128 being set up in the compiler (as
  POWER8 does not have IEEE-compatible 128-bit hardware float, unlike POWER9.)
  
  Sponsored by: Tag1 Consulting, Inc.

Modified:
  head/share/man/man7/arch.7

Modified: head/share/man/man7/arch.7
==
--- head/share/man/man7/arch.7  Wed Sep 23 03:02:45 2020(r366060)
+++ head/share/man/man7/arch.7  Wed Sep 23 03:12:58 2020(r366061)
@@ -26,7 +26,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 23, 2020
+.Dd September 22, 2020
 .Dt ARCH 7
 .Os
 .Sh NAME
@@ -110,6 +110,7 @@ architectures, the final release.
 .It powerpc Ta 6.0
 .It powerpcspe  Ta 12.0
 .It powerpc64   Ta 6.0
+.It powerpc64le Ta 13.0
 .It riscv64 Ta 12.0
 .It riscv64sf   Ta 12.0
 .It sparc64 Ta 5.0   Ta 12.x
@@ -206,6 +207,7 @@ Machine-dependent type sizes:
 .It powerpc Ta 4 Ta  8 Ta 8
 .It powerpcspe  Ta 4 Ta  8 Ta 8
 .It powerpc64   Ta 8 Ta  8 Ta 8
+.It powerpc64le Ta 8 Ta  8 Ta 8
 .It riscv64 Ta 8 Ta 16 Ta 8
 .It riscv64sf   Ta 8 Ta 16 Ta 8
 .El
@@ -232,6 +234,7 @@ is 8 bytes on all supported architectures except i386.
 .It powerpc Ta bigTa unsigned
 .It powerpcspe  Ta bigTa unsigned
 .It powerpc64   Ta bigTa unsigned
+.It powerpc64le Ta little Ta unsigned
 .It riscv64 Ta little Ta   signed
 .It riscv64sf   Ta little Ta   signed
 .El
@@ -255,6 +258,7 @@ is 8 bytes on all supported architectures except i386.
 .It powerpc Ta 4K
 .It powerpcspe  Ta 4K
 .It powerpc64   Ta 4K
+.It powerpc64le Ta 4K
 .It riscv64 Ta 4K, 2M, 1G
 .It riscv64sf   Ta 4K, 2M, 1G
 .El
@@ -278,6 +282,7 @@ is 8 bytes on all supported architectures except i386.
 .It powerpc Ta hard Ta hard, double precision
 .It powerpcspe  Ta hard Ta hard, double precision
 .It powerpc64   Ta hard Ta hard, double precision
+.It powerpc64le Ta hard Ta hard, double precision
 .It riscv64 Ta hard Ta hard, quad precision
 .It riscv64sf   Ta soft Ta soft, quad precision
 .El
@@ -311,7 +316,7 @@ or similar things like boot sequences.
 .It arm Ta arm Ta armv6, armv7
 .It i386 Ta i386 Ta i386
 .It mips Ta mips Ta mips, mipsel, mips64, mips64el, mipshf, mipselhf, 
mips64elhf, mipsn32
-.It powerpc Ta powerpc Ta powerpc, powerpcspe, powerpc64
+.It powerpc Ta powerpc Ta powerpc, powerpcspe, powerpc64, powerpc64le
 .It riscv Ta riscv Ta riscv64, riscv64sf
 .El
 .Ss Predefined Macros
@@ -356,6 +361,7 @@ Architecture-specific macros:
 .It powerpc Ta Dv __powerpc__
 .It powerpcspe  Ta Dv __powerpc__ , Dv __SPE__
 .It powerpc64   Ta Dv __powerpc__ , Dv __powerpc64__
+.It powerpc64le Ta Dv __powerpc__ , Dv __powerpc64__
 .It riscv64 Ta Dv __riscv , Dv __riscv_xlen == 64
 .It riscv64sf   Ta Dv __riscv , Dv __riscv_xlen == 64 , Dv 
__riscv_float_abi_soft
 .El
___
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: r366060 - head/bin/cp/tests

2020-09-22 Thread Kyle Evans
Author: kevans
Date: Wed Sep 23 03:02:45 2020
New Revision: 366060
URL: https://svnweb.freebsd.org/changeset/base/366060

Log:
  cp: tests: fix weird 20 insertion
  
  This slipped in at the last moment. =(

Modified:
  head/bin/cp/tests/cp_test.sh

Modified: head/bin/cp/tests/cp_test.sh
==
--- head/bin/cp/tests/cp_test.shWed Sep 23 03:01:14 2020
(r366059)
+++ head/bin/cp/tests/cp_test.shWed Sep 23 03:02:45 2020
(r366060)
@@ -30,7 +30,8 @@ check_size()
 {
file=$1
sz=$2
-20atf_check -o inline:"$sz\n" stat -f '%z' $file
+
+   atf_check -o inline:"$sz\n" stat -f '%z' $file
 }
 
 atf_test_case basic
___
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: r365643 - head/bin/cp

2020-09-22 Thread Warner Losh
I already committed... There's no need for a special upgrade process...

Warner

On Tue, Sep 22, 2020 at 8:59 PM Alan Somers  wrote:

> Go ahead and commit.  Consider it reviewed by me.  And if I understand
> correctly, this commit means there's no need for a special updating
> procedure, right?
>
> On Tue, Sep 22, 2020 at 6:55 PM Warner Losh  wrote:
>
>>
>>
>> On Tue, Sep 22, 2020 at 5:17 PM Kyle Evans  wrote:
>>
>>> On Tue, Sep 22, 2020, 17:02 Warner Losh  wrote:
>>>


 On Tue, Sep 22, 2020 at 3:55 PM Kyle Evans  wrote:

> On Tue, Sep 22, 2020 at 4:53 PM Ian Lepore  wrote:
> >
> > On Tue, 2020-09-22 at 15:50 -0600, Warner Losh wrote:
> > > I think it's a great leap sideways, but I've done cp /dev/null foo
> to
> > > clear
> > > it out for 35 years now... It's why it feels like a workaround.
> > >
> > > Though it is a legit optimization, no matter the feelings. As for
> > > clearer,
> > > I'm less sure since then I have to remember what the : operator
> does.
> > >
> > > Warner
> > >
> >
> > For me, :> is idiomatic (but ugly).
> >
> > On the other hand, the cp /dev/null had a nice dogfooding aspect to
> > it... when we broke cp by accident, its use in the build system was
> the
> > first alarm to go off.
> >
> > --Ian
> >
>
> To be honest, this is a case that really should be covered by
> regression tests somewhere.
>

 It should (but isn't yet).

 Ian is right for old-school FreeBSD thinking. In that thinking the
 build system should use an eclectic mix of tools to act as a fire-wall
 against accidental breakage.

 Complete, effective, test suites give much better coverage... if they
 are run...

 So until we run tests frequently, with loud regression squawking that's
 as effective as build breakage, I tend to fall in the 'all of the above'
 camp until that's in place... :)

 Warner

 P.S. though not, if I suppose, if it means that we're slowing down the
 regression coverage uptake...

>>>
>>> --
>>>
>>> The test build was fine, please confirm if I can commit it or if someone
>>> else would like to write the UPDATING notice or start bootstrapping cp on
>>> systems that were affected. I'm not comfortable with not taking any path at
>>> all here, but this is a lot of friction for a small mechanical change to
>>> ease the pain.
>>>
>>
>> Sorry if I wasn't clear: I'm not objecting to the quick mechanical change
>> so much as complaining that I wish we had better test coverage. Don't let
>> that stop you from doing what's right (or I can if you'd like).
>>
>> Warner
>>
>
___
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: r365643 - head/bin/cp

2020-09-22 Thread Kyle Evans
Correct- we're good now. Thanks!

On Tue, Sep 22, 2020 at 9:59 PM Alan Somers  wrote:
>
> Go ahead and commit.  Consider it reviewed by me.  And if I understand 
> correctly, this commit means there's no need for a special updating 
> procedure, right?
>
> On Tue, Sep 22, 2020 at 6:55 PM Warner Losh  wrote:
>>
>>
>>
>> On Tue, Sep 22, 2020 at 5:17 PM Kyle Evans  wrote:
>>>
>>> On Tue, Sep 22, 2020, 17:02 Warner Losh  wrote:



 On Tue, Sep 22, 2020 at 3:55 PM Kyle Evans  wrote:
>
> On Tue, Sep 22, 2020 at 4:53 PM Ian Lepore  wrote:
> >
> > On Tue, 2020-09-22 at 15:50 -0600, Warner Losh wrote:
> > > I think it's a great leap sideways, but I've done cp /dev/null foo to
> > > clear
> > > it out for 35 years now... It's why it feels like a workaround.
> > >
> > > Though it is a legit optimization, no matter the feelings. As for
> > > clearer,
> > > I'm less sure since then I have to remember what the : operator does.
> > >
> > > Warner
> > >
> >
> > For me, :> is idiomatic (but ugly).
> >
> > On the other hand, the cp /dev/null had a nice dogfooding aspect to
> > it... when we broke cp by accident, its use in the build system was the
> > first alarm to go off.
> >
> > --Ian
> >
>
> To be honest, this is a case that really should be covered by
> regression tests somewhere.


 It should (but isn't yet).

 Ian is right for old-school FreeBSD thinking. In that thinking the build 
 system should use an eclectic mix of tools to act as a fire-wall against 
 accidental breakage.

 Complete, effective, test suites give much better coverage... if they are 
 run...

 So until we run tests frequently, with loud regression squawking that's as 
 effective as build breakage, I tend to fall in the 'all of the above' camp 
 until that's in place... :)

 Warner

 P.S. though not, if I suppose, if it means that we're slowing down the 
 regression coverage uptake...
>>>
>>>
>>> --
>>>
>>> The test build was fine, please confirm if I can commit it or if someone 
>>> else would like to write the UPDATING notice or start bootstrapping cp on 
>>> systems that were affected. I'm not comfortable with not taking any path at 
>>> all here, but this is a lot of friction for a small mechanical change to 
>>> ease the pain.
>>
>>
>> Sorry if I wasn't clear: I'm not objecting to the quick mechanical change so 
>> much as complaining that I wish we had better test coverage. Don't let that 
>> stop you from doing what's right (or I can if you'd like).
>>
>> Warner
___
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: r366059 - in head: bin/cp bin/cp/tests etc/mtree

2020-09-22 Thread Kyle Evans
Author: kevans
Date: Wed Sep 23 03:01:14 2020
New Revision: 366059
URL: https://svnweb.freebsd.org/changeset/base/366059

Log:
  cp: add some basic tests
  
  There are some tests available in the NetBSD test suite, but we don't
  currently pass all of those; further investigation will go into that. For
  now, just add a basic test as well as a test that copies from /dev/null to a
  file.
  
  The /dev/null test confirms that the file gets created if it's empty, then
  that it truncates the file if it's non-empty. This matches some usage that
  was previously employed in the build and was replaced in r366042 by a
  simpler shell construct.
  
  I will also plan on coming back to expand these in due time.
  
  MFC after:1 week

Added:
  head/bin/cp/tests/
  head/bin/cp/tests/Makefile   (contents, props changed)
  head/bin/cp/tests/cp_test.sh   (contents, props changed)
Modified:
  head/bin/cp/Makefile
  head/etc/mtree/BSD.tests.dist

Modified: head/bin/cp/Makefile
==
--- head/bin/cp/MakefileWed Sep 23 02:37:27 2020(r366058)
+++ head/bin/cp/MakefileWed Sep 23 03:01:14 2020(r366059)
@@ -1,9 +1,14 @@
 #  @(#)Makefile8.1 (Berkeley) 5/31/93
 # $FreeBSD$
 
+.include 
+
 PACKAGE=runtime
 PROG=  cp
 SRCS=  cp.c utils.c
 CFLAGS+= -DVM_AND_BUFFER_CACHE_SYNCHRONIZED -D_ACL_PRIVATE
+
+HAS_TESTS=
+SUBDIR.${MK_TESTS}=tests
 
 .include 

Added: head/bin/cp/tests/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/bin/cp/tests/Makefile  Wed Sep 23 03:01:14 2020(r366059)
@@ -0,0 +1,7 @@
+# $FreeBSD$
+
+PACKAGE=   tests
+
+ATF_TESTS_SH=  cp_test
+
+.include 

Added: head/bin/cp/tests/cp_test.sh
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/bin/cp/tests/cp_test.shWed Sep 23 03:01:14 2020
(r366059)
@@ -0,0 +1,63 @@
+#
+# SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+#
+# Copyright (c) 2020 Kyle Evans 
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#notice, this list of conditions and the following disclaimer in the
+#documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
+
+check_size()
+{
+   file=$1
+   sz=$2
+20atf_check -o inline:"$sz\n" stat -f '%z' $file
+}
+
+atf_test_case basic
+basic_body()
+{
+   echo "foo" > bar
+
+   atf_check cp bar baz
+   check_size baz 4
+}
+
+atf_test_case chrdev
+chrdev_body()
+{
+   echo "foo" > bar
+
+   check_size bar 4
+   atf_check cp /dev/null trunc
+   check_size trunc 0
+   atf_check cp bar trunc
+   check_size trunc 4
+   atf_check cp /dev/null trunc
+   check_size trunc 0
+}
+
+atf_init_test_cases()
+{
+   atf_add_test_case basic
+   atf_add_test_case chrdev
+}

Modified: head/etc/mtree/BSD.tests.dist
==
--- head/etc/mtree/BSD.tests.dist   Wed Sep 23 02:37:27 2020
(r366058)
+++ head/etc/mtree/BSD.tests.dist   Wed Sep 23 03:01:14 2020
(r366059)
@@ -12,6 +12,8 @@
 ..
 chmod
 ..
+cp
+..
 date
 ..
 dd
___
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: r365643 - head/bin/cp

2020-09-22 Thread Alan Somers
Go ahead and commit.  Consider it reviewed by me.  And if I understand
correctly, this commit means there's no need for a special updating
procedure, right?

On Tue, Sep 22, 2020 at 6:55 PM Warner Losh  wrote:

>
>
> On Tue, Sep 22, 2020 at 5:17 PM Kyle Evans  wrote:
>
>> On Tue, Sep 22, 2020, 17:02 Warner Losh  wrote:
>>
>>>
>>>
>>> On Tue, Sep 22, 2020 at 3:55 PM Kyle Evans  wrote:
>>>
 On Tue, Sep 22, 2020 at 4:53 PM Ian Lepore  wrote:
 >
 > On Tue, 2020-09-22 at 15:50 -0600, Warner Losh wrote:
 > > I think it's a great leap sideways, but I've done cp /dev/null foo
 to
 > > clear
 > > it out for 35 years now... It's why it feels like a workaround.
 > >
 > > Though it is a legit optimization, no matter the feelings. As for
 > > clearer,
 > > I'm less sure since then I have to remember what the : operator
 does.
 > >
 > > Warner
 > >
 >
 > For me, :> is idiomatic (but ugly).
 >
 > On the other hand, the cp /dev/null had a nice dogfooding aspect to
 > it... when we broke cp by accident, its use in the build system was
 the
 > first alarm to go off.
 >
 > --Ian
 >

 To be honest, this is a case that really should be covered by
 regression tests somewhere.

>>>
>>> It should (but isn't yet).
>>>
>>> Ian is right for old-school FreeBSD thinking. In that thinking the build
>>> system should use an eclectic mix of tools to act as a fire-wall against
>>> accidental breakage.
>>>
>>> Complete, effective, test suites give much better coverage... if they
>>> are run...
>>>
>>> So until we run tests frequently, with loud regression squawking that's
>>> as effective as build breakage, I tend to fall in the 'all of the above'
>>> camp until that's in place... :)
>>>
>>> Warner
>>>
>>> P.S. though not, if I suppose, if it means that we're slowing down the
>>> regression coverage uptake...
>>>
>>
>> --
>>
>> The test build was fine, please confirm if I can commit it or if someone
>> else would like to write the UPDATING notice or start bootstrapping cp on
>> systems that were affected. I'm not comfortable with not taking any path at
>> all here, but this is a lot of friction for a small mechanical change to
>> ease the pain.
>>
>
> Sorry if I wasn't clear: I'm not objecting to the quick mechanical change
> so much as complaining that I wish we had better test coverage. Don't let
> that stop you from doing what's right (or I can if you'd like).
>
> Warner
>
___
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: r366058 - head/usr.sbin/ntp

2020-09-22 Thread Brandon Bergren
Author: bdragon
Date: Wed Sep 23 02:37:27 2020
New Revision: 366058
URL: https://svnweb.freebsd.org/changeset/base/366058

Log:
  [PowerPC] Fix multiple ntp configuration issues
  
  * powerpc time_t is 64 bit, not 32 bit.
  
  * Add definition for powerpc64le.
  
  With this, powerpc64le ntpd and ntpdate operate correctly instead of
  corrupting the clock and exiting.
  
  Tested on powerpc64, powerpc64le, and powerpc.
  
  No feedback from cy@.
  
  I am a bit confused as to how SIZEOF_TIME_T being wrong ever worked on
  powerpc, it being big endian and all.
  
  Sponsored by: Tag1 Consulting, Inc.
  Differential Revision:https://reviews.freebsd.org/D26379

Modified:
  head/usr.sbin/ntp/config.h

Modified: head/usr.sbin/ntp/config.h
==
--- head/usr.sbin/ntp/config.h  Wed Sep 23 02:28:19 2020(r366057)
+++ head/usr.sbin/ntp/config.h  Wed Sep 23 02:37:27 2020(r366058)
@@ -1548,7 +1548,7 @@
 #define SIZEOF_SIGNED_CHAR 1
 
 /* The size of `time_t', as computed by sizeof. */
-#if defined(__i386__) || defined(__powerpc__)
+#if defined(__i386__)
 #define SIZEOF_TIME_T 4
 #else
 #define SIZEOF_TIME_T 8
@@ -1580,6 +1580,8 @@
 /* canonical system (cpu-vendor-os) of where we should run */
 #if defined(__amd64__)
 #define STR_SYSTEM "amd64-undermydesk-freebsd"
+#elif defined(__powerpc64__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+#define STR_SYSTEM "powerpc64le-undermydesk-freebsd"
 #elif defined(__powerpc64__)
 #define STR_SYSTEM "powerpc64-undermydesk-freebsd"
 #elif defined(__powerpc__)
@@ -1660,8 +1662,8 @@ typedef unsigned int  uintptr_t;
 
 /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
-#if defined(__ARMEB__) || defined(__MIPSEB__) || defined(__powerpc__) || \
-defined(__powerpc64__)
+#if defined(__ARMEB__) || defined(__MIPSEB__) || \
+(defined(__powerpc__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
 #define WORDS_BIGENDIAN 1
 #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: r366032 - in head: . share/mk stand sys/conf sys/modules sys/powerpc/include

2020-09-22 Thread Pedro Giffuni

On 22/09/2020 18:49, Brandon Bergren wrote:

Author: bdragon
Date: Tue Sep 22 23:49:30 2020
New Revision: 366032
URL: https://svnweb.freebsd.org/changeset/base/366032

Log:
   [PowerPC64LE] Set up powerpc.powerpc64le architecture
   
   This is the initial set up for PowerPC64LE.
   
   The current plan is for this arch to remain experimental for FreeBSD 13.
   
   This started as a weekend learning project for me and kinda snowballed from

   there.
   
   (More to follow momentarily.)


Very nice "learning" project ... Huge thanks for taking time on this and 
having fun in the process !


Pedro.

___
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: r366057 - head/sys/powerpc/powerpc

2020-09-22 Thread Brandon Bergren
Author: bdragon
Date: Wed Sep 23 02:28:19 2020
New Revision: 366057
URL: https://svnweb.freebsd.org/changeset/base/366057

Log:
  [PowerPC64LE] Fix sleeping on POWER8.
  
  Due to enter_idle_powerx fabricating a MSR from scratch, it is necessary
  for it to care about the endianness, so we don't accidentally switch
  endian the first time we idle a thread.
  
  Took about five seconds to spot after seeing an unmangled backtrace.
  
  The hard bit was needing to temporarily set up a mutex to sort out the
  logjam that happens when every thread simultaneously wakes up in the wrong
  endian due to the panic IPI and panics, leaving what I can best describe as
  "alphabet soup" on the console.
  
  Luckily, I already had a patch sitting around to do that.
  
  This brings POWER8 up to equivilence with POWER9 on PPC64LE.
  
  Sponsored by: Tag1 Consulting, Inc.

Modified:
  head/sys/powerpc/powerpc/cpu_subr64.S

Modified: head/sys/powerpc/powerpc/cpu_subr64.S
==
--- head/sys/powerpc/powerpc/cpu_subr64.S   Wed Sep 23 02:17:44 2020
(r366056)
+++ head/sys/powerpc/powerpc/cpu_subr64.S   Wed Sep 23 02:28:19 2020
(r366057)
@@ -71,7 +71,11 @@ ENTRY(enter_idle_powerx)
 
/* Set MSR */
li  %r3,0
+#ifdef __LITTLE_ENDIAN__
+   ori %r3,%r3,(PSL_ME | PSL_RI | PSL_LE)
+#else
ori %r3,%r3,(PSL_ME | PSL_RI)
+#endif
li  %r8,0x9 /* PSL_SF and PSL_HV */
insrdi  %r3,%r8,4,0
mtsrr1  %r3
___
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: r366056 - head/lib/libsqlite3

2020-09-22 Thread Brandon Bergren
Author: bdragon
Date: Wed Sep 23 02:17:44 2020
New Revision: 366056
URL: https://svnweb.freebsd.org/changeset/base/366056

Log:
  [PowerPC64LE] Pass our byte order to the sqlite3 build.
  
  Due to the sqlite3 endian detection code preferring to check platform defines
  instead of checking endian defines, it is necessary to manually set
  the endianness on PowerPC64LE.
  
  Unlike other bi-endian platforms, PowerPC64LE relies entirely on the
  generic endianness macros like __BYTE_ORDER__ and has no platform-specific
  define to denote little endian.
  
  Add -DSQLITE_BYTEORDER=1234 to the CFLAGS when building libsqlite3 on
  powerpc64le.
  
  Fixes runtime operation of sqlite on PowerPC64LE.
  
  Sponsored by: Tag1 Consulting, Inc.

Modified:
  head/lib/libsqlite3/Makefile

Modified: head/lib/libsqlite3/Makefile
==
--- head/lib/libsqlite3/MakefileWed Sep 23 02:11:24 2020
(r366055)
+++ head/lib/libsqlite3/MakefileWed Sep 23 02:17:44 2020
(r366056)
@@ -35,4 +35,8 @@ CFLAGS+=  -I${SQLITE} \
-D_REENTRANT=1 \
-DSQLITE_THREADSAFE=1
 
+.if ${MACHINE_ARCH} == "powerpc64le"
+CFLAGS+=   -DSQLITE_BYTEORDER=1234
+.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: r366055 - head/lib/libkvm

2020-09-22 Thread Brandon Bergren
Author: bdragon
Date: Wed Sep 23 02:11:24 2020
New Revision: 366055
URL: https://svnweb.freebsd.org/changeset/base/366055

Log:
  [PowerPC64LE] libkvm powerpc64le support.
  
  * Add missing _kvm16toh() function.
  * Teach libkvm about powerpc64le.
  
  Sponsored by: Tag1 Consulting, Inc.

Modified:
  head/lib/libkvm/kvm_powerpc64.c
  head/lib/libkvm/kvm_private.h

Modified: head/lib/libkvm/kvm_powerpc64.c
==
--- head/lib/libkvm/kvm_powerpc64.c Wed Sep 23 02:05:44 2020
(r366054)
+++ head/lib/libkvm/kvm_powerpc64.c Wed Sep 23 02:11:24 2020
(r366055)
@@ -53,22 +53,23 @@ struct vmstate {
 };
 
 static int
-valid_elf_header(Elf64_Ehdr *eh)
+valid_elf_header(kvm_t *kd, Elf64_Ehdr *eh)
 {
 
if (!IS_ELF(*eh))
return (0);
if (eh->e_ident[EI_CLASS] != ELFCLASS64)
return (0);
-   if (eh->e_ident[EI_DATA] != ELFDATA2MSB)
+   if (eh->e_ident[EI_DATA] != ELFDATA2MSB &&
+   eh->e_ident[EI_DATA] != ELFDATA2LSB)
return (0);
if (eh->e_ident[EI_VERSION] != EV_CURRENT)
return (0);
if (eh->e_ident[EI_OSABI] != ELFOSABI_STANDALONE)
return (0);
-   if (be16toh(eh->e_type) != ET_CORE)
+   if (_kvm16toh(kd, eh->e_type) != ET_CORE)
return (0);
-   if (be16toh(eh->e_machine) != EM_PPC64)
+   if (_kvm16toh(kd, eh->e_machine) != EM_PPC64)
return (0);
/* Can't think of anything else to check... */
return (1);
@@ -80,7 +81,8 @@ dump_header_size(struct kerneldumpheader *dh)
 
if (strcmp(dh->magic, KERNELDUMPMAGIC) != 0)
return (0);
-   if (strcmp(dh->architecture, "powerpc64") != 0)
+   if (strcmp(dh->architecture, "powerpc64") != 0 &&
+   strcmp(dh->architecture, "powerpc64le") != 0)
return (0);
/* That should do it... */
return (sizeof(*dh));
@@ -107,7 +109,7 @@ powerpc_maphdrs(kvm_t *kd)
}
vm->dmphdrsz = 0;
vm->eh = vm->map;
-   if (!valid_elf_header(vm->eh)) {
+   if (!valid_elf_header(kd, vm->eh)) {
/*
 * Hmmm, no ELF header. Maybe we still have a dump header.
 * This is normal when the core file wasn't created by
@@ -118,11 +120,11 @@ powerpc_maphdrs(kvm_t *kd)
if (vm->dmphdrsz == 0)
goto inval;
vm->eh = (void *)((uintptr_t)vm->map + vm->dmphdrsz);
-   if (!valid_elf_header(vm->eh))
+   if (!valid_elf_header(kd, vm->eh))
goto inval;
}
-   mapsz = be16toh(vm->eh->e_phentsize) * be16toh(vm->eh->e_phnum) +
-   be64toh(vm->eh->e_phoff);
+   mapsz = _kvm16toh(kd, vm->eh->e_phentsize) *
+   _kvm16toh(kd, vm->eh->e_phnum) + _kvm64toh(kd, vm->eh->e_phoff);
munmap(vm->map, vm->mapsz);
 
/* Map all headers. */
@@ -134,7 +136,7 @@ powerpc_maphdrs(kvm_t *kd)
}
vm->eh = (void *)((uintptr_t)vm->map + vm->dmphdrsz);
vm->ph = (void *)((uintptr_t)vm->eh +
-   (uintptr_t)be64toh(vm->eh->e_phoff));
+   (uintptr_t)_kvm64toh(kd, vm->eh->e_phoff));
return (0);
 
  inval:
@@ -155,19 +157,21 @@ powerpc64_va2off(kvm_t *kd, kvaddr_t va, off_t *ofs)
int nph;
 
ph = vm->ph;
-   nph = be16toh(vm->eh->e_phnum);
-   while (nph && (va < be64toh(ph->p_vaddr) ||
-   va >= be64toh(ph->p_vaddr) + be64toh(ph->p_memsz))) {
+   nph = _kvm16toh(kd, vm->eh->e_phnum);
+   while (nph && (va < _kvm64toh(kd, ph->p_vaddr) ||
+   va >= _kvm64toh(kd, ph->p_vaddr) + _kvm64toh(kd, ph->p_memsz))) {
nph--;
-   ph = (void *)((uintptr_t)ph + be16toh(vm->eh->e_phentsize));
+   ph = (void *)((uintptr_t)ph +
+   _kvm16toh(kd, vm->eh->e_phentsize));
}
if (nph == 0)
return (0);
 
/* Segment found. Return file offset and range. */
-   *ofs = vm->dmphdrsz + be64toh(ph->p_offset) +
-   (va - be64toh(ph->p_vaddr));
-   return (be64toh(ph->p_memsz) - (va - be64toh(ph->p_vaddr)));
+   *ofs = vm->dmphdrsz + _kvm64toh(kd, ph->p_offset) +
+   (va - _kvm64toh(kd, ph->p_vaddr));
+   return (_kvm64toh(kd, ph->p_memsz) -
+   (va - _kvm64toh(kd, ph->p_vaddr)));
 }
 
 static void
@@ -190,6 +194,14 @@ _powerpc64_probe(kvm_t *kd)
 }
 
 static int
+_powerpc64le_probe(kvm_t *kd)
+{
+
+   return (_kvm_probe_elf_kernel(kd, ELFCLASS64, EM_PPC64) &&
+   kd->nlehdr.e_ident[EI_DATA] == ELFDATA2LSB);
+}
+
+static int
 _powerpc64_initvtop(kvm_t *kd)
 {
 
@@ -209,7 +221,7 @@ _powerpc64_kvatop(kvm_t *kd, kvaddr_t va, off_t *ofs)
struct vmstate *vm;
 
vm = kd->vmst;
-   if (be64toh(vm->ph->p_paddr) == 0x)
+   if (_kvm64toh(kd, vm->ph->p_paddr) == 

svn commit: r366054 - in head/lib/libc: powerpc/softfloat powerpc64

2020-09-22 Thread Brandon Bergren
Author: bdragon
Date: Wed Sep 23 02:05:44 2020
New Revision: 366054
URL: https://svnweb.freebsd.org/changeset/base/366054

Log:
  [PowerPC64LE] Fix gdtoa configurations on LE.
  
  gdtoa wins the award for "most outdated endianness naming convention"
  with its IEEE_8087 vs IEEE_MC68k defines. I had a good chuckle.
  
  Update softfloat and arith.h to adjust to BE or LE automatically
  based on the low level preprocessor defines.
  
  Fixes printf/scanf on PowerPC64LE, although there is still a problem
  lurking regarding Signalling NaNs...
  
  Sponsored by: Tag1 Consulting, Inc.

Modified:
  head/lib/libc/powerpc/softfloat/powerpc-gcc.h
  head/lib/libc/powerpc64/arith.h

Modified: head/lib/libc/powerpc/softfloat/powerpc-gcc.h
==
--- head/lib/libc/powerpc/softfloat/powerpc-gcc.h   Wed Sep 23 01:56:26 
2020(r366053)
+++ head/lib/libc/powerpc/softfloat/powerpc-gcc.h   Wed Sep 23 02:05:44 
2020(r366054)
@@ -6,7 +6,11 @@
 One of the macros `BIGENDIAN' or `LITTLEENDIAN' must be defined.
 ---
 */
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+#define LITTLEENDIAN
+#else
 #define BIGENDIAN
+#endif
 
 /*
 ---

Modified: head/lib/libc/powerpc64/arith.h
==
--- head/lib/libc/powerpc64/arith.h Wed Sep 23 01:56:26 2020
(r366053)
+++ head/lib/libc/powerpc64/arith.h Wed Sep 23 02:05:44 2020
(r366054)
@@ -11,8 +11,13 @@
  * architecture.  See contrib/gdtoa/gdtoaimp.h for details.
  */
 
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+#define IEEE_8087
+#define Arith_Kind_ASL 1
+#else
 #define IEEE_MC68k
 #define Arith_Kind_ASL 2
+#endif
 #define Long int
 #define Intcast (int)(long)
 #define Double_Align
___
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: r366053 - in head/sys/powerpc: aim include

2020-09-22 Thread Brandon Bergren
Author: bdragon
Date: Wed Sep 23 01:56:26 2020
New Revision: 366053
URL: https://svnweb.freebsd.org/changeset/base/366053

Log:
  [PowerPC64LE] Fix AP spinup on powernv.
  
  OPAL unconditionally enters secondary CPUs with only HV and SF set.
  
  I tried writing a secondary entry point instead, but OPAL rejected it
  and I am unsure why, so I resorted to making the system reset interrupt
  endian-flexible.
  
  This means we take a slight performance hit on wakeup on LE, but it is
  a good stopgap until we can figure out a reliable way to make OPAL enter
  where we want it to.
  
  It probably makes sense to have it around anyway, because I can imagine
  scenarios where the cpu resets itself to BE and does a software reset.
  
  Sponsored by: Tag1 Consulting, Inc.

Modified:
  head/sys/powerpc/aim/trap_subr64.S
  head/sys/powerpc/include/asm.h

Modified: head/sys/powerpc/aim/trap_subr64.S
==
--- head/sys/powerpc/aim/trap_subr64.S  Wed Sep 23 01:56:21 2020
(r366052)
+++ head/sys/powerpc/aim/trap_subr64.S  Wed Sep 23 01:56:26 2020
(r366053)
@@ -319,6 +319,19 @@ dtrace_invop_calltrap_addr:
.globl  CNAME(cpu_wakeup_handler)
.p2align 3
 CNAME(rstcode):
+#ifdef __LITTLE_ENDIAN__
+   /*
+* XXX This shouldn't be necessary.
+*
+* According to the ISA documentation, LE should be set from HILE
+* or the LPCR ILE bit automatically. However, the entry into this
+* vector from OPAL_START_CPU does not honor this correctly.
+*
+* We should be able to define an alternate entry for opal's
+* start_kernel_secondary asm code to branch to.
+*/
+   RETURN_TO_NATIVE_ENDIAN
+#endif
/*
 * Check if this is software reset or
 * processor is waking up from power saving mode

Modified: head/sys/powerpc/include/asm.h
==
--- head/sys/powerpc/include/asm.h  Wed Sep 23 01:56:21 2020
(r366052)
+++ head/sys/powerpc/include/asm.h  Wed Sep 23 01:56:26 2020
(r366053)
@@ -213,6 +213,9 @@ name: \
  * wrong endian.
  *
  * This sequence is NMI-reentrant.
+ *
+ * Do not change the length of this sequence without looking at the users,
+ * this is used in size-constrained places like the reset vector!
  */
 #defineRETURN_TO_NATIVE_ENDIAN 
  \
tdi 0, %r0, 0x48;   /* Endian swapped: b . + 8  */\
___
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: r366052 - stable/11/sys/fs/nfsserver

2020-09-22 Thread Rick Macklem
Author: rmacklem
Date: Wed Sep 23 01:56:21 2020
New Revision: 366052
URL: https://svnweb.freebsd.org/changeset/base/366052

Log:
  MFC: r365789
  Fix a LOR between the NFS server and server side krpc.
  
  Recent testing of the NFS-over-TLS code found a LOR between the mutex lock
  used for sessions and the sleep lock used for server side krpc socket
  structures.
  The code in nfsrv_checksequence() would call SVC_RELEASE() with the mutex
  held.  Normally this is ok, since all that happens is SVC_RELEASE()
  decrements a reference count.  However, if the socket has just been shut
  down, SVC_RELEASE() drops the reference count to 0 and acquires a sleep
  lock during destruction of the server side krpc structure.
  
  This patch fixes the problem by moving the SVC_RELEASE() call in
  nfsrv_checksequence() down a few lines to below where the mutex is released.

Modified:
  stable/11/sys/fs/nfsserver/nfs_nfsdstate.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/fs/nfsserver/nfs_nfsdstate.c
==
--- stable/11/sys/fs/nfsserver/nfs_nfsdstate.c  Wed Sep 23 01:51:01 2020
(r366051)
+++ stable/11/sys/fs/nfsserver/nfs_nfsdstate.c  Wed Sep 23 01:56:21 2020
(r366052)
@@ -6091,6 +6091,7 @@ nfsrv_checksequence(struct nfsrv_descript *nd, uint32_
 * bound as well, do the implicit binding unless a
 * BindConnectiontoSession has already been done on the session.
 */
+   savxprt = NULL;
if (sep->sess_clp->lc_req.nr_client != NULL &&
sep->sess_cbsess.nfsess_xprt != nd->nd_xprt &&
(sep->sess_crflags & NFSV4CRSESS_CONNBACKCHAN) != 0 &&
@@ -6103,14 +6104,14 @@ nfsrv_checksequence(struct nfsrv_descript *nd, uint32_
sep->sess_clp->lc_req.nr_client->cl_private;
nd->nd_xprt->xp_idletimeout = 0;/* Disable timeout. */
sep->sess_cbsess.nfsess_xprt = nd->nd_xprt;
-   if (savxprt != NULL)
-   SVC_RELEASE(savxprt);
}
 
*sflagsp = 0;
if (sep->sess_clp->lc_req.nr_client == NULL)
*sflagsp |= NFSV4SEQ_CBPATHDOWN;
NFSUNLOCKSESSION(shp);
+   if (savxprt != NULL)
+   SVC_RELEASE(savxprt);
if (error == NFSERR_EXPIRED) {
*sflagsp |= NFSV4SEQ_EXPIREDALLSTATEREVOKED;
error = 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: r366051 - head/sys/powerpc/powernv

2020-09-22 Thread Brandon Bergren
Author: bdragon
Date: Wed Sep 23 01:51:01 2020
New Revision: 366051
URL: https://svnweb.freebsd.org/changeset/base/366051

Log:
  [PowerPC64LE] Endian fix for opal_hmi.c
  
  Another boring one. We need to endian swap before checking flags.
  
  Sponsored by: Tag1 Consulting, Inc.

Modified:
  head/sys/powerpc/powernv/opal_hmi.c

Modified: head/sys/powerpc/powernv/opal_hmi.c
==
--- head/sys/powerpc/powernv/opal_hmi.c Wed Sep 23 01:49:50 2020
(r366050)
+++ head/sys/powerpc/powernv/opal_hmi.c Wed Sep 23 01:51:01 2020
(r366051)
@@ -94,7 +94,7 @@ opal_hmi_handler2(struct trapframe *frame)
*flags = 0;
err = opal_call(OPAL_HANDLE_HMI2, DMAP_TO_PHYS((vm_offset_t)flags));
 
-   if (*flags & OPAL_HMI_FLAGS_TOD_TB_FAIL)
+   if (be64toh(*flags) & OPAL_HMI_FLAGS_TOD_TB_FAIL)
panic("TOD/TB recovery failure");
 
if (err == OPAL_SUCCESS)
___
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: r366050 - stable/12/sys/fs/nfsserver

2020-09-22 Thread Rick Macklem
Author: rmacklem
Date: Wed Sep 23 01:49:50 2020
New Revision: 366050
URL: https://svnweb.freebsd.org/changeset/base/366050

Log:
  MFC: r365789
  Fix a LOR between the NFS server and server side krpc.
  
  Recent testing of the NFS-over-TLS code found a LOR between the mutex lock
  used for sessions and the sleep lock used for server side krpc socket
  structures.
  The code in nfsrv_checksequence() would call SVC_RELEASE() with the mutex
  held.  Normally this is ok, since all that happens is SVC_RELEASE()
  decrements a reference count.  However, if the socket has just been shut
  down, SVC_RELEASE() drops the reference count to 0 and acquires a sleep
  lock during destruction of the server side krpc structure.
  
  This patch fixes the problem by moving the SVC_RELEASE() call in
  nfsrv_checksequence() down a few lines to below where the mutex is released.

Modified:
  stable/12/sys/fs/nfsserver/nfs_nfsdstate.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/fs/nfsserver/nfs_nfsdstate.c
==
--- stable/12/sys/fs/nfsserver/nfs_nfsdstate.c  Wed Sep 23 01:49:37 2020
(r366049)
+++ stable/12/sys/fs/nfsserver/nfs_nfsdstate.c  Wed Sep 23 01:49:50 2020
(r366050)
@@ -6214,6 +6214,7 @@ nfsrv_checksequence(struct nfsrv_descript *nd, uint32_
 * bound as well, do the implicit binding unless a
 * BindConnectiontoSession has already been done on the session.
 */
+   savxprt = NULL;
if (sep->sess_clp->lc_req.nr_client != NULL &&
sep->sess_cbsess.nfsess_xprt != nd->nd_xprt &&
(sep->sess_crflags & NFSV4CRSESS_CONNBACKCHAN) != 0 &&
@@ -6226,14 +6227,14 @@ nfsrv_checksequence(struct nfsrv_descript *nd, uint32_
sep->sess_clp->lc_req.nr_client->cl_private;
nd->nd_xprt->xp_idletimeout = 0;/* Disable timeout. */
sep->sess_cbsess.nfsess_xprt = nd->nd_xprt;
-   if (savxprt != NULL)
-   SVC_RELEASE(savxprt);
}
 
*sflagsp = 0;
if (sep->sess_clp->lc_req.nr_client == NULL)
*sflagsp |= NFSV4SEQ_CBPATHDOWN;
NFSUNLOCKSESSION(shp);
+   if (savxprt != NULL)
+   SVC_RELEASE(savxprt);
if (error == NFSERR_EXPIRED) {
*sflagsp |= NFSV4SEQ_EXPIREDALLSTATEREVOKED;
error = 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: r366049 - head/sys/powerpc/powernv

2020-09-22 Thread Brandon Bergren
Author: bdragon
Date: Wed Sep 23 01:49:37 2020
New Revision: 366049
URL: https://svnweb.freebsd.org/changeset/base/366049

Log:
  [PowerPC64LE] Get XIVE up and running.
  
  More endian conversion.
  
  * Install TCEs correctly (i.e. in big endian)
  
  * Convert to big endian and back when setting up queue pages and IRQs.
  
  Sponsored by: Tag1 Consulting, Inc.

Modified:
  head/sys/powerpc/powernv/opal_pci.c
  head/sys/powerpc/powernv/xive.c

Modified: head/sys/powerpc/powernv/opal_pci.c
==
--- head/sys/powerpc/powernv/opal_pci.c Wed Sep 23 01:41:51 2020
(r366048)
+++ head/sys/powerpc/powernv/opal_pci.c Wed Sep 23 01:49:37 2020
(r366049)
@@ -385,7 +385,7 @@ opalpci_attach(device_t dev)
(uintmax_t)sc->phb_id);
 
for (i = 0; i < entries; i++)
-   sc->tce[i] = (i * tce_size) | OPAL_PCI_TCE_R | OPAL_PCI_TCE_W;
+   sc->tce[i] = htobe64((i * tce_size) | OPAL_PCI_TCE_R | 
OPAL_PCI_TCE_W);
 
/* Map TCE for every PE. It seems necessary for Power8 */
for (i = 0; i < npe; i++) {

Modified: head/sys/powerpc/powernv/xive.c
==
--- head/sys/powerpc/powernv/xive.c Wed Sep 23 01:41:51 2020
(r366048)
+++ head/sys/powerpc/powernv/xive.c Wed Sep 23 01:49:37 2020
(r366049)
@@ -377,6 +377,9 @@ xive_attach(device_t dev)
opal_call(OPAL_XIVE_GET_VP_INFO, xive_cpud->vp, NULL,
vtophys(_cpud->cam), NULL, vtophys(_cpud->chip));
 
+   xive_cpud->cam = be64toh(xive_cpud->cam);
+   xive_cpud->chip = be64toh(xive_cpud->chip);
+
/* Allocate the queue page and populate the queue state data. */
xive_cpud->queue.q_page = contigmalloc(PAGE_SIZE, M_XIVE,
M_ZERO | M_WAITOK, 0, BUS_SPACE_MAXADDR, PAGE_SIZE, 0);
@@ -707,6 +710,12 @@ xive_init_irq(struct xive_irq *irqd, u_int irq)
vtophys(_phys), vtophys(_shift),
vtophys(>chip));
 
+   irqd->flags = be64toh(irqd->flags);
+   eoi_phys = be64toh(eoi_phys);
+   trig_phys = be64toh(trig_phys);
+   esb_shift = be32toh(esb_shift);
+   irqd->chip = be32toh(irqd->chip);
+
irqd->girq = irq;
irqd->esb_size = 1 << esb_shift;
irqd->eoi_page = (vm_offset_t)pmap_mapdev(eoi_phys, irqd->esb_size);
@@ -721,6 +730,10 @@ xive_init_irq(struct xive_irq *irqd, u_int irq)
 
opal_call(OPAL_XIVE_GET_IRQ_CONFIG, irq, vtophys(>vp),
vtophys(>prio), vtophys(>lirq));
+
+   irqd->vp = be64toh(irqd->vp);
+   irqd->prio = be64toh(irqd->prio);
+   irqd->lirq = be32toh(irqd->lirq);
 }
 
 /* Allocate an IRQ struct before populating it. */
___
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: r366048 - head/sys/powerpc/powernv

2020-09-22 Thread Brandon Bergren
Author: bdragon
Date: Wed Sep 23 01:41:51 2020
New Revision: 366048
URL: https://svnweb.freebsd.org/changeset/base/366048

Log:
  [PowerPC64LE] Endian fix for opal_dev.c.
  
  Not much to say here, another missing be64toh() in memory that was written
  from OPAL.
  
  Sponsored by: Tag1 Consulting, Inc.

Modified:
  head/sys/powerpc/powernv/opal_dev.c

Modified: head/sys/powerpc/powernv/opal_dev.c
==
--- head/sys/powerpc/powernv/opal_dev.c Wed Sep 23 01:37:01 2020
(r366047)
+++ head/sys/powerpc/powernv/opal_dev.c Wed Sep 23 01:41:51 2020
(r366048)
@@ -135,7 +135,7 @@ opal_heartbeat(void)
events = 0;
/* Turn the OPAL state crank */
opal_call(OPAL_POLL_EVENTS, vtophys());
-   if (events & OPAL_EVENT_MSG_PENDING)
+   if (be64toh(events) & OPAL_EVENT_MSG_PENDING)
opal_handle_messages();
tsleep(opal_hb_proc, 0, "opal",
MSEC_2_TICKS(opal_heartbeat_ms));
___
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: r366047 - head/sys/powerpc/powernv

2020-09-22 Thread Brandon Bergren
Author: bdragon
Date: Wed Sep 23 01:37:01 2020
New Revision: 366047
URL: https://svnweb.freebsd.org/changeset/base/366047

Log:
  [PowerPC64LE] Endian fixes for opal_pci.c.
  
  Since OPAL runs in big endian, any data being passed back and forth
  via memory instead of registers needs to be byteswapped.
  
  From my notes during development:
  
  "A good way to find candidates is to look for vtophys() in opal_call()
  parameters. The memory being passed will be written into in BE."
  
  Sponsored by: Tag1 Consulting, Inc.

Modified:
  head/sys/powerpc/powernv/opal_pci.c

Modified: head/sys/powerpc/powernv/opal_pci.c
==
--- head/sys/powerpc/powernv/opal_pci.c Wed Sep 23 01:33:54 2020
(r366046)
+++ head/sys/powerpc/powernv/opal_pci.c Wed Sep 23 01:37:01 2020
(r366047)
@@ -524,11 +524,12 @@ opalpci_read_config(device_t dev, u_int bus, u_int slo
case 2:
error = opal_call(OPAL_PCI_CONFIG_READ_HALF_WORD, sc->phb_id,
config_addr, reg, vtophys());
-   word = half;
+   word = be16toh(half);
break;
case 4:
error = opal_call(OPAL_PCI_CONFIG_READ_WORD, sc->phb_id,
config_addr, reg, vtophys());
+   word = be32toh(word);
break;
default:
error = OPAL_SUCCESS;
@@ -547,6 +548,7 @@ opalpci_read_config(device_t dev, u_int bus, u_int slo
opal_call(OPAL_PCI_EEH_FREEZE_STATUS, sc->phb_id,
OPAL_PCI_DEFAULT_PE, vtophys(_state),
vtophys(_type), NULL);
+   err_type = be16toh(err_type); /* XXX unused */
if (eeh_state != OPAL_EEH_STOPPED_NOT_FROZEN)
opal_call(OPAL_PCI_EEH_FREEZE_CLEAR,
sc->phb_id, OPAL_PCI_DEFAULT_PE,
___
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: r366046 - head/sys/powerpc/aim

2020-09-22 Thread Brandon Bergren
Author: bdragon
Date: Wed Sep 23 01:33:54 2020
New Revision: 366046
URL: https://svnweb.freebsd.org/changeset/base/366046

Log:
  [PowerPC64LE] Implement endian-independent dword atomic PTE lock.
  
  It's much easier to implement this in an endian-independent way when we
  don't also have to worry about masking half of the dword off.
  
  Given that this code ran on a machine that ran a poudriere bulk with no
  kernel oddities, I am relatively certain it is correctly implemented. ;)
  
  This should be a minor performance boost on BE as well.
  
  Sponsored by: Tag1 Consulting, Inc.

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

Modified: head/sys/powerpc/aim/moea64_native.c
==
--- head/sys/powerpc/aim/moea64_native.cWed Sep 23 01:29:33 2020
(r366045)
+++ head/sys/powerpc/aim/moea64_native.cWed Sep 23 01:33:54 2020
(r366046)
@@ -633,15 +633,46 @@ static int
 atomic_pte_lock(volatile struct lpte *pte, uint64_t bitmask, uint64_t *oldhi)
 {
int ret;
+#ifdef __powerpc64__
+   uint64_t temp;
+#else
uint32_t oldhihalf;
+#endif
 
/*
 * Note: in principle, if just the locked bit were set here, we
 * could avoid needing the eviction lock. However, eviction occurs
 * so rarely that it isn't worth bothering about in practice.
 */
-
+#ifdef __powerpc64__
+   /*
+* Note: Success of this sequence has the side effect of invalidating
+* the PTE, as we are setting it to LPTE_LOCKED and discarding the
+* other bits, including LPTE_V.
+*/
__asm __volatile (
+   "1:\tldarx %1, 0, %3\n\t"   /* load old value */
+   "and. %0,%1,%4\n\t" /* check if any bits set */
+   "bne 2f\n\t"/* exit if any set */
+   "stdcx. %5, 0, %3\n\t"  /* attempt to store */
+   "bne- 1b\n\t"   /* spin if failed */
+   "li %0, 1\n\t"  /* success - retval = 1 */
+   "b 3f\n\t"  /* we've succeeded */
+   "2:\n\t"
+   "stdcx. %1, 0, %3\n\t"  /* clear reservation (74xx) */
+   "li %0, 0\n\t"  /* failure - retval = 0 */
+   "3:\n\t"
+   : "=" (ret), "="(temp), "=m" (pte->pte_hi)
+   : "r" ((volatile char *)>pte_hi),
+ "r" (htobe64(bitmask)), "r" (htobe64(LPTE_LOCKED)),
+ "m" (pte->pte_hi)
+   : "cr0", "cr1", "cr2", "memory");
+   *oldhi = be64toh(temp);
+#else
+   /*
+* This code is used on bridge mode only.
+*/
+   __asm __volatile (
"1:\tlwarx %1, 0, %3\n\t"   /* load old value */
"and. %0,%1,%4\n\t" /* check if any bits set */
"bne 2f\n\t"/* exit if any set */
@@ -660,6 +691,7 @@ atomic_pte_lock(volatile struct lpte *pte, uint64_t bi
: "cr0", "cr1", "cr2", "memory");
 
*oldhi = (pte->pte_hi & 0xULL) | oldhihalf;
+#endif
 
return (ret);
 }
___
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: r366045 - head/sys/powerpc/aim

2020-09-22 Thread Brandon Bergren
Author: bdragon
Date: Wed Sep 23 01:29:33 2020
New Revision: 366045
URL: https://svnweb.freebsd.org/changeset/base/366045

Log:
  [PowerPC64LE] Fix endian conversion bugs in moea64.
  
  For a body of code that had its endian conversion bits written blind without
  the ability to test, moea64 was VERY close to being correct.
  
  There were only four instances where the existing code was getting it wrong.
  
  Sponsored by: Tag1 Consulting, Inc.

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

Modified: head/sys/powerpc/aim/moea64_native.c
==
--- head/sys/powerpc/aim/moea64_native.cWed Sep 23 01:13:29 2020
(r366044)
+++ head/sys/powerpc/aim/moea64_native.cWed Sep 23 01:29:33 2020
(r366045)
@@ -341,7 +341,7 @@ moea64_pte_unset_native(struct pvo_entry *pvo)
pvo_ptevpn = moea64_pte_vpn_from_pvo_vpn(pvo);
 
rw_rlock(_eviction_lock);
-   if ((be64toh(pt->pte_hi & LPTE_AVPN_MASK)) != pvo_ptevpn) {
+   if ((be64toh(pt->pte_hi) & LPTE_AVPN_MASK) != pvo_ptevpn) {
/* Evicted */
STAT_MOEA64(moea64_pte_overflow--);
rw_runlock(_eviction_lock);
@@ -354,7 +354,7 @@ moea64_pte_unset_native(struct pvo_entry *pvo)
 */
isync();
critical_enter();
-   pt->pte_hi = be64toh((pt->pte_hi & ~LPTE_VALID) | LPTE_LOCKED);
+   pt->pte_hi = htobe64((be64toh(pt->pte_hi) & ~LPTE_VALID) | LPTE_LOCKED);
PTESYNC();
TLBIE(pvo->pvo_vpn);
ptelo = be64toh(pt->pte_lo);
@@ -378,7 +378,7 @@ moea64_pte_replace_inval_native(struct pvo_entry *pvo,
moea64_pte_from_pvo(pvo, );
 
rw_rlock(_eviction_lock);
-   if ((be64toh(pt->pte_hi & LPTE_AVPN_MASK)) !=
+   if ((be64toh(pt->pte_hi) & LPTE_AVPN_MASK) !=
(properpt.pte_hi & LPTE_AVPN_MASK)) {
/* Evicted */
STAT_MOEA64(moea64_pte_overflow--);
@@ -392,7 +392,7 @@ moea64_pte_replace_inval_native(struct pvo_entry *pvo,
 */
isync();
critical_enter();
-   pt->pte_hi = be64toh((pt->pte_hi & ~LPTE_VALID) | LPTE_LOCKED);
+   pt->pte_hi = htobe64((be64toh(pt->pte_hi) & ~LPTE_VALID) | LPTE_LOCKED);
PTESYNC();
TLBIE(pvo->pvo_vpn);
ptelo = be64toh(pt->pte_lo);
___
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: r366044 - head/release/powerpc

2020-09-22 Thread Brandon Bergren
Author: bdragon
Date: Wed Sep 23 01:13:29 2020
New Revision: 366044
URL: https://svnweb.freebsd.org/changeset/base/366044

Log:
  [PowerPC64LE] Add release building script for powerpc64le.
  
  This was originally part of the initial commit, but after discussion in
  D26399, I split it out into its own commit after the kernel config file.
  
  Sponsored by: Tag1 Consulting, Inc.

Added:
  head/release/powerpc/powerpc64le.conf   (contents, props changed)

Added: head/release/powerpc/powerpc64le.conf
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/release/powerpc/powerpc64le.conf   Wed Sep 23 01:13:29 2020
(r366044)
@@ -0,0 +1,10 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# Configuration file for release/release.sh to build powerpc/powerpc64le.
+
+TARGET="powerpc"
+TARGET_ARCH="powerpc64le"
+KERNEL="GENERIC64LE"
___
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: r366043 - head/sys/powerpc/conf

2020-09-22 Thread Brandon Bergren
Author: bdragon
Date: Wed Sep 23 01:07:55 2020
New Revision: 366043
URL: https://svnweb.freebsd.org/changeset/base/366043

Log:
  [PowerPC64LE] Initial GENERIC64LE kernel config.
  
  This is slightly stripped down from GENERIC64, as PowerMac G5 machines
  are incapable of running in LE mode (so we can skip the Mac drivers.)
  
  While technically POWER6 and POWER7 have the hardware capability of running
  in LE mode, they have a tendency to trap excessively when a load/store is
  misaligned. (an extremely common occurrence in LE code, and one of the main
  reasons I consider BE to be superior, as it turns potential security issues
  into immediately obvious mangled numbers.)
  
  Additionally, there was no mechanism to control what endian interrupts
  are delivered in, so supporting LE operation on POWER6 and POWER7 involves
  some really dirty tricks in the interrupt vectors that I would rather
  avoid.
  
  IBM drew the line in the sand at POWER8 some time around 2013, embracing
  full support for LE in the platform, and making a push across the board
  for LE code to target POWER8 as a minimum requirement. As such, usage of
  LE kernels on POWER6 and POWER7 is practically nil, despite it being
  technically possible to do.
  
  The so-called "TRUELE" feature bit which is the baseline requirement for
   needed for PowerPC64LE was introduced in POWER8.
  
  Sponsored by: Tag1 Consulting, Inc.

Added:
  head/sys/powerpc/conf/GENERIC64LE   (contents, props changed)

Added: head/sys/powerpc/conf/GENERIC64LE
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/powerpc/conf/GENERIC64LE   Wed Sep 23 01:07:55 2020
(r366043)
@@ -0,0 +1,253 @@
+#
+# GENERIC -- Generic kernel configuration file for FreeBSD/powerpc
+#
+# For more information on this file, please read the handbook section on
+# Kernel Configuration Files:
+#
+#
https://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html
+#
+# The handbook is also available locally in /usr/share/doc/handbook
+# if you've installed the doc distribution, otherwise always see the
+# FreeBSD World Wide Web server (https://www.FreeBSD.org/) for the
+# latest information.
+#
+# An exhaustive list of options and more detailed explanations of the
+# device lines is also present in the ../../conf/NOTES and NOTES files. 
+# If you are in doubt as to the purpose or necessity of a line, check first 
+# in NOTES.
+#
+# $FreeBSD$
+
+cpuAIM
+ident  GENERIC
+
+machinepowerpc powerpc64le
+
+makeoptionsDEBUG=-g#Build kernel with gdb(1) debug symbols
+makeoptionsWITH_CTF=1
+
+# Platform support
+optionsMAMBO   #IBM Mambo Full System Simulator
+optionsQEMU#QEMU processor emulator
+optionsPSERIES #PAPR-compliant systems (e.g. IBM p)
+optionsPOWERNV #Non-virtualized OpenPOWER systems
+
+optionsFDT #Flattened Device Tree
+optionsSCHED_ULE   #ULE scheduler
+optionsNUMA#Non-Uniform Memory Architecture support
+optionsPREEMPTION  #Enable kernel thread preemption
+optionsVIMAGE  # Subsystem virtualization, e.g. VNET
+optionsINET#InterNETworking
+optionsINET6   #IPv6 communications protocols
+optionsIPSEC_SUPPORT   # Allow kldload of ipsec and tcpmd5
+optionsTCP_OFFLOAD # TCP offload
+optionsTCP_BLACKBOX# Enhanced TCP event logging
+optionsTCP_HHOOK   # hhook(9) framework for TCP
+optionsTCP_RFC7413 # TCP Fast Open
+optionsSCTP_SUPPORT# Allow kldload of SCTP
+optionsFFS #Berkeley Fast Filesystem
+optionsSOFTUPDATES #Enable FFS soft updates support
+optionsUFS_ACL #Support for access control lists
+optionsUFS_DIRHASH #Improve performance on big directories
+optionsUFS_GJOURNAL#Enable gjournal-based UFS journaling
+optionsQUOTA   #Enable disk quotas for UFS
+optionsMD_ROOT #MD is a potential root device
+optionsMD_ROOT_MEM #Enable use of initrd as MD root
+optionsNFSCL   #Network Filesystem Client
+optionsNFSD#Network Filesystem Server
+optionsNFSLOCKD#Network Lock Manager
+optionsNFS_ROOT#NFS usable as root device
+optionsMSDOSFS #MSDOS Filesystem
+optionsCD9660  #ISO 9660 Filesystem
+optionsPROCFS  #Process filesystem (requires PSEUDOFS)
+options

svn commit: r366042 - in head/stand: i386/zfsboot libsa

2020-09-22 Thread Warner Losh
Author: imp
Date: Wed Sep 23 01:04:25 2020
New Revision: 366042
URL: https://svnweb.freebsd.org/changeset/base/366042

Log:
  Work around cp breakage in current from last week
  
  There was a small window cp was broken. Work around this by using :>
  instead of cp /dev/null. Ideally, we'd keep the cp /dev/null in the
  build as a regression test, but doing so breaks people that upgraded
  during the cp breakage and this is simpler than bootstrapping a
  working cp since there's no good __FreeBSD_version sign posts for
  that.
  
  Suggested by: lots of people
  Too stubborn for his own good: imp

Modified:
  head/stand/i386/zfsboot/Makefile
  head/stand/libsa/Makefile

Modified: head/stand/i386/zfsboot/Makefile
==
--- head/stand/i386/zfsboot/MakefileWed Sep 23 00:32:50 2020
(r366041)
+++ head/stand/i386/zfsboot/MakefileWed Sep 23 01:04:25 2020
(r366042)
@@ -81,7 +81,7 @@ zfsboot.ld: zfsboot.ldr zfsboot.bin ${BTXKERN}
-o ${.TARGET} -P 1 zfsboot.bin
 
 zfsboot.ldr:
-   cp /dev/null ${.TARGET}
+   :> ${.TARGET}
 
 zfsboot.bin: zfsboot.out
${OBJCOPY} -S -O binary zfsboot.out ${.TARGET}

Modified: head/stand/libsa/Makefile
==
--- head/stand/libsa/Makefile   Wed Sep 23 00:32:50 2020(r366041)
+++ head/stand/libsa/Makefile   Wed Sep 23 01:04:25 2020(r366042)
@@ -122,7 +122,7 @@ beforedepend:
ln -sf ${SRCTOP}/include/arpa/inet.h arpa/inet.h; \
ln -sf ${SRCTOP}/include/arpa/tftp.h arpa/tftp.h; \
for i in _time.h _strings.h _string.h; do \
-   [ -f xlocale/$$i ] || cp /dev/null xlocale/$$i; \
+   [ -f xlocale/$$i ] || :> xlocale/$$i; \
done; \
for i in ${STAND_H_INC}; do \
ln -sf ${SASRC}/stand.h $$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: r365643 - head/bin/cp

2020-09-22 Thread Warner Losh
On Tue, Sep 22, 2020 at 5:17 PM Kyle Evans  wrote:

> On Tue, Sep 22, 2020, 17:02 Warner Losh  wrote:
>
>>
>>
>> On Tue, Sep 22, 2020 at 3:55 PM Kyle Evans  wrote:
>>
>>> On Tue, Sep 22, 2020 at 4:53 PM Ian Lepore  wrote:
>>> >
>>> > On Tue, 2020-09-22 at 15:50 -0600, Warner Losh wrote:
>>> > > I think it's a great leap sideways, but I've done cp /dev/null foo to
>>> > > clear
>>> > > it out for 35 years now... It's why it feels like a workaround.
>>> > >
>>> > > Though it is a legit optimization, no matter the feelings. As for
>>> > > clearer,
>>> > > I'm less sure since then I have to remember what the : operator does.
>>> > >
>>> > > Warner
>>> > >
>>> >
>>> > For me, :> is idiomatic (but ugly).
>>> >
>>> > On the other hand, the cp /dev/null had a nice dogfooding aspect to
>>> > it... when we broke cp by accident, its use in the build system was the
>>> > first alarm to go off.
>>> >
>>> > --Ian
>>> >
>>>
>>> To be honest, this is a case that really should be covered by
>>> regression tests somewhere.
>>>
>>
>> It should (but isn't yet).
>>
>> Ian is right for old-school FreeBSD thinking. In that thinking the build
>> system should use an eclectic mix of tools to act as a fire-wall against
>> accidental breakage.
>>
>> Complete, effective, test suites give much better coverage... if they are
>> run...
>>
>> So until we run tests frequently, with loud regression squawking that's
>> as effective as build breakage, I tend to fall in the 'all of the above'
>> camp until that's in place... :)
>>
>> Warner
>>
>> P.S. though not, if I suppose, if it means that we're slowing down the
>> regression coverage uptake...
>>
>
> --
>
> The test build was fine, please confirm if I can commit it or if someone
> else would like to write the UPDATING notice or start bootstrapping cp on
> systems that were affected. I'm not comfortable with not taking any path at
> all here, but this is a lot of friction for a small mechanical change to
> ease the pain.
>

Sorry if I wasn't clear: I'm not objecting to the quick mechanical change
so much as complaining that I wish we had better test coverage. Don't let
that stop you from doing what's right (or I can if you'd like).

Warner
___
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: r366041 - in head/sys/powerpc: include powernv

2020-09-22 Thread Brandon Bergren
Author: bdragon
Date: Wed Sep 23 00:32:50 2020
New Revision: 366041
URL: https://svnweb.freebsd.org/changeset/base/366041

Log:
  [PowerPC64LE] powernv ILE setup code.
  
  When running without a hypervisor, we need to set the ILE bit in the LPCR
  ourselves.
  
  For the boot processor, handle it in powernv_attach() like we do for other
  LPCR bits.
  
  No change for the APs, as they will use the lpcr global to set up their own
  LPCR when they do their own cpudep_ap_early_bootstrap() and pick up this
  automatically.
  
  Sponsored by: Tag1 Consulting, Inc.

Modified:
  head/sys/powerpc/include/spr.h
  head/sys/powerpc/powernv/platform_powernv.c

Modified: head/sys/powerpc/include/spr.h
==
--- head/sys/powerpc/include/spr.h  Wed Sep 23 00:28:47 2020
(r366040)
+++ head/sys/powerpc/include/spr.h  Wed Sep 23 00:32:50 2020
(r366041)
@@ -292,6 +292,7 @@
 #defineSPR_LPCR0x13e   /* .6. Logical Partitioning 
Control */
 #define  LPCR_LPES   0x008 /* Bit 60 */
 #define  LPCR_HVICE  0x002 /* Hypervisor Virtualization 
Interrupt (Arch 3.0) */
+#define  LPCR_ILE(1ULL << 25) /* Interrupt 
Little-Endian (ISA 2.07) */
 #define  LPCR_UPRT   (1ULL << 22) /* Use Process Table 
(ISA 3) */
 #define  LPCR_HR (1ULL << 20) /* Host Radix mode */
 #define  LPCR_PECE_DRBL  (1ULL << 16) /* Directed Privileged 
Doorbell */

Modified: head/sys/powerpc/powernv/platform_powernv.c
==
--- head/sys/powerpc/powernv/platform_powernv.c Wed Sep 23 00:28:47 2020
(r366040)
+++ head/sys/powerpc/powernv/platform_powernv.c Wed Sep 23 00:32:50 2020
(r366041)
@@ -174,6 +174,10 @@ powernv_attach(platform_t plat)
if (cpu_features2 & PPC_FEATURE2_ARCH_3_00)
lpcr |= LPCR_HVICE;
 
+#if BYTE_ORDER == LITTLE_ENDIAN
+   lpcr |= LPCR_ILE;
+#endif
+
mtspr(SPR_LPCR, lpcr);
isync();
 
___
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: r366040 - head/sys/powerpc/powernv

2020-09-22 Thread Brandon Bergren
Author: bdragon
Date: Wed Sep 23 00:28:47 2020
New Revision: 366040
URL: https://svnweb.freebsd.org/changeset/base/366040

Log:
  [PowerPC64LE] LE opal_call() implementation
  
  OPAL runs in big endian, so we need to rfid into it to switch endian
  atomically when branching to it, and we need to do the
  RETURN_TO_NATIVE_ENDIAN dance when it returns to us.
  
  Sponsored by: Tag1 Consulting, Inc.

Modified:
  head/sys/powerpc/powernv/opal.c
  head/sys/powerpc/powernv/opalcall.S

Modified: head/sys/powerpc/powernv/opal.c
==
--- head/sys/powerpc/powernv/opal.c Wed Sep 23 00:21:51 2020
(r366039)
+++ head/sys/powerpc/powernv/opal.c Wed Sep 23 00:28:47 2020
(r366040)
@@ -57,7 +57,7 @@ opal_check(void)
OF_getencprop(opal, "opal-entry-address", val, sizeof(val));
opal_entrypoint = ((uint64_t)val[0] << 32) | val[1];
 
-   opal_msr = mfmsr() & ~(PSL_EE | PSL_IR | PSL_DR | PSL_SE);
+   opal_msr = mfmsr() & ~(PSL_EE | PSL_IR | PSL_DR | PSL_SE | PSL_LE);
 
opal_initialized = 1;
 

Modified: head/sys/powerpc/powernv/opalcall.S
==
--- head/sys/powerpc/powernv/opalcall.S Wed Sep 23 00:21:51 2020
(r366039)
+++ head/sys/powerpc/powernv/opalcall.S Wed Sep 23 00:28:47 2020
(r366040)
@@ -84,6 +84,10 @@ ASENTRY(opal_call)
xori%r3,%r3,1
 #endif
 
+#ifdef __LITTLE_ENDIAN__
+   mtsrr1  %r3
+#endif
+
/* Shift registers over */
mr  %r3,%r4
mr  %r4,%r5
@@ -93,8 +97,23 @@ ASENTRY(opal_call)
mr  %r8,%r9
mr  %r9,%r10
 
+#ifdef __LITTLE_ENDIAN__
+   /* We need to rfid to switch endian. */
+   mfctr   %r11
+   mtsrr0  %r11
+   LOAD_LR_NIA
+1:
+   mflr%r11
+   addi%r11, %r11, (2f-1b)
+   mtlr%r11
/* Call OPAL */
+   rfid
+2:
+   RETURN_TO_NATIVE_ENDIAN
+#else
+   /* Call OPAL */
bctrl
+#endif
 
/* Restore MSR */
mtmsrd  %r31
___
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: r366039 - in head: lib/csu lib/libc lib/libc/powerpc64/string libexec/rtld-elf libexec/rtld-elf/rtld-libc

2020-09-22 Thread Brandon Bergren
Author: bdragon
Date: Wed Sep 23 00:21:51 2020
New Revision: 366039
URL: https://svnweb.freebsd.org/changeset/base/366039

Log:
  [PowerPC64LE] Use a shared LIBC_ARCH for powerpc64le.
  
  Given that we have converted to ELFv2 for BE already, endianness is the only
  difference between the two ARCHs.
  
  As such, there is no need to differentiate LIBC_ARCH between the two.
  
  Combining them like this lets us avoid needing to have two copies of several
  bits for no good reason.
  
  Sponsored by: Tag1 Consulting, Inc.

Modified:
  head/lib/csu/Makefile
  head/lib/libc/Makefile
  head/lib/libc/powerpc64/string/Makefile.inc
  head/libexec/rtld-elf/Makefile
  head/libexec/rtld-elf/rtld-libc/Makefile.inc

Modified: head/lib/csu/Makefile
==
--- head/lib/csu/Makefile   Wed Sep 23 00:13:58 2020(r366038)
+++ head/lib/csu/Makefile   Wed Sep 23 00:21:51 2020(r366039)
@@ -2,8 +2,8 @@
 
 .include 
 
-.if exists(${.CURDIR}/${MACHINE_ARCH})
-SUBDIR+= ${MACHINE_ARCH}
+.if exists(${.CURDIR}/${MACHINE_ARCH:S/powerpc64le/powerpc64/})
+SUBDIR+= ${MACHINE_ARCH:S/powerpc64le/powerpc64/}
 .else
 SUBDIR+= ${MACHINE_CPUARCH}
 .endif

Modified: head/lib/libc/Makefile
==
--- head/lib/libc/Makefile  Wed Sep 23 00:13:58 2020(r366038)
+++ head/lib/libc/Makefile  Wed Sep 23 00:21:51 2020(r366039)
@@ -15,8 +15,8 @@ LIBC_SRCTOP?= ${.CURDIR}
 # named MACHINE_CPUARCH, but some ABIs are different enough to require
 # their own libc, so allow a directory named MACHINE_ARCH to override this.
 
-.if exists(${LIBC_SRCTOP}/${MACHINE_ARCH})
-LIBC_ARCH=${MACHINE_ARCH}
+.if exists(${LIBC_SRCTOP}/${MACHINE_ARCH:S/powerpc64le/powerpc64/})
+LIBC_ARCH=${MACHINE_ARCH:S/powerpc64le/powerpc64/}
 .else
 LIBC_ARCH=${MACHINE_CPUARCH}
 .endif

Modified: head/lib/libc/powerpc64/string/Makefile.inc
==
--- head/lib/libc/powerpc64/string/Makefile.inc Wed Sep 23 00:13:58 2020
(r366038)
+++ head/lib/libc/powerpc64/string/Makefile.inc Wed Sep 23 00:21:51 2020
(r366039)
@@ -10,9 +10,14 @@ MDSRCS+= \
memmove.S \
memmove_vsx.S \
memmove_resolver.c \
-   strcpy_arch_2_05.S \
-   strcpy.c \
-   strcpy_resolver.c \
strncpy_arch_2_05.S \
strncpy.c \
strncpy_resolver.c
+
+# XXX Port strcpy to LE.
+.if ${MACHINE_ARCH} == "powerpc64"
+MDSRCS+= \
+   strcpy_arch_2_05.S \
+   strcpy.c \
+   strcpy_resolver.c
+.endif

Modified: head/libexec/rtld-elf/Makefile
==
--- head/libexec/rtld-elf/Makefile  Wed Sep 23 00:13:58 2020
(r366038)
+++ head/libexec/rtld-elf/Makefile  Wed Sep 23 00:21:51 2020
(r366039)
@@ -32,8 +32,8 @@ MAN?= rtld.1
 ACFLAGS+=  -DLOCORE
 CFLAGS+=   -Wall -DFREEBSD_ELF -DIN_RTLD -ffreestanding
 CFLAGS+=   -I${SRCTOP}/lib/csu/common
-.if exists(${RTLD_ELF_DIR}/${MACHINE_ARCH})
-RTLD_ARCH= ${MACHINE_ARCH}
+.if exists(${RTLD_ELF_DIR}/${MACHINE_ARCH:S/powerpc64le/powerpc64/})
+RTLD_ARCH= ${MACHINE_ARCH:S/powerpc64le/powerpc64/}
 .else
 RTLD_ARCH= ${MACHINE_CPUARCH}
 .endif

Modified: head/libexec/rtld-elf/rtld-libc/Makefile.inc
==
--- head/libexec/rtld-elf/rtld-libc/Makefile.incWed Sep 23 00:13:58 
2020(r366038)
+++ head/libexec/rtld-elf/rtld-libc/Makefile.incWed Sep 23 00:21:51 
2020(r366039)
@@ -5,8 +5,8 @@
 .include 
 
 LIBC_SRCTOP=${SRCTOP}/lib/libc
-.if exists(${LIBC_SRCTOP}/${MACHINE_ARCH})
-LIBC_ARCH=${MACHINE_ARCH}
+.if exists(${LIBC_SRCTOP}/${MACHINE_ARCH:S/powerpc64le/powerpc64/})
+LIBC_ARCH=${MACHINE_ARCH:S/powerpc64le/powerpc64/}
 .else
 LIBC_ARCH=${MACHINE_CPUARCH}
 .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"


svn commit: r366038 - head/sys/powerpc/pseries

2020-09-22 Thread Brandon Bergren
Author: bdragon
Date: Wed Sep 23 00:13:58 2020
New Revision: 366038
URL: https://svnweb.freebsd.org/changeset/base/366038

Log:
  [PowerPC64LE] Fix endianness issues in phyp_vscsi.
  
  Unlike virtio, which in legacy mode is guest endian, the hypervisor vscsi
  interface operates in big endian, so we must convert back and forth in several
  places.
  
  These changes are enough to attach a rootdisk.
  
  Sponsored by: Tag1 Consulting, Inc.

Modified:
  head/sys/powerpc/pseries/phyp_vscsi.c

Modified: head/sys/powerpc/pseries/phyp_vscsi.c
==
--- head/sys/powerpc/pseries/phyp_vscsi.c   Wed Sep 23 00:09:29 2020
(r366037)
+++ head/sys/powerpc/pseries/phyp_vscsi.c   Wed Sep 23 00:13:58 2020
(r366038)
@@ -506,7 +506,8 @@ vscsi_srp_login(struct vscsi_softc *sc)
TAILQ_INSERT_TAIL(>active_xferq, xp, queue);
 
/* Set up command */
-   xp->srp_iu_size = crq.iu_length = 64;
+   xp->srp_iu_size = 64;
+   crq.iu_length = htobe16(xp->srp_iu_size);
err = vmem_alloc(xp->sc->srp_iu_arena, xp->srp_iu_size,
M_BESTFIT | M_NOWAIT, >srp_iu_offset);
if (err)
@@ -524,11 +525,12 @@ vscsi_srp_login(struct vscsi_softc *sc)
/* Create CRQ entry */
crq.valid = 0x80;
crq.format = 0x01;
-   crq.iu_data = xp->sc->srp_iu_phys + xp->srp_iu_offset;
+   crq.iu_data = htobe64(xp->sc->srp_iu_phys + xp->srp_iu_offset);
bus_dmamap_sync(sc->crq_tag, sc->crq_map, BUS_DMASYNC_PREWRITE);
 
-   err = phyp_hcall(H_SEND_CRQ, xp->sc->unit, ((uint64_t *)())[0],
-   ((uint64_t *)())[1]);
+   err = phyp_hcall(H_SEND_CRQ, xp->sc->unit,
+   be64toh(((uint64_t *)())[0]),
+   be64toh(((uint64_t *)())[1]));
if (err != 0)
panic("CRQ send failure (%d)", err);
 }
@@ -550,7 +552,8 @@ vscsi_task_management(struct vscsi_softc *sc, union cc
TAILQ_REMOVE(>free_xferq, xp, queue);
TAILQ_INSERT_TAIL(>active_xferq, xp, queue);
 
-   xp->srp_iu_size = crq.iu_length = sizeof(*cmd);
+   xp->srp_iu_size = sizeof(*cmd);
+   crq.iu_length = htobe16(xp->srp_iu_size);
err = vmem_alloc(xp->sc->srp_iu_arena, xp->srp_iu_size,
M_BESTFIT | M_NOWAIT, >srp_iu_offset);
if (err)
@@ -577,10 +580,11 @@ vscsi_task_management(struct vscsi_softc *sc, union cc
/* Create CRQ entry */
crq.valid = 0x80;
crq.format = 0x01;
-   crq.iu_data = xp->sc->srp_iu_phys + xp->srp_iu_offset;
+   crq.iu_data = htobe64(xp->sc->srp_iu_phys + xp->srp_iu_offset);
 
-   err = phyp_hcall(H_SEND_CRQ, xp->sc->unit, ((uint64_t *)())[0],
-   ((uint64_t *)())[1]);
+   err = phyp_hcall(H_SEND_CRQ, xp->sc->unit,
+   be64toh(((uint64_t *)())[0]),
+   be64toh(((uint64_t *)())[1]));
if (err != 0)
panic("CRQ send failure (%d)", err);
 }
@@ -605,9 +609,9 @@ vscsi_scsi_command(void *xxp, bus_dma_segment_t *segs,
ccb->csio.cdb_io.cdb_ptr : ccb->csio.cdb_io.cdb_bytes;
 
/* Command format from Table 20, page 37 of SRP spec */
-   crq.iu_length = 48 + ((nsegs > 1) ? 20 : 16) + 
+   xp->srp_iu_size = 48 + ((nsegs > 1) ? 20 : 16) +
((ccb->csio.cdb_len > 16) ? (ccb->csio.cdb_len - 16) : 0);
-   xp->srp_iu_size = crq.iu_length;
+   crq.iu_length = htobe16(xp->srp_iu_size);
if (nsegs > 1)
xp->srp_iu_size += nsegs*16;
xp->srp_iu_size = roundup(xp->srp_iu_size, 16);
@@ -644,19 +648,20 @@ vscsi_scsi_command(void *xxp, bus_dma_segment_t *segs,
 
desc_start = ((ccb->csio.cdb_len > 16) ?
ccb->csio.cdb_len - 16 : 0);
-   chunk_addr = xp->sc->srp_iu_phys + xp->srp_iu_offset + 20 +
-   desc_start + sizeof(*cmd);
-   chunk_size = 16*nsegs;
+   chunk_addr = htobe64(xp->sc->srp_iu_phys + xp->srp_iu_offset + 
20 +
+   desc_start + sizeof(*cmd));
+   chunk_size = htobe32(16*nsegs);
memcpy(>data_payload[desc_start], _addr, 8);
memcpy(>data_payload[desc_start+12], _size, 4);
chunk_size = 0;
for (i = 0; i < nsegs; i++)
chunk_size += segs[i].ds_len;
+   chunk_size = htobe32(chunk_size);
memcpy(>data_payload[desc_start+16], _size, 4);
desc_start += 20;
for (i = 0; i < nsegs; i++) {
-   chunk_addr = segs[i].ds_addr;
-   chunk_size = segs[i].ds_len;
+   chunk_addr = htobe64(segs[i].ds_addr);
+   chunk_size = htobe32(segs[i].ds_len);
 
memcpy(>data_payload[desc_start + 16*i],
_addr, 8);
@@ -685,8 +690,8 @@ vscsi_scsi_command(void *xxp, bus_dma_segment_t *segs,
 * 4 byte length
  

svn commit: r366037 - in head/sys: conf powerpc/conf powerpc/ofw powerpc/powernv

2020-09-22 Thread Brandon Bergren
Author: bdragon
Date: Wed Sep 23 00:09:29 2020
New Revision: 366037
URL: https://svnweb.freebsd.org/changeset/base/366037

Log:
  [PowerPC64LE] Work around qemu TCG bug in mtmsrd emulation.
  
  The TCG implementation of mtmsrd in qemu blindly copies the entire register
  to the MSR, instead of the specific bit positions listed in the ISA.
  
  This means that qemu will prematurely switch endian out from under the
  running code instead of waiting for the rfid, causing an immediate trap
  as it attempts to interpret the next instruction in the wrong endianness.
  
  To work around this, ensure PSL_LE is still set before doing the mtmsrd.
  
  In the future, we may wish to just turn off translation and unconditionally
  use rfid to switch to the ofmsr instead of quasi-switching to the ofmsr.
  
  Add a new platform option so this can be disabled. (And so that we can
  conditonalize additional QEMU-specific hacks in the platform code.)
  
  Sponsored by: Tag1 Consulting, Inc.

Modified:
  head/sys/conf/options.powerpc
  head/sys/powerpc/conf/GENERIC64
  head/sys/powerpc/conf/NOTES
  head/sys/powerpc/ofw/ofwcall64.S
  head/sys/powerpc/powernv/opalcall.S

Modified: head/sys/conf/options.powerpc
==
--- head/sys/conf/options.powerpc   Wed Sep 23 00:06:48 2020
(r366036)
+++ head/sys/conf/options.powerpc   Wed Sep 23 00:09:29 2020
(r366037)
@@ -29,6 +29,7 @@ MAMBO
 POWERNVopt_platform.h
 PSERIES
 PSIM
+QEMU   opt_platform.h
 
 SC_OFWFB   opt_ofwfb.h
 

Modified: head/sys/powerpc/conf/GENERIC64
==
--- head/sys/powerpc/conf/GENERIC64 Wed Sep 23 00:06:48 2020
(r366036)
+++ head/sys/powerpc/conf/GENERIC64 Wed Sep 23 00:09:29 2020
(r366037)
@@ -30,6 +30,7 @@ makeoptions   WITH_CTF=1
 optionsPOWERMAC#NewWorld Apple PowerMacs
 optionsPS3 #Sony Playstation 3
 optionsMAMBO   #IBM Mambo Full System Simulator
+optionsQEMU#QEMU processor emulator
 optionsPSERIES #PAPR-compliant systems (e.g. IBM p)
 optionsPOWERNV #Non-virtualized OpenPOWER systems
 

Modified: head/sys/powerpc/conf/NOTES
==
--- head/sys/powerpc/conf/NOTES Wed Sep 23 00:06:48 2020(r366036)
+++ head/sys/powerpc/conf/NOTES Wed Sep 23 00:09:29 2020(r366037)
@@ -44,6 +44,7 @@ options   POWERMAC#NewWorld Apple 
PowerMacs
 #options   PS3 #Sony Playstation 3
 optionsPSIM#GDB PSIM ppc simulator
 optionsMAMBO   #IBM Mambo Full System Simulator
+optionsQEMU#QEMU processor emulator
 
 # The cpufreq(4) driver provides support for CPU frequency control
 device cpufreq

Modified: head/sys/powerpc/ofw/ofwcall64.S
==
--- head/sys/powerpc/ofw/ofwcall64.SWed Sep 23 00:06:48 2020
(r366036)
+++ head/sys/powerpc/ofw/ofwcall64.SWed Sep 23 00:09:29 2020
(r366037)
@@ -32,6 +32,8 @@
 #include 
 #include 
 
+#include "opt_platform.h"
+
 #defineOFWSTKSZ4096/* 4K Open Firmware stack */
 
 /*
@@ -119,6 +121,10 @@ ASENTRY_NOPROF(ofwcall)
addis   %r5,%r2,TOC_REF(ofmsr)@ha
ld  %r5,TOC_REF(ofmsr)@l(%r5)
ld  %r5,0(%r5)
+#if defined(__LITTLE_ENDIAN__) && defined(QEMU)
+   /* QEMU hack: qemu does not emulate mtmsrd correctly! */
+   ori %r5,%r5,1   /* Leave PSR_LE set */
+#endif
mtmsrd  %r5
isync
 
@@ -270,6 +276,10 @@ ASENTRY_NOPROF(rtascall)
addis   %r7,%r2,TOC_REF(rtasmsr)@ha
ld  %r7,TOC_REF(rtasmsr)@l(%r7)
ld  %r7,0(%r7)
+#ifdef __LITTLE_ENDIAN__
+   /* QEMU hack: qemu does not emulate mtmsrd correctly! */
+   ori %r7,%r7,1   /* Leave PSR_LE set */
+#endif
mtmsrd  %r7
isync
 

Modified: head/sys/powerpc/powernv/opalcall.S
==
--- head/sys/powerpc/powernv/opalcall.S Wed Sep 23 00:06:48 2020
(r366036)
+++ head/sys/powerpc/powernv/opalcall.S Wed Sep 23 00:09:29 2020
(r366037)
@@ -27,6 +27,8 @@
 
 #include 
 
+#include "opt_platform.h"
+
 GLOBAL(opal_entrypoint)
.llong  0
 GLOBAL(opal_data)
@@ -70,8 +72,17 @@ ASENTRY(opal_call)
ld  %r2,TOC_REF(opal_data)@l(%r2)
ld  %r2,0(%r2)
 
+
+#if defined(__LITTLE_ENDIAN__) && defined(QEMU)
+   /* QEMU hack: qemu does not emulate mtmsrd correctly! */
+   ori %r3,%r3,1   /* Leave PSR_LE set */
+#endif
mtmsrd  %r3
isync

svn commit: r366036 - in head/sys/powerpc: powernv pseries

2020-09-22 Thread Brandon Bergren
Author: bdragon
Date: Wed Sep 23 00:06:48 2020
New Revision: 366036
URL: https://svnweb.freebsd.org/changeset/base/366036

Log:
  [PowerPC64LE] Fix endianness issues in phyp and opal consoles.
  
  This applies to both pseries and powernv, which were tested at different
  points during the patchset development.
  
  Sponsored by: Tag1 Consulting, Inc.

Modified:
  head/sys/powerpc/powernv/opal_console.c
  head/sys/powerpc/pseries/phyp_console.c

Modified: head/sys/powerpc/powernv/opal_console.c
==
--- head/sys/powerpc/powernv/opal_console.c Wed Sep 23 00:03:35 2020
(r366035)
+++ head/sys/powerpc/powernv/opal_console.c Wed Sep 23 00:06:48 2020
(r366036)
@@ -25,6 +25,7 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include 
 #include 
 #include 
 #include 
@@ -323,7 +324,7 @@ uart_opal_get(struct uart_opal_softc *sc, void *buffer
int hdr = 0;
 
if (sc->protocol == OPAL_RAW) {
-   uint64_t len = bufsize;
+   uint64_t len = htobe64(bufsize);
uint64_t olen = (uint64_t)
uint64_t obuf = (uint64_t)buffer;
 
@@ -336,7 +337,7 @@ uart_opal_get(struct uart_opal_softc *sc, void *buffer
if (err != OPAL_SUCCESS)
return (-1);
 
-   bufsize = len;
+   bufsize = be64toh(len);
} else {
uart_lock(>sc_mtx);
if (sc->inbuflen == 0) {
@@ -347,6 +348,7 @@ uart_opal_get(struct uart_opal_softc *sc, void *buffer
return (-1);
}
hdr = 1; 
+   sc->inbuflen = be64toh(sc->inbuflen);
}
 
if (sc->inbuflen == 0) {
@@ -391,7 +393,9 @@ uart_opal_put(struct uart_opal_softc *sc, void *buffer
len = bufsize;
 
uart_opal_real_map_outbuffer(, );
+   *(uint64_t*)olen = htobe64(*(uint64_t*)olen);
err = opal_call(OPAL_CONSOLE_WRITE, sc->vtermid, olen, obuf);
+   *(uint64_t*)olen = be64toh(*(uint64_t*)olen);
uart_opal_real_unmap_outbuffer();
} else {
uart_lock(>sc_mtx);
@@ -406,7 +410,9 @@ uart_opal_put(struct uart_opal_softc *sc, void *buffer
len = 4 + bufsize;
 
uart_opal_real_map_outbuffer(, );
+   *(uint64_t*)olen = htobe64(*(uint64_t*)olen);
err = opal_call(OPAL_CONSOLE_WRITE, sc->vtermid, olen, obuf);
+   *(uint64_t*)olen = be64toh(*(uint64_t*)olen);
uart_opal_real_unmap_outbuffer();
 
uart_unlock(>sc_mtx);

Modified: head/sys/powerpc/pseries/phyp_console.c
==
--- head/sys/powerpc/pseries/phyp_console.c Wed Sep 23 00:03:35 2020
(r366035)
+++ head/sys/powerpc/pseries/phyp_console.c Wed Sep 23 00:06:48 2020
(r366036)
@@ -27,6 +27,7 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include 
 #include 
 #include 
 #include 
@@ -306,6 +307,11 @@ uart_phyp_get(struct uart_phyp_softc *sc, void *buffer
return (0);
}
 
+#if BYTE_ORDER == LITTLE_ENDIAN
+   sc->phyp_inbuf.u64[0] = be64toh(sc->phyp_inbuf.u64[0]);
+   sc->phyp_inbuf.u64[1] = be64toh(sc->phyp_inbuf.u64[1]);
+#endif
+
if ((sc->protocol == HVTERMPROT) && (hdr == 1)) {
sc->inbuflen = sc->inbuflen - 4;
/* The VTERM protocol has a 4 byte header, skip it here. */
@@ -380,8 +386,8 @@ uart_phyp_put(struct uart_phyp_softc *sc, void *buffer
}
 
do {
-   err = phyp_hcall(H_PUT_TERM_CHAR, sc->vtermid, len, cbuf.u64[0],
-   cbuf.u64[1]);
+   err = phyp_hcall(H_PUT_TERM_CHAR, sc->vtermid, len, 
htobe64(cbuf.u64[0]),
+   htobe64(cbuf.u64[1]));
DELAY(100);
} while (err == H_BUSY);
 
___
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: r366035 - head/sys/powerpc/pseries

2020-09-22 Thread Brandon Bergren
Author: bdragon
Date: Wed Sep 23 00:03:35 2020
New Revision: 366035
URL: https://svnweb.freebsd.org/changeset/base/366035

Log:
  [PowerPC64LE] Tell the hypervisor to switch interrupts to LE at CHRP attach.
  
  Since we will need to be able to take traps relatively early in the process,
  ensure that the hypervisor changes our ILE for us as soon as we are ready.
  
  Sponsored by: Tag1 Consulting, Inc.

Modified:
  head/sys/powerpc/pseries/phyp-hvcall.h
  head/sys/powerpc/pseries/platform_chrp.c

Modified: head/sys/powerpc/pseries/phyp-hvcall.h
==
--- head/sys/powerpc/pseries/phyp-hvcall.h  Tue Sep 22 23:59:02 2020
(r366034)
+++ head/sys/powerpc/pseries/phyp-hvcall.h  Wed Sep 23 00:03:35 2020
(r366035)
@@ -170,6 +170,13 @@
 #define H_PP1 (1UL<<(63-62))
 #define H_PP2 (1UL<<(63-63))
 
+/* H_SET_MODE resource identifiers from 14.5.4.3.5. */
+#defineH_SET_MODE_RSRC_CIABR   0x1 /* All versions */
+#defineH_SET_MODE_RSRC_DAWR0   0x2 /* All versions */
+#defineH_SET_MODE_RSRC_INTR_TRANS_MODE 0x3 /* All versions */
+#defineH_SET_MODE_RSRC_ILE 0x4 /* PAPR 2.8 / ISA 2.07 
*/
+#defineH_SET_MODE_RSRC_DAWR1   0x5 /* ISA 3.1 Future 
support */
+
 /* pSeries hypervisor opcodes. */
 #define H_REMOVE   0x04
 #define H_ENTER0x08

Modified: head/sys/powerpc/pseries/platform_chrp.c
==
--- head/sys/powerpc/pseries/platform_chrp.cTue Sep 22 23:59:02 2020
(r366034)
+++ head/sys/powerpc/pseries/platform_chrp.cWed Sep 23 00:03:35 2020
(r366035)
@@ -136,6 +136,9 @@ chrp_attach(platform_t plat)
int quiesce;
 #ifdef __powerpc64__
int i;
+#if BYTE_ORDER == LITTLE_ENDIAN
+   int result;
+#endif
 
/* XXX: check for /rtas/ibm,hypertas-functions? */
if (!(mfmsr() & PSL_HV)) {
@@ -171,6 +174,24 @@ chrp_attach(platform_t plat)
 
/* Set up hypervisor CPU stuff */
chrp_smp_ap_init(plat);
+
+#if BYTE_ORDER == LITTLE_ENDIAN
+   /*
+* Ask the hypervisor to update the LPAR ILE bit.
+*
+* This involves all processors reentering the hypervisor
+* so the change appears simultaneously in all processors.
+* This can take a long time.
+*/
+   for(;;) {
+   result = phyp_hcall(H_SET_MODE, 1UL,
+   H_SET_MODE_RSRC_ILE, 0, 0);
+   if (result == H_SUCCESS)
+   break;
+   DELAY(1000);
+   }
+#endif
+
}
 #endif
chrp_cpuref_init();
___
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: r366034 - head/sys/powerpc/ofw

2020-09-22 Thread Brandon Bergren
Author: bdragon
Date: Tue Sep 22 23:59:02 2020
New Revision: 366034
URL: https://svnweb.freebsd.org/changeset/base/366034

Log:
  [PowerPC64LE] Fix endian dependence of ofw_real.c.
  
  Since OFW always runs in big endian in practice, we need to convert several
  bits back and forth.
  
  This is necessary to communicate with SLOF on LE pseries.
  
  Sponsored by: Tag1 Consulting, Inc.

Modified:
  head/sys/powerpc/ofw/ofw_real.c

Modified: head/sys/powerpc/ofw/ofw_real.c
==
--- head/sys/powerpc/ofw/ofw_real.c Tue Sep 22 23:55:34 2020
(r366033)
+++ head/sys/powerpc/ofw/ofw_real.c Tue Sep 22 23:59:02 2020
(r366034)
@@ -60,6 +60,7 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include 
 #include 
 #include 
 #include 
@@ -168,6 +169,9 @@ static caddr_t  of_bounce_virt;
 static off_t   of_bounce_offset;
 static size_t  of_bounce_size;
 
+#define IN(x) htobe32(x)
+#define OUT(x) be32toh(x)
+
 /*
  * To be able to use OFW console on PPC, that requires real mode OFW,
  * the mutex that guards the mapping/unmapping of virtual to physical
@@ -406,13 +410,13 @@ ofw_real_test(ofw_t ofw, const char *name)
cell_t missing;
} args;
 
-   args.name = (cell_t)(uintptr_t)"test";
-   args.nargs = 1;
-   args.nreturns = 1;
+   args.name = IN((cell_t)(uintptr_t)"test");
+   args.nargs = IN(1);
+   args.nreturns = IN(1);
 
ofw_real_start();
 
-   args.service = ofw_real_map(name, strlen(name) + 1);
+   args.service = IN(ofw_real_map(name, strlen(name) + 1));
argsptr = ofw_real_map(, sizeof(args));
if (args.service == 0 || openfirmware((void *)argsptr) == -1) {
ofw_real_stop();
@@ -420,7 +424,7 @@ ofw_real_test(ofw_t ofw, const char *name)
}
ofw_real_unmap(argsptr, , sizeof(args));
ofw_real_stop();
-   return (args.missing);
+   return (OUT(args.missing));
 }
 
 /*
@@ -440,11 +444,11 @@ ofw_real_peer(ofw_t ofw, phandle_t node)
cell_t next;
} args;
 
-   args.name = (cell_t)(uintptr_t)"peer";
-   args.nargs = 1;
-   args.nreturns = 1;
+   args.name = IN((cell_t)(uintptr_t)"peer");
+   args.nargs = IN(1);
+   args.nreturns = IN(1);
 
-   args.node = node;
+   args.node = IN(node);
ofw_real_start();
argsptr = ofw_real_map(, sizeof(args));
if (openfirmware((void *)argsptr) == -1) {
@@ -453,7 +457,7 @@ ofw_real_peer(ofw_t ofw, phandle_t node)
}
ofw_real_unmap(argsptr, , sizeof(args));
ofw_real_stop();
-   return (args.next);
+   return (OUT(args.next));
 }
 
 /* Return the first child of this node or 0. */
@@ -469,11 +473,11 @@ ofw_real_child(ofw_t ofw, phandle_t node)
cell_t child;
} args;
 
-   args.name = (cell_t)(uintptr_t)"child";
-   args.nargs = 1;
-   args.nreturns = 1;
+   args.name = IN((cell_t)(uintptr_t)"child");
+   args.nargs = IN(1);
+   args.nreturns = IN(1);
 
-   args.node = node;
+   args.node = IN(node);
ofw_real_start();
argsptr = ofw_real_map(, sizeof(args));
if (openfirmware((void *)argsptr) == -1) {
@@ -482,7 +486,7 @@ ofw_real_child(ofw_t ofw, phandle_t node)
}
ofw_real_unmap(argsptr, , sizeof(args));
ofw_real_stop();
-   return (args.child);
+   return (OUT(args.child));
 }
 
 /* Return the parent of this node or 0. */
@@ -498,11 +502,11 @@ ofw_real_parent(ofw_t ofw, phandle_t node)
cell_t parent;
} args;
 
-   args.name = (cell_t)(uintptr_t)"parent";
-   args.nargs = 1;
-   args.nreturns = 1;
+   args.name = IN((cell_t)(uintptr_t)"parent");
+   args.nargs = IN(1);
+   args.nreturns = IN(1);
 
-   args.node = node;
+   args.node = IN(node);
ofw_real_start();
argsptr = ofw_real_map(, sizeof(args));
if (openfirmware((void *)argsptr) == -1) {
@@ -511,7 +515,7 @@ ofw_real_parent(ofw_t ofw, phandle_t node)
}
ofw_real_unmap(argsptr, , sizeof(args));
ofw_real_stop();
-   return (args.parent);
+   return (OUT(args.parent));
 }
 
 /* Return the package handle that corresponds to an instance handle. */
@@ -527,11 +531,11 @@ ofw_real_instance_to_package(ofw_t ofw, ihandle_t inst
cell_t package;
} args;
 
-   args.name = (cell_t)(uintptr_t)"instance-to-package";
-   args.nargs = 1;
-   args.nreturns = 1;
+   args.name = IN((cell_t)(uintptr_t)"instance-to-package");
+   args.nargs = IN(1);
+   args.nreturns = IN(1);
 
-   args.instance = instance;
+   args.instance = IN(instance);
ofw_real_start();
argsptr = ofw_real_map(, sizeof(args));
if (openfirmware((void *)argsptr) == -1) {
@@ -540,7 +544,7 @@ ofw_real_instance_to_package(ofw_t ofw, ihandle_t inst
}
  

svn commit: r366033 - in head/sys/powerpc: aim ofw pseries

2020-09-22 Thread Brandon Bergren
Author: bdragon
Date: Tue Sep 22 23:55:34 2020
New Revision: 366033
URL: https://svnweb.freebsd.org/changeset/base/366033

Log:
  [PowerPC64LE] LE bringup work: locore / machdep / platform
  
  This is the initial LE changes required in the machdep code to get as far
  as platform attachment on qemu pseries.
  
  Sponsored by: Tag1 Consulting, Inc.

Modified:
  head/sys/powerpc/aim/aim_machdep.c
  head/sys/powerpc/aim/locore64.S
  head/sys/powerpc/ofw/ofw_machdep.c
  head/sys/powerpc/ofw/ofwcall64.S
  head/sys/powerpc/pseries/platform_chrp.c

Modified: head/sys/powerpc/aim/aim_machdep.c
==
--- head/sys/powerpc/aim/aim_machdep.c  Tue Sep 22 23:49:30 2020
(r366032)
+++ head/sys/powerpc/aim/aim_machdep.c  Tue Sep 22 23:55:34 2020
(r366033)
@@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$");
 #include "opt_kstack_pages.h"
 #include "opt_platform.h"
 
+#include 
 #include 
 #include 
 #include 
@@ -257,6 +258,11 @@ aim_cpu_init(vm_offset_t toc)
psl_kernset |= PSL_SF;
if (mfmsr() & PSL_HV)
psl_kernset |= PSL_HV;
+
+#if BYTE_ORDER == LITTLE_ENDIAN
+   psl_kernset |= PSL_LE;
+#endif
+
 #endif
psl_userset = psl_kernset | PSL_PR;
 #ifdef __powerpc64__

Modified: head/sys/powerpc/aim/locore64.S
==
--- head/sys/powerpc/aim/locore64.S Tue Sep 22 23:49:30 2020
(r366032)
+++ head/sys/powerpc/aim/locore64.S Tue Sep 22 23:55:34 2020
(r366033)
@@ -133,7 +133,11 @@ btext:
  * r7: Magic cookie (0xfb5d104d) to indicate that r6 has loader metadata
  */
.text
-ASENTRY_NOPROF(__start)
+_NAKED_ENTRY(__start)
+
+#ifdef __LITTLE_ENDIAN__
+   RETURN_TO_NATIVE_ENDIAN
+#endif
/* Set 64-bit mode if not yet set before branching to C */
mfmsr   %r20
li  %r21,1

Modified: head/sys/powerpc/ofw/ofw_machdep.c
==
--- head/sys/powerpc/ofw/ofw_machdep.c  Tue Sep 22 23:49:30 2020
(r366032)
+++ head/sys/powerpc/ofw/ofw_machdep.c  Tue Sep 22 23:55:34 2020
(r366033)
@@ -572,6 +572,10 @@ OF_initial_setup(void *fdt_ptr, void *junk, int (*open
ofmsr[0] = mfmsr();
#ifdef __powerpc64__
ofmsr[0] &= ~PSL_SF;
+   #ifdef __LITTLE_ENDIAN__
+   /* Assume OFW is BE. */
+   ofmsr[0] &= ~PSL_LE;
+   #endif
#else
__asm __volatile("mfsprg0 %0" : "="(ofmsr[1]));
#endif
@@ -645,7 +649,7 @@ OF_bootstrap()
 * of its auto-remapping function once the kernel is loaded.
 * This is a dirty hack, but what we have.
 */
-#ifdef _LITTLE_ENDIAN
+#ifdef __LITTLE_ENDIAN__
fdt_bt = _le_tag;
 #else
fdt_bt = _be_tag;

Modified: head/sys/powerpc/ofw/ofwcall64.S
==
--- head/sys/powerpc/ofw/ofwcall64.STue Sep 22 23:49:30 2020
(r366032)
+++ head/sys/powerpc/ofw/ofwcall64.STue Sep 22 23:55:34 2020
(r366033)
@@ -113,6 +113,7 @@ ASENTRY_NOPROF(ofwcall)
/*
 * Set the MSR to the OF value. This has the side effect of disabling
 * exceptions, which is important for the next few steps.
+* This does NOT, however, cause us to switch endianness.
 */
 
addis   %r5,%r2,TOC_REF(ofmsr)@ha
@@ -138,9 +139,28 @@ ASENTRY_NOPROF(ofwcall)
stw %r5,4(%r1)
stw %r5,0(%r1)
 
+#ifdef __LITTLE_ENDIAN__
+   /* Atomic context switch w/ endian change */
+   mtmsrd  %r5, 1  /* Clear PSL_EE|PSL_RI */
+   addis   %r5,%r2,TOC_REF(ofmsr)@ha
+   ld  %r5,TOC_REF(ofmsr)@l(%r5)
+   ld  %r5,0(%r5)
+   mtsrr0  %r4
+   mtsrr1  %r5
+   LOAD_LR_NIA
+1:
+   mflr%r5
+   addi%r5, %r5, (2f-1b)
+   mtlr%r5
+   li  %r5, 0
+   rfid
+2:
+   RETURN_TO_NATIVE_ENDIAN
+#else
/* Finally, branch to OF */
mtctr   %r4
bctrl
+#endif
 
/* Reload stack pointer, MSR, and reference PC from the OFW stack */
ld  %r7,32(%r1)

Modified: head/sys/powerpc/pseries/platform_chrp.c
==
--- head/sys/powerpc/pseries/platform_chrp.cTue Sep 22 23:49:30 2020
(r366032)
+++ head/sys/powerpc/pseries/platform_chrp.cTue Sep 22 23:55:34 2020
(r366033)
@@ -30,6 +30,7 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include 
 #include 
 #include 
 #include 
@@ -414,7 +415,7 @@ chrp_cpuref_init(void)
/* /chosen/cpu */
if (OF_getproplen(chosen, "cpu") == sizeof(ihandle_t)) {
OF_getprop(chosen, "cpu", , sizeof(ibsp));
-   pbsp = OF_instance_to_package(ibsp);
+   pbsp = OF_instance_to_package(be32toh(ibsp));
if (pbsp != -1)
   

svn commit: r366032 - in head: . share/mk stand sys/conf sys/modules sys/powerpc/include

2020-09-22 Thread Brandon Bergren
Author: bdragon
Date: Tue Sep 22 23:49:30 2020
New Revision: 366032
URL: https://svnweb.freebsd.org/changeset/base/366032

Log:
  [PowerPC64LE] Set up powerpc.powerpc64le architecture
  
  This is the initial set up for PowerPC64LE.
  
  The current plan is for this arch to remain experimental for FreeBSD 13.
  
  This started as a weekend learning project for me and kinda snowballed from
  there.
  
  (More to follow momentarily.)
  
  Reviewed by:  imp (earlier version), emaste
  Sponsored by: Tag1 Consulting, Inc.
  Differential Revision:https://reviews.freebsd.org/D26399

Added:
  head/sys/conf/ldscript.powerpc64le   (contents, props changed)
Modified:
  head/Makefile
  head/Makefile.inc1
  head/share/mk/bsd.cpu.mk
  head/share/mk/bsd.endian.mk
  head/share/mk/local.meta.sys.mk
  head/share/mk/src.opts.mk
  head/share/mk/sys.mk
  head/stand/defs.mk
  head/sys/conf/files.powerpc
  head/sys/conf/kern.mk
  head/sys/conf/options.powerpc
  head/sys/modules/Makefile
  head/sys/powerpc/include/param.h

Modified: head/Makefile
==
--- head/Makefile   Tue Sep 22 23:39:14 2020(r366031)
+++ head/Makefile   Tue Sep 22 23:49:30 2020(r366032)
@@ -500,7 +500,7 @@ worlds: .PHONY
 EXTRA_ARCHES_mips= mipsel mipshf mipselhf mips64el mips64hf mips64elhf
 EXTRA_ARCHES_mips+=mipsn32
 # powerpcspe excluded from main list until clang fixed
-EXTRA_ARCHES_powerpc=  powerpcspe
+EXTRA_ARCHES_powerpc=  powerpcspe powerpc64le
 .endif
 TARGETS?=amd64 arm arm64 i386 mips powerpc riscv
 _UNIVERSE_TARGETS= ${TARGETS}

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Tue Sep 22 23:39:14 2020(r366031)
+++ head/Makefile.inc1  Tue Sep 22 23:49:30 2020(r366032)
@@ -152,6 +152,7 @@ KNOWN_ARCHES?=  aarch64/arm64 \
mips64hf/mips \
powerpc \
powerpc64/powerpc \
+   powerpc64le/powerpc \
powerpcspe/powerpc \
riscv64/riscv \
riscv64sf/riscv

Modified: head/share/mk/bsd.cpu.mk
==
--- head/share/mk/bsd.cpu.mkTue Sep 22 23:39:14 2020(r366031)
+++ head/share/mk/bsd.cpu.mkTue Sep 22 23:49:30 2020(r366032)
@@ -128,7 +128,7 @@ _CPUCFLAGS = -Wa,-me500 -msoft-float
 .  else
 _CPUCFLAGS = -mcpu=${CPUTYPE} -mno-powerpc64
 .  endif
-. elif ${MACHINE_ARCH} == "powerpc64"
+. elif ${MACHINE_ARCH:Mpowerpc64*} != ""
 _CPUCFLAGS = -mcpu=${CPUTYPE}
 . elif ${MACHINE_CPUARCH} == "mips"
 # mips[1234], mips32, mips64, and all later releases need to have mips

Modified: head/share/mk/bsd.endian.mk
==
--- head/share/mk/bsd.endian.mk Tue Sep 22 23:39:14 2020(r366031)
+++ head/share/mk/bsd.endian.mk Tue Sep 22 23:49:30 2020(r366032)
@@ -4,6 +4,7 @@
 ${MACHINE_ARCH} == "amd64" || \
 ${MACHINE_ARCH} == "i386" || \
 (${MACHINE} == "arm" && ${MACHINE_ARCH:Marm*eb*} == "") || \
+${MACHINE_ARCH} == "powerpc64le" || \
 ${MACHINE_CPUARCH} == "riscv" || \
 ${MACHINE_ARCH:Mmips*el*} != ""
 TARGET_ENDIANNESS= 1234

Modified: head/share/mk/local.meta.sys.mk
==
--- head/share/mk/local.meta.sys.mk Tue Sep 22 23:39:14 2020
(r366031)
+++ head/share/mk/local.meta.sys.mk Tue Sep 22 23:49:30 2020
(r366032)
@@ -17,7 +17,7 @@ MK_INSTALL_AS_USER= yes
 TARGET_ARCHES_arm?= arm armv6 armv7
 TARGET_ARCHES_arm64?=   aarch64
 TARGET_ARCHES_mips?=mipsel mips mips64el mips64 mipsn32 mipsn32el
-TARGET_ARCHES_powerpc?= powerpc powerpc64 powerpcspe
+TARGET_ARCHES_powerpc?= powerpc powerpc64 powerpc64le powerpcspe
 TARGET_ARCHES_riscv?=   riscv64 riscv64sf
 
 # some corner cases

Modified: head/share/mk/src.opts.mk
==
--- head/share/mk/src.opts.mk   Tue Sep 22 23:39:14 2020(r366031)
+++ head/share/mk/src.opts.mk   Tue Sep 22 23:49:30 2020(r366032)
@@ -354,14 +354,14 @@ BROKEN_OPTIONS+=MLX5TOOL
 BROKEN_OPTIONS+=HYPERV
 .endif
 
-# NVME is only aarch64, x86 and powerpc64
+# NVME is only aarch64, x86 and powerpc64*
 .if ${__T} != "aarch64" && ${__T} != "amd64" && ${__T} != "i386" && \
-${__T} != "powerpc64"
+${__T:Mpowerpc64*} == ""
 BROKEN_OPTIONS+=NVME
 .endif
 
 .if ${__T} == "aarch64" || ${__T} == "amd64" || ${__T} == "i386" || \
-${__T} == "powerpc64"
+${__T:Mpowerpc64*} != ""
 __DEFAULT_YES_OPTIONS+=OPENMP
 .else
 __DEFAULT_NO_OPTIONS+=OPENMP

Modified: head/share/mk/sys.mk
==
--- head/share/mk/sys.mkTue Sep 22 23:39:14 2020(r366031)
+++ head/share/mk/sys.mk   

svn commit: r366031 - head/share/man/man9

2020-09-22 Thread Konstantin Belousov
Author: kib
Date: Tue Sep 22 23:39:14 2020
New Revision: 366031
URL: https://svnweb.freebsd.org/changeset/base/366031

Log:
  Remove stray line

Modified:
  head/share/man/man9/Makefile

Modified: head/share/man/man9/Makefile
==
--- head/share/man/man9/MakefileTue Sep 22 23:28:06 2020
(r366030)
+++ head/share/man/man9/MakefileTue Sep 22 23:39:14 2020
(r366031)
@@ -124,7 +124,6 @@ MAN=accept_filter.9 \
devctl_notify.9 \
devctl_process_running.9 \
devctl_safe_quote_sb.9 \
-   devctl_
devstat.9 \
devtoname.9 \
disk.9 \
___
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: r366030 - head/sys/amd64/amd64

2020-09-22 Thread Konstantin Belousov
Author: kib
Date: Tue Sep 22 23:28:06 2020
New Revision: 366030
URL: https://svnweb.freebsd.org/changeset/base/366030

Log:
  amd64 pmap: More unification for psind = 1 vs 2 in pmap_enter_largepage().
  
  Move
pkru check
wait for page alloc
wire accounting update
asserting allowed updates for valid mappings
  out of psind conditions.
  
  Also add assert that psind references supported page size.
  Remove not true comment.
  Avoid uneccessary page table walks from top level.
  
  Reviewed by:  alc, markj (previous version)
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week
  Differential revision:https://reviews.freebsd.org/D26513

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

Modified: head/sys/amd64/amd64/pmap.c
==
--- head/sys/amd64/amd64/pmap.c Tue Sep 22 23:27:09 2020(r366029)
+++ head/sys/amd64/amd64/pmap.c Tue Sep 22 23:28:06 2020(r366030)
@@ -6479,7 +6479,7 @@ pmap_enter_largepage(pmap_t pmap, vm_offset_t va, pt_e
pt_entry_t origpte, *pml4e, *pdpe, *pde, pten, PG_V;
 
PMAP_LOCK_ASSERT(pmap, MA_OWNED);
-   KASSERT(psind > 0 && psind < MAXPAGESIZES,
+   KASSERT(psind > 0 && psind < MAXPAGESIZES && pagesizes[psind] != 0,
("psind %d unexpected", psind));
KASSERT(((newpte & PG_FRAME) & (pagesizes[psind] - 1)) == 0,
("unaligned phys address %#lx newpte %#lx psind %d",
@@ -6494,38 +6494,25 @@ pmap_enter_largepage(pmap_t pmap, vm_offset_t va, pt_e
PG_V = pmap_valid_bit(pmap);
 
 restart:
+   if (!pmap_pkru_same(pmap, va, va + pagesizes[psind]))
+   return (KERN_PROTECTION_FAILURE);
pten = newpte;
if (va < VM_MAXUSER_ADDRESS && pmap->pm_type == PT_X86)
pten |= pmap_pkru_get(pmap, va);
 
if (psind == 2) {   /* 1G */
-   if (!pmap_pkru_same(pmap, va, va + NBPDP))
-   return (KERN_PROTECTION_FAILURE);
pml4e = pmap_pml4e(pmap, va);
if (pml4e == NULL || (*pml4e & PG_V) == 0) {
mp = _pmap_allocpte(pmap, pmap_pml4e_pindex(va),
NULL, va);
-   if (mp == NULL) {
-   if ((flags & PMAP_ENTER_NOSLEEP) != 0)
-   return (KERN_RESOURCE_SHORTAGE);
-   PMAP_UNLOCK(pmap);
-   vm_wait(NULL);
-   PMAP_LOCK(pmap);
-
-   /*
-* Restart at least to recalcuate the pkru
-* key.  Our caller must keep the map locked
-* so no paging structure can be validated
-* under us.
-*/
-   goto restart;
-   }
-   pdpe = pmap_pdpe(pmap, va);
-   KASSERT(pdpe != NULL, ("va %#lx lost pdpe", va));
+   if (mp == NULL)
+   goto allocf;
+   pdpe = (pdp_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(mp));
+   pdpe = [pmap_pdpe_index(va)];
origpte = *pdpe;
MPASS(origpte == 0);
} else {
-   pdpe = pmap_pdpe(pmap, va);
+   pdpe = pmap_pml4e_to_pdpe(pml4e, va);
KASSERT(pdpe != NULL, ("va %#lx lost pdpe", va));
origpte = *pdpe;
if ((origpte & PG_V) == 0) {
@@ -6533,57 +6520,49 @@ restart:
mp->ref_count++;
}
}
-   KASSERT((origpte & PG_V) == 0 || ((origpte & PG_PS) != 0 &&
-   (origpte & PG_FRAME) == (pten & PG_FRAME)),
-   ("va %#lx changing 1G phys page pdpe %#lx pten %#lx",
-   va, origpte, pten));
-   if ((pten & PG_W) != 0 && (origpte & PG_W) == 0)
-   pmap->pm_stats.wired_count += NBPDP / PAGE_SIZE;
-   else if ((pten & PG_W) == 0 && (origpte & PG_W) != 0)
-   pmap->pm_stats.wired_count -= NBPDP / PAGE_SIZE;
*pdpe = pten;
} else /* (psind == 1) */ { /* 2M */
-   if (!pmap_pkru_same(pmap, va, va + NBPDR))
-   return (KERN_PROTECTION_FAILURE);
pde = pmap_pde(pmap, va);
if (pde == NULL) {
mp = _pmap_allocpte(pmap, pmap_pdpe_pindex(va),
NULL, va);
-   if (mp == NULL) {
-   if ((flags & PMAP_ENTER_NOSLEEP) != 0)
-   return (KERN_RESOURCE_SHORTAGE);
-   PMAP_UNLOCK(pmap);
- 

svn commit: r366029 - head/stand/ficl

2020-09-22 Thread Brandon Bergren
Author: bdragon
Date: Tue Sep 22 23:27:09 2020
New Revision: 366029
URL: https://svnweb.freebsd.org/changeset/base/366029

Log:
  Tweak ficl definition from r365724
  
  I had overthought how to do the FICL_TRUE change. We do not need to
  explicitly specify how big the 0 is before the cast to the correct size.
  
  The same change was suggested by both imp@ and Gunther Nikl independently.
  
  Tested on powerpc.
  
  Reported by:  imp, Gunther Nikl

Modified:
  head/stand/ficl/ficl.h

Modified: head/stand/ficl/ficl.h
==
--- head/stand/ficl/ficl.h  Tue Sep 22 23:13:29 2020(r366028)
+++ head/stand/ficl/ficl.h  Tue Sep 22 23:27:09 2020(r366029)
@@ -249,7 +249,7 @@ typedef struct ficl_system_info FICL_SYSTEM_INFO;
 ** complement of false... that unifies logical and bitwise operations
 ** nicely.
 */
-#define FICL_TRUE  ((FICL_UNS)~(0LL))
+#define FICL_TRUE  (~(FICL_UNS)0)
 #define FICL_FALSE (0)
 #define FICL_BOOL(x) ((x) ? FICL_TRUE : FICL_FALSE)
 
___
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: r365643 - head/bin/cp

2020-09-22 Thread Kyle Evans
On Tue, Sep 22, 2020, 17:02 Warner Losh  wrote:

>
>
> On Tue, Sep 22, 2020 at 3:55 PM Kyle Evans  wrote:
>
>> On Tue, Sep 22, 2020 at 4:53 PM Ian Lepore  wrote:
>> >
>> > On Tue, 2020-09-22 at 15:50 -0600, Warner Losh wrote:
>> > > I think it's a great leap sideways, but I've done cp /dev/null foo to
>> > > clear
>> > > it out for 35 years now... It's why it feels like a workaround.
>> > >
>> > > Though it is a legit optimization, no matter the feelings. As for
>> > > clearer,
>> > > I'm less sure since then I have to remember what the : operator does.
>> > >
>> > > Warner
>> > >
>> >
>> > For me, :> is idiomatic (but ugly).
>> >
>> > On the other hand, the cp /dev/null had a nice dogfooding aspect to
>> > it... when we broke cp by accident, its use in the build system was the
>> > first alarm to go off.
>> >
>> > --Ian
>> >
>>
>> To be honest, this is a case that really should be covered by
>> regression tests somewhere.
>>
>
> It should (but isn't yet).
>
> Ian is right for old-school FreeBSD thinking. In that thinking the build
> system should use an eclectic mix of tools to act as a fire-wall against
> accidental breakage.
>
> Complete, effective, test suites give much better coverage... if they are
> run...
>
> So until we run tests frequently, with loud regression squawking that's as
> effective as build breakage, I tend to fall in the 'all of the above' camp
> until that's in place... :)
>
> Warner
>
> P.S. though not, if I suppose, if it means that we're slowing down the
> regression coverage uptake...
>

--

The test build was fine, please confirm if I can commit it or if someone
else would like to write the UPDATING notice or start bootstrapping cp on
systems that were affected. I'm not comfortable with not taking any path at
all here, but this is a lot of friction for a small mechanical change to
ease the pain.

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: r366028 - stable/12/release/tools

2020-09-22 Thread Colin Percival
Author: cperciva
Date: Tue Sep 22 23:13:29 2020
New Revision: 366028
URL: https://svnweb.freebsd.org/changeset/base/366028

Log:
  MFC r365696: Spawn the DHCPv6 client in EC2 instances via rtsold.

Modified:
  stable/12/release/tools/ec2.conf
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/release/tools/ec2.conf
==
--- stable/12/release/tools/ec2.confTue Sep 22 23:02:01 2020
(r366027)
+++ stable/12/release/tools/ec2.confTue Sep 22 23:13:29 2020
(r366028)
@@ -6,7 +6,7 @@
 # Packages to install into the image we're creating.  This is a deliberately
 # minimalist set, providing only the packages necessary to bootstrap further
 # package installation as specified via EC2 user-data.
-export VM_EXTRA_PACKAGES="ec2-scripts firstboot-freebsd-update firstboot-pkgs 
dual-dhclient-daemon ebsnvme-id"
+export VM_EXTRA_PACKAGES="ec2-scripts firstboot-freebsd-update firstboot-pkgs 
isc-dhcp44-client ebsnvme-id"
 
 # Include the amazon-ssm-agent package in amd64 images, since some users want
 # to be able to use it on systems which are not connected to the Internet.
@@ -63,9 +63,19 @@ vm_extra_pre_umount() {
# via EC2 user-data.
echo 'firstboot_pkgs_list="awscli"' >> ${DESTDIR}/etc/rc.conf
 
-   # Enable IPv6 on all interfaces, and use DHCP on both IPv4 and IPv6.
+   # Enable IPv6 on all interfaces, and spawn DHCPv6 via rtsold
echo 'ipv6_activate_all_interfaces="YES"' >> ${DESTDIR}/etc/rc.conf
-   echo 'dhclient_program="/usr/local/sbin/dual-dhclient"' >> 
${DESTDIR}/etc/rc.conf
+   echo 'rtsold_enable="YES"' >> ${DESTDIR}/etc/rc.conf
+   echo 'rtsold_flags="-M /usr/local/libexec/rtsold-M -a"' >> 
${DESTDIR}/etc/rc.conf
+
+   # Provide a script which rtsold can use to launch DHCPv6
+   mkdir -p ${DESTDIR}/usr/local/libexec
+   cat > ${DESTDIR}/usr/local/libexec/rtsold-M <<'EOF'
+#!/bin/sh
+
+/usr/local/sbin/dhclient -6 -nw -N -cf /dev/null $1
+EOF
+   chmod 755 ${DESTDIR}/usr/local/libexec/rtsold-M
 
# The EC2 console is output-only, so while printing a backtrace can
# be useful, there's no point dropping into a debugger or waiting
___
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: r366027 - head/share/man/man9

2020-09-22 Thread Warner Losh
Author: imp
Date: Tue Sep 22 23:02:01 2020
New Revision: 366027
URL: https://svnweb.freebsd.org/changeset/base/366027

Log:
  Add devctl_notify(9) man page
  
  Document the calls to send messages to userland via devctl.
  devctl_notify will create a message for the specified system,
  subsystem and type, optionally adding additional information.
  
  Reviewed by: bcr
  Differential Revision: https://reviews.freebsd.org/D26520

Added:
  head/share/man/man9/devctl_notify.9   (contents, props changed)
Modified:
  head/share/man/man9/Makefile

Modified: head/share/man/man9/Makefile
==
--- head/share/man/man9/MakefileTue Sep 22 23:01:57 2020
(r366026)
+++ head/share/man/man9/MakefileTue Sep 22 23:02:01 2020
(r366027)
@@ -121,6 +121,7 @@ MAN=accept_filter.9 \
DEVICE_SHUTDOWN.9 \
DEV_MODULE.9 \
dev_refthread.9 \
+   devctl_notify.9 \
devctl_process_running.9 \
devctl_safe_quote_sb.9 \
devctl_

Added: head/share/man/man9/devctl_notify.9
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/share/man/man9/devctl_notify.9 Tue Sep 22 23:02:01 2020
(r366027)
@@ -0,0 +1,78 @@
+.\"
+.\" Copyright (c) 2020 M Warner Losh
+.\"
+.\" This program is free software.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"notice, this list of conditions and the following disclaimer in the
+.\"documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``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 DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
+.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd September 22, 2020
+.Dt DEVCTL_NOTIFY 9
+.Os
+.Sh NAME
+.Nm devctl_notify
+.Nd Send a message, via devctl, to userland
+.Sh SYNOPSIS
+.In sys/devctl.h
+.Ft void
+.Fn devctl_notify "const char *system" "const char *subsystem" "const char 
*type" "const char *data"
+.Sh DESCRIPTION
+Send a notification to user land via
+.Xr devctl 4 .
+See
+.Xr devctl 4
+for the format of these messages.
+.Pp
+The
+.Nm
+function creates a string using the following template:
+.Bd -literal
+snprintf(buffer, sizeof(buffer), "!system=%s subsystem=%s type=%s",
+   system, subsystem, type);
+.Ed
+.Pp
+The
+.Va system ,
+.Va subsystem ,
+and
+.Va type
+pointers cannot be NULL.
+.Pp
+The
+.Va data
+argument may be NULL (for no additions) or a message formatted
+properly for
+.Xr devctl 4 .
+A space will be added to the above template and this argument copied
+verbatim to form the message passed to userland.
+Senders should balance between only passing data that userland can not
+discover itself and sending all the data userland will want to use to
+decide what to do with the message.
+.Pp
+The current total message length limit is just under 1kb.
+Senders should try to remain well below this limit.
+.Sh SEE ALSO
+.Xr devctl 4 ,
+.Xr devd 8
+.Sh AUTHORS
+This manual page was written by
+.An M. Warner Losh
___
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: r366025 - head/share/man/man9

2020-09-22 Thread Warner Losh
Author: imp
Date: Tue Sep 22 23:01:53 2020
New Revision: 366025
URL: https://svnweb.freebsd.org/changeset/base/366025

Log:
  Document devctl_safe_quote_sb
  
  This routine centralizes the knowledge needed for properly quoting
  'value' in all key="value" items that appear in devctl messages.
  
  Reviewed by: bcr
  Differential Revision: https://reviews.freebsd.org/D26520

Added:
  head/share/man/man9/devctl_safe_quote_sb.9   (contents, props changed)
Modified:
  head/share/man/man9/Makefile

Modified: head/share/man/man9/Makefile
==
--- head/share/man/man9/MakefileTue Sep 22 23:01:44 2020
(r366024)
+++ head/share/man/man9/MakefileTue Sep 22 23:01:53 2020
(r366025)
@@ -122,6 +122,8 @@ MAN=accept_filter.9 \
DEV_MODULE.9 \
dev_refthread.9 \
devctl_process_running.9 \
+   devctl_safe_quote_sb.9 \
+   devctl_
devstat.9 \
devtoname.9 \
disk.9 \

Added: head/share/man/man9/devctl_safe_quote_sb.9
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/share/man/man9/devctl_safe_quote_sb.9  Tue Sep 22 23:01:53 2020
(r366025)
@@ -0,0 +1,57 @@
+.\"
+.\" Copyright (c) 2020 M Warner Losh
+.\"
+.\" This program is free software.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"notice, this list of conditions and the following disclaimer in the
+.\"documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``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 DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
+.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd September 22, 2020
+.Dt DEVCTL_SAFE_QUOTE_SB 9
+.Os
+.Sh NAME
+.Nm devctl_safe_quote_sb
+.Nd Insert a string, properly quoted, into a sbuf
+.Sh SYNOPSIS
+.In sys/devctl.h
+.In sys/sbuf.h
+.Ft void
+.Fn devctl_safe_quote_sb "struct sbuf *sb" "const char *src"
+.Sh DESCRIPTION
+Copy the string from
+.Vn src
+into
+.Vn sb .
+All backslash characters are doubled.
+All double quote characters
+.Sq "
+are also preceded by a backslash.
+All other characters are copied without modification.
+The
+.Xr devctl 4
+protocol requires quoted string to be quoted thus.
+This routine centralizes this knowledge.
+.Sh SEE ALSO
+.Xr devd 8
+.Sh AUTHORS
+This manual page was written by
+.An M. Warner Losh
___
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: r366026 - head/share/man/man4

2020-09-22 Thread Warner Losh
Author: imp
Date: Tue Sep 22 23:01:57 2020
New Revision: 366026
URL: https://svnweb.freebsd.org/changeset/base/366026

Log:
  Document quoting requirements for the devctl protocol
  
  Belatedly document the quoting requirements for the devctl protocol. I
  thought they'd been previously documented.
  
  Also, while I'm here, make igor happy.
  
  Reviewed by: bcr
  Differential Revision: https://reviews.freebsd.org/D26520

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

Modified: head/share/man/man4/devctl.4
==
--- head/share/man/man4/devctl.4Tue Sep 22 23:01:53 2020
(r366025)
+++ head/share/man/man4/devctl.4Tue Sep 22 23:01:57 2020
(r366026)
@@ -23,12 +23,16 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 26, 2014
+.Dd September 21, 2020
 .Dt DEVCTL 4
 .Os
 .Sh NAME
 .Nm devctl
 .Nd "device event reporting and device control interface"
+.Sh SYNOPSIS
+The
+.Nm
+driver is automatically included in the kernel.
 .Sh DESCRIPTION
 The
 .Nm
@@ -124,5 +128,17 @@ driver.
 The attach message driver has already claimed this device.
 One cannot use the detach messages to flush data to the device.
 The device is already gone.
+.Pp
+All values passed back are of the form
+.Sq key=value
+or
+.Sq key="value" .
+When the latter, the string
+.Dq value
+must have any internal backslashes doubled.
+It must also have any internal double quote characters
+.Sq "
+preceded by a backslash.
+All other characters should be passed through.
 .Sh SEE ALSO
 .Xr devd 8
___
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: r366024 - head/share/man/man9

2020-09-22 Thread Warner Losh
Author: imp
Date: Tue Sep 22 23:01:44 2020
New Revision: 366024
URL: https://svnweb.freebsd.org/changeset/base/366024

Log:
  Add a devctl_process_running man page.
  
  Reviewed by: bcr
  Differential Revision: https://reviews.freebsd.org/D26520

Added:
  head/share/man/man9/devctl_process_running.9   (contents, props changed)
Modified:
  head/share/man/man9/Makefile

Modified: head/share/man/man9/Makefile
==
--- head/share/man/man9/MakefileTue Sep 22 22:54:54 2020
(r366023)
+++ head/share/man/man9/MakefileTue Sep 22 23:01:44 2020
(r366024)
@@ -121,6 +121,7 @@ MAN=accept_filter.9 \
DEVICE_SHUTDOWN.9 \
DEV_MODULE.9 \
dev_refthread.9 \
+   devctl_process_running.9 \
devstat.9 \
devtoname.9 \
disk.9 \

Added: head/share/man/man9/devctl_process_running.9
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/share/man/man9/devctl_process_running.9Tue Sep 22 23:01:44 
2020(r366024)
@@ -0,0 +1,60 @@
+.\"
+.\" Copyright (c) 2020 M Warner Losh
+.\"
+.\" This program is free software.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"notice, this list of conditions and the following disclaimer in the
+.\"documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``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 DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
+.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd September 22, 2020
+.Dt DEVCTL_PROCESS_RUNNING 9
+.Os
+.Sh NAME
+.Nm devctl_process_running
+.Nd Returns true when devctl has a consumer process running
+.Sh SYNOPSIS
+.In sys/devctl.h
+.Ft bool
+.Fn devctl_process_running "void"
+.Sh DESCRIPTION
+The
+.Nm
+call returns
+.Vt true
+when a process has the devctl device open for
+reading, and
+.Vt false
+otherwise.
+One can assume from this that the default
+.Xr devd 8
+or similar is running when
+.Vt true
+is returned.
+Some subsystems will send a message and allow userland to do something
+before proceeding with a default action if there's a timeout.
+This call allows those subsystems to do the default action right away
+when no process is running.
+.Sh SEE ALSO
+.Xr devd 8
+.Sh AUTHORS
+This manual page was written by
+.An M. Warner Losh
___
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: r366023 - head/lib/libc/sys

2020-09-22 Thread Konstantin Belousov
Author: kib
Date: Tue Sep 22 22:54:54 2020
New Revision: 366023
URL: https://svnweb.freebsd.org/changeset/base/366023

Log:
  Document {O,AT}_RESOLVE_BENEATH and new O_BENEATH behavior for relative paths.
  
  PR:   248335
  Reviewed by:  markj
  Tested by:pho
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week
  Differential revision:https://reviews.freebsd.org/D25886

Modified:
  head/lib/libc/sys/access.2
  head/lib/libc/sys/chflags.2
  head/lib/libc/sys/chmod.2
  head/lib/libc/sys/chown.2
  head/lib/libc/sys/fhlink.2
  head/lib/libc/sys/getfh.2
  head/lib/libc/sys/link.2
  head/lib/libc/sys/open.2
  head/lib/libc/sys/stat.2
  head/lib/libc/sys/unlink.2
  head/lib/libc/sys/utimensat.2

Modified: head/lib/libc/sys/access.2
==
--- head/lib/libc/sys/access.2  Tue Sep 22 22:48:12 2020(r366022)
+++ head/lib/libc/sys/access.2  Tue Sep 22 22:54:54 2020(r366023)
@@ -28,7 +28,7 @@
 .\" @(#)access.2   8.2 (Berkeley) 4/1/94
 .\" $FreeBSD$
 .\"
-.Dd March 30, 2020
+.Dd September 23, 2020
 .Dt ACCESS 2
 .Os
 .Sh NAME
@@ -124,6 +124,13 @@ IDs instead of the real user and group ID as required 
 Only operate on files and directories below the topping directory.
 See the description of the
 .Dv O_BENEATH
+flag in the
+.Xr open 2
+manual page.
+.It Dv AT_RESOLVE_BENEATH
+Only walks paths below the topping directory.
+See the description of the
+.Dv O_RESOLVE_BENEATH
 flag in the
 .Xr open 2
 manual page.

Modified: head/lib/libc/sys/chflags.2
==
--- head/lib/libc/sys/chflags.2 Tue Sep 22 22:48:12 2020(r366022)
+++ head/lib/libc/sys/chflags.2 Tue Sep 22 22:54:54 2020(r366023)
@@ -28,7 +28,7 @@
 .\"@(#)chflags.2   8.3 (Berkeley) 5/2/95
 .\" $FreeBSD$
 .\"
-.Dd March 30, 2020
+.Dd September 23, 2020
 .Dt CHFLAGS 2
 .Os
 .Sh NAME
@@ -99,6 +99,13 @@ Only allow to change flags for a file which is beneath
 the topping directory.
 See the description of the
 .Dv O_BENEATH
+flag in the
+.Xr open 2
+manual page.
+.It Dv AT_RESOLVE_BENEATH
+Only walks paths below the topping directory.
+See the description of the
+.Dv O_RESOLVE_BENEATH
 flag in the
 .Xr open 2
 manual page.

Modified: head/lib/libc/sys/chmod.2
==
--- head/lib/libc/sys/chmod.2   Tue Sep 22 22:48:12 2020(r366022)
+++ head/lib/libc/sys/chmod.2   Tue Sep 22 22:54:54 2020(r366023)
@@ -28,7 +28,7 @@
 .\" @(#)chmod.28.1 (Berkeley) 6/4/93
 .\" $FreeBSD$
 .\"
-.Dd March 30, 2020
+.Dd September 23, 2020
 .Dt CHMOD 2
 .Os
 .Sh NAME
@@ -106,6 +106,13 @@ Only allow to change permissions of a file which is be
 the topping directory.
 See the description of the
 .Dv O_BENEATH
+flag in the
+.Xr open 2
+manual page.
+.It Dv AT_RESOLVE_BENEATH
+Only walks paths below the topping directory.
+See the description of the
+.Dv O_RESOLVE_BENEATH
 flag in the
 .Xr open 2
 manual page.

Modified: head/lib/libc/sys/chown.2
==
--- head/lib/libc/sys/chown.2   Tue Sep 22 22:48:12 2020(r366022)
+++ head/lib/libc/sys/chown.2   Tue Sep 22 22:54:54 2020(r366023)
@@ -28,7 +28,7 @@
 .\" @(#)chown.28.4 (Berkeley) 4/19/94
 .\" $FreeBSD$
 .\"
-.Dd March 30, 2020
+.Dd September 23, 2020
 .Dt CHOWN 2
 .Os
 .Sh NAME
@@ -123,6 +123,13 @@ Only allow to change ownership of a file which is bene
 the topping directory.
 See the description of the
 .Dv O_BENEATH
+flag in the
+.Xr open 2
+manual page.
+.It Dv AT_RESOLVE_BENEATH
+Only walks paths below the topping directory.
+See the description of the
+.Dv O_RESOLVE_BENEATH
 flag in the
 .Xr open 2
 manual page.

Modified: head/lib/libc/sys/fhlink.2
==
--- head/lib/libc/sys/fhlink.2  Tue Sep 22 22:48:12 2020(r366022)
+++ head/lib/libc/sys/fhlink.2  Tue Sep 22 22:54:54 2020(r366023)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 30, 2020
+.Dd September 23, 2020
 .Dt FHLINK 2
 .Os
 .Sh NAME
@@ -110,6 +110,13 @@ created.
 Only allow to link to a file which is beneath of the topping directory.
 See the description of the
 .Dv O_BENEATH
+flag in the
+.Xr open 2
+manual page.
+.It Dv AT_RESOLVE_BENEATH
+Only walks paths below the topping directory.
+See the description of the
+.Dv O_RESOLVE_BENEATH
 flag in the
 .Xr open 2
 manual page.

Modified: head/lib/libc/sys/getfh.2
==
--- head/lib/libc/sys/getfh.2   Tue Sep 22 22:48:12 2020(r366022)
+++ head/lib/libc/sys/getfh.2   Tue Sep 22 22:54:54 2020(r366023)
@@ -29,7 +29,7 @@
 .\"@(#)getfh.2 8.1 (Berkeley) 6/9/93
 .\" $FreeBSD$
 .\"
-.Dd March 30, 2020
+.Dd September 23, 2020
 .Dt GETFH 2
 .Os
 .Sh NAME
@@ -109,6 

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

2020-09-22 Thread Konstantin Belousov
Author: kib
Date: Tue Sep 22 22:48:12 2020
New Revision: 366022
URL: https://svnweb.freebsd.org/changeset/base/366022

Log:
  Add O_RESOLVE_BENEATH and AT_RESOLVE_BENEATH to mimic Linux' RESOLVE_BENEATH.
  
  It is like O_BENEATH, but disables to walk out of the subtree rooted
  in the starting directory. O_BENEATH does not care if path walks out
  if it returned.
  
  Requested by: Dan Gohman 
  PR:   248335
  Reviewed by:  markj
  Tested by:pho
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week
  Differential revision:https://reviews.freebsd.org/D25886

Modified:
  head/sys/kern/vfs_lookup.c
  head/sys/kern/vfs_syscalls.c
  head/sys/kern/vfs_vnops.c
  head/sys/sys/fcntl.h
  head/sys/sys/namei.h

Modified: head/sys/kern/vfs_lookup.c
==
--- head/sys/kern/vfs_lookup.c  Tue Sep 22 22:43:32 2020(r366021)
+++ head/sys/kern/vfs_lookup.c  Tue Sep 22 22:48:12 2020(r366022)
@@ -428,6 +428,16 @@ namei_setup(struct nameidata *ndp, struct vnode **dpp,
if (error == 0)
ndp->ni_lcf |= NI_LCF_LATCH;
}
+   if (error == 0 && (cnp->cn_flags & RBENEATH) != 0) {
+   if (cnp->cn_pnbuf[0] == '/' ||
+   (ndp->ni_lcf & NI_LCF_BENEATH_ABS) != 0) {
+   error = EINVAL;
+   } else if ((ndp->ni_lcf & NI_LCF_STRICTRELATIVE) == 0) {
+   ndp->ni_lcf |= NI_LCF_STRICTRELATIVE |
+   NI_LCF_CAP_DOTDOT;
+   }
+   }
+
/*
 * If we are auditing the kernel pathname, save the user pathname.
 */

Modified: head/sys/kern/vfs_syscalls.c
==
--- head/sys/kern/vfs_syscalls.cTue Sep 22 22:43:32 2020
(r366021)
+++ head/sys/kern/vfs_syscalls.cTue Sep 22 22:48:12 2020
(r366022)
@@ -124,6 +124,8 @@ at2cnpflags(u_int at_flags, u_int mask)
at_flags &= mask;
if ((at_flags & AT_BENEATH) != 0)
res |= BENEATH;
+   if ((at_flags & AT_RESOLVE_BENEATH) != 0)
+   res |= RBENEATH;
if ((at_flags & AT_SYMLINK_FOLLOW) != 0)
res |= FOLLOW;
/* NOFOLLOW is pseudo flag */
@@ -1503,11 +1505,13 @@ sys_linkat(struct thread *td, struct linkat_args *uap)
int flag;
 
flag = uap->flag;
-   if ((flag & ~(AT_SYMLINK_FOLLOW | AT_BENEATH)) != 0)
+   if ((flag & ~(AT_SYMLINK_FOLLOW | AT_BENEATH |
+   AT_RESOLVE_BENEATH)) != 0)
return (EINVAL);
 
return (kern_linkat(td, uap->fd1, uap->fd2, uap->path1, uap->path2,
-   UIO_USERSPACE, at2cnpflags(flag, AT_SYMLINK_FOLLOW | AT_BENEATH)));
+   UIO_USERSPACE, at2cnpflags(flag, AT_SYMLINK_FOLLOW | AT_BENEATH |
+   AT_RESOLVE_BENEATH)));
 }
 
 int hardlink_check_uid = 0;
@@ -1872,7 +1876,7 @@ kern_funlinkat(struct thread *td, int dfd, const char 
 restart:
bwillwrite();
NDINIT_ATRIGHTS(, DELETE, LOCKPARENT | LOCKLEAF | AUDITVNODE1 |
-   at2cnpflags(flag, AT_BENEATH),
+   at2cnpflags(flag, AT_BENEATH | AT_RESOLVE_BENEATH),
pathseg, path, dfd, _unlinkat_rights, td);
if ((error = namei()) != 0) {
if (error == EINVAL)
@@ -2075,7 +2079,7 @@ kern_accessat(struct thread *td, int fd, const char *p
struct nameidata nd;
int error;
 
-   if ((flag & ~(AT_EACCESS | AT_BENEATH)) != 0)
+   if ((flag & ~(AT_EACCESS | AT_BENEATH | AT_RESOLVE_BENEATH)) != 0)
return (EINVAL);
if (amode != F_OK && (amode & ~(R_OK | W_OK | X_OK)) != 0)
return (EINVAL);
@@ -2096,7 +2100,7 @@ kern_accessat(struct thread *td, int fd, const char *p
usecred = cred;
AUDIT_ARG_VALUE(amode);
NDINIT_ATRIGHTS(, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF |
-   AUDITVNODE1 | at2cnpflags(flag, AT_BENEATH),
+   AUDITVNODE1 | at2cnpflags(flag, AT_BENEATH | AT_RESOLVE_BENEATH),
pathseg, path, fd, _fstat_rights, td);
if ((error = namei()) != 0)
goto out;
@@ -2387,11 +2391,12 @@ kern_statat(struct thread *td, int flag, int fd, const
struct nameidata nd;
int error;
 
-   if ((flag & ~(AT_SYMLINK_NOFOLLOW | AT_BENEATH)) != 0)
+   if ((flag & ~(AT_SYMLINK_NOFOLLOW | AT_BENEATH |
+   AT_RESOLVE_BENEATH)) != 0)
return (EINVAL);
 
NDINIT_ATRIGHTS(, LOOKUP, at2cnpflags(flag, AT_BENEATH |
-   AT_SYMLINK_NOFOLLOW) | LOCKSHARED | LOCKLEAF |
+   AT_RESOLVE_BENEATH | AT_SYMLINK_NOFOLLOW) | LOCKSHARED | LOCKLEAF |
AUDITVNODE1, pathseg, path, fd, _fstat_rights, td);
 
if ((error = namei()) != 0)
@@ -2710,7 +2715,8 @@ int
 sys_chflagsat(struct thread *td, struct chflagsat_args *uap)
 {
 
-   if ((uap->atflag & ~(AT_SYMLINK_NOFOLLOW | 

svn commit: r366021 - head/sys/kern

2020-09-22 Thread Konstantin Belousov
Author: kib
Date: Tue Sep 22 22:43:32 2020
New Revision: 366021
URL: https://svnweb.freebsd.org/changeset/base/366021

Log:
  Change O_BENEATH to handle relative paths same as absolute.
  
  Do not care if path walks out of the topping directory if it returns back.
  
  Requested and reviewed by:markj
  Tested by:pho
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week
  Differential revision:https://reviews.freebsd.org/D25886

Modified:
  head/sys/kern/vfs_lookup.c

Modified: head/sys/kern/vfs_lookup.c
==
--- head/sys/kern/vfs_lookup.c  Tue Sep 22 22:36:02 2020(r366020)
+++ head/sys/kern/vfs_lookup.c  Tue Sep 22 22:43:32 2020(r366021)
@@ -178,11 +178,13 @@ static void
 nameicap_tracker_add(struct nameidata *ndp, struct vnode *dp)
 {
struct nameicap_tracker *nt;
+   struct componentname *cnp;
 
if ((ndp->ni_lcf & NI_LCF_CAP_DOTDOT) == 0 || dp->v_type != VDIR)
return;
-   if ((ndp->ni_lcf & (NI_LCF_BENEATH_ABS | NI_LCF_BENEATH_LATCHED)) ==
-   NI_LCF_BENEATH_ABS) {
+   cnp = >ni_cnd;
+   if ((cnp->cn_flags & BENEATH) != 0 &&
+   (ndp->ni_lcf & NI_LCF_BENEATH_LATCHED) == 0) {
MPASS((ndp->ni_lcf & NI_LCF_LATCH) != 0);
if (dp != ndp->ni_beneath_latch)
return;
@@ -593,8 +595,8 @@ namei(struct nameidata *ndp)
namei_cleanup_cnp(cnp);
} else
cnp->cn_flags |= HASBUF;
-   if ((ndp->ni_lcf & (NI_LCF_BENEATH_ABS |
-   NI_LCF_BENEATH_LATCHED)) == NI_LCF_BENEATH_ABS) {
+   if ((ndp->ni_lcf & (NI_LCF_LATCH |
+   NI_LCF_BENEATH_LATCHED)) == NI_LCF_LATCH) {
NDFREE(ndp, 0);
error = ENOTCAPABLE;
}
___
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: r366020 - head/sys/kern

2020-09-22 Thread Konstantin Belousov
Author: kib
Date: Tue Sep 22 22:36:02 2020
New Revision: 366020
URL: https://svnweb.freebsd.org/changeset/base/366020

Log:
  Only clear latch for BENEATH when we walk out of the startdir,
  
  not unconditionally on any dotdot component.
  
  Reviewed by:  markj
  Tested by:pho
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week
  Differential revision:https://reviews.freebsd.org/D25886

Modified:
  head/sys/kern/vfs_lookup.c

Modified: head/sys/kern/vfs_lookup.c
==
--- head/sys/kern/vfs_lookup.c  Tue Sep 22 22:23:58 2020(r366019)
+++ head/sys/kern/vfs_lookup.c  Tue Sep 22 22:36:02 2020(r366020)
@@ -238,13 +238,14 @@ nameicap_check_dotdot(struct nameidata *ndp, struct vn
return (ENOTCAPABLE);
TAILQ_FOREACH_REVERSE(nt, >ni_cap_tracker, nameicap_tracker_head,
nm_link) {
+   if ((ndp->ni_lcf & NI_LCF_LATCH) != 0 &&
+   ndp->ni_beneath_latch == nt->dp) {
+   ndp->ni_lcf &= ~NI_LCF_BENEATH_LATCHED;
+   nameicap_cleanup(ndp, false);
+   return (0);
+   }
if (dp == nt->dp)
return (0);
-   }
-   if ((ndp->ni_lcf & NI_LCF_BENEATH_ABS) != 0) {
-   ndp->ni_lcf &= ~NI_LCF_BENEATH_LATCHED;
-   nameicap_cleanup(ndp, false);
-   return (0);
}
return (ENOTCAPABLE);
 }
___
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: r366019 - head/sys/kern

2020-09-22 Thread Konstantin Belousov
Author: kib
Date: Tue Sep 22 22:23:58 2020
New Revision: 366019
URL: https://svnweb.freebsd.org/changeset/base/366019

Log:
  Add open2nameif()
  
  the helper to calculate namei flags both for open(2) and creat(2).
  
  Suggested and reviewed by:markj
  Tested by:pho
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week
  Differential revision:https://reviews.freebsd.org/D25886

Modified:
  head/sys/kern/vfs_vnops.c

Modified: head/sys/kern/vfs_vnops.c
==
--- head/sys/kern/vfs_vnops.c   Tue Sep 22 22:22:29 2020(r366018)
+++ head/sys/kern/vfs_vnops.c   Tue Sep 22 22:23:58 2020(r366019)
@@ -192,6 +192,21 @@ vn_open(struct nameidata *ndp, int *flagp, int cmode, 
return (vn_open_cred(ndp, flagp, cmode, 0, td->td_ucred, fp));
 }
 
+static uint64_t
+open2nameif(int fmode, u_int vn_open_flags)
+{
+   uint64_t res;
+
+   res = ISOPEN | LOCKLEAF;
+   if ((fmode & O_BENEATH) != 0)
+   res |= BENEATH;
+   if ((vn_open_flags & VN_OPEN_NOAUDIT) == 0)
+   res |= AUDITVNODE1;
+   if ((vn_open_flags & VN_OPEN_NOCAPCHECK) != 0)
+   res |= NOCAPCHECK;
+   return (res);
+}
+
 /*
  * Common code for vnode open operations via a name lookup.
  * Lookup the vnode and invoke VOP_CREATE if needed.
@@ -218,19 +233,14 @@ restart:
return (EINVAL);
else if ((fmode & (O_CREAT | O_DIRECTORY)) == O_CREAT) {
ndp->ni_cnd.cn_nameiop = CREATE;
+   ndp->ni_cnd.cn_flags = open2nameif(fmode, vn_open_flags);
/*
 * Set NOCACHE to avoid flushing the cache when
 * rolling in many files at once.
*/
-   ndp->ni_cnd.cn_flags = ISOPEN | LOCKPARENT | LOCKLEAF | NOCACHE;
+   ndp->ni_cnd.cn_flags |= LOCKPARENT | NOCACHE;
if ((fmode & O_EXCL) == 0 && (fmode & O_NOFOLLOW) == 0)
ndp->ni_cnd.cn_flags |= FOLLOW;
-   if ((fmode & O_BENEATH) != 0)
-   ndp->ni_cnd.cn_flags |= BENEATH;
-   if (!(vn_open_flags & VN_OPEN_NOAUDIT))
-   ndp->ni_cnd.cn_flags |= AUDITVNODE1;
-   if (vn_open_flags & VN_OPEN_NOCAPCHECK)
-   ndp->ni_cnd.cn_flags |= NOCAPCHECK;
if ((vn_open_flags & VN_OPEN_INVFS) == 0)
bwillwrite();
if ((error = namei(ndp)) != 0)
@@ -285,16 +295,11 @@ restart:
}
} else {
ndp->ni_cnd.cn_nameiop = LOOKUP;
-   ndp->ni_cnd.cn_flags = ISOPEN |
-   ((fmode & O_NOFOLLOW) ? NOFOLLOW : FOLLOW) | LOCKLEAF;
-   if (!(fmode & FWRITE))
+   ndp->ni_cnd.cn_flags = open2nameif(fmode, vn_open_flags);
+   ndp->ni_cnd.cn_flags |= (fmode & O_NOFOLLOW) != 0 ? NOFOLLOW :
+   FOLLOW;
+   if ((fmode & FWRITE) == 0)
ndp->ni_cnd.cn_flags |= LOCKSHARED;
-   if ((fmode & O_BENEATH) != 0)
-   ndp->ni_cnd.cn_flags |= BENEATH;
-   if (!(vn_open_flags & VN_OPEN_NOAUDIT))
-   ndp->ni_cnd.cn_flags |= AUDITVNODE1;
-   if (vn_open_flags & VN_OPEN_NOCAPCHECK)
-   ndp->ni_cnd.cn_flags |= NOCAPCHECK;
if ((error = namei(ndp)) != 0)
return (error);
vp = ndp->ni_vp;
___
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: r366018 - head/sys/kern

2020-09-22 Thread Konstantin Belousov
Author: kib
Date: Tue Sep 22 22:22:29 2020
New Revision: 366018
URL: https://svnweb.freebsd.org/changeset/base/366018

Log:
  Add at2cnpflags()
  
  the helper to convert AT_ flags for *at() syscalls to namei flags.
  
  Reviewed by:  markj
  Tested by:pho
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week
  Differential revision:https://reviews.freebsd.org/D25886

Modified:
  head/sys/kern/vfs_syscalls.c

Modified: head/sys/kern/vfs_syscalls.c
==
--- head/sys/kern/vfs_syscalls.cTue Sep 22 22:06:20 2020
(r366017)
+++ head/sys/kern/vfs_syscalls.cTue Sep 22 22:22:29 2020
(r366018)
@@ -112,6 +112,28 @@ static int kern_readlink_vp(struct vnode *vp, char *bu
 static int kern_linkat_vp(struct thread *td, struct vnode *vp, int fd,
 const char *path, enum uio_seg segflag);
 
+static uint64_t
+at2cnpflags(u_int at_flags, u_int mask)
+{
+   u_int64_t res;
+
+   MPASS((at_flags & (AT_SYMLINK_FOLLOW | AT_SYMLINK_NOFOLLOW)) !=
+   (AT_SYMLINK_FOLLOW | AT_SYMLINK_NOFOLLOW));
+
+   res = 0;
+   at_flags &= mask;
+   if ((at_flags & AT_BENEATH) != 0)
+   res |= BENEATH;
+   if ((at_flags & AT_SYMLINK_FOLLOW) != 0)
+   res |= FOLLOW;
+   /* NOFOLLOW is pseudo flag */
+   if ((mask & AT_SYMLINK_NOFOLLOW) != 0) {
+   res |= (at_flags & AT_SYMLINK_NOFOLLOW) != 0 ? NOFOLLOW :
+   FOLLOW;
+   }
+   return (res);
+}
+
 int
 kern_sync(struct thread *td)
 {
@@ -1485,8 +1507,7 @@ sys_linkat(struct thread *td, struct linkat_args *uap)
return (EINVAL);
 
return (kern_linkat(td, uap->fd1, uap->fd2, uap->path1, uap->path2,
-   UIO_USERSPACE, ((flag & AT_SYMLINK_FOLLOW) != 0 ? FOLLOW :
-   NOFOLLOW) | ((flag & AT_BENEATH) != 0 ? BENEATH : 0)));
+   UIO_USERSPACE, at2cnpflags(flag, AT_SYMLINK_FOLLOW | AT_BENEATH)));
 }
 
 int hardlink_check_uid = 0;
@@ -1851,7 +1872,7 @@ kern_funlinkat(struct thread *td, int dfd, const char 
 restart:
bwillwrite();
NDINIT_ATRIGHTS(, DELETE, LOCKPARENT | LOCKLEAF | AUDITVNODE1 |
-   ((flag & AT_BENEATH) != 0 ? BENEATH : 0),
+   at2cnpflags(flag, AT_BENEATH),
pathseg, path, dfd, _unlinkat_rights, td);
if ((error = namei()) != 0) {
if (error == EINVAL)
@@ -2075,7 +2096,7 @@ kern_accessat(struct thread *td, int fd, const char *p
usecred = cred;
AUDIT_ARG_VALUE(amode);
NDINIT_ATRIGHTS(, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF |
-   AUDITVNODE1 | ((flag & AT_BENEATH) != 0 ? BENEATH : 0),
+   AUDITVNODE1 | at2cnpflags(flag, AT_BENEATH),
pathseg, path, fd, _fstat_rights, td);
if ((error = namei()) != 0)
goto out;
@@ -2369,10 +2390,9 @@ kern_statat(struct thread *td, int flag, int fd, const
if ((flag & ~(AT_SYMLINK_NOFOLLOW | AT_BENEATH)) != 0)
return (EINVAL);
 
-   NDINIT_ATRIGHTS(, LOOKUP, ((flag & AT_SYMLINK_NOFOLLOW) != 0 ?
-   NOFOLLOW : FOLLOW) | ((flag & AT_BENEATH) != 0 ? BENEATH : 0) |
-   LOCKSHARED | LOCKLEAF | AUDITVNODE1, pathseg, path, fd,
-   _fstat_rights, td);
+   NDINIT_ATRIGHTS(, LOOKUP, at2cnpflags(flag, AT_BENEATH |
+   AT_SYMLINK_NOFOLLOW) | LOCKSHARED | LOCKLEAF |
+   AUDITVNODE1, pathseg, path, fd, _fstat_rights, td);
 
if ((error = namei()) != 0)
return (error);
@@ -2719,12 +2739,11 @@ kern_chflagsat(struct thread *td, int fd, const char *
 enum uio_seg pathseg, u_long flags, int atflag)
 {
struct nameidata nd;
-   int error, follow;
+   int error;
 
AUDIT_ARG_FFLAGS(flags);
-   follow = (atflag & AT_SYMLINK_NOFOLLOW) ? NOFOLLOW : FOLLOW;
-   follow |= (atflag & AT_BENEATH) != 0 ? BENEATH : 0;
-   NDINIT_ATRIGHTS(, LOOKUP, follow | AUDITVNODE1, pathseg, path, fd,
+   NDINIT_ATRIGHTS(, LOOKUP, at2cnpflags(atflag, AT_SYMLINK_NOFOLLOW |
+   AT_BENEATH) | AUDITVNODE1, pathseg, path, fd,
_fchflags_rights, td);
if ((error = namei()) != 0)
return (error);
@@ -2848,12 +2867,11 @@ kern_fchmodat(struct thread *td, int fd, const char *p
 enum uio_seg pathseg, mode_t mode, int flag)
 {
struct nameidata nd;
-   int error, follow;
+   int error;
 
AUDIT_ARG_MODE(mode);
-   follow = (flag & AT_SYMLINK_NOFOLLOW) != 0 ? NOFOLLOW : FOLLOW;
-   follow |= (flag & AT_BENEATH) != 0 ? BENEATH : 0;
-   NDINIT_ATRIGHTS(, LOOKUP, follow | AUDITVNODE1, pathseg, path, fd,
+   NDINIT_ATRIGHTS(, LOOKUP, at2cnpflags(flag, AT_SYMLINK_NOFOLLOW |
+   AT_BENEATH) | AUDITVNODE1, pathseg, path, fd,
_fchmod_rights, td);
if ((error = namei()) != 0)
return (error);
@@ -2960,12 +2978,11 @@ kern_fchownat(struct thread *td, int fd, 

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

2020-09-22 Thread Konstantin Belousov
Author: kib
Date: Tue Sep 22 22:06:20 2020
New Revision: 366017
URL: https://svnweb.freebsd.org/changeset/base/366017

Log:
  Add NIRES_STRICTREL.
  
  Stop abusing internal namei flag NI_LCF_STRICTRELATIVE as indicator of
  cap-restricted lookup.  Add designated returned flag NIRES_STRICTREL
  to inform kern_openat() that lookup was restricted.
  
  Reviewed by:  markj
  Tested by:pho
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week
  Differential revision:https://reviews.freebsd.org/D25886

Modified:
  head/sys/kern/vfs_lookup.c
  head/sys/kern/vfs_syscalls.c
  head/sys/sys/namei.h

Modified: head/sys/kern/vfs_lookup.c
==
--- head/sys/kern/vfs_lookup.c  Tue Sep 22 21:59:18 2020(r366016)
+++ head/sys/kern/vfs_lookup.c  Tue Sep 22 22:06:20 2020(r366017)
@@ -322,6 +322,7 @@ namei_setup(struct nameidata *ndp, struct vnode **dpp,
 */
if (IN_CAPABILITY_MODE(td) && (cnp->cn_flags & NOCAPCHECK) == 0) {
ndp->ni_lcf |= NI_LCF_STRICTRELATIVE;
+   ndp->ni_resflags |= NIRES_STRICTREL;
if (ndp->ni_dirfd == AT_FDCWD) {
 #ifdef KTRACE
if (KTRPOINT(td, KTR_CAPFAIL))
@@ -400,6 +401,7 @@ namei_setup(struct nameidata *ndp, struct vnode **dpp,
ndp->ni_filecaps.fc_fcntls != CAP_FCNTL_ALL ||
ndp->ni_filecaps.fc_nioctls != -1) {
ndp->ni_lcf |= NI_LCF_STRICTRELATIVE;
+   ndp->ni_resflags |= NIRES_STRICTREL;
}
 #endif
}

Modified: head/sys/kern/vfs_syscalls.c
==
--- head/sys/kern/vfs_syscalls.cTue Sep 22 21:59:18 2020
(r366016)
+++ head/sys/kern/vfs_syscalls.cTue Sep 22 22:06:20 2020
(r366017)
@@ -1136,7 +1136,7 @@ kern_openat(struct thread *td, int fd, const char *pat
 * understand exactly what would happen, and we don't think
 * that it ever should.
 */
-   if ((nd.ni_lcf & NI_LCF_STRICTRELATIVE) == 0 &&
+   if ((nd.ni_resflags & NIRES_STRICTREL) == 0 &&
(error == ENODEV || error == ENXIO) &&
td->td_dupfd >= 0) {
error = dupfdopen(td, fdp, td->td_dupfd, flags, error,
@@ -1180,7 +1180,7 @@ success:
struct filecaps *fcaps;
 
 #ifdef CAPABILITIES
-   if ((nd.ni_lcf & NI_LCF_STRICTRELATIVE) != 0)
+   if ((nd.ni_resflags & NIRES_STRICTREL) != 0)
fcaps = _filecaps;
else
 #endif

Modified: head/sys/sys/namei.h
==
--- head/sys/sys/namei.hTue Sep 22 21:59:18 2020(r366016)
+++ head/sys/sys/namei.hTue Sep 22 22:06:20 2020(r366017)
@@ -183,6 +183,7 @@ int cache_fplookup(struct nameidata *ndp, enum cache_f
  * Namei results flags
  */
 #defineNIRES_ABS   0x0001 /* Path was absolute */
+#defineNIRES_STRICTREL 0x0002 /* Restricted lookup result */
 
 /*
  * Flags in ni_lcf, valid for the duration of the namei call.
___
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: r365643 - head/bin/cp

2020-09-22 Thread Warner Losh
On Tue, Sep 22, 2020 at 3:55 PM Kyle Evans  wrote:

> On Tue, Sep 22, 2020 at 4:53 PM Ian Lepore  wrote:
> >
> > On Tue, 2020-09-22 at 15:50 -0600, Warner Losh wrote:
> > > I think it's a great leap sideways, but I've done cp /dev/null foo to
> > > clear
> > > it out for 35 years now... It's why it feels like a workaround.
> > >
> > > Though it is a legit optimization, no matter the feelings. As for
> > > clearer,
> > > I'm less sure since then I have to remember what the : operator does.
> > >
> > > Warner
> > >
> >
> > For me, :> is idiomatic (but ugly).
> >
> > On the other hand, the cp /dev/null had a nice dogfooding aspect to
> > it... when we broke cp by accident, its use in the build system was the
> > first alarm to go off.
> >
> > --Ian
> >
>
> To be honest, this is a case that really should be covered by
> regression tests somewhere.
>

It should (but isn't yet).

Ian is right for old-school FreeBSD thinking. In that thinking the build
system should use an eclectic mix of tools to act as a fire-wall against
accidental breakage.

Complete, effective, test suites give much better coverage... if they are
run...

So until we run tests frequently, with loud regression squawking that's as
effective as build breakage, I tend to fall in the 'all of the above' camp
until that's in place... :)

Warner

P.S. though not, if I suppose, if it means that we're slowing down the
regression coverage uptake...

> > On Tue, Sep 22, 2020 at 3:48 PM Alan Somers 
> > > wrote:
> > >
> > > > It doesn't feel like a workaround to me.  I think Kyle's version is
> > > > clearer than the original.
> > > >
> > > > On Tue, Sep 22, 2020 at 3:45 PM Warner Losh  wrote:
> > > >
> > > > >
> > > > >
> > > > > On Tue, Sep 22, 2020 at 3:42 PM Kyle Evans 
> > > > > wrote:
> > > > >
> > > > > > cp is already fixed, people are still feeling the fallout of
> > > > > > being
> > > > > > within those revisions and needing to bootstrap their own cp.
> > > > > > We can
> > > > > > reduce the number of components these invocations rely on
> > > > > > trivially to
> > > > > > shell built-in mechanics, why not do so?
> > > > > >
> > > > >
> > > > > Fair point. I just bristle at putting workarounds in for valid
> > > > > /bin/sh
> > > > > syntax because we opposed for a few days. so long as it's an
> > > > > unconditional
> > > > > clearing of the file to be zero length, I'm OK with that.
> > > > >
> > > > > Warner
> > > > >
> > > > >
> > > > > > On Tue, Sep 22, 2020 at 4:40 PM Warner Losh 
> > > > > > wrote:
> > > > > > >
> > > > > > > So why do we need a workaround at all? cp /dev/null has been
> > > > > > > fixed,
> > > > > >
> > > > > > and that's way more important to get right.
> > > > > > >
> > > > > > > I don't want to paper-over issues with this at all, though if
> > > > > > > we use
> > > > > >
> > > > > > the host's (now broken) cp, I suppose that might be OK in the
> > > > > > short term.
> > > > > > If that's the case, then maybe this is OK.
> > > > > > >
> > > > > > > Otherwise, I'd strongly prefer we fix cp.
> > > > > > >
> > > > > > > Warner
> > > > > > >
> > > > > > > On Tue, Sep 22, 2020 at 3:31 PM Alan Somers <
> > > > > > > asom...@freebsd.org>
> > > > > >
> > > > > > wrote:
> > > > > > > >
> > > > > > > > +1.
> > > > > > > >
> > > > > > > > On Tue, Sep 22, 2020 at 3:27 PM Kyle Evans <
> > > > > > > > kev...@freebsd.org>
> > > > > >
> > > > > > wrote:
> > > > > > > > >
> > > > > > > > > I'm running a build at the suggestion of mjg to confirm
> > > > > > > > > there aren't
> > > > > > > > > any others hiding that can be converted, and I will
> > > > > > > > > commit after I've
> > > > > > > > > verified that this is it.
> > > > > > > > >
> > > > > > > > > On Tue, Sep 22, 2020 at 4:02 PM Alan Somers <
> > > > > > > > > asom...@freebsd.org>
> > > > > >
> > > > > > wrote:
> > > > > > > > > >
> > > > > > > > > > LGTM.
> > > > > > > > > >
> > > > > > > > > > On Tue, Sep 22, 2020 at 2:59 PM Kyle Evans <
> > > > > > > > > > kev...@freebsd.org>
> > > > > >
> > > > > > wrote:
> > > > > > > > > > >
> > > > > > > > > > > Perhaps:
> > > > > > > > > > >
> > > > > > > > > > > diff --git a/stand/i386/zfsboot/Makefile
> > > > > >
> > > > > > b/stand/i386/zfsboot/Makefile
> > > > > > > > > > > index ff315abc0ef..7e362b43a39 100644
> > > > > > > > > > > --- a/stand/i386/zfsboot/Makefile
> > > > > > > > > > > +++ b/stand/i386/zfsboot/Makefile
> > > > > > > > > > > @@ -81,7 +81,7 @@ zfsboot.ld: zfsboot.ldr zfsboot.bin
> > > > > > > > > > > ${BTXKERN}
> > > > > > > > > > > -o ${.TARGET} -P 1 zfsboot.bin
> > > > > > > > > > >
> > > > > > > > > > >  zfsboot.ldr:
> > > > > > > > > > > -   cp /dev/null ${.TARGET}
> > > > > > > > > > > +   :> ${.TARGET}
> > > > > > > > > > >
> > > > > > > > > > >  zfsboot.bin: zfsboot.out
> > > > > > > > > > > ${OBJCOPY} -S -O binary zfsboot.out
> > > > > > > > > > > ${.TARGET}
> > > > > > > > > > > diff --git a/stand/libsa/Makefile
> > > > > > > > > > > b/stand/libsa/Makefile
> > > > > > > > 

svn commit: r366016 - head/sys/kern

2020-09-22 Thread Konstantin Belousov
Author: kib
Date: Tue Sep 22 21:59:18 2020
New Revision: 366016
URL: https://svnweb.freebsd.org/changeset/base/366016

Log:
  lookup: Track last lookup component if it is directory.
  
  This makes open("/a/../a", O_BENEATH) with cwd == "/a" work.
  
  Reviewed by:  markj
  Reported and tested by:   pho
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week
  Differential revision:https://reviews.freebsd.org/D25886

Modified:
  head/sys/kern/vfs_lookup.c

Modified: head/sys/kern/vfs_lookup.c
==
--- head/sys/kern/vfs_lookup.c  Tue Sep 22 21:54:30 2020(r366015)
+++ head/sys/kern/vfs_lookup.c  Tue Sep 22 21:59:18 2020(r366016)
@@ -1248,6 +1248,8 @@ success:
goto bad2;
}
}
+   if (ndp->ni_vp != NULL && ndp->ni_vp->v_type == VDIR)
+   nameicap_tracker_add(ndp, ndp->ni_vp);
return (0);
 
 bad2:
___
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: r365643 - head/bin/cp

2020-09-22 Thread Kyle Evans
On Tue, Sep 22, 2020 at 4:53 PM Ian Lepore  wrote:
>
> On Tue, 2020-09-22 at 15:50 -0600, Warner Losh wrote:
> > I think it's a great leap sideways, but I've done cp /dev/null foo to
> > clear
> > it out for 35 years now... It's why it feels like a workaround.
> >
> > Though it is a legit optimization, no matter the feelings. As for
> > clearer,
> > I'm less sure since then I have to remember what the : operator does.
> >
> > Warner
> >
>
> For me, :> is idiomatic (but ugly).
>
> On the other hand, the cp /dev/null had a nice dogfooding aspect to
> it... when we broke cp by accident, its use in the build system was the
> first alarm to go off.
>
> --Ian
>

To be honest, this is a case that really should be covered by
regression tests somewhere.

> > On Tue, Sep 22, 2020 at 3:48 PM Alan Somers 
> > wrote:
> >
> > > It doesn't feel like a workaround to me.  I think Kyle's version is
> > > clearer than the original.
> > >
> > > On Tue, Sep 22, 2020 at 3:45 PM Warner Losh  wrote:
> > >
> > > >
> > > >
> > > > On Tue, Sep 22, 2020 at 3:42 PM Kyle Evans 
> > > > wrote:
> > > >
> > > > > cp is already fixed, people are still feeling the fallout of
> > > > > being
> > > > > within those revisions and needing to bootstrap their own cp.
> > > > > We can
> > > > > reduce the number of components these invocations rely on
> > > > > trivially to
> > > > > shell built-in mechanics, why not do so?
> > > > >
> > > >
> > > > Fair point. I just bristle at putting workarounds in for valid
> > > > /bin/sh
> > > > syntax because we opposed for a few days. so long as it's an
> > > > unconditional
> > > > clearing of the file to be zero length, I'm OK with that.
> > > >
> > > > Warner
> > > >
> > > >
> > > > > On Tue, Sep 22, 2020 at 4:40 PM Warner Losh 
> > > > > wrote:
> > > > > >
> > > > > > So why do we need a workaround at all? cp /dev/null has been
> > > > > > fixed,
> > > > >
> > > > > and that's way more important to get right.
> > > > > >
> > > > > > I don't want to paper-over issues with this at all, though if
> > > > > > we use
> > > > >
> > > > > the host's (now broken) cp, I suppose that might be OK in the
> > > > > short term.
> > > > > If that's the case, then maybe this is OK.
> > > > > >
> > > > > > Otherwise, I'd strongly prefer we fix cp.
> > > > > >
> > > > > > Warner
> > > > > >
> > > > > > On Tue, Sep 22, 2020 at 3:31 PM Alan Somers <
> > > > > > asom...@freebsd.org>
> > > > >
> > > > > wrote:
> > > > > > >
> > > > > > > +1.
> > > > > > >
> > > > > > > On Tue, Sep 22, 2020 at 3:27 PM Kyle Evans <
> > > > > > > kev...@freebsd.org>
> > > > >
> > > > > wrote:
> > > > > > > >
> > > > > > > > I'm running a build at the suggestion of mjg to confirm
> > > > > > > > there aren't
> > > > > > > > any others hiding that can be converted, and I will
> > > > > > > > commit after I've
> > > > > > > > verified that this is it.
> > > > > > > >
> > > > > > > > On Tue, Sep 22, 2020 at 4:02 PM Alan Somers <
> > > > > > > > asom...@freebsd.org>
> > > > >
> > > > > wrote:
> > > > > > > > >
> > > > > > > > > LGTM.
> > > > > > > > >
> > > > > > > > > On Tue, Sep 22, 2020 at 2:59 PM Kyle Evans <
> > > > > > > > > kev...@freebsd.org>
> > > > >
> > > > > wrote:
> > > > > > > > > >
> > > > > > > > > > Perhaps:
> > > > > > > > > >
> > > > > > > > > > diff --git a/stand/i386/zfsboot/Makefile
> > > > >
> > > > > b/stand/i386/zfsboot/Makefile
> > > > > > > > > > index ff315abc0ef..7e362b43a39 100644
> > > > > > > > > > --- a/stand/i386/zfsboot/Makefile
> > > > > > > > > > +++ b/stand/i386/zfsboot/Makefile
> > > > > > > > > > @@ -81,7 +81,7 @@ zfsboot.ld: zfsboot.ldr zfsboot.bin
> > > > > > > > > > ${BTXKERN}
> > > > > > > > > > -o ${.TARGET} -P 1 zfsboot.bin
> > > > > > > > > >
> > > > > > > > > >  zfsboot.ldr:
> > > > > > > > > > -   cp /dev/null ${.TARGET}
> > > > > > > > > > +   :> ${.TARGET}
> > > > > > > > > >
> > > > > > > > > >  zfsboot.bin: zfsboot.out
> > > > > > > > > > ${OBJCOPY} -S -O binary zfsboot.out
> > > > > > > > > > ${.TARGET}
> > > > > > > > > > diff --git a/stand/libsa/Makefile
> > > > > > > > > > b/stand/libsa/Makefile
> > > > > > > > > > index effece9e01b..63cd46a9c54 100644
> > > > > > > > > > --- a/stand/libsa/Makefile
> > > > > > > > > > +++ b/stand/libsa/Makefile
> > > > > > > > > > @@ -122,7 +122,7 @@ beforedepend:
> > > > > > > > > > ln -sf ${SRCTOP}/include/arpa/inet.h
> > > > > > > > > > arpa/inet.h; \
> > > > > > > > > > ln -sf ${SRCTOP}/include/arpa/t
> > > > > > > > > > ftp.h arpa/tftp.h; \
> > > > > > > > > > for i in _time.h _strings.h _string.h; do \
> > > > > > > > > > -   [ -f xlocale/$$i ] || cp /dev/null
> > > > > > > > > > xlocale/$$i; \
> > > > > > > > > > +   [ -f xlocale/$$i ] || :> xlocale/$$i;
> > > > > > > > > > \
> > > > > > > > > > done; \
> > > > > > > > > > for i in ${STAND_H_INC}; do \
> > > > > > > > > > ln -sf ${SASRC}/stand.h $$i; \
> > > > > > > > > >
> > > > > > > > > >
> > 

svn commit: r366015 - head/sys/kern

2020-09-22 Thread Konstantin Belousov
Author: kib
Date: Tue Sep 22 21:54:30 2020
New Revision: 366015
URL: https://svnweb.freebsd.org/changeset/base/366015

Log:
  Improve comment above nameicap_check_dotdot().
  
  Explain why tracker is needed at all.
  
  Reviewed by:  markj
  Tested by:pho
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week
  Differential revision:https://reviews.freebsd.org/D25886

Modified:
  head/sys/kern/vfs_lookup.c

Modified: head/sys/kern/vfs_lookup.c
==
--- head/sys/kern/vfs_lookup.c  Tue Sep 22 21:43:43 2020(r366014)
+++ head/sys/kern/vfs_lookup.c  Tue Sep 22 21:54:30 2020(r366015)
@@ -215,7 +215,11 @@ nameicap_cleanup(struct nameidata *ndp, bool clean_lat
 /*
  * For dotdot lookups in capability mode, only allow the component
  * lookup to succeed if the resulting directory was already traversed
- * during the operation.  Also fail dotdot lookups for non-local
+ * during the operation.  This catches situations where already
+ * traversed directory is moved to different parent, and then we walk
+ * over it with dotdots.
+ *
+ * Also allow to force failure of dotdot lookups for non-local
  * filesystems, where external agents might assist local lookups to
  * escape the compartment.
  */
___
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: r365643 - head/bin/cp

2020-09-22 Thread Toomas Soome via svn-src-all



> On 23. Sep 2020, at 00:50, Warner Losh  wrote:
> 
> I think it's a great leap sideways, but I've done cp /dev/null foo to clear 
> it out for 35 years now... It's why it feels like a workaround.
> 
> Though it is a legit optimization, no matter the feelings. As for clearer, 
> I'm less sure since then I have to remember what the : operator does.
> 
> Warner


you can always use /bin/true instead (unless its gnu;) or just echo.

rgds,
toomas

> 
> On Tue, Sep 22, 2020 at 3:48 PM Alan Somers  > wrote:
> It doesn't feel like a workaround to me.  I think Kyle's version is clearer 
> than the original.
> 
> On Tue, Sep 22, 2020 at 3:45 PM Warner Losh  > wrote:
> 
> 
> On Tue, Sep 22, 2020 at 3:42 PM Kyle Evans  > wrote:
> cp is already fixed, people are still feeling the fallout of being
> within those revisions and needing to bootstrap their own cp. We can
> reduce the number of components these invocations rely on trivially to
> shell built-in mechanics, why not do so?
> 
> Fair point. I just bristle at putting workarounds in for valid /bin/sh syntax 
> because we opposed for a few days. so long as it's an unconditional clearing 
> of the file to be zero length, I'm OK with that.
> 
> Warner
>  
> On Tue, Sep 22, 2020 at 4:40 PM Warner Losh  > wrote:
> >
> > So why do we need a workaround at all? cp /dev/null has been fixed, and 
> > that's way more important to get right.
> >
> > I don't want to paper-over issues with this at all, though if we use the 
> > host's (now broken) cp, I suppose that might be OK in the short term. If 
> > that's the case, then maybe this is OK.
> >
> > Otherwise, I'd strongly prefer we fix cp.
> >
> > Warner
> >
> > On Tue, Sep 22, 2020 at 3:31 PM Alan Somers  > > wrote:
> >>
> >> +1.
> >>
> >> On Tue, Sep 22, 2020 at 3:27 PM Kyle Evans  >> > wrote:
> >>>
> >>> I'm running a build at the suggestion of mjg to confirm there aren't
> >>> any others hiding that can be converted, and I will commit after I've
> >>> verified that this is it.
> >>>
> >>> On Tue, Sep 22, 2020 at 4:02 PM Alan Somers  >>> > wrote:
> >>> >
> >>> > LGTM.
> >>> >
> >>> > On Tue, Sep 22, 2020 at 2:59 PM Kyle Evans  >>> > > wrote:
> >>> >>
> >>> >> Perhaps:
> >>> >>
> >>> >> diff --git a/stand/i386/zfsboot/Makefile b/stand/i386/zfsboot/Makefile
> >>> >> index ff315abc0ef..7e362b43a39 100644
> >>> >> --- a/stand/i386/zfsboot/Makefile
> >>> >> +++ b/stand/i386/zfsboot/Makefile
> >>> >> @@ -81,7 +81,7 @@ zfsboot.ld: zfsboot.ldr zfsboot.bin ${BTXKERN}
> >>> >> -o ${.TARGET} -P 1 zfsboot.bin
> >>> >>
> >>> >>  zfsboot.ldr:
> >>> >> -   cp /dev/null ${.TARGET}
> >>> >> +   :> ${.TARGET}
> >>> >>
> >>> >>  zfsboot.bin: zfsboot.out
> >>> >> ${OBJCOPY} -S -O binary zfsboot.out ${.TARGET}
> >>> >> diff --git a/stand/libsa/Makefile b/stand/libsa/Makefile
> >>> >> index effece9e01b..63cd46a9c54 100644
> >>> >> --- a/stand/libsa/Makefile
> >>> >> +++ b/stand/libsa/Makefile
> >>> >> @@ -122,7 +122,7 @@ beforedepend:
> >>> >> ln -sf ${SRCTOP}/include/arpa/inet.h arpa/inet.h; \
> >>> >> ln -sf ${SRCTOP}/include/arpa/tftp.h arpa/tftp.h; \
> >>> >> for i in _time.h _strings.h _string.h; do \
> >>> >> -   [ -f xlocale/$$i ] || cp /dev/null xlocale/$$i; \
> >>> >> +   [ -f xlocale/$$i ] || :> xlocale/$$i; \
> >>> >> done; \
> >>> >> for i in ${STAND_H_INC}; do \
> >>> >> ln -sf ${SASRC}/stand.h $$i; \
> >>> >>
> >>> >>
> >>> >> On Tue, Sep 22, 2020 at 3:58 PM Alan Somers  >>> >> > wrote:
> >>> >> >
> >>> >> > Looks like two places in stand.  Is there any reason why Mateusz's 
> >>> >> > suggestion wouldn't work?
> >>> >> >
> >>> >> > > rg -g Makefile 'cp.*/dev/null'
> >>> >> > stand/libsa/Makefile
> >>> >> > 125: [ -f xlocale/$$i ] || cp /dev/null xlocale/$$i; \
> >>> >> >
> >>> >> > stand/i386/zfsboot/Makefile
> >>> >> > 82: cp /dev/null ${.TARGET}
> >>> >> >
> >>> >> > On Tue, Sep 22, 2020 at 2:54 PM Mateusz Guzik  >>> >> > > wrote:
> >>> >> >>
> >>> >> >> Can we instead add a workaround to the build tree?
> >>> >> >>
> >>> >> >> Where is cp /dev/null coming from anyway? Perhaps this can be 
> >>> >> >> patched
> >>> >> >> to touch the target file.
> >>> >> >>
> >>> >> >> On 9/22/20, Alan Somers  >>> >> >> > wrote:
> >>> >> >> > On Tue, Sep 22, 2020 at 2:48 PM Kyle Evans  >>> >> >> > > wrote:
> >>> >> >> >
> >>> >> >> >> On Fri, Sep 11, 2020 at 3:49 PM Alan Somers  >>> >> >> >> > wrote:
> >>> >> >> >> >
> >>> >> >> >> > Author: asomers
> >>> >> >> >> > Date: Fri Sep 11 20:49:36 2020
> >>> >> >> >> > New Revision: 365643
> >>> >> >> >> > URL: 

Re: svn commit: r365643 - head/bin/cp

2020-09-22 Thread Ian Lepore
On Tue, 2020-09-22 at 15:50 -0600, Warner Losh wrote:
> I think it's a great leap sideways, but I've done cp /dev/null foo to
> clear
> it out for 35 years now... It's why it feels like a workaround.
> 
> Though it is a legit optimization, no matter the feelings. As for
> clearer,
> I'm less sure since then I have to remember what the : operator does.
> 
> Warner
> 

For me, :> is idiomatic (but ugly).

On the other hand, the cp /dev/null had a nice dogfooding aspect to
it... when we broke cp by accident, its use in the build system was the
first alarm to go off.

--Ian

> On Tue, Sep 22, 2020 at 3:48 PM Alan Somers 
> wrote:
> 
> > It doesn't feel like a workaround to me.  I think Kyle's version is
> > clearer than the original.
> > 
> > On Tue, Sep 22, 2020 at 3:45 PM Warner Losh  wrote:
> > 
> > > 
> > > 
> > > On Tue, Sep 22, 2020 at 3:42 PM Kyle Evans 
> > > wrote:
> > > 
> > > > cp is already fixed, people are still feeling the fallout of
> > > > being
> > > > within those revisions and needing to bootstrap their own cp.
> > > > We can
> > > > reduce the number of components these invocations rely on
> > > > trivially to
> > > > shell built-in mechanics, why not do so?
> > > > 
> > > 
> > > Fair point. I just bristle at putting workarounds in for valid
> > > /bin/sh
> > > syntax because we opposed for a few days. so long as it's an
> > > unconditional
> > > clearing of the file to be zero length, I'm OK with that.
> > > 
> > > Warner
> > > 
> > > 
> > > > On Tue, Sep 22, 2020 at 4:40 PM Warner Losh 
> > > > wrote:
> > > > > 
> > > > > So why do we need a workaround at all? cp /dev/null has been
> > > > > fixed,
> > > > 
> > > > and that's way more important to get right.
> > > > > 
> > > > > I don't want to paper-over issues with this at all, though if
> > > > > we use
> > > > 
> > > > the host's (now broken) cp, I suppose that might be OK in the
> > > > short term.
> > > > If that's the case, then maybe this is OK.
> > > > > 
> > > > > Otherwise, I'd strongly prefer we fix cp.
> > > > > 
> > > > > Warner
> > > > > 
> > > > > On Tue, Sep 22, 2020 at 3:31 PM Alan Somers <
> > > > > asom...@freebsd.org>
> > > > 
> > > > wrote:
> > > > > > 
> > > > > > +1.
> > > > > > 
> > > > > > On Tue, Sep 22, 2020 at 3:27 PM Kyle Evans <
> > > > > > kev...@freebsd.org>
> > > > 
> > > > wrote:
> > > > > > > 
> > > > > > > I'm running a build at the suggestion of mjg to confirm
> > > > > > > there aren't
> > > > > > > any others hiding that can be converted, and I will
> > > > > > > commit after I've
> > > > > > > verified that this is it.
> > > > > > > 
> > > > > > > On Tue, Sep 22, 2020 at 4:02 PM Alan Somers <
> > > > > > > asom...@freebsd.org>
> > > > 
> > > > wrote:
> > > > > > > > 
> > > > > > > > LGTM.
> > > > > > > > 
> > > > > > > > On Tue, Sep 22, 2020 at 2:59 PM Kyle Evans <
> > > > > > > > kev...@freebsd.org>
> > > > 
> > > > wrote:
> > > > > > > > > 
> > > > > > > > > Perhaps:
> > > > > > > > > 
> > > > > > > > > diff --git a/stand/i386/zfsboot/Makefile
> > > > 
> > > > b/stand/i386/zfsboot/Makefile
> > > > > > > > > index ff315abc0ef..7e362b43a39 100644
> > > > > > > > > --- a/stand/i386/zfsboot/Makefile
> > > > > > > > > +++ b/stand/i386/zfsboot/Makefile
> > > > > > > > > @@ -81,7 +81,7 @@ zfsboot.ld: zfsboot.ldr zfsboot.bin
> > > > > > > > > ${BTXKERN}
> > > > > > > > > -o ${.TARGET} -P 1 zfsboot.bin
> > > > > > > > > 
> > > > > > > > >  zfsboot.ldr:
> > > > > > > > > -   cp /dev/null ${.TARGET}
> > > > > > > > > +   :> ${.TARGET}
> > > > > > > > > 
> > > > > > > > >  zfsboot.bin: zfsboot.out
> > > > > > > > > ${OBJCOPY} -S -O binary zfsboot.out
> > > > > > > > > ${.TARGET}
> > > > > > > > > diff --git a/stand/libsa/Makefile
> > > > > > > > > b/stand/libsa/Makefile
> > > > > > > > > index effece9e01b..63cd46a9c54 100644
> > > > > > > > > --- a/stand/libsa/Makefile
> > > > > > > > > +++ b/stand/libsa/Makefile
> > > > > > > > > @@ -122,7 +122,7 @@ beforedepend:
> > > > > > > > > ln -sf ${SRCTOP}/include/arpa/inet.h
> > > > > > > > > arpa/inet.h; \
> > > > > > > > > ln -sf ${SRCTOP}/include/arpa/t
> > > > > > > > > ftp.h arpa/tftp.h; \
> > > > > > > > > for i in _time.h _strings.h _string.h; do \
> > > > > > > > > -   [ -f xlocale/$$i ] || cp /dev/null
> > > > > > > > > xlocale/$$i; \
> > > > > > > > > +   [ -f xlocale/$$i ] || :> xlocale/$$i;
> > > > > > > > > \
> > > > > > > > > done; \
> > > > > > > > > for i in ${STAND_H_INC}; do \
> > > > > > > > > ln -sf ${SASRC}/stand.h $$i; \
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > On Tue, Sep 22, 2020 at 3:58 PM Alan Somers <
> > > > > > > > > asom...@freebsd.org>
> > > > 
> > > > wrote:
> > > > > > > > > > 
> > > > > > > > > > Looks like two places in stand.  Is there any
> > > > > > > > > > reason why
> > > > 
> > > > Mateusz's suggestion wouldn't work?
> > > > > > > > > > 
> > > > > > > > > > > rg -g Makefile 'cp.*/dev/null'
> > > > > > 

Re: svn commit: r365643 - head/bin/cp

2020-09-22 Thread Warner Losh
I think it's a great leap sideways, but I've done cp /dev/null foo to clear
it out for 35 years now... It's why it feels like a workaround.

Though it is a legit optimization, no matter the feelings. As for clearer,
I'm less sure since then I have to remember what the : operator does.

Warner

On Tue, Sep 22, 2020 at 3:48 PM Alan Somers  wrote:

> It doesn't feel like a workaround to me.  I think Kyle's version is
> clearer than the original.
>
> On Tue, Sep 22, 2020 at 3:45 PM Warner Losh  wrote:
>
>>
>>
>> On Tue, Sep 22, 2020 at 3:42 PM Kyle Evans  wrote:
>>
>>> cp is already fixed, people are still feeling the fallout of being
>>> within those revisions and needing to bootstrap their own cp. We can
>>> reduce the number of components these invocations rely on trivially to
>>> shell built-in mechanics, why not do so?
>>>
>>
>> Fair point. I just bristle at putting workarounds in for valid /bin/sh
>> syntax because we opposed for a few days. so long as it's an unconditional
>> clearing of the file to be zero length, I'm OK with that.
>>
>> Warner
>>
>>
>>> On Tue, Sep 22, 2020 at 4:40 PM Warner Losh  wrote:
>>> >
>>> > So why do we need a workaround at all? cp /dev/null has been fixed,
>>> and that's way more important to get right.
>>> >
>>> > I don't want to paper-over issues with this at all, though if we use
>>> the host's (now broken) cp, I suppose that might be OK in the short term.
>>> If that's the case, then maybe this is OK.
>>> >
>>> > Otherwise, I'd strongly prefer we fix cp.
>>> >
>>> > Warner
>>> >
>>> > On Tue, Sep 22, 2020 at 3:31 PM Alan Somers 
>>> wrote:
>>> >>
>>> >> +1.
>>> >>
>>> >> On Tue, Sep 22, 2020 at 3:27 PM Kyle Evans 
>>> wrote:
>>> >>>
>>> >>> I'm running a build at the suggestion of mjg to confirm there aren't
>>> >>> any others hiding that can be converted, and I will commit after I've
>>> >>> verified that this is it.
>>> >>>
>>> >>> On Tue, Sep 22, 2020 at 4:02 PM Alan Somers 
>>> wrote:
>>> >>> >
>>> >>> > LGTM.
>>> >>> >
>>> >>> > On Tue, Sep 22, 2020 at 2:59 PM Kyle Evans 
>>> wrote:
>>> >>> >>
>>> >>> >> Perhaps:
>>> >>> >>
>>> >>> >> diff --git a/stand/i386/zfsboot/Makefile
>>> b/stand/i386/zfsboot/Makefile
>>> >>> >> index ff315abc0ef..7e362b43a39 100644
>>> >>> >> --- a/stand/i386/zfsboot/Makefile
>>> >>> >> +++ b/stand/i386/zfsboot/Makefile
>>> >>> >> @@ -81,7 +81,7 @@ zfsboot.ld: zfsboot.ldr zfsboot.bin ${BTXKERN}
>>> >>> >> -o ${.TARGET} -P 1 zfsboot.bin
>>> >>> >>
>>> >>> >>  zfsboot.ldr:
>>> >>> >> -   cp /dev/null ${.TARGET}
>>> >>> >> +   :> ${.TARGET}
>>> >>> >>
>>> >>> >>  zfsboot.bin: zfsboot.out
>>> >>> >> ${OBJCOPY} -S -O binary zfsboot.out ${.TARGET}
>>> >>> >> diff --git a/stand/libsa/Makefile b/stand/libsa/Makefile
>>> >>> >> index effece9e01b..63cd46a9c54 100644
>>> >>> >> --- a/stand/libsa/Makefile
>>> >>> >> +++ b/stand/libsa/Makefile
>>> >>> >> @@ -122,7 +122,7 @@ beforedepend:
>>> >>> >> ln -sf ${SRCTOP}/include/arpa/inet.h arpa/inet.h; \
>>> >>> >> ln -sf ${SRCTOP}/include/arpa/tftp.h arpa/tftp.h; \
>>> >>> >> for i in _time.h _strings.h _string.h; do \
>>> >>> >> -   [ -f xlocale/$$i ] || cp /dev/null xlocale/$$i; \
>>> >>> >> +   [ -f xlocale/$$i ] || :> xlocale/$$i; \
>>> >>> >> done; \
>>> >>> >> for i in ${STAND_H_INC}; do \
>>> >>> >> ln -sf ${SASRC}/stand.h $$i; \
>>> >>> >>
>>> >>> >>
>>> >>> >> On Tue, Sep 22, 2020 at 3:58 PM Alan Somers 
>>> wrote:
>>> >>> >> >
>>> >>> >> > Looks like two places in stand.  Is there any reason why
>>> Mateusz's suggestion wouldn't work?
>>> >>> >> >
>>> >>> >> > > rg -g Makefile 'cp.*/dev/null'
>>> >>> >> > stand/libsa/Makefile
>>> >>> >> > 125: [ -f xlocale/$$i ] || cp /dev/null xlocale/$$i; \
>>> >>> >> >
>>> >>> >> > stand/i386/zfsboot/Makefile
>>> >>> >> > 82: cp /dev/null ${.TARGET}
>>> >>> >> >
>>> >>> >> > On Tue, Sep 22, 2020 at 2:54 PM Mateusz Guzik <
>>> mjgu...@gmail.com> wrote:
>>> >>> >> >>
>>> >>> >> >> Can we instead add a workaround to the build tree?
>>> >>> >> >>
>>> >>> >> >> Where is cp /dev/null coming from anyway? Perhaps this can be
>>> patched
>>> >>> >> >> to touch the target file.
>>> >>> >> >>
>>> >>> >> >> On 9/22/20, Alan Somers  wrote:
>>> >>> >> >> > On Tue, Sep 22, 2020 at 2:48 PM Kyle Evans <
>>> kev...@freebsd.org> wrote:
>>> >>> >> >> >
>>> >>> >> >> >> On Fri, Sep 11, 2020 at 3:49 PM Alan Somers <
>>> asom...@freebsd.org> wrote:
>>> >>> >> >> >> >
>>> >>> >> >> >> > Author: asomers
>>> >>> >> >> >> > Date: Fri Sep 11 20:49:36 2020
>>> >>> >> >> >> > New Revision: 365643
>>> >>> >> >> >> > URL: https://svnweb.freebsd.org/changeset/base/365643
>>> >>> >> >> >> >
>>> >>> >> >> >> > Log:
>>> >>> >> >> >> >   cp: fall back to read/write if copy_file_range fails
>>> >>> >> >> >> >
>>> >>> >> >> >> >   Even though copy_file_range has a file-system agnostic
>>> version, it
>>> >>> >> >> >> still
>>> >>> >> >> >> >   fails on devfs (perhaps because the file 

Re: svn commit: r365643 - head/bin/cp

2020-09-22 Thread Alan Somers
It doesn't feel like a workaround to me.  I think Kyle's version is clearer
than the original.

On Tue, Sep 22, 2020 at 3:45 PM Warner Losh  wrote:

>
>
> On Tue, Sep 22, 2020 at 3:42 PM Kyle Evans  wrote:
>
>> cp is already fixed, people are still feeling the fallout of being
>> within those revisions and needing to bootstrap their own cp. We can
>> reduce the number of components these invocations rely on trivially to
>> shell built-in mechanics, why not do so?
>>
>
> Fair point. I just bristle at putting workarounds in for valid /bin/sh
> syntax because we opposed for a few days. so long as it's an unconditional
> clearing of the file to be zero length, I'm OK with that.
>
> Warner
>
>
>> On Tue, Sep 22, 2020 at 4:40 PM Warner Losh  wrote:
>> >
>> > So why do we need a workaround at all? cp /dev/null has been fixed, and
>> that's way more important to get right.
>> >
>> > I don't want to paper-over issues with this at all, though if we use
>> the host's (now broken) cp, I suppose that might be OK in the short term.
>> If that's the case, then maybe this is OK.
>> >
>> > Otherwise, I'd strongly prefer we fix cp.
>> >
>> > Warner
>> >
>> > On Tue, Sep 22, 2020 at 3:31 PM Alan Somers 
>> wrote:
>> >>
>> >> +1.
>> >>
>> >> On Tue, Sep 22, 2020 at 3:27 PM Kyle Evans  wrote:
>> >>>
>> >>> I'm running a build at the suggestion of mjg to confirm there aren't
>> >>> any others hiding that can be converted, and I will commit after I've
>> >>> verified that this is it.
>> >>>
>> >>> On Tue, Sep 22, 2020 at 4:02 PM Alan Somers 
>> wrote:
>> >>> >
>> >>> > LGTM.
>> >>> >
>> >>> > On Tue, Sep 22, 2020 at 2:59 PM Kyle Evans 
>> wrote:
>> >>> >>
>> >>> >> Perhaps:
>> >>> >>
>> >>> >> diff --git a/stand/i386/zfsboot/Makefile
>> b/stand/i386/zfsboot/Makefile
>> >>> >> index ff315abc0ef..7e362b43a39 100644
>> >>> >> --- a/stand/i386/zfsboot/Makefile
>> >>> >> +++ b/stand/i386/zfsboot/Makefile
>> >>> >> @@ -81,7 +81,7 @@ zfsboot.ld: zfsboot.ldr zfsboot.bin ${BTXKERN}
>> >>> >> -o ${.TARGET} -P 1 zfsboot.bin
>> >>> >>
>> >>> >>  zfsboot.ldr:
>> >>> >> -   cp /dev/null ${.TARGET}
>> >>> >> +   :> ${.TARGET}
>> >>> >>
>> >>> >>  zfsboot.bin: zfsboot.out
>> >>> >> ${OBJCOPY} -S -O binary zfsboot.out ${.TARGET}
>> >>> >> diff --git a/stand/libsa/Makefile b/stand/libsa/Makefile
>> >>> >> index effece9e01b..63cd46a9c54 100644
>> >>> >> --- a/stand/libsa/Makefile
>> >>> >> +++ b/stand/libsa/Makefile
>> >>> >> @@ -122,7 +122,7 @@ beforedepend:
>> >>> >> ln -sf ${SRCTOP}/include/arpa/inet.h arpa/inet.h; \
>> >>> >> ln -sf ${SRCTOP}/include/arpa/tftp.h arpa/tftp.h; \
>> >>> >> for i in _time.h _strings.h _string.h; do \
>> >>> >> -   [ -f xlocale/$$i ] || cp /dev/null xlocale/$$i; \
>> >>> >> +   [ -f xlocale/$$i ] || :> xlocale/$$i; \
>> >>> >> done; \
>> >>> >> for i in ${STAND_H_INC}; do \
>> >>> >> ln -sf ${SASRC}/stand.h $$i; \
>> >>> >>
>> >>> >>
>> >>> >> On Tue, Sep 22, 2020 at 3:58 PM Alan Somers 
>> wrote:
>> >>> >> >
>> >>> >> > Looks like two places in stand.  Is there any reason why
>> Mateusz's suggestion wouldn't work?
>> >>> >> >
>> >>> >> > > rg -g Makefile 'cp.*/dev/null'
>> >>> >> > stand/libsa/Makefile
>> >>> >> > 125: [ -f xlocale/$$i ] || cp /dev/null xlocale/$$i; \
>> >>> >> >
>> >>> >> > stand/i386/zfsboot/Makefile
>> >>> >> > 82: cp /dev/null ${.TARGET}
>> >>> >> >
>> >>> >> > On Tue, Sep 22, 2020 at 2:54 PM Mateusz Guzik 
>> wrote:
>> >>> >> >>
>> >>> >> >> Can we instead add a workaround to the build tree?
>> >>> >> >>
>> >>> >> >> Where is cp /dev/null coming from anyway? Perhaps this can be
>> patched
>> >>> >> >> to touch the target file.
>> >>> >> >>
>> >>> >> >> On 9/22/20, Alan Somers  wrote:
>> >>> >> >> > On Tue, Sep 22, 2020 at 2:48 PM Kyle Evans <
>> kev...@freebsd.org> wrote:
>> >>> >> >> >
>> >>> >> >> >> On Fri, Sep 11, 2020 at 3:49 PM Alan Somers <
>> asom...@freebsd.org> wrote:
>> >>> >> >> >> >
>> >>> >> >> >> > Author: asomers
>> >>> >> >> >> > Date: Fri Sep 11 20:49:36 2020
>> >>> >> >> >> > New Revision: 365643
>> >>> >> >> >> > URL: https://svnweb.freebsd.org/changeset/base/365643
>> >>> >> >> >> >
>> >>> >> >> >> > Log:
>> >>> >> >> >> >   cp: fall back to read/write if copy_file_range fails
>> >>> >> >> >> >
>> >>> >> >> >> >   Even though copy_file_range has a file-system agnostic
>> version, it
>> >>> >> >> >> still
>> >>> >> >> >> >   fails on devfs (perhaps because the file descriptor is
>> non-seekable?)
>> >>> >> >> >> In
>> >>> >> >> >> >   that case, fallback to old-fashioned read/write. Fixes
>> >>> >> >> >> >   "cp /dev/null /tmp/null"
>> >>> >> >> >> >
>> >>> >> >> >>
>> >>> >> >> >> Hi,
>> >>> >> >> >>
>> >>> >> >> >> Any objection to adding a quick UPDATING entry for this? I'm
>> seeing
>> >>> >> >> >> occasional reports of this breakage as recent as today on
>> IRC from
>> >>> >> >> >> folks that were a little bit thrown off by this because it
>> throws up
>> >>> 

Re: svn commit: r365643 - head/bin/cp

2020-09-22 Thread Warner Losh
On Tue, Sep 22, 2020 at 3:42 PM Kyle Evans  wrote:

> cp is already fixed, people are still feeling the fallout of being
> within those revisions and needing to bootstrap their own cp. We can
> reduce the number of components these invocations rely on trivially to
> shell built-in mechanics, why not do so?
>

Fair point. I just bristle at putting workarounds in for valid /bin/sh
syntax because we opposed for a few days. so long as it's an unconditional
clearing of the file to be zero length, I'm OK with that.

Warner


> On Tue, Sep 22, 2020 at 4:40 PM Warner Losh  wrote:
> >
> > So why do we need a workaround at all? cp /dev/null has been fixed, and
> that's way more important to get right.
> >
> > I don't want to paper-over issues with this at all, though if we use the
> host's (now broken) cp, I suppose that might be OK in the short term. If
> that's the case, then maybe this is OK.
> >
> > Otherwise, I'd strongly prefer we fix cp.
> >
> > Warner
> >
> > On Tue, Sep 22, 2020 at 3:31 PM Alan Somers  wrote:
> >>
> >> +1.
> >>
> >> On Tue, Sep 22, 2020 at 3:27 PM Kyle Evans  wrote:
> >>>
> >>> I'm running a build at the suggestion of mjg to confirm there aren't
> >>> any others hiding that can be converted, and I will commit after I've
> >>> verified that this is it.
> >>>
> >>> On Tue, Sep 22, 2020 at 4:02 PM Alan Somers 
> wrote:
> >>> >
> >>> > LGTM.
> >>> >
> >>> > On Tue, Sep 22, 2020 at 2:59 PM Kyle Evans 
> wrote:
> >>> >>
> >>> >> Perhaps:
> >>> >>
> >>> >> diff --git a/stand/i386/zfsboot/Makefile
> b/stand/i386/zfsboot/Makefile
> >>> >> index ff315abc0ef..7e362b43a39 100644
> >>> >> --- a/stand/i386/zfsboot/Makefile
> >>> >> +++ b/stand/i386/zfsboot/Makefile
> >>> >> @@ -81,7 +81,7 @@ zfsboot.ld: zfsboot.ldr zfsboot.bin ${BTXKERN}
> >>> >> -o ${.TARGET} -P 1 zfsboot.bin
> >>> >>
> >>> >>  zfsboot.ldr:
> >>> >> -   cp /dev/null ${.TARGET}
> >>> >> +   :> ${.TARGET}
> >>> >>
> >>> >>  zfsboot.bin: zfsboot.out
> >>> >> ${OBJCOPY} -S -O binary zfsboot.out ${.TARGET}
> >>> >> diff --git a/stand/libsa/Makefile b/stand/libsa/Makefile
> >>> >> index effece9e01b..63cd46a9c54 100644
> >>> >> --- a/stand/libsa/Makefile
> >>> >> +++ b/stand/libsa/Makefile
> >>> >> @@ -122,7 +122,7 @@ beforedepend:
> >>> >> ln -sf ${SRCTOP}/include/arpa/inet.h arpa/inet.h; \
> >>> >> ln -sf ${SRCTOP}/include/arpa/tftp.h arpa/tftp.h; \
> >>> >> for i in _time.h _strings.h _string.h; do \
> >>> >> -   [ -f xlocale/$$i ] || cp /dev/null xlocale/$$i; \
> >>> >> +   [ -f xlocale/$$i ] || :> xlocale/$$i; \
> >>> >> done; \
> >>> >> for i in ${STAND_H_INC}; do \
> >>> >> ln -sf ${SASRC}/stand.h $$i; \
> >>> >>
> >>> >>
> >>> >> On Tue, Sep 22, 2020 at 3:58 PM Alan Somers 
> wrote:
> >>> >> >
> >>> >> > Looks like two places in stand.  Is there any reason why
> Mateusz's suggestion wouldn't work?
> >>> >> >
> >>> >> > > rg -g Makefile 'cp.*/dev/null'
> >>> >> > stand/libsa/Makefile
> >>> >> > 125: [ -f xlocale/$$i ] || cp /dev/null xlocale/$$i; \
> >>> >> >
> >>> >> > stand/i386/zfsboot/Makefile
> >>> >> > 82: cp /dev/null ${.TARGET}
> >>> >> >
> >>> >> > On Tue, Sep 22, 2020 at 2:54 PM Mateusz Guzik 
> wrote:
> >>> >> >>
> >>> >> >> Can we instead add a workaround to the build tree?
> >>> >> >>
> >>> >> >> Where is cp /dev/null coming from anyway? Perhaps this can be
> patched
> >>> >> >> to touch the target file.
> >>> >> >>
> >>> >> >> On 9/22/20, Alan Somers  wrote:
> >>> >> >> > On Tue, Sep 22, 2020 at 2:48 PM Kyle Evans 
> wrote:
> >>> >> >> >
> >>> >> >> >> On Fri, Sep 11, 2020 at 3:49 PM Alan Somers <
> asom...@freebsd.org> wrote:
> >>> >> >> >> >
> >>> >> >> >> > Author: asomers
> >>> >> >> >> > Date: Fri Sep 11 20:49:36 2020
> >>> >> >> >> > New Revision: 365643
> >>> >> >> >> > URL: https://svnweb.freebsd.org/changeset/base/365643
> >>> >> >> >> >
> >>> >> >> >> > Log:
> >>> >> >> >> >   cp: fall back to read/write if copy_file_range fails
> >>> >> >> >> >
> >>> >> >> >> >   Even though copy_file_range has a file-system agnostic
> version, it
> >>> >> >> >> still
> >>> >> >> >> >   fails on devfs (perhaps because the file descriptor is
> non-seekable?)
> >>> >> >> >> In
> >>> >> >> >> >   that case, fallback to old-fashioned read/write. Fixes
> >>> >> >> >> >   "cp /dev/null /tmp/null"
> >>> >> >> >> >
> >>> >> >> >>
> >>> >> >> >> Hi,
> >>> >> >> >>
> >>> >> >> >> Any objection to adding a quick UPDATING entry for this? I'm
> seeing
> >>> >> >> >> occasional reports of this breakage as recent as today on IRC
> from
> >>> >> >> >> folks that were a little bit thrown off by this because it
> throws up
> >>> >> >> >> fairly far into the build and looks like a stand build
> regression
> >>> >> >> >> instead of a cp regression.
> >>> >> >> >>
> >>> >> >> >> Thanks,
> >>> >> >> >>
> >>> >> >> >> Kyle Evans
> >>> >> >> >>
> >>> >> >> >
> >>> >> >> > No objection.  Can you suggest the proper wording?
> >>> >> >> > 

svn commit: r366014 - in stable/12/sys: dev/bnxt dev/vmware/vmxnet3 net

2020-09-22 Thread Vincenzo Maffione
Author: vmaffione
Date: Tue Sep 22 21:43:43 2020
New Revision: 366014
URL: https://svnweb.freebsd.org/changeset/base/366014

Log:
  MFC r365061
  
  iflib: leave only 1 receive descriptor unused
  
  The pidx argument of isc_rxd_flush() indicates which is the last valid
  receive descriptor to be used by the NIC. However, current code has
  multiple issues:
- Intel drivers write pidx to their RDT register, which means that
  NICs will only use the descriptors up to pidx-1 (modulo ring size N),
  and won't actually use the one pointed by pidx. This does not break
  reception, but it is anyway confusing and suboptimal (the NIC will
  actually see only N-2 descriptors as available, rather than N-1).
  Other drivers (if_vmx, if_bnxt, if_mgb) adhere to this semantic.
- The semantic used by Intel (RDT is one descriptor past the last
  valid one) is used by most (if not all) NICs, and it is also used
  on the TX side (also in iflib). Since iflib is not currently
  using this semantic for RX, it must decrement fl->ifl_pidx
  (modulo N) before calling isc_rxd_flush(), and then the
  per-driver callback implementation must increment the index
  again (to match the real semantic). This is confusing and suboptimal.
- The iflib refill function is also called at initialization.
  However, in case the ring size is smaller than 128 (e.g. if_mgb),
  the refill function will actually prepare all the receive
  descriptors (N), without leaving one unused, as most of NICs assume
  (e.g. to avoid RDT to overrun RDH). I can speculate that the code
  looks like this right now because this issue showed up during
  testing (e.g. with if_mgb), and it was easy to workaround by
  decrementing pidx before isc_rxd_flush().
  
  The goal of this change is to simplify the code (removing a bunch
  of instructions from the RX fast path), and to make the semantic of
  isc_rxd_flush() consistent across drivers. To achieve this, we:
- change the semantics of the pidx argument to the usual one (that
  is the index one past the last valid one), so that both iflib and
  drivers avoid the decrement/increment dance.
- fix the initialization code to prepare at most N-1 descriptors.
  
  Reviewed by:markj
  Differential Revision:  https://reviews.freebsd.org/D26191

Modified:
  stable/12/sys/dev/bnxt/bnxt_txrx.c
  stable/12/sys/dev/vmware/vmxnet3/if_vmx.c
  stable/12/sys/net/iflib.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/bnxt/bnxt_txrx.c
==
--- stable/12/sys/dev/bnxt/bnxt_txrx.c  Tue Sep 22 21:16:03 2020
(r366013)
+++ stable/12/sys/dev/bnxt/bnxt_txrx.c  Tue Sep 22 21:43:43 2020
(r366014)
@@ -316,10 +316,9 @@ bnxt_isc_rxd_flush(void *sc, uint16_t rxqid, uint8_t f
if (softc->rx_cp_rings[rxqid].cons != UINT32_MAX)
BNXT_CP_IDX_DISABLE_DB(>rx_cp_rings[rxqid].ring,
softc->rx_cp_rings[rxqid].cons);
-   /* We're given the last filled RX buffer here, not the next empty one */
-   BNXT_RX_DB(rx_ring, RING_NEXT(rx_ring, pidx));
+   BNXT_RX_DB(rx_ring, pidx);
/* TODO: Cumulus+ doesn't need the double doorbell */
-   BNXT_RX_DB(rx_ring, RING_NEXT(rx_ring, pidx));
+   BNXT_RX_DB(rx_ring, pidx);
return;
 }
 

Modified: stable/12/sys/dev/vmware/vmxnet3/if_vmx.c
==
--- stable/12/sys/dev/vmware/vmxnet3/if_vmx.c   Tue Sep 22 21:16:03 2020
(r366013)
+++ stable/12/sys/dev/vmware/vmxnet3/if_vmx.c   Tue Sep 22 21:43:43 2020
(r366014)
@@ -1744,13 +1744,6 @@ vmxnet3_isc_rxd_flush(void *vsc, uint16_t rxqid, uint8
else
r = VMXNET3_BAR0_RXH2(rxqid);
 
-   /*
-* pidx is the index of the last descriptor with a buffer the device
-* can use, and the device needs to be told which index is one past
-* that.
-*/
-   if (++pidx == rxr->vxrxr_ndesc)
-   pidx = 0;
vmxnet3_write_bar0(sc, r, pidx);
 }
 

Modified: stable/12/sys/net/iflib.c
==
--- stable/12/sys/net/iflib.c   Tue Sep 22 21:16:03 2020(r366013)
+++ stable/12/sys/net/iflib.c   Tue Sep 22 21:43:43 2020(r366014)
@@ -2030,7 +2030,8 @@ _rxq_refill_cb(void *arg, bus_dma_segment_t *segs, int
  * @count: the number of new buffers to allocate
  *
  * (Re)populate an rxq free-buffer list with up to @count new packet buffers.
- * The caller must assure that @count does not exceed the queue's capacity.
+ * The caller must assure that @count does not exceed the queue's capacity
+ * minus one (since we always leave a descriptor unavailable).
  */
 static uint8_t
 iflib_fl_refill(if_ctx_t ctx, iflib_fl_t fl, int count)
@@ -2045,6 +2046,8 @@ iflib_fl_refill(if_ctx_t 

Re: svn commit: r365643 - head/bin/cp

2020-09-22 Thread Kyle Evans
cp is already fixed, people are still feeling the fallout of being
within those revisions and needing to bootstrap their own cp. We can
reduce the number of components these invocations rely on trivially to
shell built-in mechanics, why not do so?

On Tue, Sep 22, 2020 at 4:40 PM Warner Losh  wrote:
>
> So why do we need a workaround at all? cp /dev/null has been fixed, and 
> that's way more important to get right.
>
> I don't want to paper-over issues with this at all, though if we use the 
> host's (now broken) cp, I suppose that might be OK in the short term. If 
> that's the case, then maybe this is OK.
>
> Otherwise, I'd strongly prefer we fix cp.
>
> Warner
>
> On Tue, Sep 22, 2020 at 3:31 PM Alan Somers  wrote:
>>
>> +1.
>>
>> On Tue, Sep 22, 2020 at 3:27 PM Kyle Evans  wrote:
>>>
>>> I'm running a build at the suggestion of mjg to confirm there aren't
>>> any others hiding that can be converted, and I will commit after I've
>>> verified that this is it.
>>>
>>> On Tue, Sep 22, 2020 at 4:02 PM Alan Somers  wrote:
>>> >
>>> > LGTM.
>>> >
>>> > On Tue, Sep 22, 2020 at 2:59 PM Kyle Evans  wrote:
>>> >>
>>> >> Perhaps:
>>> >>
>>> >> diff --git a/stand/i386/zfsboot/Makefile b/stand/i386/zfsboot/Makefile
>>> >> index ff315abc0ef..7e362b43a39 100644
>>> >> --- a/stand/i386/zfsboot/Makefile
>>> >> +++ b/stand/i386/zfsboot/Makefile
>>> >> @@ -81,7 +81,7 @@ zfsboot.ld: zfsboot.ldr zfsboot.bin ${BTXKERN}
>>> >> -o ${.TARGET} -P 1 zfsboot.bin
>>> >>
>>> >>  zfsboot.ldr:
>>> >> -   cp /dev/null ${.TARGET}
>>> >> +   :> ${.TARGET}
>>> >>
>>> >>  zfsboot.bin: zfsboot.out
>>> >> ${OBJCOPY} -S -O binary zfsboot.out ${.TARGET}
>>> >> diff --git a/stand/libsa/Makefile b/stand/libsa/Makefile
>>> >> index effece9e01b..63cd46a9c54 100644
>>> >> --- a/stand/libsa/Makefile
>>> >> +++ b/stand/libsa/Makefile
>>> >> @@ -122,7 +122,7 @@ beforedepend:
>>> >> ln -sf ${SRCTOP}/include/arpa/inet.h arpa/inet.h; \
>>> >> ln -sf ${SRCTOP}/include/arpa/tftp.h arpa/tftp.h; \
>>> >> for i in _time.h _strings.h _string.h; do \
>>> >> -   [ -f xlocale/$$i ] || cp /dev/null xlocale/$$i; \
>>> >> +   [ -f xlocale/$$i ] || :> xlocale/$$i; \
>>> >> done; \
>>> >> for i in ${STAND_H_INC}; do \
>>> >> ln -sf ${SASRC}/stand.h $$i; \
>>> >>
>>> >>
>>> >> On Tue, Sep 22, 2020 at 3:58 PM Alan Somers  wrote:
>>> >> >
>>> >> > Looks like two places in stand.  Is there any reason why Mateusz's 
>>> >> > suggestion wouldn't work?
>>> >> >
>>> >> > > rg -g Makefile 'cp.*/dev/null'
>>> >> > stand/libsa/Makefile
>>> >> > 125: [ -f xlocale/$$i ] || cp /dev/null xlocale/$$i; \
>>> >> >
>>> >> > stand/i386/zfsboot/Makefile
>>> >> > 82: cp /dev/null ${.TARGET}
>>> >> >
>>> >> > On Tue, Sep 22, 2020 at 2:54 PM Mateusz Guzik  
>>> >> > wrote:
>>> >> >>
>>> >> >> Can we instead add a workaround to the build tree?
>>> >> >>
>>> >> >> Where is cp /dev/null coming from anyway? Perhaps this can be patched
>>> >> >> to touch the target file.
>>> >> >>
>>> >> >> On 9/22/20, Alan Somers  wrote:
>>> >> >> > On Tue, Sep 22, 2020 at 2:48 PM Kyle Evans  
>>> >> >> > wrote:
>>> >> >> >
>>> >> >> >> On Fri, Sep 11, 2020 at 3:49 PM Alan Somers  
>>> >> >> >> wrote:
>>> >> >> >> >
>>> >> >> >> > Author: asomers
>>> >> >> >> > Date: Fri Sep 11 20:49:36 2020
>>> >> >> >> > New Revision: 365643
>>> >> >> >> > URL: https://svnweb.freebsd.org/changeset/base/365643
>>> >> >> >> >
>>> >> >> >> > Log:
>>> >> >> >> >   cp: fall back to read/write if copy_file_range fails
>>> >> >> >> >
>>> >> >> >> >   Even though copy_file_range has a file-system agnostic 
>>> >> >> >> > version, it
>>> >> >> >> still
>>> >> >> >> >   fails on devfs (perhaps because the file descriptor is 
>>> >> >> >> > non-seekable?)
>>> >> >> >> In
>>> >> >> >> >   that case, fallback to old-fashioned read/write. Fixes
>>> >> >> >> >   "cp /dev/null /tmp/null"
>>> >> >> >> >
>>> >> >> >>
>>> >> >> >> Hi,
>>> >> >> >>
>>> >> >> >> Any objection to adding a quick UPDATING entry for this? I'm seeing
>>> >> >> >> occasional reports of this breakage as recent as today on IRC from
>>> >> >> >> folks that were a little bit thrown off by this because it throws 
>>> >> >> >> up
>>> >> >> >> fairly far into the build and looks like a stand build regression
>>> >> >> >> instead of a cp regression.
>>> >> >> >>
>>> >> >> >> Thanks,
>>> >> >> >>
>>> >> >> >> Kyle Evans
>>> >> >> >>
>>> >> >> >
>>> >> >> > No objection.  Can you suggest the proper wording?
>>> >> >> > ___
>>> >> >> > 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"
>>> >> >> >
>>> >> >>
>>> >> >>
>>> >> >> --
>>> >> >> Mateusz Guzik 
___
svn-src-all@freebsd.org mailing list

Re: svn commit: r365643 - head/bin/cp

2020-09-22 Thread Warner Losh
So why do we need a workaround at all? cp /dev/null has been fixed, and
that's way more important to get right.

I don't want to paper-over issues with this at all, though if we use the
host's (now broken) cp, I suppose that might be OK in the short term. If
that's the case, then maybe this is OK.

Otherwise, I'd strongly prefer we fix cp.

Warner

On Tue, Sep 22, 2020 at 3:31 PM Alan Somers  wrote:

> +1.
>
> On Tue, Sep 22, 2020 at 3:27 PM Kyle Evans  wrote:
>
>> I'm running a build at the suggestion of mjg to confirm there aren't
>> any others hiding that can be converted, and I will commit after I've
>> verified that this is it.
>>
>> On Tue, Sep 22, 2020 at 4:02 PM Alan Somers  wrote:
>> >
>> > LGTM.
>> >
>> > On Tue, Sep 22, 2020 at 2:59 PM Kyle Evans  wrote:
>> >>
>> >> Perhaps:
>> >>
>> >> diff --git a/stand/i386/zfsboot/Makefile b/stand/i386/zfsboot/Makefile
>> >> index ff315abc0ef..7e362b43a39 100644
>> >> --- a/stand/i386/zfsboot/Makefile
>> >> +++ b/stand/i386/zfsboot/Makefile
>> >> @@ -81,7 +81,7 @@ zfsboot.ld: zfsboot.ldr zfsboot.bin ${BTXKERN}
>> >> -o ${.TARGET} -P 1 zfsboot.bin
>> >>
>> >>  zfsboot.ldr:
>> >> -   cp /dev/null ${.TARGET}
>> >> +   :> ${.TARGET}
>> >>
>> >>  zfsboot.bin: zfsboot.out
>> >> ${OBJCOPY} -S -O binary zfsboot.out ${.TARGET}
>> >> diff --git a/stand/libsa/Makefile b/stand/libsa/Makefile
>> >> index effece9e01b..63cd46a9c54 100644
>> >> --- a/stand/libsa/Makefile
>> >> +++ b/stand/libsa/Makefile
>> >> @@ -122,7 +122,7 @@ beforedepend:
>> >> ln -sf ${SRCTOP}/include/arpa/inet.h arpa/inet.h; \
>> >> ln -sf ${SRCTOP}/include/arpa/tftp.h arpa/tftp.h; \
>> >> for i in _time.h _strings.h _string.h; do \
>> >> -   [ -f xlocale/$$i ] || cp /dev/null xlocale/$$i; \
>> >> +   [ -f xlocale/$$i ] || :> xlocale/$$i; \
>> >> done; \
>> >> for i in ${STAND_H_INC}; do \
>> >> ln -sf ${SASRC}/stand.h $$i; \
>> >>
>> >>
>> >> On Tue, Sep 22, 2020 at 3:58 PM Alan Somers 
>> wrote:
>> >> >
>> >> > Looks like two places in stand.  Is there any reason why Mateusz's
>> suggestion wouldn't work?
>> >> >
>> >> > > rg -g Makefile 'cp.*/dev/null'
>> >> > stand/libsa/Makefile
>> >> > 125: [ -f xlocale/$$i ] || cp /dev/null xlocale/$$i; \
>> >> >
>> >> > stand/i386/zfsboot/Makefile
>> >> > 82: cp /dev/null ${.TARGET}
>> >> >
>> >> > On Tue, Sep 22, 2020 at 2:54 PM Mateusz Guzik 
>> wrote:
>> >> >>
>> >> >> Can we instead add a workaround to the build tree?
>> >> >>
>> >> >> Where is cp /dev/null coming from anyway? Perhaps this can be
>> patched
>> >> >> to touch the target file.
>> >> >>
>> >> >> On 9/22/20, Alan Somers  wrote:
>> >> >> > On Tue, Sep 22, 2020 at 2:48 PM Kyle Evans 
>> wrote:
>> >> >> >
>> >> >> >> On Fri, Sep 11, 2020 at 3:49 PM Alan Somers 
>> wrote:
>> >> >> >> >
>> >> >> >> > Author: asomers
>> >> >> >> > Date: Fri Sep 11 20:49:36 2020
>> >> >> >> > New Revision: 365643
>> >> >> >> > URL: https://svnweb.freebsd.org/changeset/base/365643
>> >> >> >> >
>> >> >> >> > Log:
>> >> >> >> >   cp: fall back to read/write if copy_file_range fails
>> >> >> >> >
>> >> >> >> >   Even though copy_file_range has a file-system agnostic
>> version, it
>> >> >> >> still
>> >> >> >> >   fails on devfs (perhaps because the file descriptor is
>> non-seekable?)
>> >> >> >> In
>> >> >> >> >   that case, fallback to old-fashioned read/write. Fixes
>> >> >> >> >   "cp /dev/null /tmp/null"
>> >> >> >> >
>> >> >> >>
>> >> >> >> Hi,
>> >> >> >>
>> >> >> >> Any objection to adding a quick UPDATING entry for this? I'm
>> seeing
>> >> >> >> occasional reports of this breakage as recent as today on IRC
>> from
>> >> >> >> folks that were a little bit thrown off by this because it
>> throws up
>> >> >> >> fairly far into the build and looks like a stand build regression
>> >> >> >> instead of a cp regression.
>> >> >> >>
>> >> >> >> Thanks,
>> >> >> >>
>> >> >> >> Kyle Evans
>> >> >> >>
>> >> >> >
>> >> >> > No objection.  Can you suggest the proper wording?
>> >> >> > ___
>> >> >> > 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"
>> >> >> >
>> >> >>
>> >> >>
>> >> >> --
>> >> >> Mateusz Guzik 
>>
>
___
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: r365643 - head/bin/cp

2020-09-22 Thread Alan Somers
+1.

On Tue, Sep 22, 2020 at 3:27 PM Kyle Evans  wrote:

> I'm running a build at the suggestion of mjg to confirm there aren't
> any others hiding that can be converted, and I will commit after I've
> verified that this is it.
>
> On Tue, Sep 22, 2020 at 4:02 PM Alan Somers  wrote:
> >
> > LGTM.
> >
> > On Tue, Sep 22, 2020 at 2:59 PM Kyle Evans  wrote:
> >>
> >> Perhaps:
> >>
> >> diff --git a/stand/i386/zfsboot/Makefile b/stand/i386/zfsboot/Makefile
> >> index ff315abc0ef..7e362b43a39 100644
> >> --- a/stand/i386/zfsboot/Makefile
> >> +++ b/stand/i386/zfsboot/Makefile
> >> @@ -81,7 +81,7 @@ zfsboot.ld: zfsboot.ldr zfsboot.bin ${BTXKERN}
> >> -o ${.TARGET} -P 1 zfsboot.bin
> >>
> >>  zfsboot.ldr:
> >> -   cp /dev/null ${.TARGET}
> >> +   :> ${.TARGET}
> >>
> >>  zfsboot.bin: zfsboot.out
> >> ${OBJCOPY} -S -O binary zfsboot.out ${.TARGET}
> >> diff --git a/stand/libsa/Makefile b/stand/libsa/Makefile
> >> index effece9e01b..63cd46a9c54 100644
> >> --- a/stand/libsa/Makefile
> >> +++ b/stand/libsa/Makefile
> >> @@ -122,7 +122,7 @@ beforedepend:
> >> ln -sf ${SRCTOP}/include/arpa/inet.h arpa/inet.h; \
> >> ln -sf ${SRCTOP}/include/arpa/tftp.h arpa/tftp.h; \
> >> for i in _time.h _strings.h _string.h; do \
> >> -   [ -f xlocale/$$i ] || cp /dev/null xlocale/$$i; \
> >> +   [ -f xlocale/$$i ] || :> xlocale/$$i; \
> >> done; \
> >> for i in ${STAND_H_INC}; do \
> >> ln -sf ${SASRC}/stand.h $$i; \
> >>
> >>
> >> On Tue, Sep 22, 2020 at 3:58 PM Alan Somers 
> wrote:
> >> >
> >> > Looks like two places in stand.  Is there any reason why Mateusz's
> suggestion wouldn't work?
> >> >
> >> > > rg -g Makefile 'cp.*/dev/null'
> >> > stand/libsa/Makefile
> >> > 125: [ -f xlocale/$$i ] || cp /dev/null xlocale/$$i; \
> >> >
> >> > stand/i386/zfsboot/Makefile
> >> > 82: cp /dev/null ${.TARGET}
> >> >
> >> > On Tue, Sep 22, 2020 at 2:54 PM Mateusz Guzik 
> wrote:
> >> >>
> >> >> Can we instead add a workaround to the build tree?
> >> >>
> >> >> Where is cp /dev/null coming from anyway? Perhaps this can be patched
> >> >> to touch the target file.
> >> >>
> >> >> On 9/22/20, Alan Somers  wrote:
> >> >> > On Tue, Sep 22, 2020 at 2:48 PM Kyle Evans 
> wrote:
> >> >> >
> >> >> >> On Fri, Sep 11, 2020 at 3:49 PM Alan Somers 
> wrote:
> >> >> >> >
> >> >> >> > Author: asomers
> >> >> >> > Date: Fri Sep 11 20:49:36 2020
> >> >> >> > New Revision: 365643
> >> >> >> > URL: https://svnweb.freebsd.org/changeset/base/365643
> >> >> >> >
> >> >> >> > Log:
> >> >> >> >   cp: fall back to read/write if copy_file_range fails
> >> >> >> >
> >> >> >> >   Even though copy_file_range has a file-system agnostic
> version, it
> >> >> >> still
> >> >> >> >   fails on devfs (perhaps because the file descriptor is
> non-seekable?)
> >> >> >> In
> >> >> >> >   that case, fallback to old-fashioned read/write. Fixes
> >> >> >> >   "cp /dev/null /tmp/null"
> >> >> >> >
> >> >> >>
> >> >> >> Hi,
> >> >> >>
> >> >> >> Any objection to adding a quick UPDATING entry for this? I'm
> seeing
> >> >> >> occasional reports of this breakage as recent as today on IRC from
> >> >> >> folks that were a little bit thrown off by this because it throws
> up
> >> >> >> fairly far into the build and looks like a stand build regression
> >> >> >> instead of a cp regression.
> >> >> >>
> >> >> >> Thanks,
> >> >> >>
> >> >> >> Kyle Evans
> >> >> >>
> >> >> >
> >> >> > No objection.  Can you suggest the proper wording?
> >> >> > ___
> >> >> > 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"
> >> >> >
> >> >>
> >> >>
> >> >> --
> >> >> Mateusz Guzik 
>
___
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: r365643 - head/bin/cp

2020-09-22 Thread Kyle Evans
I'm running a build at the suggestion of mjg to confirm there aren't
any others hiding that can be converted, and I will commit after I've
verified that this is it.

On Tue, Sep 22, 2020 at 4:02 PM Alan Somers  wrote:
>
> LGTM.
>
> On Tue, Sep 22, 2020 at 2:59 PM Kyle Evans  wrote:
>>
>> Perhaps:
>>
>> diff --git a/stand/i386/zfsboot/Makefile b/stand/i386/zfsboot/Makefile
>> index ff315abc0ef..7e362b43a39 100644
>> --- a/stand/i386/zfsboot/Makefile
>> +++ b/stand/i386/zfsboot/Makefile
>> @@ -81,7 +81,7 @@ zfsboot.ld: zfsboot.ldr zfsboot.bin ${BTXKERN}
>> -o ${.TARGET} -P 1 zfsboot.bin
>>
>>  zfsboot.ldr:
>> -   cp /dev/null ${.TARGET}
>> +   :> ${.TARGET}
>>
>>  zfsboot.bin: zfsboot.out
>> ${OBJCOPY} -S -O binary zfsboot.out ${.TARGET}
>> diff --git a/stand/libsa/Makefile b/stand/libsa/Makefile
>> index effece9e01b..63cd46a9c54 100644
>> --- a/stand/libsa/Makefile
>> +++ b/stand/libsa/Makefile
>> @@ -122,7 +122,7 @@ beforedepend:
>> ln -sf ${SRCTOP}/include/arpa/inet.h arpa/inet.h; \
>> ln -sf ${SRCTOP}/include/arpa/tftp.h arpa/tftp.h; \
>> for i in _time.h _strings.h _string.h; do \
>> -   [ -f xlocale/$$i ] || cp /dev/null xlocale/$$i; \
>> +   [ -f xlocale/$$i ] || :> xlocale/$$i; \
>> done; \
>> for i in ${STAND_H_INC}; do \
>> ln -sf ${SASRC}/stand.h $$i; \
>>
>>
>> On Tue, Sep 22, 2020 at 3:58 PM Alan Somers  wrote:
>> >
>> > Looks like two places in stand.  Is there any reason why Mateusz's 
>> > suggestion wouldn't work?
>> >
>> > > rg -g Makefile 'cp.*/dev/null'
>> > stand/libsa/Makefile
>> > 125: [ -f xlocale/$$i ] || cp /dev/null xlocale/$$i; \
>> >
>> > stand/i386/zfsboot/Makefile
>> > 82: cp /dev/null ${.TARGET}
>> >
>> > On Tue, Sep 22, 2020 at 2:54 PM Mateusz Guzik  wrote:
>> >>
>> >> Can we instead add a workaround to the build tree?
>> >>
>> >> Where is cp /dev/null coming from anyway? Perhaps this can be patched
>> >> to touch the target file.
>> >>
>> >> On 9/22/20, Alan Somers  wrote:
>> >> > On Tue, Sep 22, 2020 at 2:48 PM Kyle Evans  wrote:
>> >> >
>> >> >> On Fri, Sep 11, 2020 at 3:49 PM Alan Somers  
>> >> >> wrote:
>> >> >> >
>> >> >> > Author: asomers
>> >> >> > Date: Fri Sep 11 20:49:36 2020
>> >> >> > New Revision: 365643
>> >> >> > URL: https://svnweb.freebsd.org/changeset/base/365643
>> >> >> >
>> >> >> > Log:
>> >> >> >   cp: fall back to read/write if copy_file_range fails
>> >> >> >
>> >> >> >   Even though copy_file_range has a file-system agnostic version, it
>> >> >> still
>> >> >> >   fails on devfs (perhaps because the file descriptor is 
>> >> >> > non-seekable?)
>> >> >> In
>> >> >> >   that case, fallback to old-fashioned read/write. Fixes
>> >> >> >   "cp /dev/null /tmp/null"
>> >> >> >
>> >> >>
>> >> >> Hi,
>> >> >>
>> >> >> Any objection to adding a quick UPDATING entry for this? I'm seeing
>> >> >> occasional reports of this breakage as recent as today on IRC from
>> >> >> folks that were a little bit thrown off by this because it throws up
>> >> >> fairly far into the build and looks like a stand build regression
>> >> >> instead of a cp regression.
>> >> >>
>> >> >> Thanks,
>> >> >>
>> >> >> Kyle Evans
>> >> >>
>> >> >
>> >> > No objection.  Can you suggest the proper wording?
>> >> > ___
>> >> > 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"
>> >> >
>> >>
>> >>
>> >> --
>> >> Mateusz Guzik 
___
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: r366013 - in stable/12: lib lib/libnetmap share/mk

2020-09-22 Thread Vincenzo Maffione
Author: vmaffione
Date: Tue Sep 22 21:16:03 2020
New Revision: 366013
URL: https://svnweb.freebsd.org/changeset/base/366013

Log:
  MFC r364936, r365023
  
  lib: add libnetmap
  
  This changeset introduces the new libnetmap library for writing
  netmap applications.
  Before libnetmap, applications could either use the kernel API
  directly (e.g. NIOCREGIF/NIOCCTRL) or the simple header-only-library
  netmap_user.h (e.g. nm_open(), nm_close(), nm_mmap() etc.)
  
  The new library offers more functionalities than netmap_user.h:
- Support for complex netmap options, such as external memory
  allocators or per-buffer offsets. This opens the way to future
  extensions.
- More flexibility in the netmap port bind options, such as
  non-numeric names for pipes, or the ability to specify the netmap
  allocator that must be used for a given port.
- Automatic tracking of the netmap memory regions in use across the
  open ports.
  
  At the moment there is no man page, but the libnetmap.h header file
   has in-depth documentation.
  
  Reviewed by:hrs
  Differential Revision:  https://reviews.freebsd.org/D26171

Added:
  stable/12/lib/libnetmap/
 - copied from r364936, head/lib/libnetmap/
Modified:
  stable/12/lib/Makefile
  stable/12/lib/libnetmap/nmctx-pthreads.c
  stable/12/lib/libnetmap/nmctx.c
  stable/12/lib/libnetmap/nmport.c
  stable/12/lib/libnetmap/nmreq.c
  stable/12/share/mk/bsd.libnames.mk
  stable/12/share/mk/src.libnames.mk
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/lib/Makefile
==
--- stable/12/lib/Makefile  Tue Sep 22 21:13:26 2020(r366012)
+++ stable/12/lib/Makefile  Tue Sep 22 21:16:03 2020(r366013)
@@ -66,6 +66,7 @@ SUBDIR=   ${SUBDIR_BOOTSTRAP} \
libmt \
lib80211 \
libnetbsd \
+   libnetmap \
libnv \
libopenbsd \
libopie \

Modified: stable/12/lib/libnetmap/nmctx-pthreads.c
==
--- head/lib/libnetmap/nmctx-pthreads.c Fri Aug 28 20:03:54 2020
(r364936)
+++ stable/12/lib/libnetmap/nmctx-pthreads.cTue Sep 22 21:16:03 2020
(r366013)
@@ -1,4 +1,34 @@
-/* $FreeBSD$ */
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright (C) 2018 Universita` di Pisa
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   1. Redistributions of source code must retain the above copyright
+ *  notice, this list of conditions and the following disclaimer.
+ *   2. Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
 #include 
 #include 
 #include 

Modified: stable/12/lib/libnetmap/nmctx.c
==
--- head/lib/libnetmap/nmctx.c  Fri Aug 28 20:03:54 2020(r364936)
+++ stable/12/lib/libnetmap/nmctx.c Tue Sep 22 21:16:03 2020
(r366013)
@@ -1,4 +1,34 @@
-/* $FreeBSD$ */
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright (C) 2018 Universita` di Pisa
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   1. Redistributions of source code must retain the above copyright
+ *  notice, this list of conditions and the following disclaimer.
+ *   2. Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF 

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

2020-09-22 Thread Christian Brueffer
Author: brueffer
Date: Tue Sep 22 21:13:26 2020
New Revision: 366012
URL: https://svnweb.freebsd.org/changeset/base/366012

Log:
  Fix a bunch of mdoc issues found by mandoc -Tlint.

Modified:
  head/share/man/man4/cc_newreno.4
  head/share/man/man4/ddb.4
  head/share/man/man4/ena.4
  head/share/man/man4/fdc.4
  head/share/man/man4/gpioiic.4
  head/share/man/man4/iicmux.4
  head/share/man/man4/itwd.4
  head/share/man/man4/linux.4
  head/share/man/man4/mem.4
  head/share/man/man4/nda.4
  head/share/man/man4/ng_patch.4
  head/share/man/man4/psm.4
  head/share/man/man4/rum.4
  head/share/man/man4/smb.4
  head/share/man/man4/umass.4
  head/share/man/man4/vale.4
  head/share/man/man4/vmd.4
  head/share/man/man4/wbwd.4

Modified: head/share/man/man4/cc_newreno.4
==
--- head/share/man/man4/cc_newreno.4Tue Sep 22 20:20:43 2020
(r366011)
+++ head/share/man/man4/cc_newreno.4Tue Sep 22 21:13:26 2020
(r366012)
@@ -47,13 +47,13 @@ The
 module supports a number of socket options under TCP_CCALGOOPT (refer to
 .Xr tcp 4
 and
-.Xr moc_cc 9 for details)
+.Xr mod_cc 9 for details)
 which can
 be set with
 .Xr setsockopt 2
 and tested with
 .Xr getsockopt 2 .
-The 
+The
 .Nm
 socket options use this structure defined in
 :

Modified: head/share/man/man4/ddb.4
==
--- head/share/man/man4/ddb.4   Tue Sep 22 20:20:43 2020(r366011)
+++ head/share/man/man4/ddb.4   Tue Sep 22 21:13:26 2020(r366012)
@@ -532,9 +532,7 @@ if the argument is a decimal number, or address
 .Ar addr ,
 otherwise.
 .El
-.Pp
 .Ss SPECIALIZED HELPER COMMANDS
-.Pp
 .Bl -tag -width indent -compact
 .It Xo
 .Ic findstack

Modified: head/share/man/man4/ena.4
==
--- head/share/man/man4/ena.4   Tue Sep 22 20:20:43 2020(r366011)
+++ head/share/man/man4/ena.4   Tue Sep 22 21:13:26 2020(r366012)
@@ -263,6 +263,7 @@ Packet with unsupported number of segments was queued 
 device.
 .br
 Packet will be dropped.
+.El
 .Sh SUPPORT
 If an issue is identified with the released source code with a supported
 adapter, please email the specific information related to the issue to
@@ -276,4 +277,4 @@ and
 The
 .Nm
 driver was written by
-.An Semihalf.
+.An Semihalf .

Modified: head/share/man/man4/fdc.4
==
--- head/share/man/man4/fdc.4   Tue Sep 22 20:20:43 2020(r366011)
+++ head/share/man/man4/fdc.4   Tue Sep 22 21:13:26 2020(r366012)
@@ -322,14 +322,14 @@ The PC Card attachment of this driver is scheduled for
 floppy disk device nodes
 .El
 .Sh SEE ALSO
-.Xr fdformat 1 ,
 .Xr fdread 1 ,
 .Xr fdwrite 1 ,
 .Xr ioctl 2 ,
 .Xr open 2 ,
 .Xr read 2 ,
 .Xr write 2 ,
-.Xr fdcontrol 8
+.Xr fdcontrol 8 ,
+.Xr fdformat 8
 .Sh AUTHORS
 .An -nosplit
 This man page was initially written by

Modified: head/share/man/man4/gpioiic.4
==
--- head/share/man/man4/gpioiic.4   Tue Sep 22 20:20:43 2020
(r366011)
+++ head/share/man/man4/gpioiic.4   Tue Sep 22 21:13:26 2020
(r366012)
@@ -61,7 +61,6 @@ The pins are never driven to the logical value of '1'.
 They are driven to '0' or switched to input mode (Hi-Z/tri-state), and
 an external pullup resistor pulls the line to the 1 state unless some
 other device on the bus is driving it to 0.
-.Pp
 .Sh HINTS CONFIGURATION
 On a
 .Xr device.hints 5

Modified: head/share/man/man4/iicmux.4
==
--- head/share/man/man4/iicmux.4Tue Sep 22 20:20:43 2020
(r366011)
+++ head/share/man/man4/iicmux.4Tue Sep 22 21:13:26 2020
(r366012)
@@ -140,7 +140,7 @@ When configured via hints, the driver automatically ad
 instance for every downstream bus supported by the chip.
 There is currently no way to indicate used versus unused downstream buses.
 .Sh SEE ALSO
-.Xr iicbus 4 ,
+.Xr iicbus 4
 .Sh HISTORY
 The
 .Nm

Modified: head/share/man/man4/itwd.4
==
--- head/share/man/man4/itwd.4  Tue Sep 22 20:20:43 2020(r366011)
+++ head/share/man/man4/itwd.4  Tue Sep 22 21:13:26 2020(r366012)
@@ -63,7 +63,7 @@ IT8728F
 IT8771F
 .El
 .Sh SEE ALSO
-.Xr superio 4
+.Xr superio 4 ,
 .Xr watchdog 4 ,
 .Xr device.hints 5 ,
 .Xr watchdog 8 ,

Modified: head/share/man/man4/linux.4
==
--- head/share/man/man4/linux.4 Tue Sep 22 20:20:43 2020(r366011)
+++ head/share/man/man4/linux.4 Tue Sep 22 21:13:26 2020(r366012)
@@ -125,6 +125,7 @@ From a user perspective, this makes
 .Va SIGINFO
 work for Linux executables.
 Defaults to 0.
+.El
 .Sh FILES
 

Re: svn commit: r360037 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2020-09-22 Thread Gleb Smirnoff
  Kyle,

On Thu, Sep 03, 2020 at 12:49:41PM -0500, Kyle Evans wrote:
K> > Author: glebius
K> > Date: Fri Apr 17 06:05:08 2020
K> > New Revision: 360037
K> > URL: https://svnweb.freebsd.org/changeset/base/360037
K> >
K> > Log:
K> >   Make ZFS depend on xdr.ko only.  It doesn't need kernel RPC.
K> >
K> >   Differential Revision:https://reviews.freebsd.org/D24408
K> >
K> 
K> Would you object to me MFC'ing this series to stable/12? It's pretty
K> useful for building a good MINIMAL config with zfs support, and would
K> probably allow us to drop a __FreeBSD_version split of dependencies in
K> the short-to-mid term from OpenZFS if we don't need to pretend that
K> OpenZFS will build on 11. None of it looked too invasive for stable
K> from a cursory glance.

My apologies for the delay. Of course, these changes can be easily MFCed.
Go forward for it.

-- 
Gleb Smirnoff
___
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: r365643 - head/bin/cp

2020-09-22 Thread Alan Somers
LGTM.

On Tue, Sep 22, 2020 at 2:59 PM Kyle Evans  wrote:

> Perhaps:
>
> diff --git a/stand/i386/zfsboot/Makefile b/stand/i386/zfsboot/Makefile
> index ff315abc0ef..7e362b43a39 100644
> --- a/stand/i386/zfsboot/Makefile
> +++ b/stand/i386/zfsboot/Makefile
> @@ -81,7 +81,7 @@ zfsboot.ld: zfsboot.ldr zfsboot.bin ${BTXKERN}
> -o ${.TARGET} -P 1 zfsboot.bin
>
>  zfsboot.ldr:
> -   cp /dev/null ${.TARGET}
> +   :> ${.TARGET}
>
>  zfsboot.bin: zfsboot.out
> ${OBJCOPY} -S -O binary zfsboot.out ${.TARGET}
> diff --git a/stand/libsa/Makefile b/stand/libsa/Makefile
> index effece9e01b..63cd46a9c54 100644
> --- a/stand/libsa/Makefile
> +++ b/stand/libsa/Makefile
> @@ -122,7 +122,7 @@ beforedepend:
> ln -sf ${SRCTOP}/include/arpa/inet.h arpa/inet.h; \
> ln -sf ${SRCTOP}/include/arpa/tftp.h arpa/tftp.h; \
> for i in _time.h _strings.h _string.h; do \
> -   [ -f xlocale/$$i ] || cp /dev/null xlocale/$$i; \
> +   [ -f xlocale/$$i ] || :> xlocale/$$i; \
> done; \
> for i in ${STAND_H_INC}; do \
> ln -sf ${SASRC}/stand.h $$i; \
>
>
> On Tue, Sep 22, 2020 at 3:58 PM Alan Somers  wrote:
> >
> > Looks like two places in stand.  Is there any reason why Mateusz's
> suggestion wouldn't work?
> >
> > > rg -g Makefile 'cp.*/dev/null'
> > stand/libsa/Makefile
> > 125: [ -f xlocale/$$i ] || cp /dev/null xlocale/$$i; \
> >
> > stand/i386/zfsboot/Makefile
> > 82: cp /dev/null ${.TARGET}
> >
> > On Tue, Sep 22, 2020 at 2:54 PM Mateusz Guzik  wrote:
> >>
> >> Can we instead add a workaround to the build tree?
> >>
> >> Where is cp /dev/null coming from anyway? Perhaps this can be patched
> >> to touch the target file.
> >>
> >> On 9/22/20, Alan Somers  wrote:
> >> > On Tue, Sep 22, 2020 at 2:48 PM Kyle Evans 
> wrote:
> >> >
> >> >> On Fri, Sep 11, 2020 at 3:49 PM Alan Somers 
> wrote:
> >> >> >
> >> >> > Author: asomers
> >> >> > Date: Fri Sep 11 20:49:36 2020
> >> >> > New Revision: 365643
> >> >> > URL: https://svnweb.freebsd.org/changeset/base/365643
> >> >> >
> >> >> > Log:
> >> >> >   cp: fall back to read/write if copy_file_range fails
> >> >> >
> >> >> >   Even though copy_file_range has a file-system agnostic version,
> it
> >> >> still
> >> >> >   fails on devfs (perhaps because the file descriptor is
> non-seekable?)
> >> >> In
> >> >> >   that case, fallback to old-fashioned read/write. Fixes
> >> >> >   "cp /dev/null /tmp/null"
> >> >> >
> >> >>
> >> >> Hi,
> >> >>
> >> >> Any objection to adding a quick UPDATING entry for this? I'm seeing
> >> >> occasional reports of this breakage as recent as today on IRC from
> >> >> folks that were a little bit thrown off by this because it throws up
> >> >> fairly far into the build and looks like a stand build regression
> >> >> instead of a cp regression.
> >> >>
> >> >> Thanks,
> >> >>
> >> >> Kyle Evans
> >> >>
> >> >
> >> > No objection.  Can you suggest the proper wording?
> >> > ___
> >> > 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
> "
> >> >
> >>
> >>
> >> --
> >> Mateusz Guzik 
>
___
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: r365643 - head/bin/cp

2020-09-22 Thread Kyle Evans
Perhaps:

diff --git a/stand/i386/zfsboot/Makefile b/stand/i386/zfsboot/Makefile
index ff315abc0ef..7e362b43a39 100644
--- a/stand/i386/zfsboot/Makefile
+++ b/stand/i386/zfsboot/Makefile
@@ -81,7 +81,7 @@ zfsboot.ld: zfsboot.ldr zfsboot.bin ${BTXKERN}
-o ${.TARGET} -P 1 zfsboot.bin

 zfsboot.ldr:
-   cp /dev/null ${.TARGET}
+   :> ${.TARGET}

 zfsboot.bin: zfsboot.out
${OBJCOPY} -S -O binary zfsboot.out ${.TARGET}
diff --git a/stand/libsa/Makefile b/stand/libsa/Makefile
index effece9e01b..63cd46a9c54 100644
--- a/stand/libsa/Makefile
+++ b/stand/libsa/Makefile
@@ -122,7 +122,7 @@ beforedepend:
ln -sf ${SRCTOP}/include/arpa/inet.h arpa/inet.h; \
ln -sf ${SRCTOP}/include/arpa/tftp.h arpa/tftp.h; \
for i in _time.h _strings.h _string.h; do \
-   [ -f xlocale/$$i ] || cp /dev/null xlocale/$$i; \
+   [ -f xlocale/$$i ] || :> xlocale/$$i; \
done; \
for i in ${STAND_H_INC}; do \
ln -sf ${SASRC}/stand.h $$i; \


On Tue, Sep 22, 2020 at 3:58 PM Alan Somers  wrote:
>
> Looks like two places in stand.  Is there any reason why Mateusz's suggestion 
> wouldn't work?
>
> > rg -g Makefile 'cp.*/dev/null'
> stand/libsa/Makefile
> 125: [ -f xlocale/$$i ] || cp /dev/null xlocale/$$i; \
>
> stand/i386/zfsboot/Makefile
> 82: cp /dev/null ${.TARGET}
>
> On Tue, Sep 22, 2020 at 2:54 PM Mateusz Guzik  wrote:
>>
>> Can we instead add a workaround to the build tree?
>>
>> Where is cp /dev/null coming from anyway? Perhaps this can be patched
>> to touch the target file.
>>
>> On 9/22/20, Alan Somers  wrote:
>> > On Tue, Sep 22, 2020 at 2:48 PM Kyle Evans  wrote:
>> >
>> >> On Fri, Sep 11, 2020 at 3:49 PM Alan Somers  wrote:
>> >> >
>> >> > Author: asomers
>> >> > Date: Fri Sep 11 20:49:36 2020
>> >> > New Revision: 365643
>> >> > URL: https://svnweb.freebsd.org/changeset/base/365643
>> >> >
>> >> > Log:
>> >> >   cp: fall back to read/write if copy_file_range fails
>> >> >
>> >> >   Even though copy_file_range has a file-system agnostic version, it
>> >> still
>> >> >   fails on devfs (perhaps because the file descriptor is non-seekable?)
>> >> In
>> >> >   that case, fallback to old-fashioned read/write. Fixes
>> >> >   "cp /dev/null /tmp/null"
>> >> >
>> >>
>> >> Hi,
>> >>
>> >> Any objection to adding a quick UPDATING entry for this? I'm seeing
>> >> occasional reports of this breakage as recent as today on IRC from
>> >> folks that were a little bit thrown off by this because it throws up
>> >> fairly far into the build and looks like a stand build regression
>> >> instead of a cp regression.
>> >>
>> >> Thanks,
>> >>
>> >> Kyle Evans
>> >>
>> >
>> > No objection.  Can you suggest the proper wording?
>> > ___
>> > 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"
>> >
>>
>>
>> --
>> Mateusz Guzik 
___
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: r365643 - head/bin/cp

2020-09-22 Thread Alan Somers
Looks like two places in stand.  Is there any reason why Mateusz's
suggestion wouldn't work?

> rg -g Makefile 'cp.*/dev/null'
stand/libsa/Makefile
125: [ -f xlocale/$$i ] || cp /dev/null xlocale/$$i; \

stand/i386/zfsboot/Makefile
82: cp /dev/null ${.TARGET}

On Tue, Sep 22, 2020 at 2:54 PM Mateusz Guzik  wrote:

> Can we instead add a workaround to the build tree?
>
> Where is cp /dev/null coming from anyway? Perhaps this can be patched
> to touch the target file.
>
> On 9/22/20, Alan Somers  wrote:
> > On Tue, Sep 22, 2020 at 2:48 PM Kyle Evans  wrote:
> >
> >> On Fri, Sep 11, 2020 at 3:49 PM Alan Somers 
> wrote:
> >> >
> >> > Author: asomers
> >> > Date: Fri Sep 11 20:49:36 2020
> >> > New Revision: 365643
> >> > URL: https://svnweb.freebsd.org/changeset/base/365643
> >> >
> >> > Log:
> >> >   cp: fall back to read/write if copy_file_range fails
> >> >
> >> >   Even though copy_file_range has a file-system agnostic version, it
> >> still
> >> >   fails on devfs (perhaps because the file descriptor is
> non-seekable?)
> >> In
> >> >   that case, fallback to old-fashioned read/write. Fixes
> >> >   "cp /dev/null /tmp/null"
> >> >
> >>
> >> Hi,
> >>
> >> Any objection to adding a quick UPDATING entry for this? I'm seeing
> >> occasional reports of this breakage as recent as today on IRC from
> >> folks that were a little bit thrown off by this because it throws up
> >> fairly far into the build and looks like a stand build regression
> >> instead of a cp regression.
> >>
> >> Thanks,
> >>
> >> Kyle Evans
> >>
> >
> > No objection.  Can you suggest the proper wording?
> > ___
> > 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"
> >
>
>
> --
> Mateusz Guzik 
>
___
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: r365643 - head/bin/cp

2020-09-22 Thread Kyle Evans
On Tue, Sep 22, 2020 at 3:54 PM Mateusz Guzik  wrote:
> On 9/22/20, Alan Somers  wrote:
> > On Tue, Sep 22, 2020 at 2:48 PM Kyle Evans  wrote:
> >
> >> On Fri, Sep 11, 2020 at 3:49 PM Alan Somers  wrote:
> >> >
> >> > Author: asomers
> >> > Date: Fri Sep 11 20:49:36 2020
> >> > New Revision: 365643
> >> > URL: https://svnweb.freebsd.org/changeset/base/365643
> >> >
> >> > Log:
> >> >   cp: fall back to read/write if copy_file_range fails
> >> >
> >> >   Even though copy_file_range has a file-system agnostic version, it
> >> still
> >> >   fails on devfs (perhaps because the file descriptor is non-seekable?)
> >> In
> >> >   that case, fallback to old-fashioned read/write. Fixes
> >> >   "cp /dev/null /tmp/null"
> >> >
> >>
> >> Hi,
> >>
> >> Any objection to adding a quick UPDATING entry for this? I'm seeing
> >> occasional reports of this breakage as recent as today on IRC from
> >> folks that were a little bit thrown off by this because it throws up
> >> fairly far into the build and looks like a stand build regression
> >> instead of a cp regression.
> >>
> >> Thanks,
> >>
> >> Kyle Evans
> >>
> >
> > No objection.  Can you suggest the proper wording?
>
> Can we instead add a workaround to the build tree?
>
> Where is cp /dev/null coming from anyway? Perhaps this can be patched
> to touch the target file.
>

I'll look into why stand's doing it this way, but the workaround is a
bit heavy-handed than an advisory to effectively do the same; you'd
have to pick what ends up being a huge range of revisions based on
__FreeBSD_version to decide on bootstrapping a cp that gets used
instead.
___
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: r365643 - head/bin/cp

2020-09-22 Thread Mateusz Guzik
Can we instead add a workaround to the build tree?

Where is cp /dev/null coming from anyway? Perhaps this can be patched
to touch the target file.

On 9/22/20, Alan Somers  wrote:
> On Tue, Sep 22, 2020 at 2:48 PM Kyle Evans  wrote:
>
>> On Fri, Sep 11, 2020 at 3:49 PM Alan Somers  wrote:
>> >
>> > Author: asomers
>> > Date: Fri Sep 11 20:49:36 2020
>> > New Revision: 365643
>> > URL: https://svnweb.freebsd.org/changeset/base/365643
>> >
>> > Log:
>> >   cp: fall back to read/write if copy_file_range fails
>> >
>> >   Even though copy_file_range has a file-system agnostic version, it
>> still
>> >   fails on devfs (perhaps because the file descriptor is non-seekable?)
>> In
>> >   that case, fallback to old-fashioned read/write. Fixes
>> >   "cp /dev/null /tmp/null"
>> >
>>
>> Hi,
>>
>> Any objection to adding a quick UPDATING entry for this? I'm seeing
>> occasional reports of this breakage as recent as today on IRC from
>> folks that were a little bit thrown off by this because it throws up
>> fairly far into the build and looks like a stand build regression
>> instead of a cp regression.
>>
>> Thanks,
>>
>> Kyle Evans
>>
>
> No objection.  Can you suggest the proper wording?
> ___
> 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"
>


-- 
Mateusz Guzik 
___
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: r365643 - head/bin/cp

2020-09-22 Thread Alan Somers
On Tue, Sep 22, 2020 at 2:48 PM Kyle Evans  wrote:

> On Fri, Sep 11, 2020 at 3:49 PM Alan Somers  wrote:
> >
> > Author: asomers
> > Date: Fri Sep 11 20:49:36 2020
> > New Revision: 365643
> > URL: https://svnweb.freebsd.org/changeset/base/365643
> >
> > Log:
> >   cp: fall back to read/write if copy_file_range fails
> >
> >   Even though copy_file_range has a file-system agnostic version, it
> still
> >   fails on devfs (perhaps because the file descriptor is non-seekable?)
> In
> >   that case, fallback to old-fashioned read/write. Fixes
> >   "cp /dev/null /tmp/null"
> >
>
> Hi,
>
> Any objection to adding a quick UPDATING entry for this? I'm seeing
> occasional reports of this breakage as recent as today on IRC from
> folks that were a little bit thrown off by this because it throws up
> fairly far into the build and looks like a stand build regression
> instead of a cp regression.
>
> Thanks,
>
> Kyle Evans
>

No objection.  Can you suggest the proper wording?
___
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: r365643 - head/bin/cp

2020-09-22 Thread Kyle Evans
On Fri, Sep 11, 2020 at 3:49 PM Alan Somers  wrote:
>
> Author: asomers
> Date: Fri Sep 11 20:49:36 2020
> New Revision: 365643
> URL: https://svnweb.freebsd.org/changeset/base/365643
>
> Log:
>   cp: fall back to read/write if copy_file_range fails
>
>   Even though copy_file_range has a file-system agnostic version, it still
>   fails on devfs (perhaps because the file descriptor is non-seekable?) In
>   that case, fallback to old-fashioned read/write. Fixes
>   "cp /dev/null /tmp/null"
>

Hi,

Any objection to adding a quick UPDATING entry for this? I'm seeing
occasional reports of this breakage as recent as today on IRC from
folks that were a little bit thrown off by this because it throws up
fairly far into the build and looks like a stand build regression
instead of a cp regression.

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"


Re: svn commit: r365984 - head/usr.bin/calendar/calendars

2020-09-22 Thread Scott Long
>> 
>> Does this file still need to be in FreeBSD? It may have been a novel=
>> ty back
>> in the day but IMO calendar.history has nothing to do with BSD, comp=
>> uters
>> or anything else of interest to FreeBSD. At the very least this file=
>> should
>> be moved to ports or better yet, removed entirely. I simply don't se=
>> e the
>> point of it being in the tree and distributed with an O/S, any O/S.
 =20
 I think that the only reason for this file's existence in the source tr=
>> ee is for
 Greg's staving off the commit bit reaper.
 No offense meant.
 =20
 P.S.
 And occasional flame wars, it seems.
>>> =20
>>> We already had a similar discussion in march 2020 after r358561 [1].
>>> =20
>>> In the short, the calendar utility has it's historic place, even it's
>>> just more a kind of tradition, like adding yourself as a FreeBSD committer
>>> to calendar.freebsd.
>>> =20
>>> [1] https://lists.freebsd.org/pipermail/svn-src-all/2020-March/thread.html
>> 
>> Would it make sense to prune calendar entries to only BSD-related
>> entries?
> 
> +1
> 
> 

Responding to the most recent message here, but there are a couple of things
that warrant a response.  First, proposals for technical action, like 
re-arranging
or removing the calendar module, should happen on arch@, not here.  Please
formulate a proposal and move the discuss to that forum.

Second, there’s a vibe in parts of this thread that are passive-aggressively
disrespectful to Greg.  I encourage those who might feel some personal
frustration towards Greg to talk to him directly.  The Core team can help with
that communication if needed.  Otherwise, it’s not not appropriate and not
welcome on the mailing lists.  If you don’t feel it’s important enough to
resolve in a professional manner, then please keep it to yourself.

Thanks,
Scott

___
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: r366011 - head/lib/libnetmap

2020-09-22 Thread Vincenzo Maffione
Author: vmaffione
Date: Tue Sep 22 20:20:43 2020
New Revision: 366011
URL: https://svnweb.freebsd.org/changeset/base/366011

Log:
  libnetmap: fix cast from uint64_t to void*
  
  We use uintptr_t as an intermediate cast to avoid compiler
  warnings on 32 bit architectures.
  
  Reported by:  adrian
  MFC after:3 days

Modified:
  head/lib/libnetmap/libnetmap.h
  head/lib/libnetmap/nmport.c

Modified: head/lib/libnetmap/libnetmap.h
==
--- head/lib/libnetmap/libnetmap.h  Tue Sep 22 20:04:57 2020
(r366010)
+++ head/lib/libnetmap/libnetmap.h  Tue Sep 22 20:20:43 2020
(r366011)
@@ -554,9 +554,9 @@ struct nmreq_option *nmreq_find_option(struct nmreq_he
 void nmreq_free_options(struct nmreq_header *);
 const char* nmreq_option_name(uint32_t);
 #define nmreq_foreach_option(h_, o_) \
-   for ((o_) = (struct nmreq_option *)((h_)->nr_options);\
+   for ((o_) = (struct nmreq_option *)((uintptr_t)((h_)->nr_options));\
 (o_) != NULL;\
-(o_) = (struct nmreq_option *)((o_)->nro_next))
+(o_) = (struct nmreq_option *)((uintptr_t)((o_)->nro_next)))
 
 /* nmctx manipulation */
 

Modified: head/lib/libnetmap/nmport.c
==
--- head/lib/libnetmap/nmport.c Tue Sep 22 20:04:57 2020(r366010)
+++ head/lib/libnetmap/nmport.c Tue Sep 22 20:20:43 2020(r366011)
@@ -614,7 +614,7 @@ nmport_mmap(struct nmport_d *d)
}
memset(m, 0, sizeof(*m));
if (d->extmem != NULL) {
-   m->mem = (void *)d->extmem->nro_usrptr;
+   m->mem = (void *)((uintptr_t)d->extmem->nro_usrptr);
m->size = d->extmem->nro_info.nr_memsize;
m->is_extmem = 1;
} else {
___
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: r366010 - stable/12/tests/sys/opencrypto

2020-09-22 Thread Li-Wen Hsu
Author: lwhsu
Date: Tue Sep 22 20:04:57 2020
New Revision: 366010
URL: https://svnweb.freebsd.org/changeset/base/366010

Log:
  MFC r346623 (by ngie):
  
  Chase PEP-3110
  
  Replace `except Environment, e:` with `except Environment as e` for
  compatibility between python 2.x and python 3.x.
  
  While here, fix a bad indentation change from r346620 by reindenting the code
  properly.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/12/tests/sys/opencrypto/cryptotest.py
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/tests/sys/opencrypto/cryptotest.py
==
--- stable/12/tests/sys/opencrypto/cryptotest.pyTue Sep 22 18:18:57 
2020(r366009)
+++ stable/12/tests/sys/opencrypto/cryptotest.pyTue Sep 22 20:04:57 
2020(r366010)
@@ -126,7 +126,7 @@ def GenTestCase(cname):

mac=self._gmacsizes[len(cipherkey)],
mackey=cipherkey, crid=crid,
maclen=16)
-   except EnvironmentError, e:
+   except EnvironmentError as e:
# Can't test algorithms the 
driver does not support.
if e.errno != errno.EOPNOTSUPP:
raise
@@ -135,7 +135,7 @@ def GenTestCase(cname):
if mode == 'ENCRYPT':
try:
rct, rtag = 
c.encrypt(pt, iv, aad)
-   except EnvironmentError, e:
+   except EnvironmentError as e:
# Can't test inputs the 
driver does not support.
if e.errno != 
errno.EINVAL:
raise
@@ -155,7 +155,7 @@ def GenTestCase(cname):
else:
try:
rpt, rtag = 
c.decrypt(*args)
-   except 
EnvironmentError, e:
+   except EnvironmentError 
as e:
# Can't test 
inputs the driver does not support.
if e.errno != 
errno.EINVAL:
raise
@@ -223,7 +223,7 @@ def GenTestCase(cname):
try:
c = Crypto(meth, cipherkey, 
crid=crid)
r = curfun(c, pt, iv)
-   except EnvironmentError, e:
+   except EnvironmentError as e:
# Can't test hashes the driver 
does not support.
if e.errno != errno.EOPNOTSUPP:
raise
@@ -254,7 +254,7 @@ def GenTestCase(cname):
mackey=key, maclen=16)
r, tag = Crypto.encrypt(c, payload,
nonce, aad)
-   except EnvironmentError, e:
+   except EnvironmentError as e:
if e.errno != errno.EOPNOTSUPP:
raise
continue
@@ -296,7 +296,7 @@ def GenTestCase(cname):
key=key,

mac=cryptodev.CRYPTO_AES_CCM_CBC_MAC,
mackey=key, maclen=16)
-   except EnvironmentError, e:
+   except EnvironmentError as e:
if e.errno != errno.EOPNOTSUPP:
raise
continue
@@ -390,13 +390,13 @@ def GenTestCase(cname):
 
for data in lines:
msg = data['Msg'].decode('hex')
-msg = msg[:int(data['Len'])]
+   msg = msg[:int(data['Len'])]
md = 

Re: svn commit: r365984 - head/usr.bin/calendar/calendars

2020-09-22 Thread Cy Schubert
In message <20200922192424.mnzunuwnjtwfwilh@mutt-hbsd>, Shawn Webb writes:
> 
> --ftu52o6ib5uewj7t
> Content-Type: text/plain; charset=us-ascii
> Content-Disposition: inline
> Content-Transfer-Encoding: quoted-printable
>
> On Tue, Sep 22, 2020 at 09:18:43PM +0200, Gordon Bergling wrote:
> > On Tue, Sep 22, 2020 at 09:01:46PM +0300, Andriy Gapon wrote:
> > > On 22/09/2020 06:06, Conrad Meyer wrote:
> > > > Big ol plus one from me.
> > > >=20
> > > > On Mon, Sep 21, 2020 at 4:16 PM Cy Schubert  m> wrote:
> > > >>
> > > >> In message <202009212255.08lmtpsp078...@repo.freebsd.org>, Greg Lehey
> > > >> writes:
> > > >>> Author: grog
> > > >>> Date: Mon Sep 21 22:55:51 2020
> > > >>> New Revision: 365984
> > > >>> URL: https://svnweb.freebsd.org/changeset/base/365984
> > > >>>
> > > >>> Log:
> > > >>>   Remove claim that Allied Forces created "West Germany" in 1953.  =
> I can
> > > >>>   find no historic substantiation for such a claim.  The Federal
> > > >>>   Republic of Germany was created by Germans on 23 May 1949, as also
> > > >>>   noted in this file.
> > > >>>
> > > >>> Modified:
> > > >>>   head/usr.bin/calendar/calendars/calendar.history
> > > >>>
> > > >>> Modified: head/usr.bin/calendar/calendars/calendar.history
> > > >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
> =3D=3D=3D=3D=3D
> > > >>> =3D
> > > >>> --- head/usr.bin/calendar/calendars/calendar.history  Mon Sep 21 22=
> :52:57 202
> > > >>> 0 (r365983)
> > > >>> +++ head/usr.bin/calendar/calendars/calendar.history  Mon Sep 21 22=
> :55:51 202
> > > >>> 0 (r365984)
> > > >>> @@ -521,7 +521,6 @@
> > > >>>  09/20Magellan leaves Spain on the first Round the World pa=
> ssage, 151
> > > >>> 9
> > > >>>  09/20The Roxy Theater opens in Hollywood, 1973
> > > >>>  09/21J. R. R. Tolkien's The Hobbit is published, 1937
> > > >>> -09/22Allied forces form the independent nation West German=
> y, 1953
> > > >>>  09/22US President Lincoln issues the Emancipation Proclama=
> tion, 1862
> > > >>>  09/22Special prosecutor Leon Jeworski subpoenas US Preside=
> nt Nixon,
> > > >>> 1974
> > > >>>  09/22The first Soviet atomic bomb explodes, 1949
> > > >>>
> > > >>
> > > >> Does this file still need to be in FreeBSD? It may have been a novel=
> ty back
> > > >> in the day but IMO calendar.history has nothing to do with BSD, comp=
> uters
> > > >> or anything else of interest to FreeBSD. At the very least this file=
>  should
> > > >> be moved to ports or better yet, removed entirely. I simply don't se=
> e the
> > > >> point of it being in the tree and distributed with an O/S, any O/S.
> > >=20
> > > I think that the only reason for this file's existence in the source tr=
> ee is for
> > > Greg's staving off the commit bit reaper.
> > > No offense meant.
> > >=20
> > > P.S.
> > > And occasional flame wars, it seems.
> >=20
> > We already had a similar discussion in march 2020 after r358561 [1].
> >=20
> > In the short, the calendar utility has it's historic place, even it's
> > just more a kind of tradition, like adding yourself as a FreeBSD committer
> > to calendar.freebsd.
> >=20
> > [1] https://lists.freebsd.org/pipermail/svn-src-all/2020-March/thread.html
>
> Would it make sense to prune calendar entries to only BSD-related
> entries?

+1


-- 
Cheers,
Cy Schubert 
FreeBSD UNIX: Web:  https://FreeBSD.org
NTP:   Web:  https://nwtime.org

The need of the many outweighs the greed of the few.


___
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: r365984 - head/usr.bin/calendar/calendars

2020-09-22 Thread Shawn Webb
On Tue, Sep 22, 2020 at 09:18:43PM +0200, Gordon Bergling wrote:
> On Tue, Sep 22, 2020 at 09:01:46PM +0300, Andriy Gapon wrote:
> > On 22/09/2020 06:06, Conrad Meyer wrote:
> > > Big ol plus one from me.
> > > 
> > > On Mon, Sep 21, 2020 at 4:16 PM Cy Schubert  
> > > wrote:
> > >>
> > >> In message <202009212255.08lmtpsp078...@repo.freebsd.org>, Greg Lehey
> > >> writes:
> > >>> Author: grog
> > >>> Date: Mon Sep 21 22:55:51 2020
> > >>> New Revision: 365984
> > >>> URL: https://svnweb.freebsd.org/changeset/base/365984
> > >>>
> > >>> Log:
> > >>>   Remove claim that Allied Forces created "West Germany" in 1953.  I can
> > >>>   find no historic substantiation for such a claim.  The Federal
> > >>>   Republic of Germany was created by Germans on 23 May 1949, as also
> > >>>   noted in this file.
> > >>>
> > >>> Modified:
> > >>>   head/usr.bin/calendar/calendars/calendar.history
> > >>>
> > >>> Modified: head/usr.bin/calendar/calendars/calendar.history
> > >>> =
> > >>> =
> > >>> --- head/usr.bin/calendar/calendars/calendar.history  Mon Sep 21 
> > >>> 22:52:57 202
> > >>> 0 (r365983)
> > >>> +++ head/usr.bin/calendar/calendars/calendar.history  Mon Sep 21 
> > >>> 22:55:51 202
> > >>> 0 (r365984)
> > >>> @@ -521,7 +521,6 @@
> > >>>  09/20Magellan leaves Spain on the first Round the World 
> > >>> passage, 151
> > >>> 9
> > >>>  09/20The Roxy Theater opens in Hollywood, 1973
> > >>>  09/21J. R. R. Tolkien's The Hobbit is published, 1937
> > >>> -09/22Allied forces form the independent nation West Germany, 
> > >>> 1953
> > >>>  09/22US President Lincoln issues the Emancipation 
> > >>> Proclamation, 1862
> > >>>  09/22Special prosecutor Leon Jeworski subpoenas US President 
> > >>> Nixon,
> > >>> 1974
> > >>>  09/22The first Soviet atomic bomb explodes, 1949
> > >>>
> > >>
> > >> Does this file still need to be in FreeBSD? It may have been a novelty 
> > >> back
> > >> in the day but IMO calendar.history has nothing to do with BSD, computers
> > >> or anything else of interest to FreeBSD. At the very least this file 
> > >> should
> > >> be moved to ports or better yet, removed entirely. I simply don't see the
> > >> point of it being in the tree and distributed with an O/S, any O/S.
> > 
> > I think that the only reason for this file's existence in the source tree 
> > is for
> > Greg's staving off the commit bit reaper.
> > No offense meant.
> > 
> > P.S.
> > And occasional flame wars, it seems.
> 
> We already had a similar discussion in march 2020 after r358561 [1].
> 
> In the short, the calendar utility has it's historic place, even it's
> just more a kind of tradition, like adding yourself as a FreeBSD committer
> to calendar.freebsd.
> 
> [1] https://lists.freebsd.org/pipermail/svn-src-all/2020-March/thread.html

Would it make sense to prune calendar entries to only BSD-related
entries?

Thanks,

-- 
Shawn Webb
Cofounder / Security Engineer
HardenedBSD

GPG Key ID:  0xFF2E67A277F8E1FA
GPG Key Fingerprint: D206 BB45 15E0 9C49 0CF9  3633 C85B 0AF8 AB23 0FB2
https://git-01.md.hardenedbsd.org/HardenedBSD/pubkeys/src/branch/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc


signature.asc
Description: PGP signature


Re: svn commit: r365984 - head/usr.bin/calendar/calendars

2020-09-22 Thread Gordon Bergling
On Tue, Sep 22, 2020 at 09:01:46PM +0300, Andriy Gapon wrote:
> On 22/09/2020 06:06, Conrad Meyer wrote:
> > Big ol plus one from me.
> > 
> > On Mon, Sep 21, 2020 at 4:16 PM Cy Schubert  
> > wrote:
> >>
> >> In message <202009212255.08lmtpsp078...@repo.freebsd.org>, Greg Lehey
> >> writes:
> >>> Author: grog
> >>> Date: Mon Sep 21 22:55:51 2020
> >>> New Revision: 365984
> >>> URL: https://svnweb.freebsd.org/changeset/base/365984
> >>>
> >>> Log:
> >>>   Remove claim that Allied Forces created "West Germany" in 1953.  I can
> >>>   find no historic substantiation for such a claim.  The Federal
> >>>   Republic of Germany was created by Germans on 23 May 1949, as also
> >>>   noted in this file.
> >>>
> >>> Modified:
> >>>   head/usr.bin/calendar/calendars/calendar.history
> >>>
> >>> Modified: head/usr.bin/calendar/calendars/calendar.history
> >>> =
> >>> =
> >>> --- head/usr.bin/calendar/calendars/calendar.history  Mon Sep 21 22:52:57 
> >>> 202
> >>> 0 (r365983)
> >>> +++ head/usr.bin/calendar/calendars/calendar.history  Mon Sep 21 22:55:51 
> >>> 202
> >>> 0 (r365984)
> >>> @@ -521,7 +521,6 @@
> >>>  09/20Magellan leaves Spain on the first Round the World passage, 
> >>> 151
> >>> 9
> >>>  09/20The Roxy Theater opens in Hollywood, 1973
> >>>  09/21J. R. R. Tolkien's The Hobbit is published, 1937
> >>> -09/22Allied forces form the independent nation West Germany, 1953
> >>>  09/22US President Lincoln issues the Emancipation Proclamation, 
> >>> 1862
> >>>  09/22Special prosecutor Leon Jeworski subpoenas US President 
> >>> Nixon,
> >>> 1974
> >>>  09/22The first Soviet atomic bomb explodes, 1949
> >>>
> >>
> >> Does this file still need to be in FreeBSD? It may have been a novelty back
> >> in the day but IMO calendar.history has nothing to do with BSD, computers
> >> or anything else of interest to FreeBSD. At the very least this file should
> >> be moved to ports or better yet, removed entirely. I simply don't see the
> >> point of it being in the tree and distributed with an O/S, any O/S.
> 
> I think that the only reason for this file's existence in the source tree is 
> for
> Greg's staving off the commit bit reaper.
> No offense meant.
> 
> P.S.
> And occasional flame wars, it seems.

We already had a similar discussion in march 2020 after r358561 [1].

In the short, the calendar utility has it's historic place, even it's
just more a kind of tradition, like adding yourself as a FreeBSD committer
to calendar.freebsd.

[1] https://lists.freebsd.org/pipermail/svn-src-all/2020-March/thread.html

-- Gordon
___
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: r365724 - in head/stand: ficl ficl/powerpc powerpc/ofw

2020-09-22 Thread Brandon Bergren
Yeah, I will be changing it, that exact fix is in my local tree and I will 
commit it after the next round of tests.

> This looks strange. The define should be written as (~(FICL_UNS)0).
> The size suffix is superfluous if the value is casted anyway.

-- 
  Brandon Bergren
  bdra...@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: r365724 - in head/stand: ficl ficl/powerpc powerpc/ofw

2020-09-22 Thread Gunther Nikl
Brandon Bergren  wrote:

> Author: bdragon
> Date: Mon Sep 14 15:48:30 2020
> New Revision: 365724
> URL: https://svnweb.freebsd.org/changeset/base/365724
> 
> [snip]
>
> Modified: head/stand/ficl/ficl.h
> ==
> --- head/stand/ficl/ficl.hMon Sep 14 15:20:37 2020
> (r365723) +++ head/stand/ficl/ficl.h  Mon Sep 14 15:48:30
> 2020  (r365724) @@ -249,7 +249,7 @@ typedef struct
> ficl_system_info FICL_SYSTEM_INFO; ** complement of false... that
> unifies logical and bitwise operations ** nicely.
>  */
> -#define FICL_TRUE  ((unsigned long)~(0L))
> +#define FICL_TRUE  ((FICL_UNS)~(0LL))

This looks strange. The define should be written as (~(FICL_UNS)0).
The size suffix is superfluous if the value is casted anyway.

>  #define FICL_FALSE (0)
>  #define FICL_BOOL(x) ((x) ? FICL_TRUE : FICL_FALSE)
>  
> 

Regards,
Gunther
___
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: r366009 - stable/12/release/tools

2020-09-22 Thread Colin Percival
Author: cperciva
Date: Tue Sep 22 18:18:57 2020
New Revision: 366009
URL: https://svnweb.freebsd.org/changeset/base/366009

Log:
  Revert r361645.  The current quarterly ports branch contains ebsnvme-id,
  so packages are now available for all architectures.
  
  (Direct commit to stable/12 since r361645 never happened in HEAD.)

Modified:
  stable/12/release/tools/ec2.conf

Modified: stable/12/release/tools/ec2.conf
==
--- stable/12/release/tools/ec2.confTue Sep 22 17:30:53 2020
(r366008)
+++ stable/12/release/tools/ec2.confTue Sep 22 18:18:57 2020
(r366009)
@@ -6,14 +6,7 @@
 # Packages to install into the image we're creating.  This is a deliberately
 # minimalist set, providing only the packages necessary to bootstrap further
 # package installation as specified via EC2 user-data.
-export VM_EXTRA_PACKAGES="ec2-scripts firstboot-freebsd-update firstboot-pkgs 
dual-dhclient-daemon"
-
-# This package isn't currently (2020-05-29) available for aarch64 since it is
-# not yet in the "quarterly" branch.  Some time after 2020-07-01 this can be
-# made unconditional.
-if [ "${TARGET_ARCH}" = "amd64" ]; then
-   export VM_EXTRA_PACKAGES="${VM_EXTRA_PACKAGES} ebsnvme-id"
-fi
+export VM_EXTRA_PACKAGES="ec2-scripts firstboot-freebsd-update firstboot-pkgs 
dual-dhclient-daemon ebsnvme-id"
 
 # Include the amazon-ssm-agent package in amd64 images, since some users want
 # to be able to use it on systems which are not connected to the Internet.
___
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: r365984 - head/usr.bin/calendar/calendars

2020-09-22 Thread Andriy Gapon
On 22/09/2020 06:06, Conrad Meyer wrote:
> Big ol plus one from me.
> 
> On Mon, Sep 21, 2020 at 4:16 PM Cy Schubert  wrote:
>>
>> In message <202009212255.08lmtpsp078...@repo.freebsd.org>, Greg Lehey
>> writes:
>>> Author: grog
>>> Date: Mon Sep 21 22:55:51 2020
>>> New Revision: 365984
>>> URL: https://svnweb.freebsd.org/changeset/base/365984
>>>
>>> Log:
>>>   Remove claim that Allied Forces created "West Germany" in 1953.  I can
>>>   find no historic substantiation for such a claim.  The Federal
>>>   Republic of Germany was created by Germans on 23 May 1949, as also
>>>   noted in this file.
>>>
>>> Modified:
>>>   head/usr.bin/calendar/calendars/calendar.history
>>>
>>> Modified: head/usr.bin/calendar/calendars/calendar.history
>>> =
>>> =
>>> --- head/usr.bin/calendar/calendars/calendar.history  Mon Sep 21 22:52:57 
>>> 202
>>> 0 (r365983)
>>> +++ head/usr.bin/calendar/calendars/calendar.history  Mon Sep 21 22:55:51 
>>> 202
>>> 0 (r365984)
>>> @@ -521,7 +521,6 @@
>>>  09/20Magellan leaves Spain on the first Round the World passage, 
>>> 151
>>> 9
>>>  09/20The Roxy Theater opens in Hollywood, 1973
>>>  09/21J. R. R. Tolkien's The Hobbit is published, 1937
>>> -09/22Allied forces form the independent nation West Germany, 1953
>>>  09/22US President Lincoln issues the Emancipation Proclamation, 
>>> 1862
>>>  09/22Special prosecutor Leon Jeworski subpoenas US President Nixon,
>>> 1974
>>>  09/22The first Soviet atomic bomb explodes, 1949
>>>
>>
>> Does this file still need to be in FreeBSD? It may have been a novelty back
>> in the day but IMO calendar.history has nothing to do with BSD, computers
>> or anything else of interest to FreeBSD. At the very least this file should
>> be moved to ports or better yet, removed entirely. I simply don't see the
>> point of it being in the tree and distributed with an O/S, any O/S.

I think that the only reason for this file's existence in the source tree is for
Greg's staving off the commit bit reaper.
No offense meant.

P.S.
And occasional flame wars, it seems.

-- 
Andriy Gapon
___
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: r366008 - stable/12/share/man/man9

2020-09-22 Thread Gordon Bergling
Author: gbe (doc committer)
Date: Tue Sep 22 17:30:53 2020
New Revision: 366008
URL: https://svnweb.freebsd.org/changeset/base/366008

Log:
  MFC r365853: domainset(9): Some markup fixes
  
  - new sentence, new line
  - whitespace at end of input line

Modified:
  stable/12/share/man/man9/domainset.9
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/share/man/man9/domainset.9
==
--- stable/12/share/man/man9/domainset.9Tue Sep 22 17:29:44 2020
(r366007)
+++ stable/12/share/man/man9/domainset.9Tue Sep 22 17:30:53 2020
(r366008)
@@ -88,8 +88,9 @@ memory is accessed from many CPUs that are not in the 
 .It Dv DOMAINSET_POLICY_PREFER
 Memory is allocated from the node in the
 .Vt prefer
-member.  The preferred node must be set in the allowed mask.
-If the preferred node is out of memory the allocation falls back to 
+member.
+The preferred node must be set in the allowed mask.
+If the preferred node is out of memory the allocation falls back to
 round-robin among allowed sets.
 .It Dv DOMAINSET_POLICY_INTERLEAVE
 Memory is allocated in a striped fashion with multiple pages
@@ -128,8 +129,7 @@ function takes a partially filled in domainset as a ke
 valid domainset or NULL.
 It is critical that consumers not use domainsets that have not been
 returned by this function.
-.Vt
-domainset
+.Vt domainset
 is an immutable type that is shared among all matching keys and must
 not be modified after return.
 .Pp
@@ -138,9 +138,8 @@ The
 function is provided as a convenience for modifying or viewing domainsets
 that are not accessible via
 .Xr cpuset 2 .
-It is intended for use with 
+It is intended for use with
 .Xr sysctl 9 .
-.Pp
 .Sh SEE ALSO
 .Xr cpuset 1 ,
 .Xr cpuset 2 ,
___
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: r366007 - stable/12/share/man/man9

2020-09-22 Thread Gordon Bergling
Author: gbe (doc committer)
Date: Tue Sep 22 17:29:44 2020
New Revision: 366007
URL: https://svnweb.freebsd.org/changeset/base/366007

Log:
  MFC r365854: VOP_INACTIVE(9): Remove trailing whitespace

Modified:
  stable/12/share/man/man9/VOP_INACTIVE.9
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/share/man/man9/VOP_INACTIVE.9
==
--- stable/12/share/man/man9/VOP_INACTIVE.9 Tue Sep 22 17:28:32 2020
(r366006)
+++ stable/12/share/man/man9/VOP_INACTIVE.9 Tue Sep 22 17:29:44 2020
(r366007)
@@ -57,7 +57,7 @@ to exclusive without sleeping.
 This may be
 because the reference count reaches zero or it may be that the
 file system is being forcibly unmounted while there are open files.
-It can be used to reclaim space on the last close of an 
+It can be used to reclaim space on the last close of an
 .Sq open but deleted
 file.
 .Pp
___
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: r366006 - stable/12/share/man/man9

2020-09-22 Thread Gordon Bergling
Author: gbe (doc committer)
Date: Tue Sep 22 17:28:32 2020
New Revision: 366006
URL: https://svnweb.freebsd.org/changeset/base/366006

Log:
  MFC r365857: pwmbus(9): some markup fixes
  
  - whitespace at end of input line

Modified:
  stable/12/share/man/man9/pwmbus.9
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/share/man/man9/pwmbus.9
==
--- stable/12/share/man/man9/pwmbus.9   Tue Sep 22 17:05:01 2020
(r366005)
+++ stable/12/share/man/man9/pwmbus.9   Tue Sep 22 17:28:32 2020
(r366006)
@@ -68,11 +68,11 @@ argument is the duration in nanoseconds of the on port
 .Pp
 Some PWM hardware is organized as a single controller with multiple channels.
 Channel numbers count up from zero.
-When multiple channels are present, they sometimes share a common clock or 
+When multiple channels are present, they sometimes share a common clock or
 other resources.
-In such cases, changing the period or duty cycle of any one channel may affect 
+In such cases, changing the period or duty cycle of any one channel may affect
 other channels within the hardware which share the same resources.
-Consult the documentation for the underlying PWM hardware device driver for 
+Consult the documentation for the underlying PWM hardware device driver for
 details on channels that share resources.
 .Sh INTERFACE
 .Bl -tag -width indent
___
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: r366005 - head/sys/fs/udf

2020-09-22 Thread Mark Johnston
Author: markj
Date: Tue Sep 22 17:05:01 2020
New Revision: 366005
URL: https://svnweb.freebsd.org/changeset/base/366005

Log:
  udf: Validate the full file entry length
  
  Otherwise a corrupted file entry containing invalid extended attribute
  lengths or allocation descriptor lengths can trigger an overflow when
  the file entry is loaded.
  
  admbug:   965
  PR:   248613
  Reported by:  C Turt 
  MFC after:3 days
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/fs/udf/udf_vfsops.c

Modified: head/sys/fs/udf/udf_vfsops.c
==
--- head/sys/fs/udf/udf_vfsops.cTue Sep 22 16:18:31 2020
(r366004)
+++ head/sys/fs/udf/udf_vfsops.cTue Sep 22 17:05:01 2020
(r366005)
@@ -589,6 +589,7 @@ udf_vget(struct mount *mp, ino_t ino, int flags, struc
struct vnode *vp;
struct udf_node *unode;
struct file_entry *fe;
+   uint32_t lea, lad;
int error, sector, size;
 
error = vfs_hash_get(mp, ino, flags, curthread, vpp, NULL, NULL);
@@ -644,31 +645,37 @@ udf_vget(struct mount *mp, ino_t ino, int flags, struc
devvp = udfmp->im_devvp;
if ((error = RDSECTOR(devvp, sector, udfmp->bsize, )) != 0) {
printf("Cannot read sector %d\n", sector);
-   vgone(vp);
-   vput(vp);
-   brelse(bp);
-   *vpp = NULL;
-   return (error);
+   goto error;
}
 
+   /*
+* File entry length validation.
+*/
fe = (struct file_entry *)bp->b_data;
if (udf_checktag(>tag, TAGID_FENTRY)) {
printf("Invalid file entry!\n");
-   vgone(vp);
-   vput(vp);
-   brelse(bp);
-   *vpp = NULL;
-   return (ENOMEM);
+   error = ENOMEM;
+   goto error;
}
-   size = UDF_FENTRY_SIZE + le32toh(fe->l_ea) + le32toh(fe->l_ad);
+   lea = le32toh(fe->l_ea);
+   lad = le32toh(fe->l_ad);
+   if (lea > udfmp->bsize || lad > udfmp->bsize) {
+   printf("Invalid EA and AD lengths %u, %u\n", lea, lad);
+   error = EIO;
+   goto error;
+   }
+   size = UDF_FENTRY_SIZE + lea + lad;
+   if (size > udfmp->bsize) {
+   printf("Invalid file entry size %u\n", size);
+   error = EIO;
+   goto error;
+   }
+
unode->fentry = malloc(size, M_UDFFENTRY, M_NOWAIT | M_ZERO);
if (unode->fentry == NULL) {
printf("Cannot allocate file entry block\n");
-   vgone(vp);
-   vput(vp);
-   brelse(bp);
-   *vpp = NULL;
-   return (ENOMEM);
+   error = ENOMEM;
+   goto error;
}
 
bcopy(bp->b_data, unode->fentry, size);
@@ -713,6 +720,13 @@ udf_vget(struct mount *mp, ino_t ino, int flags, struc
*vpp = vp;
 
return (0);
+
+error:
+   vgone(vp);
+   vput(vp);
+   brelse(bp);
+   *vpp = NULL;
+   return (error);
 }
 
 static int
___
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: r363700 - in head/sys: arm/ti arm/ti/am335x arm/ti/clk arm/ti/cpsw arm/ti/omap4 arm/ti/usb dev/uart modules

2020-09-22 Thread Ed Maste
On Thu, 30 Jul 2020 at 10:45, Michal Meloun  wrote:
>
> Author: mmel
> Date: Thu Jul 30 14:45:05 2020
> New Revision: 363700
> URL: https://svnweb.freebsd.org/changeset/base/363700
>
> Log:
>   Move Ti AM335x to dev/extres/clk framework.

It looks like BeagleBone Black is indeed broken after this commit
https://ci.freebsd.org/hwlab/job/FreeBSD-device-head-beaglebone-test/6131/
https://ci.freebsd.org/hwlab/job/FreeBSD-device-head-beaglebone-test/6131/artifact/device_tests/beaglebone.boot.log

...
ti_clkctrl0:  mem 0x14-0x14f on ti_omap4_cm0
ti_clkctrl1:  mem 0x4-0xd7 on ti_omap4_cm1
ti_clkctrl2:  mem 0x4-0x7 on ti_omap4_cm2
panic: Duplicated clock registration: clk@4_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: r366004 - in head: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/aes crypto/openssl/crypto/asn1 crypto/openssl/crypto/bio crypto/openssl/crypto/bn crypt...

2020-09-22 Thread Jung-uk Kim
Author: jkim
Date: Tue Sep 22 16:18:31 2020
New Revision: 366004
URL: https://svnweb.freebsd.org/changeset/base/366004

Log:
  Merge OpenSSL 1.1.1h.

Deleted:
  head/crypto/openssl/crypto/ec/asm/ecp_nistz256-avx2.pl
Modified:
  head/crypto/openssl/CHANGES
  head/crypto/openssl/Configure
  head/crypto/openssl/NEWS
  head/crypto/openssl/NOTES.PERL
  head/crypto/openssl/README
  head/crypto/openssl/apps/genpkey.c
  head/crypto/openssl/apps/rsa8192.pem
  head/crypto/openssl/apps/s_client.c
  head/crypto/openssl/apps/x509.c
  head/crypto/openssl/appveyor.yml
  head/crypto/openssl/crypto/aes/aes_core.c
  head/crypto/openssl/crypto/aes/aes_ige.c
  head/crypto/openssl/crypto/asn1/d2i_pr.c
  head/crypto/openssl/crypto/asn1/x_algor.c
  head/crypto/openssl/crypto/bio/b_print.c
  head/crypto/openssl/crypto/bio/bss_acpt.c
  head/crypto/openssl/crypto/bio/bss_conn.c
  head/crypto/openssl/crypto/bn/bn_gcd.c
  head/crypto/openssl/crypto/bn/bn_lib.c
  head/crypto/openssl/crypto/bn/bn_mpi.c
  head/crypto/openssl/crypto/cmac/cmac.c
  head/crypto/openssl/crypto/cms/cms_lib.c
  head/crypto/openssl/crypto/cms/cms_sd.c
  head/crypto/openssl/crypto/conf/conf_def.c
  head/crypto/openssl/crypto/ec/asm/ecp_nistz256-armv4.pl
  head/crypto/openssl/crypto/ec/ec_ameth.c
  head/crypto/openssl/crypto/ec/ec_asn1.c
  head/crypto/openssl/crypto/ec/ec_err.c
  head/crypto/openssl/crypto/ec/ec_key.c
  head/crypto/openssl/crypto/ec/ec_lib.c
  head/crypto/openssl/crypto/ec/ec_local.h
  head/crypto/openssl/crypto/ec/ecp_nistp224.c
  head/crypto/openssl/crypto/ec/ecp_nistp521.c
  head/crypto/openssl/crypto/ec/ecp_nistz256.c
  head/crypto/openssl/crypto/engine/eng_lib.c
  head/crypto/openssl/crypto/err/openssl.txt
  head/crypto/openssl/crypto/evp/e_aes.c
  head/crypto/openssl/crypto/evp/encode.c
  head/crypto/openssl/crypto/mem_sec.c
  head/crypto/openssl/crypto/modes/cbc128.c
  head/crypto/openssl/crypto/modes/ccm128.c
  head/crypto/openssl/crypto/modes/cfb128.c
  head/crypto/openssl/crypto/modes/ctr128.c
  head/crypto/openssl/crypto/modes/gcm128.c
  head/crypto/openssl/crypto/modes/modes_local.h
  head/crypto/openssl/crypto/modes/ofb128.c
  head/crypto/openssl/crypto/modes/xts128.c
  head/crypto/openssl/crypto/o_str.c
  head/crypto/openssl/crypto/o_time.c
  head/crypto/openssl/crypto/pem/pem_err.c
  head/crypto/openssl/crypto/pem/pem_lib.c
  head/crypto/openssl/crypto/pem/pem_pkey.c
  head/crypto/openssl/crypto/pem/pvkfmt.c
  head/crypto/openssl/crypto/rand/drbg_ctr.c
  head/crypto/openssl/crypto/rand/drbg_lib.c
  head/crypto/openssl/crypto/rand/rand_lib.c
  head/crypto/openssl/crypto/rand/rand_local.h
  head/crypto/openssl/crypto/rand/rand_unix.c
  head/crypto/openssl/crypto/rand/randfile.c
  head/crypto/openssl/crypto/rsa/rsa_ameth.c
  head/crypto/openssl/crypto/store/loader_file.c
  head/crypto/openssl/crypto/store/store_lib.c
  head/crypto/openssl/crypto/ts/ts_rsp_sign.c
  head/crypto/openssl/crypto/ui/ui_openssl.c
  head/crypto/openssl/crypto/whrlpool/wp_block.c
  head/crypto/openssl/crypto/x509/x509_err.c
  head/crypto/openssl/crypto/x509/x509_local.h
  head/crypto/openssl/crypto/x509/x509_req.c
  head/crypto/openssl/crypto/x509/x509_txt.c
  head/crypto/openssl/crypto/x509/x509_vfy.c
  head/crypto/openssl/crypto/x509/x_pubkey.c
  head/crypto/openssl/crypto/x509v3/pcy_data.c
  head/crypto/openssl/crypto/x509v3/v3_alt.c
  head/crypto/openssl/crypto/x509v3/v3_purp.c
  head/crypto/openssl/doc/man1/CA.pl.pod
  head/crypto/openssl/doc/man1/ca.pod
  head/crypto/openssl/doc/man1/dgst.pod
  head/crypto/openssl/doc/man1/enc.pod
  head/crypto/openssl/doc/man1/ocsp.pod
  head/crypto/openssl/doc/man1/pkcs12.pod
  head/crypto/openssl/doc/man1/pkcs8.pod
  head/crypto/openssl/doc/man1/pkeyutl.pod
  head/crypto/openssl/doc/man1/s_client.pod
  head/crypto/openssl/doc/man1/s_server.pod
  head/crypto/openssl/doc/man1/s_time.pod
  head/crypto/openssl/doc/man1/sess_id.pod
  head/crypto/openssl/doc/man1/ts.pod
  head/crypto/openssl/doc/man1/tsget.pod
  head/crypto/openssl/doc/man1/verify.pod
  head/crypto/openssl/doc/man1/x509.pod
  head/crypto/openssl/doc/man3/ASN1_INTEGER_get_int64.pod
  head/crypto/openssl/doc/man3/ASN1_STRING_length.pod
  head/crypto/openssl/doc/man3/ASN1_TIME_set.pod
  head/crypto/openssl/doc/man3/ASN1_TYPE_get.pod
  head/crypto/openssl/doc/man3/ASYNC_WAIT_CTX_new.pod
  head/crypto/openssl/doc/man3/ASYNC_start_job.pod
  head/crypto/openssl/doc/man3/BF_encrypt.pod
  head/crypto/openssl/doc/man3/BIO_ADDR.pod
  head/crypto/openssl/doc/man3/BIO_ADDRINFO.pod
  head/crypto/openssl/doc/man3/BIO_connect.pod
  head/crypto/openssl/doc/man3/BIO_ctrl.pod
  head/crypto/openssl/doc/man3/BIO_get_data.pod
  head/crypto/openssl/doc/man3/BIO_parse_hostserv.pod
  head/crypto/openssl/doc/man3/BIO_read.pod
  head/crypto/openssl/doc/man3/BIO_s_accept.pod
  head/crypto/openssl/doc/man3/BIO_s_bio.pod
  head/crypto/openssl/doc/man3/BIO_s_connect.pod
  head/crypto/openssl/doc/man3/BIO_s_file.pod
  head/crypto/openssl/doc/man3/BIO_set_callback.pod
  

Re: svn commit: r365984 - head/usr.bin/calendar/calendars

2020-09-22 Thread xtouqh

Steffen Nurpmeso wrote:

Ian Lepore wrote in
  :
  |On Tue, 2020-09-22 at 16:02 +0200, Steffen Nurpmeso wrote:
  |> Greg Lehey wrote in
  |>  <202009212255.08lmtpsp078...@repo.freebsd.org>:
  |>|Author: grog
  |>|Date: Mon Sep 21 22:55:51 2020
  |>|New Revision: 365984
  |>|URL: https://svnweb.freebsd.org/changeset/base/365984
  |>|
  |>|Log:
  |>|  Remove claim that Allied Forces created "West Germany" in
  |> 1953.  I can
  |>|  find no historic substantiation for such a claim.  The Federal
  |>|  Republic of Germany was created by Germans on 23 May 1949, as
  |> also
  |>|  noted in this file.
  |>
  |> I could imagine it was Konrad Adenauer (chancellor at that time)
  |> refusing (let aside western war winners) the Sowjet offer to
  |> reunite Germany shall Germany henceforth exist as a "neutral
  |> state" in the same sense as Switzerland claims to be neutral.
  |> He refused, instead forward looking to rearm the German army.
  |> That is, turning Germany to a part of the Western Alliance
  |> explicitly and willingly.  Or was that in 1949?  Hm.
  |
  |And this is why I agree with Cy and Conrad that we should not be trying
  |to be wikipedia lite.


[offtopic trimmed]

Yet again, that's exactly why this needs to go, political stuff has no 
place in the OS source.

___
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: r365984 - head/usr.bin/calendar/calendars

2020-09-22 Thread Steffen Nurpmeso
Ian Lepore wrote in
 <65448d226d8cf4318c1db49af993a14e54034dab.ca...@freebsd.org>:

 |And now you're arguing about the factual correctness of your comment in
 |reply to my comment which wasn't about the facts at all.
 |
 |Thank you for proving my point most elequently about why we should not
 |be purveyors of trivia or general knowledge.

Not true.  I even gave the suggestion to return to the original
calendar approach.
Furthermore everything should be taken with a grain of salt like
i think Warner Losh would say it, even if it comes from the
FreeBSD community.

--steffen
|
|Der Kragenbaer,The moon bear,
|der holt sich munter   he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)
___
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: r365984 - head/usr.bin/calendar/calendars

2020-09-22 Thread Ian Lepore
On Tue, 2020-09-22 at 17:56 +0200, Steffen Nurpmeso wrote:
> Ian Lepore wrote in
>  :
>  |On Tue, 2020-09-22 at 16:02 +0200, Steffen Nurpmeso wrote:
>  |> Greg Lehey wrote in
>  |>  <202009212255.08lmtpsp078...@repo.freebsd.org>:
>  |>|Author: grog
>  |>|Date: Mon Sep 21 22:55:51 2020
>  |>|New Revision: 365984
>  |>|URL: https://svnweb.freebsd.org/changeset/base/365984
>  |>|
>  |>|Log:
>  |>|  Remove claim that Allied Forces created "West Germany" in
>  |> 1953.  I can
>  |>|  find no historic substantiation for such a claim.  The Federal
>  |>|  Republic of Germany was created by Germans on 23 May 1949, as
>  |> also
>  |>|  noted in this file.
>  |> 
>  |> I could imagine it was Konrad Adenauer (chancellor at that time)
>  |> refusing (let aside western war winners) the Sowjet offer to
>  |> reunite Germany shall Germany henceforth exist as a "neutral
>  |> state" in the same sense as Switzerland claims to be neutral.
>  |> He refused, instead forward looking to rearm the German army.
>  |> That is, turning Germany to a part of the Western Alliance
>  |> explicitly and willingly.  Or was that in 1949?  Hm.
>  |
>  |And this is why I agree with Cy and Conrad that we should not be
> trying
>  |to be wikipedia lite.
> 
> Not finding anything at all that is to say then?
> On Wikipedia there is lobbyism and even war in big style for sure,
> you can very often see this.
> In fact, _this_ calendar entry is so fine because it mentions
> something that is not talked about in Germany, the last time
> i have heard it in the public was about twenty years ago, wait, it
> was in fact 2003 during the German public law TV show "Greatest
> Germans", and once the brave man said it ("sometimes the truth has
> to be told") it came out how that audience was mounted, because
> a loud LIE! could be heard.  And yes, Konrad Adenauer was
> voted the greatest german of all time, a wise and comprehensible
> decision, outperforming those dwarfs like Goethe, Schiller,
> Beethoven, Einstein, Bach, and our wonderful emperor even.  I do
> not understand!
> 
> The calendar program came into BSD in 1981 and originally only
> looked for per user calendar files.
> I am using this program ever since i started using FreeBSD, now
> also on Linux.  Other than that i cannot help it, you know.
> But it is great that just recently someone pimped the codebase in
> order to make it work with other calendar formats also, i think.
> (I cloned that specific repository in addition the second i read
> the announcement.  Have not tried it yet though.  But will keep
> it.)
> 

And now you're arguing about the factual correctness of your comment in
reply to my comment which wasn't about the facts at all.

Thank you for proving my point most elequently about why we should not
be purveyors of trivia or general knowledge.

-- Ian


___
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: r365984 - head/usr.bin/calendar/calendars

2020-09-22 Thread Steffen Nurpmeso
Ian Lepore wrote in
 :
 |On Tue, 2020-09-22 at 16:02 +0200, Steffen Nurpmeso wrote:
 |> Greg Lehey wrote in
 |>  <202009212255.08lmtpsp078...@repo.freebsd.org>:
 |>|Author: grog
 |>|Date: Mon Sep 21 22:55:51 2020
 |>|New Revision: 365984
 |>|URL: https://svnweb.freebsd.org/changeset/base/365984
 |>|
 |>|Log:
 |>|  Remove claim that Allied Forces created "West Germany" in
 |> 1953.  I can
 |>|  find no historic substantiation for such a claim.  The Federal
 |>|  Republic of Germany was created by Germans on 23 May 1949, as
 |> also
 |>|  noted in this file.
 |> 
 |> I could imagine it was Konrad Adenauer (chancellor at that time)
 |> refusing (let aside western war winners) the Sowjet offer to
 |> reunite Germany shall Germany henceforth exist as a "neutral
 |> state" in the same sense as Switzerland claims to be neutral.
 |> He refused, instead forward looking to rearm the German army.
 |> That is, turning Germany to a part of the Western Alliance
 |> explicitly and willingly.  Or was that in 1949?  Hm.
 |
 |And this is why I agree with Cy and Conrad that we should not be trying
 |to be wikipedia lite.

Not finding anything at all that is to say then?
On Wikipedia there is lobbyism and even war in big style for sure,
you can very often see this.
In fact, _this_ calendar entry is so fine because it mentions
something that is not talked about in Germany, the last time
i have heard it in the public was about twenty years ago, wait, it
was in fact 2003 during the German public law TV show "Greatest
Germans", and once the brave man said it ("sometimes the truth has
to be told") it came out how that audience was mounted, because
a loud LIE! could be heard.  And yes, Konrad Adenauer was
voted the greatest german of all time, a wise and comprehensible
decision, outperforming those dwarfs like Goethe, Schiller,
Beethoven, Einstein, Bach, and our wonderful emperor even.  I do
not understand!

The calendar program came into BSD in 1981 and originally only
looked for per user calendar files.
I am using this program ever since i started using FreeBSD, now
also on Linux.  Other than that i cannot help it, you know.
But it is great that just recently someone pimped the codebase in
order to make it work with other calendar formats also, i think.
(I cloned that specific repository in addition the second i read
the announcement.  Have not tried it yet though.  But will keep
it.)

--steffen
|
|Der Kragenbaer,The moon bear,
|der holt sich munter   he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)
___
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: r366003 - head/libexec/ftpd

2020-09-22 Thread Mark Johnston
Author: markj
Date: Tue Sep 22 15:54:18 2020
New Revision: 366003
URL: https://svnweb.freebsd.org/changeset/base/366003

Log:
  ftpd: Add missing braces around a statfd check
  
  This was harmless but looked incorrect.  No functional change intended.
  
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/libexec/ftpd/ftpd.c

Modified: head/libexec/ftpd/ftpd.c
==
--- head/libexec/ftpd/ftpd.cTue Sep 22 15:54:05 2020(r366002)
+++ head/libexec/ftpd/ftpd.cTue Sep 22 15:54:18 2020(r366003)
@@ -1530,7 +1530,7 @@ skip:
setusercontext(lc, pw, 0, LOGIN_SETRESOURCES);
 #endif
 
-   if (guest && stats && statfd < 0)
+   if (guest && stats && statfd < 0) {
 #ifdef VIRTUAL_HOSTING
statfd = open(thishost->statfile, O_WRONLY|O_APPEND);
 #else
@@ -1538,6 +1538,7 @@ skip:
 #endif
if (statfd < 0)
stats = 0;
+   }
 
/*
 * For a chrooted local user,
___
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: r366002 - head/libexec/tftpd

2020-09-22 Thread Mark Johnston
Author: markj
Date: Tue Sep 22 15:54:05 2020
New Revision: 366002
URL: https://svnweb.freebsd.org/changeset/base/366002

Log:
  tftpd: Check for errors from chdir()
  
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/libexec/tftpd/tftpd.c

Modified: head/libexec/tftpd/tftpd.c
==
--- head/libexec/tftpd/tftpd.c  Tue Sep 22 15:01:34 2020(r366001)
+++ head/libexec/tftpd/tftpd.c  Tue Sep 22 15:54:05 2020(r366002)
@@ -373,7 +373,10 @@ main(int argc, char *argv[])
chroot_dir, strerror(errno));
exit(1);
}
-   chdir("/");
+   if (chdir("/") != 0) {
+   tftp_log(LOG_ERR, "chdir: %s", strerror(errno));
+   exit(1);
+   }
if (setgroups(1, >pw_gid) != 0) {
tftp_log(LOG_ERR, "setgroups failed");
exit(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"


  1   2   >