]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
10 years agosh: Remove one syscall when waiting for a foreground job.
jilles [Fri, 18 Oct 2013 12:35:12 +0000 (12:35 +0000)]
sh: Remove one syscall when waiting for a foreground job.

The getpgrp() call is unnecessary: if there is no job control then the
result was not used at all and if there is job control then we are not a
subshell and our process group ID is equal to our process ID (rootpid).

10 years agoRevert r256587.
glebius [Fri, 18 Oct 2013 11:26:40 +0000 (11:26 +0000)]
Revert r256587.

Requested by: zec

10 years agoRevert r256587.
glebius [Fri, 18 Oct 2013 11:25:08 +0000 (11:25 +0000)]
Revert r256587.

Requested by: zec

10 years agoDon't build krping.ko, iw_cxgb.ko, and iw_cxgbe.ko, if MK_OFED=no
trasz [Fri, 18 Oct 2013 09:17:35 +0000 (09:17 +0000)]
Don't build krping.ko, iw_cxgb.ko, and iw_cxgbe.ko, if MK_OFED=no
(the default).  They build, but are unloadable, due to missing ibcore.ko.

Sponsored by: FreeBSD Foundation

10 years agoMake geom_label(4) resize-aware. This fixes a situation when "gpart resize"
trasz [Fri, 18 Oct 2013 09:14:19 +0000 (09:14 +0000)]
Make geom_label(4) resize-aware.  This fixes a situation when "gpart resize"
would resize a partition, but label providers - e.g. /dev/gptid/XXX - would
stay the same size.

Reviewed by: mav
MFC after: 1 month
Sponsored by: FreeBSD Foundation

10 years agoCorrect tx mixer gain value for RT3070 and RT3071.
kevlo [Fri, 18 Oct 2013 07:48:20 +0000 (07:48 +0000)]
Correct tx mixer gain value for RT3070 and RT3071.

Correctly value in EEPROM/EFUSE is one or more for RT3070 and
two or more for other RT3071 chips.

10 years agoSince the DAC issue has been fixed in RT3070(F), the voltage raising fix
kevlo [Fri, 18 Oct 2013 07:46:28 +0000 (07:46 +0000)]
Since the DAC issue has been fixed in RT3070(F), the voltage raising fix
is no longer needed.

10 years agoFix lower bits of RF_R3 for RT3370 and newer. This change doesn't affect
kevlo [Fri, 18 Oct 2013 07:43:49 +0000 (07:43 +0000)]
Fix lower bits of RF_R3 for RT3370 and newer.  This change doesn't affect
older chipsets.

10 years agoFix rf registers for RT3070.
kevlo [Fri, 18 Oct 2013 07:42:16 +0000 (07:42 +0000)]
Fix rf registers for RT3070.

10 years agoUpdate firmware for run(4) to version 0.33.
kevlo [Fri, 18 Oct 2013 07:40:50 +0000 (07:40 +0000)]
Update firmware for run(4) to version 0.33.

10 years ago- Fix a bug which prevented jails from starting when $jail_conf was used and
hrs [Fri, 18 Oct 2013 03:44:16 +0000 (03:44 +0000)]
- Fix a bug which prevented jails from starting when $jail_conf was used and
  no jail name was specified.
- Display error messages when start/stop fails.

Reported by: swills

10 years agoUse long explicitly for the time difference.
hrs [Fri, 18 Oct 2013 02:22:38 +0000 (02:22 +0000)]
Use long explicitly for the time difference.

10 years agoFix typo in previous commit.
np [Fri, 18 Oct 2013 00:00:08 +0000 (00:00 +0000)]
Fix typo in previous commit.

10 years agoiw_cxgbe should have a dependency on t4nex.
np [Thu, 17 Oct 2013 23:57:17 +0000 (23:57 +0000)]
iw_cxgbe should have a dependency on t4nex.

Reported by: trasz@

10 years agoIncrease the KVA available for xscale CPUs.
cognet [Thu, 17 Oct 2013 22:12:32 +0000 (22:12 +0000)]
Increase the KVA available for xscale CPUs.

10 years agoChanges required for OpenBSD/amd64:
grehan [Thu, 17 Oct 2013 22:01:17 +0000 (22:01 +0000)]
Changes required for OpenBSD/amd64:

- Allow a hostbridge to be created with AMD as a vendor.
  This passes the OpenBSD check to allow the use of MSI
  on a PCI bus.
- Enable the i/o interrupt section of the mptable, and
  populate it with unity ISA mappings. This allows the
  'legacy' IRQ mappings of the PCI serial port to be
  set up. Delete unused print routine that was obscuring code.
- Use the '-W' option to enable virtio single-vector MSI
  rather than an environment variable. Update the virtio
  net/block drivers to query this flag when setting up
  interrupts.: bhyverun.c
- Fix the arithmetic used to derive the century byte in
  RTC CMOS, as well as encoding it in BCD.

Reviewed by: neel
MFC after: 3 days

10 years agoAdd lot of missed files and dirs
zont [Thu, 17 Oct 2013 22:00:35 +0000 (22:00 +0000)]
Add lot of missed files and dirs

10 years agoEliminate unconditional debug printfs.
grehan [Thu, 17 Oct 2013 21:56:39 +0000 (21:56 +0000)]
Eliminate unconditional debug printfs.

Linux writes to these nominally read-only registers,
so avoid having bhyve write warning messages to stdout
when the reg writes can be safely ignored. Change the
WPRINTF to DPRINTF which is conditional.

Reviewed by: mav
Discussed with: mav, Zhixiang Yu
MFC after: 3 days

10 years agoSpell cpu_l2cache_wb_range correctly.
cognet [Thu, 17 Oct 2013 21:38:14 +0000 (21:38 +0000)]
Spell cpu_l2cache_wb_range correctly.

10 years ago- Switch to use WBWA mappings for page tables on armv6, this is needed for SMP.
cognet [Thu, 17 Oct 2013 21:06:19 +0000 (21:06 +0000)]
- Switch to use WBWA mappings for page tables on armv6, this is needed for SMP.
- Fix PTE_SYNC() for PIPT L2 caches, using the virtual address wasn't so useful.
- Use PTE_SYNC() for >= armv6

10 years agoOptimize isp(4) to reduce CPU usage, especially in target mode:
mav [Thu, 17 Oct 2013 20:19:15 +0000 (20:19 +0000)]
Optimize isp(4) to reduce CPU usage, especially in target mode:
 - Remove two excessive and slow register reads from isp_intr().  Instead
of rereading value every time, assume that registers contain what we have
written there.
 - Avoid sequential search through 4096 array elements when looking for
command tag.  Use hash of lists to store active tags separately from free
ones and so greatly speedup the searches.

Reviewed by: mjacob

10 years agoRemove atf headers which never existed
zont [Thu, 17 Oct 2013 20:14:47 +0000 (20:14 +0000)]
Remove atf headers which never existed

Reviewed by: marcel

10 years ago- Add relative specification in expiration time.
hrs [Thu, 17 Oct 2013 19:04:05 +0000 (19:04 +0000)]
- Add relative specification in expiration time.
- Add proto3 option for RTF_PROTO3.
- Use %lu for members of struct rt_metrics.

10 years agoiw_cxgbe: iWARP driver for Chelsio T4/T5 chips. This is a straight port
np [Thu, 17 Oct 2013 18:37:25 +0000 (18:37 +0000)]
iw_cxgbe: iWARP driver for Chelsio T4/T5 chips.  This is a straight port
of the iw_cxgb4 found in OFED distributions.

Obtained from: Chelsio

10 years agoFix .debug_line prologue header length calculation for 64-bit DWARF
emaste [Thu, 17 Oct 2013 17:25:00 +0000 (17:25 +0000)]
Fix .debug_line prologue header length calculation for 64-bit DWARF

The header_length field is the number of bytes following the field to
the first byte of the line number program.  The hard-coded constants
previously here (4 + 2 + 4) were correct only for 32-bit DWARF.

Sponsored by: DARPA, AFRL

10 years agoMake casuword() atomic for armv6
cognet [Thu, 17 Oct 2013 17:11:15 +0000 (17:11 +0000)]
Make casuword() atomic for armv6

10 years agoAdd an automatic resize support to the GEOM_PART class.
ae [Thu, 17 Oct 2013 16:18:43 +0000 (16:18 +0000)]
Add an automatic resize support to the GEOM_PART class.

When parent provider has been resized, the scheme specific G_PART_RESIZE
method does an update of scheme's metadata. But all changes are not saved
to disk, until `gpart commit` will be called.

Discussed with: trasz
MFC after: 1 month

10 years agoUse the same actor key for media types of the same speed.
ae [Thu, 17 Oct 2013 15:14:58 +0000 (15:14 +0000)]
Use the same actor key for media types of the same speed.

PR: 176097
MFC after: 2 weeks

10 years agoUpgrade to the latest version of mtree from NetBSD. This revision
brooks [Thu, 17 Oct 2013 14:18:11 +0000 (14:18 +0000)]
Upgrade to the latest version of mtree from NetBSD.  This revision
re-removes the printing of size for non-regular files, supports
type-less root (.) entries as seen in a couple ports, and corrects a bug
in -N that caused expanded Subversion $FreeBSD$ strings in comments to
be processed as /etc/group entries.

Includes one trivial portability fix (including <stdint.h> in three
files) that has been submitted upstream but not yet committed.

MFC after: 3 days

10 years agoFix resource free.
alfred [Thu, 17 Oct 2013 12:19:36 +0000 (12:19 +0000)]
Fix resource free.

The order of releasing resources in mlxen was wrong, which caused
panic on reload of the module.

conf_ctx list should be released before stat_ctx list, otherwise
the leafs in conf_ctx list won't be released because of the dependancy.

The fix is to change the order of the releases.

Submitted by: Shahar Klein (shahark at mellanox.com)

10 years agoFix the -Wconversion warnings produced when compiling the SNMP agent.
syrinx [Thu, 17 Oct 2013 12:03:17 +0000 (12:03 +0000)]
Fix the -Wconversion warnings produced when compiling the SNMP agent.

10 years agoFix SNMP Error response PDUs and properly encode them when using v3 auth/encryption.
syrinx [Thu, 17 Oct 2013 11:49:46 +0000 (11:49 +0000)]
Fix SNMP Error response PDUs and properly encode them when using v3 auth/encryption.

Reported by: harti@

10 years agoIf we avoid to use the page at addr 0, we should adjust the size to reflect it.
cognet [Thu, 17 Oct 2013 09:57:09 +0000 (09:57 +0000)]
If we avoid to use the page at addr 0, we should adjust the size to reflect it.

10 years agoUtilize the stronger guarantees on the call arguments from the
kib [Thu, 17 Oct 2013 07:57:58 +0000 (07:57 +0000)]
Utilize the stronger guarantees on the call arguments from the
harvester, which now always calls hwrngs with the buffer length
multiple of the word size.  This allows to remove the excessive memory
accesses to temporary buffer when saving the entropy word.

Streamline the assembly and unify it between i386 and amd64.

Reviewed by: markm, des
Approved by: so (des)
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

10 years agoCleanup clang section
zont [Thu, 17 Oct 2013 07:40:21 +0000 (07:40 +0000)]
Cleanup clang section

10 years agoAdd a missing comma.
rpaulo [Thu, 17 Oct 2013 05:51:54 +0000 (05:51 +0000)]
Add a missing comma.

10 years agowlconfig exists only on i386
zont [Thu, 17 Oct 2013 05:20:40 +0000 (05:20 +0000)]
wlconfig exists only on i386

10 years agoRemove files which are in ObsoleteFiles.inc
zont [Thu, 17 Oct 2013 04:51:28 +0000 (04:51 +0000)]
Remove files which are in ObsoleteFiles.inc

10 years agoFix the libproc build when DEBUG is defined.
markj [Thu, 17 Oct 2013 03:39:21 +0000 (03:39 +0000)]
Fix the libproc build when DEBUG is defined.

10 years agoRemove duplicates in ipfilter and kerberos sections
zont [Thu, 17 Oct 2013 02:02:29 +0000 (02:02 +0000)]
Remove duplicates in ipfilter and kerberos sections

10 years agoCheck for EHOSTUNREACH when establishing a connection.
kevlo [Thu, 17 Oct 2013 01:59:08 +0000 (01:59 +0000)]
Check for EHOSTUNREACH when establishing a connection.

Reviewed by: trasz

10 years agoMove a lot of debugging printf's to DPRINTF.
rpaulo [Thu, 17 Oct 2013 01:53:07 +0000 (01:53 +0000)]
Move a lot of debugging printf's to DPRINTF.

Approved by: adrian
MFC after: 2 weeks

10 years agoAdd an option to bhyveload(8) that allows setting a loader environment variable
neel [Thu, 17 Oct 2013 00:28:35 +0000 (00:28 +0000)]
Add an option to bhyveload(8) that allows setting a loader environment variable
from the command line.

The option syntax is "-e <name=value>". It may be used multiple times to set
multiple environment variables.

Reviewed by: grehan
Requested by: alfred

10 years agokldxref: Add static keyword to the new function only used in the same file.
jilles [Wed, 16 Oct 2013 20:04:06 +0000 (20:04 +0000)]
kldxref: Add static keyword to the new function only used in the same file.

The WARNS level is not such that the omission broke the build.

Reported by: mdf

10 years agoWhilst here, document that this TX alignment requirement may acutally
adrian [Wed, 16 Oct 2013 19:53:50 +0000 (19:53 +0000)]
Whilst here, document that this TX alignment requirement may acutally
not be required on later hardware.

It would allow for higher packet rates so yes, it would be nice
to disable it.

10 years agoAllow the MDIO bus frequency to be selected.
adrian [Wed, 16 Oct 2013 19:36:50 +0000 (19:36 +0000)]
Allow the MDIO bus frequency to be selected.

The MDIO bus frequency is configured as a divisor off of the MDIO bus
reference clock.  For the AR9344 and later, the MDIO bus frequency can
be faster than normal (ie, up to 100MHz) and thus a static divisor may
not be very applicable.

So, for those boards that may require an actual frequency to be selected
regardless of what crazy stuff the vendor throws in uboot, one can now
set the MDIO bus frequency.  It uses the MDIO frequency and the target
frequency to choose a divisor that doesn't exceed the target frequency.

By default it will choose:

* DIV_28 on everything; except
* DIV_58 on the AR9344 to be conservative.

Whilst I'm here, add some comments about the defaults being not quite
right.  For the other internal switch devices (like the AR933x, AR724x)
the divisor can be higher - it's internal and the reference MDIO clock
is much lower than 100MHz.

The divisor tables and loop code is inspired from Linux/OpenWRT.  It's very
simple; I didn't feel that reimplementing it would yield a substantially
different solution.

Tested:

* AR9331 (mips24k)
* AR9344 (mips74k)

Obtained from: Linux/OpenWRT

10 years agoInvalidate the entire L2 cache before enabling it. Say whether it
ian [Wed, 16 Oct 2013 19:06:44 +0000 (19:06 +0000)]
Invalidate the entire L2 cache before enabling it.  Say whether it
has been enabled or disabled.

10 years agoWhen installing updates, install new directories first and remove old
cperciva [Wed, 16 Oct 2013 18:36:53 +0000 (18:36 +0000)]
When installing updates, install new directories first and remove old
directories last.

This is generally handled by the fact that the list of filesystem objects
is sorted, but this sorting is broken by code which moves .so files ahead
(so that they're present before any binaries which use them)... that code
also moved .so files ahead of directories, which is a problem for upgrading
to 10.0 where there's a new directory containing new .so files.

Errata Notice Candidate.

10 years agoAdd a new capability, VM_CAP_ENABLE_INVPCID, that can be enabled to expose
neel [Wed, 16 Oct 2013 18:20:27 +0000 (18:20 +0000)]
Add a new capability, VM_CAP_ENABLE_INVPCID, that can be enabled to expose
'invpcid' instruction to the guest. Currently bhyve will try to enable this
capability unconditionally if it is available.

Consolidate code in bhyve to set the capabilities so it is no longer
duplicated in BSP and AP bringup.

Add a sysctl 'vm.pmap.invpcid_works' to display whether the 'invpcid'
instruction is available.

Reviewed by: grehan
MFC after: 3 days

10 years agoMake it possible to seek within a gzip stream.
delphij [Wed, 16 Oct 2013 17:16:40 +0000 (17:16 +0000)]
Make it possible to seek within a gzip stream.

10 years agoError out on failure to open specified config file
emaste [Wed, 16 Oct 2013 17:03:46 +0000 (17:03 +0000)]
Error out on failure to open specified config file

10 years agoSince C++ typeinfo objects are currently not guaranteed to be merged at
dim [Wed, 16 Oct 2013 17:00:21 +0000 (17:00 +0000)]
Since C++ typeinfo objects are currently not guaranteed to be merged at
runtime by the dynamic linker, check for their equality in libcxxrt by
not only comparing the typeinfo's name pointers, but also comparing the
full names, if necessary.  (This is similar to what GNU libstdc++ does
in its default configuration.)  The 'deep' check can be turned off again
by defining LIBCXXRT_MERGED_TYPEINFO, and recompiling libcxxrt.

Reviewed by: theraven
MFC after: 3 days

10 years agohelp running sshd on picobsd
luigi [Wed, 16 Oct 2013 16:53:00 +0000 (16:53 +0000)]
help running sshd on picobsd

10 years agoAllow 'make xdev' to work when DESTDIR is set.
ian [Wed, 16 Oct 2013 16:46:25 +0000 (16:46 +0000)]
Allow 'make xdev' to work when DESTDIR is set.

Submitted by: Patrick Kelsey <kelsey@ieee.org>

10 years agoupdate the picobsd script to build with GCC and not CLANG
luigi [Wed, 16 Oct 2013 16:46:15 +0000 (16:46 +0000)]
update the picobsd script to build with GCC and not CLANG

10 years agoAdd cases for the combinations of busdma sync op flags that we handle
ian [Wed, 16 Oct 2013 16:35:25 +0000 (16:35 +0000)]
Add cases for the combinations of busdma sync op flags that we handle
correctly by doing nothing, then add a panic for the default case, because
that implies that some driver asked for a sync (probably incorrectly) and
nothing was done.

10 years agoWhen calculating the number of bounce pages needed, round the maxsize
ian [Wed, 16 Oct 2013 16:32:35 +0000 (16:32 +0000)]
When calculating the number of bounce pages needed, round the maxsize
up to a multiple of PAGE_SIZE, and add one page because there can always
be one more boundary crossing than the number of pages in the transfer.

10 years agoAdd CPU ID for ARM Cortex A5.
br [Wed, 16 Oct 2013 15:20:27 +0000 (15:20 +0000)]
Add CPU ID for ARM Cortex A5.

Approved by: cognet (mentor)

10 years agoFix a register name typo. The effect was that CPU_CONTROL_AFLT_ENABLE
ian [Wed, 16 Oct 2013 14:24:22 +0000 (14:24 +0000)]
Fix a register name typo.  The effect was that CPU_CONTROL_AFLT_ENABLE
wasn't being set, but it was almost assuredly already turned on anyway
by the bootloader.

10 years agoFix long-standing issue with incorrect radix mask calculation.
melifaro [Wed, 16 Oct 2013 12:18:44 +0000 (12:18 +0000)]
Fix long-standing issue with incorrect radix mask calculation.

Usual symptoms are messages like
rn_delete: inconsistent annotation
rn_addmask: mask impossibly already in tree
or inability to flush/delete particular prefix in ipfw table.

Changes:
* Assume 32 bytes as maximum radix key length
* Remove rn_init()
* Statically allocate rn_ones/rn_zeroes
* Make separate mask tree for each "normal" tree instead of system global one
* Remove "optimization" on masks reusage and key zeroying
* Change rn_addmask() arguments to accept tree pointer (no users in base)

PR: kern/182851, kern/169206, kern/135476, kern/134531
Found by: Slawa Olhovchenkov <slw@zxy.spb.ru>
MFC after: 2 weeks
Reviewed by: glebius
Sponsored by: Yandex LLC

10 years agoReflect r248070 (RTM_PINNED) changes in documentation.
melifaro [Wed, 16 Oct 2013 10:36:42 +0000 (10:36 +0000)]
Reflect r248070 (RTM_PINNED) changes in documentation.

Pointed by: pluknet
MFC after: 2 weeks

10 years agoRemove unused fields from radix_node_head.
melifaro [Wed, 16 Oct 2013 10:33:20 +0000 (10:33 +0000)]
Remove unused fields from radix_node_head.

Sponsored by: Yandex LLC

10 years agoMFprojects/camlock r256370:
mav [Wed, 16 Oct 2013 09:56:40 +0000 (09:56 +0000)]
MFprojects/camlock r256370:
 - Take BIO lock in biodone() only when there is no completion callback set
and so we should wake up thread waiting in biowait().
 - Remove msleep() timeout from biowait().  It was added 11 years ago, when
there was no locks used, and it should not be needed any more.

10 years agoMFprojects/camlock r254763:
mav [Wed, 16 Oct 2013 09:52:59 +0000 (09:52 +0000)]
MFprojects/camlock r254763:
Move tq_enqueue() call out of the queue lock for known handlers (actually
I have found no others in the base system).  This reduces queue lock hold
time and congestion spinning under active multithreaded enqueuing.

10 years agoMFprojects/camlock r254685:
mav [Wed, 16 Oct 2013 09:48:23 +0000 (09:48 +0000)]
MFprojects/camlock r254685:
Remove TQ_FLAGS_PENDING flag, softly duplicating queue emptiness status.

10 years agoMFprojects/camlock r256445:
mav [Wed, 16 Oct 2013 09:33:23 +0000 (09:33 +0000)]
MFprojects/camlock r256445:
Add unmapped I/O support to GEOM RAID.

10 years agoMFprojects/camlock r256371:
mav [Wed, 16 Oct 2013 09:21:40 +0000 (09:21 +0000)]
MFprojects/camlock r256371:
Fix passing uninitialized bio_resid argument to g_trace().

10 years agoMFprojects/camlock r254907:
mav [Wed, 16 Oct 2013 09:18:01 +0000 (09:18 +0000)]
MFprojects/camlock r254907:
Move g_io_deliver() out of the lock, as required for direct dispatch.
Move g_destroy_bio() out too to reduce lock scope even more.

10 years agoMFprojects/camlock r254905:
mav [Wed, 16 Oct 2013 09:12:40 +0000 (09:12 +0000)]
MFprojects/camlock r254905:
Introduce new function devstat_end_transaction_bio_bt(), adding new argument
to specify present time.  Use this function to move binuptime() out of lock,
substantially reducing lock congestion when slow timecounter is used.

10 years agoSpeed up `freebsd-update IDS` by using IFS to split fields instead of
cperciva [Wed, 16 Oct 2013 08:19:58 +0000 (08:19 +0000)]
Speed up `freebsd-update IDS` by using IFS to split fields instead of
forking lots of processes to run echo|cut.  In one test this reduced
the CPU time from 980s to 134s and the wallclock time from 806s to
132s.

Submitted by: Oleg Ginzburg

10 years agoFor VIMAGE kernels store vnet in the struct task, and set vnet context
glebius [Wed, 16 Oct 2013 05:02:01 +0000 (05:02 +0000)]
For VIMAGE kernels store vnet in the struct task, and set vnet context
during task processing.

Reported & tested by: mm

10 years agoRename Free() macro to R_Free(). This matches R_Malloc() and has much lower
glebius [Wed, 16 Oct 2013 04:59:59 +0000 (04:59 +0000)]
Rename Free() macro to R_Free(). This matches R_Malloc() and has much lower
probability to clash with other headers.

Submitted by: Eric van Gyzen <eric_van_gyzen dell.com>

10 years agoNow that all of the on-chip switch and basic platform support is updated,
adrian [Wed, 16 Oct 2013 04:22:26 +0000 (04:22 +0000)]
Now that all of the on-chip switch and basic platform support is updated,
we can now add all the hardware bits for the DB120.

* arge0/argemdio0 is hooked up to an AR8327 switch - which there's currently
  no support for.  However, the bootloader on this board does set it up as
  a basic switch so we can at least _use_ it ourselves.

  So we should at least configure the arge0 side of things, including the GMAC
  register.

* .. the GMAC config peels off arge0 from the internal switch and exposes it
  as an RGMII to said AR8327.

* arge1/argemdio1 are hooked up to an internal 10/100 switch.  So, that also
  needs configuring.

* Add support for the NOR flash layout.

* Add support for the wifi (which works, with bugs, but it works.)

What's missing!

* No GPIO stuff yet!
* No sound (I2S) and no NAND flash support yet, sorry!
* The normal DB120 has an external AR95xx wifi chip on PCIe but with the
  actual calibration data in the NOR flash.  My DB120 has been modified
  to let me use the PCIe slot as a normal PCIe slot.  I'll add the "default"
  settings later when I have access to a non-modified one.
* Other stuff, like why the wifi unit gets upset and spits out stuck beacons
  and interrupt storms everywhere.  Sigh.

Tested:

* DB120 board - AR9344 (mips74k SoC) booting off of SPI flash into multi-user
  mode.

10 years agoYes, this board has 128mb of RAM.
adrian [Wed, 16 Oct 2013 04:16:54 +0000 (04:16 +0000)]
Yes, this board has 128mb of RAM.

10 years agoAdd a big, big note to the vlan code that it needs to be taught
adrian [Wed, 16 Oct 2013 04:15:35 +0000 (04:15 +0000)]
Add a big, big note to the vlan code that it needs to be taught
about the new VLAN options for the AR9340 and AR8327 chips.

10 years agoAdd support for the AR9340 switch to the switch framework.
adrian [Wed, 16 Oct 2013 04:15:03 +0000 (04:15 +0000)]
Add support for the AR9340 switch to the switch framework.

* Do the hardware setup in the right order!
* Modify/improve the chip probe check so it can actually
  probe the 7240/9340 directly (although it's not yet used..)
* Initialise and fetch the is_mii option
* Fix some debugging whilst I'm here.

This is enough to get things off the ground.

Tested:

* AR9344 SoC

10 years agoFix the Wii build, and remove an extraneous critical_enter().
jhibbits [Wed, 16 Oct 2013 04:11:42 +0000 (04:11 +0000)]
Fix the Wii build, and remove an extraneous critical_enter().

10 years agoAdd AR9340 switch support to the build.
adrian [Wed, 16 Oct 2013 04:10:28 +0000 (04:10 +0000)]
Add AR9340 switch support to the build.

10 years agoPrepare to link in the AR934x SoC switch support.
adrian [Wed, 16 Oct 2013 03:19:05 +0000 (03:19 +0000)]
Prepare to link in the AR934x SoC switch support.

* Add an AR9340 switch version entry;
* Support the switch being connected via MII;
* Add a flag to note that a switch is actually an internal
  switch rather than an external switch.

Now:

* The ar9340 switch can interconnect via MII;
* Since some slightly different phy/switch register access methods
  and quirks appear for the internal versus external switch,
  we will need a flag to mark it as an "internal" switch.

Tested:

* AR9344 (internal switch)
* AR9331 (internal switch)

TODO:

* Test the AR8316 switch!

10 years agoInitial commit of AR9340 switch SoC support.
adrian [Wed, 16 Oct 2013 03:15:52 +0000 (03:15 +0000)]
Initial commit of AR9340 switch SoC support.

This is just the chip initialisation code (for now.)

It's not linked into the main build as it requires a bunch of other code
to be tidied up and committed.  But it indeed does function as advertised.

Tested:

* AR9344 SoC

10 years agoAdd in the platform specific quirks to get the AR934x SoC ethernet
adrian [Wed, 16 Oct 2013 03:11:18 +0000 (03:11 +0000)]
Add in the platform specific quirks to get the AR934x SoC ethernet
up and running.

* The MAC FIFO configurations needed updating;
* Reset the MDIO block at the same time the MAC block is reset;
* The default divisor needs changing as the DB120 runs at a higher
  base MDIO bus clock compared to other chips.

The long-term fix is to allow the system to have a target MDIO bus
clock rate and then calculate the most suitable divider to meet
that.  This will likely need implementing before stable external
PHY or switch support can be committed.

Tested:

* AR9344 (mips74k)
* AR9331 (mips24k)

10 years agoFix logic error. MPPE only accepts protocol numbers 0x21 through 0xFA.
kevlo [Wed, 16 Oct 2013 02:55:31 +0000 (02:55 +0000)]
Fix logic error.  MPPE only accepts protocol numbers 0x21 through 0xFA.

PR: bin/175974

10 years agoAdd in a write barrier after each if_arge write.
adrian [Wed, 16 Oct 2013 02:46:00 +0000 (02:46 +0000)]
Add in a write barrier after each if_arge write.

Without correct barriers, this code just plain doesn't work on the
mips74k cores (specifically the AR9344.)

In particular, the MDIO register accesses need this barriering or MII bus
access results in out-of-order garbage.

Tested:

* AR9344 (mips74k)
* AR9331 (mips24k)

10 years agoAdd bus space barriers to the AR71xx SPI code.
adrian [Wed, 16 Oct 2013 02:10:35 +0000 (02:10 +0000)]
Add bus space barriers to the AR71xx SPI code.

This is required for correct, stable operation on the MIPS74k SoCs
that are dual-issue, superscalar pipelines.

Tested:

* AR9344 SoC (MIPS74k)
* AR9331 SoC (MIPS24k)

10 years agoAdd a function, memstr, which can be used to convert a buffer of
markj [Wed, 16 Oct 2013 01:39:26 +0000 (01:39 +0000)]
Add a function, memstr, which can be used to convert a buffer of
null-separated strings to a single string. This can be used to print the
full arguments of a process using execsnoop (from the DTrace toolkit) or
with the following one-liner:

dtrace -n 'syscall::execve:return {trace(curpsinfo->pr_psargs);}'

Note that this relies on the process arguments being cached via the struct
proc, which means that it will not work for argvs longer than
kern.ps_arg_cache_limit. However, the following rather non-portable
script can be used to extract any argv at exec time:

fbt::kern_execve:entry
{
    printf("%s", memstr(args[1]->begin_argv, ' ',
        args[1]->begin_envv - args[1]->begin_argv));
}

The debug.dtrace.memstr_max sysctl limits the maximum argument size to
memstr(). Thanks to Brendan Gregg for helpful comments on freebsd-dtrace.

Tested by: Fabian Keil (earlier version)
MFC after: 2 weeks

10 years agoFix the witness warning that warned against calling uiomove() while holding
neel [Wed, 16 Oct 2013 00:58:47 +0000 (00:58 +0000)]
Fix the witness warning that warned against calling uiomove() while holding
the 'vmmdev_mtx' in vmmdev_rw().

Rely on the 'si_threadcount' accounting to ensure that we never destroy the
VM device node while it has operations in progress (e.g. ioctl, mmap etc).

Reported by: grehan
Reviewed by: grehan

10 years agoIn the flowtable scanner, restart the scan at the last found position,
emax [Tue, 15 Oct 2013 21:28:51 +0000 (21:28 +0000)]
In the flowtable scanner, restart the scan at the last found position,
not at position 0.  Changes the scanner from O(N^2) to O(N).

Submitted by: scottl
Obtained from: Netflix, Inc
MFC after: 3 weeks

10 years agoPrevent an unlikely, but real double free issue in gvinum(8).
delphij [Tue, 15 Oct 2013 21:04:46 +0000 (21:04 +0000)]
Prevent an unlikely, but real double free issue in gvinum(8).

Coverity ID: 1018965

10 years agoAdd -K (__FreeBSD_version of kernel) and -U (__FreeBSD_version of userland).
peter [Tue, 15 Oct 2013 20:57:40 +0000 (20:57 +0000)]
Add -K (__FreeBSD_version of kernel) and -U (__FreeBSD_version of userland).
Things like Makefile.inc1 resort to parsing /usr/include/osreldate.h with
awk because this isn't easily available by other means.  The separation
of user and kernel versions is important for jail/chroot environments.

10 years agoRemove a buggy comparision when setting manually the path MTU.
tuexen [Tue, 15 Oct 2013 20:21:27 +0000 (20:21 +0000)]
Remove a buggy comparision when setting manually the path MTU.
After fixing, the comparision would have become redundant.
Thanks to Andrew Galante for reporting the issue.

MFC after: 3 days

10 years agoMove the resource allocation from the ata_*_probe section to the ata_*_attach
andreast [Tue, 15 Oct 2013 18:59:32 +0000 (18:59 +0000)]
Move the resource allocation from the ata_*_probe section to the ata_*_attach
section. This prevents a boot crash on nearly all iMacs and PowerMacs/Books.

The allocation in the probe section was working before because ata_probe was
returning 0 which did not invoke a second DEVICE_PROBE. Now it returns
a BUS_PROBE_DEFAULT which can invoke a second DEVICE_PROBE which results in
a "failed to reserve resource" exit.

PR: powerpc/182978
Discussed with: grehan@
MFC after: 1 Week

10 years agoMake ZFSBOOT_BEROOT_NAME be ROOT by default. This is what sysutils/beadm
dteske [Tue, 15 Oct 2013 18:06:33 +0000 (18:06 +0000)]
Make ZFSBOOT_BEROOT_NAME be ROOT by default. This is what sysutils/beadm
and OpenSolaris/Illumos beadm use.

Remove /usr/local and /var/db/pkg datasets.  Andriy Gapon writes:
I want to note that a good implementation of BEs should support a dependent
datasets feature.  Unfortunately, it seems that we do not have any good BE
implementation for FreeBSD right now.  If we had, personally I'd prefer to
have /usr/local in separate filesystem.

NOTE: Until then, remove these datasets.

Discussed on: src-committers
Submitted by: Bryan Drewery <bryan@shatow.net>
Reviewed by: Allan Jude <freebsd@allanjude.com>
MFC after: 3 days

10 years agoUnify periph invalidation and destruction reporting.
mav [Tue, 15 Oct 2013 17:59:41 +0000 (17:59 +0000)]
Unify periph invalidation and destruction reporting.
Print message containing device model and serial number on invalidation.

Requested by:   glebius
MFC after: 1 week

10 years agoBump .Dd date (should have been part of SVN r256549)
dteske [Tue, 15 Oct 2013 17:52:44 +0000 (17:52 +0000)]
Bump .Dd date (should have been part of SVN r256549)

10 years agoImprove locking model used to protect netgraph topology:
melifaro [Tue, 15 Oct 2013 17:44:35 +0000 (17:44 +0000)]
Improve locking model used to protect netgraph topology:
use rwlocks instead of mutexes on node traversal.

Reviewed by: glebius
Tested by: Eugene Grosbein <egrosbein@rdtc.ru>
MFC after: 2 weeks
Sponsored by: Yandex LLC

10 years agoMan page updates to go along with SVN r256343, introducing zfsboot.
dteske [Tue, 15 Oct 2013 17:33:30 +0000 (17:33 +0000)]
Man page updates to go along with SVN r256343, introducing zfsboot.

10 years agoCorrect programming of XXX_MAXP register. This register is 16-bit wide
hselasky [Tue, 15 Oct 2013 17:11:13 +0000 (17:11 +0000)]
Correct programming of XXX_MAXP register. This register is 16-bit wide
and not 8-bit. Fix support for isochronous transfers in USB host mode.
Fix a whitespace while at it.

MFC after: 1 week
Reported by: SAITOU Toshihide <toshi@ruby.ocn.ne.jp>
PR: usb/181987

10 years agoAdded 4K quirks for Corsair Neutron GTX SSD's
smh [Tue, 15 Oct 2013 17:03:02 +0000 (17:03 +0000)]
Added 4K quirks for Corsair Neutron GTX SSD's

10 years agoFix __free_pages() in the linux shim.
alfred [Tue, 15 Oct 2013 15:50:43 +0000 (15:50 +0000)]
Fix __free_pages() in the linux shim.

__free_pages() is actaully supposed to take a "struct page *" not
an address.

10 years agoFix SVN r256540: s/TMPETC/TMPBOOT/ for loader.conf(5) GELI entries.
dteske [Tue, 15 Oct 2013 15:00:53 +0000 (15:00 +0000)]
Fix SVN r256540: s/TMPETC/TMPBOOT/ for loader.conf(5) GELI entries.