svn commit: r326895 - head

2017-12-16 Thread Jens Schweikhardt
Author: schweikh
Date: Sat Dec 16 11:49:30 2017
New Revision: 326895
URL: https://svnweb.freebsd.org/changeset/base/326895

Log:
  Correct a typo; remove white space at EOL.

Modified:
  head/UPDATING

Modified: head/UPDATING
==
--- head/UPDATING   Sat Dec 16 05:22:16 2017(r326894)
+++ head/UPDATING   Sat Dec 16 11:49:30 2017(r326895)
@@ -58,7 +58,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW:
 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
+   by default as the lesser evil in r326857. If you boot off ZFS and/or
GELI, it might not be a good time to update.
 
 20171125:
@@ -280,7 +280,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW:
full procedure documented below under the heading "To rebuild
everything and install it on the current system."  Specifically,
a reboot is required after installing the new kernel before
-   installing world.  
+   installing world.
 
 20170424:
The NATM framework including the en(4), fatm(4), hatm(4), and
___
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: r326896 - head/share/examples/etc

2017-12-16 Thread Jens Schweikhardt
Author: schweikh
Date: Sat Dec 16 12:23:59 2017
New Revision: 326896
URL: https://svnweb.freebsd.org/changeset/base/326896

Log:
  Remove white space at EOL.

Modified:
  head/share/examples/etc/make.conf

Modified: head/share/examples/etc/make.conf
==
--- head/share/examples/etc/make.conf   Sat Dec 16 11:49:30 2017
(r326895)
+++ head/share/examples/etc/make.conf   Sat Dec 16 12:23:59 2017
(r326896)
@@ -59,11 +59,11 @@
 # nonstandard optimization settings
 # before submitting bug reports without patches to the developers.
 #
-# CFLAGS.arch provides a mechanism for applying CFLAGS only when building 
-# the given architecture.  This is useful primarily on a system used for 
-# cross-building, when you have a set of flags to apply to the TARGET_ARCH 
-# being cross-built but don't want those settings applied to building the 
-# cross-tools or other components that run on the build host machine.  
+# CFLAGS.arch provides a mechanism for applying CFLAGS only when building
+# the given architecture.  This is useful primarily on a system used for
+# cross-building, when you have a set of flags to apply to the TARGET_ARCH
+# being cross-built but don't want those settings applied to building the
+# cross-tools or other components that run on the build host machine.
 #
 # CXXFLAGS controls the compiler settings used when compiling C++ code.
 # Note that CXXFLAGS is initially set to the value of CFLAGS.  If you wish
___
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: r326897 - head/contrib/llvm/tools/lld/ELF

2017-12-16 Thread Ed Maste
Author: emaste
Date: Sat Dec 16 14:26:11 2017
New Revision: 326897
URL: https://svnweb.freebsd.org/changeset/base/326897

Log:
  lld: Slightly simplify code and add comment.
  
  Cherry-pick lld r315658 by Rui Ueyama:
  This is not a mechanical transformation. Even though I believe this
  patch is correct, I'm not 100% sure if lld with this patch behaves
  exactly the same way as before on all edge cases. At least all tests
  still pass.
  
  I'm submitting this patch because it took almost a day to understand
  this function, and I don't want to lose it.
  
  This fixes jemalloc assertion failures observed at startup with i386
  binaries and an lld-linked libc.so.
  
  Reviewed by:  dim
  Obtained from:LLVM r315658
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D13503

Modified:
  head/contrib/llvm/tools/lld/ELF/Relocations.cpp

Modified: head/contrib/llvm/tools/lld/ELF/Relocations.cpp
==
--- head/contrib/llvm/tools/lld/ELF/Relocations.cpp Sat Dec 16 12:23:59 
2017(r326896)
+++ head/contrib/llvm/tools/lld/ELF/Relocations.cpp Sat Dec 16 14:26:11 
2017(r326897)
@@ -790,13 +790,31 @@ static void addGotEntry(SymbolBody &Sym, bool Preempti
 DynType = Target->GotRel;
   }
 
-  bool Constant = !Preemptible && (!Config->Pic || isAbsolute(Sym));
-  if (!Constant)
+  // If a GOT slot value can be calculated at link-time, which is now,
+  // we can just fill that out.
+  //
+  // (We don't actually write a value to a GOT slot right now, but we
+  // add a static relocation to a Relocations vector so that
+  // InputSection::relocate will do the work for us. We may be able
+  // to just write a value now, but it is a TODO.)
+  bool IsLinkTimeConstant = !Preemptible && (!Config->Pic || isAbsolute(Sym));
+  if (IsLinkTimeConstant) {
+InX::Got->Relocations.push_back({Expr, DynType, Off, 0, &Sym});
+  } else {
+// Otherwise, we emit a dynamic relocation to .rel[a].dyn so that
+// the GOT slot will be fixed at load-time.
 In::RelaDyn->addReloc(
 {DynType, InX::Got, Off, !Preemptible, &Sym, 0});
 
-  if (Constant || (!Config->IsRela && !Preemptible))
-InX::Got->Relocations.push_back({Expr, DynType, Off, 0, &Sym});
+// REL type relocations don't have addend fields unlike RELAs, and
+// their addends are stored to the section to which they are applied.
+// So, store addends if we need to.
+//
+// This is ugly -- the difference between REL and RELA should be
+// handled in a better way. It's a TODO.
+if (!Config->IsRela)
+  InX::Got->Relocations.push_back({R_ABS, Target->GotRel, Off, 0, &Sym});
+  }
 }
 
 // The reason we have to do this early scan is as follows
___
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: r326898 - head/sys/net

2017-12-16 Thread Andrey V. Elsukov
Author: ae
Date: Sat Dec 16 14:36:21 2017
New Revision: 326898
URL: https://svnweb.freebsd.org/changeset/base/326898

Log:
  Fix possible memory leak.
  
  vxlan_ftable entries are sorted in ascending order, due to wrong arguments
  order it is possible to stop search before existing element will be found.
  Then new element will be allocated in vxlan_ftable_update_locked() and can
  be inserted in the list second time or trigger MPASS() assertion with
  enabled INVARIANTS.
  
  PR:   224371
  MFC after:1 week

Modified:
  head/sys/net/if_vxlan.c

Modified: head/sys/net/if_vxlan.c
==
--- head/sys/net/if_vxlan.c Sat Dec 16 14:26:11 2017(r326897)
+++ head/sys/net/if_vxlan.c Sat Dec 16 14:36:21 2017(r326898)
@@ -782,7 +782,7 @@ vxlan_ftable_entry_lookup(struct vxlan_softc *sc, cons
hash = VXLAN_SC_FTABLE_HASH(sc, mac);
 
LIST_FOREACH(fe, &sc->vxl_ftable[hash], vxlfe_hash) {
-   dir = vxlan_ftable_addr_cmp(fe->vxlfe_mac, mac);
+   dir = vxlan_ftable_addr_cmp(mac, fe->vxlfe_mac);
if (dir == 0)
return (fe);
if (dir > 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"


svn commit: r326908 - head/lib/libc/i386

2017-12-16 Thread Ed Maste
Author: emaste
Date: Sat Dec 16 15:17:54 2017
New Revision: 326908
URL: https://svnweb.freebsd.org/changeset/base/326908

Log:
  revert r322589: force use of ld.bfd for linking i386 libc
  
  As of r326897 ld.lld can link a working i386 libc.so, so we no longer
  need to force use of ld.bfd.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/lib/libc/i386/Makefile.inc

Modified: head/lib/libc/i386/Makefile.inc
==
--- head/lib/libc/i386/Makefile.inc Sat Dec 16 14:47:12 2017
(r326907)
+++ head/lib/libc/i386/Makefile.inc Sat Dec 16 15:17:54 2017
(r326908)
@@ -4,13 +4,3 @@
 GDTOASRCS+=strtorx.c
 SRCS+=machdep_ldisx.c
 SYM_MAPS+=${LIBC_SRCTOP}/i386/Symbol.map
-
-# XXX force use of ld.bfd for linking i386 libc
-#
-# lld can successfully link most of a working i386 userland and kernel,
-# but produces a broken libc. For now if we're otherwise using lld, and
-# ld.bfd is available, explicitly use it for libc.
-.include 
-.if ${LINKER_TYPE} == "lld" && ${MK_BINUTILS_BOOTSTRAP} != "no"
-LDFLAGS+=-fuse-ld=bfd
-.endif
___
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-16 Thread John Baldwin
On 12/14/17 3:34 AM, 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

In case it is not clear, it is not _just_ NFS that is broken.  clang is
_known_ to be broken.  When I build a FreeBSD/mips64 kernel with clang,
_any_ simple NFS op triggers a kernel stack overflow.  Kernels compiled
with GCC do not.  I would really appreciate investigating the clang vs gcc
on i386 to determine if this issue is platform-specific or not.  If clang
is stack hungry on all architectures then we need to be aware of that
problem.  (clang 5 on MIPS also has the lovely property that it doesn't
save $RA when it calls a dead2 function, so the stack trace for the kernel
stack overflow from ddb is useless and ends when the trap handler calls
panic, it never makes it back into the original stack which overflowed.)

-- 
John Baldwin
___
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: r326909 - in head: contrib/llvm/lib/Target/BPF contrib/llvm/lib/Transforms/Scalar contrib/llvm/tools/clang/lib/Basic contrib/llvm/tools/clang/lib/Sema contrib/llvm/tools/lld/lib/ReaderW...

2017-12-16 Thread Dimitry Andric
Author: dim
Date: Sat Dec 16 18:06:30 2017
New Revision: 326909
URL: https://svnweb.freebsd.org/changeset/base/326909

Log:
  Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to
  5.0.1 release (upstream r320880).
  
  Relnotes: yes
  MFC after:2 weeks

Modified:
  head/contrib/llvm/lib/Target/BPF/BPFISelLowering.cpp
  head/contrib/llvm/lib/Target/BPF/BPFInstrInfo.td
  head/contrib/llvm/lib/Transforms/Scalar/NewGVN.cpp
  head/contrib/llvm/tools/clang/lib/Basic/Version.cpp
  head/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp
  head/contrib/llvm/tools/clang/lib/Sema/SemaDeclCXX.cpp
  head/contrib/llvm/tools/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
  head/contrib/llvm/tools/lld/lib/ReaderWriter/MachO/ArchHandler.h
  head/contrib/llvm/tools/lld/lib/ReaderWriter/MachO/ArchHandler_arm.cpp
  head/contrib/llvm/tools/lld/lib/ReaderWriter/MachO/ArchHandler_arm64.cpp
  head/contrib/llvm/tools/lld/lib/ReaderWriter/MachO/ArchHandler_x86.cpp
  head/contrib/llvm/tools/lld/lib/ReaderWriter/MachO/ArchHandler_x86_64.cpp
  
head/contrib/llvm/tools/lld/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp
  head/lib/clang/include/clang/Basic/Version.inc
  head/lib/clang/include/lld/Config/Version.inc
  head/lib/clang/include/llvm/Support/VCSRevision.h
Directory Properties:
  head/contrib/compiler-rt/   (props changed)
  head/contrib/libc++/   (props changed)
  head/contrib/llvm/   (props changed)
  head/contrib/llvm/tools/clang/   (props changed)
  head/contrib/llvm/tools/lld/   (props changed)
  head/contrib/llvm/tools/lldb/   (props changed)

Modified: head/contrib/llvm/lib/Target/BPF/BPFISelLowering.cpp
==
--- head/contrib/llvm/lib/Target/BPF/BPFISelLowering.cppSat Dec 16 
15:17:54 2017(r326908)
+++ head/contrib/llvm/lib/Target/BPF/BPFISelLowering.cppSat Dec 16 
18:06:30 2017(r326909)
@@ -578,11 +578,15 @@ BPFTargetLowering::EmitInstrWithCustomInserter(Machine
 .addReg(LHS)
 .addReg(MI.getOperand(2).getReg())
 .addMBB(Copy1MBB);
-  else
+  else {
+int64_t imm32 = MI.getOperand(2).getImm();
+// sanity check before we build J*_ri instruction.
+assert (isInt<32>(imm32));
 BuildMI(BB, DL, TII.get(NewCC))
 .addReg(LHS)
-.addImm(MI.getOperand(2).getImm())
+.addImm(imm32)
 .addMBB(Copy1MBB);
+  }
 
   // Copy0MBB:
   //  %FalseValue = ...

Modified: head/contrib/llvm/lib/Target/BPF/BPFInstrInfo.td
==
--- head/contrib/llvm/lib/Target/BPF/BPFInstrInfo.tdSat Dec 16 15:17:54 
2017(r326908)
+++ head/contrib/llvm/lib/Target/BPF/BPFInstrInfo.tdSat Dec 16 18:06:30 
2017(r326909)
@@ -464,7 +464,7 @@ let usesCustomInserter = 1 in {
   (ins GPR:$lhs, i64imm:$rhs, i64imm:$imm, GPR:$src, 
GPR:$src2),
   "# Select PSEUDO $dst = $lhs $imm $rhs ? $src : $src2",
   [(set i64:$dst,
-   (BPFselectcc i64:$lhs, (i64 imm:$rhs), (i64 imm:$imm), 
i64:$src, i64:$src2))]>;
+   (BPFselectcc i64:$lhs, (i64 i64immSExt32:$rhs), (i64 
imm:$imm), i64:$src, i64:$src2))]>;
 }
 
 // load 64-bit global addr into register

Modified: head/contrib/llvm/lib/Transforms/Scalar/NewGVN.cpp
==
--- head/contrib/llvm/lib/Transforms/Scalar/NewGVN.cpp  Sat Dec 16 15:17:54 
2017(r326908)
+++ head/contrib/llvm/lib/Transforms/Scalar/NewGVN.cpp  Sat Dec 16 18:06:30 
2017(r326909)
@@ -586,8 +586,8 @@ class NewGVN { (public)
 private:
   // Expression handling.
   const Expression *createExpression(Instruction *) const;
-  const Expression *createBinaryExpression(unsigned, Type *, Value *,
-   Value *) const;
+  const Expression *createBinaryExpression(unsigned, Type *, Value *, Value *,
+   Instruction *) const;
   PHIExpression *createPHIExpression(Instruction *, bool &HasBackEdge,
  bool &OriginalOpsConstant) const;
   const DeadExpression *createDeadExpression() const;
@@ -902,8 +902,8 @@ bool NewGVN::setBasicExpressionInfo(Instruction *I, Ba
 }
 
 const Expression *NewGVN::createBinaryExpression(unsigned Opcode, Type *T,
- Value *Arg1,
- Value *Arg2) const {
+ Value *Arg1, Value *Arg2,
+ Instruction *I) const {
   auto *E = new (ExpressionAllocator) BasicExpression(2);
 
   E->setType(T);
@@ -921,7 +921,7 @@ const Expression *NewGVN::createBinaryExpression(unsig
   E->op_push_back(lookupOperandLeader(Arg2));
 
   Value *V = SimplifyBinOp(Opcode, E->getOperand(0), E->getOperand(

svn commit: r326910 - head/lib/libsysdecode

2017-12-16 Thread Ed Schouten
Author: ed
Date: Sat Dec 16 19:37:55 2017
New Revision: 326910
URL: https://svnweb.freebsd.org/changeset/base/326910

Log:
  libsysdecode: Add a new ABI type, SYSDECODE_ABI_CLOUDABI32.
  
  In order to let truss(8) support tracing of 32-bit CloudABI
  applications, we need to add a new ABI type to libsysdecode. We can
  reuse the existing errno mapping table. Also link in the cloudabi32
  system call table to translate system call names.
  
  While there, remove all of the architecture ifdefs. There are not
  needed, as the CloudABI data types and system call tables build fine on
  any architecture. Building this unconditionally will make it easier to
  do tracing for different compat modes, emulation, etc.
  
  Reviewed by:  jhb
  Differential Revision:https://reviews.freebsd.org/D13516

Modified:
  head/lib/libsysdecode/errno.c
  head/lib/libsysdecode/syscallnames.c
  head/lib/libsysdecode/sysdecode.3
  head/lib/libsysdecode/sysdecode.h

Modified: head/lib/libsysdecode/errno.c
==
--- head/lib/libsysdecode/errno.c   Sat Dec 16 18:06:30 2017
(r326909)
+++ head/lib/libsysdecode/errno.c   Sat Dec 16 19:37:55 2017
(r326910)
@@ -58,7 +58,6 @@ static int bsd_to_linux_errno[ELAST + 1] = {
 };
 #endif
 
-#if defined(__aarch64__) || defined(__amd64__)
 #include 
 
 static const int cloudabi_errno_table[] = {
@@ -139,7 +138,6 @@ static const int cloudabi_errno_table[] = {
[CLOUDABI_EXDEV]= EXDEV,
[CLOUDABI_ENOTCAPABLE]  = ENOTCAPABLE,
 };
-#endif
 
 int
 sysdecode_abi_to_freebsd_errno(enum sysdecode_abi abi, int error)
@@ -165,13 +163,12 @@ sysdecode_abi_to_freebsd_errno(enum sysdecode_abi abi,
break;
}
 #endif
-#if defined(__aarch64__) || defined(__amd64__)
+   case SYSDECODE_ABI_CLOUDABI32:
case SYSDECODE_ABI_CLOUDABI64:
if (error >= 0 &&
(unsigned int)error < nitems(cloudabi_errno_table))
return (cloudabi_errno_table[error]);
break;
-#endif
default:
break;
}
@@ -193,7 +190,7 @@ sysdecode_freebsd_to_abi_errno(enum sysdecode_abi abi,
return (bsd_to_linux_errno[error]);
break;
 #endif
-#if defined(__aarch64__) || defined(__amd64__)
+   case SYSDECODE_ABI_CLOUDABI32:
case SYSDECODE_ABI_CLOUDABI64: {
unsigned int i;
 
@@ -203,7 +200,6 @@ sysdecode_freebsd_to_abi_errno(enum sysdecode_abi abi,
}
break;
}
-#endif
default:
break;
}

Modified: head/lib/libsysdecode/syscallnames.c
==
--- head/lib/libsysdecode/syscallnames.cSat Dec 16 18:06:30 2017
(r326909)
+++ head/lib/libsysdecode/syscallnames.cSat Dec 16 19:37:55 2017
(r326910)
@@ -63,10 +63,10 @@ static
 #include 
 #endif
 
-#if defined(__amd64__) || defined(__aarch64__)
 static
+#include 
+static
 #include 
-#endif
 
 const char *
 sysdecode_syscallname(enum sysdecode_abi abi, unsigned int code)
@@ -95,12 +95,14 @@ sysdecode_syscallname(enum sysdecode_abi abi, unsigned
return (linux32_syscallnames[code]);
break;
 #endif
-#if defined(__amd64__) || defined(__aarch64__)
+   case SYSDECODE_ABI_CLOUDABI32:
+   if (code < nitems(cloudabi32_syscallnames))
+   return (cloudabi32_syscallnames[code]);
+   break;
case SYSDECODE_ABI_CLOUDABI64:
if (code < nitems(cloudabi64_syscallnames))
return (cloudabi64_syscallnames[code]);
break;
-#endif
default:
break;
}

Modified: head/lib/libsysdecode/sysdecode.3
==
--- head/lib/libsysdecode/sysdecode.3   Sat Dec 16 18:06:30 2017
(r326909)
+++ head/lib/libsysdecode/sysdecode.3   Sat Dec 16 19:37:55 2017
(r326910)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 24, 2017
+.Dd December 16, 2017
 .Dt SYSDECODE 3
 .Os
 .Sh NAME
@@ -61,9 +61,12 @@ Supported on amd64 and i386.
 .It Li SYSDECODE_ABI_LINUX32
 32-bit Linux binaries.
 Supported on amd64.
+.It Li SYSDECODE_ABI_CLOUDABI32
+32-bit CloudABI binaries.
+Supported on all platforms.
 .It Li SYSDECODE_ABI_CLOUDABI64
 64-bit CloudABI binaries.
-Supported on aarch64 and amd64.
+Supported on all platforms.
 .It Li SYSDECODE_ABI_UNKNOWN
 A placeholder for use when the ABI is not known.
 .El

Modified: head/lib/libsysdecode/sysdecode.h
==
--- head/lib/libsysdecode/sysdecode.h   Sat Dec 16 18:06:30 2017
(r326909)
+++ head/lib/libsysdecode/sysdecode.h   Sat Dec 16 19:37:55 2017
(r326910)
@@ -35,7 +35

svn commit: r326911 - head/usr.bin/truss

2017-12-16 Thread Ed Schouten
Author: ed
Date: Sat Dec 16 19:40:28 2017
New Revision: 326911
URL: https://svnweb.freebsd.org/changeset/base/326911

Log:
  Make truss(8) work for i686-unknown-cloudabi binaries on FreeBSD/amd64.
  
  This change copies the existing amd64_cloudabi64.c to amd64_cloudabi32.c
  and reimplements the functions for fetching system call arguments and
  return values to use the same scheme as used by the vDSO that is used
  when running cloudabi32 executables.
  
  As arguments are automatically padded to 64-bit words by the vDSO in
  userspace, we can copy the arguments directly into the array used by
  truss(8) internally.
  
  Reviewed by:  jhb
  Differential Revision:https://reviews.freebsd.org/D13516

Added:
  head/usr.bin/truss/amd64-cloudabi32.c
 - copied, changed from r326896, head/usr.bin/truss/amd64-cloudabi64.c
Modified:
  head/usr.bin/truss/Makefile

Modified: head/usr.bin/truss/Makefile
==
--- head/usr.bin/truss/Makefile Sat Dec 16 19:37:55 2017(r326910)
+++ head/usr.bin/truss/Makefile Sat Dec 16 19:40:28 2017(r326911)
@@ -22,6 +22,7 @@ ABIS+=i386-linux
 ABIS+= amd64-linux
 ABIS+= amd64-linux32
 ABIS+= freebsd32
+ABIS+= cloudabi32
 ABIS+= cloudabi64
 .endif
 .if ${MACHINE_ARCH} == "powerpc64"

Copied and modified: head/usr.bin/truss/amd64-cloudabi32.c (from r326896, 
head/usr.bin/truss/amd64-cloudabi64.c)
==
--- head/usr.bin/truss/amd64-cloudabi64.c   Sat Dec 16 12:23:59 2017
(r326896, copy source)
+++ head/usr.bin/truss/amd64-cloudabi32.c   Sat Dec 16 19:40:28 2017
(r326911)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2015 Nuxi, https://nuxi.nl/
+ * Copyright (c) 2015-2017 Nuxi, https://nuxi.nl/
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -38,60 +38,75 @@ __FBSDID("$FreeBSD$");
 #include "truss.h"
 
 static int
-amd64_cloudabi64_fetch_args(struct trussinfo *trussinfo, unsigned int narg)
+amd64_cloudabi32_fetch_args(struct trussinfo *trussinfo, unsigned int narg)
 {
struct current_syscall *cs;
+   struct ptrace_io_desc iorequest;
struct reg regs;
lwpid_t tid;
 
-   tid = trussinfo->curthread->tid;
-   if (ptrace(PT_GETREGS, tid, (caddr_t)®s, 0) == -1) {
-   fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n");
-   return (-1);
-   }
+   if (narg > 0) {
+   /* Fetch registers, containing the address of the arguments. */
+   tid = trussinfo->curthread->tid;
+   if (ptrace(PT_GETREGS, tid, (caddr_t)®s, 0) == -1) {
+   fprintf(trussinfo->outfile,
+   "-- CANNOT READ REGISTERS --\n");
+   return (-1);
+   }
 
-   cs = &trussinfo->curthread->cs;
-   if (narg >= 1)
-   cs->args[0] = regs.r_rdi;
-   if (narg >= 2)
-   cs->args[1] = regs.r_rsi;
-   if (narg >= 3)
-   cs->args[2] = regs.r_rdx;
-   if (narg >= 4)
-   cs->args[3] = regs.r_rcx;
-   if (narg >= 5)
-   cs->args[4] = regs.r_r8;
-   if (narg >= 6)
-   cs->args[5] = regs.r_r9;
+   /* Fetch arguments. They are already padded to 64 bits. */
+   cs = &trussinfo->curthread->cs;
+   iorequest.piod_op = PIOD_READ_D;
+   iorequest.piod_offs = (void *)regs.r_rcx;
+   iorequest.piod_addr = cs->args;
+   iorequest.piod_len = sizeof(cs->args[0]) * narg;
+   if (ptrace(PT_IO, tid, (caddr_t)&iorequest, 0) == -1 ||
+   iorequest.piod_len == 0)
+   return (-1);
+   }
return (0);
 }
 
 static int
-amd64_cloudabi64_fetch_retval(struct trussinfo *trussinfo, long *retval,
+amd64_cloudabi32_fetch_retval(struct trussinfo *trussinfo, long *retval,
 int *errorp)
 {
+   struct ptrace_io_desc iorequest;
struct reg regs;
lwpid_t tid;
 
+   /* Fetch registers, containing the address of the return values. */
tid = trussinfo->curthread->tid;
if (ptrace(PT_GETREGS, tid, (caddr_t)®s, 0) == -1) {
fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n");
return (-1);
}
 
-   retval[0] = regs.r_rax;
-   retval[1] = regs.r_rdx;
-   *errorp = (regs.r_rflags & PSL_C) != 0;
+   if (regs.r_rax == 0) {
+   /* System call succeeded. Fetch return values. */
+   iorequest.piod_op = PIOD_READ_D;
+   iorequest.piod_offs = (void *)regs.r_rcx;
+   iorequest.piod_addr = retval;
+   iorequest.piod_len = sizeof(retval[0]) * 2;
+   if (ptrace(PT_IO, tid, (caddr_t)

svn commit: r326912 - head/usr.sbin/makefs

2017-12-16 Thread Mark Johnston
Author: markj
Date: Sat Dec 16 20:19:00 2017
New Revision: 326912
URL: https://svnweb.freebsd.org/changeset/base/326912

Log:
  Fix a logic bug in makefs lazy inode initialization.
  
  We may need to initialize multiple inode blocks before writing a given
  inode. makefs(8) was only initializing a single block at a time, so
  certain inode allocation patterns could lead to a situation where it
  wrote an inode to an uninitialized block. That inode might be clobbered
  by a later initialization, resulting in a filesystem image containing
  directory entries that point to a seemingly unused inode.
  
  Reviewed by:  imp
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D13505

Modified:
  head/usr.sbin/makefs/ffs.c

Modified: head/usr.sbin/makefs/ffs.c
==
--- head/usr.sbin/makefs/ffs.c  Sat Dec 16 19:40:28 2017(r326911)
+++ head/usr.sbin/makefs/ffs.c  Sat Dec 16 20:19:00 2017(r326912)
@@ -1130,7 +1130,7 @@ ffs_write_inode(union dinode *dp, uint32_t ino, const 
 * Initialize inode blocks on the fly for UFS2.
 */
initediblk = ufs_rw32(cgp->cg_initediblk, fsopts->needswap);
-   if (ffs_opts->version == 2 && cgino + INOPB(fs) > initediblk &&
+   while (ffs_opts->version == 2 && cgino + INOPB(fs) > initediblk &&
initediblk < ufs_rw32(cgp->cg_niblk, fsopts->needswap)) {
memset(buf, 0, fs->fs_bsize);
dip = (struct ufs2_dinode *)buf;
___
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: r326913 - head/share/dict

2017-12-16 Thread Warner Losh
Author: imp
Date: Sat Dec 16 20:25:50 2017
New Revision: 326913
URL: https://svnweb.freebsd.org/changeset/base/326913

Log:
  Sync with NetBSD's /usr/share/dict/words, with the exception of quim
  due to its vulgar nature.
  
  Submitted by: sevan@
  Differential Revision: https://reviews.freebsd.org/D13510

Modified:
  head/share/dict/web2

Modified: head/share/dict/web2
==
--- head/share/dict/web2Sat Dec 16 20:19:00 2017(r326912)
+++ head/share/dict/web2Sat Dec 16 20:25:50 2017(r326913)
@@ -1545,9 +1545,9 @@ ackman
 acknow
 acknowledge
 acknowledgeable
-acknowledgement
 acknowledged
 acknowledgedly
+acknowledgement
 acknowledger
 acknowledgment
 aclastic
@@ -2648,6 +2648,7 @@ admedial
 admedian
 admensuration
 admi
+admin
 adminicle
 adminicula
 adminicular
@@ -2656,7 +2657,7 @@ adminiculate
 adminiculation
 adminiculum
 administer
-administerd
+administered
 administerial
 administrable
 administrant
@@ -5948,6 +5949,7 @@ alphabetist
 alphabetization
 alphabetize
 alphabetizer
+alphanumeric
 Alphard
 alphatoluic
 Alphean
@@ -7003,6 +7005,7 @@ amove
 Amoy
 Amoyan
 Amoyese
+amp
 ampalaya
 ampalea
 ampangabeite
@@ -19646,6 +19649,7 @@ Beaune
 beaupere
 beauseant
 beauship
+beaut
 beauteous
 beauteously
 beauteousness
@@ -23499,6 +23503,7 @@ blebby
 blechnoid
 Blechnum
 bleck
+bled
 blee
 bleed
 bleeder
@@ -32163,6 +32168,7 @@ ceilinged
 ceilingward
 ceilingwards
 ceilometer
+cel
 Celadon
 celadon
 celadonite
@@ -34048,6 +34054,7 @@ checkless
 checkman
 checkmate
 checkoff
+checkout
 checkrack
 checkrein
 checkroll
@@ -39340,6 +39347,7 @@ collector
 collectorate
 collectorship
 collectress
+Colleen
 colleen
 collegatary
 college
@@ -42631,6 +42639,7 @@ coony
 coop
 cooper
 cooperage
+cooperate
 Cooperia
 coopering
 coopery
@@ -57415,6 +57424,7 @@ downlier
 downligging
 downlike
 downline
+downlink
 downlooked
 downlooker
 downlying
@@ -68583,6 +68593,7 @@ fatuoid
 fatuous
 fatuously
 fatuousness
+fatwa
 fatwood
 faucal
 faucalize
@@ -70236,6 +70247,7 @@ firestopping
 firetail
 firetop
 firetrap
+firewall
 firewarden
 firewater
 fireweed
@@ -71816,6 +71828,7 @@ fomenter
 fomes
 fomites
 Fon
+fond
 fondak
 fondant
 fondish
@@ -74044,6 +74057,7 @@ fuelizer
 fuerte
 fuff
 fuffy
+fug
 fugacious
 fugaciously
 fugaciousness
@@ -76068,6 +76082,7 @@ geeldikkop
 geelhout
 geepound
 geerah
+geese
 geest
 geet
 Geez
@@ -85657,6 +85672,7 @@ hickory
 Hicksite
 hickwall
 Hicoria
+hid
 hidable
 hidage
 hidalgism
@@ -86106,6 +86122,7 @@ hirmos
 Hirneola
 hiro
 Hirofumi
+hirofumi
 hirondelle
 Hirotoshi
 Hiroyuki
@@ -95495,6 +95512,7 @@ instantaneously
 instantaneousness
 instanter
 instantial
+instantiate
 instantly
 instantness
 instar
@@ -101941,6 +101959,7 @@ kickout
 kickseys
 kickshaw
 kickup
+kid
 Kidder
 kidder
 Kidderminster
@@ -106352,6 +106371,7 @@ Libytheinae
 Licania
 licareol
 licca
+lice
 licensable
 license
 licensed
@@ -106828,6 +106848,7 @@ Limnorchis
 Limnoria
 Limnoriidae
 limnorioid
+limo
 Limodorum
 limoid
 limonene
@@ -108017,6 +108038,7 @@ logium
 loglet
 loglike
 logman
+logo
 logocracy
 logodaedaly
 logogogue
@@ -108253,6 +108275,7 @@ looker
 looking
 lookout
 lookum
+lookup
 loom
 loomer
 loomery
@@ -118182,6 +118205,7 @@ Molinist
 Molinistic
 molka
 Moll
+moll
 molland
 Mollberg
 molle
@@ -128067,6 +128091,7 @@ nosewards
 nosewheel
 nosewise
 nosey
+nosh
 nosine
 nosing
 nosism
@@ -130324,6 +130349,7 @@ Oldfieldia
 Oldhamia
 oldhamite
 oldhearted
+oldie
 oldish
 oldland
 oldness
@@ -147610,6 +147636,7 @@ placeable
 Placean
 placebo
 placeful
+placeholder
 placeless
 placelessly
 placemaker
@@ -152000,6 +152027,7 @@ pot
 potability
 potable
 potableness
+potage
 potagerie
 potagery
 potamic
@@ -153673,6 +153701,7 @@ predynamite
 predynastic
 preen
 preener
+preexist
 preeze
 prefab
 prefabricate
@@ -162965,6 +162994,7 @@ rakishness
 rakit
 rakshasa
 raku
+rale
 Ralf
 rallentando
 ralliance
@@ -165219,6 +165249,7 @@ redhoop
 redia
 redictate
 redictation
+redid
 redient
 redifferentiate
 redifferentiation
@@ -165313,6 +165344,7 @@ redolent
 redolently
 redominate
 redondilla
+redone
 redoom
 redouble
 redoublement
@@ -166542,6 +166574,7 @@ Rellyanite
 reload
 reloan
 relocable
+relocatable
 relocate
 relocation
 relocator
@@ -173817,6 +173850,7 @@ sashless
 sasin
 sasine
 saskatoon
+sass
 sassaby
 sassafac
 sassafrack
@@ -184478,6 +184512,7 @@ softner
 softness
 softship
 softtack
+software
 softwood
 softy
 sog
@@ -185669,6 +185704,7 @@ spaller
 spalling
 spalpeen
 spalt
+spam
 span
 spancel
 spandle
@@ -186716,6 +186752,8 @@ spill
 spillage
 spiller
 spillet
+spillikin
+spillover
 spillproof
 spillway
 spilly
@@ -201472,6 +201510,7 @@ Themis
 themis
 Themistian
 themsel
+themself
 themselves
 then
 thenabouts
@@ -204283,6 +204322,7 @@ tolylenediamine
 Tolypeutes
 tolypeutine
 Tom
+tom
 Toma
 tomahawk
 tomahawker
@@ -205532,6 +205572,7 @@ trade
 tradecraft
 tradeful
 tradeless
+trademark
 trad

svn commit: r326914 - head/stand

2017-12-16 Thread Warner Losh
Author: imp
Date: Sat Dec 16 21:33:21 2017
New Revision: 326914
URL: https://svnweb.freebsd.org/changeset/base/326914

Log:
  Move loader-only defines to loader.mk from defs.mk
  
  Produces the same .o's, verified with md5.
  
  Sponsored by: Netflix

Modified:
  head/stand/defs.mk
  head/stand/loader.mk

Modified: head/stand/defs.mk
==
--- head/stand/defs.mk  Sat Dec 16 20:25:50 2017(r326913)
+++ head/stand/defs.mk  Sat Dec 16 21:33:21 2017(r326914)
@@ -50,52 +50,6 @@ CFLAGS+= -I${BOOTOBJ}/libsa
 CFLAGS+=   -I${SASRC} -D_STANDALONE
 CFLAGS+=   -I${SYSDIR}
 
-# Filesystem support
-.if ${LOADER_CD9660_SUPPORT:Uno} == "yes"
-CFLAGS+=   -DLOADER_CD9660_SUPPORT
-.endif
-.if ${LOADER_EXT2FS_SUPPORT:Uno} == "yes"
-CFLAGS+=   -DLOADER_EXT2FS_SUPPORT
-.endif
-.if ${LOADER_MSDOS_SUPPORT:Uno} == "yes"
-CFLAGS+=   -DLOADER_MSDOS_SUPPORT
-.endif
-.if ${LOADER_NANDFS_SUPPORT:U${MK_NAND}} == "yes"
-CFLAGS+=   -DLOADER_NANDFS_SUPPORT
-.endif
-.if ${LOADER_UFS_SUPPORT:Uyes} == "yes"
-CFLAGS+=   -DLOADER_UFS_SUPPORT
-.endif
-
-# Compression
-.if ${LOADER_GZIP_SUPPORT:Uno} == "yes"
-CFLAGS+=   -DLOADER_GZIP_SUPPORT
-.endif
-.if ${LOADER_BZIP2_SUPPORT:Uno} == "yes"
-CFLAGS+=   -DLOADER_BZIP2_SUPPORT
-.endif
-
-# Network related things
-.if ${LOADER_NET_SUPPORT:Uno} == "yes"
-CFLAGS+=   -DLOADER_NET_SUPPORT
-.endif
-.if ${LOADER_NFS_SUPPORT:Uno} == "yes"
-CFLAGS+=   -DLOADER_NFS_SUPPORT
-.endif
-.if ${LOADER_TFTP_SUPPORT:Uno} == "yes"
-CFLAGS+=   -DLOADER_TFTP_SUPPORT
-.endif
-
-# Disk and partition support
-.if ${LOADER_DISK_SUPPORT:Uyes} == "yes"
-CFLAGS+= -DLOADER_DISK_SUPPORT
-.if ${LOADER_GPT_SUPPORT:Uyes} == "yes"
-CFLAGS+= -DLOADER_GPT_SUPPORT
-.endif
-.if ${LOADER_MBR_SUPPORT:Uyes} == "yes"
-CFLAGS+= -DLOADER_MBR_SUPPORT
-.endif
-
 # GELI Support, with backward compat hooks (mostly)
 .if defined(HAVE_GELI)
 .if defined(LOADER_NO_GELI_SUPPORT)
@@ -110,9 +64,8 @@ MK_LOADER_GELI=yes
 CFLAGS+=   -DLOADER_GELI_SUPPORT
 CFLAGS+=   -I${BOOTSRC}/geli
 LIBGELIBOOT=   ${BOOTOBJ}/geli/libgeliboot.a
-.endif
-.endif
-.endif
+.endif # MK_LOADER_GELI
+.endif # HAVE_GELI
 
 # Machine specific flags for all builds here
 

Modified: head/stand/loader.mk
==
--- head/stand/loader.mkSat Dec 16 20:25:50 2017(r326913)
+++ head/stand/loader.mkSat Dec 16 21:33:21 2017(r326914)
@@ -69,6 +69,53 @@ CFLAGS+= -DBOOT_PROMPT_123
 SRCS+= install.c
 .endif
 
+# Filesystem support
+.if ${LOADER_CD9660_SUPPORT:Uno} == "yes"
+CFLAGS+=   -DLOADER_CD9660_SUPPORT
+.endif
+.if ${LOADER_EXT2FS_SUPPORT:Uno} == "yes"
+CFLAGS+=   -DLOADER_EXT2FS_SUPPORT
+.endif
+.if ${LOADER_MSDOS_SUPPORT:Uno} == "yes"
+CFLAGS+=   -DLOADER_MSDOS_SUPPORT
+.endif
+.if ${LOADER_NANDFS_SUPPORT:U${MK_NAND}} == "yes"
+CFLAGS+=   -DLOADER_NANDFS_SUPPORT
+.endif
+.if ${LOADER_UFS_SUPPORT:Uyes} == "yes"
+CFLAGS+=   -DLOADER_UFS_SUPPORT
+.endif
+
+# Compression
+.if ${LOADER_GZIP_SUPPORT:Uno} == "yes"
+CFLAGS+=   -DLOADER_GZIP_SUPPORT
+.endif
+.if ${LOADER_BZIP2_SUPPORT:Uno} == "yes"
+CFLAGS+=   -DLOADER_BZIP2_SUPPORT
+.endif
+
+# Network related things
+.if ${LOADER_NET_SUPPORT:Uno} == "yes"
+CFLAGS+=   -DLOADER_NET_SUPPORT
+.endif
+.if ${LOADER_NFS_SUPPORT:Uno} == "yes"
+CFLAGS+=   -DLOADER_NFS_SUPPORT
+.endif
+.if ${LOADER_TFTP_SUPPORT:Uno} == "yes"
+CFLAGS+=   -DLOADER_TFTP_SUPPORT
+.endif
+
+# Disk and partition support
+.if ${LOADER_DISK_SUPPORT:Uyes} == "yes"
+CFLAGS+= -DLOADER_DISK_SUPPORT
+.if ${LOADER_GPT_SUPPORT:Uyes} == "yes"
+CFLAGS+= -DLOADER_GPT_SUPPORT
+.endif
+.if ${LOADER_MBR_SUPPORT:Uyes} == "yes"
+CFLAGS+= -DLOADER_MBR_SUPPORT
+.endif
+.endif
+
 .if defined(HAVE_ZFS)
 CFLAGS+=   -DLOADER_ZFS_SUPPORT
 CFLAGS+=   -I${ZFSSRC}
___
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"