]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
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

10 years agoProgram the AR_TSFOOR_THRESHOLD register with a default lifted from
adrian [Sun, 27 Apr 2014 23:35:05 +0000 (23:35 +0000)]
Program the AR_TSFOOR_THRESHOLD register with a default lifted from
the QCA HAL.

This fires off an interrupt if the TSF from the AP / IBSS peer is
wildly out of range.  I'll add some code to the ath(4) driver soon
which makes use of this.

TODO:

* verify this didn't break TDMA!

10 years agoFix the AR_SLEEP1 and AR_SLEEP2 definitions. Oops!
adrian [Sun, 27 Apr 2014 23:33:37 +0000 (23:33 +0000)]
Fix the AR_SLEEP1 and AR_SLEEP2 definitions. Oops!

Tested:

* AR9285, STA
* AR5416, STA

Obtained from: QCA, Linux ath9k

10 years agoDo a read-after-write to ensure the interrupt register update is flushed
adrian [Sun, 27 Apr 2014 23:31:42 +0000 (23:31 +0000)]
Do a read-after-write to ensure the interrupt register update is flushed
to the hardware.

The QCA HAL has a comment noting that if this isn't done, modifications
to AR_IMR_S2 before AR_IMR is flushed may produce spurious interrupts.

Obtained from: QCA

10 years agoDisable the beastie menu for EFI console which doesn't support ANSI codes
dteske [Sun, 27 Apr 2014 22:18:33 +0000 (22:18 +0000)]
Disable the beastie menu for EFI console which doesn't support ANSI codes
(so things like `at-xy', `clear', and other commands don't work making it
impossible to generate a living menu).

Reviewed by: nwhitehorn, emaste

10 years agoFix build
melifaro [Sun, 27 Apr 2014 21:17:54 +0000 (21:17 +0000)]
Fix build

Found by: ian
Pointyhat to: me

10 years agoNo EFI on i386. This unbreaks the i386 VT kernel build.
nwhitehorn [Sun, 27 Apr 2014 20:36:19 +0000 (20:36 +0000)]
No EFI on i386. This unbreaks the i386 VT kernel build.

10 years agoExplain why wbinv_all is SMP-safe in this case, and add a missing l2 cache
ian [Sun, 27 Apr 2014 20:26:15 +0000 (20:26 +0000)]
Explain why wbinv_all is SMP-safe in this case, and add a missing l2 cache
flush.  (Either it was missing here, or it isn't needed in the minidump
case.  Adding it here seems like the safer path to consistancy.)

10 years agoFlush and invalidate caches on each CPU as part of handling IPI_STOP.
ian [Sun, 27 Apr 2014 20:16:51 +0000 (20:16 +0000)]
Flush and invalidate caches on each CPU as part of handling IPI_STOP.

Flushing the caches is required before doing a panic dump, but ARM
doesn't provide a flavor of flush that gets broadcast to other cores.
However, all cores except one are stopped before doing a dump, so this
works around the lack of a global flush/invalidate by doing it locally
on each CPU as part of stopping.

Discussed with: cognet@

10 years agoThere is no difference between IPI_STOP and IPI_STOP_HARD on ARM, so
ian [Sun, 27 Apr 2014 20:01:59 +0000 (20:01 +0000)]
There is no difference between IPI_STOP and IPI_STOP_HARD on ARM, so
map them both to the same interrupt number like other arches do.

10 years agoRemove cpu_idcache_wbinv_all() from kdb_cpu_trap(), it's no longer needed.
ian [Sun, 27 Apr 2014 18:12:55 +0000 (18:12 +0000)]
Remove cpu_idcache_wbinv_all() from kdb_cpu_trap(), it's no longer needed.

This was added ca. 2004 for the purpose of ensuring the caches were in the
right state after the debugger set a breakpoint.  kdb_cpu_sync_icache()
was added in 2007 to handle that situation, and now the wbinv_all is
actually harmful because the operation isn't broadcast to other cores.

10 years agoImprove memory allocation model for rt_msg2() rtsock messages:
melifaro [Sun, 27 Apr 2014 17:41:18 +0000 (17:41 +0000)]
Improve memory allocation model for rt_msg2() rtsock messages:
 * memory is now allocated as early as possible, without holding locks.
 * sysctl users are now guaranteed to get a response (M_WAITOK buffer prealloc).
 * socket users are more likely to use on-stack buffer for replies.
 * standard kernel malloc/free functions are now used instead of radix wrappers.
rt_msg2() has been renamed to rtsock_msg_buffer().

MFC after: 1 month

10 years agoTurn off the full witness trace on console output.
gjb [Sun, 27 Apr 2014 16:40:40 +0000 (16:40 +0000)]
Turn off the full witness trace on console output.

On head/, or more specifically, when WITNESS is in
the kernel config, the console is spammed excessively
with lock order reversal between isofs and devfs.

Set debug.witness.trace=0 in the installer sysctl.conf
to avoid printing the full KDB stack backtrace.  This
does not prevent printing the lock order reversal has
happened, only lessens the console spam.

Sponsored by: The FreeBSD Foundation

10 years agoloader's GPT support on BIOS does not seem to like the root filesystem
nwhitehorn [Sun, 27 Apr 2014 16:34:59 +0000 (16:34 +0000)]
loader's GPT support on BIOS does not seem to like the root filesystem
being the last filesystem on the disk for some reason when made by this
script. Add a vestigial swap partition to allow this to boot with QEMU
BIOS.

10 years agoFinish connecting up installer UEFI support. If the kernel was booted using
nwhitehorn [Sun, 27 Apr 2014 15:58:07 +0000 (15:58 +0000)]
Finish connecting up installer UEFI support. If the kernel was booted using
EFI, set up the disks for an EFI system. If booted from BIOS/CSM, set up
for BIOS.

10 years agoSetting the IMOD value below 0x3F8 can cause IRQ lockups in the Intel
hselasky [Sun, 27 Apr 2014 15:41:44 +0000 (15:41 +0000)]
Setting the IMOD value below 0x3F8 can cause IRQ lockups in the Intel
LynxPoint USB 3.0 controllers found in MacBookPro 2013's.

MFC after: 2 days
Tested by: Huang Wen Hui <huanghwh@gmail.com>

10 years agoReport boot method (BIOS/UEFI) via sysctl machdep.bootmethod
emaste [Sun, 27 Apr 2014 15:14:59 +0000 (15:14 +0000)]
Report boot method (BIOS/UEFI) via sysctl machdep.bootmethod

Sponsored by: The FreeBSD Foundation

10 years agoRevert r258678. Make the led gpio-specifier match again the #gpio-cells
loos [Sun, 27 Apr 2014 13:10:51 +0000 (13:10 +0000)]
Revert r258678.  Make the led gpio-specifier match again the #gpio-cells
settings from the GPIO controller, which i had broken in r258678.  Restore
the active-low flag.

10 years agoFix the gpio-specifier decoding by respecting the GPIO controller's
loos [Sun, 27 Apr 2014 12:11:00 +0000 (12:11 +0000)]
Fix the gpio-specifier decoding by respecting the GPIO controller's
#gpio-cells property.

Add a new ofw_bus method (OFW_BUS_MAP_GPIOS()) that allows the GPIO
controller to implement its own mapping to deal with gpio-specifiers,
allowing the decoding of gpio-specifiers to be controller specific.

The default ofw_bus_map_gpios() decodes the linux standard (#gpio-cells =
<2>) and the FreeBSD standard (#gpio-cells = <3>).

It pass the gpio-specifier flag field to the children as an ivar variable so
they can act upon.

10 years agoRemove useless zeroing of RTAX_DST on error.
melifaro [Sun, 27 Apr 2014 10:43:48 +0000 (10:43 +0000)]
Remove useless zeroing of RTAX_DST on error.
Cleanup a bit.

MFC after: 1 month

10 years agoCleanup route_output() a bit.
melifaro [Sun, 27 Apr 2014 10:20:37 +0000 (10:20 +0000)]
Cleanup route_output() a bit.

MFC after: 1 month

10 years agoDo not delay freeing rtm. Bandaid added in r227061 is not needed since r227061,
melifaro [Sun, 27 Apr 2014 09:49:35 +0000 (09:49 +0000)]
Do not delay freeing rtm. Bandaid added in r227061 is not needed since r227061,

MFC after: 1 month

10 years agoSame as it was done in r263878 for invlrng_handler(), fix order of
kib [Sun, 27 Apr 2014 05:37:01 +0000 (05:37 +0000)]
Same as it was done in r263878 for invlrng_handler(), fix order of
checks for special pcid values in invlpg_pcid_handler().  Forst check
for special values, and only then do PCID-specific page invalidation.

Minor fix to the style compliance, declare local variable at the
function start.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

10 years agoFix order of libthr and libc in the global dso list for sshd, by
kib [Sun, 27 Apr 2014 05:28:14 +0000 (05:28 +0000)]
Fix order of libthr and libc in the global dso list for sshd, by
explicitely linking main binary with -lpthread.  Before, libthr
appeared in the list due to dependency of one of the kerberos libs.
Due to the change in ld(1) behaviour of not copying NEEDED entries
from direct dependencies into the link results, the order becomes
reversed.

The libthr must appear before libc to properly interpose libc symbols
and provide working rtld locks implementation.  The symptom was sshd
hanging on rtld bind lock during nested symbol binding from a signal
handler.

Approved by: des (openssh maintainer)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

10 years agoWhen vm_fault_copy_entry() is called from vm_map_protect() for a wired
kib [Sun, 27 Apr 2014 05:19:01 +0000 (05:19 +0000)]
When vm_fault_copy_entry() is called from vm_map_protect() for a wired
entry and performs the upgrade of the entry permissions from read-only
to read-write, we must allow to search for the source pages in the
backing object, like we do in the case of forking the read-only wired
entry. For the fork case, the behaviour is allowed by src_readonly
boolean, which in fact is only used to assert that read-write case
provides all source pages in the top-level object.

Eliminate the src_readonly variable.  Allow for the copy loop to look
into the backing objects, add explicit asserts to ensure that only
read-only and upgrade case actually does.

Expand comments. Change the panic call into assert.

Reported by: markj
Tested by: markj, pho (previous version)
Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

10 years agoDon't need this now. VT does the same thing, but better.
nwhitehorn [Sun, 27 Apr 2014 02:28:32 +0000 (02:28 +0000)]
Don't need this now. VT does the same thing, but better.

Submitted by: gjb

10 years agoAdd vt_efifb to VT kernel configuration now that that actually works. This
nwhitehorn [Sun, 27 Apr 2014 02:22:21 +0000 (02:22 +0000)]
Add vt_efifb to VT kernel configuration now that that actually works. This
kernel will now boot on both BIOS and EFI systems without modification.
Equivalent functionality in GENERIC requires making vt(9) the default console
driver, which is probably appropriate at this point.

10 years agoIncrease the maximum framebuffer size to more reasonable values reflecting
nwhitehorn [Sun, 27 Apr 2014 02:20:51 +0000 (02:20 +0000)]
Increase the maximum framebuffer size to more reasonable values reflecting
the high-resolution boot consoles present on Open Firmware and EFI systems.

10 years agoMove up fibnum to ensure it is always defined.
melifaro [Sun, 27 Apr 2014 02:20:09 +0000 (02:20 +0000)]
Move up fibnum to ensure it is always defined.

Found by: ian
MFC with: r264987