]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoFix the copy of addresses passed from userland in table replace command.
Luiz Otavio O Souza [Mon, 17 Aug 2015 23:03:54 +0000 (23:03 +0000)]
Fix the copy of addresses passed from userland in table replace command.

The size2 is the maximum userland buffer size (used when the addresses are
copied back to userland).

Obtained from: pfSense
MFC after: 3 days
Sponsored by: Rubicon Communications (Netgate)

8 years agoUse an xlat table and xlookup() instead of a home-rolled version for the
John Baldwin [Mon, 17 Aug 2015 19:08:48 +0000 (19:08 +0000)]
Use an xlat table and xlookup() instead of a home-rolled version for the
sigprocmask operation type.

8 years agoTidy the linux_socketcall decoding:
John Baldwin [Mon, 17 Aug 2015 18:47:39 +0000 (18:47 +0000)]
Tidy the linux_socketcall decoding:
- Don't exit if get_struct() fails, instead print the raw pointer value to
  match all other argument decoding cases.
- Use an xlat table instead of a home-rolled switch for the operation name.
- Display the nested socketcall args structure as a structure instead of as
  two inline arguments.

8 years agoXEN/amd64 may initiate i/o over the pages not mapped by the direct
Konstantin Belousov [Mon, 17 Aug 2015 18:42:45 +0000 (18:42 +0000)]
XEN/amd64 may initiate i/o over the pages not mapped by the direct
map.  Handle busdma bouncing and ata PIO accesses by using global
frame used by the current CPU locally for the duration of
pmap_quick_enter/remove_page().  A spin mutex protects the concurent
frame use and prevents thread migration.

Noted by: royger
Reviewed by: alc, jah, royger (previous version)
Sponsored by: The FreeBSD Foundation

8 years agoSome cleanups to make the style of pmap_quick_enter_page() and pmap_quick_remove_page...
Jason A. Harmening [Mon, 17 Aug 2015 18:28:40 +0000 (18:28 +0000)]
Some cleanups to make the style of pmap_quick_enter_page() and pmap_quick_remove_page() in arm/pmap-v6-new.c more consistent with the rest of the file.

Submitted by: Svatopluk Kraus <onwahe@gmail.com>
Approved by: kib (mentor)

8 years agoDecode the optional SOCK_NONBLOCK and SOCK_CLOEXEC flags passed in a
John Baldwin [Mon, 17 Aug 2015 17:57:01 +0000 (17:57 +0000)]
Decode the optional SOCK_NONBLOCK and SOCK_CLOEXEC flags passed in a
socket type.

8 years ago- Decode the arguments for several signal-related system calls: sigpending,
John Baldwin [Mon, 17 Aug 2015 17:52:28 +0000 (17:52 +0000)]
- Decode the arguments for several signal-related system calls: sigpending,
  sigqueue, sigreturn, sigsuspend, sigtimedwait, sigwait, sigwaitinfo, and
  thr_kill.
- Print signal sets as a structure (with {}'s) and in particular use this to
  differentiate empty sets from a NULL pointer.
- Decode arguments for some other system calls: issetugid, pipe2, sysarch
  (operations are only decoded for amd64 and i386), and thr_self.

8 years agogpioled(4) depends on gpiobus.
Luiz Otavio O Souza [Mon, 17 Aug 2015 17:09:57 +0000 (17:09 +0000)]
gpioled(4) depends on gpiobus.

This fixes the loading of gpioled as a module.

Sponsored by: Rubicon Communications (Netgate)

8 years agoFix the build of gpiobus as a module.
Luiz Otavio O Souza [Mon, 17 Aug 2015 17:01:26 +0000 (17:01 +0000)]
Fix the build of gpiobus as a module.

Add the missing newbus interfaces and gpioc, which is part of basic gpiobus
framework.

Sponsored by: Rubicon Communications (Netgate)

8 years agoFix a few bugs when gpiobus is detaching:
Luiz Otavio O Souza [Mon, 17 Aug 2015 16:51:37 +0000 (16:51 +0000)]
Fix a few bugs when gpiobus is detaching:

 - Detach the gpiobus and the gpioc devices from the GPIO controller.

 - Fix the leak of gpiobus IRQ rman(9) region descriptor.

 - Fix the leak of child ivars and IRQ resource list.

While here return NULL (instead of 0) for a device_t that fails to allocate
the ivar memory.

Tested with gpiobus built as a module.

Sponsored by: Rubicon Communications (Netgate)

8 years agoDon't forget to invoke pre_execve() and post_execve().
Ed Schouten [Mon, 17 Aug 2015 13:07:12 +0000 (13:07 +0000)]
Don't forget to invoke pre_execve() and post_execve().

CloudABI's proc_exec() was implemented before r282708 introduced
pre_execve() and post_execve(). Sync up by adding these missing calls.

8 years agoSeparate ELFTOOLCHAIN_BOOTSTRAP from BINUTILS_BOOTSTRAP
Ed Maste [Mon, 17 Aug 2015 10:48:55 +0000 (10:48 +0000)]
Separate ELFTOOLCHAIN_BOOTSTRAP from BINUTILS_BOOTSTRAP

For most cases they are equivalent, but BINUTILS_BOOTSTRAP is a
BROKEN_OPTION on arm64 as the in-tree GNU binutils do not support it,
so we need a separate internal flag for ELF Tool Chain.

Reviewed by: andrew, brooks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3381

8 years agoBelatedly fix documentation on which interface to use as argument.
Gleb Smirnoff [Mon, 17 Aug 2015 09:18:54 +0000 (09:18 +0000)]
Belatedly fix documentation on which interface to use as argument.

8 years agoAdd DEV_RANDOM pseudo-option and use it to "include out" random(4)
Mark Murray [Mon, 17 Aug 2015 07:36:12 +0000 (07:36 +0000)]
Add DEV_RANDOM pseudo-option and use it to "include out" random(4)
if desired.

Retire randomdev_none.c and introduce random_infra.c for resident
infrastructure. Completely stub out random(4) calls in the "without
DEV_RANDOM" case.

Add RANDOM_LOADABLE option to allow loadable Yarrow/Fortuna/LocallyWritten
algorithm.  Add a skeleton "other" algorithm framework for folks
to add their own processing code. NIST, anyone?

Retire the RANDOM_DUMMY option.

Build modules for Yarrow, Fortuna and "other".

Use atomics for the live entropy rate-tracking.

Convert ints to bools for the 'seeded' logic.

Move _write() function from the algorithm-specific areas to randomdev.c

Get rid of reseed() function - it is unused.

Tidy up the opt_*.h includes.

Update documentation for random(4) modules.

Fix test program (reviewers, please leave this).

Differential Revision:    https://reviews.freebsd.org/D3354
Reviewed by:              wblock,delphij,jmg,bjk
Approved by:              so (/dev/random blanket)

8 years agoAdd simple (no-op) emulations for the CHECK_POWER_MODE,
Peter Grehan [Mon, 17 Aug 2015 05:59:36 +0000 (05:59 +0000)]
Add simple (no-op) emulations for the CHECK_POWER_MODE,
READ_VERIFY and READ_VERIFY_EXT commands.

Reviewed by: mav

8 years agoAdd define for SATA Check-Power-Mode command, 0xe5.
Peter Grehan [Mon, 17 Aug 2015 05:56:41 +0000 (05:56 +0000)]
Add define for SATA Check-Power-Mode command, 0xe5.

8 years agoso_vnet is constant after creation and no locking is necessary,
Xin LI [Mon, 17 Aug 2015 05:53:37 +0000 (05:53 +0000)]
so_vnet is constant after creation and no locking is necessary,
document this fact.

(netmap have an assignment too but that socket object is on stack).

MFC after: 2 weeks

8 years agoRemove most of the references of ifp->if_softc and replace with
Adrian Chadd [Mon, 17 Aug 2015 02:04:11 +0000 (02:04 +0000)]
Remove most of the references of ifp->if_softc and replace with
references to ic->ic_softc.

This is in preparation for gleb's ifnet work.

Tested:

* ath(4), STA mode
* ath(4), hostap mode
* make universe

8 years agoUse arc4random_buf(). While there, unifdef the code for HAVE_ARC4RANDOM.
Xin LI [Sun, 16 Aug 2015 23:23:58 +0000 (23:23 +0000)]
Use arc4random_buf().  While there, unifdef the code for HAVE_ARC4RANDOM.

MFC after: 2 weeks

8 years agoBump all copywrite dates to 2015
Sean Bruno [Sun, 16 Aug 2015 20:13:58 +0000 (20:13 +0000)]
Bump all copywrite dates to 2015

Differential Revision: https://reviews.freebsd.org/D3160
Submitted by: erj
MFC after: 2 weeks
Sponsored by: Intel Corportation

8 years agoe1000/if_lem.c bump to 1.1.0
Sean Bruno [Sun, 16 Aug 2015 20:10:43 +0000 (20:10 +0000)]
e1000/if_lem.c bump to 1.1.0
- deprecate fbsd 8

Differential Revision: https://reviews.freebsd.org/D3164
Submitted by: erj
MFC after: 2 weeks
Sponsored by: Intel Corporation

8 years agoIncrease EM_MAX_SCATTER to 64 such that the size of em_xmit()::segs[EM_MAX_SCATTER]
Sean Bruno [Sun, 16 Aug 2015 19:43:44 +0000 (19:43 +0000)]
Increase EM_MAX_SCATTER to 64 such that the size of em_xmit()::segs[EM_MAX_SCATTER]
doesn't get overrun by things like NFS that can and do shove more than 32 segs when
being used with em(4) and TSO4.

Update tso handling code in em_xmit() with update from jhb@ in email thread:
https://lists.freebsd.org/pipermail/freebsd-net/2014-July/039306.html

set ifp->if_hw_tsomax, ifp->if_hw_tsomaxsegcount & ifp->if_hw_tsomaxsegsize
to appropriate values.

Define a TSO workaround "magic" number  of 4 that is used to avoid an
alignment issue in hardware.

Change a couple of integer values that were used as booleans to actual
bool types.

Ensure that em_enable_intr() enables the appropriate mask of interrupts
and not just a hardcoded define of values.

PR: 200221 199174 195078
Differential Revision: https://reviews.freebsd.org/D3192
Reviewed by: erj jhb hiren
MFC after: 2 weeks
Sponsored by: Limelight Networks

8 years agowordexp(): Stop using the undocumented wordexp builtin.
Jilles Tjoelker [Sun, 16 Aug 2015 19:42:15 +0000 (19:42 +0000)]
wordexp(): Stop using the undocumented wordexp builtin.

The functionality of the wordexp builtin is easily replaced using normal
shell code, although performance is slightly worse.

This does not mean that wordexp() will remain shell-independent -- a fully
reliable implementation of WRDE_NOCMD is really only possible using
extensions to the shell, or by adding much of the shell's code to libc.

8 years agoAdd capability to disable CRC stripping. This breaks IPMI/BMC capabilities on certain...
Sean Bruno [Sun, 16 Aug 2015 19:06:23 +0000 (19:06 +0000)]
Add capability to disable CRC stripping. This breaks IPMI/BMC capabilities on certain adatpers.
Linux has been doing the exact same thing since 2008

https://github.com/torvalds/linux/commit/eb7c3adb1ca92450870dbb0d347fc986cd5e2af4

PR: 161277
Differential Revision: https://reviews.freebsd.org/D3282
Submitted by: Fravadona@gmail.com
Reviewed by: erj wblock
MFC after: 2 weeks
Relnotes: yes
Sponsored by: Limelight Networks

8 years agoAs another piece of PG_CACHE page elimination, remove an LRU-defeating call
Alan Cox [Sun, 16 Aug 2015 17:07:53 +0000 (17:07 +0000)]
As another piece of PG_CACHE page elimination, remove an LRU-defeating call
to vm_page_try_to_cache() from vm_pageout_flush().  Other changes, most
recently r286814, have made this call unnecessary.

Reviewed by: kib
Discussed with: jeff
Tested by: pho
Sponsored by: EMC / Isilon Storage Division

8 years agoPick UINT_MAX / 100 as an upperbound.
Ed Schouten [Sun, 16 Aug 2015 13:59:11 +0000 (13:59 +0000)]
Pick UINT_MAX / 100 as an upperbound.

The fix that I applied in r286798 is already good, but it assumes that
sizeof(int) > sizeof(short). Express the upperbound in terms of
UINT_MAX. By dividing that by 100, we're sure that the resulting value
is never larger than approximately UINT_MAX / 10, which is safe.

PR: 202326
Discussed with: kcwu csie org
MFC after: 1 month

8 years agosh: Backslash-newline should not affect field splitting in read builtin.
Jilles Tjoelker [Sun, 16 Aug 2015 12:57:17 +0000 (12:57 +0000)]
sh: Backslash-newline should not affect field splitting in read builtin.

This was originally broken in r212339 in 2010.

8 years agoSplit arpresolve() into fast/slow path.
Alexander V. Chernikov [Sun, 16 Aug 2015 12:23:58 +0000 (12:23 +0000)]
Split arpresolve() into fast/slow path.

This change isolates the most common case (e.g. successful lookup)
  from more complicates scenarios. It also (tries to) make code
  more simple by avoiding retry: cycle.

The actual goal is to prepare code to the upcoming change that will
  allow LL address retrieval without acquiring LLE lock at all.

Reviewed by: ae
Differential Revision: https://reviews.freebsd.org/D3383

8 years agoRegen src.conf.5 per r286822
Enji Cooper [Sun, 16 Aug 2015 10:10:58 +0000 (10:10 +0000)]
Regen src.conf.5 per r286822

8 years agoReap MK_SYSINSTALL
Enji Cooper [Sun, 16 Aug 2015 09:51:24 +0000 (09:51 +0000)]
Reap MK_SYSINSTALL

It's no longer in use in the tree (most likely missed when sade/sysinstall
were removed)

MFC after: 1 week

8 years agoSRR1 and DSISR aren't pointers, print them as integers.
Justin Hibbits [Sun, 16 Aug 2015 01:08:59 +0000 (01:08 +0000)]
SRR1 and DSISR aren't pointers, print them as integers.

8 years agoSmall addition to r286814.
Alexander Motin [Sat, 15 Aug 2015 22:55:32 +0000 (22:55 +0000)]
Small addition to r286814.

Submitted by: bz
MFC after: 2 weeks

8 years agoMake dtb file configurable via loader(8) variable. ubldr already checks
Oleksandr Tymoshenko [Sat, 15 Aug 2015 21:47:07 +0000 (21:47 +0000)]
Make dtb file configurable via loader(8) variable. ubldr already checks
"fdt_file" and "fdtfile" U-Boot variables. Add one more check for
"fdt_file" loader(8) variable.

loader(8) variable takes precedence over u-boot env one

8 years agoRemove UMA allocation of ATA requests.
Alexander Motin [Sat, 15 Aug 2015 21:46:02 +0000 (21:46 +0000)]
Remove UMA allocation of ATA requests.

After CAM replaced old ATA stack, this driver processes no more then one
request at a time per channel.  Using UMA after that is overkill, so
replace it with simple preallocation of one request per channel.

MFC after: 2 weeks

8 years agobsd.lib.mk has to be included after MLINKS assignment
Antoine Brodin [Sat, 15 Aug 2015 19:00:38 +0000 (19:00 +0000)]
bsd.lib.mk has to be included after MLINKS assignment

8 years agoPolish sizes processing.
Alexander Motin [Sat, 15 Aug 2015 18:22:16 +0000 (18:22 +0000)]
Polish sizes processing.

8 years agoImprove support for Macs that have a stride not equal to the
Marcel Moolenaar [Sat, 15 Aug 2015 16:13:28 +0000 (16:13 +0000)]
Improve support for Macs that have a stride not equal to the
horizonal resolution (width). In those cases fb_bpp ended up
completely wrong -- as in 6 bytes per pixel or something like
that. Since we already have a way to calculate fb_depth given
the masks and fb_bpp is effectively the same as fb_depth, all
we need to do is make sure fb_bpp is rounded to the next
multiple of the number of bits in a byte -- we assume we can
divide by the number of bits in a byte throughout vt(4).
While here:
-   simplify how we calculate fb_depth.
-   use fb_bpp instead of fb_depth to calculate fb_stride;
    we know we can divide fb_bpp.
-   don't limit fb_width and fb_height by VT_FB_DEFAULT_WIDTH
    and VT_FB_DEFAULT_HEIGHT (resp.). Those constants have
    not relation to the size of the frame buffer.

This at least fixes "lower-resolution" Macs. We're talking
1280x1024 or so. There still is a problem with 27" Macs,
which typically have a horizontal resolution over 2K.

PR: 193745 (partial)
Ok'd by: emaste@

8 years agoImprove the VT initialization message: have it say what the
Marcel Moolenaar [Sat, 15 Aug 2015 15:44:09 +0000 (15:44 +0000)]
Improve the VT initialization message: have it say what the
resolution is. For text mode this is the number of columns
by the number of rows. Include the name of the driver in a
much less prominent way.

8 years agoMove "ioctl" CAM frontend into separate file.
Alexander Motin [Sat, 15 Aug 2015 15:42:21 +0000 (15:42 +0000)]
Move "ioctl" CAM frontend into separate file.

It has nothing to share with too huge ctl.c other then device descriptor,
but even that may be counted as design error that may be fixed later.
At some point we may even want to have several ioctl ports.

8 years agoDrop "internal" CTL frontend.
Alexander Motin [Sat, 15 Aug 2015 13:34:38 +0000 (13:34 +0000)]
Drop "internal" CTL frontend.

Its idea was to be a simple initiator and execute several commands from
kernel level, but FreeBSD never had consumer for that functionality,
while its implementation polluted many unrelated places..

8 years agoUpdate to use the latest version of the PCI IDs Repository.
Baptiste Daroussin [Sat, 15 Aug 2015 12:55:06 +0000 (12:55 +0000)]
Update to use the latest version of the PCI IDs Repository.

MFC after: 1 week

8 years agoFixes for HIGH speed ISOCHRONOUS traffic. HS ISOCHRONOUS traffic at
Hans Petter Selasky [Sat, 15 Aug 2015 12:06:15 +0000 (12:06 +0000)]
Fixes for HIGH speed ISOCHRONOUS traffic. HS ISOCHRONOUS traffic at
intervals less than 250us was not handled properly. Add support for
high-bandwidth ISOCHRONOUS packets. USB webcams, USB audio and USB DVB
devices are expected to work better. High-bandwidth INTERRUPT
endpoints is not yet supported.

MFC after: 2 weeks

8 years agoFix race in USB PF which can happen if we stop tracing exactly when
Hans Petter Selasky [Sat, 15 Aug 2015 09:00:36 +0000 (09:00 +0000)]
Fix race in USB PF which can happen if we stop tracing exactly when
the kernel is tapping an USB transfer. This leads to a NULL pointer
access. The solution is to only trace while the USB bus lock is
locked.

MFC after: 2 weeks

8 years agoStop parsing digits if the value already exceeds USHRT_MAX.
Ed Schouten [Sat, 15 Aug 2015 08:42:33 +0000 (08:42 +0000)]
Stop parsing digits if the value already exceeds USHRT_MAX.

There is no need for us to support parsing values that are larger than
the maximum terminal window size. In this case that would be the maximum
of unsigned short.

The problem with parsing larger values is that they can cause integer
overflows when adjusting the cursor position, leading to all sorts of
failing assertions.

PR: 202326
Reported by: kcwu csie org
MFC after: 1 month

8 years agoAdd missing 'static' keyword to keep build at WARNS=6 happy.
Ed Schouten [Sat, 15 Aug 2015 08:29:13 +0000 (08:29 +0000)]
Add missing 'static' keyword to keep build at WARNS=6 happy.

MFC after: 1 month

8 years agoAdd support for the arrays in nvlist library.
Mariusz Zaborski [Sat, 15 Aug 2015 06:34:49 +0000 (06:34 +0000)]
Add support for the arrays in nvlist library.

- Add
  nvlist_{add,get,take,move,exists,free}_{number,bool,string,nvlist,
  descriptor} functions.
- Add support for (un)packing arrays.
- Add the nvl_array_next field to the nvlist structure.
  If an array is added by the nvlist_{move,add}_nvlist_array function
  this field will contains next element in the array.
- Add the nitems field to the nvpair and nvpair_header structure.
  This field contains number of elements in the array.
- Add special flag (NV_FLAG_IN_ARRAY) which is set if nvlist is a part of
  an array.
- Add special type (NV_TYPE_NVLIST_ARRAY_NEXT).This type is used only
  on packing/unpacking.
- Add new API for traversing arrays (nvlist_get_array_next).
- Add the nvlist_get_pararr function which combines the
  nvlist_get_array_next and nvlist_get_parent functions. If nvlist is in
  the array it will return next element from array. If nvlist is last
  element in array or it isn't in array it will return his
  container (parent). This function should simplify traveling over nvlist.
- Add tests for new features.
- Add documentation for new functions.
- Add my copyright.
- Regenerate the sys/cddl/compat/opensolaris/sys/nvpair.h file.

PR: 191083
Reviewed by: allanjude (doc)
Approved by: pjd (mentor)

8 years agoRemove automatic checkout feature.
Xin LI [Sat, 15 Aug 2015 00:42:33 +0000 (00:42 +0000)]
Remove automatic checkout feature.

Obtained from: DragonFly via OpenBSD
Relnotes: yes
MFC: never

8 years agosys/conf: pass NMFLAGS to nm(1) via genassym.sh.
Rui Paulo [Fri, 14 Aug 2015 22:58:32 +0000 (22:58 +0000)]
sys/conf: pass NMFLAGS to nm(1) via genassym.sh.

8 years agogenassym.sh: call nm(1) with NMFLAGS.
Rui Paulo [Fri, 14 Aug 2015 22:57:13 +0000 (22:57 +0000)]
genassym.sh: call nm(1) with NMFLAGS.

8 years agobsd.lib.mk: pass NMFLAGS to the lorder script.
Rui Paulo [Fri, 14 Aug 2015 22:55:23 +0000 (22:55 +0000)]
bsd.lib.mk: pass NMFLAGS to the lorder script.

8 years agoIntroduce a new make variable: NMFLAGS.
Rui Paulo [Fri, 14 Aug 2015 22:54:52 +0000 (22:54 +0000)]
Introduce a new make variable: NMFLAGS.

As the name indicates, these are flags to pass to nm(1).  The newer
binutils have a plugin mechanism so, to build something with LLVM's
LTO, we need to pass flags to nm(1).  This commit also extends
lorder(1) to pass NMFLAGS to nm(1).

8 years agoFor the case where an NFSv4.1 ExchangeID operation has the client identifier
Rick Macklem [Fri, 14 Aug 2015 22:02:14 +0000 (22:02 +0000)]
For the case where an NFSv4.1 ExchangeID operation has the client identifier
that already has a confirmed ClientID, the nfsrv_setclient() function would
not fill in the clientidp being returned. As such, the value of ClientID
returned would be whatever garbage was on the stack.
An NFSv4.1 client would not normally do this, but it appears that it can
happen for certain Linux clients. When it happens, the client persistently
retries the ExchangeID and Create_session after Create_session fails when
it uses the bogus clientid. With this patch, the correct clientid is replied.
This problem was identified in a packet trace supplied by
Ahmed Kamal via email.

Reported by: email.ahmedkamal@googlemail.com
MFC after: 2 weeks

8 years agosh: When setting option via long name, don't go via letter.
Jilles Tjoelker [Fri, 14 Aug 2015 21:44:15 +0000 (21:44 +0000)]
sh: When setting option via long name, don't go via letter.

Looking up the letter makes no sense and prevents adding options that only
have a long name, no letter.

8 years agoUse pmap_quick_enter_page() to handle bouncing of unmapped buffers in the x86 busdma_...
Jason A. Harmening [Fri, 14 Aug 2015 20:08:16 +0000 (20:08 +0000)]
Use pmap_quick_enter_page() to handle bouncing of unmapped buffers in the x86 busdma_bounce implementation.  Also treat user buffers as unmapped.
This allows two things:
1. Sync'ing bounced maps in non-sleepable contexts.  The physcopy* calls previously used could sleep on sf_buf operations in some cases.
2. Sync'ing user buffers outside the context of the owning process

Approved by: kib (mentor)

8 years agoRemove another remnant of PV domU support and assume that we always run
John Baldwin [Fri, 14 Aug 2015 18:38:39 +0000 (18:38 +0000)]
Remove another remnant of PV domU support and assume that we always run
with an automatically translated physmap under XEN.

Reviewed by: royger (earlier version)
Differential Revision: https://reviews.freebsd.org/D3325

8 years agoReformat x86 bounce buffer synchronization code to reduce indentation. No functional...
Jason A. Harmening [Fri, 14 Aug 2015 18:01:40 +0000 (18:01 +0000)]
Reformat x86 bounce buffer synchronization code to reduce indentation.  No functional change.

Approved by: kib (mentor)

8 years agoStop describing an acquire operation as a read barrier and a release
Alan Cox [Fri, 14 Aug 2015 17:49:03 +0000 (17:49 +0000)]
Stop describing an acquire operation as a read barrier and a release
operation as a write barrier.  That description has never been correct,
and it has caused confusion.  An acquire operation orders writes as well
as reads, and a release operation orders reads as well as writes.

Also, explicitly say that a thread doesn't see its own accesses being
reordered.  The reordering of a thread's accesses is only (potentially)
visible to another thread.  Thus, memory barriers need only be used to
control the ordering of accesses between threads, not within a thread.

Reviewed by: bde, kib
Discussed with: jhb
MFC after: 1 week

8 years agoUse simple fixed name strings for these timecounters and eventimers which
Ian Lepore [Fri, 14 Aug 2015 16:48:07 +0000 (16:48 +0000)]
Use simple fixed name strings for these timecounters and eventimers which
are tied to fixed pieces of hardware; dynamic string formatting isn't needed.

8 years agoRemove a stale comment and clarify the original where it was taken from
Pedro F. Giffuni [Fri, 14 Aug 2015 14:58:04 +0000 (14:58 +0000)]
Remove a stale comment and clarify the original where it was taken from

The comment in the libc/sys symbol map referenced the generated symbols
for the syscall trampolines. Such comment was out of place in the secure
symbol map so remove the stale comment and attempt to clarify the old one
to avoid risks of confusion.

Pointed out by: kib

8 years agoAllow the path MTU to grow up to the outgoing interface MTU.
Michael Tuexen [Fri, 14 Aug 2015 14:26:13 +0000 (14:26 +0000)]
Allow the path MTU to grow up to the outgoing interface MTU.

MFC after: 3 days

8 years agoHandle NYET high speed tokens and predict NAK'ing is up next.
Hans Petter Selasky [Fri, 14 Aug 2015 14:20:10 +0000 (14:20 +0000)]
Handle NYET high speed tokens and predict NAK'ing is up next.

MFC after: 2 weeks

8 years agoUse __builtin_clzll to count the leading zero bits, the data is based on
Andrew Turner [Fri, 14 Aug 2015 14:17:04 +0000 (14:17 +0000)]
Use __builtin_clzll to count the leading zero bits, the data is based on
long long so __builtin_clz will return an incorrect value.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D3375

8 years agoMinor code refactor to avoid duplicating code.
Hans Petter Selasky [Fri, 14 Aug 2015 13:58:18 +0000 (13:58 +0000)]
Minor code refactor to avoid duplicating code.

MFC after: 2 weeks

8 years agoComment only change, fix grammar and somewhat clarify the action.
Konstantin Belousov [Fri, 14 Aug 2015 13:51:59 +0000 (13:51 +0000)]
Comment only change, fix grammar and somewhat clarify the action.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

8 years agoRemove some random accumulated diff from Illumos.
Alexander Motin [Fri, 14 Aug 2015 13:43:12 +0000 (13:43 +0000)]
Remove some random accumulated diff from Illumos.

Submitted by: avg (partially)

8 years agoRegression: fix pw usermod -w xxx
Baptiste Daroussin [Fri, 14 Aug 2015 13:39:55 +0000 (13:39 +0000)]
Regression: fix pw usermod -w xxx

Reported by: gjb

8 years ago2618 arc.c mistypes in the comments
Alexander Motin [Fri, 14 Aug 2015 13:10:30 +0000 (13:10 +0000)]
2618 arc.c mistypes in the comments

Reviewed by: Jason King <jason.brian.king@gmail.com>
Reviewed by: Josef Sipek <jeffpc@josefsipek.net>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Bart Coddens <bart.coddens@gmail.com>

illumos/illumos-gate@fc98fea58e89224f6f13d7fae246d6cb5dfa35ea

8 years agoImprove the realtime properties of USB transfers for embedded systems
Hans Petter Selasky [Fri, 14 Aug 2015 12:57:53 +0000 (12:57 +0000)]
Improve the realtime properties of USB transfers for embedded systems
like RPI-B and RPI-2.

Description of problem:
USB transfers can process data in their callbacks sometimes causing
unacceptable latency for other USB transfers. Separate BULK completion
callbacks from CONTROL, INTERRUPT and ISOCHRONOUS callbacks, and give
BULK completion callbacks lesser execution priority than the
others. This way USB audio won't be interfered by heavy USB ethernet
usage for example.

Further serve USB transfer completion in a round robin fashion,
instead of only serving the most CPU hungry. This has been done by
adding a third flag to USB transfer queue structure which keeps track
of looping callbacks. The "command" callback function then decides
what to do when looping.

MFC after: 2 weeks

8 years agoFix r286766 build with debug.
Alexander Motin [Fri, 14 Aug 2015 11:47:53 +0000 (11:47 +0000)]
Fix r286766 build with debug.

8 years agoAdd support for bus_space_read_region and bus_space_write_region. This is
Andrew Turner [Fri, 14 Aug 2015 09:55:25 +0000 (09:55 +0000)]
Add support for bus_space_read_region and bus_space_write_region. This is
needed for the dwc USB controller driver.

Sponsored by: ABT Systems Ltd

8 years agoFix minor mismerge sometimes earlier.
Alexander Motin [Fri, 14 Aug 2015 09:48:23 +0000 (09:48 +0000)]
Fix minor mismerge sometimes earlier.

8 years agoMFV r286765: 5817 change type of arcs_size from uint64_t to refcount_t
Alexander Motin [Fri, 14 Aug 2015 09:39:23 +0000 (09:39 +0000)]
MFV r286765: 5817 change type of arcs_size from uint64_t to refcount_t

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Paul Dagnelie <paul.dagnelie@delphix.com>
Reviewed by: Adam Leventhal <ahl@delphix.com>
Reviewed by: Alex Reece <alex@delphix.com>
Reviewed by: Richard Elling <richard.elling@richardelling.com>
Approved by: Garrett D'Amore <garrett@damore.org>
Author: Prakash Surya <prakash.surya@delphix.com>

illumos/illumos-gate@2fd872a734cf486007a8dba532cec52bfb4d40e5

As a way to make it more difficult to introduce bugs into the ARC, and to
make it easier to diagnose issues when bugs do creep in, it would be
beneficial to change the type of the arc_state_t's arcs_size field to be
a refcount_t instead of a uint64_t. This would allow us to make stricter
checks when incrementing and decrementing the value with debugging enabled,
but still fallback to simple, fast atomic operations when debugging is
disabled.

8 years ago5817 change type of arcs_size from uint64_t to refcount_t
Alexander Motin [Fri, 14 Aug 2015 09:37:54 +0000 (09:37 +0000)]
5817 change type of arcs_size from uint64_t to refcount_t

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Paul Dagnelie <paul.dagnelie@delphix.com>
Reviewed by: Adam Leventhal <ahl@delphix.com>
Reviewed by: Alex Reece <alex@delphix.com>
Reviewed by: Richard Elling <richard.elling@richardelling.com>
Approved by: Garrett D'Amore <garrett@damore.org>
Author: Prakash Surya <prakash.surya@delphix.com>

illumos/illumos-gate@2fd872a734cf486007a8dba532cec52bfb4d40e5

As a way to make it more difficult to introduce bugs into the ARC, and to
make it easier to diagnose issues when bugs do creep in, it would be
beneficial to change the type of the arc_state_t's arcs_size field to be
a refcount_t instead of a uint64_t. This would allow us to make stricter
checks when incrementing and decrementing the value with debugging enabled,
but still fallback to simple, fast atomic operations when debugging is
disabled.

8 years agoMFV r285025: 6033 arc_adjust() should search MFU lists for oldest buffer
Alexander Motin [Fri, 14 Aug 2015 09:33:46 +0000 (09:33 +0000)]
MFV r285025: 6033 arc_adjust() should search MFU lists for oldest buffer
when adjusting MFU size.

illumos/illumos-gate@31c46cf23cd1cf4d66390a983dc5072d7d299ba2

https://www.illumos.org/issues/6033
  When we're looking for the list containing oldest buffer we never
  actually look at the MFU lists even when we try to evict from MFU.
  looks like a copy paste error, the fix is here:

Reviewed by: Saso Kiselkov <saso.kiselkov@nexenta.com>
Reviewed by: Xin Li <delphij@delphij.net>
Reviewed by: Prakash Surya <me@prakashsurya.com>
Approved by: Matthew Ahrens <mahrens@delphix.com>
Author: Alek Pinchuk <alek@nexenta.com>
Obtained from:  illumos

8 years agoMFV r277431: 5497 lock contention on arcs_mtx
Alexander Motin [Fri, 14 Aug 2015 09:31:07 +0000 (09:31 +0000)]
MFV r277431: 5497 lock contention on arcs_mtx

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Richard Elling <richard.elling@richardelling.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Prakash Surya <prakash.surya@delphix.com>

illumos/illumos-gate@244781f10dcd82684fd8163c016540667842f203

This patch attempts to reduce lock contention on the current arc_state_t
mutexes. These mutexes are used liberally to protect the number of LRU
lists within the ARC (e.g. ARC_mru, ARC_mfu, etc). The granularity at
which these locks are acquired has been shown to greatly affect the
performance of highly concurrent, cached workloads.

8 years agoRevert part of r205231, introducing multiple ARC state locks.
Alexander Motin [Fri, 14 Aug 2015 09:25:54 +0000 (09:25 +0000)]
Revert part of r205231, introducing multiple ARC state locks.

This local implementation will be replaced by one from Illumos to reduce
code divergence and make further merges easier.

8 years agoMove the stack protector to a new "secure" directory
Pedro F. Giffuni [Fri, 14 Aug 2015 03:03:13 +0000 (03:03 +0000)]
Move the stack protector to a new "secure" directory

As part of the code refactoring to support FORTIFY_SOURCE we want
a new subdirectory "secure" to keep the files related to security.
Move the stack protector functions to this new directory.

No functional change.

Differential Review: https://reviews.freebsd.org/D3333

8 years agoMake clear the bcopy(3) manpage regards when it was marked as LEGACY
Marcelo Araujo [Fri, 14 Aug 2015 01:27:30 +0000 (01:27 +0000)]
Make clear the bcopy(3) manpage regards when it was marked as LEGACY
as well as when it was removed from POSIX specification.

Reviewed by: theraven, wblock, bapt, rodrigc
Approved by: bapt, rodrigc (mentor)
Differential Revision: D3374

8 years agoMFV of 286748,tzdata2015f
Edwin Groothuis [Thu, 13 Aug 2015 23:57:44 +0000 (23:57 +0000)]
MFV of 286748,tzdata2015f

Update to tzdata2015f:

Changes affecting future time stamps

    North Korea switches to +0830 on 2015-08-15.  (Thanks to Steffen Thorsen.)
    The abbreviation remains "KST".  (Thanks to Robert Elz.)
    Uruguay no longer observes DST.  (Thanks to Steffen Thorsen and Pablo Camargo.)
    Changes affecting past and future time stamps
    Moldova starts and ends DST at 00:00 UTC, not at 01:00 UTC. (Thanks to Roman Tudos.)

8 years agoVendor import of tzdata2015f:
Edwin Groothuis [Thu, 13 Aug 2015 23:57:00 +0000 (23:57 +0000)]
Vendor import of tzdata2015f:

Update to tzdata2015f:

Changes affecting future time stamps

    North Korea switches to +0830 on 2015-08-15.  (Thanks to Steffen Thorsen.)
    The abbreviation remains "KST".  (Thanks to Robert Elz.)
    Uruguay no longer observes DST.  (Thanks to Steffen Thorsen and Pablo Camargo.)
    Changes affecting past and future time stamps
    Moldova starts and ends DST at 00:00 UTC, not at 01:00 UTC. (Thanks to Roman Tudos.)

Obtained from: ftp://ftp.iana.org/tz/releases/

8 years agoSpell binaries in the customary way.
Warner Losh [Thu, 13 Aug 2015 22:32:42 +0000 (22:32 +0000)]
Spell binaries in the customary way.

Submitted by: jhb@

8 years agoStop removing ELF toolchain tools
Antoine Brodin [Thu, 13 Aug 2015 22:04:30 +0000 (22:04 +0000)]
Stop removing ELF toolchain tools

8 years agos/as/at/ in previous commit.
Marcel Moolenaar [Thu, 13 Aug 2015 19:12:55 +0000 (19:12 +0000)]
s/as/at/ in previous commit.

Pointed out by: jmallett@

8 years agoRemove arm64 workaround for Clang 3.4 crash
Ed Maste [Thu, 13 Aug 2015 19:05:18 +0000 (19:05 +0000)]
Remove arm64 workaround for Clang 3.4 crash

8 years agoPlug a memory leak.
Xin LI [Thu, 13 Aug 2015 18:45:52 +0000 (18:45 +0000)]
Plug a memory leak.

MFC after: 2 weeks

8 years agoAvoid left-shifting negative signed values in bxe(4).
Dimitry Andric [Thu, 13 Aug 2015 18:24:41 +0000 (18:24 +0000)]
Avoid left-shifting negative signed values in bxe(4).

Reviewed by: davidcs
MFC after: 3 days

8 years agoRemove remnant of WITHOUT_ELFTOOLCHAIN_TOOLS missed in r286730
Ed Maste [Thu, 13 Aug 2015 18:01:50 +0000 (18:01 +0000)]
Remove remnant of WITHOUT_ELFTOOLCHAIN_TOOLS missed in r286730

8 years agoUpdate src.conf(5) after r286730
Ed Maste [Thu, 13 Aug 2015 17:54:28 +0000 (17:54 +0000)]
Update src.conf(5) after r286730

8 years agoRoll WITHOUT_ELFTOOLCHAIN_TOOLS into WITHOUT_TOOLCHAIN
Ed Maste [Thu, 13 Aug 2015 17:50:47 +0000 (17:50 +0000)]
Roll WITHOUT_ELFTOOLCHAIN_TOOLS into WITHOUT_TOOLCHAIN

The option was added only to ease the transition from GNU Binutils to
ELF Tool Chain tools, and that process is now complete (for the viable
replacements). Noting the removal in UPDATING is sufficient as we have
not shipped a release with the option.

Reviewed by: brooks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3240

8 years agoSmall cleanup.
Christian Brueffer [Thu, 13 Aug 2015 16:11:04 +0000 (16:11 +0000)]
Small cleanup.

- fix mandoc -Tlint warnings
- use appropriate macros
- canonize FreeBSD spelling

8 years agoAdd a new PPS driver for AM335x (beaglebone) timer hardware. This can be
Ian Lepore [Thu, 13 Aug 2015 15:19:30 +0000 (15:19 +0000)]
Add a new PPS driver for AM335x (beaglebone) timer hardware.  This can be
used as a module or compiled-in.

8 years agoChange md(4) to use weak symbols as start, end and size for the embedded
Marcel Moolenaar [Thu, 13 Aug 2015 15:16:34 +0000 (15:16 +0000)]
Change md(4) to use weak symbols as start, end and size for the embedded
root disk. The embedded image is linked into the kernel in the .mfs
section.

Add rules and variables to kern.pre.mk and kern.post.mk that handle the
linking of the image. First objcopy is used to generate an object file.
Then, the object file is linked into the kernel.

Submitted by: Steve Kiernan <stevek@juniper.net>
Reviewed by: brooks@
Obtained from: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D2903

8 years agoInstead of having separate do_sync functions for ARM_ARCH 6 vs.
Marcel Moolenaar [Thu, 13 Aug 2015 14:53:29 +0000 (14:53 +0000)]
Instead of having separate do_sync functions for ARM_ARCH 6 vs.
ARM_ARCH >= 7, use the dmb() macro defined in machine/atomic.h

Submitted by: Steve Kiernan <stevek@juniper.net>
Reviewed by: imp@
Differential Revision: https://reviews.freebsd.org/D3355

8 years agoThe Broadcom BCM56060 chip has a Cortex-A9R4 core.
Marcel Moolenaar [Thu, 13 Aug 2015 14:50:11 +0000 (14:50 +0000)]
The Broadcom BCM56060 chip has a Cortex-A9R4 core.

Submitted by: Steve Kiernan <stevek@juniper.net>
Reviewed by: imp@
Differential Revision: https://reviews.freebsd.org/D3357

8 years agoConstify the pointers to eventtimer and timecounter name strings.
Ian Lepore [Thu, 13 Aug 2015 14:43:25 +0000 (14:43 +0000)]
Constify the pointers to eventtimer and timecounter name strings.

The need for this appears as soon as you try to set the names to something
that isn't a "quoted literal".  (I'm actually confused why quoted strings
aren't a problem as well, we must have some warning disabled.)

8 years agoFix text mode operation.
Marcel Moolenaar [Thu, 13 Aug 2015 14:43:11 +0000 (14:43 +0000)]
Fix text mode operation.

We first map 64KB at 0xA0000 and then determine whether to work
in text or graphics mode.  When graphics mode, the mapping is
precisely what we need and everything is fine.  But text mode,
has the frame buffer relocated to 0xB8000. We didn't map that
much to safely add 0x18000 bytes to the base address.

Now we first check whether to work in text or graphics mode and
then map the frame buffer at the right address and with the
right size (0xA0000+64KB for graphics, 0xB8000+32KB for text).

PR: 202276
Tested by: ed@

8 years agoMove lle update code from from gigantic ip_arpinput() to
Alexander V. Chernikov [Thu, 13 Aug 2015 13:38:09 +0000 (13:38 +0000)]
Move lle update code from from gigantic ip_arpinput() to
separate bunch of functions. The goal is to isolate actual lle
updates to permit more fine-grained locking.

Do all lle link-level update under AFDATA wlock.

Sponsored by: Yandex LLC

8 years agoarm64: turn unknown el0 exception into a SIGILL
Ed Maste [Thu, 13 Aug 2015 13:21:00 +0000 (13:21 +0000)]
arm64: turn unknown el0 exception into a SIGILL

It seems we get EXCP_UNKNOWN from QEMU when executing zeroed memory.
Print a register dump here and signal illegal instruction. Also print
a register dump for other invalid exceptions, before panic.

Reviewed by: andrew
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3370

8 years agoUse g_conf_printf_escaped() to escape illegal symbols in file name.
Andrey V. Elsukov [Thu, 13 Aug 2015 13:20:29 +0000 (13:20 +0000)]
Use g_conf_printf_escaped() to escape illegal symbols in file name.

PR: 202289
MFC after: 1 week

8 years agoRevert part of r280687, reporting "1" (true) for empty value.
Alexander Motin [Thu, 13 Aug 2015 13:19:56 +0000 (13:19 +0000)]
Revert part of r280687, reporting "1" (true) for empty value.

For example, it made gpart partitions without label report "1" as label.

PR: 202089
MFC after: 3 days