freebsd.git
15 hours agoMake first step toward supporting target and initiator roles same time. master github/master
mav [Sun, 5 Jul 2015 03:38:58 +0000 (03:38 +0000)]
Make first step toward supporting target and initiator roles same time.

To avoid conflicts between target and initiator devices in CAM, make
CTL use target ID reported by HBA as its initiator_id in XPT_PATH_INQ.
That target ID is known to never be used for initiator role, so it won't
conflict.  For Fibre Channel and FireWire HBAs this specific ID choice
is irrelevant since all target IDs there are virtual. Same time for SPI
HBAs it seems could be even requirement to use same target ID for both
initiator and target roles.

While there are some more things to polish in isp(4) driver, first tests
of using both roles same time on the same port appeared successfull:

# camcontrol devlist -v
scbus0 on isp0 bus 0:
<FREEBSD CTLDISK 0001>             at scbus0 target 1 lun 0 (da20,pass21)
<>                                 at scbus0 target 256 lun 0 (ctl0)
<>                                 at scbus0 target -1 lun ffffffff (ctl1)

17 hours agoRemove extra level of target ID indirection (isp_dev_map).
mav [Sun, 5 Jul 2015 02:09:46 +0000 (02:09 +0000)]
Remove extra level of target ID indirection (isp_dev_map).

FreeBSD never had limitation on number of target IDs, and there is no
any other requirement to allocate them densely.  Since slots of port
database already populated just sequentially, there is no much need
for another indirection to allocate sequentially too.

22 hours agoSummary: Add missing files necessary to build with IPSEC and crypto
gnn [Sat, 4 Jul 2015 21:32:44 +0000 (21:32 +0000)]
Summary: Add missing files necessary to build with IPSEC and crypto

23 hours agoFix up tabs vs. spaces
gnn [Sat, 4 Jul 2015 20:31:06 +0000 (20:31 +0000)]
Fix up tabs vs. spaces

23 hours agoAdd llvm patch corresponding to r285149.
dim [Sat, 4 Jul 2015 20:09:24 +0000 (20:09 +0000)]
Add llvm patch corresponding to r285149.

23 hours agoPull in r241142 from upstream llvm trunk (by David Majnemer):
dim [Sat, 4 Jul 2015 20:07:37 +0000 (20:07 +0000)]
Pull in r241142 from upstream llvm trunk (by David Majnemer):

  [SCCP] Turn loads of null into undef instead of zero initialized values

  Surprisingly, this is a correctness issue: the mmx type exists for
  calling convention purposes, LLVM doesn't have a zero representation for
  them.

  This partially fixes PR23999.

Pull in r241143 from upstream llvm trunk (by David Majnemer):

  [LoopUnroll] Use undef for phis with no value live

  We would create a phi node with a zero initialized operand instead of
  undef in the case where no value was originally available.  This was
  problematic for x86_mmx which has no null value.

These fix a "Cannot create a null constant of that type!" error when
compiling the graphics/sdl2_gfx port with MMX enabled.

Reported by: amdmi3

24 hours agoUse the correct type for physical addresses.
jhibbits [Sat, 4 Jul 2015 19:00:38 +0000 (19:00 +0000)]
Use the correct type for physical addresses.

On Book-E, physical addresses are actually 36-bits, not 32-bits.  This is
currently worked around by ignoring the top bits.  However, in some cases, the
boot loader configures CCSR to something above the 32-bit mark.  This is stage 1
in updating the pmap to handle 36-bit physaddr.

24 hours agoChange comment added in r284540.
mav [Sat, 4 Jul 2015 18:51:54 +0000 (18:51 +0000)]
Change comment added in r284540.

This appeared to be not card's issue, but driver's, though solution is
the same so far.

24 hours agoDrop discovered targets when initiator role is disabled.
mav [Sat, 4 Jul 2015 18:38:46 +0000 (18:38 +0000)]
Drop discovered targets when initiator role is disabled.

24 hours agoRemove duplicate header string.h.
araujo [Sat, 4 Jul 2015 18:36:02 +0000 (18:36 +0000)]
Remove duplicate header string.h.

25 hours agoAdd machine check register printing
jhibbits [Sat, 4 Jul 2015 18:16:41 +0000 (18:16 +0000)]
Add machine check register printing

This will print out the Memory Subsystem Status Register on MPC745x (G4+ class),
and the Machine Check Status Register on Book-E class CPUs, to aid in debugging
machine checks.  Other relevant registers, for other CPUs, can be added in the
future.

25 hours agoRemove unused variable flags reported by clang. The function zygote_clone()
araujo [Sat, 4 Jul 2015 17:38:56 +0000 (17:38 +0000)]
Remove unused variable flags reported by clang. The function zygote_clone()
always receive the flags with value 0 and this flags is never checked on
zygote_main().

Differential Revision: D2689
Reviewed by: rodrigc, oshogbo

25 hours agoEnable IPSEC in all GENERIC kernels.
gnn [Sat, 4 Jul 2015 17:37:00 +0000 (17:37 +0000)]
Enable IPSEC in all GENERIC kernels.

Universe and kernel build tests passed 4 July 2015

PR: 128030
Sponsored by: Rubicon Communications (Netgate)

26 hours agoRemove unused variable to silence clang warning.
araujo [Sat, 4 Jul 2015 17:22:07 +0000 (17:22 +0000)]
Remove unused variable to silence clang warning.

Differential Revision: D2683
Reviewed by: rodrigc, bapt

26 hours agoAdd fdclose(3) function.
oshogbo [Sat, 4 Jul 2015 16:42:14 +0000 (16:42 +0000)]
Add fdclose(3) function.

This function is equivalent to fclose(3) function except that it
does not close the underlying file descriptor.
fdclose(3) is step forward to make FILE structure private.

Reviewed by: wblock, jilles, jhb, pjd
Approved by: pjd (mentor)
Differential Revision: https://reviews.freebsd.org/D2697

27 hours agoMove the nvlist source and private includes from sys/kern to seperate
oshogbo [Sat, 4 Jul 2015 16:33:37 +0000 (16:33 +0000)]
Move the nvlist source and private includes from sys/kern to seperate
directory sys/contrib/libnv.

The goal of this operation is to NOT install header files which shouldn't
be used outside the nvlist library.

Approved by: pjd (mentor)

27 hours agoInstall loader.rc with ARM u-boot loader (ubldr).
loos [Sat, 4 Jul 2015 16:19:38 +0000 (16:19 +0000)]
Install loader.rc with ARM u-boot loader (ubldr).

loader.rc is the responsible to read and process loader.conf variables.

This fix the issue of loader.conf being silently ignored.

MFC after: 3 days

27 hours agoFix validation of crypted password
bapt [Sat, 4 Jul 2015 15:56:59 +0000 (15:56 +0000)]
Fix validation of crypted password
Small cleanups

27 hours agoAlso validate inputs of pw groupmod -h and groupmod -H
bapt [Sat, 4 Jul 2015 15:54:11 +0000 (15:54 +0000)]
Also validate inputs of pw groupmod -h and groupmod -H

27 hours agovfs: use shared vnode locking when looking up ".." in vop_stdvptocnp
mjg [Sat, 4 Jul 2015 15:46:39 +0000 (15:46 +0000)]
vfs: use shared vnode locking when looking up ".." in vop_stdvptocnp

Briefly discussed with: kib

27 hours agofd: de-k&r-ify functions + some whitespace fixes
mjg [Sat, 4 Jul 2015 15:42:03 +0000 (15:42 +0000)]
fd: de-k&r-ify functions + some whitespace fixes

No functional changes.

28 hours agoValidate input of pw usermod -h and pwusermod -H
bapt [Sat, 4 Jul 2015 15:27:04 +0000 (15:27 +0000)]
Validate input of pw usermod -h and pwusermod -H

Push the code that set the password into a separate function to improve
readability

Add regression tests about pw usermod -h and pw usermod -H

28 hours agosysctl: get rid of sysctl_lock/unlock
mjg [Sat, 4 Jul 2015 14:44:39 +0000 (14:44 +0000)]
sysctl: get rid of sysctl_lock/unlock

Inline their contents into the only consumer.

33 hours agoRemove non-existent dnvlist functions.
oshogbo [Sat, 4 Jul 2015 10:33:33 +0000 (10:33 +0000)]
Remove non-existent dnvlist functions.

Approved by: pjd (mentor)

33 hours agoMove nvlist documentation to the FreeBSD Kernel Developer's sections.
oshogbo [Sat, 4 Jul 2015 10:27:30 +0000 (10:27 +0000)]
Move nvlist documentation to the FreeBSD Kernel Developer's sections.

Approved by: pjd (mentor)

34 hours agoStaticize some stuff in mountd(8); no functional changes.
trasz [Sat, 4 Jul 2015 08:40:48 +0000 (08:40 +0000)]
Staticize some stuff in mountd(8); no functional changes.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

35 hours agoimprove dependencies for this module a bit... not great, but at
jmg [Sat, 4 Jul 2015 08:16:32 +0000 (08:16 +0000)]
improve dependencies for this module a bit...  not great, but at
least gives some basics...  I would add them to DPSRC, but due to the
intrinsics headers, they can't be added...

36 hours agosysctl: remove a debugging printf which crept in with r285125
mjg [Sat, 4 Jul 2015 07:01:43 +0000 (07:01 +0000)]
sysctl: remove a debugging printf which crept in with r285125

36 hours agosysctl: switch sysctllock to a sleepable rmlock
mjg [Sat, 4 Jul 2015 06:54:15 +0000 (06:54 +0000)]
sysctl: switch sysctllock to a sleepable rmlock

The lock is almost never taken for writing.

37 hours agoCache _MPATH and pass it down into the modules build. Some NFS setups
imp [Sat, 4 Jul 2015 05:43:45 +0000 (05:43 +0000)]
Cache _MPATH and pass it down into the modules build. Some NFS setups
make the find it does extremely expensive, so compute it only
once. Also make sure the 'traditional' module building method works at
the expense of a bit of duplicated code.

40 hours agoQuieten the scorpion SoC/WMAC reset path. Stuff the non-error stuff
adrian [Sat, 4 Jul 2015 03:15:42 +0000 (03:15 +0000)]
Quieten the scorpion SoC/WMAC reset path.  Stuff the non-error stuff
under HALDEBUG().

40 hours agoCall the WMAC DDR flush before handling an interrupt for the
adrian [Sat, 4 Jul 2015 03:07:28 +0000 (03:07 +0000)]
Call the WMAC DDR flush before handling an interrupt for the
Atheros AHB (internally) connected MAC.

TODO:

* verify the interrupt was for us before doing the DDR flush.

40 hours agoReshuffle all of the DDR flush operations into a single switch/mux,
adrian [Sat, 4 Jul 2015 03:05:57 +0000 (03:05 +0000)]
Reshuffle all of the DDR flush operations into a single switch/mux,
and start teaching subsystems about it.

The Atheros MIPS platforms don't guarantee any kind of FIFO consistency
with interrupts in hardware.  So software needs to do a flush when it
receives an interrupt and before it calls the interrupt handler.

There are new ones for the QCA934x and QCA955x, so do a few things:

* Get rid of the individual ones (for ethernet and IP2);
* Create a mux and enum listing all the variations on DDR flushes;
* replace the uses of IP2 with the relevant one (which will typically
  be "PCI" here);
* call the USB DDR flush before calling the real USB interrupt handlers;
* call the ethernet one upon receiving an interrupt that's for us,
  rather than never calling it during operation.

Tested:

* QCA9558 (TP-Link archer c7 v2)
* AR9331 (Carambola 2)

TODO:

* PCI, USB, ethernet, etc need to do a double-check to see if the
  interrupt was truely for them before doing the DDR.  For now I
  prefer "correct" over "fast".

40 hours agoWake up the hardware before doing anything in sysctl.
adrian [Sat, 4 Jul 2015 02:59:30 +0000 (02:59 +0000)]
Wake up the hardware before doing anything in sysctl.

This stops the panics that occur on MIPS platforms when doing say,
'sysctl dev.ath.0' whilst the MAC is asleep.  The MIPS platform is
rather unforgiving in getting power-save register access wrong and you
will get all kinds of odd failures if you don't have things woken
up at the right times.

Tested:

* QCA9558 (TP-Link Archer C7 v2)
* AR9331 (Carambola 2)

.. with no VAPs configured and ath0 down (thus the MAC is definitely
   asleep.)

PR: kern/201117

40 hours agoAdd support for TEST_METADATA
jmmv [Sat, 4 Jul 2015 02:37:36 +0000 (02:37 +0000)]
Add support for TEST_METADATA

Allow Makefiles to define generic metadata settings that apply to all test
programs defined by a Makefile.  The generic TEST_METADATA variable extends
the per-test program settings already supported via TEST_METADATA.<program>.

This feature will be useful to easily apply some settings to all programs
in a directory.  In particular, Kyua 0.12 will support parallel execution
of test programs and a bunch of them will need to be tagged as is_exclusive
to indicate that they cannot be run in parallel with anything else due to
their side-effects.  It will be reasonable to set this setting on whole
directories.

MFC after: 1 week

41 hours agoAdd missing shebang
jmmv [Sat, 4 Jul 2015 02:24:47 +0000 (02:24 +0000)]
Add missing shebang

Plain test programs are not preprocessed by the build system (as opposed to
ATF test cases, which automatically gain a shebang pointing at atf-sh), so
we must take care of providing the shebang ourselves.

I'm not sure why this was not causing problems with Kyua 0.11, but the
upcoming 0.12 release chokes on this particular issue.

MFC after: 1 week

41 hours agoMake cleanup routines idempotent
jmmv [Sat, 4 Jul 2015 02:22:26 +0000 (02:22 +0000)]
Make cleanup routines idempotent

cleanup routines can be executed at any point during the execution of the
body, including even before the body has done any real work.  In those
cases, cleanup routines should be careful to not raise spurious errors so
as to not "override" the actual result of the test case.

This is just general good coding style but is not a problem in practice
for these specific tests.  (The way I discovered the issue, though, was
due to a regression I introduced in Kyua itself while refactoring some
internals.)

MFC after: 1 week

43 hours agoRevert r285018, r285019, r285076, r285078, r285082.
gjb [Sat, 4 Jul 2015 00:01:41 +0000 (00:01 +0000)]
Revert r285018, r285019, r285076, r285078, r285082.

The true cause of the missing UFS/MSDOSFS labels has been
identified, and only affects stable/10 at the moment.

An request for commit to stable/10 will be pending RE approval
after this commit.

MFC after: 1 day
X-MFC-Note: never
X-MFC-Never: r285018, r285019, r285076, r285078, r285082
Sponsored by: The FreeBSD Foundation

45 hours agoIf a "principal" argument isn't provided for a Kerberized NFS mount,
rmacklem [Fri, 3 Jul 2015 22:11:07 +0000 (22:11 +0000)]
If a "principal" argument isn't provided for a Kerberized NFS mount,
the kernel would generate a bogus one with a ":/<path>" suffix.
This would only occur for the case where there was no explicit
"principal" argument and the getaddrinfo() call in mount_nfs.c failed to a
return a cannonical name for the server.
This patch fixes this unusual case.

PR: 201073
Submitted by: masato@itc.naist.jp
MFC after: 2 weeks

46 hours agoUpdate the date on the manual page.
gnn [Fri, 3 Jul 2015 20:42:31 +0000 (20:42 +0000)]
Update the date on the manual page.

Noticed by: bz

47 hours agoNew AES modes for IPSec, user space components.
gnn [Fri, 3 Jul 2015 20:09:14 +0000 (20:09 +0000)]
New AES modes for IPSec, user space components.
Update setkey and libipsec to understand aes-gcm-16 as an
encryption method.

A partial commit of the work in review D2936.

Submitted by: eri
Reviewed by: jmg
MFC after: 2 weeks
Sponsored by: Rubicon Communications (Netgate)

2 days agoKeep IPv6 address specified by IPV6_PKTINFO socket option in kernel
ae [Fri, 3 Jul 2015 19:01:38 +0000 (19:01 +0000)]
Keep IPv6 address specified by IPV6_PKTINFO socket option in kernel
internal form to be able handle link-local IPv6 addresses.

Reported by: kp
Tested by: kp

2 days agoAdd the routines to activate the GMAC clock and setup the GMAC mode.
loos [Fri, 3 Jul 2015 18:39:25 +0000 (18:39 +0000)]
Add the routines to activate the GMAC clock and setup the GMAC mode.

Tested on Cubieboard 2 and Banana pi.

2 days agoRename a10_emac_gpio_config() to a10_gpio_ethernet_activate() to make the
loos [Fri, 3 Jul 2015 17:54:41 +0000 (17:54 +0000)]
Rename a10_emac_gpio_config() to a10_gpio_ethernet_activate() to make the
change to GMAC easier on A20 SoCs.

On A10 only the EMAC controller is available (fast ethernet), but on A20
there is also GMAC a high (or better) performant controller (gigabit
ethernet).

On A20 the both controllers uses the same pins to talk to the ethernet PHY
(MII or RGMII) and they can be selected by the GPIO pin mux.

There is work in progress to bring in GMAC support.

2 days agoGrammar and language fixes.
kib [Fri, 3 Jul 2015 17:30:31 +0000 (17:30 +0000)]
Grammar and language fixes.

Submitted by: wblock
Review: https://reviews.freebsd.org/D2969
MFC after: 12 days

2 days agoRemove duplicate and unnecessary includes.
loos [Fri, 3 Jul 2015 17:09:27 +0000 (17:09 +0000)]
Remove duplicate and unnecessary includes.

While here remove an unused and wrong define.

2 days agoMake ctl(4) appear in "man -k iscsi" results.
trasz [Fri, 3 Jul 2015 16:55:08 +0000 (16:55 +0000)]
Make ctl(4) appear in "man -k iscsi" results.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

2 days agoMinor update to the proto(4) man page:
marcel [Fri, 3 Jul 2015 16:20:14 +0000 (16:20 +0000)]
Minor update to the proto(4) man page:
1.  We now support ISA devices
2.  DMA support has been added

2 days agoRemove commented-out and non-existent cbus(4) attachment for uart(4).
marcel [Fri, 3 Jul 2015 16:02:06 +0000 (16:02 +0000)]
Remove commented-out and non-existent cbus(4) attachment for uart(4).

2 days agoAllow proto(4) to be compiled into the kernel.
marcel [Fri, 3 Jul 2015 15:56:00 +0000 (15:56 +0000)]
Allow proto(4) to be compiled into the kernel.

2 days agoReduce overhead of IPSEC for traffic generated from host
eri [Fri, 3 Jul 2015 15:31:56 +0000 (15:31 +0000)]
Reduce overhead of IPSEC for traffic generated from host

When IPSEC is enabled on the kernel the forwarding path has an optimization to not enter the code paths
for checking security policies but first checks if there is any security policy active at all.

The patch introduces the same optimization but for traffic generated from the host itself.
This reduces the overhead by 50% on my tests for generated host traffic without and SP active.

Differential Revision: https://reviews.freebsd.org/D2980
Reviewed by: ae, gnn
Approved by: gnn(mentor)

2 days agoo Add a description for virtio block device implemented
br [Fri, 3 Jul 2015 14:46:57 +0000 (14:46 +0000)]
o Add a description for virtio block device implemented
  in PISM (Bluespec C-interface device)
o Add a kernel config

Sponsored by: HEIF5

2 days agoAllow BERI virtio-platform code to operate with no PIO devices specified.
br [Fri, 3 Jul 2015 14:27:28 +0000 (14:27 +0000)]
Allow BERI virtio-platform code to operate with no PIO devices specified.
We will use it with Bluespec simulator of CHERI processor for invalidating
caches only.

2 days agoAdd 'prewrite' method allowing us to run some platform-specific
br [Fri, 3 Jul 2015 14:13:16 +0000 (14:13 +0000)]
Add 'prewrite' method allowing us to run some platform-specific
code before each write happens, e.g. write-back caches.
This will help booting in Bluespec simulator of CHERI processor.

2 days agoAdd AHCI attachment code for Allwinner A10/A20 SoCs.
loos [Fri, 3 Jul 2015 14:11:01 +0000 (14:11 +0000)]
Add AHCI attachment code for Allwinner A10/A20 SoCs.

The Allwinner SoC has an AHCI device on its internal main bus rather
than the PCI bus.  This SoC is somewhat underdocumented, and its SATA
controller is no exception.  The methods to support this chip were
harvested from the Linux Allwinner SDK, and then constants invented to
describe what's going on based on low-level constants contained in the
SATA standard and guess work.

This SoC requires a specific AHCI channel setup in order to start the
operations on the channel properly.

Clock setup and AHCI channel setup idea came from NetBSD.

Tested on Cubieboard 2 and Banana pi (and attachment on Cubieboard by
Pratik Singhal).

Differential Revision: https://reviews.freebsd.org/D737
Submitted by: imp
Reviewed by: imp, ganbold, mav, andrew

2 days agonetfront: preserve configuration across migrations
royger [Fri, 3 Jul 2015 12:09:05 +0000 (12:09 +0000)]
netfront: preserve configuration across migrations

Try to preserve the xn configuration when migrating. This is not always
possible since the backend might not have the same set of options
available, in which case we will try to preserve as many as possible.

MFC after:    2 weeks
PR:           183139
Reported by:  mcdouga9@egr.msu.edu
Sponsored by: Citrix Systems R&D

2 days agoFix broken implementation of "kvasprintf()" function by adding missing
hselasky [Fri, 3 Jul 2015 11:16:20 +0000 (11:16 +0000)]
Fix broken implementation of "kvasprintf()" function by adding missing
kmalloc() call. Make function global instead of static inline to fix
compiler warnings about passing variable argument lists to inline
functions.

MFC after: 1 week
Sponsored by: Mellanox Technologies

2 days agoRemove OpenSSL dependency from iscsid(8) and ctld(8).
trasz [Fri, 3 Jul 2015 10:08:10 +0000 (10:08 +0000)]
Remove OpenSSL dependency from iscsid(8) and ctld(8).

Differential Revision: https://reviews.freebsd.org/D2866
Submitted by: Tony Morlan <tony at scroner.com> (earlier version)
Reviewed by: bapt@, delphij@
MFC after: 1 month
Sponsored by: The FreeBSD Foundation

2 days agoUser proper terminology - iSCSI sessions, not iSCSI connections.
trasz [Fri, 3 Jul 2015 10:04:41 +0000 (10:04 +0000)]
User proper terminology - iSCSI sessions, not iSCSI connections.

Sponsored by: The FreeBSD Foundation

2 days agoMove comment to the right position.
bz [Fri, 3 Jul 2015 09:53:56 +0000 (09:53 +0000)]
Move comment to the right position.

PR: 152791
Submitted by: vangyzen (as part of the functional change)
MFC after: 3 days

2 days agoOops - fix typo.
adrian [Fri, 3 Jul 2015 07:00:24 +0000 (07:00 +0000)]
Oops - fix typo.

2 days agoTest for loader.rc existence before attempting to create
gjb [Fri, 3 Jul 2015 06:15:54 +0000 (06:15 +0000)]
Test for loader.rc existence before attempting to create
the symlink from loader.rc.sample.

Fix paths relative to the CHROOTDIR.

MFC after: 3 days
X-MFC-With: r285076, r285078
X-MFC-Before: 10.2-BETA1
Sponsored by: The FreeBSD Foundation

2 days agoUpdated depends
sjg [Fri, 3 Jul 2015 06:11:54 +0000 (06:11 +0000)]
Updated depends

2 days agoFix generation of src.conf.5
sjg [Fri, 3 Jul 2015 06:10:09 +0000 (06:10 +0000)]
Fix generation of src.conf.5

Since makeman turns all options on, we need to guard somethings from
make(showconfig)

2 days agoAdd initial support for the TP-Link Archer C7 v2.
adrian [Fri, 3 Jul 2015 06:09:56 +0000 (06:09 +0000)]
Add initial support for the TP-Link Archer C7 v2.

The SoC, the flash, the ethernet ports and ethernet switch all work.
The USB works.

The 11ac PCIe NIC internally is at least seen by the PCIE RC, but
I haven't tried using it yet.  There's no driver and I haven't
yet swapped it out for a non-11ac chip.

The on-chip 2GHz wifi works, but there are some data errors that
get thrown up in STA mode when scanning.  I have a feeling I have
to finish the DDR flush code out and have it run correctly on the
shared interrupts; that'll take a bit of time to get right.

But if you're after an updated piece of hardware, the Archer C7 v2
is certainly there, and you can replace the 11ac NIC with a 3x3
Atheros PCIe device (eg AR9380, AR9390, AR9580, etc) and it'll
"just work".

Tested:

* TP-Link archer c7v2.

2 days agoRevert r285018 and r285019, which attempted to resolve
gjb [Fri, 3 Jul 2015 06:07:21 +0000 (06:07 +0000)]
Revert r285018 and r285019, which attempted to resolve
UFS/MSDOSFS label issues on FreeBSD/arm builds, however
the real problem was addressed in r285076, which is due
to two separate issues, unrelated to md(4) stale device
existence.

MFC after: 3 days
X-MFC-With: r285076
X-MFC-Before: 10.2-BETA1
Sponsored by: The FreeBSD Foundation

2 days agoAdd pcb1 to the QCA955x.
adrian [Fri, 3 Jul 2015 06:06:44 +0000 (06:06 +0000)]
Add pcb1 to the QCA955x.

The Tp-link Archer-C7v2 unit has a QCA9558 internally but hangs the
QCA988x 11ac PCIe NIC off of PCI RC #1, not #0.

So I actually finally /do/ have a board to verify whether PCIe is working.
Grr.

Tested:

* TP-Link Archer-C7v2.

2 days agoFix the real problem with missing UFS/MSDOSFS labels on the
gjb [Fri, 3 Jul 2015 06:01:37 +0000 (06:01 +0000)]
Fix the real problem with missing UFS/MSDOSFS labels on the
FreeBSD/arm builds.  The problem stems from the loader.rc file
not existing, as well as geom_label not being loaded at boot.

For now, add the geom_label_load entry to loader.conf, and
symlink loader.rc.sample to loader.rc, both of which allowed
my BeagleBone Black to boot fine with a UFS label reference in
fstab(5).

MFC after: 3 days
X-MFC-Before: 10.2-BETA1
Sponsored by: The FreeBSD Foundation

2 days agoImplement busdma_md_unload() and busdma_sync().
marcel [Fri, 3 Jul 2015 05:47:56 +0000 (05:47 +0000)]
Implement busdma_md_unload() and busdma_sync().

While here:
1.  have the Python bindings contain constants for the space
    identifiers and the sync operation.
2.  change the segment iterators to return None when done,
    not ENXIO.

2 days agoImplement unload and sync operations.
marcel [Fri, 3 Jul 2015 05:44:58 +0000 (05:44 +0000)]
Implement unload and sync operations.

2 days agoEnable setting the QCA955x GPIO output mux configuration.
adrian [Fri, 3 Jul 2015 03:34:21 +0000 (03:34 +0000)]
Enable setting the QCA955x GPIO output mux configuration.

It's not used by any boards yet, but it's going to creep up soon
as more boards show up.

2 days agoAdd register defines for the QCA955x DDR flush and GPIO control.
adrian [Fri, 3 Jul 2015 03:32:54 +0000 (03:32 +0000)]
Add register defines for the QCA955x DDR flush and GPIO control.

2 days agoAdd busdma_md_create, busdma_md_destroy and busdma_md_load.
marcel [Fri, 3 Jul 2015 02:06:47 +0000 (02:06 +0000)]
Add busdma_md_create, busdma_md_destroy and busdma_md_load.

2 days agomore word smithing wrt the crd_inject field...
jmg [Fri, 3 Jul 2015 01:55:06 +0000 (01:55 +0000)]
more word smithing wrt the crd_inject field...

We've already defined IV earlier, so no need to expand it a second
time here...

2 days agoAdd create, destroy and load of memory descriptors.
marcel [Fri, 3 Jul 2015 01:52:22 +0000 (01:52 +0000)]
Add create, destroy and load of memory descriptors.

2 days agoKill MFILES and find things automatically. It turned out to be only
imp [Fri, 3 Jul 2015 01:50:26 +0000 (01:50 +0000)]
Kill MFILES and find things automatically. It turned out to be only
lightly used. Find the proper .m file when we depend on *_if.[ch] in
the srcs line, with seat-belts for false positive matches.  This uses
make's path mechanism. A further refinement would be to calculate this
once, and then pass the resulting _MPATH to modules submakes.

Differential Revision: https://reviews.freebsd.org/D2327

2 days agomfiutil: increase buffer size to accommodate sprintf string
emaste [Fri, 3 Jul 2015 01:43:11 +0000 (01:43 +0000)]
mfiutil: increase buffer size to accommodate sprintf string

PR: 201289
MFC after: 1 week

2 days agoAlex Burlyga reported a POLA violation for the new NFS client as
rmacklem [Fri, 3 Jul 2015 01:15:21 +0000 (01:15 +0000)]
Alex Burlyga reported a POLA violation for the new NFS client as
compared to the old NFS client via email to the freebsd-fs@ mailing list.
For the new client, when multiple clients attempted to create a symbolic
link concurrently, more that one client would report success instead of
EEXIST. This was caused by code in the new client that mapped EEXIST to
OK assuming it was caused by a retried RPC request.
Since the old client did not do this, the patch defaults to the old
behaviour and permits the new behaviour to be enabled via a sysctl.

Reported by: alex.burlyga.ietf@gmail.com
Tested by: alex.burlyga.ietf@gmail.com
MFC after: 2 weeks

2 days agoupdate the documentation of the _IV_ flags... _IV_PRESENT doesn't
jmg [Fri, 3 Jul 2015 00:37:16 +0000 (00:37 +0000)]
update the documentation of the _IV_ flags...  _IV_PRESENT doesn't
mean what you think it should...  This will be fixed in the future
with a flag rename, but document what the flag really does and make
the _IV_ flags clear what their presents (or lack there of) means...

Reviewed by: gnn, eri (both earlier version)

2 days agoAdd repository.callsign, to help arcanist figure out what repo it's
mat [Thu, 2 Jul 2015 22:23:52 +0000 (22:23 +0000)]
Add repository.callsign, to help arcanist figure out what repo it's
doing things on when not using Subversion.

With hat: phabric-admin@
Sponsored by: Absolight

2 days agoLet the nv.h and dnv.h includes be only in sys directory.
oshogbo [Thu, 2 Jul 2015 21:58:10 +0000 (21:58 +0000)]
Let the nv.h and dnv.h includes be only in sys directory.

Change consumers to include those files from sys.
Add duplicated files to ObsoleteFiles.

Approved by: pjd (mentor)

2 days agoAdd stddef.h for size_t typedef.
oshogbo [Thu, 2 Jul 2015 21:46:07 +0000 (21:46 +0000)]
Add stddef.h for size_t typedef.

Approved by: pjd (mentor)

2 days agoBump .Dd due to changes made in r285050 and r285053
garga [Thu, 2 Jul 2015 19:41:08 +0000 (19:41 +0000)]
Bump .Dd due to changes made in r285050 and r285053

Spotted by: loos
Approved by: loos

3 days agoAdd an ISA/ACPI bus attachment to proto(4).
marcel [Thu, 2 Jul 2015 19:21:29 +0000 (19:21 +0000)]
Add an ISA/ACPI bus attachment to proto(4).

3 days agosysvshm: fix up some whitespace issues and spurious initialisation
mjg [Thu, 2 Jul 2015 19:14:30 +0000 (19:14 +0000)]
sysvshm: fix up some whitespace issues and spurious initialisation

3 days agosysvshm: don't lock proc when calculating attach_va
mjg [Thu, 2 Jul 2015 19:03:44 +0000 (19:03 +0000)]
sysvshm: don't lock proc when calculating attach_va

vm_daddr is constant and RLIMIT_DATA can be obtained from thread's copy of
rlimits.

3 days agosysvshm: fix shmrealloc
mjg [Thu, 2 Jul 2015 19:00:22 +0000 (19:00 +0000)]
sysvshm: fix shmrealloc

The code was supposed to initialize new segs in newsegs array, but used the old
pointer.

3 days agovm: don't lock proc around accesses to vm_{t,d}addr and RLIMIT_DATA in sys_mmap
mjg [Thu, 2 Jul 2015 18:30:12 +0000 (18:30 +0000)]
vm: don't lock proc around accesses to vm_{t,d}addr and RLIMIT_DATA in sys_mmap

vm_{t,d}addr are constant and we can use thread's copy of resource limits

3 days agoImprove pw_lock.3 text changed in r285050
garga [Thu, 2 Jul 2015 18:27:18 +0000 (18:27 +0000)]
Improve pw_lock.3 text changed in r285050

Suggested by: wblock
Approved by: gnn

3 days agoAvoid doing multiple route lookups for the same destination IP during forwarding
eri [Thu, 2 Jul 2015 18:10:41 +0000 (18:10 +0000)]
Avoid doing multiple route lookups for the same destination IP during forwarding

ip_forward() does a route lookup for testing this packet can be sent to a known destination,
it also can do another route lookup if it detects that an ICMP redirect is needed,
it forgets all of this and handovers to ip_output() to do the same lookup yet again.

This optimisation just does one route lookup during the forwarding path and handovers that to be considered by ip_output().

Differential Revision: https://reviews.freebsd.org/D2964
Approved by: ae, gnn(mentor)
MFC after: 1 week

3 days agoWhen passwd or group information is changed (by pw, vipw, chpass, ...)
garga [Thu, 2 Jul 2015 17:30:59 +0000 (17:30 +0000)]
When passwd or group information is changed (by pw, vipw, chpass, ...)
temporary file is created and then a rename() call move it to official file.
This operation didn't have any check to make sure data was written to disk
and if a power cycle happens system could end up with a 0 length passwd
or group database.

There is a pfSense bug with more infor about it:

https://redmine.pfsense.org/issues/4523

The following changes were made to protect passwd and group operations:

* lib/libutil/gr_util.c:
 - Replace mkstemp() by mkostemp() with O_SYNC flag to create temp file
 - After rename(), fsync() call on directory for faster result

* lib/libutil/pw_util.c
 - Replace mkstemp() by mkostemp() with O_SYNC flag to create temp file

* usr.sbin/pwd_mkdb/pwd_mkdb.c
 - Added O_SYNC flag on dbopen() calls
 - After rename(), fsync() call on directory for faster result

* lib/libutil/pw_util.3
 - pw_lock() returns a file descriptor to master password file on success

Differential Revision: https://reviews.freebsd.org/D2978
Approved by: bapt
Sponsored by: Netgate

3 days agoRemove an unneeded define and old comment referencing amd64.
andrew [Thu, 2 Jul 2015 16:13:29 +0000 (16:13 +0000)]
Remove an unneeded define and old comment referencing amd64.

3 days agoRemove an old comment, the cache is enabled.
andrew [Thu, 2 Jul 2015 15:26:40 +0000 (15:26 +0000)]
Remove an old comment, the cache is enabled.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

3 days agoAccount for the main process stack being one page below the highest
kib [Thu, 2 Jul 2015 15:22:13 +0000 (15:22 +0000)]
Account for the main process stack being one page below the highest
user address when ABI uses shared page.

Note that the change is no-op for correctness, since shared page does
not fault.  The mapping for the shared page is installed at the
address space creation, the page is unmanaged and its pte/pv entry
cannot be reclaimed.

Submitted by: Oliver Pinter
Review: https://reviews.freebsd.org/D2954
MFC after: 1 week

3 days agoUse pmap_load to load table entries. This simplifies finding places where
andrew [Thu, 2 Jul 2015 15:17:30 +0000 (15:17 +0000)]
Use pmap_load to load table entries. This simplifies finding places where
we access the tables.

Obtained from: ABT Systems Ltd
Sponsored by: The fReeBSD Foundation

3 days agoForce the dynamic linker to resolve _end early so we pick up the correct
andrew [Thu, 2 Jul 2015 15:02:59 +0000 (15:02 +0000)]
Force the dynamic linker to resolve _end early so we pick up the correct
copy.

Sponsored by: ABT Systems Ltd

3 days agoCleanup brk and sbrk to use the same code to find curbrk and minbrk when
andrew [Thu, 2 Jul 2015 14:54:21 +0000 (14:54 +0000)]
Cleanup brk and sbrk to use the same code to find curbrk and minbrk when
both compiling for PIC and non-PIC.

Sponsored by: ABT Systems Ltd

3 days agoUpdate meta2deps example after i386-elf to i386 rename
emaste [Thu, 2 Jul 2015 14:44:30 +0000 (14:44 +0000)]
Update meta2deps example after i386-elf to i386 rename

3 days agoUse single instance of the identical INKERNEL() and PMC_IN_KERNEL()
kib [Thu, 2 Jul 2015 14:37:21 +0000 (14:37 +0000)]
Use single instance of the identical INKERNEL() and PMC_IN_KERNEL()
macros on amd64 and i386.  Move the definition to machine/param.h.
kgdb defines INKERNEL() too, the conflict is resolved by renaming kgdb
version to PINKERNEL().

On i386, correct the lowest kernel address.  After the shared page was
introduced, USRSTACK no longer points to the last user address + 1 [*]

Submitted by: Oliver Pinter [*]
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

3 days agoEnable kernel debugging on arm64, other than GDB as it fails to build.
andrew [Thu, 2 Jul 2015 14:35:30 +0000 (14:35 +0000)]
Enable kernel debugging on arm64, other than GDB as it fails to build.

Sponsored by: ABT Systems Ltd