Re: svn commit: r350998 - head/sbin/ping

2019-08-13 Thread Alan Somers
On Tue, Aug 13, 2019 at 9:23 PM Warner Losh  wrote:
>
>
>
> On Tue, Aug 13, 2019 at 9:17 PM O. Hartmann  wrote:
>>
>> ping has now exorbitant high latency numbers:
>>
>> 64 bytes from 193.99.144.80: icmp_seq=123 ttl=244 time=1565750958347.753 ms
>
>
> Ping times of 50 years. Where are you pinging? Mu Cassiopeiae?
>
> Warner

Teehee, that's funny.  But you'd probably be happier with this:
https://reviews.freebsd.org/D21258
___
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: r350998 - head/sbin/ping

2019-08-13 Thread Warner Losh
On Tue, Aug 13, 2019 at 9:17 PM O. Hartmann  wrote:

> ping has now exorbitant high latency numbers:
>
> 64 bytes from 193.99.144.80: icmp_seq=123 ttl=244 time=1565750958347.753
> ms
>

Ping times of 50 years. Where are you pinging? Mu Cassiopeiae
?

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


Re: svn commit: r350998 - head/sbin/ping

2019-08-13 Thread O. Hartmann
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Am Tue, 13 Aug 2019 19:27:24 + (UTC)
Alan Somers  schrieb:

> Author: asomers
> Date: Tue Aug 13 19:27:23 2019
> New Revision: 350998
> URL: https://svnweb.freebsd.org/changeset/base/350998
> 
> Log:
>   ping: use the monotonic clock to measure durations
>   
>   Submitted by:   Ján Sučan 
>   MFC after:  2 weeks
>   Sponsored by:   Google, inc. (Google Summer of Code 2019)
>   Differential Revision:  https://reviews.freebsd.org/D21245
> 
> Modified:
>   head/sbin/ping/ping.c
> 
> Modified: head/sbin/ping/ping.c
> ==
> --- head/sbin/ping/ping.c Tue Aug 13 19:24:17 2019(r350997)
> +++ head/sbin/ping/ping.c Tue Aug 13 19:27:23 2019(r350998)
> @@ -96,6 +96,7 @@ __FBSDID("$FreeBSD$");
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  
>  #define  INADDR_LEN  ((int)sizeof(in_addr_t))
> @@ -119,7 +120,7 @@ __FBSDID("$FreeBSD$");
>  
>  struct tv32 {
>   int32_t tv32_sec;
> - int32_t tv32_usec;
> + int32_t tv32_nsec;
>  };
>  
>  /* various options */
> @@ -217,11 +218,10 @@ static char *pr_addr(struct in_addr);
>  static char *pr_ntime(n_time);
>  static void pr_icmph(struct icmp *);
>  static void pr_iph(struct ip *);
> -static void pr_pack(char *, int, struct sockaddr_in *, struct timeval *);
> +static void pr_pack(char *, int, struct sockaddr_in *, struct timespec *);
>  static void pr_retip(struct ip *);
>  static void status(int);
>  static void stopit(int);
> -static void tvsub(struct timeval *, const struct timeval *);
>  static void usage(void) __dead2;
>  
>  int
> @@ -229,7 +229,7 @@ main(int argc, char *const *argv)
>  {
>   struct sockaddr_in from, sock_in;
>   struct in_addr ifaddr;
> - struct timeval last, intvl;
> + struct timespec last, intvl;
>   struct iovec iov;
>   struct ip *ip;
>   struct msghdr msg;
> @@ -247,7 +247,7 @@ main(int argc, char *const *argv)
>   long ltmp;
>   int almost_done, ch, df, hold, i, icmp_len, mib[4], preload;
>   int ssend_errno, srecv_errno, tos, ttl;
> - char ctrl[CMSG_SPACE(sizeof(struct timeval))];
> + char ctrl[CMSG_SPACE(sizeof(struct timespec))];
>   char hnamebuf[MAXHOSTNAMELEN], snamebuf[MAXHOSTNAMELEN];
>  #ifdef IP_OPTIONS
>   char rspace[MAX_IPOPTLEN];  /* record route space */
> @@ -871,19 +871,19 @@ main(int argc, char *const *argv)
>   while (preload--)   /* fire off them quickies */
>   pinger();
>   }
> - (void)gettimeofday(, NULL);
> + (void)clock_gettime(CLOCK_MONOTONIC, );
>  
>   if (options & F_FLOOD) {
>   intvl.tv_sec = 0;
> - intvl.tv_usec = 1;
> + intvl.tv_nsec = 1000;
>   } else {
>   intvl.tv_sec = interval / 1000;
> - intvl.tv_usec = interval % 1000 * 1000;
> + intvl.tv_nsec = interval % 1000 * 100;
>   }
>  
>   almost_done = 0;
>   while (!finish_up) {
> - struct timeval now, timeout;
> + struct timespec now, timeout;
>   fd_set rfds;
>   int cc, n;
>  
> @@ -892,24 +892,16 @@ main(int argc, char *const *argv)
>   errx(EX_OSERR, "descriptor too large");
>   FD_ZERO();
>   FD_SET(srecv, );
> - (void)gettimeofday(, NULL);
> - timeout.tv_sec = last.tv_sec + intvl.tv_sec - now.tv_sec;
> - timeout.tv_usec = last.tv_usec + intvl.tv_usec - now.tv_usec;
> - while (timeout.tv_usec < 0) {
> - timeout.tv_usec += 100;
> - timeout.tv_sec--;
> - }
> - while (timeout.tv_usec >= 100) {
> - timeout.tv_usec -= 100;
> - timeout.tv_sec++;
> - }
> + (void)clock_gettime(CLOCK_MONOTONIC, );
> + timespecadd(, , );
> + timespecsub(, , );
>   if (timeout.tv_sec < 0)
> - timerclear();
> - n = select(srecv + 1, , NULL, NULL, );
> + timespecclear();
> + n = pselect(srecv + 1, , NULL, NULL, , NULL);
>   if (n < 0)
>   continue;   /* Must be EINTR. */
>   if (n == 1) {
> - struct timeval *tv = NULL;
> + struct timespec *tv = NULL;
>  #ifdef SO_TIMESTAMP
>   struct cmsghdr *cmsg = (struct cmsghdr *)
>  
> @@ -932,7 +924,7 @@ main(int argc, char *const *argv)
>   }
>  #endif
>   if (tv == NULL) {
> - (void)gettimeofday(, NULL);
> + (void)clock_gettime(CLOCK_MONOTONIC, );
>   tv = 
>   }
>   pr_pack((char *)packet, cc, , 

svn commit: r351006 - head/sys/dev/nvd

2019-08-13 Thread Alexander Motin
Author: mav
Date: Wed Aug 14 02:02:14 2019
New Revision: 351006
URL: https://svnweb.freebsd.org/changeset/base/351006

Log:
  Add missing break statements in r351004.
  
  Surprisingly code still worked, but thanks imp@ for noticing it.
  
  MFC after:1 week

Modified:
  head/sys/dev/nvd/nvd.c

Modified: head/sys/dev/nvd/nvd.c
==
--- head/sys/dev/nvd/nvd.c  Tue Aug 13 23:32:56 2019(r351005)
+++ head/sys/dev/nvd/nvd.c  Wed Aug 14 02:02:14 2019(r351006)
@@ -306,8 +306,10 @@ nvd_getattr(struct bio *bp)
nsdata = nvme_ns_get_data(ndisk->ns);
 
/* Try to return NGUID as lunid. */
-   for (i = 0; i < sizeof(nsdata->nguid); i++)
+   for (i = 0; i < sizeof(nsdata->nguid); i++) {
if (nsdata->nguid[i] != 0)
+   break;
+   }
if (i < sizeof(nsdata->nguid)) {
if (bp->bio_length < sizeof(nsdata->nguid) * 2 + 1)
return (EFAULT);
@@ -320,8 +322,10 @@ nvd_getattr(struct bio *bp)
}
 
/* Try to return EUI64 as lunid. */
-   for (i = 0; i < sizeof(nsdata->eui64); i++)
+   for (i = 0; i < sizeof(nsdata->eui64); i++) {
if (nsdata->eui64[i] != 0)
+   break;
+   }
if (i < sizeof(nsdata->eui64)) {
if (bp->bio_length < sizeof(nsdata->eui64) * 2 + 1)
return (EFAULT);
___
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: r351005 - in head: share/man/man4 sys/conf sys/geom/uzip sys/modules/geom/geom_uzip usr.bin/mkuzip

2019-08-13 Thread Conrad Meyer
Author: cem
Date: Tue Aug 13 23:32:56 2019
New Revision: 351005
URL: https://svnweb.freebsd.org/changeset/base/351005

Log:
  geom_uzip(4), mkuzip(8): Add Zstd image mode
  
  The Zstd format bumps the CLOOP major number to 4 to avoid incompatibility
  with older systems.  Support in geom_uzip(4) is conditional on the ZSTDIO
  kernel option, which is enabled in amd64 GENERIC, but not all in-tree
  configurations.
  
  mkuzip(8) was modified slightly to always initialize the nblocks + 1'th
  offset in the CLOOP file format.  Previously, it was only initialized in the
  case where the final compressed block happened to be unaligned w.r.t.
  DEV_BSIZE.  The "Fake" last+1 block change in r298619 means that the final
  compressed block's 'blen' was never correct unless the compressed uzip image
  happened to be BSIZE-aligned.  This happened in about 1 out of every 512
  cases.  The zlib and lzma decompressors are probably tolerant of extra trash
  following the frame they were told to decode, but Zstd complains that the
  input size is incorrect.
  
  Correspondingly, geom_uzip(4) was modified slightly to avoid trashing the
  nblocks + 1'th offset when it is known to be initialized to a good value.
  This corrects the calculated final real cluster compressed length to match
  that printed by mkuzip(8).
  
  mkuzip(8) was refactored somewhat to reduce code duplication and increase
  ease of adding other compression formats.
  
* Input block size validation was pulled out of individual compression
  init routines into main().
  
* Init routines now validate a user-provided compression level or select
  an algorithm-specific default, if none was provided.
  
* A new interface for calculating the maximal compressed size of an
  incompressible input block was added for each driver.  The generic code
  uses it to validate against MAXPHYS as well as to allocate compression
  result buffers in the generic code.
  
* Algorithm selection is now driven by a table lookup, to increase ease of
  adding other formats in the future.
  
  mkuzip(8) gained the ability to explicitly specify a compression level with
  '-C'.  The prior defaults -- 9 for zlib and 6 for lzma -- are maintained.
  The new zstd default is 9, to match zlib.
  
  Rather than select lzma or zlib with '-L' or its absense, respectively, a
  new argument '-A ' is provided to select 'zlib', 'lzma', or
  'zstd'.  '-L' is considered deprecated, but will probably never be removed.
  
  All of the new features were documented in mkuzip.8; the page was also
  cleaned up slightly.
  
  Relnotes: yes

Added:
  head/sys/geom/uzip/g_uzip_zstd.c   (contents, props changed)
  head/sys/geom/uzip/g_uzip_zstd.h   (contents, props changed)
  head/usr.bin/mkuzip/mkuz_zstd.c   (contents, props changed)
  head/usr.bin/mkuzip/mkuz_zstd.h   (contents, props changed)
Modified:
  head/share/man/man4/geom_uzip.4
  head/sys/conf/NOTES
  head/sys/conf/files
  head/sys/geom/uzip/g_uzip.c
  head/sys/geom/uzip/g_uzip_cloop.h
  head/sys/modules/geom/geom_uzip/Makefile
  head/usr.bin/mkuzip/Makefile
  head/usr.bin/mkuzip/mkuz_cfg.h
  head/usr.bin/mkuzip/mkuz_cloop.h
  head/usr.bin/mkuzip/mkuz_conveyor.c
  head/usr.bin/mkuzip/mkuz_format.h
  head/usr.bin/mkuzip/mkuz_lzma.c
  head/usr.bin/mkuzip/mkuz_lzma.h
  head/usr.bin/mkuzip/mkuz_zlib.c
  head/usr.bin/mkuzip/mkuz_zlib.h
  head/usr.bin/mkuzip/mkuzip.8
  head/usr.bin/mkuzip/mkuzip.c
  head/usr.bin/mkuzip/mkuzip.h

Modified: head/share/man/man4/geom_uzip.4
==
--- head/share/man/man4/geom_uzip.4 Tue Aug 13 21:49:07 2019
(r351004)
+++ head/share/man/man4/geom_uzip.4 Tue Aug 13 23:32:56 2019
(r351005)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd February 26, 2019
+.Dd August 13, 2019
 .Dt GEOM_UZIP 4
 .Os
 .Sh NAME
@@ -37,6 +37,7 @@ place the following line in your
 kernel configuration file:
 .Bd -ragged -offset indent
 .Cd "device xz"
+.Cd "options zstd"
 .Cd "options GEOM_UZIP"
 .Ed
 .Pp
@@ -163,6 +164,9 @@ Log operations involving compressed cluster number.
 .Xr md 4 ,
 .Xr geom 8 ,
 .Xr mkuzip 8
+.Sh HISTORY
+Zstd support was added in
+.Fx 13.0 .
 .Sh AUTHORS
 .An -nosplit
 The

Modified: head/sys/conf/NOTES
==
--- head/sys/conf/NOTES Tue Aug 13 21:49:07 2019(r351004)
+++ head/sys/conf/NOTES Tue Aug 13 23:32:56 2019(r351005)
@@ -2853,8 +2853,8 @@ options IMAGACT_BINMISC
 # This enables support for compressed core dumps.
 optionsGZIO
 
-# zstd I/O stream support
-# This enables support for Zstd compressed core dumps.
+# zstd support
+# This enables support for Zstd compressed core dumps and GEOM_UZIP images.
 optionsZSTDIO
 
 # BHND(4) drivers

Modified: head/sys/conf/files
==
--- head/sys/conf/files Tue 

svn commit: r351004 - head/sys/dev/nvd

2019-08-13 Thread Alexander Motin
Author: mav
Date: Tue Aug 13 21:49:07 2019
New Revision: 351004
URL: https://svnweb.freebsd.org/changeset/base/351004

Log:
  Make nvd(4) report NGUID or EUI64 as GEOM::lunid.
  
  With support for multiple namespaces and multiple ports in NVMe there is
  now a need for reliable unique namespace identification alike to SCSI.
  
  MFC after:1 weeks
  Sponsored by: iXsystems, Inc.

Modified:
  head/sys/dev/nvd/nvd.c

Modified: head/sys/dev/nvd/nvd.c
==
--- head/sys/dev/nvd/nvd.c  Tue Aug 13 21:15:59 2019(r351003)
+++ head/sys/dev/nvd/nvd.c  Tue Aug 13 21:49:07 2019(r351004)
@@ -54,6 +54,7 @@ struct nvd_controller;
 static disk_ioctl_t nvd_ioctl;
 static disk_strategy_t nvd_strategy;
 static dumper_t nvd_dump;
+static disk_getattr_t nvd_getattr;
 
 static void nvd_done(void *arg, const struct nvme_completion *cpl);
 static void nvd_gone(struct nvd_disk *ndisk);
@@ -294,6 +295,47 @@ nvd_dump(void *arg, void *virt, vm_offset_t phys, off_
return (nvme_ns_dump(ndisk->ns, virt, offset, len));
 }
 
+static int
+nvd_getattr(struct bio *bp)
+{
+   struct nvd_disk *ndisk = (struct nvd_disk *)bp->bio_disk->d_drv1;
+   const struct nvme_namespace_data *nsdata;
+   u_int i;
+
+   if (!strcmp("GEOM::lunid", bp->bio_attribute)) {
+   nsdata = nvme_ns_get_data(ndisk->ns);
+
+   /* Try to return NGUID as lunid. */
+   for (i = 0; i < sizeof(nsdata->nguid); i++)
+   if (nsdata->nguid[i] != 0)
+   if (i < sizeof(nsdata->nguid)) {
+   if (bp->bio_length < sizeof(nsdata->nguid) * 2 + 1)
+   return (EFAULT);
+   for (i = 0; i < sizeof(nsdata->nguid); i++) {
+   sprintf(>bio_data[i * 2], "%02x",
+   nsdata->nguid[i]);
+   }
+   bp->bio_completed = bp->bio_length;
+   return (0);
+   }
+
+   /* Try to return EUI64 as lunid. */
+   for (i = 0; i < sizeof(nsdata->eui64); i++)
+   if (nsdata->eui64[i] != 0)
+   if (i < sizeof(nsdata->eui64)) {
+   if (bp->bio_length < sizeof(nsdata->eui64) * 2 + 1)
+   return (EFAULT);
+   for (i = 0; i < sizeof(nsdata->eui64); i++) {
+   sprintf(>bio_data[i * 2], "%02x",
+   nsdata->eui64[i]);
+   }
+   bp->bio_completed = bp->bio_length;
+   return (0);
+   }
+   }
+   return (-1);
+}
+
 static void
 nvd_done(void *arg, const struct nvme_completion *cpl)
 {
@@ -403,6 +445,7 @@ nvd_new_disk(struct nvme_namespace *ns, void *ctrlr_ar
disk->d_strategy = nvd_strategy;
disk->d_ioctl = nvd_ioctl;
disk->d_dump = nvd_dump;
+   disk->d_getattr = nvd_getattr;
disk->d_gone = nvd_gonecb;
disk->d_name = NVD_STR;
disk->d_unit = ndisk->unit;
___
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: r351003 - head/sys/compat/linuxkpi/common/include/linux

2019-08-13 Thread John Baldwin
Author: jhb
Date: Tue Aug 13 21:15:59 2019
New Revision: 351003
URL: https://svnweb.freebsd.org/changeset/base/351003

Log:
  Fix build with DRM and INVARIANTS enabled.
  
  The DRM drivers use the lockdep assertion macros with spinlock_t locks
  which are backed by mutexes, not sx locks.  This causes compile
  failures since you can't use sx_assert with a mutex.  Instead, change
  the lockdep macros to use lock_class methods.  This works by assuming
  that each LinuxKPI locking primitive embeds a FreeBSD lock as its
  first structure and uses a cast to get to the underlying 'struct
  lock_object'.
  
  Reviewed by:  hselasky
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D20992

Modified:
  head/sys/compat/linuxkpi/common/include/linux/lockdep.h

Modified: head/sys/compat/linuxkpi/common/include/linux/lockdep.h
==
--- head/sys/compat/linuxkpi/common/include/linux/lockdep.h Tue Aug 13 
20:56:44 2019(r351002)
+++ head/sys/compat/linuxkpi/common/include/linux/lockdep.h Tue Aug 13 
21:15:59 2019(r351003)
@@ -40,13 +40,34 @@ struct lock_class_key {
 #definelockdep_set_current_reclaim_state(g) do { } while (0)
 #definelockdep_clear_current_reclaim_state() do { } while (0)
 
-#definelockdep_assert_held(m)  \
-   sx_assert(&(m)->sx, SA_XLOCKED)
+#ifdef INVARIANTS
+#definelockdep_assert_held(m) do { 
\
+   struct lock_object *__lock = (struct lock_object *)(m); \
+   LOCK_CLASS(__lock)->lc_assert(__lock, LA_LOCKED);   \
+} while (0)
 
-#definelockdep_assert_held_once(m) \
-   sx_assert(&(m)->sx, SA_XLOCKED | SA_NOTRECURSED)
+#definelockdep_assert_held_once(m) do {
\
+   struct lock_object *__lock = (struct lock_object *)(m); \
+   LOCK_CLASS(__lock)->lc_assert(__lock, LA_LOCKED | LA_NOTRECURSED); \
+} while (0)
 
-#definelockdep_is_held(m)  (sx_xholder(&(m)->sx) == curthread)
+static __inline bool
+lockdep_is_held(void *__m)
+{
+   struct lock_object *__lock;
+   struct thread *__td;
+
+   __lock = __m;
+   return (LOCK_CLASS(__lock)->lc_owner(__lock, &__td) != 0);
+}
+
+#else
+#definelockdep_assert_held(m) do { } while (0)
+
+#definelockdep_assert_held_once(m) do { } while (0)
+
+#definelockdep_is_held(m)  1
+#endif
 
 #definemight_lock(m)   do { } while (0)
 #definemight_lock_read(m) do { } while (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: r351002 - head/sys/ufs/ffs

2019-08-13 Thread Kirk McKusick
Author: mckusick
Date: Tue Aug 13 20:56:44 2019
New Revision: 351002
URL: https://svnweb.freebsd.org/changeset/base/351002

Log:
  Clarify comment that describes how the FS_METACKHASH is managed.
  
  MFC after: 3 days

Modified:
  head/sys/ufs/ffs/fs.h

Modified: head/sys/ufs/ffs/fs.h
==
--- head/sys/ufs/ffs/fs.h   Tue Aug 13 20:06:55 2019(r351001)
+++ head/sys/ufs/ffs/fs.h   Tue Aug 13 20:56:44 2019(r351002)
@@ -409,22 +409,27 @@ CTASSERT(sizeof(struct fs) == 1376);
  * The FS_UNCLEAN flag is set by the kernel when the filesystem was
  * mounted with fs_clean set to zero. The FS_DOSOFTDEP flag indicates
  * that the filesystem should be managed by the soft updates code.
- * Note that the FS_NEEDSFSCK flag is set and cleared only by the
- * fsck utility. It is set when background fsck finds an unexpected
+ * Note that the FS_NEEDSFSCK flag is set and cleared by the fsck
+ * utility. It is set when background fsck finds an unexpected
  * inconsistency which requires a traditional foreground fsck to be
  * run. Such inconsistencies should only be found after an uncorrectable
- * disk error. A foreground fsck will clear the FS_NEEDSFSCK flag when
- * it has successfully cleaned up the filesystem. The kernel uses this
+ * disk error. The FS_NEEDSFSCK can also be set when a mounted filesystem
+ * discovers an internal inconsistency such as freeing a freed inode.
+ * A foreground fsck will clear the FS_NEEDSFSCK flag when it has
+ * successfully cleaned up the filesystem. The kernel uses this
  * flag to enforce that inconsistent filesystems be mounted read-only.
- * The FS_INDEXDIRS flag when set indicates that the kernel maintains
- * on-disk auxiliary indexes (such as B-trees) for speeding directory
- * accesses. Kernels that do not support auxiliary indices clear the
- * flag to indicate that the indices need to be rebuilt (by fsck) before
- * they can be used. When a filesystem is mounted, any flags not
- * included in FS_SUPPORTED are cleared. This lets newer features
- * know that the filesystem has been run on an older version of the
- * filesystem and thus that data structures associated with those
- * features are out-of-date and need to be rebuilt.
+ *
+ * The FS_METACKHASH flag when set indicates that the kernel maintains
+ * one or more check hashes. The actual set of supported check hashes
+ * is stored in the fs_metackhash field. Kernels that do not support
+ * check hashes clear the FS_METACKHASH flag to indicate that the
+ * check hashes need to be rebuilt (by fsck) before they can be used.
+ *
+ * When a filesystem is mounted, any flags not included in FS_SUPPORTED
+ * are cleared. This lets newer features know that the filesystem has
+ * been run on an older version of the filesystem and thus that data
+ * structures associated with those features are out-of-date and need
+ * to be rebuilt.
  *
  * FS_ACLS indicates that POSIX.1e ACLs are administratively enabled
  * for the file system, so they should be loaded from extended attributes,
___
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: r351001 - in head: sbin/bsdlabel sbin/fdisk sbin/sunlabel share/man/man4 sys/conf sys/geom sys/modules/geom/geom_bsd sys/modules/geom/geom_fox sys/modules/geom/geom_mbr sys/modules/geom...

2019-08-13 Thread Conrad Meyer
Author: cem
Date: Tue Aug 13 20:06:55 2019
New Revision: 351001
URL: https://svnweb.freebsd.org/changeset/base/351001

Log:
  Remove deprecated GEOM classes
  
  Follow-up on r322318 and r322319 and remove the deprecated modules.
  
  Shift some now-unused kernel files into userspace utilities that incorporate
  them.  Remove references to removed GEOM classes in userspace utilities.
  
  Reviewed by:  imp (earlier version)
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D21249

Added:
  head/sbin/fdisk/fdisk_mbr_enc.c
 - copied, changed from r351000, head/sys/geom/geom_mbr_enc.c
  head/sbin/fdisk/fdisk_mbr_enc.h   (contents, props changed)
  head/sbin/sunlabel/sun_disklabel.h
 - copied unchanged from r351000, head/sys/sys/sun_disklabel.h
  head/sbin/sunlabel/sunlabel_enc.c
 - copied, changed from r351000, head/sys/geom/geom_sunlabel_enc.c
Deleted:
  head/share/man/man4/geom_fox.4
  head/sys/geom/geom_bsd.c
  head/sys/geom/geom_fox.c
  head/sys/geom/geom_mbr.c
  head/sys/geom/geom_mbr_enc.c
  head/sys/geom/geom_sunlabel.c
  head/sys/geom/geom_sunlabel_enc.c
  head/sys/geom/geom_vol_ffs.c
  head/sys/modules/geom/geom_bsd/
  head/sys/modules/geom/geom_fox/
  head/sys/modules/geom/geom_mbr/
  head/sys/modules/geom/geom_sunlabel/
  head/sys/modules/geom/geom_vol_ffs/
  head/sys/sys/sun_disklabel.h
Modified:
  head/sbin/bsdlabel/bsdlabel.c
  head/sbin/fdisk/Makefile
  head/sbin/fdisk/fdisk.c
  head/sbin/sunlabel/Makefile
  head/sbin/sunlabel/sunlabel.c
  head/share/man/man4/Makefile
  head/share/man/man4/geom.4
  head/sys/conf/NOTES
  head/sys/conf/files
  head/sys/conf/options
  head/sys/sys/diskmbr.h
  head/usr.sbin/boot0cfg/boot0cfg.c

Modified: head/sbin/bsdlabel/bsdlabel.c
==
--- head/sbin/bsdlabel/bsdlabel.c   Tue Aug 13 19:39:36 2019
(r351000)
+++ head/sbin/bsdlabel/bsdlabel.c   Tue Aug 13 20:06:55 2019
(r351001)
@@ -381,8 +381,6 @@ static int
 writelabel(void)
 {
int i, fd, serrno;
-   struct gctl_req *grq;
-   char const *errstr;
struct disklabel *lp = 
 
if (disable_write) {
@@ -423,39 +421,8 @@ writelabel(void)
return (1);
}
 
-   /* Give up if GEOM_BSD is not available. */
-   if (geom_class_available("BSD") == 0) {
-   warnc(serrno, "%s", specname);
-   return (1);
-   }
-
-   grq = gctl_get_handle();
-   gctl_ro_param(grq, "verb", -1, "write label");
-   gctl_ro_param(grq, "class", -1, "BSD");
-   gctl_ro_param(grq, "geom", -1, pname);
-   gctl_ro_param(grq, "label", 148+16*8,
-   bootarea + labeloffset + labelsoffset * lab.d_secsize);
-   errstr = gctl_issue(grq);
-   if (errstr != NULL) {
-   warnx("%s", errstr);
-   gctl_free(grq);
-   return(1);
-   }
-   gctl_free(grq);
-   if (installboot) {
-   grq = gctl_get_handle();
-   gctl_ro_param(grq, "verb", -1, "write bootcode");
-   gctl_ro_param(grq, "class", -1, "BSD");
-   gctl_ro_param(grq, "geom", -1, pname);
-   gctl_ro_param(grq, "bootcode", BBSIZE, bootarea);
-   errstr = gctl_issue(grq);
-   if (errstr != NULL) {
-   warnx("%s", errstr);
-   gctl_free(grq);
-   return (1);
-   }
-   gctl_free(grq);
-   }
+   warnc(serrno, "%s", specname);
+   return (1);
} else {
if (write(fd, bootarea, bbsize) != bbsize) {
warn("write %s", specname);

Modified: head/sbin/fdisk/Makefile
==
--- head/sbin/fdisk/MakefileTue Aug 13 19:39:36 2019(r351000)
+++ head/sbin/fdisk/MakefileTue Aug 13 20:06:55 2019(r351001)
@@ -2,11 +2,9 @@
 
 PACKAGE=runtime
 PROG=  fdisk
-SRCS=  fdisk.c geom_mbr_enc.c
+SRCS=  fdisk.c fdisk_mbr_enc.c
 WARNS?=4
 MAN=   fdisk.8
-
-.PATH: ${SRCTOP}/sys/geom
 
 LIBADD=geom
 

Modified: head/sbin/fdisk/fdisk.c
==
--- head/sbin/fdisk/fdisk.c Tue Aug 13 19:39:36 2019(r351000)
+++ head/sbin/fdisk/fdisk.c Tue Aug 13 20:06:55 2019(r351001)
@@ -47,6 +47,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include "fdisk_mbr_enc.h"
+
 static int iotest;
 
 #define NO_DISK_SECTORS ((u_int32_t)-1)
@@ -786,47 +788,17 @@ geom_class_available(const char *name)
 static int
 write_disk(off_t sector, 

svn commit: r351000 - in head/sys: amd64/vmm/io x86/x86

2019-08-13 Thread Ed Maste
Author: emaste
Date: Tue Aug 13 19:39:36 2019
New Revision: 351000
URL: https://svnweb.freebsd.org/changeset/base/351000

Log:
  sys/{x86,amd64}: remove one of doubled ;s
  
  MFC after:1 week

Modified:
  head/sys/amd64/vmm/io/vlapic.c
  head/sys/x86/x86/local_apic.c

Modified: head/sys/amd64/vmm/io/vlapic.c
==
--- head/sys/amd64/vmm/io/vlapic.c  Tue Aug 13 19:29:33 2019
(r350999)
+++ head/sys/amd64/vmm/io/vlapic.c  Tue Aug 13 19:39:36 2019
(r351000)
@@ -316,7 +316,7 @@ vlapic_get_lvtptr(struct vlapic *vlapic, uint32_t offs
return (>lvt_cmci);
case APIC_OFFSET_TIMER_LVT ... APIC_OFFSET_ERROR_LVT:
i = (offset - APIC_OFFSET_TIMER_LVT) >> 2;
-   return ((>lvt_timer) + i);;
+   return ((>lvt_timer) + i);
default:
panic("vlapic_get_lvt: invalid LVT\n");
}

Modified: head/sys/x86/x86/local_apic.c
==
--- head/sys/x86/x86/local_apic.c   Tue Aug 13 19:29:33 2019
(r350999)
+++ head/sys/x86/x86/local_apic.c   Tue Aug 13 19:39:36 2019
(r351000)
@@ -130,7 +130,7 @@ struct lvt {
 
 struct lapic {
struct lvt la_lvts[APIC_LVT_MAX + 1];
-   struct lvt la_elvts[APIC_ELVT_MAX + 1];;
+   struct lvt la_elvts[APIC_ELVT_MAX + 1];
u_int la_id:8;
u_int la_cluster:4;
u_int la_cluster_id:2;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r350999 - stable/11/sys/dev/nvd

2019-08-13 Thread Alexander Motin
Author: mav
Date: Tue Aug 13 19:29:33 2019
New Revision: 350999
URL: https://svnweb.freebsd.org/changeset/base/350999

Log:
  MFC r350961: Missed part of r350523.

Modified:
  stable/11/sys/dev/nvd/nvd.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/nvd/nvd.c
==
--- stable/11/sys/dev/nvd/nvd.c Tue Aug 13 19:27:23 2019(r350998)
+++ stable/11/sys/dev/nvd/nvd.c Tue Aug 13 19:29:33 2019(r350999)
@@ -275,17 +275,12 @@ nvd_gonecb(struct disk *dp)
 }
 
 static int
-nvd_ioctl(struct disk *ndisk, u_long cmd, void *data, int fflag,
+nvd_ioctl(struct disk *dp, u_long cmd, void *data, int fflag,
 struct thread *td)
 {
-   int ret = 0;
+   struct nvd_disk *ndisk = dp->d_drv1;
 
-   switch (cmd) {
-   default:
-   ret = EIO;
-   }
-
-   return (ret);
+   return (nvme_ns_ioctl_process(ndisk->ns, cmd, data, fflag, td));
 }
 
 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: r350998 - head/sbin/ping

2019-08-13 Thread Alan Somers
Author: asomers
Date: Tue Aug 13 19:27:23 2019
New Revision: 350998
URL: https://svnweb.freebsd.org/changeset/base/350998

Log:
  ping: use the monotonic clock to measure durations
  
  Submitted by: Ján Sučan 
  MFC after:2 weeks
  Sponsored by: Google, inc. (Google Summer of Code 2019)
  Differential Revision:https://reviews.freebsd.org/D21245

Modified:
  head/sbin/ping/ping.c

Modified: head/sbin/ping/ping.c
==
--- head/sbin/ping/ping.c   Tue Aug 13 19:24:17 2019(r350997)
+++ head/sbin/ping/ping.c   Tue Aug 13 19:27:23 2019(r350998)
@@ -96,6 +96,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #defineINADDR_LEN  ((int)sizeof(in_addr_t))
@@ -119,7 +120,7 @@ __FBSDID("$FreeBSD$");
 
 struct tv32 {
int32_t tv32_sec;
-   int32_t tv32_usec;
+   int32_t tv32_nsec;
 };
 
 /* various options */
@@ -217,11 +218,10 @@ static char *pr_addr(struct in_addr);
 static char *pr_ntime(n_time);
 static void pr_icmph(struct icmp *);
 static void pr_iph(struct ip *);
-static void pr_pack(char *, int, struct sockaddr_in *, struct timeval *);
+static void pr_pack(char *, int, struct sockaddr_in *, struct timespec *);
 static void pr_retip(struct ip *);
 static void status(int);
 static void stopit(int);
-static void tvsub(struct timeval *, const struct timeval *);
 static void usage(void) __dead2;
 
 int
@@ -229,7 +229,7 @@ main(int argc, char *const *argv)
 {
struct sockaddr_in from, sock_in;
struct in_addr ifaddr;
-   struct timeval last, intvl;
+   struct timespec last, intvl;
struct iovec iov;
struct ip *ip;
struct msghdr msg;
@@ -247,7 +247,7 @@ main(int argc, char *const *argv)
long ltmp;
int almost_done, ch, df, hold, i, icmp_len, mib[4], preload;
int ssend_errno, srecv_errno, tos, ttl;
-   char ctrl[CMSG_SPACE(sizeof(struct timeval))];
+   char ctrl[CMSG_SPACE(sizeof(struct timespec))];
char hnamebuf[MAXHOSTNAMELEN], snamebuf[MAXHOSTNAMELEN];
 #ifdef IP_OPTIONS
char rspace[MAX_IPOPTLEN];  /* record route space */
@@ -871,19 +871,19 @@ main(int argc, char *const *argv)
while (preload--)   /* fire off them quickies */
pinger();
}
-   (void)gettimeofday(, NULL);
+   (void)clock_gettime(CLOCK_MONOTONIC, );
 
if (options & F_FLOOD) {
intvl.tv_sec = 0;
-   intvl.tv_usec = 1;
+   intvl.tv_nsec = 1000;
} else {
intvl.tv_sec = interval / 1000;
-   intvl.tv_usec = interval % 1000 * 1000;
+   intvl.tv_nsec = interval % 1000 * 100;
}
 
almost_done = 0;
while (!finish_up) {
-   struct timeval now, timeout;
+   struct timespec now, timeout;
fd_set rfds;
int cc, n;
 
@@ -892,24 +892,16 @@ main(int argc, char *const *argv)
errx(EX_OSERR, "descriptor too large");
FD_ZERO();
FD_SET(srecv, );
-   (void)gettimeofday(, NULL);
-   timeout.tv_sec = last.tv_sec + intvl.tv_sec - now.tv_sec;
-   timeout.tv_usec = last.tv_usec + intvl.tv_usec - now.tv_usec;
-   while (timeout.tv_usec < 0) {
-   timeout.tv_usec += 100;
-   timeout.tv_sec--;
-   }
-   while (timeout.tv_usec >= 100) {
-   timeout.tv_usec -= 100;
-   timeout.tv_sec++;
-   }
+   (void)clock_gettime(CLOCK_MONOTONIC, );
+   timespecadd(, , );
+   timespecsub(, , );
if (timeout.tv_sec < 0)
-   timerclear();
-   n = select(srecv + 1, , NULL, NULL, );
+   timespecclear();
+   n = pselect(srecv + 1, , NULL, NULL, , NULL);
if (n < 0)
continue;   /* Must be EINTR. */
if (n == 1) {
-   struct timeval *tv = NULL;
+   struct timespec *tv = NULL;
 #ifdef SO_TIMESTAMP
struct cmsghdr *cmsg = (struct cmsghdr *)
 
@@ -932,7 +924,7 @@ main(int argc, char *const *argv)
}
 #endif
if (tv == NULL) {
-   (void)gettimeofday(, NULL);
+   (void)clock_gettime(CLOCK_MONOTONIC, );
tv = 
}
pr_pack((char *)packet, cc, , tv);
@@ -956,17 +948,17 @@ main(int argc, char *const *argv)
if (almost_done)
break;
almost_done = 1;
- 

svn commit: r350997 - head/sbin/ping6

2019-08-13 Thread Alan Somers
Author: asomers
Date: Tue Aug 13 19:24:17 2019
New Revision: 350997
URL: https://svnweb.freebsd.org/changeset/base/350997

Log:
  ping6: use the monotonic clock to measure durations
  
  Submitted by: Ján Sučan 
  MFC after:2 weeks
  Sponsored by: Google, inc. (Google Summer of Code 2019)
  Differential Revision:https://reviews.freebsd.org/D21226

Modified:
  head/sbin/ping6/ping6.c

Modified: head/sbin/ping6/ping6.c
==
--- head/sbin/ping6/ping6.c Tue Aug 13 19:23:45 2019(r350996)
+++ head/sbin/ping6/ping6.c Tue Aug 13 19:24:17 2019(r350997)
@@ -107,7 +107,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 
 #include 
 #include 
@@ -133,6 +132,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #ifdef IPSEC
@@ -144,7 +144,7 @@ __FBSDID("$FreeBSD$");
 
 struct tv32 {
u_int32_t tv32_sec;
-   u_int32_t tv32_usec;
+   u_int32_t tv32_nsec;
 };
 
 #define MAXPACKETLEN   131072
@@ -288,7 +288,6 @@ static void  pr_rthdr(void *, size_t);
 static int  pr_bitrange(u_int32_t, int, int);
 static void pr_retip(struct ip6_hdr *, u_char *);
 static void summary(void);
-static void tvsub(struct timeval *, struct timeval *);
 static int  setpolicy(int, char *);
 static char*nigroup(char *, int);
 static void usage(void);
@@ -296,7 +295,7 @@ static void  usage(void);
 int
 main(int argc, char *argv[])
 {
-   struct timeval last, intvl;
+   struct timespec last, intvl;
struct sockaddr_in6 from, *sin6;
struct addrinfo hints, *res;
struct sigaction si_sa;
@@ -456,15 +455,15 @@ main(int argc, char *argv[])
errx(1, "%s: only root may use interval < 1s",
strerror(EPERM));
}
-   intvl.tv_sec = (long)t;
-   intvl.tv_usec =
-   (long)((t - intvl.tv_sec) * 100);
+   intvl.tv_sec = (time_t)t;
+   intvl.tv_nsec =
+   (long)((t - intvl.tv_sec) * 10);
if (intvl.tv_sec < 0)
errx(1, "illegal timing interval %s", optarg);
/* less than 1/hz does not make sense */
-   if (intvl.tv_sec == 0 && intvl.tv_usec < 1) {
+   if (intvl.tv_sec == 0 && intvl.tv_nsec < 1000) {
warnx("too small interval, raised to .01");
-   intvl.tv_usec = 1;
+   intvl.tv_nsec = 1000;
}
options |= F_INTERVAL;
break;
@@ -1102,7 +1101,7 @@ main(int argc, char *argv[])
while (preload--)
pinger();
}
-   gettimeofday(, NULL);
+   clock_gettime(CLOCK_MONOTONIC, );
 
sigemptyset(_sa.sa_mask);
si_sa.sa_flags = 0;
@@ -1121,15 +1120,15 @@ main(int argc, char *argv[])
}
if (options & F_FLOOD) {
intvl.tv_sec = 0;
-   intvl.tv_usec = 1;
+   intvl.tv_nsec = 1000;
} else if ((options & F_INTERVAL) == 0) {
intvl.tv_sec = interval / 1000;
-   intvl.tv_usec = interval % 1000 * 1000;
+   intvl.tv_nsec = interval % 1000 * 100;
}
 
almost_done = 0;
while (seenint == 0) {
-   struct timeval now, timeout;
+   struct timespec now, timeout;
struct msghdr m;
struct iovec iov[2];
fd_set rfds;
@@ -1147,21 +1146,13 @@ main(int argc, char *argv[])
 #endif
FD_ZERO();
FD_SET(srecv, );
-   gettimeofday(, NULL);
-   timeout.tv_sec = last.tv_sec + intvl.tv_sec - now.tv_sec;
-   timeout.tv_usec = last.tv_usec + intvl.tv_usec - now.tv_usec;
-   while (timeout.tv_usec < 0) {
-   timeout.tv_usec += 100;
-   timeout.tv_sec--;
-   }
-   while (timeout.tv_usec > 100) {
-   timeout.tv_usec -= 100;
-   timeout.tv_sec++;
-   }
+   clock_gettime(CLOCK_MONOTONIC, );
+   timespecadd(, , );
+   timespecsub(, , );
if (timeout.tv_sec < 0)
-   timeout.tv_sec = timeout.tv_usec = 0;
+   timespecclear();
 
-   n = select(srecv + 1, , NULL, NULL, );
+   n = pselect(srecv + 1, , NULL, NULL, , NULL);
if (n < 0)
continue;   /* EINTR */
if (n == 1) {
@@ -1222,17 +1213,18 @@ main(int argc, char *argv[])
 * 

svn commit: r350996 - stable/11/sys/dev/nvme

2019-08-13 Thread Alexander Motin
Author: mav
Date: Tue Aug 13 19:23:45 2019
New Revision: 350996
URL: https://svnweb.freebsd.org/changeset/base/350996

Log:
  MFC kernel part of r350523, r350524, r350961:
  Add IOCTL to translate nvdX into nvmeY and NSID.
  
  While very useful by itself, it also makes `nvmecontrol` not depend on
  hardcoded device names parsing, that in its turn makes simple to take
  nvdX (and potentially any other) device names as arguments.
  
  Also added IOCTL bypass from nvdX to respective nvmeYnsZ makes them
  interchangeable for management purposes.

Modified:
  stable/11/sys/dev/nvme/nvme.h
  stable/11/sys/dev/nvme/nvme_ctrlr.c
  stable/11/sys/dev/nvme/nvme_ns.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/nvme/nvme.h
==
--- stable/11/sys/dev/nvme/nvme.h   Tue Aug 13 19:17:44 2019
(r350995)
+++ stable/11/sys/dev/nvme/nvme.h   Tue Aug 13 19:23:45 2019
(r350996)
@@ -37,6 +37,7 @@
 
 #defineNVME_PASSTHROUGH_CMD_IOWR('n', 0, struct 
nvme_pt_command)
 #defineNVME_RESET_CONTROLLER   _IO('n', 1)
+#defineNVME_GET_NSID   _IOR('n', 2, struct 
nvme_get_nsid)
 
 #defineNVME_IO_TEST_IOWR('n', 100, struct 
nvme_io_test)
 #defineNVME_BIO_TEST   _IOWR('n', 101, struct 
nvme_io_test)
@@ -1047,6 +1048,11 @@ struct nvme_pt_command {
struct mtx *driver_lock;
 };
 
+struct nvme_get_nsid {
+   charcdev[SPECNAMELEN + 1];
+   uint32_tnsid;
+};
+
 #define nvme_completion_is_error(cpl)  \
((cpl)->status.sc != 0 || (cpl)->status.sct != 0)
 
@@ -1055,6 +1061,7 @@ void  nvme_strvis(uint8_t *dst, const uint8_t *src, 
int
 #ifdef _KERNEL
 
 struct bio;
+struct thread;
 
 struct nvme_namespace;
 struct nvme_controller;
@@ -1137,6 +1144,8 @@ uint32_t  nvme_ns_get_stripesize(struct nvme_namespace 
 
 intnvme_ns_bio_process(struct nvme_namespace *ns, struct bio *bp,
nvme_cb_fn_t cb_fn);
+intnvme_ns_ioctl_process(struct nvme_namespace *ns, u_long cmd,
+caddr_t arg, int flag, struct thread *td);
 
 /*
  * Command building helper functions -- shared with CAM

Modified: stable/11/sys/dev/nvme/nvme_ctrlr.c
==
--- stable/11/sys/dev/nvme/nvme_ctrlr.c Tue Aug 13 19:17:44 2019
(r350995)
+++ stable/11/sys/dev/nvme/nvme_ctrlr.c Tue Aug 13 19:23:45 2019
(r350996)
@@ -1047,6 +1047,14 @@ nvme_ctrlr_ioctl(struct cdev *cdev, u_long cmd, caddr_
pt = (struct nvme_pt_command *)arg;
return (nvme_ctrlr_passthrough_cmd(ctrlr, pt, pt->cmd.nsid,
1 /* is_user_buffer */, 1 /* is_admin_cmd */));
+   case NVME_GET_NSID:
+   {
+   struct nvme_get_nsid *gnsid = (struct nvme_get_nsid *)arg;
+   strncpy(gnsid->cdev, device_get_nameunit(ctrlr->dev),
+   sizeof(gnsid->cdev));
+   gnsid->nsid = 0;
+   break;
+   }
default:
return (ENOTTY);
}

Modified: stable/11/sys/dev/nvme/nvme_ns.c
==
--- stable/11/sys/dev/nvme/nvme_ns.cTue Aug 13 19:17:44 2019
(r350995)
+++ stable/11/sys/dev/nvme/nvme_ns.cTue Aug 13 19:23:45 2019
(r350996)
@@ -80,6 +80,14 @@ nvme_ns_ioctl(struct cdev *cdev, u_long cmd, caddr_t a
pt = (struct nvme_pt_command *)arg;
return (nvme_ctrlr_passthrough_cmd(ctrlr, pt, ns->id, 
1 /* is_user_buffer */, 0 /* is_admin_cmd */));
+   case NVME_GET_NSID:
+   {
+   struct nvme_get_nsid *gnsid = (struct nvme_get_nsid *)arg;
+   strncpy(gnsid->cdev, device_get_nameunit(ctrlr->dev),
+   sizeof(gnsid->cdev));
+   gnsid->nsid = ns->id;
+   break;
+   }
case DIOCGMEDIASIZE:
*(off_t *)arg = (off_t)nvme_ns_get_size(ns);
break;
@@ -466,6 +474,13 @@ nvme_ns_bio_process(struct nvme_namespace *ns, struct 
}
 
return (err);
+}
+
+int
+nvme_ns_ioctl_process(struct nvme_namespace *ns, u_long cmd, caddr_t arg,
+int flag, struct thread *td)
+{
+   return (nvme_ns_ioctl(ns->cdev, cmd, arg, flag, td));
 }
 
 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: r350995 - stable/12/sys/dev/nvd

2019-08-13 Thread Alexander Motin
Author: mav
Date: Tue Aug 13 19:17:44 2019
New Revision: 350995
URL: https://svnweb.freebsd.org/changeset/base/350995

Log:
  MFC r350961: Missed part of r350523.

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

Modified: stable/12/sys/dev/nvd/nvd.c
==
--- stable/12/sys/dev/nvd/nvd.c Tue Aug 13 16:25:23 2019(r350994)
+++ stable/12/sys/dev/nvd/nvd.c Tue Aug 13 19:17:44 2019(r350995)
@@ -277,17 +277,12 @@ nvd_gonecb(struct disk *dp)
 }
 
 static int
-nvd_ioctl(struct disk *ndisk, u_long cmd, void *data, int fflag,
+nvd_ioctl(struct disk *dp, u_long cmd, void *data, int fflag,
 struct thread *td)
 {
-   int ret = 0;
+   struct nvd_disk *ndisk = dp->d_drv1;
 
-   switch (cmd) {
-   default:
-   ret = EIO;
-   }
-
-   return (ret);
+   return (nvme_ns_ioctl_process(ndisk->ns, cmd, data, fflag, td));
 }
 
 static int
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r350993 - head/sbin/ping6

2019-08-13 Thread Warner Losh
On Tue, Aug 13, 2019 at 10:50 AM Enji Cooper (yaneurabeya) <
yaneurab...@gmail.com> wrote:

>
> > On Aug 13, 2019, at 09:22, Alan Somers  wrote:
> >
> > Author: asomers
> > Date: Tue Aug 13 16:22:43 2019
> > New Revision: 350993
> > URL: https://svnweb.freebsd.org/changeset/base/350993
> >
> > Log:
> >  Consistently use the byteorder functions in the correct direction
> >
> >  Though ntohs and htons are functionally identical, they have different
> meanings.Using the correct one helps to document the code.
>
> This statement is only true for BE platforms. For LE platforms like
> i386/x64, ntohs and htons actually does a endianness conversion:
>
> sys/powerpc/include/endian.h:#define__ntohs(x)
> (__bswap16((__uint16_t)(x)))
> sys/powerpc/include/endian.h:#define__ntohs(x)  ((__uint16_t)(x))
> sys/sparc64/include/endian.h:#define__ntohs(x)  ((__uint16_t)(x))
> sys/x86/include/endian.h:#define__ntohs(x)  __bswap16(x)
> sys/mips/include/endian.h:#define   __ntohs(x)  ((__uint16_t)(x))
> sys/mips/include/endian.h:#define __ntohs(x)(__bswap16((x)))
> sys/arm/include/endian.h:#define __ntohs(x) ((__uint16_t)(x))
> sys/arm/include/endian.h:#define __ntohs(x)(__bswap16(x))
> sys/arm64/include/endian.h:#define  __ntohs(x)(__bswap16(x))
> sys/riscv/include/endian.h:#define  __ntohs(x)(__bswap16(x))
> sys/sys/param.h:#define ntohs(x)__ntohs(x)
> sys/netinet/in.h:#definentohs(x)__ntohs(x)
>

The statement was that htons and ntohs are the same actual code, but
document different things. And that's correct. htons and ntohs can be used
indiscriminately and the code will still work. But using htons when putting
data into network byte order and ntohs when putting it into host order
documents the operations better. This is independent of endian: either both
do nothing, or both do bswap16.

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


Re: svn commit: r350993 - head/sbin/ping6

2019-08-13 Thread Enji Cooper (yaneurabeya)


> On Aug 13, 2019, at 09:22, Alan Somers  wrote:
> 
> Author: asomers
> Date: Tue Aug 13 16:22:43 2019
> New Revision: 350993
> URL: https://svnweb.freebsd.org/changeset/base/350993
> 
> Log:
>  Consistently use the byteorder functions in the correct direction
> 
>  Though ntohs and htons are functionally identical, they have different 
> meanings.Using the correct one helps to document the code.

This statement is only true for BE platforms. For LE platforms like i386/x64, 
ntohs and htons actually does a endianness conversion:

sys/powerpc/include/endian.h:#define__ntohs(x)  
(__bswap16((__uint16_t)(x)))
sys/powerpc/include/endian.h:#define__ntohs(x)  ((__uint16_t)(x))
sys/sparc64/include/endian.h:#define__ntohs(x)  ((__uint16_t)(x))
sys/x86/include/endian.h:#define__ntohs(x)  __bswap16(x)
sys/mips/include/endian.h:#define   __ntohs(x)  ((__uint16_t)(x))
sys/mips/include/endian.h:#define __ntohs(x)(__bswap16((x)))
sys/arm/include/endian.h:#define __ntohs(x) ((__uint16_t)(x))
sys/arm/include/endian.h:#define __ntohs(x)(__bswap16(x))
sys/arm64/include/endian.h:#define  __ntohs(x)(__bswap16(x))
sys/riscv/include/endian.h:#define  __ntohs(x)(__bswap16(x))
sys/sys/param.h:#define ntohs(x)__ntohs(x)
sys/netinet/in.h:#definentohs(x)__ntohs(x)

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


svn commit: r350994 - head/sbin/ping

2019-08-13 Thread Alan Somers
Author: asomers
Date: Tue Aug 13 16:25:23 2019
New Revision: 350994
URL: https://svnweb.freebsd.org/changeset/base/350994

Log:
  ping: fix data type of a variable for a packet sequence number
  
  Submitted by: Ján Sučan 
  MFC after:2 weeks
  Sponsored by: Google, inc. (Google Summer of Code 2019)
  Differential Revision:https://reviews.freebsd.org/D21244

Modified:
  head/sbin/ping/ping.c

Modified: head/sbin/ping/ping.c
==
--- head/sbin/ping/ping.c   Tue Aug 13 16:22:43 2019(r350993)
+++ head/sbin/ping/ping.c   Tue Aug 13 16:25:23 2019(r350994)
@@ -1087,7 +1087,8 @@ pr_pack(char *buf, int cc, struct sockaddr_in *from, s
struct ip *ip;
const void *tp;
double triptime;
-   int dupflag, hlen, i, j, recv_len, seq;
+   int dupflag, hlen, i, j, recv_len;
+   uint16_t seq;
static int old_rrlen;
static char old_rr[MAX_IPOPTLEN];
 
___
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: r350993 - head/sbin/ping6

2019-08-13 Thread Alan Somers
Author: asomers
Date: Tue Aug 13 16:22:43 2019
New Revision: 350993
URL: https://svnweb.freebsd.org/changeset/base/350993

Log:
  Consistently use the byteorder functions in the correct direction
  
  Though ntohs and htons are functionally identical, they have different 
meanings.Using the correct one helps to document the code.
  
  Submitted by: Ján Sučan 
  MFC after:2 weeks
  Sponsored by: Google, inc. (Google Summer of Code 2019)
  Differential Revision:https://reviews.freebsd.org/D21219

Modified:
  head/sbin/ping6/ping6.c

Modified: head/sbin/ping6/ping6.c
==
--- head/sbin/ping6/ping6.c Tue Aug 13 15:52:28 2019(r350992)
+++ head/sbin/ping6/ping6.c Tue Aug 13 16:22:43 2019(r350993)
@@ -1324,7 +1324,7 @@ pinger(void)
 
memcpy(nip->icmp6_ni_nonce, nonce,
sizeof(nip->icmp6_ni_nonce));
-   *(u_int16_t *)nip->icmp6_ni_nonce = ntohs(seq);
+   *(u_int16_t *)nip->icmp6_ni_nonce = htons(seq);
 
memcpy([ICMP6_NIQLEN], _addr,
sizeof(dst.sin6_addr));
@@ -1339,7 +1339,7 @@ pinger(void)
 
memcpy(nip->icmp6_ni_nonce, nonce,
sizeof(nip->icmp6_ni_nonce));
-   *(u_int16_t *)nip->icmp6_ni_nonce = ntohs(seq);
+   *(u_int16_t *)nip->icmp6_ni_nonce = htons(seq);
 
cc = ICMP6_NIQLEN;
datalen = 0;
@@ -1351,7 +1351,7 @@ pinger(void)
 
memcpy(nip->icmp6_ni_nonce, nonce,
sizeof(nip->icmp6_ni_nonce));
-   *(u_int16_t *)nip->icmp6_ni_nonce = ntohs(seq);
+   *(u_int16_t *)nip->icmp6_ni_nonce = htons(seq);
 
memcpy([ICMP6_NIQLEN], _addr,
sizeof(dst.sin6_addr));
@@ -1366,14 +1366,14 @@ pinger(void)
 
memcpy(nip->icmp6_ni_nonce, nonce,
sizeof(nip->icmp6_ni_nonce));
-   *(u_int16_t *)nip->icmp6_ni_nonce = ntohs(seq);
+   *(u_int16_t *)nip->icmp6_ni_nonce = htons(seq);
cc = ICMP6_NIQLEN;
datalen = 0;
} else {
icp->icmp6_type = ICMP6_ECHO_REQUEST;
icp->icmp6_code = 0;
icp->icmp6_id = htons(ident);
-   icp->icmp6_seq = ntohs(seq);
+   icp->icmp6_seq = htons(seq);
if (timing) {
struct timeval tv;
struct tv32 *tv32;
___
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: r350992 - head/tests/sys/fs/fusefs

2019-08-13 Thread Alan Somers
Author: asomers
Date: Tue Aug 13 15:52:28 2019
New Revision: 350992
URL: https://svnweb.freebsd.org/changeset/base/350992

Log:
  fusefs: skip some tests when unsafe aio is disabled
  
  MFC after:  15 days
  MFC-With:   r350665
  Sponsored by:   The FreeBSD Foundation

Modified:
  head/tests/sys/fs/fusefs/fsync.cc
  head/tests/sys/fs/fusefs/fsyncdir.cc
  head/tests/sys/fs/fusefs/read.cc
  head/tests/sys/fs/fusefs/utils.cc
  head/tests/sys/fs/fusefs/utils.hh
  head/tests/sys/fs/fusefs/write.cc
Directory Properties:
  head/   (props changed)

Modified: head/tests/sys/fs/fusefs/fsync.cc
==
--- head/tests/sys/fs/fusefs/fsync.cc   Tue Aug 13 15:50:47 2019
(r350991)
+++ head/tests/sys/fs/fusefs/fsync.cc   Tue Aug 13 15:52:28 2019
(r350992)
@@ -82,8 +82,17 @@ void expect_write(uint64_t ino, uint64_t size, const v
 
 };
 
+class AioFsync: public Fsync {
+virtual void SetUp() {
+   if (!is_unsafe_aio_enabled())
+   GTEST_SKIP() <<
+   "vfs.aio.enable_unsafe must be set for this test";
+   FuseTest::SetUp();
+}
+};
+
 /* https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=236379 */
-TEST_F(Fsync, aio_fsync)
+TEST_F(AioFsync, aio_fsync)
 {
const char FULLPATH[] = "mountpoint/some_file.txt";
const char RELPATH[] = "some_file.txt";

Modified: head/tests/sys/fs/fusefs/fsyncdir.cc
==
--- head/tests/sys/fs/fusefs/fsyncdir.ccTue Aug 13 15:50:47 2019
(r350991)
+++ head/tests/sys/fs/fusefs/fsyncdir.ccTue Aug 13 15:52:28 2019
(r350992)
@@ -77,8 +77,17 @@ void expect_lookup(const char *relpath, uint64_t ino)
 
 };
 
+class AioFsyncDir: public FsyncDir {
+virtual void SetUp() {
+   if (!is_unsafe_aio_enabled())
+   GTEST_SKIP() <<
+   "vfs.aio.enable_unsafe must be set for this test";
+   FuseTest::SetUp();
+}
+};
+
 /* https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=236379 */
-TEST_F(FsyncDir, aio_fsync)
+TEST_F(AioFsyncDir, aio_fsync)
 {
const char FULLPATH[] = "mountpoint/some_file.txt";
const char RELPATH[] = "some_file.txt";

Modified: head/tests/sys/fs/fusefs/read.cc
==
--- head/tests/sys/fs/fusefs/read.ccTue Aug 13 15:50:47 2019
(r350991)
+++ head/tests/sys/fs/fusefs/read.ccTue Aug 13 15:52:28 2019
(r350992)
@@ -73,17 +73,10 @@ void expect_lookup(const char *relpath, uint64_t ino, 
 class AioRead: public Read {
 public:
 virtual void SetUp() {
-   const char *node = "vfs.aio.enable_unsafe";
-   int val = 0;
-   size_t size = sizeof(val);
-
-   FuseTest::SetUp();
-
-   ASSERT_EQ(0, sysctlbyname(node, , , NULL, 0))
-   << strerror(errno);
-   if (!val)
+   if (!is_unsafe_aio_enabled())
GTEST_SKIP() <<
"vfs.aio.enable_unsafe must be set for this test";
+   FuseTest::SetUp();
 }
 };
 

Modified: head/tests/sys/fs/fusefs/utils.cc
==
--- head/tests/sys/fs/fusefs/utils.cc   Tue Aug 13 15:50:47 2019
(r350991)
+++ head/tests/sys/fs/fusefs/utils.cc   Tue Aug 13 15:52:28 2019
(r350992)
@@ -89,6 +89,18 @@ void check_environment()
GTEST_SKIP() << "current user is not allowed to mount";
 }
 
+bool is_unsafe_aio_enabled(void) {
+   const char *node = "vfs.aio.enable_unsafe";
+   int val = 0;
+   size_t size = sizeof(val);
+
+   if (sysctlbyname(node, , , NULL, 0)) {
+   perror("sysctlbyname");
+   return (false);
+   }
+   return (val != 0);
+}
+
 class FuseEnv: public Environment {
virtual void SetUp() {
}

Modified: head/tests/sys/fs/fusefs/utils.hh
==
--- head/tests/sys/fs/fusefs/utils.hh   Tue Aug 13 15:50:47 2019
(r350991)
+++ head/tests/sys/fs/fusefs/utils.hh   Tue Aug 13 15:52:28 2019
(r350992)
@@ -44,6 +44,8 @@ inline void nap()
usleep(NAP_NS / 1000);
 }
 
+bool is_unsafe_aio_enabled(void);
+
 extern const uint32_t libfuse_max_write;
 extern const uint32_t default_max_write;
 class FuseTest : public ::testing::Test {

Modified: head/tests/sys/fs/fusefs/write.cc
==
--- head/tests/sys/fs/fusefs/write.cc   Tue Aug 13 15:50:47 2019
(r350991)
+++ head/tests/sys/fs/fusefs/write.cc   Tue Aug 13 15:52:28 2019
(r350992)
@@ -35,7 +35,6 @@ extern "C" {
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
@@ -138,17 +137,10 @@ void expect_lookup(const char *relpath, uint64_t ino, 
 
 class AioWrite: public Write {
 virtual void SetUp() {
-   const char *node = 

svn commit: r350991 - head/sys/conf

2019-08-13 Thread Warner Losh
Author: imp
Date: Tue Aug 13 15:50:47 2019
New Revision: 350991
URL: https://svnweb.freebsd.org/changeset/base/350991

Log:
  r350976 accidentally removed nvram device. Restore it.

Modified:
  head/sys/conf/files.i386

Modified: head/sys/conf/files.i386
==
--- head/sys/conf/files.i386Tue Aug 13 15:49:40 2019(r350990)
+++ head/sys/conf/files.i386Tue Aug 13 15:50:47 2019(r350991)
@@ -278,6 +278,7 @@ dev/ntb/ntb_if.moptional ntb | ntb_transport | 
if_nt
 dev/ntb/ntb_hw/ntb_hw_amd.coptional ntb_hw_amd | ntb_hw
 dev/ntb/ntb_hw/ntb_hw_intel.c  optional ntb_hw_intel | ntb_hw
 dev/ntb/ntb_hw/ntb_hw_plx.coptional ntb_hw_plx | ntb_hw
+dev/nvram/nvram.c  optionalnvram isa
 dev/ofw/ofwpci.c   optional fdt pci
 dev/pcf/pcf_isa.c  optional pcf
 dev/random/ivy.c   optional rdrand_rng !random_loadable
___
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: r350990 - head/tests/sys/fs/fusefs

2019-08-13 Thread Alan Somers
Author: asomers
Date: Tue Aug 13 15:49:40 2019
New Revision: 350990
URL: https://svnweb.freebsd.org/changeset/base/350990

Log:
  fusefs: add SVN Keywords to the test files
  
  Reported by:  SVN pre-commit hooks
  MFC after:15 days
  MFC-With: r350665
  Sponsored by: The FreeBSD Foundation

Modified:
  head/tests/sys/fs/fusefs/access.cc
  head/tests/sys/fs/fusefs/allow_other.cc
  head/tests/sys/fs/fusefs/bmap.cc
  head/tests/sys/fs/fusefs/create.cc
  head/tests/sys/fs/fusefs/default_permissions.cc
  head/tests/sys/fs/fusefs/default_permissions_privileged.cc
  head/tests/sys/fs/fusefs/destroy.cc
  head/tests/sys/fs/fusefs/dev_fuse_poll.cc
  head/tests/sys/fs/fusefs/fifo.cc
  head/tests/sys/fs/fusefs/flush.cc
  head/tests/sys/fs/fusefs/forget.cc
  head/tests/sys/fs/fusefs/fsync.cc
  head/tests/sys/fs/fusefs/fsyncdir.cc
  head/tests/sys/fs/fusefs/getattr.cc
  head/tests/sys/fs/fusefs/interrupt.cc
  head/tests/sys/fs/fusefs/io.cc
  head/tests/sys/fs/fusefs/link.cc
  head/tests/sys/fs/fusefs/locks.cc
  head/tests/sys/fs/fusefs/lookup.cc
  head/tests/sys/fs/fusefs/mkdir.cc
  head/tests/sys/fs/fusefs/mknod.cc
  head/tests/sys/fs/fusefs/mockfs.cc
  head/tests/sys/fs/fusefs/mockfs.hh   (contents, props changed)
  head/tests/sys/fs/fusefs/mount.cc
  head/tests/sys/fs/fusefs/nfs.cc
  head/tests/sys/fs/fusefs/notify.cc
  head/tests/sys/fs/fusefs/open.cc
  head/tests/sys/fs/fusefs/opendir.cc
  head/tests/sys/fs/fusefs/read.cc
  head/tests/sys/fs/fusefs/readdir.cc
  head/tests/sys/fs/fusefs/readlink.cc
  head/tests/sys/fs/fusefs/release.cc
  head/tests/sys/fs/fusefs/releasedir.cc
  head/tests/sys/fs/fusefs/rename.cc
  head/tests/sys/fs/fusefs/rmdir.cc
  head/tests/sys/fs/fusefs/setattr.cc
  head/tests/sys/fs/fusefs/statfs.cc
  head/tests/sys/fs/fusefs/symlink.cc
  head/tests/sys/fs/fusefs/unlink.cc
  head/tests/sys/fs/fusefs/utils.cc
  head/tests/sys/fs/fusefs/utils.hh   (contents, props changed)
  head/tests/sys/fs/fusefs/write.cc
  head/tests/sys/fs/fusefs/xattr.cc

Modified: head/tests/sys/fs/fusefs/access.cc
==
--- head/tests/sys/fs/fusefs/access.cc  Tue Aug 13 15:41:36 2019
(r350989)
+++ head/tests/sys/fs/fusefs/access.cc  Tue Aug 13 15:49:40 2019
(r350990)
@@ -26,6 +26,8 @@
  * 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$
  */
 
 extern "C" {

Modified: head/tests/sys/fs/fusefs/allow_other.cc
==
--- head/tests/sys/fs/fusefs/allow_other.cc Tue Aug 13 15:41:36 2019
(r350989)
+++ head/tests/sys/fs/fusefs/allow_other.cc Tue Aug 13 15:49:40 2019
(r350990)
@@ -26,6 +26,8 @@
  * 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$
  */
 
 /*

Modified: head/tests/sys/fs/fusefs/bmap.cc
==
--- head/tests/sys/fs/fusefs/bmap.ccTue Aug 13 15:41:36 2019
(r350989)
+++ head/tests/sys/fs/fusefs/bmap.ccTue Aug 13 15:49:40 2019
(r350990)
@@ -26,6 +26,8 @@
  * 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$
  */
 
 extern "C" {

Modified: head/tests/sys/fs/fusefs/create.cc
==
--- head/tests/sys/fs/fusefs/create.cc  Tue Aug 13 15:41:36 2019
(r350989)
+++ head/tests/sys/fs/fusefs/create.cc  Tue Aug 13 15:49:40 2019
(r350990)
@@ -26,6 +26,8 @@
  * 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$
  */
 
 extern "C" {

Modified: head/tests/sys/fs/fusefs/default_permissions.cc
==
--- head/tests/sys/fs/fusefs/default_permissions.cc Tue Aug 13 15:41:36 
2019(r350989)
+++ head/tests/sys/fs/fusefs/default_permissions.cc Tue Aug 13 15:49:40 
2019(r350990)
@@ -26,6 +26,8 @@
  * 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$
  */
 
 /*

Modified: head/tests/sys/fs/fusefs/default_permissions_privileged.cc
==
--- head/tests/sys/fs/fusefs/default_permissions_privileged.cc  Tue Aug 13 
15:41:36 2019(r350989)
+++ head/tests/sys/fs/fusefs/default_permissions_privileged.cc  Tue Aug 13 
15:49:40 2019(r350990)
@@ 

svn commit: r350989 - in head/share/man: man4 man5

2019-08-13 Thread Ed Maste
Author: emaste
Date: Tue Aug 13 15:41:36 2019
New Revision: 350989
URL: https://svnweb.freebsd.org/changeset/base/350989

Log:
  Remove some more leftover rlogin man page xrefs
  
  rcmds were removed in r32435 and these three man pages can trivially
  drop the references.
  
  There's still a reference in pts.4 because it describes a mode
  (TIOCPKT_NOSTOP), and only lists rlogin/rlogind as examples of programs
  that use that mode.  To update later.
  
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/share/man/man4/termios.4
  head/share/man/man4/tty.4
  head/share/man/man5/hosts.equiv.5

Modified: head/share/man/man4/termios.4
==
--- head/share/man/man4/termios.4   Tue Aug 13 15:38:05 2019
(r350988)
+++ head/share/man/man4/termios.4   Tue Aug 13 15:41:36 2019
(r350989)
@@ -58,9 +58,7 @@ a connection being present.
 In practice, applications
 seldom open these files; they are opened by special programs, such
 as
-.Xr getty 8
-or
-.Xr rlogind 8 ,
+.Xr getty 8 ,
 and become
 an application's standard input, output, and error files.
 .Ss Job Control in a Nutshell

Modified: head/share/man/man4/tty.4
==
--- head/share/man/man4/tty.4   Tue Aug 13 15:38:05 2019(r350988)
+++ head/share/man/man4/tty.4   Tue Aug 13 15:41:36 2019(r350989)
@@ -54,8 +54,6 @@ These special terminal devices are called
 .Em ptys
 and provide the mechanism necessary to give users the same interface to the
 system when logging in over a network (using
-.Xr rlogin 1 ,
-or
 .Xr telnet 1
 for example).
 Even in these cases the details of how the terminal

Modified: head/share/man/man5/hosts.equiv.5
==
--- head/share/man/man5/hosts.equiv.5   Tue Aug 13 15:38:05 2019
(r350988)
+++ head/share/man/man5/hosts.equiv.5   Tue Aug 13 15:41:36 2019
(r350989)
@@ -127,8 +127,6 @@ except users from netgroup
 .Dq dau .
 .Sh SEE ALSO
 .Xr rcp 1 ,
-.Xr rlogin 1 ,
-.Xr rsh 1 ,
 .Xr gethostbyname 3 ,
 .Xr inet 3 ,
 .Xr innetgr 3 ,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r350988 - head/sys/dev/gpio

2019-08-13 Thread Ian Lepore
Author: ian
Date: Tue Aug 13 15:38:05 2019
New Revision: 350988
URL: https://svnweb.freebsd.org/changeset/base/350988

Log:
  Add PNP_INFO to the gpiopps driver.

Modified:
  head/sys/dev/gpio/gpiopps.c

Modified: head/sys/dev/gpio/gpiopps.c
==
--- head/sys/dev/gpio/gpiopps.c Tue Aug 13 15:30:29 2019(r350987)
+++ head/sys/dev/gpio/gpiopps.c Tue Aug 13 15:38:05 2019(r350988)
@@ -47,6 +47,7 @@ static struct ofw_compat_data compat_data[] = {
{"pps-gpio",1},
{NULL,  0}
 };
+SIMPLEBUS_PNP_INFO(compat_data);
 #endif /* FDT */
 
 static devclass_t pps_devclass;
___
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: r350987 - head/sbin/ping6

2019-08-13 Thread Alan Somers
Author: asomers
Date: Tue Aug 13 15:30:29 2019
New Revision: 350987
URL: https://svnweb.freebsd.org/changeset/base/350987

Log:
  ping6: Fix data type of a variable for a packet sequence number
  
  Submitted by:   Ján Sučan 
  MFC after:  2 weeks
  Sponsored by:   Google, inc. (Google Summer of Code 2019)
  Differential Revision:  https://reviews.freebsd.org/D21218

Modified:
  head/sbin/ping6/ping6.c
Directory Properties:
  head/   (props changed)

Modified: head/sbin/ping6/ping6.c
==
--- head/sbin/ping6/ping6.c Tue Aug 13 15:28:22 2019(r350986)
+++ head/sbin/ping6/ping6.c Tue Aug 13 15:30:29 2019(r350987)
@@ -1304,7 +1304,7 @@ pinger(void)
struct iovec iov[2];
int i, cc;
struct icmp6_nodeinfo *nip;
-   int seq;
+   uint16_t seq;
 
if (npackets && ntransmitted >= npackets)
return(-1); /* no more transmission */
___
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: r350986 - head/sys/conf

2019-08-13 Thread Warner Losh
Author: imp
Date: Tue Aug 13 15:28:22 2019
New Revision: 350986
URL: https://svnweb.freebsd.org/changeset/base/350986

Log:
  Flowtables were removed in r321618, remove stray reference here.

Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==
--- head/sys/conf/files Tue Aug 13 15:28:18 2019(r350985)
+++ head/sys/conf/files Tue Aug 13 15:28:22 2019(r350986)
@@ -4045,7 +4045,6 @@ net/bpf_jitter.c  optional bpf_jitter
 net/bpf_filter.c   optional bpf | netgraph_bpf
 net/bpf_zerocopy.c optional bpf
 net/bridgestp.coptional bridge | if_bridge
-net/flowtable.coptional flowtable inet | flowtable 
inet6
 net/ieee8023ad_lacp.c  optional lagg
 net/if.c   standard
 net/if_bridge.coptional bridge inet | if_bridge inet
___
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: r350984 - head/sys/conf

2019-08-13 Thread Warner Losh
Author: imp
Date: Tue Aug 13 15:28:11 2019
New Revision: 350984
URL: https://svnweb.freebsd.org/changeset/base/350984

Log:
  nsp(4) was removed in r339571. Remove stray reference.

Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==
--- head/sys/conf/files Tue Aug 13 15:23:14 2019(r350983)
+++ head/sys/conf/files Tue Aug 13 15:28:11 2019(r350984)
@@ -2476,8 +2476,6 @@ dev/netmap/netmap_vale.c  optional netmap
 dev/nfsmb/nfsmb.c  optional nfsmb pci
 dev/nge/if_nge.c   optional nge
 dev/nmdm/nmdm.coptional nmdm
-dev/nsp/nsp.c  optional nsp
-dev/nsp/nsp_pccard.c   optional nsp pccard
 dev/null/null.cstandard
 dev/nvd/nvd.c  optional nvd nvme
 dev/nvme/nvme.coptional nvme
___
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: r350985 - head/sys/conf

2019-08-13 Thread Warner Losh
Author: imp
Date: Tue Aug 13 15:28:18 2019
New Revision: 350985
URL: https://svnweb.freebsd.org/changeset/base/350985

Log:
  vx(4) was removed in r347921. Remove stray reference.

Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==
--- head/sys/conf/files Tue Aug 13 15:28:11 2019(r350984)
+++ head/sys/conf/files Tue Aug 13 15:28:18 2019(r350985)
@@ -3404,8 +3404,6 @@ dev/vt/vt_cpulogos.c  optional vt splash
 dev/vt/vt_font.c   optional vt
 dev/vt/vt_sysmouse.c   optional vt
 dev/vte/if_vte.c   optional vte pci
-dev/vx/if_vx.c optional vx
-dev/vx/if_vx_pci.c optional vx pci
 dev/watchdog/watchdog.cstandard
 dev/wi/if_wi.c optional wi
 dev/wi/if_wi_pccard.c  optional wi pccard
___
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: r350983 - head/usr.sbin/crunch/examples

2019-08-13 Thread Ed Maste
Author: emaste
Date: Tue Aug 13 15:23:14 2019
New Revision: 350983
URL: https://svnweb.freebsd.org/changeset/base/350983

Log:
  crunch: remove rsh and rlogin from example config file
  
  rcmds removed in r324351.
  
  Historical references in the README are maintained.  There's a paragraph
  describing a "980K crunched 'fixit'" that references rsh and rlogin.
  
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/usr.sbin/crunch/examples/fixit.conf

Modified: head/usr.sbin/crunch/examples/fixit.conf
==
--- head/usr.sbin/crunch/examples/fixit.confTue Aug 13 15:16:42 2019
(r350982)
+++ head/usr.sbin/crunch/examples/fixit.confTue Aug 13 15:23:14 2019
(r350983)
@@ -29,7 +29,7 @@ ln restore rrestore
 
 # /usr/bin stuff
 
-progs ftp rsh sed telnet rlogin common find
+progs ftp sed telnet common find
 ln common vi
 ln common view
 ln common ex
___
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: r350982 - head/sys/conf

2019-08-13 Thread Warner Losh
Author: imp
Date: Tue Aug 13 15:16:42 2019
New Revision: 350982
URL: https://svnweb.freebsd.org/changeset/base/350982

Log:
  fe(4) driver has been removed from the tree in r347914. Remove stray 
reference.

Modified:
  head/sys/conf/files.i386

Modified: head/sys/conf/files.i386
==
--- head/sys/conf/files.i386Tue Aug 13 14:57:04 2019(r350981)
+++ head/sys/conf/files.i386Tue Aug 13 15:16:42 2019(r350982)
@@ -202,7 +202,6 @@ dev/fb/fb.c optional fb | vga
 dev/fb/s3_pci.coptional s3pci
 dev/fb/vesa.c  optional vga vesa
 dev/fb/vga.c   optional vga
-dev/fe/if_fe_isa.c optional fe isa
 dev/glxiic/glxiic.coptional glxiic
 dev/glxsb/glxsb.c  optional glxsb
 dev/glxsb/glxsb_hash.c optional glxsb
___
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: r350981 - head/share/man/man5

2019-08-13 Thread Ed Maste
Author: emaste
Date: Tue Aug 13 14:57:04 2019
New Revision: 350981
URL: https://svnweb.freebsd.org/changeset/base/350981

Log:
  Regen src.conf.5 after r350980 (remove rsh/rlogin references)
  
  Also pick up changes to LLVM_TARGET_RISCV, NAND, NVME, OPENM
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/share/man/man5/src.conf.5

Modified: head/share/man/man5/src.conf.5
==
--- head/share/man/man5/src.conf.5  Tue Aug 13 14:51:16 2019
(r350980)
+++ head/share/man/man5/src.conf.5  Tue Aug 13 14:57:04 2019
(r350981)
@@ -1,6 +1,6 @@
 .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman.
 .\" $FreeBSD$
-.Dd March 29, 2019
+.Dd August 13, 2019
 .Dt SRC.CONF 5
 .Os
 .Sh NAME
@@ -233,8 +233,6 @@ Set to build some programs without
 support, like
 .Xr fingerd 8 ,
 .Xr ftpd 8 ,
-.Xr rlogind 8 ,
-.Xr rshd 8 ,
 and
 .Xr sshd 8 .
 .It Va WITHOUT_BLUETOOTH
@@ -399,10 +397,6 @@ is set explicitly)
 (unless
 .Va WITH_LLVM_TARGET_POWERPC
 is set explicitly)
-.It Va WITHOUT_LLVM_TARGET_RISCV
-(unless
-.Va WITH_LLVM_TARGET_RISCV
-is set explicitly)
 .It Va WITHOUT_LLVM_TARGET_SPARC
 (unless
 .Va WITH_LLVM_TARGET_SPARC
@@ -1214,20 +1208,11 @@ option should be used rather than this in most cases.
 .Pp
 This is a default setting on
 amd64/amd64, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, 
mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, 
mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and 
powerpc/powerpcspe.
-.It Va WITHOUT_LLVM_TARGET_RISCV
-Set to not build LLVM target support for RISC-V.
-The
-.Va LLVM_TARGET_ALL
-option should be used rather than this in most cases.
-.Pp
-This is a default setting on
-amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, 
mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, 
mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, 
powerpc/powerpc64, powerpc/powerpcspe, and sparc/sparc64.
 .It Va WITH_LLVM_TARGET_RISCV
 Set to build LLVM target support for RISC-V.
 The
 .Va LLVM_TARGET_ALL
 option should be used rather than this in most cases.
-.Pp
 .It Va WITHOUT_LLVM_TARGET_SPARC
 Set to not build LLVM target support for SPARC.
 The
@@ -1469,8 +1454,6 @@ Set to build
 .Pp
 This is a default setting on
 amd64/amd64, arm64/aarch64, i386/i386, powerpc/powerpc64 and sparc64/sparc64.
-.It Va WITH_NAND
-Set to build the NAND Flash components.
 .It Va WITHOUT_NDIS
 Set to not build programs and libraries
 related to NDIS emulation support.
@@ -1535,13 +1518,13 @@ and related programs.
 Set to not build nvme related tools and kernel modules.
 .Pp
 This is a default setting on
-arm/arm, arm/armv6, arm/armv7, arm64/aarch64, mips/mipsel, mips/mips, 
mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, 
mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpcspe, 
riscv/riscv64 and sparc64/sparc64.
+arm/arm, arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, 
mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, 
mips/mips64hf, powerpc/powerpc, powerpc/powerpcspe, riscv/riscv64 and 
sparc64/sparc64.
 .It Va WITH_NVME
 Set to build nvme related tools and kernel modules.
 
 .Pp
 This is a default setting on
-amd64/amd64, i386/i386 and powerpc/powerpc64.
+amd64/amd64, arm64/aarch64, i386/i386 and powerpc/powerpc64.
 .It Va WITH_OFED
 Set to build the
 .Dq "OpenFabrics Enterprise Distribution"
@@ -1556,12 +1539,12 @@ Enable building openldap support for kerberos.
 Set to not build LLVM's OpenMP runtime.
 .Pp
 This is a default setting on
-arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, 
mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, 
mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, 
powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64.
+arm/arm, arm/armv6, arm/armv7, arm64/aarch64, mips/mipsel, mips/mips, 
mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, 
mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, 
powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64.
 .It Va WITH_OPENMP
 Set to build LLVM's OpenMP runtime.
 .Pp
 This is a default setting on
-amd64/amd64.
+amd64/amd64 and i386/i386.
 .It Va WITHOUT_OPENSSH
 Set to not build OpenSSH.
 .It Va WITHOUT_OPENSSL
@@ -1674,10 +1657,10 @@ by proxy.
 .It Va WITHOUT_RBOOTD
 Set to not build or install
 .Xr rbootd 8 .
-.It Va WITHOUT_REPRODUCIBLE_BUILD
-Set to include build metadata (such as the build time, user, and host)
-in the kernel, boot loaders, and uname output.
-Successive builds will not be bit-for-bit identical.
+.It Va WITH_REPRODUCIBLE_BUILD
+Set to exclude build metadata (such as the build time, user, or host)
+from the kernel, boot loaders, and uname output, so that builds produce
+bit-for-bit identical output.
 .It Va WITHOUT_RESCUE
 Set to not 

svn commit: r350980 - head/tools/build/options

2019-08-13 Thread Ed Maste
Author: emaste
Date: Tue Aug 13 14:51:16 2019
New Revision: 350980
URL: https://svnweb.freebsd.org/changeset/base/350980

Log:
  Remove rlogin/rsh references from src.conf(5) WITHOUT_BLACKLIST_SUPPORT
  
  rcmds were removed in r324351
  
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/tools/build/options/WITHOUT_BLACKLIST_SUPPORT

Modified: head/tools/build/options/WITHOUT_BLACKLIST_SUPPORT
==
--- head/tools/build/options/WITHOUT_BLACKLIST_SUPPORT  Tue Aug 13 14:47:24 
2019(r350979)
+++ head/tools/build/options/WITHOUT_BLACKLIST_SUPPORT  Tue Aug 13 14:51:16 
2019(r350980)
@@ -4,7 +4,5 @@ Set to build some programs without
 support, like
 .Xr fingerd 8 ,
 .Xr ftpd 8 ,
-.Xr rlogind 8 ,
-.Xr rshd 8 ,
 and
 .Xr sshd 8 .
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r350979 - head/share/man/man7

2019-08-13 Thread Ed Maste
Author: emaste
Date: Tue Aug 13 14:47:24 2019
New Revision: 350979
URL: https://svnweb.freebsd.org/changeset/base/350979

Log:
  Remove rsh/rlogin references from security man page
  
  More extensive changes to this page are certainly needed, but at least
  remove references to binaries that no longer exist.
  
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

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

Modified: head/share/man/man7/security.7
==
--- head/share/man/man7/security.7  Tue Aug 13 13:48:44 2019
(r350978)
+++ head/share/man/man7/security.7  Tue Aug 13 14:47:24 2019
(r350979)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 27, 2019
+.Dd August 13, 2019
 .Dt SECURITY 7
 .Os
 .Sh NAME
@@ -99,9 +99,7 @@ pipe.
 A user account compromise is even more common than a DoS attack.
 Many
 sysadmins still run standard
-.Xr telnetd 8 ,
-.Xr rlogind 8 ,
-.Xr rshd 8 ,
+.Xr telnetd 8
 and
 .Xr ftpd 8
 servers on their machines.
@@ -186,8 +184,6 @@ in the
 file
 so that direct root logins via
 .Xr telnet 1
-or
-.Xr rlogin 1
 are disallowed.
 If using
 other login services such as
@@ -342,10 +338,7 @@ virtually every server ever run as root, including bas
 If you are running a machine through which people only log in via
 .Xr sshd 8
 and never log in via
-.Xr telnetd 8 ,
-.Xr rshd 8 ,
-or
-.Xr rlogind 8 ,
+.Xr telnetd 8
 then turn off those services!
 .Pp
 .Fx
@@ -378,7 +371,7 @@ occur through them.
 The other big potential root hole in a system are the SUID-root and SGID
 binaries installed on the system.
 Most of these binaries, such as
-.Xr rlogin 1 ,
+.Xr su 1 ,
 reside in
 .Pa /bin , /sbin , /usr/bin ,
 or
@@ -905,8 +898,6 @@ if you intend to use them.
 Kerberos5 is an excellent authentication
 protocol but the kerberized
 .Xr telnet 1
-and
-.Xr rlogin 1
 suck rocks.
 There are bugs that make them unsuitable for dealing with binary streams.
 Also, by default
___
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: r350978 - in stable/11/sys/amd64: amd64 include

2019-08-13 Thread Konstantin Belousov
Author: kib
Date: Tue Aug 13 13:48:44 2019
New Revision: 350978
URL: https://svnweb.freebsd.org/changeset/base/350978

Log:
  MFC r350639:
  amd64: prevents speculations over swapgs reload of %gs base.

Modified:
  stable/11/sys/amd64/amd64/exception.S
  stable/11/sys/amd64/include/asmacros.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/amd64/amd64/exception.S
==
--- stable/11/sys/amd64/amd64/exception.S   Tue Aug 13 13:47:03 2019
(r350977)
+++ stable/11/sys/amd64/amd64/exception.S   Tue Aug 13 13:48:44 2019
(r350978)
@@ -130,6 +130,7 @@ X\l:
testb   $SEL_RPL_MASK,TF_CS(%rsp)
jz  alltraps_noen_k
swapgs
+   lfence
jmp alltraps_noen_u
.endm
 
@@ -164,6 +165,7 @@ X\l:
testb   $SEL_RPL_MASK,TF_CS(%rsp)
jz  alltraps_k
swapgs
+   lfence
jmp alltraps_u
.endm
 
@@ -199,6 +201,7 @@ X\l:
testb   $SEL_RPL_MASK,TF_CS(%rsp)
jz  alltraps_k
swapgs
+   lfence
jmp alltraps_u
.endm
 
@@ -228,6 +231,7 @@ alltraps_u:
.globl  alltraps_k
.type   alltraps_k,@function
 alltraps_k:
+   lfence
movq%rdi,TF_RDI(%rsp)
movq%rdx,TF_RDX(%rsp)
movq%rax,TF_RAX(%rsp)
@@ -303,6 +307,7 @@ alltraps_noen_u:
.globl  alltraps_noen_k
.type   alltraps_noen_k,@function
 alltraps_noen_k:
+   lfence
movq%rdi,TF_RDI(%rsp)
 alltraps_noen_save_segs:
SAVE_SEGS
@@ -340,7 +345,7 @@ IDTVEC(dblfault)
testb   $SEL_RPL_MASK,TF_CS(%rsp) /* Did we come from kernel? */
jz  1f  /* already running with kernel GS.base 
*/
swapgs
-1:
+1: lfence
movqPCPU(KCR3),%rax
cmpq$~0,%rax
je  2f
@@ -355,6 +360,7 @@ IDTVEC(page_pti)
testb   $SEL_RPL_MASK,PTI_CS-PTI_ERR(%rsp)
jz  page_k
swapgs
+   lfence
pushq   %rax
movq%cr3,%rax
movq%rax,PCPU(SAVED_UCR3)
@@ -370,6 +376,7 @@ IDTVEC(page)
testb   $SEL_RPL_MASK,TF_CS-TF_ERR(%rsp) /* Did we come from kernel? */
jnz page_u_swapgs   /* already running with kernel GS.base 
*/
 page_k:
+   lfence
subq$TF_ERR,%rsp
movq%rdi,TF_RDI(%rsp)   /* free up GP registers */
movq%rax,TF_RAX(%rsp)
@@ -379,6 +386,7 @@ page_k:
ALIGN_TEXT
 page_u_swapgs:
swapgs
+   lfence
 page_u:
subq$TF_ERR,%rsp
movq%rdi,TF_RDI(%rsp)
@@ -416,6 +424,7 @@ page_cr2:
.macro PROTF_ENTRY name,trapno
 \name\()_pti_doreti:
swapgs
+   lfence
cmpq$~0,PCPU(UCR3)
je  1f
pushq   %rax
@@ -438,9 +447,9 @@ IDTVEC(\name\()_pti)
cmpq$doreti_iret,PTI_RIP-2*8(%rsp)
je  \name\()_pti_doreti
testb   $SEL_RPL_MASK,PTI_CS-2*8(%rsp) /* %rax, %rdx not yet pushed */
-   jz  X\name
+   jz  X\name  /* lfence is not needed until %gs: use */
PTI_UENTRY has_err=1
-   swapgs
+   swapgs  /* fence provided by PTI_UENTRY */
 IDTVEC(\name)
subq$TF_ERR,%rsp
movl$\trapno,TF_TRAPNO(%rsp)
@@ -473,6 +482,7 @@ prot_addrf:
jne 2f
rdgsbase %rdx
 2: swapgs
+   lfence
movqPCPU(CURPCB),%rdi
testb   $CPUID_STDEXT_FSGSBASE,cpu_stdext_feature(%rip)
jz  4f
@@ -492,7 +502,8 @@ prot_addrf:
jmp alltraps_pushregs_no_rax
 
 5: swapgs
-6: movqPCPU(CURPCB),%rdi
+6: lfence
+   movqPCPU(CURPCB),%rdi
jmp 4b
 
 /*
@@ -507,6 +518,7 @@ prot_addrf:
SUPERALIGN_TEXT
 IDTVEC(fast_syscall_pti)
swapgs
+   lfence
movq%rax,PCPU(SCRATCH_RAX)
cmpq$~0,PCPU(UCR3)
je  fast_syscall_common
@@ -516,6 +528,7 @@ IDTVEC(fast_syscall_pti)
SUPERALIGN_TEXT
 IDTVEC(fast_syscall)
swapgs
+   lfence
movq%rax,PCPU(SCRATCH_RAX)
 fast_syscall_common:
movq%rsp,PCPU(SCRATCH_RSP)
@@ -635,6 +648,7 @@ IDTVEC(dbg)
cld
testb   $SEL_RPL_MASK,TF_CS(%rsp)
jnz dbg_fromuserspace
+   lfence
/*
 * We've interrupted the kernel.  Preserve GS.base in %r12,
 * %cr3 in %r13, and possibly lower half of MSR_IA32_SPEC_CTL in %r14d.
@@ -690,6 +704,7 @@ dbg_fromuserspace:
 * in trap().
 */
swapgs
+   lfence
movqPCPU(KCR3),%rax
cmpq$~0,%rax
je  1f
@@ -773,6 +788,7 @@ IDTVEC(nmi)
 * We've interrupted the kernel.  Preserve GS.base in %r12,
 * %cr3 in %r13, and possibly lower half of MSR_IA32_SPEC_CTL in %r14d.
 */
+   lfence
movl$MSR_GSBASE,%ecx
rdmsr
movq%rax,%r12
@@ -798,6 +814,7 @@ IDTVEC(nmi)
 nmi_fromuserspace:
 

svn commit: r350977 - in stable/12/sys/amd64: amd64 include

2019-08-13 Thread Konstantin Belousov
Author: kib
Date: Tue Aug 13 13:47:03 2019
New Revision: 350977
URL: https://svnweb.freebsd.org/changeset/base/350977

Log:
  MFC r350639:
  amd64: prevents speculations over swapgs reload of %gs base.

Modified:
  stable/12/sys/amd64/amd64/exception.S
  stable/12/sys/amd64/include/asmacros.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/amd64/amd64/exception.S
==
--- stable/12/sys/amd64/amd64/exception.S   Tue Aug 13 13:41:46 2019
(r350976)
+++ stable/12/sys/amd64/amd64/exception.S   Tue Aug 13 13:47:03 2019
(r350977)
@@ -129,6 +129,7 @@ X\l:
testb   $SEL_RPL_MASK,TF_CS(%rsp)
jz  alltraps_noen_k
swapgs
+   lfence
jmp alltraps_noen_u
.endm
 
@@ -163,6 +164,7 @@ X\l:
testb   $SEL_RPL_MASK,TF_CS(%rsp)
jz  alltraps_k
swapgs
+   lfence
jmp alltraps_u
.endm
 
@@ -198,6 +200,7 @@ X\l:
testb   $SEL_RPL_MASK,TF_CS(%rsp)
jz  alltraps_k
swapgs
+   lfence
jmp alltraps_u
.endm
 
@@ -227,6 +230,7 @@ alltraps_u:
.globl  alltraps_k
.type   alltraps_k,@function
 alltraps_k:
+   lfence
movq%rdi,TF_RDI(%rsp)
movq%rdx,TF_RDX(%rsp)
movq%rax,TF_RAX(%rsp)
@@ -304,6 +308,7 @@ alltraps_noen_u:
.globl  alltraps_noen_k
.type   alltraps_noen_k,@function
 alltraps_noen_k:
+   lfence
movq%rdi,TF_RDI(%rsp)
 alltraps_noen_save_segs:
SAVE_SEGS
@@ -343,7 +348,7 @@ IDTVEC(dblfault)
testb   $SEL_RPL_MASK,TF_CS(%rsp) /* Did we come from kernel? */
jz  1f  /* already running with kernel GS.base 
*/
swapgs
-1:
+1: lfence
movqPCPU(KCR3),%rax
cmpq$~0,%rax
je  2f
@@ -358,6 +363,7 @@ IDTVEC(page_pti)
testb   $SEL_RPL_MASK,PTI_CS-PTI_ERR(%rsp)
jz  page_k
swapgs
+   lfence
pushq   %rax
movq%cr3,%rax
movq%rax,PCPU(SAVED_UCR3)
@@ -373,6 +379,7 @@ IDTVEC(page)
testb   $SEL_RPL_MASK,TF_CS-TF_ERR(%rsp) /* Did we come from kernel? */
jnz page_u_swapgs   /* already running with kernel GS.base 
*/
 page_k:
+   lfence
subq$TF_ERR,%rsp
movq%rdi,TF_RDI(%rsp)   /* free up GP registers */
movq%rax,TF_RAX(%rsp)
@@ -382,6 +389,7 @@ page_k:
ALIGN_TEXT
 page_u_swapgs:
swapgs
+   lfence
 page_u:
subq$TF_ERR,%rsp
movq%rdi,TF_RDI(%rsp)
@@ -419,6 +427,7 @@ page_cr2:
.macro PROTF_ENTRY name,trapno
 \name\()_pti_doreti:
swapgs
+   lfence
cmpq$~0,PCPU(UCR3)
je  1f
pushq   %rax
@@ -441,9 +450,9 @@ IDTVEC(\name\()_pti)
cmpq$doreti_iret,PTI_RIP-2*8(%rsp)
je  \name\()_pti_doreti
testb   $SEL_RPL_MASK,PTI_CS-2*8(%rsp) /* %rax, %rdx not yet pushed */
-   jz  X\name
+   jz  X\name  /* lfence is not needed until %gs: use */
PTI_UENTRY has_err=1
-   swapgs
+   swapgs  /* fence provided by PTI_UENTRY */
 IDTVEC(\name)
subq$TF_ERR,%rsp
movl$\trapno,TF_TRAPNO(%rsp)
@@ -476,6 +485,7 @@ prot_addrf:
jne 2f
rdgsbase %rdx
 2: swapgs
+   lfence
movqPCPU(CURPCB),%rdi
testb   $CPUID_STDEXT_FSGSBASE,cpu_stdext_feature(%rip)
jz  4f
@@ -495,7 +505,8 @@ prot_addrf:
jmp alltraps_pushregs_no_rax
 
 5: swapgs
-6: movqPCPU(CURPCB),%rdi
+6: lfence
+   movqPCPU(CURPCB),%rdi
jmp 4b
 
 /*
@@ -510,6 +521,7 @@ prot_addrf:
SUPERALIGN_TEXT
 IDTVEC(fast_syscall_pti)
swapgs
+   lfence
movq%rax,PCPU(SCRATCH_RAX)
cmpq$~0,PCPU(UCR3)
je  fast_syscall_common
@@ -519,6 +531,7 @@ IDTVEC(fast_syscall_pti)
SUPERALIGN_TEXT
 IDTVEC(fast_syscall)
swapgs
+   lfence
movq%rax,PCPU(SCRATCH_RAX)
 fast_syscall_common:
movq%rsp,PCPU(SCRATCH_RSP)
@@ -647,6 +660,7 @@ IDTVEC(dbg)
popfq
testb   $SEL_RPL_MASK,TF_CS(%rsp)
jnz dbg_fromuserspace
+   lfence
/*
 * We've interrupted the kernel.  Preserve GS.base in %r12,
 * %cr3 in %r13, and possibly lower half of MSR_IA32_SPEC_CTL in %r14d.
@@ -702,6 +716,7 @@ dbg_fromuserspace:
 * in trap().
 */
swapgs
+   lfence
movqPCPU(KCR3),%rax
cmpq$~0,%rax
je  1f
@@ -787,6 +802,7 @@ IDTVEC(nmi)
 * We've interrupted the kernel.  Preserve GS.base in %r12,
 * %cr3 in %r13, and possibly lower half of MSR_IA32_SPEC_CTL in %r14d.
 */
+   lfence
movl$MSR_GSBASE,%ecx
rdmsr
movq%rax,%r12
@@ -812,6 +828,7 @@ IDTVEC(nmi)
 nmi_fromuserspace:
   

svn commit: r350976 - head/sys/conf

2019-08-13 Thread Warner Losh
Author: imp
Date: Tue Aug 13 13:41:46 2019
New Revision: 350976
URL: https://svnweb.freebsd.org/changeset/base/350976

Log:
  nvme has been moved to 'files' so shouldn't be here anymore. It works on
  powerpc64 and arm64 these days as well as amd64/i386.

Modified:
  head/sys/conf/files.amd64
  head/sys/conf/files.i386

Modified: head/sys/conf/files.amd64
==
--- head/sys/conf/files.amd64   Tue Aug 13 13:28:12 2019(r350975)
+++ head/sys/conf/files.amd64   Tue Aug 13 13:41:46 2019(r350976)
@@ -346,17 +346,6 @@ dev/ntb/ntb_if.m   optionalntb | 
ntb_transport | if_nt
 dev/ntb/ntb_hw/ntb_hw_amd.coptionalntb_hw_amd | ntb_hw
 dev/ntb/ntb_hw/ntb_hw_intel.c  optionalntb_hw_intel | ntb_hw
 dev/ntb/ntb_hw/ntb_hw_plx.coptionalntb_hw_plx | ntb_hw
-dev/nvd/nvd.c  optionalnvd nvme
-dev/nvme/nvme.coptionalnvme
-dev/nvme/nvme_ctrlr.c  optionalnvme
-dev/nvme/nvme_ctrlr_cmd.c  optionalnvme
-dev/nvme/nvme_ns.c optionalnvme
-dev/nvme/nvme_ns_cmd.c optionalnvme
-dev/nvme/nvme_qpair.c  optionalnvme
-dev/nvme/nvme_sim.coptionalnvme scbus
-dev/nvme/nvme_sysctl.c optionalnvme
-dev/nvme/nvme_test.c   optionalnvme
-dev/nvme/nvme_util.c   optionalnvme
 dev/nvram/nvram.c  optionalnvram isa
 dev/random/ivy.c   optionalrdrand_rng !random_loadable
 dev/random/nehemiah.c  optionalpadlock_rng !random_loadable

Modified: head/sys/conf/files.i386
==
--- head/sys/conf/files.i386Tue Aug 13 13:28:12 2019(r350975)
+++ head/sys/conf/files.i386Tue Aug 13 13:41:46 2019(r350976)
@@ -279,17 +279,6 @@ dev/ntb/ntb_if.m   optional ntb | ntb_transport | 
if_nt
 dev/ntb/ntb_hw/ntb_hw_amd.coptional ntb_hw_amd | ntb_hw
 dev/ntb/ntb_hw/ntb_hw_intel.c  optional ntb_hw_intel | ntb_hw
 dev/ntb/ntb_hw/ntb_hw_plx.coptional ntb_hw_plx | ntb_hw
-dev/nvd/nvd.c  optional nvd nvme
-dev/nvme/nvme.coptional nvme
-dev/nvme/nvme_ctrlr.c  optional nvme
-dev/nvme/nvme_ctrlr_cmd.c  optional nvme
-dev/nvme/nvme_ns.c optional nvme
-dev/nvme/nvme_ns_cmd.c optional nvme
-dev/nvme/nvme_qpair.c  optional nvme
-dev/nvme/nvme_sysctl.c optional nvme
-dev/nvme/nvme_test.c   optional nvme
-dev/nvme/nvme_util.c   optional nvme
-dev/nvram/nvram.c  optional nvram isa
 dev/ofw/ofwpci.c   optional fdt pci
 dev/pcf/pcf_isa.c  optional pcf
 dev/random/ivy.c   optional rdrand_rng !random_loadable
___
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: r350975 - head/sys/conf

2019-08-13 Thread Warner Losh
Author: imp
Date: Tue Aug 13 13:28:12 2019
New Revision: 350975
URL: https://svnweb.freebsd.org/changeset/base/350975

Log:
  ed(4) has been removed from the tree, but these were forgotten in r347911.

Modified:
  head/sys/conf/files.amd64
  head/sys/conf/files.i386

Modified: head/sys/conf/files.amd64
==
--- head/sys/conf/files.amd64   Tue Aug 13 12:47:53 2019(r350974)
+++ head/sys/conf/files.amd64   Tue Aug 13 13:28:12 2019(r350975)
@@ -236,12 +236,6 @@ dev/bxe/57712_init_values.c optional   bxe pci
 dev/coretemp/coretemp.coptionalcoretemp
 dev/cpuctl/cpuctl.coptionalcpuctl
 dev/dpms/dpms.coptionaldpms
-# There are no systems with isa slots, so all ed isa entries should go..
-dev/ed/if_ed_3c503.c   optionaled isa ed_3c503
-dev/ed/if_ed_isa.c optionaled isa
-dev/ed/if_ed_wd80x3.c  optionaled isa
-dev/ed/if_ed_hpp.c optionaled isa ed_hpp
-dev/ed/if_ed_sic.c optionaled isa ed_sic
 dev/fb/fb.coptionalfb | vga
 dev/fb/s3_pci.coptionals3pci
 dev/fb/vesa.c  optionalvga vesa

Modified: head/sys/conf/files.i386
==
--- head/sys/conf/files.i386Tue Aug 13 12:47:53 2019(r350974)
+++ head/sys/conf/files.i386Tue Aug 13 13:28:12 2019(r350975)
@@ -198,11 +198,6 @@ dev/cx/csigma.coptional cx
 dev/cx/cxddk.c optional cx
 dev/cx/if_cx.c optional cx
 dev/dpms/dpms.coptional dpms
-dev/ed/if_ed_3c503.c   optional ed isa ed_3c503
-dev/ed/if_ed_isa.c optional ed isa
-dev/ed/if_ed_wd80x3.c  optional ed isa
-dev/ed/if_ed_hpp.c optional ed isa ed_hpp
-dev/ed/if_ed_sic.c optional ed isa ed_sic
 dev/fb/fb.coptional fb | vga
 dev/fb/s3_pci.coptional s3pci
 dev/fb/vesa.c  optional vga vesa
___
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: r350974 - head/sys/netinet

2019-08-13 Thread Andrey V. Elsukov
Author: ae
Date: Tue Aug 13 12:47:53 2019
New Revision: 350974
URL: https://svnweb.freebsd.org/changeset/base/350974

Log:
  Save ip_ttl value and restore it after checksum calculation.
  
  Since ipvoly is used for checksum calculation, part of original IP
  header is zeroed. This part includes ip_ttl field, that can be used
  later in IP_MINTTL socket option handling.
  
  PR:   239799
  MFC after:1 week

Modified:
  head/sys/netinet/tcp_input.c

Modified: head/sys/netinet/tcp_input.c
==
--- head/sys/netinet/tcp_input.cTue Aug 13 12:41:15 2019
(r350973)
+++ head/sys/netinet/tcp_input.cTue Aug 13 12:47:53 2019
(r350974)
@@ -554,6 +554,7 @@ tcp_input(struct mbuf **mp, int *offp, int proto)
int optlen = 0;
 #ifdef INET
int len;
+   uint8_t ipttl;
 #endif
int tlen = 0, off;
int drop_hdrlen;
@@ -676,6 +677,7 @@ tcp_input(struct mbuf **mp, int *offp, int proto)
 * Checksum extended TCP header and data.
 */
len = off0 + tlen;
+   ipttl = ip->ip_ttl;
bzero(ipov->ih_x1, sizeof(ipov->ih_x1));
ipov->ih_len = htons(tlen);
th->th_sum = in_cksum(m, len);
@@ -684,6 +686,7 @@ tcp_input(struct mbuf **mp, int *offp, int proto)
/* Reset TOS bits */
ip->ip_tos = iptos;
/* Re-initialization for later version check */
+   ip->ip_ttl = ipttl;
ip->ip_v = IPVERSION;
ip->ip_hl = off0 >> 2;
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r350973 - head/sys/netinet/tcp_stacks

2019-08-13 Thread Randall Stewart
Author: rrs
Date: Tue Aug 13 12:41:15 2019
New Revision: 350973
URL: https://svnweb.freebsd.org/changeset/base/350973

Log:
  Place back in the dependency on HPTS via module depends versus
  a fatal error in compiling. This was taken out by mistake
  when I mis-merged from the 18q22p2 sources of rack in NF. Opps.
  
  Reported by:  sbruno

Modified:
  head/sys/netinet/tcp_stacks/rack.c

Modified: head/sys/netinet/tcp_stacks/rack.c
==
--- head/sys/netinet/tcp_stacks/rack.c  Tue Aug 13 04:54:02 2019
(r350972)
+++ head/sys/netinet/tcp_stacks/rack.c  Tue Aug 13 12:41:15 2019
(r350973)
@@ -128,10 +128,6 @@ uma_zone_t rack_pcb_zone;
 struct sysctl_ctx_list rack_sysctl_ctx;
 struct sysctl_oid *rack_sysctl_root;
 
-#ifndef TCPHPTS
-#error "fatal error missing option TCPHSTS in the build"
-#endif
-
 #define CUM_ACKED 1
 #define SACKED 2
 
@@ -9212,3 +9208,4 @@ static moduledata_t tcp_rack = {
 
 MODULE_VERSION(MODNAME, 1);
 DECLARE_MODULE(MODNAME, tcp_rack, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY);
+MODULE_DEPEND(MODNAME, tcphpts, 1, 1, 1);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"