]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
10 years agoMove includes from if_bcereg.h to .c files.
glebius [Sat, 26 Oct 2013 17:40:38 +0000 (17:40 +0000)]
Move includes from if_bcereg.h to .c files.

10 years agoEnable SATA interface on Armada XP
zbb [Sat, 26 Oct 2013 17:29:50 +0000 (17:29 +0000)]
Enable SATA interface on Armada XP

- Add appropriate entry to DTS
- Allow for MV78460 SATA probe and configuration

Tested by: kevlo
Approved by: cognet (mentor)

10 years agoEnable UART busy detection handling for Armada XP - based board
zbb [Sat, 26 Oct 2013 17:27:32 +0000 (17:27 +0000)]
Enable UART busy detection handling for Armada XP - based board

All Armada XP chips should be affected. It is necessary to handle
busy interrupt/indication by enabling busy-detect property in DTS.

Tested by: kevlo
Approved by: cognet (mentor)

10 years agoWait for DesignWare UART transfers completion before accessing line control
zbb [Sat, 26 Oct 2013 17:24:59 +0000 (17:24 +0000)]
Wait for DesignWare UART transfers completion before accessing line control

When using DW UART with BUSY detection it is necessary to wait
until all serial transfers are finished before manipulating the
line control. LCR will not be affected when UART is busy.
In addition, if Divisor Latch Access Bit is being set in order to
modify UART divisors:
1. We will get BUSY interrupt if interrupts are enabled.
2. Because LCR will not be affected the THR and (even worse) IER
   contents will be corrupted. This will lead to console hang.

Approved by: cognet (mentor)

10 years agoFix concurrency issues with TLB1 updates and make pmap_kextract() search
nwhitehorn [Sat, 26 Oct 2013 16:49:41 +0000 (16:49 +0000)]
Fix concurrency issues with TLB1 updates and make pmap_kextract() search
TLB1 mappings as well, which is required for the console to work after
r257111.

10 years agoFix indentation
bdrewery [Sat, 26 Oct 2013 16:19:14 +0000 (16:19 +0000)]
Fix indentation

Reported by: zont
Approved by: bapt (implicit)
MFC after: 2 days
X-MFC-With: r257145

10 years agoSwitch to using ofw_bus_search_compatible() table-driven compat lookup.
ian [Sat, 26 Oct 2013 15:15:31 +0000 (15:15 +0000)]
Switch to using ofw_bus_search_compatible() table-driven compat lookup.
Add compat strings for Freescale Vybrid family SoCs.

10 years agoDocument that -a will output the device name when -u is not specified..
jmg [Sat, 26 Oct 2013 15:05:27 +0000 (15:05 +0000)]
Document that -a will output the device name when -u is not specified..
when -u is specified it is not...

update the docs to say that you can use full device names w/ -u, and
update the examples...

Submitted by: #vbsdcon
MFC after: 3 days

10 years agoAdd missing /etc/pkg to BSD.root.dist
bdrewery [Sat, 26 Oct 2013 15:02:34 +0000 (15:02 +0000)]
Add missing /etc/pkg to BSD.root.dist

Approved by: bapt
MFC after: 2 days
X-MFC-With: r257145

10 years agoThe old trap.h (then trap_aim.h) actually had trap ID codes for Book-E CPUs.
nwhitehorn [Sat, 26 Oct 2013 14:54:43 +0000 (14:54 +0000)]
The old trap.h (then trap_aim.h) actually had trap ID codes for Book-E CPUs.
Use it universally. Book-E traps may also need revisiting due to the
introduction of fixed-offset traps and the deprecation of IVORs in POWER
ISA 2.06, but that's very much an issue for another day.

10 years agoAdd pmap_mapdev_attr() and pmap_kenter_attr() interfaces. pmap_set_memattr()
nwhitehorn [Sat, 26 Oct 2013 14:52:55 +0000 (14:52 +0000)]
Add pmap_mapdev_attr() and pmap_kenter_attr() interfaces. pmap_set_memattr()
is slightly more complicated and is left unimplemented for now. Also
prevent pmap_mapdev() from mapping over the kernel and KVA regions if
devices happen to have high physical addresses.

MFC after: 2 weeks

10 years agoQueisce warnings for gperf -Wlogical-op-parentheses with parens to
sbruno [Sat, 26 Oct 2013 14:49:19 +0000 (14:49 +0000)]
Queisce warnings for gperf -Wlogical-op-parentheses with parens to
explicitly define the logic

10 years agoDisable fingerprint checking for now as the pkg repository mirrors will
bdrewery [Sat, 26 Oct 2013 14:19:57 +0000 (14:19 +0000)]
Disable fingerprint checking for now as the pkg repository mirrors will
not receive the signature until later this week.

Approved by: bapt

10 years agoLink in libcrypto as well to fix build in some cases.
bdrewery [Sat, 26 Oct 2013 13:38:49 +0000 (13:38 +0000)]
Link in libcrypto as well to fix build in some cases.

Approved by: bapt
MFC after: 2 days
Reported by: many

10 years agomachine/pmap.h is included by vm/pmap.h, so is redundant here. Thanks to
nwhitehorn [Sat, 26 Oct 2013 13:18:39 +0000 (13:18 +0000)]
machine/pmap.h is included by vm/pmap.h, so is redundant here. Thanks to
Alan Cox for pointing this out.

10 years agoMake hastctl list command output current queue sizes.
trociny [Sat, 26 Oct 2013 08:38:21 +0000 (08:38 +0000)]
Make hastctl list command output current queue sizes.

Reviewed by: pjd
MFC after: 1 month

10 years agoMerging local and remote bitmaps must be protected by hr_amp lock.
trociny [Sat, 26 Oct 2013 08:35:54 +0000 (08:35 +0000)]
Merging local and remote bitmaps must be protected by hr_amp lock.

This is believed to fix hastd crashes, which might occur during
synchronization, triggered by the failed assertion:

 Assertion failed: (amp->am_memtab[ext] > 0),
 function activemap_write_complete, file activemap.c, line 351.

MFC after: 1 week

10 years agoDo some cleanup of the SDT code. In particular,
markj [Sat, 26 Oct 2013 06:23:51 +0000 (06:23 +0000)]
Do some cleanup of the SDT code. In particular,

* Remove the unused sdt cdev.
* Don't bother keeping a list of probes in struct sdt_prov; it's not needed.
* Invoke sdt_load and sdt_unload from the module handler instead of
  registering separate SYSINITs.
* Keep to within 80 columns.
* Check for errors from dtrace_unregister().

10 years agoDocument /var/cache/pkg into hier(7) which pkg(8) uses.
bdrewery [Sat, 26 Oct 2013 03:55:29 +0000 (03:55 +0000)]
Document /var/cache/pkg into hier(7) which pkg(8) uses.

Approved by: bapt
MFC after: 2 days

10 years agoAdd infrastructure for installing pkg(8) keys into /etc/keys/pkg and add
bdrewery [Sat, 26 Oct 2013 03:53:24 +0000 (03:53 +0000)]
Add infrastructure for installing pkg(8) keys into /etc/keys/pkg and add
the current test key that packages will be signed with until 10.0-RELEASE.

Approved by: bapt
Discussed by: bapt with des
MFC after: 2 days

10 years agoAdd support to check the signature of a local pkg.txz file being
bdrewery [Sat, 26 Oct 2013 03:47:49 +0000 (03:47 +0000)]
Add support to check the signature of a local pkg.txz file being
added with "pkg add". If the pkg.conf is configured to check for
signature, then the pkg.txz.sig file will be expected and validated
per r257147

Approved by: bapt
MFC after: 2 days

10 years agoTell which fingerprint pkg is being validated against.
bdrewery [Sat, 26 Oct 2013 03:44:08 +0000 (03:44 +0000)]
Tell which fingerprint pkg is being validated against.

Approved by: bapt
MFC after: 2 days

10 years agoSupport checking signature for pkg bootstrap.
bdrewery [Sat, 26 Oct 2013 03:43:02 +0000 (03:43 +0000)]
Support checking signature for pkg bootstrap.

If the pkg.conf is configured with SIGNATURE_TYPE: FINGERPRINTS,
and FINGERPRINTS: /etc/keys/pkg then a pkg.sig file is fetched along
with pkg.txz. The signature contains the signature provided by the
signing server, and the public key. The .sig is the exact output
from the signing server in the following format:

  SIGNATURE
  <openssl signed>
  CERT
  <rsa public key>
  END

The signature is verified with the following logic:

 - If the .sig file is missing, it fails.
 - If the .sig doesn't validate, it fails.
 - If the public key in the .sig is not in the known trusted fingerprints,
   it fails.
 - If the public key is in the revoked key list, it fails.

Approved by: bapt
MFC after: 2 days
Discussed by: bapt with des, jonathan, gavin

10 years agoBe verbose and tell where pkg(8) is being bootstrapped from.
bdrewery [Sat, 26 Oct 2013 03:32:06 +0000 (03:32 +0000)]
Be verbose and tell where pkg(8) is being bootstrapped from.

Approved by: bapt
MFC after: 2 days

10 years agoAdd support for reading configuration files from /etc/pkg.
bdrewery [Sat, 26 Oct 2013 03:31:05 +0000 (03:31 +0000)]
Add support for reading configuration files from /etc/pkg.
For now only /etc/pkg/FreeBSD.conf is supported. Its style is:

Repo: {
   URL: "...",
   MIRROR_TYPE: "...",
   ...
}

The configuration will be read from /usr/local/etc/pkg.conf if exists,
otherwise /etc/pkg/FreeBSD.conf

Approved by: bapt
MFC after:  2 days

10 years agoFix build after r257111 by including headers with definition of pmap_kextract().
nwhitehorn [Sat, 26 Oct 2013 03:22:57 +0000 (03:22 +0000)]
Fix build after r257111 by including headers with definition of pmap_kextract().

10 years agoFix a couple of bugs in the fasttrap emulation of a "push %rbp" instruction:
markj [Sat, 26 Oct 2013 03:21:54 +0000 (03:21 +0000)]
Fix a couple of bugs in the fasttrap emulation of a "push %rbp" instruction:
the code was trying to save the stack pointer rather than the frame pointer,
and the arguments to copyout(9) were reversed, so nothing ended up being
saved on the stack. This would cause process crashes when the pid provider
was being used to instrument calls of a function starting with this
instruction.

Reported by: symbolics@gmx.com
Tested by: symbolics@gmx.com (earlier version)
MFC after: 2 weeks

10 years agoWrap long lines
bdrewery [Sat, 26 Oct 2013 03:21:08 +0000 (03:21 +0000)]
Wrap long lines

Approved by: bapt
MFC after: 2 days

10 years agoadd 0x8b, lifted from Linux iwlegacy/commands.h
adrian [Sat, 26 Oct 2013 01:17:54 +0000 (01:17 +0000)]
add 0x8b, lifted from Linux iwlegacy/commands.h

This is "STA invalid". I saw it during some 4965 testing (kern/183260)
and I still have no idea what is causing it.

Obtained from: Linux drivers/net/wireless/iwlegacy

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