]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoFix TI PRUSS driver panic with INVARIANTS enabled
Oleksandr Tymoshenko [Tue, 30 Aug 2016 01:31:03 +0000 (01:31 +0000)]
Fix TI PRUSS driver panic with INVARIANTS enabled

Value passed as islocked argument to knlist_add should
be consistent with actual lock state so add lock/unlock
calls around knlist_add

PR: 212120
Submitted by: Manuel Stuhn

7 years agoSome versions of SLOF do not append the partition number to the boot
Nathan Whitehorn [Tue, 30 Aug 2016 00:47:21 +0000 (00:47 +0000)]
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
MFC after: 2 days

7 years agoImplement 'devctl clear driver' to undo a previous 'devctl set driver'.
John Baldwin [Mon, 29 Aug 2016 22:48:36 +0000 (22:48 +0000)]
Implement 'devctl clear driver' to undo a previous 'devctl set driver'.

Add a new 'clear driver' command for devctl along with the accompanying
ioctl and devctl_clear_driver() library routine to reset a device to
use a wildcard devclass instead of a fixed devclass.  This can be used
to undo a previous 'set driver' command.  After the device's name has
been reset to permit wildcard names, it is reprobed so that it can
attach to newly-available (to it) device drivers.

MFC after: 1 month
Sponsored by: Chelsio Communications

7 years agoMinor Makefile simplifications for lib/atf/...
Enji Cooper [Mon, 29 Aug 2016 22:47:53 +0000 (22:47 +0000)]
Minor Makefile simplifications for lib/atf/...

- Replace uses of `${.CURDIR:H:H:H}` with ${SRCTOP}
- Use built-in :H operator instead of ".." when enumerating paths.

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

7 years agoUse device_verbose() to undo device_quiet() when detaching from t[45]iovX.
John Baldwin [Mon, 29 Aug 2016 22:47:14 +0000 (22:47 +0000)]
Use device_verbose() to undo device_quiet() when detaching from t[45]iovX.

The device quiet flag is not automatically reset on detach, so it is
inherited by other device drivers (e.g. when switching a device driver
over to ppt for PCI pass through).  Cope with this behavior by explicitly
marking the device verbose during detach so that the next driver can make
its own decision.

Sponsored by: Chelsio Communications

7 years agoFix typo
Enji Cooper [Mon, 29 Aug 2016 22:38:18 +0000 (22:38 +0000)]
Fix typo

atf_tc_expect_fail should have been atf_expect_fail per atf-sh-api(3)

PR: 212193
Pointyhat to: ngie
Sponsored by: EMC / Isilon Storage Division

7 years agoFix typo
Enji Cooper [Mon, 29 Aug 2016 22:34:31 +0000 (22:34 +0000)]
Fix typo

atf_tc_expect_fail should have been atf_expect_fail per atf-sh-api(3)

PR: 212193
Pointyhat to: ngie
Sponsored by: EMC / Isilon Storage Division

7 years agoioat(4): Add additional CTR tracing during reset
Conrad Meyer [Mon, 29 Aug 2016 20:51:34 +0000 (20:51 +0000)]
ioat(4): Add additional CTR tracing during reset

7 years agoioat(4): Don't "complete" DMA descriptors prematurely
Conrad Meyer [Mon, 29 Aug 2016 20:46:33 +0000 (20:46 +0000)]
ioat(4): Don't "complete" DMA descriptors prematurely

In r304602, I mistakenly removed the ioat_process_events check that we weren't
processing events before the hardware had completed the descriptor
("last_seen").  Reinstate that logic.

Keep the defensive loop condition and additionally make sure we've actually
completed a descriptor before blindly chasing the ring around.

In reset, queue and finish the startup command before allowing any event
processing or submission to occur.  Avoid potential missed callouts by
requeueing the poll later.

7 years agoWhen the EFI implementation (like U-Boot) does not support WaitForKey, we
Jared McNeill [Mon, 29 Aug 2016 20:01:53 +0000 (20:01 +0000)]
When the EFI implementation (like U-Boot) does not support WaitForKey, we
can emulate efi_cons_poll(0 with a flag and caching the last key read with
ReadKeyStroke. This fixes the loader.efi countdown timer on Pine64 (and
other U-Boot + EFI using platforms).

Reviewed by: imp, manu
Differential Revision: https://reviews.freebsd.org/D7670

7 years agoTypesetting fixes.
Konstantin Belousov [Mon, 29 Aug 2016 19:53:13 +0000 (19:53 +0000)]
Typesetting fixes.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

7 years agoAvoid undefined behavior when calling va_start() in bnep_send_control(),
Dimitry Andric [Mon, 29 Aug 2016 19:40:46 +0000 (19:40 +0000)]
Avoid undefined behavior when calling va_start() in bnep_send_control(),
by making the 'type' parameter a plain unsigned.

MFC after: 3 days

7 years agoRestore the requirement of setting errno to zero before calling
Konstantin Belousov [Mon, 29 Aug 2016 19:33:07 +0000 (19:33 +0000)]
Restore the requirement of setting errno to zero before calling
ptrace(2).  Describe the behaviour of automatically zeroing errno as
historical feature.

Requested by: ache, jhb
Reviewed by: ache, bjk
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoMFhead @ r305020
Enji Cooper [Mon, 29 Aug 2016 19:14:52 +0000 (19:14 +0000)]
MFhead @ r305020

7 years agoRemove redundant declarations and simplify ../ in pathing
Enji Cooper [Mon, 29 Aug 2016 19:10:58 +0000 (19:10 +0000)]
Remove redundant declarations and simplify ../ in pathing

- TESTSBASE and LOCALBASE are already defined in bsd.tests.mk
- TESTSDIR is automatically divined as ${TESTSBASE}${RELDIR:H} after
  r289158.
- Replace SRCDIR with SRCTOP

MFC after: 1 week
X-MFC with: r305019
Sponsored by: EMC / Isilon Storage Division

7 years agoRemove unnecessary variable (SRCDIR) replaced by SRCTOP in Makefile.common
Enji Cooper [Mon, 29 Aug 2016 19:07:48 +0000 (19:07 +0000)]
Remove unnecessary variable (SRCDIR) replaced by SRCTOP in Makefile.common

MFC after: 1 week
X-MFC with: r305018
Sponsored by: EMC / Isilon Storage Division

7 years agoUse SRCTOP instead of a homegrown definition for it (SRCDIR)
Enji Cooper [Mon, 29 Aug 2016 19:06:40 +0000 (19:06 +0000)]
Use SRCTOP instead of a homegrown definition for it (SRCDIR)

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

7 years agoFix the zfsd unittest:
Dimitry Andric [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.
Konstantin Belousov [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 agoMFhead @ r305013
Enji Cooper [Mon, 29 Aug 2016 18:53:36 +0000 (18:53 +0000)]
MFhead @ r305013

7 years agoAdd an empty virtual destructor to zfsd's Vdev class. This is needed
Dimitry Andric [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.
Konstantin Belousov [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
Enji Cooper [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
Bruce Evans [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.
Bryan Drewery [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)
Enji Cooper [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
Steven Kreuzer [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
Bruce Evans [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
Bruce Evans [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 Schouten [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:
Martin Matuska [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
Martin Matuska [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
Bruce Evans [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.
Sepherosa Ziehau [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.
Sepherosa Ziehau [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.
Sepherosa Ziehau [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.
Sepherosa Ziehau [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.
Sepherosa Ziehau [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.
John Baldwin [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
Justin Hibbits [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.
Dimitry Andric [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
Landon J. Fuller [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 Wemm [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 agoFollow-up to r304953, in which I broke the build: apparently the SOLARIS
Dimitry Andric [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.
Landon J. Fuller [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,
Bruce Evans [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 agoComplete r304953.
Konstantin Belousov [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.
Bruce Evans [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.
Bruce Evans [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*
Bjoern A. Zeeb [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 agoDefine ipfilter's SOLARIS macro in a defined and portable way.
Dimitry Andric [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.
Mariusz Zaborski [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 Chadd [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 Chadd [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
Justin Hibbits [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 Chadd [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 Chadd [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 Chadd [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 Chadd [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 Chadd [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 Chadd [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 Chadd [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!

8 years agoFollow ABI when calling __error from the ptrace(2) wrapper.
Konstantin Belousov [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

8 years agoDo not obliterate errno value in the main thread during ptrace(2) call on x86.
Konstantin Belousov [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

8 years agovfs: provide a common exit point in namei for error cases
Mateusz Guzik [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

8 years agoIn ncurses baudrate definitions, avoid warnings about implicit
Dimitry Andric [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

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

MFC after: 1 week

8 years agoConsistently delimit each vnode description block with two blank
Konstantin Belousov [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

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

8 years agoAdd missed header file for cnv.h .
Mariusz Zaborski [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@

8 years agoThe formal behavior of qsort is unstable with regard to objects that
Andrey A. Chernov [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

8 years agoIntroduce cnv man page.
Mariusz Zaborski [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

8 years agoFix style issue in the cnv API.
Mariusz Zaborski [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.

8 years agoAdd cnv API.
Mariusz Zaborski [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>

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

Should unbreak tinderbox.

8 years agoFix build without INET6 and with gcc. A function definition was ifdefed
Bruce Evans [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.

8 years agoPrint both the kernel read and write translation in DDB when asking for
Andrew Turner [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

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

8 years agoProperly use MACHINE_CPUARCH for finding cloudabi*_sysvec.c.
Ed Schouten [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

8 years agoiwm: add 'command accepted' debug notification (copied from wpi(4)).
Andriy Voskoboinyk [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.

8 years agoRemove warning on struct-overflow on gcc 5.3.0 as zic(8) dies on it
Baptiste Daroussin [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

8 years agoImplement siba(4) support for bhnd_(read|write)_config.
Landon J. Fuller [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)

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

MFC after: 2 weeks

8 years agoTemporarily disable two libarchive tests that have not yet been fixed by
Martin Matuska [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

8 years agocxgbe(4): Provide more details about the card in the sysctl MIB.
Navdeep Parhar [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

8 years agobhnd(4): Include the chip model (e.g. BCM4xxx) in bhnd(4) bus's device
Landon J. Fuller [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

8 years ago[mips/broadcom]: Replace static frequency table with generic PMU clock
Landon J. Fuller [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

8 years agobhnd(4): Initial PMU/PWRCTL power and clock management support.
Landon J. Fuller [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

8 years agoMFV r304866:
Martin Matuska [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

8 years agoUpdate vendor/libarchive to git 299c6bf136b9bc328b498505f24f87e732b73ff6
Martin Matuska [Fri, 26 Aug 2016 22:02:37 +0000 (22:02 +0000)]
Update vendor/libarchive to git 299c6bf136b9bc328b498505f24f87e732b73ff6

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: Be more careful about extra_length

8 years agoImprove compatibility of calls to dirname() on constant strings.
Ed Schouten [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!)

8 years ago[mips/broadcom] Generic platform_reset() support.
Landon J. Fuller [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

8 years agoEnable I/O MMU when PCI pass through is first used.
John Baldwin [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

8 years agoAdjust TCP module fastpath after r304803's cc_ack_received() changes.
Hiren Panchasara [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

8 years agoUpdate TCPS_HAVERCVDFIN() macro to correctly include all states a connection
Hiren Panchasara [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

8 years agocxgbe/iw_cxgbe: Various fixes to the iWARP driver.
Navdeep Parhar [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

8 years agoUnused variables and cstyle fix for loader dosfs
Toomas Soome [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

8 years agoDo not free an uninitialized pointer on soaccept failure in the iWARP
Navdeep Parhar [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

8 years agoFix a bug, where no SACK is sent when receiving a FORWARD-TSN or
Michael 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

8 years agohyperv/hn: Use vmbus xact for RNDIS set.
Sepherosa Ziehau [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