]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoMFC r305013:
dim [Fri, 2 Sep 2016 17:07:52 +0000 (17:07 +0000)]
MFC r305013:

Add an empty virtual destructor to zfsd's Vdev class.  This is needed
because the class has virtual functions, and the compiler-generated
default destructor is non-virtual.

Reviewed by: asomers

MFC r305016:

Fix the zfsd unittest:
* TESTSDIR is supposed to be under cddl/usr.sbin, not cddl/sbin
* DevdCtl::EventBuffer no longer exists, so remove its forward
  declaration

7 years agoMFC r303576:
ngie [Fri, 2 Sep 2016 04:06:44 +0000 (04:06 +0000)]
MFC r303576:

Conditionalize code which defines sysctls per _KERNEL #ifdef guard

This resolves several issues when compiling libzpool (userspace library), i.e.
-Wimplicit-function-declaration and -Wmissing-declarations issues.

Tested with: clang 3.8.1, gcc 4.2.1, gcc 5.3.0

7 years agoMFC r305108,305109:
nwhitehorn [Thu, 1 Sep 2016 22:27:47 +0000 (22:27 +0000)]
MFC r305108,305109:
Refix operation on sparse CPU mappings as in r302372, temporarily broken
by r304716.

PR: kern/210106

7 years agoMFC r305036:
nwhitehorn [Thu, 1 Sep 2016 22:24:30 +0000 (22:24 +0000)]
MFC r305036:
Some versions of SLOF do not append the partition number to the boot
device argument to the stage-1 bootloader. In such cases, boot1 would
only try to read the entire device rather than checking for partitions.
Instead of panic'ing, fall back to reading the partitions as normal in
such situations. This was preventing boot of installed systems on some
versions of PowerKVM.

PR: kern/211599

7 years agoMFC r304966 (peter):
gjb [Thu, 1 Sep 2016 19:30:52 +0000 (19:30 +0000)]
MFC r304966 (peter):
 The read-ahead code from r298230 made it likely the boot code would read
 beyond the end of disk. r298900 added code to prevent this.  Some BIOSes
 cause significant delays if asked to read past end-of-disk.

 We never trusted the BIOS to accurately report the sectorsize of disks
 before and this set of changes.  Unfortuately they interact badly with
 the infamous >2TB wraparound bugs.  We have a number of relatively-recent
 machines in the FreeBSD.org cluster where the BIOS reports 3TB disks as 1TB.

 With pre-r298900 they work just fine.  After r298900 they stop working if
 the boot environment attempts to access anything outside the first 1TB on
 the disk.  'ZFS: I/O error, all block copies unavailable' etc.  It affects
 both UFS and ZFS if they try to boot from large volumes.

 This change replaces the blind trust of the BIOS end-of-disk reporting
 with a read-ahead clip to prevent reads crossing the of end-of-disk
 boundary.  Since 2^32 (2TB) size reporting truncation is not uncommon,
 the clipping is done on 2TB aliases of the reported end-of-disk.
 ie: a 3TB disk reported as 1TB has readahead clipped at 1TB, 3TB, 5TB, ...
 as one of them is likely to be the real end-of-disk.

 This should make the loader on these broken machines behave the same as
 traditional pre-r298900 loader behavior, without disabling read-ahead.

PR: 212139
Sponsored by: The FreeBSD Foundation

7 years agoMFC r304809:
ngie [Thu, 1 Sep 2016 19:00:30 +0000 (19:00 +0000)]
MFC r304809:

Add non-TRUSTEDBSD prefixed knobs for the _PC_ACL* and {CAP,INF,MAC}_PRESENT knobs

It's not necessarily intuitive that the variables to query contain TRUSTEDBSD
in the prefix. Add non-TRUSTEDBSD prefixed knobs for querying things like
"_PC_ACL_NFS4".

Relnotes: yes

7 years agoMFC r303573:
ngie [Thu, 1 Sep 2016 18:56:42 +0000 (18:56 +0000)]
MFC r303573:

Cast result from third parameter to int instead of promoting it to size_t

This resolves a -Wformat issue when the value is used as a format width
precision specifier, i.e. %*s

7 years agoMFC r304075,r304989:
mm [Thu, 1 Sep 2016 07:53:59 +0000 (07:53 +0000)]
MFC r304075,r304989:
Sync libarchive with vendor including security fixes

Vendor issues fixed:
Issue #731: Reject tar entries >= INT64_MAX
Issue #744: Very long pathnames evade symlink checks
Issue #748: libarchive can compress, but cannot decompress zip some files
PR #750: ustar: fix out of bounds read on empty string ("") filename
PR #755: fix use of acl_get_flagset_np() on FreeBSD
Issue #767: Buffer overflow printing a filename
Issue #770: Zip read: be more careful about extra_length

MFC r304874:
Temporarily disable two libarchive tests that have not yet been fixed by
vendor. Tests will be re-enabled after a fix has been merged.

7 years agoMFC 304202
sephe [Thu, 1 Sep 2016 07:41:49 +0000 (07:41 +0000)]
MFC 304202
    tcp/lro: Make # of LRO entries tunable

    Reviewed by:    hps, gallatin
    Obtained from:  rrs, gallatin
    Sponsored by:   Netflix (rrs, gallatin), Microsoft (sephe)
    Differential Revision:  https://reviews.freebsd.org/D7499

7 years agoMFC r305024:
kib [Thu, 1 Sep 2016 07:19:04 +0000 (07:19 +0000)]
MFC r305024:
Typesetting fixes.

7 years agoMFC r304812:
kib [Thu, 1 Sep 2016 07:15:23 +0000 (07:15 +0000)]
MFC r304812:
In both do_rw_wrlock() and do_rw_rdlock(), do not obliterate possible
error from sleep.

7 years agoMFC r304808:
kib [Thu, 1 Sep 2016 07:08:01 +0000 (07:08 +0000)]
MFC r304808:
Prevent leak of URWLOCK_READ_WAITERS flag for urwlocks.

PR: 211947

7 years agoMFC r304652:
badger [Wed, 31 Aug 2016 22:18:50 +0000 (22:18 +0000)]
MFC r304652:

Fix missing substitution of @SBINDIR@ in resolvconf scripts

Certain features, such as resolv_conf_passthrough=NULL, do not work
correctly due to this missing substitution.

Also remove the @PREFIX@ substitution, which is no longer needed.

Approved by: vangyzen (mentor)
Sponsored by: Dell Inc.

7 years agoMFC r303855:
markj [Wed, 31 Aug 2016 21:35:12 +0000 (21:35 +0000)]
MFC r303855:
Handle races with listening socket close when connecting a unix socket.

PR: 211531

7 years agoMFC r304053, r304054:
markj [Wed, 31 Aug 2016 21:14:16 +0000 (21:14 +0000)]
MFC r304053, r304054:
Initialize busy lock state and strengthen busy lock assertions.

7 years agoMFC: r304638, r304640
jkim [Wed, 31 Aug 2016 20:33:59 +0000 (20:33 +0000)]
MFC: r304638, r304640

Fix white spaces and prefer C-style comments in assembly sources.

7 years agoMFC: r304636
jkim [Wed, 31 Aug 2016 20:30:49 +0000 (20:30 +0000)]
MFC: r304636

Build OpenSSL assembly sources for arm.

7 years agoMFC r304315 (by jilles):
kib [Wed, 31 Aug 2016 20:25:37 +0000 (20:25 +0000)]
MFC r304315 (by jilles):
rights(4): CAP_FSYNC also permits fdatasync(2).

7 years agoMFC: r304320
jkim [Wed, 31 Aug 2016 20:21:03 +0000 (20:21 +0000)]
MFC: r304320

Disable assembly sources when compiler/assembler cannot compile certain
instructions.  For example, GCC 4.2.1 + binutils 2.17.50 does not support
AVX instructions.

7 years agoMFC r304969:
dim [Wed, 31 Aug 2016 18:37:04 +0000 (18:37 +0000)]
MFC r304969:

Define hastd's STRICT_ALIGN macro in a defined and portable way.

7 years agoMFC r304953:
dim [Wed, 31 Aug 2016 18:00:41 +0000 (18:00 +0000)]
MFC r304953:

Define ipfilter's SOLARIS macro in a defined and portable way.

Reviewed by: cy
Differential Revision: https://reviews.freebsd.org/D7671

MFC r304959 (by kib):

Complete r304953.

Sponsored by: The FreeBSD Foundation

MFC r304964:

Follow-up to r304953, in which I broke the build: apparently the SOLARIS
macro is defined in lots of different places in ipfilter, so replace all
of the nonportable definitions with portable ones.

Pointy hat to: dim

7 years agoMFC 302847, 302848, 302852, 302853:
andrew [Wed, 31 Aug 2016 17:36:43 +0000 (17:36 +0000)]
MFC 302847, 302848, 302852, 302853:
Remove the remaining non-INTRNG support from the arm64 code.

7 years agoMFC 302789:
andrew [Wed, 31 Aug 2016 17:30:21 +0000 (17:30 +0000)]
MFC 302789:
Add memmmap on arm64 so we can mmap /dev/mem and /dev/kmem.

7 years agoMFC r304751: Fix minor copy/paste bug.
mav [Wed, 31 Aug 2016 09:49:26 +0000 (09:49 +0000)]
MFC r304751:  Fix minor copy/paste bug.

7 years agoMFC r304055:
markj [Wed, 31 Aug 2016 01:26:21 +0000 (01:26 +0000)]
MFC r304055:
Fix handling of forward enum declarations in the CTF tools.

7 years agoMFC r304736:
tuexen [Tue, 30 Aug 2016 19:27:27 +0000 (19:27 +0000)]
MFC r304736:
When aborting an association, send the ABORT before notifying the upper
layer. For the kernel this doesn't matter, for the userland stack, it does.
While there, silence a clang warning when compiling it in userland.

MFC r304837:
Fix a bug, where no SACK is sent when receiving a FORWARD-TSN or
I-FORWARD-TSN chunk before any DATA or I-DATA chunk.

Thanks to Julian Cordes for finding this problem and prividing
packetdrill scripts to reporduce the issue.

7 years agoMFC r304916:
kib [Tue, 30 Aug 2016 13:56:11 +0000 (13:56 +0000)]
MFC r304916:
Consistently delimit each vnode description block with two blank
lines.

7 years agoMFC r304184:
badger [Tue, 30 Aug 2016 13:39:42 +0000 (13:39 +0000)]
MFC r304184:

sem_post(): wake up the sleeper only after adjusting has_waiters

If the caller of sem_post() wakes up a thread sleeping via sem_wait()
before it clears the has_waiters flag, the caller of sem_wait() has no way of
knowing when it is safe to destroy the semaphore and reuse the memory. This is
because the caller of sem_post() may be interrupted between the wake step and
the clearing of has_waiters. It will then write into the has_waiters flag in
userspace after being preempted for some unknown amount of time.

Approved by: vangyzen (mentor)
Sponsored by: Dell Inc.

7 years agoMFC r304911
ache [Tue, 30 Aug 2016 01:01:41 +0000 (01:01 +0000)]
MFC r304911

The formal behavior of qsort is unstable with regard to objects that
are equal. Unfortunately, RFC 3484 requires that otherwise equal objects
remain in the order supplied by the DNS server. The present code attempts
to deal with this by returning -1 for objects that are equal (i.e.,
returns that the first parameter is less then the second parameter).
Unfortunately, the qsort API does not state that the first parameter
passed in is in any particular position in the list.

PR:     212122
Submitted by:   Herbie.Robinson@stratus.com

7 years agoMFC r303626 (by gallatin)
hiren [Mon, 29 Aug 2016 18:00:14 +0000 (18:00 +0000)]
MFC r303626 (by gallatin)
Rework IPV6 TCP path MTU discovery to match IPv4.

No objection: gallatin

7 years agoMFC r304747:
cy [Mon, 29 Aug 2016 12:54:46 +0000 (12:54 +0000)]
MFC r304747:

Update from sqlite3-3.12.1 (3120100) to sqlite3-3.14.1 (3140100).

This commit addresses the tmpdir selection vulnerability fixed in
sqlite3-1.13.0.  See VuXML entry 546deeea-3fc6-11e6-a671-60a44ce6887b.

Security: VuXML 546deeea-3fc6-11e6-a671-60a44ce6887b
Security: CVE-2016-6153

7 years agoMFC r304629:
hselasky [Mon, 29 Aug 2016 08:52:53 +0000 (08:52 +0000)]
MFC r304629:
Don't separate the status stage of the XHCI USB control transfers into
its own job because this breaks the simplified QEMU XHCI TRB parser,
which expects the complete USB control transfer as a series of back to
back TRBs. The old behaviour is kept under #ifdef in case this change
breaks enumeration of any USB devices.

PR: 212021

7 years agoMFC r304601:
hselasky [Mon, 29 Aug 2016 08:48:10 +0000 (08:48 +0000)]
MFC r304601:
Increase the maximum RX/TX queue size. This allows for a RX/TX queue
size of 16384 mbufs. Previously the limit was 8192.

Sponsored by: Mellanox Technologies

7 years agoMFC r304597:
hselasky [Mon, 29 Aug 2016 08:39:53 +0000 (08:39 +0000)]
MFC r304597:
Fix for invalid use of bits in input context. Basically split
configuring of EP0 and non-EP0 into xhci_cmd_evaluate_ctx() and
xhci_cmd_configure_ep() respectivly. This resolves some errors when
using XHCI under QEMU and gets is more in line with the XHCI
specification.

PR: 212021

7 years agoMFC r304182 (by ed):
kib [Mon, 29 Aug 2016 06:32:30 +0000 (06:32 +0000)]
MFC r304182 (by ed):
Let CloudABI use fdatasync() as well.

MFC r304185 (by ed):
Eliminate use of sys_fsync() and sys_fdatasync().

7 years agoMFC r304287:
kib [Mon, 29 Aug 2016 05:59:12 +0000 (05:59 +0000)]
MFC r304287:
Add fdatasync(2) man page, combined with fsync(2).

7 years agoMFC r304180:
kib [Mon, 29 Aug 2016 05:53:59 +0000 (05:53 +0000)]
MFC r304180:
Implement VOP_FDATASYNC() for UFS.

7 years agoMFC r303924 (by trasz):
kib [Mon, 29 Aug 2016 05:51:27 +0000 (05:51 +0000)]
MFC r303924 (by trasz):
Eliminate vprint().

7 years agoMFC r304178:
kib [Mon, 29 Aug 2016 05:40:21 +0000 (05:40 +0000)]
MFC r304178:
Implement VOP_FDATASYNC() for msdosfs.

7 years agoMFC r304209:
kib [Mon, 29 Aug 2016 05:37:03 +0000 (05:37 +0000)]
MFC r304209:
The fdatasync(2) call must be cancellation point.

7 years agoRegen
kib [Mon, 29 Aug 2016 05:17:44 +0000 (05:17 +0000)]
Regen

7 years agoMFC r304176:
kib [Mon, 29 Aug 2016 05:15:43 +0000 (05:15 +0000)]
MFC r304176:
Add a trivial implementation of fdatasync(2).

7 years agoMFC r303548:
kib [Mon, 29 Aug 2016 04:45:58 +0000 (04:45 +0000)]
MFC r303548:
Cache getbintime(9) answer in timehands.

7 years agoMFC r303804:
ngie [Sun, 28 Aug 2016 07:19:33 +0000 (07:19 +0000)]
MFC r303804:

Fix building usr.bin/tar/tests with PIE symbol building enabled by
removing CFLAGS+= -static

`CFLAGS+= -static` was a carryover from pre-r289195 with
usr.bin/tar/test/Makefile that should have been specified in LDFLAGS
There doesn't seem to be an apparent need for static compilation
of the test binaries.

Obtained-from: opBSD (418a491eed20d2603ddd1f1bd92c2c0d95094002)

7 years agoMFC r304033:
ngie [Sun, 28 Aug 2016 07:17:25 +0000 (07:17 +0000)]
MFC r304033:

Increase timeout from 10 minutes to 20 minutes for all tests

On particular slow networks, it can (on average) take longer to
resolve hosts to IP* addresses. 20 minutes seemed reasonable for
my work network

This will be solved in a more meaningful way (if possible) using
concurrency in the near future

7 years agoMFC r303830,r304693,r304694,r304698:
ngie [Sun, 28 Aug 2016 07:16:11 +0000 (07:16 +0000)]
MFC r303830,r304693,r304694,r304698:

r303830:

Remove vestigal references to __alpha__

Replace alpha reference in getconf(1) with amd64 [*]

PR:   211300 [*]

r304693:

Clean up trailing whitespace

r304694:

Add `MIN_HOLE_SIZE` pathconf(2) support to getconf

This allows shell programs to programmatically determine whether
or not a filesystem supports sparse files

r304698:

Add support for _PC_ACL_NFS4 as TRUSTEDBSD_ACL_NFS4

The TRUSTEDBSD prefix was chosen for consistency with the other
related `_PC_ACL*` prefixed variables.

7 years agoMFC r303900:
ngie [Sun, 28 Aug 2016 07:12:47 +0000 (07:12 +0000)]
MFC r303900:

Highball memory requirement (4GB) with common/{raise,safety}

Both test suites require more memory than my amd64 VM using
GENERIC-NODEBUG can provide and reliably panic it with OOM issues in
dtrace(4).

Some of the testcases fail, but this at least bypasses the panic behavior
on platforms that don't have enough resources

Discussed with: markj

7 years agoMFC r304238:
ngie [Sun, 28 Aug 2016 07:10:48 +0000 (07:10 +0000)]
MFC r304238:

Only expect :encode_tv_random_million to fail on 64-bit platforms

It passes on i386

7 years agoMFC r304040:
ngie [Sun, 28 Aug 2016 07:09:45 +0000 (07:09 +0000)]
MFC r304040:

Redirect the output of the testcases to stderr instead of
redirecting it to /dev/null

This will aid in debugging failures

7 years agoMFC r304034:
ngie [Sun, 28 Aug 2016 07:08:29 +0000 (07:08 +0000)]
MFC r304034:

Initialize `ai` to NULL and test for `ai` with type-appropriate values

Depending on the address family and ai_flags containing AI_V4MAPPED,
it might not do a proper DNS lookup on the provided DNS address

Convert some `ai` boolean true/false checks to NULL/non-NULL while here.

PR: 211790

7 years agoMFC r304050
alc [Sun, 28 Aug 2016 05:18:39 +0000 (05:18 +0000)]
MFC r304050
  Eliminate two calls to vm_page_xunbusy() that are both unnecessary and
  incorrect from the error cases in exec_map_first_page().  They are
  unnecessary because we automatically unbusy the page in vm_page_free()
  when we remove it from the object.  The calls are incorrect because they
  happen after the page is freed, so we might actually unbusy the page
  after it has been reallocated to a different object.  (This error was
  introduced in r292373.)

7 years agoRemove stale items
skreuzer [Sun, 28 Aug 2016 00:21:24 +0000 (00:21 +0000)]
Remove stale items

Approved by: re (gjb, implicit, relnotes)

7 years agoDocument r299142, The leap-seconds file has been updated to
skreuzer [Sun, 28 Aug 2016 00:12:45 +0000 (00:12 +0000)]
Document r299142, The leap-seconds file has been updated to
                  leap-seconds.3676752000
Document r302177, WITH_SYSTEM_COMPILER: Enable by default
Document r304246, PCIe HotPlug: Detect bridges that are not really
                  HotPlug capable
Document r301565, Switch arm64 to use intrng by default
Document r299781, Support for the Allwinner Reduced Serial Bus (RSB)
Document r296064, Support for Allwinner A20 HDMI
Document r299393, Default installation directory for modules is /boot/modules
Document r303716, Drop SSH1 support
Document r303719, Disable DSA by default
Document r297633, RCTL resources for limited filesystem IO
Document r300723, Mellanox implementation of iSER
Document r299848, Allow reroot to NFS
Document r301033, Discovery without attaching support in iscsictl
Document r299371, camcontrol reprobe
Document r295212, Add an additional, libucl-based configuration file parser
                  to ctld
Document r287842, Change default regulatory domain from DEBUG to FCC in ifconfig
Document r301875, The SIOCSIFALIFETIME_IN6 ioctl has been removed

Approved by: re (gjb, implicit, relnotes)

7 years agoDocument r299142, Native PCIe Hotplug support
skreuzer [Sat, 27 Aug 2016 21:32:56 +0000 (21:32 +0000)]
Document r299142, Native PCIe Hotplug support
Document r298166, libucl has been updated to version 0.8.0
Document r302288, Enable indirect segment I/O by default when running on EC2
Document r302265, Allow ZFS ARC min / max to be tuned at runtime

Approved by: re (gjb, implicit, relnotes)

7 years agoMFC r303747,303982
alc [Sat, 27 Aug 2016 21:31:00 +0000 (21:31 +0000)]
MFC r303747,303982
  Correct errors and clean up the comments on the active queue scan.

  Eliminate some unnecessary blank lines.

  Clean up the comments and code style in and around vm_pageout_cluster().
  In particular, fix factual, grammatical, and spelling errors in various
  comments, and remove comments that are out of place in this function.

7 years agoMFC r303877:
skreuzer [Sat, 27 Aug 2016 20:43:52 +0000 (20:43 +0000)]
MFC r303877:

Write kern.randompid to /etc/sysctl.conf

Approved by: allanjude

7 years agoDocument 292120, Update to ELF Tool Chain r3272
skreuzer [Sat, 27 Aug 2016 20:08:34 +0000 (20:08 +0000)]
Document 292120, Update to ELF Tool Chain r3272

Approved by: re (gjb, implicit, relnotes)

7 years agoMFC r304607,r304641,r304819,r304811
ache [Sat, 27 Aug 2016 11:07:57 +0000 (11:07 +0000)]
MFC r304607,r304641,r304819,r304811

1) Don't forget to set __SERR on __slbexpand() error.

2) Remove "Fast path" from fgetwc()/fputwc() since it can't detect
encoding errors and ignores them all.
One of affected encoding example: US-ASCII

3)  Original fgetln() from 44lite return success for line tail errors,
i.e. partial line, but set __SERR and errno in the same time, which
is inconsistent.
Now both OpenBSD and NetBSD return failure, i.e. no line and set error
indicators for such case, so make our fgetln() and fgetwln()
(as its wide version) compatible with the rest of *BSD.

PR:     212033

7 years agoMFC r304810
ache [Sat, 27 Aug 2016 10:00:36 +0000 (10:00 +0000)]
MFC r304810

Don't check for __SERR which may stick from one of any previous stdio
functions.
__SERR is for user and the rest of stdio code do not check it
for error sensing internally, only set it.
In vf(w)printf.c here it is more easy to save __SERR, clear and restore it.

7 years agoMFC r303426:
kib [Sat, 27 Aug 2016 09:23:20 +0000 (09:23 +0000)]
MFC r303426:
Rewrite subr_sleepqueue.c use of callouts to not depend on the
specifics of callout KPI.

7 years agoMFC r303425:
kib [Sat, 27 Aug 2016 09:11:57 +0000 (09:11 +0000)]
MFC r303425:
Add callout_when(9).

MFC r303919:
Fix indentation.

7 years agoMFC r304779, r304780, r304781, r304782, r304802
cy [Sat, 27 Aug 2016 02:53:21 +0000 (02:53 +0000)]
MFC r304779, r304780, r304781, r304782, r304802

r304779:

  Revert r298887 (spelling fix) and remove $FreeBSD$ because text changes
  to leap-seconds invaldidates validation hash at the end of the file.

  Remove svn:keywords and replace with fbsd:nokeywords=yes to
  support this change.

r304780:

  Change the algorithm by which /var/db/leap-seconds is updated.

  1. Use the leap-seconds version number (update time) to determine
     whether to update the file or not.

  2. If the version numbers of the files is the same, use the later
     expiry date to determine which file to use.

  Suggested by: ian@

r304781:

  Add logic to replace the working ntp leap-seconds file in /var/db
  if it contains a $FreeBSD$ header. The header will cause the file
  to fail checksum of the hash causing ntpd to ignore the file.

r304782:

  Make validation of the leap-seconds file unconditional.

r304802:

  Remove the gratuitous check for $FreeBSD$ and rename the function
  to ntpd_init_leapfile, to ensure a copy exists in /var/db if a copy
  isn't already there.

  Reported by: ache@

7 years agoMFC r304721:
cy [Sat, 27 Aug 2016 02:27:29 +0000 (02:27 +0000)]
MFC r304721:

Fixup man page formatting.

Submitted by: Steve Kargl <sgk@troutmask.apl.washington.edu>
Discussed with: bjk@

7 years agoBump __FreeBSD_version after LC_*_MASK fix
ache [Fri, 26 Aug 2016 21:28:24 +0000 (21:28 +0000)]
Bump __FreeBSD_version after LC_*_MASK fix

7 years agoMFC r304703, r304755
ache [Fri, 26 Aug 2016 21:23:38 +0000 (21:23 +0000)]
MFC r304703, r304755

1) _locale.h
LC_*_MASK bit shifting order was partially broken from the initial commit
time at year 2012. Only LC_COLLATE_MASK and LC_CTYPE_MASK are in the
right order.

The order here should match XLC_* from "xlocale_private.h" which, in turn,
match LC_* publicly visible order from <locale.h> which determines how
locale components are stored in the structure.
LC_*_MASK -> XLC_* translation done as "ffs(mask) - 1" in the querylocale()
and equivalent shift loop in the newlocale(), so mapped to some wrong
components (excluding two mentioned above).

Formally the fix is ABI breakage, but old code using those masks
never works properly in any case.
Only newlocale() and querylocale() are affected.

2) msgcat.c
Use current locale (f.e. set by thread). It was global locale always
previously.

PR:     211743

7 years agoMFC r304342:
hselasky [Fri, 26 Aug 2016 12:04:31 +0000 (12:04 +0000)]
MFC r304342:
Add support for setting blocking and non-blocking mode on /dev/rdma_cm
by returning success on FIONBIO and FIOASYNC IOCTLs. The actual flags
handling is done by the kern_ioctl() function.

Reported by: Alex Bowden <alex.bowden@outlook.com>
Sponsored by: Mellanox Technologies

7 years agoMFC r303388:
kib [Fri, 26 Aug 2016 10:06:24 +0000 (10:06 +0000)]
MFC r303388:
Remove Giant from settime().

7 years agoMFC r303382:
kib [Fri, 26 Aug 2016 10:04:10 +0000 (10:04 +0000)]
MFC r303382:
Provide the getboottime(9) and getboottimebin(9) KPI.

MFC r303387:
Prevent parallel tc_windup() calls.  Keep boottime in timehands,
and adjust it from tc_windup().

MFC notes:

The boottime and boottimebin globals are still exported from
the kernel dyn symbol table in stable/11, but their declarations are
removed from sys/time.h.  This preserves KBI but not KPI, while all
in-tree consumers are converted to getboottime().

The variables are updated after tc_setclock_mtx is dropped, which gives
approximately same unlocked bugs as before.

The boottime and boottimebin locals in several sys/kern_tc.c functions
were renamed by adding the '_x' suffix to avoid name conficts.

7 years agoMFC r303386:
kib [Fri, 26 Aug 2016 09:42:51 +0000 (09:42 +0000)]
MFC r303386:
Change ntpadj_lock to spinlock always.
Add missed lock to ntp_update_second().

7 years agoMFC r303385:
kib [Fri, 26 Aug 2016 09:40:34 +0000 (09:40 +0000)]
MFC r303385:
Reduce the resettodr_lock scope to only CLOCK_SETTIME() call.

7 years agoMFC r303384:
kib [Fri, 26 Aug 2016 09:38:25 +0000 (09:38 +0000)]
MFC r303384:
Style.

7 years agoMFC r303383:
kib [Fri, 26 Aug 2016 09:36:45 +0000 (09:36 +0000)]
MFC r303383:
Reduce number of timehands to just two.

7 years agoMFC 303766
sephe [Fri, 26 Aug 2016 05:37:44 +0000 (05:37 +0000)]
MFC 303766
    tcp/lro: If timestamps mismatch or it's a FIN, force flush.

    This keeps the segments/ACK/FIN delivery order.

    Before this patch, it was observed: if A sent FIN immediately after
    an ACK, B would deliver FIN first to the TCP stack, then the ACK.
    This out-of-order delivery causes one unnecessary ACK sent from B.

    Reviewed by:    gallatin, hps
    Obtained from:  rrs, gallatin
    Sponsored by:   Netflix (rrs, gallatin), Microsoft (sephe)
    Differential Revision:  https://reviews.freebsd.org/D7415

7 years agoMFC r304543:
tuexen [Thu, 25 Aug 2016 09:16:25 +0000 (09:16 +0000)]
MFC r304543:
Unbreak sctp_connectx().

MFC r304573:
Remove duplicate code, which is not protected by the appropriate locks.

MFC r304579:
Improve the locking when sending user messages.

First, keep a ref count on the stcb after looking it up, as
done in the other lookup cases.
Second, before looking again at sp, ensure that it is not
freed, because the assoc is about to be freed.

7 years agoMFC r304286:
kib [Wed, 24 Aug 2016 09:18:38 +0000 (09:18 +0000)]
MFC r304286:
Remove duplicated code.

7 years agoMFC r304697:
bdrewery [Wed, 24 Aug 2016 02:23:03 +0000 (02:23 +0000)]
MFC r304697:

  FAST_DEPEND: Fix 'make all install' not properly rebuilding based on
  .depend.* files.

7 years agoMFC r304322:
bdrewery [Wed, 24 Aug 2016 01:44:53 +0000 (01:44 +0000)]
MFC r304322:

  [net80211] correctly lock the ifp before accessing the lladdr.

7 years agoMFC r304643:
bdrewery [Wed, 24 Aug 2016 01:34:22 +0000 (01:34 +0000)]
MFC r304643:

  Fix building on read-only source trees.

PR: 211952

7 years agoMFC r304021: Update iflib to support more NIC designs
shurd [Tue, 23 Aug 2016 21:21:56 +0000 (21:21 +0000)]
MFC r304021: Update iflib to support more NIC designs

- Move group task queue into kern/subr_gtaskqueue.c
- Change intr_enable to return an int so it can be detected if it's not
  implemented
- Allow different TX/RX queues per set to be different sizes
- Don't split up TX mbufs before transmit
- Allow a completion queue for TX as well as RX
- Pass the RX budget to isc_rxd_available() to allow an earlier return
  and avoid multiple calls

Approved by: sbruno

7 years agoMFC r304232:
kib [Tue, 23 Aug 2016 07:32:12 +0000 (07:32 +0000)]
MFC r304232:
In UFS_BALLOC(), invalidate pages of indirect buffers on failed block
allocation unwinding.

7 years agoMFC r304231:
kib [Tue, 23 Aug 2016 07:30:20 +0000 (07:30 +0000)]
MFC r304231:
On unwind after failed block allocation in ffs_balloc_ufs{1,2}, assert
that recorded allocated blocks numbers match the physical block numbers
of dandling buffers which are released.
When finally freeing the blocks during unwind, assert that dandling
buffers where not re-allocated.

7 years agoMFC r304229:
kib [Tue, 23 Aug 2016 07:27:38 +0000 (07:27 +0000)]
MFC r304229:
When looking up dandling buffers for unwing after failing block
allocation in UFS_BALLOC(), there is no need to map them.

7 years agoMFC r304228:
kib [Tue, 23 Aug 2016 07:25:39 +0000 (07:25 +0000)]
MFC r304228:
When block allocation fails in UFS_BALLOC(), and the volume does not
have SU enabled, there is no point in calling softdep_request_cleanup().

7 years agoMFC r304227:
kib [Tue, 23 Aug 2016 07:23:50 +0000 (07:23 +0000)]
MFC r304227:
In ffs_balloc_ufs{1,2} routines, assert that unwind records do not
overflow local arrays.

7 years agoMFC r304521: JMicron JMB361 has only a single SATA port
avg [Tue, 23 Aug 2016 07:02:50 +0000 (07:02 +0000)]
MFC r304521: JMicron JMB361 has only a single SATA port

7 years agoMFC r304530:
dim [Tue, 23 Aug 2016 05:22:03 +0000 (05:22 +0000)]
MFC r304530:

Pull in r265122 from upstream llvm trunk (by James Molloy):

  Fix for pr24346: arm asm label calculation error in sub

  Some ARM instructions encode 32-bit immediates as a 8-bit integer
  (0-255) and a 4-bit rotation (0-30, even) in its least significant 12
  bits. The original fixup, FK_Data_4, patches the instruction by the
  value bit-to-bit, regardless of the encoding. For example, assuming
  the label L1 and L2 are 0x0 and 0x104 respectively, the following
  instruction:

    add r0, r0, #(L2 - L1) ; expects 0x104, i.e., 260

  would be assembled to the following, which adds 1 to r0, instead of
  260:

    e2800104 add r0, r0, #4, 2 ; equivalently 1

  The new fixup kind fixup_arm_mod_imm takes care of the encoding:

    e2800f41 add r0, r0, #260

  Patch by Ting-Yuan Huang!

This fixes label calculation for ARM assembly, and is needed to enable
ARM assembly sources for OpenSSL.

Requested by: jkim

7 years agoMFC 304476: Fix various nits in the aio operation manpages.
jhb [Mon, 22 Aug 2016 17:52:10 +0000 (17:52 +0000)]
MFC 304476: Fix various nits in the aio operation manpages.

- Avoid double use of "request" in a single sentence.  Instead, describe
  aio_sigevent as being used to request notification of the associated
  operation's completion.  This matches the language used to describe
  aio_sigevent in aio(4).
- Simplify the prohibition on modifying buffers while requests are in
  flight.
- Fix case mismatch.
- Drop note about not using stack variables. C programmers should be able
  to figure out if a stack variable is safe based on the later warning
  about the life cycle requirements of control blocks.
- Remove prohibition on modifying the I/O buffer for aio_fsync() since
  it does not use an I/O buffer.  For aio_mlock(), prohibit modifications
  to the mapping (e.g. due to mprotect, munmap, mmap, etc.) but do not
  prohibit modifications to the memory backing the buffer (stores into
  the pages backing the buffer).

7 years agoMFC r304440, r304487:
markj [Mon, 22 Aug 2016 17:23:27 +0000 (17:23 +0000)]
MFC r304440, r304487:
Fix some handling of P2_PTRACE_FSTP.

7 years agoMFC r304608:
bdrewery [Mon, 22 Aug 2016 15:53:32 +0000 (15:53 +0000)]
MFC r304608:

  Bump __FreeBSD_version for C++11 thread_local support in r303795.

PR:         192320

7 years agoMFC r304174:
kib [Mon, 22 Aug 2016 07:25:09 +0000 (07:25 +0000)]
MFC r304174:
VOP_FSYNC() does not take cred as an argument.  Correct comment.

7 years agoImport Dragonfly Mail Agent snapshort from 20160806 aka v0.11+
bapt [Mon, 22 Aug 2016 07:08:00 +0000 (07:08 +0000)]
Import Dragonfly Mail Agent snapshort from 20160806 aka v0.11+

Most important change being:
dma - Fix security hole

Affecting DragonFly 4.6 and earlier, Matt Dillon fixed this in base after
finding out from BSDNow Episode 152. Comments following were from his commit
which explains better than I. Just taking his change and putting it here as well.

* dma makes an age-old mistake of not properly checking whether a file
owned by a user is a symlink or not, a bug which the original mail.local
also had.

* Add O_NOFOLLOW to disallow symlinks.
Thanks-to: BSDNow Episode 152, made me dive dma to check when they talked
about the mail.local bug.

7 years agoMFC 304251
sephe [Mon, 22 Aug 2016 02:23:05 +0000 (02:23 +0000)]
MFC 304251

    hyperv/storvsc: Deliver CAM_SEL_TIMEOUT upon SRB status error.

    SRB status is set to 0x20 by the hypervisor, if the specified LUN is
    unaccessible, and even worse the INQUIRY response will not be set by
    the hypervisor at all under this situation.  Additionally, SRB status
    is 0x20 too, for TUR on an unaccessible LUN.

    Deliver CAM_SEL_TIMEOUT to CAM upon SRB status errors as suggested by
    Scott Long, other values seems improper.

    This commit fixes the Hyper-V disk hotplug support.

    Submitted by:   Hongjiang Zhang <honzhan microsoft com>
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D7521

7 years agoMFC r304313:
ae [Sun, 21 Aug 2016 17:26:16 +0000 (17:26 +0000)]
MFC r304313:
  Teach netisr_get_cpuid() to limit a given value to supported by netisr.
  Use netisr_get_cpuid() in netisr_select_cpuid() to limit cpuid value
  returned by protocol to be sure that it is not greather than nws_count.

  PR: 211836

7 years agoMFC r304077:
manu [Sun, 21 Aug 2016 15:45:12 +0000 (15:45 +0000)]
MFC r304077:

Correct the size of the softc in a10_ehci

Reported by: andrew

7 years agoMFC r304545: Disable L2 caching for UDP over IPv6
karels [Sat, 20 Aug 2016 20:56:36 +0000 (20:56 +0000)]
MFC r304545: Disable L2 caching for UDP over IPv6

The ip6_output routine is missing L2 cache invalication as done
in ip_output.  Even with that code, some problems with UDP over
IPv6 have been reported.  Diabling L2 cache for that problem works
around the problem for now.

PR: 211872 211926
Reviewed by: gnn
Approved by: gnn (mentor)
Tested by: peter@, Mike Andrews
MFC after: immediate

7 years agoMFC r304319:
dim [Sat, 20 Aug 2016 12:49:05 +0000 (12:49 +0000)]
MFC r304319:

Pull in r262772 from upstream clang trunk (by Simon Pilgrim):

  [X86] AMD Bobcat CPU (btver1) doesn't support XSAVE

  btver1 is a SSSE3/SSE4a only CPU - it doesn't have AVX and doesn't
  support XSAVE.

  Differential Revision: http://reviews.llvm.org/D17682

Pull in r262782 from upstream llvm trunk (by Simon Pilgrim):

  [X86] AMD Bobcat CPU (btver1) doesn't support XSAVE

  btver1 is a SSSE3/SSE4a only CPU - it doesn't have AVX and doesn't
  support XSAVE.

  Differential Revision: http://reviews.llvm.org/D17683

This ensures clang does not emit AVX instructions for CPUTYPE=btver1.

Reported by: Michel Depeige <demik+freebsd@lostwave.net>
PR: 211864

7 years agoMFC r303795:
kib [Sat, 20 Aug 2016 11:58:23 +0000 (11:58 +0000)]
MFC r303795:
Add __cxa_thread_atexit(3) API implementation.

7 years agoMFC r303794:
kib [Sat, 20 Aug 2016 11:54:11 +0000 (11:54 +0000)]
MFC r303794:
Create namespace for the symbols added during 12-CURRENT cycle.

7 years agoMFC r304292:
tuexen [Sat, 20 Aug 2016 07:44:41 +0000 (07:44 +0000)]
MFC r304292:
Use names for SCTP and UDPLite when reporting the input histogram.

MFC r304295:
Fix the output for scope statistics.

7 years agoMFC r303147
pfg [Sat, 20 Aug 2016 02:14:14 +0000 (02:14 +0000)]
MFC r303147
binutils: fix "Bad value" error in bfd for MIPS when using -Bsymbolic.

From OpenBSD's log:

Inspired by https://sourceware.org/ml/binutils/2010-08/msg00333.html,
but expressed differently so there are no GPLv3 issues.

Obtained from: OpenBSD (CVS rev. 1.7)