]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agocxgbe(4): Rename the debug_flags driver tunable/sysctl to dflags.
np [Sun, 11 Sep 2016 18:05:37 +0000 (18:05 +0000)]
cxgbe(4): Rename the debug_flags driver tunable/sysctl to dflags.
Tunables that end with _flags are special.

Sponsored by: Chelsio Communications

7 years agocxgbe(4): Deal with the slightly different SGE_STAT_CFG in T6.
np [Sun, 11 Sep 2016 17:57:53 +0000 (17:57 +0000)]
cxgbe(4): Deal with the slightly different SGE_STAT_CFG in T6.

Sponsored by: Chelsio Communications

7 years agocxgbe(4): Use smaller min/max bursts for fl descriptors with a T6.
np [Sun, 11 Sep 2016 17:51:17 +0000 (17:51 +0000)]
cxgbe(4): Use smaller min/max bursts for fl descriptors with a T6.

Sponsored by: Chelsio Communications

7 years agoMFV r268120:
allanjude [Sun, 11 Sep 2016 17:48:06 +0000 (17:48 +0000)]
MFV r268120:
  4936 lz4 could theoretically overflow a pointer with a certain input

  illumos/illumos-gate@58d0718061c87e3d647c891ec5281b93c08dba4e

Reviewed by: delphij
MFC after: 2 weeks
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D7850

7 years agoMark libifconfig as private until the API/ABI is stable
allanjude [Sun, 11 Sep 2016 17:44:35 +0000 (17:44 +0000)]
Mark libifconfig as private until the API/ABI is stable

libifconfig is still experimental and under active development.
To avoid making any ABI promises, mark the library as private

Suggested by: bapt
Reviewed by: kp

7 years agocxgbe(4): Update the pad_boundary calculation for T6, which has a
np [Sun, 11 Sep 2016 17:22:54 +0000 (17:22 +0000)]
cxgbe(4): Update the pad_boundary calculation for T6, which has a
different range of boundaries.

Sponsored by: Chelsio Communications

7 years agocxgbe(4): Use correct macro for header length with T6 ASICs. This
np [Sun, 11 Sep 2016 16:11:51 +0000 (16:11 +0000)]
cxgbe(4): Use correct macro for header length with T6 ASICs.  This
affects the transmit of the VF driver only.

Sponsored by: Chelsio Communications

7 years agocxgbe(4): Set up fl_starve_threshold2 accurately for T6.
np [Sun, 11 Sep 2016 16:06:17 +0000 (16:06 +0000)]
cxgbe(4): Set up fl_starve_threshold2 accurately for T6.

Sponsored by: Chelsio Communications

7 years agoAdd FPU_KERN_NOCTX flag to the fpu_kern_enter() function on amd64.
kib [Sun, 11 Sep 2016 09:14:07 +0000 (09:14 +0000)]
Add FPU_KERN_NOCTX flag to the fpu_kern_enter() function on amd64.

The flag specifies that the block which uses FPU must be executed in
critical section, i.e. take no context switches, and does not need an
FPU save area during the execution.

It is intended to be applied around fast and short code pathes where
save area allocation is impossible or undesirable, due to context or
due to the relative cost of calculation vs. allocation.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agocap_enter.2: describe flag returned by cap_getmode
emaste [Sun, 11 Sep 2016 01:11:47 +0000 (01:11 +0000)]
cap_enter.2: describe flag returned by cap_getmode

Previously the flag returned by cap_getmode was not described explicitly
in the man page.

Reviewed by: wblock
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7822

7 years agoa10_mmc: Remove completly the PIO code now all access is done by DMA.
manu [Sat, 10 Sep 2016 17:45:35 +0000 (17:45 +0000)]
a10_mmc: Remove completly the PIO code now all access is done by DMA.
Rename registers as in the manual.
Do a hard reset of the controller before a soft one.
Since DMA is always used remove dependancy on allwinner_soc_family, it was used
to differentiate SoC as the fdt compatible string were the same.

Tested on A10, A20, H3 and A64.

Reviewed by: jmcneill
Differential Revision: https://reviews.freebsd.org/D6868

7 years agoVarious changes to pmap_ts_referenced()
alc [Sat, 10 Sep 2016 16:49:25 +0000 (16:49 +0000)]
Various changes to pmap_ts_referenced()

Move PMAP_TS_REFERENCED_MAX out of the various pmap implementations and
into vm/pmap.h, and describe what its purpose is.  Eliminate the archaic
"XXX" comment about its value.  I don't believe that its exact value, e.g.,
5 versus 6, matters.

Update the arm64 and riscv pmap implementations of pmap_ts_referenced()
to opportunistically update the page's dirty field.

On amd64, use the PDE value already cached in a local variable rather than
dereferencing a pointer again and again.

Reviewed by: kib, markj
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D7836

7 years agocache: improve scalability by introducing bucket locks
mjg [Sat, 10 Sep 2016 16:29:53 +0000 (16:29 +0000)]
cache: improve scalability by introducing bucket locks

An array of bucket locks is added.

All modifications still require the global cache_lock to be held for
writing. However, most readers only need the relevant bucket lock and in
effect can run concurrently to the writer as long as they use a
different lock. See the added comment for more details.

This is an intermediate step towards removal of the global lock.

Reviewed by: kib
Tested by: pho

7 years agoSwitch random_get_pseudo_bytes() shim to arc4rand().
mav [Sat, 10 Sep 2016 09:37:41 +0000 (09:37 +0000)]
Switch random_get_pseudo_bytes() shim to arc4rand().

Our shim for Solaris random_get_bytes() uses read_random(), that looks
reasonable, since it guaranties reliably seeded random data.  On the other
side Solaris random_get_pseudo_bytes() does not provide this guarantie,
and its original Solaris implementation is equivalent to our arc4rand(),
using software crypto without stressing slower hardware RNG.

7 years agoFix build
kib [Sat, 10 Sep 2016 09:00:12 +0000 (09:00 +0000)]
Fix build

7 years agoAdd ehci to the MPC85XX build
jhibbits [Sat, 10 Sep 2016 01:09:58 +0000 (01:09 +0000)]
Add ehci to the MPC85XX build

Many QorIQ and MPC85xx SoCs have USB support, so add it to the kernel.

MFC after: 1 week

7 years agowait: Do not copyout uninitialized status/rusage/wrusage.
jilles [Fri, 9 Sep 2016 21:58:48 +0000 (21:58 +0000)]
wait: Do not copyout uninitialized status/rusage/wrusage.

If wait4() or wait6() return 0 because of WNOHANG, the status, rusage and
wrusage information should not be returned.

PR: 212048
Reported by: Casey Lucas
MFC after: 2 weeks

7 years agolocks: add backoff for spin mutexes and thread lock
mjg [Fri, 9 Sep 2016 19:13:02 +0000 (19:13 +0000)]
locks: add backoff for spin mutexes and thread lock

Reviewed by: jhb

7 years agoFix regression from r304644 which could cause .WAITs in SUBDIR to be ignored.
bdrewery [Fri, 9 Sep 2016 18:49:45 +0000 (18:49 +0000)]
Fix regression from r304644 which could cause .WAITs in SUBDIR to be ignored.

This was possible if a STANDALONE_SUBDIR_TARGET item came in
SUBDIR_TARGETS before 'all', which would then cause SUBDIR to
have all .WAIT's removed.

Sponsored by: Dell EMC Isilon

7 years agoANSIfy uipc_syscalls.c
emaste [Fri, 9 Sep 2016 17:40:26 +0000 (17:40 +0000)]
ANSIfy uipc_syscalls.c

Reviewed by: kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7839

7 years agocxgbe(4): Avoid a NULL dereference in the clearstats ioctl handler.
np [Fri, 9 Sep 2016 17:15:16 +0000 (17:15 +0000)]
cxgbe(4): Avoid a NULL dereference in the clearstats ioctl handler.
Port softc's are not initialized when the adapter is in recovery mode.

7 years agoFix spelling in comment.
brooks [Fri, 9 Sep 2016 16:18:44 +0000 (16:18 +0000)]
Fix spelling in comment.

Submitted by: brueffer

7 years agoPass the trap type and code down from db_trap() to db_stop_at_pc() so
bde [Fri, 9 Sep 2016 15:53:42 +0000 (15:53 +0000)]
Pass the trap type and code down from db_trap() to db_stop_at_pc() so
that the latter can easily determine what the trap type actually is
after callers are fixed to encode the type unambigously.

ddb currently barely understands breakpoints, and it treats all
non-breakpoints as single-step traps.  This works OK for stopping
after every instruction when single-stepping, but is broken for
single-stepping with a count > 1 (especially with a large count).
ddb needs to stop on the first non-single-step trap while single-
stepping.  Otherwise, ddb doesn't even stop the first time for
fatal traps and external breakpoints like the one in kdb_enter().

7 years agoAdd support for SMP on MIPS Malta platform.
br [Fri, 9 Sep 2016 14:50:44 +0000 (14:50 +0000)]
Add support for SMP on MIPS Malta platform.
Tested in QEMU on Malta32, Malta64.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5

7 years agoFix stopping when the specified breakpoint count is reached. The
bde [Fri, 9 Sep 2016 14:09:50 +0000 (14:09 +0000)]
Fix stopping when the specified breakpoint count is reached.  The
countdown was done correctly, but the action when the count was not
reduced to 0 was to fall through to generic code which almost always
stopped.

7 years agoGive the full syntax of the 'count' arg for all commmands that support
bde [Fri, 9 Sep 2016 13:23:07 +0000 (13:23 +0000)]
Give the full syntax of the 'count' arg for all commmands that support
it.  This arg is most interesting for the 'break' command where it
never worked, and for the step command where it is powerful but too
fragile to use much.

Give the full syntax of the 'addr' arg for these commands and some
others.  Rename it from 'address' for the generic command.

Fix description of how 'count' is supposed to work for the 'break'
command.

Don't (mis)describe the syntax of the comma for the 'step' command.

Expand the description for the generic command.

Give the full syntax for the 'examine' command.  It was also missing
the possible values for the modifier.

Fix mdoc syntax error for the 'search' command.

Remove FUD about consequences of not having a trap handler for the
'search' command.

7 years agonullfs: plug vnode ref leak in null_vptocnp
mjg [Fri, 9 Sep 2016 10:40:55 +0000 (10:40 +0000)]
nullfs: plug vnode ref leak in null_vptocnp

The lower vnode is already referenced and nodeget is supposed to consume
the reference. Thus the extra vref call was causing a leak.

Reported by: pho
Reviewed by: kib
MFC after: 1 week

7 years agocxgbe(4): Do not prescreen frames before attempting LRO.
np [Fri, 9 Sep 2016 07:34:14 +0000 (07:34 +0000)]
cxgbe(4): Do not prescreen frames before attempting LRO.

Sponsored by: Chelsio Communications

7 years agoProperly patch up dirname()/basename() calls to not clobber ent->log.
ed [Fri, 9 Sep 2016 07:10:50 +0000 (07:10 +0000)]
Properly patch up dirname()/basename() calls to not clobber ent->log.

It turns out that we had a couple of more calls to dirname()/basename()
in newsyslog(8) that assume the input isn't clobbered. This is bad,
because it apparently breaks log rotation now that the new dirname()
implementation has been merged.

Fix this by first copying the input and then calling
dirname()/basename(). While there, improve the naming of variables in
this function a bit.

Reported by: Ryan Steinmetz, gjb
Reviewed by: bdrewery, allanjude
Differential Revision: https://reviews.freebsd.org/D7838

7 years ago[gpio] include intr.h when building with INTRNG.
adrian [Fri, 9 Sep 2016 04:54:41 +0000 (04:54 +0000)]
[gpio] include intr.h when building with INTRNG.

Trying to build a MIPS platform that uses INTRNG needs this
for this to work right in gpiobusvar.h :

#ifdef INTRNG
struct intr_map_data_gpio {
        struct intr_map_data    hdr;
...
};
#endif

7 years ago[net80211] add in ToA/ToD based location mbuf tags for some experimenting.
adrian [Fri, 9 Sep 2016 04:47:48 +0000 (04:47 +0000)]
[net80211] add in ToA/ToD based location mbuf tags for some experimenting.

7 years ago[ath_hal] fixes for finer grain timestamping, some 11n macros
adrian [Fri, 9 Sep 2016 04:45:25 +0000 (04:45 +0000)]
[ath_hal] fixes for finer grain timestamping, some 11n macros

* change the HT_RC_2_MCS to do MCS0..23
* Use it when looking up the ht20/ht40 array for bits-per-symbol
* add a clk_to_psec (picoseconds) routine, so we can get sub-microsecond
  accuracy for the math
* .. and make that + clk_to_usec public, so higher layer code that is
  returning clocks (eg the ANI diag routines, some upcoming locationing
  experiments) can be converted to microseconds.

Whilst here, add a comment in ar5416 so i or someone else can revisit the
latency values.

7 years agoCorrect the type of db_cmd_loop_done.
jhibbits [Fri, 9 Sep 2016 04:16:53 +0000 (04:16 +0000)]
Correct the type of db_cmd_loop_done.

On big endian hardware that uses 1 byte bool a type mismatch of bool vs int will
cause the least signifcant byte of db_cmd_loop_done to be set, but the MSB to be
read, and read as 0.  This causes ddb to stay in an infinite loop.

MFC after: 1 week

7 years agoMissed part of patch
sjg [Fri, 9 Sep 2016 02:02:13 +0000 (02:02 +0000)]
Missed part of patch

7 years agoUpdate to latest dirdeps.mk
sjg [Fri, 9 Sep 2016 01:21:35 +0000 (01:21 +0000)]
Update to latest dirdeps.mk

Take advantage of new bmake feature to only consider Makefile.depend
as invalidating DIRDEPS_CACHE.

When bootstrapping allow more filtering via .MAKE.DEPENDFILE_BOOTSTRAP_SED

Move some comments back to where they make sense.

meta.sys.mk: add META_COOKIE_TOUCH and META_NOPHONY to better handle some
targets in meta mode vs non-meta mode.
Also use .MAKE.META.IGNORE_PATHS to ignore mtime of makefiles - which do
not matter in meta mode.

7 years agoUpdate to bmake-20170818
sjg [Fri, 9 Sep 2016 01:09:39 +0000 (01:09 +0000)]
Update to bmake-20170818

This version has some new knobs for dealing with troublesome targets
in meta mode.

7 years agoReduce duplicate NOASM and PSEUDO definitions
brooks [Thu, 8 Sep 2016 22:38:20 +0000 (22:38 +0000)]
Reduce duplicate NOASM and PSEUDO definitions

The initial value of NOASM is nearly the same in all cases and the
initial value of PSEUDO is the same in all cases so reduce duplication
(and hopefully, future merge conflicts) by machine independent defaults.

Also document the PSEUDO variable.

Reviewed by: jhb, kib
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D7820

7 years agoAdd new directories added in r305626 to fix "make installworld".
jkim [Thu, 8 Sep 2016 21:59:34 +0000 (21:59 +0000)]
Add new directories added in r305626 to fix "make installworld".

7 years agointro(2),_exit(2): Update for reaper (procctl(PROC_REAP_ACQUIRE)).
jilles [Thu, 8 Sep 2016 21:50:03 +0000 (21:50 +0000)]
intro(2),_exit(2): Update for reaper (procctl(PROC_REAP_ACQUIRE)).

MFC after: 1 week

7 years agoqueue(3): Enhance queue debugging macros
cem [Thu, 8 Sep 2016 21:20:01 +0000 (21:20 +0000)]
queue(3): Enhance queue debugging macros

Split the QUEUE_MACRO_DEBUG into QUEUE_MACRO_DEBUG_TRACE and
QUEUE_MACRO_DEBUG_TRASH.

Add the debug macrso QMD_IS_TRASHED() and QMD_SLIST_CHECK_PREVPTR().

Document these in queue.3.

Reviewed by: emaste
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D3984

7 years agoMove libcasper tests from regression/capsicum/libcasper/ to
oshogbo [Thu, 8 Sep 2016 20:01:26 +0000 (20:01 +0000)]
Move libcasper tests from regression/capsicum/libcasper/ to
lib/libcasper/service/${service_name}/tests.

Reviewed by: emaste, ngie
Differential Revision: https://reviews.freebsd.org/D7759

7 years agoDon't check aq64_minfree which is unsigned for negative values.
jhb [Thu, 8 Sep 2016 19:47:57 +0000 (19:47 +0000)]
Don't check aq64_minfree which is unsigned for negative values.

This fixes a tautological comparison warning.

Reviewed by: rwatson
Differential Revision: https://reviews.freebsd.org/D7682

7 years agoDocument PCI_HP and PCI_IOV kernel options and various tunables in pci(4).
jhb [Thu, 8 Sep 2016 19:42:49 +0000 (19:42 +0000)]
Document PCI_HP and PCI_IOV kernel options and various tunables in pci(4).

Describe PCI-related kernel options for HotPlug and SR-IOV support in the
pci(4) manual page.  While here, add a section describing the various
tunables supported by the PCI bus driver as well.

Reviewed by: wblock
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D7754

7 years agoSprinkle DOINGASYNC() checks so as to do delayed writes for async
bde [Thu, 8 Sep 2016 17:40:40 +0000 (17:40 +0000)]
Sprinkle DOINGASYNC() checks so as to do delayed writes for async
mounts in almost all cases instead of in most cases.  Don't override
DOINGASYNC() by any condition except IO_SYNC.

Fix previous sprinking of DOINGASYNC() checks.  Don't override IO_SYNC
by DOINGASYNC().  In ffs_write() and ffs_extwrite(), there were
intentional overrides that just broke O_SYNC of data.  In
ffs_truncate(), there are 5 calls to ffs_update(), 4 with
apparently-unintentional overrides and 1 without; this had no effect
due to the main async mount hack descibed below.

Fix 1 place in ffs_truncate() where the caller's IO_ASYNC was overridden
for the soft updates case too (to do a delayed write instead of a sync
write).  This is supposed to be the only change that affects anything
except async mounts.

In ffs_update(), remove the 19 year old efficiency hack of ignoring
the waitfor flag for async mounts, so that fsync() almost works for
async mounts.  All callers are supposed to be fixed to not ask for a
sync update unless they are for fsync() or [I]O_SYNC operations.
fsync() now almost works for async mounts.  It used to sync the data
but not the most important metdata (the inode).  It still doesn't sync
associated directories.

This gave 10-20% fewer writes for my makeworld benchmark with async
mounted tmp and obj directories from an already small number.

Style fixes:
- in ffs_balloc.c, remove rotted quadruplicated comments about the
  simplest part of the DOING*() decisions and rearrange the nearly-
  quadruplicated code to be more nearly so.
- in ufs_vnops.c, use a consistent style with less negative logic and
  no manual "optimization" of || to | in DOING*() expressions.

Reviewed by: kib (previous version)

7 years agoAllow the use of soft-interrupts for sending IPIs.
br [Thu, 8 Sep 2016 17:37:13 +0000 (17:37 +0000)]
Allow the use of soft-interrupts for sending IPIs.
This will be required for SMP support on MIPS Malta platform.

Reviewed by: adrian
Sponsored by: DARPA, AFRL
Sponsored by: HEIF5
Differential Revision: https://reviews.freebsd.org/D7835

7 years agoetcupdate: preserve the metadata of the destination file
vangyzen [Thu, 8 Sep 2016 15:53:49 +0000 (15:53 +0000)]
etcupdate: preserve the metadata of the destination file

When using diff3 to perform a three-way merge, etcupdate lost the destination
file's metadata. The metadata from the temporary file were used instead.
This was unpleasant for rc.d scripts, which require execute permission.
Use "cat >" to overwrite the destination file's contents while preserving its
metadata.

Reviewed by: bapt
Sponsored by: Dell Technologies
Differential Revision: https://reviews.freebsd.org/D7817

7 years ago- Fix typo
gabor [Thu, 8 Sep 2016 14:50:23 +0000 (14:50 +0000)]
- Fix typo

PR: 211245
Submitted by: Christoph Schonweiler <public2016@hauptsignal.at>
MFC after: 5 days

7 years agoFix single-stepping of instructions emulated by vm86.
bde [Thu, 8 Sep 2016 14:43:39 +0000 (14:43 +0000)]
Fix single-stepping of instructions emulated by vm86.

In vm86.c, fix 2 (rarely used) cases where the return code lost the
single-step indicator.  While here, fix 2 misspellings of PSL_T as
PSL_TF (TF is the CPU manufacturer's spelling, but we use T).

In trap.c, turn T_PROTFLT and T_STKFLT into T_TRCTRAP if
vm86_emulate() asked for this (it does this when the instruction is
being traced and was successully emulated).  In the kernel case, we
used to deliver the trap as SIGTRAP to the process, where it always
terminated the process; now we deliver the trap as T_TRCTRAP to kdb,
where it normally gives single-stepping.  In the user case, the only
difference is that we now clear PSL_T and initialize ucode properly.

Reviewed by: kib

7 years agoUpdate capabilities.conf comment
emaste [Thu, 8 Sep 2016 14:04:04 +0000 (14:04 +0000)]
Update capabilities.conf comment

getdtablesize is per-process state, not global state

7 years agoDon't report to devd statuses that CAM doesn't consider errors.
mav [Thu, 8 Sep 2016 13:33:33 +0000 (13:33 +0000)]
Don't report to devd statuses that CAM doesn't consider errors.

Some statuses, such as "ATA pass through information available", are part
part of absolutely normal operation and do not worth reporting.

MFC after: 2 weeks

7 years ago"Extended copy information available" is not an error either.
mav [Thu, 8 Sep 2016 13:03:49 +0000 (13:03 +0000)]
"Extended copy information available" is not an error either.

MFC after: 2 weeks

7 years ago"ATA pass through information available" is not an error.
mav [Thu, 8 Sep 2016 12:58:33 +0000 (12:58 +0000)]
"ATA pass through information available" is not an error.

MFC after: 2 weeks

7 years agoTrap msr/mrs instructions. These are privileged arm64 instructions and
andrew [Thu, 8 Sep 2016 12:53:01 +0000 (12:53 +0000)]
Trap msr/mrs instructions. These are privileged arm64 instructions and
shouldn't normally be used.

Obtained from: ABT Systems Ltd
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

7 years agointpm: make sure to register smbus driver before intpm driver
avg [Thu, 8 Sep 2016 12:43:24 +0000 (12:43 +0000)]
intpm: make sure to register smbus driver before intpm driver

Otherwise we can fail to create an smbus child of intpm.

MFC after: 1 week

7 years agoDon't panic when we don't handle a userland exception, not all we may see
andrew [Thu, 8 Sep 2016 12:39:03 +0000 (12:39 +0000)]
Don't panic when we don't handle a userland exception, not all we may see
are currently handled.

Obtained from: ABT Systems Ltd
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

7 years agointpm: better clean up resources after a failed attachment
avg [Thu, 8 Sep 2016 12:27:34 +0000 (12:27 +0000)]
intpm: better clean up resources after a failed attachment

bus_generic_detach() fails when called from attach method
thus preventing further clean up actions.

MFC after: 1 week

7 years agointpm: do not try attaching to unsupported controller revisions
avg [Thu, 8 Sep 2016 12:24:46 +0000 (12:24 +0000)]
intpm: do not try attaching to unsupported controller revisions

While there set a different device description for the controllers
found in various FCHs (Hudson, Bolton, CPU integrated).

MFC after: 1 week

7 years agointpm: fix attachment to supported AMD FCHs
avg [Thu, 8 Sep 2016 12:12:39 +0000 (12:12 +0000)]
intpm: fix attachment to supported AMD FCHs

7 years agoOn rename, do not perform truncation of dirhash if the vnode
kib [Thu, 8 Sep 2016 12:09:34 +0000 (12:09 +0000)]
On rename, do not perform truncation of dirhash if the vnode
truncation failed.

Doing so resulted in inconsistent state of the ufs dirhash with regard
to the actual directory inode state, and could lead to spurious ENOENT
errors for lookups of existing files in production kernels, or
assertion failures in the debugging kernels.

Change the logic of calling ufsdirhash_dirtrunc() to be same as in
ufs_direnter().  Execute UFS_TRUNCATE() first, log error, and only do
dirtrunc() if UFS_TRUNCATE() succeeded.

Note that the problem was exacerbated by the bug in the
flush_newblk_dep() function (see r305599), which caused in the spurios
errors from ffs_sync() and then ffs_truncate().

In collaboration with: pho
Reviewed by: mckusick
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agoamdsbwd.4: update supported hardware list
avg [Thu, 8 Sep 2016 12:09:13 +0000 (12:09 +0000)]
amdsbwd.4: update supported hardware list

And place it into its own section.

MFC after: 1 week

7 years agoDo not leak transient ENOLCK error from flush_newblk_dep() loop.
kib [Thu, 8 Sep 2016 12:08:54 +0000 (12:08 +0000)]
Do not leak transient ENOLCK error from flush_newblk_dep() loop.

The buffer lock is retried on failed LK_SLEEPFAIL attempt, and error
from the failed attempt is irrelevant.  But since there is path after
retry which does not clear error, it is possible to return spurious
error from the function.

The issue resulted in a spurious failure of softdep_sync_buf(),
causing further spurious failure of ffs_sync().

In collaboration with: pho
Reviewed by: mckusick
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agoWhen logging unlikely UFS_TRUNCATE() failure in ufs_direnter(),
kib [Thu, 8 Sep 2016 12:08:08 +0000 (12:08 +0000)]
When logging unlikely UFS_TRUNCATE() failure in ufs_direnter(),
include error code.

Reported and tested by: pho
Reviewed by: mckusick
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agoWhen externding directory inode in ufs_direnter(), adjust i_endoff.
kib [Thu, 8 Sep 2016 12:07:25 +0000 (12:07 +0000)]
When externding directory inode in ufs_direnter(), adjust i_endoff.

This change is formally not needed, since i_endoff not used in all
code paths after the call to ufs_direnter(), and i_endoff is
recalculated by the next lookup.  But having the value correct makes
the reasoning about code simpler.

Reported and tested by: pho
Reviewed by: mckusick
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agointpm.4 update supported hardware list
avg [Thu, 8 Sep 2016 12:07:25 +0000 (12:07 +0000)]
intpm.4 update supported hardware list

MFC after: 1 week

7 years agoIn dqsync(), when called from quotactl(), um_quotas entry might appear
kib [Thu, 8 Sep 2016 12:06:43 +0000 (12:06 +0000)]
In dqsync(), when called from quotactl(), um_quotas entry might appear
cleared since nothing prevents completion of the parallel quotaoff.
There is nothing to sync in this case, and no reason to panic.

Reported and tested by: pho
Reviewed by: mckusick
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agoIn softdep_prealloc(), return early not only for snapshots, but for
kib [Thu, 8 Sep 2016 12:05:13 +0000 (12:05 +0000)]
In softdep_prealloc(), return early not only for snapshots, but for
the quota files as well.

Reported and tested by: pho
Reviewed by: mckusick
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agoThere is no need to upgrade the last dvp lock on lookups for modifying
kib [Thu, 8 Sep 2016 12:04:45 +0000 (12:04 +0000)]
There is no need to upgrade the last dvp lock on lookups for modifying
operations.  Instead of upgrading, assert that the lock is exclusive.
Explain the cause in comments.

This effectively reverts r209367.

Tested by: pho
Reviewed by: mckusick
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agoPartially lift suspension when ffs_reload() finished with cgs and
kib [Thu, 8 Sep 2016 12:01:28 +0000 (12:01 +0000)]
Partially lift suspension when ffs_reload() finished with cgs and
going to re-read inodes.

Secondary write initiators, e.g. ufs_inactive(), might need to start a
write while owning the vnode lock.  Since the suspended state
established by /dev/ufssuspend prevents them from entering
vn_start_secondary_write(), we get deadlock otherwise.

Note that it is arguably not very useful to re-read inodes after
/dev/ufssuspend suspension, because the suspension does not block
readers, and other threads might read existing files in parallel with
suspension owner (for now, only growfs(8)) operations.  This
effectively means that suspension owner cannot safely modify existing
inodes, and then there is no sense in re-reading.  But keep the code
enabled for now.

Reported and tested by: pho
Reviewed by: mckusick
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agoDecode ATA Status Return descriptor.
mav [Thu, 8 Sep 2016 12:00:02 +0000 (12:00 +0000)]
Decode ATA Status Return descriptor.

MFC after: 2 weeks

7 years agoCorrectly map the USB mouse tilt delta values into buttons 5 and 6
hselasky [Thu, 8 Sep 2016 10:10:05 +0000 (10:10 +0000)]
Correctly map the USB mouse tilt delta values into buttons 5 and 6
instead of 3 and 4 which is used for the scroll wheel, according to
X.org.

PR: 170358
MFC after: 1 week

7 years agopxeboot: Add nfs.read_size tunable.
sephe [Thu, 8 Sep 2016 09:11:13 +0000 (09:11 +0000)]
pxeboot: Add nfs.read_size tunable.

Increase this tunable improves kernel loading speed.

Submitted by: Jun Su <junsu microsoft com>
Reviewed by: rpokala, wblock (previous version)
Obtained from: DragonFlyBSD
MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7756

7 years agohyperv/hn: Factor out NVS NDIS initialization
sephe [Thu, 8 Sep 2016 07:45:20 +0000 (07:45 +0000)]
hyperv/hn: Factor out NVS NDIS initialization

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

7 years agohyperv/hn: Function renaming.
sephe [Thu, 8 Sep 2016 07:34:31 +0000 (07:34 +0000)]
hyperv/hn: Function renaming.

While I'm here, remove obvious comment.

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

7 years agohyperv/kvp: Fix IPv4/IPv6 address injection support.
sephe [Thu, 8 Sep 2016 07:16:56 +0000 (07:16 +0000)]
hyperv/kvp: Fix IPv4/IPv6 address injection support.

The GUID string provided by hypervisor has leading and trailing braces,
while our GUID string does not have braces at all.  Both braces should
be ignored, when the GUID strings are compared.

Submitted by: Hongjiang Zhang <honzhan microsoft com>
Modified by: sephe
MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7809

7 years agohyperv/hn: Pass MTU around.
sephe [Thu, 8 Sep 2016 06:42:30 +0000 (06:42 +0000)]
hyperv/hn: Pass MTU around.

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

7 years agohyperv/hn: Factor out function to do NVS initialization.
sephe [Thu, 8 Sep 2016 06:23:08 +0000 (06:23 +0000)]
hyperv/hn: Factor out function to do NVS initialization.

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

7 years agohyperv/hn: Push RXBUF size adjustment down.
sephe [Thu, 8 Sep 2016 06:06:54 +0000 (06:06 +0000)]
hyperv/hn: Push RXBUF size adjustment down.

It is not used in other places.

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

7 years agohyperv/hn: Pull vmbus channel open up.
sephe [Thu, 8 Sep 2016 05:27:43 +0000 (05:27 +0000)]
hyperv/hn: Pull vmbus channel open up.

While I'm here, pull up the channel callback related code too.

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

7 years agoFix typo in skein amd64 assembly
allanjude [Thu, 8 Sep 2016 02:38:55 +0000 (02:38 +0000)]
Fix typo in skein amd64 assembly

Sponsored by: ScaleEngine Inc.

7 years agoIn m_devget(), if the data fits in a packet header mbuf, check the amount
kevlo [Thu, 8 Sep 2016 01:02:53 +0000 (01:02 +0000)]
In m_devget(), if the data fits in a packet header mbuf, check the amount
of data is less than or equal to MHLEN instead of MLEN when placing initial
small packet header at end of mbuf.

Reviewed by: glebius
MFC after: 3 days

7 years agoRemove a pointless translation of struct ioc_toc_header.
brooks [Thu, 8 Sep 2016 00:38:50 +0000 (00:38 +0000)]
Remove a pointless translation of struct ioc_toc_header.

struct ioc_toc_header will be the same size (and thus IOREADTOCHEADER
will have the same value on all supported platforms).

Sponsored by: DARPA, AFRL

7 years agoFix an obvious typo.
jkim [Wed, 7 Sep 2016 23:37:10 +0000 (23:37 +0000)]
Fix an obvious typo.

7 years agoSuffix short month names with "월" and replace %b with %_m for date formats.
jkim [Wed, 7 Sep 2016 23:35:38 +0000 (23:35 +0000)]
Suffix short month names with "월" and replace %b with %_m for date formats.
This change is analogous to r199179, r199271, and r289041 for japanese and
chinese locales.

7 years agoMFV r305562: 7259 DS_FIELD_LARGE_BLOCKS is unused
mav [Wed, 7 Sep 2016 20:09:24 +0000 (20:09 +0000)]
MFV r305562: 7259 DS_FIELD_LARGE_BLOCKS is unused

The DS_FIELD_LARGE_BLOCKS macro has been unused since the integration of
this patch:

    commit ca0cc3918a1789fa839194af2a9245f801a06b1a
    Author: Matthew Ahrens <mahrens@delphix.com>
    Date:   Fri Jul 24 09:53:55 2015 -0700

        5959 clean up per-dataset feature count code
        Reviewed by: Toomas Soome <tsoome@me.com>
        Reviewed by: George Wilson <george@delphix.com>
        Reviewed by: Alex Reece <alex@delphix.com>
        Approved by: Richard Lowe <richlowe@richlowe.net>

This patch simply removes this macro from dsl_dataset.h.

Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Dan McDonald <danmcd@omniti.com>
Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Author: Matthew Ahrens <mahrens@delphix.com>

7 years agoMFV r305560: 7278 tuning zfs_arc_max does not impact arc_c_min
mav [Wed, 7 Sep 2016 20:05:10 +0000 (20:05 +0000)]
MFV r305560: 7278 tuning zfs_arc_max does not impact arc_c_min

When changing zfs_arc_max (e.g. as zdb does), it may be set to less
than the default arc_c_min. arc_c_min should decrease to not be more than
arc_c_max, but it doesn't; therefore tuning of arc_c_max is ineffective.

Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Paul Dagnelie <paul.dagnelie@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Author: Matthew Ahrens <mahrens@delphix.com>

openzfs/openzfs@608764beadaf4bb71c5d8fe1818e8392ac66a61b

7 years agoChelsio T4/T5 VF driver.
jhb [Wed, 7 Sep 2016 18:13:57 +0000 (18:13 +0000)]
Chelsio T4/T5 VF driver.

The cxgbev/cxlv driver supports Virtual Function devices for Chelsio
T4 and T4 adapters.  The VF devices share most of their code with the
existing PF4 driver (cxgbe/cxl) and as such the VF device driver
currently depends on the PF4 driver.

Similar to the cxgbe/cxl drivers, the VF driver includes a t4vf/t5vf
PCI device driver that attaches to the VF device.  It then creates
child cxgbev/cxlv devices representing ports assigned to the VF.
By default, the PF driver assigns a single port to each VF.

t4vf_hw.c contains VF-specific routines from the shared code used to
fetch VF-specific parameters from the firmware.

t4_vf.c contains the VF-specific PCI device driver and includes its
own attach routine.

VF devices are required to use a different firmware request when
transmitting packets (which in turn requires a different CPL message
to encapsulate messages).  This alternate firmware request does not
permit chaining multiple packets in a single message, so each packet
results in a firmware request.  In addition, the different CPL message
requires more detailed information when enabling hardware checksums,
so parse_pkt() on VF devices must examine L2 and L3 headers for all
packets (not just TSO packets) for VF devices.  Finally, L2 checksums
on non-UDP/non-TCP packets do not work reliably (the firmware trashes
the IPv4 fragment field), so IPv4 checksums for such packets are
calculated in software.

Most of the other changes in the non-VF-specific code are to expose
various variables and functions private to the PF driver so that they
can be used by the VF driver.

Note that a limited subset of cxgbetool functions are supported on VF
devices including register dumps, scheduler classes, and clearing of
statistics.  In addition, TOE is not supported on VF devices, only for
the PF interfaces.

Reviewed by: np
MFC after: 2 months
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D7599

7 years agoDon't break out of the m_advance() loop if len drops to zero.
jhb [Wed, 7 Sep 2016 18:08:43 +0000 (18:08 +0000)]
Don't break out of the m_advance() loop if len drops to zero.

If a packet contains the Ethernet header (14 bytes) in the first mbuf
and the payload (IP + UDP + data) in the second mbuf, then the attempt
to fetch the l3hdr will return a NULL pointer.  The first loop iteration
will drop len to zero and exit the loop without setting 'p'.  However,
the desired data is at the start of the second mbuf, so the correct
behavior is to loop around and let the conditional set 'p' to m_data of
the next mbuf (and leave offset as 0).

Reviewed by: np
Sponsored by: Chelsio Communications

7 years agoWhen synchronising the instruction and data caches we only need to clean
andrew [Wed, 7 Sep 2016 16:46:54 +0000 (16:46 +0000)]
When synchronising the instruction and data caches we only need to clean
the data cache to the point of unification. This is the point where the
two caches are unified to a single unified cache so cleaning past here
is just extra unneeded work.

This was noticed when investigating r305545.

Reported by: bz
Obtained from: ABT Systems Ltd
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

7 years agoOnly call cpu_icache_sync_range when inserting an executable page. If the
andrew [Wed, 7 Sep 2016 16:22:05 +0000 (16:22 +0000)]
Only call cpu_icache_sync_range when inserting an executable page. If the
page is non-executable the contents of the i-cache are unimportant so this
call is just adding unneeded overhead when inserting pages.

While doing research using gem5 with an O3 pipeline and 1k/32k/1M iTLB/L1
iCache/L2 Bjoern Zeeb (bz@) observed a fairly high rate of calls into
arm64_icache_sync_range() from pmap_enter() along with a high number of
instruction fetches and iTLB/iCache hits.

Limiting the calls to arm64_icache_sync_range() to only executable pages,
we observe the iTLB and iCache Hit going down by about 43%. These numbers
are quite misleading when looked at alone as at the same time instructions
retired were reduced by 19.2% and instruction fetches were reduced by 38.8%.
Overall this reduced the runtime of the test program by 22.4%.

On Juno hardware, in steady-state, running the same test, using the cycle
count to determine runtime, we do see a reduction of up to 28.9% in runtime.

While these numbers certainly depend on the program executed, we expect an
overall performance improvement.

Reported by: bz
Obtained from: ABT Systems Ltd
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

7 years agorum: fix possible panic on device detach (similar to r302034).
avos [Wed, 7 Sep 2016 16:19:20 +0000 (16:19 +0000)]
rum: fix possible panic on device detach (similar to r302034).

Tested with WUSB54GC, STA/AP modes.

7 years agoo Update QEMU device tree.
br [Wed, 7 Sep 2016 15:48:44 +0000 (15:48 +0000)]
o Update QEMU device tree.

QEMU was updated to privileged architecture v1.9
and we now fully support it.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5

7 years agowork around AMD erratum 793 for family 16h, models 00h-0Fh
avg [Wed, 7 Sep 2016 14:24:29 +0000 (14:24 +0000)]
work around AMD erratum 793 for family 16h, models 00h-0Fh

7 years agoFix channel initialization in FBS mode.
mav [Wed, 7 Sep 2016 13:51:34 +0000 (13:51 +0000)]
Fix channel initialization in FBS mode.

Due to reading initialized variable, FIS receive area was always allocated
as 256 bytes, suitable for command-based switching, instead of 4096 bytes,
required for FIS-based switching.  This caused memory corruption in case of
port multipliers used on FBS-capable HBAs (Marvell).

MFC after: 1 week

7 years agoamdsbwd: add support for FCH in family 16h models 30h-3Fh processors
avg [Wed, 7 Sep 2016 13:45:35 +0000 (13:45 +0000)]
amdsbwd: add support for FCH in family 16h models 30h-3Fh processors

Requested by: Mike Tancsa <mike@sentex.net>
Tested by: Mike Tancsa <mike@sentex.net>
MFC after: 1 week

7 years agorum: use mgmt frame rate for EAPOL frames.
avos [Wed, 7 Sep 2016 12:07:02 +0000 (12:07 +0000)]
rum: use mgmt frame rate for EAPOL frames.

7 years agoFix MIPS INTRNG (both FDT and non-FDT) behaviour broken by r304459
sgalabov [Wed, 7 Sep 2016 09:31:10 +0000 (09:31 +0000)]
Fix MIPS INTRNG (both FDT and non-FDT) behaviour broken by r304459

More changes to MIPS may be required, as commented in D7692, but this
revision aims to restore MIPS INTRNG functionality so we can move on
with working interrupts.

Reported by: yamori813@yahoo.co.jp
Tested by: mizhka (on BCM), sgalabov (on Mediatek)
Reviewed by: adrian, nwhitehorn (older version)
Sponsored by: Smartcom - Bulgaria AD
Differential Revision: https://reviews.freebsd.org/D7692

7 years agohyperv/hn: Nuke unused bits
sephe [Wed, 7 Sep 2016 09:20:58 +0000 (09:20 +0000)]
hyperv/hn: Nuke unused bits

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

7 years agohyperv/hn: Simplify per-packet-info construction.
sephe [Wed, 7 Sep 2016 06:02:29 +0000 (06:02 +0000)]
hyperv/hn: Simplify per-packet-info construction.

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

7 years agohyperv/hn: Cleanup RNDIS packet message encapsulation.
sephe [Wed, 7 Sep 2016 05:41:01 +0000 (05:41 +0000)]
hyperv/hn: Cleanup RNDIS packet message encapsulation.

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

7 years agoRemove messy machdep code for Alpine V1 and use proper drivers instead
wma [Wed, 7 Sep 2016 05:36:55 +0000 (05:36 +0000)]
Remove messy machdep code for Alpine V1 and use proper drivers instead

Let drivers for Alpine CCU, NB and Serdes take care of internal SoC configuration.

Obtained from:         Semihalf
Submitted by:          Michal Stanek <mst@semihalf.com>
Sponsored by:          Annapurna Labs
Reviewed by:           imp,wma
Differential Revision: https://reviews.freebsd.org/D7566