]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
10 years agoRegerate after r257138 swapped the default to WITH_NMTREE.
brooks [Fri, 25 Oct 2013 22:47:54 +0000 (22:47 +0000)]
Regerate after r257138 swapped the default to WITH_NMTREE.

MFC after: 3 days
Sponsored by: DARPA/AFRL

10 years agoSwitch the default mtree to nmtree our new NetBSD derived mtree.
brooks [Fri, 25 Oct 2013 22:45:18 +0000 (22:45 +0000)]
Switch the default mtree to nmtree our new NetBSD derived mtree.

Exp-run by:     bdrewery
MFC after:      3 days
Sponsored by: DARPA/AFRL

10 years agovnet.h needs to be included before raw_cb.h. Now it compiles due to
glebius [Fri, 25 Oct 2013 19:49:03 +0000 (19:49 +0000)]
vnet.h needs to be included before raw_cb.h. Now it compiles due to
pollution via if_var.h.

10 years agoBegin fleshing out a knob to enable/disable bluetooth coexistence.
adrian [Fri, 25 Oct 2013 19:46:52 +0000 (19:46 +0000)]
Begin fleshing out a knob to enable/disable bluetooth coexistence.

Some firmware versions seem to get very unhappy if they're sent btcoex
commands when they don't actually have bluetooth hardware in them.
So, disable sending them those commands.

Tested:

* 5100 (which has bluetooth, no problems)
* 4965 (which doesn't have bluetooth, but didn't seem to crash)
* 6200 (no bluetooth, seems to get unhappy being sent bluetooth commands.)

10 years agoTemporarily disable multi-rate retry (link quality) and eliminate rate
adrian [Fri, 25 Oct 2013 19:44:53 +0000 (19:44 +0000)]
Temporarily disable multi-rate retry (link quality) and eliminate rate
index lookups.

* My recent(ish) change to iwn(4) and the net80211 rate control API to
  support 11n rates broke the link quality table use.  So, until I or
  someone else decides to fix it, let's just disable it for now.

* Teach iwn_tx_data_raw() to use the iwn_rate_to_plcp() function.

* Eliminate two uses of the net80211 rate index lookup functions - they
  are only for legacy rates and they're not needed here.

This fixes some invalid looking rate control TX issues that showed up
on my 4965 but it doesn't fix the two TX hangs I've noticed. Those look
like DMA related issues.

Tested:

* 4965, STA mode
* 5100, STA mode

10 years agoAdd id for GTM661W.
n_hibma [Fri, 25 Oct 2013 19:39:22 +0000 (19:39 +0000)]
Add id for GTM661W.

10 years agoReject attempts to attack a disk device that has the old NEEDSGIANT
jhb [Fri, 25 Oct 2013 19:19:12 +0000 (19:19 +0000)]
Reject attempts to attack a disk device that has the old NEEDSGIANT
flag set.

Reviewed by: mav

10 years agoAdd a helper routine to search for a compat string in a table that
ian [Fri, 25 Oct 2013 19:15:21 +0000 (19:15 +0000)]
Add a helper routine to search for a compat string in a table that
associates compat strings with arbitrary values that mean something to
the driver.  This is handy for drivers that support several variations
of similar hardware and need to know which one matched.

Reviewed by: imp, jmg, nwhitehorn

10 years agoRemove time and date stamps from svn* binaries, in order to make the
cperciva [Fri, 25 Oct 2013 18:43:53 +0000 (18:43 +0000)]
Remove time and date stamps from svn* binaries, in order to make the
builds reproducible.

Reviewed by: peter
MFC after: 3 days

10 years agoRemove all the instances of '#undef DEBUG' from kernel.
loos [Fri, 25 Oct 2013 18:38:44 +0000 (18:38 +0000)]
Remove all the instances of '#undef DEBUG' from kernel.

Suggested by: rpaulo
Approved by: adrian (mentor)

10 years agoMake sure to get the right node when looking up #interrupt-cells.
nwhitehorn [Fri, 25 Oct 2013 15:37:58 +0000 (15:37 +0000)]
Make sure to get the right node when looking up #interrupt-cells.

10 years agoConvert e500 PCI driver to use common PPC PCI bus glue. No functional
nwhitehorn [Fri, 25 Oct 2013 14:43:16 +0000 (14:43 +0000)]
Convert e500 PCI driver to use common PPC PCI bus glue. No functional
changes.

10 years agoRemove dead reference to PSL_MBO.
nwhitehorn [Fri, 25 Oct 2013 14:38:46 +0000 (14:38 +0000)]
Remove dead reference to PSL_MBO.

10 years agoRemove some #ifdef and duplication in the MSR bit definitions. This adds
nwhitehorn [Fri, 25 Oct 2013 14:37:15 +0000 (14:37 +0000)]
Remove some #ifdef and duplication in the MSR bit definitions. This adds
some security features to the Book-E kernel as well.

10 years agoUse common OFW root code to set up fdtbus. This is an almost purely
nwhitehorn [Fri, 25 Oct 2013 13:29:07 +0000 (13:29 +0000)]
Use common OFW root code to set up fdtbus. This is an almost purely
negative diff that should improve reliability somewhat. There should be
no differences in behavior -- please report any that crop up. This has been
tested on ARM and PPC systems.

Tested by: ray

10 years agoTest UARTs physical address instead of virtual.
ray [Fri, 25 Oct 2013 11:44:39 +0000 (11:44 +0000)]
Test UARTs physical address instead of virtual.

10 years agoAdd clang-CC and CC to list of hints allowing clang to identify its operating
smh [Fri, 25 Oct 2013 09:09:00 +0000 (09:09 +0000)]
Add clang-CC and CC to list of hints allowing clang to identify its operating
mode as c++ instead of defaulting to c for the binary names CC and clang-CC.

This fixes builds that use cmake, which automatically sets CXX to
/usr/bin/CC by default.

PR: bin/182442
Reviewed by: dwhite, wca
MFC after: 2 days

10 years agoDisable WITH_TESTS= for now.
rpaulo [Fri, 25 Oct 2013 06:37:43 +0000 (06:37 +0000)]
Disable WITH_TESTS= for now.

10 years agoAdd a tests(7) manual page.
rpaulo [Fri, 25 Oct 2013 05:33:04 +0000 (05:33 +0000)]
Add a tests(7) manual page.

This manual page intends to describe the structure and behavior of
the FreeBSD test suite installed in /usr/tests.  The contents have
been inherited from the NetBSD manual page.

As a side effect, this also updates the hier(7) manual page to
mention /usr/tests and points at tests(7) for more details.

Submitted by: Julio Merino jmmv google.com
Reviewed by: sjg
MFC after: 2 weeks

10 years agoAdd missing plain.test.mk.
rpaulo [Fri, 25 Oct 2013 05:31:26 +0000 (05:31 +0000)]
Add missing plain.test.mk.

Submitted by: Julio Merino jmmv google.com
MFC after: 2 weeks

10 years agoAdd missing WITHOUT_TESTS file.
rpaulo [Fri, 25 Oct 2013 05:27:36 +0000 (05:27 +0000)]
Add missing WITHOUT_TESTS file.

Submitted by: Julio Merio jmmv google.com
Reviewed by: sjg
MFC after: 2 weeks

10 years agoSet up the /usr/tests hierarchy.
rpaulo [Fri, 25 Oct 2013 05:25:19 +0000 (05:25 +0000)]
Set up the /usr/tests hierarchy.

Populate /usr/tests with the only test programs that currently live
in the tree (those in lib/libcrypt/tests/) and add all the build
machinery to accompany this change.

In particular:

- Add a WITHOUT_TESTS variable that users can define to request that
  no tests be put in /usr/tests.
- Add a top-level Kyuafile for /usr/tests and a way to create similar
  Kyuafiles in top-level subdirectories.
- Add a BSD.tests.dist file to define the directory layout of
  /usr/tests.

Submitted by: Julio Merino jmmv google.com
Reviewed by: sjg
MFC after: 2 weeks

10 years agoMove the TESTSBASE definition to bsd.own.mk.
rpaulo [Fri, 25 Oct 2013 05:12:31 +0000 (05:12 +0000)]
Move the TESTSBASE definition to bsd.own.mk.

We need to be able to reference the value of TESTSBASE without requiring
the inclusion of bsd.test.mk (e.g. in etc/Makefile), so move its definition
to the more generic bsd.own.mk.

Submitted by: Julio Merino jmmv google.com
Reviewed by: sjg
MFC after: 2 weeks

10 years agoAllow mixing bsd.files.mk with bsd.subdir.mk.
rpaulo [Fri, 25 Oct 2013 05:11:10 +0000 (05:11 +0000)]
Allow mixing bsd.files.mk with bsd.subdir.mk.

If a single Makefile wants to recurse into subdirectories and also
wants to install files, bsd.files.mk's targets would get ignored in
favor of those defined by bsd.subdir.mk because installfiles would
not get defined in bsd.files.mk.

Prevent this from happening by defining the targets in bsd.files.mk
with auxiliary names and listing them as dependencies of installfiles
instead.

This is required by bsd.test.mk, which needs to install a Kyuafile
in pretty much all cases but may also need to recurse into
subdirectories for build purposes.

Submitted by: Julio Merino jmmv google.com
Reviewed by: sjg
MFC after: 2 weeks

10 years agoAdd a configuration file and hints file for the Alfa Networks Hornet UB
adrian [Fri, 25 Oct 2013 04:06:54 +0000 (04:06 +0000)]
Add a configuration file and hints file for the Alfa Networks Hornet UB
board.

This is another AR9331 board similar to the Carambola2. It has different
ethernet and LED wiring though.

They make a variety of boards that mostly differ on the amount of RAM/flash
available.  Alfa Networks graciously donated a handful of 64MB RAM/16MB flash
boards so I can finish off 802.11s support for the AR93xx chips and do up
a tech demonstration with it.

This is enough to bring up the board.

Tested:

* Alfa networks UB Hornet board - 64MB ram, 16MB flash version.

Thankyou to Alfa Networks for the development boards!

Sponsored by: Alfa Networks (hardware only)

10 years agoBe a little more suspicious of thermal sensors, which can have single
nwhitehorn [Fri, 25 Oct 2013 03:55:52 +0000 (03:55 +0000)]
Be a little more suspicious of thermal sensors, which can have single
crazy readings occasionally. One wild reading should not be enough to
trigger a shutdown, so instead wait for several concerning readings in
a row.

PR: powerpc/180593
Submitted by: Julio Merino
MFC after: 1 week

10 years agoFix bug in the ioapic emulation for level-triggered interrupts,
grehan [Fri, 25 Oct 2013 03:18:56 +0000 (03:18 +0000)]
Fix bug in the ioapic emulation for level-triggered interrupts,
where a pin assertion while a source was masked would result in
the interrupt being lost, with the symptom being a console hang.
The condition is now recorded, and the interrupt generated when
the source is unmasked.

Discovered by: OpenBSD 5.4 MP
Reviewed by: neel
MFC after: 3 days

10 years agoQueisce quite a few clang warnings -Wdangling-else due to this work around
sbruno [Fri, 25 Oct 2013 01:10:07 +0000 (01:10 +0000)]
Queisce quite a few clang warnings -Wdangling-else due to this work around
for compiling gperf under Visual Studio from 1998.

ref. http://msdn.microsoft.com/en-us/library/b80153d8%28v=vs.90%29.aspx
ref. http://stackoverflow.com/questions/984878/what-is-the-possible-use-for-define-for-if-false-else-for

10 years agoInitialize inc_fibnum for properly handling ICMP6_PACKET_TOO_BIG errors
ae [Fri, 25 Oct 2013 01:02:25 +0000 (01:02 +0000)]
Initialize inc_fibnum for properly handling ICMP6_PACKET_TOO_BIG errors
in multifib environment.

PR: 183265
MFC after: 1 week

10 years agoELF PowerPC64 ABI puts the LR save word at 16 byte offset, not 8.
jhibbits [Fri, 25 Oct 2013 00:17:12 +0000 (00:17 +0000)]
ELF PowerPC64 ABI puts the LR save word at 16 byte offset, not 8.

10 years agoFix build host pollution by avoiding calling 'uname -srp' to
gjb [Thu, 24 Oct 2013 22:55:15 +0000 (22:55 +0000)]
Fix build host pollution by avoiding calling 'uname -srp' to
determine values for 'VERSION'.

Looked at by: cperciva

10 years agoFix panic in the tap driver when a tap and vmnet interface were
grehan [Thu, 24 Oct 2013 22:21:31 +0000 (22:21 +0000)]
Fix panic in the tap driver when a tap and vmnet interface were
created after each other e.g.

 ifconfig tap0
 ifconfig vmnet0
 <panic>

Appears to be a cut'n'paste error from the tap code to the vmnet
code where the name string wasn't updated in the call to make_dev().

Reviewed by: glebius
MFC after: 3 days

10 years agoCleanup empty directories
zont [Thu, 24 Oct 2013 21:58:14 +0000 (21:58 +0000)]
Cleanup empty directories

PR: conf/167133

10 years agoRemove some of the code required for supporting ssm(4) on SPARC in favor
nwhitehorn [Thu, 24 Oct 2013 21:49:23 +0000 (21:49 +0000)]
Remove some of the code required for supporting ssm(4) on SPARC in favor
of a more PowerPC/FDT-focused design. Whenever SPARC64 is integrated
into this rework, this should be (trivially) revisited.

10 years agoMake pci_get_dma_tag() non-static. Since the function is only
kib [Thu, 24 Oct 2013 20:29:29 +0000 (20:29 +0000)]
Make pci_get_dma_tag() non-static.  Since the function is only
referenced by pointer, making it non-static should not have even the
negligible impact on the existing code.

Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

10 years agoAdd some definitions for the bits in root control and status PCIe cap
kib [Thu, 24 Oct 2013 20:25:29 +0000 (20:25 +0000)]
Add some definitions for the bits in root control and status PCIe cap
registers.

Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

10 years agoMove the PCI_DMA_BOUNDARY definition into the pcivar.h.
kib [Thu, 24 Oct 2013 20:21:37 +0000 (20:21 +0000)]
Move the PCI_DMA_BOUNDARY definition into the pcivar.h.

Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

10 years agoAdd ddb 'show ioapic' and 'show all ioapics' commands.
kib [Thu, 24 Oct 2013 20:13:40 +0000 (20:13 +0000)]
Add ddb 'show ioapic' and 'show all ioapics' commands.

Reviewed by: jhb (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

10 years agoModernize pass(4) description to the 21st century.
pluknet [Thu, 24 Oct 2013 19:49:55 +0000 (19:49 +0000)]
Modernize pass(4) description to the 21st century.

Reviewed by: mav

10 years agoCorrect typo. s/an an/an/
pluknet [Thu, 24 Oct 2013 19:32:20 +0000 (19:32 +0000)]
Correct typo. s/an an/an/

10 years agoMove the implementation of bus_space_barrier(9) to the inline function in
marius [Thu, 24 Oct 2013 17:06:41 +0000 (17:06 +0000)]
Move the implementation of bus_space_barrier(9) to the inline function in
the header. Actually, there's only one version for all types of busses, so
it doesn't make sense to walk up the hierarchy.

10 years agoFix a use-after-free node reference issue when waiting for a return
adrian [Thu, 24 Oct 2013 17:04:16 +0000 (17:04 +0000)]
Fix a use-after-free node reference issue when waiting for a return
from a management frame transmission.

This bug is a bit loopy, so here goes.

The underlying cause is pretty easy to understand - the node isn't
referenced before passing into the callout, so if the node is deleted
before the callout fires, it'll dereference free'd memory.

The code path however is slightly more convoluted.

The functions _say_ mgt_tx - ie management transmit - which is partially
true.  Yes, that callback is attached to the mbuf for some management
frames.  However, it's only for frames relating to scanning and
authentication attempts.  It helpfully drives the VAP state back to
"SCAN" if the transmission fails _OR_ (as I subsequently found out!)
if the transmission succeeds but the state machine doesn't make progress
towards being authenticated and active.

Now, the code itself isn't terribly clear about this.

It _looks_ like it's just handling the transmit failure case.

However, when you look at what goes on in the transmit success case, it's
moving the VAP state back to SCAN if it hasn't changed state since
the time the callback was scheduled.  Ie, if it's in ASSOC or AUTH still,
it'll go back to SCAN.  But if it has transitioned to the RUN state,
the comparison will fail and it'll not transition things back to the
SCAN state.

So, to fix this, I decided to leave everything the way it is and merely
fix the locking and remove the node reference.

The _better_ fix would be to turn this callout into a "assoc/auth request"
timeout callback and make the callout locked, thus eliminating all races.
However, until all the drivers have been fixed so that transmit completions
occur outside of any locking that's going on, it's going to be impossible
to do this without introducing LORs.  So, I leave some of the evilness
in there.

Tested:

* AR5212, ath(4), STA mode
* 5100 and 4965 wifi, iwn(4), STA mode

10 years agoAdd an OFW SPI compatible bus. Fix the spibus probe to return
loos [Thu, 24 Oct 2013 16:56:38 +0000 (16:56 +0000)]
Add an OFW SPI compatible bus.  Fix the spibus probe to return
BUS_PROBE_GENERIC and not BUS_PROBE_SPECIFIC (0) so the OFW SPI bus can
attach when enabled.  Export the spibus devclass_t and driver_t
declarations.

Submitted by: ray
Approved by: adrian (mentor)

10 years agoAdd the Raspberry Pi SPI controller driver.
loos [Thu, 24 Oct 2013 16:27:33 +0000 (16:27 +0000)]
Add the Raspberry Pi SPI controller driver.

Reviewed by: rpaulo
Approved by: adrian (mentor)

10 years agoDon't spin with mutex hold when there is not enough room in the send socket
trasz [Thu, 24 Oct 2013 15:54:06 +0000 (15:54 +0000)]
Don't spin with mutex hold when there is not enough room in the send socket
buffer.  While here, make the code flow somewhat nicer.

Thanks to mav@ for tracking it down.

Tested by: mav
MFC after: 3 days
Sponsored by: FreeBSD Foundation

10 years agoDo not map IRQs twice. This fixes PowerPC/FDT systems with multiple PICs,
nwhitehorn [Thu, 24 Oct 2013 15:44:29 +0000 (15:44 +0000)]
Do not map IRQs twice. This fixes PowerPC/FDT systems with multiple PICs,
which would try to treat the previously-mapped interrupts from
fdt_decode_intr() as interrupt line numbers on the same parent PIC.

10 years agoAllow PIC drivers to translate firmware sense codes for themselves. This
nwhitehorn [Thu, 24 Oct 2013 15:37:32 +0000 (15:37 +0000)]
Allow PIC drivers to translate firmware sense codes for themselves. This
is designed to replace the tables in dev/fdt/fdt_ARCH.c, but will not
happen quite yet.

10 years agoRegenerate documentation post r256915:
brooks [Thu, 24 Oct 2013 15:11:30 +0000 (15:11 +0000)]
Regenerate documentation post r256915:

Stop conflating WITHOUT_CLANG with WITHOUT_CLANG_IS_CC.  This allows
bootstrapping a copy of clang without building clang for the base system
which is useful for nanobsd and similar setups.  It's still probably
wrong to conflate what is installed as /usr/bin/cc with the selection
of a bootstrap compiler under WITH*_CLANG_IS_CC, but that's for another
day.

10 years agoRevert r256921 to prevent error output when in the wrong directory.
gjb [Thu, 24 Oct 2013 15:00:19 +0000 (15:00 +0000)]
Revert r256921 to prevent error output when in the wrong directory.
This should have been reverted with the stable/10/Makefile.inc1
revert, but apparently my commit did not go through.

Discussed with: cperciva (originally)

10 years agointerrupt-parent and #interrupt-cells are written to the tree using
nwhitehorn [Thu, 24 Oct 2013 14:15:05 +0000 (14:15 +0000)]
interrupt-parent and #interrupt-cells are written to the tree using
encode-int.

10 years agoSome microoptimizations for da and ada drivers:
mav [Thu, 24 Oct 2013 14:05:44 +0000 (14:05 +0000)]
Some microoptimizations for da and ada drivers:
 - Replace ordered_tag_count counter with single flag;
 - From da remove outstanding_cmds counter, duplicating pending_ccbs list;
 - From da_softc remove unused links field.

10 years agoAdd support for using "pkg+http://" for the PACKAGESITE.
bdrewery [Thu, 24 Oct 2013 10:49:55 +0000 (10:49 +0000)]
Add support for using "pkg+http://" for the PACKAGESITE.

pkg 1.2 is adding this support as well. This should help
lessen the confusion on why the default SRV PACKAGESITE
does not load in a browser.

Adapated from: matthew's upstream pkg change
Approved by: bapt
MFC after: 2 days

10 years agoFix crossed fingers output. Only comment changed.
ray [Thu, 24 Oct 2013 09:27:06 +0000 (09:27 +0000)]
Fix crossed fingers output. Only comment changed.

10 years agoBe more selective when filtering for lib*.so.N files. These are deleted
cperciva [Thu, 24 Oct 2013 03:36:39 +0000 (03:36 +0000)]
Be more selective when filtering for lib*.so.N files.  These are deleted
at the end of the upgrade process, after warning users to upgrade any
3rd party software (e.g., from the ports tree) which might link to the
libraries being removed.

Prior to this commit, the line
  /usr/lib/libc.so|...|/lib/libc.so.7
matched the regex, which -- upgrading from 9.x to 10.x, where libc.so is
a regular file and thus was not part of a line which matched the regex --
resulted in freebsd-update thinking that /usr/lib/libc.so was a shared
library which was being removed as part of the upgrade.  This had some
unfortunate consequences.

This will be part of an upcoming Errata Notice.

10 years agoRedefine the io provider using the SDT(9) macros instead of doing everything
markj [Thu, 24 Oct 2013 02:39:07 +0000 (02:39 +0000)]
Redefine the io provider using the SDT(9) macros instead of doing everything
manually. This change has no functional impact.

Discussed with: gnn

10 years agoReturn 0 if:
hrs [Thu, 24 Oct 2013 01:06:44 +0000 (01:06 +0000)]
Return 0 if:

  1. "-u N" specified, no -f, and mdN found,
  2. no -u, "-f /pathname" specified, and mdN associated with /pathname found,
  3. "-u N" specified, "-f /pathname" specified, and both of them found,
  4. "-l" specified and no -f,
  5. "-l" specified, "-f /pathname" specified, and /pathname found.

otherwise return -1.

Spotted by: Julian H. Stacey

10 years agoBreak out the debug code into a new include file in preparation for
adrian [Thu, 24 Oct 2013 01:03:42 +0000 (01:03 +0000)]
Break out the debug code into a new include file in preparation for
some more iwn work.

10 years agoAdd #ifdef wrapper around definitions so they aren't included multiple
adrian [Thu, 24 Oct 2013 01:02:54 +0000 (01:02 +0000)]
Add #ifdef wrapper around definitions so they aren't included multiple
times.

10 years agoUFS2: make di_extsize unsigned.
pfg [Thu, 24 Oct 2013 00:33:29 +0000 (00:33 +0000)]
UFS2: make di_extsize unsigned.

di_extsize is the EA size and as such it should be unsigned.
Adjust related types for consistency.

Reviewed by: mckusick (previous version)
MFC after: 3 weeks

10 years agoTidy usage messages for bhyve and bhyveload.
neel [Wed, 23 Oct 2013 21:42:53 +0000 (21:42 +0000)]
Tidy usage messages for bhyve and bhyveload.

Submitted by: jhb

10 years agoMFP4:
brooks [Wed, 23 Oct 2013 21:35:39 +0000 (21:35 +0000)]
MFP4:
Change 221534 by rwatson@rwatson_zenith_cl_cam_ac_uk on 2013/01/27 16:05:30

        FreeBSD/mips stores page-table entries in a near-identical format
        to MIPS TLB entries -- only it overrides certain "reserved" bits
        in the MIPS-defined EntryLo register to hold software-defined bits
        (swbits) to avoid significantly increasing the page table memory
        footprint.  On n32 and n64, these bits were (a) colliding with
        MIPS64r2 physical memory extensions and (b) being improperly
        cleared.

        Attempt to fix both of these problems by pushing swbits further
        along 64-bit EntryLo registers into the reserved space, and
        improving consistency between C-based and assembly-based clearing
        of swbits -- in particular, to use the same definition.  This
        should stop swbits from leaking into TLB entries -- while ignored
        by most current MIPS hardware, this would cause a problem with
        (much) larger physical memory sizes, and also leads to confusing
        hardware-level tracing as physical addresses contain unexpected
        (and inconsistent) higher bits.

        Discussed with: imp, jmallett

Change 1187301 by brooks@brooks_zenith on 2013/10/23 14:40:10
        Loop back the initial commit of 221534 to HEAD.  Correct its
        implementation for mips32.

MFC after: 3 days
Sponsored by: DARPA/AFRL

10 years agoFactor out MI portions of the PowerPC nexus device into /sys/dev/ofw. The
nwhitehorn [Wed, 23 Oct 2013 20:00:14 +0000 (20:00 +0000)]
Factor out MI portions of the PowerPC nexus device into /sys/dev/ofw. The
sparc64 driver will be modified to use this shortly.

10 years agoTypo while reviewing diffs. Sorry for the breakage!
nwhitehorn [Wed, 23 Oct 2013 19:56:13 +0000 (19:56 +0000)]
Typo while reviewing diffs. Sorry for the breakage!

10 years agoUpdate driver to version 10.0.664.0.
delphij [Wed, 23 Oct 2013 18:58:38 +0000 (18:58 +0000)]
Update driver to version 10.0.664.0.

Many thanks to Emulex for their continued support of FreeBSD.

Submitted by: Venkata Duvvuru <VenkatKumar.Duvvuru Emulex Com>
MFC after: 3 day

10 years agosbin/geom/class/part/geom_part.c
asomers [Wed, 23 Oct 2013 18:58:11 +0000 (18:58 +0000)]
sbin/geom/class/part/geom_part.c
Always validate the return of find_geomcfg().  It could be NULL, for
example when the geom is withering.

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

10 years agoExport the block size capability to guests.
grehan [Wed, 23 Oct 2013 18:54:58 +0000 (18:54 +0000)]
Export the block size capability to guests.
- Use #defines for capability bits
- Export the VTBLK_F_BLK_SIZE capability
- Fix bug in calculating capacity: it is in
  512-byte units, not the underlying sector size

This allows virtio-blk to have backing devices
with non 512-byte sector sizes e.g. /dev/cd0, and
4K-block harddrives.

Reviewed by: neel
MFC after: 3 days

10 years agoAdded support for the 'zfs list -t snap' and 'zfs snap' aliases which are
smh [Wed, 23 Oct 2013 18:22:27 +0000 (18:22 +0000)]
Added support for the 'zfs list -t snap' and 'zfs snap' aliases which are
available under Oracle Solaris 11.

This includes an update to the ZFS(8) man page to reflect all the
available alias (snap, umount, and recv).

Initial changes obtained from ZFS On Linux + fixes for man page and cmd
help:
https://github.com/zfsonlinux/zfs/commit/10b75496bb0cb7a7b8146c263164adc37f1d176a
https://github.com/zfsonlinux/zfs/commit/cf81b00a73fe47fdb21586ac1cc179b734540973

Obtained from: https://github.com/zfsonlinux/zfs
MFC after: 2 weeks
Sponsored by: Multiplay

10 years agoRemove 128KB bzero() call done for every block I/O data buffer.
mav [Wed, 23 Oct 2013 17:55:35 +0000 (17:55 +0000)]
Remove 128KB bzero() call done for every block I/O data buffer.

On my tests this improves performance of the new iSCSI target backed by
GEOM STRIPE of SSDs from 75K to 110K IOPS.

Reviewed by: ken

10 years agoAdd two new interfaces to ofw_bus:
nwhitehorn [Wed, 23 Oct 2013 17:24:21 +0000 (17:24 +0000)]
Add two new interfaces to ofw_bus:
- ofw_bus_map_intr()
  Maps an (iparent, IRQ) tuple to a system-global interrupt number in some
  platform dependent way. This is meant to be implemented as a replacement
  for [FDT_]MAP_IRQ() that is an MI interface that knows about the bus
  hierarchy.
- ofw_bus_config_intr()
  Configures an interrupt (previously mapped) based on firmware sense flags.
  This replaces manual interpretation of the sense field in bus drivers and
  will, in a follow-up, allow that interpretation to be redirected to the PIC
  drivers where it belongs. This will eventually replace the tables in
  /sys/dev/fdt/fdt_ARCH.c

The PowerPC/AIM code has been converted to use these globally, with an
implementation in terms of MAP_IRQ() and powerpc_config_intr(), assuming
OpenPIC, at the bus root in nexus(4). The ofw_bus_config_intr() will shortly
be integrated into pic_if.m and bounced through nexus into the PIC tree.

FDT integration will happen significantly later due to larger testing
requirements. This patch in general also lays the groundwork for the removal
of /sys/dev/fdt/fdt_ARCH.c and machine/fdt.h.

10 years agoFix build with gcc
bapt [Wed, 23 Oct 2013 15:29:42 +0000 (15:29 +0000)]
Fix build with gcc

MFC after: 3 days

10 years agoBERI_SIM.hint is no longer used, remove it.
brooks [Wed, 23 Oct 2013 15:24:05 +0000 (15:24 +0000)]
BERI_SIM.hint is no longer used, remove it.

MFC after: 3 days
Sponsored by: DARPA/AFRL

10 years agoMinor (mostly cosmetical) addition to r256960.
mav [Wed, 23 Oct 2013 14:58:09 +0000 (14:58 +0000)]
Minor (mostly cosmetical) addition to r256960.

10 years agoA quick addendum: the standard says that timebase-frequency can be either
nwhitehorn [Wed, 23 Oct 2013 14:34:04 +0000 (14:34 +0000)]
A quick addendum: the standard says that timebase-frequency can be either
32 or 64 bits, so allow either.

10 years agoIf the device tree directly contains the timebase frequency, use it. This
nwhitehorn [Wed, 23 Oct 2013 14:28:59 +0000 (14:28 +0000)]
If the device tree directly contains the timebase frequency, use it. This
property is required by ePAPR, but maintain the fallback to bus-frequency
for compatibility.

MFC after: 2 weeks

10 years agoRevert addition of sbintime and getsbintime that crept into r256963.
brooks [Wed, 23 Oct 2013 14:28:42 +0000 (14:28 +0000)]
Revert addition of sbintime and getsbintime that crept into r256963.

Pointyhat: brooks

10 years agoAllow to bootstrap by doing pkg add ./a/path/to/a/pkg_package.txz
bapt [Wed, 23 Oct 2013 14:23:48 +0000 (14:23 +0000)]
Allow to bootstrap by doing pkg add ./a/path/to/a/pkg_package.txz

Requested by: many
MFC after: 3 days

10 years agoUse OF_getencprop() in preference to OF_getprop() for numerical quantities.
nwhitehorn [Wed, 23 Oct 2013 14:06:41 +0000 (14:06 +0000)]
Use OF_getencprop() in preference to OF_getprop() for numerical quantities.
Since all supported PowerPC systems are big-endian, this is a no-op, but
this is preparatory work to moving this to /sys/dev/ofw.

10 years agoImprove SRV records support for the pkg(8) bootstrap:
bapt [Wed, 23 Oct 2013 14:06:07 +0000 (14:06 +0000)]
Improve SRV records support for the pkg(8) bootstrap:
- order srv records by priorities
- for all entries of the same priority, order randomly respect the weight
- select the port where to fetch from respect the port provided in the SRV record

Obtained from: pkg git repo
MFC after: 3 days

10 years agoRemove OF_instance_to_package() hack for FDT and replace with use of the
nwhitehorn [Wed, 23 Oct 2013 14:04:09 +0000 (14:04 +0000)]
Remove OF_instance_to_package() hack for FDT and replace with use of the
generic OF_xref_phandle() API universally. Also replace some related
explicit uses of fdt32_to_cpu() with OF_getencprop() calls.

10 years agoMake all Open Firmware internal interfaces endian-safe by using the new
nwhitehorn [Wed, 23 Oct 2013 13:55:41 +0000 (13:55 +0000)]
Make all Open Firmware internal interfaces endian-safe by using the new
OF_getencprop() API. This removes one explicit endianness conversion in
ofw_iicbus.c.

10 years agoRevert r256934, it needs work to build on mips32.
brooks [Wed, 23 Oct 2013 13:32:52 +0000 (13:32 +0000)]
Revert r256934, it needs work to build on mips32.

10 years agoFinish r254925 and remove the last remaining sysctl name list macro. The
jhb [Wed, 23 Oct 2013 13:22:50 +0000 (13:22 +0000)]
Finish r254925 and remove the last remaining sysctl name list macro.  The
one port that used it has been fixed to use the more portable
getprotoent(3) instead.

10 years agoEnable the build of OFW I2C bus for FDT systems.
loos [Wed, 23 Oct 2013 13:09:57 +0000 (13:09 +0000)]
Enable the build of OFW I2C bus for FDT systems.

Approved by: adrian (mentor)

10 years agoMove CAM_UNQUEUED_INDEX setting to the last moment and under the periph lock.
mav [Wed, 23 Oct 2013 12:53:05 +0000 (12:53 +0000)]
Move CAM_UNQUEUED_INDEX setting to the last moment and under the periph lock.
This fixes race condition with cam_periph_ccbwait(), causing use-after-free.

10 years agoAdd the Raspberry Pi BSC (I2C compliant) controller driver.
loos [Wed, 23 Oct 2013 12:29:39 +0000 (12:29 +0000)]
Add the Raspberry Pi BSC (I2C compliant) controller driver.

Reviewed by: rpaulo
Approved by: adrian (mentor)

10 years agoImprove ZFS N-way mirror read performance by using load and locality
smh [Wed, 23 Oct 2013 09:54:58 +0000 (09:54 +0000)]
Improve ZFS N-way mirror read performance by using load and locality
information.

The existing algorithm selects a preferred leaf vdev based on offset of the zio
request modulo the number of members in the mirror. It assumes the devices are
of equal performance and that spreading the requests randomly over both drives
will be sufficient to saturate them. In practice this results in the leaf vdevs
being under utilized.

The new algorithm takes into the following additional factors:
* Load of the vdevs (number outstanding I/O requests)
* The locality of last queued I/O vs the new I/O request.

Within the locality calculation additional knowledge about the underlying vdev
is considered such as; is the device backing the vdev a rotating media device.

This results in performance increases across the board as well as significant
increases for predominantly streaming loads and for configurations which don't
have evenly performing devices.

The following are results from a setup with 3 Way Mirror with 2 x HD's and
1 x SSD from a basic test running multiple parrallel dd's.

With pre-fetch disabled (vfs.zfs.prefetch_disable=1):

== Stripe Balanced (default) ==
Read 15360MB using bs: 1048576, readers: 3, took 161 seconds @ 95 MB/s
== Load Balanced (zfslinux) ==
Read 15360MB using bs: 1048576, readers: 3, took 297 seconds @ 51 MB/s
== Load Balanced (locality freebsd) ==
Read 15360MB using bs: 1048576, readers: 3, took 54 seconds @ 284 MB/s

With pre-fetch enabled (vfs.zfs.prefetch_disable=0):

== Stripe Balanced (default) ==
Read 15360MB using bs: 1048576, readers: 3, took 91 seconds @ 168 MB/s
== Load Balanced (zfslinux) ==
Read 15360MB using bs: 1048576, readers: 3, took 108 seconds @ 142 MB/s
== Load Balanced (locality freebsd) ==
Read 15360MB using bs: 1048576, readers: 3, took 48 seconds @ 320 MB/s

In addition to the performance changes the code was also restructured, with
the help of Justin Gibbs, to provide a more logical flow which also ensures
vdevs loads are only calculated from the set of valid candidates.

The following additional sysctls where added to allow the administrator
to tune the behaviour of the load algorithm:
* vfs.zfs.vdev.mirror.rotating_inc
* vfs.zfs.vdev.mirror.rotating_seek_inc
* vfs.zfs.vdev.mirror.rotating_seek_offset
* vfs.zfs.vdev.mirror.non_rotating_inc
* vfs.zfs.vdev.mirror.non_rotating_seek_inc

These changes where based on work started by the zfsonlinux developers:
https://github.com/zfsonlinux/zfs/pull/1487

Reviewed by: gibbs, mav, will
MFC after: 2 weeks
Sponsored by: Multiplay

10 years agoFix the RT2860_TX_SW_CFG2 init value on older revisions of RT3070 chip.
kevlo [Wed, 23 Oct 2013 09:53:37 +0000 (09:53 +0000)]
Fix the RT2860_TX_SW_CFG2 init value on older revisions of RT3070 chip.

10 years agoFix build.
andreast [Wed, 23 Oct 2013 03:59:51 +0000 (03:59 +0000)]
Fix build.

10 years agoAdd missing symlinks for the sbuf man page
eadler [Wed, 23 Oct 2013 03:27:42 +0000 (03:27 +0000)]
Add missing symlinks for the sbuf man page

10 years agognop: make sure that newly allocated memory for softc is zeroed
mjg [Wed, 23 Oct 2013 01:34:18 +0000 (01:34 +0000)]
gnop: make sure that newly allocated memory for softc is zeroed

This prevents mtx_init from encountering non-zeros and panicking
the kernel as a result.

Reported by: Keith White <kwhite site.uottawa.ca>

10 years agoRadxa Rock board (by radxa.com) kernel config file.
ganbold [Wed, 23 Oct 2013 00:43:22 +0000 (00:43 +0000)]
Radxa Rock board (by radxa.com) kernel config file.
More info on the Wiki page:
https://wiki.freebsd.org/FreeBSD/arm/Radxa%20Rock

Reviewed by: ray@

10 years agoImport basic support for Rockchip RK3188 SoC.
ganbold [Wed, 23 Oct 2013 00:39:43 +0000 (00:39 +0000)]
Import basic support for Rockchip RK3188 SoC.

Reviewed by: ray@

10 years agoAdd FDT for Radxa Rock board and Rockchip RK3188 SoC.
ganbold [Wed, 23 Oct 2013 00:35:58 +0000 (00:35 +0000)]
Add FDT for Radxa Rock board and Rockchip RK3188 SoC.

Reviewed by: ray@

10 years agoMFP4: 1187103, 222076, 222057, 222051, 221799
brooks [Tue, 22 Oct 2013 22:17:48 +0000 (22:17 +0000)]
MFP4: 1187103, 222076, 222057, 222051, 221799

Add atsectl, a simple utility to read and update MAC addresses stored in
the default flash location on Altera DE4 boards.  Typically used once
when setting up a board so leaving in tools rather than inflicting on
all users.

To build with world add LOCAL_DIRS=tools/tools/atsectl to the make
command line.

MFC after: 3 days
Sponsored by: DARPA/AFRL

10 years agoMFP4:
brooks [Tue, 22 Oct 2013 22:03:01 +0000 (22:03 +0000)]
MFP4:
Change 221669 by bz@bz_zenith on 2013/02/01 12:26:04

        Run the initialization for polling earlier along with INTRs
        so that we can put network interface into polling mode by default
        if DEVICE_POLLING is compiled in and no interrupts are available.

MFC after: 3 days
Sponsored by: DARPA/AFRL

10 years ago- Use bus_dmamap_unload(), it is not optional.
cognet [Tue, 22 Oct 2013 21:51:07 +0000 (21:51 +0000)]
- Use bus_dmamap_unload(), it is not optional.
- The new allocator won't return coherent memory for any size > PAGE_SIZE,
so don't assume we have coherent memory, and explicitely use
bus_dmamap_sync().

10 years agoTypo fix.
cognet [Tue, 22 Oct 2013 21:49:58 +0000 (21:49 +0000)]
Typo fix.

10 years agoTry to make sure the frame is indeed in the kernel memory.
cognet [Tue, 22 Oct 2013 21:47:34 +0000 (21:47 +0000)]
Try to make sure the frame is indeed in the kernel memory.

10 years agoAllow users to set UUID in network byte order regardless of SMBIOS version.
jkim [Tue, 22 Oct 2013 21:32:28 +0000 (21:32 +0000)]
Allow users to set UUID in network byte order regardless of SMBIOS version.
Define BOOT_NETWORK_ENDIAN_UUID in make.conf(5) to enable this feature.

10 years agoMFP4:
brooks [Tue, 22 Oct 2013 21:27:22 +0000 (21:27 +0000)]
MFP4:
Change 221767 by rwatson@rwatson_zenith_cl_cam_ac_uk on 2013/02/05 14:18:53

        When printing out information on a TLB MOD exception for a user
        process (e.g., an attempt to write to a read-only page), report
        it as a "write" in the console message, rather than "unknown".

Change 221768 by rwatson@rwatson_zenith_cl_cam_ac_uk on 2013/02/05 14:28:00

        Fix post-compile but pre-commit typo in last changeset.

MFC after: 3 days
Sponsored by: DARPA/AFRL