Re: svn commit: r363091 - in head/contrib/bc: . include manuals src tests tests/bc

2020-07-30 Thread Alexey Dokuchaev
On Thu, Jul 30, 2020 at 06:51:58PM +0200, Stefan E??er wrote:
> ...
> My guess is that he'll add a compile time switch to his version
> that will be added to our usr.bin Makefile and will suppress the
> start-up message in our base system version. (I'll keep the port
> version as is unless there is a strong preference to suppress it
> also in the port).

Yes, this is the correct approach, thank you Stefan.

./danfe
___
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: r363723 - head

2020-07-30 Thread Kyle Evans
Author: kevans
Date: Fri Jul 31 02:21:19 2020
New Revision: 363723
URL: https://svnweb.freebsd.org/changeset/base/363723

Log:
  UPDATING: Add a note about running installworld twice
  
  Some folks seem to be hitting issues with build orchestration; presumably
  some of our .WAIT-removal optimizations are going awry, and they're ending
  up with applications linked against new libc being installed before the new
  libc.
  
  Letting installworld complete the first time should ensure that the new libc
  is installed by the end of it, then the second installworld will ensure
  consistency as everything should succeed.

Modified:
  head/UPDATING

Modified: head/UPDATING
==
--- head/UPDATING   Fri Jul 31 00:13:40 2020(r363722)
+++ head/UPDATING   Fri Jul 31 02:21:19 2020(r363723)
@@ -33,6 +33,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW:
ports, but other non-ports software may need extra escapes removed to
continue to function.
 
+   Because of this change, installworld may encounter the following error
+   from rtld: Undefined symbol "regcomp@FBSD_1.6" -- It is imperative that
+   you do not halt installworld. Instead, let it run to completion (whether
+   successful or not) and run installworld once more.
+
 20200627:
A new implementation of bc and dc has been imorted in r362681. This
implementation corrects non-conformant behavior of the previous bc
___
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: r363679 - in head: contrib/netbsd-tests/lib/libc/regex/data lib/libc/regex

2020-07-30 Thread Kyle Evans
On Thu, Jul 30, 2020 at 8:47 PM Kyle Evans  wrote:
>
> On Wed, Jul 29, 2020 at 10:53 PM Li-Wen Hsu  wrote:
> >
> > On Thu, Jul 30, 2020 at 7:22 AM Kyle Evans  wrote:
> > >
> > > Author: kevans
> > > Date: Wed Jul 29 23:21:56 2020
> > > New Revision: 363679
> > > URL: https://svnweb.freebsd.org/changeset/base/363679
> > >
> > > Log:
> > >   regex(3): Interpret many escaped ordinary characters as EESCAPE
> > >
> > >   In IEEE 1003.1-2008 [1] and earlier revisions, BRE/ERE grammar allows 
> > > for
> > >   any character to be escaped, but "ORD_CHAR preceded by an unescaped
> > >character [gives undefined results]".
> > >
> > >   Historically, we've interpreted an escaped ordinary character as the
> > >   ordinary character itself. This becomes problematic when some extensions
> > >   give special meanings to an otherwise ordinary character
> > >   (e.g. GNU's \b, \s, \w), meaning we may have two different valid
> > >   interpretations of the same sequence.
> > >
> > >   To make this easier to deal with and given that the standard calls this
> > >   undefined, we should throw an error (EESCAPE) if we run into this 
> > > scenario
> > >   to ease transition into a state where some escaped ordinaries are 
> > > blessed
> > >   with a special meaning -- it will either error out or have extended
> > >   behavior, rather than have two entirely different versions of undefined
> > >   behavior that leave the consumer of regex(3) guessing as to what 
> > > behavior
> > >   will be used or leaving them with false impressions.
> > >
> > >   This change bumps the symbol version of regcomp to FBSD_1.6 and 
> > > provides the
> > >   old escape semantics for legacy applications, just in case one has an 
> > > older
> > >   application that would immediately turn into a pumpkin because of an
> > >   extraneous escape that's 
> > > embehttps://ci.freebsd.org/job/FreeBSD-head-amd64-test/16011/testReport/junit/lib.googletest.gtest_main/googletest-port-test/main/dded
> > >  or otherwise critical to its operation.
> > >
> > >   This is the final piece needed before enhancing libregex with GNU 
> > > extensions
> > >   and flipping the switch on bsdgrep.
> > >
> > >   [1] http://pubs.opengroup.org/onlinepubs/9699919799.2016edition/
> > >
> > >   PR:   229925 (exp-run, courtesy of antoine)
> > >   Differential Revision:https://reviews.freebsd.org/D10510
> > >
> > > Modified:
> > >   head/contrib/netbsd-tests/lib/libc/regex/data/meta.in
> > >   head/contrib/netbsd-tests/lib/libc/regex/data/subexp.in
> > >   head/lib/libc/regex/Symbol.map
> > >   head/lib/libc/regex/regcomp.c
> >
> > I think there are 3 test cases need to be modified after this change:
> >
> > https://ci.freebsd.org/job/FreeBSD-head-amd64-test/16011/testReport/junit/lib.googletest.gtest_main/googletest-port-test/main/
> > https://ci.freebsd.org/job/FreeBSD-head-amd64-test/16011/testReport/junit/usr.bin.diff/diff_test/side_by_side/
> > https://ci.freebsd.org/job/FreeBSD-head-amd64-test/16011/testReport/junit/usr.bin.sed/sed2_test/hex_subst/
> >
>
> CC'ing asomers@ and ngie@, because ISTR they have some googletest stock.
>
> Testing my libregex GNU extensions revealed that I'm really not ready
> to commit that just yet. We have two options here for googletest:
>
> 1. Disable it and create a PR to be fixed when my changes are done,
> hopefully by the end of the week, or
> 2. Fix the expressions in
> contrib/googletest/googletest/test/googletest-port-test.cc to be POSIX
> compliant and upstream that.
>
> #2 is generally a replacement of \w -> [[:alnum:]] and \W ->
> [^[:alnum:]] and maybe \s -> [[:space:]].
>

Sorry, to be more precise: disable it meaning expect failure of that
specific test or something similar.
___
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: r363679 - in head: contrib/netbsd-tests/lib/libc/regex/data lib/libc/regex

2020-07-30 Thread Kyle Evans
On Wed, Jul 29, 2020 at 10:53 PM Li-Wen Hsu  wrote:
>
> On Thu, Jul 30, 2020 at 7:22 AM Kyle Evans  wrote:
> >
> > Author: kevans
> > Date: Wed Jul 29 23:21:56 2020
> > New Revision: 363679
> > URL: https://svnweb.freebsd.org/changeset/base/363679
> >
> > Log:
> >   regex(3): Interpret many escaped ordinary characters as EESCAPE
> >
> >   In IEEE 1003.1-2008 [1] and earlier revisions, BRE/ERE grammar allows for
> >   any character to be escaped, but "ORD_CHAR preceded by an unescaped
> >character [gives undefined results]".
> >
> >   Historically, we've interpreted an escaped ordinary character as the
> >   ordinary character itself. This becomes problematic when some extensions
> >   give special meanings to an otherwise ordinary character
> >   (e.g. GNU's \b, \s, \w), meaning we may have two different valid
> >   interpretations of the same sequence.
> >
> >   To make this easier to deal with and given that the standard calls this
> >   undefined, we should throw an error (EESCAPE) if we run into this scenario
> >   to ease transition into a state where some escaped ordinaries are blessed
> >   with a special meaning -- it will either error out or have extended
> >   behavior, rather than have two entirely different versions of undefined
> >   behavior that leave the consumer of regex(3) guessing as to what behavior
> >   will be used or leaving them with false impressions.
> >
> >   This change bumps the symbol version of regcomp to FBSD_1.6 and provides 
> > the
> >   old escape semantics for legacy applications, just in case one has an 
> > older
> >   application that would immediately turn into a pumpkin because of an
> >   extraneous escape that's 
> > embehttps://ci.freebsd.org/job/FreeBSD-head-amd64-test/16011/testReport/junit/lib.googletest.gtest_main/googletest-port-test/main/dded
> >  or otherwise critical to its operation.
> >
> >   This is the final piece needed before enhancing libregex with GNU 
> > extensions
> >   and flipping the switch on bsdgrep.
> >
> >   [1] http://pubs.opengroup.org/onlinepubs/9699919799.2016edition/
> >
> >   PR:   229925 (exp-run, courtesy of antoine)
> >   Differential Revision:https://reviews.freebsd.org/D10510
> >
> > Modified:
> >   head/contrib/netbsd-tests/lib/libc/regex/data/meta.in
> >   head/contrib/netbsd-tests/lib/libc/regex/data/subexp.in
> >   head/lib/libc/regex/Symbol.map
> >   head/lib/libc/regex/regcomp.c
>
> I think there are 3 test cases need to be modified after this change:
>
> https://ci.freebsd.org/job/FreeBSD-head-amd64-test/16011/testReport/junit/lib.googletest.gtest_main/googletest-port-test/main/
> https://ci.freebsd.org/job/FreeBSD-head-amd64-test/16011/testReport/junit/usr.bin.diff/diff_test/side_by_side/
> https://ci.freebsd.org/job/FreeBSD-head-amd64-test/16011/testReport/junit/usr.bin.sed/sed2_test/hex_subst/
>

CC'ing asomers@ and ngie@, because ISTR they have some googletest stock.

Testing my libregex GNU extensions revealed that I'm really not ready
to commit that just yet. We have two options here for googletest:

1. Disable it and create a PR to be fixed when my changes are done,
hopefully by the end of the week, or
2. Fix the expressions in
contrib/googletest/googletest/test/googletest-port-test.cc to be POSIX
compliant and upstream that.

#2 is generally a replacement of \w -> [[:alnum:]] and \W ->
[^[:alnum:]] and maybe \s -> [[:space:]].

Thoughts?

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: r363722 - head/sys/kern

2020-07-30 Thread Conrad Meyer
Author: cem
Date: Fri Jul 31 00:13:40 2020
New Revision: 363722
URL: https://svnweb.freebsd.org/changeset/base/363722

Log:
  getblk: Remove a non-sensical LK_NOWAIT | LK_SLEEPFAIL
  
  No functional change.
  
  LK_SLEEPFAIL implies a behavior that is only possible if the lock operation 
can
  sleep.  LK_NOWAIT prevents the lock operation from sleeping.
  
  Discussed with:   kib

Modified:
  head/sys/kern/vfs_bio.c

Modified: head/sys/kern/vfs_bio.c
==
--- head/sys/kern/vfs_bio.c Fri Jul 31 00:07:01 2020(r363721)
+++ head/sys/kern/vfs_bio.c Fri Jul 31 00:13:40 2020(r363722)
@@ -3887,10 +3887,8 @@ loop:
 * Buffer is in-core.  If the buffer is not busy nor managed,
 * it must be on a queue.
 */
-   lockflags = LK_EXCLUSIVE | LK_SLEEPFAIL | LK_INTERLOCK;
-
-   if ((flags & GB_LOCK_NOWAIT) != 0)
-   lockflags |= LK_NOWAIT;
+   lockflags = LK_EXCLUSIVE | LK_INTERLOCK |
+   ((flags & GB_LOCK_NOWAIT) ? LK_NOWAIT : LK_SLEEPFAIL);
 
error = BUF_TIMELOCK(bp, lockflags,
BO_LOCKPTR(bo), "getblk", slpflag, slptimeo);
___
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: r363721 - head/sys/kern

2020-07-30 Thread Conrad Meyer
Author: cem
Date: Fri Jul 31 00:07:01 2020
New Revision: 363721
URL: https://svnweb.freebsd.org/changeset/base/363721

Log:
  getblk: Avoid sleeping on wrong buf in lockless path
  
  If the buffer identity changed during lookup, sleeping could introduce a
  lock order reversal.  Since we do not know if the identity changed until we
  get the lock, we must try-lock (LK_NOWAIT) only.  EINTR and ERESTART error
  handling becomes irrelevant, as we no longer sleep.
  
  Reported by:  kib
  Reviewed by:  kib
  X-MFC-With:   r363482
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D25898

Modified:
  head/sys/kern/vfs_bio.c

Modified: head/sys/kern/vfs_bio.c
==
--- head/sys/kern/vfs_bio.c Thu Jul 30 23:54:25 2020(r363720)
+++ head/sys/kern/vfs_bio.c Fri Jul 31 00:07:01 2020(r363721)
@@ -3844,7 +3844,7 @@ getblkx(struct vnode *vp, daddr_t blkno, daddr_t dblkn
struct buf *bp;
struct bufobj *bo;
daddr_t d_blkno;
-   int bsize, error, maxsize, vmio, lockflags;
+   int bsize, error, maxsize, vmio;
off_t offset;
 
CTR3(KTR_BUF, "getblk(%p, %ld, %d)", vp, (long)blkno, size);
@@ -3865,14 +3865,9 @@ getblkx(struct vnode *vp, daddr_t blkno, daddr_t dblkn
if (bp == NULL)
goto newbuf_unlocked;
 
-   lockflags = LK_EXCLUSIVE | LK_SLEEPFAIL |
-   ((flags & GB_LOCK_NOWAIT) ? LK_NOWAIT : 0);
-
-   error = BUF_TIMELOCK(bp, lockflags, NULL, "getblku", slpflag,
-   slptimeo);
-   if (error == EINTR || error == ERESTART)
-   return (error);
-   else if (error != 0)
+   error = BUF_TIMELOCK(bp, LK_EXCLUSIVE | LK_NOWAIT, NULL, "getblku", 0,
+   0);
+   if (error != 0)
goto loop;
 
/* Verify buf identify has not changed since lookup. */
@@ -3886,6 +3881,8 @@ loop:
BO_RLOCK(bo);
bp = gbincore(bo, blkno);
if (bp != NULL) {
+   int lockflags;
+
/*
 * Buffer is in-core.  If the buffer is not busy nor managed,
 * it must be on a queue.
___
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: r363720 - head/sys/contrib/pcg-c

2020-07-30 Thread Conrad Meyer
Author: cem
Date: Thu Jul 30 23:54:25 2020
New Revision: 363720
URL: https://svnweb.freebsd.org/changeset/base/363720

Log:
  Import PCG-C into sys/contrib
  
  The intended (future) use is to provide fast pseudo-random numbers in non-
  cryptographic applications.

Added:
  head/sys/contrib/pcg-c/
 - copied from r363718, vendor/pcg-c/20190718-83252d9/
___
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: r363719 - head/sys/sys

2020-07-30 Thread Peter Grehan
Author: grehan
Date: Thu Jul 30 23:49:49 2020
New Revision: 363719
URL: https://svnweb.freebsd.org/changeset/base/363719

Log:
  Definition for the 'removable media flag' from word 0 in the Identify page.
  
  This will be used to remove a magic number in the bhyve AHCI emulation.
  
  Reported by:  rpokala
  Reviewed by:  imp, rpokala
  Approved by:  imp, rpokala
  MFC after:3 weeks
  Differential Revision:https://reviews.freebsd.org/D25893

Modified:
  head/sys/sys/ata.h

Modified: head/sys/sys/ata.h
==
--- head/sys/sys/ata.h  Thu Jul 30 23:20:09 2020(r363718)
+++ head/sys/sys/ata.h  Thu Jul 30 23:49:49 2020(r363719)
@@ -46,6 +46,7 @@ struct ata_params {
 #define ATA_ATAPI_TYPE_TAPE 0x0100  /* streaming tape */
 #define ATA_ATAPI_TYPE_CDROM0x0500  /* CD-ROM device */
 #define ATA_ATAPI_TYPE_OPTICAL  0x0700  /* optical disk */
+#define ATA_ATAPI_REMOVABLE 0x0080
 #define ATA_DRQ_MASK0x0060
 #define ATA_DRQ_SLOW0x  /* cpu 3 ms delay */
 #define ATA_DRQ_INTR0x0020  /* interrupt 10 ms delay */
___
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: r363718 - vendor/pcg-c/20190718-83252d9

2020-07-30 Thread Conrad Meyer
Author: cem
Date: Thu Jul 30 23:20:09 2020
New Revision: 363718
URL: https://svnweb.freebsd.org/changeset/base/363718

Log:
  Tag PCG-C master 2019-07-18 83252d9

Added:
  vendor/pcg-c/20190718-83252d9/
 - copied from r363717, vendor/pcg-c/dist/
___
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: r363717 - in vendor/pcg-c: . dist dist/include

2020-07-30 Thread Conrad Meyer
Author: cem
Date: Thu Jul 30 23:17:30 2020
New Revision: 363717
URL: https://svnweb.freebsd.org/changeset/base/363717

Log:
  Import PCG-C master, 2019-07-18 (83252d9c23df9c82ecb42210afed61a7b42402d7)

Added:
  vendor/pcg-c/
  vendor/pcg-c/dist/
  vendor/pcg-c/dist/include/
  vendor/pcg-c/dist/include/pcg_variants.h   (contents, props changed)

Added: vendor/pcg-c/dist/include/pcg_variants.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ vendor/pcg-c/dist/include/pcg_variants.hThu Jul 30 23:17:30 2020
(r363717)
@@ -0,0 +1,2544 @@
+/*
+ * PCG Random Number Generation for C.
+ *
+ * Copyright 2014-2019 Melissa O'Neill ,
+ * and the PCG Project contributors.
+ *
+ * SPDX-License-Identifier: (Apache-2.0 OR MIT)
+ *
+ * Licensed under the Apache License, Version 2.0 (provided in
+ * LICENSE-APACHE.txt and at http://www.apache.org/licenses/LICENSE-2.0)
+ * or under the MIT license (provided in LICENSE-MIT.txt and at
+ * http://opensource.org/licenses/MIT), at your option. This file may not
+ * be copied, modified, or distributed except according to those terms.
+ *
+ * Distributed on an "AS IS" BASIS, WITHOUT WARRANTY OF ANY KIND, either
+ * express or implied.  See your chosen license for details.
+ *
+ * For additional information about the PCG random number generation scheme,
+ * visit http://www.pcg-random.org/.
+ */
+
+/*
+ * This code is derived from the canonical C++ PCG implementation, which
+ * has many additional features and is preferable if you can use C++ in
+ * your project.
+ *
+ * Much of the derivation was performed mechanically.  In particular, the
+ * output functions were generated by compiling the C++ output functions
+ * into LLVM bitcode and then transforming that using the LLVM C backend
+ * (from https://github.com/draperlaboratory/llvm-cbe), and then
+ * postprocessing and hand editing the output.
+ *
+ * Much of the remaining code was generated by C-preprocessor metaprogramming.
+ */
+
+#ifndef PCG_VARIANTS_H_INCLUDED
+#define PCG_VARIANTS_H_INCLUDED 1
+
+#include 
+
+#if __SIZEOF_INT128__
+typedef __uint128_t pcg128_t;
+#define PCG_128BIT_CONSTANT(high,low) \
+pcg128_t)high) << 64) + low)
+#define PCG_HAS_128BIT_OPS 1
+#endif
+
+#if __GNUC_GNU_INLINE__  &&  !defined(__cplusplus)
+#error Nonstandard GNU inlining semantics. Compile with -std=c99 or better.
+/* We could instead use macros PCG_INLINE and PCG_EXTERN_INLINE
+   but better to just reject ancient C code. */
+#endif
+
+#if __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Rotate helper functions.
+ */
+
+inline uint8_t pcg_rotr_8(uint8_t value, unsigned int rot)
+{
+/* Unfortunately, clang is kinda pathetic when it comes to properly
+ * recognizing idiomatic rotate code, so for clang we actually provide
+ * assembler directives (enabled with PCG_USE_INLINE_ASM).  Boo, hiss.
+ */
+#if PCG_USE_INLINE_ASM && __clang__ && (__x86_64__  || __i386__)
+asm ("rorb   %%cl, %0" : "=r" (value) : "0" (value), "c" (rot));
+return value;
+#else
+return (value >> rot) | (value << ((- rot) & 7));
+#endif
+}
+
+inline uint16_t pcg_rotr_16(uint16_t value, unsigned int rot)
+{
+#if PCG_USE_INLINE_ASM && __clang__ && (__x86_64__  || __i386__)
+asm ("rorw   %%cl, %0" : "=r" (value) : "0" (value), "c" (rot));
+return value;
+#else
+return (value >> rot) | (value << ((- rot) & 15));
+#endif
+}
+
+inline uint32_t pcg_rotr_32(uint32_t value, unsigned int rot)
+{
+#if PCG_USE_INLINE_ASM && __clang__ && (__x86_64__  || __i386__)
+asm ("rorl   %%cl, %0" : "=r" (value) : "0" (value), "c" (rot));
+return value;
+#else
+return (value >> rot) | (value << ((- rot) & 31));
+#endif
+}
+
+inline uint64_t pcg_rotr_64(uint64_t value, unsigned int rot)
+{
+#if 0 && PCG_USE_INLINE_ASM && __clang__ && __x86_64__
+/* For whatever reason, clang actually *does* generate rotq by
+   itself, so we don't need this code. */
+asm ("rorq   %%cl, %0" : "=r" (value) : "0" (value), "c" (rot));
+return value;
+#else
+return (value >> rot) | (value << ((- rot) & 63));
+#endif
+}
+
+#if PCG_HAS_128BIT_OPS
+inline pcg128_t pcg_rotr_128(pcg128_t value, unsigned int rot)
+{
+return (value >> rot) | (value << ((- rot) & 127));
+}
+#endif
+
+/*
+ * Output functions.  These are the core of the PCG generation scheme.
+ */
+
+/* XSH RS */
+
+inline uint8_t pcg_output_xsh_rs_16_8(uint16_t state)
+{
+return (uint8_t)(((state >> 7u) ^ state) >> ((state >> 14u) + 3u));
+}
+
+inline uint16_t pcg_output_xsh_rs_32_16(uint32_t state)
+{
+return (uint16_t)(((state >> 11u) ^ state) >> ((state >> 30u) + 11u));
+}
+
+inline uint32_t pcg_output_xsh_rs_64_32(uint64_t state)
+{
+
+return (uint32_t)(((state >> 22u) ^ state) >> ((state >> 61u) + 22u));
+}
+
+#if PCG_HAS_128BIT_OPS
+inline uint64_t pcg_output_xsh_rs_128_64(pcg128_t state)
+{
+return 

svn commit: r363716 - head/sys/security/mac

2020-07-30 Thread Mateusz Guzik
Author: mjg
Date: Thu Jul 30 22:56:57 2020
New Revision: 363716
URL: https://svnweb.freebsd.org/changeset/base/363716

Log:
  Fix tinderbox build after r363714

Modified:
  head/sys/security/mac/mac_framework.h

Modified: head/sys/security/mac/mac_framework.h
==
--- head/sys/security/mac/mac_framework.h   Thu Jul 30 22:52:18 2020
(r363715)
+++ head/sys/security/mac/mac_framework.h   Thu Jul 30 22:56:57 2020
(r363716)
@@ -259,7 +259,11 @@ void   mac_posixshm_destroy(struct shmfd *);
 void   mac_posixshm_init(struct shmfd *);
 
 intmac_priv_check_impl(struct ucred *cred, int priv);
+#ifdef MAC
 extern bool mac_priv_check_fp_flag;
+#else
+#define mac_priv_check_fp_flag 0
+#endif
 static inline int
 mac_priv_check(struct ucred *cred, int priv)
 {
@@ -270,7 +274,11 @@ mac_priv_check(struct ucred *cred, int priv)
 }
 
 intmac_priv_grant_impl(struct ucred *cred, int priv);
+#ifdef MAC
 extern bool mac_priv_grant_fp_flag;
+#else
+#define mac_priv_grant_fp_flag 0
+#endif
 static inline int
 mac_priv_grant(struct ucred *cred, int priv)
 {
___
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: r363625 - stable/12/usr.sbin/mountd

2020-07-30 Thread Jessica Clarke
On 30 Jul 2020, at 23:38, Rick Macklem  wrote:
> Brooks Davis wrote:
>> On Thu, Jul 30, 2020 at 03:48:34PM +, Rick Macklem wrote:
>>> Rick Macklem wrote:
 Ian Lepore wrote:
> On Thu, 2020-07-30 at 01:52 +, Rick Macklem wrote:
>> Brooks Davis wrote:
>>> Author: brooks
>>> Date: Mon Jul 27 23:18:14 2020
>>> New Revision: 363625
>>> URL: https://svnweb.freebsd.org/changeset/base/363625
>>> 
>>> Log:
>>> MFC r363439:
>>> 
>>> Correct a type-mismatch between xdr_long and the variable "bad".
>>> 
>>> [...]
>> --> I can't see how the xdr.c code would work for a machine that is
>> BIG_ENDIAN and where "long" is 64bits, but we don't have any of
>> those.
>> 
> 
> mips64 and powerpc64 are both big endian with 64-bit long.
 Oops, I didn't know that. In the past, I've run PowerPC and MIPS, but 
 thought
 they both were little endian. (I recall the arches can be run either way.)
 
 Anyhow, take a look at head/lib/libc/xdr/xdr.c and it looks to me like it
 has been broken "forever" (ever since we stopped using a K compiler
 that would have always made "long" 32bits).
>>> OK, I took another look at xdr.c and it isn't broken as I thought.
>>> 
>>> xdr_long() takes a "long *" argument ("long" in Sun XDR is 32bits),
>>> but then it only passes it as an argument to XDR_PUTLONG(), which is 
>>> actually
>>> a call to xdrmem_putlong_aligned() or xdrmem_putlong_unaligned().
>>> For xdrmem_putlong_aligned(), the line is:
>>>   *(u_int32_t *)xdrs->x_private = htonl((u_int32_t)*lp);
>>>  --> where lp is a "long *"
>>> 
>>> I'll admit I'm not 100% sure if "(u_int32_t)*lp" gets the correct 32bits of 
>>> a 64bit
>>> long pointer for all arches? (I'm not very good at knowing what type casts 
>>> do.)
>>> If this is the equivalent of "u_int32_t t; t = *lp; htonl(t); then I think 
>>> the code is ok?
>>> (At least it makes it clear that it is using 32bits of the value pointed to 
>>> by the
>>> argument.)
>>> 
>>> For xdrmem_putlong_unaligned(), it does the same thing via:
>>>u_int32_t l;
>>>?.
>>>l = htonl((u_int32_t)*lp);
>>> 
>>> --> At least the man page for xdr_long() should be clarified to note it
>>>  puts a 32bit quantity on the wire.
> I think I will try and come up with a man page patch, noting that xdr_long()
> always puts 32bits on the wire, even if long is 64bits for the arch.
> 
>>> 
 If anyone has either of these and can set up an NFS server on one of
 them and then try and do an NFSv3 mount that is not allowed, it would
 be interesting to see the packet trace and if the MNT RPC fails, because
 it looks like it will put the high order 32bits on the wire and they'll
 always be 0?
>>> It would still be interesting to test this on a 64bit big endian, but so 
>>> long as
>>> the above cast works, it does look like it works for all arches.
>>> 
 Just to clarify. The behaviour wasn't broken by this commit. I just
 don't see how the commit fixes anything?
>>> My mistake. Sorry for the noise.
>>> 
>>> I now think the commit is correct since it uses "*lp" to get the value 
>>> before
>>> casting it down to 32bits. Passing in an "int *" was incorrect.
>>> 
>>> The code does seem to handle "long *" for 64bit arches, although it
>>> only puts 32bits "on-the-wire".
>>> 
>>> rick, who was confused because he knew there was only supposed to be
>>>32bits go on the wire.
>> 
>> Thank you for all the analysis.  I'd initially changed all the uses
>> of bad to use xdr_int(), but switched to this "fix" because it's what
>> NetBSD and OpenBSD have been using for over a decade (and there was
>> less churn).  I'm happy to flip it the other way if that seems more
>> correct/less confusing.
> I think your current patch is fine. The confusion is w.r.t. what xdr_long() 
> does
> for a 64bit long and I think a man page update may be the way to go.
> --> If you look in xdr.c, xdr_int() assigns the value to a long and then ends
>  up truncating it back down, similar to xdr_long().
>  --> Some of the stuff in xdr.c is pretty scary for 64bit longs, but it 
> all
> seems to work, once you look at it for a while.;-)
> 
>> The previous code does in fact cause a 64-bit load of a pointer to an
>> int on 64-bit platforms.  I hit this in CheriBSD because that pointer
>> had 4-byte bounds.
> Yes. The first time I looked at the code (it was late evening), I misread
>((u_int32_t)*lp)  as *((u_int32_t *)lp) and that was why I thought your 
> patch
>was broken.
> 
> Thanks for doing this and sorry about the noise, rick
> ps: Personally, I've never understood why ANSI C allowed "long" to be 64bits
> on some arches. I still bump into hassles because the old K code was
> written assuming long to be 32bits.

Yeah, c.f. XChangeProperty(3) which has a similarly weird interface
(but slightly more so) that seriously confused me a few years ago. If
you 

svn commit: r363715 - head/sys/kern

2020-07-30 Thread Mateusz Guzik
Author: mjg
Date: Thu Jul 30 22:52:18 2020
New Revision: 363715
URL: https://svnweb.freebsd.org/changeset/base/363715

Log:
  cache: drop the useless numchecks counter

Modified:
  head/sys/kern/vfs_cache.c

Modified: head/sys/kern/vfs_cache.c
==
--- head/sys/kern/vfs_cache.c   Thu Jul 30 22:14:04 2020(r363714)
+++ head/sys/kern/vfs_cache.c   Thu Jul 30 22:52:18 2020(r363715)
@@ -419,7 +419,6 @@ STATNODE_COUNTER(numcachehv, "Number of namecache entr
 STATNODE_COUNTER(numdrops, "Number of dropped entries due to reaching the 
limit");
 STATNODE_COUNTER(dothits, "Number of '.' hits");
 STATNODE_COUNTER(dotdothits, "Number of '..' hits");
-STATNODE_COUNTER(numchecks, "Number of checks in lookup");
 STATNODE_COUNTER(nummiss, "Number of cache misses");
 STATNODE_COUNTER(nummisszap, "Number of cache misses we do not want to cache");
 STATNODE_COUNTER(numposzaps,
@@ -1315,7 +1314,6 @@ retry:
rw_wlock(blp);
 
CK_LIST_FOREACH(ncp, (NCHHASH(hash)), nc_hash) {
-   counter_u64_add(numchecks, 1);
if (ncp->nc_dvp == dvp && ncp->nc_nlen == cnp->cn_namelen &&
!bcmp(ncp->nc_name, cnp->cn_nameptr, ncp->nc_nlen))
break;
@@ -1460,7 +1458,6 @@ retry_hashed:
}
 
CK_LIST_FOREACH(ncp, (NCHHASH(hash)), nc_hash) {
-   counter_u64_add(numchecks, 1);
if (ncp->nc_dvp == dvp && ncp->nc_nlen == cnp->cn_namelen &&
!bcmp(ncp->nc_name, cnp->cn_nameptr, ncp->nc_nlen))
break;
@@ -3366,7 +3363,6 @@ cache_fplookup_next(struct cache_fpl *fpl)
hash = cache_get_hash(cnp->cn_nameptr, cnp->cn_namelen, dvp);
 
CK_LIST_FOREACH(ncp, (NCHHASH(hash)), nc_hash) {
-   counter_u64_add(numchecks, 1);
if (ncp->nc_dvp == dvp && ncp->nc_nlen == cnp->cn_namelen &&
!bcmp(ncp->nc_name, cnp->cn_nameptr, ncp->nc_nlen))
break;
___
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: r363625 - stable/12/usr.sbin/mountd

2020-07-30 Thread Rick Macklem
Brooks Davis wrote:
>On Thu, Jul 30, 2020 at 03:48:34PM +, Rick Macklem wrote:
>> Rick Macklem wrote:
>> >Ian Lepore wrote:
>> >>On Thu, 2020-07-30 at 01:52 +, Rick Macklem wrote:
>> >>> Brooks Davis wrote:
>> >>> > Author: brooks
>> >>> > Date: Mon Jul 27 23:18:14 2020
>> >>> > New Revision: 363625
>> >>> > URL: https://svnweb.freebsd.org/changeset/base/363625
>> >>> >
>> >>> > Log:
>> >>> >  MFC r363439:
>> >>> >
>> >>> >  Correct a type-mismatch between xdr_long and the variable "bad".
>> >>> >
>> >>> > [...]
>> >>> --> I can't see how the xdr.c code would work for a machine that is
>> >>> BIG_ENDIAN and where "long" is 64bits, but we don't have any of
>> >>> those.
>> >>>
>> >>
>> >>mips64 and powerpc64 are both big endian with 64-bit long.
>> >Oops, I didn't know that. In the past, I've run PowerPC and MIPS, but 
>> >thought
>> >they both were little endian. (I recall the arches can be run either way.)
>> >
>> >Anyhow, take a look at head/lib/libc/xdr/xdr.c and it looks to me like it
>> >has been broken "forever" (ever since we stopped using a K compiler
>> >that would have always made "long" 32bits).
>> OK, I took another look at xdr.c and it isn't broken as I thought.
>>
>> xdr_long() takes a "long *" argument ("long" in Sun XDR is 32bits),
>> but then it only passes it as an argument to XDR_PUTLONG(), which is actually
>> a call to xdrmem_putlong_aligned() or xdrmem_putlong_unaligned().
>> For xdrmem_putlong_aligned(), the line is:
>>*(u_int32_t *)xdrs->x_private = htonl((u_int32_t)*lp);
>>   --> where lp is a "long *"
>>
>> I'll admit I'm not 100% sure if "(u_int32_t)*lp" gets the correct 32bits of 
>> a 64bit
>> long pointer for all arches? (I'm not very good at knowing what type casts 
>> do.)
>> If this is the equivalent of "u_int32_t t; t = *lp; htonl(t); then I think 
>> the code is ok?
>> (At least it makes it clear that it is using 32bits of the value pointed to 
>> by the
>>  argument.)
>>
>> For xdrmem_putlong_unaligned(), it does the same thing via:
>> u_int32_t l;
>> ?.
>> l = htonl((u_int32_t)*lp);
>>
>> --> At least the man page for xdr_long() should be clarified to note it
>>   puts a 32bit quantity on the wire.
I think I will try and come up with a man page patch, noting that xdr_long()
always puts 32bits on the wire, even if long is 64bits for the arch.

>>
>> >If anyone has either of these and can set up an NFS server on one of
>> >them and then try and do an NFSv3 mount that is not allowed, it would
>> >be interesting to see the packet trace and if the MNT RPC fails, because
>> >it looks like it will put the high order 32bits on the wire and they'll
>> >always be 0?
>> It would still be interesting to test this on a 64bit big endian, but so 
>> long as
>> the above cast works, it does look like it works for all arches.
>>
>> >Just to clarify. The behaviour wasn't broken by this commit. I just
>> >don't see how the commit fixes anything?
>> My mistake. Sorry for the noise.
>>
>> I now think the commit is correct since it uses "*lp" to get the value before
>> casting it down to 32bits. Passing in an "int *" was incorrect.
>>
>> The code does seem to handle "long *" for 64bit arches, although it
>> only puts 32bits "on-the-wire".
>>
>> rick, who was confused because he knew there was only supposed to be
>> 32bits go on the wire.
>
>Thank you for all the analysis.  I'd initially changed all the uses
>of bad to use xdr_int(), but switched to this "fix" because it's what
>NetBSD and OpenBSD have been using for over a decade (and there was
>less churn).  I'm happy to flip it the other way if that seems more
>correct/less confusing.
I think your current patch is fine. The confusion is w.r.t. what xdr_long() does
for a 64bit long and I think a man page update may be the way to go.
--> If you look in xdr.c, xdr_int() assigns the value to a long and then ends
  up truncating it back down, similar to xdr_long().
  --> Some of the stuff in xdr.c is pretty scary for 64bit longs, but it all
 seems to work, once you look at it for a while.;-)

>The previous code does in fact cause a 64-bit load of a pointer to an
>int on 64-bit platforms.  I hit this in CheriBSD because that pointer
>had 4-byte bounds.
Yes. The first time I looked at the code (it was late evening), I misread
((u_int32_t)*lp)  as *((u_int32_t *)lp) and that was why I thought your 
patch
was broken.

Thanks for doing this and sorry about the noise, rick
ps: Personally, I've never understood why ANSI C allowed "long" to be 64bits
 on some arches. I still bump into hassles because the old K code was
 written assuming long to be 32bits.

-- Brooks
___
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: r363482 - in head/sys: kern sys

2020-07-30 Thread Konstantin Belousov
On Thu, Jul 30, 2020 at 03:13:19PM -0700, Conrad Meyer wrote:
> Hi Konstantin,
> 
> On Tue, Jul 28, 2020 at 11:42 AM Konstantin Belousov
>  wrote:
> >
> > On Fri, Jul 24, 2020 at 05:34:05PM +, Conrad Meyer wrote:
> > > ...
> > > --- head/sys/kern/vfs_bio.c   Fri Jul 24 17:32:10 2020(r363481)
> > > +++ head/sys/kern/vfs_bio.c   Fri Jul 24 17:34:04 2020(r363482)
> > > @@ -3849,7 +3849,7 @@ getblkx(struct vnode *vp, daddr_t blkno, daddr_t 
> > > dblkn
> > > ...
> > > + /* Attempt lockless lookup first. */
> > > + bp = gbincore_unlocked(bo, blkno);
> > > + if (bp == NULL)
> > > + goto newbuf_unlocked;
> > > +
> > > + lockflags = LK_EXCLUSIVE | LK_SLEEPFAIL |
> > > + ((flags & GB_LOCK_NOWAIT) ? LK_NOWAIT : 0);
> > > +
> > > + error = BUF_TIMELOCK(bp, lockflags, NULL, "getblku", slpflag,
> > > + slptimeo);
> > I realized that this is not safe.  There is an ordering between buffer
> > types that defines which order buffer locks should obey.  For instance,
> > on UFS the critical order is inode buffer -> snaplk -> cg buffer, or
> > data block -> indirect data block.  Since buffer identity can change under
> > us, we might end up waiting for a lock of type that is incompatible with
> > the currently owned lock.
> >
> > I think the easiest fix is to use LK_NOWAIT always, after all it is lockless
> > path.  ERESTART/EINTR checks below than can be removed.
> 
> Thanks, that makes sense to me.  Please see 
> https://reviews.freebsd.org/D25898 .
> 
> (For the UFS scenario, I think this requires an on-disk sector
> changing identity from one kind to another?  I believe lblknos are
> mostly statically typed in UFS, but it could happen with data blocks
> and indirect blocks?  Of course, UFS is not the only filesystem.)
For UFS, it is enough for buffer to change its identity due to reclaim.
We do not pin buffers to device/block number for their lifetime.
So buffer might be freed and reassigned to different block under us.
___
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: r363482 - in head/sys: kern sys

2020-07-30 Thread Conrad Meyer
Hi Konstantin,

On Tue, Jul 28, 2020 at 11:42 AM Konstantin Belousov
 wrote:
>
> On Fri, Jul 24, 2020 at 05:34:05PM +, Conrad Meyer wrote:
> > ...
> > --- head/sys/kern/vfs_bio.c   Fri Jul 24 17:32:10 2020(r363481)
> > +++ head/sys/kern/vfs_bio.c   Fri Jul 24 17:34:04 2020(r363482)
> > @@ -3849,7 +3849,7 @@ getblkx(struct vnode *vp, daddr_t blkno, daddr_t dblkn
> > ...
> > + /* Attempt lockless lookup first. */
> > + bp = gbincore_unlocked(bo, blkno);
> > + if (bp == NULL)
> > + goto newbuf_unlocked;
> > +
> > + lockflags = LK_EXCLUSIVE | LK_SLEEPFAIL |
> > + ((flags & GB_LOCK_NOWAIT) ? LK_NOWAIT : 0);
> > +
> > + error = BUF_TIMELOCK(bp, lockflags, NULL, "getblku", slpflag,
> > + slptimeo);
> I realized that this is not safe.  There is an ordering between buffer
> types that defines which order buffer locks should obey.  For instance,
> on UFS the critical order is inode buffer -> snaplk -> cg buffer, or
> data block -> indirect data block.  Since buffer identity can change under
> us, we might end up waiting for a lock of type that is incompatible with
> the currently owned lock.
>
> I think the easiest fix is to use LK_NOWAIT always, after all it is lockless
> path.  ERESTART/EINTR checks below than can be removed.

Thanks, that makes sense to me.  Please see https://reviews.freebsd.org/D25898 .

(For the UFS scenario, I think this requires an on-disk sector
changing identity from one kind to another?  I believe lblknos are
mostly statically typed in UFS, but it could happen with data blocks
and indirect blocks?  Of course, UFS is not the only filesystem.)

Best regards,
Conrad
___
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: r363714 - head/sys/kern

2020-07-30 Thread Mateusz Guzik
Author: mjg
Date: Thu Jul 30 22:14:04 2020
New Revision: 363714
URL: https://svnweb.freebsd.org/changeset/base/363714

Log:
  Further depessimize priv_check_cred_vfs_generation

Modified:
  head/sys/kern/kern_priv.c

Modified: head/sys/kern/kern_priv.c
==
--- head/sys/kern/kern_priv.c   Thu Jul 30 22:13:15 2020(r363713)
+++ head/sys/kern/kern_priv.c   Thu Jul 30 22:14:04 2020(r363714)
@@ -247,8 +247,8 @@ priv_check(struct thread *td, int priv)
return (priv_check_cred(td->td_ucred, priv));
 }
 
-int
-priv_check_cred_vfs_generation(struct ucred *cred)
+static int __noinline
+priv_check_cred_vfs_generation_slow(struct ucred *cred)
 {
int error;
 
@@ -270,4 +270,19 @@ priv_check_cred_vfs_generation(struct ucred *cred)
 out:
return (priv_check_cred_post(cred, PRIV_VFS_GENERATION, error, true));
 
+}
+
+int
+priv_check_cred_vfs_generation(struct ucred *cred)
+{
+   int error;
+
+   if (__predict_false(mac_priv_check_fp_flag ||
+   mac_priv_grant_fp_flag || SDT_PROBES_ENABLED()))
+   return (priv_check_cred_vfs_generation_slow(cred));
+
+   error = EPERM;
+   if (!jailed(cred) && cred->cr_uid == 0 && suser_enabled)
+   error = 0;
+   return (error);
 }
___
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: r363713 - head/sys/sys

2020-07-30 Thread Mateusz Guzik
Author: mjg
Date: Thu Jul 30 22:13:15 2020
New Revision: 363713
URL: https://svnweb.freebsd.org/changeset/base/363713

Log:
  fd: predict in fdrop

Modified:
  head/sys/sys/file.h

Modified: head/sys/sys/file.h
==
--- head/sys/sys/file.h Thu Jul 30 19:11:01 2020(r363712)
+++ head/sys/sys/file.h Thu Jul 30 22:13:15 2020(r363713)
@@ -279,21 +279,22 @@ int fgetvp_read(struct thread *td, int fd, cap_rights_
 int fgetvp_write(struct thread *td, int fd, cap_rights_t *rightsp,
 struct vnode **vpp);
 
-static __inline int
-_fnoop(void)
-{
-
-   return (0);
-}
-
 static __inline __result_use_check bool
 fhold(struct file *fp)
 {
return (refcount_acquire_checked(>f_count));
 }
 
-#definefdrop(fp, td)   
\
-   (refcount_release(&(fp)->f_count) ? _fdrop((fp), (td)) : _fnoop())
+#definefdrop(fp, td)   ({  \
+   struct file *_fp;   \
+   int _error; \
+   \
+   _error = 0; \
+   _fp = (fp); \
+   if (__predict_false(refcount_release(&_fp->f_count)))   \
+   _error = _fdrop(_fp, td);   \
+   _error; \
+})
 
 static __inline fo_rdwr_t  fo_read;
 static __inline fo_rdwr_t  fo_write;
___
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: r363712 - in stable/12/sys: conf modules powerpc/conf

2020-07-30 Thread Eric Joyner
Author: erj
Date: Thu Jul 30 19:11:01 2020
New Revision: 363712
URL: https://svnweb.freebsd.org/changeset/base/363712

Log:
  MFC r358908: Enable ixl device on PowerPC64
  
  Relnotes: yes

Modified:
  stable/12/sys/conf/files.powerpc
  stable/12/sys/conf/options.powerpc
  stable/12/sys/modules/Makefile
  stable/12/sys/powerpc/conf/GENERIC64
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/conf/files.powerpc
==
--- stable/12/sys/conf/files.powerpcThu Jul 30 18:31:25 2020
(r363711)
+++ stable/12/sys/conf/files.powerpcThu Jul 30 19:11:01 2020
(r363712)
@@ -43,6 +43,43 @@ dev/iicbus/max6690.c optionalmax6690 powermac
 dev/iicbus/ofw_iicbus.coptionaliicbus aim
 dev/ipmi/ipmi.coptionalipmi
 dev/ipmi/ipmi_opal.c   optionalpowernv ipmi
+dev/ixl/if_ixl.c   optionalixl pci powerpc64 \
+   compile-with "${NORMAL_C} -I$S/dev/ixl"
+dev/ixl/ixl_pf_main.c  optionalixl pci powerpc64 \
+   compile-with "${NORMAL_C} -I$S/dev/ixl"
+dev/ixl/ixl_pf_qmgr.c  optionalixl pci powerpc64 \
+   compile-with "${NORMAL_C} -I$S/dev/ixl"
+dev/ixl/ixl_pf_iov.c   optionalixl pci pci_iov powerpc64 \
+   compile-with "${NORMAL_C} -I$S/dev/ixl"
+dev/ixl/ixl_pf_i2c.c   optionalixl pci powerpc64 \
+   compile-with "${NORMAL_C} -I$S/dev/ixl"
+dev/ixl/if_iavf.c  optionaliavf pci powerpc64 \
+   compile-with "${NORMAL_C} -I$S/dev/ixl"
+dev/ixl/iavf_vc.c  optionaliavf pci powerpc64 \
+   compile-with "${NORMAL_C} -I$S/dev/ixl"
+dev/ixl/ixl_txrx.c optionalixl pci powerpc64 | \
+   iavf pci powerpc64 \
+   compile-with "${NORMAL_C} -I$S/dev/ixl"
+dev/ixl/i40e_osdep.c   optionalixl pci powerpc64 | \
+   iavf pci powerpc64 \
+   compile-with "${NORMAL_C} -I$S/dev/ixl"
+dev/ixl/i40e_lan_hmc.c optionalixl pci powerpc64 | \
+   iavf pci powerpc64 \
+   compile-with "${NORMAL_C} -I$S/dev/ixl"
+dev/ixl/i40e_hmc.c optionalixl pci powerpc64 | \
+   iavf pci powerpc64 \
+   compile-with "${NORMAL_C} -I$S/dev/ixl"
+dev/ixl/i40e_common.c  optionalixl pci powerpc64 | \
+   iavf pci powerpc64 \
+   compile-with "${NORMAL_C} -I$S/dev/ixl"
+dev/ixl/i40e_nvm.c optionalixl pci powerpc64 | \
+   iavf pci powerpc64 \
+   compile-with "${NORMAL_C} -I$S/dev/ixl"
+dev/ixl/i40e_adminq.c  optionalixl pci powerpc64 | \
+   iavf pci powerpc64 \
+   compile-with "${NORMAL_C} -I$S/dev/ixl"
+dev/ixl/i40e_dcb.c optionalixl pci powerpc64 \
+   compile-with "${NORMAL_C} -I$S/dev/ixl"
 dev/nand/nfc_fsl.c optionalnand mpc85xx
 dev/nand/nfc_rb.c  optionalnand mpc85xx
 # Most ofw stuff below is brought in by conf/files for options FDT, but

Modified: stable/12/sys/conf/options.powerpc
==
--- stable/12/sys/conf/options.powerpc  Thu Jul 30 18:31:25 2020
(r363711)
+++ stable/12/sys/conf/options.powerpc  Thu Jul 30 19:11:01 2020
(r363712)
@@ -35,3 +35,6 @@ OFWCONS_POLL_HZ   opt_ofw.h
 AGP_DEBUG  opt_agp.h
 
 MIKROTIK
+
+# iWARP client interface support in ixl
+IXL_IW opt_ixl.h

Modified: stable/12/sys/modules/Makefile
==
--- stable/12/sys/modules/Makefile  Thu Jul 30 18:31:25 2020
(r363711)
+++ stable/12/sys/modules/Makefile  Thu Jul 30 19:11:01 2020
(r363712)
@@ -824,6 +824,8 @@ _wi=wi
 _drm2= drm2
 .endif
 _ipmi= ipmi
+_ixl=  ixl
+_nvram=opal_nvram
 .endif
 .if ${MACHINE_ARCH} == "powerpc64" || ${MACHINE_ARCH} == "powerpc"
 # Don't build powermac_nvram for powerpcspe, it's never supported.

Modified: stable/12/sys/powerpc/conf/GENERIC64
==
--- stable/12/sys/powerpc/conf/GENERIC64Thu Jul 30 18:31:25 2020
(r363711)
+++ stable/12/sys/powerpc/conf/GENERIC64Thu Jul 30 19:11:01 2020
(r363712)
@@ -146,6 +146,7 @@ device  iflib
 # Ethernet hardware
 device em  # Intel PRO/1000 Gigabit Ethernet Family
 device ix  # Intel PRO/10GbE PCIE PF Ethernet Family
+device ixl

Re: svn commit: r362063 - head/sys/dev/e1000

2020-07-30 Thread Eric Joyner
Done in r363711. I apologize for it taking so long.

On Fri, Jul 24, 2020 at 8:49 PM Yoshihiro Takahashi 
wrote:

> Please merge this change to stable/12 branch until a proper fix is
> done.
>
> ---
> Yoshihiro Takahashi 
>
> In article <202006111559.05bfxnsa070...@repo.freebsd.org>
> Eric Joyner  writes:
>
> > Author: erj
> > Date: Thu Jun 11 15:59:49 2020
> > New Revision: 362063
> > URL: https://svnweb.freebsd.org/changeset/base/362063
> >
> > Log:
> >   em(4): Always reinit interface when adding/removing VLAN
> >
> >   This partially reverts r361053 since there have been reports
> >   by users that this breaks some functionality for em(4)
> >   devices; it seems at first glance that some sort of interface
> >   restart is required for those cards.
> >
> >   This isn't a proper fix; this unbreaks those users until a proper
> >   fix is found for their issues.
> >
> >   PR: 240818
> >   Reported by:Marek Zarychta 
> >   MFC after:  3 days
> >
> > Modified:
> >   head/sys/dev/e1000/if_em.c
> >
> > Modified: head/sys/dev/e1000/if_em.c
> >
> ==
> > --- head/sys/dev/e1000/if_em.cThu Jun 11 15:17:13 2020
> (r362062)
> > +++ head/sys/dev/e1000/if_em.cThu Jun 11 15:59:49 2020
> (r362063)
> > @@ -4059,7 +4059,6 @@ em_if_needs_restart(if_ctx_t ctx __unused, enum
> iflib_
> >  {
> >   switch (event) {
> >   case IFLIB_RESTART_VLAN_CONFIG:
> > - return (false);
> >   default:
> >   return (true);
> >   }
>
___
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: r363711 - stable/12/sys/dev/e1000

2020-07-30 Thread Eric Joyner
Author: erj
Date: Thu Jul 30 18:31:25 2020
New Revision: 363711
URL: https://svnweb.freebsd.org/changeset/base/363711

Log:
  MFC r362063: em(4): Always reinit interface when adding/removing VLAN
  
  PR:   240818
  Sponsored by: Intel Corporation

Modified:
  stable/12/sys/dev/e1000/if_em.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/e1000/if_em.c
==
--- stable/12/sys/dev/e1000/if_em.c Thu Jul 30 17:43:23 2020
(r363710)
+++ stable/12/sys/dev/e1000/if_em.c Thu Jul 30 18:31:25 2020
(r363711)
@@ -4042,7 +4042,6 @@ em_if_needs_restart(if_ctx_t ctx __unused, enum iflib_
 {
switch (event) {
case IFLIB_RESTART_VLAN_CONFIG:
-   return (false);
default:
return (true);
}
___
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: r363710 - head/sys/netinet6

2020-07-30 Thread Mark Johnston
Author: markj
Date: Thu Jul 30 17:43:23 2020
New Revision: 363710
URL: https://svnweb.freebsd.org/changeset/base/363710

Log:
  ip6_output(): Check the return value of in6_getlinkifnet().
  
  If the destination address has an embedded scope ID, make sure that it
  corresponds to a valid ifnet before proceeding.  Otherwise a sendto()
  with a bogus link-local address can trigger a NULL pointer dereference.
  
  Reported by:  syzkaller
  Reviewed by:  ae
  Fixes:r358572
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D25887

Modified:
  head/sys/netinet6/ip6_output.c

Modified: head/sys/netinet6/ip6_output.c
==
--- head/sys/netinet6/ip6_output.c  Thu Jul 30 17:18:42 2020
(r363709)
+++ head/sys/netinet6/ip6_output.c  Thu Jul 30 17:43:23 2020
(r363710)
@@ -761,6 +761,10 @@ again:
IN6_IS_ADDR_MC_NODELOCAL(_sa.sin6_addr)) {
if (scopeid > 0) {
ifp = in6_getlinkifnet(scopeid);
+   if (ifp == NULL) {
+   error = EHOSTUNREACH;
+   goto bad;
+   }
*dst = dst_sa;  /* XXX */
goto nonh6lookup;
}
___
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: r363709 - stable/11/sys/kern

2020-07-30 Thread Brooks Davis
Author: brooks
Date: Thu Jul 30 17:18:42 2020
New Revision: 363709
URL: https://svnweb.freebsd.org/changeset/base/363709

Log:
  MFC r363438:
  
  Use SI_ORDER_(FOURTH|FIFTH) rather than bespoke versions.
  
  No functional change.
  
  When these SYSINITs were added these macros didn't exist.
  
  Reviewed by:  imp
  Obtained from:CheriBSD
  Sponsored by: DARPA
  Differential Revision:https://reviews.freebsd.org/D25758

Modified:
  stable/11/sys/kern/init_main.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/init_main.c
==
--- stable/11/sys/kern/init_main.c  Thu Jul 30 15:50:51 2020
(r363708)
+++ stable/11/sys/kern/init_main.c  Thu Jul 30 17:18:42 2020
(r363709)
@@ -370,18 +370,18 @@ SYSINIT(version, SI_SUB_COPYRIGHT, SI_ORDER_THIRD, pri
 #ifdef WITNESS
 static char wit_warn[] =
  "WARNING: WITNESS option enabled, expect reduced performance.\n";
-SYSINIT(witwarn, SI_SUB_COPYRIGHT, SI_ORDER_THIRD + 1,
+SYSINIT(witwarn, SI_SUB_COPYRIGHT, SI_ORDER_FOURTH,
print_caddr_t, wit_warn);
-SYSINIT(witwarn2, SI_SUB_LAST, SI_ORDER_THIRD + 1,
+SYSINIT(witwarn2, SI_SUB_LAST, SI_ORDER_FOURTH,
print_caddr_t, wit_warn);
 #endif
 
 #ifdef DIAGNOSTIC
 static char diag_warn[] =
  "WARNING: DIAGNOSTIC option enabled, expect reduced performance.\n";
-SYSINIT(diagwarn, SI_SUB_COPYRIGHT, SI_ORDER_THIRD + 2,
+SYSINIT(diagwarn, SI_SUB_COPYRIGHT, SI_ORDER_FIFTH,
 print_caddr_t, diag_warn);
-SYSINIT(diagwarn2, SI_SUB_LAST, SI_ORDER_THIRD + 2,
+SYSINIT(diagwarn2, SI_SUB_LAST, SI_ORDER_FIFTH,
 print_caddr_t, diag_warn);
 #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: r363091 - in head/contrib/bc: . include manuals src tests tests/bc

2020-07-30 Thread Ravi Pokala
-Original Message-
From:  on behalf of Stefan Eßer 

Date: 2020-07-30, Thursday at 09:55
To: Jessica Clarke , Ravi Pokala 
Cc: Baptiste Daroussin , Stefan Eßer , 
src-committers , , 

Subject: Re: svn commit: r363091 - in head/contrib/bc: . include manuals src 
tests tests/bc

Am 30.07.20 um 18:45 schrieb Jessica Clarke:
> On 30 Jul 2020, at 17:40, Ravi Pokala  wrote:
>>
>> -Original Message-
>> From:  on behalf of Jessica Clarke 

>> Date: 2020-07-30, Thursday at 09:35
>> To: Baptiste Daroussin 
>> Cc: Stefan Eßer , src-committers 
, , 

>> Subject: Re: svn commit: r363091 - in head/contrib/bc: . include manuals 
src tests tests/bc
>>
>>On 30 Jul 2020, at 17:31, Baptiste Daroussin  wrote:
>>> On Thu, Jul 30, 2020 at 05:28:19PM +0100, Jessica Clarke wrote:
 On 30 Jul 2020, at 17:20, Baptiste Daroussin  wrote:
> On Sat, Jul 11, 2020 at 07:33:19AM +, Stefan Eßer wrote:
>> Author: se
>> Date: Sat Jul 11 07:33:18 2020
>> New Revision: 363091
>> URL: https://svnweb.freebsd.org/changeset/base/363091
>>
>> Log:
>> Update to version 3.1.3
>>
> Jumping on that commit, since the switch from our previous bc.
>
> The output of the interactive bc has changed, the previous version 
had a clean
> UI, the new version "pollutes" the output with plenty of lines about 
the
> copyright:
>
> 
> Copyright (c) 2018-2020 Gavin D. Howard and contributors
> Report bugs at: https://git.yzena.com/gavin/bc
>
> This is free software with ABSOLUTELY NO WARRANTY.
> 
>
> Imagine if all programs where doing that, it would be painful, do you 
think
> upstream can be convinced to remove those lines?
>
> I no the GNU version also has the same polluted output which was one 
of the
> reason I was happy with out previous version of bc.

 By default both will print such a banner if and only if being called
 interactively. You can disable the banner explicitly with -q/--quiet
 for both GNU bc and this bc. I agree it's a bit noisy and would be
 nicer to not have that printed, but it's not without precedent for
 REPL-like things.
>>>
>>> Yes it is not without precedent for REPL-like things, still I dislike 
this and
>>> would be happy to get bc interactive be as nice as the previous one we 
had :)
>>>
>>> If not I will deal with it and just yell internally each time I run it 
:D
>>
>>`alias bc='bc -q'` / `alias bc bc -q` and preserve your inner zen? :)
>>
>>Jess
>>
>> I was actually about to complain about the new `dc' not exiting after 
evaluating a '-e' expression, without an explicit 'q'. But then I noticed the 
"DC_EXPR_EXIT" envvar, which restores the desired behavior. That lead me to 
discover "DC_ENV_ARGS" and, correspondingly, "BC_ENV_ARGS"; that last one would 
be helpful here.
> 
> That does feel like the wrong default; even GNU dc doesn't do that, and
> the principle of least surprise would suggest exiting is the right
> thing to do. It's also unlikely you want to evaluate something and then
> use it interactively.

Interesting observation - I've got to admit that I hardly ever use dc
(despite being the owner of a collection of HP UPN calculators ;-) ).

Ironically, I couldn't wrap my head around HP RPN calculators in the '90s, so I 
used a TI-85 or TI-89 instead. Now, I do all my non-trivial math using RPN in 
`dc'. :-)

-Ravi

I'll forward this to the author of this bc/dc and I'm sure he will
offer a patched version (unless there are strong reasons for the
current behavior, e.g. compatibility with another dc ...)

Regards, STefan


___
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: r363625 - stable/12/usr.sbin/mountd

2020-07-30 Thread Brooks Davis
On Thu, Jul 30, 2020 at 03:48:34PM +, Rick Macklem wrote:
> Rick Macklem wrote:
> >Ian Lepore wrote:
> >>On Thu, 2020-07-30 at 01:52 +, Rick Macklem wrote:
> >>> Brooks Davis wrote:
> >>> > Author: brooks
> >>> > Date: Mon Jul 27 23:18:14 2020
> >>> > New Revision: 363625
> >>> > URL: https://svnweb.freebsd.org/changeset/base/363625
> >>> >
> >>> > Log:
> >>> >  MFC r363439:
> >>> >
> >>> >  Correct a type-mismatch between xdr_long and the variable "bad".
> >>> >
> >>> > [...]
> >>> --> I can't see how the xdr.c code would work for a machine that is
> >>> BIG_ENDIAN and where "long" is 64bits, but we don't have any of
> >>> those.
> >>>
> >>
> >>mips64 and powerpc64 are both big endian with 64-bit long.
> >Oops, I didn't know that. In the past, I've run PowerPC and MIPS, but thought
> >they both were little endian. (I recall the arches can be run either way.)
> >
> >Anyhow, take a look at head/lib/libc/xdr/xdr.c and it looks to me like it
> >has been broken "forever" (ever since we stopped using a K compiler
> >that would have always made "long" 32bits).
> OK, I took another look at xdr.c and it isn't broken as I thought.
> 
> xdr_long() takes a "long *" argument ("long" in Sun XDR is 32bits),
> but then it only passes it as an argument to XDR_PUTLONG(), which is actually
> a call to xdrmem_putlong_aligned() or xdrmem_putlong_unaligned().
> For xdrmem_putlong_aligned(), the line is:
>*(u_int32_t *)xdrs->x_private = htonl((u_int32_t)*lp);
>   --> where lp is a "long *"
> 
> I'll admit I'm not 100% sure if "(u_int32_t)*lp" gets the correct 32bits of a 
> 64bit
> long pointer for all arches? (I'm not very good at knowing what type casts 
> do.)
> If this is the equivalent of "u_int32_t t; t = *lp; htonl(t); then I think 
> the code is ok?
> (At least it makes it clear that it is using 32bits of the value pointed to 
> by the
>  argument.)
> 
> For xdrmem_putlong_unaligned(), it does the same thing via:
> u_int32_t l;
> ?.
> l = htonl((u_int32_t)*lp);
> 
> --> At least the man page for xdr_long() should be clarified to note it
>   puts a 32bit quantity on the wire.
> 
> >If anyone has either of these and can set up an NFS server on one of
> >them and then try and do an NFSv3 mount that is not allowed, it would
> >be interesting to see the packet trace and if the MNT RPC fails, because
> >it looks like it will put the high order 32bits on the wire and they'll
> >always be 0?
> It would still be interesting to test this on a 64bit big endian, but so long 
> as
> the above cast works, it does look like it works for all arches.
> 
> >Just to clarify. The behaviour wasn't broken by this commit. I just
> >don't see how the commit fixes anything?
> My mistake. Sorry for the noise.
> 
> I now think the commit is correct since it uses "*lp" to get the value before
> casting it down to 32bits. Passing in an "int *" was incorrect.
> 
> The code does seem to handle "long *" for 64bit arches, although it
> only puts 32bits "on-the-wire".
> 
> rick, who was confused because he knew there was only supposed to be
> 32bits go on the wire.

Thank you for all the analysis.  I'd initially changed all the uses
of bad to use xdr_int(), but switched to this "fix" because it's what
NetBSD and OpenBSD have been using for over a decade (and there was
less churn).  I'm happy to flip it the other way if that seems more
correct/less confusing.

The previous code does in fact cause a 64-bit load of a pointer to an
int on 64-bit platforms.  I hit this in CheriBSD because that pointer
had 4-byte bounds.

-- Brooks


signature.asc
Description: PGP signature


Re: svn commit: r363091 - in head/contrib/bc: . include manuals src tests tests/bc

2020-07-30 Thread Stefan Eßer
Am 30.07.20 um 18:45 schrieb Jessica Clarke:
> On 30 Jul 2020, at 17:40, Ravi Pokala  wrote:
>>
>> -Original Message-
>> From:  on behalf of Jessica Clarke 
>> 
>> Date: 2020-07-30, Thursday at 09:35
>> To: Baptiste Daroussin 
>> Cc: Stefan Eßer , src-committers 
>> , , 
>> 
>> Subject: Re: svn commit: r363091 - in head/contrib/bc: . include manuals src 
>> tests tests/bc
>>
>>On 30 Jul 2020, at 17:31, Baptiste Daroussin  wrote:
>>> On Thu, Jul 30, 2020 at 05:28:19PM +0100, Jessica Clarke wrote:
 On 30 Jul 2020, at 17:20, Baptiste Daroussin  wrote:
> On Sat, Jul 11, 2020 at 07:33:19AM +, Stefan Eßer wrote:
>> Author: se
>> Date: Sat Jul 11 07:33:18 2020
>> New Revision: 363091
>> URL: https://svnweb.freebsd.org/changeset/base/363091
>>
>> Log:
>> Update to version 3.1.3
>>
> Jumping on that commit, since the switch from our previous bc.
>
> The output of the interactive bc has changed, the previous version had a 
> clean
> UI, the new version "pollutes" the output with plenty of lines about the
> copyright:
>
> 
> Copyright (c) 2018-2020 Gavin D. Howard and contributors
> Report bugs at: https://git.yzena.com/gavin/bc
>
> This is free software with ABSOLUTELY NO WARRANTY.
> 
>
> Imagine if all programs where doing that, it would be painful, do you 
> think
> upstream can be convinced to remove those lines?
>
> I no the GNU version also has the same polluted output which was one of 
> the
> reason I was happy with out previous version of bc.

 By default both will print such a banner if and only if being called
 interactively. You can disable the banner explicitly with -q/--quiet
 for both GNU bc and this bc. I agree it's a bit noisy and would be
 nicer to not have that printed, but it's not without precedent for
 REPL-like things.
>>>
>>> Yes it is not without precedent for REPL-like things, still I dislike this 
>>> and
>>> would be happy to get bc interactive be as nice as the previous one we had 
>>> :)
>>>
>>> If not I will deal with it and just yell internally each time I run it :D
>>
>>`alias bc='bc -q'` / `alias bc bc -q` and preserve your inner zen? :)
>>
>>Jess
>>
>> I was actually about to complain about the new `dc' not exiting after 
>> evaluating a '-e' expression, without an explicit 'q'. But then I noticed 
>> the "DC_EXPR_EXIT" envvar, which restores the desired behavior. That lead me 
>> to discover "DC_ENV_ARGS" and, correspondingly, "BC_ENV_ARGS"; that last one 
>> would be helpful here.
> 
> That does feel like the wrong default; even GNU dc doesn't do that, and
> the principle of least surprise would suggest exiting is the right
> thing to do. It's also unlikely you want to evaluate something and then
> use it interactively.

Interesting observation - I've got to admit that I hardly ever use dc
(despite being the owner of a collection of HP UPN calculators ;-) ).

I'll forward this to the author of this bc/dc and I'm sure he will
offer a patched version (unless there are strong reasons for the
current behavior, e.g. compatibility with another dc ...)

Regards, STefan
___
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: r363091 - in head/contrib/bc: . include manuals src tests tests/bc

2020-07-30 Thread Stefan Eßer
Am 30.07.20 um 18:31 schrieb Baptiste Daroussin:
> On Thu, Jul 30, 2020 at 05:28:19PM +0100, Jessica Clarke wrote:
>> On 30 Jul 2020, at 17:20, Baptiste Daroussin  wrote:
>>> On Sat, Jul 11, 2020 at 07:33:19AM +, Stefan Eßer wrote:
 Author: se
 Date: Sat Jul 11 07:33:18 2020
 New Revision: 363091
 URL: https://svnweb.freebsd.org/changeset/base/363091

 Log:
  Update to version 3.1.3

>>> Jumping on that commit, since the switch from our previous bc.
>>>
>>> The output of the interactive bc has changed, the previous version had a 
>>> clean
>>> UI, the new version "pollutes" the output with plenty of lines about the
>>> copyright:
>>>
>>> 
>>> Copyright (c) 2018-2020 Gavin D. Howard and contributors
>>> Report bugs at: https://git.yzena.com/gavin/bc
>>>
>>> This is free software with ABSOLUTELY NO WARRANTY.
>>> 
>>>
>>> Imagine if all programs where doing that, it would be painful, do you think
>>> upstream can be convinced to remove those lines?
>>>
>>> I no the GNU version also has the same polluted output which was one of the
>>> reason I was happy with out previous version of bc.
>>
>> By default both will print such a banner if and only if being called
>> interactively. You can disable the banner explicitly with -q/--quiet
>> for both GNU bc and this bc. I agree it's a bit noisy and would be
>> nicer to not have that printed, but it's not without precedent for
>> REPL-like things.
> 
> Yes it is not without precedent for REPL-like things, still I dislike this and
> would be happy to get bc interactive be as nice as the previous one we had :)
> 
> If not I will deal with it and just yell internally each time I run it :D

I'll forward this thread to the author - had already stated similar
thought to him for consideration.

Is very interested to prevent forks of his software - although not
forbidden by the license - but he wants to keep his sources as the
official and "clean" upstream for other projects.

My guess is that he'll add a compile time switch to his version
that will be added to our usr.bin Makefile and will suppress the
start-up message in our base system version. (I'll keep the port
version as is unless there is a strong preference to suppress it
also in the port).

I'd expect it to take a few days (since he only tags new versions
after running a fuzzer for a few days if non-trivial changes have
been performed and I know he improved something in the interpreter
without publishing it, yet) ...

Regards, STefan
___
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: r363091 - in head/contrib/bc: . include manuals src tests tests/bc

2020-07-30 Thread John Baldwin
On 7/30/20 9:31 AM, Baptiste Daroussin wrote:
> On Thu, Jul 30, 2020 at 05:28:19PM +0100, Jessica Clarke wrote:
>> On 30 Jul 2020, at 17:20, Baptiste Daroussin  wrote:
>>> On Sat, Jul 11, 2020 at 07:33:19AM +, Stefan Eßer wrote:
 Author: se
 Date: Sat Jul 11 07:33:18 2020
 New Revision: 363091
 URL: https://svnweb.freebsd.org/changeset/base/363091

 Log:
  Update to version 3.1.3

>>> Jumping on that commit, since the switch from our previous bc.
>>>
>>> The output of the interactive bc has changed, the previous version had a 
>>> clean
>>> UI, the new version "pollutes" the output with plenty of lines about the
>>> copyright:
>>>
>>> 
>>> Copyright (c) 2018-2020 Gavin D. Howard and contributors
>>> Report bugs at: https://git.yzena.com/gavin/bc
>>>
>>> This is free software with ABSOLUTELY NO WARRANTY.
>>> 
>>>
>>> Imagine if all programs where doing that, it would be painful, do you think
>>> upstream can be convinced to remove those lines?
>>>
>>> I no the GNU version also has the same polluted output which was one of the
>>> reason I was happy with out previous version of bc.
>>
>> By default both will print such a banner if and only if being called
>> interactively. You can disable the banner explicitly with -q/--quiet
>> for both GNU bc and this bc. I agree it's a bit noisy and would be
>> nicer to not have that printed, but it's not without precedent for
>> REPL-like things.
> 
> Yes it is not without precedent for REPL-like things, still I dislike this and
> would be happy to get bc interactive be as nice as the previous one we had :)
> 
> If not I will deal with it and just yell internally each time I run it :D

FWIW, I also consider this a regression relative to the previous bc.
I had gotten used to the lack of spam when invoking bc and it was the
first thing I noticed when the new one was imported, just hadn't sat
down and wrote an e-mail about it yet.

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


Re: svn commit: r363091 - in head/contrib/bc: . include manuals src tests tests/bc

2020-07-30 Thread Jessica Clarke
On 30 Jul 2020, at 17:40, Ravi Pokala  wrote:
> 
> -Original Message-
> From:  on behalf of Jessica Clarke 
> 
> Date: 2020-07-30, Thursday at 09:35
> To: Baptiste Daroussin 
> Cc: Stefan Eßer , src-committers 
> , , 
> 
> Subject: Re: svn commit: r363091 - in head/contrib/bc: . include manuals src 
> tests tests/bc
> 
>On 30 Jul 2020, at 17:31, Baptiste Daroussin  wrote:
>> On Thu, Jul 30, 2020 at 05:28:19PM +0100, Jessica Clarke wrote:
>>> On 30 Jul 2020, at 17:20, Baptiste Daroussin  wrote:
 On Sat, Jul 11, 2020 at 07:33:19AM +, Stefan Eßer wrote:
> Author: se
> Date: Sat Jul 11 07:33:18 2020
> New Revision: 363091
> URL: https://svnweb.freebsd.org/changeset/base/363091
> 
> Log:
> Update to version 3.1.3
> 
 Jumping on that commit, since the switch from our previous bc.
 
 The output of the interactive bc has changed, the previous version had a 
 clean
 UI, the new version "pollutes" the output with plenty of lines about the
 copyright:
 
 
 Copyright (c) 2018-2020 Gavin D. Howard and contributors
 Report bugs at: https://git.yzena.com/gavin/bc
 
 This is free software with ABSOLUTELY NO WARRANTY.
 
 
 Imagine if all programs where doing that, it would be painful, do you think
 upstream can be convinced to remove those lines?
 
 I no the GNU version also has the same polluted output which was one of the
 reason I was happy with out previous version of bc.
>>> 
>>> By default both will print such a banner if and only if being called
>>> interactively. You can disable the banner explicitly with -q/--quiet
>>> for both GNU bc and this bc. I agree it's a bit noisy and would be
>>> nicer to not have that printed, but it's not without precedent for
>>> REPL-like things.
>> 
>> Yes it is not without precedent for REPL-like things, still I dislike this 
>> and
>> would be happy to get bc interactive be as nice as the previous one we had :)
>> 
>> If not I will deal with it and just yell internally each time I run it :D
> 
>`alias bc='bc -q'` / `alias bc bc -q` and preserve your inner zen? :)
> 
>Jess
> 
> I was actually about to complain about the new `dc' not exiting after 
> evaluating a '-e' expression, without an explicit 'q'. But then I noticed the 
> "DC_EXPR_EXIT" envvar, which restores the desired behavior. That lead me to 
> discover "DC_ENV_ARGS" and, correspondingly, "BC_ENV_ARGS"; that last one 
> would be helpful here.

That does feel like the wrong default; even GNU dc doesn't do that, and
the principle of least surprise would suggest exiting is the right
thing to do. It's also unlikely you want to evaluate something and then
use it interactively.

Jess

___
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: r363091 - in head/contrib/bc: . include manuals src tests tests/bc

2020-07-30 Thread Ravi Pokala
-Original Message-
From:  on behalf of Jessica Clarke 

Date: 2020-07-30, Thursday at 09:35
To: Baptiste Daroussin 
Cc: Stefan Eßer , src-committers 
, , 

Subject: Re: svn commit: r363091 - in head/contrib/bc: . include manuals src 
tests tests/bc

On 30 Jul 2020, at 17:31, Baptiste Daroussin  wrote:
> On Thu, Jul 30, 2020 at 05:28:19PM +0100, Jessica Clarke wrote:
>> On 30 Jul 2020, at 17:20, Baptiste Daroussin  wrote:
>>> On Sat, Jul 11, 2020 at 07:33:19AM +, Stefan Eßer wrote:
 Author: se
 Date: Sat Jul 11 07:33:18 2020
 New Revision: 363091
 URL: https://svnweb.freebsd.org/changeset/base/363091
 
 Log:
 Update to version 3.1.3
 
>>> Jumping on that commit, since the switch from our previous bc.
>>> 
>>> The output of the interactive bc has changed, the previous version had 
a clean
>>> UI, the new version "pollutes" the output with plenty of lines about the
>>> copyright:
>>> 
>>> 
>>> Copyright (c) 2018-2020 Gavin D. Howard and contributors
>>> Report bugs at: https://git.yzena.com/gavin/bc
>>> 
>>> This is free software with ABSOLUTELY NO WARRANTY.
>>> 
>>> 
>>> Imagine if all programs where doing that, it would be painful, do you 
think
>>> upstream can be convinced to remove those lines?
>>> 
>>> I no the GNU version also has the same polluted output which was one of 
the
>>> reason I was happy with out previous version of bc.
>> 
>> By default both will print such a banner if and only if being called
>> interactively. You can disable the banner explicitly with -q/--quiet
>> for both GNU bc and this bc. I agree it's a bit noisy and would be
>> nicer to not have that printed, but it's not without precedent for
>> REPL-like things.
> 
> Yes it is not without precedent for REPL-like things, still I dislike 
this and
> would be happy to get bc interactive be as nice as the previous one we 
had :)
> 
> If not I will deal with it and just yell internally each time I run it :D

`alias bc='bc -q'` / `alias bc bc -q` and preserve your inner zen? :)

Jess

I was actually about to complain about the new `dc' not exiting after 
evaluating a '-e' expression, without an explicit 'q'. But then I noticed the 
"DC_EXPR_EXIT" envvar, which restores the desired behavior. That lead me to 
discover "DC_ENV_ARGS" and, correspondingly, "BC_ENV_ARGS"; that last one would 
be helpful here.

Thanks,

Ravi (rpokala@)


___
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: r363091 - in head/contrib/bc: . include manuals src tests tests/bc

2020-07-30 Thread Baptiste Daroussin
On Thu, Jul 30, 2020 at 05:35:20PM +0100, Jessica Clarke wrote:
> On 30 Jul 2020, at 17:31, Baptiste Daroussin  wrote:
> > On Thu, Jul 30, 2020 at 05:28:19PM +0100, Jessica Clarke wrote:
> >> On 30 Jul 2020, at 17:20, Baptiste Daroussin  wrote:
> >>> On Sat, Jul 11, 2020 at 07:33:19AM +, Stefan Eßer wrote:
>  Author: se
>  Date: Sat Jul 11 07:33:18 2020
>  New Revision: 363091
>  URL: https://svnweb.freebsd.org/changeset/base/363091
>  
>  Log:
>  Update to version 3.1.3
>  
> >>> Jumping on that commit, since the switch from our previous bc.
> >>> 
> >>> The output of the interactive bc has changed, the previous version had a 
> >>> clean
> >>> UI, the new version "pollutes" the output with plenty of lines about the
> >>> copyright:
> >>> 
> >>> 
> >>> Copyright (c) 2018-2020 Gavin D. Howard and contributors
> >>> Report bugs at: https://git.yzena.com/gavin/bc
> >>> 
> >>> This is free software with ABSOLUTELY NO WARRANTY.
> >>> 
> >>> 
> >>> Imagine if all programs where doing that, it would be painful, do you 
> >>> think
> >>> upstream can be convinced to remove those lines?
> >>> 
> >>> I no the GNU version also has the same polluted output which was one of 
> >>> the
> >>> reason I was happy with out previous version of bc.
> >> 
> >> By default both will print such a banner if and only if being called
> >> interactively. You can disable the banner explicitly with -q/--quiet
> >> for both GNU bc and this bc. I agree it's a bit noisy and would be
> >> nicer to not have that printed, but it's not without precedent for
> >> REPL-like things.
> > 
> > Yes it is not without precedent for REPL-like things, still I dislike this 
> > and
> > would be happy to get bc interactive be as nice as the previous one we had 
> > :)
> > 
> > If not I will deal with it and just yell internally each time I run it :D
> 
> `alias bc='bc -q'` / `alias bc bc -q` and preserve your inner zen? :)
> 
That was my actual plan but it was less fun to write :D

Bapt


signature.asc
Description: PGP signature


Re: svn commit: r363091 - in head/contrib/bc: . include manuals src tests tests/bc

2020-07-30 Thread Jessica Clarke
On 30 Jul 2020, at 17:31, Baptiste Daroussin  wrote:
> On Thu, Jul 30, 2020 at 05:28:19PM +0100, Jessica Clarke wrote:
>> On 30 Jul 2020, at 17:20, Baptiste Daroussin  wrote:
>>> On Sat, Jul 11, 2020 at 07:33:19AM +, Stefan Eßer wrote:
 Author: se
 Date: Sat Jul 11 07:33:18 2020
 New Revision: 363091
 URL: https://svnweb.freebsd.org/changeset/base/363091
 
 Log:
 Update to version 3.1.3
 
>>> Jumping on that commit, since the switch from our previous bc.
>>> 
>>> The output of the interactive bc has changed, the previous version had a 
>>> clean
>>> UI, the new version "pollutes" the output with plenty of lines about the
>>> copyright:
>>> 
>>> 
>>> Copyright (c) 2018-2020 Gavin D. Howard and contributors
>>> Report bugs at: https://git.yzena.com/gavin/bc
>>> 
>>> This is free software with ABSOLUTELY NO WARRANTY.
>>> 
>>> 
>>> Imagine if all programs where doing that, it would be painful, do you think
>>> upstream can be convinced to remove those lines?
>>> 
>>> I no the GNU version also has the same polluted output which was one of the
>>> reason I was happy with out previous version of bc.
>> 
>> By default both will print such a banner if and only if being called
>> interactively. You can disable the banner explicitly with -q/--quiet
>> for both GNU bc and this bc. I agree it's a bit noisy and would be
>> nicer to not have that printed, but it's not without precedent for
>> REPL-like things.
> 
> Yes it is not without precedent for REPL-like things, still I dislike this and
> would be happy to get bc interactive be as nice as the previous one we had :)
> 
> If not I will deal with it and just yell internally each time I run it :D

`alias bc='bc -q'` / `alias bc bc -q` and preserve your inner zen? :)

Jess

___
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: r363091 - in head/contrib/bc: . include manuals src tests tests/bc

2020-07-30 Thread Baptiste Daroussin
On Thu, Jul 30, 2020 at 05:28:19PM +0100, Jessica Clarke wrote:
> On 30 Jul 2020, at 17:20, Baptiste Daroussin  wrote:
> > On Sat, Jul 11, 2020 at 07:33:19AM +, Stefan Eßer wrote:
> >> Author: se
> >> Date: Sat Jul 11 07:33:18 2020
> >> New Revision: 363091
> >> URL: https://svnweb.freebsd.org/changeset/base/363091
> >> 
> >> Log:
> >>  Update to version 3.1.3
> >> 
> > Jumping on that commit, since the switch from our previous bc.
> > 
> > The output of the interactive bc has changed, the previous version had a 
> > clean
> > UI, the new version "pollutes" the output with plenty of lines about the
> > copyright:
> > 
> > 
> > Copyright (c) 2018-2020 Gavin D. Howard and contributors
> > Report bugs at: https://git.yzena.com/gavin/bc
> > 
> > This is free software with ABSOLUTELY NO WARRANTY.
> > 
> > 
> > Imagine if all programs where doing that, it would be painful, do you think
> > upstream can be convinced to remove those lines?
> > 
> > I no the GNU version also has the same polluted output which was one of the
> > reason I was happy with out previous version of bc.
> 
> By default both will print such a banner if and only if being called
> interactively. You can disable the banner explicitly with -q/--quiet
> for both GNU bc and this bc. I agree it's a bit noisy and would be
> nicer to not have that printed, but it's not without precedent for
> REPL-like things.

Yes it is not without precedent for REPL-like things, still I dislike this and
would be happy to get bc interactive be as nice as the previous one we had :)

If not I will deal with it and just yell internally each time I run it :D

Bapt


signature.asc
Description: PGP signature


Re: svn commit: r363091 - in head/contrib/bc: . include manuals src tests tests/bc

2020-07-30 Thread Jessica Clarke
On 30 Jul 2020, at 17:20, Baptiste Daroussin  wrote:
> On Sat, Jul 11, 2020 at 07:33:19AM +, Stefan Eßer wrote:
>> Author: se
>> Date: Sat Jul 11 07:33:18 2020
>> New Revision: 363091
>> URL: https://svnweb.freebsd.org/changeset/base/363091
>> 
>> Log:
>>  Update to version 3.1.3
>> 
> Jumping on that commit, since the switch from our previous bc.
> 
> The output of the interactive bc has changed, the previous version had a clean
> UI, the new version "pollutes" the output with plenty of lines about the
> copyright:
> 
> 
> Copyright (c) 2018-2020 Gavin D. Howard and contributors
> Report bugs at: https://git.yzena.com/gavin/bc
> 
> This is free software with ABSOLUTELY NO WARRANTY.
> 
> 
> Imagine if all programs where doing that, it would be painful, do you think
> upstream can be convinced to remove those lines?
> 
> I no the GNU version also has the same polluted output which was one of the
> reason I was happy with out previous version of bc.

By default both will print such a banner if and only if being called
interactively. You can disable the banner explicitly with -q/--quiet
for both GNU bc and this bc. I agree it's a bit noisy and would be
nicer to not have that printed, but it's not without precedent for
REPL-like things.

Jess

___
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: r363091 - in head/contrib/bc: . include manuals src tests tests/bc

2020-07-30 Thread Baptiste Daroussin
On Sat, Jul 11, 2020 at 07:33:19AM +, Stefan Eßer wrote:
> Author: se
> Date: Sat Jul 11 07:33:18 2020
> New Revision: 363091
> URL: https://svnweb.freebsd.org/changeset/base/363091
> 
> Log:
>   Update to version 3.1.3
>   
Jumping on that commit, since the switch from our previous bc.

The output of the interactive bc has changed, the previous version had a clean
UI, the new version "pollutes" the output with plenty of lines about the
copyright:


Copyright (c) 2018-2020 Gavin D. Howard and contributors
Report bugs at: https://git.yzena.com/gavin/bc

This is free software with ABSOLUTELY NO WARRANTY.


Imagine if all programs where doing that, it would be painful, do you think
upstream can be convinced to remove those lines?

I no the GNU version also has the same polluted output which was one of the
reason I was happy with out previous version of bc.

Best regards,
Bapt


signature.asc
Description: PGP signature


svn commit: r363708 - in head/sys: kern sys tools

2020-07-30 Thread Mateusz Guzik
Author: mjg
Date: Thu Jul 30 15:50:51 2020
New Revision: 363708
URL: https://svnweb.freebsd.org/changeset/base/363708

Log:
  vfs: inline vops if there are no pre/post associated calls
  
  This removes a level of indirection from frequently used methods, most notably
  VOP_LOCK1 and VOP_UNLOCK1.
  
  Tested by:pho

Modified:
  head/sys/kern/vfs_subr.c
  head/sys/kern/vnode_if.src
  head/sys/sys/vnode.h
  head/sys/tools/vnode_if.awk

Modified: head/sys/kern/vfs_subr.c
==
--- head/sys/kern/vfs_subr.cThu Jul 30 15:48:56 2020(r363707)
+++ head/sys/kern/vfs_subr.cThu Jul 30 15:50:51 2020(r363708)
@@ -5597,21 +5597,21 @@ vop_rename_pre(void *ap)
 
 #ifdef DEBUG_VFS_LOCKS
 void
-vop_fplookup_vexec_pre(void *ap __unused)
+vop_fplookup_vexec_debugpre(void *ap __unused)
 {
 
VFS_SMR_ASSERT_ENTERED();
 }
 
 void
-vop_fplookup_vexec_post(void *ap __unused, int rc __unused)
+vop_fplookup_vexec_debugpost(void *ap __unused, int rc __unused)
 {
 
VFS_SMR_ASSERT_ENTERED();
 }
 
 void
-vop_strategy_pre(void *ap)
+vop_strategy_debugpre(void *ap)
 {
struct vop_strategy_args *a;
struct buf *bp;
@@ -5635,7 +5635,7 @@ vop_strategy_pre(void *ap)
 }
 
 void
-vop_lock_pre(void *ap)
+vop_lock_debugpre(void *ap)
 {
struct vop_lock1_args *a = ap;
 
@@ -5646,7 +5646,7 @@ vop_lock_pre(void *ap)
 }
 
 void
-vop_lock_post(void *ap, int rc)
+vop_lock_debugpost(void *ap, int rc)
 {
struct vop_lock1_args *a = ap;
 
@@ -5656,7 +5656,7 @@ vop_lock_post(void *ap, int rc)
 }
 
 void
-vop_unlock_pre(void *ap)
+vop_unlock_debugpre(void *ap)
 {
struct vop_unlock_args *a = ap;
 
@@ -5664,7 +5664,7 @@ vop_unlock_pre(void *ap)
 }
 
 void
-vop_need_inactive_pre(void *ap)
+vop_need_inactive_debugpre(void *ap)
 {
struct vop_need_inactive_args *a = ap;
 
@@ -5672,7 +5672,7 @@ vop_need_inactive_pre(void *ap)
 }
 
 void
-vop_need_inactive_post(void *ap, int rc)
+vop_need_inactive_debugpost(void *ap, int rc)
 {
struct vop_need_inactive_args *a = ap;
 

Modified: head/sys/kern/vnode_if.src
==
--- head/sys/kern/vnode_if.src  Thu Jul 30 15:48:56 2020(r363707)
+++ head/sys/kern/vnode_if.src  Thu Jul 30 15:50:51 2020(r363708)
@@ -147,8 +147,8 @@ vop_close {
 
 
 %% fplookup_vexec  vp  - - -
-%! fplookup_vexec  pre vop_fplookup_vexec_pre
-%! fplookup_vexec  postvop_fplookup_vexec_post
+%! fplookup_vexec  debugprevop_fplookup_vexec_debugpre
+%! fplookup_vexec  debugpost   vop_fplookup_vexec_debugpost
 
 vop_fplookup_vexec {
IN struct vnode *vp;
@@ -379,8 +379,8 @@ vop_inactive {
IN struct thread *td;
 };
 
-%! need_inactive   pre vop_need_inactive_pre
-%! need_inactive   postvop_need_inactive_post
+%! need_inactive   debugprevop_need_inactive_debugpre
+%! need_inactive   debugpost   vop_need_inactive_debugpost
 
 vop_need_inactive {
 IN struct vnode *vp;
@@ -395,8 +395,8 @@ vop_reclaim {
 };
 
 
-%! lock1   pre vop_lock_pre
-%! lock1   postvop_lock_post
+%! lock1   debugprevop_lock_debugpre
+%! lock1   debugpost   vop_lock_debugpost
 
 vop_lock1 {
IN struct vnode *vp;
@@ -406,7 +406,7 @@ vop_lock1 {
 };
 
 
-%! unlock  pre vop_unlock_pre
+%! unlock  debugprevop_unlock_debugpre
 
 vop_unlock {
IN struct vnode *vp;
@@ -426,7 +426,7 @@ vop_bmap {
 
 
 %% strategyvp  L L L
-%! strategypre vop_strategy_pre
+%! strategydebugprevop_strategy_debugpre
 
 vop_strategy {
IN struct vnode *vp;

Modified: head/sys/sys/vnode.h
==
--- head/sys/sys/vnode.hThu Jul 30 15:48:56 2020(r363707)
+++ head/sys/sys/vnode.hThu Jul 30 15:50:51 2020(r363708)
@@ -869,23 +869,23 @@ void  vop_symlink_post(void *a, int rc);
 intvop_sigdefer(struct vop_vector *vop, struct vop_generic_args *a);
 
 #ifdef DEBUG_VFS_LOCKS
-void   vop_fplookup_vexec_pre(void *a);
-void   vop_fplookup_vexec_post(void *a, int rc);
-void   vop_strategy_pre(void *a);
-void   vop_lock_pre(void *a);
-void   vop_lock_post(void *a, int rc);
-void   vop_unlock_pre(void *a);
-void   vop_need_inactive_pre(void *a);
-void   vop_need_inactive_post(void *a, int rc);
+void   vop_fplookup_vexec_debugpre(void *a);
+void   vop_fplookup_vexec_debugpost(void *a, int rc);
+void   vop_strategy_debugpre(void *a);
+void   vop_lock_debugpre(void *a);
+void   vop_lock_debugpost(void *a, int rc);
+void   vop_unlock_debugpre(void *a);
+void   vop_need_inactive_debugpre(void *a);
+void   vop_need_inactive_debugpost(void *a, int rc);
 #else
-#definevop_fplookup_vexec_pre(x)   do { } while (0)
-#definevop_fplookup_vexec_post(x, y)   do { } 

svn commit: r363707 - head/sys/kern

2020-07-30 Thread Mateusz Guzik
Author: mjg
Date: Thu Jul 30 15:48:56 2020
New Revision: 363707
URL: https://svnweb.freebsd.org/changeset/base/363707

Log:
  vfs: fold poll_no_poll into vop_nopoll
  
  The logic was almost completely present in vop_stdpoll anyway.

Modified:
  head/sys/kern/vfs_default.c

Modified: head/sys/kern/vfs_default.c
==
--- head/sys/kern/vfs_default.c Thu Jul 30 15:47:41 2020(r363706)
+++ head/sys/kern/vfs_default.c Thu Jul 30 15:48:56 2020(r363707)
@@ -616,7 +616,9 @@ vop_nopoll(ap)
} */ *ap;
 {
 
-   return (poll_no_poll(ap->a_events));
+   if (ap->a_events & ~POLLSTANDARD)
+   return (POLLNVAL);
+   return (ap->a_events & (POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM));
 }
 
 /*
___
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: r363625 - stable/12/usr.sbin/mountd

2020-07-30 Thread Rick Macklem
Rick Macklem wrote:
>Ian Lepore wrote:
>>On Thu, 2020-07-30 at 01:52 +, Rick Macklem wrote:
>>> Brooks Davis wrote:
>>> > Author: brooks
>>> > Date: Mon Jul 27 23:18:14 2020
>>> > New Revision: 363625
>>> > URL: https://svnweb.freebsd.org/changeset/base/363625
>>> >
>>> > Log:
>>> >  MFC r363439:
>>> >
>>> >  Correct a type-mismatch between xdr_long and the variable "bad".
>>> >
>>> > [...]
>>> --> I can't see how the xdr.c code would work for a machine that is
>>> BIG_ENDIAN and where "long" is 64bits, but we don't have any of
>>> those.
>>>
>>
>>mips64 and powerpc64 are both big endian with 64-bit long.
>Oops, I didn't know that. In the past, I've run PowerPC and MIPS, but thought
>they both were little endian. (I recall the arches can be run either way.)
>
>Anyhow, take a look at head/lib/libc/xdr/xdr.c and it looks to me like it
>has been broken "forever" (ever since we stopped using a K compiler
>that would have always made "long" 32bits).
OK, I took another look at xdr.c and it isn't broken as I thought.

xdr_long() takes a "long *" argument ("long" in Sun XDR is 32bits),
but then it only passes it as an argument to XDR_PUTLONG(), which is actually
a call to xdrmem_putlong_aligned() or xdrmem_putlong_unaligned().
For xdrmem_putlong_aligned(), the line is:
   *(u_int32_t *)xdrs->x_private = htonl((u_int32_t)*lp);
  --> where lp is a "long *"

I'll admit I'm not 100% sure if "(u_int32_t)*lp" gets the correct 32bits of a 
64bit
long pointer for all arches? (I'm not very good at knowing what type casts do.)
If this is the equivalent of "u_int32_t t; t = *lp; htonl(t); then I think the 
code is ok?
(At least it makes it clear that it is using 32bits of the value pointed to by 
the
 argument.)

For xdrmem_putlong_unaligned(), it does the same thing via:
u_int32_t l;
….
l = htonl((u_int32_t)*lp);

--> At least the man page for xdr_long() should be clarified to note it
  puts a 32bit quantity on the wire.

>If anyone has either of these and can set up an NFS server on one of
>them and then try and do an NFSv3 mount that is not allowed, it would
>be interesting to see the packet trace and if the MNT RPC fails, because
>it looks like it will put the high order 32bits on the wire and they'll
>always be 0?
It would still be interesting to test this on a 64bit big endian, but so long as
the above cast works, it does look like it works for all arches.

>Just to clarify. The behaviour wasn't broken by this commit. I just
>don't see how the commit fixes anything?
My mistake. Sorry for the noise.

I now think the commit is correct since it uses "*lp" to get the value before
casting it down to 32bits. Passing in an "int *" was incorrect.

The code does seem to handle "long *" for 64bit arches, although it
only puts 32bits "on-the-wire".

rick, who was confused because he knew there was only supposed to be
32bits go on the wire.

-- 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"


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

2020-07-30 Thread Mateusz Guzik
Author: mjg
Date: Thu Jul 30 15:47:41 2020
New Revision: 363706
URL: https://svnweb.freebsd.org/changeset/base/363706

Log:
  vfs: short-circuit the common case NDFREE calls
  
  Almost all consumers use the NDF_ONLY_PNBUF macro, making them avoidably 
branch
  a lot in the NDFREE routine. Also note most of them should not need to call
  any cleanup anyway as they don't request HASBUF.

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

Modified: head/sys/kern/vfs_lookup.c
==
--- head/sys/kern/vfs_lookup.c  Thu Jul 30 15:45:11 2020(r363705)
+++ head/sys/kern/vfs_lookup.c  Thu Jul 30 15:47:41 2020(r363706)
@@ -1390,18 +1390,26 @@ NDINIT_ALL(struct nameidata *ndp, u_long op, u_long fl
  * Free data allocated by namei(); see namei(9) for details.
  */
 void
-NDFREE(struct nameidata *ndp, const u_int flags)
+NDFREE_PNBUF(struct nameidata *ndp)
 {
+
+   if ((ndp->ni_cnd.cn_flags & HASBUF) != 0) {
+   uma_zfree(namei_zone, ndp->ni_cnd.cn_pnbuf);
+   ndp->ni_cnd.cn_flags &= ~HASBUF;
+   }
+}
+
+void
+(NDFREE)(struct nameidata *ndp, const u_int flags)
+{
int unlock_dvp;
int unlock_vp;
 
unlock_dvp = 0;
unlock_vp = 0;
 
-   if (!(flags & NDF_NO_FREE_PNBUF) &&
-   (ndp->ni_cnd.cn_flags & HASBUF)) {
-   uma_zfree(namei_zone, ndp->ni_cnd.cn_pnbuf);
-   ndp->ni_cnd.cn_flags &= ~HASBUF;
+   if (!(flags & NDF_NO_FREE_PNBUF)) {
+   NDFREE_PNBUF(ndp);
}
if (!(flags & NDF_NO_VP_UNLOCK) &&
(ndp->ni_cnd.cn_flags & LOCKLEAF) && ndp->ni_vp)

Modified: head/sys/sys/namei.h
==
--- head/sys/sys/namei.hThu Jul 30 15:45:11 2020(r363705)
+++ head/sys/sys/namei.hThu Jul 30 15:47:41 2020(r363706)
@@ -210,7 +210,15 @@ void NDINIT_ALL(struct nameidata *ndp, u_long op, u_lo
 #define NDF_NO_FREE_PNBUF  0x0020
 #define NDF_ONLY_PNBUF (~NDF_NO_FREE_PNBUF)
 
+void NDFREE_PNBUF(struct nameidata *);
 void NDFREE(struct nameidata *, const u_int);
+#define NDFREE(ndp, flags) do {
\
+   struct nameidata *_ndp = (ndp); \
+   if (__builtin_constant_p(flags) && flags == NDF_ONLY_PNBUF) \
+   NDFREE_PNBUF(_ndp); \
+   else\
+   NDFREE(_ndp, flags);\
+} while (0)
 
 intnamei(struct nameidata *ndp);
 intlookup(struct nameidata *ndp);
___
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: r363705 - head/sys/kern

2020-07-30 Thread Mateusz Guzik
Author: mjg
Date: Thu Jul 30 15:45:11 2020
New Revision: 363705
URL: https://svnweb.freebsd.org/changeset/base/363705

Log:
  vfs: add support for WANTPARENT and LOCKPARENT to lockless lookup
  
  This makes the realpath syscall operational with the new lookup. Note that the
  walk to obtain the full path name still takes locks.
  
  Tested by:  pho
  Differential Revision:https://reviews.freebsd.org/D23917

Modified:
  head/sys/kern/vfs_cache.c

Modified: head/sys/kern/vfs_cache.c
==
--- head/sys/kern/vfs_cache.c   Thu Jul 30 15:44:10 2020(r363704)
+++ head/sys/kern/vfs_cache.c   Thu Jul 30 15:45:11 2020(r363705)
@@ -3011,8 +3011,8 @@ cache_fpl_handled_impl(struct cache_fpl *fpl, int erro
 #define cache_fpl_handled(x, e)cache_fpl_handled_impl((x), (e), 
__LINE__)
 
 #define CACHE_FPL_SUPPORTED_CN_FLAGS \
-   (LOCKLEAF | FOLLOW | LOCKSHARED | SAVENAME | ISOPEN | NOMACCHECK | \
-AUDITVNODE1 | AUDITVNODE2)
+   (LOCKLEAF | LOCKPARENT | WANTPARENT | FOLLOW | LOCKSHARED | SAVENAME | \
+ISOPEN | NOMACCHECK | AUDITVNODE1 | AUDITVNODE2)
 
 static bool
 cache_can_fplookup(struct cache_fpl *fpl)
@@ -3208,10 +3208,42 @@ cache_fplookup_partial_setup(struct cache_fpl *fpl)
 }
 
 static int
-cache_fplookup_final(struct cache_fpl *fpl)
+cache_fplookup_final_child(struct cache_fpl *fpl, enum vgetstate tvs)
 {
struct componentname *cnp;
-   enum vgetstate tvs;
+   struct vnode *tvp;
+   seqc_t tvp_seqc;
+   int error;
+
+   cnp = fpl->cnp;
+   tvp = fpl->tvp;
+   tvp_seqc = fpl->tvp_seqc;
+
+   if ((cnp->cn_flags & LOCKLEAF) != 0) {
+   error = vget_finish(tvp, cnp->cn_lkflags, tvs);
+   if (error != 0) {
+   return (cache_fpl_aborted(fpl));
+   }
+   } else {
+   vget_finish_ref(tvp, tvs);
+   }
+
+   if (!vn_seqc_consistent(tvp, tvp_seqc)) {
+   if ((cnp->cn_flags & LOCKLEAF) != 0)
+   vput(tvp);
+   else
+   vrele(tvp);
+   return (cache_fpl_aborted(fpl));
+   }
+
+   return (cache_fpl_handled(fpl, 0));
+}
+
+static int __noinline
+cache_fplookup_final_withparent(struct cache_fpl *fpl)
+{
+   enum vgetstate dvs, tvs;
+   struct componentname *cnp;
struct vnode *dvp, *tvp;
seqc_t dvp_seqc, tvp_seqc;
int error;
@@ -3222,39 +3254,90 @@ cache_fplookup_final(struct cache_fpl *fpl)
tvp = fpl->tvp;
tvp_seqc = fpl->tvp_seqc;
 
-   VNPASS(cache_fplookup_vnode_supported(dvp), dvp);
+   MPASS((cnp->cn_flags & (LOCKPARENT|WANTPARENT)) != 0);
 
+   /*
+* This is less efficient than it can be for simplicity.
+*/
+   dvs = vget_prep_smr(dvp);
+   if (dvs == VGET_NONE) {
+   return (cache_fpl_aborted(fpl));
+   }
tvs = vget_prep_smr(tvp);
if (tvs == VGET_NONE) {
-   return (cache_fpl_partial(fpl));
-   }
-
-   if (!vn_seqc_consistent(dvp, dvp_seqc)) {
cache_fpl_smr_exit(fpl);
-   vget_abort(tvp, tvs);
+   vget_abort(dvp, dvs);
return (cache_fpl_aborted(fpl));
}
 
cache_fpl_smr_exit(fpl);
 
-   if ((cnp->cn_flags & LOCKLEAF) != 0) {
-   error = vget_finish(tvp, cnp->cn_lkflags, tvs);
+   if ((cnp->cn_flags & LOCKPARENT) != 0) {
+   error = vget_finish(dvp, LK_EXCLUSIVE, dvs);
if (error != 0) {
+   vget_abort(tvp, tvs);
return (cache_fpl_aborted(fpl));
}
} else {
-   vget_finish_ref(tvp, tvs);
+   vget_finish_ref(dvp, dvs);
}
 
-   if (!vn_seqc_consistent(tvp, tvp_seqc)) {
-   if ((cnp->cn_flags & LOCKLEAF) != 0)
-   vput(tvp);
+   if (!vn_seqc_consistent(dvp, dvp_seqc)) {
+   vget_abort(tvp, tvs);
+   if ((cnp->cn_flags & LOCKPARENT) != 0)
+   vput(dvp);
else
-   vrele(tvp);
+   vrele(dvp);
+   cache_fpl_aborted(fpl);
+   return (error);
+   }
+
+   error = cache_fplookup_final_child(fpl, tvs);
+   if (error != 0) {
+   MPASS(fpl->status == CACHE_FPL_STATUS_ABORTED);
+   if ((cnp->cn_flags & LOCKPARENT) != 0)
+   vput(dvp);
+   else
+   vrele(dvp);
+   return (error);
+   }
+
+   MPASS(fpl->status == CACHE_FPL_STATUS_HANDLED);
+   return (0);
+}
+
+static int
+cache_fplookup_final(struct cache_fpl *fpl)
+{
+   struct componentname *cnp;
+   enum vgetstate tvs;
+   struct vnode *dvp, *tvp;
+   seqc_t dvp_seqc, tvp_seqc;
+
+   cnp = fpl->cnp;
+   dvp = 

svn commit: r363704 - head/sys/kern

2020-07-30 Thread Mateusz Guzik
Author: mjg
Date: Thu Jul 30 15:44:10 2020
New Revision: 363704
URL: https://svnweb.freebsd.org/changeset/base/363704

Log:
  vfs: support negative entry promotion in lockless lookup
  
  Tested by:pho

Modified:
  head/sys/kern/vfs_cache.c

Modified: head/sys/kern/vfs_cache.c
==
--- head/sys/kern/vfs_cache.c   Thu Jul 30 15:43:16 2020(r363703)
+++ head/sys/kern/vfs_cache.c   Thu Jul 30 15:44:10 2020(r363704)
@@ -807,6 +807,15 @@ cache_negative_remove(struct namecache *ncp)
} else {
list_locked = true;
mtx_lock(>nl_lock);
+   /*
+* We may be racing against promotion in lockless lookup.
+*/
+   if ((negstate->neg_flag & NEG_HOT) != 0) {
+   mtx_unlock(>nl_lock);
+   hot_locked = true;
+   mtx_lock(_hot.nl_lock);
+   mtx_lock(>nl_lock);
+   }
}
if ((negstate->neg_flag & NEG_HOT) != 0) {
mtx_assert(_hot.nl_lock, MA_OWNED);
@@ -3061,6 +3070,103 @@ cache_fplookup_vnode_supported(struct vnode *vp)
 }
 
 /*
+ * Move a negative entry to the hot list.
+ *
+ * We have to take locks, but they may be contended and in the worst
+ * case we may need to go off CPU. We don't want to spin within the
+ * smr section and we can't block with it. Instead we are going to
+ * look up the entry again.
+ */
+static int __noinline
+cache_fplookup_negative_promote(struct cache_fpl *fpl, struct namecache *oncp,
+uint32_t hash)
+{
+   struct componentname *cnp;
+   struct namecache *ncp;
+   struct neglist *neglist;
+   struct negstate *negstate;
+   struct vnode *dvp;
+   u_char nc_flag;
+
+   cnp = fpl->cnp;
+   dvp = fpl->dvp;
+
+   if (!vhold_smr(dvp))
+   return (cache_fpl_aborted(fpl));
+
+   neglist = NCP2NEGLIST(oncp);
+   cache_fpl_smr_exit(fpl);
+
+   mtx_lock(_hot.nl_lock);
+   mtx_lock(>nl_lock);
+   /*
+* For hash iteration.
+*/
+   cache_fpl_smr_enter(fpl);
+
+   /*
+* Avoid all surprises by only succeeding if we got the same entry and
+* bailing completely otherwise.
+*
+* In particular at this point there can be a new ncp which matches the
+* search but hashes to a different neglist.
+*/
+   CK_LIST_FOREACH(ncp, (NCHHASH(hash)), nc_hash) {
+   if (ncp == oncp)
+   break;
+   }
+
+   /*
+* No match to begin with.
+*/
+   if (__predict_false(ncp == NULL)) {
+   goto out_abort;
+   }
+
+   /*
+* The newly found entry may be something different...
+*/
+   if (!(ncp->nc_dvp == dvp && ncp->nc_nlen == cnp->cn_namelen &&
+   !bcmp(ncp->nc_name, cnp->cn_nameptr, ncp->nc_nlen))) {
+   goto out_abort;
+   }
+
+   /*
+* ... and not even negative.
+*/
+   nc_flag = atomic_load_char(>nc_flag);
+   if ((nc_flag & NCF_NEGATIVE) == 0) {
+   goto out_abort;
+   }
+
+   if (__predict_false(cache_ncp_invalid(ncp))) {
+   goto out_abort;
+   }
+
+   negstate = NCP2NEGSTATE(ncp);
+   if ((negstate->neg_flag & NEG_HOT) == 0) {
+   numhotneg++;
+   TAILQ_REMOVE(>nl_list, ncp, nc_dst);
+   TAILQ_INSERT_TAIL(_hot.nl_list, ncp, nc_dst);
+   negstate->neg_flag |= NEG_HOT;
+   }
+
+   SDT_PROBE2(vfs, namecache, lookup, hit__negative, dvp, ncp->nc_name);
+   counter_u64_add(numneghits, 1);
+   cache_fpl_smr_exit(fpl);
+   mtx_unlock(>nl_lock);
+   mtx_unlock(_hot.nl_lock);
+   vdrop(dvp);
+   return (cache_fpl_handled(fpl, ENOENT));
+out_abort:
+   cache_fpl_smr_exit(fpl);
+   mtx_unlock(>nl_lock);
+   mtx_unlock(_hot.nl_lock);
+   vdrop(dvp);
+   return (cache_fpl_aborted(fpl));
+}
+
+/*
  * The target vnode is not supported, prepare for the slow path to take over.
  */
 static int
@@ -3204,12 +3310,7 @@ cache_fplookup_next(struct cache_fpl *fpl)
return (cache_fpl_partial(fpl));
}
if (!neg_hot) {
-   /*
-* TODO
-* Promoting to hot negative requires locks, thus is
-* left not yet supported for simplicity.
-*/
-   return (cache_fpl_partial(fpl));
+   return (cache_fplookup_negative_promote(fpl, ncp, 
hash));
}
SDT_PROBE2(vfs, namecache, lookup, hit__negative, dvp,
ncp->nc_name);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any 

svn commit: r363703 - head/sys/kern

2020-07-30 Thread Mateusz Guzik
Author: mjg
Date: Thu Jul 30 15:43:16 2020
New Revision: 363703
URL: https://svnweb.freebsd.org/changeset/base/363703

Log:
  vfs: add NOMACCHECK and AUDITVNODE2 to lockless lookup
  
  They are both nops since lookup does not progress with either mac or audit 
enabled.
  
  Tested by:pho

Modified:
  head/sys/kern/vfs_cache.c

Modified: head/sys/kern/vfs_cache.c
==
--- head/sys/kern/vfs_cache.c   Thu Jul 30 14:50:43 2020(r363702)
+++ head/sys/kern/vfs_cache.c   Thu Jul 30 15:43:16 2020(r363703)
@@ -3002,7 +3002,8 @@ cache_fpl_handled_impl(struct cache_fpl *fpl, int erro
 #define cache_fpl_handled(x, e)cache_fpl_handled_impl((x), (e), 
__LINE__)
 
 #define CACHE_FPL_SUPPORTED_CN_FLAGS \
-   (LOCKLEAF | FOLLOW | LOCKSHARED | SAVENAME | ISOPEN | AUDITVNODE1)
+   (LOCKLEAF | FOLLOW | LOCKSHARED | SAVENAME | ISOPEN | NOMACCHECK | \
+AUDITVNODE1 | AUDITVNODE2)
 
 static bool
 cache_can_fplookup(struct cache_fpl *fpl)
___
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: r363702 - stable/11/sys/fs/cuse

2020-07-30 Thread Mark Johnston
Author: markj
Date: Thu Jul 30 14:50:43 2020
New Revision: 363702
URL: https://svnweb.freebsd.org/changeset/base/363702

Log:
  MFC r363446:
  cuse: Stop checking for failures from malloc(M_WAITOK).

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

Modified: stable/11/sys/fs/cuse/cuse.c
==
--- stable/11/sys/fs/cuse/cuse.cThu Jul 30 14:48:48 2020
(r363701)
+++ stable/11/sys/fs/cuse/cuse.cThu Jul 30 14:50:43 2020
(r363702)
@@ -427,8 +427,6 @@ cuse_server_alloc_memory(struct cuse_server *pcs, uint
int error;
 
mem = malloc(sizeof(*mem), M_CUSE, M_WAITOK | M_ZERO);
-   if (mem == NULL)
-   return (ENOMEM);
 
object = vm_pager_allocate(OBJT_SWAP, NULL, PAGE_SIZE * page_count,
VM_PROT_DEFAULT, 0, curthread->td_ucred);
@@ -750,8 +748,6 @@ cuse_server_open(struct cdev *dev, int fflags, int dev
struct cuse_server *pcs;
 
pcs = malloc(sizeof(*pcs), M_CUSE, M_WAITOK | M_ZERO);
-   if (pcs == NULL)
-   return (ENOMEM);
 
if (devfs_set_cdevpriv(pcs, _server_free)) {
printf("Cuse: Cannot set cdevpriv.\n");
@@ -1219,10 +1215,6 @@ cuse_server_ioctl(struct cdev *dev, unsigned long cmd,
 
pcsd = malloc(sizeof(*pcsd), M_CUSE, M_WAITOK | M_ZERO);
 
-   if (pcsd == NULL) {
-   error = ENOMEM;
-   break;
-   }
pcsd->server = pcs;
 
pcsd->user_dev = pcd->dev;
@@ -1432,11 +1424,6 @@ cuse_client_open(struct cdev *dev, int fflags, int dev
}
 
pcc = malloc(sizeof(*pcc), M_CUSE, M_WAITOK | M_ZERO);
-   if (pcc == NULL) {
-   /* drop reference on server */
-   cuse_server_unref(pcs);
-   return (ENOMEM);
-   }
if (devfs_set_cdevpriv(pcc, _client_free)) {
printf("Cuse: Cannot set cdevpriv.\n");
/* drop reference on server */
___
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: r363701 - stable/12/sys/fs/cuse

2020-07-30 Thread Mark Johnston
Author: markj
Date: Thu Jul 30 14:48:48 2020
New Revision: 363701
URL: https://svnweb.freebsd.org/changeset/base/363701

Log:
  MFC r363446:
  cuse: Stop checking for failures from malloc(M_WAITOK).

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

Modified: stable/12/sys/fs/cuse/cuse.c
==
--- stable/12/sys/fs/cuse/cuse.cThu Jul 30 14:45:05 2020
(r363700)
+++ stable/12/sys/fs/cuse/cuse.cThu Jul 30 14:48:48 2020
(r363701)
@@ -425,8 +425,6 @@ cuse_server_alloc_memory(struct cuse_server *pcs, uint
int error;
 
mem = malloc(sizeof(*mem), M_CUSE, M_WAITOK | M_ZERO);
-   if (mem == NULL)
-   return (ENOMEM);
 
object = vm_pager_allocate(OBJT_SWAP, NULL, PAGE_SIZE * page_count,
VM_PROT_DEFAULT, 0, curthread->td_ucred);
@@ -748,8 +746,6 @@ cuse_server_open(struct cdev *dev, int fflags, int dev
struct cuse_server *pcs;
 
pcs = malloc(sizeof(*pcs), M_CUSE, M_WAITOK | M_ZERO);
-   if (pcs == NULL)
-   return (ENOMEM);
 
if (devfs_set_cdevpriv(pcs, _server_free)) {
printf("Cuse: Cannot set cdevpriv.\n");
@@ -1217,10 +1213,6 @@ cuse_server_ioctl(struct cdev *dev, unsigned long cmd,
 
pcsd = malloc(sizeof(*pcsd), M_CUSE, M_WAITOK | M_ZERO);
 
-   if (pcsd == NULL) {
-   error = ENOMEM;
-   break;
-   }
pcsd->server = pcs;
 
pcsd->user_dev = pcd->dev;
@@ -1430,11 +1422,6 @@ cuse_client_open(struct cdev *dev, int fflags, int dev
}
 
pcc = malloc(sizeof(*pcc), M_CUSE, M_WAITOK | M_ZERO);
-   if (pcc == NULL) {
-   /* drop reference on server */
-   cuse_server_unref(pcs);
-   return (ENOMEM);
-   }
if (devfs_set_cdevpriv(pcc, _client_free)) {
printf("Cuse: Cannot set cdevpriv.\n");
/* drop reference on server */
___
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: 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-07-30 Thread Michal Meloun
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.
  
  Re-implement clocks for these SoC by using now standard extres/clk framework.
  This is necessary for future expansion of these. The new  implementation
  is (due to the size of the patch) only the initial (minimum) version.
  It will be updated/expanded with a subsequent set of particular patches.
  
  This patch is also not tested on OMAP4 based boards (BeagleBone),
  so all possible issues should be (and will be) fixed by ASAP once
  identified.
  
  Submited by:  Oskar Holmlund (oskar.holml...@ohdata.se)
  Differential Revision:  https://reviews.freebsd.org/D25118

Added:
  head/sys/arm/ti/am335x/am3359_cppi41.c   (contents, props changed)
  head/sys/arm/ti/am335x/am335x_usb_phy.c   (contents, props changed)
  head/sys/arm/ti/clk/
  head/sys/arm/ti/clk/clock_common.c   (contents, props changed)
  head/sys/arm/ti/clk/clock_common.h   (contents, props changed)
  head/sys/arm/ti/clk/ti_clk_clkctrl.c   (contents, props changed)
  head/sys/arm/ti/clk/ti_clk_clkctrl.h   (contents, props changed)
  head/sys/arm/ti/clk/ti_clk_dpll.c   (contents, props changed)
  head/sys/arm/ti/clk/ti_clk_dpll.h   (contents, props changed)
  head/sys/arm/ti/clk/ti_clkctrl.c   (contents, props changed)
  head/sys/arm/ti/clk/ti_divider_clock.c   (contents, props changed)
  head/sys/arm/ti/clk/ti_dpll_clock.c   (contents, props changed)
  head/sys/arm/ti/clk/ti_gate_clock.c   (contents, props changed)
  head/sys/arm/ti/clk/ti_mux_clock.c   (contents, props changed)
  head/sys/arm/ti/ti_omap4_cm.c   (contents, props changed)
  head/sys/arm/ti/ti_omap4_cm.h   (contents, props changed)
  head/sys/arm/ti/ti_prm.c   (contents, props changed)
  head/sys/arm/ti/ti_prm.h   (contents, props changed)
  head/sys/arm/ti/ti_scm_syscon.c   (contents, props changed)
  head/sys/arm/ti/ti_sysc.h   (contents, props changed)
Deleted:
  head/sys/arm/ti/am335x/am335x_prcm.c
  head/sys/arm/ti/am335x/am335x_usbss.c
  head/sys/arm/ti/ti_hwmods.c
  head/sys/arm/ti/ti_hwmods.h
Modified:
  head/sys/arm/ti/am335x/am335x_dmtimer.c
  head/sys/arm/ti/am335x/am335x_dmtpps.c
  head/sys/arm/ti/am335x/am335x_dmtreg.h
  head/sys/arm/ti/am335x/am335x_gpio.c
  head/sys/arm/ti/am335x/am335x_lcd.c
  head/sys/arm/ti/am335x/am335x_musb.c
  head/sys/arm/ti/am335x/am335x_pwmss.c
  head/sys/arm/ti/am335x/am335x_rtc.c
  head/sys/arm/ti/am335x/am335x_scm.c
  head/sys/arm/ti/am335x/files.am335x
  head/sys/arm/ti/cpsw/if_cpsw.c
  head/sys/arm/ti/files.ti
  head/sys/arm/ti/omap4/files.omap4
  head/sys/arm/ti/ti_adc.c
  head/sys/arm/ti/ti_edma3.c
  head/sys/arm/ti/ti_gpio.c
  head/sys/arm/ti/ti_i2c.c
  head/sys/arm/ti/ti_mbox.c
  head/sys/arm/ti/ti_pinmux.c
  head/sys/arm/ti/ti_prcm.c
  head/sys/arm/ti/ti_prcm.h
  head/sys/arm/ti/ti_pruss.c
  head/sys/arm/ti/ti_scm.c
  head/sys/arm/ti/ti_sdhci.c
  head/sys/arm/ti/ti_sdma.c
  head/sys/arm/ti/ti_spi.c
  head/sys/arm/ti/ti_sysc.c
  head/sys/arm/ti/ti_wdt.c
  head/sys/arm/ti/usb/omap_ehci.c
  head/sys/arm/ti/usb/omap_host.c
  head/sys/arm/ti/usb/omap_tll.c
  head/sys/dev/uart/uart_dev_ti8250.c
  head/sys/modules/Makefile

Added: head/sys/arm/ti/am335x/am3359_cppi41.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/arm/ti/am335x/am3359_cppi41.c  Thu Jul 30 14:45:05 2020
(r363700)
@@ -0,0 +1,192 @@
+/*-
+ * Copyright (c) 2019 Emmanuel Vadot 
+ *
+ * Copyright (c) 2020 Oskar Holmlund 
+ *
+ * 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 ``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 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$
+ */
+/* Based on sys/arm/ti/ti_sysc.c */
+
+#include 
+__FBSDID("$FreeBSD$");
+

svn commit: r363699 - stable/12/usr.bin/fortune

2020-07-30 Thread Ed Maste
Author: emaste
Date: Thu Jul 30 14:42:50 2020
New Revision: 363699
URL: https://svnweb.freebsd.org/changeset/base/363699

Log:
  MFC r361596: fortune: remove warning about potentially offensive fortunes
  
  They were removed long ago.
  
  PR:   246736
  Submitted by: Ruby Lazuli Lord

Modified:
  stable/12/usr.bin/fortune/README
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.bin/fortune/README
==
--- stable/12/usr.bin/fortune/READMEThu Jul 30 14:41:41 2020
(r363698)
+++ stable/12/usr.bin/fortune/READMEThu Jul 30 14:42:50 2020
(r363699)
@@ -1,13 +1,6 @@
 #  @(#)README  8.1 (Berkeley) 5/31/93
 # $FreeBSD$
 
-The potentially offensive fortunes are installed by default on FreeBSD
-systems.  If you're absolutely, *positively*, without-a-shadow-of-a-doubt
-sure that your user community goes berzerk/sues your pants off/drops dead
-upon reading one of them, edit the Makefile in the subdirectory datfiles,
-and do "make all install".
-
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Some years ago, my neighbor Avery said to me: "There has not been an
 adequate jokebook published since "Joe_Miller", which came out in 1739 and
 which, incidentally, was the most miserable no-good ... jokebook in the
___
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: r363698 - stable/12/sbin/md5

2020-07-30 Thread Ed Maste
Author: emaste
Date: Thu Jul 30 14:41:41 2020
New Revision: 363698
URL: https://svnweb.freebsd.org/changeset/base/363698

Log:
  MFC r363457: md5: return non-zero if built-in tests (-x) fail

Modified:
  stable/12/sbin/md5/md5.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sbin/md5/md5.c
==
--- stable/12/sbin/md5/md5.cThu Jul 30 14:05:24 2020(r363697)
+++ stable/12/sbin/md5/md5.cThu Jul 30 14:41:41 2020(r363698)
@@ -498,10 +498,12 @@ MDTestSuite(const Algorithm_t *alg)
for (i = 0; i < MDTESTCOUNT; i++) {
(*alg->Data)(MDTestInput[i], strlen(MDTestInput[i]), buffer);
printf("%s (\"%s\") = %s", alg->name, MDTestInput[i], buffer);
-   if (strcmp(buffer, (*alg->TestOutput)[i]) == 0)
+   if (strcmp(buffer, (*alg->TestOutput)[i]) == 0) {
printf(" - verified correct\n");
-   else
+   } else {
printf(" - INCORRECT RESULT!\n");
+   failed++;
+   }
}
 }
 
___
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: r363697 - in stable/12/sys/cddl/dev: dtrace/arm fbt/arm

2020-07-30 Thread Andriy Gapon
Author: avg
Date: Thu Jul 30 14:05:24 2020
New Revision: 363697
URL: https://svnweb.freebsd.org/changeset/base/363697

Log:
  MFC r363383: dtrace/fbt: fix return probe arguments on arm
  
  arg0 should be an offset of the return point within the function, arg1
  should be the return value.  Previously the return probe had arguments as
  if for the entry probe.
  
  Tested on armv7.
  
  andrew noted that the same problem seems to be present on arm64, mips,
  and riscv.
  I am not sure if I will get around to fixing those.  So, platform users
  or anyone looking to make a contribution please be aware of this
  opportunity.

Modified:
  stable/12/sys/cddl/dev/dtrace/arm/dtrace_subr.c
  stable/12/sys/cddl/dev/fbt/arm/fbt_isa.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/cddl/dev/dtrace/arm/dtrace_subr.c
==
--- stable/12/sys/cddl/dev/dtrace/arm/dtrace_subr.c Thu Jul 30 14:01:54 
2020(r363696)
+++ stable/12/sys/cddl/dev/dtrace/arm/dtrace_subr.c Thu Jul 30 14:05:24 
2020(r363697)
@@ -248,7 +248,7 @@ dtrace_invop_start(struct trapframe *frame)
register_t *r0, *sp;
int data, invop, reg, update_sp;
 
-   invop = dtrace_invop(frame->tf_pc, frame, frame->tf_pc);
+   invop = dtrace_invop(frame->tf_pc, frame, frame->tf_r0);
switch (invop & DTRACE_INVOP_MASK) {
case DTRACE_INVOP_PUSHM:
sp = (register_t *)frame->tf_svc_sp;

Modified: stable/12/sys/cddl/dev/fbt/arm/fbt_isa.c
==
--- stable/12/sys/cddl/dev/fbt/arm/fbt_isa.cThu Jul 30 14:01:54 2020
(r363696)
+++ stable/12/sys/cddl/dev/fbt/arm/fbt_isa.cThu Jul 30 14:05:24 2020
(r363697)
@@ -56,9 +56,12 @@ fbt_invop(uintptr_t addr, struct trapframe *frame, uin
register_t fifthparam;
 
for (; fbt != NULL; fbt = fbt->fbtp_hashnext) {
-   if ((uintptr_t)fbt->fbtp_patchpoint == addr) {
-   cpu->cpu_dtrace_caller = addr;
+   if ((uintptr_t)fbt->fbtp_patchpoint != addr)
+   continue;
 
+   cpu->cpu_dtrace_caller = addr;
+
+   if (fbt->fbtp_roffset == 0) {
/* Get 5th parameter from stack */
DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT);
fifthparam = *(register_t *)frame->tf_svc_sp;
@@ -67,11 +70,13 @@ fbt_invop(uintptr_t addr, struct trapframe *frame, uin
dtrace_probe(fbt->fbtp_id, frame->tf_r0,
frame->tf_r1, frame->tf_r2,
frame->tf_r3, fifthparam);
-
-   cpu->cpu_dtrace_caller = 0;
-
-   return (fbt->fbtp_rval | (fbt->fbtp_savedval << 
DTRACE_INVOP_SHIFT));
+   } else {
+   dtrace_probe(fbt->fbtp_id, fbt->fbtp_roffset, rval,
+   0, 0, 0);
}
+
+   cpu->cpu_dtrace_caller = 0;
+   return (fbt->fbtp_rval | (fbt->fbtp_savedval << 
DTRACE_INVOP_SHIFT));
}
 
return (0);
@@ -178,6 +183,7 @@ again:
fbt->fbtp_rval = DTRACE_INVOP_B;
else
fbt->fbtp_rval = DTRACE_INVOP_POPM;
+   fbt->fbtp_roffset = (uintptr_t)instr - (uintptr_t)symval->value;
fbt->fbtp_savedval = *instr;
fbt->fbtp_patchval = FBT_BREAKPOINT;
fbt->fbtp_hashnext = fbt_probetab[FBT_ADDR2NDX(instr)];
___
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: r363696 - stable/12/sys/dev/gpio

2020-07-30 Thread Andriy Gapon
Author: avg
Date: Thu Jul 30 14:01:54 2020
New Revision: 363696
URL: https://svnweb.freebsd.org/changeset/base/363696

Log:
  MFC r363382: gpioiic: never drive lines active high
  
  Few drivers support GPIO_PIN_OPENDRAIN.

Modified:
  stable/12/sys/dev/gpio/gpioiic.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/gpio/gpioiic.c
==
--- stable/12/sys/dev/gpio/gpioiic.cThu Jul 30 13:56:45 2020
(r363695)
+++ stable/12/sys/dev/gpio/gpioiic.cThu Jul 30 14:01:54 2020
(r363696)
@@ -191,16 +191,14 @@ static void
 gpioiic_setsda(device_t dev, int val)
 {
struct gpioiic_softc *sc = device_get_softc(dev);
-   int err;
 
-   /*
-* Some controllers cannot set an output value while a pin is in input
-* mode; in that case we set the pin again after changing mode.
-*/
-   err = gpio_pin_set_active(sc->sdapin, val);
-   gpio_pin_setflags(sc->sdapin, GPIO_PIN_OUTPUT | GPIO_PIN_OPENDRAIN);
-   if (err != 0)
-   gpio_pin_set_active(sc->sdapin, val);
+   if (val) {
+   gpio_pin_setflags(sc->sdapin, GPIO_PIN_INPUT);
+   } else {
+   gpio_pin_setflags(sc->sdapin,
+   GPIO_PIN_OUTPUT | GPIO_PIN_OPENDRAIN);
+   gpio_pin_set_active(sc->sdapin, 0);
+   }
 }
 
 static void
@@ -208,8 +206,13 @@ gpioiic_setscl(device_t dev, int val)
 {
struct gpioiic_softc *sc = device_get_softc(dev);
 
-   gpio_pin_setflags(sc->sclpin, GPIO_PIN_OUTPUT | GPIO_PIN_OPENDRAIN);
-   gpio_pin_set_active(sc->sclpin, val);
+   if (val) {
+   gpio_pin_setflags(sc->sclpin, GPIO_PIN_INPUT);
+   } else {
+   gpio_pin_setflags(sc->sclpin,
+   GPIO_PIN_OUTPUT | GPIO_PIN_OPENDRAIN);
+   gpio_pin_set_active(sc->sclpin, 0);
+   }
 }
 
 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"


svn commit: r363695 - stable/12/sys/modules/dtb/allwinner

2020-07-30 Thread Andriy Gapon
Author: avg
Date: Thu Jul 30 13:56:45 2020
New Revision: 363695
URL: https://svnweb.freebsd.org/changeset/base/363695

Log:
  MFC r363232: build DTS for Orange Pi PC Plus as well

Modified:
  stable/12/sys/modules/dtb/allwinner/Makefile
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/modules/dtb/allwinner/Makefile
==
--- stable/12/sys/modules/dtb/allwinner/MakefileThu Jul 30 13:55:05 
2020(r363694)
+++ stable/12/sys/modules/dtb/allwinner/MakefileThu Jul 30 13:56:45 
2020(r363695)
@@ -21,6 +21,7 @@ DTS=  \
sun8i-h3-nanopi-neo.dts \
sun8i-h3-orangepi-one.dts \
sun8i-h3-orangepi-pc.dts \
+   sun8i-h3-orangepi-pc-plus.dts \
sun8i-h3-orangepi-plus2e.dts
 
 DTSO=  sun8i-a83t-sid.dtso \
___
svn-src-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: r363694 - in stable/12/sys: dev/ena modules/ena

2020-07-30 Thread Andriy Gapon
Author: avg
Date: Thu Jul 30 13:55:05 2020
New Revision: 363694
URL: https://svnweb.freebsd.org/changeset/base/363694

Log:
  MFC r362530: teach ena driver about RSS kernel option
  
  Networking is broken if the driver configures its (virtual) hardware to
  use a hash algorithm (or a key) different from the one that the network
  stack (software RSS) uses.  This can be seen with connections initiated
  from the host.  The PCB will be placed into the hash table based on the
  hash value calculated by the software.  The hardware-calculated hash
  value in reponse packets will be different, so the PCB won't be found.
  
  Tested with a kernel compiled with 'options RSS' on an instance with ena
  driver.

Modified:
  stable/12/sys/dev/ena/ena.c
  stable/12/sys/modules/ena/Makefile
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/ena/ena.c
==
--- stable/12/sys/dev/ena/ena.c Thu Jul 30 13:36:24 2020(r363693)
+++ stable/12/sys/dev/ena/ena.c Thu Jul 30 13:55:05 2020(r363694)
@@ -30,6 +30,8 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "opt_rss.h"
+
 #include 
 #include 
 #include 
@@ -62,6 +64,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#ifdef RSS
+#include 
+#endif
 
 #include 
 #include 
@@ -1424,6 +1429,19 @@ ena_rx_hash_mbuf(struct ena_ring *rx_ring, struct ena_
if (likely(adapter->rss_support)) {
mbuf->m_pkthdr.flowid = ena_rx_ctx->hash;
 
+#ifdef RSS
+   /*
+* Hardware and software RSS are in agreement only when both are
+* configured to Toeplitz algorithm.  This driver configures
+* that algorithm only when software RSS is enabled and uses it.
+*/
+   if (adapter->ena_dev->rss.hash_func != ENA_ADMIN_TOEPLITZ &&
+   ena_rx_ctx->l3_proto != ENA_ETH_IO_L3_PROTO_UNKNOWN) {
+   M_HASHTYPE_SET(mbuf, M_HASHTYPE_OPAQUE_HASH);
+   return;
+   }
+#endif
+
if (ena_rx_ctx->frag &&
(ena_rx_ctx->l3_proto != ENA_ETH_IO_L3_PROTO_UNKNOWN)) {
M_HASHTYPE_SET(mbuf, M_HASHTYPE_OPAQUE_HASH);
@@ -3106,6 +3124,16 @@ ena_rss_init_default(struct ena_adapter *adapter)
}
}
 
+#ifdef RSS
+   uint8_t rss_algo = rss_gethashalgo();
+   if (rss_algo == RSS_HASH_TOEPLITZ) {
+   uint8_t hash_key[RSS_KEYSIZE];
+
+   rss_getkey(hash_key);
+   rc = ena_com_fill_hash_function(ena_dev, ENA_ADMIN_TOEPLITZ,
+   hash_key, RSS_KEYSIZE, 0x);
+   } else
+#endif
rc = ena_com_fill_hash_function(ena_dev, ENA_ADMIN_CRC32, NULL,
ENA_HASH_KEY_SIZE, 0x);
if (unlikely((rc != 0) && (rc != EOPNOTSUPP))) {

Modified: stable/12/sys/modules/ena/Makefile
==
--- stable/12/sys/modules/ena/Makefile  Thu Jul 30 13:36:24 2020
(r363693)
+++ stable/12/sys/modules/ena/Makefile  Thu Jul 30 13:55:05 2020
(r363694)
@@ -36,6 +36,7 @@
 KMOD   = if_ena
 SRCS   = ena.c ena_com.c ena_eth_com.c ena_sysctl.c
 SRCS   += device_if.h bus_if.h pci_if.h
+SRCS   += opt_rss.h
 CFLAGS  += -I${SRCTOP}/sys/contrib
 
 .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: r363693 - head/usr.bin/sed/tests

2020-07-30 Thread Kyle Evans
Author: kevans
Date: Thu Jul 30 13:36:24 2020
New Revision: 363693
URL: https://svnweb.freebsd.org/changeset/base/363693

Log:
  sed: fix hex_subst test after after r363679
  
  r363679 is in-fact the future change referenced by the comment, helpfully
  left and forgotten by kevans. Instead of just silently not matching, we
  should now be erroring out with vigor.

Modified:
  head/usr.bin/sed/tests/sed2_test.sh

Modified: head/usr.bin/sed/tests/sed2_test.sh
==
--- head/usr.bin/sed/tests/sed2_test.sh Thu Jul 30 13:33:45 2020
(r363692)
+++ head/usr.bin/sed/tests/sed2_test.sh Thu Jul 30 13:36:24 2020
(r363693)
@@ -109,11 +109,9 @@ hex_subst_body()
# Single digit \x should work as well.
atf_check -o "inline:xn" sed 's/\xd/x/' c
 
-   # Invalid digit should cause us to ignore the sequence.  This test
-   # invokes UB, escapes of an ordinary character.  A future change will
-   # make regex(3) on longer tolerate this and we'll need to adjust what
-   # we're doing, but for now this will suffice.
-   atf_check -o "inline:" sed 's/\xx//' d
+   # This should get passed through to the underlying regex engine as
+   # \xx, which is an invalid escape of an ordinary character.
+   atf_check -s exit:1 -e not-empty sed 's/\xx//' d
 }
 
 atf_test_case commands_on_stdin
___
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: r363692 - head/usr.bin/diff/tests

2020-07-30 Thread Kyle Evans
Author: kevans
Date: Thu Jul 30 13:33:45 2020
New Revision: 363692
URL: https://svnweb.freebsd.org/changeset/base/363692

Log:
  diff: fix side_by_side after r363679
  
  It's currently unclear to me how this could have worked previously; \n here
  is not a literal newline but actual '\' 'n', and was getting passed to the
  underlying regex engine as such. regex(3) does not translate this to a
  newline, and this became an error because we don't really allow escaping
  of arbitrary ordinary characters anymore.
  
  Run the pattern strings through printf to make sure we're dealing with real
  newlines before passing them through to atf_check, which ultimately feeds
  them directly to regcomp(3).
  
  This fix is different than that will be needed for sed, in that this is the
  proper way to inject newlines into search strings as long as regex(3)
  won't combine \ + n as folks might expect.
  
  Reported by:  Jenkins via lwhsu
  MFC after:1 week

Modified:
  head/usr.bin/diff/tests/diff_test.sh

Modified: head/usr.bin/diff/tests/diff_test.sh
==
--- head/usr.bin/diff/tests/diff_test.shThu Jul 30 13:17:01 2020
(r363691)
+++ head/usr.bin/diff/tests/diff_test.shThu Jul 30 13:33:45 2020
(r363692)
@@ -108,8 +108,8 @@ side_by_side_body()
atf_check -o save:A printf "A\nB\nC\n"
atf_check -o save:B printf "D\nB\nE\n"
 
-   
exp_output="A[[:space:]]+|[[:space:]]+D\nB[[:space:]]+B\nC[[:space:]]+|[[:space:]]+E"
-   
exp_output_suppressed="A[[:space:]]+|[[:space:]]+D\nC[[:space:]]+|[[:space:]]+E"
+   exp_output=$(printf 
"A[[:space:]]+|[[:space:]]+D\nB[[:space:]]+B\nC[[:space:]]+|[[:space:]]+E")
+   exp_output_suppressed=$(printf 
"A[[:space:]]+|[[:space:]]+D\nC[[:space:]]+|[[:space:]]+E")
 
atf_check -o match:"$exp_output" -s exit:1 \
diff --side-by-side A B
___
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: r363691 - stable/12/sys/dev/gpio

2020-07-30 Thread Andriy Gapon
Author: avg
Date: Thu Jul 30 13:17:01 2020
New Revision: 363691
URL: https://svnweb.freebsd.org/changeset/base/363691

Log:
  MFC r362492: gpiobus_release_pin: remove incorrect prefix from error messages

Modified:
  stable/12/sys/dev/gpio/gpiobus.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/gpio/gpiobus.c
==
--- stable/12/sys/dev/gpio/gpiobus.cThu Jul 30 12:59:23 2020
(r363690)
+++ stable/12/sys/dev/gpio/gpiobus.cThu Jul 30 13:17:01 2020
(r363691)
@@ -421,13 +421,13 @@ gpiobus_release_pin(device_t bus, uint32_t pin)
/* Consistency check. */
if (pin >= sc->sc_npins) {
device_printf(bus,
-   "gpiobus_acquire_pin: invalid pin %d, max=%d\n",
+   "invalid pin %d, max=%d\n",
pin, sc->sc_npins - 1);
return (-1);
}
 
if (!sc->sc_pins[pin].mapped) {
-   device_printf(bus, "gpiobus_acquire_pin: pin %d is not 
mapped\n", pin);
+   device_printf(bus, "pin %d is not mapped\n", pin);
return (-1);
}
sc->sc_pins[pin].mapped = 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: r363690 - stable/12/sys/dev/sound/pci/hda

2020-07-30 Thread Andriy Gapon
Author: avg
Date: Thu Jul 30 12:59:23 2020
New Revision: 363690
URL: https://svnweb.freebsd.org/changeset/base/363690

Log:
  MFC r362294,r362647: hdac_intr_handler: keep working until global interrupt 
status clears
  
  It is plausible that the hardware interrupts a host only when GIS goes
  from zero to one.  GIS is formed by OR-ing multiple hardware statuses,
  so it's possible that a previously cleared status gets set again while
  another status has not been cleared yet.  Thus, there will be no new
  interrupt as GIS always stayed set.  If we don't re-examine GIS then we
  can leave it set and never get another interrupt again.
  
  Without this change I frequently saw a problem where snd_hda would stop
  working.  Setting dev.hdac.1.polling=1 would bring it back to life and
  afterwards I could set polling back to zero.  Sometimes the problem
  started right after a boot, sometimes it happened after resuming from
  S3, frequently it would occur when sound output and input are active
  concurrently (such as during conferencing).  I looked at HDAC_INTSTS
  while the sound was not working and I saw that both HDAC_INTSTS_GIS and
  HDAC_INTSTS_CIS were set, but there were no interrupts.

Modified:
  stable/12/sys/dev/sound/pci/hda/hdac.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/sound/pci/hda/hdac.c
==
--- stable/12/sys/dev/sound/pci/hda/hdac.c  Thu Jul 30 07:26:11 2020
(r363689)
+++ stable/12/sys/dev/sound/pci/hda/hdac.c  Thu Jul 30 12:59:23 2020
(r363690)
@@ -302,34 +302,36 @@ hdac_config_fetch(struct hdac_softc *sc, uint32_t *on,
}
 }
 
-/
- * void hdac_intr_handler(void *)
- *
- * Interrupt handler. Processes interrupts received from the hdac.
- /
 static void
-hdac_intr_handler(void *context)
+hdac_one_intr(struct hdac_softc *sc, uint32_t intsts)
 {
-   struct hdac_softc *sc;
device_t dev;
-   uint32_t intsts;
uint8_t rirbsts;
int i;
 
-   sc = (struct hdac_softc *)context;
-   hdac_lock(sc);
-
-   /* Do we have anything to do? */
-   intsts = HDAC_READ_4(>mem, HDAC_INTSTS);
-   if ((intsts & HDAC_INTSTS_GIS) == 0) {
-   hdac_unlock(sc);
-   return;
-   }
-
/* Was this a controller interrupt? */
if (intsts & HDAC_INTSTS_CIS) {
-   rirbsts = HDAC_READ_1(>mem, HDAC_RIRBSTS);
+   /*
+* Placeholder: if we ever enable any bits in HDAC_WAKEEN, then
+* we will need to check and clear HDAC_STATESTS.
+* That event is used to report codec status changes such as
+* a reset or a wake-up event.
+*/
+   /*
+* Placeholder: if we ever enable HDAC_CORBCTL_CMEIE, then we
+* will need to check and clear HDAC_CORBSTS_CMEI in
+* HDAC_CORBSTS.
+* That event is used to report CORB memory errors.
+*/
+   /*
+* Placeholder: if we ever enable HDAC_RIRBCTL_RIRBOIC, then we
+* will need to check and clear HDAC_RIRBSTS_RIRBOIS in
+* HDAC_RIRBSTS.
+* That event is used to report response FIFO overruns.
+*/
+
/* Get as many responses that we can */
+   rirbsts = HDAC_READ_1(>mem, HDAC_RIRBSTS);
while (rirbsts & HDAC_RIRBSTS_RINTFL) {
HDAC_WRITE_1(>mem,
HDAC_RIRBSTS, HDAC_RIRBSTS_RINTFL);
@@ -345,16 +347,45 @@ hdac_intr_handler(void *context)
if ((intsts & (1 << i)) == 0)
continue;
HDAC_WRITE_1(>mem, (i << 5) + HDAC_SDSTS,
-   HDAC_SDSTS_DESE | HDAC_SDSTS_FIFOE | 
HDAC_SDSTS_BCIS );
+   HDAC_SDSTS_DESE | HDAC_SDSTS_FIFOE | 
HDAC_SDSTS_BCIS);
if ((dev = sc->streams[i].dev) != NULL) {
HDAC_STREAM_INTR(dev,
sc->streams[i].dir, sc->streams[i].stream);
}
}
}
+}
 
-   HDAC_WRITE_4(>mem, HDAC_INTSTS, intsts);
-   hdac_unlock(sc);
+/
+ * void hdac_intr_handler(void *)
+ *
+ * Interrupt handler. Processes interrupts received from the hdac.
+ /
+static void
+hdac_intr_handler(void *context)
+{
+   struct hdac_softc *sc;
+   uint32_t intsts;
+
+   sc = (struct hdac_softc *)context;
+
+   /*
+* Loop until HDAC_INTSTS_GIS gets clear.

Re: svn commit: r363679 - in head: contrib/netbsd-tests/lib/libc/regex/data lib/libc/regex

2020-07-30 Thread Stefan Eßer
Am 30.07.20 um 13:54 schrieb Kyle Evans:
> On Thu, Jul 30, 2020 at 6:48 AM Gordon Bergling  wrote:
>> I got the same error this morning and was able to solve it by doing a full
>> buildworld without NO_CLEAN=yes.
>>
>> You may want to try this in case you are using NO_CLEAN=yes.
>>
> 
> This is interesting; there shouldn't be any NO_CLEAN implications with
> this change. There were no dependency changes, libc should definitely
> get rebuilt because regcomp.c changed and thus, the libc in your
> objdir should have the symbol. The binary referenced above is one that
> we symlink into OBJDIR from the host system.
> 
> I think it's also likely your problem was just fixed by the second
> installworld. The first one will manage to get libc installed, but not
> before you get errors from all the other stuff.

This appears to be true: after once completing installworld with
WITHOUT_TESTS=yes the build and installation does also succeed for
subsequent runs with WITH_TESTS=yes.

My guess is that "make install" in tests tries to link against the
base system version of the library and the freshly built one with
the correct symbol version has not been installed, yet.

Regards, STefan
___
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: r363679 - in head: contrib/netbsd-tests/lib/libc/regex/data lib/libc/regex

2020-07-30 Thread Stefan Eßer
Am 30.07.20 um 13:48 schrieb Gordon Bergling:
> On Thu, Jul 30, 2020 at 01:26:46PM +0200, Stefan Eßer wrote:
>> Am 30.07.20 um 01:21 schrieb Kyle Evans:
>> [...]
>>>   This change bumps the symbol version of regcomp to FBSD_1.6 and provides 
>>> the
>>>   old escape semantics for legacy applications, just in case one has an 
>>> older
>>>   application that would immediately turn into a pumpkin because of an
>>>   extraneous escape that's embedded or otherwise critical to its operation.
>>
>> I get an error during make buildworld with option WITH_TESTS=yes:
>>
>> ===> usr.bin/bmake/tests (install)
>> ld-elf.so.1: /usr/src/amd64.amd64/tmp/legacy/usr/sbin/make: Undefined
>> symbol "regcomp@FBSD_1.6"
>>
>> Regards, STefan
> 
> I got the same error this morning and was able to solve it by doing a full
> buildworld without NO_CLEAN=yes.
> 
> You may want to try this in case you are using NO_CLEAN=yes.

Too late ... but thanks for the hint ...

I have restarted make buildworld installworld on an unmodified
source tree from when the error occurred and it just finished,
without error this time.

Maybe that it will work with WITH_TESTS too, now - I'll start
another build/install cycle now and will report back. If it does
not work, I'll try without NO_CLEAN (I'm building with META_MODE
enabled, normally).

Regards, STefan
___
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: r363679 - in head: contrib/netbsd-tests/lib/libc/regex/data lib/libc/regex

2020-07-30 Thread Kyle Evans
On Thu, Jul 30, 2020 at 6:48 AM Gordon Bergling  wrote:
>
> On Thu, Jul 30, 2020 at 01:26:46PM +0200, Stefan Eßer wrote:
> > Am 30.07.20 um 01:21 schrieb Kyle Evans:
> > [...]
> > >   This change bumps the symbol version of regcomp to FBSD_1.6 and 
> > > provides the
> > >   old escape semantics for legacy applications, just in case one has an 
> > > older
> > >   application that would immediately turn into a pumpkin because of an
> > >   extraneous escape that's embedded or otherwise critical to its 
> > > operation.
> >
> > I get an error during make buildworld with option WITH_TESTS=yes:
> >
> > ===> usr.bin/bmake/tests (install)
> > ld-elf.so.1: /usr/src/amd64.amd64/tmp/legacy/usr/sbin/make: Undefined
> > symbol "regcomp@FBSD_1.6"
> >
> > Regards, STefan
>
> I got the same error this morning and was able to solve it by doing a full
> buildworld without NO_CLEAN=yes.
>
> You may want to try this in case you are using NO_CLEAN=yes.
>

This is interesting; there shouldn't be any NO_CLEAN implications with
this change. There were no dependency changes, libc should definitely
get rebuilt because regcomp.c changed and thus, the libc in your
objdir should have the symbol. The binary referenced above is one that
we symlink into OBJDIR from the host system.

I think it's also likely your problem was just fixed by the second
installworld. The first one will manage to get libc installed, but not
before you get errors from all the other stuff.

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: r363679 - in head: contrib/netbsd-tests/lib/libc/regex/data lib/libc/regex

2020-07-30 Thread Gordon Bergling
On Thu, Jul 30, 2020 at 01:26:46PM +0200, Stefan Eßer wrote:
> Am 30.07.20 um 01:21 schrieb Kyle Evans:
> [...]
> >   This change bumps the symbol version of regcomp to FBSD_1.6 and provides 
> > the
> >   old escape semantics for legacy applications, just in case one has an 
> > older
> >   application that would immediately turn into a pumpkin because of an
> >   extraneous escape that's embedded or otherwise critical to its operation.
> 
> I get an error during make buildworld with option WITH_TESTS=yes:
> 
> ===> usr.bin/bmake/tests (install)
> ld-elf.so.1: /usr/src/amd64.amd64/tmp/legacy/usr/sbin/make: Undefined
> symbol "regcomp@FBSD_1.6"
> 
> Regards, STefan

I got the same error this morning and was able to solve it by doing a full
buildworld without NO_CLEAN=yes.

You may want to try this in case you are using NO_CLEAN=yes.

--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: r363679 - in head: contrib/netbsd-tests/lib/libc/regex/data lib/libc/regex

2020-07-30 Thread Kyle Evans
On Thu, Jul 30, 2020 at 6:26 AM Stefan Eßer  wrote:
>
> Am 30.07.20 um 01:21 schrieb Kyle Evans:
> [...]
> >   This change bumps the symbol version of regcomp to FBSD_1.6 and provides 
> > the
> >   old escape semantics for legacy applications, just in case one has an 
> > older
> >   application that would immediately turn into a pumpkin because of an
> >   extraneous escape that's embedded or otherwise critical to its operation.
>
> I get an error during make buildworld with option WITH_TESTS=yes:
>
> ===> usr.bin/bmake/tests (install)
> ld-elf.so.1: /usr/src/amd64.amd64/tmp/legacy/usr/sbin/make: Undefined
> symbol "regcomp@FBSD_1.6"
>
> Regards, STefan

Hi,

Can you describe the environment in which you're running installworld,
please? i.e. is it just a raw installworld directly in your shell, or
something more complicated?

I observed this in testing an exceptional scenario; running
installworld in a buildenv. installworld injects .WAIT between lib and
libexec + other subdirs, which is supposed to prevent stuff like this
(new binary got installed linked against new libc before new libc).
Running in a buildenv set SYSROOT and stripped out the .WAITs, leaving
me with an annoyance where I had to installworld twice.

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: r363679 - in head: contrib/netbsd-tests/lib/libc/regex/data lib/libc/regex

2020-07-30 Thread Stefan Eßer
Am 30.07.20 um 01:21 schrieb Kyle Evans:
[...]
>   This change bumps the symbol version of regcomp to FBSD_1.6 and provides the
>   old escape semantics for legacy applications, just in case one has an older
>   application that would immediately turn into a pumpkin because of an
>   extraneous escape that's embedded or otherwise critical to its operation.

I get an error during make buildworld with option WITH_TESTS=yes:

===> usr.bin/bmake/tests (install)
ld-elf.so.1: /usr/src/amd64.amd64/tmp/legacy/usr/sbin/make: Undefined
symbol "regcomp@FBSD_1.6"

Regards, STefan
___
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: r363689 - head/sys/dev/hyperv/vmbus

2020-07-30 Thread Wei Hu
Author: whu
Date: Thu Jul 30 07:26:11 2020
New Revision: 363689
URL: https://svnweb.freebsd.org/changeset/base/363689

Log:
  Prevent framebuffer mmio space from being allocated to other devices on 
HyperV.
  
  On Gen2 VMs, Hyper-V provides mmio space for framebuffer.
  This mmio address range is not useable for other PCI devices.
  Currently only efifb driver is using this range without reserving
  it from system.
  Therefore, vmbus driver reserves it before any other PCI device
  drivers start to request mmio addresses.
  
  PR:   222996
  Submitted by: w...@microsoft.com
  Reported by:  dmitry_kules...@ukr.net
  Reviewed by:  de...@microsoft.com
  Sponsored by: Microsoft

Modified:
  head/sys/dev/hyperv/vmbus/vmbus.c

Modified: head/sys/dev/hyperv/vmbus/vmbus.c
==
--- head/sys/dev/hyperv/vmbus/vmbus.c   Thu Jul 30 07:11:08 2020
(r363688)
+++ head/sys/dev/hyperv/vmbus/vmbus.c   Thu Jul 30 07:26:11 2020
(r363689)
@@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -46,6 +47,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1332,12 +1334,66 @@ vmbus_get_mmio_res(device_t dev)
vmbus_get_mmio_res_pass(dev, parse_32);
 }
 
+/*
+ * On Gen2 VMs, Hyper-V provides mmio space for framebuffer.
+ * This mmio address range is not useable for other PCI devices.
+ * Currently only efifb driver is using this range without reserving
+ * it from system.
+ * Therefore, vmbus driver reserves it before any other PCI device
+ * drivers start to request mmio addresses.
+ */
+static struct resource *hv_fb_res;
+
 static void
+vmbus_fb_mmio_res(device_t dev)
+{
+   struct efi_fb *efifb;
+   caddr_t kmdp;
+
+   struct vmbus_softc *sc = device_get_softc(dev);
+   int rid = 0;
+
+   kmdp = preload_search_by_type("elf kernel");
+   if (kmdp == NULL)
+   kmdp = preload_search_by_type("elf64 kernel");
+   efifb = (struct efi_fb *)preload_search_info(kmdp,
+   MODINFO_METADATA | MODINFOMD_EFI_FB);
+   if (efifb == NULL) {
+   if (bootverbose)
+   device_printf(dev,
+   "fb has no preloaded kernel efi information\n");
+   /* We are on Gen1 VM, just return. */
+   return;
+   } else {
+   if (bootverbose)
+   device_printf(dev,
+   "efifb: fb_addr: %#jx, size: %#jx, "
+   "actual size needed: 0x%x\n",
+   efifb->fb_addr, efifb->fb_size,
+   (int) efifb->fb_height * efifb->fb_width);
+   }
+
+   hv_fb_res = pcib_host_res_alloc(>vmbus_mmio_res, dev,
+   SYS_RES_MEMORY, ,
+   efifb->fb_addr, efifb->fb_addr + efifb->fb_size, efifb->fb_size,
+   RF_ACTIVE | rman_make_alignment_flags(PAGE_SIZE));
+
+   if (hv_fb_res && bootverbose)
+   device_printf(dev,
+   "successfully reserved memory for framebuffer "
+   "starting at %#jx, size %#jx\n",
+   efifb->fb_addr, efifb->fb_size);
+}
+
+static void
 vmbus_free_mmio_res(device_t dev)
 {
struct vmbus_softc *sc = device_get_softc(dev);
 
pcib_host_res_free(dev, >vmbus_mmio_res);
+
+   if (hv_fb_res)
+   hv_fb_res = NULL;
 }
 #endif /* NEW_PCIB */
 
@@ -1387,6 +1443,7 @@ vmbus_doattach(struct vmbus_softc *sc)
 
 #ifdef NEW_PCIB
vmbus_get_mmio_res(sc->vmbus_dev);
+   vmbus_fb_mmio_res(sc->vmbus_dev);
 #endif
 
sc->vmbus_flags |= VMBUS_FLAG_ATTACHED;
___
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: r363688 - head/sys/kern

2020-07-30 Thread Mateusz Guzik
Author: mjg
Date: Thu Jul 30 07:11:08 2020
New Revision: 363688
URL: https://svnweb.freebsd.org/changeset/base/363688

Log:
  vfs: make sure startdir_used is always assigned to before use
  
  CID:  1431070

Modified:
  head/sys/kern/vfs_lookup.c

Modified: head/sys/kern/vfs_lookup.c
==
--- head/sys/kern/vfs_lookup.c  Thu Jul 30 04:05:59 2020(r363687)
+++ head/sys/kern/vfs_lookup.c  Thu Jul 30 07:11:08 2020(r363688)
@@ -289,11 +289,13 @@ namei_setup(struct nameidata *ndp, struct vnode **dpp,
struct pwd *pwd;
cap_rights_t rights;
struct filecaps dirfd_caps;
-   int error, startdir_used;
+   int error;
+   bool startdir_used;
 
cnp = >ni_cnd;
td = cnp->cn_thread;
 
+   startdir_used = false;
*pwdp = NULL;
 
 #ifdef CAPABILITY_MODE
@@ -340,7 +342,7 @@ namei_setup(struct nameidata *ndp, struct vnode **dpp,
} else {
if (ndp->ni_startdir != NULL) {
*dpp = ndp->ni_startdir;
-   startdir_used = 1;
+   startdir_used = true;
} else if (ndp->ni_dirfd == AT_FDCWD) {
*dpp = pwd->pwd_cdir;
vrefact(*dpp);
___
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: r363625 - stable/12/usr.sbin/mountd

2020-07-30 Thread Rick Macklem
Ian Lepore wrote:
>On Thu, 2020-07-30 at 01:52 +, Rick Macklem wrote:
>> Brooks Davis wrote:
>> > Author: brooks
>> > Date: Mon Jul 27 23:18:14 2020
>> > New Revision: 363625
>> > URL: https://svnweb.freebsd.org/changeset/base/363625
>> >
>> > Log:
>> >  MFC r363439:
>> >
>> >  Correct a type-mismatch between xdr_long and the variable "bad".
>> >
>> > [...]
>> --> I can't see how the xdr.c code would work for a machine that is
>> BIG_ENDIAN and where "long" is 64bits, but we don't have any of
>> those.
>>
>
>mips64 and powerpc64 are both big endian with 64-bit long.
Oops, I didn't know that. In the past, I've run PowerPC and MIPS, but thought
they both were little endian. (I recall the arches can be run either way.)

Anyhow, take a look at head/lib/libc/xdr/xdr.c and it looks to me like it
has been broken "forever" (ever since we stopped using a K compiler
that would have always made "long" 32bits).

If anyone has either of these and can set up an NFS server on one of
them and then try and do an NFSv3 mount that is not allowed, it would
be interesting to see the packet trace and if the MNT RPC fails, because
it looks like it will put the high order 32bits on the wire and they'll
always be 0?

Just to clarify. The behaviour wasn't broken by this commit. I just
don't see how the commit fixes anything?

rick, who doesn't have these arches to test on.

-- 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"