freebsd.git
8 years 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

8 years 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

8 years 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

8 years 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

8 years 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

8 years 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

8 years 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

8 years 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)

8 years 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

8 years 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.

8 years 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.

8 years 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

8 years 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.

8 years 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

8 years 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

8 years 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).

8 years 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.

8 years 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)

8 years 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

8 years 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.

8 years 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.

8 years 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

8 years 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

8 years 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

8 years 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

8 years 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

8 years 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

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

8 years 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

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

8 years 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)

8 years 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.

8 years 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

8 years 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.

8 years 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

8 years 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.

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

8 years 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.

8 years 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.

8 years 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.

8 years 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...

8 years 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.

8 years 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

8 years 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

8 years 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

8 years 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)

8 years 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

8 years 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)

8 years 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)

8 years 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

8 years 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).

8 years 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

8 years 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.

8 years 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.

8 years 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

8 years 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

8 years 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

8 years 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

8 years 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.

8 years 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

8 years 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

8 years 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

8 years 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

8 years 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

8 years 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

8 years 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

8 years 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

8 years agoVnode is not referenced by the vfs_domount() at the point where
kib [Thu, 2 Jul 2015 14:31:47 +0000 (14:31 +0000)]
Vnode is not referenced by the vfs_domount() at the point where
asserts are made.  Remove them, since we might dereference freed
memory.  Leaked locks are asserted by the syscall return code anyway.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agoSave & restore the floating-pont argument registers before calling
andrew [Thu, 2 Jul 2015 14:00:07 +0000 (14:00 +0000)]
Save & restore the floating-pont argument registers before calling
_rtld_bind. The compiler may generate code using these registers and not
save them. Unfortunately, as we make use of libc, we are unable to disallow
rtld from using floating-point register without also doing the same for the
parts of libc we use, or by limiting what _rtld_bind is able to call.

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

8 years agoAdd -b to the devlist usage info, forgotten in r260059.
brueffer [Thu, 2 Jul 2015 13:57:26 +0000 (13:57 +0000)]
Add -b to the devlist usage info, forgotten in r260059.

PR: 195094
Submitted by: robin.hahling@gw-computing.net
MFC after: 1 week

8 years agoSet MACHINE_CPU to arm64 when building for arm64. This is needed by the
andrew [Thu, 2 Jul 2015 13:42:57 +0000 (13:42 +0000)]
Set MACHINE_CPU to arm64 when building for arm64. This is needed by the
ports tree as they check this value in a number of ports.

PR: 201259
Sponsored by: ABT Systems Ltd

8 years agoFix couple panics on forced unmount of backing file.
mav [Thu, 2 Jul 2015 12:53:22 +0000 (12:53 +0000)]
Fix couple panics on forced unmount of backing file.

MFC after: 1 week
Sponsored by: iXsystems, Inc.

8 years agoFix an obviously wrong boolean operator.
brueffer [Thu, 2 Jul 2015 12:14:48 +0000 (12:14 +0000)]
Fix an obviously wrong boolean operator.

PR: 200983
Submitted by: David Bindeman
MFC after: 1 week

8 years agoAdd the year to the VAX-11/780 announcement entry.
brueffer [Thu, 2 Jul 2015 12:08:05 +0000 (12:08 +0000)]
Add the year to the VAX-11/780 announcement entry.

PR: 200961
Submitted by: John Marshall
MFC after: 1 week

8 years agoFix a typo.
brueffer [Thu, 2 Jul 2015 11:46:35 +0000 (11:46 +0000)]
Fix a typo.

PR: 199453
Submitted by: John Nielsen

8 years agoProperly propagate errors in metadata reading.
pjd [Thu, 2 Jul 2015 10:57:34 +0000 (10:57 +0000)]
Properly propagate errors in metadata reading.

PR: 198860
Submitted by: Matthew D. Fuller

8 years agoAllow to omit keyfile number for the first keyfile.
pjd [Thu, 2 Jul 2015 10:55:32 +0000 (10:55 +0000)]
Allow to omit keyfile number for the first keyfile.

8 years agozfs_mount(MS_REMOUNT): protect zfs_(un)register_callbacks calls
avg [Thu, 2 Jul 2015 08:32:02 +0000 (08:32 +0000)]
zfs_mount(MS_REMOUNT): protect zfs_(un)register_callbacks calls

We now take z_teardown_lock as a writer to ensure that there is no I/O
while the filesystem state is in a flux.  Also, zfs_suspend_fs() ->
zfsvfs_teardown() call zfs_unregister_callbacks() and zfs_resume_fs() ->
zfsvfs_setup() call zfs_unregister_callbacks().  Previously there was no
synchronization between those calls and the calls in the re-mounting
case.  That could lead to concurrent execution and a crash.

PR: 180060
Differential Revision: https://reviews.freebsd.org/D2865
Suggested by: mahrens
Reviewed by: delphij, pho, mahrens, will
MFC after: 13 days
Sponsored by: ClusterHQ

8 years agoDisable port multiplier support on Marvell 88SE61xx chips.
mav [Thu, 2 Jul 2015 08:25:45 +0000 (08:25 +0000)]
Disable port multiplier support on Marvell 88SE61xx chips.

According to report, some recent unrelated changes in the driver triggered
timeouts when testing for absent port multiplier.  Cause of this behavior
channge is unclear, but since these chips are old, rare and buggy, it is
easier to just disable port multiplier support, same as done in Linux.

Reported by: bar
MFC after: 3 days

8 years agoFix the path to the UFS/MSDOSFS filesystem labels, since they
gjb [Thu, 2 Jul 2015 02:33:58 +0000 (02:33 +0000)]
Fix the path to the UFS/MSDOSFS filesystem labels, since they
cannot possibly exist within the chroot(8) before the target
filesystem actually exists.

MFC after: 3 days
X-MFC-With: r285018
Sponsored by: The FreeBSD Foundation

8 years agoImplement an evil workaround that prevents UFS/MSDOS labels from being
gjb [Thu, 2 Jul 2015 02:13:20 +0000 (02:13 +0000)]
Implement an evil workaround that prevents UFS/MSDOS labels from being
written to disk with newfs(8) and newfs_msdosfs(8).

When iterating through snapshot builds in serial, it is possible for
a build failure to leave stale md(4) devices behind, in some cases, they
could have a UFS or MSDOS filesystem label assigned.

If the md(4) is not destroyed (or not able to be destroyed, as has
happened recently due to my own fault), the filesystem label that
already exists can interfere with a new md(4) device that is targeted to
have the same label.

This behavior, although admittedly a logic error in the wrapper build
scripts, has caused intermittent reports (in particular with the armv6
builds) of missing UFS/MSDOSFS labels, causing the image to fallback to
the mountroot prompt.  This appears to only happen when the backing
md(4) device is destroyed before the calling umount(8) on the target
mount, after which the UFS/MSDOSFS label persists.

The workaround is this:  If EVERYTHINGISFINE is set to non-empty value,
check for an existing ufs/rootfs and msdosfs/MSDOSBOOT filesystem label
in arm_create_disk(), and rm(1) them if they exist.

The EVERYTHINGISFINE variable is chosen because it is used in exactly
one other place - release/Makefile.mirrors - and there are big scary
warnings at the top of that file as well that it should *not* be used
under normal circumstances.  This should not destroy a build machine
that also uses '/dev/ufs/rootfs' as the UFS label, and I have verified
in extensive local testing that the destroyed label is recreated when
the md(4) is unmounted/mounted, but this really should not be enabled
by anyone.

Having said all that, I absolutely *do* plan MFC this to stable/10 for
the 10.2-RELEASE cycle, as so far, I have only observed this behavior
on stable/10, but this is a temporary solution until I can unravel all
of the failure paths to properly trap them.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

8 years agoAdd DMA support for Allwinner MMC controller.
loos [Wed, 1 Jul 2015 23:27:01 +0000 (23:27 +0000)]
Add DMA support for Allwinner MMC controller.

DMA handles all data transfers up to 128K or 16 segments and fallback to
pio mode when DMA requirements are not met.

The read performance has improved greatly while the write performance also
showed some improvement but seems limited by the card type and quality.

Submitted by: Pratik Singhal <pratiksinghal@freebsd.org>
Sponsored by: Google Summer of Code 2015
Tested on: A10 (cubieboard) and A20 (cubieboard 2 and banana pi)

8 years agoFix the logic for when to restore the VFP registers. It should restore
andrew [Wed, 1 Jul 2015 17:27:44 +0000 (17:27 +0000)]
Fix the logic for when to restore the VFP registers. It should restore
them when a different thread last used them, or when the thread was last
run on a different cpu.

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

8 years agoBump .Dd for the example code update.
brueffer [Wed, 1 Jul 2015 16:50:01 +0000 (16:50 +0000)]
Bump .Dd for the example code update.

Submitted by: loos

8 years agoDisallow a debugger on 64bit system to set fs/gs bases of the 32bit
kib [Wed, 1 Jul 2015 16:37:03 +0000 (16:37 +0000)]
Disallow a debugger on 64bit system to set fs/gs bases of the 32bit
process beyond the end of the process address space.  Such setting is
not dangerous to the kernel integrity, but it causes confusing
application misbehaviour.

Sponsored by: The FreeBSD Foundation
MFC after: 12 days

8 years agoAdd one more file missed in the BIND-removal entries.
brueffer [Wed, 1 Jul 2015 15:54:13 +0000 (15:54 +0000)]
Add one more file missed in the BIND-removal entries.

PR: 196515
Submitted by: Trond Endrestol
MFC after: 1 week

8 years agoFirst cut of DTrace for AArch64.
br [Wed, 1 Jul 2015 15:51:11 +0000 (15:51 +0000)]
First cut of DTrace for AArch64.

Reviewed by: andrew, emaste
Sponsored by: ARM Limited
Differential Revision: https://reviews.freebsd.org/D2738

8 years agoUse the correct le*dec function to decode a 16bit type.
brueffer [Wed, 1 Jul 2015 14:54:13 +0000 (14:54 +0000)]
Use the correct le*dec function to decode a 16bit type.

PR: 194228
Submitted by: David Horwitt
MFC after: 2 weeks

8 years agoRemove the HH-MM suffix from the build date suffix.
gjb [Wed, 1 Jul 2015 14:51:26 +0000 (14:51 +0000)]
Remove the HH-MM suffix from the build date suffix.

It was useful when working out several kinks when
testing automated image uploading when retrying was
necessary, but now it is making things much too messy.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

8 years agoAdd a central location for exclusion checks. We check
br [Wed, 1 Jul 2015 14:09:59 +0000 (14:09 +0000)]
Add a central location for exclusion checks. We check
here if function is excluded from FBT instrumentation.

Reviewed by: andrew, emaste, markj
Differential Revision: https://reviews.freebsd.org/D2899

8 years agoMake libproc compilable on AArch64.
br [Wed, 1 Jul 2015 13:59:26 +0000 (13:59 +0000)]
Make libproc compilable on AArch64.

8 years agoRefine the lockstat(1) entry based on corrections and
gjb [Wed, 1 Jul 2015 10:33:19 +0000 (10:33 +0000)]
Refine the lockstat(1) entry based on corrections and
clarifications received during review.

Submitted by: avg
Sponsored by: The FreeBSD Foundation

8 years agoMake the example code actually work.
brueffer [Wed, 1 Jul 2015 09:25:23 +0000 (09:25 +0000)]
Make the example code actually work.

PR: 199440
Submitted by: waitman@waitman.net
Reviewed by: loos
MFC after: 1 week

8 years agoFix the gcloud port/package name.
gjb [Wed, 1 Jul 2015 08:48:49 +0000 (08:48 +0000)]
Fix the gcloud port/package name.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

8 years agocxgbe(4): request an automatic tx update when a netmap tx queue idles.
np [Wed, 1 Jul 2015 00:34:14 +0000 (00:34 +0000)]
cxgbe(4): request an automatic tx update when a netmap tx queue idles.
The NIC tx queues already do this.

MFC after: 1 week
Differential Revision:

8 years agocxgbetool: fix code that decodes T5 SGE contexts. Some of the fields
np [Tue, 30 Jun 2015 22:30:21 +0000 (22:30 +0000)]
cxgbetool: fix code that decodes T5 SGE contexts.  Some of the fields
that changed between T4 and T5 were not displayed correctly.

Obtained from: Chelsio
MFC after: 3 days
Differential Revision:

8 years ago- Fix `make depend` in sys/modules
lwhsu [Tue, 30 Jun 2015 19:35:14 +0000 (19:35 +0000)]
- Fix `make depend` in sys/modules

Differential Revision: https://reviews.freebsd.org/D2951
Approved by: delphij

8 years agoDefault the VAGRANT_VERSION to ${REVISION}-${BRANCH} if
gjb [Tue, 30 Jun 2015 19:18:08 +0000 (19:18 +0000)]
Default the VAGRANT_VERSION to ${REVISION}-${BRANCH} if
not set, which expands to '11.0-CURRENT', for example.

If the branch is -CURRENT, -STABLE, or -PRERELEASE, suffix
the VAGRANT_VERSION with the snapshot date.

MFC after: 3 days
X-MFC-Needs: r284893, r284895, r284896, r284897, r284942
Tested with: head@r284961 (patched)
Sponsored by: The FreeBSD Foundation

8 years agoadd units to the length and count so that it's clear what they
jmg [Tue, 30 Jun 2015 19:06:14 +0000 (19:06 +0000)]
add units to the length and count so that it's clear what they
are measured in...  Gems like: "len is the length of the buffer."
aren't useful in man pages.

8 years agoDocument x86 machine-specific ptrace(2) requests. Provide list of the
kib [Tue, 30 Jun 2015 18:53:42 +0000 (18:53 +0000)]
Document x86 machine-specific ptrace(2) requests.  Provide list of the
ppc requests.

Reviewed by: brueffer, emaste, gjb (previous version)
Sponsored by: The FreeBSD Foundation
Review: https://reviews.freebsd.org/D2962
MFC after: 2 weeks