]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoMerge ^/head r288197 through r288456.
dim [Thu, 1 Oct 2015 19:02:45 +0000 (19:02 +0000)]
Merge ^/head r288197 through r288456.

8 years agoRather than groveling around in a socket address structure for a socket
jhb [Thu, 1 Oct 2015 18:18:58 +0000 (18:18 +0000)]
Rather than groveling around in a socket address structure for a socket
address's length (and then overriding it if it "looks wrong"), use the
next argument to the system call to determine the length.  This is more
reliable since this is what the kernel depends on anyway and is also
simpler.

8 years agoThe id_t type used to pass IDs to wait6(2) and procctl(6) is a 64-bit
jhb [Thu, 1 Oct 2015 17:50:41 +0000 (17:50 +0000)]
The id_t type used to pass IDs to wait6(2) and procctl(6) is a 64-bit
integer.  Fix the argument decoding to treat this as a quad instead of an
int.  This includes using QUAD_ALIGN and QUAD_SLOTS as necessary.  To
continue printing IDs in decimal, add a new QuadHex argument type that
prints a 64-bit integer in hex, use QuadHex for the existing off_t arguments,
repurpose Quad to print a 64-bit integer in decimal, and use Quad for id_t
arguments.

This fixes the decoding of wait6(2) and procctl(2) on 32-bit platforms.

8 years ago- Remove extra integer argument from truncate() and ftruncate(). This is
jhb [Thu, 1 Oct 2015 17:28:07 +0000 (17:28 +0000)]
- Remove extra integer argument from truncate() and ftruncate().  This is
  probably fallout from the removal of the extra padding argument before
  off_t in 7.  However, that padding still exists for 32-bit powerpc, so
  use QUAD_ALIGN.
- Fix QUAD_ALIGN to be zero for powerpc64.  It should only be set to 1
  for 32-bit platforms that add padding to align 64-bit arguments.

8 years agoMost error cases in i915_gem_do_execbuffer() jump to one of two labels to
jhb [Thu, 1 Oct 2015 16:59:07 +0000 (16:59 +0000)]
Most error cases in i915_gem_do_execbuffer() jump to one of two labels to
release resources (such as unholding pages) when errors occur.  Some
recently added error checks return immediately instead of jumping to a
label resulting in leaks.  Fix these to jump to a label to do cleanup
instead.

Reviewed by: kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D3745

8 years agoEnsure that vop_stdadvise() does not call getblk() on vnodes that have an
markj [Thu, 1 Oct 2015 16:34:53 +0000 (16:34 +0000)]
Ensure that vop_stdadvise() does not call getblk() on vnodes that have an
empty bufobj. Otherwise, vnodes belonging to filesystems that do not use the
buffer cache may trigger assertion failures.

Reported by: Fabien Keil

8 years agoMake zero WUT use WRITE SAME with recently allowed NDOB flag.
mav [Thu, 1 Oct 2015 16:30:20 +0000 (16:30 +0000)]
Make zero WUT use WRITE SAME with recently allowed NDOB flag.

8 years agoImplement SPC-3 exceptions to SPC-2 RESERVE and RELEASE behavior.
mav [Thu, 1 Oct 2015 12:57:37 +0000 (12:57 +0000)]
Implement SPC-3 exceptions to SPC-2 RESERVE and RELEASE behavior.

8 years agoUnify PR variable names to reduce confusion.
mav [Thu, 1 Oct 2015 12:15:36 +0000 (12:15 +0000)]
Unify PR variable names to reduce confusion.

8 years agoAn IPI must be cleared before it is handled otherwise next IPI could be
andrew [Thu, 1 Oct 2015 12:09:05 +0000 (12:09 +0000)]
An IPI must be cleared before it is handled otherwise next IPI could be
missed. In other words, if a new request for an IPI is sent while the
previous request is being handled but the IPI is not cleared yet, the
clearing of the previous IPI request also clears the new one and the
handling is missed.

There are only three MP interrupt controllers in ARM now. Two of them are
fixed by this change, the third one is correct, probably only just by
accident. The fix is minimalistic as new interrupt framework is awaited.

It was debugged on RPi2 where missing IPI handling together with SCHED_ULE
led to situation in which tdq_ipipending was not cleared and so IPI_PREEMPT
was stopped to be sent. Various odditys were found related to slow system
response time like various events timed out, and slow console response.

Submitted by: Svatopluk Kraus <onwahe@gmail.com>
Reviewed by: loos, kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D3722

8 years agoDisable suspend when we're shutting down. This solves the "tell FreeBSD
cperciva [Thu, 1 Oct 2015 10:52:26 +0000 (10:52 +0000)]
Disable suspend when we're shutting down.  This solves the "tell FreeBSD
to shut down; close laptop lid" scenario which otherwise tended to end
with a laptop overheating or the battery dying.

The implementation uses a new sysctl, kern.suspend_blocked; init(8) sets
this while rc.suspend runs, and the ACPI sleep code ignores requests while
the sysctl is set.

Discussed on: freebsd-acpi (35 emails)
MFC after: 1 week

8 years agoUse pmap_load more consistently. While here try to only load the data once
andrew [Thu, 1 Oct 2015 10:43:40 +0000 (10:43 +0000)]
Use pmap_load more consistently. While here try to only load the data once
when we reuse the same data.

Obtained from: EuroBSDCon Devsummit
Sponsored by: ABT Systems Ltd

8 years agoPass 8 arguments to makecontext on arm64 as this is all we support.
andrew [Thu, 1 Oct 2015 09:53:12 +0000 (09:53 +0000)]
Pass 8 arguments to makecontext on arm64 as this is all we support.

Obtained from: EuroBSDCon Devsummit
Sponsored by: ABT Systems Ltd

8 years agoAdd the ENTRY/END entries around the exception handlers.
andrew [Thu, 1 Oct 2015 09:44:15 +0000 (09:44 +0000)]
Add the ENTRY/END entries around the exception handlers.

Obtained from: EuroBSDCon Devsummit
Sponsored by: ABT Systems Ltd

8 years agoAlso build ofwdump on arm64.
andrew [Thu, 1 Oct 2015 09:40:33 +0000 (09:40 +0000)]
Also build ofwdump on arm64.

Obtained from: EuroBSDCon Devsummit
Sponsored by: ABT Systems Ltd

8 years agoUpdate the arm64 ttys file to enable the correct uart based on which device
andrew [Thu, 1 Oct 2015 09:36:18 +0000 (09:36 +0000)]
Update the arm64 ttys file to enable the correct uart based on which device
the console is attached to. This makes this file identical to the 32-bit
arm version of this file.

Obtained from: EuroBSDCon devsummit
Sponsored by: ABT Systems Ltd

8 years agoFix `make depend` in sys/modules/otus
lwhsu [Thu, 1 Oct 2015 05:56:38 +0000 (05:56 +0000)]
Fix `make depend` in sys/modules/otus

Reviewed by: delphij
Approved by: delphij
Differential Revision: https://reviews.freebsd.org/D3751

8 years agoPartially revert r288433, with a minor change:
gjb [Thu, 1 Oct 2015 01:50:20 +0000 (01:50 +0000)]
Partially revert r288433, with a minor change:

Spell 'k' correctly.

Spotted by: loos (thank you!)
Sponsored by: The FreeBSD Foundation

8 years agoFix FAT_SIZE by removing '-b' argument passing, which was
gjb [Thu, 1 Oct 2015 00:34:38 +0000 (00:34 +0000)]
Fix FAT_SIZE by removing '-b' argument passing, which was
a result of my misunderstanding on what Crochet was doing
in this case for these boards.

Sponsored by: The FreeBSD Foundation

8 years agoMETA_MODE: Set HOST_CXX and HOST_CPP and chain them down into CXX/CPP for host builds.
bdrewery [Wed, 30 Sep 2015 23:14:23 +0000 (23:14 +0000)]
META_MODE: Set HOST_CXX and HOST_CPP and chain them down into CXX/CPP for host builds.

Sponsored by: EMC / Isilon Storage Division

8 years agoAs a step towards the elimination of PG_CACHED pages, rework the handling
markj [Wed, 30 Sep 2015 23:06:29 +0000 (23:06 +0000)]
As a step towards the elimination of PG_CACHED pages, rework the handling
of POSIX_FADV_DONTNEED so that it causes the backing pages to be moved to
the head of the inactive queue instead of being cached.

This affects the implementation of POSIX_FADV_NOREUSE as well, since it
works by applying POSIX_FADV_DONTNEED to file ranges after they have been
read or written.  At that point the corresponding buffers may still be
dirty, so the previous implementation would coalesce successive ranges and
apply POSIX_FADV_DONTNEED to the result, ensuring that pages backing the
dirty buffers would eventually be cached.  To preserve this behaviour in an
efficient manner, this change adds a new buf flag, B_NOREUSE, which causes
the pages backing a VMIO buf to be placed at the head of the inactive queue
when the buf is released.  POSIX_FADV_NOREUSE then works by setting this
flag in bufs that underlie the specified range.

Reviewed by: alc, kib
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D3726

8 years agowordexp: Rewrite to make WRDE_NOCMD reliable.
jilles [Wed, 30 Sep 2015 21:32:29 +0000 (21:32 +0000)]
wordexp: Rewrite to make WRDE_NOCMD reliable.

Shell syntax is too complicated to detect command substitution and unquoted
operators reliably without implementing much of sh's parser. Therefore, have
sh do this detection.

While changing sh's support anyway, also read input from a pipe instead of
arguments to avoid {ARG_MAX} limits and improve privacy, and output count
and length using 16 instead of 8 digits.

The basic concept is:
execl("/bin/sh", "sh", "-c", "freebsd_wordexp ${1:+\"$1\"} -f "$2",
    "", flags & WRDE_NOCMD ? "-p" : "", <pipe with words>);

The WRDE_BADCHAR error is still implemented in libc. POSIX requires us to
fail strings containing unquoted braces with code WRDE_BADCHAR. Since this
is normally not a syntax error in sh, there is still a need for checking
code in libc, we_check().

The new we_check() is an optimistic check that all the characters
  <newline> | & ; < > ( ) { }
are quoted. To avoid duplicating too much sh logic, such characters are
permitted when quoting characters are seen, even if the quoting characters
may themselves be quoted. This code reports all WRDE_BADCHAR errors; bad
characters that get past it and are a syntax error in sh return WRDE_SYNTAX.

Although many implementations of WRDE_NOCMD erroneously allow some command
substitutions (and ours even documented this), there appears to be code that
relies on its security (codesearch.debian.net shows quite a few uses).
Passing untrusted data to wordexp() still exposes a denial of service
possibility and a fairly large attack surface.

Reviewed by: wblock (man page only)
MFC after: 2 weeks
Relnotes: yes
Security: fixes command execution with wordexp(untrusted, WRDE_NOCMD)

8 years agoReplace most of the beforeinstall: hack with FILES mechanism.
bdrewery [Wed, 30 Sep 2015 20:47:27 +0000 (20:47 +0000)]
Replace most of the beforeinstall: hack with FILES mechanism.

This now generates the files into the OBJDIR as needed.  Some of the files
are installed directly from the src directory.  Files which are generated
from the src directory are renamed to .in to generate them and avoid
colliding with the checked-in file when CURDIR=OBJDIR.

The remaining beforeinstall: handling still needs to be reworked as it does
not work well with staging for packaging.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoMETA_MODE: Remove unneeded groff/tmac special GENDIRDEPS_FILTER.
bdrewery [Wed, 30 Sep 2015 20:40:51 +0000 (20:40 +0000)]
META_MODE: Remove unneeded groff/tmac special GENDIRDEPS_FILTER.

This is converting the path usr/share/tmac.*stage to something else, but
nothing ever installs or reads from such a path.  They might look in
stage.*usr/share/tmac, but that's not what this is matching.  Additionally
the .dirdeps match all of the tmac files back to gnu/usr.bin/groff/tmac
fine.

Sponsored by: EMC / Isilon Storage Division

8 years agoUse proper STAILQ_* macros where possible.
mav [Wed, 30 Sep 2015 20:38:35 +0000 (20:38 +0000)]
Use proper STAILQ_* macros where possible.

8 years agoSeveral changes to truss.
jhb [Wed, 30 Sep 2015 19:13:32 +0000 (19:13 +0000)]
Several changes to truss.
- Refactor the interface between the ABI-independent code and the
  ABI-specific backends.  The backends now provide smaller hooks to
  fetch system call arguments and return values.  The rest of the
  system call entry and exit handling that was previously duplicated
  among all the backends has been moved to one place.
- Merge the loop when waiting for an event with the loop for handling stops.
  This also means not emulating a procfs-like interface on top of ptrace().
  Instead, use a single event loop that fetches process events via waitid().
  Among other things this allows us to report the full 32-bit exit value.
- Use PT_FOLLOW_FORK to follow new child processes instead of forking a new
  truss process for each new child.  This allows one truss process to monitor
  a tree of processes and truss -c should now display one total for the
  entire tree instead of separate summaries per process.
- Use the recently added fields to ptrace_lwpinfo to determine the current
  system call number and argument count.  The latter is especially useful
  and fixes a regression since the conversion from procfs.  truss now
  generally prints the correct number of arguments for most system calls
  rather than printing extra arguments for any call not listed in the
  table in syscalls.c.
- Actually check the new ABI when processes call exec.  The comments claimed
  that this happened but it was not being done (perhaps this was another
  regression in the conversion to ptrace()).  If the new ABI after exec
  is not supported, truss detaches from the process.  If truss does not
  support the ABI for a newly executed process the process is killed
  before it returns from exec.
- Along with the refactor, teach the various ABI-specific backends to
  fetch both return values, not just the first.  Use this to properly
  report the full 64-bit return value from lseek().  In addition, the
  handler for "pipe" now pulls the pair of descriptors out of the
  return values (which is the true kernel system call interface) but
  displays them as an argument (which matches the interface exported by
  libc).
- Each ABI handler adds entries to a linker set rather than requiring
  a statically defined table of handlers in main.c.
- The arm and mips system call fetching code was changed to follow the
  same pattern as amd64 (and the in-kernel handler) of fetching register
  arguments first and then reading any remaining arguments from the
  stack.  This should fix indirect system call arguments on at least
  arm.
- The mipsn32 and n64 ABIs will now look for arguments in A4 through A7.
- Use register %ebp for the 6th system call argument for Linux/i386 ABIs
  to match the in-kernel argument fetch code.
- For powerpc binaries on a powerpc64 system, fetch the extra arguments
  on the stack as 32-bit values that are then copied into the 64-bit
  argument array instead of reading the 32-bit values directly into the
  64-bit array.

Reviewed by: kib (earlier version)
Tested on: amd64 (FreeBSD/amd64 & i386), i386, arm (earlier version)
Tested on: powerpc64 (FreeBSD/powerpc64 & powerpc)
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D3575

8 years agoSkip the B_flag testcase to stop blowing up freebsd-current@ with
ngie [Wed, 30 Sep 2015 17:43:02 +0000 (17:43 +0000)]
Skip the B_flag testcase to stop blowing up freebsd-current@ with
"test failure emails" because kyua report-jenkins doesn't properly
escape non-printable chars

8 years agoInitial attempt to add support for building images for
gjb [Wed, 30 Sep 2015 16:31:21 +0000 (16:31 +0000)]
Initial attempt to add support for building images for
BANANAPI, CUBIEBOARD, and CUBIEBOARD2 SoCs.

Obtained from: Crochet, FreeBSD/arm/Allwinner Wiki page
Sponsored by: The FreeBSD Foundation

8 years agoMake pass, sg and targ drivers respect HBA's maxio.
mav [Wed, 30 Sep 2015 13:31:37 +0000 (13:31 +0000)]
Make pass, sg and targ drivers respect HBA's maxio.

Previous limitation of 64K (DFLTPHYS) is quite annoying.

8 years agoJoin excessive split lines.
brueffer [Wed, 30 Sep 2015 12:40:51 +0000 (12:40 +0000)]
Join excessive split lines.

MFC after: 1 week

8 years agoTake extra reference to security policy before calling crypto_dispatch().
ae [Wed, 30 Sep 2015 08:16:33 +0000 (08:16 +0000)]
Take extra reference to security policy before calling crypto_dispatch().

Currently we perform crypto requests for IPSEC synchronous for most of
crypto providers (software, aesni) and only VIA padlock calls crypto
callback asynchronous. In synchronous mode it is possible, that security
policy will be removed during the processing crypto request. And crypto
callback will release the last reference to SP. Then upon return into
ipsec[46]_process_packet() IPSECREQUEST_UNLOCK() will be called to already
freed request. To prevent this we will take extra reference to SP.

PR: 201876
Sponsored by: Yandex LLC

8 years agoHave lockstat(1) trace locks by name rather than by address.
markj [Wed, 30 Sep 2015 05:46:56 +0000 (05:46 +0000)]
Have lockstat(1) trace locks by name rather than by address.

Previously, lockstat(1) would use a lock's address as its identifier when
consuming data describing lock contention and hold events. After collecting
the requested data, it would use ksyms(4) to resolve lock addresses to
names. Of course, this doesn't work too well for locks contained in
dynamically-allocated memory. This change modifies lockstat(1) to trace the
lock names obtained from the base struct lock_object instead, leading to
output that is generally much more useful.

This change also removes the -c option, which is used to coalesce data for
locks in an array. It's not possible to support this option without also
tracing lock addresses, and since lock arrays in which the lock names are
distinct are not very common in FreeBSD, it's simpler to just remove the
option.

Reviewed by: avg (earlier revision)
Differential Revision: https://reviews.freebsd.org/D3661

8 years agoUpdate DTrace test makefiles after r288415.
markj [Wed, 30 Sep 2015 05:25:39 +0000 (05:25 +0000)]
Update DTrace test makefiles after r288415.

8 years agoMFV r288408:
markj [Wed, 30 Sep 2015 05:24:22 +0000 (05:24 +0000)]
MFV r288408:
6266 harden dtrace_difo_chunksize() with respect to malicious DIF

illumos/illumos-gate@395c7a3dcfc66b8b671dc4b3c4a2f0ca26449922

Reviewed by: Alex Wilson <alex.wilson@joyent.com>
Reviewed by: Dan McDonald <danmcd@omniti.com>
Approved by: Garrett D'Amore <garrett@damore.org>
Author: Bryan Cantrill <bryan@joyent.com>

MFC after: 1 week

8 years agomodify the rssi logic a bit to actually return a useful rssi.
adrian [Wed, 30 Sep 2015 05:19:16 +0000 (05:19 +0000)]
modify the rssi logic a bit to actually return a useful rssi.

The fullmac firmware doesn't seem to populate a useful rssi indicator
in the RX descriptor, so if one plotted said values, they'd basically
look like garbage.

The reference driver implements a "get current rssi" firmware command
which I guess is really meant for station operation only (as hostap
operation would need rssi per station, not a single firmware read.)

So:

* populate sc_currssi during each calibration run;
* use this in the RX path instead of trying to reconstruct the RSSI
  value and passing it around as a pointer;
* do up a quick hack to map the rssi hardware value to some useful
  signal level;
* the survey results provide an RSSI value between 0..100, so just
  do another quick hack to map it into some usefulish signal level;
* supply a faked noise floor - I haven't yet found how to pull it
  out of the firmware.

The scan results and the station RSSI information is now more useful
for indicating signal strength / distance.

8 years agoStop hard-coding a 32-bit data model for USDT tests, and just use the native
markj [Wed, 30 Sep 2015 04:48:56 +0000 (04:48 +0000)]
Stop hard-coding a 32-bit data model for USDT tests, and just use the native
model. This was causing many of the tests to fail on amd64 since USDT
support for 32-bit programs is currently non-functional.

MFC after: 1 week

8 years agoWhen processing ICMP need frag message, ignore the suggested MTU unless it
glebius [Wed, 30 Sep 2015 03:37:37 +0000 (03:37 +0000)]
When processing ICMP need frag message, ignore the suggested MTU unless it
is smaller than the current one for this connection. This is behavior
specified by RFC 1191, and this is how original BSD stack behaved, but this
was unintentionally regressed in r182851.

Reported & tested by: Richard Russo <russor whatsapp.com>
Differential Revision: D3567
Sponsored by: Nginx, Inc.

8 years ago6266 harden dtrace_difo_chunksize() with respect to malicious DIF
markj [Wed, 30 Sep 2015 03:30:24 +0000 (03:30 +0000)]
6266 harden dtrace_difo_chunksize() with respect to malicious DIF

illumos/illumos-gate@395c7a3dcfc66b8b671dc4b3c4a2f0ca26449922

Reviewed by: Alex Wilson <alex.wilson@joyent.com>
Reviewed by: Dan McDonald <danmcd@omniti.com>
Approved by: Garrett D'Amore <garrett@damore.org>
Author: Bryan Cantrill <bryan@joyent.com>

8 years agoTrim trailing whitespace.
jhb [Wed, 30 Sep 2015 00:08:24 +0000 (00:08 +0000)]
Trim trailing whitespace.

8 years agoDecode recently added procctl(2) operations.
jhb [Tue, 29 Sep 2015 23:54:26 +0000 (23:54 +0000)]
Decode recently added procctl(2) operations.

8 years agoFix locking after my EDCA update change.
adrian [Tue, 29 Sep 2015 19:15:08 +0000 (19:15 +0000)]
Fix locking after my EDCA update change.

The net80211 lock is no longer held during this call, so we don't have
to unlock/relock.

Noticed by: David Wolfskill

8 years agoFix the .MAKE added in r251750 to properly support the historical -n -n.
bdrewery [Tue, 29 Sep 2015 18:57:30 +0000 (18:57 +0000)]
Fix the .MAKE added in r251750 to properly support the historical -n -n.

The condition used matches the condition in sys.mk for setting _+_ to blank
or +.

With this -n will continue to not descend into Makefile.inc1, while -n -n will
and cause Makefile.inc1's target to run with -n.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoWhen stopping ugidfw, it is not enough to just try unloading the module. If
bdrewery [Tue, 29 Sep 2015 18:51:56 +0000 (18:51 +0000)]
When stopping ugidfw, it is not enough to just try unloading the module.  If
the module is built-in to the kernel then the kldunload will fail.  Rather
than do this just check if there are rules and then remove them all.

Add requirement on FILESYSTEMS to ensure /usr is present for /usr/sbin/ugidfw
and /usr/bin/xargs.  This was already effectively the ordering from rcorder(8).

MFC after: 2 weeks
Relnotes: yes

8 years agoFix 'ugidfw remove' after r284251 incorrectly changed it.
bdrewery [Tue, 29 Sep 2015 18:48:12 +0000 (18:48 +0000)]
Fix 'ugidfw remove' after r284251 incorrectly changed it.

The sysctl_rule() node removes entries when given a newptr and newlen == 0.

8 years agoThe Sun RPC framework uses a netbuf structure to represent the
delphij [Tue, 29 Sep 2015 18:05:54 +0000 (18:05 +0000)]
The Sun RPC framework uses a netbuf structure to represent the
transport specific form of a universal transport address.  The
structure is expected to be opaque to consumers.  In the current
implementation, the structure contains a pointer to a buffer
that holds the actual address.

In rpcbind(8), netbuf structures are copied directly, which would
result in two netbuf structures that reference to one shared
address buffer.  When one of the two netbuf structures is freed,
access to the other netbuf structure would result in an undefined
result that may crash the rpcbind(8) daemon.

Fix this by making a copy of the buffer that is going to be freed
instead of doing a shallow copy.

Security: FreeBSD-SA-15:24.rpcbind
Security: CVE-2015-7236

8 years agoIn this context fclose() can never fail, so assert it in the test
delphij [Tue, 29 Sep 2015 17:54:28 +0000 (17:54 +0000)]
In this context fclose() can never fail, so assert it in the test
case.

8 years agoAll supported releases have the -m support from r186678, so remove
bdrewery [Tue, 29 Sep 2015 17:54:01 +0000 (17:54 +0000)]
All supported releases have the -m support from r186678, so remove
the mention of it and reword this a bit to remove 'you'.

MFC after: 3 days

8 years agoDocument the post-merge actions of calling tzsetup(8) and services_mkdb(8)
bdrewery [Tue, 29 Sep 2015 17:49:59 +0000 (17:49 +0000)]
Document the post-merge actions of calling tzsetup(8) and services_mkdb(8)
added in r259134.

MFC after: 3 days

8 years agoAdd otus(4) to the hardware notes.
brueffer [Tue, 29 Sep 2015 17:04:20 +0000 (17:04 +0000)]
Add otus(4) to the hardware notes.

8 years agoIn addition to the ubldr file, also copy ubldr.bin to the
gjb [Tue, 29 Sep 2015 16:09:59 +0000 (16:09 +0000)]
In addition to the ubldr file, also copy ubldr.bin to the
MS-DOS partition.  This will help with transitioning to
a single arm/armv6 userland build which could be used for
all FreeBSD/armv6 images without UBLDR_LOADADDR being set
for each board (ultimately requiring a separate buildworld
for each currently).

Requested by: ian
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

8 years agoAnnotate arm userspace assembler sources stating their tolerance to
kib [Tue, 29 Sep 2015 16:09:58 +0000 (16:09 +0000)]
Annotate arm userspace assembler sources stating their tolerance to
the non-executable stack.

Reviewed by: andrew
Sponsored by: The FreeBSD Foundation

8 years agoUse EFI page size constants instead of hardcoding 4096.
jhb [Tue, 29 Sep 2015 15:49:53 +0000 (15:49 +0000)]
Use EFI page size constants instead of hardcoding 4096.

Reviewed by: emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D3692

8 years agoWhen XSAVE support was added on amd64, the FPU save area was moved
jhb [Tue, 29 Sep 2015 15:47:42 +0000 (15:47 +0000)]
When XSAVE support was added on amd64, the FPU save area was moved
out of 'struct pcb' and into a variable-sized region after the
structure. The kgdb code currently only reads the pcb. It does not
read in the FPU save area but instead passes stack garbage as the
FPU's saved context. Fixing this would mean determining the proper
size of the area and fetching it. However, this state is not saved
for running CPUs in stoppcbs[], so the callback would also have to
know to ignore those pcbs. Instead, just remove the call since it is
of limited usefulness. It results in kgdb reporting the state of the
FPU/SIMD registers in userland, not their current values in the kernel.
In particular, it does not report the correct state for any code in
the kernel which does use the FPU and would report incorrect values
in that case.

Reviewed by: kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D3743

8 years agoIn vm_copy_base(), turn off SU+J on the resultant filesystem,
gjb [Tue, 29 Sep 2015 15:30:27 +0000 (15:30 +0000)]
In vm_copy_base(), turn off SU+J on the resultant filesystem,
leaving only SU enabled.

Discussed with: kib (a few weeks ago)
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

8 years agoReally implement PREVENT ALLOW MEDIUM REMOVAL command.
mav [Tue, 29 Sep 2015 15:12:40 +0000 (15:12 +0000)]
Really implement PREVENT ALLOW MEDIUM REMOVAL command.

8 years agoDon't report SYNC_NV bit set in SYNCHRONIZE CACHE as error.
mav [Tue, 29 Sep 2015 13:58:27 +0000 (13:58 +0000)]
Don't report SYNC_NV bit set in SYNCHRONIZE CACHE as error.

While this bit is obsolete in SBC-3, behavior controlled by it is allowed
on device discretion.

8 years agoFix arguments order.
mav [Tue, 29 Sep 2015 12:53:41 +0000 (12:53 +0000)]
Fix arguments order.

8 years agosdt.h: no need for argtype_list_head
avg [Tue, 29 Sep 2015 12:14:59 +0000 (12:14 +0000)]
sdt.h: no need for argtype_list_head

MFC after: 12 days

8 years agosdt: static-ize couple of variables
avg [Tue, 29 Sep 2015 12:14:22 +0000 (12:14 +0000)]
sdt: static-ize couple of variables

MFC after: 11 days

8 years agosdt module does not seem to actually use any symbol from opensolaris module
avg [Tue, 29 Sep 2015 12:13:31 +0000 (12:13 +0000)]
sdt module does not seem to actually use any symbol from opensolaris module

MFC after: 11 days

8 years agostd: it is important that func name is never an empty string
avg [Tue, 29 Sep 2015 12:02:23 +0000 (12:02 +0000)]
std: it is important that func name is never an empty string

otherwise DTRACE_ANCHORED() returns false and that makes stack()
insert a bogus frame at the top.
For example:
dtrace -n 'test:dtrace_test::sdttest { stack(); }

This change is not really a solution, but just a work-around.
The real solution is to record the probe's call site and to use
that for resolving a function name.

PR: 195222
MFC after: 22 days

8 years agosdt: start checking version field when parsing probe definitions
avg [Tue, 29 Sep 2015 11:58:21 +0000 (11:58 +0000)]
sdt: start checking version field when parsing probe definitions

This is an extra safety measure.

MFC after: 21 days

8 years agodtrace_getarg: remove stray return statement on amd64, powerpc
avg [Tue, 29 Sep 2015 11:55:26 +0000 (11:55 +0000)]
dtrace_getarg: remove stray return statement on amd64, powerpc

MFC after: 10 days

8 years agoThe Dt argument should be in capital letters.
brueffer [Tue, 29 Sep 2015 11:48:47 +0000 (11:48 +0000)]
The Dt argument should be in capital letters.

8 years agoReport that we can read all flavours of DVD. Why not?
mav [Tue, 29 Sep 2015 10:44:37 +0000 (10:44 +0000)]
Report that we can read all flavours of DVD.  Why not?

8 years agoAdd CD/DVD Capabilities and Mechanical Status Page.
mav [Tue, 29 Sep 2015 09:09:37 +0000 (09:09 +0000)]
Add CD/DVD Capabilities and Mechanical Status Page.

This page is obsolete since MMC-4, but still used by some software.

8 years agorsu(4): Add support for 1T2R and 2T2R NICs.
adrian [Tue, 29 Sep 2015 06:56:00 +0000 (06:56 +0000)]
rsu(4): Add support for 1T2R and 2T2R NICs.

This logic is mostly crimed from the reference driver and the linux
r92su driver.

I verified that it (a) worked on the rsu hardware I have, and (b)
did traffic testing whilst watching what ath(4) sent as a hostap.
It successfully sent MCS8..15 rates (which requires 2-stream reception)
as well as MCS0..7 (which is 1-stream.)

Tested:

* RTL8712, 1T1R NIC, MCS rates 0..7.
* RTL8712, 1T2R NIC, MCS rates 0..15

TODO:

* Find a 2T2R NIC!

8 years agourtwn driver fixes - missing include, free node references, shut down xfers first
adrian [Tue, 29 Sep 2015 05:03:24 +0000 (05:03 +0000)]
urtwn driver fixes - missing include, free node references, shut down xfers first

* include opt_wlan.h like a good little wlan driver;
* add a function to free the mbufq /and/ the node references on it, or we will leak
  said node references;
* free the mbufq upon NIC shutdown otherwise we may end up with a full list that
  we never begin transmit work on, and thus never drain it;
* .. which frees it upon NIC detach too;
* ensure urtwn_start() gets called after the completion of frame TX even if the
  pending queue is empty, otherwise transmit will stall.  It's highly unlikely that
  the usb tx queue would be empty whilst the incoming send queue is full, but hey,
  who knows.

This passes some iperf testing with and without the NIC being actively removed during
said active iperf test.

Tested:

* urtwn0: MAC/BB RTL8188EU, RF 6052 1T1R ; STA mode

8 years agoAdd opt_wlan.h as requirements for the two drivers I'm currently working on.
adrian [Tue, 29 Sep 2015 04:56:27 +0000 (04:56 +0000)]
Add opt_wlan.h as requirements for the two drivers I'm currently working on.

8 years agoUse calloc() instead of malloc + memset.
delphij [Tue, 29 Sep 2015 04:47:31 +0000 (04:47 +0000)]
Use calloc() instead of malloc + memset.

MFC after: 2 weeks

8 years agoDefer calling into the driver to update the QOS (WME) configuration.
adrian [Tue, 29 Sep 2015 03:40:21 +0000 (03:40 +0000)]
Defer calling into the driver to update the QOS (WME) configuration.

This gets called from the driver RX path which leads to driver re-entry.

8 years agoRemove the references to the TX IC lock - i ended up solving this
adrian [Tue, 29 Sep 2015 03:37:17 +0000 (03:37 +0000)]
Remove the references to the TX IC lock - i ended up solving this
using net80211 to seralise encap+xmit, so now it's a non-issue.

8 years agoUmplement media load/eject support for removable devices.
mav [Mon, 28 Sep 2015 20:54:18 +0000 (20:54 +0000)]
Umplement media load/eject support for removable devices.

In case of block backend eject really closes the backing store, while
load tries to open it back.  Failed store open is reported as no media.

8 years agoAppend VMFORMATS and VMSIZE to RELEASE_RMAKEFLAGS only if
gjb [Mon, 28 Sep 2015 19:19:53 +0000 (19:19 +0000)]
Append VMFORMATS and VMSIZE to RELEASE_RMAKEFLAGS only if
WITH_VMIMAGES is set.

MFC after: 3 days
X-MFC-With: r288341, r288345
Sponsored by: The FreeBSD Foundation

8 years agoIn followup to r288341, ensure VMFORMATS and VMSIZE are not
gjb [Mon, 28 Sep 2015 18:39:21 +0000 (18:39 +0000)]
In followup to r288341, ensure VMFORMATS and VMSIZE are not
set to empty values, which would result in nonintuitive build
errors.

MFC after: 3 days
X-MFC-With: r288341
PR: 203420 (related to)
Sponsored by: The FreeBSD Foundation

8 years agoUse _PATH_DEVNULL instead of direct hardcoding.
delphij [Mon, 28 Sep 2015 18:19:22 +0000 (18:19 +0000)]
Use _PATH_DEVNULL instead of direct hardcoding.

MFC after: 2 weeks

8 years agoHonor VMFORMATS and VMSIZE if set in release.conf.
gjb [Mon, 28 Sep 2015 16:33:38 +0000 (16:33 +0000)]
Honor VMFORMATS and VMSIZE if set in release.conf.

PR: 203420
Submitted by: luca <dot> pizzamiglio <at> gmail <dot> com
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

8 years agodefine aok in libnvpair which is linked to all zfs libraries that need aok
avg [Mon, 28 Sep 2015 15:25:36 +0000 (15:25 +0000)]
define aok in libnvpair which is linked to all zfs libraries that need aok

This removes the circular dependency of libnvpair on libzfs / libzpool.

PR: 199811
Obtained from: bapt
MFC after: 23 days

8 years agoremove unused sgsmsg utility (originally imported from opensolaris)
avg [Mon, 28 Sep 2015 12:38:57 +0000 (12:38 +0000)]
remove unused sgsmsg utility (originally imported from opensolaris)

MFC after: 25 days

8 years agoremove an extra copy of avl.c from illumos contrib code
avg [Mon, 28 Sep 2015 12:23:10 +0000 (12:23 +0000)]
remove an extra copy of avl.c from illumos contrib code

MFC after: 20 days

8 years agosave some bytes by using more concise SDT_PROBE<n> instead of SDT_PROBE
avg [Mon, 28 Sep 2015 12:14:16 +0000 (12:14 +0000)]
save some bytes by using more concise SDT_PROBE<n> instead of SDT_PROBE

SDT_PROBE requires 5 parameters whereas SDT_PROBE<n> requires n parameters
where n is typically smaller than 5.

Perhaps SDT_PROBE should be made a private implementation detail.

MFC after: 20 days

8 years agoStore PID after becoming a daemon() and not before to ensure the
hselasky [Mon, 28 Sep 2015 07:23:05 +0000 (07:23 +0000)]
Store PID after becoming a daemon() and not before to ensure the
correct PID gets written to the PID file.

Submitted by: Maxime Soule <btik-fbsd@scoubidou.com>
PR: 203252
MFC after: 2 weeks

8 years agoRemove some debugging that wasn't supposed to be there.
adrian [Mon, 28 Sep 2015 06:26:46 +0000 (06:26 +0000)]
Remove some debugging that wasn't supposed to be there.

8 years agoAdd initial testcases for bin/ls
ngie [Mon, 28 Sep 2015 03:36:15 +0000 (03:36 +0000)]
Add initial testcases for bin/ls

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

8 years agoinclude opt_wlan.h . Tsk adrian.
adrian [Mon, 28 Sep 2015 01:16:44 +0000 (01:16 +0000)]
include opt_wlan.h .  Tsk adrian.

8 years agoif_otus fixes; add fast-frames support.
adrian [Mon, 28 Sep 2015 01:09:48 +0000 (01:09 +0000)]
if_otus fixes; add fast-frames support.

Fast-frames:

* include opt_wlan.h ; tsk to not doing it earlier;
* add a tx pending tracking counter for seeing how deep
  the hardware TX queue is;
* add the frame aging code from if_ath;
* add fast-frames capability to the driver setup.

Bugs:

* free the buffers (and node references) before
  detaching net80211 state.  This prevents a use-after-free in
  the node free path where we've destroyed net80211 underneath it.

8 years agoMigrate the fast-frames transmit support away from using the txa_private
adrian [Mon, 28 Sep 2015 00:59:07 +0000 (00:59 +0000)]
Migrate the fast-frames transmit support away from using the txa_private
field and into a separate fast-frames staging pointer in ieee80211_node.

The A-MPDU TX path allows txa_private to be used by drivers.  So it will
clash with any attempt to use fast-frames.  Now, fast-frames is not really
anything special - it's just a custom ethernet frame type that contains
two MSDUs into one MPDU.  So all the NIC has to support doing is transmitting
up to a 4KiB frame with an arbitrary ethertype and bam! Fast-frames.
However, using txa_private means we can /either/ do fast-frames or A-MPDU TX,
so fast frames has been turned off in the Atheros HAL for 11n chipsets.
This is a bit silly - it actually means that 802.11 performance to/from
11abg Atheros chips is actually better than between an 11abg atheros device
and an 11n Atheros device.

So:

* create a new mbuf staging queue for fast frames.  It only queues a single
  frame in the staging queue (and there's a top-level ic staging queue
  used for expiry/tracking) so it's just an mbuf pointer per TID.

* Still use the ampdu TX packet counter to determine whether to do
  aggregation or not.  It'll double count if we start doing both A-MPDU TX
  and fast frames, but that's not all that important right now.

* Initialise the pps tracker so ticks isn't zero.  This ensures that
  fast-frames actually gets used - without it, the ticks math overflows
  and the pps math always sets txa_pps=0.  This is the same bug that
  plagued A-MPDU TX starting logic.

This actually allows fast-frames transmit to occur between the AR9331
(in 11n HT/20 mode) and AR9170 (if_otus) in 11bg mode.

Now, this is a great big no-op on atheros 11n hardware, so don't worry.
It may mean you start seeing more reliable fast-frames transmission on
11abg hardware which may expose some more amusing bugs.

TODO:

* further testing and debugging of all of this before flipping on
  fast-frames in if_ath (for 11n) and if_otus.

8 years agoComments, mostly to remind myself of what's going on and why.
adrian [Mon, 28 Sep 2015 00:51:24 +0000 (00:51 +0000)]
Comments, mostly to remind myself of what's going on and why.

8 years agoAbstract out the ampdu TX pps initialisation code so it can be reused
adrian [Mon, 28 Sep 2015 00:17:51 +0000 (00:17 +0000)]
Abstract out the ampdu TX pps initialisation code so it can be reused
in the superg fast-frames code.

This harks back to an earlier commit (r280349) where I found that
initialising the pps code with ticks=0 would cause hilariously bad
hz ticks wraparound failures, leading to never actually aggregating
traffic.  This is still true for the superg path and so I have to
do the same thing there.

This is a big no-op; a subsequent commit will flip this on so it
works with the fast-frames transmit path.

Tested:

* AR9170, otus(4) - STA mode, 11bg operation
* AR9331, AP mode

8 years agoFix whitespace error in ls(1) detected by igor
allanjude [Sun, 27 Sep 2015 22:05:20 +0000 (22:05 +0000)]
Fix whitespace error in ls(1) detected by igor

Approved by: bcr (mentor)
Sponsored by: EuroBSDCon DevSummit

8 years agoUse one fewer made up words in the ls(1) man page
allanjude [Sun, 27 Sep 2015 22:02:46 +0000 (22:02 +0000)]
Use one fewer made up words in the ls(1) man page

PR: 203337
Submitted by: Mike Dame <damemi@gmail.com>
Approved by: bcr (mentor)
Sponsored by: EuroBSDCon DevSummit

8 years agoSet the #address-cells and #size-cells for the I2C controllers in RPi2.
loos [Sun, 27 Sep 2015 18:21:22 +0000 (18:21 +0000)]
Set the #address-cells and #size-cells for the I2C controllers in RPi2.

This allows the use of I2C addresses in 'reg' property.

8 years agoAdd to CTL initial support for CDROMs and removable devices.
mav [Sun, 27 Sep 2015 13:47:28 +0000 (13:47 +0000)]
Add to CTL initial support for CDROMs and removable devices.

Relnotes: yes

8 years agofnmatch(): Remove exponential behaviour as in sh r229201.
jilles [Sun, 27 Sep 2015 12:52:18 +0000 (12:52 +0000)]
fnmatch(): Remove exponential behaviour as in sh r229201.

The old code was exponential in the number of asterisks in the pattern.
However, once a match has been found upto the next asterisk, the previous
asterisks are no longer relevant.

8 years agoFix what looks like a consistent copy&paste error.
bz [Sun, 27 Sep 2015 12:19:36 +0000 (12:19 +0000)]
Fix what looks like a consistent copy&paste error.
Don't make an integer to a boolean and then compare to a value which
needs an integer comparison.

Spotted by: reading kernel compile time log
MFC after: 2 weeks

8 years agoCompare the correct variable to see if memory allocation succeeded.
bz [Sun, 27 Sep 2015 12:17:03 +0000 (12:17 +0000)]
Compare the correct variable to see if memory allocation succeeded.
I don't even want to know where the symbol "version" comes from.

Spotted by: reading kernel compile time log
MFC after: 2 weeks

8 years agoAdd support to systat to display zfs arc cache status/info
mr [Sun, 27 Sep 2015 09:15:54 +0000 (09:15 +0000)]
Add support to systat to display zfs arc cache status/info

PR: 195460
Submitted by: ota

8 years agoReplace N #defines with nitems to simplify ifconfig code slightly
ngie [Sun, 27 Sep 2015 07:51:18 +0000 (07:51 +0000)]
Replace N #defines with nitems to simplify ifconfig code slightly

MFC after: 1 week

8 years agoEnable parallel subdirectory building with sys/modules/netgraph
ngie [Sun, 27 Sep 2015 07:40:19 +0000 (07:40 +0000)]
Enable parallel subdirectory building with sys/modules/netgraph

MFC after: 2 weeks

8 years agoMFV r288243: nc from OpenBSD 5.8.
delphij [Sun, 27 Sep 2015 07:04:16 +0000 (07:04 +0000)]
MFV r288243: nc from OpenBSD 5.8.