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

10 years agoA few other common cases for encode-int decoding: OF_getencprop_alloc()
nwhitehorn [Tue, 22 Oct 2013 21:20:05 +0000 (21:20 +0000)]
A few other common cases for encode-int decoding: OF_getencprop_alloc()
and OF_searchencprop(). I thought about using the element size parameter
to OF_getprop_alloc() to do endian-switching automatically, but it breaks
use with structs and a *lot* of FDT code (which can hopefully be moved to
these new APIs).

MFC after: 2 weeks

10 years agoMFP4:
brooks [Tue, 22 Oct 2013 21:16:57 +0000 (21:16 +0000)]
MFP4:
Change 231031 by brooks@brooks_zenith on 2013/07/11 16:22:08

        Turn the unused and uncompilable MIPS_DISABLE_L1_CACHE define in
        cache.c into an option and when set force I- and D-cache line
        sizes to 0 (the latter part might be better as a tunable).

        Fix some casts in an #if 0'd bit of code which attempts to
        disable L1 cache ops when the cache is coherent.

Sponsored by: DARPA/AFRL

10 years agoRemove a bit of debugging output that slipped into r256911.
brooks [Tue, 22 Oct 2013 21:13:02 +0000 (21:13 +0000)]
Remove a bit of debugging output that slipped into r256911.

MFC after: 3 days
Sponsored by: DARPA/AFRL

10 years agoMFP4:
brooks [Tue, 22 Oct 2013 21:08:25 +0000 (21:08 +0000)]
MFP4:
Change 228019 by bz@bz_zenith on 2013/04/23 13:55:30

Add kernel side support for large TLB on BERI/CHERI.
Modelled similar to NLM

MFC after: 3 days
Sponsored by: DAPRA/AFRL

10 years agoMFP4:
brooks [Tue, 22 Oct 2013 21:06:27 +0000 (21:06 +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

MFC after: 3 days
Sponsored by: DARPA/AFRL

10 years agoAdd a new function (OF_getencprop()) that undoes the transformation applied
nwhitehorn [Tue, 22 Oct 2013 20:57:24 +0000 (20:57 +0000)]
Add a new function (OF_getencprop()) that undoes the transformation applied
by encode-int. Specifically, it takes a set of 32-bit cell values and
changes them to host byte order. Most non-string instances of OF_getprop()
should be using this function, which is a no-op on big-endian platforms.

10 years agoEnable ATSE_CFI_HACK in BERI configs, stable MAC addresses are useful.
brooks [Tue, 22 Oct 2013 20:50:41 +0000 (20:50 +0000)]
Enable ATSE_CFI_HACK in BERI configs, stable MAC addresses are useful.

MFC after: 3 days
Sponsored by: DARPA/AFRL

10 years agoAdd a manpage for the getenv() family of functions in the kernel.
jhb [Tue, 22 Oct 2013 20:10:38 +0000 (20:10 +0000)]
Add a manpage for the getenv() family of functions in the kernel.

10 years agoFix AHCI ATAPI emulation when backed with /dev/cd0
grehan [Tue, 22 Oct 2013 19:55:04 +0000 (19:55 +0000)]
Fix AHCI ATAPI emulation when backed with /dev/cd0

- remove assumption that the backing file/device had
  512-byte sectors
- fix incorrect iovec size variable that would result
  in a buffer overrun when an o/s issued an i/o request
  with more s/g elements than the blockif api

Reviewed by: Zhixiang Yu (zxyu.core@gmail.com)
MFC after: 3 days

10 years agoAdd a dummy statement to the beginning of the pthread_cleanup_pop() macro
tijl [Tue, 22 Oct 2013 19:53:52 +0000 (19:53 +0000)]
Add a dummy statement to the beginning of the pthread_cleanup_pop() macro
to allow a call of the macro to be labelled as in:

label:
  pthread_cleanup_pop();

Reviewed by: imp
MFC after: 3 days

10 years agoRename the "alfred" command to "auto", and document it. Retain support
gavin [Tue, 22 Oct 2013 18:55:52 +0000 (18:55 +0000)]
Rename the "alfred" command to "auto", and document it.  Retain support
for "portsnap alfred" for now.

Discussed: many times, most recently on svn-src-all
MFC after: 1 week

10 years agoThou shalt not leak build host state into the system being compiled.
cperciva [Tue, 22 Oct 2013 18:36:39 +0000 (18:36 +0000)]
Thou shalt not leak build host state into the system being compiled.

The VERSION variable is encoded into the SUNW_ctf sections of the kernel
and every kernel module when dtrace is enabled; starting with 9.2-RELEASE
(when dtrace was turned on in GENERIC) this means that different host kernels
will result in very different kernel binaries being generated.  This tripped
up freebsd-update builds after the build boxes were updated from 9.x to 10.x.

MFC after: 3 days (stable/9)
X-MFC after: 0 days (stable/10)
Security: Rendered two members of so@ temporarily insane

10 years agoThe TCP delayed ACK logic isn't aware of LRO passing up large aggregated
andre [Tue, 22 Oct 2013 18:24:34 +0000 (18:24 +0000)]
The TCP delayed ACK logic isn't aware of LRO passing up large aggregated
segments thinking it received only one segment. This causes it to enable
the delay the ACK for 100ms to wait for another segment which may never
come because all the data was received already.

Doing delayed ACK for LRO segments is bogus for two reasons: a) it pushes
us further away from acking every other packet; b) it introduces additional
delay in responding to the sender.  The latter is especially bad because it
is in the nature of LRO to aggregated all segments of a burst with no more
coming until an ACK is sent back.

Change the delayed ACK logic to detect LRO segments by being larger than
the MSS for this connection and issuing an immediate ACK for them to keep
the ACK clock ticking without interruption.

Reported by: julian, cperciva
Tested by: cperciva
Reviewed by: lstewart
MFC after: 3 days

10 years agoMask out non-address bits in the mac address register, for proper
ian [Tue, 22 Oct 2013 18:14:06 +0000 (18:14 +0000)]
Mask out non-address bits in the mac address register, for proper
detection of an all-zeroes address.  Also remove a misplaced return.

Reviewed by: br@

10 years agoStop conflating WITHOUT_CLANG with WITHOUT_CLANG_IS_CC. This allows
brooks [Tue, 22 Oct 2013 15:53:29 +0000 (15:53 +0000)]
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.

MFC after: 1 week
Sponsored by: DARPA/AFRL

10 years agoIgnore registers on devices where the reg property is malformed. Issue a
nwhitehorn [Tue, 22 Oct 2013 15:47:13 +0000 (15:47 +0000)]
Ignore registers on devices where the reg property is malformed. Issue a
warning if this happens under bootverbose. This prevents some
strange-looking entries in dmesg for SMU devices on Apple G5 systems.

10 years agoSync BERI kernel configs with P4:
brooks [Tue, 22 Oct 2013 15:45:31 +0000 (15:45 +0000)]
Sync BERI kernel configs with P4:

Switch the majority of device configuration to FDT from hints.

Add BERI_*_BASE configs to reduce duplication in the MDROOT and SDROOT
kernels.

Add NFS and GSSAPI support by default.

MFC after: 3 days
Sponsored by: DARPA/AFRL

10 years agoMFP4: 223121 (PIC portion), 225861, 227822, 229692 (PIC only), 229693,
brooks [Tue, 22 Oct 2013 15:29:59 +0000 (15:29 +0000)]
MFP4: 223121 (PIC portion), 225861, 227822, 229692 (PIC only), 229693,
230523, 1123614

Implement a driver for Robert Norton's PIC as an FDT interrupt
controller. Devices whose interrupt-parent property points to a beripic
device will have their interrupt allocation, activation , and setup
operations routed through the IC rather than down the traditional bus
hierarchy.

This driver largely abstracts the underlying CPU away allowing the
PIC to be implemented on CPU's other than BERI. Due to insufficient
abstractions a small amount of MIPS specific code is currently required
in fdt_mips.c and to implement counters.

MFC after: 3 days
Sponsored by: DARPA/AFRL

10 years agoCatch up on 6 years of improvements in Open Firmware nexus devices by
nwhitehorn [Tue, 22 Oct 2013 14:11:16 +0000 (14:11 +0000)]
Catch up on 6 years of improvements in Open Firmware nexus devices by
importing the sparc64 one. At least 90% of this code is MI and will be
moved into /sys/dev/ofw at some point in the future.

10 years agoSet BUS_PROBE_NOWILDCARD on this attachment as a stopgap. Unconditionally
nwhitehorn [Tue, 22 Oct 2013 14:10:00 +0000 (14:10 +0000)]
Set BUS_PROBE_NOWILDCARD on this attachment as a stopgap. Unconditionally
poking at registers in unknown devices is not the best probe mechanism.
This should be reverted and a better solution found later.

10 years agoAllow lots of interrupts (useful on multi-domain platforms) and do not
nwhitehorn [Tue, 22 Oct 2013 14:08:57 +0000 (14:08 +0000)]
Allow lots of interrupts (useful on multi-domain platforms) and do not
set device_quiet() on all devices attached under nexus(4).

10 years agoStandards-conformance and code deduplication:
nwhitehorn [Tue, 22 Oct 2013 14:07:57 +0000 (14:07 +0000)]
Standards-conformance and code deduplication:
- Use bus reference phandles in place of FDT offsets as IRQ domain keys
- Unify the identical macio/fdt/mambo OpenPIC drivers into one
- Be more forgiving (following ePAPR) about what we need from the device
  tree to identify an OpenPIC
- Correctly map all IRQs into an interrupt domain
- Set IRQ_*_CONFORM for interrupts on an unknown PIC type instead of
  failing attachment for that device.

10 years agoFix memory and references leak due to unfreed path.
mav [Tue, 22 Oct 2013 13:56:30 +0000 (13:56 +0000)]
Fix memory and references leak due to unfreed path.

Coverity CID: 1054773

10 years agoFix memory and references leak due to unfreed path.
mav [Tue, 22 Oct 2013 13:52:20 +0000 (13:52 +0000)]
Fix memory and references leak due to unfreed path.

Coverity CID: 1109815

10 years agoUse the vdev's ashift to calculate the supported min block size passed to
smh [Tue, 22 Oct 2013 13:31:36 +0000 (13:31 +0000)]
Use the vdev's ashift to calculate the supported min block size passed to
zio_compress_data(..) when compressing l2arc buffers.

This eliminates l2arc I/O errors, which resulted in very poor performance on
vdev's configured with block size greater than 512b due to compression
assuming a smaller min block size than the vdev supports.

MFC after: 2 days

10 years agoUnconditionally acquire periph reference on CCB allocation failure.
mav [Tue, 22 Oct 2013 12:58:22 +0000 (12:58 +0000)]
Unconditionally acquire periph reference on CCB allocation failure.

cam_periph_acquire() can return error if periph already invalidated, but
that may be unacceptable and cause deadlock if the invalidated periph can't
be destroyed without "executing" the scheduled request.

Coverity CID: 1109822
MFC after: 2 months

10 years agoFix memory and references leak due to unfreed path.
mav [Tue, 22 Oct 2013 12:42:49 +0000 (12:42 +0000)]
Fix memory and references leak due to unfreed path.

Coverity CID: 1109817

10 years agoUpdate ahci(4), respecting recent driver changes.
mav [Tue, 22 Oct 2013 11:56:46 +0000 (11:56 +0000)]
Update ahci(4), respecting recent driver changes.

10 years agoRemove global device lock acquisition from dev_relthread(), replacing it
mav [Tue, 22 Oct 2013 10:40:26 +0000 (10:40 +0000)]
Remove global device lock acquisition from dev_relthread(), replacing it
with atomics on per-device data.

10 years agoRemove Giant-locked drivers support (DISKFLAG_NEEDSGIANT flag) from disk(9).
mav [Tue, 22 Oct 2013 10:21:20 +0000 (10:21 +0000)]
Remove Giant-locked drivers support (DISKFLAG_NEEDSGIANT flag) from disk(9).

Since at least FreeBSD 7 we had only four of them in the base tree, and
in head branch, thanks to jhb@, we have no any for more then a year.

10 years agoMerge GEOM direct dispatch changes from the projects/camlock branch.
mav [Tue, 22 Oct 2013 08:22:19 +0000 (08:22 +0000)]
Merge GEOM direct dispatch changes from the projects/camlock branch.

When safety requirements are met, it allows to avoid passing I/O requests
to GEOM g_up/g_down thread, executing them directly in the caller context.
That allows to avoid CPU bottlenecks in g_up/g_down threads, plus avoid
several context switches per I/O.

The defined now safety requirements are:
 - caller should not hold any locks and should be reenterable;
 - callee should not depend on GEOM dual-threaded concurency semantics;
 - on the way down, if request is unmapped while callee doesn't support it,
   the context should be sleepable;
 - kernel thread stack usage should be below 50%.

To keep compatibility with GEOM classes not meeting above requirements
new provider and consumer flags added:
 - G_CF_DIRECT_SEND -- consumer code meets caller requirements (request);
 - G_CF_DIRECT_RECEIVE -- consumer code meets callee requirements (done);
 - G_PF_DIRECT_SEND -- provider code meets caller requirements (done);
 - G_PF_DIRECT_RECEIVE -- provider code meets callee requirements (request).
Capable GEOM class can set them, allowing direct dispatch in cases where
it is safe.  If any of requirements are not met, request is queued to
g_up or g_down thread same as before.

Such GEOM classes were reviewed and updated to support direct dispatch:
CONCAT, DEV, DISK, GATE, MD, MIRROR, MULTIPATH, NOP, PART, RAID, STRIPE,
VFS, ZERO, ZFS::VDEV, ZFS::ZVOL, all classes based on g_slice KPI (LABEL,
MAP, FLASHMAP, etc).

To declare direct completion capability disk(9) KPI got new flag equivalent
to G_PF_DIRECT_SEND -- DISKFLAG_DIRECT_COMPLETION.  da(4) and ada(4) disk
drivers got it set now thanks to earlier CAM locking work.

This change more then twice increases peak block storage performance on
systems with manu CPUs, together with earlier CAM locking changes reaching
more then 1 million IOPS (512 byte raw reads from 16 SATA SSDs on 4 HBAs to
256 user-level threads).

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

10 years agoAdd a reload command.
des [Tue, 22 Oct 2013 07:44:26 +0000 (07:44 +0000)]
Add a reload command.

Reviewed by: hrs
MFC after: 3 days

10 years agoStart rtsold if necessary.
des [Tue, 22 Oct 2013 06:53:01 +0000 (06:53 +0000)]
Start rtsold if necessary.

Reviewed by: hrs
MFC after: 3 days

10 years agoMake watchdog function conform watchdog(9):
gonzo [Tue, 22 Oct 2013 05:22:46 +0000 (05:22 +0000)]
Make watchdog function conform watchdog(9):
Set error to 0 when watchdog is armed and disable it when timeout
is too large to be set.

10 years ago- Implement watchdog function and register it with watchdog list
gonzo [Tue, 22 Oct 2013 05:19:42 +0000 (05:19 +0000)]
- Implement watchdog function and register it with watchdog list

10 years agoReturn standards-compliant code from OF_nextprop() with FDT when no
nwhitehorn [Tue, 22 Oct 2013 02:39:56 +0000 (02:39 +0000)]
Return standards-compliant code from OF_nextprop() with FDT when no
properties remain on this node.

10 years agoMake netback compile without INET support in the kernel.
bz [Tue, 22 Oct 2013 00:50:53 +0000 (00:50 +0000)]
Make netback compile without INET support in the kernel.

This shuld have been a problem since r230587.  Not exactly sure why it
was not detected the last weeks with the tinderbox.  I would assume
r255744 is what started to cause it.

MFC after: 1 week

10 years agoResolve clang warning about a use of syslog. By using a proper enforcement
sbruno [Mon, 21 Oct 2013 22:55:56 +0000 (22:55 +0000)]
Resolve clang warning about a use of syslog. By using a proper enforcement
of string format in a call so syslog

/usr/src/gnu/lib/libssp/../../../contrib/gcclibs/libssp/ssp.c:137:23:
warning: format string is not a string literal (potentially insecure)
      [-Wformat-security]
    syslog (LOG_CRIT, msg1);
                      ^~~~

Reviewed by: dim@

10 years agoRemove the isf(4) driver. It was created by accident and is subset of
brooks [Mon, 21 Oct 2013 22:43:38 +0000 (22:43 +0000)]
Remove the isf(4) driver.  It was created by accident and is subset of
the cfi(4) driver.  It remained in the tree longer than would be ideal
due to the time required to bring cfi(4) to feature parity.

Sponsored by: DARPA/AFRL
MFC after: 3 days

10 years agoMake hard-wired TLB allocations be at minimum one page. This is required by
nwhitehorn [Mon, 21 Oct 2013 22:25:54 +0000 (22:25 +0000)]
Make hard-wired TLB allocations be at minimum one page. This is required by
some implementations, most notably (in my case) QEMU's e500 emulation.

10 years agoAdd comments that taskqueue_enqueue_locked() returns without the lock.
mav [Mon, 21 Oct 2013 21:16:50 +0000 (21:16 +0000)]
Add comments that taskqueue_enqueue_locked() returns without the lock.

10 years agoMFP4: 223121 (FDT infrastructure portion)
brooks [Mon, 21 Oct 2013 21:13:01 +0000 (21:13 +0000)]
MFP4: 223121 (FDT infrastructure portion)

Implement support for interrupt-parent nodes in simplebus.  The current
implementation requires that device declarations have an interrupt-parent
node and that it point to a device that has registered itself as a
interrupt controller in fdt_ic_list_head and implements the fdt_ic
interface.

Sponsored by:   DARPA/AFRL

10 years agoAllow kernels without options SOFTUPDATES to build. This should fix the
brooks [Mon, 21 Oct 2013 20:51:08 +0000 (20:51 +0000)]
Allow kernels without options SOFTUPDATES to build.  This should fix the
embedded tinderboxes.

Reviewed by: emaste