]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
10 years agoBring in the mpr(4) driver for LSI's MPT3 12Gb SAS controllers.
ken [Fri, 2 May 2014 20:25:09 +0000 (20:25 +0000)]
Bring in the mpr(4) driver for LSI's MPT3 12Gb SAS controllers.

This is derived from the mps(4) driver, but it supports only the 12Gb
IT and IR hardware including the SAS 3004, SAS 3008 and SAS 3108.

Some notes about this driver:
 o The 12Gb hardware can do "FastPath" I/O, and that capability is included in
   this driver.

 o WarpDrive functionality has been removed, since it isn't supported in
   the 12Gb driver interface.

 o The Scatter/Gather list handling code is significantly different between
   the 6Gb and 12Gb hardware.  The 12Gb boards support IEEE Scatter/Gather
   lists.

Thanks to LSI for developing and testing this driver for FreeBSD.

share/man/man4/mpr.4:
mpr(4) man page.

sys/dev/mpr/*:
mpr(4) driver files.

sys/modules/Makefile,
sys/modules/mpr/Makefile:
Add a module Makefile for the mpr(4) driver.

sys/conf/files:
Add the mpr(4) driver.

sys/amd64/conf/GENERIC,
sys/i386/conf/GENERIC,
sys/mips/conf/OCTEON1,
sys/sparc64/conf/GENERIC:
Add the mpr(4) driver to all config files that currently
have the mps(4) driver.

sys/ia64/conf/GENERIC:
Add the mps(4) and mpr(4) drivers to the ia64 GENERIC
config file.

sys/i386/conf/XEN:
Exclude the mpr module from building here.

Submitted by: Steve McConnell <Stephen.McConnell@lsi.com>
MFC after: 3 days
Tested by: Chris Reeves <chrisr@spectralogic.com>
Sponsored by: LSI, Spectra Logic
Relnotes: LSI 12Gb SAS driver mpr(4) added

10 years agoFix a panic caused by doing "ifconfig -am" while a lagg is being destroyed.
asomers [Fri, 2 May 2014 16:24:09 +0000 (16:24 +0000)]
Fix a panic caused by doing "ifconfig -am" while a lagg is being destroyed.
The thread that is destroying the lagg has already set sc->sc_psc=NULL when
the "ifconfig -am" thread gets to lacp_req().  It tries to dereference
sc->sc_psc and panics.  The solution is for lacp_req() to check the value of
sc->sc_psc.  If NULL, harmlessly return an lacp_opreq structure full of
zeros.  Full details in GNATS.

PR: kern/189003
Reviewed by: timeout on freebsd-net@
MFC after: 3 weeks
Sponsored by: Spectra Logic Corporation

10 years agogcc: fix strict alignment.
pfg [Fri, 2 May 2014 16:15:34 +0000 (16:15 +0000)]
gcc: fix strict alignment.

From the OpenBSD log:

x86-64 ABI requires arrays greater than 16 bytes to be aligned to
16byte boundary.  However, GCC 16-byte aligns arrays of >=16 BITS,
not BYTES.

This diff improves bug detectability for code which has local arrays
of [16 .. 127] bits:  in those cases SSP will now detect even 1-byte
overflows.

Obtained from: OpenBSD (CVS rev 1.4)
MFC after: 1 week

10 years agoClarify that MAKEOBJDIRPREFIX and MAKEOBJDIR are not
gjb [Fri, 2 May 2014 15:52:50 +0000 (15:52 +0000)]
Clarify that MAKEOBJDIRPREFIX and MAKEOBJDIR are not
honored as make(1) arguments.

Requested by: smh
MFC After: 3 days
Sponsored by: The FreeBSD Foundation

10 years agoAdd -J to filter by matching jail IDs and names.
bdrewery [Fri, 2 May 2014 15:05:47 +0000 (15:05 +0000)]
Add -J to filter by matching jail IDs and names.

-J 0 can be used to show only host processes.

Patch partially based on work by bz@

PR: bin/78763
MFC after: 2 weeks
Relnotes: yes

10 years agoClean up more lindev(4) vestiges.
brueffer [Fri, 2 May 2014 11:09:01 +0000 (11:09 +0000)]
Clean up more lindev(4) vestiges.

10 years agoRemoved pointless / duplicated call to trim_map_first.
smh [Fri, 2 May 2014 09:31:21 +0000 (09:31 +0000)]
Removed pointless / duplicated call to trim_map_first.

MFC after: 1 month
X-MFC-With: r265152

10 years agolibdev(4) has been removed, get rid of the module as well to fix the build.
brueffer [Fri, 2 May 2014 09:24:06 +0000 (09:24 +0000)]
libdev(4) has been removed, get rid of the module as well to fix the build.

Submitted by: Sainath Varanasi

10 years agoGarbage collect mtxpool_lockbuilder, the mutex pool historically used
rwatson [Fri, 2 May 2014 07:57:40 +0000 (07:57 +0000)]
Garbage collect mtxpool_lockbuilder, the mutex pool historically used
for lockmgr and sx interlocks, but unused since optimised versions of
those sleep locks were introduced.  This will save a (quite) small
amount of memory in all kernel configurations.  The sleep mutex pool is
retained as it is used for 'struct bio' and several other consumers.

Discussed with: jhb
MFC after: 3 days

10 years agolindev(4): finish the partial commit in r265212
eadler [Fri, 2 May 2014 07:14:22 +0000 (07:14 +0000)]
lindev(4): finish the partial commit in r265212

lindev(4) was only used to provide /dev/full which is now a standard feature of
FreeBSD.  /dev/full was never linux-specific and provides a generally useful
feature.

Document this in UPDATING and bump __FreeBSD_version.  This will be documented
in the PH shortly.

Reported by: jkim

10 years agolindev(4): remove the device
eadler [Fri, 2 May 2014 05:30:49 +0000 (05:30 +0000)]
lindev(4): remove the device

lindev(4) was only used to provide /dev/full which is now a standard feature of
FreeBSD.  /dev/full was never linux-specific and provides a generally useful
feature.

Document this in UPDATING and bump __FreeBSD_version.  This will be documented
in the PH shortly.

Reported by: jkim

10 years agoDon't allow MPtable generation if there are multiple PCI hierarchies. This is
neel [Fri, 2 May 2014 04:51:31 +0000 (04:51 +0000)]
Don't allow MPtable generation if there are multiple PCI hierarchies. This is
because there isn't a standard way to relay this information to the guest OS.

Add a command line option "-Y" to bhyve(8) to inhibit MPtable generation.

If the virtual machine is using PCI devices on buses other than 0 then it can
still use ACPI tables to convey this information to the guest.

Discussed with: grehan@

10 years agoHonor the max-frequency property if it appears in the fdt data.
ian [Fri, 2 May 2014 01:28:19 +0000 (01:28 +0000)]
Honor the max-frequency property if it appears in the fdt data.
Adjust the exynos and zedboard dts files to use max-frequency (the
documented standard property) instead of clock-frequency.

Submitted by: Thomas Skibo <ThomasSkibo@sbcglobal.net>

10 years agoSwitch to use arm_devmap_add_entry() to setup static device mapping.
ganbold [Fri, 2 May 2014 01:20:13 +0000 (01:20 +0000)]
Switch to use arm_devmap_add_entry() to setup static device mapping.

Approved by: stas (mentor)

10 years agoIgnore the error from pipespace_new when creating a pipe.
mjg [Fri, 2 May 2014 00:52:13 +0000 (00:52 +0000)]
Ignore the error from pipespace_new when creating a pipe.

It can fail if pipe map is exhausted (as a result of too many pipes created),
but it is not fatal and could be provoked by unprivileged users. The only
consequence is worse performance with given pipe.

Reported by: ivoras
Suggested by: kib
MFC after: 1 week

10 years agoAdd tracking for self-generated frames when the VAP is in sleep state.
adrian [Fri, 2 May 2014 00:48:09 +0000 (00:48 +0000)]
Add tracking for self-generated frames when the VAP is in sleep state.

The hardware can generate its own frames (eg RTS/CTS exchanges, other
kinds of 802.11 management stuff, especially when it comes to 802.11n)
and these also have PWRMGT flags.  So if the VAP is asleep but the
NIC is in force-awake for some reason, ensure that the self-generated
frames have PWRMGT set to 1.

Now, this (like basically everything to do with powersave) is still
racy - the only way to guarantee that it's all actually consistent
is to pause transmit and let it finish before transitioning the VAP
to sleep, but this at least gets the basic method of tracking and
updating the state debugged.

Tested:

* AR5416, STA mode
* AR9380, STA mode

10 years agoAdd logic in the HLT exit handler to detect if the guest has put all vcpus
neel [Fri, 2 May 2014 00:33:56 +0000 (00:33 +0000)]
Add logic in the HLT exit handler to detect if the guest has put all vcpus
to sleep permanently by executing a HLT with interrupts disabled.

When this condition is detected the guest with be suspended with a reason of
VM_SUSPEND_HALT and the bhyve(8) process will exit.

Tested by executing "halt" inside a RHEL7-beta guest.

Discussed with: grehan@
Reviewed by: jhb@, tychon@

10 years agoregex: Remove some unreachable breaks.
pfg [Thu, 1 May 2014 23:34:14 +0000 (23:34 +0000)]
regex: Remove some unreachable breaks.

This is based on a much bigger cleanup done in Illumos.

Reference:
https://www.illumos.org/issues/2077

MFC after: 1 week

10 years agoFix a 2038 bug.
brooks [Thu, 1 May 2014 22:28:14 +0000 (22:28 +0000)]
Fix a 2038 bug.

If time_t is 64-bit (i.e. isn't 32-bit) allow any value of year, not
just years less than 2038.

Don't bother fixing the underflow in the case of years before 1903.

MFC after: 1 week
Sponsored by: DARPA, AFRL

10 years agoFix a leak in g_uzip_taste(). After retrieve all the block offsets from
loos [Thu, 1 May 2014 15:23:20 +0000 (15:23 +0000)]
Fix a leak in g_uzip_taste().  After retrieve all the block offsets from
the uzip image, free the last data read.

10 years agoFix rnh_walktree_from() function (patch from kern/174959).
melifaro [Thu, 1 May 2014 15:04:32 +0000 (15:04 +0000)]
Fix rnh_walktree_from() function (patch from kern/174959).
Require valid netmask to be passed since host route is always a leaf.

PR: kern/174959
Submitted by: Keith Sklower
MFC after: 2 weeks

10 years agoActually the FEATURE() macro is defined on sys/sysctl.h.
loos [Thu, 1 May 2014 14:59:04 +0000 (14:59 +0000)]
Actually the FEATURE() macro is defined on sys/sysctl.h.

Pointyhat to: loos

10 years agoSome style and whitespace fixes. Reduce the difference between geom_uzip(4)
loos [Thu, 1 May 2014 14:47:27 +0000 (14:47 +0000)]
Some style and whitespace fixes.  Reduce the difference between geom_uzip(4)
and geom_uncompress(4).  Now, they produce an almost clean diff(1) output.

Remove a duplicated variable from g_uncompress.c and an unnecessary header
from g_uzip.c.

No functional changes.

10 years agoRemove unnecessary headers. Sort out the headers. Add a missing header on
loos [Thu, 1 May 2014 14:09:47 +0000 (14:09 +0000)]
Remove unnecessary headers.  Sort out the headers.  Add a missing header on
ofw_gpiobus.c (it was working because of sys/libkern.h).

10 years agoUse mkimg instead of md(4) and gpart.
nwhitehorn [Thu, 1 May 2014 03:24:41 +0000 (03:24 +0000)]
Use mkimg instead of md(4) and gpart.

10 years agoAdd freebsd-boot to recognized partition types.
nwhitehorn [Thu, 1 May 2014 03:24:20 +0000 (03:24 +0000)]
Add freebsd-boot to recognized partition types.

10 years agocitrus: Avoid invalid code points.
pfg [Thu, 1 May 2014 01:42:48 +0000 (01:42 +0000)]
citrus: Avoid invalid code points.

From the OpenBSD log:
The UTF-8 decoder should not accept byte sequences which decode to unicode
code positions U+D800 to U+DFFF (UTF-16 surrogates), U+FFFE, and U+FFFF.

http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
http://unicode.org/faq/utf_bom.html#utf8-4

Reported by: Stefan Sperling
Obtained from: OpenBSD
MFC after: 5 days

10 years agoProvide an alias for the userboot console and name it 'comconsole'.
grehan [Thu, 1 May 2014 00:12:24 +0000 (00:12 +0000)]
Provide an alias for the userboot console and name it 'comconsole'.
This allows existing loader.conf files that set "console=comconsole"
to work without failing. No functional difference otherwise.

Reported by: Michael Dexter, pfSense install.
Reviewed by: neel
MFC after: 3 weeks

10 years agoSmall cleanup: mostly whitespace vs. tabs.
pfg [Wed, 30 Apr 2014 21:19:46 +0000 (21:19 +0000)]
Small cleanup: mostly whitespace vs. tabs.

10 years agoFix logic error. <blush>
imp [Wed, 30 Apr 2014 20:52:38 +0000 (20:52 +0000)]
Fix logic error. <blush>

Submitted by: ian@

10 years agoTurns out this .if evaluated not in the context of the makedtb target
imp [Wed, 30 Apr 2014 20:47:40 +0000 (20:47 +0000)]
Turns out this .if evaluated not in the context of the makedtb target
sometimes due to Makefile expansion rules. Make the test for things
being NULL elsewhere...

10 years agoRespect MAXIMUM TRANSFER LENGTH field of Block Limits VPD page.
mav [Wed, 30 Apr 2014 19:44:31 +0000 (19:44 +0000)]
Respect MAXIMUM TRANSFER LENGTH field of Block Limits VPD page.

Nobody yet reported disk supporting I/Os less then our MAXPHYS value, but
since we any way have code to read Block Limits VPD page, that is easy.

MFC after: 2 weeks

10 years agokldxref: Clean up error reporting
emaste [Wed, 30 Apr 2014 18:11:53 +0000 (18:11 +0000)]
kldxref: Clean up error reporting

Omit "too many sections" warnings if the ELF file is not dynamically
linked (and is therefore skipped anyway), and otherwise output it only
once.  An errant core file would previously cause kldxref to output a
number of warnings.

Also introduce a MAXSEGS #define and replace literal 2 with it, to make
comparisons clear.

Reviewed by: kib
Sponsored by: The FreeBSD Foundation

10 years agoThis was copied to IMX6, which has since evolved further. Remove this
imp [Wed, 30 Apr 2014 18:02:19 +0000 (18:02 +0000)]
This was copied to IMX6, which has since evolved further. Remove this
as it is no longer needed.

10 years agoOmit from the universe build all config files tagged with
imp [Wed, 30 Apr 2014 18:02:10 +0000 (18:02 +0000)]
Omit from the universe build all config files tagged with
#NO_UNIVERSE. Many of these config files are important examples, but
add little to no regresive value to the intended purpose of
UNIVERSE. We now build over 120 kernels during universe. There's
really little to no value to this over building say 60 or even 30 of
them (either is still a way too big number). This is especially true
for kernels that are nothing more than including a common base and
adding a static DTB file. Start by pruning 1/3 of the arm kernels that
add little regresion value.

10 years agoAllow FDT_DTS_FILE to be a list, either in the makedtb target, or in a
imp [Wed, 30 Apr 2014 18:02:04 +0000 (18:02 +0000)]
Allow FDT_DTS_FILE to be a list, either in the makedtb target, or in a
kernel config file. If you also want to have a static DTB compiled
into your kernel, however, it cannot be a list. We have no mechanism
in the kernel for picking one, so that doesn't make sense and will
result in a compile-time error.

10 years agoReintroduce priority for the TRIM ZIOs instead of using the "NOW" priority
smh [Wed, 30 Apr 2014 17:46:29 +0000 (17:46 +0000)]
Reintroduce priority for the TRIM ZIOs instead of using the "NOW" priority

The changes how TRIM requests are generated to use ZIO_TYPE_FREE + a priority
instead of ZIO_TYPE_IOCTL, until processed by vdev_geom; only then is it
translated the required geom values. This reduces the amount of changes
required for FREE requests to be supported by the new IO scheduler. This
also eliminates the need for a specific DKIOCTRIM.

Also fixed FREE vdev child IO's from running ZIO_STAGE_VDEV_IO_DONE as part
of their schedule.

As the new IO scheduler can result in a request to execute one type of IO to
actually run a different type of IO it requires that zio_trim requests are
processed without holding the trim map lock (tm->tm_lock), as the free request
execute call may result in write request running hence triggering a
trim_map_write_start call, which takes the trim map lock and hence would result
in recused on no-recursive sx lock.

This is based off avg's original work, so credit to him.

MFC after: 1 month

10 years agoDo not reread SCSI disk VPD pages on every device open.
mav [Wed, 30 Apr 2014 17:38:26 +0000 (17:38 +0000)]
Do not reread SCSI disk VPD pages on every device open.

Instead of rereading VPD pages on every device open, do it only on initial
device probe, and in cases when device reported via UNIT ATTENTIONs that
something has changed.  Capacity is still rereaded on every open because
it is more critical for operation and more probable to change in run time.

On my tests with Intel 530 SSDs on mps(4) HBA this change reduces time
GEOM needs to retaste the device (that includes few open/close cycles)
from ~150ms to ~30ms.

MFC after: 2 weeks
Sponsored by: iXsystems, Inc.

10 years agoMake uninteresting PCI devices with no attached drivers only print out
smh [Wed, 30 Apr 2014 16:42:12 +0000 (16:42 +0000)]
Make uninteresting PCI devices with no attached drivers only print out
on a verbose boot

MFC after: 2 weeks

10 years agoConvert the Zynq SoC support to the new routines for static device mapping.
ian [Wed, 30 Apr 2014 14:38:13 +0000 (14:38 +0000)]
Convert the Zynq SoC support to the new routines for static device mapping.

10 years agoDon't forget to remember previous element at the end of the loop.
pjd [Wed, 30 Apr 2014 09:58:28 +0000 (09:58 +0000)]
Don't forget to remember previous element at the end of the loop.

Reported by: brueffer
Found with: Coverity Prevent(tm)
CID: 1135301

10 years agoDocument m_get2().
kevlo [Wed, 30 Apr 2014 08:51:30 +0000 (08:51 +0000)]
Document m_get2().

Reviewed by: glebius

10 years agoChange type from int to short to match function prototypes.
kevlo [Wed, 30 Apr 2014 07:17:51 +0000 (07:17 +0000)]
Change type from int to short to match function prototypes.

Reviewed by: glebius

10 years agoAdd missing comma
eadler [Wed, 30 Apr 2014 06:54:35 +0000 (06:54 +0000)]
Add missing comma

Relnotes: yes (/dev/full)

10 years agonull.c: uio is unused
eadler [Wed, 30 Apr 2014 06:40:30 +0000 (06:40 +0000)]
null.c: uio is unused

Mark another parameter as unused

Reported by: rpaulo

10 years agoman pages: add missing comma
eadler [Wed, 30 Apr 2014 06:34:53 +0000 (06:34 +0000)]
man pages: add missing comma

Reported by: brueffer

10 years agonull.c: fix ordering
eadler [Wed, 30 Apr 2014 06:30:37 +0000 (06:30 +0000)]
null.c: fix ordering

Use a consistent ordering of full -> null -> zero (alphabetical) in null.c

Reported by: mjg

10 years agoAdd a /dev/full device.
eadler [Wed, 30 Apr 2014 06:20:48 +0000 (06:20 +0000)]
Add a /dev/full device.

/dev/full is similar to /dev/zero except it always returns
ENOSPC when you attempt to write to it.

Reviewed by: jhibbits
Discussed with: rpaulo

10 years agoFix TCP reassembly vulnerability.
delphij [Wed, 30 Apr 2014 04:02:57 +0000 (04:02 +0000)]
Fix TCP reassembly vulnerability.

Patch done by: glebius
Security: FreeBSD-SA-14:08.tcp
Security: CVE-2014-3000

10 years agoFix OpenSSL use-after-free vulnerability.
delphij [Wed, 30 Apr 2014 04:02:36 +0000 (04:02 +0000)]
Fix OpenSSL use-after-free vulnerability.

Obtained from: OpenBSD
Security: FreeBSD-SA-14:09.openssl
Security: CVE-2010-5298

10 years agoFix devfs rules not applied by default for jails.
delphij [Wed, 30 Apr 2014 04:02:32 +0000 (04:02 +0000)]
Fix devfs rules not applied by default for jails.

Security: FreeBSD-SA-14:07.devfs
Security: CVE-2014-3001

10 years ago* Modify the beacon interval in debugging to be ni_intval, not 102400
adrian [Wed, 30 Apr 2014 02:44:07 +0000 (02:44 +0000)]
* Modify the beacon interval in debugging to be ni_intval, not 102400
* Be paranoid about avoiding divide-by-zero.

Tested:

* AR9380, STA mode

10 years agoAdd ar9300_get_next_tbtt().
adrian [Wed, 30 Apr 2014 02:29:31 +0000 (02:29 +0000)]
Add ar9300_get_next_tbtt().

Tested:

* AR9380, STA mode

10 years agoBring over some initial power save management support, reset path
adrian [Wed, 30 Apr 2014 02:19:41 +0000 (02:19 +0000)]
Bring over some initial power save management support, reset path
fixes and beacon programming / debugging into the ath(4) driver.

The basic power save tracking:

* Add some new code to track the current desired powersave state; and
* Add some reference count tracking so we know when the NIC is awake; then
* Add code in all the points where we're about to touch the hardware and
  push it to force-wake.

Then, how things are moved into power save:

* Only move into network-sleep during a RUN->SLEEP transition;
* Force wake the hardware up everywhere that we're about to touch
  the hardware.

The net80211 stack takes care of doing RUN<->SLEEP<->(other) state
transitions so we don't have to do it in the driver.

Next, when to wake things up:

* In short - everywhere we touch the hardware.
* The hardware will take care of staying awake if things are queued
  in the transmit queue(s); it'll then transit down to sleep if
  there's nothing left.  This way we don't have to track the
  software / hardware transmit queue(s) and keep the hardware
  awake for those.

Then, some transmit path fixes that aren't related but useful:

* Force EAPOL frames to go out at the lowest rate.  This improves
  reliability during the encryption handshake after 802.11
  negotiation.

Next, some reset path fixes!

* Fix the overlap between reset and transmit pause so we don't
  transmit frames during a reset.
* Some noisy environments will end up taking a lot longer to reset
  than normal, so extend the reset period and drop the raise the
  reset interval to be more realistic and give the hardware some
  time to finish calibration.
* Skip calibration during the reset path.  Tsk!

Then, beacon fixes in station mode!

* Add a _lot_ more debugging in the station beacon reset path.
  This is all quite fluid right now.
* Modify the STA beacon programming code to try and take
  the TU gap between desired TSF and the target TU into
  account.  (Lifted from QCA.)

Tested:

* AR5210
* AR5211
* AR5212
* AR5413
* AR5416
* AR9280
* AR9285

TODO:

* More AP, IBSS, mesh, TDMA testing
* Thorough AR9380 and later testing!
* AR9160 and AR9287 testing

Obtained from: QCA

10 years agoIgnore writes to microcode update MSR. This MSR is accessed by RHEL7 guest.
neel [Wed, 30 Apr 2014 02:08:27 +0000 (02:08 +0000)]
Ignore writes to microcode update MSR. This MSR is accessed by RHEL7 guest.
Add KTR tracepoints to annotate wrmsr and rdmsr VM exits.

10 years agoOnly track the power state variable if the power state is changed,
adrian [Wed, 30 Apr 2014 02:03:47 +0000 (02:03 +0000)]
Only track the power state variable if the power state is changed,
not if the self-generated frame state is changed.

10 years ago* Only update ah_powerMode if we're setting the chip sleep state.
adrian [Wed, 30 Apr 2014 02:03:13 +0000 (02:03 +0000)]
* Only update ah_powerMode if we're setting the chip sleep state.
  Some code will appear soon that is actually setting the chip powerstate
  separate from the self-generated frames power state.
* Allow the AR5416 family chips to actually have the power state changed
  from the self generated state change.

Tested (STA mode):

* AR5210
* AR5211
* AR5412
* AR5413
* AR5416
* AR9285

10 years agoMake this declaration into a proper function prototype.
ian [Tue, 29 Apr 2014 23:29:28 +0000 (23:29 +0000)]
Make this declaration into a proper function prototype.

10 years agoUpdate comment.
marius [Tue, 29 Apr 2014 20:57:25 +0000 (20:57 +0000)]
Update comment.

10 years agoGiven that as of r258002 the last external user is gone, make sched_lock
marius [Tue, 29 Apr 2014 20:51:57 +0000 (20:51 +0000)]
Given that as of r258002 the last external user is gone, make sched_lock
static.

10 years agoBe consistent with the whitespace in the rest of these files.
rstone [Tue, 29 Apr 2014 20:49:47 +0000 (20:49 +0000)]
Be consistent with the whitespace in the rest of these files.

X-MFC-With: r264007

10 years agoPartially revert r265019 - allocating 512 bytes on stack
melifaro [Tue, 29 Apr 2014 19:48:11 +0000 (19:48 +0000)]
Partially revert r265019 - allocating 512 bytes on stack
can be too much for architectures like ARM. Always use rounded
malloc instead.

Discussed with: jmallett
MFC after: 4 weeks

10 years agoMove rt_setmetrics() from rtsock.c to route.c.
melifaro [Tue, 29 Apr 2014 19:14:42 +0000 (19:14 +0000)]
Move rt_setmetrics() from rtsock.c to route.c.
All rtsock-initiated rte creation/modification are now
performed in route.c holding radix tree write lock.
This reduces the need for per-rte mutex.

Sponsored by: Yandex LLC
MFC after: 1 month

10 years agoFix two cases of recursive acquisitions of the vm object lock, only
kib [Tue, 29 Apr 2014 19:02:34 +0000 (19:02 +0000)]
Fix two cases of recursive acquisitions of the vm object lock, only
possible in rare failure situations.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

10 years agoSome Linux guests will implement a 'halt' by disabling the APIC and executing
neel [Tue, 29 Apr 2014 18:42:56 +0000 (18:42 +0000)]
Some Linux guests will implement a 'halt' by disabling the APIC and executing
the 'HLT' instruction. This condition was detected by 'vm_handle_hlt()' and
converted into the SPINDOWN_CPU exitcode . The bhyve(8) process would exit
the vcpu thread in response to a SPINDOWN_CPU and when the last vcpu was
spun down it would reset the virtual machine via vm_suspend(VM_SUSPEND_RESET).

This functionality was broken in r263780 in a way that made it impossible
to kill the bhyve(8) process because it would loop forever in
vm_handle_suspend().

Unbreak this by removing the code to spindown vcpus. Thus a 'halt' from
a Linux guest will appear to be hung but this is consistent with the
behavior on bare metal. The guest can be rebooted by using the bhyvectl
options '--force-reset' or '--force-poweroff'.

Reviewed by: grehan@

10 years agoFor the VM_PHYSSEG_DENSE case, checking the requested range to fall
kib [Tue, 29 Apr 2014 18:42:37 +0000 (18:42 +0000)]
For the VM_PHYSSEG_DENSE case, checking the requested range to fall
into the area backed by vm_page_array wrongly compared end with
vm_page_array_size.  It should be adjusted by first_page index to be
correct.

Also, the corner and incorrect case of the requested range extending
after the end of the vm_page_array was incorrectly handled by
allocating the segment.

Fix the comparision for the end of range and return EINVAL if the end
extends beyond vm_page_array.

Discussed with: royger
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

10 years agoAdd SMP support for Zedboard.
ian [Tue, 29 Apr 2014 17:48:57 +0000 (17:48 +0000)]
Add SMP support for Zedboard.

Submitted by: Thomas Skibo <ThomasSkibo@sbcglobal.net>

10 years agoBump WITNESS_PENDLIST by MAXCPU to account for the
grehan [Tue, 29 Apr 2014 17:22:29 +0000 (17:22 +0000)]
Bump WITNESS_PENDLIST by MAXCPU to account for the
pmap pvlist locks which are scaled by MAXCPU.

This allows an amd64 system to boot with MAXCPU set
to 256, which is currently FreeBSD's hard limit without
x2apic support.

Compile-tested for other arch's.

PR: 185831
Discussed with: jhb
MFC after: 3 weeks

10 years agoMerge from CheriBSD:
brooks [Tue, 29 Apr 2014 16:57:25 +0000 (16:57 +0000)]
Merge from CheriBSD:

commit 1d1b908107255ffdff4d17f015d8f057d73cc6cb
Author: Brooks Davis <brooks@one-eyed-alien.net>
Date:   Fri Mar 28 16:24:45 2014 +0000

    Add a long needed seatbelt.

    Exit with an error when make is called without a target at the top level
    rather than poluting the source tree and causing use confusion in future
    builds.

commit a9d9aa341b2f4308a227ab460ba85f1f287ad028
Author: Brooks Davis <brooks@one-eyed-alien.net>
Date:   Tue Apr 29 16:06:12 2014 +0000

    Simplify seatbelt added in 1d1b908 based in feedback.

    Discussed with: imp@FreeBSD.org

Reviewed by: imp
Sponsored by: DARPA, AFRL

10 years agoFix "netstat -gW" behavior broken in r259638.
melifaro [Tue, 29 Apr 2014 16:51:28 +0000 (16:51 +0000)]
Fix "netstat -gW" behavior broken in r259638.
netstat has two options for printing multicast tables:
sysctl (the default one for live systems) and kvm-based one (for cores).
It looks like kvm-based one hasn't been working since it's been introduced
in r190012 due to absence of mfctablesize kernel symbol.
Check for all ipv4-multicast symbols being correctly resolved was introduced
in r259638 regardless of 'live' value leading to "No IPv4 MROUTING" error
message.

Reported by: Olivier Cochard-LabbĂ©
MFC after: 1 week

10 years agocitrus: Avoid invalid code points.
pfg [Tue, 29 Apr 2014 15:25:57 +0000 (15:25 +0000)]
citrus: Avoid invalid code points.

From the OpenBSD log:
The UTF-8 decoder should not accept byte sequences which decode to unicode
code positions U+D800 to U+DFFF (UTF-16 surrogates), U+FFFE, and U+FFFF.

http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
http://unicode.org/faq/utf_bom.html#utf8-4

Reported by: Stefan Sperling
Obtained from: OpenBSD
MFC after: 5 days

10 years agoAdd regression test for PR kern/189088.
asomers [Tue, 29 Apr 2014 15:12:23 +0000 (15:12 +0000)]
Add regression test for PR kern/189088.

PR: kern/189088
MFC after: 3 weeks
Sponsored by: Spectra Logic

10 years agoNLS is used by the build system.
imp [Tue, 29 Apr 2014 14:52:39 +0000 (14:52 +0000)]
NLS is used by the build system.

10 years agoFix a panic when removing an IP address from an interface, if the same address
asomers [Tue, 29 Apr 2014 14:46:45 +0000 (14:46 +0000)]
Fix a panic when removing an IP address from an interface, if the same address
exists on another interface.  The panic was introduced by change 264887, which
changed the fibnum parameter in the call to rtalloc1_fib() in
ifa_switch_loopback_route() from RT_DEFAULT_FIB to RT_ALL_FIBS.  The solution
is to use the interface fib in that call.  For the majority of users, that will
be equivalent to the legacy behavior.

PR: kern/189089
Reported by: neel
Reviewed by: neel
MFC after: 3 weeks
X-MFC with: 264887
Sponsored by: Spectra Logic

10 years agoDo not use senderr() in rtrequest1_fib_change().
melifaro [Tue, 29 Apr 2014 12:52:36 +0000 (12:52 +0000)]
Do not use senderr() in rtrequest1_fib_change().

Suggested by: glebius
MFC after: 4 weeks

10 years agoMerge r133175 from upstream:
marius [Tue, 29 Apr 2014 11:31:22 +0000 (11:31 +0000)]
Merge r133175 from upstream:

2008-03-13  Dennis Czeremin  <dennis.czeremin@smiths-heimann.com>

PR libstdc++/35566
* include/bits/stl_multimap.h (multimap<>::multimap(_InputIterator,
_InputIterator)): Forward to _M_insert_equal, not _M_insert_unique.

This patch was GPL2 at the time and fixes a regression introduced with
the merge of GCC r129013 in FreeBSD r236829.

MFC after: 3 days
Sponsored by: Bally Wulff Games & Entertainment GmbH

10 years agoAfter r264897 restore the ability to add bootoptions from FDT for
bz [Tue, 29 Apr 2014 07:48:07 +0000 (07:48 +0000)]
After r264897 restore the ability to add bootoptions from FDT for
platforms which do not use loaders or kernels that want to hardcode
options or for FDT passed in by loader.

Also fix a build issue by putting the kmdp variable accessed back under
the #ifdef FDT;  we may wish to revisit decision in which case more
code needs changing.

Submitted by: brooks

10 years agoAdd standard SYNOPSIS wording, fix typos, contractions and new sentence -> new line.
brueffer [Tue, 29 Apr 2014 07:45:21 +0000 (07:45 +0000)]
Add standard SYNOPSIS wording, fix typos, contractions and new sentence -> new line.

10 years agoFix formatting of the -a option in usage() to be consistent.
scottl [Tue, 29 Apr 2014 07:19:22 +0000 (07:19 +0000)]
Fix formatting of the -a option in usage() to be consistent.

Obtained from: Netflix, Inc.
MFC after: 3 days

10 years agoDocument the -a option that was added in r262424.
scottl [Tue, 29 Apr 2014 07:17:33 +0000 (07:17 +0000)]
Document the -a option that was added in r262424.

Obtained from: Netflix, Inc.
MFC after: 3 days

10 years agoRemove redundant include
bdrewery [Tue, 29 Apr 2014 01:17:43 +0000 (01:17 +0000)]
Remove redundant include

MFC after: 3 days

10 years agoAdd dependency for libm to libstdc++. This fixes high -j value builds
imp [Mon, 28 Apr 2014 23:16:46 +0000 (23:16 +0000)]
Add dependency for libm to libstdc++. This fixes high -j value builds
when not building with clang.

Submitted by: ian@

10 years agoAllow a virtual machine to be forcibly reset or powered off. This is done
neel [Mon, 28 Apr 2014 22:06:40 +0000 (22:06 +0000)]
Allow a virtual machine to be forcibly reset or powered off. This is done
by adding an argument to the VM_SUSPEND ioctl that specifies how the virtual
machine should be suspended, viz. VM_SUSPEND_RESET or VM_SUSPEND_POWEROFF.

The disposition of VM_SUSPEND is also made available to the exit handler
via the 'u.suspended' member of 'struct vm_exit'.

This capability is exposed via the '--force-reset' and '--force-poweroff'
arguments to /usr/sbin/bhyvectl.

Discussed with: grehan@

10 years agoRemove note about hw.bus.devctl_disable removal, restored
gjb [Mon, 28 Apr 2014 20:40:36 +0000 (20:40 +0000)]
Remove note about hw.bus.devctl_disable removal, restored
in r265060.

Sponsored by: The FreeBSD Foundation

10 years agoRevert r263754, re-adding support for hw.bus.devctl_disable. Breaking
brooks [Mon, 28 Apr 2014 20:38:08 +0000 (20:38 +0000)]
Revert r263754, re-adding support for hw.bus.devctl_disable.  Breaking
old devd's and thus hosts that get IP addresses from DHCP was too much
of a POLA violation.

The sysctl may be removed again after r263758 has been merged to at
least stable/9 and stable/10, and releases have been cut from those
branches.

Discussed with: mjg
Reported by: theraven, rwatson

10 years agoSet the new floating point exception mask correctly
andrew [Mon, 28 Apr 2014 18:54:12 +0000 (18:54 +0000)]
Set the new floating point exception mask correctly

Submitted by: Keith White <kwhite@site.uottawa.ca>

10 years agoImplement legacy interrupts for the AHCI device emulation
grehan [Mon, 28 Apr 2014 18:41:25 +0000 (18:41 +0000)]
Implement legacy interrupts for the AHCI device emulation
according to the method outlined in the AHCI spec.

Tested with FreeBSD 9/10/11 with MSI disabled,
and also NetBSD/amd64 (lightly).

Reviewed by: neel, tychon
MFC after: 3 weeks

10 years agoTurn off various fancy instruction sets, as well as deduplicate some options.
nwhitehorn [Mon, 28 Apr 2014 18:25:21 +0000 (18:25 +0000)]
Turn off various fancy instruction sets, as well as deduplicate some options.
This makes the EFI loader build work with CPUTYPE=native in make.conf on
my Core i5.

10 years agoAdd a C libary and a Python module that implements an API similar
marcel [Mon, 28 Apr 2014 18:06:11 +0000 (18:06 +0000)]
Add a C libary and a Python module that implements an API similar
to bus_space(9) and that uses the proto(4) driver for talking to
hardware. If the I/O resource is a memory mapped I/O resource,
then mmap(2) will be attempted to avoid read(2)/write(2) overhead.

Sponsored by: Juniper Networks, Inc.

10 years agoAdd proto(4): A driver for prototyping and diagnostics.
marcel [Mon, 28 Apr 2014 17:58:40 +0000 (17:58 +0000)]
Add proto(4): A driver for prototyping and diagnostics.
It exposes I/O resources to user space, so that programs can peek
and poke at the hardware. It does not itself have knowledge about
the hardware device it attaches to.

Sponsored by: Juniper Networks, Inc.

10 years agoReduce number of opens by REOM RAID during provider taste.
mav [Mon, 28 Apr 2014 15:03:52 +0000 (15:03 +0000)]
Reduce number of opens by REOM RAID during provider taste.

Instead opening/closing provider by each of metadata classes, do it only
once in core code.  Since for SCSI disks open/close means sending some
SCSI commands to the device, this change reduces taste time.

MFC after: 2 weeks
Sponsored by: iXsystems, Inc.

10 years agoDrop explicit unsigned from FD_SETSIZE constant
emaste [Mon, 28 Apr 2014 13:42:41 +0000 (13:42 +0000)]
Drop explicit unsigned from FD_SETSIZE constant

FD_SETSIZE is often used as an argument to select or compared with an
integer file descriptor.  Rather than force 3rd party software to add
explicit casts, just make it a plain (int) constant as on other
operating systems.

Previous discussion:
http://lists.freebsd.org/pipermail/freebsd-standards/2012-July/002410.html

10 years agoFix ZIO reordering done by vdev_queue_io causing panics when zio_vdev_io_start
smh [Mon, 28 Apr 2014 09:00:00 +0000 (09:00 +0000)]
Fix ZIO reordering done by vdev_queue_io causing panics when zio_vdev_io_start
returns ZIO_PIPELINE_CONTINUE from vdev_op_io_start to zio_execute resulting
in the wrong ZIO continuing its pipeline.

This is a serious issue which could cause data loss / corruption but appears
to be limited to error handling such as when vdev_readable(vd) returns false.

MFC after: 2 days

10 years agobsd-family-tree: Fix date
eadler [Mon, 28 Apr 2014 06:24:37 +0000 (06:24 +0000)]
bsd-family-tree: Fix date

10 years agoMove common device tree informations to separate dtsi files for A10 and A20 SoC.
ganbold [Mon, 28 Apr 2014 05:39:20 +0000 (05:39 +0000)]
Move common device tree informations to separate dtsi files for A10 and A20 SoC.
Change cubieboard1 and cubieboard2 dts files accordingly.

Approved by: stas (mentor)

10 years agoDon't use multiprocessing-extensions instruction on processors that don't
ian [Mon, 28 Apr 2014 02:35:28 +0000 (02:35 +0000)]
Don't use multiprocessing-extensions instruction on processors that don't
support SMP.

Submitted by: loos@
Pointy hat to: me

10 years agoMove duplicated code to print l2 cache config into the common code.
ian [Sun, 27 Apr 2014 23:47:38 +0000 (23:47 +0000)]
Move duplicated code to print l2 cache config into the common code.

10 years agoNote that the AR9380 and later hardware supports MYBEACON.
adrian [Sun, 27 Apr 2014 23:37:39 +0000 (23:37 +0000)]
Note that the AR9380 and later hardware supports MYBEACON.

(Yes, I said AR5416 in the committed code.  It's still strictly true.)

10 years agoNote that the AR5416 and later hardware supports the MYBEACON RX filter.
adrian [Sun, 27 Apr 2014 23:37:03 +0000 (23:37 +0000)]
Note that the AR5416 and later hardware supports the MYBEACON RX filter.

10 years ago* Add a new capability which returns whether the hardware supports
adrian [Sun, 27 Apr 2014 23:36:44 +0000 (23:36 +0000)]
* Add a new capability which returns whether the hardware supports
  the MYBEACON RX filter (only receive beacons which match the BSSID)
  or all beacons on the current channel.

* Add the relevant RX filter entry for MYBEACON.

Tested:

* AR5416, STA
* AR9285, STA

TODO:

* once the code is in -HEAD, just make sure that the code which uses it
  correctly sets BEACON for pre-AR5416 chips.

Obtained from: QCA, Linux ath9k