Re: svn commit: r347566 - in head/sys: amd64/amd64 amd64/include dev/cpuctl i386/i386 i386/include x86/include x86/x86

2019-05-15 Thread Konstantin Belousov
On Wed, May 15, 2019 at 08:54:04AM +0300, Dmitry Chagin wrote:
> вт, 14 мая 2019 г. в 20:02, Konstantin Belousov :
> 
> > Author: kib
> > Date: Tue May 14 17:02:20 2019
> > New Revision: 347566
> > URL: https://svnweb.freebsd.org/changeset/base/347566
> >
> > Log:
> >   Mitigations for Microarchitectural Data Sampling.
> >
> >   Microarchitectural buffers on some Intel processors utilizing
> >   speculative execution may allow a local process to obtain a memory
> >   disclosure.  An attacker may be able to read secret data from the
> >   kernel or from a process when executing untrusted code (for example,
> >   in a web browser).
> >
> >   Reference:
> > https://www.intel.com/content/www/us/en/security-center/advisory/intel-sa-00233.html
> >   Security: CVE-2018-12126, CVE-2018-12127, CVE-2018-12130,
> > CVE-2019-11091
> >   Security: FreeBSD-SA-19:07.mds
> >   Reviewed by:  jhb
> >   Tested by:emaste, lwhsu
> >   Approved by:  so (gtetlow)
> >
> > Modified:
> >   head/sys/amd64/amd64/exception.S
> >   head/sys/amd64/amd64/genassym.c
> >   head/sys/amd64/amd64/initcpu.c
> >   head/sys/amd64/amd64/machdep.c
> >   head/sys/amd64/amd64/support.S
> >
> 
> 
> 
> Hi, Kostik!
> 
> cc -target x86_64-unknown-freebsd13.0
> --sysroot=/home/dchagin/obj/home/dchagin/head/amd64.amd64/tmp
> -B/home/dchagin/obj/home/dchagin/head/amd64.amd64/tmp/usr/bin -c -x
> assembler-with-cpp -DLOCORE -O2 -pipe -fno-strict-aliasing  -g -nostdinc
> -I. -I/home/dchagin/head/sys -I/home/dchagin/head/sys/contrib/ck/include
> -I/home/dchagin/head/sys/contrib/libfdt -D_KERNEL
> -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h
> -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -MD
> -MF.depend.support.o -MTsupport.o
> -fdebug-prefix-map=./machine=/home/dchagin/head/sys/amd64/include
> -fdebug-prefix-map=./x86=/home/dchagin/head/sys/x86/include -mcmodel=kernel
> -mno-red-zone -mno-mmx -mno-sse -msoft-float
> -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector
> -gdwarf-2 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes
> -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign
> -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs
> -fdiagnostics-show-option -Wno-unknown-pragmas
> -Wno-error-tautological-compare -Wno-error-empty-body
> -Wno-error-parentheses-equality -Wno-error-unused-function
> -Wno-error-pointer-sign -Wno-error-shift-negative-value
> -Wno-address-of-packed-member  -mno-aes -mno-avx  -std=iso9899:1999
> -Werror /home/dchagin/head/sys/amd64/amd64/support.S
> /home/dchagin/head/sys/amd64/amd64/support.S:1809:2: error: instruction
> requires: AVX-512 ISA
>  vmovdqa64 %zmm0, %gs:0x340
>  ^
> /home/dchagin/head/sys/amd64/amd64/support.S:1810:2: error: instruction
> requires: AVX-512 ISA
>  vpxor %zmm0, %zmm0, %zmm0
>  ^
> /home/dchagin/head/sys/amd64/amd64/support.S:1813:2: error: instruction
> requires: AVX-512 DQ ISA
>  vorpd (%rdx), %zmm0, %zmm0
>  ^
> /home/dchagin/head/sys/amd64/amd64/support.S:1814:2: error: instruction
> requires: AVX-512 DQ ISA
>  vorpd (%rdx), %zmm0, %zmm0
>  ^
> /home/dchagin/head/sys/amd64/amd64/support.S:1826:2: error: instruction
> requires: AVX-512 ISA
>  vmovdqa64 %gs:0x340, %zmm0
>  ^
> *** Error code 1
> 
> 
> I/m missied something?
Yes, you are using older compiler than current.  Perhaps you are using
clang 6.0 still.  Update your world.

FWIW, this is is reason why the sw sequences use .byte in 11.2/12.0
patches. I do not want to put such abomination into live code base,
remembering aesni.ko.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r347615 - head

2019-05-15 Thread Antoine Brodin
Author: antoine
Date: Wed May 15 15:11:49 2019
New Revision: 347615
URL: https://svnweb.freebsd.org/changeset/base/347615

Log:
  Add more obsolete files.

Modified:
  head/ObsoleteFiles.inc

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Wed May 15 15:03:55 2019(r347614)
+++ head/ObsoleteFiles.inc  Wed May 15 15:11:49 2019(r347615)
@@ -43,6 +43,8 @@ OLD_FILES+=lib/casper/libcap_sysctl.1
 # 20190509: tests/sys/opencrypto requires the net/py-dpkt package.
 OLD_FILES+=usr/tests/sys/opencrypto/dpkt.py
 OLD_FILES+=usr/tests/sys/opencrypto/dpkt.pyc
+# 20190326: tzdata 2019a import
+OLD_FILES+=usr/share/zoneinfo/Etc/UCT
 # 20190304: new libc++ import which bumps version from 7.0.1 to 8.0.0.
 OLD_FILES+=usr/include/c++/v1/experimental/dynarray
 # 20190304: new clang import which bumps version from 7.0.1 to 8.0.0.
@@ -201,16 +203,21 @@ OLD_FILES+=usr/include/sys/seq.h
 OLD_FILES+=usr/lib/libprivateifconfig.a
 OLD_FILES+=usr/lib/libprivateifconfig_p.a
 # 20190131: pfil(9) changed
-OLD_FILES+=usr/share/man/man9/pfil_hook_get.9
-OLD_FILES+=usr/share/man/man9/pfil_rlock.9
-OLD_FILES+=usr/share/man/man9/pfil_runlock.9
-OLD_FILES+=usr/share/man/man9/pfil_wlock.9
-OLD_FILES+=usr/share/man/man9/pfil_wunlock.9
+OLD_FILES+=usr/share/man/man9/pfil_hook_get.9.gz
+OLD_FILES+=usr/share/man/man9/pfil_rlock.9.gz
+OLD_FILES+=usr/share/man/man9/pfil_runlock.9.gz
+OLD_FILES+=usr/share/man/man9/pfil_wlock.9.gz
+OLD_FILES+=usr/share/man/man9/pfil_wunlock.9.gz
 # 20190126: adv(4) / adw(4) removal
 OLD_FILES+=usr/share/man/man4/adv.4.gz
 OLD_FILES+=usr/share/man/man4/adw.4.gz
+# 20190123: nonexistant cred_update_thread(9) removed
+OLD_FILES+=usr/share/man/man9/cred_update_thread.9.gz
 # 20190114: old pbuf allocator removed
+OLD_FILES+=usr/share/man/man9/getpbuf.9.gz
 OLD_FILES+=usr/share/man/man9/pbuf.9.gz
+OLD_FILES+=usr/share/man/man9/relpbuf.9.gz
+OLD_FILES+=usr/share/man/man9/trypbuf.9.gz
 # 20181219: ibcs removal
 OLD_FILES+=usr/share/examples/ibcs2/hello.uu
 OLD_FILES+=usr/share/examples/ibcs2/README
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r347617 - head/lib/libc/stdlib

2019-05-15 Thread Benedict Reuschling
Author: bcr (doc committer)
Date: Wed May 15 15:54:27 2019
New Revision: 347617
URL: https://svnweb.freebsd.org/changeset/base/347617

Log:
  Add small EXAMPLE section to bsearch.3.
  
  Submitted by: fernape (via Phabricator)
  Reviewed by:  bcr, jilles, dab
  Approved by:  bcr (man pages), jilles (src)
  MFC after:3 days
  Differential Revision:https://reviews.freebsd.org/D19902

Modified:
  head/lib/libc/stdlib/bsearch.3

Modified: head/lib/libc/stdlib/bsearch.3
==
--- head/lib/libc/stdlib/bsearch.3  Wed May 15 15:49:29 2019
(r347616)
+++ head/lib/libc/stdlib/bsearch.3  Wed May 15 15:54:27 2019
(r347617)
@@ -32,7 +32,7 @@
 .\" @(#)bsearch.3  8.3 (Berkeley) 4/19/94
 .\" $FreeBSD$
 .\"
-.Dd February 22, 2013
+.Dd May 15, 2019
 .Dt BSEARCH 3
 .Os
 .Sh NAME
@@ -83,6 +83,61 @@ The
 function returns a pointer to a matching member of the array, or a null
 pointer if no match is found.
 If two members compare as equal, which member is matched is unspecified.
+.Sh EXAMPLES
+A sample program that searches people by age in a sorted array:
+.Bd -literal
+#include 
+#include 
+#include 
+#include 
+#include 
+
+struct person {
+   char name[5];
+   int age;
+};
+
+int
+compare(const void *key, const void *array_member)
+{
+   int age = (intptr_t) key;
+   struct person person = *(struct person *) array_member;
+
+   return (age - person.age);
+}
+
+int
+main()
+{
+   struct person *friend;
+
+   /* Sorted array */
+   struct person friends[6] = {
+   { "paul", 22 },
+   { "anne", 25 },
+   { "fred", 25 },
+   { "mary", 27 },
+   { "mark", 35 },
+   { "bill", 50 }
+   };
+
+   size_t array_size = sizeof(friends) / sizeof(struct person);
+
+   friend = bsearch((void *)22, &friends, array_size, sizeof(struct 
person), compare);
+   assert(strcmp(friend->name, "paul") == 0);
+   printf("name: %s\enage: %d\en", friend->name, friend->age);
+
+   friend = bsearch((void *)25, &friends, array_size, sizeof(struct 
person), compare);
+   assert(strcmp(friend->name, "fred") == 0 || strcmp(friend->name, 
"anne") == 0);
+   printf("name: %s\enage: %d\en", friend->name, friend->age);
+
+   friend = bsearch((void *)30, &friends, array_size, sizeof(struct 
person), compare);
+   assert(friend == NULL);
+   printf("friend aged 30 not found\en");
+
+   return (EXIT_SUCCESS);
+}
+.Ed
 .Sh SEE ALSO
 .Xr db 3 ,
 .Xr lsearch 3 ,
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r347618 - head/sys/mips/atheros

2019-05-15 Thread Adrian Chadd
Author: adrian
Date: Wed May 15 16:51:08 2019
New Revision: 347618
URL: https://svnweb.freebsd.org/changeset/base/347618

Log:
  [ar71xx_gpio] Add AR9341/AR9342 to the list of chips for programming 
function/output enable.
  
  This is reqired to use the gpiofunc behaviour for configuring GPIO
  pins at boot time.
  
  Submitted by: 
  Differential Revision:https://reviews.freebsd.org/D20170

Modified:
  head/sys/mips/atheros/ar71xx_gpio.c

Modified: head/sys/mips/atheros/ar71xx_gpio.c
==
--- head/sys/mips/atheros/ar71xx_gpio.c Wed May 15 15:54:27 2019
(r347617)
+++ head/sys/mips/atheros/ar71xx_gpio.c Wed May 15 16:51:08 2019
(r347618)
@@ -151,6 +151,8 @@ static int
 ar71xx_gpio_oe_is_high(void)
 {
switch (ar71xx_soc) {
+   case AR71XX_SOC_AR9341:
+   case AR71XX_SOC_AR9342:
case AR71XX_SOC_AR9344:
case AR71XX_SOC_QCA9533:
case AR71XX_SOC_QCA9533_V2:
@@ -559,7 +561,7 @@ ar71xx_gpio_attach(device_t dev)
&gpiomode) != 0)
continue;
 
-   /* We only handle mode=1 for now */
+   /* We only handle mode=1 (output) for now */
if (gpiomode != 1)
continue;
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r347619 - head/sys/compat/linuxkpi/common/include/linux

2019-05-15 Thread Johannes Lundberg
Author: johalun
Date: Wed May 15 16:59:04 2019
New Revision: 347619
URL: https://svnweb.freebsd.org/changeset/base/347619

Log:
  LinuxKPI: Expand ktime functionality.
  
  Also, make ktime_get_raw call getnanouptime instead of getnanotime
  to match (the correct) ktime_get_raw_ns.
  This patch is part of D19565
  
  Reviewed by:  hps
  Approved by:  imp (mentor), hps
  MFC after:1 week

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

Modified: head/sys/compat/linuxkpi/common/include/linux/ktime.h
==
--- head/sys/compat/linuxkpi/common/include/linux/ktime.h   Wed May 15 
16:51:08 2019(r347618)
+++ head/sys/compat/linuxkpi/common/include/linux/ktime.h   Wed May 15 
16:59:04 2019(r347619)
@@ -35,8 +35,6 @@
 #include 
 #include 
 
-#definektime_get_ts(x) getnanouptime(x)
-
 /* time values in nanoseconds */
 typedef s64 ktime_t;
 
@@ -93,6 +91,13 @@ ktime_add_ms(ktime_t kt, int64_t ms)
 }
 
 static inline ktime_t
+ktime_add_us(ktime_t kt, int64_t us)
+{
+
+   return (ktime_add_ns(kt, us * NSEC_PER_USEC));
+}
+
+static inline ktime_t
 ktime_sub_ns(ktime_t kt, int64_t ns)
 {
return (kt - ns);
@@ -172,11 +177,20 @@ timeval_to_ktime(struct timeval tv)
return (ktime_set(tv.tv_sec, tv.tv_usec * NSEC_PER_USEC));
 }
 
+static inline int64_t
+timespec64_to_ns(struct timespec64 *ts)
+{
+   return (timespec_to_ns(ts));
+}
+
 #definektime_to_timespec(kt)   ns_to_timespec(kt)
 #definektime_to_timespec64(kt) ns_to_timespec(kt)
 #definektime_to_timeval(kt)ns_to_timeval(kt)
 #definektime_to_ns(kt) (kt)
-#definektime_get_ts64(ts)  ktime_get_ts(ts)
+#definektime_get_ts(ts)getnanouptime(ts)
+#definektime_get_ts64(ts)  getnanouptime(ts)
+#definektime_get_raw_ts64(ts)  getnanouptime(ts)
+#definegetrawmonotonic64(ts)   getnanouptime(ts)
 
 static inline int64_t
 ktime_get_ns(void)
@@ -229,7 +243,7 @@ ktime_get_raw(void)
 {
struct timespec ts;
 
-   nanotime(&ts);
+   nanouptime(&ts);
return (timespec_to_ktime(ts));
 }
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r347620 - head/sys/compat/linuxkpi/common/include/asm

2019-05-15 Thread Johannes Lundberg
Author: johalun
Date: Wed May 15 17:04:12 2019
New Revision: 347620
URL: https://svnweb.freebsd.org/changeset/base/347620

Log:
  LinuxKPI: Update user_access_begin for Linux v5.0.
  
  Check the new LINUXKPI_VERSION macro for backwards compatibility.
  This patch is part of D19565
  
  Reviewed by:  hps
  Approved by:  imp (mentor), hps
  MFC after:1 week

Modified:
  head/sys/compat/linuxkpi/common/include/asm/uaccess.h

Modified: head/sys/compat/linuxkpi/common/include/asm/uaccess.h
==
--- head/sys/compat/linuxkpi/common/include/asm/uaccess.h   Wed May 15 
16:59:04 2019(r347619)
+++ head/sys/compat/linuxkpi/common/include/asm/uaccess.h   Wed May 15 
17:04:12 2019(r347620)
@@ -52,7 +52,11 @@ copy_from_user(void *to, const void *from, unsigned lo
 #define__copy_from_user(...)   copy_from_user(__VA_ARGS__)
 #define__copy_in_user(...) copy_from_user(__VA_ARGS__)
 
+#if defined(LINUXKPI_VERSION) && LINUXKPI_VERSION >= 5
+#defineuser_access_begin(ptr, len) access_ok(ptr, len)
+#else
 #defineuser_access_begin() do { } while (0)
+#endif
 #defineuser_access_end() do { } while (0)
 
 #defineunsafe_get_user(x, ptr, err) do { \
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r347621 - head/sys/compat/linuxkpi/common/include/linux

2019-05-15 Thread Johannes Lundberg
Author: johalun
Date: Wed May 15 17:32:00 2019
New Revision: 347621
URL: https://svnweb.freebsd.org/changeset/base/347621

Log:
  LinuxKPI: Add get_random_u32 function.
  
  This patch is part of D19565
  
  Reviewed by:  hps
  Approved by:  imp (mentor), hps
  MFC after:1 week

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

Modified: head/sys/compat/linuxkpi/common/include/linux/random.h
==
--- head/sys/compat/linuxkpi/common/include/linux/random.h  Wed May 15 
17:04:12 2019(r347620)
+++ head/sys/compat/linuxkpi/common/include/linux/random.h  Wed May 15 
17:32:00 2019(r347621)
@@ -35,6 +35,8 @@
 #include 
 #include 
 
+#defineget_random_u32() get_random_int()
+
 static inline void
 get_random_bytes(void *buf, int nbytes)
 {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r347622 - head/sys/compat/linuxkpi/common/include/linux

2019-05-15 Thread Johannes Lundberg
Author: johalun
Date: Wed May 15 17:44:25 2019
New Revision: 347622
URL: https://svnweb.freebsd.org/changeset/base/347622

Log:
  LinuxKPI: Include asm/atomic-long.h from atomic.h.
  
  This patch is part of D19565
  
  Reviewed by:  hps
  Approved by:  imp (mentor), hps
  MFC after:1 week

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

Modified: head/sys/compat/linuxkpi/common/include/linux/atomic.h
==
--- head/sys/compat/linuxkpi/common/include/linux/atomic.h  Wed May 15 
17:32:00 2019(r347621)
+++ head/sys/compat/linuxkpi/common/include/linux/atomic.h  Wed May 15 
17:44:25 2019(r347622)
@@ -31,5 +31,6 @@
 
 #include 
 #include 
+#include 
 
 #endif /* _LINUX_ATOMIC_H_ */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r347623 - head/sys/compat/linuxkpi/common/include/linux

2019-05-15 Thread Johannes Lundberg
Author: johalun
Date: Wed May 15 17:48:11 2019
New Revision: 347623
URL: https://svnweb.freebsd.org/changeset/base/347623

Log:
  LinuxKPI: Move {lower|upper}_32_bits macros from port to base.
  
  This patch is part of D19565
  
  Reviewed by:  hps
  Approved by:  imp (mentor), hps
  MFC after:1 week

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

Modified: head/sys/compat/linuxkpi/common/include/linux/compiler.h
==
--- head/sys/compat/linuxkpi/common/include/linux/compiler.hWed May 15 
17:44:25 2019(r347622)
+++ head/sys/compat/linuxkpi/common/include/linux/compiler.hWed May 15 
17:48:11 2019(r347623)
@@ -81,6 +81,12 @@
 
 #definebarrier()   __asm__ __volatile__("": : 
:"memory")
 
+#if defined(LINUXKPI_VERSION) && LINUXKPI_VERSION >= 5
+/* Moved from drm_os_freebsd.h */
+#definelower_32_bits(n)((u32)(n))
+#defineupper_32_bits(n)((u32)(((n) >> 16) >> 16))
+#endif
+
 #define___PASTE(a,b) a##b
 #define__PASTE(a,b) ___PASTE(a,b)
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r347625 - head/sys/x86/x86

2019-05-15 Thread Konstantin Belousov
Author: kib
Date: Wed May 15 17:55:41 2019
New Revision: 347625
URL: https://svnweb.freebsd.org/changeset/base/347625

Log:
  Properly announce MD_CLEAR.
  
  Submitted by: Petr Lampa 
  MFC after:3 days

Modified:
  head/sys/x86/x86/identcpu.c

Modified: head/sys/x86/x86/identcpu.c
==
--- head/sys/x86/x86/identcpu.c Wed May 15 17:50:17 2019(r347624)
+++ head/sys/x86/x86/identcpu.c Wed May 15 17:55:41 2019(r347625)
@@ -995,6 +995,7 @@ printcpuinfo(void)
printf("\n  Structured Extended Features3=0x%b",
cpu_stdext_feature3,
   "\020"
+  "\013MD_CLEAR"
   "\016TSXFA"
   "\033IBPB"
   "\034STIBP"
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r347626 - head/sys/compat/linuxkpi/common/include/linux

2019-05-15 Thread Johannes Lundberg
Author: johalun
Date: Wed May 15 17:57:06 2019
New Revision: 347626
URL: https://svnweb.freebsd.org/changeset/base/347626

Log:
  LinuxKPI: Add helper macros IS_ALIGNED and DIV_ROUND_DOWN_ULL.
  
  This patch is part of D19565
  
  Reviewed by:  hps
  Approved by:  imp (mentor), hps
  MFC after:1 week

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

Modified: head/sys/compat/linuxkpi/common/include/linux/kernel.h
==
--- head/sys/compat/linuxkpi/common/include/linux/kernel.h  Wed May 15 
17:55:41 2019(r347625)
+++ head/sys/compat/linuxkpi/common/include/linux/kernel.h  Wed May 15 
17:57:06 2019(r347626)
@@ -130,9 +130,14 @@
 #defineALIGN(x, y) roundup2((x), (y))
 #undef PTR_ALIGN
 #definePTR_ALIGN(p, a) ((__typeof(p))ALIGN((uintptr_t)(p), 
(a)))
+#if defined(LINUXKPI_VERSION) && LINUXKPI_VERSION >= 5
+/* Moved from linuxkpi_gplv2 */
+#defineIS_ALIGNED(x, a)(((x) & ((__typeof(x))(a) - 1)) == 0)
+#endif
 #defineDIV_ROUND_UP(x, n)  howmany(x, n)
 #define__KERNEL_DIV_ROUND_UP(x, n) howmany(x, n)
 #defineDIV_ROUND_UP_ULL(x, n)  DIV_ROUND_UP((unsigned long long)(x), 
(n))
+#defineDIV_ROUND_DOWN_ULL(x, n) (((unsigned long long)(x) / (n)) * (n))
 #defineFIELD_SIZEOF(t, f)  sizeof(((t *)0)->f)
 
 #defineprintk(...) printf(__VA_ARGS__)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r347566 - in head/sys: amd64/amd64 amd64/include dev/cpuctl i386/i386 i386/include x86/include x86/x86

2019-05-15 Thread Dmitry Chagin
ср, 15 мая 2019 г. в 11:10, Konstantin Belousov :

> On Wed, May 15, 2019 at 08:54:04AM +0300, Dmitry Chagin wrote:
> > вт, 14 мая 2019 г. в 20:02, Konstantin Belousov :
> >
> > > Author: kib
> > > Date: Tue May 14 17:02:20 2019
> > > New Revision: 347566
> > > URL: https://svnweb.freebsd.org/changeset/base/347566
> > >
> > > Log:
> > >   Mitigations for Microarchitectural Data Sampling.
> > >
> > >   Microarchitectural buffers on some Intel processors utilizing
> > >   speculative execution may allow a local process to obtain a memory
> > >   disclosure.  An attacker may be able to read secret data from the
> > >   kernel or from a process when executing untrusted code (for example,
> > >   in a web browser).
> > >
> > >   Reference:
> > >
> https://www.intel.com/content/www/us/en/security-center/advisory/intel-sa-00233.html
> > >   Security: CVE-2018-12126, CVE-2018-12127, CVE-2018-12130,
> > > CVE-2019-11091
> > >   Security: FreeBSD-SA-19:07.mds
> > >   Reviewed by:  jhb
> > >   Tested by:emaste, lwhsu
> > >   Approved by:  so (gtetlow)
> > >
> > > Modified:
> > >   head/sys/amd64/amd64/exception.S
> > >   head/sys/amd64/amd64/genassym.c
> > >   head/sys/amd64/amd64/initcpu.c
> > >   head/sys/amd64/amd64/machdep.c
> > >   head/sys/amd64/amd64/support.S
> > >
> >
> >
> >
> > Hi, Kostik!
> >
> > cc -target x86_64-unknown-freebsd13.0
> > --sysroot=/home/dchagin/obj/home/dchagin/head/amd64.amd64/tmp
> > -B/home/dchagin/obj/home/dchagin/head/amd64.amd64/tmp/usr/bin -c -x
> > assembler-with-cpp -DLOCORE -O2 -pipe -fno-strict-aliasing  -g -nostdinc
> > -I. -I/home/dchagin/head/sys -I/home/dchagin/head/sys/contrib/ck/include
> > -I/home/dchagin/head/sys/contrib/libfdt -D_KERNEL
> > -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h
> > -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -MD
> > -MF.depend.support.o -MTsupport.o
> > -fdebug-prefix-map=./machine=/home/dchagin/head/sys/amd64/include
> > -fdebug-prefix-map=./x86=/home/dchagin/head/sys/x86/include
> -mcmodel=kernel
> > -mno-red-zone -mno-mmx -mno-sse -msoft-float
> > -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector
> > -gdwarf-2 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes
> > -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef
> -Wno-pointer-sign
> > -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs
> > -fdiagnostics-show-option -Wno-unknown-pragmas
> > -Wno-error-tautological-compare -Wno-error-empty-body
> > -Wno-error-parentheses-equality -Wno-error-unused-function
> > -Wno-error-pointer-sign -Wno-error-shift-negative-value
> > -Wno-address-of-packed-member  -mno-aes -mno-avx  -std=iso9899:1999
> > -Werror /home/dchagin/head/sys/amd64/amd64/support.S
> > /home/dchagin/head/sys/amd64/amd64/support.S:1809:2: error: instruction
> > requires: AVX-512 ISA
> >  vmovdqa64 %zmm0, %gs:0x340
> >  ^
> > /home/dchagin/head/sys/amd64/amd64/support.S:1810:2: error: instruction
> > requires: AVX-512 ISA
> >  vpxor %zmm0, %zmm0, %zmm0
> >  ^
> > /home/dchagin/head/sys/amd64/amd64/support.S:1813:2: error: instruction
> > requires: AVX-512 DQ ISA
> >  vorpd (%rdx), %zmm0, %zmm0
> >  ^
> > /home/dchagin/head/sys/amd64/amd64/support.S:1814:2: error: instruction
> > requires: AVX-512 DQ ISA
> >  vorpd (%rdx), %zmm0, %zmm0
> >  ^
> > /home/dchagin/head/sys/amd64/amd64/support.S:1826:2: error: instruction
> > requires: AVX-512 ISA
> >  vmovdqa64 %gs:0x340, %zmm0
> >  ^
> > *** Error code 1
> >
> >
> > I/m missied something?
> Yes, you are using older compiler than current.  Perhaps you are using
> clang 6.0 still.  Update your world.
>
> FWIW, this is is reason why the sw sequences use .byte in 11.2/12.0
> patches. I do not want to put such abomination into live code base,
> remembering aesni.ko.
>

yes, you are right. thank you! but in the best tradition of the project,
the system does not built,
I got ar error when building static llvm library:
ar: fatal: Symbol table offset overflow
*** Error code 70

Stop.
make[6]: stopped in /home/dchagin/head/lib/clang/libllvm
*** Error code 1
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r347566 - in head/sys: amd64/amd64 amd64/include dev/cpuctl i386/i386 i386/include x86/include x86/x86

2019-05-15 Thread Konstantin Belousov
On Wed, May 15, 2019 at 08:31:23PM +0300, Dmitry Chagin wrote:
> ср, 15 мая 2019 г. в 11:10, Konstantin Belousov :
> 
> > On Wed, May 15, 2019 at 08:54:04AM +0300, Dmitry Chagin wrote:
> > > вт, 14 мая 2019 г. в 20:02, Konstantin Belousov :
> > >
> > > > Author: kib
> > > > Date: Tue May 14 17:02:20 2019
> > > > New Revision: 347566
> > > > URL: https://svnweb.freebsd.org/changeset/base/347566
> > > >
> > > > Log:
> > > >   Mitigations for Microarchitectural Data Sampling.
> > > >
> > > >   Microarchitectural buffers on some Intel processors utilizing
> > > >   speculative execution may allow a local process to obtain a memory
> > > >   disclosure.  An attacker may be able to read secret data from the
> > > >   kernel or from a process when executing untrusted code (for example,
> > > >   in a web browser).
> > > >
> > > >   Reference:
> > > >
> > https://www.intel.com/content/www/us/en/security-center/advisory/intel-sa-00233.html
> > > >   Security: CVE-2018-12126, CVE-2018-12127, CVE-2018-12130,
> > > > CVE-2019-11091
> > > >   Security: FreeBSD-SA-19:07.mds
> > > >   Reviewed by:  jhb
> > > >   Tested by:emaste, lwhsu
> > > >   Approved by:  so (gtetlow)
> > > >
> > > > Modified:
> > > >   head/sys/amd64/amd64/exception.S
> > > >   head/sys/amd64/amd64/genassym.c
> > > >   head/sys/amd64/amd64/initcpu.c
> > > >   head/sys/amd64/amd64/machdep.c
> > > >   head/sys/amd64/amd64/support.S
> > > >
> > >
> > >
> > >
> > > Hi, Kostik!
> > >
> > > cc -target x86_64-unknown-freebsd13.0
> > > --sysroot=/home/dchagin/obj/home/dchagin/head/amd64.amd64/tmp
> > > -B/home/dchagin/obj/home/dchagin/head/amd64.amd64/tmp/usr/bin -c -x
> > > assembler-with-cpp -DLOCORE -O2 -pipe -fno-strict-aliasing  -g -nostdinc
> > > -I. -I/home/dchagin/head/sys -I/home/dchagin/head/sys/contrib/ck/include
> > > -I/home/dchagin/head/sys/contrib/libfdt -D_KERNEL
> > > -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h
> > > -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -MD
> > > -MF.depend.support.o -MTsupport.o
> > > -fdebug-prefix-map=./machine=/home/dchagin/head/sys/amd64/include
> > > -fdebug-prefix-map=./x86=/home/dchagin/head/sys/x86/include
> > -mcmodel=kernel
> > > -mno-red-zone -mno-mmx -mno-sse -msoft-float
> > > -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector
> > > -gdwarf-2 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes
> > > -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef
> > -Wno-pointer-sign
> > > -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs
> > > -fdiagnostics-show-option -Wno-unknown-pragmas
> > > -Wno-error-tautological-compare -Wno-error-empty-body
> > > -Wno-error-parentheses-equality -Wno-error-unused-function
> > > -Wno-error-pointer-sign -Wno-error-shift-negative-value
> > > -Wno-address-of-packed-member  -mno-aes -mno-avx  -std=iso9899:1999
> > > -Werror /home/dchagin/head/sys/amd64/amd64/support.S
> > > /home/dchagin/head/sys/amd64/amd64/support.S:1809:2: error: instruction
> > > requires: AVX-512 ISA
> > >  vmovdqa64 %zmm0, %gs:0x340
> > >  ^
> > > /home/dchagin/head/sys/amd64/amd64/support.S:1810:2: error: instruction
> > > requires: AVX-512 ISA
> > >  vpxor %zmm0, %zmm0, %zmm0
> > >  ^
> > > /home/dchagin/head/sys/amd64/amd64/support.S:1813:2: error: instruction
> > > requires: AVX-512 DQ ISA
> > >  vorpd (%rdx), %zmm0, %zmm0
> > >  ^
> > > /home/dchagin/head/sys/amd64/amd64/support.S:1814:2: error: instruction
> > > requires: AVX-512 DQ ISA
> > >  vorpd (%rdx), %zmm0, %zmm0
> > >  ^
> > > /home/dchagin/head/sys/amd64/amd64/support.S:1826:2: error: instruction
> > > requires: AVX-512 ISA
> > >  vmovdqa64 %gs:0x340, %zmm0
> > >  ^
> > > *** Error code 1
> > >
> > >
> > > I/m missied something?
> > Yes, you are using older compiler than current.  Perhaps you are using
> > clang 6.0 still.  Update your world.
> >
> > FWIW, this is is reason why the sw sequences use .byte in 11.2/12.0
> > patches. I do not want to put such abomination into live code base,
> > remembering aesni.ko.
> >
> 
> yes, you are right. thank you! but in the best tradition of the project,
> the system does not built,
> I got ar error when building static llvm library:
> ar: fatal: Symbol table offset overflow
> *** Error code 70
> 
> Stop.
> make[6]: stopped in /home/dchagin/head/lib/clang/libllvm
> *** Error code 1
Perhaps try to manually compile usr.bin/ar from the new source and install
it before doing buildworld.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r347628 - in head/sys: amd64/amd64 i386/i386

2019-05-15 Thread Ryan Libby
Author: rlibby
Date: Wed May 15 18:13:43 2019
New Revision: 347628
URL: https://svnweb.freebsd.org/changeset/base/347628

Log:
  x86: spell vpxor %zmm0 as vpxord
  
  Fix gcc/gas amd64 & i386 build after r347566.
  
  Reviewed by:  kib
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D20264

Modified:
  head/sys/amd64/amd64/support.S
  head/sys/i386/i386/support.s

Modified: head/sys/amd64/amd64/support.S
==
--- head/sys/amd64/amd64/support.S  Wed May 15 17:58:08 2019
(r347627)
+++ head/sys/amd64/amd64/support.S  Wed May 15 18:13:43 2019
(r347628)
@@ -1807,7 +1807,7 @@ ENTRY(mds_handler_skl_avx512)
 1: movqPCPU(MDS_BUF), %rdi
movqPCPU(MDS_BUF64), %rdx
vmovdqa64   %zmm0, PCPU(MDS_TMP)
-   vpxor   %zmm0, %zmm0, %zmm0
+   vpxord  %zmm0, %zmm0, %zmm0
 
lfence
vorpd   (%rdx), %zmm0, %zmm0

Modified: head/sys/i386/i386/support.s
==
--- head/sys/i386/i386/support.sWed May 15 17:58:08 2019
(r347627)
+++ head/sys/i386/i386/support.sWed May 15 18:13:43 2019
(r347628)
@@ -611,7 +611,7 @@ ENTRY(mds_handler_skl_avx512)
 1: movlPCPU(MDS_BUF), %edi
movlPCPU(MDS_BUF64), %edx
vmovdqa64   %zmm0, PCPU(MDS_TMP)
-   vpxor   %zmm0, %zmm0, %zmm0
+   vpxord  %zmm0, %zmm0, %zmm0
 
lfence
vorpd   (%edx), %zmm0, %zmm0
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r347566 - in head/sys: amd64/amd64 amd64/include dev/cpuctl i386/i386 i386/include x86/include x86/x86

2019-05-15 Thread Rick Macklem
Konstantin Belousov wrote:
[lots of stuff snipped]
>On Wed, May 15, 2019 at 08:31:23PM +0300, Dmitry Chagin wrote:
>>
>> yes, you are right. thank you! but in the best tradition of the project,
>> the system does not built,
>> I got ar error when building static llvm library:
>> ar: fatal: Symbol table offset overflow
>> *** Error code 70
errno 70 is ESTALE, which is an NFS error indicating that the file was deleted
on the NFS server.
If you are using an NFS mount, I'd suggest trying it on a local disk.
(NFS isn't a POSIX compliant file system and never will be, given the protocol
 specification. You can usually get away with builds on NFS, but...)

If you aren't using a NFS mount, then I have no idea why an ESTALE would happen?

>>
>> Stop.
>> make[6]: stopped in /home/dchagin/head/lib/clang/libllvm
>> *** Error code 1
>Perhaps try to manually compile usr.bin/ar from the new source and install
>it before doing buildworld.

Good luck with it, rick
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r347638 - in head: . etc lib/libc/gen

2019-05-15 Thread Brad Davis
Author: brd
Date: Thu May 16 01:09:13 2019
New Revision: 347638
URL: https://svnweb.freebsd.org/changeset/base/347638

Log:
  Move master.passwd and group to lib/libc/gen/
  
  libc was picked as the destination location for these because of the syscalls
  that use these files as the lowest level place they are referenced.
  
  Approved by:  will (mentor), rgrimes, manu
  Differential Revision:https://reviews.freebsd.org/D16728

Added:
  head/lib/libc/gen/group
 - copied unchanged from r347637, head/etc/group
  head/lib/libc/gen/master.passwd
 - copied unchanged from r347637, head/etc/master.passwd
Deleted:
  head/etc/group
  head/etc/master.passwd
Modified:
  head/Makefile.inc1
  head/etc/Makefile
  head/lib/libc/gen/Makefile.inc

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Thu May 16 00:53:54 2019(r347637)
+++ head/Makefile.inc1  Thu May 16 01:09:13 2019(r347638)
@@ -871,8 +871,8 @@ DB_FROM_SRC=yes
 .endif
 
 .if defined(DB_FROM_SRC)
-INSTALLFLAGS+= -N ${.CURDIR}/etc
-MTREEFLAGS+=   -N ${.CURDIR}/etc
+INSTALLFLAGS+= -N ${.CURDIR}/lib/libc/gen
+MTREEFLAGS+=   -N ${.CURDIR}/lib/libc/gen
 .endif
 _INSTALL_DDIR= ${DESTDIR}/${DISTDIR}
 INSTALL_DDIR=  ${_INSTALL_DDIR:S://:/:g:C:/$::}

Modified: head/etc/Makefile
==
--- head/etc/Makefile   Thu May 16 00:53:54 2019(r347637)
+++ head/etc/Makefile   Thu May 16 01:09:13 2019(r347638)
@@ -15,7 +15,6 @@ SUBDIR+=sendmail
 .endif
 
 BIN1=  \
-   group \
login.access \
rc.bsdextended \
rc.firewall \
@@ -65,21 +64,7 @@ distribution:
 .endif
cd ${.CURDIR}; \
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
-   ${BIN1} ${DESTDIR}/etc; \
-   ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
-   master.passwd ${DESTDIR}/etc;
-
-.if ${MK_TCSH} == "no"
-   sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
-.endif
-   pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd
-.if defined(NO_ROOT)
-   ( \
-   echo "./etc/passwd type=file mode=0644 uname=root gname=wheel"; 
\
-   echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel"; 
\
-   echo "./etc/spwd.db type=file mode=0600 uname=root 
gname=wheel"; \
-   ) | ${METALOG.add}
-.endif
+   ${BIN1} ${DESTDIR}/etc
${_+_}cd ${.CURDIR}/gss; ${MAKE} install
${_+_}cd ${.CURDIR}/mtree; ${MAKE} install
${_+_}cd ${SRCTOP}/share/termcap; ${MAKE} etc-termcap

Modified: head/lib/libc/gen/Makefile.inc
==
--- head/lib/libc/gen/Makefile.inc  Thu May 16 00:53:54 2019
(r347637)
+++ head/lib/libc/gen/Makefile.inc  Thu May 16 01:09:13 2019
(r347638)
@@ -4,7 +4,8 @@
 # machine-independent gen sources
 .PATH: ${LIBC_SRCTOP}/${LIBC_ARCH}/gen ${LIBC_SRCTOP}/gen
 
-CONFS= shells
+CONFS+=group master.passwd shells
+CONFSMODE_master.passwd=   600
 
 SRCS+= __getosreldate.c \
__pthread_mutex_init_calloc_cb_stub.c \
@@ -543,3 +544,16 @@ MLINKS+=vis.3 nvis.3 \
vis.3 svis.3
 
 MLINKS+=wordexp.3 wordfree.3
+
+afterinstallconfig:
+.if ${MK_TCSH} == "no"
+   sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
+.endif
+   pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd
+.if defined(NO_ROOT) && defined(METALOG)
+   ( \
+   echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel"; 
\
+   echo "./etc/spwd.db type=file mode=0600 uname=root 
gname=wheel"; \
+   echo "./etc/passwd type=file mode=0644 uname=root gname=wheel"; 
\
+   ) | cat -l >> ${METALOG}
+.endif

Copied: head/lib/libc/gen/group (from r347637, head/etc/group)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/libc/gen/group Thu May 16 01:09:13 2019(r347638, copy 
of r347637, head/etc/group)
@@ -0,0 +1,36 @@
+# $FreeBSD$
+#
+wheel:*:0:root
+daemon:*:1:
+kmem:*:2:
+sys:*:3:
+tty:*:4:
+operator:*:5:root
+mail:*:6:
+bin:*:7:
+news:*:8:
+man:*:9:
+games:*:13:
+ftp:*:14:
+staff:*:20:
+sshd:*:22:
+smmsp:*:25:
+mailnull:*:26:
+guest:*:31:
+video:*:44:
+bind:*:53:
+unbound:*:59:
+proxy:*:62:
+authpf:*:63:
+_pflogd:*:64:
+_dhcp:*:65:
+uucp:*:66:
+dialer:*:68:
+network:*:69:
+audit:*:77:
+www:*:80:
+ntpd:*:123:
+_ypldap:*:160:
+hast:*:845:
+nogroup:*:65533:
+nobody:*:65534:

Copied: head/lib/libc/gen/master.passwd (from r347637, head/etc/master.passwd)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/libc/gen/master.passwd Thu May 16 01:09:13 2019
(r347638, cop

svn commit: r347639 - head/sys/x86/x86

2019-05-15 Thread Conrad Meyer
Author: cem
Date: Thu May 16 01:32:54 2019
New Revision: 347639
URL: https://svnweb.freebsd.org/changeset/base/347639

Log:
  x86: Correctly identify bhyve hypervisor
  
  Spotted after a similar report by Olivier Cochard-Labbé.
  
  Sponsored by: Dell EMC Isilon

Modified:
  head/sys/x86/x86/identcpu.c

Modified: head/sys/x86/x86/identcpu.c
==
--- head/sys/x86/x86/identcpu.c Thu May 16 01:09:13 2019(r347638)
+++ head/sys/x86/x86/identcpu.c Thu May 16 01:32:54 2019(r347639)
@@ -1365,7 +1365,7 @@ identify_hypervisor(void)
vm_guest = VM_GUEST_HV;
else if (strcmp(hv_vendor, "KVMKVMKVM") == 0)
vm_guest = VM_GUEST_KVM;
-   else if (strcmp(hv_vendor, "bhyve bhyve") == 0)
+   else if (strcmp(hv_vendor, "bhyve bhyve ") == 0)
vm_guest = VM_GUEST_BHYVE;
}
return;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r347640 - head/lib/libbe

2019-05-15 Thread Kyle Evans
Author: kevans
Date: Thu May 16 02:11:33 2019
New Revision: 347640
URL: https://svnweb.freebsd.org/changeset/base/347640

Log:
  libbe(3): Descend into children of datasets w/ mountpoint=none
  
  These datasets will generally be canmount=noauto,mountpoint=none (e.g.
  zroot/var) but have children that may need to be mounted. Instead of
  skipping that segment for no good reason, descend.
  
  Submitted by: Wes Maag
  Reported by:  Wes Maag
  MFC after:3 days

Modified:
  head/lib/libbe/be_access.c

Modified: head/lib/libbe/be_access.c
==
--- head/lib/libbe/be_access.c  Thu May 16 01:32:54 2019(r347639)
+++ head/lib/libbe/be_access.c  Thu May 16 02:11:33 2019(r347640)
@@ -99,13 +99,12 @@ be_mount_iter(zfs_handle_t *zfs_hdl, void *data)
if (strcmp("none", zfs_mnt) == 0) {
/*
 * mountpoint=none; we'll mount it at info->mountpoint assuming
-* we're at the root.  If we're not at the root... that's less
-* than stellar and not entirely sure what to do with that.
-* For now, we won't treat it as an error condition -- we just
-* won't mount it, and we'll continue on.
+* we're at the root.  If we're not at the root, we're likely
+* at some intermediate dataset (e.g. zroot/var) that will have
+* children that may need to be mounted.
 */
if (info->depth > 0)
-   return (0);
+   goto skipmount;
 
snprintf(tmp, BE_MAXPATHLEN, "%s", info->mountpoint);
} else {
@@ -136,6 +135,7 @@ be_mount_iter(zfs_handle_t *zfs_hdl, void *data)
if (!info->deepmount)
return (0);
 
+skipmount:
++info->depth;
err = zfs_iter_filesystems(zfs_hdl, be_mount_iter, info);
--info->depth;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r347641 - head/tests/sys/netipsec/tunnel

2019-05-15 Thread Kristof Provost
Author: kp
Date: Thu May 16 02:18:57 2019
New Revision: 347641
URL: https://svnweb.freebsd.org/changeset/base/347641

Log:
  ipsec tests: Skip if ipsec.ko is not loaded
  
  As of r347410 IPSec is no longer built into GENERIC. The ipsec.ko module must
  be loaded before we can execute the IPSec tests.
  
  Check this, and skip the tests if IPSec is not available.

Modified:
  head/tests/sys/netipsec/tunnel/utils.subr

Modified: head/tests/sys/netipsec/tunnel/utils.subr
==
--- head/tests/sys/netipsec/tunnel/utils.subr   Thu May 16 02:11:33 2019
(r347640)
+++ head/tests/sys/netipsec/tunnel/utils.subr   Thu May 16 02:18:57 2019
(r347641)
@@ -8,6 +8,10 @@
 
 ist_init()
 {
+   if ! sysctl -q kern.features.ipsec >/dev/null ; then
+   atf_skip "This test requires ipsec"
+   fi
+
vnet_init
 }
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r347642 - head/contrib/wpa/wpa_supplicant

2019-05-15 Thread Cy Schubert
Author: cy
Date: Thu May 16 02:41:25 2019
New Revision: 347642
URL: https://svnweb.freebsd.org/changeset/base/347642

Log:
  The driver list prints "(null)" for the NDIS driver when -h (help) or
  an unknown switch is passed outputting the command usage. This is
  because the NDIS driver is uninitialized when usage help is printed.
  To resolve this we initialize the driver prior to the possibility of
  printing the usage help message.
  
  Obtained from:The wpa_supplicant port
  MFC after:1 week

Modified:
  head/contrib/wpa/wpa_supplicant/main.c
  head/contrib/wpa/wpa_supplicant/wpa_supplicant.c

Modified: head/contrib/wpa/wpa_supplicant/main.c
==
--- head/contrib/wpa/wpa_supplicant/main.c  Thu May 16 02:18:57 2019
(r347641)
+++ head/contrib/wpa/wpa_supplicant/main.c  Thu May 16 02:41:25 2019
(r347642)
@@ -199,6 +199,11 @@ int main(int argc, char *argv[])
 
wpa_supplicant_fd_workaround(1);
 
+#ifdef CONFIG_DRIVER_NDIS
+   void driver_ndis_init_ops(void);
+   driver_ndis_init_ops();
+#endif /* CONFIG_DRIVER_NDIS */
+
for (;;) {
c = getopt(argc, argv,
   "b:Bc:C:D:de:f:g:G:hi:I:KLMm:No:O:p:P:qsTtuvW");

Modified: head/contrib/wpa/wpa_supplicant/wpa_supplicant.c
==
--- head/contrib/wpa/wpa_supplicant/wpa_supplicant.cThu May 16 02:18:57 
2019(r347641)
+++ head/contrib/wpa/wpa_supplicant/wpa_supplicant.cThu May 16 02:41:25 
2019(r347642)
@@ -6357,13 +6357,6 @@ struct wpa_global * wpa_supplicant_init(struct wpa_par
if (params == NULL)
return NULL;
 
-#ifdef CONFIG_DRIVER_NDIS
-   {
-   void driver_ndis_init_ops(void);
-   driver_ndis_init_ops();
-   }
-#endif /* CONFIG_DRIVER_NDIS */
-
 #ifndef CONFIG_NO_WPA_MSG
wpa_msg_register_ifname_cb(wpa_supplicant_msg_ifname_cb);
 #endif /* CONFIG_NO_WPA_MSG */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r347645 - head/sys/x86/iommu

2019-05-15 Thread Ryan Libby
Author: rlibby
Date: Thu May 16 04:24:08 2019
New Revision: 347645
URL: https://svnweb.freebsd.org/changeset/base/347645

Log:
  iommu static analysis cleanup
  
  A static analyzer complained about a couple instances of checking a
  variable against NULL after already having dereferenced it.
   - dmar_gas_alloc_region: remove the tautological NULL checks
   - dmar_release_resources / dmar_fini_fault_log: don't deref unit->regs
 unless initialized.
  
  And while here, fix an inverted initialization check in dmar_fini_qi.
  
  Reviewed by:  kib
  Sponsored by: Dell EMC Isilon
  Differential revision:https://reviews.freebsd.org/D20263

Modified:
  head/sys/x86/iommu/intel_fault.c
  head/sys/x86/iommu/intel_gas.c
  head/sys/x86/iommu/intel_qi.c

Modified: head/sys/x86/iommu/intel_fault.c
==
--- head/sys/x86/iommu/intel_fault.cThu May 16 03:30:36 2019
(r347644)
+++ head/sys/x86/iommu/intel_fault.cThu May 16 04:24:08 2019
(r347645)
@@ -291,12 +291,12 @@ void
 dmar_fini_fault_log(struct dmar_unit *unit)
 {
 
+   if (unit->fault_taskqueue == NULL)
+   return;
+
DMAR_LOCK(unit);
dmar_disable_fault_intr(unit);
DMAR_UNLOCK(unit);
-
-   if (unit->fault_taskqueue == NULL)
-   return;
 
taskqueue_drain(unit->fault_taskqueue, &unit->fault_task);
taskqueue_free(unit->fault_taskqueue);

Modified: head/sys/x86/iommu/intel_gas.c
==
--- head/sys/x86/iommu/intel_gas.c  Thu May 16 03:30:36 2019
(r347644)
+++ head/sys/x86/iommu/intel_gas.c  Thu May 16 04:24:08 2019
(r347645)
@@ -546,7 +546,7 @@ dmar_gas_alloc_region(struct dmar_domain *domain, stru
return (EBUSY);
entry->start = prev->end;
}
-   if (next != NULL && next->start < entry->end &&
+   if (next->start < entry->end &&
(next->flags & DMAR_MAP_ENTRY_PLACE) == 0) {
if ((next->flags & DMAR_MAP_ENTRY_RMRR) == 0)
return (EBUSY);
@@ -560,7 +560,7 @@ dmar_gas_alloc_region(struct dmar_domain *domain, stru
dmar_gas_rb_remove(domain, prev);
prev = NULL;
}
-   if (next != NULL && next->start < entry->end) {
+   if (next->start < entry->end) {
dmar_gas_rb_remove(domain, next);
next = NULL;
}

Modified: head/sys/x86/iommu/intel_qi.c
==
--- head/sys/x86/iommu/intel_qi.c   Thu May 16 03:30:36 2019
(r347644)
+++ head/sys/x86/iommu/intel_qi.c   Thu May 16 04:24:08 2019
(r347645)
@@ -425,7 +425,7 @@ dmar_fini_qi(struct dmar_unit *unit)
 {
struct dmar_qi_genseq gseq;
 
-   if (unit->qi_enabled)
+   if (!unit->qi_enabled)
return;
taskqueue_drain(unit->qi_taskqueue, &unit->qi_task);
taskqueue_free(unit->qi_taskqueue);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r347646 - head/sys/ddb

2019-05-15 Thread Ryan Libby
Author: rlibby
Date: Thu May 16 05:29:54 2019
New Revision: 347646
URL: https://svnweb.freebsd.org/changeset/base/347646

Log:
  db show thread: avoid overflow in tick conversion
  
  The previous calculations for displaying the time since last switch
  easily overflowed, after less than 36 min for hz=1000.  Now overflow
  takes 2000 times longer (as long as ticks takes to wrap).
  
  Reviewed by:  cem, markj
  Sponsored by: Dell EMC Isilon
  Differential revision:https://reviews.freebsd.org/D20273

Modified:
  head/sys/ddb/db_ps.c

Modified: head/sys/ddb/db_ps.c
==
--- head/sys/ddb/db_ps.cThu May 16 04:24:08 2019(r347645)
+++ head/sys/ddb/db_ps.cThu May 16 05:29:54 2019(r347646)
@@ -338,8 +338,8 @@ DB_SHOW_COMMAND(thread, db_show_thread)
 {
struct thread *td;
struct lock_object *lock;
+   u_int delta;
bool comma;
-   int delta;
 
/* Determine which thread to examine. */
if (have_addr)
@@ -421,14 +421,14 @@ DB_SHOW_COMMAND(thread, db_show_thread)
db_printf(" priority: %d\n", td->td_priority);
db_printf(" container lock: %s (%p)\n", lock->lo_name, lock);
if (td->td_swvoltick != 0) {
-   delta = (u_int)ticks - (u_int)td->td_swvoltick;
-   db_printf(" last voluntary switch: %d ms ago\n",
-   1000 * delta / hz);
+   delta = ticks - td->td_swvoltick;
+   db_printf(" last voluntary switch: %u.%03u s ago\n",
+   delta / hz, (delta % hz) * 1000 / hz);
}
if (td->td_swinvoltick != 0) {
-   delta = (u_int)ticks - (u_int)td->td_swinvoltick;
-   db_printf(" last involuntary switch: %d ms ago\n",
-   1000 * delta / hz);
+   delta = ticks - td->td_swinvoltick;
+   db_printf(" last involuntary switch: %u.%03u s ago\n",
+   delta / hz, (delta % hz) * 1000 / hz);
}
 }
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"