Re: svn commit: r326758 - in head/sys/i386: conf include

2017-12-14 Thread Eugene Grosbein
On 14.12.2017 19:26, Konstantin Belousov wrote:

> Sigh. This would make i386 even less usable for everybody, perhaps
> except you. Because default 3G of UVA is too small for some common tasks
> (thanks clang, but also e.g. pypy), and you reduce the user address
> space even more.

Those who need 3GB of UVA within single process should not use 32 bit system in 
first place, should they?

___
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: r326809 - head/sys/dev/cardbus

2017-12-14 Thread Alexey Dokuchaev
On Thu, Dec 14, 2017 at 02:36:48AM +0700, Eugene Grosbein wrote:
> 14.12.2017 1:24, Alexey Dokuchaev wrote:
> ...
> > One does not tweak FreeBSD, it just works. (tm)
> 
> Hmm. Do you really think so?

I do.

> I can assure you this is not true.  There are numerous ways to take
> down untweaked FreeBSD system.

This means that there are bugs that should be fixed.  Do you have PR
numbers?

./danfe
___
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: r326847 - head/sys/netinet

2017-12-14 Thread Andrey V. Elsukov
Author: ae
Date: Thu Dec 14 12:54:20 2017
New Revision: 326847
URL: https://svnweb.freebsd.org/changeset/base/326847

Log:
  Fix mbuf leak when TCPMD5_OUTPUT() method returns error.
  
  PR:   223817
  MFC after:1 week

Modified:
  head/sys/netinet/tcp_output.c

Modified: head/sys/netinet/tcp_output.c
==
--- head/sys/netinet/tcp_output.c   Thu Dec 14 11:45:02 2017
(r326846)
+++ head/sys/netinet/tcp_output.c   Thu Dec 14 12:54:20 2017
(r326847)
@@ -1239,12 +1239,13 @@ send:
 * NOTE: since TCP options buffer doesn't point into
 * mbuf's data, calculate offset and use it.
 */
-   if (!TCPMD5_ENABLED() || TCPMD5_OUTPUT(m, th,
-   (u_char *)(th + 1) + (to.to_signature - opt)) != 0) {
+   if (!TCPMD5_ENABLED() || (error = TCPMD5_OUTPUT(m, th,
+   (u_char *)(th + 1) + (to.to_signature - opt))) != 0) {
/*
 * Do not send segment if the calculation of MD5
 * digest has failed.
 */
+   m_freem(m);
goto out;
}
}
___
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: r326850 - head/sys/arm/include

2017-12-14 Thread Andrew Turner
Author: andrew
Date: Thu Dec 14 13:19:43 2017
New Revision: 326850
URL: https://svnweb.freebsd.org/changeset/base/326850

Log:
  Add the virtualisation special register definitions.
  
  Submitted by: Mihai Carabas 
  Reviewed by:  mmel
  Differential Revision:https://reviews.freebsd.org/D11846

Modified:
  head/sys/arm/include/sysreg.h

Modified: head/sys/arm/include/sysreg.h
==
--- head/sys/arm/include/sysreg.h   Thu Dec 14 13:10:22 2017
(r326849)
+++ head/sys/arm/include/sysreg.h   Thu Dec 14 13:19:43 2017
(r326850)
@@ -76,12 +76,6 @@
 #defineCP15_ID_MMFR2(rr)   p15, 0, rr, c0, c1,  6 /* Memory Model 
Feature Register 2 */
 #defineCP15_ID_MMFR3(rr)   p15, 0, rr, c0, c1,  7 /* Memory Model 
Feature Register 3 */
 
-#defineCP15_HCR(rr)p15, 4, rr, c1, c1, 0 /* Hyp 
Configuration Register */
-#defineCP15_HCPTR(rr)  p15, 4, rr, c1, c1, 2 /* Hyp 
Coprocessor Trap Register */
-#defineCP15_HSTR(rr)   p15, 4, rr, c1, c1, 3 /* Hyp System 
Trap Register */
-#defineCP15_HSCTLR(rr) p15, 4, rr, c1, c0, 0 /* Hyp System 
Control Register */
-#defineCP15_HDCR(rr)   p15, 4, rr, c1, c1, 1 /* Hyp Debug 
Configuration Register */
-
 #defineCP15_ID_ISAR0(rr)   p15, 0, rr, c0, c2,  0 /* Instruction 
Set Attribute Register 0 */
 #defineCP15_ID_ISAR1(rr)   p15, 0, rr, c0, c2,  1 /* Instruction 
Set Attribute Register 1 */
 #defineCP15_ID_ISAR2(rr)   p15, 0, rr, c0, c2,  2 /* Instruction 
Set Attribute Register 2 */
@@ -95,6 +89,9 @@
 
 #defineCP15_CSSELR(rr) p15, 2, rr, c0, c0,  0 /* Cache Size 
Selection Register */
 
+#defineCP15_VPIDR(rr)  p15, 4, rr, c0, c0,  0 /* 
Virtualization Processor ID Register */
+#defineCP15_VMPIDR(rr) p15, 4, rr, c0, c0,  5 /* 
Virtualization Multiprocessor ID Register */
+
 /*
  * CP15 C1 registers
  */
@@ -106,6 +103,13 @@
 #defineCP15_SDER(rr)   p15, 0, rr, c1, c1,  1 /* Secure Debug 
Enable Register */
 #defineCP15_NSACR(rr)  p15, 0, rr, c1, c1,  2 /* Non-Secure 
Access Control Register */
 
+#defineCP15_HSCTLR(rr) p15, 4, rr, c1, c0,  0 /* Hyp System 
Control Register */
+
+#defineCP15_HCR(rr)p15, 4, rr, c1, c1,  0 /* Hyp 
Configuration Register */
+#defineCP15_HDCR(rr)   p15, 4, rr, c1, c1,  1 /* Hyp Debug 
Configuration Register */
+#defineCP15_HCPTR(rr)  p15, 4, rr, c1, c1,  2 /* Hyp 
Coprocessor Trap Register */
+#defineCP15_HSTR(rr)   p15, 4, rr, c1, c1,  3 /* Hyp System 
Trap Register */
+
 /*
  * CP15 C2 registers
  */
@@ -113,6 +117,9 @@
 #defineCP15_TTBR1(rr)  p15, 0, rr, c2, c0,  1 /* Translation 
Table Base Register 1 */
 #defineCP15_TTBCR(rr)  p15, 0, rr, c2, c0,  2 /* Translation 
Table Base Control Register */
 
+#defineCP15_HTCR(rr)   p15, 4, rr, c2, c0,  2 /* Hyp 
Translation Control Register */
+#defineCP15_VTCR(rr)   p15, 4, rr, c2, c1,  2 /* 
Virtualization Translation Control Register */
+
 /*
  * CP15 C3 registers
  */
@@ -122,6 +129,7 @@
  * CP15 C5 registers
  */
 #defineCP15_DFSR(rr)   p15, 0, rr, c5, c0,  0 /* Data Fault 
Status Register */
+#defineCP15_HSR(rr)p15, 4, rr, c5, c2,  0 /* Hyp Syndrome 
Register */
 
 #if __ARM_ARCH >= 6
 /* From ARMv6: */
@@ -137,6 +145,9 @@
  * CP15 C6 registers
  */
 #defineCP15_DFAR(rr)   p15, 0, rr, c6, c0,  0 /* Data Fault 
Address Register */
+#defineCP15_HDFAR(rr)  p15, 4, rr, c6, c0,  0 /* Hyp Data 
Fault Address Register */
+#defineCP15_HIFAR(rr)  p15, 4, rr, c6, c0,  2 /* Hyp 
Instruction Fault Address Register */
+#defineCP15_HPFAR(rr)  p15, 4, rr, c6, c0,  4 /* Hyp IPA Fault 
Address Register */
 
 #if __ARM_ARCH >= 6
 /* From ARMv6k: */
@@ -223,6 +234,8 @@
 #defineCP15_TLBIMVA(rr)p15, 0, rr, c8, c7, 1 /* Invalidate 
unified TLB by MVA */
 #defineCP15_TLBIASID(rr)   p15, 0, rr, c8, c7, 2 /* Invalidate 
unified TLB by ASID */
 
+#defineCP15_TLBIALLH(rr)   p15, 4, rr, c8, c7, 0 /* Invalidate 
Entire Hyp Unified TLB */
+
 #if __ARM_ARCH >= 6
 /* From ARMv6: */
 #defineCP15_TLBIMVAA(rr)   p15, 0, rr, c8, c7, 3 /* Invalidate 
unified TLB by MVA, all ASID */
@@ -264,6 +277,9 @@
 #defineCP15_AMAIR0(rr) p15, 0, rr, c10, c3, 0 /* Auxiliary 
Memory Attribute Indirection Register 0 */
 #defineCP15_AMAIR1(rr) p15, 0, rr, c10, c3, 1 /* Auxiliary 
Memory Attribute Indirection Register 1 */
 
+#defineCP15_HMAIR0(rr) p15, 4, rr, c10, c2, 0 /* Hyp Memory 
Attribute Indirection Register 0 */
+#defineCP15_HMAIR1(rr) p15, 4, rr, c10, c2, 

svn commit: r326851 - head/sys/fs/devfs

2017-12-14 Thread Konstantin Belousov
Author: kib
Date: Thu Dec 14 13:41:11 2017
New Revision: 326851
URL: https://svnweb.freebsd.org/changeset/base/326851

Log:
  In devfs_lookupx() dotdot lookup case, avoid dereferencing
  dvp->v_mount after dvp is unlocked.
  
  The vnode might be reclaimed after unlock, so v_mount becomes NULL.
  Cache the struct mount pointer before the unlock, the struct is
  type-stable.
  
  Note that devfs_allocv() reads mp->mnt_data but does not operate on it
  further when dirent is doomed.  The unmount cannot proceed until all
  dirents are reclaimed.
  
  Reported and tested by:   pho
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/sys/fs/devfs/devfs_vnops.c

Modified: head/sys/fs/devfs/devfs_vnops.c
==
--- head/sys/fs/devfs/devfs_vnops.c Thu Dec 14 13:19:43 2017
(r326850)
+++ head/sys/fs/devfs/devfs_vnops.c Thu Dec 14 13:41:11 2017
(r326851)
@@ -896,6 +896,7 @@ devfs_lookupx(struct vop_lookup_args *ap, int *dm_unlo
struct devfs_dirent *de, *dd;
struct devfs_dirent **dde;
struct devfs_mount *dmp;
+   struct mount *mp;
struct cdev *cdev;
int error, flags, nameiop, dvplocked;
char specname[SPECNAMELEN + 1], *pname;
@@ -907,7 +908,8 @@ devfs_lookupx(struct vop_lookup_args *ap, int *dm_unlo
td = cnp->cn_thread;
flags = cnp->cn_flags;
nameiop = cnp->cn_nameiop;
-   dmp = VFSTODEVFS(dvp->v_mount);
+   mp = dvp->v_mount;
+   dmp = VFSTODEVFS(mp);
dd = dvp->v_data;
*vpp = NULLVP;
 
@@ -940,8 +942,8 @@ devfs_lookupx(struct vop_lookup_args *ap, int *dm_unlo
return (ENOENT);
dvplocked = VOP_ISLOCKED(dvp);
VOP_UNLOCK(dvp, 0);
-   error = devfs_allocv(de, dvp->v_mount,
-   cnp->cn_lkflags & LK_TYPE_MASK, vpp);
+   error = devfs_allocv(de, mp, cnp->cn_lkflags & LK_TYPE_MASK,
+   vpp);
*dm_unlock = 0;
vn_lock(dvp, dvplocked | LK_RETRY);
return (error);
@@ -1026,8 +1028,7 @@ devfs_lookupx(struct vop_lookup_args *ap, int *dm_unlo
return (0);
}
}
-   error = devfs_allocv(de, dvp->v_mount, cnp->cn_lkflags & LK_TYPE_MASK,
-   vpp);
+   error = devfs_allocv(de, mp, cnp->cn_lkflags & LK_TYPE_MASK, vpp);
*dm_unlock = 0;
return (error);
 }
___
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: r326758 - in head/sys/i386: conf include

2017-12-14 Thread Eugene Grosbein
14.12.2017 23:00, Konstantin Belousov wrote:

> Sigh. This would make i386 even less usable for everybody, perhaps
> except you. Because default 3G of UVA is too small for some common tasks
> (thanks clang, but also e.g. pypy), and you reduce the user address
> space even more.
 Those who need 3GB of UVA within single process should not use 32 bit 
 system in first place, should they?
>>> Why do you even consider it acceptable to break the configuration just
>>> because you are not interested in the workload ?
>> I do not consider it is acceptable. I'm trying to find compromise.
> If you do not find the proposed change acceptable, why do you propose
> it at all ?

I do not consider breakage acceptable but not the change.
I am still in doubt and that's why I'm asking questions.
I doubt, how average i386 workstation or server can generate 1000+ threads
and what is real threshold to get problems because of KVA fragmentation?

>>> 386 arch configuration is not perfect but it provides the main intended
>>> service of general-purpose workstation, with some limitation caused by
>>> 32bit of address space being somewhat low for modern code. Appliance
>>> flavoring of the default 386 config is unacceptable.  Keep your tweaks
>>> local.
>>
>> Do you think that kstack overflow of general-purpose workstation using NFS
>> or IPv6 or WiFi with SCTP is OK? I do not.
> 
> Kernel stack overflow is not 'OK', but two things are equally troublesome:
> - papering over the problem of large structures allocated on stack by
>   increasing the stack size;
> - ignoring the explanation why the stack increase is problematic by itself

The change was submitted for discussion before any kind of explanation was 
given.

>   and generating thread consisting of 50+ content-less messages claiming
>   that 'it fixes the problem for me'.

Not for "me". For average i386 user of IPv6 or SCTP or NFS etc. reporting 
double faults.

> The proper route to fix the issues was already explained more than
> several times, and you (and I, and other people) participated in the
> ongoing efforts there. If it is so much important to you, wave the flag
> and herd the action, by asking relevant people to help with fixes, be it
> writing the patches, providing reviews or just finding the place where
> the stack is abused. It requires identification and time to think and
> develop specific changes for each place, and cannot happen in one day.

Exactly. The problem is officialy noted in our docs since 10.2-RELEASE at least.
And I doubt we can fix all the code in some foreseeable future and 11.2-RELEASE
will still panic same way. And 12.0-RELEASE too, I'm afraid. And that is more
important than keeping old defaults for i386 workstation users
*unless* there are really lots of applications creating large number
of threads/subprocesses.

> But it also would not break KVA-starved architectures and provide fixes
> relevant to even KVA-ample machines, as you other example shown.
> 
> For the case of extreme use, there is still the tunable (and ZFS on i386
> is extreme).

Sadly, we have too many "extreme" cases, as user reports and code analisys 
shows.
That's the problem.


___
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: r326857 - in head: . share/mk stand/i386/zfsboot

2017-12-14 Thread Warner Losh
Author: imp
Date: Thu Dec 14 17:00:24 2017
New Revision: 326857
URL: https://svnweb.freebsd.org/changeset/base/326857

Log:
  Turn loader GELI support in the boot loaders off by default as a
  temporary workaround. This fixes zfs booting generally, but breaks all
  GELI booting by default. Add note to UPDATING to this effect. When the
  GELI issues are resolved, this will be reverted.

Modified:
  head/UPDATING
  head/share/mk/src.opts.mk
  head/stand/i386/zfsboot/zfsldr.S

Modified: head/UPDATING
==
--- head/UPDATING   Thu Dec 14 16:51:43 2017(r326856)
+++ head/UPDATING   Thu Dec 14 17:00:24 2017(r326857)
@@ -51,6 +51,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW:
 
 ** SPECIAL WARNING: **
 
+20171214:
+   r362593 broke ZFS + GELI support for reasons unknown. However,
+   it also broke ZFS support generally, so GELI has been turned off
+   by default as the lessor evil in r326857. If you boot off ZFS and/or
+   GELI, it might not be a good time to update.
+
 20171125:
PowerPC users must update loader(8) by rebuilding world before
installing a new kernel, as the protocol connecting them has

Modified: head/share/mk/src.opts.mk
==
--- head/share/mk/src.opts.mk   Thu Dec 14 16:51:43 2017(r326856)
+++ head/share/mk/src.opts.mk   Thu Dec 14 17:00:24 2017(r326857)
@@ -119,7 +119,6 @@ __DEFAULT_YES_OPTIONS = \
 LIB32 \
 LIBPTHREAD \
 LIBTHR \
-LOADER_GELI \
 LOCALES \
 LOCATE \
 LPR \
@@ -183,6 +182,7 @@ __DEFAULT_NO_OPTIONS = \
 LIBSOFT \
 LOADER_FIREWIRE \
 LOADER_FORCE_LE \
+LOADER_GELI \
 NAND \
 OFED \
 OPENLDAP \

Modified: head/stand/i386/zfsboot/zfsldr.S
==
--- head/stand/i386/zfsboot/zfsldr.SThu Dec 14 16:51:43 2017
(r326856)
+++ head/stand/i386/zfsboot/zfsldr.SThu Dec 14 17:00:24 2017
(r326857)
@@ -33,7 +33,7 @@
.set SIZ_PAG,0x1000 # Page size
.set SIZ_SEC,0x200  # Sector size
.set COPY_BLKS,0x8  # Number of blocks
-   # to copy for boot2
+   # to copy for boot2 (<= 15)
.set COPY_BLK_SZ,0x8000 # Copy in 32k blocks; must be
# a multiple of 16 bytes
.set NSECT,(COPY_BLK_SZ / SIZ_SEC * COPY_BLKS)
___
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: r326809 - head/sys/dev/cardbus

2017-12-14 Thread Eugene Grosbein
14.12.2017 23:27, Warner Losh wrote:

> - zfsloader(8) failing to find any ZFS pool after zfsboot(8) successfully
> loaded and started zfsload(8) from zpool (PR pending, need to collect 
> more info)
> 
> 
> GPT or MBR?

MBR, no GELI used.
 
> If you disable GELI support, it will work. If you roll back to r326583 it 
> will work.
> 
> I'm tracking down the breakage related to my efforts to get the loader in 
> shape for a gentle transition to lua. It's either GELI related or size 
> related.

I'll check it out next day, thanks!

___
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: r326758 - in head/sys/i386: conf include

2017-12-14 Thread Konstantin Belousov
On Thu, Dec 14, 2017 at 07:59:03PM +0700, Eugene Grosbein wrote:
> On 14.12.2017 19:26, Konstantin Belousov wrote:
> 
> > Sigh. This would make i386 even less usable for everybody, perhaps
> > except you. Because default 3G of UVA is too small for some common tasks
> > (thanks clang, but also e.g. pypy), and you reduce the user address
> > space even more.
> 
> Those who need 3GB of UVA within single process should not use 32 bit system 
> in first place, should they?

Why do you even consider it acceptable to break the configuration just
because you are not interested in the workload ?

3G cumulative VA does not translate into 3G of usable addresses: the bss
is reserved, the address space is fragmented due to need of growing
stack to not conflict with mmaped regions. As result, applications get
slightly less than 2G usable without tricks, and to apply the tricks
apps must know details of the AS layout, i.e. breaking the portability.

386 arch configuration is not perfect but it provides the main intended
service of general-purpose workstation, with some limitation caused by
32bit of address space being somewhat low for modern code. Appliance
flavoring of the default 386 config is unacceptable.  Keep your tweaks
local.
___
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: r326856 - head/stand/i386/gptboot

2017-12-14 Thread Warner Losh
Author: imp
Date: Thu Dec 14 16:51:43 2017
New Revision: 326856
URL: https://svnweb.freebsd.org/changeset/base/326856

Log:
  Fix comments after bump in size.

Modified:
  head/stand/i386/gptboot/gptldr.S

Modified: head/stand/i386/gptboot/gptldr.S
==
--- head/stand/i386/gptboot/gptldr.SThu Dec 14 16:51:26 2017
(r326855)
+++ head/stand/i386/gptboot/gptldr.SThu Dec 14 16:51:43 2017
(r326856)
@@ -46,7 +46,7 @@
.set SIZ_PAG,0x1000 # Page size
.set SIZ_SEC,0x200  # Sector size
.set COPY_BLKS,0x8  # Number of blocks
-   # to copy for boot2
+   # to copy for boot2 (<= 15)
.set COPY_BLK_SZ,0x8000 # Copy in 32k blocks; must be
# a multiple of 16 bytes
 
@@ -72,7 +72,7 @@ start:xor %cx,%cx # Zero
  * its header to find boot2.  We need to copy boot2 to MEM_USR and BTX
  * to MEM_BTX.  Since those might overlap, we have to copy boot2
  * backwards first and then copy BTX.  We aren't sure exactly how long
- * boot2 is, but it's currently under 128kB so we'll copy 4 blocks of 32kB
+ * boot2 is, but it's currently under 256kB so we'll copy 8 blocks of 32kB
  * each; this can be adjusted via COPY_BLK and COPY_BLK_SZ above.
  */
mov $end,%bx# BTX
___
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: r326855 - head/stand/ficl

2017-12-14 Thread Warner Losh
Author: imp
Date: Thu Dec 14 16:51:26 2017
New Revision: 326855
URL: https://svnweb.freebsd.org/changeset/base/326855

Log:
  Cargo cut a fix for the regressions r326585 caused.
  
  We need to include ficl.h after the standard includes, rather than
  before them. It changes the generated code in ways that haven't been
  completely analyized. This restores the old code generation (as
  verified by md5 changing back for zfsloader).
  
  This should restore GPT + ZFS and GPT + ZFS + GELI booting that was
  broken in r326585 (or would have been if r326584 hadn't broken the
  build).
  
  Sponsored by: Netflix

Modified:
  head/stand/ficl/float.c

Modified: head/stand/ficl/float.c
==
--- head/stand/ficl/float.c Thu Dec 14 16:41:52 2017(r326854)
+++ head/stand/ficl/float.c Thu Dec 14 16:51:26 2017(r326855)
@@ -43,13 +43,13 @@
 
 /* $FreeBSD$ */
 
-#include "ficl.h"
-
-#if FICL_WANT_FLOAT
 #include 
 #include 
 #include 
 #include 
+#include "ficl.h"
+
+#if FICL_WANT_FLOAT
 #include 
 
 /***
___
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: r326857 - in head: . share/mk stand/i386/zfsboot

2017-12-14 Thread Shawn Webb
On Thu, Dec 14, 2017 at 05:00:24PM +, Warner Losh wrote:
> Author: imp
> Date: Thu Dec 14 17:00:24 2017
> New Revision: 326857
> URL: https://svnweb.freebsd.org/changeset/base/326857
> 
> Log:
>   Turn loader GELI support in the boot loaders off by default as a
>   temporary workaround. This fixes zfs booting generally, but breaks all
>   GELI booting by default. Add note to UPDATING to this effect. When the
>   GELI issues are resolved, this will be reverted.

On an existing 12-CURRENT GELI + root-on-ZFS system (so, full-disk
encryption), if I upgrade to this revision, will my system now fail to
boot?

Or, will it only fail to boot if I update the bootloader?

Thanks,

-- 
Shawn Webb
Cofounder and Security Engineer
HardenedBSD

GPG Key ID:  0x6A84658F52456EEE
GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89  3D9E 6A84 658F 5245 6EEE


signature.asc
Description: PGP signature


svn commit: r326853 - head/sbin/dhclient

2017-12-14 Thread Alan Somers
Author: asomers
Date: Thu Dec 14 15:41:32 2017
New Revision: 326853
URL: https://svnweb.freebsd.org/changeset/base/326853

Log:
  dhclient(8): raise WARNS to 3
  
  Mostly had to fix a lot of signed/unsigned comparison warnings
  
  MFC after:3 weeks
  Sponsored by: Spectra Logic Corp

Modified:
  head/sbin/dhclient/Makefile
  head/sbin/dhclient/clparse.c
  head/sbin/dhclient/conflex.c
  head/sbin/dhclient/dhclient.c
  head/sbin/dhclient/dhcpd.h
  head/sbin/dhclient/inet.c
  head/sbin/dhclient/options.c
  head/sbin/dhclient/packet.c
  head/sbin/dhclient/parse.c
  head/sbin/dhclient/privsep.c
  head/sbin/dhclient/tree.c

Modified: head/sbin/dhclient/Makefile
==
--- head/sbin/dhclient/Makefile Thu Dec 14 15:40:03 2017(r326852)
+++ head/sbin/dhclient/Makefile Thu Dec 14 15:41:32 2017(r326853)
@@ -50,7 +50,7 @@ LIBADD+=cap_syslog
 CFLAGS+=-DWITH_CASPER
 .endif
 
-WARNS?=2
+WARNS?=3
 
 HAS_TESTS=
 SUBDIR.${MK_TESTS}+= tests

Modified: head/sbin/dhclient/clparse.c
==
--- head/sbin/dhclient/clparse.cThu Dec 14 15:40:03 2017
(r326852)
+++ head/sbin/dhclient/clparse.cThu Dec 14 15:41:32 2017
(r326853)
@@ -296,12 +296,12 @@ parse_client_statement(FILE *cfile, struct interface_i
}
 }
 
-int
-parse_X(FILE *cfile, u_int8_t *buf, int max)
+unsigned
+parse_X(FILE *cfile, u_int8_t *buf, unsigned max)
 {
int  token;
char*val;
-   int  len;
+   unsigned len;
 
token = peek_token(, cfile);
if (token == NUMBER_OR_NAME || token == NUMBER) {
@@ -685,14 +685,14 @@ parse_option_decl(FILE *cfile, struct option_data *opt
int  token;
u_int8_t buf[4];
u_int8_t hunkbuf[1024];
-   int  hunkix = 0;
+   unsigned hunkix = 0;
char*vendor;
char*fmt;
struct universe *universe;
struct option   *option;
struct iaddr ip_addr;
u_int8_t*dp;
-   int  len;
+   unsigned len;
int  nul_term = 0;
 
token = next_token(, cfile);

Modified: head/sbin/dhclient/conflex.c
==
--- head/sbin/dhclient/conflex.cThu Dec 14 15:40:03 2017
(r326852)
+++ head/sbin/dhclient/conflex.cThu Dec 14 15:41:32 2017
(r326853)
@@ -60,8 +60,8 @@ int eol_token;
 
 static char line1[81];
 static char line2[81];
-static int lpos;
-static int line;
+static unsigned lpos;
+static unsigned line;
 static int tlpos;
 static int tline;
 static int token;
@@ -228,7 +228,8 @@ skip_to_eol(FILE *cfile)
 static int
 read_string(FILE *cfile)
 {
-   int i, c, bs = 0;
+   int c, bs = 0;
+   unsigned i;
 
for (i = 0; i < sizeof(tokbuf); i++) {
c = get_char(cfile);
@@ -263,7 +264,8 @@ read_string(FILE *cfile)
 static int
 read_number(int c, FILE *cfile)
 {
-   int seenx = 0, i = 0, token = NUMBER;
+   int seenx = 0, token = NUMBER;
+   unsigned i = 0;
 
tokbuf[i++] = c;
for (; i < sizeof(tokbuf); i++) {
@@ -290,7 +292,7 @@ read_number(int c, FILE *cfile)
 static int
 read_num_or_name(int c, FILE *cfile)
 {
-   int i = 0;
+   unsigned i = 0;
int rv = NUMBER_OR_NAME;
 
tokbuf[i++] = c;

Modified: head/sbin/dhclient/dhclient.c
==
--- head/sbin/dhclient/dhclient.c   Thu Dec 14 15:40:03 2017
(r326852)
+++ head/sbin/dhclient/dhclient.c   Thu Dec 14 15:41:32 2017
(r326853)
@@ -195,7 +195,7 @@ get_ifa(char *cp, int n)
return (NULL);
 }
 
-struct iaddr defaddr = { 4 };
+struct iaddr defaddr = { .len = 4 };
 uint8_t curbssid[6];
 
 static void
@@ -237,7 +237,8 @@ routehandler(struct protocol *p)
 
n = read(routefd, , sizeof(msg));
rtm = (struct rt_msghdr *)msg;
-   if (n < sizeof(rtm->rtm_msglen) || n < rtm->rtm_msglen ||
+   if (n < (ssize_t)sizeof(rtm->rtm_msglen) ||
+   n < (ssize_t)rtm->rtm_msglen ||
rtm->rtm_version != RTM_VERSION)
return;
 
@@ -2059,7 +2060,8 @@ priv_script_write_params(char *prefix, struct client_l
 {
struct interface_info *ip = ifi;
u_int8_t dbuf[1500], *dp = NULL;
-   int i, len;
+   int i;
+   size_t len;
char tbuf[128];
 
script_set_env(ip->client, prefix, "ip_address",
@@ -2209,12 +2211,14 @@ script_write_params(char *prefix, struct client_lease 
pr_len = strlen(prefix);
 
hdr.code = IMSG_SCRIPT_WRITE_PARAMS;
-   hdr.len = sizeof(hdr) + sizeof(struct client_lease) +
-   sizeof(size_t) + fn_len + sizeof(size_t) + sn_len +

Re: svn commit: r326809 - head/sys/dev/cardbus

2017-12-14 Thread Warner Losh
On Thu, Dec 14, 2017 at 2:36 PM, Eugene Grosbein  wrote:

> - zfsloader(8) failing to find any ZFS pool after zfsboot(8) successfully
> loaded and started zfsload(8) from zpool (PR pending, need to collect more
> info)
>

GPT or MBR?

If you disable GELI support, it will work. If you roll back to r326583 it
will work.

I'm tracking down the breakage related to my efforts to get the loader in
shape for a gentle transition to lua. It's either GELI related or size
related.

Warner
___
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: r326758 - in head/sys/i386: conf include

2017-12-14 Thread Eugene Grosbein
On 14.12.2017 22:23, Konstantin Belousov wrote:

>>> Sigh. This would make i386 even less usable for everybody, perhaps
>>> except you. Because default 3G of UVA is too small for some common tasks
>>> (thanks clang, but also e.g. pypy), and you reduce the user address
>>> space even more.
>>
>> Those who need 3GB of UVA within single process should not use 32 bit system 
>> in first place, should they?
> 
> Why do you even consider it acceptable to break the configuration just
> because you are not interested in the workload ?

I do not consider it is acceptable. I'm trying to find compromise.

> 3G cumulative VA does not translate into 3G of usable addresses: the bss
> is reserved, the address space is fragmented due to need of growing
> stack to not conflict with mmaped regions. As result, applications get
> slightly less than 2G usable without tricks, and to apply the tricks
> apps must know details of the AS layout, i.e. breaking the portability.
> 
> 386 arch configuration is not perfect but it provides the main intended
> service of general-purpose workstation, with some limitation caused by
> 32bit of address space being somewhat low for modern code. Appliance
> flavoring of the default 386 config is unacceptable.  Keep your tweaks
> local.

Do you think that kstack overflow of general-purpose workstation using NFS
or IPv6 or WiFi with SCTP is OK? I do not.

___
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: r326852 - head/usr.bin/vmstat

2017-12-14 Thread Mark Johnston
Author: markj
Date: Thu Dec 14 15:40:03 2017
New Revision: 326852
URL: https://svnweb.freebsd.org/changeset/base/326852

Log:
  Re-add spaces lost in r326436.
  
  X-MFC with:   r326436

Modified:
  head/usr.bin/vmstat/vmstat.c

Modified: head/usr.bin/vmstat/vmstat.c
==
--- head/usr.bin/vmstat/vmstat.cThu Dec 14 13:41:11 2017
(r326851)
+++ head/usr.bin/vmstat/vmstat.cThu Dec 14 15:40:03 2017
(r326852)
@@ -1041,15 +1041,15 @@ dosum(void)
sum.v_vnodepgsout);
xo_emit("{:page-daemon-wakeups/%9u} {N:page daemon wakeups}\n",
sum.v_pdwakeups);
-   xo_emit("{:page-daemon-pages/%9u} {N:pages examined by the page"
+   xo_emit("{:page-daemon-pages/%9u} {N:pages examined by the page "
"daemon}\n", sum.v_pdpages);
-   xo_emit("{:page-reclamation-shortfalls/%9u} {N:clean page reclamation"
+   xo_emit("{:page-reclamation-shortfalls/%9u} {N:clean page reclamation "
"shortfalls}\n", sum.v_pdshortfalls);
xo_emit("{:reactivated/%9u} {N:pages reactivated by the page daemon}\n",
sum.v_reactivated);
xo_emit("{:copy-on-write-faults/%9u} {N:copy-on-write faults}\n",
sum.v_cow_faults);
-   xo_emit("{:copy-on-write-optimized-faults/%9u} {N:copy-on-write"
+   xo_emit("{:copy-on-write-optimized-faults/%9u} {N:copy-on-write "
"optimized faults}\n", sum.v_cow_optim);
xo_emit("{:zero-fill-pages/%9u} {N:zero fill pages zeroed}\n",
sum.v_zfod);
@@ -1061,7 +1061,7 @@ dosum(void)
sum.v_vm_faults);
xo_emit("{:faults-requiring-io/%9u} {N:page faults requiring I\\/O}\n",
sum.v_io_faults);
-   xo_emit("{:faults-from-thread-creation/%9u} {N:pages affected by"
+   xo_emit("{:faults-from-thread-creation/%9u} {N:pages affected by "
"kernel thread creation}\n", sum.v_kthreadpages);
xo_emit("{:faults-from-fork/%9u} {N:pages affected by  fork}()\n",
sum.v_forkpages);
___
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: r326758 - in head/sys/i386: conf include

2017-12-14 Thread Konstantin Belousov
On Thu, Dec 14, 2017 at 10:39:18PM +0700, Eugene Grosbein wrote:
> On 14.12.2017 22:23, Konstantin Belousov wrote:
> 
> >>> Sigh. This would make i386 even less usable for everybody, perhaps
> >>> except you. Because default 3G of UVA is too small for some common tasks
> >>> (thanks clang, but also e.g. pypy), and you reduce the user address
> >>> space even more.
> >>
> >> Those who need 3GB of UVA within single process should not use 32 bit 
> >> system in first place, should they?
> > 
> > Why do you even consider it acceptable to break the configuration just
> > because you are not interested in the workload ?
> 
> I do not consider it is acceptable. I'm trying to find compromise.
If you do not find the proposed change acceptable, why do you propose
it at all ?

> 
> > 3G cumulative VA does not translate into 3G of usable addresses: the bss
> > is reserved, the address space is fragmented due to need of growing
> > stack to not conflict with mmaped regions. As result, applications get
> > slightly less than 2G usable without tricks, and to apply the tricks
> > apps must know details of the AS layout, i.e. breaking the portability.
> > 
> > 386 arch configuration is not perfect but it provides the main intended
> > service of general-purpose workstation, with some limitation caused by
> > 32bit of address space being somewhat low for modern code. Appliance
> > flavoring of the default 386 config is unacceptable.  Keep your tweaks
> > local.
> 
> Do you think that kstack overflow of general-purpose workstation using NFS
> or IPv6 or WiFi with SCTP is OK? I do not.

Kernel stack overflow is not 'OK', but two things are equally troublesome:
- papering over the problem of large structures allocated on stack by
  increasing the stack size;
- ignoring the explanation why the stack increase is problematic by itself
  and generating thread consisting of 50+ content-less messages claiming
  that 'it fixes the problem for me'.

The proper route to fix the issues was already explained more than
several times, and you (and I, and other people) participated in the
ongoing efforts there. If it is so much important to you, wave the flag
and herd the action, by asking relevant people to help with fixes, be it
writing the patches, providing reviews or just finding the place where
the stack is abused. It requires identification and time to think and
develop specific changes for each place, and cannot happen in one day.
But it also would not break KVA-starved architectures and provide fixes
relevant to even KVA-ample machines, as you other example shown.

For the case of extreme use, there is still the tunable (and ZFS on i386
is extreme).
___
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: r326854 - in head/stand/efi: boot1 include libefi

2017-12-14 Thread Toomas Soome
Author: tsoome
Date: Thu Dec 14 16:41:52 2017
New Revision: 326854
URL: https://svnweb.freebsd.org/changeset/base/326854

Log:
  libefi: make efichar.h more usable in stand code
  
  Use _STANDALONE for guard expression in efichar.[ch] and add efi_char typedef.
  clean up boot1.c, and replace for loop in efipart.c with ucs2len().
  
  Reviewed by:  imp
  Differential Revision:https://reviews.freebsd.org/D13488

Modified:
  head/stand/efi/boot1/boot1.c
  head/stand/efi/include/efichar.h
  head/stand/efi/libefi/Makefile
  head/stand/efi/libefi/efichar.c
  head/stand/efi/libefi/efipart.c

Modified: head/stand/efi/boot1/boot1.c
==
--- head/stand/efi/boot1/boot1.cThu Dec 14 15:41:32 2017
(r326853)
+++ head/stand/efi/boot1/boot1.cThu Dec 14 16:41:52 2017
(r326854)
@@ -29,7 +29,6 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
-typedef CHAR16 efi_char;
 #include 
 
 #include "boot_module.h"

Modified: head/stand/efi/include/efichar.h
==
--- head/stand/efi/include/efichar.hThu Dec 14 15:41:32 2017
(r326853)
+++ head/stand/efi/include/efichar.hThu Dec 14 16:41:52 2017
(r326854)
@@ -29,6 +29,12 @@
 #ifndef _BOOT_EFI_EFICHAR_H_
 #define_BOOT_EFI_EFICHAR_H_
 
+#ifdef _STANDALONE
+#include 
+
+typedef CHAR16 efi_char;
+#endif
+
 int ucs2_to_utf8(const efi_char *, char **);
 int utf8_to_ucs2(const char *, efi_char **, size_t *);
 int ucs2len(const efi_char *);

Modified: head/stand/efi/libefi/Makefile
==
--- head/stand/efi/libefi/Makefile  Thu Dec 14 15:41:32 2017
(r326853)
+++ head/stand/efi/libefi/Makefile  Thu Dec 14 16:41:52 2017
(r326854)
@@ -52,6 +52,4 @@ CFLAGS+= ${FORMAT_EXTENSIONS}
 CFLAGS+= -DTERM_EMU
 .endif
 
-CFLAGS+= -DLIBEFI
-
 .include 

Modified: head/stand/efi/libefi/efichar.c
==
--- head/stand/efi/libefi/efichar.c Thu Dec 14 15:41:32 2017
(r326853)
+++ head/stand/efi/libefi/efichar.c Thu Dec 14 16:41:52 2017
(r326854)
@@ -29,16 +29,16 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
-#ifdef LIBEFI
+#ifdef _STANDALONE
 #include 
 #else
 #include 
 #include 
 #include 
 #include 
-#endif
 #include 
 #include 
+#endif
 
 #include "efichar.h"
 

Modified: head/stand/efi/libefi/efipart.c
==
--- head/stand/efi/libefi/efipart.c Thu Dec 14 15:41:32 2017
(r326853)
+++ head/stand/efi/libefi/efipart.c Thu Dec 14 16:41:52 2017
(r326854)
@@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 
 static EFI_GUID blkio_guid = BLOCK_IO_PROTOCOL;
@@ -564,8 +565,7 @@ efipart_hdinfo_add_filepath(EFI_HANDLE disk_handle)
unit = 0;
 
/* FILEPATH_DEVICE_PATH has 0 terminated string */
-   for (len = 0; node->PathName[len] != 0; len++)
-   ;
+   len = ucs2len(node->PathName);
if ((pathname = malloc(len + 1)) == NULL) {
printf("Failed to add disk, out of memory\n");
free(pd);
___
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: r326859 - head/sys/powerpc/powerpc

2017-12-14 Thread Justin Hibbits
Author: jhibbits
Date: Thu Dec 14 20:01:04 2017
New Revision: 326859
URL: https://svnweb.freebsd.org/changeset/base/326859

Log:
  Add identifier for POWER9 CPU to CPU list
  
  Without the identifier in the list booting FreeBSD results in printing the
  following (from a PowerKVM boot):
  
  cpu0: Unknown PowerPC CPU revision 0x1201, 2550.00 MHz
  
  For now, add the same feature list as POWER8.  As new capabilities are added 
to
  support POWER9 specific features, they will be added to this.
  
  PR:   224344
  Submitted by: Breno Leitao 

Modified:
  head/sys/powerpc/powerpc/cpu.c

Modified: head/sys/powerpc/powerpc/cpu.c
==
--- head/sys/powerpc/powerpc/cpu.c  Thu Dec 14 18:57:17 2017
(r326858)
+++ head/sys/powerpc/powerpc/cpu.c  Thu Dec 14 20:01:04 2017
(r326859)
@@ -163,6 +163,12 @@ static const struct cputab models[] = {
   PPC_FEATURE_HAS_VSX,
   PPC_FEATURE2_ARCH_2_07 | PPC_FEATURE2_HAS_HTM | PPC_FEATURE2_ISEL |
   PPC_FEATURE2_HAS_VCRYPTO, NULL },
+{ "IBM POWER9",IBMPOWER9,  REVFMT_MAJMIN,
+  PPC_FEATURE_64 | PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU |
+  PPC_FEATURE_SMT | PPC_FEATURE_ARCH_2_05 | PPC_FEATURE_ARCH_2_06 |
+  PPC_FEATURE_HAS_VSX,
+  PPC_FEATURE2_ARCH_2_07 | PPC_FEATURE2_HAS_HTM | PPC_FEATURE2_ISEL |
+  PPC_FEATURE2_HAS_VCRYPTO, NULL },
 { "Motorola PowerPC 7400", MPC7400,REVFMT_MAJMIN,
   PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU, 0, cpu_6xx_setup },
 { "Motorola PowerPC 7410", MPC7410,REVFMT_MAJMIN,
___
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: r326857 - in head: . share/mk stand/i386/zfsboot

2017-12-14 Thread Rodney W. Grimes
> Author: imp
> Date: Thu Dec 14 17:00:24 2017
> New Revision: 326857
> URL: https://svnweb.freebsd.org/changeset/base/326857
> 
> Log:
>   Turn loader GELI support in the boot loaders off by default as a
>   temporary workaround. This fixes zfs booting generally, but breaks all
>   GELI booting by default. Add note to UPDATING to this effect. When the
>   GELI issues are resolved, this will be reverted.
> 
> Modified:
>   head/UPDATING
>   head/share/mk/src.opts.mk
>   head/stand/i386/zfsboot/zfsldr.S

Was the change to this an unintentional oops merge, as This looks
to be doing more than what you document in the log entry.


> Modified: head/UPDATING
> ==
> --- head/UPDATING Thu Dec 14 16:51:43 2017(r326856)
> +++ head/UPDATING Thu Dec 14 17:00:24 2017(r326857)
> @@ -51,6 +51,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW:
>  
>  ****** SPECIAL WARNING: 
> **
>  
> +20171214:
> + r362593 broke ZFS + GELI support for reasons unknown. However,
> + it also broke ZFS support generally, so GELI has been turned off
> + by default as the lessor evil in r326857. If you boot off ZFS and/or
> + GELI, it might not be a good time to update.
> +
>  20171125:
>   PowerPC users must update loader(8) by rebuilding world before
>   installing a new kernel, as the protocol connecting them has
> 
> Modified: head/share/mk/src.opts.mk
> ==
> --- head/share/mk/src.opts.mk Thu Dec 14 16:51:43 2017(r326856)
> +++ head/share/mk/src.opts.mk Thu Dec 14 17:00:24 2017(r326857)
> @@ -119,7 +119,6 @@ __DEFAULT_YES_OPTIONS = \
>  LIB32 \
>  LIBPTHREAD \
>  LIBTHR \
> -LOADER_GELI \
>  LOCALES \
>  LOCATE \
>  LPR \
> @@ -183,6 +182,7 @@ __DEFAULT_NO_OPTIONS = \
>  LIBSOFT \
>  LOADER_FIREWIRE \
>  LOADER_FORCE_LE \
> +LOADER_GELI \
>  NAND \
>  OFED \
>  OPENLDAP \
> 
> Modified: head/stand/i386/zfsboot/zfsldr.S
> ==
> --- head/stand/i386/zfsboot/zfsldr.S  Thu Dec 14 16:51:43 2017
> (r326856)
> +++ head/stand/i386/zfsboot/zfsldr.S  Thu Dec 14 17:00:24 2017
> (r326857)
> @@ -33,7 +33,7 @@
>   .set SIZ_PAG,0x1000 # Page size
>   .set SIZ_SEC,0x200  # Sector size
>   .set COPY_BLKS,0x8  # Number of blocks
> - # to copy for boot2
> + # to copy for boot2 (<= 15)

This seems to match a commit you just made to other parts of the
code.

>   .set COPY_BLK_SZ,0x8000 # Copy in 32k blocks; must be
>   # a multiple of 16 bytes
>   .set NSECT,(COPY_BLK_SZ / SIZ_SEC * COPY_BLKS)

-- 
Rod Grimes rgri...@freebsd.org
___
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: r326858 - head/stand/ficl

2017-12-14 Thread Warner Losh
Author: imp
Date: Thu Dec 14 18:57:17 2017
New Revision: 326858
URL: https://svnweb.freebsd.org/changeset/base/326858

Log:
  Revert r326855: Cargo cut a fix for the regressions r326585 caused.
  
  This was an experiment that landed in the wrong branch and was pushed
  accidentally. It's best if it is ignored because the difference was
  due to vers.o being different, not float.o... And it was confirmed to
  not fix anything...
  
  Pointy Hat to: imp

Modified:
  head/stand/ficl/float.c

Modified: head/stand/ficl/float.c
==
--- head/stand/ficl/float.c Thu Dec 14 17:00:24 2017(r326857)
+++ head/stand/ficl/float.c Thu Dec 14 18:57:17 2017(r326858)
@@ -43,13 +43,13 @@
 
 /* $FreeBSD$ */
 
+#include "ficl.h"
+
+#if FICL_WANT_FLOAT
 #include 
 #include 
 #include 
 #include 
-#include "ficl.h"
-
-#if FICL_WANT_FLOAT
 #include 
 
 /***
___
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: r326860 - head/sys/net

2017-12-14 Thread Ryan Stone
Author: rstone
Date: Thu Dec 14 20:48:50 2017
New Revision: 326860
URL: https://svnweb.freebsd.org/changeset/base/326860

Log:
  Plug an ifaddr leak when changing a route's src
  
  If a route is modified in a way that changes the route's source
  address (i.e. the address used to access the gateway), then a
  reference on the ifaddr representing the old source address will
  be leaked if the address type does not have an ifa_rtrequest
  method defined.  Plug the leak by releasing the reference in
  all cases.
  
  Differential Revision:https://reviews.freebsd.org/D13417
  Reviewed by:  ae
  MFC after:3 weeks
  Sponsored by: Dell

Modified:
  head/sys/net/route.c

Modified: head/sys/net/route.c
==
--- head/sys/net/route.cThu Dec 14 20:01:04 2017(r326859)
+++ head/sys/net/route.cThu Dec 14 20:48:50 2017(r326860)
@@ -1781,8 +1781,9 @@ rtrequest1_fib_change(struct rib_head *rnh, struct rt_
 
/* Check if outgoing interface has changed */
if (info->rti_ifa != NULL && info->rti_ifa != rt->rt_ifa &&
-   rt->rt_ifa != NULL && rt->rt_ifa->ifa_rtrequest != NULL) {
-   rt->rt_ifa->ifa_rtrequest(RTM_DELETE, rt, info);
+   rt->rt_ifa != NULL) {
+   if (rt->rt_ifa->ifa_rtrequest != NULL)
+   rt->rt_ifa->ifa_rtrequest(RTM_DELETE, rt, info);
ifa_free(rt->rt_ifa);
}
/* Update gateway address */
___
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: r326861 - in head/tests/sys/geom/class: . mirror

2017-12-14 Thread Mark Johnston
Author: markj
Date: Thu Dec 14 22:11:35 2017
New Revision: 326861
URL: https://svnweb.freebsd.org/changeset/base/326861

Log:
  Add some basic tests for gmirror read and write error handling.
  
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon

Added:
  head/tests/sys/geom/class/mirror/10_test.sh   (contents, props changed)
  head/tests/sys/geom/class/mirror/11_test.sh   (contents, props changed)
  head/tests/sys/geom/class/mirror/12_test.sh   (contents, props changed)
  head/tests/sys/geom/class/mirror/13_test.sh   (contents, props changed)
Modified:
  head/tests/sys/geom/class/geom_subr.sh
  head/tests/sys/geom/class/mirror/Makefile

Modified: head/tests/sys/geom/class/geom_subr.sh
==
--- head/tests/sys/geom/class/geom_subr.sh  Thu Dec 14 20:48:50 2017
(r326860)
+++ head/tests/sys/geom/class/geom_subr.sh  Thu Dec 14 22:11:35 2017
(r326861)
@@ -20,6 +20,16 @@ attach_md()
echo $test_md
 }
 
+detach_md()
+{
+   local test_md unit
+
+   test_md=$1
+   unit=${test_md#md}
+   mdconfig -d -u $unit || exit
+   sed -i '' "/^${test_md}$/d" $TEST_MDS_FILE || exit
+}
+
 geom_test_cleanup()
 {
local test_md
@@ -38,6 +48,7 @@ if [ $(id -u) -ne 0 ]; then
echo '1..0 # SKIP tests must be run as root'
exit 0
 fi
+
 # If the geom class isn't already loaded, try loading it.
 if ! kldstat -q -m g_${class}; then
if ! geom ${class} load; then

Added: head/tests/sys/geom/class/mirror/10_test.sh
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tests/sys/geom/class/mirror/10_test.sh Thu Dec 14 22:11:35 2017
(r326861)
@@ -0,0 +1,69 @@
+#!/bin/sh
+# $FreeBSD$
+
+# Test handling of read errors.
+
+. $(dirname $0)/conf.sh
+
+echo 1..3
+
+set -e
+
+ddbs=2048
+regreadfp="debug.fail_point.g_mirror_regular_request_read"
+m1=$(mktemp $base.XX)
+m2=$(mktemp $base.XX)
+
+dd if=/dev/random of=$m1 bs=$ddbs count=1024 >/dev/null 2>&1
+dd if=/dev/zero of=$m2 bs=$ddbs count=1024 >/dev/null 2>&1
+
+us0=$(attach_md -t vnode -f $m1)
+us1=$(attach_md -t vnode -f $m2)
+
+gmirror label $name /dev/$us0
+gmirror insert $name /dev/$us1
+devwait
+syncwait
+
+tmp1=$(mktemp $base.XX)
+tmp2=$(mktemp $base.XX)
+
+EIO=5
+# gmirror should retry a failed read from the other mirror.
+sysctl ${regreadfp}="1*return(${EIO})"
+dd if=/dev/mirror/$name of=$tmp1 iseek=256 bs=$ddbs count=1 >/dev/null 2>&1
+dd if=/dev/$us1 of=$tmp2 iseek=256 bs=$ddbs count=1 >/dev/null 2>&1
+sysctl ${regreadfp}='off'
+
+if cmp -s $tmp1 $tmp2; then
+   echo "ok 1"
+else
+   echo "not ok 1"
+fi
+
+# Make sure that one of the mirrors was marked broken.
+genid1=$(gmirror dump /dev/$us0 | awk '/^[[:space:]]*genid: /{print $2}')
+genid2=$(gmirror dump /dev/$us1 | awk '/^[[:space:]]*genid: /{print $2}')
+if [ $genid1 -eq $(($genid2 + 1)) -o $genid2 -eq $(($genid1 + 1)) ]; then
+   echo "ok 2"
+else
+   echo "not ok 2"
+fi
+
+# Force a retaste of the disconnected component.
+if [ $(gmirror status -s $name | awk '{print $3}') = $us0 ]; then
+   detach_md $us1
+   us1=$(attach_md -t vnode -f $m2)
+else
+   detach_md $us0
+   us0=$(attach_md -t vnode -f $m1)
+fi
+
+# Make sure that the component wasn't re-added to the gmirror.
+if [ $(gmirror status -s $name | wc -l) -eq 1 ]; then
+   echo "ok 3"
+else
+   echo "not ok 3"
+fi
+
+rm -f $m1 $m2 $tmp1 $tmp2

Added: head/tests/sys/geom/class/mirror/11_test.sh
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tests/sys/geom/class/mirror/11_test.sh Thu Dec 14 22:11:35 2017
(r326861)
@@ -0,0 +1,84 @@
+#!/bin/sh
+# $FreeBSD$
+
+# Test handling of read errors.
+
+. $(dirname $0)/conf.sh
+
+echo 1..4
+
+set -e
+
+ddbs=2048
+regreadfp="debug.fail_point.g_mirror_regular_request_read"
+m1=$(mktemp $base.XX)
+m2=$(mktemp $base.XX)
+
+dd if=/dev/random of=$m1 bs=$ddbs count=1024 >/dev/null 2>&1
+dd if=/dev/zero of=$m2 bs=$ddbs count=1024 >/dev/null 2>&1
+
+us0=$(attach_md -t vnode -f $m1)
+us1=$(attach_md -t vnode -f $m2)
+
+gmirror label $name /dev/$us0
+gmirror insert $name /dev/$us1
+devwait
+syncwait
+
+tmp1=$(mktemp $base.XX)
+tmp2=$(mktemp $base.XX)
+
+ENXIO=6
+# gmirror has special handling for ENXIO. It does not mark the failed component
+# as broken, allowing it to rejoin the mirror automatically when it appears.
+sysctl ${regreadfp}="1*return(${ENXIO})"
+dd if=/dev/mirror/$name of=$tmp1 iseek=512 bs=$ddbs count=1 >/dev/null 2>&1
+dd if=/dev/$us1 of=$tmp2 iseek=512 bs=$ddbs count=1 >/dev/null 2>&1
+sysctl ${regreadfp}='off'
+
+if cmp -s $tmp1 $tmp2; then
+   echo "ok 1"
+else
+   echo "not ok 1"
+fi
+
+# Verify that the genids still match after ENXIO.
+genid1=$(gmirror dump /dev/$us0 | 

svn commit: r326862 - head/tests/sys/geom/class/mirror

2017-12-14 Thread Mark Johnston
Author: markj
Date: Thu Dec 14 22:14:07 2017
New Revision: 326862
URL: https://svnweb.freebsd.org/changeset/base/326862

Log:
  Make indentation consistent with other tests, and use syncwait.
  
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/tests/sys/geom/class/mirror/8_test.sh
  head/tests/sys/geom/class/mirror/9_test.sh

Modified: head/tests/sys/geom/class/mirror/8_test.sh
==
--- head/tests/sys/geom/class/mirror/8_test.sh  Thu Dec 14 22:11:35 2017
(r326861)
+++ head/tests/sys/geom/class/mirror/8_test.sh  Thu Dec 14 22:14:07 2017
(r326862)
@@ -35,9 +35,7 @@ devwait # This will take kern.geom.mirror.timeout seco
 
 # Re-attach the second mirror and wait for it to synchronize.
 us1=$(attach_md -t vnode -f $m2) || exit 1
-while [ $(gmirror status $name | grep ACTIVE | wc -l) -ne 2 ]; do
-sleep 1
-done
+syncwait
 
 # Verify the two mirrors are identical. Destroy the gmirror first so that
 # the mirror metadata is wiped; otherwise the metadata blocks will fail
@@ -45,9 +43,9 @@ done
 # command instead.
 gmirror destroy $name
 if cmp -s ${m1} ${m2}; then
-echo "ok 1"
+   echo "ok 1"
 else
-echo "not ok 1"
+   echo "not ok 1"
 fi
 
 rm -f $m1 $m2

Modified: head/tests/sys/geom/class/mirror/9_test.sh
==
--- head/tests/sys/geom/class/mirror/9_test.sh  Thu Dec 14 22:11:35 2017
(r326861)
+++ head/tests/sys/geom/class/mirror/9_test.sh  Thu Dec 14 22:14:07 2017
(r326862)
@@ -33,9 +33,7 @@ sysctl debug.fail_point.g_mirror_metadata_write='off' 
 # Replace the broken mirror, and then stop the gmirror.
 gmirror forget $name || exit 1
 gmirror insert $name /dev/$us2 || exit 1
-while [ $(gmirror status $name | grep ACTIVE | wc -l) -ne 2 ]; do
-sleep 1
-done
+syncwait
 gmirror stop $name || exit 1
 
 # Restart the gmirror on the original two mirrors. One of them is broken,
@@ -49,14 +47,12 @@ dd if=/dev/random of=/dev/mirror/$name bs=$ddbs count=
 # the metadata blocks will fail the comparison. It would be nice to do this
 # with a "gmirror verify" command instead.
 gmirror activate $name /dev/$us2 || exit 1
-while [ $(gmirror status $name | grep ACTIVE | wc -l) -ne 2 ]; do
-sleep 1
-done
+syncwait
 gmirror destroy $name || exit 1
 if cmp -s $m1 $m3; then
-echo "ok 1"
+   echo "ok 1"
 else
-echo "not ok 1"
+   echo "not ok 1"
 fi
 
 rm -f $m1 $m2 $m3
___
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: r326863 - head/tests/sys/geom/class/mirror

2017-12-14 Thread Mark Johnston
Author: markj
Date: Thu Dec 14 22:15:46 2017
New Revision: 326863
URL: https://svnweb.freebsd.org/changeset/base/326863

Log:
  Belatedly add syncwait.
  
  X-MFC with:   r326861

Modified:
  head/tests/sys/geom/class/mirror/conf.sh

Modified: head/tests/sys/geom/class/mirror/conf.sh
==
--- head/tests/sys/geom/class/mirror/conf.shThu Dec 14 22:14:07 2017
(r326862)
+++ head/tests/sys/geom/class/mirror/conf.shThu Dec 14 22:15:46 2017
(r326863)
@@ -12,4 +12,11 @@ gmirror_test_cleanup()
 }
 trap gmirror_test_cleanup ABRT EXIT INT TERM
 
+syncwait()
+{
+   while $(gmirror status -s $name | grep -q SYNCHRONIZING); do
+   sleep 0.1;
+   done
+}
+
 . `dirname $0`/../geom_subr.sh
___
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: r326866 - in head/sys/contrib/dev/acpica: . common compiler components/debugger components/disassembler components/dispatcher components/executer components/hardware components/namespac...

2017-12-14 Thread Jung-uk Kim
Author: jkim
Date: Thu Dec 14 23:21:31 2017
New Revision: 326866
URL: https://svnweb.freebsd.org/changeset/base/326866

Log:
  MFC:  r326864
  
  Merge ACPICA 20171214.

Modified:
  head/sys/contrib/dev/acpica/changes.txt
  head/sys/contrib/dev/acpica/common/adisasm.c
  head/sys/contrib/dev/acpica/common/dmswitch.c
  head/sys/contrib/dev/acpica/common/dmtable.c
  head/sys/contrib/dev/acpica/common/dmtables.c
  head/sys/contrib/dev/acpica/common/dmtbdump.c
  head/sys/contrib/dev/acpica/compiler/aslcodegen.c
  head/sys/contrib/dev/acpica/compiler/aslcompile.c
  head/sys/contrib/dev/acpica/compiler/asldebug.c
  head/sys/contrib/dev/acpica/compiler/aslfiles.c
  head/sys/contrib/dev/acpica/compiler/asloptions.c
  head/sys/contrib/dev/acpica/compiler/aslparseop.c
  head/sys/contrib/dev/acpica/compiler/aslstartup.c
  head/sys/contrib/dev/acpica/compiler/aslsupport.l
  head/sys/contrib/dev/acpica/compiler/asltree.c
  head/sys/contrib/dev/acpica/compiler/aslutils.c
  head/sys/contrib/dev/acpica/compiler/cvcompiler.c
  head/sys/contrib/dev/acpica/compiler/cvdisasm.c
  head/sys/contrib/dev/acpica/compiler/cvparser.c
  head/sys/contrib/dev/acpica/compiler/dtcompile.c
  head/sys/contrib/dev/acpica/compiler/dttable1.c
  head/sys/contrib/dev/acpica/compiler/prscan.c
  head/sys/contrib/dev/acpica/components/debugger/dbfileio.c
  head/sys/contrib/dev/acpica/components/disassembler/dmwalk.c
  head/sys/contrib/dev/acpica/components/dispatcher/dspkginit.c
  head/sys/contrib/dev/acpica/components/executer/exdump.c
  head/sys/contrib/dev/acpica/components/hardware/hwvalid.c
  head/sys/contrib/dev/acpica/components/namespace/nsxfeval.c
  head/sys/contrib/dev/acpica/components/parser/psutils.c
  head/sys/contrib/dev/acpica/components/utilities/utdebug.c
  head/sys/contrib/dev/acpica/components/utilities/utnonansi.c
  head/sys/contrib/dev/acpica/components/utilities/utosi.c
  head/sys/contrib/dev/acpica/components/utilities/uttrack.c
  head/sys/contrib/dev/acpica/include/acexcep.h
  head/sys/contrib/dev/acpica/include/acglobal.h
  head/sys/contrib/dev/acpica/include/acpixf.h
  head/sys/contrib/dev/acpica/include/actypes.h
  head/sys/contrib/dev/acpica/include/acutils.h
  head/sys/contrib/dev/acpica/os_specific/service_layers/osgendbg.c
Directory Properties:
  head/sys/contrib/dev/acpica/   (props changed)

Modified: head/sys/contrib/dev/acpica/changes.txt
==
--- head/sys/contrib/dev/acpica/changes.txt Thu Dec 14 22:57:22 2017
(r326865)
+++ head/sys/contrib/dev/acpica/changes.txt Thu Dec 14 23:21:31 2017
(r326866)
@@ -1,4 +1,44 @@
 
+14 December 2017. Summary of changes for version 20171214:
+
+
+1) ACPICA kernel-resident subsystem:
+
+Fixed a regression in the external (public) AcpiEvaluateObjectTyped 
+interface where the optional "pathname" argument had inadvertently become 
+a required argument returning an error if omitted (NULL pointer 
+argument).
+
+Fixed two possible memory leaks related to the recently developed "late 
+resolution" of reference objects within ASL Package Object definitions.
+
+Added two recently defined _OSI strings: "Windows 2016" and "Windows 
+2017". Mario Limonciello.
+
+Implemented and deployed a safer version of the C library function 
+strncpy:  AcpiUtSafeStrncpy. The intent is to at least prevent the 
+creation of unterminated strings as a possible result of a standard 
+strncpy.
+
+Cleaned up and restructured the global variable file (acglobal.h). There 
+are many changes, but no functional changes.
+
+
+2) iASL Compiler/Disassembler and Tools:
+
+iASL Table Compiler: Fixed a problem with the DBG2 ACPI table where the 
+optional OemData field at the end of the table was incorrectly required 
+for proper compilation. It is now correctly an optional field.
+
+ASLTS: The entire suite was converted from standard ASL to the ASL+ 
+language, using the ASL-to-ASL+ converter which is integrated into the 
+iASL compiler. A binary compare of all output files has verified the 
+correctness of the conversion.
+
+iASL: Fixed the source code build for platforms where "char" is unsigned. 
+This affected the iASL lexer only. Jung-uk Kim.
+
+
 10 November 2017. Summary of changes for version 20171110:
 
 

Modified: head/sys/contrib/dev/acpica/common/adisasm.c
==
--- head/sys/contrib/dev/acpica/common/adisasm.cThu Dec 14 22:57:22 
2017(r326865)
+++ head/sys/contrib/dev/acpica/common/adisasm.cThu Dec 14 23:21:31 
2017(r326866)
@@ -457,9 +457,9 @@ AdDisassembleOneTable (
  * (.xxx) file produced from the converter in case if
  * it fails to get deleted.
  */
-if (Gbl_CaptureComments)
+if (AcpiGbl_CaptureComments)
 {
-strncpy (Table->Signature, Acp

Re: svn commit: r326866 - in head/sys/contrib/dev/acpica: . common compiler components/debugger components/disassembler components/dispatcher components/executer components/hardware components/namespa

2017-12-14 Thread Jung-uk Kim
On 12/14/2017 18:21, Jung-uk Kim wrote:
> Author: jkim
> Date: Thu Dec 14 23:21:31 2017
> New Revision: 326866
> URL: https://svnweb.freebsd.org/changeset/base/326866
> 
> Log:
>   MFC:r326864
>   
>   Merge ACPICA 20171214.

I meant "MFV", of course.  Sorry.

Jung-uk Kim
___
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: r326809 - head/sys/dev/cardbus

2017-12-14 Thread Warner Losh
On Thu, Dec 14, 2017 at 5:00 PM, Eugene Grosbein  wrote:

> 14.12.2017 23:27, Warner Losh wrote:
>
> > - zfsloader(8) failing to find any ZFS pool after zfsboot(8)
> successfully
> > loaded and started zfsload(8) from zpool (PR pending, need to
> collect more info)
> >
> >
> > GPT or MBR?
>
> MBR, no GELI used.


when you update, you're updating both halves of the loader, right?


>
> > If you disable GELI support, it will work. If you roll back to r326583
> it will work.
> >
> > I'm tracking down the breakage related to my efforts to get the loader
> in shape for a gentle transition to lua. It's either GELI related or size
> related.
>
> I'll check it out next day, thanks!
>

It should be better soon...

Warner
___
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: r326809 - head/sys/dev/cardbus

2017-12-14 Thread Eugene Grosbein
15.12.2017 6:50, Warner Losh wrote:
> 
> 
> On Thu, Dec 14, 2017 at 5:00 PM, Eugene Grosbein  > wrote:
> 
> 14.12.2017 23:27, Warner Losh wrote:
> 
> > - zfsloader(8) failing to find any ZFS pool after zfsboot(8) 
> successfully
> > loaded and started zfsload(8) from zpool (PR pending, need to 
> collect more info)
> >
> >
> > GPT or MBR?
> 
> MBR, no GELI used.
> when you update, you're updating both halves of the loader, right?

I do not get it, what are "halves of the loader"?
I know zfsboot should be installed in parts but it finds boot pool just fine
and I do not update it. As for zfsloader, I install it with to /boot/zfsloader
with simple "make install" command.

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

2017-12-14 Thread Justin Hibbits
Author: jhibbits
Date: Fri Dec 15 04:11:20 2017
New Revision: 326870
URL: https://svnweb.freebsd.org/changeset/base/326870

Log:
  Handle the Facility Unavailable exception as a SIGILL
  
  Currently Facility Unavailable is absent and once an application
  tries to use or access a register from a feature disabled in the
  CPU it causes a kernel panic.
  
  A simple test-case is:
  
  int main() { asm volatile ("tbegin.;"); }
  
  which will use TM (Hardware Transactional Memory) feature which
  is not supported by the kernel and so will trigger the following
  kernel panic:
  
  
  
  fatal user trap:
  
  exception   = 0xf60 (unknown)
  srr0= 0x1890
  srr1= 0x8000f032
  lr  = 0x14e4
  curthread   = 0x5f93000
  pid = 1021, comm = htm
  
  panic: unknown trap
  cpuid = 40
  KDB: stack backtrace:
  Uptime: 3m18s
  Dumping 10 MB (3 chunks)
  chunk 0: 11MB (2648 pages) ... ok
  chunk 1: 1MB (24 pages) ... ok
  chunk 2: 1MB (2 pages)panic: IOMMU mapping error: -4
  
  cpuid = 40
  Uptime: 3m18s
  
  
  
  Since Hardware Transactional Memory is not yet supported by FreeBSD, treat
  this as an illegal instruction.
  
  PR:   224350
  Submitted by: Gustavo Romero 
  MFC after:2 weeks

Modified:
  head/sys/powerpc/include/trap.h
  head/sys/powerpc/powerpc/trap.c

Modified: head/sys/powerpc/include/trap.h
==
--- head/sys/powerpc/include/trap.h Fri Dec 15 03:46:52 2017
(r326869)
+++ head/sys/powerpc/include/trap.h Fri Dec 15 04:11:20 2017
(r326870)
@@ -80,6 +80,9 @@
 #defineEXC_HEA 0x0e40  /* Hypervisor Emulation 
Assistance */
 #defineEXC_VSX 0x0f40  /* VSX Unavailable */
 
+/* Power ISA 2.07+: */
+#defineEXC_FAC 0x0f60  /* Facility Unavailable */
+
 /* The following are available on 4xx and 85xx */
 #defineEXC_CRIT0x0100  /* Critical Input Interrupt */
 #defineEXC_PIT 0x1000  /* Programmable Interval Timer 
*/

Modified: head/sys/powerpc/powerpc/trap.c
==
--- head/sys/powerpc/powerpc/trap.c Fri Dec 15 03:46:52 2017
(r326869)
+++ head/sys/powerpc/powerpc/trap.c Fri Dec 15 04:11:20 2017
(r326870)
@@ -135,6 +135,7 @@ static struct powerpc_exception powerpc_exceptions[] =
{ EXC_PERF, "performance monitoring" },
{ EXC_VEC,  "altivec unavailable" },
{ EXC_VSX,  "vsx unavailable" },
+   { EXC_FAC,  "facility unavailable" },
{ EXC_ITMISS,   "instruction tlb miss" },
{ EXC_DLMISS,   "data load tlb miss" },
{ EXC_DSMISS,   "data store tlb miss" },
@@ -277,6 +278,11 @@ trap(struct trapframe *frame)
save_fpu(td);
td->td_pcb->pcb_flags |= PCB_VSX;
enable_fpu(td);
+   break;
+
+   case EXC_FAC:
+   sig = SIGILL;
+   ucode = ILL_ILLOPC;
break;
 
case EXC_VECAST_E:
___
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: r326872 - head/usr.sbin/pw

2017-12-14 Thread Eugene Grosbein
Author: eugen
Date: Fri Dec 15 06:05:16 2017
New Revision: 326872
URL: https://svnweb.freebsd.org/changeset/base/326872

Log:
  pw(8): r326738 broke expiration arithmetic in case of `-D' flag not supplied.
  
  Fix it and rename misnamed time_t variables `expire_days, password_days'
  (always holding absolute time) to `expire_time, password_time'.
  
  Add a comment for a case of overloading `cmdcnf->password_days'
  and `cmdcnf->expire_days' with absolute time.
  
  Reported by:  markj
  Approved by:  mav (mentor)
  MFC after:1 week

Modified:
  head/usr.sbin/pw/pw_user.c

Modified: head/usr.sbin/pw/pw_user.c
==
--- head/usr.sbin/pw/pw_user.c  Fri Dec 15 04:51:47 2017(r326871)
+++ head/usr.sbin/pw/pw_user.c  Fri Dec 15 06:05:16 2017(r326872)
@@ -1385,11 +1385,12 @@ pw_user_add(int argc, char **argv, char *arg1)
pwd->pw_uid = pw_uidpolicy(cmdcnf, id);
pwd->pw_gid = pw_gidpolicy(cnf, grname, pwd->pw_name,
(gid_t) pwd->pw_uid, dryrun);
-   
+
+   /* cmdcnf->password_days and cmdcnf->expire_days hold unixtime here */
if (cmdcnf->password_days > 0)
-   pwd->pw_change = now + cmdcnf->password_days * 86400L;
+   pwd->pw_change = cmdcnf->password_days;
if (cmdcnf->expire_days > 0)
-   pwd->pw_expire = now + cmdcnf->expire_days * 86400L;
+   pwd->pw_expire = cmdcnf->expire_days;
 
pwd->pw_dir = pw_homepolicy(cmdcnf, homedir, pwd->pw_name);
pwd->pw_shell = pw_shellpolicy(cmdcnf);
@@ -1523,9 +1524,9 @@ pw_user_mod(int argc, char **argv, char *arg1)
bool quiet, createhome, pretty, dryrun, nis, edited;
bool precrypted;
mode_t homemode = 0;
-   time_t expire_days, password_days, now;
+   time_t expire_time, password_time, now;
 
-   expire_days = password_days = -1;
+   expire_time = password_time = -1;
gecos = homedir = grname = name = newname = skel = shell =NULL;
passwd = NULL;
class = nispasswd = NULL;
@@ -1561,10 +1562,10 @@ pw_user_mod(int argc, char **argv, char *arg1)
homedir = optarg;
break;
case 'e':
-   expire_days = parse_date(now, optarg);
+   expire_time = parse_date(now, optarg);
break;
case 'p':
-   password_days = parse_date(now, optarg);
+   password_time = parse_date(now, optarg);
break;
case 'g':
group_from_name_or_id(optarg);
@@ -1699,13 +1700,13 @@ pw_user_mod(int argc, char **argv, char *arg1)
}
 
 
-   if (password_days >= 0) {
-   pwd->pw_change = now + password_days * 86400L;
+   if (password_time >= 0 && pwd->pw_change != password_time) {
+   pwd->pw_change = password_time;
edited = true;
}
 
-   if (expire_days >= 0) {
-   pwd->pw_expire = now + expire_days * 86400L;
+   if (expire_time >= 0 && pwd->pw_expire != expire_time) {
+   pwd->pw_expire = expire_time;
edited = true;
}
 
___
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: r326869 - head/share/misc

2017-12-14 Thread Eitan Adler
Author: eadler
Date: Fri Dec 15 03:46:52 2017
New Revision: 326869
URL: https://svnweb.freebsd.org/changeset/base/326869

Log:
  bsd-family-tree: add dfly 5.0.[12]

Modified:
  head/share/misc/bsd-family-tree

Modified: head/share/misc/bsd-family-tree
==
--- head/share/misc/bsd-family-tree Fri Dec 15 03:36:48 2017
(r326868)
+++ head/share/misc/bsd-family-tree Fri Dec 15 03:46:52 2017
(r326869)
@@ -354,10 +354,14 @@ FreeBSD 5.2   |  | |  
  | |  |   | | *- NetBSD 7.1|   |
  | |  | macOS   |  |   DragonFly 4.8.0
  | |  | 10.13   | OpenBSD 6.1  |
- |  FreeBSD   |   | |  |   |
+ |  FreeBSD   |   | |  |   DragonFly 5.0.0
  |   11.1  FreeBSD| |  |   |
- | |10.4  | | OpenBSD 6.2  |
- | v  | |  |   DragonFly 5.0.0
+ | |10.4  | | OpenBSD 6.2  DragonFly 5.0.1
+ | |  | |  |   |
+ | |  | |  |   DragonFly 5.0.2
+ | |  | |  |   |
+ | |  | |  |   |
+ | v  | |  |   |
  || |  |   |
 FreeBSD 12 -current   | NetBSD -current   OpenBSD -currentDragonFly 
-current
  || |  |   |
@@ -723,6 +727,8 @@ macOS 10.13 2017-09-25 [APL]
 FreeBSD 10.4   2017-10-03 [FBD]
 OpenBSD 6.22017-10-09 [OBD]
 DragonFly 5.0.02017-10-16 [DFB]
+DragonFly 5.0.12017-11-06 [DFB]
+DragonFly 5.0.22017-12-04 [DFB]
 
 Bibliography
 
___
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: r326809 - head/sys/dev/cardbus

2017-12-14 Thread Warner Losh
On Thu, Dec 14, 2017 at 11:02 PM, Eugene Grosbein 
wrote:

> 15.12.2017 6:50, Warner Losh wrote:
> >
> >
> > On Thu, Dec 14, 2017 at 5:00 PM, Eugene Grosbein  > wrote:
> >
> > 14.12.2017 23:27, Warner Losh wrote:
> >
> > > - zfsloader(8) failing to find any ZFS pool after zfsboot(8)
> successfully
> > > loaded and started zfsload(8) from zpool (PR pending, need to
> collect more info)
> > >
> > >
> > > GPT or MBR?
> >
> > MBR, no GELI used.
> > when you update, you're updating both halves of the loader, right?
>
> I do not get it, what are "halves of the loader"?
> I know zfsboot should be installed in parts but it finds boot pool just
> fine
> and I do not update it. As for zfsloader, I install it with to
> /boot/zfsloader
> with simple "make install" command.


So you are using the old zfsboot then?

And if you didn't do something like:

dd if=${dst}/boot/zfsboot of=/tmp/zfsboot1 count=1
gpart bootcode -b /tmp/zfsboo1 ${dev}s${s}
sysctl kern.geom.debugflags=0x10
dd if=${dst}/boot/zfsboot iseek=1 seek=1024 of=/dev/${dev}s${s}
sysctl kern.geom.debugflags=0x0

then you're using the new zfsloader with old zfsboot blocks. Which should
work just fine, but is apparently failing.

Warner
___
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: r326871 - in head/sys/dev: bhnd bhnd/bcma bhnd/bhndb bhnd/cores/pmu bhnd/nvram bhnd/siba bwn

2017-12-14 Thread Landon J. Fuller
Author: landonf
Date: Fri Dec 15 04:51:47 2017
New Revision: 326871
URL: https://svnweb.freebsd.org/changeset/base/326871

Log:
  bhnd(4)/bwn(4): Fix a number of small issues reported by Coverity.
  
  - Fix reference of uninitialized error value in bhndb_generic_resume() if
the dynamic window count is 0.
  
  - Fix incorrect bhnd_pmu(4) UPTME_MASK and PLL0_PC2_WILD_INT_MASK
constants.
  
  - Variable definitions referenced by our generated SPROM layouts will never
be NULL, but add explicit asserts to make that clear.
  
  - Add missing variable initialization in bhnd_nvram_sprom_ident().
  
  - Fix leak of driver array in bhnd_erom_probe_driver_classes().
  
  - Fix zero-length memset() in bhndb_pci_eio_init().
  
  - Fix an off-by-one error and potential invalid OOBSEL bit shift operation
in bcma_dinfo_init_intrs().
  
  - Remove dead code in siba_suspend_hw().
  
  - Fix duplicate call to bhnd_pmu_enable_regulator() in both the enable and
disable code paths of bhnd_compat_cc_pmu_set_ldoparef().
  
  Reported by:  Coverity
  CIDs: 1355194, 1362020, 1362022, 1373114, 1366563, 1373115,
1381569, 1381579, 1383555, 1383566, 1383571
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/dev/bhnd/bcma/bcma_dmp.h
  head/sys/dev/bhnd/bcma/bcma_subr.c
  head/sys/dev/bhnd/bhnd_erom.c
  head/sys/dev/bhnd/bhndb/bhndb.c
  head/sys/dev/bhnd/bhndb/bhndb_pci.c
  head/sys/dev/bhnd/cores/pmu/bhnd_pmureg.h
  head/sys/dev/bhnd/nvram/bhnd_nvram_data_sprom.c
  head/sys/dev/bhnd/siba/siba.c
  head/sys/dev/bwn/if_bwn_siba_compat.c

Modified: head/sys/dev/bhnd/bcma/bcma_dmp.h
==
--- head/sys/dev/bhnd/bcma/bcma_dmp.h   Fri Dec 15 04:11:20 2017
(r326870)
+++ head/sys/dev/bhnd/bcma/bcma_dmp.h   Fri Dec 15 04:51:47 2017
(r326871)
@@ -223,7 +223,7 @@
 /* OOBSEL(IN|OUT) */
 #defineBCMA_DMP_OOBSEL_MASK0xFF/**< OOB 
selector mask */
 #defineBCMA_DMP_OOBSEL_EN  (1<<7)  /**< OOB 
selector enable bit */
-#defineBCMA_DMP_OOBSEL_SHIFT(_sel) ((_sel % BCMA_OOB_NUM_SEL) * 8)
+#defineBCMA_DMP_OOBSEL_SHIFT(_sel) ((_sel % 4) * 8)
 #defineBCMA_DMP_OOBSEL_BUSLINE_MASK0x7F/**< OOB 
selector bus line mask */
 #defineBCMA_DMP_OOBSEL_BUSLINE_SHIFT   0
 

Modified: head/sys/dev/bhnd/bcma/bcma_subr.c
==
--- head/sys/dev/bhnd/bcma/bcma_subr.c  Fri Dec 15 04:11:20 2017
(r326870)
+++ head/sys/dev/bhnd/bcma/bcma_subr.c  Fri Dec 15 04:51:47 2017
(r326871)
@@ -282,7 +282,7 @@ bcma_dinfo_init_intrs(device_t bus, device_t child,
/* Fetch width of the OOB interrupt bank */
oobw = bhnd_bus_read_4(dinfo->res_agent,
 BCMA_DMP_OOB_OUTWIDTH(BCMA_OOB_BANK_INTR));
-   if (oobw > BCMA_OOB_NUM_SEL) {
+   if (oobw >= BCMA_OOB_NUM_SEL) {
device_printf(bus, "ignoring invalid OOBOUTWIDTH for core %u: "
"%#x\n", BCMA_DINFO_COREIDX(dinfo), oobw);
return (0);

Modified: head/sys/dev/bhnd/bhnd_erom.c
==
--- head/sys/dev/bhnd/bhnd_erom.c   Fri Dec 15 04:11:20 2017
(r326870)
+++ head/sys/dev/bhnd/bhnd_erom.c   Fri Dec 15 04:51:47 2017
(r326871)
@@ -145,6 +145,7 @@ bhnd_erom_probe_driver_classes(devclass_t bus_devclass
break;
}
 
+   free(drivers, M_TEMP);
return (erom_cls);
 }
 

Modified: head/sys/dev/bhnd/bhndb/bhndb.c
==
--- head/sys/dev/bhnd/bhndb/bhndb.c Fri Dec 15 04:11:20 2017
(r326870)
+++ head/sys/dev/bhnd/bhndb/bhndb.c Fri Dec 15 04:51:47 2017
(r326871)
@@ -687,6 +687,7 @@ bhndb_generic_resume(device_t dev)
/* Guarantee that all in-use dynamic register windows are mapped to
 * their previously configured target address. */
BHNDB_LOCK(sc);
+   error = 0;
for (size_t i = 0; i < bus_res->dwa_count; i++) {
dwa = _res->dw_alloc[i];


Modified: head/sys/dev/bhnd/bhndb/bhndb_pci.c
==
--- head/sys/dev/bhnd/bhndb/bhndb_pci.c Fri Dec 15 04:11:20 2017
(r326870)
+++ head/sys/dev/bhnd/bhndb/bhndb_pci.c Fri Dec 15 04:51:47 2017
(r326871)
@@ -1297,7 +1297,7 @@ static int
 bhndb_pci_eio_init(struct bhndb_pci_eio *pio, device_t dev, device_t pci_dev,
 struct bhndb_host_resources *hr)
 {
-   memset(>eio, sizeof(pio->eio), 0);
+   memset(>eio, 0, sizeof(pio->eio));
pio->eio.map = bhndb_pci_eio_map;
pio->eio.read = bhndb_pci_eio_read;
pio->eio.fini = NULL;

Modified: head/sys/dev/bhnd/cores/pmu/bhnd_pmureg.h

svn commit: r326874 - head/tools/boot

2017-12-14 Thread Warner Losh
Author: imp
Date: Fri Dec 15 06:34:27 2017
New Revision: 326874
URL: https://svnweb.freebsd.org/changeset/base/326874

Log:
  Script to generate minimal boot images for each of the 24 supported
  boot images for x86. This will be enhanced to generate all the other
  images (u-boot, powerpc CHRP, etc).
  
  At the moment, it's only generating three of them. zfs+gpt+legacy
  works with qemu:
qemu-system-x86_64 --drive file=${file},format=raw -serial 
telnet::,server
  but the ufs ones still have issues I'm tracking down.
  
  These images are the boot blocks, /boot/loader, a kernel, maybe a
  couple of modules, /sbin/init, /bin/sh, /libexec/ld-elf.so, libc.so,
  libedit and libncursesw. This is just enough to get to single user. At
  the moment, these come from the host system, but should come from
  OBJTOP.
  
  At the moment, this requires root to build since the zfs tools require
  it (and GELI will too when we add support for that).
  
  Sponsored by: Netflix

Added:
  head/tools/boot/rootgen.sh   (contents, props changed)

Added: head/tools/boot/rootgen.sh
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/boot/rootgen.sh  Fri Dec 15 06:34:27 2017(r326874)
@@ -0,0 +1,213 @@
+#!/bin/sh
+
+# $FreeBSD$
+
+#
+# Builds all the bat-shit crazy combinations we support booting from,
+# at least for amd64. It assume you have a ~sane kernel in /boot/kernel
+# and copies that into the ~150MB root images we create (we create the du
+# size of the kernel + 20MB
+#
+# Sad panda sez: this runs as root, but could be userland if someone
+# creates userland geli and zfs tools.
+#
+# This assumes an external prograam install-boot.sh which will install
+# the appropriate boot files in the appropriate locations.
+#
+# These images assume ada0 will be the root image. We should likely
+# use labels, but we don't.
+#
+# ASsumes you've already rebuilt... maybe bad? Also maybe bad: the env
+# vars should likely be conditionally set to allow better automation.
+#
+
+cpsys() {
+src=$1
+dst=$2
+
+# Copy kernel + boot loader
+(cd $src ; tar cf - .) | (cd $dst; tar xf -)
+}
+
+mk_nogeli_gpt_ufs_legacy() {
+src=$1
+img=$2
+
+rm -f ${img} ${img}.p2
+makefs -t ffs -B little -s 200m ${img}.p2 ${src}
+mkimg -s gpt -b ${src}/boot/pmbr \
+ -p freebsd-boot:=${src}/boot/gptboot \
+ -p freebsd-ufs:=${img}.p2 -o ${img}
+}
+
+mk_nogeli_gpt_ufs_uefi() {
+src=$1
+img=$2
+
+rm -f ${img} ${img}.p2
+makefs -t ffs -B little -s 200m ${img}.p2 ${src}
+mkimg -s gpt -b ${src}/boot/pmbr \
+ -p freebsd-boot:=${src}/boot/gptboot \
+ -p freebsd-ufs:=${img}.p2 -o ${img}
+}
+
+mk_nogeli_gpt_ufs_both() {
+src=$1
+img=$2
+
+makefs -t ffs -B little -s 200m ${img}.p3 ${src}
+# p1 is boot for uefi, p2 is boot for gpt, p3 is /
+mkimg -b ${src}/boot/pmbr -s gpt \
+ -p efi:=${src}/boot/boot1.efifat \
+ -p freebsd-boot:=${src}/boot/gptboot \
+ -p freebsd-ufs:=${img}.p3 \
+ -o ${img}
+}
+
+mk_nogeli_gpt_zfs_legacy() {
+src=$1
+img=$2
+mntpt=$3
+geli=$4
+scheme=$5
+fs=$6
+bios=$7
+pool=nogeli-gpt-zfs-legacy
+
+rm -f ${img}
+dd if=/dev/zero of=${img} count=1 seek=$((200 * 1024 * 1024 / 512))
+md=$(mdconfig -f ${img})
+gpart create -s gpt ${md}
+gpart add -t freebsd-boot -s 400k -a 4k${md}   # <= ~540k
+gpart add -t freebsd-zfs -l root $md
+# install-boot will make this bootable
+zpool create -O mountpoint=none -R ${mntpt} ${pool} ${md}p2
+zpool set bootfs=${pool} ${pool}
+zfs create -o mountpoint=/ ${pool}/ROOT
+# NB: The online guides go nuts customizing /var and other mountpoints 
here, no need
+cpsys ${src} ${mntpt}
+df
+# need to make a couple of tweaks
+cat > ${mntpt}/boot/loader.conf < ${DESTDIR}/boot.config
+# XXX
+cp /boot/device.hints ${DESTDIR}/boot/device.hints
+# Assume we're already built
+make install DESTDIR=${DESTDIR} MK_MAN=no MK_INSTALL_AS_USER=yes
+# Copy init, /bin/sh and minimal libraries
+mkdir -p ${DESTDIR}/sbin ${DESTDIR}/bin ${DESTDIR}/lib ${DESTDIR}/libexec
+for f in /sbin/init /bin/sh $(ldd /bin/sh | awk 'NF == 4 { print $3; }') 
/libexec/ld-elf.so.1; do
+cp $f ${DESTDIR}/$f
+done
+mkdir ${DESTDIR}/dev
+
+# OK. Let the games begin
+
+for geli in nogeli geli; do
+for scheme in gpt mbr; do
+   for fs in ufs zfs; do
+   for bios in legacy uefi both; do
+   # Create sparse file and mount newly created filesystem(s) on it
+   img=${IMGDIR}/${geli}-${scheme}-${fs}-${bios}.img
+   echo "vv   Creating $img  
vvv"
+   eval mk_${geli}_${scheme}_${fs}_${bios} ${DESTDIR} ${img} 
${MNTPT} ${geli} ${scheme} ${fs} ${bios}
+   echo "^^   Creating $img  

svn commit: r326873 - head/tools/boot

2017-12-14 Thread Warner Losh
Author: imp
Date: Fri Dec 15 06:34:11 2017
New Revision: 326873
URL: https://svnweb.freebsd.org/changeset/base/326873

Log:
  Script that knows how to put boot blocks onto a device.  Eventually,
  this will be installed into /usr/sbin, but for now it's just used for
  the boot loader regression script. It's still a bit green, and likely
  will get edge cases wrong still. It's also x86 centric at the moment,
  but will be enhanced shortly for u-boot, CHRP PowerPC and other
  methods.
  
  Sponsored by: Netflix

Added:
  head/tools/boot/install-boot.sh   (contents, props changed)

Added: head/tools/boot/install-boot.sh
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/boot/install-boot.sh Fri Dec 15 06:34:11 2017
(r326873)
@@ -0,0 +1,128 @@
+#!/bin/sh
+
+# $FreeBSD$
+
+#
+# Installs/updates the necessary boot blocks for the desired boot environment
+#
+# Lightly tested.. Intended to be installed, but until it matures, it will just
+# be a boot tool for regression testing.
+
+# insert code here to guess what you have -- yikes!
+
+die() {
+echo $*
+exit 1
+}
+
+find-part() {
+dev=$1
+part=$2
+
+gpart show $dev | tail +2 | awk '$4 == "'$part'" { print $3; }'
+}
+
+boot_nogeli_gpt_zfs_legacy() {
+dev=$1
+dst=$2
+
+idx=$(find-part $dev "freebsd-boot")
+if [ -z "$idx" ] ; then
+   die "No freebsd-boot partition found"
+fi
+gpart bootcode -b ${gpt0} -p ${gpt2} -i $idx $dev
+exit 0
+}
+
+boot_nogeli_gpt_ufs_legacy() {
+dev=$1
+dst=$2
+
+idx=$(find-part $dev "freebsd-boot")
+if [ -z "$idx" ] ; then
+   die "No freebsd-boot partition found"
+fi
+gpart bootcode -b ${gpt0} -p ${gpt2} -i $idx $dev
+exit 0
+}
+
+boot_nogeli_mbr_zfs_legacy() {
+dev=$1
+dst=$2
+
+# search to find the BSD slice
+s=$(findpart $dev "freebsd-zfs")
+if [ -z "$s" ] ; then
+   die "No freebsd-zfs slice found"
+fi
+# search to find the freebsd-zfs partition within the slice
+# Or just assume it is 'a' because it has to be since it fails otherwise
+dd if=${dst}/boot/zfsboot of=/tmp/zfsboot1 count=1
+gpart bootcode -b /tmp/zfsboo1 ${dev}s${s} # Put boot1 into the start of 
part
+sysctl kern.geom.debugflags=0x10
+dd if=${dst}/boot/zfsboot iseek=1 seek=1024# Put boot2 into ZFS 
boot slot
+sysctl kern.geom.debugflags=0x0
+
+exit 0
+}
+
+boot_nogeli_mbr_ufs_legacy() {
+dev=$1
+dst=$2
+
+gpart bootcode -b ${mbr0} ${dev}
+s=$(findpart $dev "freebsd-ufs")
+if [ -z "$s" ] ; then
+   die "No freebsd-zfs slice found"
+fi
+gpart bootcode -p ${mbr2} ${dev}s${s}
+exit 0
+}
+
+DESTDIR=/
+
+# Note: we really don't support geli boot in this script yet.
+geli=nogeli
+
+while getopts "b:d:f:g:o:s:" opt; do
+case "$opt" in
+   b)
+   bios=${OPTARG}
+   ;;
+   d)
+   DESTDIR=${OPTARG}
+   ;;
+   f)
+   fs=${OPTARG}
+   ;;
+   g)
+   case ${OPTARG} in
+   [Yy][Ee][Ss]|geli) geli=geli ;;
+   *) geli=nogeli ;;
+   esac
+   ;;
+   o)
+   opts=${OPTARG}
+   ;;
+   s)
+   scheme=${OPTARG}
+   ;;
+esac
+done
+
+shift $((OPTIND-1))
+dev=$1
+
+# For gpt, we need to install pmbr as the primary boot loader
+# it knows about 
+gpt0=${DESTDIR}/boot/pmbr
+gpt2=${DESTDIR}/boot/gptboot
+gptzfs2=${DESTDIR}/boot/gptzfsboot
+
+# For MBR, we have lots of choices, but select boot0
+mbr0=${DESTDIR}/boot/boot0
+mbr2=${DESTDIR}/boot/boot
+
+# sanity check here
+
+eval boot_${geli}_${scheme}_${fs}_${bios} $dev $DESTDIR $opts || echo 
"Unsupported boot env: ${geli}-${scheme}-${fs}-${bios}"
___
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: r326867 - head/sys/i386/acpica

2017-12-14 Thread Bruce Evans
Author: bde
Date: Fri Dec 15 03:05:14 2017
New Revision: 326867
URL: https://svnweb.freebsd.org/changeset/base/326867

Log:
  Minor cleanups found while fixing a bug involving double mapping of low
  memory:
  
  Load the kernel eflags less magically, as in locore.  The magic increased
  when I removed eflags from the pcb in r305899.
  
  Remove a jump to low memory that became garbage when the i386 version was
  mostly replaced by the amd64 version in r235622.
  
  The amd64 version is very similar.  It still loads the flags magically,
  but is not missing comments about using the special page table.
  
  Reviewed by:  kib

Modified:
  head/sys/i386/acpica/acpi_wakecode.S

Modified: head/sys/i386/acpica/acpi_wakecode.S
==
--- head/sys/i386/acpica/acpi_wakecode.SThu Dec 14 23:21:31 2017
(r326866)
+++ head/sys/i386/acpica/acpi_wakecode.SFri Dec 15 03:05:14 2017
(r326867)
@@ -50,17 +50,19 @@
.code16
 wakeup_start:
/*
-* Set up segment registers for real mode, a small stack for
-* any calls we make, and clear any flags.
+* Set up segment registers for real mode and a small stack for
+* any calls we make.  Set up full 32-bit bootstrap kernel flags
+* since resumectx() doesn't restore flags.  PSL_KERNEL gives
+* bootstrap kernel flags (with interrupts disabled), not normal
+* kernel flags.
 */
cli /* make sure no interrupts */
mov %cs, %ax/* copy %cs to %ds.  Remember these */
mov %ax, %ds/* are offsets rather than selectors */
mov %ax, %ss
movw$PAGE_SIZE, %sp
-   xorw%ax, %ax
-   pushw   %ax
-   popfw
+   pushl   $PSL_KERNEL
+   popfl
 
/* To debug resume hangs, beep the speaker if the user requested. */
testb   $~0, resume_beep - wakeup_start
@@ -156,8 +158,6 @@ wakeup_32:
orl $CR0_PG, %eax
mov %eax, %cr0
 
-   jmp 1f
-1:
/* Jump to return address. */
jmp *%edx
 
___
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: r326870 - in head/sys/powerpc: include powerpc

2017-12-14 Thread Justin Hibbits
On Thu, Dec 14, 2017 at 10:11 PM, Justin Hibbits  wrote:
> Author: jhibbits
> Date: Fri Dec 15 04:11:20 2017
> New Revision: 326870
> URL: https://svnweb.freebsd.org/changeset/base/326870
>
> Log:
>   Handle the Facility Unavailable exception as a SIGILL
>
>   Currently Facility Unavailable is absent and once an application
>   tries to use or access a register from a feature disabled in the
>   CPU it causes a kernel panic.
>
>   A simple test-case is:
>
>   int main() { asm volatile ("tbegin.;"); }
>
>   which will use TM (Hardware Transactional Memory) feature which
>   is not supported by the kernel and so will trigger the following
>   kernel panic:
>
>   
>
>   fatal user trap:
>
>   exception   = 0xf60 (unknown)
>   srr0= 0x1890
>   srr1= 0x8000f032
>   lr  = 0x14e4
>   curthread   = 0x5f93000
>   pid = 1021, comm = htm
>
>   panic: unknown trap
>   cpuid = 40
>   KDB: stack backtrace:
>   Uptime: 3m18s
>   Dumping 10 MB (3 chunks)
>   chunk 0: 11MB (2648 pages) ... ok
>   chunk 1: 1MB (24 pages) ... ok
>   chunk 2: 1MB (2 pages)panic: IOMMU mapping error: -4
>
>   cpuid = 40
>   Uptime: 3m18s
>
>   
>
>   Since Hardware Transactional Memory is not yet supported by FreeBSD, treat
>   this as an illegal instruction.
>
>   PR:   224350
>   Submitted by: Gustavo Romero 

... and of course I can't read... missed part of the email address (br.ibm.com)
___
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: r326868 - head/share/misc

2017-12-14 Thread Eitan Adler
Author: eadler
Date: Fri Dec 15 03:36:48 2017
New Revision: 326868
URL: https://svnweb.freebsd.org/changeset/base/326868

Log:
  bsd-family-tree: Add NetBSD 7.0.2
  
  Pulled directly from NetBSD

Modified:
  head/share/misc/bsd-family-tree

Modified: head/share/misc/bsd-family-tree
==
--- head/share/misc/bsd-family-tree Fri Dec 15 03:05:14 2017
(r326867)
+++ head/share/misc/bsd-family-tree Fri Dec 15 03:36:48 2017
(r326868)
@@ -339,28 +339,29 @@ FreeBSD 5.2   |  | |  
  | |  |  | |   DragonFly 4.2.0
  |  FreeBSD   |  | |   |
  |   10.2 |  | |   |
- | |macOS  NetBSD 7.0   |   |
- | |10.11|OpenBSD 5.8  |
- | |  |  | |   DragonFly 4.4.1
- |  FreeBSD   |  |OpenBSD 5.9  |
- |   10.3 |  | |   |
- | |  |   NetBSD 7.0.1 |   |
- | `--.   |  | |   DragonFly 4.6.0
- ||   |  | |   |
- ||   |  | |   |
- *--FreeBSD   | macOS|OpenBSD 6.0  |
- |   11.0 | 10.12| |   |
- | |  |   |   NetBSD 7.1   |   |
- | |  | macOS| |   DragonFly 4.8.0
- | |  | 10.13|OpenBSD 6.1  |
- |  FreeBSD   |   |  | |   |
- |   11.1  FreeBSD|  | |   |
- | |10.4  |  |OpenBSD 6.2  |
- | v  |  | |   DragonFly 5.0.0
- ||  | |   |
-FreeBSD 12 -current   |  NetBSD -current  OpenBSD -currentDragonFly 
-current
- ||  | |   |
- vv  v v   v
+ | |macOS  NetBSD 7.0  |   |
+ | |10.11   | | | OpenBSD 5.8  |
+ | |  | | | `--.   |   DragonFly 4.4.1
+ |  FreeBSD   | | ||  OpenBSD 5.9  |
+ |   10.3 | | ||   |   |
+ | |  | | | NetBSD 7.0.1   |   |
+ | `--.   | | ||   |   DragonFly 4.6.0
+ ||   | | ||   |   |
+ ||   | | ||   |   |
+ *--FreeBSD   | macOS   | ||  OpenBSD 6.0  |
+ |   11.0 | 10.12   | | NetBSD 7.0.2   |   |
+ | |  |   | | ||   |
+ | |  |   | | *- NetBSD 7.1|   |
+ | |  | macOS   |  |   DragonFly 4.8.0
+ | |  | 10.13   | OpenBSD 6.1  |
+ |  FreeBSD   |   | |  |   |
+ |   11.1  FreeBSD| |  |   |
+ | |10.4  | | OpenBSD 6.2  |
+ | v  | |  |   DragonFly 5.0.0
+ || |  |   |
+FreeBSD 12 -current   | NetBSD -current   OpenBSD -currentDragonFly 
-current
+ || |  |   |
+ vv v  v   v
 
 Time
 
@@ -712,6 +713,7 @@ NetBSD 7.0.12016-05-22 [NBD]
 DragonFly 4.6.02016-08-02 [DFB]
 OpenBSD 6.02016-09-01 [OBD]
 macOS 10.122016-09-20 [APL]
+NetBSD 7.0.2   2016-10-21 [NBD]
 FreeBSD 11.0   2016-10-10 [FBD]
 NetBSD 7.1 2017-03-11 [NBD]
 DragonFly 4.8.02017-03-27 [DFB]
@@ -786,3 +788,4 @@ Copyright (c) 1997-2012 Wolfram Schneider 

svn commit: r326875 - head/tools/boot

2017-12-14 Thread Warner Losh
Author: imp
Date: Fri Dec 15 06:44:11 2017
New Revision: 326875
URL: https://svnweb.freebsd.org/changeset/base/326875

Log:
  Add missing of=/dev/${dev}s${s} when installing zfsboot.

Modified:
  head/tools/boot/install-boot.sh

Modified: head/tools/boot/install-boot.sh
==
--- head/tools/boot/install-boot.sh Fri Dec 15 06:34:27 2017
(r326874)
+++ head/tools/boot/install-boot.sh Fri Dec 15 06:44:11 2017
(r326875)
@@ -59,8 +59,8 @@ boot_nogeli_mbr_zfs_legacy() {
 # Or just assume it is 'a' because it has to be since it fails otherwise
 dd if=${dst}/boot/zfsboot of=/tmp/zfsboot1 count=1
 gpart bootcode -b /tmp/zfsboo1 ${dev}s${s} # Put boot1 into the start of 
part
-sysctl kern.geom.debugflags=0x10
-dd if=${dst}/boot/zfsboot iseek=1 seek=1024# Put boot2 into ZFS 
boot slot
+sysctl kern.geom.debugflags=0x10   # Put boot2 into ZFS boot slot
+dd if=${dst}/boot/zfsboot of=/dev/${dev}s${s} iseek=1 seek=1024
 sysctl kern.geom.debugflags=0x0
 
 exit 0
___
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: r326758 - in head/sys/i386: conf include

2017-12-14 Thread Konstantin Belousov
On Thu, Dec 14, 2017 at 07:04:57PM +0700, Eugene Grosbein wrote:
> On 14.12.2017 18:51, Konstantin Belousov wrote:
> 
> >> I think thats's NFS code who is guilty. You can see example of amd64 
> >> (sic!) kstack exhaustion
> >> due to 40+ frames deep call chain here:
> >>
> >> https://lists.freebsd.org/pipermail/freebsd-stable/2017-July/087429.html
> > 
> > Yes, NFS crosses network/VFS and often VM boundaries, so each subsystem
> > adds its usual stack use footprint to the overall picture.  NFS reconnect
> > is especially hard in this regard, and in case the direct dispatch is
> > triggered (in this case over loopback) machine has no chance.
> > 
> > The backtrace you cited just reinforces the point that the i386 commit
> > is wrong. It breaks the workload we aims as the main FreeBSD target,
> > which is generic-purpose Unix workstation or server. The commit tries
> > to make defaults fit for specific appliance load of router with IPSEC
> > or ZFS on i386, which require extensive tuning on i386 anyway. Worse,
> > as you prove above, the commit in fact does not fix the issues, it only
> > papers over them and move easily triggered faults from one configuration
> > to another.
> 
> Modern FreeBSD usage as workstation/server should not exclude IPv6, SCTP, 
> WiFi,
> and even ZFS nor IPSEC for i386. GENERIC kernel should not panic due to low 
> volume
> network activity with default settings.
And two ponies should be given to everybody who wishes for them.

> 
> Perhaps, it's time to make KVA_PAGES loader tunnable too?
Sure, make it the tunable.  Just to make you know in advance, this is quite
delicate.

> And/or increase its default for i386 upto some value corresponding to stable 
> management
> of kern.threads.max_threads_per_proc=1500 (by default) with kstack_pages=4 ?
> 
> Maybe, KVA_PAGES=384 (1.5GB for 1500 threads)?
Sigh. This would make i386 even less usable for everybody, perhaps
except you. Because default 3G of UVA is too small for some common tasks
(thanks clang, but also e.g. pypy), and you reduce the user address
space even more.
___
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: r326809 - head/sys/dev/cardbus

2017-12-14 Thread Eugene Grosbein
On 14.12.2017 20:38, Alexey Dokuchaev wrote:
> On Thu, Dec 14, 2017 at 02:36:48AM +0700, Eugene Grosbein wrote:
>> 14.12.2017 1:24, Alexey Dokuchaev wrote:
>> ...
>>> One does not tweak FreeBSD, it just works. (tm)
>>
>> Hmm. Do you really think so?
> 
> I do.
> 
>> I can assure you this is not true.  There are numerous ways to take
>> down untweaked FreeBSD system.
> 
> This means that there are bugs that should be fixed.

Sure.

> Do you have PR numbers?

To start with:

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=224218
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=223824
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=223803
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=204700

Etc., but I should not recite our Bugzilla here.

And that hilaroius "75-frames" NFS-related panic requiring tweaks:
https://lists.freebsd.org/pipermail/freebsd-stable/2017-July/087477.html

There are problems other kinds of problems, that is:

- a need to increase kern.cam.boot_delay/kern.cam.scsi_delay (or similar newer 
tweaks)
to make boot happen;

- firewall_nat_enable="YES" with GENERIC kernel requires manual loading of 
modules
like alias_ftp.ko or alias_pptp.ko or else NAT would be useless for such 
transit traffic;

- net.isr.maxthreads may be erronously set to 1 by default affecting performance
and requiring manual tweak;

- zfsloader(8) failing to find any ZFS pool after zfsboot(8) successfully
loaded and started zfsload(8) from zpool (PR pending, need to collect more info)

- net.graph.maxdata/net.graph.maxalloc do not auto-scale resulting in DoS
and lots of other problems within NETGRAPH...

I use FreeBSD in many diverse environments and if I strain my memory, I can 
remember more.
(NFS itself is full of surprises...)

___
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: r326844 - head/usr.sbin/mailwrapper

2017-12-14 Thread Baptiste Daroussin
Author: bapt
Date: Thu Dec 14 08:57:37 2017
New Revision: 326844
URL: https://svnweb.freebsd.org/changeset/base/326844

Log:
  Replace usage of fparselen(3) by a getline(3)
  
  This allow to remove the dependency on libutil

Modified:
  head/usr.sbin/mailwrapper/Makefile
  head/usr.sbin/mailwrapper/Makefile.depend
  head/usr.sbin/mailwrapper/mailwrapper.c

Modified: head/usr.sbin/mailwrapper/Makefile
==
--- head/usr.sbin/mailwrapper/Makefile  Thu Dec 14 07:55:11 2017
(r326843)
+++ head/usr.sbin/mailwrapper/Makefile  Thu Dec 14 08:57:37 2017
(r326844)
@@ -5,8 +5,6 @@
 .if ${MK_MAILWRAPPER} != "no"
 PROG=  mailwrapper
 MAN=   mailwrapper.8
-
-LIBADD=util
 .endif
 
 .if ${MK_MAILWRAPPER} != "no" || ${MK_SENDMAIL} != "no"

Modified: head/usr.sbin/mailwrapper/Makefile.depend
==
--- head/usr.sbin/mailwrapper/Makefile.depend   Thu Dec 14 07:55:11 2017
(r326843)
+++ head/usr.sbin/mailwrapper/Makefile.depend   Thu Dec 14 08:57:37 2017
(r326844)
@@ -7,8 +7,7 @@ DIRDEPS = \
include/xlocale \
lib/${CSU_DIR} \
lib/libc \
-   lib/libcompiler_rt \
-   lib/libutil \
+   lib/libcompiler_rt
 
 
 .include 

Modified: head/usr.sbin/mailwrapper/mailwrapper.c
==
--- head/usr.sbin/mailwrapper/mailwrapper.c Thu Dec 14 07:55:11 2017
(r326843)
+++ head/usr.sbin/mailwrapper/mailwrapper.c Thu Dec 14 08:57:37 2017
(r326844)
@@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
@@ -89,14 +88,17 @@ int
 main(int argc, char *argv[], char *envp[])
 {
FILE *config;
-   char *line, *cp, *from, *to, *ap;
+   char *line, *cp, *from, *to, *ap, *walk;
const char *progname;
char localmailerconf[MAXPATHLEN];
const char *mailerconf;
-   size_t len, lineno = 0;
+   size_t linecap = 0, lineno = 0;
+   ssize_t linelen;
int i;
struct arglist al;
 
+   line = NULL;
+
/* change __progname to mailwrapper so we get sensible error messages */
progname = getprogname();
setprogname("mailwrapper");
@@ -123,12 +125,16 @@ main(int argc, char *argv[], char *envp[])
}
 
for (;;) {
-   if ((line = fparseln(config, , , NULL, 0)) == NULL) {
-   if (feof(config))
+   if ((linelen = getline(, , config)) <= 0) {
+   if (feof(config)) {
errx(EX_CONFIG, "no mapping in %s", mailerconf);
+   }
err(EX_CONFIG, "cannot parse line %lu", (u_long)lineno);
}
-
+   lineno++;
+   walk = line;
+   /* strip comments */
+   strsep(, "#");
 #defineWS  " \t\n"
cp = line;
 
___
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: r326758 - in head/sys/i386: conf include

2017-12-14 Thread Eugene Grosbein
On 13.12.2017 04:55, John Baldwin wrote:
> On 12/12/17 3:09 PM, Eugene Grosbein wrote:
>> On 13.12.2017 02:32, John Baldwin wrote:
>>
>>> Certainly for MIPS I have found that compiling with clang
>>> instead of gcc for mips64 gives a kernel that panics for stack overflow for 
>>> any
>>> use of NFS.  It might be that this is due to something MIPS-specific, but it
>>> might be worthwhile retesting with kstack_pages=2 and building the kernel
>>> with CROSS_TOOLCHAIN=i386-gcc after installing the appropriate package.
>>
>> You may want to check NFS code that uses stack heavily.
>> Here are numbers for i386 (bytes-on-stack, module, what function):
>>
>> 1344 nfs_nfsdport.o :
>> 1152 nfs_nfsdserv.o :
>> 1128 nfs_nfsdserv.o :
>> 952 nfs_nfsdserv.o :
>> 664 nfs_nfsdserv.o :
>> 640 nfs_nfsdserv.o :
>> 624 nfs_nfsdserv.o :
>> 608 nfs_nfsdserv.o :
>> 600 nfs_clvfsops.o :
> 
> My point is that you should compare gcc with clang as 10.x switched to
> clang and that may be a factor in the stack overflows beginning with 10.x.

I think thats's NFS code who is guilty. You can see example of amd64 (sic!) 
kstack exhaustion
due to 40+ frames deep call chain here:

https://lists.freebsd.org/pipermail/freebsd-stable/2017-July/087429.html

___
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: r326758 - in head/sys/i386: conf include

2017-12-14 Thread Eugene Grosbein
On 14.12.2017 18:34, Eugene Grosbein wrote:
> On 13.12.2017 04:55, John Baldwin wrote:
>> On 12/12/17 3:09 PM, Eugene Grosbein wrote:
>>> On 13.12.2017 02:32, John Baldwin wrote:
>>>
 Certainly for MIPS I have found that compiling with clang
 instead of gcc for mips64 gives a kernel that panics for stack overflow 
 for any
 use of NFS.  It might be that this is due to something MIPS-specific, but 
 it
 might be worthwhile retesting with kstack_pages=2 and building the kernel
 with CROSS_TOOLCHAIN=i386-gcc after installing the appropriate package.
>>>
>>> You may want to check NFS code that uses stack heavily.
>>> Here are numbers for i386 (bytes-on-stack, module, what function):
>>>
>>> 1344 nfs_nfsdport.o :
>>> 1152 nfs_nfsdserv.o :
>>> 1128 nfs_nfsdserv.o :
>>> 952 nfs_nfsdserv.o :
>>> 664 nfs_nfsdserv.o :
>>> 640 nfs_nfsdserv.o :
>>> 624 nfs_nfsdserv.o :
>>> 608 nfs_nfsdserv.o :
>>> 600 nfs_clvfsops.o :
>>
>> My point is that you should compare gcc with clang as 10.x switched to
>> clang and that may be a factor in the stack overflows beginning with 10.x.
> 
> I think thats's NFS code who is guilty. You can see example of amd64 (sic!) 
> kstack exhaustion
> due to 40+ frames deep call chain here:
> 
> https://lists.freebsd.org/pipermail/freebsd-stable/2017-July/087429.html

Final post in the thread describes amd64 crash with kstack_pages=5 due to 75 
frames:
https://lists.freebsd.org/pipermail/freebsd-stable/2017-July/087477.html

He increased kstack_pages upto 6 and stopped posting, as it obviously helped 
him finally.

By the way, I finally realised why I do not have KVA problems with my i386 
hosts:
I run all of them (no PAE) with options KVA_PAGES=512 (2GB) at least
and even 768 (3GB) in case of ZFS instead of default 256 (1GB) to make it 
stable.

Tell me more of untweaked FreeBSD stability...

___
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: r326758 - in head/sys/i386: conf include

2017-12-14 Thread Konstantin Belousov
On Thu, Dec 14, 2017 at 06:34:21PM +0700, Eugene Grosbein wrote:
> On 13.12.2017 04:55, John Baldwin wrote:
> > On 12/12/17 3:09 PM, Eugene Grosbein wrote:
> >> On 13.12.2017 02:32, John Baldwin wrote:
> >>
> >>> Certainly for MIPS I have found that compiling with clang
> >>> instead of gcc for mips64 gives a kernel that panics for stack overflow 
> >>> for any
> >>> use of NFS.  It might be that this is due to something MIPS-specific, but 
> >>> it
> >>> might be worthwhile retesting with kstack_pages=2 and building the kernel
> >>> with CROSS_TOOLCHAIN=i386-gcc after installing the appropriate package.
> >>
> >> You may want to check NFS code that uses stack heavily.
> >> Here are numbers for i386 (bytes-on-stack, module, what function):
> >>
> >> 1344 nfs_nfsdport.o :
> >> 1152 nfs_nfsdserv.o :
> >> 1128 nfs_nfsdserv.o :
> >> 952 nfs_nfsdserv.o :
> >> 664 nfs_nfsdserv.o :
> >> 640 nfs_nfsdserv.o :
> >> 624 nfs_nfsdserv.o :
> >> 608 nfs_nfsdserv.o :
> >> 600 nfs_clvfsops.o :
> > 
> > My point is that you should compare gcc with clang as 10.x switched to
> > clang and that may be a factor in the stack overflows beginning with 10.x.
> 
> I think thats's NFS code who is guilty. You can see example of amd64 (sic!) 
> kstack exhaustion
> due to 40+ frames deep call chain here:
> 
> https://lists.freebsd.org/pipermail/freebsd-stable/2017-July/087429.html

Yes, NFS crosses network/VFS and often VM boundaries, so each subsystem
adds its usual stack use footprint to the overall picture.  NFS reconnect
is especially hard in this regard, and in case the direct dispatch is
triggered (in this case over loopback) machine has no chance.

The backtrace you cited just reinforces the point that the i386 commit
is wrong. It breaks the workload we aims as the main FreeBSD target,
which is generic-purpose Unix workstation or server. The commit tries
to make defaults fit for specific appliance load of router with IPSEC
or ZFS on i386, which require extensive tuning on i386 anyway. Worse,
as you prove above, the commit in fact does not fix the issues, it only
papers over them and move easily triggered faults from one configuration
to another.
___
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: r326758 - in head/sys/i386: conf include

2017-12-14 Thread Eugene Grosbein
On 14.12.2017 18:51, Konstantin Belousov wrote:

>> I think thats's NFS code who is guilty. You can see example of amd64 (sic!) 
>> kstack exhaustion
>> due to 40+ frames deep call chain here:
>>
>> https://lists.freebsd.org/pipermail/freebsd-stable/2017-July/087429.html
> 
> Yes, NFS crosses network/VFS and often VM boundaries, so each subsystem
> adds its usual stack use footprint to the overall picture.  NFS reconnect
> is especially hard in this regard, and in case the direct dispatch is
> triggered (in this case over loopback) machine has no chance.
> 
> The backtrace you cited just reinforces the point that the i386 commit
> is wrong. It breaks the workload we aims as the main FreeBSD target,
> which is generic-purpose Unix workstation or server. The commit tries
> to make defaults fit for specific appliance load of router with IPSEC
> or ZFS on i386, which require extensive tuning on i386 anyway. Worse,
> as you prove above, the commit in fact does not fix the issues, it only
> papers over them and move easily triggered faults from one configuration
> to another.

Modern FreeBSD usage as workstation/server should not exclude IPv6, SCTP, WiFi,
and even ZFS nor IPSEC for i386. GENERIC kernel should not panic due to low 
volume
network activity with default settings.

Perhaps, it's time to make KVA_PAGES loader tunnable too?
And/or increase its default for i386 upto some value corresponding to stable 
management
of kern.threads.max_threads_per_proc=1500 (by default) with kstack_pages=4 ?

Maybe, KVA_PAGES=384 (1.5GB for 1500 threads)?

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