freebsd.git
8 years agontb_hw: Add programmatic interface to enable/disable WC
cem [Wed, 18 Nov 2015 22:20:21 +0000 (22:20 +0000)]
ntb_hw: Add programmatic interface to enable/disable WC

Enable users to enable/disable WC on memory windows programmatically.

Sponsored by: EMC / Isilon Storage Division

8 years agontb_hw: Add tunable to disable write-combining
cem [Wed, 18 Nov 2015 22:20:13 +0000 (22:20 +0000)]
ntb_hw: Add tunable to disable write-combining

The tunable 'hw.ntb.enable_writecombine' may be set to zero to
administratively disable write combining the mapped NTB region.

Sponsored by: EMC / Isilon Storage Division

8 years agoNTB: Fix 32-bit BAR size validation
cem [Wed, 18 Nov 2015 22:20:04 +0000 (22:20 +0000)]
NTB: Fix 32-bit BAR size validation

Sponsored by: EMC / Isilon Storage Division

8 years agoif_ntb: Diff reduce with Linux
cem [Wed, 18 Nov 2015 22:19:55 +0000 (22:19 +0000)]
if_ntb: Diff reduce with Linux

Use bus_space_write instead of (non-volatile) C pointer writes via an
iowrite32() shim in the same places as the Dual BSD/GPL Linux driver.

Update some types to fixed 32-bit sizes.

Sponsored by: EMC / Isilon Storage Division

8 years agoMETA MODE: Fix changing what "MACHINE=host" means when computing dirdeps for include/.
bdrewery [Wed, 18 Nov 2015 21:39:58 +0000 (21:39 +0000)]
META MODE: Fix changing what "MACHINE=host" means when computing dirdeps for include/.

The _SKIP_BUILD is used while computing DIRDEPS.  If MACHINE=host is passed in
then this logic was replacing 'MACHINE' with a literal value of the host arch,
which then caused the dirdeps graph to be wrong since it no longer had the
literal 'host' for any of include's dependencies.

This is a NOP currently since include/ is not usually built with MACHINE=host.

Sponsored by: EMC / Isilon Storage Division

8 years agoRemove unneeded libmd from bootstrap-tools (reverting r246784).
bdrewery [Wed, 18 Nov 2015 21:37:46 +0000 (21:37 +0000)]
Remove unneeded libmd from bootstrap-tools (reverting r246784).

The bootstrap-tools are supposed to be host tools, which in most cases, use
host headers and libraries.  As such, directly including the src tree's headers
for libmd here causes the need to link libmd in since it will be built with
the new symbols (which /usr/lib/libmd.so) won't have unless it is new enough.
During the target build in buildworld the target headers are staged into
WORLDTMP and used via --sysroot, allowing the target xinstall to be built with
the new/target libmd.

The .PATH here was also not doing anything since xinstall does not use libmd
source files.

Sponsored by: EMC / Isilon Storage Division
MFC after: 2 weeks

8 years agosh: Fix ""$@, which should not use the special case for "$@".
jilles [Wed, 18 Nov 2015 21:09:03 +0000 (21:09 +0000)]
sh: Fix ""$@, which should not use the special case for "$@".

"$@" should expand to no words if there are no positional parameters, but
""$@ should always expand to at least an empty word.

8 years agoxen: fix dropping bitmap IPIs during resume
royger [Wed, 18 Nov 2015 18:11:19 +0000 (18:11 +0000)]
xen: fix dropping bitmap IPIs during resume

Current Xen resume code clears all pending bitmap IPIs on resume, which is
not correct. Instead re-inject bitmap IPI vectors on resume to all CPUs in
order to acknowledge any pending bitmap IPIs.

Sponsored by: Citrix Systems R&D
MFC after: 2 weeks

8 years agoxen/intr: properly dispose event channels on resume
royger [Wed, 18 Nov 2015 18:10:28 +0000 (18:10 +0000)]
xen/intr: properly dispose event channels on resume

All event channels are torn down when performing a migration on Xen, make
sure all handlers are also removed and the event channel structure is
properly disposed so it can be reused.

Sponsored by: Citrix Systems R&D
MFC after: 2 weeks

8 years agox86/intr: allow mutex recursion in intr_remove_handler
royger [Wed, 18 Nov 2015 18:09:49 +0000 (18:09 +0000)]
x86/intr: allow mutex recursion in intr_remove_handler

This is needed so interrupt handlers can be removed while the PIC is
resuming, it was previously not possible due to intr_resume holding the
intr_table_lock and intr_remove_handler recursing on it.

Sponsored by: Citrix Systems R&D
Reviewed by: kib (previous version)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D4114

8 years agoConvert to SUBDIR.yes format.
bdrewery [Wed, 18 Nov 2015 17:52:38 +0000 (17:52 +0000)]
Convert to SUBDIR.yes format.

Reviewed by: imp
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D4182

8 years agoExtend r270123 to run the brand info's header_supported() routine for
nwhitehorn [Wed, 18 Nov 2015 17:03:22 +0000 (17:03 +0000)]
Extend r270123 to run the brand info's header_supported() routine for
branded as well as unbranded binaries. This will be required to add
support for the new ELFv2 ABI on powerpc64, which is distinguished from
ELFv1 by the contents of the ELF header's flags field.

Reviewed by: imp
MFC after: 2 weeks

8 years agoRecommend only to remove the content of /usr/share/locale/ and not the directory
bapt [Wed, 18 Nov 2015 16:52:19 +0000 (16:52 +0000)]
Recommend only to remove the content of /usr/share/locale/ and not the directory
Add a missing full stop

8 years agoARM: Fix dma_dcache_sync() for early allocated memory.
mmel [Wed, 18 Nov 2015 16:07:01 +0000 (16:07 +0000)]
ARM: Fix dma_dcache_sync() for early allocated memory.
Drivers can request DMA to buffers that are not in memory represented
in the vm page arrays. Because of this, store KVA of already mapped
buffer to synclist and use it in dma_dcache_sync().

Reviewed by: jah
Approved by: kib (mentor)
Differential Revision: https://reviews.freebsd.org/D4120

8 years agoFix the date on the pmcstat(8) man page from r291016.
jtl [Wed, 18 Nov 2015 15:12:24 +0000 (15:12 +0000)]
Fix the date on the pmcstat(8) man page from r291016.

Approved by: gnn (mentor)
MFC after: 1 month
X-MFC with: r291016
Pointy hat to: jtl

8 years agoSupport a wider history counter in pmcstat(8) gmon output
jtl [Wed, 18 Nov 2015 14:52:01 +0000 (14:52 +0000)]
Support a wider history counter in pmcstat(8) gmon output

pmcstat(8) contains an option to output sampling data in a gmon format
compatible with gprof(1). Currently, it uses the default histcounter,
which is an (unsigned short). With large sets of sampling data, it
is possible to overflow the maximum value provided by an (unsigned
short).

This change adds the -e argument to pmcstat. If -e and -g are both
specified, pmcstat will use a histcounter type of uint64_t.

Differential Revision: https://reviews.freebsd.org/D4151
Reviewed by: jhb, bjk
Approved by: gnn (mentor)
MFC after: 1 month
Sponsored by: Juniper Networks

8 years agoTemporarily comment out the libcrypt tests.
rodrigc [Wed, 18 Nov 2015 13:19:34 +0000 (13:19 +0000)]
Temporarily comment out the libcrypt tests.

They are emitting characters which are triggering
a kyua bug which causes kyua to emit invalid XML.
This invalid XML is causing false failures in Jenkins.

On a separate note, kyua needs to be fixed with this:
  https://github.com/jmmv/kyua/pull/148
or something similar.

8 years agoSimplify fabric tasting code.
mav [Wed, 18 Nov 2015 12:39:20 +0000 (12:39 +0000)]
Simplify fabric tasting code.

Except cosmetic changes this removes fabric ports from our port database.
It is always firmware duty to manage them, so driver don't need to worry.

8 years agoRemove some confusions between loopid and nphdl.
mav [Wed, 18 Nov 2015 11:14:59 +0000 (11:14 +0000)]
Remove some confusions between loopid and nphdl.

Modern cards in most cases operate abstract port handles, that have no
any relation to real loop IDs.  Leave loopid used only where it really
goes about local loop IDs.

While there, fix few more cases where LUNs were still printed in decimal.

8 years agoDocument loader(8) dumpdev option
smh [Wed, 18 Nov 2015 09:42:36 +0000 (09:42 +0000)]
Document loader(8) dumpdev option

Add an entry for dumpdev environment variable to loader(8).

MFC after: 1 week
Sponsored by: Multiplay

8 years agoAdd the QCA9533 base configuration file and an example configuration
adrian [Wed, 18 Nov 2015 06:25:25 +0000 (06:25 +0000)]
Add the QCA9533 base configuration file and an example configuration
for the AP143.

Wifi doesn't work on the QCA9533 board, but basic ethernet/ethernet
and ethernet switch support does work.

The AP143 has 32MB RAM and 4MB flash, so this was tested with a USB
rootfs.

Tested:

* QCA9533v2, AP143 reference design board.

8 years agouart(4) - make the 8250 uart baudrate tolerance build time tweakable.
adrian [Wed, 18 Nov 2015 06:24:21 +0000 (06:24 +0000)]
uart(4) - make the 8250 uart baudrate tolerance build time tweakable.

It turns out on a 16550 w/ a 25MHz SoC reference clock you get a little
over 3% error at 115200 baud, which causes this to fail.

Just .. cope. Things cope these days.

Default to 30 (3.0%) as before, but allow UART_DEV_TOLERANCE_PCT to be
set at build time to change that.

8 years agoPhysical addresses for e500mc/e5500 are 36-bits, e6500 is 40-bits.
jhibbits [Wed, 18 Nov 2015 02:18:14 +0000 (02:18 +0000)]
Physical addresses for e500mc/e5500 are 36-bits, e6500 is 40-bits.

Increase BUS_SPACE_MAXADDR to allow for this.

Sponsored by: Alex Perez/Inertial Computing

8 years agoAdd support for new LAW registers in QorIQ SoCs.
jhibbits [Wed, 18 Nov 2015 01:54:19 +0000 (01:54 +0000)]
Add support for new LAW registers in QorIQ SoCs.

QorIQ SoCs (e5500 core, P5 family) have 2 BARs for local access windows, while
MPC85XX, and P1/P2 families use only a single BAR register.

This also adds the QORIQ_DPAA option, mutually exclusive to MPC85XX, to handle
this difference.

Obtained from: Semihalf
Sponsored by: Alex Perez/Inertial Computing

8 years agoAdd a kernel config for the Onion Omega
allanjude [Tue, 17 Nov 2015 21:02:27 +0000 (21:02 +0000)]
Add a kernel config for the Onion Omega

Small $25 IoT device, 400mhz Atheros cpu, Atheros WiFi and Ethernet
18 GPIOs, and support for Relay, Servo, and OLED expansion
https://onion.io/omega/

Reviewed by: adrian
Approved by: bapt (mentor)
Relnotes: yes
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D4188

8 years agoFix early kernel dump via dumpdev env
smh [Tue, 17 Nov 2015 20:55:50 +0000 (20:55 +0000)]
Fix early kernel dump via dumpdev env

Setting the dumpdev via env e.g. loader.conf provides the ability to
configure the kernel dump device during early boot. When using this
g_io_getattr was returning EPERM due to cp->acr == 0.

Fix this by calling g_access to ensure we're a read consumer prior
to calling g_dev_setdumpdev.

MFC after: 2 weeks
Sponsored by: Multiplay

8 years agoSimplify man-makefile-update target.
jkim [Tue, 17 Nov 2015 20:47:16 +0000 (20:47 +0000)]
Simplify man-makefile-update target.

8 years agompsutil/mprutil: add flash subcommand
bapt [Tue, 17 Nov 2015 20:42:59 +0000 (20:42 +0000)]
mpsutil/mprutil: add flash subcommand

the flash subcommand allows to save/update firmware and bios for LSI Fusion-MPT
2/3 controllers (mps(4) and mpr(4))

Tested by: allanjude
Reviewed by: wblock (manpage)
Relnotes: yes
Sponsored by: Gandi.net
Differential Revision: https://reviews.freebsd.org/D4026

8 years agoFix dynamic IPv6 rules showing junk for non-specified address masks.
bdrewery [Tue, 17 Nov 2015 20:42:08 +0000 (20:42 +0000)]
Fix dynamic IPv6 rules showing junk for non-specified address masks.

For example:
  00002      0         0 (19s) PARENT 1 tcp 10.10.0.5 0 <-> 0.0.0.0 0
  00002      4       412 (1s) LIMIT tcp 10.10.0.5 25848 <-> 10.10.0.7 22
  00002     10       777 (1s) LIMIT tcp 2001:894:5a24:653::503:1 52023 <-> 2001:894:5a24:653:ca0a:a9ff:fe04:3978 22
  00002      0         0 (17s) PARENT 1 tcp 2001:894:5a24:653::503:1 0 <-> 80f3:70d:23fe:ffff:1005:: 0

Fix this by zeroing the unused address, as is done for IPv4:
  00002     0         0 (18s) PARENT 1 tcp 10.10.0.5 0 <-> 0.0.0.0 0
  00002    36     14952 (1s) LIMIT tcp 10.10.0.5 25848 <-> 10.10.0.7 22
  00002     0         0 (0s) PARENT 1 tcp 2001:894:5a24:653::503:1 0 <-> :: 0
  00002     4       345 (274s) LIMIT tcp 2001:894:5a24:653::503:1 34131 <-> 2001:470:1f11:262:ca0a:a9ff:fe04:3978 22

MFC after: 2 weeks

8 years agoRegister our FC4 Features in SNS.
mav [Tue, 17 Nov 2015 19:57:49 +0000 (19:57 +0000)]
Register our FC4 Features in SNS.

8 years agoFix two spelling errors
eadler [Tue, 17 Nov 2015 19:43:40 +0000 (19:43 +0000)]
Fix two spelling errors

8 years agoFix typo
bapt [Tue, 17 Nov 2015 19:40:48 +0000 (19:40 +0000)]
Fix typo

Submitted by: ngie

8 years agoMove recently added entry above the "old" line.
jhb [Tue, 17 Nov 2015 19:03:55 +0000 (19:03 +0000)]
Move recently added entry above the "old" line.

8 years agoFix 'make depend'
uqs [Tue, 17 Nov 2015 18:28:56 +0000 (18:28 +0000)]
Fix 'make depend'

8 years agoCosmetic addition to r290993.
mav [Tue, 17 Nov 2015 16:46:05 +0000 (16:46 +0000)]
Cosmetic addition to r290993.

8 years agoUnify and cleanup FC ports scan.
mav [Tue, 17 Nov 2015 16:33:46 +0000 (16:33 +0000)]
Unify and cleanup FC ports scan.

8 years agoMake native page table access endian-safe. Even on CPUs running in
nwhitehorn [Tue, 17 Nov 2015 16:09:26 +0000 (16:09 +0000)]
Make native page table access endian-safe. Even on CPUs running in
little-endian mode, the hardware page table is big-endian. This is a
no-op on all currently supported systems.

MFC after: 1 month

8 years agoWhere appropriate, use the endian-flipping OF_getencprop() instead of
nwhitehorn [Tue, 17 Nov 2015 16:07:43 +0000 (16:07 +0000)]
Where appropriate, use the endian-flipping OF_getencprop() instead of
OF_getprop() to get encode-int encoded values from the OF tree. This is
a no-op at present, since all existing PowerPC ports are big-endian, but
it is a correctness improvement and will be required if we have a
little-endian kernel at some future point.

Where it is totally impossible for the code ever to be used on a
little-endian system (much of powerpc/powermac, for instance), I have not
necessarily made the appropriate changes.

MFC after: 1 month

8 years agoImplement the sadb_x_policy_priority field as it is done in Linux:
fabient [Tue, 17 Nov 2015 14:39:33 +0000 (14:39 +0000)]
Implement the sadb_x_policy_priority field as it is done in Linux:
lower priority policies are inserted first.

Submitted by: Emeric Poupon <emeric.poupon@stormshield.eu>
Reviewed by: ae
Sponsored by: Stormshield

8 years agoOff-by-one correctiont to r290980.
mav [Tue, 17 Nov 2015 14:22:56 +0000 (14:22 +0000)]
Off-by-one correctiont to r290980.

8 years agoMake firmware handle virtual ports SNS logins for us.
mav [Tue, 17 Nov 2015 14:13:55 +0000 (14:13 +0000)]
Make firmware handle virtual ports SNS logins for us.

8 years agoMake PCB structure binary compatible for old and new PMAP on ARM
zbb [Tue, 17 Nov 2015 13:09:51 +0000 (13:09 +0000)]
Make PCB structure binary compatible for old and new PMAP on ARM

This structure must be binary compatible regardless of PMAP
version being used. Create reserved section for NEW_PMAP to
make other variables be placed exactly in the same memory
addresses. This fixes kgdb/gdb behavoiur, which uses pcb.h stuctures.
The NEW_PMAP is kernel flag, so it does not propagate to the buildworld,
what makes the tools using pcb.h unable to parse PCB data.

Reviewed by:   mmel, kib
Submitted by:  Wojciech Macek <wma@semihalf.com>
Obtained from: Semihalf
Sponsored by:  Juniper Networks Inc.
Differential Revision: https://reviews.freebsd.org/D4011

8 years agoAdd real initial support for RQSTYPE_RPT_ID_ACQ.
mav [Tue, 17 Nov 2015 13:02:44 +0000 (13:02 +0000)]
Add real initial support for RQSTYPE_RPT_ID_ACQ.

8 years agoFix buffer overflow in exynos5_ehci
zbb [Tue, 17 Nov 2015 12:50:45 +0000 (12:50 +0000)]
Fix buffer overflow in exynos5_ehci

Use proper size of exynos_ehci_softc, not the generic one.

Reviewed by:   andrew
Submitted by:  Wojciech Macek <wma@semihalf.com>
Obtained from: Semihalf
Sponsored by:  Juniper Networks Inc.
Differential Revision: https://reviews.freebsd.org/D4189

8 years agoinstall(1) is following symlinks when installing a files, which result in
bapt [Tue, 17 Nov 2015 12:18:57 +0000 (12:18 +0000)]
install(1) is following symlinks when installing a files, which result in
inconsistency when installing new locales and may also result in failures
when reinstalling after having run make delete-old (due to previous
inconsistencies) for now recommand removing all locales until install(1) is
fixed

8 years agoJSON doesn't permit a hexadecimal notation of an integer.
ume [Tue, 17 Nov 2015 12:09:57 +0000 (12:09 +0000)]
JSON doesn't permit a hexadecimal notation of an integer.

8 years agoMake pl310_print_config static, it's not called out of pl310.c
andrew [Tue, 17 Nov 2015 11:26:35 +0000 (11:26 +0000)]
Make pl310_print_config static, it's not called out of pl310.c

Sponsored by: ABT Systems Ltd

8 years agoTake maintainership of nis(8) and yp(8), Pre-commit review
araujo [Tue, 17 Nov 2015 01:45:24 +0000 (01:45 +0000)]
Take maintainership of nis(8) and yp(8), Pre-commit review
requested.

Approved by: bapt (mentor)
Differential Revision: D4118

8 years agomnt_stat.f_iosize (which is used to set bo_bsize) must be set to
rmacklem [Tue, 17 Nov 2015 01:44:26 +0000 (01:44 +0000)]
mnt_stat.f_iosize (which is used to set bo_bsize) must be set to
the largest size of buffer cache block or the mapping of the buffer
is bogus. When a mount with rsize=4096,wsize=4096 was done, f_iosize
would be set to 4096. This resulted in corrupted directory data, since
the buffer cache block size for directories is NFS_DIRBLKSIZ (8192).
This patch fixes the code so that it always sets f_iosize to at least
NFS_DIRBLKSIZ.

Tested by: krichy@cflinux.hu
PR: 177971
MFC after: 2 weeks

8 years ago- Fix directory name for pf.
glebius [Tue, 17 Nov 2015 01:01:03 +0000 (01:01 +0000)]
- Fix directory name for pf.
- Recommend my reviews for CARP.

8 years agoUse -n to ln(1) which is compatible with GNU ln(1).
bdrewery [Mon, 16 Nov 2015 23:27:44 +0000 (23:27 +0000)]
Use -n to ln(1) which is compatible with GNU ln(1).

Sponsored by: EMC / Isilon Storage Division

8 years agoWhen the smbfs iod thread (smb_iod_thread()) is shutting down, smb_iod_destroy()
rmacklem [Mon, 16 Nov 2015 23:19:53 +0000 (23:19 +0000)]
When the smbfs iod thread (smb_iod_thread()) is shutting down, smb_iod_destroy()
would call smb_iod_request(). This call could return as soon as the
wakeup(evp) in smb_iod_main() call is done and then could destroy
the mutexes. This caused a race with the rest of smb_iod_main()s
use of these mutexes.
A crash reported on freebsd-stable@ by Christian Kratzer was
diagnosed as a use of one of these mutexes after it was destroyed.
This patch moves destruction of the mutexes from smb_iod_destroy()
to the end of smb_iod_thread(), so that they aren't destroyed before
the thread is done with them. Christian comfirmed that the patch
stopped the crashes from happening.

Reported by: ck-lists@cksoft.de (Christian Kratzer)
Tested by: ck-lists@cksoft.de (Christian Kratzer)
Diagnosed by: jhb
Reviewed by: jhb
MFC after: 2 weeks

8 years ago- Unbreak dumpsys(9) on sparc64 after r276772
marius [Mon, 16 Nov 2015 23:02:33 +0000 (23:02 +0000)]
- Unbreak dumpsys(9) on sparc64 after r276772
- While at it, arrange #ifndefs in kern_dump.c more intelligently; it's
  rather confusing to have multiple competing and/or unused functions in
  the kernel.

8 years agoDefault MK_META_MODE from MK_DIRDEPS_BUILD
sjg [Mon, 16 Nov 2015 22:50:23 +0000 (22:50 +0000)]
Default MK_META_MODE from MK_DIRDEPS_BUILD

This allows most of the build to simply consider MK_META_MODE

Update to latest dirdeps.mk so we can do:

make -f dirdeps.mk bin/cat.i386

Reviewed by: bdrewery

8 years agoRemove redundant copies of CDDL_CFLAGS.
imp [Mon, 16 Nov 2015 22:37:28 +0000 (22:37 +0000)]
Remove redundant copies of CDDL_CFLAGS.

8 years agoI'm still interested in reviewing any code changes to lpr & friends
gad [Mon, 16 Nov 2015 22:08:49 +0000 (22:08 +0000)]
I'm still interested in reviewing any code changes to lpr & friends
    (lpc, lpd, lpq, etc).

8 years agowpi(4): import r289674
avos [Mon, 16 Nov 2015 21:55:11 +0000 (21:55 +0000)]
wpi(4): import r289674

Switch PCI register reads from using magic numbers to using the names
defined in pcireg.h

Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D4185

8 years agoOnly use a power of 2 for the number of receive and transmit queues.
jhb [Mon, 16 Nov 2015 21:36:50 +0000 (21:36 +0000)]
Only use a power of 2 for the number of receive and transmit queues.
Using other values causes VMXNET3_CMD_ENABLE to fail.  The Linux
driver also enforces this restriction.

Reviewed by: bryanv
MFC after: 1 week
Sponsored by: Norse
Differential Revision: https://reviews.freebsd.org/D4139

8 years agoRemove duplicate manual pages.
jkim [Mon, 16 Nov 2015 21:36:15 +0000 (21:36 +0000)]
Remove duplicate manual pages.

Reported by: brd

8 years agoWith r290566 in place it turned out that WOL previously only worked by
marius [Mon, 16 Nov 2015 21:13:57 +0000 (21:13 +0000)]
With r290566 in place it turned out that WOL previously only worked by
accident with RTL8168G and later chips when the interface actually was
brought up. This is due to the fact that with these MAC variants, RXDV
gate needs be disabled for WOL to work. So do just that in re_setwol()
when IFCAP_WOL is requested.
Reported and tested by: dhw

MFC after: 3 days

8 years agoRevert r290944. It was wrong.
bdrewery [Mon, 16 Nov 2015 21:05:38 +0000 (21:05 +0000)]
Revert r290944. It was wrong.

8 years agoFix error case for bmake to echo 0.
bdrewery [Mon, 16 Nov 2015 20:31:00 +0000 (20:31 +0000)]
Fix error case for bmake to echo 0.

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agoAvoid FSCHG for INSTALL_AS_USER as well.
bdrewery [Mon, 16 Nov 2015 20:18:38 +0000 (20:18 +0000)]
Avoid FSCHG for INSTALL_AS_USER as well.

PR: 194189
X-MFC-With: r290628
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoAdd include of signal.h for signal() prototype.
rodrigc [Mon, 16 Nov 2015 17:28:04 +0000 (17:28 +0000)]
Add include of signal.h for signal() prototype.

8 years agoReplace __svc_fdset with svc_fdset.
rodrigc [Mon, 16 Nov 2015 17:25:27 +0000 (17:25 +0000)]
Replace __svc_fdset with svc_fdset.

FreeBSD lacks __svc_fdset and __svc_fdsetsize.

8 years agoDo not use SA_LEN() to dereference sa_len.
rodrigc [Mon, 16 Nov 2015 17:11:11 +0000 (17:11 +0000)]
Do not use SA_LEN() to dereference sa_len.

FreeBSD lacks the SA_LEN() macro.

8 years agoAdd include of time.h for tzset() prototype.
rodrigc [Mon, 16 Nov 2015 17:08:51 +0000 (17:08 +0000)]
Add include of time.h for tzset() prototype.

8 years agoReplace __dead with __dead2.
rodrigc [Mon, 16 Nov 2015 17:08:05 +0000 (17:08 +0000)]
Replace __dead with __dead2.

FreeBSD lacks __dead.

8 years agoAdd include of sys/param.h for MAXHOSTNAMELEN
rodrigc [Mon, 16 Nov 2015 17:06:33 +0000 (17:06 +0000)]
Add include of sys/param.h for MAXHOSTNAMELEN

8 years agoReplace __dead with __dead2.
rodrigc [Mon, 16 Nov 2015 17:03:52 +0000 (17:03 +0000)]
Replace __dead with __dead2.

FreeBSD lacks __dead.

8 years agoReplace HOST_NAME_MAX with MAXHOSTNAMELEN.
rodrigc [Mon, 16 Nov 2015 17:02:34 +0000 (17:02 +0000)]
Replace HOST_NAME_MAX with MAXHOSTNAMELEN.

FreeBSD lacks HOST_NAME_MAX.

8 years agoRemove reference to EAI_NODATA.
rodrigc [Mon, 16 Nov 2015 16:58:09 +0000 (16:58 +0000)]
Remove reference to EAI_NODATA.

It does not exist on FreeBSD.

8 years agoAdd include of <string.h> for strlen() prototype.
rodrigc [Mon, 16 Nov 2015 16:52:56 +0000 (16:52 +0000)]
Add include of <string.h> for strlen() prototype.

8 years agoConvert Makefile to FreeBSD style.
rodrigc [Mon, 16 Nov 2015 16:51:18 +0000 (16:51 +0000)]
Convert Makefile to FreeBSD style.

Add libopenbsd to link line for imsg.

8 years agoImport ypldap from OpenBSD.
rodrigc [Mon, 16 Nov 2015 16:48:43 +0000 (16:48 +0000)]
Import ypldap from OpenBSD.

ypldap -- Intended to be a drop-in replacement for ypserv, gluing in a
LDAP directory and thus providing support for users and groups stored in
LDAP for the get{pw,gr}ent family of functions.

8 years agoImprove accuracy of PMC sampling frequency
jtl [Mon, 16 Nov 2015 15:22:15 +0000 (15:22 +0000)]
Improve accuracy of PMC sampling frequency

The code tracks a counter which is the number of events until the next
sample. On context switch in, it loads the saved counter. On context
switch out, it tries to calculate a new saved counter.

Problems:

1. The saved counter was shared by all threads in a process. However, this
means that all threads would be initially loaded with the same saved
counter. However, that could result in sampling more often than once every
X number of events.

2. The calculation to determine a new saved counter was backwards. It
added when it should have subtracted, and subtracted when it should have
added. Assume a single-threaded process with a reload count of 1000 events.
Assuming the counter on context switch in was 100 and the counter on context
switch out was 50 (meaning the thread has "consumed" 50 more events), the
code would calculate a new saved counter of 150 (instead of the proper 50).

Fix:

1. As soon as the saved counter is used to initialize a monitor for a
thread on context switch in, set the saved counter to the reload count.
That way, subsequent threads to use the saved counter will get the full
reload count, assuring we sample at least once every X number of events
(across all threads).

2. Change the calculation of the saved counter. Due to the change to the
saved counter in #1, we simply need to add (modulo the reload count) the
remaining counter time we retrieve from the CPU when a thread is context
switched out.

Differential Revision: https://reviews.freebsd.org/D4122
Approved by: gnn (mentor)
MFC after: 1 month
Sponsored by: Juniper Networks

8 years agoChange the driver stats to what they really are: unsigned values.
jtl [Mon, 16 Nov 2015 15:16:09 +0000 (15:16 +0000)]
Change the driver stats to what they really are: unsigned values.

When pmcstat exits after some samples were dropped, give the user an
idea of how many were lost. (Granted, these are global numbers, but
they may still help quantify the scope of the loss.)

Differential Revision: https://reviews.freebsd.org/D4123
Approved by: gnn (mentor)
MFC after: 1 month
Sponsored by: Juniper Networks

8 years agoBring back a couple of ISO8859-15 locales:
bapt [Mon, 16 Nov 2015 12:58:47 +0000 (12:58 +0000)]
Bring back a couple of ISO8859-15 locales:
- af_ZA.ISO8859-15
- en_AU.ISO8859-15
- en_CA.ISO8859-15
- en_NZ.ISO8859-15
- en_US.ISO8859-15
- fr_CA.ISO8859-15

8 years agoAdd missing alias for zh_CN.UTF-8
bapt [Mon, 16 Nov 2015 09:48:09 +0000 (09:48 +0000)]
Add missing alias for zh_CN.UTF-8

8 years agoUse explicitly specified ivsize instead of blocksize when we mean IV size.
ae [Mon, 16 Nov 2015 07:10:42 +0000 (07:10 +0000)]
Use explicitly specified ivsize instead of blocksize when we mean IV size.
Set zero ivsize for enc_xform_null and remove special handling from
xform_esp.c.

Reviewed by: gnn
Differential Revision: https://reviews.freebsd.org/D1503

8 years agoRemove directory made obsolete by r290905
ngie [Mon, 16 Nov 2015 06:56:45 +0000 (06:56 +0000)]
Remove directory made obsolete by r290905

MFC after: 1 week
X-MFC with: r290905
X-MFC note: stable/10 only
Sponsored by: EMC / Isilon Storage Division

8 years agoRework the test which raises OOM condition. Right now, the code
kib [Mon, 16 Nov 2015 06:26:26 +0000 (06:26 +0000)]
Rework the test which raises OOM condition.  Right now, the code
checks for the swap space consumption plus checks that the amount of
the free pages exceeds some limit, in case pagedeamon did not coped
with the page shortage in one of the late passes.  This is wrong
because it does not account for the presence of the reclamaible pages
in the queues which are not selectable for reclaim immediately.  E.g.,
on the swap-less systems, large active queue easily triggered OOM.

Instead, only raise OOM when pagedaemon is unable to produce a free
page in several back-to-back passes.  Track the failed passes per
pagedaemon thread.

The number of passes to trigger OOM was selected empirically and
tested both on small (32M-64M i386 VM) and large (32G amd64)
configurations.  If the specifics of the load require tuning, sysctl
vm.pageout_oom_seq sets the number of back-to-back passes which must
fail before OOM is raised.  Each pass takes 1/2 of seconds.  Less the
value, more sensible the pagedaemon is to the page shortage.

In future, some heuristic to calculate the value of the tunable might
be designed based on the system configuration and load.  But before it
can be done, the i/o system must be fixed to reliably time-out
pagedaemon writes, even if waiting for the memory to proceed.  Then,
code can account for the in-flight page-outs and postpone OOM until
all of them finished, which should reduce the need in tuning.  Right
now, ignoring the in-flight writes and the counter allows to break
deadlocks due to write path doing sleepable memory allocations.

Reported by: Dmitry Sivachenko, bde, many others
Tested by: pho, bde, tuexen (arm)
Reviewed by: alc
Discussed with: bde, imp
Sponsored by: The FreeBSD Foundation
MFC after: 3 weeks

8 years agoDon't need cast malloc.
araujo [Mon, 16 Nov 2015 06:17:12 +0000 (06:17 +0000)]
Don't need cast malloc.

Approved by: rodrigc (mentor)
Differential Revision: D4175

8 years agoAdd QCA9533 to the list of SoCs that require IRQ's be ACKed.
adrian [Mon, 16 Nov 2015 06:15:01 +0000 (06:15 +0000)]
Add QCA9533 to the list of SoCs that require IRQ's be ACKed.

8 years agoDo not use vmspace_resident_count() for the OOM process selection.
kib [Mon, 16 Nov 2015 06:02:11 +0000 (06:02 +0000)]
Do not use vmspace_resident_count() for the OOM process selection.
Residency count track the number of pte entries installed into the
current pmap, which does not reflect the consumption of the physical
memory by the address map.  Due to several mechanisms like pv entries
reclamation, copy on write etc. the resident pte entries count may be
much less than the amount of physical memory kept by the process.

Provide the OOM-specific vm_pageout_oom_pagecount() function which
estimates the amount of reclamaible memory which could be stolen if
the process is killed.

Reported and tested by: pho
Reviewed by: alc
Comments text by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 3 weeks

8 years agoVM daemon works in parallel with the pagedaemon threads, and, among
kib [Mon, 16 Nov 2015 05:52:04 +0000 (05:52 +0000)]
VM daemon works in parallel with the pagedaemon threads, and, among
other actions, swaps out kernel stacks of the processes.  On the other
hand, currentl OOM logic which selects a process to kill in the
critical condition, skips process with swapped-out thread.  Under some
loads, this results in the big(gest) process being ignored by OOM.

Do not skip a process which has inhibited thread due to the swap-out,
in the OOM selection loop.  Note that killing such process requires
the thread stack page-in, but sometimes this is the only way to
recover.

Reported and tested by: pho
Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 3 weeks

8 years agoIntegrate tools/regression/pipe in to the FreeBSD test suite as
ngie [Mon, 16 Nov 2015 05:38:40 +0000 (05:38 +0000)]
Integrate tools/regression/pipe in to the FreeBSD test suite as
tests/sys/kern/pipe

- Fix style(9) bugs
- Fix compiler warnings
- Use `nitems(x)` instead of `sizeof(x) / sizeof(*x)` pattern

The testcases will be converted over to ATF eventually, but for now will be
integrated in as plain C tests

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agoPort contrib/netbsd-tests/kernel/t_mqueue.c to FreeBSD
ngie [Mon, 16 Nov 2015 05:28:14 +0000 (05:28 +0000)]
Port contrib/netbsd-tests/kernel/t_mqueue.c to FreeBSD

- Add missing headers
- Ensure mqueuefs is loaded
- Make sure the mqueuefs path is absolute and relative to /
- Cast the result of mq_open returning -1 to (mqd_t) to mute a compiler
  warning

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agoIntegrate contrib/netbsd-tests/kernel/t_lockf.c into the FreeBSD test suite as
ngie [Mon, 16 Nov 2015 04:56:14 +0000 (04:56 +0000)]
Integrate contrib/netbsd-tests/kernel/t_lockf.c into the FreeBSD test suite as
tests/sys/kern/lockf_test

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agoIgnore EINTR from usleep(3) in try_locks(..)
ngie [Mon, 16 Nov 2015 04:53:13 +0000 (04:53 +0000)]
Ignore EINTR from usleep(3) in try_locks(..)

NetBSD's usleep(3) only returns -1/sets errno=EINVAL when `microseconds`
is one million or more

MFC after: 3 days
Submitted by: pho
Sponsored by: EMC / Isilon Storage Division

8 years agoAdd initial support for the QCA953x ("Honeybee") from Qualcomm Atheros.
adrian [Mon, 16 Nov 2015 04:28:00 +0000 (04:28 +0000)]
Add initial support for the QCA953x ("Honeybee") from Qualcomm Atheros.

The QCA953x SoC is an integrated 2x2 2GHz 11n + MIPS24k core, with
a 5 port FE switch, gige WAN port, and all the same stuff you'd find on
its predecessor - the AR9331.

However, buried deep in here somewhere is also a PCIe EP/RC for various
applications and some other weird bits I don't yet know about.

This is enough to get the reference board up and booting.  I haven't yet
had it pass lots of packets - I need to finalise the ethernet switch
bits and the GMAC configuration (ie, how the ethernet ports and switch
are wired up) and I'll bring that in when I commit the base configuration
files to use the thing.

The wifi stuff will come much later.  I have to port that support from
Linux ath9k and extend our vendor HAL to support it.

The reference board (AP143) comes with 32MB RAM and 4MB flash, so in order
to use it I need to get USB working fully so I can run root from there.

Thankyou to Qualcomm Atheros for access to the reference design board.

Details:

* Add register definitions from openwrt;
* It looks like a QCA955x but shrunk down to a QCA933x footprint, so
  use the QCA955x bits and fix up the clock detection code to do the
  QCA953x bits (they're very subtly different);
* Teach GPIO about it;
* Teach EHCI about it;
* Teach if_arge about it;
* Teach the CPU detection code about it.

Tested:

* AP143, QCA9533v2 SoC

Obtained from: Linux, Linux OpenWRT

8 years agoAdd some initial tests for SLIST and STAILQ macros
ngie [Mon, 16 Nov 2015 04:15:39 +0000 (04:15 +0000)]
Add some initial tests for SLIST and STAILQ macros

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agoIntegrate contrib/netbsd-tests/lib/libcrypt/t_crypt.c in to the FreeBSD
ngie [Mon, 16 Nov 2015 04:06:14 +0000 (04:06 +0000)]
Integrate contrib/netbsd-tests/lib/libcrypt/t_crypt.c in to the FreeBSD
test suite as lib/libcrypt/crypt_test

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agoExpect all testcases dealing with invalid salts to fail on FreeBSD
ngie [Mon, 16 Nov 2015 04:04:05 +0000 (04:04 +0000)]
Expect all testcases dealing with invalid salts to fail on FreeBSD

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agoFix path for symlinks.
rodrigc [Mon, 16 Nov 2015 04:02:24 +0000 (04:02 +0000)]
Fix path for symlinks.

Reviewed by: ngie

8 years agoIntegrate acct(2) testcase in as tests/sys/kern/acct/acct_test
ngie [Mon, 16 Nov 2015 03:32:12 +0000 (03:32 +0000)]
Integrate acct(2) testcase in as tests/sys/kern/acct/acct_test

The :encode_tv_random_million testcase fails the epsilon tests a few thousand
times out of one million, so expect the testcase to fail

MFC after: 1 week
Submitted by: keramida
Sponsored by: EMC / Isilon Storage Division

8 years agoIntegrate kern/kern_acct.c testcase in as tests/sys/kern/acct/acct_test
ngie [Mon, 16 Nov 2015 03:28:28 +0000 (03:28 +0000)]
Integrate kern/kern_acct.c testcase in as tests/sys/kern/acct/acct_test

The :encode_tv_random_million testcase fails the epsilon tests few thousand
times out of one million, so expect the testcase to fail

MFC after: 1 week
Submitted by: keramida
Sponsored by: EMC / Isilon Storage Division

8 years agoDon't need cast malloc.
araujo [Mon, 16 Nov 2015 03:18:40 +0000 (03:18 +0000)]
Don't need cast malloc.

Approved by: rodrigc (mentor)
Differential Revision: D4117

8 years agoEnable pjdfstest in the FreeBSD test suite by default to get some
ngie [Mon, 16 Nov 2015 02:27:38 +0000 (02:27 +0000)]
Enable pjdfstest in the FreeBSD test suite by default to get some
coverage on the root file system

Sponsored by: EMC / Isilon Storage Division

8 years agoMFhead @ r290899
ngie [Mon, 16 Nov 2015 02:00:12 +0000 (02:00 +0000)]
MFhead @ r290899