]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoFix loop termination in vm_map_find_min().
Konstantin Belousov [Sun, 9 Jul 2017 15:41:49 +0000 (15:41 +0000)]
Fix loop termination in vm_map_find_min().

Reported by: antoine
Tested by: Stefan Ehmann <shoesoft@gmx.net>,
       Jan Kokemueller <jan.kokemueller@gmail.com>
PR: 220493
Sponsored by: The FreeBSD Foundation
MFC after: 3 days

7 years agoRemove stale comments.
Pedro F. Giffuni [Sun, 9 Jul 2017 15:19:28 +0000 (15:19 +0000)]
Remove stale comments.

There's no real advantage in using memcpy here.

Dicussed with: bde (long ago)

7 years agoStyle(9). Whitespace.
Dmitry Chagin [Sun, 9 Jul 2017 14:18:22 +0000 (14:18 +0000)]
Style(9). Whitespace.

MFC after: 3 weeks

7 years agoEliminate the bogus casts.
Dmitry Chagin [Sun, 9 Jul 2017 14:15:51 +0000 (14:15 +0000)]
Eliminate the bogus casts.

MFC after: 3 weeks

7 years agodts: arm: Fix our local patches for H3
Emmanuel Vadot [Sun, 9 Jul 2017 13:56:34 +0000 (13:56 +0000)]
dts: arm: Fix our local patches for H3

sun4i-a10.h is not included anymore, define directly the drive strengh
of the pins.

7 years agoUpdate DTS files from Linux 4.12
Emmanuel Vadot [Sun, 9 Jul 2017 13:53:32 +0000 (13:53 +0000)]
Update DTS files from Linux 4.12

Notable changes:

Allwinner:
  * H3/H5 were merged into a common dtsi file
  * include/dt-bindings/sun4i-a10.h is not included anymore
  in a lot of dts files
  * Add sun8i-h3-nanopi-neo-air board DTS file

7 years agoUpdate the DTS file from Linux 4.12
Emmanuel Vadot [Sun, 9 Jul 2017 13:12:48 +0000 (13:12 +0000)]
Update the DTS file from Linux 4.12

7 years agoarm64: Add Allwinner I2C controller to GENERIC kernel
Emmanuel Vadot [Sun, 9 Jul 2017 12:53:02 +0000 (12:53 +0000)]
arm64: Add Allwinner I2C controller to GENERIC kernel

7 years agoif_awg: Add "allwinner,sun50i-a64-emac" compatible string.
Emmanuel Vadot [Sun, 9 Jul 2017 12:35:19 +0000 (12:35 +0000)]
if_awg: Add "allwinner,sun50i-a64-emac" compatible string.

This enable ethernet on Pine64 with latest DTS.

7 years agoMove open coding of construction of attributes for cut regions and
Bruce Evans [Sun, 9 Jul 2017 12:13:37 +0000 (12:13 +0000)]
Move open coding of construction of attributes for cut regions and
text cursors to functions so that it is easier to fix and improve.
This commit doesn't fix anything except for removing unnecessary
complications and adding comments.

7 years agoSwitch prison check from PROV_DRIVER to PRIV_KMEM_WRITE (like /dev/mem).
Alexander Leidinger [Sun, 9 Jul 2017 06:50:15 +0000 (06:50 +0000)]
Switch prison check from PROV_DRIVER to PRIV_KMEM_WRITE (like /dev/mem).

Access to the dri device gives effectively access to the entire memory of the machine (you can program
the graphic card to do DMA).

For current/stable/release this is a NOP, as access to memory is not allowed in a jail. This puts the dri
device into the same (in)security class than /dev/mem for future use.

Discussed with: anholt(?) several years ago
Sponsored by: Hackathon Essen 2017

7 years ago - Extend pr_allow flags visually to 32 bits, to make it more obvious at first look...
Alexander Leidinger [Sun, 9 Jul 2017 06:40:16 +0000 (06:40 +0000)]
 - Extend pr_allow flags visually to 32 bits, to make it more obvious at first look how much flags we still
   have available to use in the future.
 - Add kmem_access flag as a placeholder (reserve it), not used yet.

Differential Revision: D11451
Reviewed by: jamie
Sponsored by: Hackathon Essen 2017

7 years agoDon't initialize error in declaration.
Dmitry Chagin [Sat, 8 Jul 2017 21:15:46 +0000 (21:15 +0000)]
Don't initialize error in declaration.

MFC after: 3 weeks

7 years agoEliminate the bogus cast.
Dmitry Chagin [Sat, 8 Jul 2017 21:13:25 +0000 (21:13 +0000)]
Eliminate the bogus cast.

MFC after: 3 weeks

7 years agoEliminate the bogus cast.
Dmitry Chagin [Sat, 8 Jul 2017 21:12:00 +0000 (21:12 +0000)]
Eliminate the bogus cast.

MFC after: 3 weeks

7 years agoDon't take a lock around atomic operation.
Dmitry Chagin [Sat, 8 Jul 2017 21:08:22 +0000 (21:08 +0000)]
Don't take a lock around atomic operation.

MFC after: 3 weeks

7 years agoRemove init from declaration, collapse two int vars declarations into single.
Dmitry Chagin [Sat, 8 Jul 2017 21:05:28 +0000 (21:05 +0000)]
Remove init from declaration, collapse two int vars declarations into single.

MFC after: 3 weeks

7 years agoRemove init from declaration.
Dmitry Chagin [Sat, 8 Jul 2017 21:04:09 +0000 (21:04 +0000)]
Remove init from declaration.

MFC after: 3 weeks

7 years agoStyle(9). Add blank line aftr {.
Dmitry Chagin [Sat, 8 Jul 2017 21:02:40 +0000 (21:02 +0000)]
Style(9). Add blank line aftr {.

MFC after: 3 weeks

7 years agoAdd some helper definitions to fs.h in the LinuxKPI.
Mark Johnston [Sat, 8 Jul 2017 20:11:06 +0000 (20:11 +0000)]
Add some helper definitions to fs.h in the LinuxKPI.

Add a field to struct linux_file to allow the creation of anonymous
shmem objects.

MFC after: 1 week

7 years agoFix the definitions of pgprot_{noncached,writecombine} after r316562.
Mark Johnston [Sat, 8 Jul 2017 19:22:29 +0000 (19:22 +0000)]
Fix the definitions of pgprot_{noncached,writecombine} after r316562.

MFC after: 1 week

7 years agoAdd device_is_registered() to the LinuxKPI.
Mark Johnston [Sat, 8 Jul 2017 18:53:02 +0000 (18:53 +0000)]
Add device_is_registered() to the LinuxKPI.

MFC after: 1 week

7 years agoAdd TASK_COMM_LEN to the LinuxKPI.
Mark Johnston [Sat, 8 Jul 2017 18:52:29 +0000 (18:52 +0000)]
Add TASK_COMM_LEN to the LinuxKPI.

MFC after: 1 week

7 years agomakeman: Don't show META_MODE ABI rebuild warnings.
Bryan Drewery [Sat, 8 Jul 2017 17:53:00 +0000 (17:53 +0000)]
makeman: Don't show META_MODE ABI rebuild warnings.

Reported by: dim
Sponsored by: Dell EMC Isilon

7 years agoAdd many bitmaps (now there are 13) for mouse cursors and logic to try
Bruce Evans [Sat, 8 Jul 2017 17:30:33 +0000 (17:30 +0000)]
Add many bitmaps (now there are 13) for mouse cursors and logic to try
to choose the best one.

The old 9x13 cursor was was sort of correct for CGA 640x200 text mode,
but distorted for all other modes.  This mode is still available on
all systems with VGA, but stopped being useful in ~1985.  It has very
unsquare pixels with an aspect ratio of 240:100 on 4:3 monitors.  On
16:9 monitors, the unsquareness in this mode is reduced to only 180:100
iff the monitor stretches the pixels to the full screen.

Newer modes and systems have smaller distortions, but with many more
variations.  Square pixels first became common with VGA 640x480 mode
on 4:3 monitors.  However, standard VGA text mode also has 9-bit wide
characters and only 25 lines, so it has 720x400 pixels.  This has
unsquare pixels with an aspect ratio of 135:100 on 4:3 monitors.  On
16:9 monitors, it gives almost-square pixels with an aspect ration of
101:100 iff the monitor stretches, but in modes that were square on
4:3 monitors square similar monitor stretching breaks the squareness.

Guess the physical aspect ratio using heuristics.  The old version of
X that I use is further from doing this using info from PnP monitors
that is unavailable in syscons (X doesn't understand if the monitor
is doing stretching and doesn't even understand how its its own mode
changes affect the pixel size).  Monitors with aspect ratio control
should be configured to _not_ stretch 4:3 modes to 16:9.  Otherwise,
use the machdep.vga_aspect_scale sysctl to compensate.  Only 1 of my
4 monitors/laptops requires this.  It always stretches to 16:9.

The mouse data has new aspect ratio fields for selecting the best
cursor and a new name field for display in debugging messages.

Selecting the mouse cursor is now a slow operation so it is not done
for every drawing of the cursor.  To avoid a new initialization method,
it is done whenever the text cursor is set or changed.  Also remove
dead code in settings of text cursors.

Use larger mouse cursors (sometimes the full 10x16 one) for 8x8 fonts
in cases where this works better (mostly in graphics mode).

7 years agostdbuf(1): Add buffer definition "B" to the usage message
Alan Somers [Sat, 8 Jul 2017 17:08:42 +0000 (17:08 +0000)]
stdbuf(1): Add buffer definition "B" to the usage message

This option has been missing from the usage message ever since the program
was first imported.

Submitted by: shivansh
Reviewed by: asomers
MFC after: 3 weeks
Sponsored by: Google, Inc (GSoC 2017)
Differential Revision: https://reviews.freebsd.org/D11529

7 years agoSYSTEM_COMPILER: Ensure there is not a stale compiler in WORLDTMP.
Bryan Drewery [Sat, 8 Jul 2017 16:39:55 +0000 (16:39 +0000)]
SYSTEM_COMPILER: Ensure there is not a stale compiler in WORLDTMP.

In a scenario of cross-building it is possible that an OBJDIR's WORLDTMP
contains an older compiler in WORLDTMP/usr/bin/cc that is not rebuilt
if SYSTEM_COMPILER logic is triggered.  This compiler was still
incorrectly used.  Address this by removing WORLDTMP/usr/bin/cc and all
of the hardlinked files associated with it.  Also do this for c++ for
GCC builds.

Sponsored by: Dell EMC Isilon
MFC after: 1 week

7 years agoAdd files to help manage the (vga) syscons mouse cursor.
Bruce Evans [Sat, 8 Jul 2017 15:01:55 +0000 (15:01 +0000)]
Add files to help manage the (vga) syscons mouse cursor.

To mostly fix distortion of mouse cursors by non-square pixels, I
needed 8 variants of the same cursor shape for large fonts and
another 7 variants for small fonts.  Some variants are shared,
leaving only 13 variants in 26 glyphs altogether.  Keep these in
the BDF source file cursor.bdf.  cursor.bdf has another 5 unused
experimental cursors in 10 glyphs.  cursor.awk is a simple awk
script for converting this and similar bdf files into C declarations
for copying into scvgarndr.c.  syscons doesn't use any of this yet.

7 years agoFix handling of one more possible exception on return to usermode.
Konstantin Belousov [Sat, 8 Jul 2017 11:07:39 +0000 (11:07 +0000)]
Fix handling of one more possible exception on return to usermode.

If %ss is loaded with a segment pointing to a non-present descriptor
by the IRETD instruction, a kernel-mode #SS exception is generated.
Resulting T_STKFLT trap must be checked against doreti_iret_fault
location and handled, otherwise userspace may panic the kernel.

Note that this is i386 variant of FreeBSD-SA-15:21.amd64, but unlike
amd64, there is no swapgs on i386 and the issue is arguably not
exploitable.

Reported by: Maxime Villard <max@m00nbsd.net>
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoFix "mount -uw /" when the filesystem type doesn't match.
Edward Tomasz Napierala [Sat, 8 Jul 2017 11:06:27 +0000 (11:06 +0000)]
Fix "mount -uw /" when the filesystem type doesn't match.

This basically makes "mount -uw /" work when the filesystem
mounted on / is NFS, but the one configured in fstab(5) is UFS,
which can happen when you forget to modify fstab.

Note that the whole special case ("else if (argv[0][0] == '/'")
is probably not needed anyway.  I'll take a look at removing it
altogether; for now this is a minimally intrusive fix.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D11323

7 years agoAllow more services to run in vnet jails
Kristof Provost [Sat, 8 Jul 2017 09:28:31 +0000 (09:28 +0000)]
Allow more services to run in vnet jails

After some tests, here are the services that run into a vnet jail:
  - defaultroute
  - dhclient
  - ip6addrctl
  - natd
  - pf
  - pfsync
  - pflog (deamon runs, pflog0 interface usable, but /var/log/pflog not filled)
  - rarpd
  - route6d (do nothing anyway because obsolete)
  - routed (do nothing anyway because obsolete)
  - rtsold
  - static_arp
  - static_ndp

PR: 220530
Submitted by: olivier@freebsd.org

7 years agoSimplify language.
Konstantin Belousov [Sat, 8 Jul 2017 07:33:30 +0000 (07:33 +0000)]
Simplify language.

Submitted by: wblock
MFC after: 3 days

7 years agoCorrectly ignore branch operators in the top-level parser when applicable.
Kyle Evans [Fri, 7 Jul 2017 22:00:39 +0000 (22:00 +0000)]
Correctly ignore branch operators in the top-level parser when applicable.

An oversight in r320742 caused BREs to become sensitive to the branching operator prematurely, which caused
breakage in some limited situations -- namely, those that tried to use branching in a BRE. Most of these scenarios
had already been corrected beforehand to properly use gsed or grep for GNU extensions, so the damage is
slightly mitigated.

Reported by: antoine

Reported by: antoine
Approved by: emaste (mentor)
Differential Revision: https://reviews.freebsd.org/D11522

7 years agoBump date for today's commit.
Warner Losh [Fri, 7 Jul 2017 16:58:40 +0000 (16:58 +0000)]
Bump date for today's commit.

7 years agoImprove wording for -E and -t flags. -E never writes the entire disk,
Warner Losh [Fri, 7 Jul 2017 16:54:18 +0000 (16:54 +0000)]
Improve wording for -E and -t flags. -E never writes the entire disk,
so don't imply that. Note that if BIO_DELETE isn't supported, the
operation will fail (as opposed to writing the entire disk with
zeros). Thin storage also benefits from trim. List more accurate
reason why trim helps flash-memory.

7 years agoConnect ena(4) to the build.
Glen Barber [Fri, 7 Jul 2017 16:22:09 +0000 (16:22 +0000)]
Connect ena(4) to the build.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

7 years agoRemove the MULTIDELAY option from arm. It's now enabled when PLATFORM is
Andrew Turner [Fri, 7 Jul 2017 13:55:11 +0000 (13:55 +0000)]
Remove the MULTIDELAY option from arm. It's now enabled when PLATFORM is
enabled.

7 years agoComplete r320189 which allows a NULL VM fault handler in the LinuxKPI.
Hans Petter Selasky [Fri, 7 Jul 2017 13:44:14 +0000 (13:44 +0000)]
Complete r320189 which allows a NULL VM fault handler in the LinuxKPI.
Instead of mapping a dummy page upon a page fault, map the page
pointed to by the physical address given by IDX_TO_OFF(vmap->vm_pfn).
To simplify the implementation use OBJT_DEVICE to implement our own
linux_cdev_pager_fault() instead of using the existing
linux_cdev_pager_populate().

Some minor code factoring while at it.

Reviewed by: markj @
MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoFix a bug in synchronize RCU when the calling thread is bound to a CPU.
Hans Petter Selasky [Fri, 7 Jul 2017 13:15:00 +0000 (13:15 +0000)]
Fix a bug in synchronize RCU when the calling thread is bound to a CPU.

Set "td_pinned" to zero after "sched_unbind()" to prevent "td_pinned"
from temporarily becoming negative during "sched_bind()". This can
happen if "sched_bind()" uses "sched_pin()" and "sched_unpin()".

MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoImplement fix for BULK IN-token retry mechanism. When the hardware is
Hans Petter Selasky [Fri, 7 Jul 2017 12:03:58 +0000 (12:03 +0000)]
Implement fix for BULK IN-token retry mechanism. When the hardware is
programmed for infinite IN token retry after NAK, the SAF1761
hardware, however, does not retry the IN-token. This problem is
described in the SAF1761 errata, section 18.1.1.

While at it:
- Add some minor chip specific initialization for RTEMS.
- Add debug print for status registers in the interrupt filter.

Submitted by: Christian Mauderer <christian.mauderer@embedded-brains.de>
MFC after: 1 week

7 years agoamd-vi: gcc build errors
Ryan Libby [Fri, 7 Jul 2017 06:37:19 +0000 (06:37 +0000)]
amd-vi: gcc build errors

amdvi_cmp_wait: gcc complained about a malformed string behind an ifdef.

struct amdvi_dte: widen the type of the first reserved bitfield so that
the packed representation would not cross an alignment boundary for that
type. Apparently that causes in-tree gcc (4.2) to insert padding
(despite packed, resulting in a wrong structure definition), and causes
more modern gcc to emit a warning.

ivrs_hdr_iterate_tbl: delete a misleading check about header length
being less than 0 (the type is unsigned) and replace it with a check
that the length doesn't exceed the table size.

Reviewed by: anish, grehan
Approved by: markj (mentor)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D11485

7 years agoImprove BIT_FLS() documentation.
Konstantin Belousov [Fri, 7 Jul 2017 05:43:44 +0000 (05:43 +0000)]
Improve BIT_FLS() documentation.

Submitted by: Sebastian Huber <sebastian.huber@embedded-brains.de>
MFC after: 6 days

7 years ago - Use strlcat() instead of strncat().
Xin LI [Fri, 7 Jul 2017 02:48:55 +0000 (02:48 +0000)]
 - Use strlcat() instead of strncat().
 - Use asprintf() and handle allocation errors.

Reviewed by: kevlo
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D11486

7 years agoDocument the changes done to nfsuserd by r320757.
Rick Macklem [Thu, 6 Jul 2017 22:34:34 +0000 (22:34 +0000)]
Document the changes done to nfsuserd by r320757.

This is a content change.

7 years agoModify the nfsuserd daemon so that it uses an AF_LOCAL socket for upcalls.
Rick Macklem [Thu, 6 Jul 2017 22:04:37 +0000 (22:04 +0000)]
Modify the nfsuserd daemon so that it uses an AF_LOCAL socket for upcalls.

This patch modifies the nfsuserd daemon so that it uses an AF_LOCAL socket
for upcalls by default. This should fix the problem with using a UDP
socket upcall to 127.0.0.1 when jails are used.
The AF_LOCAL socket case only supports a single server daemon, since hangs
were observed by the original problem reporter when multiple daemons
were used.
The patch adds a command line option called "-use-udpsock" which makes
the daemon revert to its prepatched behaviour.

Suggested by: dfr
PR: 205193
Relnotes: yes

7 years agoAdd BIT_FLS() analogous to BIT_FFS().
Konstantin Belousov [Thu, 6 Jul 2017 21:47:17 +0000 (21:47 +0000)]
Add BIT_FLS() analogous to BIT_FFS().

The benefit of BIT_FLS() is that ffsl() can be implemented with a
count leading zeros instruction which is more widespread available.

Submitted by: Sebastian Huber <sebastian.huber@embedded-brains.de>
MFC after: 1 week

7 years agoUpdate copyright e-mail address to @FreeBSD.org address
Kyle Evans [Thu, 6 Jul 2017 19:53:30 +0000 (19:53 +0000)]
Update copyright e-mail address to @FreeBSD.org address

Approved by: emaste (mentor)
Differential Revision: https://reviews.freebsd.org/D11508

7 years agoFix sparc64 libc build after r320742.
Kyle Evans [Thu, 6 Jul 2017 18:21:30 +0000 (18:21 +0000)]
Fix sparc64 libc build after r320742.

p_branch_empty was declared but never used due to an oversight. Use it as
designed, further comment on its return value.

Reported by: Jenkins (head-sparc64)
Reviewed by: emaste
Approved by: emaste (mentor)
MFC with: r320742
Differential Revision: https://reviews.freebsd.org/D11506

7 years agoAllow passing NOPKG= to make(1) to prevent the pkg-stage target
Glen Barber [Thu, 6 Jul 2017 17:54:03 +0000 (17:54 +0000)]
Allow passing NOPKG= to make(1) to prevent the pkg-stage target
from getting executed.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

7 years agoFix drivers that assume ticks starts at zero. These drivers all have logic
Ian Lepore [Thu, 6 Jul 2017 17:03:22 +0000 (17:03 +0000)]
Fix drivers that assume ticks starts at zero.  These drivers all have logic
similar to "if (ticks > localvar+interval) {localvar=ticks; ...}" where
localvar is initialized to zero.  Ticks is initialized to a negative value
since r278230, and that leads to these if statements never being true.

7 years agoThe impending libregex will implement GNU extensions to bring BREs and
Kyle Evans [Thu, 6 Jul 2017 17:01:51 +0000 (17:01 +0000)]
The impending libregex will implement GNU extensions to bring BREs and
EREs closer together. Prepare for this and reduce the diff of libregex changes by
refactoring and combining the top-level parsers for EREs/BREs ahead of time.

Branching functionality has been split out to make it easier to follow the combined
version of the top-level parser. It may also be enabled in the parsing context to make
it easier when libregex enables branching for BREs.

A branching context was also added for the various branching functions and so that
BREs, for instance, can determine if they're the first expression in a chain of expressions
within the current branch and treat '*' as ordinary if so.

This should have no functional impact and negligible performance impact.

Reviewed by: cem, emaste, pfg
Approved by: emaste (mentor)
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D10920

7 years agoMake ^c work in ddb(4).
Edward Tomasz Napierala [Thu, 6 Jul 2017 15:27:34 +0000 (15:27 +0000)]
Make ^c work in ddb(4).

Obtained from: CheriBSD
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

7 years agoMake ^w work in ddb(4).
Edward Tomasz Napierala [Thu, 6 Jul 2017 15:21:57 +0000 (15:21 +0000)]
Make ^w work in ddb(4).

Obtained from: CheriBSD
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

7 years agoMake ddb(4) disassembler (x/i) use n32 register names.
Edward Tomasz Napierala [Thu, 6 Jul 2017 15:08:51 +0000 (15:08 +0000)]
Make ddb(4) disassembler (x/i) use n32 register names.

Obtained from: CheriBSD
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

7 years agoSimplify UIO_SYSSPACE and UIO_NOCOPY paths in uiomove
Andrew Gallatin [Thu, 6 Jul 2017 15:03:54 +0000 (15:03 +0000)]
Simplify UIO_SYSSPACE and UIO_NOCOPY paths in uiomove

Uiomove can only block when the segflag is UIO_USERSPACE,
otherwise we end up just doing a bcopy (or nothing) and
moving cursors. So only emit witness warnings and
set deadlock thread flags in the UIO_USERSPACE case.

Reviewed by: kib
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D11489

7 years agoFix cleanup in lib/libc/gen/setdomainname_test
Alan Somers [Thu, 6 Jul 2017 14:47:59 +0000 (14:47 +0000)]
Fix cleanup in lib/libc/gen/setdomainname_test

ATF cleanup routines run in separate processes from the tests themselves, so
they can't share global variables.

Also, setdomainname_test needs to be is_exclusive because the test cases
access a global resource.

PR: 219967
Reviewed by: ngie
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D11188

7 years agoacpidump: warn and exit loop on invalid subtable length
Ed Maste [Thu, 6 Jul 2017 14:35:47 +0000 (14:35 +0000)]
acpidump: warn and exit loop on invalid subtable length

Submitted by: Guangyuan Yang <yzgyyang@outlook.com>
Sponsored by: The FreeBSD Foundation

7 years agocompiler_rt: provide bswap buildins on sparc64
Ed Maste [Thu, 6 Jul 2017 13:27:01 +0000 (13:27 +0000)]
compiler_rt: provide bswap buildins on sparc64

Attempting to build sparc64 world with GCC 6.3 previously failed with
zstd_compress.c:(.text+0x8fc): undefined reference to `__bswapsi2'

7 years agoImprove ddb(4) error reporting a bit.
Edward Tomasz Napierala [Thu, 6 Jul 2017 12:30:39 +0000 (12:30 +0000)]
Improve ddb(4) error reporting a bit.

Obtained from: CheriBSD
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

7 years agoMake ddb(4) a bit more user-friendly by improving "help".
Edward Tomasz Napierala [Thu, 6 Jul 2017 12:27:14 +0000 (12:27 +0000)]
Make ddb(4) a bit more user-friendly by improving "help".

Obtained from: CheriBSD
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

7 years agousr.sbin/bsdinstall/scripts/hardening: fix options numbers
Bartek Rutkowski [Thu, 6 Jul 2017 12:19:15 +0000 (12:19 +0000)]
usr.sbin/bsdinstall/scripts/hardening: fix options numbers

Submitted by: Bartek Rutkowski <robak@FreeBSD.org>
Reviewed by: bapt
Approved by: bapt
MFC after: 1 day
Differential Revision: https://reviews.freebsd.org/D11505

7 years agoReport device descr in addition to ident.
Alexander Motin [Thu, 6 Jul 2017 09:05:38 +0000 (09:05 +0000)]
Report device descr in addition to ident.

Serial number without device model is somewhat less useful.

MFC after: 2 weeks

7 years agoAdd GEOM::descr attribute for symmetry with GEOM::ident.
Alexander Motin [Thu, 6 Jul 2017 08:36:14 +0000 (08:36 +0000)]
Add GEOM::descr attribute for symmetry with GEOM::ident.

MFC after: 2 weeks

7 years agoChase upstream change deprecating LIBXO_OPTIONS similar to r320521
Enji Cooper [Thu, 6 Jul 2017 08:05:57 +0000 (08:05 +0000)]
Chase upstream change deprecating LIBXO_OPTIONS similar to r320521

LIBXO_OPTIONS was deprecated in favor of the --libxo options.

Inspired by: https://github.com/Juniper/libxo (02272d5c6d7d)

7 years ago:snprintf_float: don't blindly set RLIMIT_DATA and RLIMIT_AS to 1 MB -- raise
Enji Cooper [Thu, 6 Jul 2017 07:59:00 +0000 (07:59 +0000)]
:snprintf_float: don't blindly set RLIMIT_DATA and RLIMIT_AS to 1 MB -- raise
the limit to 32MB instead.

Require user=root and memory=64MB+ first so one can be reasonably sure that
the test will function appropriately.

MFC after: 1 month
MFC with: r320726
PR: 220502

7 years agoExpect :snprintf_float to segfault
Enji Cooper [Thu, 6 Jul 2017 07:45:20 +0000 (07:45 +0000)]
Expect :snprintf_float to segfault

This issue started occurring within the past month or so.

PR: 220502
Reported by: Jenkins (amd64-head job)

7 years agortwn: add Rx descriptor structures for common code.
Andriy Voskoboinyk [Thu, 6 Jul 2017 07:37:33 +0000 (07:37 +0000)]
rtwn: add Rx descriptor structures for common code.

Remove any chipset specific usage of Rx descriptor structure / bits
from common code to prevent misuse of fields that may differ
between various chipsets.

Checked with:  RTL8821AU in STA mode.

7 years ago:l_flag:: be more aggressive when normalizing whitespace
Enji Cooper [Thu, 6 Jul 2017 07:37:03 +0000 (07:37 +0000)]
:l_flag:: be more aggressive when normalizing whitespace

Save output from ls -ldT and stat -l, then normalize all repeating whitespace using
sed to single column spaces.

This makes the test flexible with single-digit days, etc, similar to r320723. This
approach is just a bit more of a hammer approach because of how the columns are
ordered/spaced in both ls and stat.

MFC after: 1 week
MFC with: r319841

7 years agoUse %e instead of %d with x_output_date(..)
Enji Cooper [Thu, 6 Jul 2017 06:15:44 +0000 (06:15 +0000)]
Use %e instead of %d with x_output_date(..)

stat -x doesn't 0-fill days so %d is inappropriate. %e is correct.

MFC after: 1 week
MFC with: r319841

7 years agoRegenerate src.conf(5)
Enji Cooper [Thu, 6 Jul 2017 05:43:04 +0000 (05:43 +0000)]
Regenerate src.conf(5)

7 years agoAdd WITH_RCMDS for parity with WITHOUT_RCMDS
Enji Cooper [Thu, 6 Jul 2017 05:40:51 +0000 (05:40 +0000)]
Add WITH_RCMDS for parity with WITHOUT_RCMDS

7 years agohptmv: avoid gcc variably-modified warning
Ryan Libby [Thu, 6 Jul 2017 05:32:22 +0000 (05:32 +0000)]
hptmv: avoid gcc variably-modified warning

gcc produces a "variably modified X at file scope" warning for
structures that use these size definitions.

PR: 211540
Reviewed by: markj
Approved by: markj (mentor)
Sponsored by: Dell EMC Isilon
Differential revision: https://reviews.freebsd.org/D11416

7 years agoRelease mtx hw_lock before calling pause() in qla_stop() and
David C Somayajulu [Thu, 6 Jul 2017 05:16:06 +0000 (05:16 +0000)]
Release mtx hw_lock before calling pause() in qla_stop() and
qla_error_recovery()

MFC after: 5 days

7 years ago[ar724x] put in explicit memory barriers now that read/write register no longer
Adrian Chadd [Thu, 6 Jul 2017 04:56:23 +0000 (04:56 +0000)]
[ar724x] put in explicit memory barriers now that read/write register no longer
implicitly do them.

They were removed as part of my "fix this to actually work" a few commits
ago in this file.

Tested:

* AP93, AR7240 + AR9280 PCI

7 years agoAdd tests to help verify Links functionality for .../contrib/tzdata/backwards
Enji Cooper [Thu, 6 Jul 2017 04:30:06 +0000 (04:30 +0000)]
Add tests to help verify Links functionality for .../contrib/tzdata/backwards

MFC after: 1 month
MFC with: r320702

7 years agoFormalize LEAPSECONDS and OLDTIMEZONES in share/zoneinfo/... as
Enji Cooper [Thu, 6 Jul 2017 04:19:33 +0000 (04:19 +0000)]
Formalize LEAPSECONDS and OLDTIMEZONES in share/zoneinfo/... as
`MK_ZONEINFO_LEAPSECONDS_SUPPORT == yes` and
`MK_ZONEINFO_OLD_TIMEZONES_SUPPORT == yes`.

Keep `LEAPSECONDS` and `OLDTIMEZONES` for backwards compatibility,
but print out a warning notifying users that they should use the new
variables, in an effort to migrate them to the variables. This is being
done mostly for automated build tools, etc, that might rely on these
variables being set. The variables will be removed in the future on
^/head, e.g., after ^/stable/12 is cut.

MFC after:      1 month
Relnotes:       yes
Reviewed by: bdrewery
Differential Revision: D11376

7 years agoRemove SUBDIR ordering/uniquifying in *bin/Makefile
Enji Cooper [Thu, 6 Jul 2017 04:15:30 +0000 (04:15 +0000)]
Remove SUBDIR ordering/uniquifying in *bin/Makefile

After the addition of SUBDIR.yes, uniquifying/ordering the SUBDIRs doesn't
make a whole lot of sense, and it's in effect a half measure.

Ordering SUBDIR (after adding SUBDIR.yes to it) in bsd.subdir.mk is a
separate change that warrants more discussion/testing, because while
the SUBDIR_PARALLEL work largely fixed dependency ordering for SUBDIRs,
there might be downstream FreeBSD consumers that rely on the SUBDIR
ordering.

MFC after: 2 months
Reviewed by: bdrewery
Differential Revision: D11398

7 years ago[ar71xx] Start migrating the AR934x based boards over to the new world order.
Adrian Chadd [Thu, 6 Jul 2017 04:06:25 +0000 (04:06 +0000)]
[ar71xx] Start migrating the AR934x based boards over to the new world order.

This unifies the PCI hints with the AHB/NOR hint syntax.

Tested:

* DIR825C1, AR9344 SoC / 2x2 2G + AR9580 PCI 2x2 5G

7 years agoAdd support for AF_LOCAL socket upcalls to the nfsuserd daemon.
Rick Macklem [Thu, 6 Jul 2017 00:53:12 +0000 (00:53 +0000)]
Add support for AF_LOCAL socket upcalls to the nfsuserd daemon.

This patch adds support for AF_LOCAL socket upcalls to an nfsuserd daemon
that supports them. A future patch to the nfsuserd daemon will use AF_LOCAL
sockets to avoid a problem when using upcalls to 127.0.0.1 if jails are
in use.

Suggested by: dfr
PR: 205193

7 years agoAllow ipsec to run in vnet jails
Kristof Provost [Wed, 5 Jul 2017 20:00:58 +0000 (20:00 +0000)]
Allow ipsec to run in vnet jails

ipsec is usable in vnet jails, so allow it to run there.

PR: 211364
Submitted by: Matthias Meyser <meyser xenet.de>

7 years agoFix out-of-tree kernel builds after r320275 when bsd.linker.mk not yet installed.
Bryan Drewery [Wed, 5 Jul 2017 19:43:16 +0000 (19:43 +0000)]
Fix out-of-tree kernel builds after r320275 when bsd.linker.mk not yet installed.

Submitted by: bde

7 years agoAllow MTU changes without ifconfig down/up
David C Somayajulu [Wed, 5 Jul 2017 19:25:09 +0000 (19:25 +0000)]
Allow MTU changes without ifconfig down/up

MFC after:5 days

7 years agoFix create-kernel-packages with multiple BUILDKERNELS after r320284
Bryan Drewery [Wed, 5 Jul 2017 19:24:38 +0000 (19:24 +0000)]
Fix create-kernel-packages with multiple BUILDKERNELS after r320284

Submitted by: Kyle Evans <kevans91@ksu.edu>
Reviewed by: ngie

7 years agoDefer ACPI taskqueue creation to SI_SUB_KICK_SCHEDULER.
Mark Johnston [Wed, 5 Jul 2017 17:39:17 +0000 (17:39 +0000)]
Defer ACPI taskqueue creation to SI_SUB_KICK_SCHEDULER.

This addresses a deadlock during boot when EARLY_AP_STARTUP is configured:
a taskqueue thread may call pause() with an ACPI mutex held, and thread0
may block on this mutex before configuring the eventtimer. In this case
the taskqueue thread will sleep forever waiting for its callout to fire.

PR: 220277
Submitted by: jhb
MFC after: 3 days

7 years agoixgbe(4): Update HEAD (p3) to 3.2.12-k
Eric Joyner [Wed, 5 Jul 2017 17:27:03 +0000 (17:27 +0000)]
ixgbe(4): Update HEAD (p3) to 3.2.12-k

Includes:

- Support for X550EM devices.
- Support for Bypass adapters.
- Flow Director code moved to separate files
- SR-IOV code moved to separate files
- Netmap code moved to separate files

Differential Revision: https://reviews.freebsd.org/D11232
Submitted by: Jeb Cramer <cramerj@intel.com>
Reviewed by: erj@
Tested by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Sponsored by: Intel Corporation

7 years agoFix the ftp-stage target for RPI3 images by loosening the
Glen Barber [Wed, 5 Jul 2017 16:55:45 +0000 (16:55 +0000)]
Fix the ftp-stage target for RPI3 images by loosening the
constraints on the TARGET and TARGET_ARCH variables.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

7 years agoAdd naive benchmark for SSDs in ZFS SLOG role.
Alexander Motin [Wed, 5 Jul 2017 16:20:22 +0000 (16:20 +0000)]
Add naive benchmark for SSDs in ZFS SLOG role.

ZFS SLOGs have very specific access pattern with many cache flushes,
which none of benchmarks I know can simulate.  Since SSD vendors rarely
specify cache flush time, this measurement can be useful to explain why
some ZFS pools are slower then expected.  This test writes data chunks
of different size followed by cache flush, alike to what ZFS SLOG does,
and measures average time.

To illustrate, here is result for 6 years old SATA Intel 710 Series SSD:

Synchronous random writes:
         0.5 kbytes:    138.3 usec/IO =      3.5 Mbytes/s
           1 kbytes:    137.7 usec/IO =      7.1 Mbytes/s
           2 kbytes:    151.1 usec/IO =     12.9 Mbytes/s
           4 kbytes:    158.2 usec/IO =     24.7 Mbytes/s
           8 kbytes:    175.6 usec/IO =     44.5 Mbytes/s
          16 kbytes:    210.1 usec/IO =     74.4 Mbytes/s
          32 kbytes:    274.2 usec/IO =    114.0 Mbytes/s
          64 kbytes:    416.5 usec/IO =    150.1 Mbytes/s
         128 kbytes:    776.6 usec/IO =    161.0 Mbytes/s
         256 kbytes:   1503.1 usec/IO =    166.3 Mbytes/s
         512 kbytes:   2968.7 usec/IO =    168.4 Mbytes/s
        1024 kbytes:   5866.8 usec/IO =    170.5 Mbytes/s
        2048 kbytes:  11696.6 usec/IO =    171.0 Mbytes/s
        4096 kbytes:  23329.6 usec/IO =    171.5 Mbytes/s
        8192 kbytes:  46779.5 usec/IO =    171.0 Mbytes/s

, and much newer and supposedly much faster NVMe Samsung 950 PRO SSD:

Synchronous random writes:
         0.5 kbytes:   2092.9 usec/IO =      0.2 Mbytes/s
           1 kbytes:   2013.1 usec/IO =      0.5 Mbytes/s
           2 kbytes:   2014.8 usec/IO =      1.0 Mbytes/s
           4 kbytes:   2090.7 usec/IO =      1.9 Mbytes/s
           8 kbytes:   2044.5 usec/IO =      3.8 Mbytes/s
          16 kbytes:   2084.8 usec/IO =      7.5 Mbytes/s
          32 kbytes:   2137.1 usec/IO =     14.6 Mbytes/s
          64 kbytes:   2173.4 usec/IO =     28.8 Mbytes/s
         128 kbytes:   2923.9 usec/IO =     42.8 Mbytes/s
         256 kbytes:   3085.3 usec/IO =     81.0 Mbytes/s
         512 kbytes:   3112.2 usec/IO =    160.7 Mbytes/s
        1024 kbytes:   2430.6 usec/IO =    411.4 Mbytes/s
        2048 kbytes:   3788.9 usec/IO =    527.9 Mbytes/s
        4096 kbytes:   6198.0 usec/IO =    645.4 Mbytes/s
        8192 kbytes:  10764.9 usec/IO =    743.2 Mbytes/s

While the first one obviously has maximal throughput limitations, the
second one has so high cache flush latency (about 2 millisecond), that
it makes one almost useless in SLOG role, despite of its good throughput
numbers.  Power loss protection is out of scope of this test, but I
suspect it can be related.

MFC after: 2 weeks
Sponsored by: iXsystems, Inc.

7 years agoDon't overpromote values when calculating len in tcp_output().
Jonathan T. Looney [Wed, 5 Jul 2017 16:10:30 +0000 (16:10 +0000)]
Don't overpromote values when calculating len in tcp_output().

sbavail() returns u_int and sendwin is a uint32_t. Therefore, min() (which
operates on two u_int values) is able to correctly calculate the minimum
of these two arguments.

Reported by: rrs
MFC after: 1 week
Sponsored by: Netflix

7 years agoFix typo introduced in r320672 - check for existence of the right file.
Edward Tomasz Napierala [Wed, 5 Jul 2017 15:42:33 +0000 (15:42 +0000)]
Fix typo introduced in r320672 - check for existence of the right file.

Reported by: rpokala@
MFC after: 2 weeks

7 years agoAdd deprecation notices for gdb and kgdb.
John Baldwin [Wed, 5 Jul 2017 15:23:30 +0000 (15:23 +0000)]
Add deprecation notices for gdb and kgdb.

Even though gdb and kgdb may not be removed for 12.0 on some architectures,
the notice is unconditional as these tools will likely be removed at some
point in the future when adequate replacements are available (gdb in ports
or lldb in base).

Reviewed by: emaste
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D11477

7 years agoAdd option to bsdinstall to disable insecure console, update stack guard option
Bartek Rutkowski [Wed, 5 Jul 2017 13:37:27 +0000 (13:37 +0000)]
Add option to bsdinstall to disable insecure console, update stack guard option

This patch adds new bsdinstall option to hardening section that allows users
to change this behaviour to secure one and updates stack guard option so it
would set the value of relevant sysctl to 512 (2MB)

Submitted by: Bartek Rutkowski
Reviewed by: adrian, bapt, emaste
Approved by: bapt, emaste
MFC after: 1 day
Sponsored by: Pixeware LTD
Differential Revision: https://reviews.freebsd.org/D9700

7 years agoSort entries in libgcc_s Version.map
Ed Maste [Wed, 5 Jul 2017 13:13:38 +0000 (13:13 +0000)]
Sort entries in libgcc_s Version.map

7 years agoCosmetic tweaks to the default shell rc files, mostly comments.
Edward Tomasz Napierala [Wed, 5 Jul 2017 13:08:07 +0000 (13:08 +0000)]
Cosmetic tweaks to the default shell rc files, mostly comments.

MFC after: 2 weeks

7 years agoUse more canonical .Dt for vt(4).
Edward Tomasz Napierala [Wed, 5 Jul 2017 10:43:27 +0000 (10:43 +0000)]
Use more canonical .Dt for vt(4).

MFC after: 2 weeks

7 years agoRun "resizewin -z" from the default shell profile files. This makes
Edward Tomasz Napierala [Wed, 5 Jul 2017 10:37:37 +0000 (10:37 +0000)]
Run "resizewin -z" from the default shell profile files. This makes
the terminal work properly out of the box when logging over a serial
line, which is quite important for the user experience on boards like
Raspberry Pi.  It doesn't affect cases where the terminal size is
already non-zero, such as SSH or vt(4) sessions.

Note that this doesn't handle a scenario pointed out by rgrimes@:
when the terminal is resized after login, the terminal size won't
get updated even after logging out and back in.

Reviewed by: imp
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D10642

7 years agoMake MULTIDELAY a requirement in the MPCore Timer driver when using
Andrew Turner [Wed, 5 Jul 2017 10:29:05 +0000 (10:29 +0000)]
Make MULTIDELAY a requirement in the MPCore Timer driver when using
PLATFORM. This will help with removing the MULTIDELAY option, enabling
it when PLATFORM is enabled.

7 years agoRequire the ARM Generic Timer driver is built for MULTIDELAY on 32bit arm.
Andrew Turner [Wed, 5 Jul 2017 09:27:18 +0000 (09:27 +0000)]
Require the ARM Generic Timer driver is built for MULTIDELAY on 32bit arm.
As this driver is also used for DELAY on arm64 we need to keep the existing
DELAY code for it to use.

7 years agoIn open_binary_fd: when using buffer size for strl* and snprintf,
Xin LI [Wed, 5 Jul 2017 06:12:21 +0000 (06:12 +0000)]
In open_binary_fd: when using buffer size for strl* and snprintf,
always use >= instead of > to avoid truncation.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D11474
MFC after: 3 days

7 years agoDocument supported poollist() (ippool -l) options in usage() and in
Cy Schubert [Wed, 5 Jul 2017 05:50:36 +0000 (05:50 +0000)]
Document supported poollist() (ippool -l) options in usage() and in
ippool.8 man page.

7 years agolibelftc: bump version, tracking import in r320343
Ed Maste [Wed, 5 Jul 2017 02:58:46 +0000 (02:58 +0000)]
libelftc: bump version, tracking import in r320343