freebsd.git
8 years agoreturn "US-ASCII" instead of "POSIX" for "C" and "POSIX" locales
bapt [Tue, 10 Nov 2015 08:11:27 +0000 (08:11 +0000)]
return "US-ASCII" instead of "POSIX" for "C" and "POSIX" locales
as it used to be in previous version of the locales. Returning
"POSIX" has too many fallouts.

8 years agocxgbe/t4_tom: add a knob to the default configuration file to tune
np [Tue, 10 Nov 2015 02:29:19 +0000 (02:29 +0000)]
cxgbe/t4_tom: add a knob to the default configuration file to tune
the TOE for LAN operation.  It is possible to set this to other values
(cluster for networks with little loss and really tight RTTs, and wan
for relatively large RTTs and/or lossy networks) depending on the
environment in which the TOE is being used.

None of this affects plain NIC operation in any way.

MFC after: 1 week

8 years agourtwn(4): fix the build.
avos [Tue, 10 Nov 2015 00:42:32 +0000 (00:42 +0000)]
urtwn(4): fix the build.

Add some missing bits from D4020.

8 years agourtwn(4): add HOSTAP mode support.
avos [Tue, 10 Nov 2015 00:12:00 +0000 (00:12 +0000)]
urtwn(4): add HOSTAP mode support.

Tested with RTL8188EU, HOSTAP and STA modes

Reviewed by: kevlo
Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D4034

8 years agourtwn(4): refactor and fix TX path.
avos [Mon, 9 Nov 2015 23:46:13 +0000 (23:46 +0000)]
urtwn(4): refactor and fix TX path.

- Split urtwn_tx_start() into urtwn_tx_data() and urtwn_tx_start()
  (the last will be used for beacon updates / raw xmit path).
- Remove unneeded code from _urtwn_getbuf().
- Use CCK11 for data frames in 11b mode.
- Send EAPOL frames at 1 Mbps.
- Reduce code duplication in urtwn_tx_data().
- Fix sequence numbering.
- Add IEEE80211_RADIOTAP_F_WEP flag for encrypted frames.
- Check URTWN_RUNNING flag under lock.

Tested with RTL8188EU, STA mode.

Reviewed by: kevlo
Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D4017

8 years agoFAST_DEPEND: Fix building of wrong source files in some cases.
bdrewery [Mon, 9 Nov 2015 23:37:04 +0000 (23:37 +0000)]
FAST_DEPEND: Fix building of wrong source files in some cases.

Similar to the original reason for these dependency hints to be added,
in r124637, the missing-dependency file case can lead to building of the
wrong source.

A clear example of this is in gnu/lib/libstdc++ where the .PATH contains
both contrib/gcc and contrib/libstdc++/src.

  contrib/gcc has a debug.c.
  contrib/libstdc++/src has a debug.cc.

  When building for the objects of debug.o, debug.So, and debug.po, it is
  ambiguous for which src file to use due to the suffix transformation
  rules, even though the proper one is listed first in .PATH.

  This was normally avoided due to these dependency hints for the initial
  build, and then mkdep would add an explicit 'debug.o: debug.cc'
  dependency into the .depend file.  WITH_FAST_DEPEND does not generate
  the .depend file with these, but puts them into .depend.debug.o instead.

Rather than extending the exists() check to each object's .depend.*
file, just enable the hint when when using WITH_FAST_DEPEND.  It fixes
the problem and seems to be safe enough to use since it is mapping SRCS
back to OBJS, rather than letting make make assumptions from OBJS to
SRCS.

A similar check mapping objects to headers is present in some mk files
but was not extended here for FAST_DEPEND since it has not yet been
found to be a problem.

X-MFC-With: r290433
MFC after: 3 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoWhen extracting mtrees, pass -i so schg/sappnd are respected.
bdrewery [Mon, 9 Nov 2015 23:37:01 +0000 (23:37 +0000)]
When extracting mtrees, pass -i so schg/sappnd are respected.

This fixes /var/empty not being schg in the installation.

This was a change from fmtree to nmtree, that -i is now required to
apply these flags.

PR: 194189
Submitted by: guyyur@gmail.com
MFC after: 2 weeks
Relnotes: yes

8 years agoFix 'make cleanworld' to respect TARGET/TARGET_ARCH for cross-build objtrees.
bdrewery [Mon, 9 Nov 2015 23:36:57 +0000 (23:36 +0000)]
Fix 'make cleanworld' to respect TARGET/TARGET_ARCH for cross-build objtrees.

This simplifies the logic to always try removing the objdir if it exists
and to fallback on a 'cleandir' if no objdir exists.  The reasoning for
this is to avoid rm -rf src/* (r126024)

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

8 years agoMove 'make cleandir' from Makefile to Makefile.inc1.
bdrewery [Mon, 9 Nov 2015 23:36:46 +0000 (23:36 +0000)]
Move 'make cleandir' from Makefile to Makefile.inc1.

This leads the way for fixing cross-build cleanup, and eventually replacing
'cleandir' with it during the build.

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

8 years agoAdd a README to explain how to generate the locales from CLDR data
bapt [Mon, 9 Nov 2015 23:23:29 +0000 (23:23 +0000)]
Add a README to explain how to generate the locales from CLDR data

8 years agoConnect nmtree
bdrewery [Mon, 9 Nov 2015 23:20:45 +0000 (23:20 +0000)]
Connect nmtree

8 years agoRename usr.sbin/mtree to usr.sbin/fmtree since it is not what /usr/sbin/mtree
bdrewery [Mon, 9 Nov 2015 23:19:36 +0000 (23:19 +0000)]
Rename usr.sbin/mtree to usr.sbin/fmtree since it is not what /usr/sbin/mtree
actually is (which is usr.sbin/nmtree).

This has tricked me numerous times.

8 years agonl_langinfo: Simplify case ladder
bapt [Mon, 9 Nov 2015 22:29:47 +0000 (22:29 +0000)]
nl_langinfo: Simplify case ladder

The NONE:US-ASCII case isn't necessary.  The "NONE:" case will handle
US-ASCII, so let's remove the redundant handling.

Submitted by: marino
Obtained from: DragonflyBSD

8 years agoFix typo (s/ncpus/mp_ncpus/)
tijl [Mon, 9 Nov 2015 22:12:29 +0000 (22:12 +0000)]
Fix typo (s/ncpus/mp_ncpus/)

Reported by: bz

8 years agoReadd ascii.c forgotten in r290618
bapt [Mon, 9 Nov 2015 22:11:37 +0000 (22:11 +0000)]
Readd ascii.c forgotten in r290618

8 years agoRegenerate timedef now that the tools pad CJK correctly
bapt [Mon, 9 Nov 2015 22:09:38 +0000 (22:09 +0000)]
Regenerate timedef now that the tools pad CJK correctly

8 years agolocales: Enforce US-ASCII encoding (limited to 7-bit)
bapt [Mon, 9 Nov 2015 22:06:22 +0000 (22:06 +0000)]
locales: Enforce US-ASCII encoding (limited to 7-bit)

The US-ASCII format was getting treated identically to POSIX.  It is
supposed to throw an ILSEQ errno if a value of 0x80 or greater is
encountered, so let's bring back the "ASCII" handling.

While here, change nl_codeset to return US-ASCII only when the encoding
really is "US-ASCII".  Before "C" and "POSIX" encoding returned this
string, so now they return "POSIX".

Discussed with: ache
Submitted by: marino
Obtained from: DragonflyBSD

8 years agoAlso remove directories along with old locales
bapt [Mon, 9 Nov 2015 21:53:39 +0000 (21:53 +0000)]
Also remove directories along with old locales

Reported by: andreast

8 years agoFix kernel build, broken in r290612
garga [Mon, 9 Nov 2015 20:22:59 +0000 (20:22 +0000)]
Fix kernel build, broken in r290612

Approved by: adrian

8 years agoIntroduce portal group options in ctl.conf.
mav [Mon, 9 Nov 2015 18:33:36 +0000 (18:33 +0000)]
Introduce portal group options in ctl.conf.

While CTL has concept of port options, used at least for iSCSI ports now,
before this change it was impossible to set them manually.  There still
no user-configurable port options now, but I am planning to change that.

8 years agoNow that the PMU implementation is independent of HWPMC
bz [Mon, 9 Nov 2015 17:57:32 +0000 (17:57 +0000)]
Now that the PMU implementation is independent of HWPMC
as of r288992 use it to manage the CCNT.

Use the CNNT for get_cyclecount() instead of binuptime() when device pmu
is compiled in; if it fails to attach, fall back to the former method.

Enable by default for the BeagleBoneBlack configuration.

Optained from: Cambridge/L41
Sponsored by: DARPA/AFRL
Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D3837

8 years agolinuxkpi/sysfs.h: Cast arg2 through intptr_t to avoid GCC warning
cem [Mon, 9 Nov 2015 16:50:42 +0000 (16:50 +0000)]
linuxkpi/sysfs.h: Cast arg2 through intptr_t to avoid GCC warning

The code compiles fine under Clang, but GCC on PPC is less permissive about
integer and pointer sizes.  (An intmax_t is clearly *large enough* to hold a
pointer value.)

Another follow-up to r290475.

Reported by: jhibbits
Sponsored by: EMC / Isilon Storage Division

8 years agoath(4): begin fleshing out a "reset type" extension to force cold/warn resets.
adrian [Mon, 9 Nov 2015 15:59:42 +0000 (15:59 +0000)]
ath(4): begin fleshing out a "reset type" extension to force cold/warn resets.

Right now the only way to force a cold reset is:

* The HAL itself detects it's needed, or
* The sysctl, setting all resets to be cold.

Trouble is, cold resets take quite a bit longer than warm resets.

However, there are situations where a cold reset would be nice.
Specifically, after a stuck beacon, BB/MAC hang, stuck calibration results,
etc.

The vendor HAL has a separate method to set the reset reason (which is
how HAL_RESET_BBPANIC gets set) which informs the HAL during the reset path
why it occured.  This is almost but not quite the same; I may eventually
unify both approaches in the future.

This commit just extends HAL_RESET_TYPE to include both status (eg BBPANIC)
and type (eg do COLD.)  None of the HAL code uses it yet though;  that'll
come later.

It also is a big no-op in each HAL - I need to go teach each of the HALs
about cold/warm reset through this path.

8 years agoxen-blkfront: add support for unmapped IO
royger [Mon, 9 Nov 2015 12:22:44 +0000 (12:22 +0000)]
xen-blkfront: add support for unmapped IO

Using unmapped IO is really beneficial when running inside of a VM,
since it avoids IPIs to other vCPUs in order to invalidate the
mappings.

This patch adds unmapped IO support to blkfront. The following tests
results have been obtained when running on a Xen host without HAP:

PVHVM
     3165.84 real      6354.17 user      4483.32 sys
PVHVM with unmapped IO
     2099.46 real      4624.52 user      2967.38 sys

This is because when running using shadow page tables TLB flushes and
range invalidations are much more expensive, so using unmapped IO
provides a very important performance boost.

Sponsored by: Citrix Systems R&D
MFC after: 2 weeks
X-MFC-with: r290610

dev/xen/blkfront/blkfront.c:
 - Add and announce support for unmapped IO.

8 years agox86/dma_bounce: rework _bus_dmamap_load_ma implementation
royger [Mon, 9 Nov 2015 12:19:58 +0000 (12:19 +0000)]
x86/dma_bounce: rework _bus_dmamap_load_ma implementation

The implementation of bus_dmamap_load_ma_triv currently calls
_bus_dmamap_load_phys on each page that is part of the passed in buffer.
Since each page is treated as an individual buffer, the resulting behaviour
is different from the behaviour of _bus_dmamap_load_buffer. This breaks
certain drivers, like Xen blkfront.

If an unmapped buffer of size 4096 that starts at offset 13 into the first
page is passed to the current _bus_dmamap_load_ma implementation (so the ma
array contains two pages), the result is that two segments are created, one
with a size of 4083 and the other with size 13 (because two independant
calls to _bus_dmamap_load_phys are performed, one for each physical page).
If the same is done with a mapped buffer and calling _bus_dmamap_load_buffer
the result is that only one segment is created, with a size of 4096.

This patch relegates the usage of bus_dmamap_load_ma_triv in x86 bounce
buffer code to drivers requesting BUS_DMA_KEEP_PG_OFFSET and implements
_bus_dmamap_load_ma so that it's behaviour is the same as the mapped version
(_bus_dmamap_load_buffer). This patch only modifies the x86 bounce buffer
code, other arches are left untouched.

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

8 years agoBump .Dd
ngie [Mon, 9 Nov 2015 10:41:27 +0000 (10:41 +0000)]
Bump .Dd

8 years agoDocument powl(3)
ngie [Mon, 9 Nov 2015 10:40:16 +0000 (10:40 +0000)]
Document powl(3)

PR: 191751
Sponsored by: EMC / Isilon Storage Division

8 years agoDecompose arp_ifinit() into arp_add_ifa_lle() and arp_announce_ifaddr().
melifaro [Mon, 9 Nov 2015 10:35:33 +0000 (10:35 +0000)]
Decompose arp_ifinit() into arp_add_ifa_lle() and arp_announce_ifaddr().
Rename arp_ifinit2() into arp_announce_ifaddr().

Eliminate zeroing ifa_rtrequest: it was used for calling arp_rtrequest()
which was responsible for handling route cloning requests. It became
obsolete since r186119 (L2/L3 split).

8 years agoUse lladdr_event to propagate gratiotus arp.
melifaro [Mon, 9 Nov 2015 10:11:14 +0000 (10:11 +0000)]
Use lladdr_event to propagate gratiotus arp.

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

8 years agoBump .Dd
ngie [Mon, 9 Nov 2015 09:39:59 +0000 (09:39 +0000)]
Bump .Dd

8 years agoFollow up to r290259 dealing with makefs(8)
ngie [Mon, 9 Nov 2015 09:39:07 +0000 (09:39 +0000)]
Follow up to r290259 dealing with makefs(8)

- Don't use contractions (don't -> do not)
- Change "throw away" to "discard" when describing the -o keep-bad-images option
- Revert author e-mail split I brought over from NetBSD, effectively reverting
  the change bapt made in r267668

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

8 years agoRemove noatime from tmpfs(5) fstab(5) entry.
gjb [Mon, 9 Nov 2015 06:30:26 +0000 (06:30 +0000)]
Remove noatime from tmpfs(5) fstab(5) entry.

Submitted by: Howard Su
MFC after: 3 days
X-MFC-With: r290550
Sponsored by: The FreeBSD Foundation

8 years agoIntegrate tools/regression/lib/libc/gen into the FreeBSD test suite
ngie [Mon, 9 Nov 2015 06:24:11 +0000 (06:24 +0000)]
Integrate tools/regression/lib/libc/gen into the FreeBSD test suite
as lib/libc/tests/gen

The code in test-fnmatch that was used for generating:

- bin/sh/tests/builtins/case2.0
- bin/sh/tests/builtins/case3.0

has been left undisturbed. The target `make sh-tests` has been moved over
from tools/regression/lib/libc/gen/Makefile to
lib/libc/tests/gen/Makefile and made into a PHONY target

case2.0 and case3.0 test input generation isn't being done automatically.
This needs additional discussion.

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

8 years agoFix some TAP -> ATF conversion errors
ngie [Mon, 9 Nov 2015 06:16:38 +0000 (06:16 +0000)]
Fix some TAP -> ATF conversion errors

- Remove a leftover printf from when this was a TAP based testcase
- Catch mmap failures properly

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

8 years agoReduce the Makefile snippet complexity a bit
ngie [Mon, 9 Nov 2015 02:29:38 +0000 (02:29 +0000)]
Reduce the Makefile snippet complexity a bit

- Set BINDIR to TESTSDIR globally (and subsequently, remove all
  `${FILESGROUP}DIR` setting because BINDIR is set to `TESTSDIR`)
- Set MAN to "" globally, instead of per-PROG

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

8 years agoFix typo in message from arm64 ITS workaround
emaste [Mon, 9 Nov 2015 01:49:25 +0000 (01:49 +0000)]
Fix typo in message from arm64 ITS workaround

8 years agoAdd some basic tests that exercise cputime limits with limits(1)
ngie [Mon, 9 Nov 2015 01:05:31 +0000 (01:05 +0000)]
Add some basic tests that exercise cputime limits with limits(1)

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

8 years ago- Although it doesn't make a whole lot of sense to enable RX and TX
marius [Mon, 9 Nov 2015 00:19:04 +0000 (00:19 +0000)]
- Although it doesn't make a whole lot of sense to enable RX and TX
  before their initial configuration is done, it turns out that r281337
  has the inverse effect on some older chips. Moreover, as with newer
  chips before, two chips seemingly identical according to their MAC
  revisions may behave differently in this regard, with most working
  but a few not, making changes extremely hard to test.
  Closer inspection of the corresponding Linux code suggests that RX
  and TX should only be enabled after their initial configuration with
  RTL8168G and later chips, i. e. RTL8106E{,US}, RTL8107E, as well as
  RTL8168{EP,G,GU,H}, so limit the new code path to these. [1]
- Distinguish between RTL8168H and RTL8107E, with the latter being the
  10/100-Mbit/s-only variant of the former.
- For MAC variants that can only do Fast Ethernet at a maximum, ensure
  that we don't advertise Gigabit Ethernet speed.
- In re_stop(), do the inverse of re_init_locked() and enable RXDV
  gate on RTL8168G and later chips again, matching what Linux does.

PR: 203422 [1]
MFC after: 1 week

8 years agoEnsure TEMPROOT is unique, to guard against multiple builds on same machine.
sjg [Sun, 8 Nov 2015 23:46:05 +0000 (23:46 +0000)]
Ensure TEMPROOT is unique, to guard against multiple builds on same machine.

Differential Revision: D3002
Reviewed by: gjb

8 years agourtwn(4): improve RX filter.
avos [Sun, 8 Nov 2015 23:21:54 +0000 (23:21 +0000)]
urtwn(4): improve RX filter.

- Filter out unneeded frames in STA mode.
- Implement ic_promisc() call.

Tested with RTL8188EU, STA and MONITOR modes.

Reviewed by: kevlo
Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D3999

8 years agoIntegrate tools/regression/lib/libc/net into the FreeBSD test suite
ngie [Sun, 8 Nov 2015 23:06:40 +0000 (23:06 +0000)]
Integrate tools/regression/lib/libc/net into the FreeBSD test suite
as lib/libc/tests/net

Also, fix eui64_aton_test:test_str(..). The test was comparing the result
of eui64_aton to a pointer of the expected result.

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

8 years agolower again the warnings and remove the pragmas unsupported by gcc 4.2.1
bapt [Sun, 8 Nov 2015 22:23:21 +0000 (22:23 +0000)]
lower again the warnings and remove the pragmas unsupported by gcc 4.2.1

8 years agoDelete leftover printfs from when these were TAP tests
ngie [Sun, 8 Nov 2015 21:57:35 +0000 (21:57 +0000)]
Delete leftover printfs from when these were TAP tests

MFC after: 1 week
X-MFC with: r290532
Sponsored by: EMC / Isilon Storage Division

8 years agoConvert print_positional_test over to ATF
ngie [Sun, 8 Nov 2015 21:38:46 +0000 (21:38 +0000)]
Convert print_positional_test over to ATF

Somehow missed in r290537

X-MFC with: r290537
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agoEliminate some gcc pragmas
bapt [Sun, 8 Nov 2015 21:22:24 +0000 (21:22 +0000)]
Eliminate some gcc pragmas

8 years agoSync arm64 GENERIC whitespace/comments with amd64
emaste [Sun, 8 Nov 2015 21:08:31 +0000 (21:08 +0000)]
Sync arm64 GENERIC whitespace/comments with amd64

Sponsored by: The FreeBSD Foundation

8 years agoImprove r290373, do a runtime check rather than a compile time switch. I
andreast [Sun, 8 Nov 2015 21:06:51 +0000 (21:06 +0000)]
Improve r290373, do a runtime check rather than a compile time switch. I
learned that the Power8 and the PS3 have a mix of OFW and FDT. Both have AIM
defined. But currently they are not affected. They have no I2C devices under
OFW.

This version was tested on a Quad G5 and build tested for armv6*.

Discussed with nwhitehorn@
Reviewed by: ian@

8 years agoarm64: build usr.sbin/acpi subdirectory
emaste [Sun, 8 Nov 2015 20:56:04 +0000 (20:56 +0000)]
arm64: build usr.sbin/acpi subdirectory

The arm64 platform will in general use ACPI so we want these tools built
there.

Sponsored by: The FreeBSD Foundation

8 years agodrm/i915: Reduce diff with Linux 3.8
dumbbell [Sun, 8 Nov 2015 19:29:34 +0000 (19:29 +0000)]
drm/i915: Reduce diff with Linux 3.8

There is no functional change. The goal is to ease the future update to
Linux 3.8's i915 driver.

MFC after: 2 months

8 years agoModify the tool that generates the locales so that the generated CJK locales
bapt [Sun, 8 Nov 2015 19:08:38 +0000 (19:08 +0000)]
Modify the tool that generates the locales so that the generated CJK locales
are padded as expected by the users

Submitted by: marino
Obtained from: DragonflyBSD

8 years agoFix pagelist bus_dmamap_t map handling. Memory for pagelist is allocated
skra [Sun, 8 Nov 2015 18:48:35 +0000 (18:48 +0000)]
Fix pagelist bus_dmamap_t map handling. Memory for pagelist is allocated
by bus_dmamem_alloc() which creates associated bus_dmamap_t map for us.
When this memory is freed by bus_dmamem_free(), the map is freed as well.

Thus there is no need to free it explicitly by bus_dmamap_destroy(),
which leads to double freeing.

Discussed with: gonzo
Approved by: kib (mentor)

8 years agoMake naming more consistent; no functional changes.
trasz [Sun, 8 Nov 2015 18:11:24 +0000 (18:11 +0000)]
Make naming more consistent; no functional changes.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoSpeed up rctl(8) rule retrieval; the difference shows mostly in "rctl -n",
trasz [Sun, 8 Nov 2015 18:08:31 +0000 (18:08 +0000)]
Speed up rctl(8) rule retrieval; the difference shows mostly in "rctl -n",
as otherwise most of the time is spent resolving UIDs to names.

Reviewed by: mjg@
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D4059

8 years agoUse tmpfs(5) instead of md(4) for '/tmp' mount.
gjb [Sun, 8 Nov 2015 18:02:39 +0000 (18:02 +0000)]
Use tmpfs(5) instead of md(4) for '/tmp' mount.

Submitted by: Nikolai Lifanov
Differential Revision: D3506
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

8 years agoReorganize code to elimitate one _sseek() call for append modes.
ache [Sun, 8 Nov 2015 18:00:44 +0000 (18:00 +0000)]
Reorganize code to elimitate one _sseek() call for append modes.

MFC after:      1 week

8 years agoUserspace part of reroot support. This makes it possible to change
trasz [Sun, 8 Nov 2015 17:33:48 +0000 (17:33 +0000)]
Userspace part of reroot support. This makes it possible to change
the root filesystem without full reboot, using "reboot -r". This can
be used to to eg. boot from a temporary md_image preloaded by loader(8),
setup an iSCSI session, and continue booting from rootfs mounted over
iSCSI.

Reviewed by: kib@, bapt@
MFC after: 1 month
Relnotes: yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3693

8 years agoSince r289279 bufinit() uses mp_ncpus, but some architectures set this
tijl [Sun, 8 Nov 2015 14:26:50 +0000 (14:26 +0000)]
Since r289279 bufinit() uses mp_ncpus, but some architectures set this
variable during mp_start() which is too late.  Move this to mp_setmaxid()
where other architectures set it and move x86 assertions to MI code.

Reviewed by: kib (x86 part)

8 years agoPrint proper setfib values in ipfw log.
melifaro [Sun, 8 Nov 2015 13:44:21 +0000 (13:44 +0000)]
Print proper setfib values in ipfw log.

Submitted by: Denis Schneider <v1ne2go at gmail>

8 years agoFix setfib target.
melifaro [Sun, 8 Nov 2015 12:24:19 +0000 (12:24 +0000)]
Fix setfib target.
Problem was introduced in r272840 when converting tablearg value to 0.

Submitted by: Denis Schneider <v1ne2go at gmail>

8 years agoAvoid using the bounce buffer when the source or destination buffer is
hselasky [Sun, 8 Nov 2015 09:37:26 +0000 (09:37 +0000)]
Avoid using the bounce buffer when the source or destination buffer is
32-bits aligned. Merge the two bounce buffers into a single one. Some
rough tests showed that the DWC OTG throughput on RPI2 increased by
10% after this patch.

MFC after: 1 week

8 years agoMake usermode variable the bool type. It's already used that way.
skra [Sun, 8 Nov 2015 08:31:34 +0000 (08:31 +0000)]
Make usermode variable the bool type. It's already used that way.

Suggested by: kib
Approved by: kib (mentor)

8 years agoprintfloat_test and scanfloat_test need symbols from msun; these are automatically
ngie [Sun, 8 Nov 2015 08:27:51 +0000 (08:27 +0000)]
printfloat_test and scanfloat_test need symbols from msun; these are automatically
provided on amd64, but not i386. Add libm to DPADD/LDADD to unbreak the i386
tinderbox

Pointyhat to: ngie
MFC after: 1 week
X-MFC with: r290538
Sponsored by: EMC / Isilon Storage Division

8 years agoIntegrate tools/regression/lib/libc/string into the FreeBSD test suite
ngie [Sun, 8 Nov 2015 07:53:31 +0000 (07:53 +0000)]
Integrate tools/regression/lib/libc/string into the FreeBSD test suite
as lib/libc/tests/string

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

8 years agoIntegrate tools/regression/lib/libc/stdlib into the FreeBSD test suite
ngie [Sun, 8 Nov 2015 07:03:17 +0000 (07:03 +0000)]
Integrate tools/regression/lib/libc/stdlib into the FreeBSD test suite
as lib/libc/tests/stdlib

- Make the code a bit more style(9) compliant
- Convert a sizeof(x)/sizeof(x[0]) to nitems

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

8 years agoIntegrate tools/regression/lib/libc/stdio into the FreeBSD test suite
ngie [Sun, 8 Nov 2015 06:37:50 +0000 (06:37 +0000)]
Integrate tools/regression/lib/libc/stdio into the FreeBSD test suite
as lib/libc/tests/stdio

- Fix some whitespace
- Convert the testcases to ATF
- Convert "/dev/null" to _PATH_DEVNULL

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

8 years agoFix some of WITNESS complaints and bootup lock by removing msg_avail
gonzo [Sun, 8 Nov 2015 04:15:52 +0000 (04:15 +0000)]
Fix some of WITNESS complaints and bootup lock by removing msg_avail
condvar/mutex. They're basically no-op because error is not propagated
up the call chain. We still report message failures in VC service callback

8 years agovchiq interrupt is MP safe, add respective flag to bus_setup_intr
gonzo [Sun, 8 Nov 2015 03:54:15 +0000 (03:54 +0000)]
vchiq interrupt is MP safe, add respective flag to bus_setup_intr

8 years agoFix locking for VCHI driver by matching sleepable/non-sleepable APIs:
gonzo [Sun, 8 Nov 2015 03:53:31 +0000 (03:53 +0000)]
Fix locking for VCHI driver by matching sleepable/non-sleepable APIs:

- Emulate Linux mutex API using sx(9) locks with only exclusive operations
    instead of mutex(9), in Linux mutexes are sleepable.
- Emulate Linux rwlock_t using rwlock(9) instead of sx(9). rwlock_t
    in Linux are spin locks

8 years ago- Replace semaphore-base locking with sleep/wait synchronization:
gonzo [Sun, 8 Nov 2015 03:34:19 +0000 (03:34 +0000)]
- Replace semaphore-base locking with sleep/wait synchronization:
    sema_trywait/sema_timedwait can't be used while holding
    non-sleepable mutex

- Fix infinite loop if response from VideoCore never received

8 years agoIntegrate tools/regression/lib/libc/locale into the FreeBSD test suite
ngie [Sun, 8 Nov 2015 02:06:17 +0000 (02:06 +0000)]
Integrate tools/regression/lib/libc/locale into the FreeBSD test suite
as lib/libc/tests/locale

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

8 years agoAdd a manual page for PHOLD() and friends.
markj [Sun, 8 Nov 2015 01:41:44 +0000 (01:41 +0000)]
Add a manual page for PHOLD() and friends.

MFC after: 1 week

8 years ago- Consistently use PROC_ASSERT_HELD() to verify that a process' hold count
markj [Sun, 8 Nov 2015 01:38:56 +0000 (01:38 +0000)]
- Consistently use PROC_ASSERT_HELD() to verify that a process' hold count
  is non-zero.
- Include the process address in the PROC_ASSERT_HELD() and
  PROC_ASSERT_NOT_HELD() assertion messages so that the corresponding
  process can be found easily when debugging.

MFC after: 1 week

8 years agoEnsure that deactivated pages that are not expected to be reused are
markj [Sun, 8 Nov 2015 01:36:18 +0000 (01:36 +0000)]
Ensure that deactivated pages that are not expected to be reused are
reclaimed in FIFO order by the pagedaemon.  Previously we would enqueue
such pages at the head of the inactive queue, yielding a LIFO reclaim order.

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

8 years agoRegen after r290526 for WITH_CCACHE_BUILD.
bdrewery [Sun, 8 Nov 2015 00:54:41 +0000 (00:54 +0000)]
Regen after r290526 for WITH_CCACHE_BUILD.

8 years agoAdd built-in ccache build support via WITH_CCACHE_BUILD option.
bdrewery [Sun, 8 Nov 2015 00:50:18 +0000 (00:50 +0000)]
Add built-in ccache build support via WITH_CCACHE_BUILD option.

ccache is mostly beneficial for frequent builds where -DNO_CLEAN is not
used to achieve a safe pseudo-incremental build.  This is explained in
more detail upstream [1] [2].  It incurs about a 20%-28% hit to populate the
cache, but with a full cache saves 30-50% in build times.  When combined with
the WITH_FAST_DEPEND feature it saves up to 65% since ccache does cache the
resulting dependency file, which it does not do when using mkdep(1)/'CC
-E'.  Stats are provided at the end of this message.

This removes the need to modify /etc/make.conf with the CC:= and CXX:=
lines which conflicted with external compiler support [3] (causing the
bootstrap compiler to not be built which lead to obscure failures [4]),
incorrectly invoked ccache in various stages, required CCACHE_CPP2 to avoid
Clang errors with parenthesis, and did not work with META_MODE.

The option name was picked to match the existing option in ports.  This
feature is available for both in-src and out-of-src builds that use
/usr/share/mk.

Linking, assembly compiles, and pre-processing avoid using ccache since it is
only overhead.  ccache does nothing special in these modes, although there is
no harm in calling it for them.

CCACHE_COMPILERCHECK is set to 'content' when using the in-tree bootstrap
compiler to hash the content of the compiler binary to determine if it
should be a cache miss.  For external compilers the 'mtime' option is used
as it is more efficient and likely to be correct.  Future work may optimize the
'content' check using the same checks as whether a bootstrap compiler is needed
to be built.

The CCACHE_CPP2 pessimization is currently default in our devel/ccache
port due to Clang requiring it.  Clang's -Wparentheses-equality,
-Wtautological-compare, and -Wself-assign warnings do not mix well with
compiling already-pre-processed code that may have expanded macros that
trigger the warnings.  GCC has so far not had this issue so it is allowed to
disable the CCACHE_CPP2 default in our port.

Sharing a cache between multiple checkouts, or systems, is explained in
the ccache manual.  Sharing a cache over NFS would likely not be worth
it, but syncing cache directories between systems may be useful for an
organization.  There is also a memcached backend available [5].  Due to using
an object directory outside of the source directory though you will need to
ensure that both are in the same prefix and all users use the same layout.  A
possible working layout is as follows:
  Source: /some/prefix/src1
  Source: /some/prefix/src2
  Source: /some/prefix/src3
  Objdir: /some/prefix/obj
  Environment: CCACHE_BASEDIR='${SRCTOP:H}' MAKEOBJDIRPREFIX='${SRCTOP:H}/obj'
This will use src*/../obj as the MAKEOBJDIRPREFIX and tells ccache to replace
all absolute paths to be relative.  Using something like this is required due
to -I and -o flags containing both SRC and OBJDIR absolute paths that ccache
adds into its hash for the object without CCACHE_BASEDIR.

distcc can be hooked into by setting CCACHE_PREFIX=/usr/local/bin/distcc.
I have not personally tested this and assume it will not mix well with
using the bootstrap compiler.

The cache from buildworld can be reused in a subdir by first running
'make buildenv' (from r290424).

Note that the cache is currently different depending on whether -j is
used or not due to ccache enabling -fdiagnostics-color automatically if
stderr is a TTY, which bmake only does if not using -j.

The system I used for testing was:
  WITNESS
  Build options: -j20 WITH_LLDB=yes WITH_DEBUG_FILES=yes WITH_CCACHE_BUILD=yes
  DISK: ZFS 3-way mirror with very slow disks using SSD l2arc/log.
        The arc was fully populated with src tree files and ccache objects.
  RAM: 76GiB
  CPU: Intel(R) Xeon(R) CPU L5520 @2.27GHz
       2 package(s) x 4 core(s) x 2 SMT threads = hw.ncpu=16

The WITH_FAST_DEPEND feature was used for comparison here as well to show
the dramatic time savings with a full cache.

buildworld:
  x buildworld-before
  + buildworld-ccache-empty
  * buildworld-ccache-full
  % buildworld-ccache-full-fastdep
  # buildworld-fastdep
  +-------------------------------------------------------------------------------+
  |%            *                               #                                +|
  |%            *                               #                                +|
  |%            *                               #             xxx                +|
  |                                                           |A                  |
  |                                                                              A|
  |             A                                                                 |
  |A                                                                              |
  |                                             A                                 |
  +-------------------------------------------------------------------------------+
      N           Min           Max        Median           Avg        Stddev
  x   3       3744.13       3794.31       3752.25     3763.5633     26.935139
  +   3          4519       4525.04       4520.73       4521.59     3.1104823
  Difference at 95.0% confidence
          758.027 +/- 43.4565
          20.1412% +/- 1.15466%
          (Student's t, pooled s = 19.1726)
  *   3       1823.08        1827.2       1825.62        1825.3     2.0785572
  Difference at 95.0% confidence
          -1938.26 +/- 43.298
          -51.5007% +/- 1.15045%
          (Student's t, pooled s = 19.1026)
  %   3       1266.96       1279.37       1270.47     1272.2667     6.3971113
  Difference at 95.0% confidence
          -2491.3 +/- 44.3704
          -66.1952% +/- 1.17895%
          (Student's t, pooled s = 19.5758)
  #   3       3153.34       3155.16        3154.2     3154.2333    0.91045776
  Difference at 95.0% confidence
          -609.33 +/- 43.1943
          -16.1902% +/- 1.1477%
          (Student's t, pooled s = 19.0569)

buildkernel:
  x buildkernel-before
  + buildkernel-ccache-empty
  * buildkernel-ccache-empty-fastdep
  % buildkernel-ccache-full
  # buildkernel-ccache-full-fastdep
  @ buildkernel-fastdep
  +-------------------------------------------------------------------------------+
  |#                        @   %                  *                              |
  |#                        @   %                  *     x                      + |
  |#                        @   %                  *     xx                     ++|
  |                                                      MA                       |
  |                                                                             MA|
  |                                                A                              |
  |                             A                                                 |
  |A                                                                              |
  |                         A                                                     |
  +-------------------------------------------------------------------------------+
      N           Min           Max        Median           Avg        Stddev
  x   3        571.57        573.94        571.79     572.43333     1.3094401
  +   3        727.97        731.91        728.06     729.31333     2.2492295
  Difference at 95.0% confidence
          156.88 +/- 4.17129
          27.4058% +/- 0.728695%
          (Student's t, pooled s = 1.84034)
  *   3         527.1        528.29        528.08     527.82333    0.63516402
  Difference at 95.0% confidence
          -44.61 +/- 2.33254
          -7.79305% +/- 0.407478%
          (Student's t, pooled s = 1.02909)
  %   3         400.4        401.05        400.62        400.69     0.3306055
  Difference at 95.0% confidence
          -171.743 +/- 2.16453
          -30.0023% +/- 0.378128%
          (Student's t, pooled s = 0.954969)
  #   3        201.94        203.34        202.28        202.52    0.73020545
  Difference at 95.0% confidence
          -369.913 +/- 2.40293
          -64.6212% +/- 0.419774%
          (Student's t, pooled s = 1.06015)
  @   3        369.12        370.57         369.3     369.66333    0.79033748
  Difference at 95.0% confidence
          -202.77 +/- 2.45131
          -35.4225% +/- 0.428227%
          (Student's t, pooled s = 1.0815)

[1] https://ccache.samba.org/performance.html
[2] http://www.mail-archive.com/ccache@lists.samba.org/msg00576.html
[3] https://reviews.freebsd.org/D3484
[5] https://github.com/jrosdahl/ccache/pull/30

PR: 182944 [4]
MFC after: 3 weeks
Sponsored by: EMC / Isilon Storage Division
Relnotes: yes

8 years agoFAST_DEPEND: Don't enable when .MAKE.MODE=meta.
bdrewery [Sun, 8 Nov 2015 00:50:13 +0000 (00:50 +0000)]
FAST_DEPEND: Don't enable when .MAKE.MODE=meta.

This is because the .meta files generated from filemon already contain a
list of all files read to generate the object.

X-MFC-With: r290433
MFC after: 3 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoFAST_DEPEND: Don't include depend files when using 'make -V'.
bdrewery [Sun, 8 Nov 2015 00:50:09 +0000 (00:50 +0000)]
FAST_DEPEND: Don't include depend files when using 'make -V'.

This is especially noticeable in the kernel obj directory since it
includes so many files.

X-MFC-With: r290433
MFC after: 3 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoAdd a hack to workaround ZSH as BUILDENV_SHELL breaking CPUTYPE.
bdrewery [Sun, 8 Nov 2015 00:50:06 +0000 (00:50 +0000)]
Add a hack to workaround ZSH as BUILDENV_SHELL breaking CPUTYPE.

ZSH considers CPUTYPE a magic variable that will be the output of 'uname -m'
even if already set in environment when starting up.

The CPUTYPE?= check in Makefile.inc1 and supporting overriding CPUTYPE
manually in the buildenv shell make automatic workarounds too tricky
here.  ZSH should really respect variables set in the environment before
trashing them.

X-MFC-With: r290423
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoFix alignment of the short month names for CJK locales,
ume [Sat, 7 Nov 2015 23:54:14 +0000 (23:54 +0000)]
Fix alignment of the short month names for CJK locales,
as far as I could edit them.

8 years agopf: Fix broken rule skip calculation
kp [Sat, 7 Nov 2015 23:51:42 +0000 (23:51 +0000)]
pf: Fix broken rule skip calculation

r289932 accidentally broke the rule skip calculation. The address family
argument to PF_ANEQ() is now important, and because it was set to 0 the macro
always evaluated to false.
This resulted in incorrect skip values, which in turn broke the rule
evaluations.

8 years agosavecore(8): Be quiet unless the user asks for verbose
cem [Sat, 7 Nov 2015 23:27:03 +0000 (23:27 +0000)]
savecore(8): Be quiet unless the user asks for verbose

Make savecore(8) more suitable for init-time scripts; be quiet by default.

Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D3229

8 years agohptmv(4): Fix broken sysctl(9) API assumptions
cem [Sat, 7 Nov 2015 23:05:23 +0000 (23:05 +0000)]
hptmv(4): Fix broken sysctl(9) API assumptions

Sponsored by: EMC / Isilon Storage Division

8 years agoCorrect !FDT case with proper name.
imp [Sat, 7 Nov 2015 22:58:56 +0000 (22:58 +0000)]
Correct !FDT case with proper name.

8 years agoFix build of localedef(1) on arm where wchar_t is an unsigned int
bapt [Sat, 7 Nov 2015 22:57:00 +0000 (22:57 +0000)]
Fix build of localedef(1) on arm where wchar_t is an unsigned int

8 years agoImplement the phy-mode property for ate and macb. If it is set to
imp [Sat, 7 Nov 2015 22:52:06 +0000 (22:52 +0000)]
Implement the phy-mode property for ate and macb. If it is set to
"rmii", use rmii mode for the MAC, otherwise use MII mode. The code is
somewhat duplicated between these drivers for this.

Also, add AT91RM9200 compatibility strings to the ate driver. In the
future, there's a good chance that ate will lose the MACB support and
only attach to the AT91RM9200 EMAC device since the macb works now
that RMII support has been added to it.

8 years agoperiodic: Fix backwards compatibility for daily_status_security_* vars.
jilles [Sat, 7 Nov 2015 22:06:49 +0000 (22:06 +0000)]
periodic: Fix backwards compatibility for daily_status_security_* vars.

Most daily_status_security_* variables in periodic.conf were changed to
security_status_* in SVN r254974. The compatibility code for the old names
did not work.

PR: 204331
Submitted by: martin at lispworks.com
MFC after: 1 week

8 years agoRewrite the histoty part
bapt [Sat, 7 Nov 2015 21:07:40 +0000 (21:07 +0000)]
Rewrite the histoty part
Fix information about "Dragonfly-style" format which on freebsd is named
BSD-style

Noted by: bdrewery

8 years agoImprove localedef(1) manpage
bapt [Sat, 7 Nov 2015 20:36:54 +0000 (20:36 +0000)]
Improve localedef(1) manpage

Obtained from: DragonflyBSD

8 years agoBump warning level
bapt [Sat, 7 Nov 2015 20:31:23 +0000 (20:31 +0000)]
Bump warning level

8 years agoUse const where needed instead of using pragmas to work around the warnings
bapt [Sat, 7 Nov 2015 20:29:23 +0000 (20:29 +0000)]
Use const where needed instead of using pragmas to work around the warnings

8 years agoMake bsd declaration static
bapt [Sat, 7 Nov 2015 20:27:31 +0000 (20:27 +0000)]
Make bsd declaration static

8 years agoAdd support for RMII in macb, cribbed slightly from the ate
imp [Sat, 7 Nov 2015 20:02:07 +0000 (20:02 +0000)]
Add support for RMII in macb, cribbed slightly from the ate
driver. This is taken from the MAC at boot, but can be overridden with
'options AT91_MACB_USE_RMII'.

Switch to macb for HL201 and SAM9G20EK boards. It now works both
places. Also start to sneak up on FDT for the SAM9G20EK board, but
leave disabled due to issues with MMC that haven't been resolved.
Add early debug support for the SAM9G20EK since that is required
for FDT to work presently on these SoC.

8 years agoFix an off by one due to bad conversion from avl(3) to tree(3)
bapt [Sat, 7 Nov 2015 19:54:40 +0000 (19:54 +0000)]
Fix an off by one due to bad conversion from avl(3) to tree(3)
Readd calloc as it was not the issue just the messenger

Submitted by: dim
Found by: Address Sanitizer

8 years agoRework r290504.
mav [Sat, 7 Nov 2015 19:33:57 +0000 (19:33 +0000)]
Rework r290504.

8 years agoSpecify VP when sending a marker.
mav [Sat, 7 Nov 2015 19:03:47 +0000 (19:03 +0000)]
Specify VP when sending a marker.

8 years agoFlesh out sysctl types further (follow-up of r290475)
cem [Sat, 7 Nov 2015 18:26:32 +0000 (18:26 +0000)]
Flesh out sysctl types further (follow-up of r290475)

Use the right intmax_t type instead of intptr_t in a few remaining
places.

Add support for CTLFLAG_TUN for the new fixed with types.  Bruce will be
upset that the new handlers silently truncate tuned quad-sized inputs,
but so do all of the existing handlers.

Add the new types to debug_dump_node, for whatever use that is.

Bump FreeBSD_version again, for good measure.  We are changing
SYSCTL_HANDLER_ARGS and a member of struct sysctl_oid to intmax_t.

Correct the sysctl typed NULL values for the fixed-width types.  (Hat
tip: hps@.)

Suggested by: hps (partial)
Sponsored by: EMC / Isilon Storage Division

8 years agoMake ISP_SLEEP() really sleep instead of spinning.
mav [Sat, 7 Nov 2015 18:26:02 +0000 (18:26 +0000)]
Make ISP_SLEEP() really sleep instead of spinning.

While there, simplify the wait logic.

8 years agoAdd a note about the inpact on databases of the changes in collation support
bapt [Sat, 7 Nov 2015 17:54:51 +0000 (17:54 +0000)]
Add a note about the inpact on databases of the changes in collation support

Reported by: girgen

8 years agoRun memset only after having checked the return of malloc
bapt [Sat, 7 Nov 2015 16:45:51 +0000 (16:45 +0000)]
Run memset only after having checked the return of malloc

Submitted by: pluknet

8 years agoWorkaround an issue on i386 to unbreak the build until the real issue is tracked
bapt [Sat, 7 Nov 2015 16:22:29 +0000 (16:22 +0000)]
Workaround an issue on i386 to unbreak the build until the real issue is tracked
down