]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agowordexp(3): Update man page for no longer using the wordexp builtin.
Jilles Tjoelker [Tue, 18 Aug 2015 20:13:36 +0000 (20:13 +0000)]
wordexp(3): Update man page for no longer using the wordexp builtin.

8 years agoFix multiple integer overflows in expat.
Xin LI [Tue, 18 Aug 2015 19:30:04 +0000 (19:30 +0000)]
Fix multiple integer overflows in expat.

Security: CVE-2015-1283
Security: FreeBSD-SA-15:20.expat

8 years agoSet curvnet context inside the RPC code in more places.
Xin LI [Tue, 18 Aug 2015 18:12:46 +0000 (18:12 +0000)]
Set curvnet context inside the RPC code in more places.

Reviewed by: melifaro
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D3398

8 years agoCorrect All Saints' day.
Pedro F. Giffuni [Tue, 18 Aug 2015 15:50:02 +0000 (15:50 +0000)]
Correct All Saints' day.

Thanks to: zec
X-MFC with: r286891

8 years agoServe /etc/eui64 via NIS.
Alan Somers [Tue, 18 Aug 2015 15:33:23 +0000 (15:33 +0000)]
Serve /etc/eui64 via NIS.

The C library already knows how to lookup eui64 entries from NIS. For
example, fwcontrol(8) does it. But /var/yp/Makefile.dist doesn't build the
eui64 maps, and ypinit(8) doesn't push them to slaves. This change fixes
that.

Reviewed by: brooks, wblock
MFC after: 2 weeks
Sponsored by: SpectraLogic Corp
Differential Revision: https://reviews.freebsd.org/D3404

8 years agoCalendar: add a few more dates to the Christian calendar
Pedro F. Giffuni [Tue, 18 Aug 2015 15:11:41 +0000 (15:11 +0000)]
Calendar: add a few more dates to the Christian calendar

The many christian denominations have different dates for their
celebrations and controversies are likely to be always.

These are well established and happen to be holidays in many
Catholic countries.

MFC after: 1 month

8 years agoAdd ichwd TCO version 3 support (Bay Trail / Rangeley...)
Fabien Thomas [Tue, 18 Aug 2015 14:54:29 +0000 (14:54 +0000)]
Add ichwd TCO version 3 support (Bay Trail / Rangeley...)

Reviewed by: jhb
Obtained from: Cas-well
Sponsored by: Stormshield

8 years agoUsing consistent coding style to deal with error inside the loop.
Tai-hwa Liang [Tue, 18 Aug 2015 13:16:23 +0000 (13:16 +0000)]
Using consistent coding style to deal with error inside the loop.

MFC after: 1 week

8 years agoUsing the error return code documented in the comment.
Tai-hwa Liang [Tue, 18 Aug 2015 13:16:06 +0000 (13:16 +0000)]
Using the error return code documented in the comment.

Though there is no direct midi_uninit() caller amongst existing drivers
at this moment, a quick experiment indicates that EBUSY gives users more
precise error message once drivers start to honour this result.  For example,
emu_midi_detach() should check the result of mpu401_uninit() and block
module unloading if there is any MIDI I/O in progress.

MFC after: 2 weeks

8 years agoFixing typo as well as improving readability of a few comments.
Tai-hwa Liang [Tue, 18 Aug 2015 12:50:46 +0000 (12:50 +0000)]
Fixing typo as well as improving readability of a few comments.

MFC after: 3 days

8 years agoRIP Stefan Farfeleder (stefanf), committer since 2004.
Christian Brueffer [Tue, 18 Aug 2015 12:27:21 +0000 (12:27 +0000)]
RIP Stefan Farfeleder (stefanf), committer since 2004.

You will be missed!

8 years agoCorrect comment typo noted by erik
Ed Maste [Tue, 18 Aug 2015 11:52:45 +0000 (11:52 +0000)]
Correct comment typo noted by erik

8 years agocallout_stop() should return 0 (fail) when the callout is currently
Julien Charbon [Tue, 18 Aug 2015 10:15:09 +0000 (10:15 +0000)]
callout_stop() should return 0 (fail) when the callout is currently
being serviced and indeed unstoppable.

A scenario to reproduce this case is:

- the callout is being serviced and at same time,
- callout_reset() is called on this callout that sets
  the CALLOUT_PENDING flag and at same time,
- callout_stop() is called on this callout and returns 1 (success)
  even if the callout is indeed currently running and unstoppable.

This issue was caught up while making r284245 (D2763) workaround, and
was discussed at BSDCan 2015.  Once applied the r284245 workaround
is not needed anymore and will be reverted.

Differential Revision: https://reviews.freebsd.org/D3078
Reviewed by: jhb
Sponsored by: Verisign, Inc.

8 years agoRemove register dump from arm64 el0 unknown exception
Ed Maste [Tue, 18 Aug 2015 10:07:03 +0000 (10:07 +0000)]
Remove register dump from arm64 el0 unknown exception

An exception with an unknown reasion is the expected result of the
attempted execution of an instruction bit pattern that has no allocated
instruction.

Sponsored by: The FreeBSD Foundation

8 years agoRe-add LG_SIZEOF_PTR definition for __aarch64__.
Jason Evans [Tue, 18 Aug 2015 09:09:27 +0000 (09:09 +0000)]
Re-add LG_SIZEOF_PTR definition for __aarch64__.

This definition was erroneously removed during the 4.0.0 import.

8 years agoBump __FreeBSD_version for the jemalloc 4.0.0 import.
Jason Evans [Tue, 18 Aug 2015 08:29:13 +0000 (08:29 +0000)]
Bump __FreeBSD_version for the jemalloc 4.0.0 import.

8 years agoMake clear that TIME_WAIT timeout expiration is managed solely by
Julien Charbon [Tue, 18 Aug 2015 08:27:26 +0000 (08:27 +0000)]
Make clear that TIME_WAIT timeout expiration is managed solely by
tcp_tw_2msl_scan().

Sponsored by: Verisign, Inc.

8 years agoAdd missing sdallocx updates and remove *allocm manpage links.
Jason Evans [Tue, 18 Aug 2015 08:18:28 +0000 (08:18 +0000)]
Add missing sdallocx updates and remove *allocm manpage links.

Submitted by: jbeich

8 years agoFix build failure due to missing CPU_SPINWAIT definition.
Jason Evans [Tue, 18 Aug 2015 08:10:46 +0000 (08:10 +0000)]
Fix build failure due to missing CPU_SPINWAIT definition.

8 years agoAdd jemalloc support for 8 KiB, 16 KiB, and 64 KiB pages.
Jason Evans [Tue, 18 Aug 2015 06:28:37 +0000 (06:28 +0000)]
Add jemalloc support for 8 KiB, 16 KiB, and 64 KiB pages.

8 years agoFix panic when handling non-inet arp message introduced in r286825.
Alexander V. Chernikov [Tue, 18 Aug 2015 06:16:19 +0000 (06:16 +0000)]
Fix panic when handling non-inet arp message introduced in r286825.

Submitted by: delphij

8 years agoAdd 24 more page table pages we allocate on boot-up. 16MB slop
Marcel Moolenaar [Tue, 18 Aug 2015 01:53:41 +0000 (01:53 +0000)]
Add 24 more page table pages we allocate on boot-up. 16MB slop
is a little tight in and by itself, but severily insufficient
when one needs to map a large frame buffer as part of console
initialization. 64MB slop should be enough for a while. As an
example: a 15" MacBook Pro with retina display needs ~28MB of
KVA for the frame buffer.

PR: 193745

8 years agoSupport frame buffers that are larger than the default screen
Marcel Moolenaar [Tue, 18 Aug 2015 00:47:02 +0000 (00:47 +0000)]
Support frame buffers that are larger than the default screen
size as defined by VT_FB_DEFAULT_WIDTH and VT_FB_DEFAULT_HEIGHT
(at this time 2048x1200). The default is really a max. We cap
the height and width to those defaults and position the screen
in the center of the frame buffer.

Ideally we use a bigger font to utility the entire real estate
that is the frame buffer, but that's seen as an improvement over
making it work first.

PR: 193745

8 years agoUpdate jemalloc to version 4.0.0.
Jason Evans [Tue, 18 Aug 2015 00:21:25 +0000 (00:21 +0000)]
Update jemalloc to version 4.0.0.

8 years agoConvert more ifp->if_softc -> ic->ic_softc.
Adrian Chadd [Mon, 17 Aug 2015 23:44:38 +0000 (23:44 +0000)]
Convert more ifp->if_softc -> ic->ic_softc.

These should be a big no-op.

Tested:

* make universe

8 years agoMigrate ifp->if_softc -> ic->ic_softc.
Adrian Chadd [Mon, 17 Aug 2015 23:35:31 +0000 (23:35 +0000)]
Migrate ifp->if_softc -> ic->ic_softc.

Tested:

* Lenovo T400 (Intel 5300)
* make universe

8 years agoOn arm64 disable three tests that hang or panic
Ed Maste [Mon, 17 Aug 2015 23:19:36 +0000 (23:19 +0000)]
On arm64 disable three tests that hang or panic

Each issue has a PR open to track. This workaround allows us to run the
tests to investigate the failures and avoid any new regressions.

PR: 202304, 202305, 202307
Reviewed by: ngie
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3378

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.