]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoBring lld (release_39 branch, r279477) to contrib
emaste [Tue, 30 Aug 2016 16:15:19 +0000 (16:15 +0000)]
Bring lld (release_39 branch, r279477) to contrib

7 years agoMerge ^/head r305017 through r305028.
dim [Mon, 29 Aug 2016 20:57:09 +0000 (20:57 +0000)]
Merge ^/head r305017 through r305028.

7 years agoMerge ^/head r304965 through r305016.
dim [Mon, 29 Aug 2016 18:59:43 +0000 (18:59 +0000)]
Merge ^/head r304965 through r305016.

7 years agoFix the zfsd unittest:
dim [Mon, 29 Aug 2016 18:55:06 +0000 (18:55 +0000)]
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

MFC after: 3 days
X-MFC-With: r305013

7 years agoRemove commented out mention of ptrace.S.
kib [Mon, 29 Aug 2016 18:53:51 +0000 (18:53 +0000)]
Remove commented out mention of ptrace.S.
After r305012 the asm wrapper is not needed.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoAdd an empty virtual destructor to zfsd's Vdev class. This is needed
dim [Mon, 29 Aug 2016 18:51:49 +0000 (18:51 +0000)]
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 after: 3 days

7 years agoRewrite ptrace(2) wrappers in C.
kib [Mon, 29 Aug 2016 18:47:51 +0000 (18:47 +0000)]
Rewrite ptrace(2) wrappers in C.
Besides removing hand-translation to assembler, this also adds missing
wrappers for arm64 and risc-v.

Reviewed by: emaste, jhb
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D7694

7 years agoExpect sub testcases 2-4 in :tests_time_rotate to fail today due to changes
ngie [Mon, 29 Aug 2016 18:46:04 +0000 (18:46 +0000)]
Expect sub testcases 2-4 in :tests_time_rotate to fail today due to changes
to newsyslog, etc made in the past month.

The issue is being root-caused as part of the bug noted below. This commit
will need to be partially reverted once the issue has been found/fixed

PR: 212160
Reported by: Jenkins
Sponsored by: EMC / Isilon Storage Division

7 years agoAdd screen locking calls to sc cn grab and ungrab. The locking functions
bde [Mon, 29 Aug 2016 18:41:06 +0000 (18:41 +0000)]
Add screen locking calls to sc cn grab and ungrab.  The locking functions
just use the same mutex locking as sc cn putc so they have the same
defects.

The locking calls to acquire the lock are actually in sc cn open and close.
Ungrab has to unlock, although this opens a race window.

Change the direct mutex lock calls in sc cn putc to the new locking
functions via the open and close functions.  Putc also has to unlock, but
doesn't keep the screen open like grab.  Screen open and close reduce to
locking, except screen open for grab also attempts to switch the screen.

Keyboard locking is more difficult and still null, even when keyboard
input calls screen functions, except some of the functions have locks
too deep to work right.

This organization gives a single place to fix some of the locking.

7 years agoAllow parallelizing clean/cleandepend/depend with all.
bdrewery [Mon, 29 Aug 2016 18:31:34 +0000 (18:31 +0000)]
Allow parallelizing clean/cleandepend/depend with all.

This now makes 'make -jX clean all install' safe.

MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division

7 years agoExpect :basic to fail due to recent output changes in dirname(3)
ngie [Mon, 29 Aug 2016 17:50:36 +0000 (17:50 +0000)]
Expect :basic to fail due to recent output changes in dirname(3)

The dirname output change bug is actively being worked on, and this
commit will need to be reverted once it's fixed.

MFC after: never
PR: 212193
Sponsored by: EMC / Isilon Storage Division

7 years agoNull out the release notes for 12-CURRENT
skreuzer [Mon, 29 Aug 2016 17:23:04 +0000 (17:23 +0000)]
Null out the release notes for 12-CURRENT

Approved by: gjb
Differential Revision:     D7669

7 years agoShorten banal comments about zeroing and copying pages. Don't give
bde [Mon, 29 Aug 2016 14:38:31 +0000 (14:38 +0000)]
Shorten banal comments about zeroing and copying pages.  Don't give
implementation details that last echoed the code 15-20 years ago.
But add a detail about pagezero() on i386.  Switch from Mach style
to BSD style.

7 years agoOn amd64, declare sse2_pagezero() and start using it again, but only
bde [Mon, 29 Aug 2016 13:07:21 +0000 (13:07 +0000)]
On amd64, declare sse2_pagezero() and start using it again, but only
for zeroing pages in idle where nontemporal writes are clearly best.
This is almost a no-op since zeroing in idle works does nothing good
and is off by default.  Fix END() statement forgotten in previous
commit.

Align the loop in sse2_pagezero().  Since it writes to main memory,
the loop doesn't have to be very carefully written to keep up.
Unrolling it was considered useless or harmful and was not done on
i386, but that was too careless.

Timing for i386: the loop was not unrolled at all, and moved only 4
bytes/iteration.  So on a 2GHz CPU, it needed to run at 2 cycles/
iteration to keep up with a memory speed of just 4GB/sec.  But when
it crossed a 16-byte boundary, on old CPUs it ran at 3 cycles/
iteration so it gave a maximum speed of 2.67GB/sec and couldn't even
keep up with PC3200 memory.  Fix the alignment so that it keep up with
4GB/sec memory, and unroll once to get nearer to 8GB/sec.  Further
unrolling might be useless or harmful since it would prevent the loop
fitting in 16-bytes.  My test system with an old CPU and old DDR1 only
needed 5+ GB/sec.  My test system with a new CPU and DDR3 doesn't need
any changes to keep up ~16GB/sec.

Timing for amd64: with 8-byte accesses and newer faster CPUs it is
easy to reach 16GB/sec but not so easy to go much faster.  The
alignment doesn't matter much if the CPU is not very old.  The loop
was already unrolled 4 times, but needs 32 bytes and uses a fancy
method that doesn't work for 2-way unrolling in 16 bytes.  Just
align it to 32-bytes.

7 years agoUse both the MACHINE and MACHINE_CPUARCH directories for finding sources.
ed [Mon, 29 Aug 2016 07:48:35 +0000 (07:48 +0000)]
Use both the MACHINE and MACHINE_CPUARCH directories for finding sources.

When fixing this module to build on PC98, I actually broke the build on
ARM64. On PC98 we need to pull in the sources from the MACHINE_CPUARCH
(i386), but on ARM64 we need to use the MACHINE, as MACHINE_CPUARCH is
set to aarch64 instead of just arm64.

7 years agoRedo MFV r304866:
mm [Mon, 29 Aug 2016 06:54:38 +0000 (06:54 +0000)]
Redo MFV r304866:
Sync libarchive with vendor including security fixes

Vendor issues fixed:
Issue #731: Reject tar entries >= INT64_MAX
Issue #744 (part of Issue #743): Enforce sandbox with very long pathnames
Issue #748: Zip decompression failure with highly-compressed data
Issue #767: Buffer overflow printing a filename
Issue #770: Zip read: be more careful about extra_length

MFC after: 3 days

7 years agoRevert r304869
mm [Mon, 29 Aug 2016 06:50:45 +0000 (06:50 +0000)]
Revert r304869

This commit was incorrect and will be re-committed asap.

7 years agoRestore the nontemporal pagezero() under the name sse2_pagezero() (the
bde [Mon, 29 Aug 2016 06:07:43 +0000 (06:07 +0000)]
Restore the nontemporal pagezero() under the name sse2_pagezero() (the
same name as for i386).  It is not reconnected yet.

Which method is better is too machine-dependent and system-dependent
to replace the old method unconditionally.

7 years agohyperv/hn: Switch to new RNDIS set for RSS parameters.
sephe [Mon, 29 Aug 2016 05:35:35 +0000 (05:35 +0000)]
hyperv/hn: Switch to new RNDIS set for RSS parameters.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7658

7 years agohyperv/hn: Fix # of channels setting, if RSS is not available.
sephe [Mon, 29 Aug 2016 05:08:53 +0000 (05:08 +0000)]
hyperv/hn: Fix # of channels setting, if RSS is not available.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7657

7 years agohyperv/hn: Switch to new RNDIS query for RSS capabilities extraction.
sephe [Mon, 29 Aug 2016 04:54:13 +0000 (04:54 +0000)]
hyperv/hn: Switch to new RNDIS query for RSS capabilities extraction.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7656

7 years agohyperv/hn: Switch to new RNDIS query for link status extraction.
sephe [Mon, 29 Aug 2016 04:44:24 +0000 (04:44 +0000)]
hyperv/hn: Switch to new RNDIS query for link status extraction.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7654

7 years agohyperv/hn: Add definition for NDIS media state.
sephe [Mon, 29 Aug 2016 03:22:56 +0000 (03:22 +0000)]
hyperv/hn: Add definition for NDIS media state.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7652

7 years agoAdd missing array subscript.
jhb [Mon, 29 Aug 2016 01:59:18 +0000 (01:59 +0000)]
Add missing array subscript.

This fixes a tautological pointer comparison warning, but would also a
real bug for a platform where bus_dmamap_unload of a static allocation
is not a no-op.

7 years agoCheck all compatible strings on uart devices in powerpc
jhibbits [Sun, 28 Aug 2016 21:31:21 +0000 (21:31 +0000)]
Check all compatible strings on uart devices in powerpc

Summary:
Some device trees put "fsl,ns16650" first in the compatible list.  This causes
the probe code to choke, even though the device is compatible with ns16650, and
has it listed later in the tree.

Reviewed by: nwhitehorn
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D7676

7 years agoDefine hastd's STRICT_ALIGN macro in a defined and portable way.
dim [Sun, 28 Aug 2016 21:26:11 +0000 (21:26 +0000)]
Define hastd's STRICT_ALIGN macro in a defined and portable way.

MFC after: 3 days

7 years agobhnd(4): Apply the siba chipid ncore fixup in bhnd_read_chipid(), ensuring
landonf [Sun, 28 Aug 2016 20:39:53 +0000 (20:39 +0000)]
bhnd(4): Apply the siba chipid ncore fixup in bhnd_read_chipid(), ensuring
that bhndb et al are always operating on a valid core count.

Approved by: adrian (mentor, implicit)

7 years agoThe read-ahead code from r298230 made it likely the boot code would read
peter [Sun, 28 Aug 2016 20:39:33 +0000 (20:39 +0000)]
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
Discussed with: tsoome, allanjude

7 years agoMerge ^/head r304955 through r304964.
dim [Sun, 28 Aug 2016 19:48:08 +0000 (19:48 +0000)]
Merge ^/head r304955 through r304964.

7 years agoFollow-up to r304953, in which I broke the build: apparently the SOLARIS
dim [Sun, 28 Aug 2016 19:35:29 +0000 (19:35 +0000)]
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
X-MFC-With: r304959, r304953
MFC after: 3 days

7 years agobhnd(4): Add a bhnd bus method for fetching the device's core table.
landonf [Sun, 28 Aug 2016 19:34:22 +0000 (19:34 +0000)]
bhnd(4): Add a bhnd bus method for fetching the device's core table.

This will allow us to perform bhndb(4) bridge configuration based on
the identified hardware, prior to performing full enumeration of the
child bhnd bus.

Approved by: adrian (mentor, implicit)

7 years agoExpand error messages: print symbol names, parentheses and shift tokens,
bde [Sun, 28 Aug 2016 19:33:09 +0000 (19:33 +0000)]
Expand error messages: print symbol names, parentheses and shift tokens,
and negative shift counts.

Fix error messages: print "Division" instead of "Divide"; print
multiplier-like, addition-like and logical operator tokens instead of
garbage (usually the command name).

ddb has a primitive lexer with excessive information hiding that makes
it hard to find even the point in the line where a syntax error is
detected.  Old ddb just printed "Syntax error" and this was unimproved
in most places by printing a garbage token.

7 years agoRevert r304547 now there is no more need for it.
dim [Sun, 28 Aug 2016 19:32:14 +0000 (19:32 +0000)]
Revert r304547 now there is no more need for it.

7 years agoTentatively apply https://reviews.llvm.org/D23921, to get rid of false
dim [Sun, 28 Aug 2016 19:28:00 +0000 (19:28 +0000)]
Tentatively apply https://reviews.llvm.org/D23921, to get rid of false
positive diagnostics from -Wvarargs about enum parameters, e.g.:

cddl/contrib/opensolaris/lib/libnvpair/libnvpair.c:388:15: error: passing an object that undergoes default argument promotion to 'va_start' has undefined behavior
      [-Werror,-Wvarargs]
        va_start(ap, which);
                     ^
cddl/contrib/opensolaris/lib/libnvpair/libnvpair.c:382:66: note: parameter of type 'enum nvlist_prtctl_fmt' is declared here
nvlist_prtctl_dofmt(nvlist_prtctl_t pctl, enum nvlist_prtctl_fmt which, ...)
                                                                 ^

7 years agoComplete r304953.
kib [Sun, 28 Aug 2016 18:10:29 +0000 (18:10 +0000)]
Complete r304953.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

7 years agoFix vm86 initialization, part 1 of 2 and a half.
bde [Sun, 28 Aug 2016 15:23:44 +0000 (15:23 +0000)]
Fix vm86 initialization, part 1 of 2 and a half.

Early use of vm86 depends on the PIC being reset to mask interrupts,
but r286667 moved PIC initialization to after where vm86 may be first
used.

Move the PIC initialization up to immdiately before vm86 initialization.
All invocations of diff that I tried display this move poorly so that it
looks like PIC and vm86 initialization was moved later.

r286667 was to move console initialization later.  The diffs are again
unreadable -- they show a large move that doesn't seem to involve the
console.  The PIC initialization stayed just below the console
initialization where it could still be debugged but no longer works.

Later console initialization breaks mainly debugging vm86 initialization
and memory sizing using ddb and printf().  There are several printf()s
in the memory sizing that now go nowhere since message buffer
initialization has always been too late.  Memory sizing is done by loader
for most users, but the lost messages for this case are even more
interesting than for an auto-probe since they tell you what the loader
found.

7 years agoFix vm86 initialization, part 1 of 2 and a half.
bde [Sun, 28 Aug 2016 14:03:25 +0000 (14:03 +0000)]
Fix vm86 initialization, part 1 of 2 and a half.

vm86 uses the tss, but r273995 moved tss initialization to after where
it may be first used, just because tss_esp0 now depends on later
initializations and/or amd64 does it later.

vm86 is first used for memory sizing in cases where the loader can't
figure out the size or is not used.  Its initialization is placed
immediately before memory sizing to support this, and the tss was
initialized a little earlier.

Move everything in the tss initialization except for tss_esp0 back to
almost where it was, immediately before vm86 initialization (the
combined move is from before dblflt_tss initialization to after).  Add
only early initialization of tss_esp0, later reloading of the tss, and
comments.  The initial tss_esp0 no longer has space for the pcb since
initially the size of the pcb is not known and no pcb is needed.
(Later changes broke debugging at this point, so the nonexistent pcb
cannot be used by debuggers, and at the time of 273995 when ddb was
almost able to debug this problem it didn't need the pcb.)  The
iniitial tss_esp0 still has a magic 16 bytes reserved for vm86
although I think this is unused too.

7 years agoBack out r304907, Ed had fixed it apparently earlier in the cloudabi*
bz [Sun, 28 Aug 2016 12:05:34 +0000 (12:05 +0000)]
Back out r304907, Ed had fixed it apparently earlier in the cloudabi*
subdirectories.

Reported by: np

7 years agoMerge ^/head r304885 through r304954.
dim [Sun, 28 Aug 2016 11:58:15 +0000 (11:58 +0000)]
Merge ^/head r304885 through r304954.

7 years agoSquelch -Wconstant-conversion for WARNS <= 2. In clang 3.9.0, this
dim [Sun, 28 Aug 2016 11:54:45 +0000 (11:54 +0000)]
Squelch -Wconstant-conversion for WARNS <= 2.  In clang 3.9.0, this
warning has become more aggressive, and it usually turns up in decades
old code, where fixing it is more trouble than it is worth.

7 years agoDefine ipfilter's SOLARIS macro in a defined and portable way.
dim [Sun, 28 Aug 2016 11:51:46 +0000 (11:51 +0000)]
Define ipfilter's SOLARIS macro in a defined and portable way.

Reviewed by: cy
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D7671

7 years agoRemove duplicated declaration.
oshogbo [Sun, 28 Aug 2016 07:40:11 +0000 (07:40 +0000)]
Remove duplicated declaration.

Reported by: adrian@

7 years ago[ath_hal] add USB PHY control registers for hornet/AR9330.
adrian [Sun, 28 Aug 2016 05:42:03 +0000 (05:42 +0000)]
[ath_hal] add USB PHY control registers for hornet/AR9330.

Obtained from: linux ath9k

7 years ago[net80211] fix up wlanwds to compile without warnings on clang.
adrian [Sun, 28 Aug 2016 04:54:02 +0000 (04:54 +0000)]
[net80211] fix up wlanwds to compile without warnings on clang.

7 years agoFix UART PPS capture mode printing
jhibbits [Sun, 28 Aug 2016 04:40:27 +0000 (04:40 +0000)]
Fix UART PPS capture mode printing

* Add breaks to prevent fallthrough and printing of multiple modes.
* Only check the mode, mask out all other bits.

7 years ago[mips] move AR91XX_BASE to std.AR91XX.
adrian [Sun, 28 Aug 2016 04:10:23 +0000 (04:10 +0000)]
[mips] move AR91XX_BASE to std.AR91XX.

7 years ago[mips] migrate the QCA955X_BASE file to std.QCA955X, to bring this in line with
adrian [Sun, 28 Aug 2016 04:08:26 +0000 (04:08 +0000)]
[mips] migrate the QCA955X_BASE file to std.QCA955X, to bring this in line with
other board defaults.

7 years agoUse ALT_BREAK_TO_DEBUGGER as well.
adrian [Sun, 28 Aug 2016 04:08:04 +0000 (04:08 +0000)]
Use ALT_BREAK_TO_DEBUGGER as well.

7 years ago.. and since others are using wdr3600/wdr4300 right now and are having
adrian [Sun, 28 Aug 2016 04:07:34 +0000 (04:07 +0000)]
.. and since others are using wdr3600/wdr4300 right now and are having
arge issues with spammed interrupts / link issues, flip on ARGE_DEBUG too.

7 years agoSince i'm using carambola 2 for more debugging, enable ARGE_DEBUG by default.
adrian [Sun, 28 Aug 2016 04:06:57 +0000 (04:06 +0000)]
Since i'm using carambola 2 for more debugging, enable ARGE_DEBUG by default.

7 years ago[mips] make AR933X boards use ALT_BREAK_TO_DEBUGGER like the rest of the Atheros...
adrian [Sun, 28 Aug 2016 04:06:36 +0000 (04:06 +0000)]
[mips] make AR933X boards use ALT_BREAK_TO_DEBUGGER like the rest of the Atheros boards.

7 years ago[mips] QCA955x config file changes to bring things into alignment with the other...
adrian [Sun, 28 Aug 2016 04:03:52 +0000 (04:03 +0000)]
[mips] QCA955x config file changes to bring things into alignment with the other atheros config files.

* ALT_BREAK_TO_DEBUGGER, because we get random breaks when unplugging USB
  to serial adapters
* Build more modules!

7 years agoFollow ABI when calling __error from the ptrace(2) wrapper.
kib [Sun, 28 Aug 2016 00:26:06 +0000 (00:26 +0000)]
Follow ABI when calling __error from the ptrace(2) wrapper.

In particular, preserve syscall arguments on stack, since callee is
not required to preserve arg-passing registers.  Align stack.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoDo not obliterate errno value in the main thread during ptrace(2) call on x86.
kib [Sat, 27 Aug 2016 23:03:23 +0000 (23:03 +0000)]
Do not obliterate errno value in the main thread during ptrace(2) call on x86.

Since ptrace(2) syscall can return -1 for non-error situations, libc
wrappers set errno to 0 before performing the syscall, as the service
to the caller.  On both i386 and amd64, the errno symbol was directly
referenced, which only works correctly in single-threaded process.

Change assembler wrappers for ptrace(2) to get current thread errno
location by calling __error().  Allow __error interposing, as
currently allowed in cerror().

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agovfs: provide a common exit point in namei for error cases
mjg [Sat, 27 Aug 2016 22:43:41 +0000 (22:43 +0000)]
vfs: provide a common exit point in namei for error cases

This shortens the function, adds the SDT_PROBE use for error cases and
consistenly unrefs rootdir last.

Reviewed by: kib
MFC after: 2 weeks

7 years agoIn ncurses baudrate definitions, avoid warnings about implicit
dim [Sat, 27 Aug 2016 20:33:19 +0000 (20:33 +0000)]
In ncurses baudrate definitions, avoid warnings about implicit
conversions from int to short changing the values.  This applies to
B38400 and higher, since their values do not fit into a short.

However, since the wrapped values are still unique, and they only serve
as keys, there is no problem in adding a cast to silence the warnings.
This also avoids changing the ABI, which would happen if we changed
NCURSES_OSPEED to int.

Discussed with: Thomas Dickey
MFC after: 1 week

7 years agoDecode some new ATA commands found in ACS-3.
mav [Sat, 27 Aug 2016 19:51:37 +0000 (19:51 +0000)]
Decode some new ATA commands found in ACS-3.

MFC after: 1 week

7 years agoConsistently delimit each vnode description block with two blank
kib [Sat, 27 Aug 2016 18:12:42 +0000 (18:12 +0000)]
Consistently delimit each vnode description block with two blank
lines.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

7 years agoBump date in the man page.
oshogbo [Sat, 27 Aug 2016 18:08:25 +0000 (18:08 +0000)]
Bump date in the man page.

7 years agoCompile clang, lldb and related tools with WARNS=3 by default.
dim [Sat, 27 Aug 2016 16:01:10 +0000 (16:01 +0000)]
Compile clang, lldb and related tools with WARNS=3 by default.

7 years agoTentatively apply https://reviews.llvm.org/D23960, to squelch errors
dim [Sat, 27 Aug 2016 15:59:32 +0000 (15:59 +0000)]
Tentatively apply https://reviews.llvm.org/D23960, to squelch errors
about narrowing in <bitset>.

7 years agoAdd missed header file for cnv.h .
oshogbo [Sat, 27 Aug 2016 15:22:55 +0000 (15:22 +0000)]
Add missed header file for cnv.h .

Submitted by: Adam Starak <starak.adam@gmail.com>
Reported by: ache@

7 years agoThe formal behavior of qsort is unstable with regard to objects that
ache [Sat, 27 Aug 2016 14:43:13 +0000 (14:43 +0000)]
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
MFC after:      3 days

7 years agoIntroduce cnv man page.
oshogbo [Sat, 27 Aug 2016 13:47:52 +0000 (13:47 +0000)]
Introduce cnv man page.

Submitted by: Adam Starak <starak.adam@gmail.com>
Reviewed by: cem@, wblock@
Differential Revision: https://reviews.freebsd.org/D7249

7 years agoFix style issue in the cnv API.
oshogbo [Sat, 27 Aug 2016 13:40:27 +0000 (13:40 +0000)]
Fix style issue in the cnv API.
Remove unused arguments in a macro.
Remove unused typedef.

7 years agoAdd cnv API.
oshogbo [Sat, 27 Aug 2016 13:37:30 +0000 (13:37 +0000)]
Add cnv API.

cnv API is a set of functions for managing name/value pairs by cookie.
The cookie can be obtained by nvlist_next(), nvlist_get_parent() or
nvlist_get_pararr() function. This patch also includes unit tests.

Submitted by: Adam Starak <starak.adam@gmail.com>

7 years agoDo not try to build cloudabi32 for pc98.
bz [Sat, 27 Aug 2016 12:41:15 +0000 (12:41 +0000)]
Do not try to build cloudabi32 for pc98.

Should unbreak tinderbox.

7 years agoUpdate llvm to release_39 branch r279689.
dim [Sat, 27 Aug 2016 11:51:08 +0000 (11:51 +0000)]
Update llvm to release_39 branch r279689.

7 years agoFix build without INET6 and with gcc. A function definition was ifdefed
bde [Sat, 27 Aug 2016 11:06:06 +0000 (11:06 +0000)]
Fix build without INET6 and with gcc.  A function definition was ifdefed
for INET6, but its protototype was not, and gcc detects the error.

7 years agoPrint both the kernel read and write translation in DDB when asking for
andrew [Sat, 27 Aug 2016 10:30:20 +0000 (10:30 +0000)]
Print both the kernel read and write translation in DDB when asking for
a virtual to physical translation. These may be different, e.g. when a
page is mapped as read-only.

MFC after: 1 month
Sponsored by: ABT Systems Ltd

7 years agoiwm: fix few comment typos.
avos [Sat, 27 Aug 2016 10:04:48 +0000 (10:04 +0000)]
iwm: fix few comment typos.

7 years agoCentralize where LLVM_SRCS, CLANG_SRCS and LLDB_SRCS are defined.
dim [Sat, 27 Aug 2016 10:00:33 +0000 (10:00 +0000)]
Centralize where LLVM_SRCS, CLANG_SRCS and LLDB_SRCS are defined.

7 years agoMissed one .mk file where OBJTOP can be used.
dim [Sat, 27 Aug 2016 09:51:57 +0000 (09:51 +0000)]
Missed one .mk file where OBJTOP can be used.

7 years agoProperly use MACHINE_CPUARCH for finding cloudabi*_sysvec.c.
ed [Sat, 27 Aug 2016 09:50:11 +0000 (09:50 +0000)]
Properly use MACHINE_CPUARCH for finding cloudabi*_sysvec.c.

The build of the cloudabi32 kernel module currently fails for PC98. In
the case of PC98, we just want to use the code for i386.

Reported by: np

7 years agoMerge ^/head r304700 through r304884.
dim [Sat, 27 Aug 2016 09:40:29 +0000 (09:40 +0000)]
Merge ^/head r304700 through r304884.

7 years agoUse SRCTOP and OBJTOP throughout the llvm/clang/lldb build.
dim [Sat, 27 Aug 2016 09:29:39 +0000 (09:29 +0000)]
Use SRCTOP and OBJTOP throughout the llvm/clang/lldb build.

7 years agoiwm: add 'command accepted' debug notification (copied from wpi(4)).
avos [Sat, 27 Aug 2016 08:34:20 +0000 (08:34 +0000)]
iwm: add 'command accepted' debug notification (copied from wpi(4)).

Now it should be easier to find out which command causes firmware
panics when few commands are sent in a short period of time.

7 years agoRemove warning on struct-overflow on gcc 5.3.0 as zic(8) dies on it
bapt [Sat, 27 Aug 2016 01:28:00 +0000 (01:28 +0000)]
Remove warning on struct-overflow on gcc 5.3.0 as zic(8) dies on it

7 years agoImplement siba(4) support for bhnd_(read|write)_config.
landonf [Sat, 27 Aug 2016 00:58:21 +0000 (00:58 +0000)]
Implement siba(4) support for bhnd_(read|write)_config.

This provides access to the siba(4) bus-mapped per-core cfg0 register
block.

Approved by: adrian (mentor, implicit)

7 years agoUse printable ASCII instead of octal representation.
delphij [Sat, 27 Aug 2016 00:56:37 +0000 (00:56 +0000)]
Use printable ASCII instead of octal representation.

MFC after: 2 weeks

7 years agoTemporarily disable two libarchive tests that have not yet been fixed by
mm [Sat, 27 Aug 2016 00:47:47 +0000 (00:47 +0000)]
Temporarily disable two libarchive tests that have not yet been fixed by
vendor. Tests will be re-enabled after a fix has been merged.

MFC after: 3 days

7 years agocxgbe(4): Provide more details about the card in the sysctl MIB.
np [Sat, 27 Aug 2016 00:13:41 +0000 (00:13 +0000)]
cxgbe(4): Provide more details about the card in the sysctl MIB.

dev.t5nex.0.%desc: Chelsio T580-CR
dev.t5nex.0.hw_revision: 1
dev.t5nex.0.sn: PT13140042
dev.t5nex.0.pn: 110117150A0
dev.t5nex.0.ec: 0000000000000000
dev.t5nex.0.na: 0007432AF490
dev.t5nex.0.vpd_version: 3
dev.t5nex.0.scfg_version: 53255
dev.t5nex.0.bs_version: 1.1.0.0
dev.t5nex.0.er_version: 1.0.0.68
dev.t5nex.0.tp_version: 0.1.4.9
dev.t5nex.0.firmware_version: 1.16.2.0

Sponsored by: Chelsio Communications

7 years agobhnd(4): Include the chip model (e.g. BCM4xxx) in bhnd(4) bus's device
landonf [Sat, 27 Aug 2016 00:07:48 +0000 (00:07 +0000)]
bhnd(4): Include the chip model (e.g. BCM4xxx) in bhnd(4) bus's device
descriptions.

Reviewed by: mizhka
Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D7570

7 years ago[mips/broadcom]: Replace static frequency table with generic PMU clock
landonf [Sat, 27 Aug 2016 00:06:20 +0000 (00:06 +0000)]
[mips/broadcom]: Replace static frequency table with generic PMU clock
handling.

- Extended PWRCTL/PMU APIs to support querying clock frequency during very
  early boot, prior to bus attach.
- Implement generic PMU-based calculation of UART rclk values.
- Replaced use of static frequency tables (bcm_socinfo) with
  runtime-determined values.

Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D7552

7 years agobhnd(4): Initial PMU/PWRCTL power and clock management support.
landonf [Sat, 27 Aug 2016 00:03:02 +0000 (00:03 +0000)]
bhnd(4): Initial PMU/PWRCTL power and clock management support.

- Added bhnd_pmu driver implementations for PMU and PWRCTL chipsets,
  derived from Broadcom's ISC-licensed HND code.
- Added bhnd bus-level support for routing per-core clock and resource
  power requests to the PMU device.
- Lift ChipCommon support out into the bhnd module, dropping
  bhnd_chipc.

Reviewed by: mizhka
Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D7492

7 years agoMFV r304866:
mm [Fri, 26 Aug 2016 23:50:44 +0000 (23:50 +0000)]
MFV r304866:
Sync libarchive with vendor including security fixes

Vendor issues fixed:
Issue #731: Reject tar entries >= INT64_MAX
Issue #744 (part of Issue #743): Enforce sandbox with very long pathnames
Issue #748: Zip decompression failure with highly-compressed data
Issue #767: Buffer overflow printing a filename
Issue #770: Zip read: be more careful about extra_length

MFC after: 3 days

7 years agoAdd forgotten {llvm,clang}.pre.mk files.
dim [Fri, 26 Aug 2016 22:56:23 +0000 (22:56 +0000)]
Add forgotten {llvm,clang}.pre.mk files.

7 years agoCompletely revamp the way llvm, clang and lldb are built.
dim [Fri, 26 Aug 2016 22:44:22 +0000 (22:44 +0000)]
Completely revamp the way llvm, clang and lldb are built.

* Bootstrap llvm-tblgen and clang-tblgen with a minimal llvm static
  library, that has no other dependencies.
* Roll up all separate llvm libraries into one big static libllvm.
* Similar for all separate clang and lldb static libraries.
* For all these libraries, generate their .inc files only once.
* Link all llvm tools (including extra) against the big libllvm.
* Link clang and clang-format against the big libllvm and libclang.
* Link lldb against the big libllvm, libclang and liblldb.

N.B.: This is work in progress, some details may still be missing.

It also heavily depends on bsd.*.mk's support for SRCS and DPSRCS with
relative pathnames, which apparently does not always work as expected.
For building llvm, clang and lldb though, it seems to work just fine.

The main idea behind this restructuring is maintainability and build
peformance.  The previous large number of very small libraries, each
with their own generated files and dependencies was slow to traverse
and hard to understand.

Possible future improvements:
* Only build certain targets, e.g. for most regular users having just
  one target will be fine.  This will shave off some build time.
* Building the big llvm, clang and lldb libraries as shared (private)
  libraries.
* Adding other components from the LLVM project, such as lld.

7 years agoImprove compatibility of calls to dirname() on constant strings.
ed [Fri, 26 Aug 2016 20:23:10 +0000 (20:23 +0000)]
Improve compatibility of calls to dirname() on constant strings.

As the xinstall(8) utility had to be patched up to work with the POSIXly
correct basename()/dirname() prototypes, we make it pretty hard to build
previous versions of FreeBSD on HEAD. xinstall(8) is part of the
bootstrap tools.

Add some logic to <libgen.h> to automatically detect bad calls to
dirname() based on the type of the argument. If the argument is of type
'const char *', we simply fall back to calling into dirname@FBSD_1.0
directly.

I'll also give basename() similar treatment when importing the
thread-safe version of that function.

Tested by: bdrewery, madpilot (thanks!)

7 years ago[mips/broadcom] Generic platform_reset() support.
landonf [Fri, 26 Aug 2016 20:16:02 +0000 (20:16 +0000)]
[mips/broadcom] Generic platform_reset() support.

This adds support for performing platform_reset() on all supported
devices, using early boot enumeration of chipc capabilities and
available cores.

- Added Broadcom-specific MIPS CP0 register definitions used by
  BCM4785-specific reset handling.
- Added a bcm_platform structure for tracking chipc/pmu/cfe platform
  data.
- Extended the BCMA EROM API to support early boot lookup of core info
  (including port/region mappings).
- Extended platform_reset() to support PMU, PMU+AOB, and non-PMU
  devices.

Reviewed by: mizhka
Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D7539

7 years agoEnable I/O MMU when PCI pass through is first used.
jhb [Fri, 26 Aug 2016 20:15:22 +0000 (20:15 +0000)]
Enable I/O MMU when PCI pass through is first used.

Rather than enabling the I/O MMU when the vmm module is loaded,
defer initialization until the first attempt to pass a PCI device
through to a guest.  If the I/O MMU fails to initialize or is not
present, than fail the attempt to pass a PCI device through to a
guest.

The hw.vmm.force_iommu tunable has been removed since the I/O MMU is
no longer enabled during boot.  However, the I/O MMU support can be
disabled by setting the hw.vmm.iommu.enable tunable to 0 to prevent
use of the I/O MMU on any systems where it is buggy.

Reviewed by: grehan
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D7448

7 years agoAdjust TCP module fastpath after r304803's cc_ack_received() changes.
hiren [Fri, 26 Aug 2016 19:23:17 +0000 (19:23 +0000)]
Adjust TCP module fastpath after r304803's cc_ack_received() changes.

Reported by: hiren, bz, np
Reviewed by: rrs
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D7664

7 years agoUpdate TCPS_HAVERCVDFIN() macro to correctly include all states a connection
hiren [Fri, 26 Aug 2016 17:48:54 +0000 (17:48 +0000)]
Update TCPS_HAVERCVDFIN() macro to correctly include all states a connection
can be in after receiving a FIN.

FWIW, NetBSD has this change for quite some time.

This has been tested at Netflix and Limelight in production traffic.

Reported by: Sam Kumar <samkumar99 at gmail.com> on transport@
Reviewed by: rrs
MFC after: 4 weeks
Sponsored by: Limelight Networks
Differential Revision:  https://reviews.freebsd.org/D7475

7 years agocxgbe/iw_cxgbe: Various fixes to the iWARP driver.
np [Fri, 26 Aug 2016 17:38:13 +0000 (17:38 +0000)]
cxgbe/iw_cxgbe: Various fixes to the iWARP driver.

- Return appropriate error code instead of ENOMEM when sosend() fails in
  send_mpa_req.
- Fix for problematic race during destroy_qp.
- Abortive close in the failure of send_mpa_reject() instead of normal close.
- Remove the unnecessary doorbell flowcontrol logic.

Submitted by: Krishnamraju Eraparaju at Chelsio
MFC after: 1 month
Sponsored by: Chelsio communications

7 years agoUnused variables and cstyle fix for loader dosfs
tsoome [Fri, 26 Aug 2016 14:58:57 +0000 (14:58 +0000)]
Unused variables and cstyle fix for loader dosfs

Reviewed by: imp, allanjude
Approved by: imp (mentor), allanjude (mentor)
Differential Revision: https://reviews.freebsd.org/D7659

7 years agoDo not free an uninitialized pointer on soaccept failure in the iWARP
np [Fri, 26 Aug 2016 08:25:28 +0000 (08:25 +0000)]
Do not free an uninitialized pointer on soaccept failure in the iWARP
connection manager.

Sponsored by: Chelsio Communications

7 years agoFix a bug, where no SACK is sent when receiving a FORWARD-TSN or
tuexen [Fri, 26 Aug 2016 07:49:23 +0000 (07:49 +0000)]
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.

MFC after: 3 days

7 years agohyperv/hn: Use vmbus xact for RNDIS set.
sephe [Fri, 26 Aug 2016 05:18:27 +0000 (05:18 +0000)]
hyperv/hn: Use vmbus xact for RNDIS set.

And use new RNDIS set to configure NDIS offloading parameters.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7641

7 years agohyperv/hn: Save the adopted NDIS version for RNDIS to use later.
sephe [Fri, 26 Aug 2016 05:15:08 +0000 (05:15 +0000)]
hyperv/hn: Save the adopted NDIS version for RNDIS to use later.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7640

7 years agohyperv/hn: Use vmbus xact for RNDIS query.
sephe [Fri, 26 Aug 2016 05:12:09 +0000 (05:12 +0000)]
hyperv/hn: Use vmbus xact for RNDIS query.

And switch MAC address query to use new RNDIS query function.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7639