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

2020-04-14 Thread Conrad Meyer
Author: cem
Date: Wed Apr 15 05:55:14 2020
New Revision: 359959
URL: https://svnweb.freebsd.org/changeset/base/359959

Log:
  bhyve(8): Correct copyright boilerplate for r359950
  
  Use the text from the canonical sys/copyright.h 2-clause FreeBSD License.
  
  Reported by:  grehan (thanks!)

Modified:
  head/usr.sbin/bhyve/vmgenc.c
  head/usr.sbin/bhyve/vmgenc.h

Modified: head/usr.sbin/bhyve/vmgenc.c
==
--- head/usr.sbin/bhyve/vmgenc.cWed Apr 15 05:02:49 2020
(r359958)
+++ head/usr.sbin/bhyve/vmgenc.cWed Apr 15 05:55:14 2020
(r359959)
@@ -12,10 +12,10 @@
  *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 NETAPP, INC ``AS IS'' AND
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL NETAPP, INC OR CONTRIBUTORS BE LIABLE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)

Modified: head/usr.sbin/bhyve/vmgenc.h
==
--- head/usr.sbin/bhyve/vmgenc.hWed Apr 15 05:02:49 2020
(r359958)
+++ head/usr.sbin/bhyve/vmgenc.hWed Apr 15 05:55:14 2020
(r359959)
@@ -12,10 +12,10 @@
  *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 NETAPP, INC ``AS IS'' AND
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL NETAPP, INC OR CONTRIBUTORS BE LIABLE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
___
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: r359958 - in stable/11/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src sys

2020-04-14 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Apr 15 05:02:49 2020
New Revision: 359958
URL: https://svnweb.freebsd.org/changeset/base/359958

Log:
  MFC r359727:
  Clone the RCU interface into a sleepable and a non-sleepable part
  in the LinuxKPI.
  
  This allows synchronize RCU to be used inside a SRCU read section.
  No functional change intended.
  
  Bump the __FreeBSD_version to force recompilation of external kernel modules.
  
  PR:   242272
  Sponsored by: Mellanox Technologies

Modified:
  stable/11/sys/compat/linuxkpi/common/include/linux/rcupdate.h
  stable/11/sys/compat/linuxkpi/common/src/linux_rcu.c
  stable/11/sys/sys/param.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/compat/linuxkpi/common/include/linux/rcupdate.h
==
--- stable/11/sys/compat/linuxkpi/common/include/linux/rcupdate.h   Wed Apr 
15 04:56:27 2020(r359957)
+++ stable/11/sys/compat/linuxkpi/common/include/linux/rcupdate.h   Wed Apr 
15 05:02:49 2020(r359958)
@@ -35,6 +35,11 @@
 
 #defineLINUX_KFREE_RCU_OFFSET_MAX  4096/* exclusive */
 
+/* BSD specific defines */
+#defineRCU_TYPE_REGULAR 0
+#defineRCU_TYPE_SLEEPABLE 1
+#defineRCU_TYPE_MAX 2
+
 #defineRCU_INITIALIZER(v)  \
((__typeof(*(v)) *)(v))
 
@@ -43,27 +48,27 @@
 } while (0)
 
 #definecall_rcu(ptr, func) do {\
-   linux_call_rcu(ptr, func);  \
+   linux_call_rcu(RCU_TYPE_REGULAR, ptr, func);\
 } while (0)
 
 #definercu_barrier(void) do {  \
-   linux_rcu_barrier();\
+   linux_rcu_barrier(RCU_TYPE_REGULAR);\
 } while (0)
 
 #definercu_read_lock(void) do {\
-   linux_rcu_read_lock();  \
+   linux_rcu_read_lock(RCU_TYPE_REGULAR);  \
 } while (0)
 
 #definercu_read_unlock(void) do {  \
-   linux_rcu_read_unlock();\
+   linux_rcu_read_unlock(RCU_TYPE_REGULAR);\
 } while (0)
 
 #definesynchronize_rcu(void) do {  \
-   linux_synchronize_rcu();\
+   linux_synchronize_rcu(RCU_TYPE_REGULAR);\
 } while (0)
 
 #definesynchronize_rcu_expedited(void) do {\
-   linux_synchronize_rcu();\
+   linux_synchronize_rcu(RCU_TYPE_REGULAR);\
 } while (0)
 
 #definekfree_rcu(ptr, rcu_head) do {   \
@@ -94,11 +99,11 @@
 
 /* prototypes */
 
-extern void linux_call_rcu(struct rcu_head *ptr, rcu_callback_t func);
-extern void linux_rcu_barrier(void);
-extern void linux_rcu_read_lock(void);
-extern void linux_rcu_read_unlock(void);
-extern void linux_synchronize_rcu(void);
+extern void linux_call_rcu(unsigned type, struct rcu_head *ptr, rcu_callback_t 
func);
+extern void linux_rcu_barrier(unsigned type);
+extern void linux_rcu_read_lock(unsigned type);
+extern void linux_rcu_read_unlock(unsigned type);
+extern void linux_synchronize_rcu(unsigned type);
 
 /* Empty implementation for !DEBUG */
 #defineinit_rcu_head(...)

Modified: stable/11/sys/compat/linuxkpi/common/src/linux_rcu.c
==
--- stable/11/sys/compat/linuxkpi/common/src/linux_rcu.cWed Apr 15 
04:56:27 2020(r359957)
+++ stable/11/sys/compat/linuxkpi/common/src/linux_rcu.cWed Apr 15 
05:02:49 2020(r359958)
@@ -1,5 +1,6 @@
 /*-
  * Copyright (c) 2016 Matthew Macy (mm...@mattmacy.io)
+ * Copyright (c) 2017-2020 Hans Petter Selasky (hsela...@freebsd.org)
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -89,9 +90,9 @@ CTASSERT(sizeof(struct rcu_head) == sizeof(struct call
  */
 CTASSERT(offsetof(struct linux_epoch_record, epoch_record) == 0);
 
-static ck_epoch_t linux_epoch;
-static struct linux_epoch_head linux_epoch_head;
-static DPCPU_DEFINE(struct linux_epoch_record, linux_epoch_record);
+static ck_epoch_t linux_epoch[RCU_TYPE_MAX];
+static struct linux_epoch_head linux_epoch_head[RCU_TYPE_MAX];
+static DPCPU_DEFINE(struct linux_epoch_record, 
linux_epoch_record[RCU_TYPE_MAX]);
 
 static void linux_rcu_cleaner_func(void *, int);
 
@@ -100,23 +101,27 @@ linux_rcu_runtime_init(void *arg __unused)
 {
struct linux_epoch_head *head;
int i;
+   int j;
 
-   ck_epoch_init(_epoch);
+   for (j = 0; j != RCU_TYPE_MAX; j++) {
+   ck_epoch_init(_epoch[j]);
 
-   head = _epoch_head;
+   head = _epoch_head[j];
 
-   mtx_init(>lock, "LRCU-HEAD", NULL, MTX_DEF);
-   TASK_INIT(>task, 0, linux_rcu_cleaner_func, NULL);
-   STAILQ_INIT(>cb_head);
+   mtx_init(>lock, "LRCU-HEAD", NULL, MTX_DEF);
+   TASK_INIT(>task, 0, linux_rcu_cleaner_func, head);
+   STAILQ_INIT(>cb_head);
 
-   

svn commit: r359957 - in stable/12/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src sys

2020-04-14 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Apr 15 04:56:27 2020
New Revision: 359957
URL: https://svnweb.freebsd.org/changeset/base/359957

Log:
  MFC r359727:
  Clone the RCU interface into a sleepable and a non-sleepable part
  in the LinuxKPI.
  
  This allows synchronize RCU to be used inside a SRCU read section.
  No functional change intended.
  
  Bump the __FreeBSD_version to force recompilation of external kernel modules.
  
  PR:   242272
  Sponsored by: Mellanox Technologies

Modified:
  stable/12/sys/compat/linuxkpi/common/include/linux/rcupdate.h
  stable/12/sys/compat/linuxkpi/common/src/linux_rcu.c
  stable/12/sys/sys/param.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/compat/linuxkpi/common/include/linux/rcupdate.h
==
--- stable/12/sys/compat/linuxkpi/common/include/linux/rcupdate.h   Wed Apr 
15 04:52:59 2020(r359956)
+++ stable/12/sys/compat/linuxkpi/common/include/linux/rcupdate.h   Wed Apr 
15 04:56:27 2020(r359957)
@@ -35,6 +35,11 @@
 
 #defineLINUX_KFREE_RCU_OFFSET_MAX  4096/* exclusive */
 
+/* BSD specific defines */
+#defineRCU_TYPE_REGULAR 0
+#defineRCU_TYPE_SLEEPABLE 1
+#defineRCU_TYPE_MAX 2
+
 #defineRCU_INITIALIZER(v)  \
((__typeof(*(v)) *)(v))
 
@@ -43,27 +48,27 @@
 } while (0)
 
 #definecall_rcu(ptr, func) do {\
-   linux_call_rcu(ptr, func);  \
+   linux_call_rcu(RCU_TYPE_REGULAR, ptr, func);\
 } while (0)
 
 #definercu_barrier(void) do {  \
-   linux_rcu_barrier();\
+   linux_rcu_barrier(RCU_TYPE_REGULAR);\
 } while (0)
 
 #definercu_read_lock(void) do {\
-   linux_rcu_read_lock();  \
+   linux_rcu_read_lock(RCU_TYPE_REGULAR);  \
 } while (0)
 
 #definercu_read_unlock(void) do {  \
-   linux_rcu_read_unlock();\
+   linux_rcu_read_unlock(RCU_TYPE_REGULAR);\
 } while (0)
 
 #definesynchronize_rcu(void) do {  \
-   linux_synchronize_rcu();\
+   linux_synchronize_rcu(RCU_TYPE_REGULAR);\
 } while (0)
 
 #definesynchronize_rcu_expedited(void) do {\
-   linux_synchronize_rcu();\
+   linux_synchronize_rcu(RCU_TYPE_REGULAR);\
 } while (0)
 
 #definekfree_rcu(ptr, rcu_head) do {   \
@@ -94,11 +99,11 @@
 
 /* prototypes */
 
-extern void linux_call_rcu(struct rcu_head *ptr, rcu_callback_t func);
-extern void linux_rcu_barrier(void);
-extern void linux_rcu_read_lock(void);
-extern void linux_rcu_read_unlock(void);
-extern void linux_synchronize_rcu(void);
+extern void linux_call_rcu(unsigned type, struct rcu_head *ptr, rcu_callback_t 
func);
+extern void linux_rcu_barrier(unsigned type);
+extern void linux_rcu_read_lock(unsigned type);
+extern void linux_rcu_read_unlock(unsigned type);
+extern void linux_synchronize_rcu(unsigned type);
 
 /* Empty implementation for !DEBUG */
 #defineinit_rcu_head(...)

Modified: stable/12/sys/compat/linuxkpi/common/src/linux_rcu.c
==
--- stable/12/sys/compat/linuxkpi/common/src/linux_rcu.cWed Apr 15 
04:52:59 2020(r359956)
+++ stable/12/sys/compat/linuxkpi/common/src/linux_rcu.cWed Apr 15 
04:56:27 2020(r359957)
@@ -1,6 +1,6 @@
 /*-
  * Copyright (c) 2016 Matthew Macy (mm...@mattmacy.io)
- * Copyright (c) 2017 Hans Petter Selasky (hsela...@freebsd.org)
+ * Copyright (c) 2017-2020 Hans Petter Selasky (hsela...@freebsd.org)
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -90,9 +90,9 @@ CTASSERT(sizeof(struct rcu_head) == sizeof(struct call
  */
 CTASSERT(offsetof(struct linux_epoch_record, epoch_record) == 0);
 
-static ck_epoch_t linux_epoch;
-static struct linux_epoch_head linux_epoch_head;
-DPCPU_DEFINE_STATIC(struct linux_epoch_record, linux_epoch_record);
+static ck_epoch_t linux_epoch[RCU_TYPE_MAX];
+static struct linux_epoch_head linux_epoch_head[RCU_TYPE_MAX];
+DPCPU_DEFINE_STATIC(struct linux_epoch_record, 
linux_epoch_record[RCU_TYPE_MAX]);
 
 static void linux_rcu_cleaner_func(void *, int);
 
@@ -101,23 +101,27 @@ linux_rcu_runtime_init(void *arg __unused)
 {
struct linux_epoch_head *head;
int i;
+   int j;
 
-   ck_epoch_init(_epoch);
+   for (j = 0; j != RCU_TYPE_MAX; j++) {
+   ck_epoch_init(_epoch[j]);
 
-   head = _epoch_head;
+   head = _epoch_head[j];
 
-   mtx_init(>lock, "LRCU-HEAD", NULL, MTX_DEF);
-   TASK_INIT(>task, 0, linux_rcu_cleaner_func, NULL);
-   STAILQ_INIT(>cb_head);
+   mtx_init(>lock, "LRCU-HEAD", NULL, MTX_DEF);
+   TASK_INIT(>task, 0, linux_rcu_cleaner_func, 

svn commit: r359956 - stable/11/sys/compat/linuxkpi/common/include/linux

2020-04-14 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Apr 15 04:52:59 2020
New Revision: 359956
URL: https://svnweb.freebsd.org/changeset/base/359956

Log:
  MFC r359726:
  Some fixes for SRCU in the LinuxKPI.
  
  - Make sure to use READ_ONCE() when deferring variables.
  - Remove superfluous zero initializer.
  
  Sponsored by: Mellanox Technologies

Modified:
  stable/11/sys/compat/linuxkpi/common/include/linux/srcu.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/compat/linuxkpi/common/include/linux/srcu.h
==
--- stable/11/sys/compat/linuxkpi/common/include/linux/srcu.h   Wed Apr 15 
04:52:10 2020(r359955)
+++ stable/11/sys/compat/linuxkpi/common/include/linux/srcu.h   Wed Apr 15 
04:52:59 2020(r359956)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2015-2017 Mellanox Technologies, Ltd.
+ * Copyright (c) 2015-2020 Mellanox Technologies, Ltd.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -29,13 +29,16 @@
 #ifndef_LINUX_SRCU_H_
 #define_LINUX_SRCU_H_
 
+#include 
+
 struct srcu_struct {
 };
 
-#definesrcu_dereference(ptr,srcu)  ((__typeof(*(ptr)) *)(ptr))
+#definesrcu_dereference(p, srcu) \
+   ((__typeof(*(p)) *)READ_ONCE(p))
 
 #defineDEFINE_STATIC_SRCU(name) \
-   static struct srcu_struct name = {}
+   static struct srcu_struct name
 
 /* prototypes */
 
___
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: r359955 - stable/12/sys/compat/linuxkpi/common/include/linux

2020-04-14 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Apr 15 04:52:10 2020
New Revision: 359955
URL: https://svnweb.freebsd.org/changeset/base/359955

Log:
  MFC r359726:
  Some fixes for SRCU in the LinuxKPI.
  - Make sure to use READ_ONCE() when deferring variables.
  - Remove superfluous zero initializer.
  
  Sponsored by: Mellanox Technologies

Modified:
  stable/12/sys/compat/linuxkpi/common/include/linux/srcu.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/compat/linuxkpi/common/include/linux/srcu.h
==
--- stable/12/sys/compat/linuxkpi/common/include/linux/srcu.h   Wed Apr 15 
04:03:46 2020(r359954)
+++ stable/12/sys/compat/linuxkpi/common/include/linux/srcu.h   Wed Apr 15 
04:52:10 2020(r359955)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2015-2017 Mellanox Technologies, Ltd.
+ * Copyright (c) 2015-2020 Mellanox Technologies, Ltd.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -29,13 +29,16 @@
 #ifndef_LINUX_SRCU_H_
 #define_LINUX_SRCU_H_
 
+#include 
+
 struct srcu_struct {
 };
 
-#definesrcu_dereference(ptr,srcu)  ((__typeof(*(ptr)) *)(ptr))
+#definesrcu_dereference(p, srcu) \
+   ((__typeof(*(p)) *)READ_ONCE(p))
 
 #defineDEFINE_STATIC_SRCU(name) \
-   static struct srcu_struct name = {}
+   static struct srcu_struct name
 
 /* prototypes */
 
___
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: r359954 - head/sys/sys

2020-04-14 Thread Kyle Evans
Author: kevans
Date: Wed Apr 15 04:03:46 2020
New Revision: 359954
URL: https://svnweb.freebsd.org/changeset/base/359954

Log:
  sys/types.h: adjust #endif comment to match reality
  
  Submitted by: sigsys gmail com

Modified:
  head/sys/sys/types.h

Modified: head/sys/sys/types.h
==
--- head/sys/sys/types.hWed Apr 15 03:59:26 2020(r359953)
+++ head/sys/sys/types.hWed Apr 15 04:03:46 2020(r359954)
@@ -304,7 +304,7 @@ typedef _Bool   bool;
 
 #define offsetof(type, field) __offsetof(type, field)
 
-#endif /* !_KERNEL */
+#endif /* _KERNEL */
 
 /*
  * The following are all things that really shouldn't exist in this header,
___
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: r359953 - in head/sys: kern sys

2020-04-14 Thread Kyle Evans
Author: kevans
Date: Wed Apr 15 03:59:26 2020
New Revision: 359953
URL: https://svnweb.freebsd.org/changeset/base/359953

Log:
  kern uuid: break format validation out into a separate KPI
  
  This new KPI, validate_uuid, strictly validates the formatting of the input
  UUID and, optionally, populates a given struct uuid.
  
  As noted in the header, the key differences are that the new KPI won't
  recognize an empty string as a nil UUID and it won't do any kind of semantic
  validation on it. Also key is that populating a struct uuid is optional, so
  the caller doesn't necessarily need to allocate a bogus one on the stack
  just to validate the string.
  
  This KPI has specifically been broken out in support of D24288, which will
  preload /etc/hostid in loader so that early boot hostuuid users (e.g.
  anything that calls ether_gen_addr) can have a valid hostuuid to work with
  once it's been stashed in /etc/hostid.

Modified:
  head/sys/kern/kern_uuid.c
  head/sys/sys/uuid.h

Modified: head/sys/kern/kern_uuid.c
==
--- head/sys/kern/kern_uuid.c   Wed Apr 15 03:40:33 2020(r359952)
+++ head/sys/kern/kern_uuid.c   Wed Apr 15 03:59:26 2020(r359953)
@@ -382,19 +382,16 @@ be_uuid_dec(void const *buf, struct uuid *uuid)
 }
 
 int
-parse_uuid(const char *str, struct uuid *uuid)
+validate_uuid(const char *str, size_t size, struct uuid *uuid)
 {
u_int c[11];
int n;
 
-   /* An empty string represents a nil UUID. */
-   if (*str == '\0') {
-   bzero(uuid, sizeof(*uuid));
-   return (0);
-   }
+   if (size == 0 || *str == '\0')
+   return (EINVAL);
 
/* The UUID string representation has a fixed length. */
-   if (strlen(str) != 36)
+   if (size != 36)
return (EINVAL);
 
/*
@@ -406,25 +403,48 @@ parse_uuid(const char *str, struct uuid *uuid)
if (str[8] != '-')
return (EINVAL);
 
+   /* Now check the format. */
n = sscanf(str, "%8x-%4x-%4x-%2x%2x-%2x%2x%2x%2x%2x%2x", c + 0, c + 1,
c + 2, c + 3, c + 4, c + 5, c + 6, c + 7, c + 8, c + 9, c + 10);
/* Make sure we have all conversions. */
if (n != 11)
return (EINVAL);
 
-   /* Successful scan. Build the UUID. */
-   uuid->time_low = c[0];
-   uuid->time_mid = c[1];
-   uuid->time_hi_and_version = c[2];
-   uuid->clock_seq_hi_and_reserved = c[3];
-   uuid->clock_seq_low = c[4];
-   for (n = 0; n < 6; n++)
-   uuid->node[n] = c[n + 5];
+   /* Successful scan. Build the UUID if requested. */
+   if (uuid != NULL) {
+   uuid->time_low = c[0];
+   uuid->time_mid = c[1];
+   uuid->time_hi_and_version = c[2];
+   uuid->clock_seq_hi_and_reserved = c[3];
+   uuid->clock_seq_low = c[4];
+   for (n = 0; n < 6; n++)
+   uuid->node[n] = c[n + 5];
+   }
 
+   return (0);
+}
+
+int
+parse_uuid(const char *str, struct uuid *uuid)
+{
+   unsigned int clock_seq;
+   int ret;
+
+   /* An empty string represents a nil UUID. */
+   if (*str == '\0') {
+   bzero(uuid, sizeof(*uuid));
+   return (0);
+   }
+
+   ret = validate_uuid(str, strlen(str), uuid);
+   if (ret != 0)
+   return (ret);
+
/* Check semantics... */
-   return (((c[3] & 0x80) != 0x00 &&   /* variant 0? */
-   (c[3] & 0xc0) != 0x80 &&/* variant 1? */
-   (c[3] & 0xe0) != 0xc0) ? EINVAL : 0);   /* variant 2? */
+   clock_seq = uuid->clock_seq_hi_and_reserved;
+   return (((clock_seq & 0x80) != 0x00 &&  /* variant 0? */
+   (clock_seq & 0xc0) != 0x80 &&   /* variant 1? */
+   (clock_seq & 0xe0) != 0xc0) ? EINVAL : 0);  /* variant 2? */
 }
 
 int

Modified: head/sys/sys/uuid.h
==
--- head/sys/sys/uuid.h Wed Apr 15 03:40:33 2020(r359952)
+++ head/sys/sys/uuid.h Wed Apr 15 03:59:26 2020(r359953)
@@ -66,6 +66,21 @@ int uuid_ether_del(const uint8_t *);
 int snprintf_uuid(char *, size_t, struct uuid *);
 int printf_uuid(struct uuid *);
 int sbuf_printf_uuid(struct sbuf *, struct uuid *);
+
+/*
+ * There are a few key differences between validate_uuid and parse_uuid:
+ *
+ * - The struct uuid * parameter to validate_uuid is optional, so the caller
+ *can simply validate UUID format without doing anything with the result.
+ * - validate_uuid will not pass an empty string as a valid UUID, as it doesn't
+ *strictly meet the formatting requirements.  parse_uuid will accept an
+ *empty string and zero out the uuid struct accordingly.
+ * - parse_uuid does additional semantic checks on clock_seq_hi_and_reserved
+ *that validate_uuid will not 

svn commit: r359952 - head/sys/dev/cxgbe/iw_cxgbe

2020-04-14 Thread Navdeep Parhar
Author: np
Date: Wed Apr 15 03:40:33 2020
New Revision: 359952
URL: https://svnweb.freebsd.org/changeset/base/359952

Log:
  cxgbe/iw_cxgbe: Do not start the EP timer if soaccept fails.
  
  This fixes a panic that would occur when the timer tried to close a
  stale socket.
  
  Submitted by: Krishnamraju Eraparaju @ Chelsio
  MFC after:1 week
  Sponsored by: Chelsio Communications

Modified:
  head/sys/dev/cxgbe/iw_cxgbe/cm.c

Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c
==
--- head/sys/dev/cxgbe/iw_cxgbe/cm.cWed Apr 15 02:34:44 2020
(r359951)
+++ head/sys/dev/cxgbe/iw_cxgbe/cm.cWed Apr 15 03:40:33 2020
(r359952)
@@ -1013,7 +1013,6 @@ process_newconn(struct c4iw_listen_ep *master_lep, str
c4iw_get_ep(_lep->com);
init_timer(_ep->timer);
new_ep->com.state = MPA_REQ_WAIT;
-   START_EP_TIMER(new_ep);
 
setiwsockopt(new_so);
ret = soaccept(new_so, (struct sockaddr **));
@@ -1023,13 +1022,14 @@ process_newconn(struct c4iw_listen_ep *master_lep, str
__func__, master_lep->com.so, new_so, ret);
if (remote != NULL)
free(remote, M_SONAME);
-   uninit_iwarp_socket(new_so);
soclose(new_so);
c4iw_put_ep(_ep->com);
c4iw_put_ep(_lep->com);
return;
}
free(remote, M_SONAME);
+
+   START_EP_TIMER(new_ep);
 
/* MPA request might have been queued up on the socket already, so we
 * initialize the socket/upcall_handler under lock to prevent processing
___
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: r359951 - head/usr.sbin/bhyve

2020-04-14 Thread Conrad Meyer
Author: cem
Date: Wed Apr 15 02:34:44 2020
New Revision: 359951
URL: https://svnweb.freebsd.org/changeset/base/359951

Log:
  bhyve(8): Minor cosmetic niceties in instemul failure
  
  Print the failed instruction stream as a contiguous stream of hex.  This
  is closer to something you could throw at a disassembler than 0xHH 0xHH
  0xHH.
  
  Also, use the debug.h 'raw' stdio-aware printf helper to avoid the
  cascading
   line
   effect.

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

Modified: head/usr.sbin/bhyve/bhyverun.c
==
--- head/usr.sbin/bhyve/bhyverun.c  Wed Apr 15 02:00:17 2020
(r359950)
+++ head/usr.sbin/bhyve/bhyverun.c  Wed Apr 15 02:34:44 2020
(r359951)
@@ -72,6 +72,7 @@ __FBSDID("$FreeBSD$");
 #include "bootrom.h"
 #include "inout.h"
 #include "dbgport.h"
+#include "debug.h"
 #include "fwctl.h"
 #include "gdb.h"
 #include "ioapic.h"
@@ -718,16 +719,14 @@ vmexit_inst_emul(struct vmctx *ctx, struct vm_exit *vm
 
if (err) {
if (err == ESRCH) {
-   fprintf(stderr, "Unhandled memory access to 0x%lx\n",
+   EPRINTLN("Unhandled memory access to 0x%lx\n",
vmexit->u.inst_emul.gpa);
}
 
-   fprintf(stderr, "Failed to emulate instruction [");
-   for (i = 0; i < vie->num_valid; i++) {
-   fprintf(stderr, "0x%02x%s", vie->inst[i],
-   i != (vie->num_valid - 1) ? " " : "");
-   }
-   fprintf(stderr, "] at 0x%lx\n", vmexit->rip);
+   fprintf(stderr, "Failed to emulate instruction sequence [ ");
+   for (i = 0; i < vie->num_valid; i++)
+   fprintf(stderr, "%02x", vie->inst[i]);
+   FPRINTLN(stderr, " ] at 0x%lx", vmexit->rip);
return (VMEXIT_ABORT);
}
 
___
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: r359950 - head/usr.sbin/bhyve

2020-04-14 Thread Conrad Meyer
Author: cem
Date: Wed Apr 15 02:00:17 2020
New Revision: 359950
URL: https://svnweb.freebsd.org/changeset/base/359950

Log:
  bhyve(8): Add VM Generation Counter ACPI device
  
  Add an implementatation of the 'Virtual Machine Generation ID' spec to
  Bhyve.  The spec provides a randomly generated GUID (at bhyve start) in
  device memory, along with an ACPI device with _CID VM_Gen_Counter and ADDR
  evaluating to a Package pointing at that GUID.
  
  A GPE is defined which Notifies the ACPI Device when the generation changes
  (such as when a snapshot is rolled back).  At this time, Bhyve does not
  support snapshotting, so the GPE is never actually raised.
  
  Suggested by: rpokala
  Discussed with:   grehan
  Differential Revision:https://reviews.freebsd.org/D23165

Added:
  head/usr.sbin/bhyve/vmgenc.c   (contents, props changed)
  head/usr.sbin/bhyve/vmgenc.h   (contents, props changed)
Modified:
  head/usr.sbin/bhyve/Makefile
  head/usr.sbin/bhyve/acpi.c
  head/usr.sbin/bhyve/acpi.h
  head/usr.sbin/bhyve/bhyverun.c
  head/usr.sbin/bhyve/pm.c

Modified: head/usr.sbin/bhyve/Makefile
==
--- head/usr.sbin/bhyve/MakefileWed Apr 15 01:58:51 2020
(r359949)
+++ head/usr.sbin/bhyve/MakefileWed Apr 15 02:00:17 2020
(r359950)
@@ -67,6 +67,7 @@ SRCS= \
usb_mouse.c \
virtio.c\
vga.c   \
+   vmgenc.c\
xmsr.c  \
spinup_ap.c \
iov.c

Modified: head/usr.sbin/bhyve/acpi.c
==
--- head/usr.sbin/bhyve/acpi.c  Wed Apr 15 01:58:51 2020(r359949)
+++ head/usr.sbin/bhyve/acpi.c  Wed Apr 15 02:00:17 2020(r359950)
@@ -74,6 +74,7 @@ __FBSDID("$FreeBSD$");
 #include "bhyverun.h"
 #include "acpi.h"
 #include "pci_emul.h"
+#include "vmgenc.h"
 
 /*
  * Define the base address of the ACPI tables, the sizes of some tables, 
@@ -367,13 +368,13 @@ basl_fwrite_fadt(FILE *fp)
EFPRINTF(fp, "[0004]\t\tPM2 Control Block Address : \n");
EFPRINTF(fp, "[0004]\t\tPM Timer Block Address : %08X\n",
IO_PMTMR);
-   EFPRINTF(fp, "[0004]\t\tGPE0 Block Address : \n");
+   EFPRINTF(fp, "[0004]\t\tGPE0 Block Address : %08X\n", IO_GPE0_BLK);
EFPRINTF(fp, "[0004]\t\tGPE1 Block Address : \n");
EFPRINTF(fp, "[0001]\t\tPM1 Event Block Length : 04\n");
EFPRINTF(fp, "[0001]\t\tPM1 Control Block Length : 02\n");
EFPRINTF(fp, "[0001]\t\tPM2 Control Block Length : 00\n");
EFPRINTF(fp, "[0001]\t\tPM Timer Block Length : 04\n");
-   EFPRINTF(fp, "[0001]\t\tGPE0 Block Length : 00\n");
+   EFPRINTF(fp, "[0001]\t\tGPE0 Block Length : %02x\n", IO_GPE0_LEN);
EFPRINTF(fp, "[0001]\t\tGPE1 Block Length : 00\n");
EFPRINTF(fp, "[0001]\t\tGPE1 Base Offset : 00\n");
EFPRINTF(fp, "[0001]\t\t_CST Support : 00\n");
@@ -501,10 +502,10 @@ basl_fwrite_fadt(FILE *fp)
 
EFPRINTF(fp, "[0012]\t\tGPE0 Block : [Generic Address Structure]\n");
EFPRINTF(fp, "[0001]\t\tSpace ID : 01 [SystemIO]\n");
-   EFPRINTF(fp, "[0001]\t\tBit Width : 00\n");
+   EFPRINTF(fp, "[0001]\t\tBit Width : %02x\n", IO_GPE0_LEN * 8);
EFPRINTF(fp, "[0001]\t\tBit Offset : 00\n");
EFPRINTF(fp, "[0001]\t\tEncoded Access Width : 01 [Byte Access:8]\n");
-   EFPRINTF(fp, "[0008]\t\tAddress : \n");
+   EFPRINTF(fp, "[0008]\t\tAddress : %016X\n", IO_GPE0_BLK);
EFPRINTF(fp, "\n");
 
EFPRINTF(fp, "[0012]\t\tGPE1 Block : [Generic Address Structure]\n");
@@ -756,6 +757,9 @@ basl_fwrite_dsdt(FILE *fp)
dsdt_line("  })");
dsdt_line("}");
dsdt_line("  }");
+
+   vmgenc_write_dsdt();
+
dsdt_line("}");
 
if (dsdt_error != 0)

Modified: head/usr.sbin/bhyve/acpi.h
==
--- head/usr.sbin/bhyve/acpi.h  Wed Apr 15 01:58:51 2020(r359949)
+++ head/usr.sbin/bhyve/acpi.h  Wed Apr 15 02:00:17 2020(r359950)
@@ -42,9 +42,19 @@
 
 #defineIO_PMTMR0x408   /* 4-byte i/o port for the 
timer */
 
+#defineIO_GPE0_BLK 0x40c   /* 2x 1-byte IO port for 
GPE0_STS/EN */
+#defineIO_GPE0_LEN 0x2
+
+#defineIO_GPE0_STS IO_GPE0_BLK
+#defineIO_GPE0_EN  (IO_GPE0_BLK + (IO_GPE0_LEN / 2))
+
+/* Allocated GPE bits. */
+#defineGPE_VMGENC  0
+
 struct vmctx;
 
 intacpi_build(struct vmctx *ctx, int ncpu);
+void   acpi_raise_gpe(struct vmctx *ctx, unsigned bit);
 void   dsdt_line(const char *fmt, ...);
 void   dsdt_fixed_ioport(uint16_t iobase, uint16_t length);
 void   dsdt_fixed_irq(uint8_t irq);

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

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

2020-04-14 Thread Conrad Meyer
Author: cem
Date: Wed Apr 15 01:58:51 2020
New Revision: 359949
URL: https://svnweb.freebsd.org/changeset/base/359949

Log:
  bhyve(8): Add bootrom allocation abstraction
  
  To allow more general use of the bootrom region, separate initialization from
  allocation, and allocation from loading a file.
  
  The bootrom segment is the high 16MB of the low 4GB region.
  
  Each allocation in the segment creates a new mapping with specified 
protection.
  By default, allocation begins at the low end of the range.  However, the
  BOOTROM_ALLOC_TOP flag is provided to locate a provided bootrom in the high
  region it is expected to be in.
  
  The existing ROM-file loading code is refactored to use the new interface.
  
  Reviewed by:  grehan (earlier version)
  Differential Revision:https://reviews.freebsd.org/D24422

Modified:
  head/usr.sbin/bhyve/bhyverun.c
  head/usr.sbin/bhyve/bootrom.c
  head/usr.sbin/bhyve/bootrom.h
  head/usr.sbin/bhyve/pci_lpc.c

Modified: head/usr.sbin/bhyve/bhyverun.c
==
--- head/usr.sbin/bhyve/bhyverun.c  Wed Apr 15 01:39:17 2020
(r359948)
+++ head/usr.sbin/bhyve/bhyverun.c  Wed Apr 15 01:58:51 2020
(r359949)
@@ -69,6 +69,7 @@ __FBSDID("$FreeBSD$");
 #include "bhyverun.h"
 #include "acpi.h"
 #include "atkbdc.h"
+#include "bootrom.h"
 #include "inout.h"
 #include "dbgport.h"
 #include "fwctl.h"
@@ -1157,6 +1158,7 @@ main(int argc, char *argv[])
 
init_mem();
init_inout();
+   init_bootrom(ctx);
atkbdc_init(ctx);
pci_irq_init(ctx);
ioapic_init(ctx);

Modified: head/usr.sbin/bhyve/bootrom.c
==
--- head/usr.sbin/bhyve/bootrom.c   Wed Apr 15 01:39:17 2020
(r359948)
+++ head/usr.sbin/bhyve/bootrom.c   Wed Apr 15 01:58:51 2020
(r359949)
@@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -47,16 +48,102 @@ __FBSDID("$FreeBSD$");
 #include "bootrom.h"
 #include "debug.h"
 
-#defineMAX_BOOTROM_SIZE(16 * 1024 * 1024)  /* 16 MB */
+#defineBOOTROM_SIZE(16 * 1024 * 1024)  /* 16 MB */
 
+/*
+ * ROM region is 16 MB at the top of 4GB ("low") memory.
+ *
+ * The size is limited so it doesn't encroach into reserved MMIO space (e.g.,
+ * APIC, HPET, MSI).
+ *
+ * It is allocated in page-multiple blocks on a first-come first-serve basis,
+ * from high to low, during initialization, and does not change at runtime.
+ */
+static char *romptr;   /* Pointer to userspace-mapped bootrom region. */
+static vm_paddr_t gpa_base;/* GPA of low end of region. */
+static vm_paddr_t gpa_allocbot;/* Low GPA of free region. */
+static vm_paddr_t gpa_alloctop;/* High GPA, minus 1, of free region. */
+
+void
+init_bootrom(struct vmctx *ctx)
+{
+   romptr = vm_create_devmem(ctx, VM_BOOTROM, "bootrom", BOOTROM_SIZE);
+   if (romptr == MAP_FAILED)
+   err(4, "%s: vm_create_devmem", __func__);
+   gpa_base = (1ULL << 32) - BOOTROM_SIZE;
+   gpa_allocbot = gpa_base;
+   gpa_alloctop = (1ULL << 32) - 1;
+}
+
 int
-bootrom_init(struct vmctx *ctx, const char *romfile)
+bootrom_alloc(struct vmctx *ctx, size_t len, int prot, int flags,
+char **region_out, uint64_t *gpa_out)
 {
-   struct stat sbuf;
+   static const int bootrom_valid_flags = BOOTROM_ALLOC_TOP;
+
vm_paddr_t gpa;
+   vm_ooffset_t segoff;
+
+   if (flags & ~bootrom_valid_flags) {
+   warnx("%s: Invalid flags: %x", __func__,
+   flags & ~bootrom_valid_flags);
+   return (EINVAL);
+   }
+   if (prot & ~_PROT_ALL) {
+   warnx("%s: Invalid protection: %x", __func__,
+   prot & ~_PROT_ALL);
+   return (EINVAL);
+   }
+
+   if (len == 0 || len > BOOTROM_SIZE) {
+   warnx("ROM size %zu is invalid", len);
+   return (EINVAL);
+   }
+   if (len & PAGE_MASK) {
+   warnx("ROM size %zu is not a multiple of the page size",
+   len);
+   return (EINVAL);
+   }
+
+   if (flags & BOOTROM_ALLOC_TOP) {
+   gpa = (gpa_alloctop - len) + 1;
+   if (gpa < gpa_allocbot) {
+   warnx("No room for %zu ROM in bootrom region", len);
+   return (ENOMEM);
+   }
+   } else {
+   gpa = gpa_allocbot;
+   if (gpa > (gpa_alloctop - len) + 1) {
+   warnx("No room for %zu ROM in bootrom region", len);
+   return (ENOMEM);
+   }
+   }
+
+   segoff = gpa - gpa_base;
+   if (vm_mmap_memseg(ctx, gpa, VM_BOOTROM, segoff, len, prot) != 0) {
+   int serrno = errno;
+   warn("%s: vm_mmap_mapseg", __func__);
+   return (serrno);

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

2020-04-14 Thread Conrad Meyer
Author: cem
Date: Wed Apr 15 01:39:17 2020
New Revision: 359948
URL: https://svnweb.freebsd.org/changeset/base/359948

Log:
  bus_dma.9: Remove erroneous usage recommendation
  
  It is not valid to pass BUS_SPACE_UNRESTRICTED to bus_dma_tag_create()'s
  nsegments parameter as it is interpreted as a very large segment count.
  Subsequent allocation operations on the tag will preallocate some multiple of
  that count.  BUS_SPACE_UNRESTRICTED therefore indicates something like:
  malloc(infinity).
  
  Discussed with:   bcr, jhb (earlier version)

Modified:
  head/share/man/man9/bus_dma.9

Modified: head/share/man/man9/bus_dma.9
==
--- head/share/man/man9/bus_dma.9   Wed Apr 15 00:36:00 2020
(r359947)
+++ head/share/man/man9/bus_dma.9   Wed Apr 15 01:39:17 2020
(r359948)
@@ -53,7 +53,7 @@
 .\" $FreeBSD$
 .\" $NetBSD: bus_dma.9,v 1.25 2002/10/14 13:43:16 wiz Exp $
 .\"
-.Dd March 27, 2020
+.Dd April 14, 2020
 .Dt BUS_DMA 9
 .Os
 .Sh NAME
@@ -618,9 +618,6 @@ DMA mapping associated with this tag.
 .It Fa nsegments
 Number of discontinuities (scatter/gather segments) allowed
 in a DMA mapped region.
-If there is no restriction,
-.Dv BUS_SPACE_UNRESTRICTED
-may be specified.
 .It Fa maxsegsz
 Maximum size, in bytes, of a segment in any DMA mapped region associated
 with
___
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: r359945 - in head: lib/geom/eli sys/geom/eli

2020-04-14 Thread Xin Li via svn-src-all
On 4/14/20 17:22, Alan Somers wrote:
> On Tue, Apr 14, 2020 at 6:15 PM John Baldwin  > wrote:
> 
> Author: jhb
> Date: Wed Apr 15 00:14:50 2020
> New Revision: 359945
> URL: https://svnweb.freebsd.org/changeset/base/359945
> 
> Log:
>   Remove support for geli(4) algorithms deprecated in r348206.
[snip]
> Why remove read-only support?  That will make it much harder to convert
> old volumes.

Because they uses 64-bit block size and is vulnerable to birthday
attacks.  We have officially communicated that these algorithms would be
gone in 13 last year, with gone_in messages in place, so I think it's
fine to remove them as we are not going to keep the code forever.

Cheers,

___
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: r359947 - stable/12/sys/x86/x86

2020-04-14 Thread Konstantin Belousov
Author: kib
Date: Wed Apr 15 00:36:00 2020
New Revision: 359947
URL: https://svnweb.freebsd.org/changeset/base/359947

Log:
  MFC r359520:
  x86 tsc: fall back to CPUID if calibration results looks unbelievable.

Modified:
  stable/12/sys/x86/x86/tsc.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/x86/x86/tsc.c
==
--- stable/12/sys/x86/x86/tsc.c Wed Apr 15 00:18:19 2020(r359946)
+++ stable/12/sys/x86/x86/tsc.c Wed Apr 15 00:36:00 2020(r359947)
@@ -142,7 +142,7 @@ tsc_freq_vmware(void)
  * tsc_freq_intel(), when available.
  */
 static bool
-tsc_freq_cpuid(void)
+tsc_freq_cpuid(uint64_t *res)
 {
u_int regs[4];
 
@@ -150,7 +150,7 @@ tsc_freq_cpuid(void)
return (false);
do_cpuid(0x15, regs);
if (regs[0] != 0 && regs[1] != 0 && regs[2] != 0) {
-   tsc_freq = (uint64_t)regs[2] * regs[1] / regs[0];
+   *res = (uint64_t)regs[2] * regs[1] / regs[0];
return (true);
}
 
@@ -158,7 +158,7 @@ tsc_freq_cpuid(void)
return (false);
do_cpuid(0x16, regs);
if (regs[0] != 0) {
-   tsc_freq = (uint64_t)regs[0] * 100;
+   *res = (uint64_t)regs[0] * 100;
return (true);
}
 
@@ -228,7 +228,8 @@ static void
 probe_tsc_freq(void)
 {
u_int regs[4];
-   uint64_t tsc1, tsc2;
+   uint64_t tmp_freq, tsc1, tsc2;
+   int no_cpuid_override;
uint16_t bootflags;
 
if (cpu_high >= 6) {
@@ -303,15 +304,15 @@ probe_tsc_freq(void)
 */
if (acpi_get_fadt_bootflags() &&
(bootflags & ACPI_FADT_LEGACY_DEVICES) == 0 &&
-   tsc_freq_cpuid()) {
+   tsc_freq_cpuid(_freq)) {
printf("Skipping TSC calibration since no legacy "
"devices reported by FADT and CPUID works\n");
tsc_skip_calibration = 1;
}
}
if (tsc_skip_calibration) {
-   if (tsc_freq_cpuid())
-   ;
+   if (tsc_freq_cpuid(_freq))
+   tsc_freq = tmp_freq;
else if (cpu_vendor_id == CPU_VENDOR_INTEL)
tsc_freq_intel();
} else {
@@ -321,6 +322,32 @@ probe_tsc_freq(void)
DELAY(100);
tsc2 = rdtsc();
tsc_freq = tsc2 - tsc1;
+
+   /*
+* If the difference between calibrated frequency and
+* the frequency reported by CPUID 0x15/0x16 leafs
+* differ significantly, this probably means that
+* calibration is bogus.  It happens on machines
+* without 8254 timer and with BIOS not properly
+* reporting it in FADT boot flags.
+*/
+   if (tsc_freq_cpuid(_freq) && qabs(tsc_freq - tmp_freq) >
+   uqmin(tsc_freq, tmp_freq)) {
+   no_cpuid_override = 0;
+   TUNABLE_INT_FETCH("machdep.disable_tsc_cpuid_override",
+   _cpuid_override);
+   if (!no_cpuid_override) {
+   if (bootverbose) {
+   printf(
+   "TSC clock: calibration freq %ju Hz, CPUID freq %ju Hz%s\n",
+   (uintmax_t)tsc_freq,
+   (uintmax_t)tmp_freq,
+   no_cpuid_override ? "" :
+   ", doing CPUID override");
+   }
+   tsc_freq = tmp_freq;
+   }
+   }
}
if (bootverbose)
printf("TSC clock: %ju Hz\n", (intmax_t)tsc_freq);
___
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: r359944 - head/tests/sys/audit

2020-04-14 Thread Kyle Evans
On Tue, Apr 14, 2020 at 7:21 PM Alan Somers  wrote:
>
> On Tue, Apr 14, 2020 at 5:36 PM Kyle Evans  wrote:
>>
>> Author: kevans
>> Date: Tue Apr 14 23:36:03 2020
>> New Revision: 359944
>> URL: https://svnweb.freebsd.org/changeset/base/359944
>>
>> Log:
>>   tests: audit: mark closefrom test an expected fail for now
>>
>>   closefrom has been converted to close_range internally; remediation is
>>   underway for this, marking it as an expected fail for now while proper
>>   course is determined.
>>
>>   PR:   245625
>
>
> Thanks for taking care of this.  It sounds like somebody forgot to run the 
> tests before committing.

Yes- strange, given how many times I ran them with the adjacent
changes as I was amending them for close_range support. =-(
___
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: r359945 - in head: lib/geom/eli sys/geom/eli

2020-04-14 Thread Alan Somers
On Tue, Apr 14, 2020 at 6:15 PM John Baldwin  wrote:

> Author: jhb
> Date: Wed Apr 15 00:14:50 2020
> New Revision: 359945
> URL: https://svnweb.freebsd.org/changeset/base/359945
>
> Log:
>   Remove support for geli(4) algorithms deprecated in r348206.
>
>   This removes support for reading and writing volumes using the
>   following algorithms:
>
>   - Triple DES
>   - Blowfish
>   - MD5 HMAC integrity
>
>   In addition, this commit adds an explicit whitelist of supported
>   algorithms to give a better error message when an invalid or
>   unsupported algorithm is used by an existing volume.
>
>   Reviewed by:  cem
>   Sponsored by: Chelsio Communications
>   Differential Revision:https://reviews.freebsd.org/D24343
>

Why remove read-only support?  That will make it much harder to convert old
volumes.
-Alan
___
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: r359944 - head/tests/sys/audit

2020-04-14 Thread Alan Somers
On Tue, Apr 14, 2020 at 5:36 PM Kyle Evans  wrote:

> Author: kevans
> Date: Tue Apr 14 23:36:03 2020
> New Revision: 359944
> URL: https://svnweb.freebsd.org/changeset/base/359944
>
> Log:
>   tests: audit: mark closefrom test an expected fail for now
>
>   closefrom has been converted to close_range internally; remediation is
>   underway for this, marking it as an expected fail for now while proper
>   course is determined.
>
>   PR:   245625
>

Thanks for taking care of this.  It sounds like somebody forgot to run the
tests before committing.
-Alan
___
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: r359946 - in stable/12: include/protocols sbin/dump sbin/restore

2020-04-14 Thread Kirk McKusick
Author: mckusick
Date: Wed Apr 15 00:18:19 2020
New Revision: 359946
URL: https://svnweb.freebsd.org/changeset/base/359946

Log:
  MFC of 359627
  
  Update dump and restore to compile with -fno-common.

Modified:
  stable/12/include/protocols/dumprestore.h
  stable/12/sbin/dump/dump.h
  stable/12/sbin/dump/dumprmt.c
  stable/12/sbin/dump/itime.c
  stable/12/sbin/dump/main.c
  stable/12/sbin/dump/pathnames.h
  stable/12/sbin/dump/tape.c
  stable/12/sbin/restore/restore.h
  stable/12/sbin/restore/tape.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/include/protocols/dumprestore.h
==
--- stable/12/include/protocols/dumprestore.h   Wed Apr 15 00:14:50 2020
(r359945)
+++ stable/12/include/protocols/dumprestore.h   Wed Apr 15 00:18:19 2020
(r359946)
@@ -76,7 +76,7 @@
  */
 typedef uint32_t dump_ino_t;
 
-union u_spcl {
+extern union u_spcl {
char dummy[TP_BSIZE];
struct  s_spcl {
int32_t c_type; /* record type (see below) */

Modified: stable/12/sbin/dump/dump.h
==
--- stable/12/sbin/dump/dump.h  Wed Apr 15 00:14:50 2020(r359945)
+++ stable/12/sbin/dump/dump.h  Wed Apr 15 00:18:19 2020(r359946)
@@ -36,10 +36,10 @@
 /*
  * Dump maps used to describe what is to be dumped.
  */
-intmapsize;/* size of the state maps */
-char   *usedinomap;/* map of allocated inodes */
-char   *dumpdirmap;/* map of directories to be dumped */
-char   *dumpinomap;/* map of files to be dumped */
+extern int mapsize;/* size of the state maps */
+extern char *usedinomap;   /* map of allocated inodes */
+extern char *dumpdirmap;   /* map of directories to be dumped */
+extern char *dumpinomap;   /* map of files to be dumped */
 /*
  * Map manipulation macros.
  */
@@ -56,40 +56,40 @@ char*dumpinomap;/* map of files to be dumped */
 /*
  * All calculations done in 0.1" units!
  */
-char   *disk;  /* name of the disk file */
-char   *tape;  /* name of the tape file */
-char   *popenout;  /* popen(3) per-"tape" command */
-char   *dumpdates; /* name of the file containing dump date information*/
-char   *temp;  /* name of the file for doing rewrite of dumpdates */
-intlastlevel;  /* dump level of previous dump */
-intlevel;  /* dump level of this dump */
-intuflag;  /* update flag */
-intdiskfd; /* disk file descriptor */
-inttapefd; /* tape file descriptor */
-intpipeout;/* true => output to standard output */
-ino_t  curino; /* current inumber; used globally */
-intnewtape;/* new tape flag */
-intdensity;/* density in 0.1" units */
-long   tapesize;   /* estimated tape size, blocks */
-long   tsize;  /* tape size in 0.1" units */
-long   asize;  /* number of 0.1" units written on current tape */
-intetapes; /* estimated number of tapes */
-intnonodump;   /* if set, do not honor UF_NODUMP user flags */
-intunlimited;  /* if set, write to end of medium */
-intcachesize;  /* size of block cache in bytes */
-intrsync_friendly; /* be friendly with rsync */
+extern char *disk; /* name of the disk file */
+extern char *tape; /* name of the tape file */
+extern char *popenout; /* popen(3) per-"tape" command */
+extern char *dumpdates;/* name of the file containing dump date info */
+extern int lastlevel;  /* dump level of previous dump */
+extern int level;  /* dump level of this dump */
+extern int uflag;  /* update flag */
+extern int diskfd; /* disk file descriptor */
+extern int pipeout;/* true => output to standard output */
+extern ino_t curino;   /* current inumber; used globally */
+extern int newtape;/* new tape flag */
+extern int density;/* density in 0.1" units */
+extern long tapesize;  /* estimated tape size, blocks */
+extern long tsize; /* tape size in 0.1" units */
+extern int etapes; /* estimated number of tapes */
+extern int nonodump;   /* if set, do not honor UF_NODUMP user flags */
+extern int unlimited;  /* if set, write to end of medium */
+extern int cachesize;  /* size of block cache in bytes */
+extern int rsync_friendly; /* be friendly with rsync */
+extern int notify; /* notify operator flag */
+extern int blockswritten;  /* number of blocks written on current tape */
+extern int tapeno; /* current tape number */
+extern int ntrec;  /* blocking factor on tape */
+extern long blocksperfile; /* number of blocks per output file */
+extern int cartridge;  /* assume non-cartridge tape 

svn commit: r359945 - in head: lib/geom/eli sys/geom/eli

2020-04-14 Thread John Baldwin
Author: jhb
Date: Wed Apr 15 00:14:50 2020
New Revision: 359945
URL: https://svnweb.freebsd.org/changeset/base/359945

Log:
  Remove support for geli(4) algorithms deprecated in r348206.
  
  This removes support for reading and writing volumes using the
  following algorithms:
  
  - Triple DES
  - Blowfish
  - MD5 HMAC integrity
  
  In addition, this commit adds an explicit whitelist of supported
  algorithms to give a better error message when an invalid or
  unsupported algorithm is used by an existing volume.
  
  Reviewed by:  cem
  Sponsored by: Chelsio Communications
  Differential Revision:https://reviews.freebsd.org/D24343

Modified:
  head/lib/geom/eli/geli.8
  head/lib/geom/eli/geom_eli.c
  head/sys/geom/eli/g_eli.c
  head/sys/geom/eli/g_eli.h
  head/sys/geom/eli/g_eli_crypto.c
  head/sys/geom/eli/g_eli_ctl.c

Modified: head/lib/geom/eli/geli.8
==
--- head/lib/geom/eli/geli.8Tue Apr 14 23:36:03 2020(r359944)
+++ head/lib/geom/eli/geli.8Wed Apr 15 00:14:50 2020(r359945)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 19, 2020
+.Dd April 14, 2020
 .Dt GELI 8
 .Os
 .Sh NAME
@@ -172,14 +172,11 @@ will make use of it automatically.
 Supports many cryptographic algorithms (currently
 .Nm AES-XTS ,
 .Nm AES-CBC ,
-.Nm Blowfish-CBC ,
-.Nm Camellia-CBC
 and
-.Nm 3DES-CBC ) .
+.Nm Camellia-CBC ) .
 .It
 Can optionally perform data authentication (integrity verification) utilizing
 one of the following algorithms:
-.Nm HMAC/MD5 ,
 .Nm HMAC/SHA1 ,
 .Nm HMAC/RIPEMD160 ,
 .Nm HMAC/SHA256 ,
@@ -259,7 +256,6 @@ For example, when using 4096 bytes sector and
 .Nm HMAC/SHA256
 algorithm, 89% of the original provider storage will be available for use.
 Currently supported algorithms are:
-.Nm HMAC/MD5 ,
 .Nm HMAC/SHA1 ,
 .Nm HMAC/RIPEMD160 ,
 .Nm HMAC/SHA256 ,
@@ -303,9 +299,7 @@ Encryption algorithm to use.
 Currently supported algorithms are:
 .Nm AES-XTS ,
 .Nm AES-CBC ,
-.Nm Blowfish-CBC ,
 .Nm Camellia-CBC ,
-.Nm 3DES-CBC ,
 and
 .Nm NULL .
 The default and recommended algorithm is
@@ -359,11 +353,6 @@ key length.
 .Em 128 ,
 192,
 256
-.It Nm Blowfish-CBC
-.Em 128
-+ n * 32, for n=[0..10]
-.It Nm 3DES-CBC
-.Em 192
 .El
 .It Fl P
 Do not use a passphrase as a component of the User Key.
@@ -901,18 +890,6 @@ specified in
 .El
 .Sh EXIT STATUS
 Exit status is 0 on success, and 1 if the command fails.
-.Sh DEPRECATION NOTICE
-Support for the
-.Nm Blowfish-CBC
-and
-.Nm 3DES-CBC
-cryptographic algorithms and
-.Nm HMAC/MD5
-authentication algorithm will be removed in
-.Fx 13.0 .
-New volumes cannot be created using these algorithms.
-Existing volumes should be migrated to a new volume that uses
-non-deprecated algorithms.
 .Sh EXAMPLES
 Initialize a provider which is going to be encrypted with a
 passphrase and random data from a file on the user's pen drive.
@@ -967,7 +944,7 @@ Reenter new passphrase:
 Encrypted swap partition setup:
 .Bd -literal -offset indent
 # dd if=/dev/random of=/dev/ada0s1b bs=1m
-# geli onetime -d -e 3des ada0s1b
+# geli onetime -d ada0s1b
 # swapon /dev/ada0s1b.eli
 .Ed
 .Pp

Modified: head/lib/geom/eli/geom_eli.c
==
--- head/lib/geom/eli/geom_eli.cTue Apr 14 23:36:03 2020
(r359944)
+++ head/lib/geom/eli/geom_eli.cWed Apr 15 00:14:50 2020
(r359945)
@@ -805,22 +805,6 @@ eli_init(struct gctl_req *req)
return;
}
}
-   if (md.md_flags & G_ELI_FLAG_AUTH) {
-   switch (md.md_aalgo) {
-   case CRYPTO_MD5_HMAC:
-   gctl_error(req,
-   "The %s authentication algorithm is deprecated.",
-   g_eli_algo2str(md.md_aalgo));
-   return;
-   }
-   }
-   switch (md.md_ealgo) {
-   case CRYPTO_3DES_CBC:
-   case CRYPTO_BLF_CBC:
-   gctl_error(req, "The %s encryption algorithm is deprecated.",
-   g_eli_algo2str(md.md_ealgo));
-   return;
-   }
val = gctl_get_intmax(req, "keylen");
md.md_keylen = val;
md.md_keylen = g_eli_keylen(md.md_ealgo, md.md_keylen);

Modified: head/sys/geom/eli/g_eli.c
==
--- head/sys/geom/eli/g_eli.c   Tue Apr 14 23:36:03 2020(r359944)
+++ head/sys/geom/eli/g_eli.c   Wed Apr 15 00:14:50 2020(r359945)
@@ -847,6 +847,8 @@ g_eli_create(struct gctl_req *req, struct g_class *mp,
int dcw, error;
 
G_ELI_DEBUG(1, "Creating device %s%s.", bpp->name, G_ELI_SUFFIX);
+   KASSERT(eli_metadata_crypto_supported(md),
+   ("%s: unsupported crypto for %s", __func__, bpp->name));
 
gp = g_new_geomf(mp, "%s%s", bpp->name, G_ELI_SUFFIX);
sc = malloc(sizeof(*sc), M_ELI, M_WAITOK | M_ZERO);
@@ 

svn commit: r359944 - head/tests/sys/audit

2020-04-14 Thread Kyle Evans
Author: kevans
Date: Tue Apr 14 23:36:03 2020
New Revision: 359944
URL: https://svnweb.freebsd.org/changeset/base/359944

Log:
  tests: audit: mark closefrom test an expected fail for now
  
  closefrom has been converted to close_range internally; remediation is
  underway for this, marking it as an expected fail for now while proper
  course is determined.
  
  PR:   245625

Modified:
  head/tests/sys/audit/file-close.c

Modified: head/tests/sys/audit/file-close.c
==
--- head/tests/sys/audit/file-close.c   Tue Apr 14 23:24:24 2020
(r359943)
+++ head/tests/sys/audit/file-close.c   Tue Apr 14 23:36:03 2020
(r359944)
@@ -156,6 +156,8 @@ ATF_TC_BODY(closefrom_success, tc)
 {
const char *regex = "closefrom.*return,success";
FILE *pipefd = setup(fds, auclass);
+
+   atf_tc_expect_fail("closefrom was converted to close_range");
/* closefrom(2) returns 'void' */
closefrom(INT_MAX);
check_audit(fds, regex, pipefd);
___
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: r359943 - head/lib/libc/sys

2020-04-14 Thread Kyle Evans
Author: kevans
Date: Tue Apr 14 23:24:24 2020
New Revision: 359943
URL: https://svnweb.freebsd.org/changeset/base/359943

Log:
  closefrom: clamp lowfd to >= 0; close_range's parameters are unsigned.
  
  Pointy hat:   kevans
  Reported by:  CI (lwhsu)

Modified:
  head/lib/libc/sys/closefrom.c

Modified: head/lib/libc/sys/closefrom.c
==
--- head/lib/libc/sys/closefrom.c   Tue Apr 14 23:06:25 2020
(r359942)
+++ head/lib/libc/sys/closefrom.c   Tue Apr 14 23:24:24 2020
(r359943)
@@ -28,6 +28,7 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include 
 #include 
 #include 
 
@@ -40,7 +41,7 @@ closefrom(int lowfd)
 {
 
if (__getosreldate() >= CLOSE_RANGE_OSREL)
-   __sys_close_range(lowfd, ~0U, 0);
+   __sys_close_range(MAX(0, lowfd), ~0U, 0);
else
/* Fallback to closefrom(2) on older kernels. */
syscall(SYS_freebsd12_closefrom, lowfd);
___
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: r359942 - in head/sys: netinet netinet6

2020-04-14 Thread Alexander V. Chernikov
Author: melifaro
Date: Tue Apr 14 23:06:25 2020
New Revision: 359942
URL: https://svnweb.freebsd.org/changeset/base/359942

Log:
  Convert IP/IPv6 forwarding, ICMP processing and IP PCB laddr selection to
   the new routing KPI.
  
  Reviewed by:  ae
  Differential Revision:https://reviews.freebsd.org/D24245

Modified:
  head/sys/netinet/icmp6.h
  head/sys/netinet/in_pcb.c
  head/sys/netinet/ip_fastfwd.c
  head/sys/netinet/ip_icmp.c
  head/sys/netinet6/icmp6.c
  head/sys/netinet6/ip6_fastfwd.c
  head/sys/netinet6/ip6_forward.c

Modified: head/sys/netinet/icmp6.h
==
--- head/sys/netinet/icmp6.hTue Apr 14 22:57:21 2020(r359941)
+++ head/sys/netinet/icmp6.hTue Apr 14 23:06:25 2020(r359942)
@@ -693,7 +693,7 @@ voidkmod_icmp6stat_inc(int statnum);
 
 #ifdef _KERNEL
 # ifdef __STDC__
-struct rtentry;
+struct nhop_object;
 struct rttimer;
 struct in6_multi;
 # endif
@@ -705,7 +705,7 @@ voidicmp6_fasttimo(void);
 void   icmp6_slowtimo(void);
 void   icmp6_prepare(struct mbuf *);
 void   icmp6_redirect_input(struct mbuf *, int);
-void   icmp6_redirect_output(struct mbuf *, struct rtentry *);
+void   icmp6_redirect_output(struct mbuf *, struct nhop_object *);
 
 struct ip6ctlparam;
 void   icmp6_mtudisc_update(struct ip6ctlparam *, int);

Modified: head/sys/netinet/in_pcb.c
==
--- head/sys/netinet/in_pcb.c   Tue Apr 14 22:57:21 2020(r359941)
+++ head/sys/netinet/in_pcb.c   Tue Apr 14 23:06:25 2020(r359942)
@@ -88,6 +88,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #ifdef INET
 #include 
+#include 
 #endif
 #include 
 #include 
@@ -102,6 +103,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #endif /* INET6 */
+#include 
 #endif
 
 #include 
@@ -1033,8 +1035,8 @@ in_pcbladdr(struct inpcb *inp, struct in_addr *faddr, 
 {
struct ifaddr *ifa;
struct sockaddr *sa;
-   struct sockaddr_in *sin;
-   struct route sro;
+   struct sockaddr_in *sin, dst;
+   struct nhop_object *nh;
int error;
 
NET_EPOCH_ASSERT();
@@ -1047,9 +1049,10 @@ in_pcbladdr(struct inpcb *inp, struct in_addr *faddr, 
return (0);
 
error = 0;
-   bzero(, sizeof(sro));
 
-   sin = (struct sockaddr_in *)_dst;
+   nh = NULL;
+   bzero(, sizeof(dst));
+   sin = 
sin->sin_family = AF_INET;
sin->sin_len = sizeof(struct sockaddr_in);
sin->sin_addr.s_addr = faddr->s_addr;
@@ -1061,7 +1064,8 @@ in_pcbladdr(struct inpcb *inp, struct in_addr *faddr, 
 * Find out route to destination.
 */
if ((inp->inp_socket->so_options & SO_DONTROUTE) == 0)
-   in_rtalloc_ign(, 0, inp->inp_inc.inc_fibnum);
+   nh = fib4_lookup(inp->inp_inc.inc_fibnum, *faddr,
+   0, NHR_NONE, 0);
 
/*
 * If we found a route, use the address corresponding to
@@ -1071,7 +1075,7 @@ in_pcbladdr(struct inpcb *inp, struct in_addr *faddr, 
 * network and try to find a corresponding interface to take
 * the source address from.
 */
-   if (sro.ro_rt == NULL || sro.ro_rt->rt_ifp == NULL) {
+   if (nh == NULL || nh->nh_ifp == NULL) {
struct in_ifaddr *ia;
struct ifnet *ifp;
 
@@ -1124,22 +1128,22 @@ in_pcbladdr(struct inpcb *inp, struct in_addr *faddr, 
 *belonging to this jail. If so use it.
 * 3. as a last resort return the 'default' jail address.
 */
-   if ((sro.ro_rt->rt_ifp->if_flags & IFF_LOOPBACK) == 0) {
+   if ((nh->nh_ifp->if_flags & IFF_LOOPBACK) == 0) {
struct in_ifaddr *ia;
struct ifnet *ifp;
 
/* If not jailed, use the default returned. */
if (cred == NULL || !prison_flag(cred, PR_IP4)) {
-   ia = (struct in_ifaddr *)sro.ro_rt->rt_ifa;
+   ia = (struct in_ifaddr *)nh->nh_ifa;
laddr->s_addr = ia->ia_addr.sin_addr.s_addr;
goto done;
}
 
/* Jailed. */
/* 1. Check if the iface address belongs to the jail. */
-   sin = (struct sockaddr_in *)sro.ro_rt->rt_ifa->ifa_addr;
+   sin = (struct sockaddr_in *)nh->nh_ifa->ifa_addr;
if (prison_check_ip4(cred, >sin_addr) == 0) {
-   ia = (struct in_ifaddr *)sro.ro_rt->rt_ifa;
+   ia = (struct in_ifaddr *)nh->nh_ifa;
laddr->s_addr = ia->ia_addr.sin_addr.s_addr;
goto done;
}
@@ -1149,7 +1153,7 @@ in_pcbladdr(struct inpcb *inp, struct in_addr *faddr, 
 *belonging to this jail.
 */
ia = NULL;
-   ifp = sro.ro_rt->rt_ifp;
+   ifp = nh->nh_ifp;

svn commit: r359941 - in head/sys/fs: nfsclient nfsserver

2020-04-14 Thread Rick Macklem
Author: rmacklem
Date: Tue Apr 14 22:57:21 2020
New Revision: 359941
URL: https://svnweb.freebsd.org/changeset/base/359941

Log:
  Fix the NFSv2 extended attribute support to handle 0 length attributes.
  
  I did not realize that zero length attributes are allowed, but they are.
  This patch fixes the NFSv4.2 client and server to handle zero length
  extended attributes correctly.
  
  Submitted by: Frank van der Linden  (earlier version)
  Reported by:  Frank van der Linden 

Modified:
  head/sys/fs/nfsclient/nfs_clrpcops.c
  head/sys/fs/nfsclient/nfs_clvnops.c
  head/sys/fs/nfsserver/nfs_nfsdport.c
  head/sys/fs/nfsserver/nfs_nfsdserv.c

Modified: head/sys/fs/nfsclient/nfs_clrpcops.c
==
--- head/sys/fs/nfsclient/nfs_clrpcops.cTue Apr 14 22:48:33 2020
(r359940)
+++ head/sys/fs/nfsclient/nfs_clrpcops.cTue Apr 14 22:57:21 2020
(r359941)
@@ -8341,7 +8341,7 @@ nfsrpc_getextattr(vnode_t vp, const char *name, struct
} else if (uiop == NULL && len > 0) {
/* Just wants the length and not the data. */
error = nfsm_advance(nd, NFSM_RNDUP(len), -1);
-   } else
+   } else if (len > 0)
error = ENOATTR;
if (error != 0)
goto nfsmout;

Modified: head/sys/fs/nfsclient/nfs_clvnops.c
==
--- head/sys/fs/nfsclient/nfs_clvnops.c Tue Apr 14 22:48:33 2020
(r359940)
+++ head/sys/fs/nfsclient/nfs_clvnops.c Tue Apr 14 22:57:21 2020
(r359941)
@@ -3982,7 +3982,7 @@ nfs_setextattr(struct vop_setextattr_args *ap)
}
mtx_unlock(>nm_mtx);
 
-   if (ap->a_uio->uio_resid <= 0)
+   if (ap->a_uio->uio_resid < 0)
return (EINVAL);
cred = ap->a_cred;
if (cred == NULL)

Modified: head/sys/fs/nfsserver/nfs_nfsdport.c
==
--- head/sys/fs/nfsserver/nfs_nfsdport.cTue Apr 14 22:48:33 2020
(r359940)
+++ head/sys/fs/nfsserver/nfs_nfsdport.cTue Apr 14 22:57:21 2020
(r359941)
@@ -6159,8 +6159,14 @@ nfsvno_getxattr(struct vnode *vp, char *name, uint32_t
return (NFSERR_XATTR2BIG);
len = siz;
tlen = NFSM_RNDUP(len);
-   uiop->uio_iovcnt = nfsrv_createiovec(tlen, , , );
-   uiop->uio_iov = iv;
+   if (tlen > 0) {
+   uiop->uio_iovcnt = nfsrv_createiovec(tlen, , , );
+   uiop->uio_iov = iv;
+   } else {
+   uiop->uio_iovcnt = 0;
+   uiop->uio_iov = iv = NULL;
+   m = m2 = NULL;
+   }
uiop->uio_offset = 0;
uiop->uio_resid = tlen;
uiop->uio_rw = UIO_READ;
@@ -6173,8 +6179,9 @@ nfsvno_getxattr(struct vnode *vp, char *name, uint32_t
goto out;
 #endif
 
-   error = VOP_GETEXTATTR(vp, EXTATTR_NAMESPACE_USER, name, uiop, NULL,
-   cred, p);
+   if (tlen > 0)
+   error = VOP_GETEXTATTR(vp, EXTATTR_NAMESPACE_USER, name, uiop,
+   NULL, cred, p);
if (error != 0)
goto out;
if (uiop->uio_resid > 0) {
@@ -6191,7 +6198,8 @@ nfsvno_getxattr(struct vnode *vp, char *name, uint32_t
 
 out:
if (error != 0) {
-   m_freem(m);
+   if (m != NULL)
+   m_freem(m);
*lenp = 0;
}
free(iv, M_TEMP);
@@ -6223,9 +6231,14 @@ nfsvno_setxattr(struct vnode *vp, char *name, int len,
uiop->uio_td = p;
uiop->uio_offset = 0;
uiop->uio_resid = len;
-   error = nfsrv_createiovecw(len, m, cp, , );
-   uiop->uio_iov = iv;
-   uiop->uio_iovcnt = cnt;
+   if (len > 0) {
+   error = nfsrv_createiovecw(len, m, cp, , );
+   uiop->uio_iov = iv;
+   uiop->uio_iovcnt = cnt;
+   } else {
+   uiop->uio_iov = iv = NULL;
+   uiop->uio_iovcnt = 0;
+   }
if (error == 0) {
error = VOP_SETEXTATTR(vp, EXTATTR_NAMESPACE_USER, name, uiop,
cred, p);

Modified: head/sys/fs/nfsserver/nfs_nfsdserv.c
==
--- head/sys/fs/nfsserver/nfs_nfsdserv.cTue Apr 14 22:48:33 2020
(r359940)
+++ head/sys/fs/nfsserver/nfs_nfsdserv.cTue Apr 14 22:57:21 2020
(r359941)
@@ -5564,9 +5564,11 @@ nfsrvd_getxattr(struct nfsrv_descript *nd, __unused in
if (nd->nd_repstat == 0) {
NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED);
*tl = txdr_unsigned(len);
-   nd->nd_mb->m_next = mp;
-   nd->nd_mb = mpend;
-   nd->nd_bpos = mtod(mpend, caddr_t) + mpend->m_len;
+   if (len > 0) {
+   

svn commit: r359940 - in head/sys: net netinet6

2020-04-14 Thread Alexander V. Chernikov
Author: melifaro
Date: Tue Apr 14 22:48:33 2020
New Revision: 359940
URL: https://svnweb.freebsd.org/changeset/base/359940

Log:
  Reorganise nd6 notification code to avoid direct rtentry field access.
  
  One of the goals of the new routing KPI defined in r359823 is to entirely hide
   `struct rtentry` from the consumers. Doing so will allow to improve routing
   subsystem internals and deliver features more easily. This change is one of
the ongoing changes to eliminate direct struct rtentry field accesses.
  
  It introduces rtfree_func() wrapper around RTFREE() and reorganises nd6 
notification
   code to avoid accessing most of the rtentry fields.
  
  Reviewed by:  ae
  Differential Revision:https://reviews.freebsd.org/D24404

Modified:
  head/sys/net/route.c
  head/sys/net/route.h
  head/sys/netinet6/nd6_rtr.c

Modified: head/sys/net/route.c
==
--- head/sys/net/route.cTue Apr 14 22:16:40 2020(r359939)
+++ head/sys/net/route.cTue Apr 14 22:48:33 2020(r359940)
@@ -604,6 +604,18 @@ done:
 }
 
 /*
+ * Temporary RTFREE() function wrapper.
+ *  Intended to use in control plane code to
+ *  avoid exposing internal layout of 'struct rtentry'.
+ */
+void
+rtfree_func(struct rtentry *rt)
+{
+
+   RTFREE(rt);
+}
+
+/*
  * Adds a temporal redirect entry to the routing table.
  * @fibnum: fib number
  * @dst: destination to install redirect to

Modified: head/sys/net/route.h
==
--- head/sys/net/route.hTue Apr 14 22:16:40 2020(r359939)
+++ head/sys/net/route.hTue Apr 14 22:48:33 2020(r359940)
@@ -422,6 +422,8 @@ struct rt_addrinfo {
RTFREE_LOCKED(_rt); \
 } while (0)
 
+#defineRTFREE_FUNC(_rt)rtfree_func(_rt)
+
 #defineRO_RTFREE(_ro) do { \
if ((_ro)->ro_rt)   \
RTFREE((_ro)->ro_rt);   \
@@ -482,6 +484,7 @@ int rtsock_routemsg_info(int, struct rt_addrinfo *, in
  */
 
 voidrtfree(struct rtentry *);
+voidrtfree_func(struct rtentry *);
 void   rt_updatemtu(struct ifnet *);
 
 typedef int rt_walktree_f_t(struct rtentry *, void *);

Modified: head/sys/netinet6/nd6_rtr.c
==
--- head/sys/netinet6/nd6_rtr.c Tue Apr 14 22:16:40 2020(r359939)
+++ head/sys/netinet6/nd6_rtr.c Tue Apr 14 22:48:33 2020(r359940)
@@ -603,14 +603,6 @@ nd6_ra_input(struct mbuf *m, int off, int icmp6len)
m_freem(m);
 }
 
-/* tell the change to user processes watching the routing socket. */
-static void
-nd6_rtmsg(int cmd, struct rtentry *rt)
-{
-
-   rt_routemsg(cmd, rt, rt->rt_ifp, 0, rt->rt_fibnum);
-}
-
 /* PFXRTR */
 static struct nd_pfxrouter *
 pfxrtr_lookup(struct nd_prefix *pr, struct nd_defrouter *dr)
@@ -681,6 +673,7 @@ defrouter_addreq(struct nd_defrouter *new)
 {
struct sockaddr_in6 def, mask, gate;
struct rtentry *newrt = NULL;
+   unsigned int fibnum;
int error;
 
bzero(, sizeof(def));
@@ -691,13 +684,14 @@ defrouter_addreq(struct nd_defrouter *new)
sizeof(struct sockaddr_in6);
def.sin6_family = gate.sin6_family = AF_INET6;
gate.sin6_addr = new->rtaddr;
+   fibnum = new->ifp->if_fib;
 
error = in6_rtrequest(RTM_ADD, (struct sockaddr *),
(struct sockaddr *), (struct sockaddr *),
-   RTF_GATEWAY, , new->ifp->if_fib);
+   RTF_GATEWAY, , fibnum);
if (newrt) {
-   nd6_rtmsg(RTM_ADD, newrt); /* tell user process */
-   RTFREE(newrt);
+   rt_routemsg(RTM_ADD, newrt, new->ifp, 0, fibnum);
+   RTFREE_FUNC(newrt);
}
if (error == 0)
new->installed = 1;
@@ -713,6 +707,7 @@ defrouter_delreq(struct nd_defrouter *dr)
 {
struct sockaddr_in6 def, mask, gate;
struct rtentry *oldrt = NULL;
+   unsigned int fibnum;
 
bzero(, sizeof(def));
bzero(, sizeof(mask));
@@ -722,13 +717,14 @@ defrouter_delreq(struct nd_defrouter *dr)
sizeof(struct sockaddr_in6);
def.sin6_family = gate.sin6_family = AF_INET6;
gate.sin6_addr = dr->rtaddr;
+   fibnum = dr->ifp->if_fib;
 
in6_rtrequest(RTM_DELETE, (struct sockaddr *),
(struct sockaddr *),
-   (struct sockaddr *), RTF_GATEWAY, , dr->ifp->if_fib);
+   (struct sockaddr *), RTF_GATEWAY, , fibnum);
if (oldrt) {
-   nd6_rtmsg(RTM_DELETE, oldrt);
-   RTFREE(oldrt);
+   rt_routemsg(RTM_DELETE, oldrt, dr->ifp, 0, fibnum);
+   RTFREE_FUNC(oldrt);
}
 
dr->installed = 0;
@@ -2044,15 +2040,7 @@ nd6_prefix_onlink_rtrequest(struct nd_prefix *pr, 

Re: svn commit: r359937 - in head/sys: amd64/linux amd64/linux32 arm64/linux compat/freebsd32 compat/linux dev/ipmi dev/mpr dev/mps dev/mpt i386/linux kern sys

2020-04-14 Thread Brooks Davis
On Tue, Apr 14, 2020 at 03:08:24PM -0700, Conrad Meyer wrote:
> Brooks,
> 
> On Tue, Apr 14, 2020 at 13:31 Brooks Davis  wrote:
> 
> > Author: brooks
> > Date: Tue Apr 14 20:30:48 2020
> > New Revision: 359937
> > URL: https://svnweb.freebsd.org/changeset/base/359937
> >
> > Log:
> >   Centralize compatability translation macros.
> >
> >   Copy the CP, PTRIN, etc macros from freebsd32.h into a sys/abi_compat.h
> >   and replace existing definitation with includes where required. This
> >   eliminates duplicate code and allows Linux and FreeBSD compatability
> >   headers to be included in the same files.
> >
> >   Input from:   cem, jhb
> 
> 
> You dismissed my input, so I don???t think there???s a good reason to suggest 
> I
> was involved with the revision.

I apologize.  I did make some (admittedly trivial) changes in response
to your feedback and thought it was worth a mention.  Your other
proposed suggestions do seem worth exploring, but they were an enormous
expansion of scope from a tiny bit of code consolidation to touching a
large portion of macro sites.

-- Brooks


signature.asc
Description: PGP signature


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

2020-04-14 Thread Emmanuel Vadot
Author: manu
Date: Tue Apr 14 22:16:40 2020
New Revision: 359939
URL: https://svnweb.freebsd.org/changeset/base/359939

Log:
  modules: dtb: allwinner: Remove sun50i-a64-sid.dtso
  
  File was removed in r359935
  
  MFC after:2 month
  X-MFC-With:   r359935

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

Modified: head/sys/modules/dtb/allwinner/Makefile
==
--- head/sys/modules/dtb/allwinner/Makefile Tue Apr 14 20:53:12 2020
(r359938)
+++ head/sys/modules/dtb/allwinner/Makefile Tue Apr 14 22:16:40 2020
(r359939)
@@ -51,7 +51,6 @@ DTS=  \
 DTSO=  sun50i-a64-opp.dtso \
sun50i-a64-pwm.dtso \
sun50i-a64-rpwm.dtso \
-   sun50i-a64-sid.dtso \
sun50i-a64-spi0-spigen.dtso \
sun50i-a64-timer.dtso \
sun50i-h5-opp.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"


Re: svn commit: r359937 - in head/sys: amd64/linux amd64/linux32 arm64/linux compat/freebsd32 compat/linux dev/ipmi dev/mpr dev/mps dev/mpt i386/linux kern sys

2020-04-14 Thread Conrad Meyer
Brooks,

On Tue, Apr 14, 2020 at 13:31 Brooks Davis  wrote:

> Author: brooks
> Date: Tue Apr 14 20:30:48 2020
> New Revision: 359937
> URL: https://svnweb.freebsd.org/changeset/base/359937
>
> Log:
>   Centralize compatability translation macros.
>
>   Copy the CP, PTRIN, etc macros from freebsd32.h into a sys/abi_compat.h
>   and replace existing definitation with includes where required. This
>   eliminates duplicate code and allows Linux and FreeBSD compatability
>   headers to be included in the same files.
>
>   Input from:   cem, jhb


You dismissed my input, so I don’t think there’s a good reason to suggest I
was involved with the revision.

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: r359938 - in head/sys: compat/freebsd32 kern

2020-04-14 Thread Brooks Davis
Author: brooks
Date: Tue Apr 14 20:53:12 2020
New Revision: 359938
URL: https://svnweb.freebsd.org/changeset/base/359938

Log:
  Remove bogus use of useracc() in (clock_)nanosleep.
  
  There's no point in pre-checking that we can access the user's rmtp
  pointer before we do it in copyout().
  
  While here, improve style(9) compliance.
  
  Reviewed by:  imp
  MFC after:1 week
  Sponsored by: DARPA
  Differential Revision:https://reviews.freebsd.org/D24409

Modified:
  head/sys/compat/freebsd32/freebsd32_misc.c
  head/sys/kern/kern_time.c

Modified: head/sys/compat/freebsd32/freebsd32_misc.c
==
--- head/sys/compat/freebsd32/freebsd32_misc.c  Tue Apr 14 20:30:48 2020
(r359937)
+++ head/sys/compat/freebsd32/freebsd32_misc.c  Tue Apr 14 20:53:12 2020
(r359938)
@@ -2651,7 +2651,7 @@ freebsd32_user_clock_nanosleep(struct thread *td, cloc
 {
struct timespec32 rmt32, rqt32;
struct timespec rmt, rqt;
-   int error;
+   int error, error2;
 
error = copyin(ua_rqtp, , sizeof(rqt32));
if (error)
@@ -2660,18 +2660,13 @@ freebsd32_user_clock_nanosleep(struct thread *td, cloc
CP(rqt32, rqt, tv_sec);
CP(rqt32, rqt, tv_nsec);
 
-   if (ua_rmtp != NULL && (flags & TIMER_ABSTIME) == 0 &&
-   !useracc(ua_rmtp, sizeof(rmt32), VM_PROT_WRITE))
-   return (EFAULT);
error = kern_clock_nanosleep(td, clock_id, flags, , );
if (error == EINTR && ua_rmtp != NULL && (flags & TIMER_ABSTIME) == 0) {
-   int error2;
-
CP(rmt, rmt32, tv_sec);
CP(rmt, rmt32, tv_nsec);
 
error2 = copyout(, ua_rmtp, sizeof(rmt32));
-   if (error2)
+   if (error2 != 0)
error = error2;
}
return (error);

Modified: head/sys/kern/kern_time.c
==
--- head/sys/kern/kern_time.c   Tue Apr 14 20:30:48 2020(r359937)
+++ head/sys/kern/kern_time.c   Tue Apr 14 20:53:12 2020(r359938)
@@ -625,20 +625,15 @@ user_clock_nanosleep(struct thread *td, clockid_t cloc
 const struct timespec *ua_rqtp, struct timespec *ua_rmtp)
 {
struct timespec rmt, rqt;
-   int error;
+   int error, error2;
 
error = copyin(ua_rqtp, , sizeof(rqt));
if (error)
return (error);
-   if (ua_rmtp != NULL && (flags & TIMER_ABSTIME) == 0 &&
-   !useracc(ua_rmtp, sizeof(rmt), VM_PROT_WRITE))
-   return (EFAULT);
error = kern_clock_nanosleep(td, clock_id, flags, , );
if (error == EINTR && ua_rmtp != NULL && (flags & TIMER_ABSTIME) == 0) {
-   int error2;
-
error2 = copyout(, ua_rmtp, sizeof(rmt));
-   if (error2)
+   if (error2 != 0)
error = error2;
}
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: r359937 - in head/sys: amd64/linux amd64/linux32 arm64/linux compat/freebsd32 compat/linux dev/ipmi dev/mpr dev/mps dev/mpt i386/linux kern sys

2020-04-14 Thread Brooks Davis
Author: brooks
Date: Tue Apr 14 20:30:48 2020
New Revision: 359937
URL: https://svnweb.freebsd.org/changeset/base/359937

Log:
  Centralize compatability translation macros.
  
  Copy the CP, PTRIN, etc macros from freebsd32.h into a sys/abi_compat.h
  and replace existing definitation with includes where required. This
  eliminates duplicate code and allows Linux and FreeBSD compatability
  headers to be included in the same files.
  
  Input from:   cem, jhb
  Obtained from:CheriBSD
  MFC after:2 weeks
  Sponsored by: DARPA
  Differential Revision:https://reviews.freebsd.org/D24275

Added:
  head/sys/sys/abi_compat.h   (contents, props changed)
Modified:
  head/sys/amd64/linux/linux.h
  head/sys/amd64/linux32/linux.h
  head/sys/arm64/linux/linux.h
  head/sys/compat/freebsd32/freebsd32.h
  head/sys/compat/linux/linux_ioctl.c
  head/sys/compat/linux/linux_timer.h
  head/sys/dev/ipmi/ipmi.c
  head/sys/dev/mpr/mpr_user.c
  head/sys/dev/mps/mps_user.c
  head/sys/dev/mpt/mpt_user.c
  head/sys/i386/linux/linux.h
  head/sys/kern/sysv_sem.c
  head/sys/kern/sysv_shm.c

Modified: head/sys/amd64/linux/linux.h
==
--- head/sys/amd64/linux/linux.hTue Apr 14 20:20:08 2020
(r359936)
+++ head/sys/amd64/linux/linux.hTue Apr 14 20:30:48 2020
(r359937)
@@ -32,20 +32,14 @@
 #ifndef _AMD64_LINUX_H_
 #define_AMD64_LINUX_H_
 
+#include 
+
 #include 
 #include 
 
 #defineLINUX_LEGACY_SYSCALLS
 
 #defineLINUX_DTRACElinuxulator
-
-#definePTRIN(v)(void *)(v)
-#definePTROUT(v)   (uintptr_t)(v)
-
-#defineCP(src,dst,fld) do { (dst).fld = (src).fld; } while (0)
-#defineCP2(src,dst,sfld,dfld) do { (dst).dfld = (src).sfld; } while (0)
-#definePTRIN_CP(src,dst,fld) \
-   do { (dst).fld = PTRIN((src).fld); } while (0)
 
 /*
  * Provide a separate set of types for the Linux types.

Modified: head/sys/amd64/linux32/linux.h
==
--- head/sys/amd64/linux32/linux.h  Tue Apr 14 20:20:08 2020
(r359936)
+++ head/sys/amd64/linux32/linux.h  Tue Apr 14 20:30:48 2020
(r359937)
@@ -35,6 +35,8 @@
 #ifndef _AMD64_LINUX_H_
 #define_AMD64_LINUX_H_
 
+#include 
+
 #include 
 #include 
 
@@ -51,14 +53,6 @@
 #defineLINUX32_MAXDSIZ (512 * 1024 * 1024) /* 512MB */
 #defineLINUX32_MAXSSIZ (64 * 1024 * 1024)  /* 64MB */
 #defineLINUX32_MAXVMEM 0   /* Unlimited */
-
-#definePTRIN(v)(void *)(uintptr_t)(v)
-#definePTROUT(v)   (l_uintptr_t)(uintptr_t)(v)
-
-#defineCP(src,dst,fld) do { (dst).fld = (src).fld; } while (0)
-#defineCP2(src,dst,sfld,dfld) do { (dst).dfld = (src).sfld; } while (0)
-#definePTRIN_CP(src,dst,fld) \
-   do { (dst).fld = PTRIN((src).fld); } while (0)
 
 /*
  * Provide a separate set of types for the Linux types.

Modified: head/sys/arm64/linux/linux.h
==
--- head/sys/arm64/linux/linux.hTue Apr 14 20:20:08 2020
(r359936)
+++ head/sys/arm64/linux/linux.hTue Apr 14 20:30:48 2020
(r359937)
@@ -31,18 +31,12 @@
 #ifndef _ARM64_LINUX_H_
 #define_ARM64_LINUX_H_
 
+#include 
+
 #include 
 #include 
 
 #defineLINUX_DTRACElinuxulator
-
-#definePTRIN(v)(void *)(v)
-#definePTROUT(v)   (uintptr_t)(v)
-
-#defineCP(src,dst,fld) do { (dst).fld = (src).fld; } while (0)
-#defineCP2(src,dst,sfld,dfld) do { (dst).dfld = (src).sfld; } while (0)
-#definePTRIN_CP(src,dst,fld) \
-   do { (dst).fld = PTRIN((src).fld); } while (0)
 
 /* Provide a separate set of types for the Linux types */
 typedef int32_tl_int;

Modified: head/sys/compat/freebsd32/freebsd32.h
==
--- head/sys/compat/freebsd32/freebsd32.h   Tue Apr 14 20:20:08 2020
(r359936)
+++ head/sys/compat/freebsd32/freebsd32.h   Tue Apr 14 20:30:48 2020
(r359937)
@@ -31,19 +31,11 @@
 #ifndef _COMPAT_FREEBSD32_FREEBSD32_H_
 #define _COMPAT_FREEBSD32_FREEBSD32_H_
 
+#include 
 #include 
 #include 
 #include 
 
-#define PTRIN(v)   (void *)(uintptr_t) (v)
-#define PTROUT(v)  (u_int32_t)(uintptr_t) (v)
-
-#define CP(src,dst,fld) do { (dst).fld = (src).fld; } while (0)
-#define PTRIN_CP(src,dst,fld) \
-   do { (dst).fld = PTRIN((src).fld); } while (0)
-#define PTROUT_CP(src,dst,fld) \
-   do { (dst).fld = PTROUT((src).fld); } while (0)
-
 /*
  * i386 is the only arch with a 32-bit time_t
  */
@@ -57,37 +49,21 @@ struct timeval32 {
time32_t tv_sec;
int32_t tv_usec;
 };
-#define TV_CP(src,dst,fld) do {\
-   

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

2020-04-14 Thread Emmanuel Vadot
Author: manu
Date: Tue Apr 14 20:20:08 2020
New Revision: 359936
URL: https://svnweb.freebsd.org/changeset/base/359936

Log:
  modules: dtb: allwinner: Remove non existant files
  
  Those files have been removed in r359935.
  
  MFC after:2 months
  X-MFC-With:   r359935

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

Modified: head/sys/modules/dtb/allwinner/Makefile
==
--- head/sys/modules/dtb/allwinner/Makefile Tue Apr 14 19:05:17 2020
(r359935)
+++ head/sys/modules/dtb/allwinner/Makefile Tue Apr 14 20:20:08 2020
(r359936)
@@ -24,9 +24,7 @@ DTS=  \
sun8i-h3-orangepi-plus2e.dts
 
 DTSO=  sun8i-a83t-sid.dtso \
-   sun8i-h3-i2c0.dtso \
-   sun8i-h3-sid.dtso \
-   sun8i-h3-ths.dtso
+   sun8i-h3-i2c0.dtso
 
 LINKS= \
${DTBDIR}/sun4i-a10-cubieboard.dtb ${DTBDIR}/cubieboard.dtb \
@@ -55,11 +53,8 @@ DTSO=sun50i-a64-opp.dtso \
sun50i-a64-rpwm.dtso \
sun50i-a64-sid.dtso \
sun50i-a64-spi0-spigen.dtso \
-   sun50i-a64-ths.dtso \
sun50i-a64-timer.dtso \
sun50i-h5-opp.dtso \
-   sun50i-h5-sid.dtso \
-   sun50i-h5-ths.dtso \
sun50i-h5-nanopi-neo2-opp.dtso
 
 .endif
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r359935 - in head: . sys/arm/allwinner sys/dts/arm/overlays sys/dts/arm64/overlays

2020-04-14 Thread Emmanuel Vadot
Author: manu
Date: Tue Apr 14 19:05:17 2020
New Revision: 359935
URL: https://svnweb.freebsd.org/changeset/base/359935

Log:
  allwinner: aw_thermal: Cope with DTS changes
  
  The upstream DTS now include the thermal device node and the SID
  calibration entry.
  Update our driver to cope with this change and remove the DTB
  overlays that aren't needed anymore.
  
  MFC after:2 months
  X-MFC-With:   r359934

Deleted:
  head/sys/dts/arm/overlays/sun8i-h3-sid.dtso
  head/sys/dts/arm/overlays/sun8i-h3-ths.dtso
  head/sys/dts/arm64/overlays/sun50i-a64-sid.dtso
  head/sys/dts/arm64/overlays/sun50i-a64-ths.dtso
  head/sys/dts/arm64/overlays/sun50i-h5-sid.dtso
  head/sys/dts/arm64/overlays/sun50i-h5-ths.dtso
Modified:
  head/UPDATING
  head/sys/arm/allwinner/aw_sid.c
  head/sys/arm/allwinner/aw_thermal.c

Modified: head/UPDATING
==
--- head/UPDATING   Tue Apr 14 18:57:00 2020(r359934)
+++ head/UPDATING   Tue Apr 14 19:05:17 2020(r359935)
@@ -26,6 +26,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW:
disable the most expensive debugging functionality run
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
 
+20200414:
+   Upstream DTS from Linux 5.6 was merged and they now have the SID
+   and THS (Secure ID controller and THermal Sensor) node present.
+   The DTB overlays have now been removed from the tree for the H3/H5 and
+   A64 SoCs and the aw_sid and aw_thermal driver have been updated to
+   deal with upstream DTS. If you are using those overlays you need to
+   remove them from loader.conf and update the DTBs on the FAT partition.
+
 20200310:
Clang, llvm, lld, lldb, compiler-rt, libc++, libunwind and openmp have
been upgraded to 10.0.0.  Please see the 20141231 entry below for

Modified: head/sys/arm/allwinner/aw_sid.c
==
--- head/sys/arm/allwinner/aw_sid.c Tue Apr 14 18:57:00 2020
(r359934)
+++ head/sys/arm/allwinner/aw_sid.c Tue Apr 14 19:05:17 2020
(r359935)
@@ -100,7 +100,7 @@ static struct aw_sid_efuse a64_efuses[] = {
.public = true,
},
{
-   .name = "ths-calib",
+   .name = "calibration",
.desc = "Thermal Sensor Calibration Data",
.base = EFUSE_OFFSET,
.offset = 0x34,
@@ -121,7 +121,7 @@ static struct aw_sid_efuse a83t_efuses[] = {
.public = true,
},
{
-   .name = "ths-calib",
+   .name = "calibration",
.desc = "Thermal Sensor Calibration Data",
.base = EFUSE_OFFSET,
.offset = 0x34,
@@ -142,11 +142,11 @@ static struct aw_sid_efuse h3_efuses[] = {
.public = true,
},
{
-   .name = "ths-calib",
+   .name = "calibration",
.desc = "Thermal Sensor Calibration Data",
.base = EFUSE_OFFSET,
.offset = 0x34,
-   .size = 2,
+   .size = 4,
.id = AW_SID_FUSE_THSSENSOR,
.public = false,
},
@@ -163,7 +163,7 @@ static struct aw_sid_efuse h5_efuses[] = {
.public = true,
},
{
-   .name = "ths-calib",
+   .name = "calibration",
.desc = "Thermal Sensor Calibration Data",
.base = EFUSE_OFFSET,
.offset = 0x34,
@@ -350,8 +350,7 @@ aw_sid_read(device_t dev, uint32_t offset, uint32_t si
sc = device_get_softc(dev);
 
for (i = 0; i < sc->sid_conf->nfuses; i++)
-   if (offset == (sc->sid_conf->efuses[i].base +
-   sc->sid_conf->efuses[i].offset)) {
+   if (offset == sc->sid_conf->efuses[i].offset) {
fuse_id = sc->sid_conf->efuses[i].id;
break;
}

Modified: head/sys/arm/allwinner/aw_thermal.c
==
--- head/sys/arm/allwinner/aw_thermal.c Tue Apr 14 18:57:00 2020
(r359934)
+++ head/sys/arm/allwinner/aw_thermal.c Tue Apr 14 19:05:17 2020
(r359935)
@@ -267,7 +267,7 @@ static const struct aw_thermal_config h3_config = {
.thermal_per = H3_THERMAL_PER,
.to_temp = h3_to_temp,
.to_reg = h3_to_reg,
-   .calib0_mask = 0x,
+   .calib0_mask = 0x,
 };
 
 static int
@@ -387,12 +387,12 @@ aw_thermal_init(struct aw_thermal_softc *sc)
int error;
 
node = ofw_bus_get_node(sc->dev);
-   if (nvmem_get_cell_len(node, "ths-calib") > sizeof(calib)) {
-   

svn commit: r359934 - in head/sys/gnu/dts: arm arm64/allwinner arm64/altera arm64/amlogic arm64/arm arm64/bitmain arm64/exynos arm64/freescale arm64/hisilicon arm64/intel arm64/marvell arm64/mediat...

2020-04-14 Thread Emmanuel Vadot
Author: manu
Date: Tue Apr 14 18:57:00 2020
New Revision: 359934
URL: https://svnweb.freebsd.org/changeset/base/359934

Log:
  dts: Import DTS from Linux 5.6

Added:
  head/sys/gnu/dts/arm/am3703.dtsi
 - copied unchanged from r359928, 
vendor/device-tree/dist/src/arm/am3703.dtsi
  head/sys/gnu/dts/arm/am3715.dtsi
 - copied unchanged from r359928, 
vendor/device-tree/dist/src/arm/am3715.dtsi
  head/sys/gnu/dts/arm/armada-385-clearfog-gtr-l8.dts
 - copied unchanged from r359928, 
vendor/device-tree/dist/src/arm/armada-385-clearfog-gtr-l8.dts
  head/sys/gnu/dts/arm/armada-385-clearfog-gtr-s4.dts
 - copied unchanged from r359928, 
vendor/device-tree/dist/src/arm/armada-385-clearfog-gtr-s4.dts
  head/sys/gnu/dts/arm/armada-385-clearfog-gtr.dtsi
 - copied unchanged from r359928, 
vendor/device-tree/dist/src/arm/armada-385-clearfog-gtr.dtsi
  head/sys/gnu/dts/arm/at91-kizboxmini-base.dts
 - copied unchanged from r359928, 
vendor/device-tree/dist/src/arm/at91-kizboxmini-base.dts
  head/sys/gnu/dts/arm/at91-kizboxmini-common.dtsi
 - copied unchanged from r359928, 
vendor/device-tree/dist/src/arm/at91-kizboxmini-common.dtsi
  head/sys/gnu/dts/arm/at91-kizboxmini-mb.dts
 - copied unchanged from r359928, 
vendor/device-tree/dist/src/arm/at91-kizboxmini-mb.dts
  head/sys/gnu/dts/arm/at91-kizboxmini-rd.dts
 - copied unchanged from r359928, 
vendor/device-tree/dist/src/arm/at91-kizboxmini-rd.dts
  head/sys/gnu/dts/arm/at91-sam9x60ek.dts
 - copied unchanged from r359928, 
vendor/device-tree/dist/src/arm/at91-sam9x60ek.dts
  head/sys/gnu/dts/arm/at91-sama5d27_wlsom1.dtsi
 - copied unchanged from r359928, 
vendor/device-tree/dist/src/arm/at91-sama5d27_wlsom1.dtsi
  head/sys/gnu/dts/arm/at91-sama5d27_wlsom1_ek.dts
 - copied unchanged from r359928, 
vendor/device-tree/dist/src/arm/at91-sama5d27_wlsom1_ek.dts
  head/sys/gnu/dts/arm/at91-smartkiz.dts
 - copied unchanged from r359928, 
vendor/device-tree/dist/src/arm/at91-smartkiz.dts
  head/sys/gnu/dts/arm/dm3725.dtsi
 - copied unchanged from r359928, 
vendor/device-tree/dist/src/arm/dm3725.dtsi
  head/sys/gnu/dts/arm/imx6dl-gw5907.dts
 - copied unchanged from r359928, 
vendor/device-tree/dist/src/arm/imx6dl-gw5907.dts
  head/sys/gnu/dts/arm/imx6dl-gw5910.dts
 - copied unchanged from r359928, 
vendor/device-tree/dist/src/arm/imx6dl-gw5910.dts
  head/sys/gnu/dts/arm/imx6dl-gw5912.dts
 - copied unchanged from r359928, 
vendor/device-tree/dist/src/arm/imx6dl-gw5912.dts
  head/sys/gnu/dts/arm/imx6dl-gw5913.dts
 - copied unchanged from r359928, 
vendor/device-tree/dist/src/arm/imx6dl-gw5913.dts
  head/sys/gnu/dts/arm/imx6q-gw5907.dts
 - copied unchanged from r359928, 
vendor/device-tree/dist/src/arm/imx6q-gw5907.dts
  head/sys/gnu/dts/arm/imx6q-gw5910.dts
 - copied unchanged from r359928, 
vendor/device-tree/dist/src/arm/imx6q-gw5910.dts
  head/sys/gnu/dts/arm/imx6q-gw5912.dts
 - copied unchanged from r359928, 
vendor/device-tree/dist/src/arm/imx6q-gw5912.dts
  head/sys/gnu/dts/arm/imx6q-gw5913.dts
 - copied unchanged from r359928, 
vendor/device-tree/dist/src/arm/imx6q-gw5913.dts
  head/sys/gnu/dts/arm/imx6qdl-gw5907.dtsi
 - copied unchanged from r359928, 
vendor/device-tree/dist/src/arm/imx6qdl-gw5907.dtsi
  head/sys/gnu/dts/arm/imx6qdl-gw5910.dtsi
 - copied unchanged from r359928, 
vendor/device-tree/dist/src/arm/imx6qdl-gw5910.dtsi
  head/sys/gnu/dts/arm/imx6qdl-gw5912.dtsi
 - copied unchanged from r359928, 
vendor/device-tree/dist/src/arm/imx6qdl-gw5912.dtsi
  head/sys/gnu/dts/arm/imx6qdl-gw5913.dtsi
 - copied unchanged from r359928, 
vendor/device-tree/dist/src/arm/imx6qdl-gw5913.dtsi
  head/sys/gnu/dts/arm/imx6sl-tolino-shine3.dts
 - copied unchanged from r359928, 
vendor/device-tree/dist/src/arm/imx6sl-tolino-shine3.dts
  head/sys/gnu/dts/arm/imx7ulp-com.dts
 - copied unchanged from r359928, 
vendor/device-tree/dist/src/arm/imx7ulp-com.dts
  head/sys/gnu/dts/arm/omap3-echo.dts
 - copied unchanged from r359928, 
vendor/device-tree/dist/src/arm/omap3-echo.dts
  head/sys/gnu/dts/arm/rk3288-veyron-broadcom-bluetooth.dtsi
 - copied unchanged from r359928, 
vendor/device-tree/dist/src/arm/rk3288-veyron-broadcom-bluetooth.dtsi
  head/sys/gnu/dts/arm/rockchip-radxa-dalang-carrier.dtsi
 - copied unchanged from r359928, 
vendor/device-tree/dist/src/arm/rockchip-radxa-dalang-carrier.dtsi
  head/sys/gnu/dts/arm/sam9x60.dtsi
 - copied unchanged from r359928, 
vendor/device-tree/dist/src/arm/sam9x60.dtsi
  head/sys/gnu/dts/arm/ste-ab8505.dtsi
 - copied unchanged from r359928, 
vendor/device-tree/dist/src/arm/ste-ab8505.dtsi
  head/sys/gnu/dts/arm/ste-db8500.dtsi
 - copied unchanged from r359928, 
vendor/device-tree/dist/src/arm/ste-db8500.dtsi
  head/sys/gnu/dts/arm/ste-db8520.dtsi
 - copied unchanged from r359928, 
vendor/device-tree/dist/src/arm/ste-db8520.dtsi
  head/sys/gnu/dts/arm/ste-dbx5x0-pinctrl.dtsi
 - copied unchanged from r359928, 

svn commit: r359933 - stable/12/share/misc

2020-04-14 Thread Richard Scheffenegger
Author: rscheff
Date: Tue Apr 14 18:24:59 2020
New Revision: 359933
URL: https://svnweb.freebsd.org/changeset/base/359933

Log:
  add my (rscheff) mentor relationship
  
  Reviewed by:  rgrimes (mentor), tuexen (mentor)
  Approved by:  rgrimes (mentor), tuexen (mentor)
  Sponsored by: NetApp, Inc.
  Differential Revision: https://reviews.freebsd.org/D24318

Modified:
  stable/12/share/misc/committers-src.dot
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/share/misc/committers-src.dot
==
--- stable/12/share/misc/committers-src.dot Tue Apr 14 18:11:54 2020
(r359932)
+++ stable/12/share/misc/committers-src.dot Tue Apr 14 18:24:59 2020
(r359933)
@@ -304,6 +304,7 @@ royger [label="Roger Pau Monne\nroy...@freebsd.org\n20
 rpaulo [label="Rui Paulo\nrpa...@freebsd.org\n2007/09/25"]
 rpokala [label="Ravi Pokala\nrpok...@freebsd.org\n2015/11/19"]
 rrs [label="Randall R Stewart\n...@freebsd.org\n2007/02/08"]
+rscheff [label="Richard Scheffenegger\nrsch...@freebsd.org\n2020/04/06"]
 rse [label="Ralf S. Engelschall\n...@freebsd.org\n1997/07/31"]
 rstone [label="Ryan Stone\nrst...@freebsd.org\n2010/04/19"]
 ru [label="Ruslan Ermilov\n...@freebsd.org\n1999/05/27"]
@@ -766,6 +767,7 @@ pjd -> smh
 pjd -> trociny
 
 rgrimes -> markm
+rgrimes -> rscheff
 
 rmacklem -> jwd
 
@@ -855,6 +857,8 @@ thompsa -> eri
 
 trasz -> jh
 trasz -> mjg
+
+tuexen -> rscheff
 
 ume -> jinmei
 ume -> suz
___
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: r359931 - in head/sys: compat/freebsd32 kern sys

2020-04-14 Thread Kyle Evans
Author: kevans
Date: Tue Apr 14 18:11:26 2020
New Revision: 359931
URL: https://svnweb.freebsd.org/changeset/base/359931

Log:
  sysent: re-roll after r359930

Modified:
  head/sys/compat/freebsd32/freebsd32_syscall.h
  head/sys/compat/freebsd32/freebsd32_syscalls.c
  head/sys/compat/freebsd32/freebsd32_sysent.c
  head/sys/compat/freebsd32/freebsd32_systrace_args.c
  head/sys/kern/init_sysent.c
  head/sys/kern/syscalls.c
  head/sys/kern/systrace_args.c
  head/sys/sys/syscall.h
  head/sys/sys/syscall.mk
  head/sys/sys/sysproto.h

Modified: head/sys/compat/freebsd32/freebsd32_syscall.h
==
--- head/sys/compat/freebsd32/freebsd32_syscall.h   Tue Apr 14 18:07:42 
2020(r359930)
+++ head/sys/compat/freebsd32/freebsd32_syscall.h   Tue Apr 14 18:11:26 
2020(r359931)
@@ -431,7 +431,7 @@
 #defineFREEBSD32_SYS_freebsd32_jail_get506
 #defineFREEBSD32_SYS_freebsd32_jail_set507
 #defineFREEBSD32_SYS_jail_remove   508
-#defineFREEBSD32_SYS_closefrom 509
+#defineFREEBSD32_SYS_freebsd12_closefrom   509
 #defineFREEBSD32_SYS_freebsd32_semctl  510
 #defineFREEBSD32_SYS_freebsd32_msgctl  511
 #defineFREEBSD32_SYS_freebsd32_shmctl  512

Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c
==
--- head/sys/compat/freebsd32/freebsd32_syscalls.c  Tue Apr 14 18:07:42 
2020(r359930)
+++ head/sys/compat/freebsd32/freebsd32_syscalls.c  Tue Apr 14 18:11:26 
2020(r359931)
@@ -531,7 +531,7 @@ const char *freebsd32_syscallnames[] = {
"freebsd32_jail_get",   /* 506 = freebsd32_jail_get */
"freebsd32_jail_set",   /* 507 = freebsd32_jail_set */
"jail_remove",  /* 508 = jail_remove */
-   "closefrom",/* 509 = closefrom */
+   "compat12.closefrom",   /* 509 = freebsd12 closefrom */
"freebsd32_semctl", /* 510 = freebsd32_semctl */
"freebsd32_msgctl", /* 511 = freebsd32_msgctl */
"freebsd32_shmctl", /* 512 = freebsd32_shmctl */

Modified: head/sys/compat/freebsd32/freebsd32_sysent.c
==
--- head/sys/compat/freebsd32/freebsd32_sysent.cTue Apr 14 18:07:42 
2020(r359930)
+++ head/sys/compat/freebsd32/freebsd32_sysent.cTue Apr 14 18:11:26 
2020(r359931)
@@ -584,7 +584,7 @@ struct sysent freebsd32_sysent[] = {
{ AS(freebsd32_jail_get_args), (sy_call_t *)freebsd32_jail_get, 
AUE_JAIL_GET, NULL, 0, 0, 0, SY_THR_STATIC },   /* 506 = freebsd32_jail_get */
{ AS(freebsd32_jail_set_args), (sy_call_t *)freebsd32_jail_set, 
AUE_JAIL_SET, NULL, 0, 0, 0, SY_THR_STATIC },   /* 507 = freebsd32_jail_set */
{ AS(jail_remove_args), (sy_call_t *)sys_jail_remove, AUE_JAIL_REMOVE, 
NULL, 0, 0, 0, SY_THR_STATIC },  /* 508 = jail_remove */
-   { AS(closefrom_args), (sy_call_t *)sys_closefrom, AUE_CLOSEFROM, NULL, 
0, 0, SYF_CAPENABLED, SY_THR_STATIC },   /* 509 = closefrom */
+   { compat12(AS(freebsd12_closefrom_args),closefrom), AUE_CLOSEFROM, 
NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 509 = freebsd12 closefrom */
{ AS(freebsd32_semctl_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 
0, 0, SY_THR_ABSENT },  /* 510 = freebsd32_semctl */
{ AS(freebsd32_msgctl_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 
0, 0, SY_THR_ABSENT },  /* 511 = freebsd32_msgctl */
{ AS(freebsd32_shmctl_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 
0, 0, SY_THR_ABSENT },  /* 512 = freebsd32_shmctl */

Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c
==
--- head/sys/compat/freebsd32/freebsd32_systrace_args.c Tue Apr 14 18:07:42 
2020(r359930)
+++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Tue Apr 14 18:11:26 
2020(r359931)
@@ -2722,13 +2722,6 @@ systrace_args(int sysnum, void *params, uint64_t *uarg
*n_args = 1;
break;
}
-   /* closefrom */
-   case 509: {
-   struct closefrom_args *p = params;
-   iarg[0] = p->lowfd; /* int */
-   *n_args = 1;
-   break;
-   }
/* freebsd32_semctl */
case 510: {
struct freebsd32_semctl_args *p = params;
@@ -7904,16 +7897,6 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d
break;
};
break;
-   /* closefrom */
-   case 509:
-   switch(ndx) {
-   case 0:
-   p = "int";
-   break;
-   default:
-   break;
- 

svn commit: r359932 - head/sys/conf

2020-04-14 Thread Emmanuel Vadot
Author: manu
Date: Tue Apr 14 18:11:54 2020
New Revision: 359932
URL: https://svnweb.freebsd.org/changeset/base/359932

Log:
  files: Add mmc_fdt_helpers for mmccam enabled config
  
  MFC after:1 month
  X-MFC-With:   r359924

Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==
--- head/sys/conf/files Tue Apr 14 18:11:26 2020(r359931)
+++ head/sys/conf/files Tue Apr 14 18:11:54 2020(r359932)
@@ -2399,7 +2399,7 @@ dev/mmc/mmc.c optional mmc !mmccam
 dev/mmc/mmcbr_if.m standard
 dev/mmc/mmcbus_if.mstandard
 dev/mmc/mmcsd.coptional mmcsd !mmccam
-dev/mmc/mmc_fdt_helpers.c  optional mmc fdt
+dev/mmc/mmc_fdt_helpers.c  optional mmc fdt | mmccam fdt
 dev/mmcnull/mmcnull.c  optional mmcnull
 dev/mn/if_mn.c optional mn pci
 dev/mpr/mpr.c  optional mpr
___
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: r359930 - in head: lib/libc/include lib/libc/sys sys/compat/freebsd32 sys/kern tools/build

2020-04-14 Thread Kyle Evans
et(struct iovec32 *iovp, \
unsigned int iovcnt, int flags); }
 508AUE_JAIL_REMOVE NOPROTO { int jail_remove(int jid); }
-509AUE_CLOSEFROM   NOPROTO { int closefrom(int lowfd); }
+509AUE_CLOSEFROM   COMPAT12|NOPROTO{ int closefrom(int lowfd); }
 510AUE_SEMCTL  NOSTD { int freebsd32_semctl(int semid, int semnum, \
int cmd, union semun32 *arg); }
 511AUE_MSGCTL  NOSTD   { int freebsd32_msgctl(int msqid, int cmd, \

Modified: head/sys/kern/kern_descrip.c
==
--- head/sys/kern/kern_descrip.cTue Apr 14 16:56:57 2020
(r359929)
+++ head/sys/kern/kern_descrip.cTue Apr 14 18:07:42 2020
(r359930)
@@ -1372,17 +1372,18 @@ sys_close_range(struct thread *td, struct close_range_
return (kern_close_range(td, uap->lowfd, uap->highfd));
 }
 
+#ifdef COMPAT_FREEBSD12
 /*
  * Close open file descriptors.
  */
 #ifndef _SYS_SYSPROTO_H_
-struct closefrom_args {
+struct freebsd12_closefrom_args {
int lowfd;
 };
 #endif
 /* ARGSUSED */
 int
-sys_closefrom(struct thread *td, struct closefrom_args *uap)
+freebsd12_closefrom(struct thread *td, struct freebsd12_closefrom_args *uap)
 {
u_int lowfd;
 
@@ -1395,6 +1396,7 @@ sys_closefrom(struct thread *td, struct closefrom_args
lowfd = MAX(0, uap->lowfd);
return (kern_close_range(td, lowfd, ~0U));
 }
+#endif /* COMPAT_FREEBSD12 */
 
 #if defined(COMPAT_43)
 /*

Modified: head/sys/kern/syscalls.master
==
--- head/sys/kern/syscalls.master   Tue Apr 14 16:56:57 2020
(r359929)
+++ head/sys/kern/syscalls.master   Tue Apr 14 18:07:42 2020
(r359930)
@@ -2776,7 +2776,7 @@
int jid
);
}
-509AUE_CLOSEFROM   STD {
+509AUE_CLOSEFROM   COMPAT12 {
int closefrom(
int lowfd
);

Modified: head/tools/build/depend-cleanup.sh
==
--- head/tools/build/depend-cleanup.sh  Tue Apr 14 16:56:57 2020
(r359929)
+++ head/tools/build/depend-cleanup.sh  Tue Apr 14 18:07:42 2020
(r359930)
@@ -36,3 +36,5 @@ clean_dep()
 clean_dep lib/libc   shm_open S
 # 20200310  r358851  rename of openmp's ittnotify_static.c to .cpp
 clean_dep lib/libomp ittnotify_static c
+# 20200414  r359930  closefrom
+clean_dep lib/libc   closefrom S
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r359928 - in vendor/device-tree/dist: . Bindings Bindings/arm Bindings/arm/bcm Bindings/arm/hisilicon Bindings/arm/msm Bindings/arm/omap Bindings/arm/sprd Bindings/arm/stm32 Bindings/ar...

2020-04-14 Thread Emmanuel Vadot
Author: manu
Date: Tue Apr 14 16:56:11 2020
New Revision: 359928
URL: https://svnweb.freebsd.org/changeset/base/359928

Log:
  Import DTS files from Linux 5.6

Added:
  vendor/device-tree/dist/Bindings/arm/idle-states.yaml
  vendor/device-tree/dist/Bindings/arm/sprd/
  vendor/device-tree/dist/Bindings/arm/sprd/sprd.yaml
  vendor/device-tree/dist/Bindings/arm/stm32/st,mlahb.yaml
  vendor/device-tree/dist/Bindings/arm/stm32/st,stm32-syscon.yaml
  vendor/device-tree/dist/Bindings/arm/sunxi/allwinner,sun4i-a10-mbus.yaml
  vendor/device-tree/dist/Bindings/arm/ux500.yaml
  vendor/device-tree/dist/Bindings/ata/allwinner,sun4i-a10-ahci.yaml
  vendor/device-tree/dist/Bindings/ata/allwinner,sun8i-r40-ahci.yaml
  vendor/device-tree/dist/Bindings/ata/faraday,ftide010.yaml
  vendor/device-tree/dist/Bindings/ata/pata-common.yaml
  vendor/device-tree/dist/Bindings/ata/sata-common.yaml
  vendor/device-tree/dist/Bindings/clock/allwinner,sun4i-a10-ahb-clk.yaml
  vendor/device-tree/dist/Bindings/clock/allwinner,sun4i-a10-apb0-clk.yaml
  vendor/device-tree/dist/Bindings/clock/allwinner,sun4i-a10-apb1-clk.yaml
  vendor/device-tree/dist/Bindings/clock/allwinner,sun4i-a10-axi-clk.yaml
  vendor/device-tree/dist/Bindings/clock/allwinner,sun4i-a10-cpu-clk.yaml
  vendor/device-tree/dist/Bindings/clock/allwinner,sun4i-a10-display-clk.yaml
  vendor/device-tree/dist/Bindings/clock/allwinner,sun4i-a10-gates-clk.yaml
  vendor/device-tree/dist/Bindings/clock/allwinner,sun4i-a10-mbus-clk.yaml
  vendor/device-tree/dist/Bindings/clock/allwinner,sun4i-a10-mmc-clk.yaml
  vendor/device-tree/dist/Bindings/clock/allwinner,sun4i-a10-mod0-clk.yaml
  vendor/device-tree/dist/Bindings/clock/allwinner,sun4i-a10-mod1-clk.yaml
  vendor/device-tree/dist/Bindings/clock/allwinner,sun4i-a10-osc-clk.yaml
  vendor/device-tree/dist/Bindings/clock/allwinner,sun4i-a10-pll1-clk.yaml
  vendor/device-tree/dist/Bindings/clock/allwinner,sun4i-a10-pll3-clk.yaml
  vendor/device-tree/dist/Bindings/clock/allwinner,sun4i-a10-pll5-clk.yaml
  vendor/device-tree/dist/Bindings/clock/allwinner,sun4i-a10-pll6-clk.yaml
  vendor/device-tree/dist/Bindings/clock/allwinner,sun4i-a10-tcon-ch0-clk.yaml
  vendor/device-tree/dist/Bindings/clock/allwinner,sun4i-a10-usb-clk.yaml
  vendor/device-tree/dist/Bindings/clock/allwinner,sun4i-a10-ve-clk.yaml
  vendor/device-tree/dist/Bindings/clock/allwinner,sun5i-a13-ahb-clk.yaml
  vendor/device-tree/dist/Bindings/clock/allwinner,sun6i-a31-pll6-clk.yaml
  vendor/device-tree/dist/Bindings/clock/allwinner,sun7i-a20-gmac-clk.yaml
  vendor/device-tree/dist/Bindings/clock/allwinner,sun7i-a20-out-clk.yaml
  vendor/device-tree/dist/Bindings/clock/allwinner,sun8i-a83t-de2-clk.yaml
  vendor/device-tree/dist/Bindings/clock/allwinner,sun8i-h3-bus-gates-clk.yaml
  vendor/device-tree/dist/Bindings/clock/allwinner,sun9i-a80-ahb-clk.yaml
  vendor/device-tree/dist/Bindings/clock/allwinner,sun9i-a80-apb0-clk.yaml
  vendor/device-tree/dist/Bindings/clock/allwinner,sun9i-a80-cpus-clk.yaml
  vendor/device-tree/dist/Bindings/clock/allwinner,sun9i-a80-de-clks.yaml
  vendor/device-tree/dist/Bindings/clock/allwinner,sun9i-a80-gt-clk.yaml
  vendor/device-tree/dist/Bindings/clock/allwinner,sun9i-a80-mmc-config-clk.yaml
  vendor/device-tree/dist/Bindings/clock/allwinner,sun9i-a80-pll4-clk.yaml
  vendor/device-tree/dist/Bindings/clock/allwinner,sun9i-a80-usb-clocks.yaml
  vendor/device-tree/dist/Bindings/clock/allwinner,sun9i-a80-usb-mod-clk.yaml
  vendor/device-tree/dist/Bindings/clock/allwinner,sun9i-a80-usb-phy-clk.yaml
  vendor/device-tree/dist/Bindings/clock/amlogic,meson8-ddr-clkc.yaml
  vendor/device-tree/dist/Bindings/clock/fsl,plldig.yaml
  vendor/device-tree/dist/Bindings/clock/fsl,sai-clock.yaml
  vendor/device-tree/dist/Bindings/clock/imx8mp-clock.yaml
  vendor/device-tree/dist/Bindings/clock/qcom,gcc-apq8064.yaml
  vendor/device-tree/dist/Bindings/clock/qcom,gcc-ipq8074.yaml
  vendor/device-tree/dist/Bindings/clock/qcom,gcc-msm8996.yaml
  vendor/device-tree/dist/Bindings/clock/qcom,gcc-msm8998.yaml
  vendor/device-tree/dist/Bindings/clock/qcom,gcc-qcs404.yaml
  vendor/device-tree/dist/Bindings/clock/qcom,gcc-sc7180.yaml
  vendor/device-tree/dist/Bindings/clock/qcom,gcc-sm8150.yaml
  vendor/device-tree/dist/Bindings/clock/qcom,mmcc.yaml
  vendor/device-tree/dist/Bindings/clock/qcom,msm8998-gpucc.yaml
  vendor/device-tree/dist/Bindings/clock/qcom,sc7180-dispcc.yaml
  vendor/device-tree/dist/Bindings/clock/qcom,sc7180-gpucc.yaml
  vendor/device-tree/dist/Bindings/clock/qcom,sc7180-videocc.yaml
  vendor/device-tree/dist/Bindings/clock/qcom,sdm845-dispcc.yaml
  vendor/device-tree/dist/Bindings/clock/qcom,sdm845-gpucc.yaml
  vendor/device-tree/dist/Bindings/clock/qcom,sdm845-videocc.yaml
  vendor/device-tree/dist/Bindings/clock/st,stm32mp1-rcc.yaml
  vendor/device-tree/dist/Bindings/clock/xlnx,versal-clk.yaml
  
vendor/device-tree/dist/Bindings/display/allwinner,sun4i-a10-display-backend.yaml
  

svn commit: r359929 - vendor/device-tree/5.6

2020-04-14 Thread Emmanuel Vadot
Author: manu
Date: Tue Apr 14 16:56:57 2020
New Revision: 359929
URL: https://svnweb.freebsd.org/changeset/base/359929

Log:
  Tag DTS files from Linux 5.6

Added:
  vendor/device-tree/5.6/
 - copied from r359928, vendor/device-tree/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: r359927 - head/sys/dev/mmc/host

2020-04-14 Thread Emmanuel Vadot
Author: manu
Date: Tue Apr 14 16:35:18 2020
New Revision: 359927
URL: https://svnweb.freebsd.org/changeset/base/359927

Log:
  arm: dwmmc: Use mmc_fdt_helpers
  
  Use the mmc_fdt_parse function instead of parsing everything in the
  driver.
  
  MFC after:1 month

Modified:
  head/sys/dev/mmc/host/dwmmc.c
  head/sys/dev/mmc/host/dwmmc_altera.c
  head/sys/dev/mmc/host/dwmmc_hisi.c
  head/sys/dev/mmc/host/dwmmc_rockchip.c
  head/sys/dev/mmc/host/dwmmc_samsung.c
  head/sys/dev/mmc/host/dwmmc_var.h

Modified: head/sys/dev/mmc/host/dwmmc.c
==
--- head/sys/dev/mmc/host/dwmmc.c   Tue Apr 14 16:35:05 2020
(r359926)
+++ head/sys/dev/mmc/host/dwmmc.c   Tue Apr 14 16:35:18 2020
(r359927)
@@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -446,7 +447,6 @@ dwmmc_card_task(void *arg, int pending __unused)
}
} else
DWMMC_UNLOCK(sc);
-   
} else {
/* Card isn't present, detach if necessary */
if (sc->child != NULL) {
@@ -466,7 +466,7 @@ parse_fdt(struct dwmmc_softc *sc)
 {
pcell_t dts_value[3];
phandle_t node;
-   uint32_t bus_hz = 0, bus_width;
+   uint32_t bus_hz = 0;
int len;
 #ifdef EXT_RESOURCES
int error;
@@ -475,18 +475,13 @@ parse_fdt(struct dwmmc_softc *sc)
if ((node = ofw_bus_get_node(sc->dev)) == -1)
return (ENXIO);
 
-   /* bus-width */
-   if (OF_getencprop(node, "bus-width", _width, sizeof(uint32_t)) <= 0)
-   bus_width = 4;
-   if (bus_width >= 4)
-   sc->host.caps |= MMC_CAP_4_BIT_DATA;
-   if (bus_width >= 8)
-   sc->host.caps |= MMC_CAP_8_BIT_DATA;
+   /* Set some defaults for freq and supported mode */
+   sc->host.f_min = 40;
+   sc->host.f_max = 2;
+   sc->host.host_ocr = MMC_OCR_320_330 | MMC_OCR_330_340;
+   sc->host.caps = MMC_CAP_HSPEED | MMC_CAP_SIGNALING_330;
+   mmc_fdt_parse(sc->dev, node, >mmc_helper, >host);
 
-   /* max-frequency */
-   if (OF_getencprop(node, "max-frequency", >host.f_max, 
sizeof(uint32_t)) <= 0)
-   sc->host.f_max = 2;
-
/* fifo-depth */
if ((len = OF_getproplen(node, "fifo-depth")) > 0) {
OF_getencprop(node, "fifo-depth", dts_value, len);
@@ -721,11 +716,6 @@ dwmmc_attach(device_t dev)
   DWMMC_ERR_FLAGS |
   SDMMC_INTMASK_CD));
WRITE4(sc, SDMMC_CTRL, SDMMC_CTRL_INT_ENABLE);
-
-   sc->host.f_min = 40;
-   sc->host.host_ocr = MMC_OCR_320_330 | MMC_OCR_330_340;
-   sc->host.caps |= MMC_CAP_HSPEED;
-   sc->host.caps |= MMC_CAP_SIGNALING_330;
 
TASK_INIT(>card_task, 0, dwmmc_card_task, sc);
TIMEOUT_TASK_INIT(taskqueue_swi_giant, >card_delayed_task, 0,

Modified: head/sys/dev/mmc/host/dwmmc_altera.c
==
--- head/sys/dev/mmc/host/dwmmc_altera.cTue Apr 14 16:35:05 2020
(r359926)
+++ head/sys/dev/mmc/host/dwmmc_altera.cTue Apr 14 16:35:18 2020
(r359927)
@@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#include 
 
 #include 
 

Modified: head/sys/dev/mmc/host/dwmmc_hisi.c
==
--- head/sys/dev/mmc/host/dwmmc_hisi.c  Tue Apr 14 16:35:05 2020
(r359926)
+++ head/sys/dev/mmc/host/dwmmc_hisi.c  Tue Apr 14 16:35:18 2020
(r359927)
@@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#include 
 
 #include 
 

Modified: head/sys/dev/mmc/host/dwmmc_rockchip.c
==
--- head/sys/dev/mmc/host/dwmmc_rockchip.c  Tue Apr 14 16:35:05 2020
(r359926)
+++ head/sys/dev/mmc/host/dwmmc_rockchip.c  Tue Apr 14 16:35:18 2020
(r359927)
@@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#include 
 
 #include 
 

Modified: head/sys/dev/mmc/host/dwmmc_samsung.c
==
--- head/sys/dev/mmc/host/dwmmc_samsung.c   Tue Apr 14 16:35:05 2020
(r359926)
+++ head/sys/dev/mmc/host/dwmmc_samsung.c   Tue Apr 14 16:35:18 2020
(r359927)
@@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#include 
 
 #include 
 #include 

Modified: head/sys/dev/mmc/host/dwmmc_var.h
==
--- head/sys/dev/mmc/host/dwmmc_var.h   Tue Apr 14 16:35:05 2020
(r359926)
+++ head/sys/dev/mmc/host/dwmmc_var.h   Tue Apr 14 16:35:18 2020
(r359927)
@@ -52,6 +52,7 @@ struct dwmmc_softc {
device_tdev;
void

svn commit: r359926 - head/sys/netinet

2020-04-14 Thread Michael Tuexen
Author: tuexen
Date: Tue Apr 14 16:35:05 2020
New Revision: 359926
URL: https://svnweb.freebsd.org/changeset/base/359926

Log:
  Improve the TCP blackhole detection. The principle is to reduce the
  MSS in two steps and try each candidate two times. However, if two
  candidates are the same (which is the case in TCP/IPv6), this candidate
  was tested four times. This patch ensures that each candidate actually
  reduced the MSS and is only tested 2 times. This reduces the time window
  of missclassifying a temporary outage as an MTU issue.
  
  Reviewed by:  jtl
  MFC after:1 week
  Sponsored by: Netflix, Inc.
  Differential Revision:https://reviews.freebsd.org/D24308

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

Modified: head/sys/netinet/tcp_timer.c
==
--- head/sys/netinet/tcp_timer.cTue Apr 14 16:34:13 2020
(r359925)
+++ head/sys/netinet/tcp_timer.cTue Apr 14 16:35:05 2020
(r359926)
@@ -723,16 +723,40 @@ tcp_timer_rexmt(void * xtp)
(V_tcp_pmtud_blackhole_detect == 3 && isipv6)) &&
((tp->t_state == TCPS_ESTABLISHED) ||
(tp->t_state == TCPS_FIN_WAIT_1))) {
-   /*
-* Idea here is that at each stage of mtu probe (usually, 1448
-* -> 1188 -> 524) should be given 2 chances to recover before
-*  further clamping down. 'tp->t_rxtshift % 2 == 0' should
-*  take care of that.
-*/
+   if (tp->t_rxtshift == 1) {
+   /*
+* We enter blackhole detection after the first
+* unsuccessful timer based retransmission.
+* Then we reduce up to two times the MSS, each
+* candidate giving two tries of retransmissions.
+* But we give a candidate only two tries, if it
+* actually reduces the MSS.
+*/
+   tp->t_blackhole_enter = 2;
+   tp->t_blackhole_exit = tp->t_blackhole_enter;
+   if (isipv6) {
+#ifdef INET6
+   if (tp->t_maxseg > V_tcp_v6pmtud_blackhole_mss)
+   tp->t_blackhole_exit += 2;
+   if (tp->t_maxseg > V_tcp_v6mssdflt &&
+   V_tcp_v6pmtud_blackhole_mss > 
V_tcp_v6mssdflt)
+   tp->t_blackhole_exit += 2;
+#endif
+   } else {
+#ifdef INET
+   if (tp->t_maxseg > V_tcp_pmtud_blackhole_mss)
+   tp->t_blackhole_exit += 2;
+   if (tp->t_maxseg > V_tcp_mssdflt &&
+   V_tcp_pmtud_blackhole_mss > V_tcp_mssdflt)
+   tp->t_blackhole_exit += 2;
+#endif
+   }
+   }
if (((tp->t_flags2 & (TF2_PLPMTU_PMTUD|TF2_PLPMTU_MAXSEGSNT)) ==
(TF2_PLPMTU_PMTUD|TF2_PLPMTU_MAXSEGSNT)) &&
-   (tp->t_rxtshift >= 2 && tp->t_rxtshift < 6 &&
-   tp->t_rxtshift % 2 == 0)) {
+   (tp->t_rxtshift >= tp->t_blackhole_enter &&
+   tp->t_rxtshift < tp->t_blackhole_exit &&
+   (tp->t_rxtshift - tp->t_blackhole_enter) % 2 == 0)) {
/*
 * Enter Path MTU Black-hole Detection mechanism:
 * - Disable Path MTU Discovery (IP "DF" bit).
@@ -752,7 +776,8 @@ tcp_timer_rexmt(void * xtp)
 */
 #ifdef INET6
if (isipv6 &&
-   tp->t_maxseg > V_tcp_v6pmtud_blackhole_mss) {
+   tp->t_maxseg > V_tcp_v6pmtud_blackhole_mss &&
+   V_tcp_v6pmtud_blackhole_mss > V_tcp_v6mssdflt) {
/* Use the sysctl tuneable blackhole MSS. */
tp->t_maxseg = V_tcp_v6pmtud_blackhole_mss;
TCPSTAT_INC(tcps_pmtud_blackhole_activated);
@@ -771,7 +796,8 @@ tcp_timer_rexmt(void * xtp)
else
 #endif
 #ifdef INET
-   if (tp->t_maxseg > V_tcp_pmtud_blackhole_mss) {
+   if (tp->t_maxseg > V_tcp_pmtud_blackhole_mss &&
+   V_tcp_pmtud_blackhole_mss > V_tcp_mssdflt) {
/* Use the sysctl tuneable blackhole MSS. */
tp->t_maxseg = V_tcp_pmtud_blackhole_mss;
TCPSTAT_INC(tcps_pmtud_blackhole_activated);
@@ -798,11 +824,9 @@ tcp_timer_rexmt(void * xtp)
 * with a lowered MTU, maybe this isn't a blackhole and
   

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

2020-04-14 Thread Emmanuel Vadot
Author: manu
Date: Tue Apr 14 16:34:13 2020
New Revision: 359925
URL: https://svnweb.freebsd.org/changeset/base/359925

Log:
  arm: allwinner: aw_mmc: Use the mmc_fdt_helper
  
  The fdt properties are now parsed via the help of mmc_fdt_helper functions.
  This also adds card detection.
  Note that on some boards (like the Pine64) card detection is broken due to
  a missing resistor on the cd pin.
  
  MFC after:1 month
  Differential Revision:https://reviews.freebsd.org/D23268

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

Modified: head/sys/arm/allwinner/aw_mmc.c
==
--- head/sys/arm/allwinner/aw_mmc.c Tue Apr 14 16:30:54 2020
(r359924)
+++ head/sys/arm/allwinner/aw_mmc.c Tue Apr 14 16:34:13 2020
(r359925)
@@ -41,6 +41,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include 
 
@@ -49,6 +51,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -122,6 +125,7 @@ struct aw_mmc_softc {
int aw_timeout;
struct callout  aw_timeoutc;
struct mmc_host aw_host;
+   struct mmc_fdt_helper   mmc_helper;
 #ifdef MMCCAM
union ccb * ccb;
struct cam_devq *   devq;
@@ -136,9 +140,8 @@ struct aw_mmc_softc {
uint32_taw_intr;
uint32_taw_intr_wait;
void *  aw_intrhand;
-   regulator_t aw_reg_vmmc;
-   regulator_t aw_reg_vqmmc;
unsigned intaw_clock;
+   device_tchild;
 
/* Fields required for DMA access. */
bus_addr_t  aw_dma_desc_phys;
@@ -164,6 +167,7 @@ static int aw_mmc_reset(struct aw_mmc_softc *);
 static int aw_mmc_init(struct aw_mmc_softc *);
 static void aw_mmc_intr(void *);
 static int aw_mmc_update_clock(struct aw_mmc_softc *, uint32_t);
+static void aw_mmc_helper_cd_handler(device_t, bool);
 
 static void aw_mmc_print_error(uint32_t);
 static int aw_mmc_update_ios(device_t, device_t);
@@ -360,6 +364,40 @@ aw_mmc_cam_request(struct aw_mmc_softc *sc, union ccb 
 }
 #endif /* MMCCAM */
 
+static void
+aw_mmc_helper_cd_handler(device_t dev, bool present)
+{
+   struct aw_mmc_softc *sc;
+
+   sc = device_get_softc(dev);
+   AW_MMC_LOCK(sc);
+   if (present) {
+   if (sc->child == NULL) {
+   if (bootverbose)
+   device_printf(sc->aw_dev, "Card inserted\n");
+
+   sc->child = device_add_child(sc->aw_dev, "mmc", -1);
+   AW_MMC_UNLOCK(sc);
+   if (sc->child) {
+   device_set_ivars(sc->child, sc);
+   (void)device_probe_and_attach(sc->child);
+   }
+   } else
+   AW_MMC_UNLOCK(sc);
+   } else {
+   /* Card isn't present, detach if necessary */
+   if (sc->child != NULL) {
+   if (bootverbose)
+   device_printf(sc->aw_dev, "Card removed\n");
+
+   AW_MMC_UNLOCK(sc);
+   device_delete_child(sc->aw_dev, sc->child);
+   sc->child = NULL;
+   } else
+   AW_MMC_UNLOCK(sc);
+   }
+}
+
 static int
 aw_mmc_probe(device_t dev)
 {
@@ -377,15 +415,11 @@ aw_mmc_probe(device_t dev)
 static int
 aw_mmc_attach(device_t dev)
 {
-   device_t child;
struct aw_mmc_softc *sc;
struct sysctl_ctx_list *ctx;
struct sysctl_oid_list *tree;
-   uint32_t bus_width, max_freq;
-   phandle_t node;
int error;
 
-   node = ofw_bus_get_node(dev);
sc = device_get_softc(dev);
sc->aw_dev = dev;
 
@@ -399,7 +433,7 @@ aw_mmc_attach(device_t dev)
return (ENXIO);
}
if (bus_setup_intr(dev, sc->aw_res[AW_MMC_IRQRES],
-   INTR_TYPE_MISC | INTR_MPSAFE, NULL, aw_mmc_intr, sc,
+   INTR_TYPE_NET | INTR_MPSAFE, NULL, aw_mmc_intr, sc,
>aw_intrhand)) {
bus_release_resources(dev, aw_mmc_res_spec, sc->aw_res);
device_printf(dev, "cannot setup interrupt handler\n");
@@ -463,47 +497,15 @@ aw_mmc_attach(device_t dev)
goto fail;
}
 
-   if (OF_getencprop(node, "bus-width", _width, sizeof(uint32_t)) <= 0)
-   bus_width = 4;
-
-   if (regulator_get_by_ofw_property(dev, 0, "vmmc-supply",
-   >aw_reg_vmmc) == 0) {
-   if (bootverbose)
-   device_printf(dev, "vmmc-supply regulator found\n");
-   }
-   if (regulator_get_by_ofw_property(dev, 0, "vqmmc-supply",
-   >aw_reg_vqmmc) == 0 && bootverbose) {
-   if (bootverbose)
-   device_printf(dev, 

svn commit: r359924 - in head/sys: conf dev/mmc

2020-04-14 Thread Emmanuel Vadot
Author: manu
Date: Tue Apr 14 16:30:54 2020
New Revision: 359924
URL: https://svnweb.freebsd.org/changeset/base/359924

Log:
  Those functions are here to help fdt mmc controller drivers to parse
  the dts to find the supported speeds and the regulators.
  Not all DTS have every settings properly defined so host controller
  will still have to add some caps themselves.
  It also add a mmc_fdt_gpio_setup function which will read the cd-gpios
  property and register it as the CD pin.
  If the pin support interrupts one will be registered and the cd_helper
  function will be called.
  If the pin doesn't support interrupts the internal taskqueue will poll
  for change and call the same cd_helper function.
  mmc_fdt_gpio_setup will also parse the wp-gpio property and MMC drivers
  can know the write-protect pin value by calling the
  mmc_fdt_gpio_get_readonly function.
  
  MFC after:1 month
  Differential Revision:https://reviews.freebsd.org/D23267

Added:
  head/sys/dev/mmc/mmc_fdt_helpers.c   (contents, props changed)
  head/sys/dev/mmc/mmc_fdt_helpers.h   (contents, props changed)
Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==
--- head/sys/conf/files Tue Apr 14 15:38:18 2020(r359923)
+++ head/sys/conf/files Tue Apr 14 16:30:54 2020(r359924)
@@ -2399,6 +2399,7 @@ dev/mmc/mmc.c optional mmc !mmccam
 dev/mmc/mmcbr_if.m standard
 dev/mmc/mmcbus_if.mstandard
 dev/mmc/mmcsd.coptional mmcsd !mmccam
+dev/mmc/mmc_fdt_helpers.c  optional mmc fdt
 dev/mmcnull/mmcnull.c  optional mmcnull
 dev/mn/if_mn.c optional mn pci
 dev/mpr/mpr.c  optional mpr

Added: head/sys/dev/mmc/mmc_fdt_helpers.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/mmc/mmc_fdt_helpers.c  Tue Apr 14 16:30:54 2020
(r359924)
@@ -0,0 +1,414 @@
+/*
+ * Copyright 2019 Emmanuel Vadot 
+ * Copyright (c) 2017 Ian Lepore  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *  1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *  2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#ifdef EXT_RESOURCES
+#include 
+#endif
+
+static inline void
+mmc_fdt_parse_sd_speed(phandle_t node, struct mmc_host *host)
+{
+   bool no_18v = false;
+
+   /* 
+* Parse SD supported modes 
+* All UHS-I modes requires 1.8V signaling.
+*/
+   if (OF_hasprop(node, "no1-8-v"))
+   no_18v = true;
+   if (OF_hasprop(node, "cap-sd-highspeed"))
+   host->caps |= MMC_CAP_HSPEED;
+   if (OF_hasprop(node, "sd-uhs-sdr12") && no_18v == false)
+   host->caps |= MMC_CAP_UHS_SDR12 | MMC_CAP_SIGNALING_180;
+   if (OF_hasprop(node, "sd-uhs-sdr25") && no_18v == false)
+   host->caps |= MMC_CAP_UHS_SDR25 | MMC_CAP_SIGNALING_180;
+   if (OF_hasprop(node, "sd-uhs-sdr50") && no_18v == false)
+   host->caps |= MMC_CAP_UHS_SDR50 | MMC_CAP_SIGNALING_180;
+   if (OF_hasprop(node, "sd-uhs-sdr104") && no_18v == false)
+   host->caps |= MMC_CAP_UHS_SDR104 | MMC_CAP_SIGNALING_180;
+   if (OF_hasprop(node, "sd-uhs-ddr50") && no_18v == false)
+   host->caps |= MMC_CAP_UHS_DDR50 | MMC_CAP_SIGNALING_180;
+}
+
+static inline void
+mmc_fdt_parse_mmc_speed(phandle_t node, struct mmc_host *host)
+{
+
+   /* Parse eMMC supported modes */
+   if (OF_hasprop(node, "cap-mmc-highspeed"))
+   

svn commit: r359923 - in head: lib/libc/sys sys/kern sys/sys

2020-04-14 Thread Jonathan T. Looney
Author: jtl
Date: Tue Apr 14 15:38:18 2020
New Revision: 359923
URL: https://svnweb.freebsd.org/changeset/base/359923

Log:
  Make sonewconn() overflow messages have per-socket rate-limits and values.
  
  sonewconn() emits debug-level messages when a listen socket's queue
  overflows. Currently, sonewconn() tracks overflows on a global basis. It
  will only log one message every 60 seconds, regardless of how many sockets
  experience overflows. And, when it next logs at the end of the 60 seconds,
  it records a single message referencing a single PCB with the total number
  of overflows across all sockets.
  
  This commit changes to per-socket overflow tracking. The code will now
  log one message every 60 seconds per socket. And, the code will provide
  per-socket queue length and overflow counts. It also provides a way to
  change the period between log messages using a sysctl.
  
  Reviewed by:  jhb (previous version), bcr (manpages)
  MFC after:2 weeks
  Sponsored by: Netflix, Inc.
  Differential Revision:https://reviews.freebsd.org/D24316

Modified:
  head/lib/libc/sys/listen.2
  head/sys/kern/uipc_socket.c
  head/sys/sys/socketvar.h

Modified: head/lib/libc/sys/listen.2
==
--- head/lib/libc/sys/listen.2  Tue Apr 14 15:30:34 2020(r359922)
+++ head/lib/libc/sys/listen.2  Tue Apr 14 15:38:18 2020(r359923)
@@ -28,7 +28,7 @@
 .\"From: @(#)listen.2  8.2 (Berkeley) 12/11/93
 .\" $FreeBSD$
 .\"
-.Dd August 18, 2016
+.Dd April 14, 2020
 .Dt LISTEN 2
 .Os
 .Sh NAME
@@ -110,6 +110,13 @@ or less than zero is specified,
 .Fa backlog
 is silently forced to
 .Va kern.ipc.soacceptqueue .
+.Pp
+If the listen queue overflows, the kernel will emit a LOG_DEBUG syslog message.
+The
+.Xr sysctl 3
+MIB variable
+.Va kern.ipc.sooverinterval
+specifies a per-socket limit on how often the kernel will emit these messages.
 .Sh INTERACTION WITH ACCEPT FILTERS
 When accept filtering is used on a socket, a second queue will
 be used to hold sockets that have connected, but have not yet

Modified: head/sys/kern/uipc_socket.c
==
--- head/sys/kern/uipc_socket.c Tue Apr 14 15:30:34 2020(r359922)
+++ head/sys/kern/uipc_socket.c Tue Apr 14 15:38:18 2020(r359923)
@@ -575,6 +575,11 @@ SYSCTL_INT(_regression, OID_AUTO, sonewconn_earlytest,
 _sonewconn_earlytest, 0, "Perform early sonewconn limit test");
 #endif
 
+static struct timeval overinterval = { 60, 0 };
+SYSCTL_TIMEVAL_SEC(_kern_ipc, OID_AUTO, sooverinterval, CTLFLAG_RW,
+,
+"Delay in seconds between warnings for listen socket overflows");
+
 /*
  * When an attempt at a new connection is noted on a socket which accepts
  * connections, sonewconn is called.  If the connection is possible (subject
@@ -587,14 +592,10 @@ SYSCTL_INT(_regression, OID_AUTO, sonewconn_earlytest,
 struct socket *
 sonewconn(struct socket *head, int connstatus)
 {
-   static struct timeval lastover;
-   static struct timeval overinterval = { 60, 0 };
-   static int overcount;
-
struct sbuf descrsb;
struct socket *so;
-   u_int over;
-   int len;
+   int len, overcount;
+   u_int qlen;
const char localprefix[] = "local:";
char descrbuf[SUNPATHLEN + sizeof(localprefix)];
 #if defined(INET6)
@@ -602,18 +603,31 @@ sonewconn(struct socket *head, int connstatus)
 #elif defined(INET)
char addrbuf[INET_ADDRSTRLEN];
 #endif
+   bool dolog, over;
 
SOLISTEN_LOCK(head);
over = (head->sol_qlen > 3 * head->sol_qlimit / 2);
-   SOLISTEN_UNLOCK(head);
 #ifdef REGRESSION
if (regression_sonewconn_earlytest && over) {
 #else
if (over) {
 #endif
-   overcount++;
+   head->sol_overcount++;
+   dolog = !!ratecheck(>sol_lastover, );
 
-   if (ratecheck(, )) {
+   /*
+* If we're going to log, copy the overflow count and queue
+* length from the listen socket before dropping the lock.
+* Also, reset the overflow count.
+*/
+   if (dolog) {
+   overcount = head->sol_overcount;
+   head->sol_overcount = 0;
+   qlen = head->sol_qlen;
+   }
+   SOLISTEN_UNLOCK(head);
+
+   if (dolog) {
/*
 * Try to print something descriptive about the
 * socket for the error message.
@@ -686,7 +700,7 @@ sonewconn(struct socket *head, int connstatus)
"%i already in queue awaiting acceptance "
"(%d occurrences)\n",
__func__, head->so_pcb, sbuf_data(),
-   head->sol_qlen, overcount);
+   qlen, overcount);

svn commit: r359922 - head/sys/kern

2020-04-14 Thread Jonathan T. Looney
Author: jtl
Date: Tue Apr 14 15:30:34 2020
New Revision: 359922
URL: https://svnweb.freebsd.org/changeset/base/359922

Log:
  Print more detail as part of the sonewconn() overflow message.
  
  When a socket's listen queue overflows, sonewconn() emits a debug-level
  log message. These messages are sometimes useful to systems administrators
  in highlighting a process which is not keeping up with its listen queue.
  
  This commit attempts to enhance the usefulness of this message by printing
  more details about the socket's address. If all else fails, it will at
  least print the domain name of the socket.
  
  Reviewed by:  bz, jhb, kbowling
  MFC after:2 weeks
  Sponsored by: Netflix, Inc.
  Differential Revision:https://reviews.freebsd.org/D24272

Modified:
  head/sys/kern/uipc_socket.c

Modified: head/sys/kern/uipc_socket.c
==
--- head/sys/kern/uipc_socket.c Tue Apr 14 15:27:24 2020(r359921)
+++ head/sys/kern/uipc_socket.c Tue Apr 14 15:30:34 2020(r359922)
@@ -130,6 +130,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -140,9 +141,12 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -587,8 +591,17 @@ sonewconn(struct socket *head, int connstatus)
static struct timeval overinterval = { 60, 0 };
static int overcount;
 
+   struct sbuf descrsb;
struct socket *so;
u_int over;
+   int len;
+   const char localprefix[] = "local:";
+   char descrbuf[SUNPATHLEN + sizeof(localprefix)];
+#if defined(INET6)
+   char addrbuf[INET6_ADDRSTRLEN];
+#elif defined(INET)
+   char addrbuf[INET_ADDRSTRLEN];
+#endif
 
SOLISTEN_LOCK(head);
over = (head->sol_qlen > 3 * head->sol_qlimit / 2);
@@ -601,10 +614,80 @@ sonewconn(struct socket *head, int connstatus)
overcount++;
 
if (ratecheck(, )) {
-   log(LOG_DEBUG, "%s: pcb %p: Listen queue overflow: "
+   /*
+* Try to print something descriptive about the
+* socket for the error message.
+*/
+   sbuf_new(, descrbuf, sizeof(descrbuf),
+   SBUF_FIXEDLEN);
+   switch (head->so_proto->pr_domain->dom_family) {
+#if defined(INET) || defined(INET6)
+#ifdef INET
+   case AF_INET:
+#endif
+#ifdef INET6
+   case AF_INET6:
+   if (head->so_proto->pr_domain->dom_family ==
+   AF_INET6 ||
+   (sotoinpcb(head)->inp_inc.inc_flags &
+   INC_ISIPV6)) {
+   ip6_sprintf(addrbuf,
+   
(head)->inp_inc.inc6_laddr);
+   sbuf_printf(, "[%s]", addrbuf);
+   } else
+#endif
+   {
+#ifdef INET
+   inet_ntoa_r(
+   sotoinpcb(head)->inp_inc.inc_laddr,
+   addrbuf);
+   sbuf_cat(, addrbuf);
+#endif
+   }
+   sbuf_printf(, ":%hu (proto %u)",
+   ntohs(sotoinpcb(head)->inp_inc.inc_lport),
+   head->so_proto->pr_protocol);
+   break;
+#endif /* INET || INET6 */
+   case AF_UNIX:
+   sbuf_cat(, localprefix);
+   if (sotounpcb(head)->unp_addr != NULL)
+   len =
+   sotounpcb(head)->unp_addr->sun_len -
+   offsetof(struct sockaddr_un,
+   sun_path);
+   else
+   len = 0;
+   if (len > 0)
+   sbuf_bcat(,
+   sotounpcb(head)->unp_addr->sun_path,
+   len);
+   else
+   sbuf_cat(, "(unknown)");
+   break;
+   }
+
+   /*
+* If we can't print something more specific, at least
+* print the domain name.
+*/
+   if (sbuf_finish() != 0 ||
+   sbuf_len() <= 0) {
+  

svn commit: r359921 - head/sys/sys

2020-04-14 Thread Jonathan T. Looney
Author: jtl
Date: Tue Apr 14 15:27:24 2020
New Revision: 359921
URL: https://svnweb.freebsd.org/changeset/base/359921

Log:
  Make the path length of UNIX domain sockets specified by a #define.
  Also, add a comment describing the historical context for this length.
  
  Reviewed by:  bz, jhb, kbowling (previous version)
  MFC after:2 weeks
  Sponsored by: Netflix, Inc.
  Differential Revision:https://reviews.freebsd.org/D24272

Modified:
  head/sys/sys/un.h

Modified: head/sys/sys/un.h
==
--- head/sys/sys/un.h   Tue Apr 14 14:48:00 2020(r359920)
+++ head/sys/sys/un.h   Tue Apr 14 15:27:24 2020(r359921)
@@ -44,12 +44,20 @@ typedef __sa_family_t   sa_family_t;
 #endif
 
 /*
+ * Historically, (struct sockaddr) needed to fit inside an mbuf.
+ * For this reason, UNIX domain sockets were therefore limited to
+ * 104 bytes. While this limit is no longer necessary, it is kept for
+ * binary compatibility reasons.
+ */
+#defineSUNPATHLEN  104
+
+/*
  * Definitions for UNIX IPC domain.
  */
 struct sockaddr_un {
unsigned char   sun_len;/* sockaddr len including null */
sa_family_t sun_family; /* AF_UNIX */
-   charsun_path[104];  /* path name (gag) */
+   charsun_path[SUNPATHLEN];   /* path name (gag) */
 };
 
 #if __BSD_VISIBLE
___
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: r359920 - head/sys/sys

2020-04-14 Thread Andrew Gallatin
Author: gallatin
Date: Tue Apr 14 14:48:00 2020
New Revision: 359920
URL: https://svnweb.freebsd.org/changeset/base/359920

Log:
  Bump FreeBSD version after r359919 (KTLS / unmapped mbuf changes)
  
  The above changes mbufs, and any module using unmapped mbufs
  would need to be re-compiled.
  
  Sponsored by: Netflix

Modified:
  head/sys/sys/param.h

Modified: head/sys/sys/param.h
==
--- head/sys/sys/param.hTue Apr 14 14:46:06 2020(r359919)
+++ head/sys/sys/param.hTue Apr 14 14:48:00 2020(r359920)
@@ -60,7 +60,7 @@
  * in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1300091  /* Master, propagated to newvers */
+#define __FreeBSD_version 1300092  /* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r359919 - in head/sys: dev/cxgbe dev/cxgbe/crypto dev/cxgbe/tom dev/mlx5/mlx5_en kern netinet netinet6 sys

2020-04-14 Thread Andrew Gallatin
Author: gallatin
Date: Tue Apr 14 14:46:06 2020
New Revision: 359919
URL: https://svnweb.freebsd.org/changeset/base/359919

Log:
  KTLS: Re-work unmapped mbufs to carry ext_pgs in the mbuf itself.
  
  While the original implementation of unmapped mbufs was a large
  step forward in terms of reducing cache misses by enabling mbufs
  to carry more than a single page for sendfile, they are rather
  cache unfriendly when accessing the ext_pgs metadata and
  data. This is because the ext_pgs part of the mbuf is allocated
  separately, and almost guaranteed to be cold in cache.
  
  This change takes advantage of the fact that unmapped mbufs
  are never used at the same time as pkthdr mbufs. Given this
  fact, we can overlap the ext_pgs metadata with the mbuf
  pkthdr, and carry the ext_pgs meta directly in the mbuf itself.
  Similarly, we can carry the ext_pgs data (TLS hdr/trailer/array
  of pages) directly after the existing m_ext.
  
  In order to be able to carry 5 pages (which is the minimum
  required for a 16K TLS record which is not perfectly aligned) on
  LP64, I've had to steal ext_arg2. The only user of this in the
  xmit path is sendfile, and I've adjusted it to use arg1 when
  using unmapped mbufs.
  
  This change is almost entirely mechanical, except that we
  change mb_alloc_ext_pgs() to no longer allow allocating
  pkthdrs, the change to avoid ext_arg2 as mentioned above,
  and the removal of the ext_pgs zone,
  
  This change saves roughly 2% "raw" CPU (~59% -> 57%), or over
  3% "scaled" CPU on a Netflix 100% software kTLS workload at
  90+ Gb/s on Broadwell Xeons.
  
  In a follow-on commit, I plan to remove some hacks to avoid
  access ext_pgs fields of mbufs, since they will now be in
  cache.
  
  Many thanks to glebius for helping to make this better in
  the Netflix tree.
  
  Reviewed by:  hselasky, jhb, rrs, glebius (early version)
  Sponsored by: Netflix
  Differential Revision:https://reviews.freebsd.org/D24213

Modified:
  head/sys/dev/cxgbe/crypto/t4_kern_tls.c
  head/sys/dev/cxgbe/t4_sge.c
  head/sys/dev/cxgbe/tom/t4_cpl_io.c
  head/sys/dev/cxgbe/tom/t4_tls.c
  head/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c
  head/sys/kern/kern_mbuf.c
  head/sys/kern/kern_sendfile.c
  head/sys/kern/subr_bus_dma.c
  head/sys/kern/subr_sglist.c
  head/sys/kern/uipc_ktls.c
  head/sys/kern/uipc_mbuf.c
  head/sys/kern/uipc_sockbuf.c
  head/sys/netinet/ip_output.c
  head/sys/netinet/tcp_output.c
  head/sys/netinet6/ip6_output.c
  head/sys/sys/mbuf.h

Modified: head/sys/dev/cxgbe/crypto/t4_kern_tls.c
==
--- head/sys/dev/cxgbe/crypto/t4_kern_tls.c Tue Apr 14 13:32:03 2020
(r359918)
+++ head/sys/dev/cxgbe/crypto/t4_kern_tls.c Tue Apr 14 14:46:06 2020
(r359919)
@@ -905,8 +905,8 @@ ktls_tcp_payload_length(struct tlspcb *tlsp, struct mb
u_int plen, mlen;
 
MBUF_EXT_PGS_ASSERT(m_tls);
-   ext_pgs = m_tls->m_ext.ext_pgs;
-   hdr = (void *)ext_pgs->hdr;
+   ext_pgs = _tls->m_ext_pgs;
+   hdr = (void *)ext_pgs->m_epg_hdr;
plen = ntohs(hdr->tls_length);
 
/*
@@ -961,8 +961,8 @@ ktls_payload_offset(struct tlspcb *tlsp, struct mbuf *
 #endif
 
MBUF_EXT_PGS_ASSERT(m_tls);
-   ext_pgs = m_tls->m_ext.ext_pgs;
-   hdr = (void *)ext_pgs->hdr;
+   ext_pgs = _tls->m_ext_pgs;
+   hdr = (void *)ext_pgs->m_epg_hdr;
plen = ntohs(hdr->tls_length);
 #ifdef INVARIANTS
mlen = mtod(m_tls, vm_offset_t) + m_tls->m_len;
@@ -1008,7 +1008,7 @@ ktls_wr_len(struct tlspcb *tlsp, struct mbuf *m, struc
u_int imm_len, offset, plen, wr_len, tlen;
 
MBUF_EXT_PGS_ASSERT(m_tls);
-   ext_pgs = m_tls->m_ext.ext_pgs;
+   ext_pgs = _tls->m_ext_pgs;
 
/*
 * Determine the size of the TLS record payload to send
@@ -1040,7 +1040,7 @@ ktls_wr_len(struct tlspcb *tlsp, struct mbuf *m, struc
return (wr_len);
}
 
-   hdr = (void *)ext_pgs->hdr;
+   hdr = (void *)ext_pgs->m_epg_hdr;
plen = TLS_HEADER_LENGTH + ntohs(hdr->tls_length) - ext_pgs->trail_len;
if (tlen < plen) {
plen = tlen;
@@ -1474,7 +1474,7 @@ ktls_write_tunnel_packet(struct sge_txq *txq, void *ds
 
/* Locate the template TLS header. */
MBUF_EXT_PGS_ASSERT(m_tls);
-   ext_pgs = m_tls->m_ext.ext_pgs;
+   ext_pgs = _tls->m_ext_pgs;
 
/* This should always be the last TLS record in a chain. */
MPASS(m_tls->m_next == NULL);
@@ -1543,8 +1543,8 @@ ktls_write_tunnel_packet(struct sge_txq *txq, void *ds
(m->m_pkthdr.l2hlen + m->m_pkthdr.l3hlen + sizeof(*tcp)));
 
/* Copy the subset of the TLS header requested. */
-   copy_to_txd(>eq, (char *)ext_pgs->hdr + mtod(m_tls, vm_offset_t),
-   , m_tls->m_len);
+   copy_to_txd(>eq, (char *)ext_pgs->m_epg_hdr +
+   mtod(m_tls, vm_offset_t), , m_tls->m_len);
txq->imm_wrs++;
 
   

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

2020-04-14 Thread Kyle Evans
Author: kevans
Date: Tue Apr 14 13:32:03 2020
New Revision: 359918
URL: https://svnweb.freebsd.org/changeset/base/359918

Log:
  posixshm: fix counting of writable mappings
  
  Similar to mmap'ing vnodes, posixshm should count any mapping where maxprot
  contains VM_PROT_WRITE (i.e. fd opened r/w with no write-seal applied) as
  writable and thus blocking of any write-seal.
  
  The memfd tests have been amended to reflect the fixes here, which notably
  includes:
  
  1. Fix for error return bug; EPERM is not a documented failure mode for mmap
  2. Fix rejection of write-seal with active mappings that can be upgraded via
  mprotect(2).
  
  Reported by:  markj
  Discussed with:   markj, kib

Modified:
  head/sys/kern/uipc_shm.c
  head/tests/sys/kern/memfd_test.c

Modified: head/sys/kern/uipc_shm.c
==
--- head/sys/kern/uipc_shm.cTue Apr 14 13:12:22 2020(r359917)
+++ head/sys/kern/uipc_shm.cTue Apr 14 13:32:03 2020(r359918)
@@ -1147,14 +1147,16 @@ shm_mmap(struct file *fp, vm_map_t map, vm_offset_t *a
if ((fp->f_flag & FWRITE) != 0 &&
(shmfd->shm_seals & F_SEAL_WRITE) == 0)
maxprot |= VM_PROT_WRITE;
-   writecnt = (prot & VM_PROT_WRITE) != 0;
-   if (writecnt && (shmfd->shm_seals & F_SEAL_WRITE) != 0) {
-   error = EPERM;
-   goto out;
-   }
 
-   /* Don't permit shared writable mappings on read-only 
descriptors. */
-   if (writecnt && (maxprot & VM_PROT_WRITE) == 0) {
+   /*
+* Any mappings from a writable descriptor may be upgraded to
+* VM_PROT_WRITE with mprotect(2), unless a write-seal was
+* applied between the open and subsequent mmap(2).  We want to
+* reject application of a write seal as long as any such
+* mapping exists so that the seal cannot be trivially bypassed.
+*/
+   writecnt = (maxprot & VM_PROT_WRITE) != 0;
+   if (!writecnt && (prot & VM_PROT_WRITE) != 0) {
error = EACCES;
goto out;
}

Modified: head/tests/sys/kern/memfd_test.c
==
--- head/tests/sys/kern/memfd_test.cTue Apr 14 13:12:22 2020
(r359917)
+++ head/tests/sys/kern/memfd_test.cTue Apr 14 13:32:03 2020
(r359918)
@@ -108,7 +108,7 @@ ATF_TC_BODY(write_seal, tc)
 
ATF_REQUIRE(mmap(0, BUF_SIZE, (PROT_READ | PROT_WRITE), MAP_SHARED,
fd, 0) == MAP_FAILED);
-   ATF_REQUIRE(errno == EPERM);
+   ATF_REQUIRE(errno == EACCES);
 
close(fd);
 }
@@ -136,13 +136,23 @@ ATF_TC_BODY(mmap_write_seal, tc)
 
ATF_REQUIRE(munmap(addr, BUF_SIZE) == 0);
 
+   /*
+* This should fail, because raddr still exists and it was spawned from
+* a r/w fd.
+*/
+   ATF_REQUIRE(fcntl(fd, F_ADD_SEALS, F_SEAL_WRITE) == -1);
+   ATF_REQUIRE(errno == EBUSY);
+
+   ATF_REQUIRE(munmap(raddr, BUF_SIZE) == 0);
+   /* This one should succeed; only the private mapping remains. */
ATF_REQUIRE(fcntl(fd, F_ADD_SEALS, F_SEAL_WRITE) == 0);
 
ATF_REQUIRE(munmap(paddr, BUF_SIZE) == 0);
-   ATF_REQUIRE(munmap(raddr, BUF_SIZE) == 0);
ATF_REQUIRE(mmap(0, BUF_SIZE, (PROT_READ | PROT_WRITE), MAP_SHARED,
fd, 0) == MAP_FAILED);
-   ATF_REQUIRE(errno == EPERM);
+   ATF_REQUIRE(errno == EACCES);
+
+   /* Make sure we can still map privately r/w or shared r/o. */
paddr = mmap(0, BUF_SIZE, (PROT_READ | PROT_WRITE), MAP_PRIVATE, fd, 0);
ATF_REQUIRE(paddr != MAP_FAILED);
raddr = mmap(0, BUF_SIZE, PROT_READ, MAP_SHARED, fd, 0);
@@ -227,7 +237,7 @@ ATF_TC_BODY(dup_seals, tc)
 
ATF_REQUIRE(mmap(0, BUF_SIZE, (PROT_READ | PROT_WRITE), MAP_SHARED,
fdx, 0) == MAP_FAILED);
-   ATF_REQUIRE(errno == EPERM);
+   ATF_REQUIRE(errno == EACCES);
 
close(fd);
close(fdx);
@@ -259,7 +269,6 @@ ATF_TC_BODY(immutable_seals, tc)
"Added duplicate grow seal after restricting seals");
close(fd);
 }
-
 
 ATF_TP_ADD_TCS(tp)
 {
___
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: r359823 - in head: etc/mtree include lib/libc/gen sys/conf sys/net sys/net/route sys/netinet sys/netinet6 sys/sys usr.bin/netstat

2020-04-14 Thread Alexander V . Chernikov
14.04.2020, 13:25, "Hans Petter Selasky" :
> Hi,
Hi Hans,
Thank you!
Indeed, the check slipped through the cracks while merging the code.
Should be fixed by r359917.
I'll add the testcases to cover that later today.

>
> It looks like you need to add some NULL checks:
>
>>  diff --git a/sys/netinet/in_rmx.c b/sys/netinet/in_rmx.c
>>  index eeb7760c5cc..5f9ae967177 100644
>>  --- a/sys/netinet/in_rmx.c
>>  +++ b/sys/netinet/in_rmx.c
>>  @@ -103,7 +103,7 @@ rib4_preadd(u_int fibnum, const struct sockaddr *addr, 
>> const struct sockaddr *ma
>>
>>  /* Ensure that default route nhop has special flag */
>>  const struct sockaddr_in *mask4 = (const struct sockaddr_in *)mask;
>>  - if ((rt_flags & RTF_HOST) == 0 && mask4->sin_addr.s_addr == 0)
>>  + if ((rt_flags & RTF_HOST) == 0 && mask4 != NULL && mask4->sin_addr.s_addr 
>> == 0)
>>  nh->nh_flags |= NHF_DEFAULT;
>>
>>  /* Set nhop type to basic per-AF nhop */
>>  diff --git a/sys/netinet6/in6_rmx.c b/sys/netinet6/in6_rmx.c
>>  index 7f10b290309..4621669dab9 100644
>>  --- a/sys/netinet6/in6_rmx.c
>>  +++ b/sys/netinet6/in6_rmx.c
>>  @@ -125,7 +125,7 @@ rib6_preadd(u_int fibnum, const struct sockaddr *addr, 
>> const struct sockaddr *ma
>>
>>  /* Ensure that default route nhop has special flag */
>>  const struct sockaddr_in6 *mask6 = (const struct sockaddr_in6 
>> *)mask;
>>  - if ((nhop_get_rtflags(nh) & RTF_HOST) == 0 &&
>>  + if ((nhop_get_rtflags(nh) & RTF_HOST) == 0 && mask6 != NULL &&
>>  IN6_IS_ADDR_UNSPECIFIED(>sin6_addr))
>>  nh->nh_flags |= NHF_DEFAULT;
>
> Else I hit a panic with this command:
>
> sysctl net.inet.icmp.bmcastecho=1
> route add -net 255.255.255.255 a.b.c.d
>
> Where a.b.c.d is a valid IPv4 on the local network.
>
> --HPS
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r359917 - in head/sys: netinet netinet6

2020-04-14 Thread Alexander V. Chernikov
Author: melifaro
Date: Tue Apr 14 13:12:22 2020
New Revision: 359917
URL: https://svnweb.freebsd.org/changeset/base/359917

Log:
  Plug netmask NULL check during route addition causing kernel panic.
   This bug was introduced by the r359823.
  
  Reported by:  hselasky

Modified:
  head/sys/netinet/in_rmx.c
  head/sys/netinet6/in6_rmx.c

Modified: head/sys/netinet/in_rmx.c
==
--- head/sys/netinet/in_rmx.c   Tue Apr 14 10:10:31 2020(r359916)
+++ head/sys/netinet/in_rmx.c   Tue Apr 14 13:12:22 2020(r359917)
@@ -103,7 +103,8 @@ rib4_preadd(u_int fibnum, const struct sockaddr *addr,
 
/* Ensure that default route nhop has special flag */
const struct sockaddr_in *mask4 = (const struct sockaddr_in *)mask;
-   if ((rt_flags & RTF_HOST) == 0 && mask4->sin_addr.s_addr == 0)
+   if ((rt_flags & RTF_HOST) == 0 && mask4 != NULL &&
+   mask4->sin_addr.s_addr == 0)
nh->nh_flags |= NHF_DEFAULT;
 
/* Set nhop type to basic per-AF nhop */

Modified: head/sys/netinet6/in6_rmx.c
==
--- head/sys/netinet6/in6_rmx.c Tue Apr 14 10:10:31 2020(r359916)
+++ head/sys/netinet6/in6_rmx.c Tue Apr 14 13:12:22 2020(r359917)
@@ -125,7 +125,7 @@ rib6_preadd(u_int fibnum, const struct sockaddr *addr,
 
/* Ensure that default route nhop has special flag */
const struct sockaddr_in6 *mask6 = (const struct sockaddr_in6 *)mask;
-   if ((nhop_get_rtflags(nh) & RTF_HOST) == 0 &&
+   if ((nhop_get_rtflags(nh) & RTF_HOST) == 0 && mask6 != NULL &&
IN6_IS_ADDR_UNSPECIFIED(>sin6_addr))
nh->nh_flags |= NHF_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"


Re: svn commit: r359823 - in head: etc/mtree include lib/libc/gen sys/conf sys/net sys/net/route sys/netinet sys/netinet6 sys/sys usr.bin/netstat

2020-04-14 Thread Hans Petter Selasky

Hi,

It looks like you need to add some NULL checks:


diff --git a/sys/netinet/in_rmx.c b/sys/netinet/in_rmx.c
index eeb7760c5cc..5f9ae967177 100644
--- a/sys/netinet/in_rmx.c
+++ b/sys/netinet/in_rmx.c
@@ -103,7 +103,7 @@ rib4_preadd(u_int fibnum, const struct sockaddr *addr, 
const struct sockaddr *ma
 
/* Ensure that default route nhop has special flag */

const struct sockaddr_in *mask4 = (const struct sockaddr_in *)mask;
-   if ((rt_flags & RTF_HOST) == 0 && mask4->sin_addr.s_addr == 0)
+   if ((rt_flags & RTF_HOST) == 0 && mask4 != NULL && 
mask4->sin_addr.s_addr == 0)
nh->nh_flags |= NHF_DEFAULT;
 
/* Set nhop type to basic per-AF nhop */

diff --git a/sys/netinet6/in6_rmx.c b/sys/netinet6/in6_rmx.c
index 7f10b290309..4621669dab9 100644
--- a/sys/netinet6/in6_rmx.c
+++ b/sys/netinet6/in6_rmx.c
@@ -125,7 +125,7 @@ rib6_preadd(u_int fibnum, const struct sockaddr *addr, 
const struct sockaddr *ma
 
/* Ensure that default route nhop has special flag */

const struct sockaddr_in6 *mask6 = (const struct sockaddr_in6 *)mask;
-   if ((nhop_get_rtflags(nh) & RTF_HOST) == 0 &&
+   if ((nhop_get_rtflags(nh) & RTF_HOST) == 0 && mask6 != NULL &&
IN6_IS_ADDR_UNSPECIFIED(>sin6_addr))
nh->nh_flags |= NHF_DEFAULT;
 


Else I hit a panic with this command:

sysctl net.inet.icmp.bmcastecho=1
route add -net 255.255.255.255 a.b.c.d

Where a.b.c.d is a valid IPv4 on the local network.

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


svn commit: r359916 - head/sbin/umount

2020-04-14 Thread Mateusz Piotrowski
Author: 0mp (doc,ports committer)
Date: Tue Apr 14 10:10:31 2020
New Revision: 359916
URL: https://svnweb.freebsd.org/changeset/base/359916

Log:
  Improve manual page formatting
  
  - Use appropriate macros for command arguments.
  - Increase option list indentation for better readability.
  
  MFC after:3 days

Modified:
  head/sbin/umount/umount.8

Modified: head/sbin/umount/umount.8
==
--- head/sbin/umount/umount.8   Tue Apr 14 08:34:34 2020(r359915)
+++ head/sbin/umount/umount.8   Tue Apr 14 10:10:31 2020(r359916)
@@ -28,7 +28,7 @@
 .\" @(#)umount.8   8.2 (Berkeley) 5/8/95
 .\" $FreeBSD$
 .\"
-.Dd July 25, 2017
+.Dd April 14, 2020
 .Dt UMOUNT 8
 .Os
 .Sh NAME
@@ -52,7 +52,9 @@ utility calls the
 system call to remove a file system from the file system tree.
 The file system can be specified by its
 .Ar special
-device or remote node (rhost:path), the path to the mount point
+device or remote node
+.Pq Ar rhost Ns Cm \& : Ns Ar path ,
+the path to the mount point
 .Ar node
 or by the file system ID
 .Ar fsid
@@ -61,7 +63,7 @@ as reported by
 when run by root.
 .Pp
 The options are as follows:
-.Bl -tag -width indent
+.Bl -tag -width "-F fstab"
 .It Fl a
 All the file systems described in
 .Xr fstab 5
___
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: r359915 - in stable/12/sys: amd64/vmm/amd contrib/dev/acpica contrib/dev/acpica/common contrib/dev/acpica/compiler contrib/dev/acpica/components/debugger contrib/dev/acpica/components/d...

2020-04-14 Thread Jung-uk Kim
Author: jkim
Date: Tue Apr 14 08:34:34 2020
New Revision: 359915
URL: https://svnweb.freebsd.org/changeset/base/359915

Log:
  MFC:  r356618, r357959, r359346
  
  Merge ACPICA 20200326.

Modified:
  stable/12/sys/amd64/vmm/amd/amdvi_priv.h
  stable/12/sys/amd64/vmm/amd/ivrs_drv.c
  stable/12/sys/contrib/dev/acpica/changes.txt
  stable/12/sys/contrib/dev/acpica/common/acfileio.c
  stable/12/sys/contrib/dev/acpica/common/acgetline.c
  stable/12/sys/contrib/dev/acpica/common/adfile.c
  stable/12/sys/contrib/dev/acpica/common/adisasm.c
  stable/12/sys/contrib/dev/acpica/common/adwalk.c
  stable/12/sys/contrib/dev/acpica/common/ahids.c
  stable/12/sys/contrib/dev/acpica/common/ahpredef.c
  stable/12/sys/contrib/dev/acpica/common/ahtable.c
  stable/12/sys/contrib/dev/acpica/common/ahuuids.c
  stable/12/sys/contrib/dev/acpica/common/cmfsize.c
  stable/12/sys/contrib/dev/acpica/common/dmextern.c
  stable/12/sys/contrib/dev/acpica/common/dmrestag.c
  stable/12/sys/contrib/dev/acpica/common/dmswitch.c
  stable/12/sys/contrib/dev/acpica/common/dmtable.c
  stable/12/sys/contrib/dev/acpica/common/dmtables.c
  stable/12/sys/contrib/dev/acpica/common/dmtbdump.c
  stable/12/sys/contrib/dev/acpica/common/dmtbdump1.c
  stable/12/sys/contrib/dev/acpica/common/dmtbdump2.c
  stable/12/sys/contrib/dev/acpica/common/dmtbdump3.c
  stable/12/sys/contrib/dev/acpica/common/dmtbinfo.c
  stable/12/sys/contrib/dev/acpica/common/dmtbinfo1.c
  stable/12/sys/contrib/dev/acpica/common/dmtbinfo2.c
  stable/12/sys/contrib/dev/acpica/common/dmtbinfo3.c
  stable/12/sys/contrib/dev/acpica/common/getopt.c
  stable/12/sys/contrib/dev/acpica/compiler/aslallocate.c
  stable/12/sys/contrib/dev/acpica/compiler/aslanalyze.c
  stable/12/sys/contrib/dev/acpica/compiler/aslascii.c
  stable/12/sys/contrib/dev/acpica/compiler/aslbtypes.c
  stable/12/sys/contrib/dev/acpica/compiler/aslcache.c
  stable/12/sys/contrib/dev/acpica/compiler/aslcodegen.c
  stable/12/sys/contrib/dev/acpica/compiler/aslcompile.c
  stable/12/sys/contrib/dev/acpica/compiler/aslcompiler.h
  stable/12/sys/contrib/dev/acpica/compiler/aslcompiler.l
  stable/12/sys/contrib/dev/acpica/compiler/aslcstyle.y
  stable/12/sys/contrib/dev/acpica/compiler/asldebug.c
  stable/12/sys/contrib/dev/acpica/compiler/asldefine.h
  stable/12/sys/contrib/dev/acpica/compiler/aslerror.c
  stable/12/sys/contrib/dev/acpica/compiler/aslexternal.c
  stable/12/sys/contrib/dev/acpica/compiler/aslfileio.c
  stable/12/sys/contrib/dev/acpica/compiler/aslfiles.c
  stable/12/sys/contrib/dev/acpica/compiler/aslfold.c
  stable/12/sys/contrib/dev/acpica/compiler/aslglobal.h
  stable/12/sys/contrib/dev/acpica/compiler/aslhelp.c
  stable/12/sys/contrib/dev/acpica/compiler/aslhelpers.y
  stable/12/sys/contrib/dev/acpica/compiler/aslhex.c
  stable/12/sys/contrib/dev/acpica/compiler/aslkeywords.y
  stable/12/sys/contrib/dev/acpica/compiler/asllength.c
  stable/12/sys/contrib/dev/acpica/compiler/asllisting.c
  stable/12/sys/contrib/dev/acpica/compiler/asllistsup.c
  stable/12/sys/contrib/dev/acpica/compiler/aslload.c
  stable/12/sys/contrib/dev/acpica/compiler/asllookup.c
  stable/12/sys/contrib/dev/acpica/compiler/aslmain.c
  stable/12/sys/contrib/dev/acpica/compiler/aslmap.c
  stable/12/sys/contrib/dev/acpica/compiler/aslmapenter.c
  stable/12/sys/contrib/dev/acpica/compiler/aslmapoutput.c
  stable/12/sys/contrib/dev/acpica/compiler/aslmaputils.c
  stable/12/sys/contrib/dev/acpica/compiler/aslmessages.c
  stable/12/sys/contrib/dev/acpica/compiler/aslmessages.h
  stable/12/sys/contrib/dev/acpica/compiler/aslmethod.c
  stable/12/sys/contrib/dev/acpica/compiler/aslnamesp.c
  stable/12/sys/contrib/dev/acpica/compiler/asloffset.c
  stable/12/sys/contrib/dev/acpica/compiler/aslopcodes.c
  stable/12/sys/contrib/dev/acpica/compiler/asloperands.c
  stable/12/sys/contrib/dev/acpica/compiler/aslopt.c
  stable/12/sys/contrib/dev/acpica/compiler/asloptions.c
  stable/12/sys/contrib/dev/acpica/compiler/aslparseop.c
  stable/12/sys/contrib/dev/acpica/compiler/aslparser.y
  stable/12/sys/contrib/dev/acpica/compiler/aslpld.c
  stable/12/sys/contrib/dev/acpica/compiler/aslpredef.c
  stable/12/sys/contrib/dev/acpica/compiler/aslprepkg.c
  stable/12/sys/contrib/dev/acpica/compiler/aslprimaries.y
  stable/12/sys/contrib/dev/acpica/compiler/aslprintf.c
  stable/12/sys/contrib/dev/acpica/compiler/aslprune.c
  stable/12/sys/contrib/dev/acpica/compiler/aslresource.c
  stable/12/sys/contrib/dev/acpica/compiler/aslresources.y
  stable/12/sys/contrib/dev/acpica/compiler/aslrestype1.c
  stable/12/sys/contrib/dev/acpica/compiler/aslrestype1i.c
  stable/12/sys/contrib/dev/acpica/compiler/aslrestype2.c
  stable/12/sys/contrib/dev/acpica/compiler/aslrestype2d.c
  stable/12/sys/contrib/dev/acpica/compiler/aslrestype2e.c
  stable/12/sys/contrib/dev/acpica/compiler/aslrestype2q.c
  stable/12/sys/contrib/dev/acpica/compiler/aslrestype2s.c
  stable/12/sys/contrib/dev/acpica/compiler/aslrestype2w.c
  stable/12/sys/contrib/dev/acpica/compiler/aslrules.y
  

svn commit: r359914 - head/sys/net

2020-04-14 Thread Alexander V. Chernikov
Author: melifaro
Date: Tue Apr 14 07:38:34 2020
New Revision: 359914
URL: https://svnweb.freebsd.org/changeset/base/359914

Log:
  Postpone multipath seed init till SI_SUB_LAST, as it is needed only after
   some useland program installs multiple paths to the same destination.
  
  While here, make multipath init conditional.
  
  Discussed with:   cem,ian

Modified:
  head/sys/net/radix_mpath.c

Modified: head/sys/net/radix_mpath.c
==
--- head/sys/net/radix_mpath.c  Tue Apr 14 01:07:58 2020(r359913)
+++ head/sys/net/radix_mpath.c  Tue Apr 14 07:38:34 2020(r359914)
@@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$");
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
+#include "opt_mpath.h"
 
 #include 
 #include 
@@ -298,11 +299,13 @@ rt_mpath_init_rnh(struct rib_head *rnh)
rnh->rnh_multipath = 1;
 }
 
+#ifdef RADIX_MPATH
 static void
 mpath_init(void)
 {
 
hashjitter = arc4random();
 }
-SYSINIT(mpath_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY, mpath_init, NULL);
+SYSINIT(mpath_init, SI_SUB_LAST, SI_ORDER_ANY, mpath_init, NULL);
+#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"