]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
10 years agofletcher4 is currently the default.
dteske [Mon, 16 Dec 2013 19:43:04 +0000 (19:43 +0000)]
fletcher4 is currently the default.

Discussed on: -current
MFC after: 3 days

10 years agoImprove default ZFS disk layout (tested):
dteske [Mon, 16 Dec 2013 19:37:15 +0000 (19:37 +0000)]
Improve default ZFS disk layout (tested):
+ For GPT, always provision zfs# partition after swap [for resizability]
+ For MBR, always use a boot pool to relialy place root vdevs at EOD
NB: Fixes edge-cases where MBR combination failed boot (e.g. swap-less)
+ Generalize boot pool logic so it can be used for any scheme (namely MBR)
+ Update existing comments and some whitespace fixes
+ Change some variable names to make reading/debugging the code easier
  in zfs_create_boot() (namely prepend zroot_ or bootpool_ to property)
+ Because zroot vdevs are at EOD, no longer need to calculate partsize
  (vdev consumes remaining space after allocating swap)
+ Optimize processing of disks -- no reason to loop over the disks 3-4
  separate times when we can logically use a single loop to do everything

Discussed on: -stable
MFC after: 3 days

10 years agoMigrate the sendfile_sync struct to use a UMA zone rather than M_TEMP.
adrian [Mon, 16 Dec 2013 19:31:23 +0000 (19:31 +0000)]
Migrate the sendfile_sync struct to use a UMA zone rather than M_TEMP.

This allows it to be better tracked as well as being able to leverage
UMA for more interesting/useful behaviour at a later date.

Sponsored by: Netflix, Inc.

10 years agoBug-fixes and debugging improvments:
dteske [Mon, 16 Dec 2013 18:53:09 +0000 (18:53 +0000)]
Bug-fixes and debugging improvments:
+ De-obfuscate debugging to show actual values
+ Change graid(8) syntax; s/destroy/delete/ [destroy is not invalid syntax]
+ Log commands that were previously quiet
+ Added some new comemnts and updated some existing ones
+ Add missing local for `disk' used in zfs_create_boot()
+ Use $disks instead of multiply-expanding $* in zfs_create_boot()
+ Pedantically unset variable holding geli(8) passphrase after use
+ Pedantically add double-quotes around zpool names and zfs datasets
+ Fix quotation expansion for zpool_cache entries of loader.conf(5)
+ Some limited whitespace changes

MFC after: 3 days

10 years agoEnable llvm's integrated assembler for PowerPC, since it should now be
dim [Mon, 16 Dec 2013 18:45:21 +0000 (18:45 +0000)]
Enable llvm's integrated assembler for PowerPC, since it should now be
good enough for typical usage.

Requested by: rdivacky
MFC after: 1 week

10 years agoAccept NULL input as also meaning zero swap.
dteske [Mon, 16 Dec 2013 17:11:09 +0000 (17:11 +0000)]
Accept NULL input as also meaning zero swap.

MFC after: 3 days

10 years agoAdd myself to the src-committers list
bdrewery [Mon, 16 Dec 2013 17:05:03 +0000 (17:05 +0000)]
Add myself to the src-committers list

Approved by: bapt (mentor)

10 years agoAs per discussions on -current, re-add /var/mail (removed in r257842) but
dteske [Mon, 16 Dec 2013 17:03:44 +0000 (17:03 +0000)]
As per discussions on -current, re-add /var/mail (removed in r257842) but
this time with atime=on in support of various software that requires it.

Discussed on: -current
MFC after: 3 days

10 years agoMask error from newaliases(1) when the hostname is not fully qualified.
dteske [Mon, 16 Dec 2013 15:52:44 +0000 (15:52 +0000)]
Mask error from newaliases(1) when the hostname is not fully qualified.

MFC after: 3 days

10 years agoAdd a fix for Long-standing problem with VMware. Described in below links:
dteske [Mon, 16 Dec 2013 15:50:59 +0000 (15:50 +0000)]
Add a fix for Long-standing problem with VMware. Described in below links:
https://communities.vmware.com/thread/107230
https://communities.vmware.com/docs/DOC-11677

Basically, ignore the ``function 62'' and ``function 63'' interpretations
of the left/right command key when we're in the lengthiest portion of the
installation (initiated by the `auto' module).

The net effect is that you can now (once you've started the installer from
the media) escape the VM without prematurely terminating the current action
due to spurious escape sequence.

MFC after: 3 days

10 years agoFix periodic per-CPU timers startup on boot.
mav [Mon, 16 Dec 2013 13:52:18 +0000 (13:52 +0000)]
Fix periodic per-CPU timers startup on boot.

Reported by: neel
MFC after: 2 weeks

10 years agoStart-up script for casperd daemon.
pjd [Mon, 16 Dec 2013 11:03:59 +0000 (11:03 +0000)]
Start-up script for casperd daemon.

Sponsored by: The FreeBSD Foundation

10 years agoFix regression issue after r259248:
hselasky [Mon, 16 Dec 2013 10:50:13 +0000 (10:50 +0000)]
Fix regression issue after r259248:

Some Intel XHCI controlles timeout processing so-called "TRBs" when
the final LINK TRB of a so-called "TD" has the CHAIN-BIT set.

MFC after: 1 week
Tested by: glebius @

10 years agotzfile.5: catch up to r204333
bjk [Mon, 16 Dec 2013 01:58:12 +0000 (01:58 +0000)]
tzfile.5: catch up to r204333

The stdtime sources were moved from lib/libc to contrib/tzcode, and tzfile.h
is not an installed header, so the man page refers to its location in the
source tree.

The documentation could be more clear about the internal nature of the
header, but those changes should go through upstream tzcode.

PR: docs/176864
Approved by: hrs (mentor)

10 years agoProperly drain the TTY when both revoke(2) and close(2) end up closing
marcel [Mon, 16 Dec 2013 00:50:14 +0000 (00:50 +0000)]
Properly drain the TTY when both revoke(2) and close(2) end up closing
the TTY. In such a case, ttydev_close() is called multiple times and
each time, t_revokecnt is incremented and cv_broadcast() is called for
both the t_outwait and t_inwait condition variables.
Let's say revoke(2) comes in first and gets to call tty_drain() from
ttydev_leave(). Let's say that the revoke comes from init(8) as the
result of running "shutdown -r now". Since shutdown prints various
messages to the console before announing that the machine will reboot
immediately, let's also say that the output queue is not empty and
that tty_drain() has something to do. Let's assume this all happens
on a 9600 baud serial console, so it takes a time to drain.
The shutdown command will exit(2) and as such will end up closing
stdout. Let's say this close will come in second, bump t_revokecnt
and call tty_wakeup(). This has tty_wait() return prematurely and
the next thing that will happen is that the thread doing revoke(2)
will flush the TTY. Since the drain wasn't complete, the flush will
effectively drop whatever is left in t_outq.

This change takes into account that tty_drain() will return ERESTART
due to the fact that t_revokecnt was bumped and in that case simply
call tty_drain() again. The thread in question is already performing
the close so it can safely finish draining the TTY before destroying
the TTY structure.

Now all messages from shutdown will be printed on the serial console.

Obtained from: Juniper Networks, Inc.

10 years agoInclude bsd.own.mk for MK_CASPER to work.
pjd [Sun, 15 Dec 2013 23:49:42 +0000 (23:49 +0000)]
Include bsd.own.mk for MK_CASPER to work.

Reported by: nwhitehorn

10 years agoRegenerate after r259438.
pjd [Sun, 15 Dec 2013 23:20:26 +0000 (23:20 +0000)]
Regenerate after r259438.

10 years agoFix syscalls that can be loaded as kernel modules - they were not given
pjd [Sun, 15 Dec 2013 23:19:42 +0000 (23:19 +0000)]
Fix syscalls that can be loaded as kernel modules - they were not given
the flag allowing to call them from capability mode sandbox.

Noticed by: David Drysdale <drysdale@google.com>

10 years agoRegenerate after r259436.
pjd [Sun, 15 Dec 2013 23:15:12 +0000 (23:15 +0000)]
Regenerate after r259436.

10 years agoAllow for pselect(2) in capability mode.
pjd [Sun, 15 Dec 2013 23:14:27 +0000 (23:14 +0000)]
Allow for pselect(2) in capability mode.

Noticed by: David Drysdale <drysdale@google.com>

10 years agoForgot to regenerate after r257736.
pjd [Sun, 15 Dec 2013 23:12:42 +0000 (23:12 +0000)]
Forgot to regenerate after r257736.

10 years agoMake use of Casper's system.pwd and system.grp services when the -r option
pjd [Sun, 15 Dec 2013 23:09:05 +0000 (23:09 +0000)]
Make use of Casper's system.pwd and system.grp services when the -r option
is given to convert uids and gids to user names and group names even when
running in capability mode sandbox.

While here log on stderr when we successfully enter the sandbox.

Sponsored by: The FreeBSD Foundation

10 years agoAdd Casper support.
pjd [Sun, 15 Dec 2013 23:05:19 +0000 (23:05 +0000)]
Add Casper support.

Sponsored by: The FreeBSD Foundation

10 years agoMake use of casperd's system.dns service when running without the -n option.
pjd [Sun, 15 Dec 2013 23:02:36 +0000 (23:02 +0000)]
Make use of casperd's system.dns service when running without the -n option.
Now tcpdump(8) is sandboxed even if DNS resolution is required.

Sponsored by: The FreeBSD Foundation

10 years agoMFp4 @1189141:
pjd [Sun, 15 Dec 2013 22:59:34 +0000 (22:59 +0000)]
MFp4 @1189141:

Change casperd's zygote process title.

MFC after: 1 week

10 years agoMFp4 @1189139:
pjd [Sun, 15 Dec 2013 22:58:09 +0000 (22:58 +0000)]
MFp4 @1189139:

Get rid of the msg_peek() function, which has a problem.  If there was less
data in the socket buffer than requested by the caller, the function would busy
loop, as select(2) will always return immediately.

We can just receive nvlhdr now, because some time ago we splitted receive of
data from the receive of descriptors.

MFC after: 1 week

10 years agoClear some more places with potentially sensitive data.
pjd [Sun, 15 Dec 2013 22:52:18 +0000 (22:52 +0000)]
Clear some more places with potentially sensitive data.

MFC after: 1 week

10 years agoClear content of keyfiles loaded by the loader after processing them.
pjd [Sun, 15 Dec 2013 22:51:26 +0000 (22:51 +0000)]
Clear content of keyfiles loaded by the loader after processing them.

Pointed out by: rwatson
MFC after: 1 week

10 years agoExport 'REPOS_DIR' when the selected source medium for package
gjb [Sun, 15 Dec 2013 20:47:27 +0000 (20:47 +0000)]
Export 'REPOS_DIR' when the selected source medium for package
installation is cdrom.  This enables bsdconfig(8) to make use
of the on-disc pkg(8) repository configuration, which fixes
package selection and installation from the dvd installer.

MFC after: 3 days
M-MFC-With: r259426
X-MFC-Before: -RC3
Sponsored by: The FreeBSD Foundation

10 years agoAdd a pkg(8) repository configuration file for cdrom-based package
gjb [Sun, 15 Dec 2013 20:38:07 +0000 (20:38 +0000)]
Add a pkg(8) repository configuration file for cdrom-based package
installation.

As part of the 'pkg-stage' target, copy the configuration file
to the 'packages/repos/' directory on the DVD filesystem.

MFC after: 3 days
X-MFC-Before: -RC3
Sponsored by: The FreeBSD Foundation

10 years agoAdd an UPDATING entry for the gss_pseudo_random behavior change
bjk [Sun, 15 Dec 2013 19:18:18 +0000 (19:18 +0000)]
Add an UPDATING entry for the gss_pseudo_random behavior change

Approved by: hrs (mentor, src committer)

10 years agoIncrement __FreeBSD_version for the behavior change of gss_pseudo_random
bjk [Sun, 15 Dec 2013 18:26:31 +0000 (18:26 +0000)]
Increment __FreeBSD_version for the behavior change of gss_pseudo_random
introduced in r259286.

Approved by: hrs (mentor, src committer)

10 years agoRevert r259045.
kib [Sun, 15 Dec 2013 18:13:42 +0000 (18:13 +0000)]
Revert r259045.

It seems that clang miscompiles code related to UDP with -fno-strict-overflow.

10 years agoSave r3 before using it for the trap check, else we end up saving the new r3,
jhibbits [Sun, 15 Dec 2013 18:07:25 +0000 (18:07 +0000)]
Save r3 before using it for the trap check, else we end up saving the new r3,
containing the trap instruction encoding (0x7c810808), and restoring it back
with the frame on return.  This caused it to panic on my ppc32 machine, but
somehow my ppc64 machine overlooked it, because I was using such a simple
dtrace probe.

X-MFC-with: r259245
MFC after: 2 weeks

10 years agoSet max_lun to zero. This field is ignored unless we are manually probing
nwhitehorn [Sun, 15 Dec 2013 16:58:23 +0000 (16:58 +0000)]
Set max_lun to zero. This field is ignored unless we are manually probing
LUNs anyway, and we certainly don't want to probe 2^32 values by hand in
that case.

MFC after: 2 weeks

10 years agoReplace Sun RPC license for TI-RPC library with a 3-clause BSD license,
hrs [Sun, 15 Dec 2013 16:17:00 +0000 (16:17 +0000)]
Replace Sun RPC license for TI-RPC library with a 3-clause BSD license,
with the explicit permission of Sun Microsystems in 2009.
The code in question in this file was copied from lib/libc/rpc/pmap_getport.c.

10 years agoBump libcam shared library version forgotten in r259397.
nwhitehorn [Sun, 15 Dec 2013 15:51:05 +0000 (15:51 +0000)]
Bump libcam shared library version forgotten in r259397.

Submitted by: kib

10 years agomdoc: sort SEE ALSO.
joel [Sun, 15 Dec 2013 08:52:16 +0000 (08:52 +0000)]
mdoc: sort SEE ALSO.

10 years agosplit netmap code according to functions:
luigi [Sun, 15 Dec 2013 08:37:24 +0000 (08:37 +0000)]
split netmap code according to functions:
- netmap.c base code
- netmap_freebsd.c FreeBSD-specific code
- netmap_generic.c emulate netmap over standard drivers
- netmap_mbq.c simple mbuf tailq
- netmap_mem2.c memory management
- netmap_vale.c VALE switch

simplify devce-specific code

10 years agoDefer start/stop port to workqueues.
alfred [Sun, 15 Dec 2013 07:07:13 +0000 (07:07 +0000)]
Defer start/stop port to workqueues.

We need to do this because the Linux compat layer uses sx(9) for
mutex, however the lagg code uses rmlocks and calls into the mellanox
driver.  This causes deadlock due to sleeping while holding a rmlock.

Submitted by: Shahar Klein (shahark mellanox.com)
MFC After: 3 days.

10 years agorevise the helper functions to lookup binaries and their
luigi [Sun, 15 Dec 2013 07:04:59 +0000 (07:04 +0000)]
revise the helper functions to lookup binaries and their
shared libraries.

10 years agoproc exit: don't take PROC_LOCK while freeing rlimits
mjg [Sun, 15 Dec 2013 04:11:43 +0000 (04:11 +0000)]
proc exit: don't take PROC_LOCK while freeing rlimits

Code wishing to check rlimits of some process should check whether it
is exiting first, which current consumers do.

MFC after: 2 weeks

10 years agoReduce disc1.iso size by 74MB by removing lib32 libraries, sendmail,
gjb [Sat, 14 Dec 2013 22:41:17 +0000 (22:41 +0000)]
Reduce disc1.iso size by 74MB by removing lib32 libraries, sendmail,
and atf.

MFC after: 3 days
X-MFC-To-10: immediate (-RC2 requirement)
Sponsored by: The FreeBSD Foundation

10 years agoAvoid warning about insecure format with clang.
nwhitehorn [Sat, 14 Dec 2013 22:28:32 +0000 (22:28 +0000)]
Avoid warning about insecure format with clang.

10 years agoWiden lun_id_t to 64 bits. This is a follow-on to r257345 to let the kernel
nwhitehorn [Sat, 14 Dec 2013 22:07:40 +0000 (22:07 +0000)]
Widen lun_id_t to 64 bits. This is a follow-on to r257345 to let the kernel
support all valid SAM-5 LUN IDs. CAM_VERSION is bumped, as the CAM ABI
(though not API) is changed. No behavior is changed relative to r257345
except that LUNs with non-zero high 32 bits will no longer be ignored
during device enumeration for SIMs that have set PIM_EXTLUNS.

Reviewed by: scottl

10 years agoAdd userland PMC backtracing, and use the PMC trapframe macros for kernel
jhibbits [Sat, 14 Dec 2013 20:12:28 +0000 (20:12 +0000)]
Add userland PMC backtracing, and use the PMC trapframe macros for kernel
backtraces.

MFC after: 1 week

10 years agoRebase the PMC indices at 1, since PMC_SOFT is at 0.
jhibbits [Sat, 14 Dec 2013 19:01:24 +0000 (19:01 +0000)]
Rebase the PMC indices at 1, since PMC_SOFT is at 0.

MFC after: 1 week

10 years agoFix several panics when initialization of an ISA or PC-CARD device fails:
gavin [Sat, 14 Dec 2013 18:49:59 +0000 (18:49 +0000)]
Fix several panics when initialization of an ISA or PC-CARD device fails:

o  Assign sc->an_dev in an_probe() (which isn't really a probe function in
   the standard newbus sense) as we may need it for printing errors.
o  Use device_printf() rather than if_printf() in an_reset() - this is
   called from an_probe() long before the ifp structure is initialised
   in an_attach().
o  Initialize the ifp structure early in an_attach() as we use if_printf()
   in cases where allocation of descriptors etc fails.

MFC after: 3 days

10 years agoRead card capabilities after firmware initialization, instead of setting
np [Sat, 14 Dec 2013 03:08:03 +0000 (03:08 +0000)]
Read card capabilities after firmware initialization, instead of setting
them up as part of firmware initialization (which the driver gets to do
only if it's the master driver).

Read the range of tids available for the ETHOFLD functionality if it's
enabled.

New is_ftid() and is_etid() functions to test whether a tid falls within
the range of filter tids or ETHOFLD tids respectively.

MFC after: 2 weeks

10 years agosbin/devd/devd.cc
asomers [Fri, 13 Dec 2013 22:58:57 +0000 (22:58 +0000)]
sbin/devd/devd.cc
Promoting the SIGINFO handler's log message from LOG_INFO to
LOG_NOTICE, and promoting the "Processing event ..." message from
LOG_DEBUG to LOG_INFO.  Setting the logfile to LOG_NOTICE with this
change will have the same result as setting it to LOG_INFO without
this change.  Setting it to LOG_INFO with this change will include
the useful "Processing event ..." messages that were previously at
LOG_DEBUG, without including useless messages like "Pushing table".

The intent of this change is that one can log "Processing event ..."
without logging "Pushing table" and related messages that are sent
for every event.  The number of lines actually logged is reduced by
about 75% by making this change and setting syslog to LOG_INFO vs
setting syslog to LOG_DEBUG.

etc/syslog.conf
Changing the recommended loglevel to notice instead of info.

Sponsored by: Spectra Logic Corp
MFC after: 4 weeks

10 years agogetopt_long.3: wording quibbles
eadler [Fri, 13 Dec 2013 21:50:03 +0000 (21:50 +0000)]
getopt_long.3: wording quibbles

- Make wording more clear: "is expect" vs "is expected" [1]
- Remove extraneous trailing period..

Reported by: dim [1]

10 years agosbin/devd/devd.cc
asomers [Fri, 13 Dec 2013 21:49:41 +0000 (21:49 +0000)]
sbin/devd/devd.cc
Increase the size of devd's client socket's send buffer from the
default (8k) to 128k.  This prevents clients from getting
POLLHUPped during event storms.  For example, during zpool creation,
the kernel emits a resource.fs.zfs.statechange event for every vdev
in the pool.  A 128k buffer is large enough to hold the statechange
events for a pool with nearly 800 drives.

Reviewed by: ian, imp
Approved by: ken (mentor)
Sponsored by: Spectra Logic Corp
MFC after: 4 weeks

10 years agorlimit: avoid unnecessary copying of rlimits
mjg [Fri, 13 Dec 2013 20:54:45 +0000 (20:54 +0000)]
rlimit: avoid unnecessary copying of rlimits

If refcount is 1 just modify rlimits in place.

MFC after: 2 weeks

10 years agorlimit: add and utilize lim_shared
mjg [Fri, 13 Dec 2013 20:53:31 +0000 (20:53 +0000)]
rlimit: add and utilize lim_shared

MFC after: 2 weeks

10 years agobhyve(8) man page.
grehan [Fri, 13 Dec 2013 08:31:13 +0000 (08:31 +0000)]
bhyve(8) man page.

mdoc formatting and much input and review from Warren Block (wblock@).

Reviewed by: many
MFC after: 3 days

10 years agoSome style(9) fixes
jhibbits [Fri, 13 Dec 2013 05:54:25 +0000 (05:54 +0000)]
Some style(9) fixes

MFC after: 1 month
X-MFC with: r259284

10 years agoApply patch from upstream Heimdal for encoding fix
bjk [Fri, 13 Dec 2013 03:09:29 +0000 (03:09 +0000)]
Apply patch from upstream Heimdal for encoding fix

RFC 4402 specifies the implementation of the gss_pseudo_random()
function for the krb5 mechanism (and the C bindings therein).
The implementation uses a PRF+ function that concatenates the output
of individual krb5 pseudo-random operations produced with a counter
and seed.  The original implementation of this function in Heimdal
incorrectly encoded the counter as a little-endian integer, but the
RFC specifies the counter encoding as big-endian.  The implementation
initializes the counter to zero, so the first block of output (16 octets,
for the modern AES enctypes 17 and 18) is unchanged.  (RFC 4402 specifies
that the counter should begin at 1, but both existing implementations
begin with zero and it looks like the standard will be re-issued, with
test vectors, to begin at zero.)

This is upstream's commit f85652af868e64811f2b32b815d4198e7f9017f6,
from 13 October, 2013:
% Fix krb5's gss_pseudo_random() (n is big-endian)
%
% The first enctype RFC3961 prf output length's bytes are correct because
% the little- and big-endian representations of unsigned zero are the
% same.  The second block of output was wrong because the counter was not
% being encoded as big-endian.
%
% This change could break applications.  But those applications would not
% have been interoperating with other implementations anyways (in
% particular: MIT's).

Approved by: hrs (mentor, src committer)
MFC after: 3 days

10 years agoAdd PMU-based CPU frequency scaling. This method is used on most Titanium
jhibbits [Fri, 13 Dec 2013 02:37:35 +0000 (02:37 +0000)]
Add PMU-based CPU frequency scaling.  This method is used on most Titanium
PowerBooks.

MFC after: 1 month

10 years agoSomehow stable/10 branch contains correct version, but head doesn't.
glebius [Thu, 12 Dec 2013 22:33:32 +0000 (22:33 +0000)]
Somehow stable/10 branch contains correct version, but head doesn't.

10 years agoI caught the following snippet at the end of my /var/log/bsdinstall_log:
dteske [Thu, 12 Dec 2013 20:47:18 +0000 (20:47 +0000)]
I caught the following snippet at the end of my /var/log/bsdinstall_log:
===
DEBUG: Running installation step: services
local: Not in a function
/usr/libexec/bsdinstall/services: cannot create  : Read-only file system
/usr/libexec/bsdinstall/services: /tmp/bsdinstall/etc/rc.conf.services: \
 Permission denied
===
The `local: Not in a function' is obvious, and was introduced by myself in
SVN revision 256348.

The latter two are caused by the attempt to use "\" to continue the line
after using the ">>" redirect. This appears to attempt to write a file with
the name " " in the current directory and subsequently attempts to execute
the file that was originally intended for writing (which is not executable;
hence the `Permission denied'). That was introduced in SVN r228192 about
2 years ago, apparently unnoticed until I started going over the debug
outputs very carefully.

MFC after: 3 days

10 years agoAdd a command to inject an NMI on a specific vcpu. It is a simple
jhb [Thu, 12 Dec 2013 20:34:04 +0000 (20:34 +0000)]
Add a command to inject an NMI on a specific vcpu.  It is a simple
wrapper around the existing vm_inject_nmi().

Reviewed by: grehan, neel

10 years agoMention BIND removal in release notes.
rodrigc [Thu, 12 Dec 2013 20:20:46 +0000 (20:20 +0000)]
Mention BIND removal in release notes.

Submitted by: skreuzer

10 years agoAfter r256961 ofw_iicbuc.c will be built for any kernel which includes
loos [Thu, 12 Dec 2013 18:29:36 +0000 (18:29 +0000)]
After r256961 ofw_iicbuc.c will be built for any kernel which includes
options 'iicbus' and 'fdt'.  Remove the (now) unnecessary entries.

Verified on BBB (am335x), EFIKA_MX (imx51 - by ray@), DIGI-CCWMX53
(imx53 - kernel build).

Approved by: adrian (mentor)

10 years agoAdd an FDT DTS and MDROOT kernel configuration for BERI on NetFPGA.
bz [Thu, 12 Dec 2013 18:08:31 +0000 (18:08 +0000)]
Add an FDT DTS and MDROOT kernel configuration for BERI on NetFPGA.

At this point we only support one CPU, the PIC, and a UART console.

Reviewed by: brooks
Sponsored by: DARPA, AFRL
MFC after: 5 days

10 years agoFix multi-repository support by properly respecting 'enabled' flag.
bdrewery [Thu, 12 Dec 2013 17:59:09 +0000 (17:59 +0000)]
Fix multi-repository support by properly respecting 'enabled' flag.

This will read the REPOS_DIR env/config setting (default is /etc/pkg
and /usr/local/etc/pkg/repos) and use the last enabled repository.

This can be changed in the environment using a comma-separated list,
or in /usr/local/etc/pkg.conf with JSON array syntax of:
    REPOS_DIR: ["/etc/pkg", "/usr/local/etc/pkg/repos"]

Approved by: bapt
MFC after: 1 week

10 years agoUse correct value pointing to previously selected FDT DTB.
bz [Thu, 12 Dec 2013 17:48:33 +0000 (17:48 +0000)]
Use correct value pointing to previously selected FDT DTB.

Reviewed by: brooks
Sponsored by: DARPA, AFRL
MFC after: 1 week

10 years agoDo not try to probe/attach if attempt to add fbd child are failed.
ray [Thu, 12 Dec 2013 14:49:26 +0000 (14:49 +0000)]
Do not try to probe/attach if attempt to add fbd child are failed.

Sponsored by: The FreeBSD Foundation

10 years agoFix long known bug with handling device aliases residing not in devfs root.
mav [Thu, 12 Dec 2013 11:05:48 +0000 (11:05 +0000)]
Fix long known bug with handling device aliases residing not in devfs root.

Historically creation of device aliases created symbolic links using only
name of target device as a link target, not considering current directory.
Fix that by adding number of "../" chunks to the terget device name,
required to get out of the current directory to devfs root first.

MFC after: 1 month

10 years agoSome more cleanups and bug fixes in dtc for property printing / parsing.
theraven [Thu, 12 Dec 2013 08:55:24 +0000 (08:55 +0000)]
Some more cleanups and bug fixes in dtc for property printing / parsing.

Submitted by: Patrick Wildt

10 years agoFix the version string in dts emission.
theraven [Thu, 12 Dec 2013 08:48:45 +0000 (08:48 +0000)]
Fix the version string in dts emission.

Reported by: Patrick Wildt
MFC after: 1 week

10 years agoSet chain bit correctly. This will fix some problems sending and
hselasky [Thu, 12 Dec 2013 08:34:51 +0000 (08:34 +0000)]
Set chain bit correctly. This will fix some problems sending and
receiving Zero Length Packets, ZLPs. See comment in code for more
information.

MFC after: 1 week
Reported by: Kohji Okuno <okuno.kohji@jp.panasonic.com>

10 years agoFix bug introduced at r256607. We have to recalculate bp_resid here since
mav [Thu, 12 Dec 2013 08:23:28 +0000 (08:23 +0000)]
Fix bug introduced at r256607.  We have to recalculate bp_resid here since
sizes of original and completed requests may differ due to end of media.

Bisected by: pho

10 years agoPrevent release build errors found during snapshot builds where if
gjb [Thu, 12 Dec 2013 05:49:27 +0000 (05:49 +0000)]
Prevent release build errors found during snapshot builds where if
NOPORTS=1, pkg-stage.sh cannot build the ports-mgmt/pkg port if
WITH_DVD=1.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

10 years agoFBT now does work fully on PowerPC.
jhibbits [Thu, 12 Dec 2013 04:12:19 +0000 (04:12 +0000)]
FBT now does work fully on PowerPC.

MFC after: 2 weeks

10 years agoAllow pmap_remove_pages() to be called for physical maps not
marcel [Thu, 12 Dec 2013 03:04:00 +0000 (03:04 +0000)]
Allow pmap_remove_pages() to be called for physical maps not
associated with the current thread.

Obtained from: alc@

10 years agosys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
asomers [Thu, 12 Dec 2013 00:27:22 +0000 (00:27 +0000)]
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
When a da or ada device dissappears, outstanding IOs fail with
ENXIO, not EIO.  The check for EIO was probably copied from Illumos,
where that is indeed the correct errno.

Without this change, pulling a busy drive from a zpool would usually
turn it into UNAVAIL, even though pulling an idle drive would turn
it into REMOVED.  With this change, it is REMOVED every time.

Also, vdev_geom_io_intr shouldn't do zfs_post_remove, because that
results in devd getting two resource.fs.zfs.removed events.  The
comment said that the event had to be sent directly instead of
through the async removal thread because "the DE engine is using
this information to discard prevoius I/O errors".  However, the fact
that vdev_geom_io_intr was never actually sending the events until
now, and that vdev_geom_orphan never sent them at all, and that
vdev_geom_orphan usually gets called about 2 seconds after the
actual removal, means that FreeBSD's userland can cope with a late
event just fine.

Approved by: ken (mentor)
Sponsored by: Spectra Logic Corporation
MFC after: 4 weeks

10 years agoCreate own free list for each of the first 32 possible allocation sizes.
mav [Wed, 11 Dec 2013 21:48:04 +0000 (21:48 +0000)]
Create own free list for each of the first 32 possible allocation sizes.
In case of 4K allocation quantum that means for allocations up to 128K.

With growth of memory fragmentation these lists may grow to quite a large
sizes (tenths and hundreds of thousands items).  Having in one list items
of different sizes in worst case may require full linear list traversal,
that may be very expensive.  Having lists for items of single size means
that unless user specify some alignment or border requirements (that are
very rare cases) first item found on the list should satisfy the request.

While running SPEC NFS benchmark on top of ZFS on 24-core machine with
84GB RAM this change reduces CPU time spent in vmem_xalloc() from 8%
and lock congestion spinning around it from 20% to invisible levels.
And that all is by the cost of just 26 more pointers per vmem instance.

If at some point our kernel will start to actively use KVA allocations
with odd sizes above 128K, something may need to be done to bigger lists
also.

10 years ago- Use <x86/mptable.h> instead of duplicating its definitions.
jhb [Wed, 11 Dec 2013 21:21:03 +0000 (21:21 +0000)]
- Use <x86/mptable.h> instead of duplicating its definitions.
- Switch to mmaping the table from RAM instead of reading it out of
  /dev/mem via read(2).

10 years agoUse fixed-width types for all fields in MP Table structures and pack
jhb [Wed, 11 Dec 2013 21:19:04 +0000 (21:19 +0000)]
Use fixed-width types for all fields in MP Table structures and pack
all the structures.  While here, move a helper struct only used in
the kernel parser out of this header since it is not part of the MP
specification itself.

10 years agoDestroy mtx lock when failed to allocate memory during attach.
mav [Wed, 11 Dec 2013 17:40:35 +0000 (17:40 +0000)]
Destroy mtx lock when failed to allocate memory during attach.

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after: 2 weeks

10 years agoFix a panic when booting with kernels that have FREEBBSD_COMPAT
gnn [Wed, 11 Dec 2013 17:18:10 +0000 (17:18 +0000)]
Fix a panic when booting with kernels that have FREEBBSD_COMPAT
4, 5, 6 or 43 by only thunking the data parameter for old ioctls
compatability ioctls instead of doing it for all of them.

Submitted by: jhb@

10 years agoLoose -> Lose so this sentence makes sense.
imp [Wed, 11 Dec 2013 15:32:28 +0000 (15:32 +0000)]
Loose -> Lose so this sentence makes sense.

MFC after: 3 days

10 years agocalendar(1): use strlcpy instead of strncpy
eadler [Wed, 11 Dec 2013 14:54:58 +0000 (14:54 +0000)]
calendar(1): use strlcpy instead of strncpy

use strlcpy instead of strncpy which avoids non-null-termination if the string is MAXPATHLEN bytes or longer.

10 years agoUSB method structures for USB controllers and USB pipes should be
hselasky [Wed, 11 Dec 2013 13:20:32 +0000 (13:20 +0000)]
USB method structures for USB controllers and USB pipes should be
constant and does not need to be modified. This also saves a small
amount of RAM.

10 years agoFix typo when initializing the vlapic version register ('<<' instead of '<').
neel [Wed, 11 Dec 2013 06:28:44 +0000 (06:28 +0000)]
Fix typo when initializing the vlapic version register ('<<' instead of '<').

10 years agoFix one race and one fence post error. When the TX buffer was
imp [Wed, 11 Dec 2013 05:32:29 +0000 (05:32 +0000)]
Fix one race and one fence post error. When the TX buffer was
completely full, we'd not complete any of the mbufs due to the fence
post error (this creates a large leak). When this is fixed, we still
leak, but at a much smaller rate due to a race between ateintr and
atestart_locked as well as an asymmetry where atestart_locked is
called from elsewhere.  Ensure that we free in-flight packets that
have completed there as well. Also remove needless check for NULL on
mb, checked earlier in the loop and simplify a redundant if.

MFC after: 3 days

10 years agoCorrect the check for errors from proc_rwmem().
markj [Wed, 11 Dec 2013 04:31:40 +0000 (04:31 +0000)]
Correct the check for errors from proc_rwmem().

MFC after: 2 weeks

10 years agoMigrate tools/regression/bin/ tests to the new layout.
jmmv [Wed, 11 Dec 2013 04:09:17 +0000 (04:09 +0000)]
Migrate tools/regression/bin/ tests to the new layout.

This change is a proof of concept on how to easily integrate existing
tests from the tools/regression/ hierarchy into the /usr/tests/ test
suite and on how to adapt them to the new layout for src.

To achieve these goals, this change:

- Moves tests from tools/regression/bin/<tool>/ to bin/<tool>/tests/.
- Renames the previous regress.sh files to legacy_test.sh.
- Adds Makefiles to build and install the tests and all their supporting
  data files into /usr/tests/bin/.
- Plugs the legacy_test test programs into the test suite using the new
  TAP backend for Kyua (appearing in 0.8) so that the code of the test
  programs does not have to change.
- Registers the new directories in the BSD.test.dist mtree file.

Reviewed by: freebsd-testing
Approved by: rpaulo (mentor)

10 years agoMake bsd.progs.mk work in directories with SCRIPTS but no PROGS.
jmmv [Wed, 11 Dec 2013 03:41:07 +0000 (03:41 +0000)]
Make bsd.progs.mk work in directories with SCRIPTS but no PROGS.

This change fixes some cases where bsd.progs.mk would fail to handle
directories with SCRIPTS but no PROGS.  In particular, "install" did
not handle such scripts nor dependent files when bsd.subdir.mk was
added to the mix.

This is "make tinderbox" clean.

Reviewed by: freebsd-testing
Approved by: rpaulo (mentor)

10 years agoAdd tap.test.mk.
jmmv [Wed, 11 Dec 2013 03:39:50 +0000 (03:39 +0000)]
Add tap.test.mk.

This file provides support to build test programs that comply with the
Test Anything Protocol.  Its main goal is to support the painless
integration of existing tests from tools/regression/ into the Kyua-based
test suite.

Approved by: rpaulo (mentor)

10 years agoFix x2apic support in bhyve.
neel [Tue, 10 Dec 2013 22:56:51 +0000 (22:56 +0000)]
Fix x2apic support in bhyve.

When the guest is bringing up the APs in the x2APIC mode a write to the
ICR register will now trigger a return to userspace with an exitcode of
VM_EXITCODE_SPINUP_AP. This gets SMP guests working again with x2APIC.

Change the vlapic timer lock to be a spinlock because the vlapic can be
accessed from within a critical section (vm run loop) when guest is using
x2apic mode.

Reviewed by: grehan@

10 years agoThe opt_*.h headers must be included before any system header, except
kib [Tue, 10 Dec 2013 22:33:02 +0000 (22:33 +0000)]
The opt_*.h headers must be included before any system header, except
sys/cdefs.h.  In particular, in case of COMPAT_43, param.h includes
sys/types.h, which includes sys/select.h, which includes
sys/_sigset.h.  The _sigset.h customizes the provided definions based
on COMPAT_43, eliminating osigset_t if symbol is not defined.  The
sys/proc.h is included after opt_compat.h and needs osigset_t.

Move opt_compat.h inclusion into the right place.

Sponsored by: The FreeBSD Foundation

10 years agoCorrect license statements to reflect the fact that these files were all
jhb [Tue, 10 Dec 2013 22:13:36 +0000 (22:13 +0000)]
Correct license statements to reflect the fact that these files were all
derived from sys/arm/mv/bus_space.c.

Approved by: core

10 years agoFix detection of EOF in kern_physio(). If bio_length was clipped by
kib [Tue, 10 Dec 2013 21:15:18 +0000 (21:15 +0000)]
Fix detection of EOF in kern_physio().  If bio_length was clipped by
the excess code in g_io_check(), bio_resid is also truncated by
g_io_deliver().  As result, bufdonebio() assigns truncated value to
the buffer b_resid field.

Use the residual bio_completed to calculate buffer b_resid from
b_bcount in bufdonebio(), instead of bio_resid, calculated from
bio_length in g_io_deliver().

The issue is seemingly caused by the code rearrange into g_io_check(),
which is not present in stable/10.  The change still looks as the
useful change to have in 10 nevertheless.

Reported by: Stefan Hegnauer <stefan.hegnauer@gmx.ch>
Tested by: pho, Stefan Hegnauer <stefan.hegnauer@gmx.ch>
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

10 years agoReturn the correct IEEE 1275 code for "nextprop".
nwhitehorn [Tue, 10 Dec 2013 21:01:28 +0000 (21:01 +0000)]
Return the correct IEEE 1275 code for "nextprop".

10 years agoOnly assert the length of the passed bio in the mdstart_vnode() when
kib [Tue, 10 Dec 2013 20:52:31 +0000 (20:52 +0000)]
Only assert the length of the passed bio in the mdstart_vnode() when
the bio is unmapped, so we must map the bio pages into pbuf.  This
works around the geom classes which do not follow the MAXPHYS limit on
the i/o size, since such classes do not know about unmapped bios
either.

Reported by: Paolo Pinto <paolo.pinto@netasq.com>
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

10 years agoDo not DELAY() for P-state transition unless we want to see the result.
mav [Tue, 10 Dec 2013 20:25:43 +0000 (20:25 +0000)]
Do not DELAY() for P-state transition unless we want to see the result.

Intel manual says: "If a transition is already in progress, transition to
a new value will subsequently take effect. Reads of IA32_PERF_CTL determine
the last targeted operating point."  So seems it should be fine to just
trigger wanted transition and go.  Linux does the same.

MFC after: 1 month

10 years agoCheck remote protocol version only for the first connection (when it
trociny [Tue, 10 Dec 2013 20:09:49 +0000 (20:09 +0000)]
Check remote protocol version only for the first connection (when it
is actually sent by the remote node).

Otherwise it generated confusing "Negotiated protocol version 1" debug
messages when processing the second connection.

MFC after: 2 weeks

10 years agoSend wakeup to threads waiting on empty queue before releasing the
trociny [Tue, 10 Dec 2013 20:06:41 +0000 (20:06 +0000)]
Send wakeup to threads waiting on empty queue before releasing the
lock to decrease spurious wakeups.

Submitted by: davidxu
MFC after: 2 weeks

10 years agoIn remote_send_thread, if sending a request fails don't take the
trociny [Tue, 10 Dec 2013 20:05:07 +0000 (20:05 +0000)]
In remote_send_thread, if sending a request fails don't take the
request back from the receive queue -- it might already be processed
by remote_recv_thread, which lead to crashes like below:

  (primary) Unable to receive reply header: Connection reset by peer.
  (primary) Unable to send request (Connection reset by peer):
      WRITE(954662912, 131072).
  (primary) Disconnected from kopusha:7772.
  (primary) Increasing localcnt to 1.
  (primary) Assertion failed: (old > 0), function refcnt_release,
      file refcnt.h, line 62.

Taking the request back was not necessary (it would properly be
processed by the remote_recv_thread) and only complicated things.

MFC after: 2 weeks