]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoAdd in DIRDEPS_BUILD support.
bdrewery [Thu, 7 Jan 2016 00:19:30 +0000 (00:19 +0000)]
Add in DIRDEPS_BUILD support.

Sponsored by: EMC / Isilon Storage Division

8 years agoMove the MAKEOBJDIRPREFIX value guard to sys.mk and expand to MAKEOBJDIR.
bdrewery [Thu, 7 Jan 2016 00:19:03 +0000 (00:19 +0000)]
Move the MAKEOBJDIRPREFIX value guard to sys.mk and expand to MAKEOBJDIR.

This will ensure that the variable was not set as a make override, in
make.conf, src.conf or src-env.conf.  It allows setting the value in
src-env.conf when using WITH_AUTO_OBJ since that case properly handles
changing .OBJDIR (except if MAKEOBJDIRPREFIX does not yet exist which is
being discussed to be changed).

This change allows setting a default MAKEOBJDIRPREFIX via local.sys.env.mk.

Sponsored by: EMC / Isilon Storage Division

8 years agoSwitch GNU ld to be installed as ld.bfd and linked as ld
emaste [Thu, 7 Jan 2016 00:15:02 +0000 (00:15 +0000)]
Switch GNU ld to be installed as ld.bfd and linked as ld

We intend to replace GNU ld with LLVM's lld, and on the path to there
we'll experiment with having lld installed or linked as /usr/bin/ld.
Thus, make ld.bfd the primary install target for GNU ld, to later
facilitate making the ld link optional.

Reviewed by: davide, dim
Differential Revision: https://reviews.freebsd.org/D4790

8 years agoHistorically we have two fields in tcpcb to describe sender MSS: t_maxopd,
glebius [Thu, 7 Jan 2016 00:14:42 +0000 (00:14 +0000)]
Historically we have two fields in tcpcb to describe sender MSS: t_maxopd,
and t_maxseg. This dualism emerged with T/TCP, but was not properly cleaned
up after T/TCP removal. After all permutations over the years the result is
that t_maxopd stores a minimum of peer offered MSS and MTU reduced by minimum
protocol header. And t_maxseg stores (t_maxopd - TCPOLEN_TSTAMP_APPA) if
timestamps are in action, or is equal to t_maxopd otherwise. That's a very
rough estimate of MSS reduced by options length. Throughout the code it
was used in places, where preciseness was not important, like cwnd or
ssthresh calculations.

With this change:

- t_maxopd goes away.
- t_maxseg now stores MSS not adjusted by options.
- new function tcp_maxseg() is provided, that calculates MSS reduced by
  options length. The functions gives a better estimate, since it takes
  into account SACK state as well.

Reviewed by: jtl
Differential Revision: https://reviews.freebsd.org/D3593

8 years agoProvide knob NO_INSTALLEXTRAKERNELS. If defined, extra kernels in KERNCONF
glebius [Wed, 6 Jan 2016 21:58:45 +0000 (21:58 +0000)]
Provide knob NO_INSTALLEXTRAKERNELS. If defined, extra kernels in KERNCONF
won't be installed, only the first one would.

8 years agoUse standard name for ASCII LF and FF control codes
emaste [Wed, 6 Jan 2016 21:47:49 +0000 (21:47 +0000)]
Use standard name for ASCII LF and FF control codes

PR: 205778
MFC after: 2 weeks

8 years agostyle(9) fixes for EFI boot
smh [Wed, 6 Jan 2016 20:48:29 +0000 (20:48 +0000)]
style(9) fixes for EFI boot

Fix some style(9) nits for EFI boot code, no functional changes.

MFC after: 2 weeks
X-MFC-With: r293268
Sponsored by: Multiplay

8 years agoFix const conversion warning in lz4_decompress
smh [Wed, 6 Jan 2016 20:28:09 +0000 (20:28 +0000)]
Fix const conversion warning in lz4_decompress

Fix const conversion warning in lz4_decompress which shows when warnings
are enabled (to be done later).

MFC after: 2 weeks
X-MFC-With: r293268
Sponsored by: Multiplay

8 years agoFix return from zfs_probe_dev
smh [Wed, 6 Jan 2016 20:25:41 +0000 (20:25 +0000)]
Fix return from zfs_probe_dev

Ensure zfs_probe_dev returns the correct value.

Also fix a style(9) trailing whitespace issue while here.

MFC after: 2 weeks
X-MFC-With: r293268
Sponsored by: Multiplay

8 years agoFix _MSC_EXTENSIONS checks
smh [Wed, 6 Jan 2016 20:22:28 +0000 (20:22 +0000)]
Fix _MSC_EXTENSIONS checks

Use #ifdef instead of #if checks to prevent warnings generated by checks
to be enabled shortly.

MFC after: 2 weeks
Sponsored by: Multiplay

8 years agolibunwind: Include header for dl_unwind_find_exidx for ARM EHABI
emaste [Wed, 6 Jan 2016 19:41:06 +0000 (19:41 +0000)]
libunwind: Include header for dl_unwind_find_exidx for ARM EHABI

8 years agoloader.efi style(9) cleanup
emaste [Wed, 6 Jan 2016 19:18:43 +0000 (19:18 +0000)]
loader.efi style(9) cleanup

Submitted by: smh

8 years agoIntroduce and use new EFI_ERROR_CODE macro for EFI errors
emaste [Wed, 6 Jan 2016 19:15:16 +0000 (19:15 +0000)]
Introduce and use new EFI_ERROR_CODE macro for EFI errors

Submitted by: smh
MFC after: 1 week

8 years agoAdd fls() to libstand
emaste [Wed, 6 Jan 2016 17:33:32 +0000 (17:33 +0000)]
Add fls() to libstand

Although we don't use it in tree yet libstand is installed as user-
facing /usr/liblibstand.a, and some work in progress makes use of it.
Instead of conflicting with ongoing libstand Makefile deduplication,
just add it now.

8 years agoTry a little harder to remove firstboot and firstboot-reboot files in
imp [Wed, 6 Jan 2016 17:13:40 +0000 (17:13 +0000)]
Try a little harder to remove firstboot and firstboot-reboot files in
case they accidentally get created as directories or with flags that
prevent their removal. While I wouldn't normally go the extra mile
here and let the normal unix rules prevail, the effects of failure are
large enough that extra care is warranted.

8 years agoEnable the beastie menu for the UEFI console
emaste [Wed, 6 Jan 2016 15:50:21 +0000 (15:50 +0000)]
Enable the beastie menu for the UEFI console

As of r293233 the UEFI console includes basic terminal emulator support.

MFC after: 2 weeks
Relnotes: Yes

8 years agoloader.efi: add terminal emulation support
emaste [Wed, 6 Jan 2016 15:38:39 +0000 (15:38 +0000)]
loader.efi: add terminal emulation support

This is based on the vidconsole implementation.

Submitted by: Toomas Soome <tsoome@me.com>
Reviewed by: adrian
MFC after: 2 weeks
Relnotes: Yes
Differential Revision: https://reviews.freebsd.org/D4797

8 years agoAdd a new target to touch the ${.OBJDIR}/release file, which
gjb [Wed, 6 Jan 2016 05:23:25 +0000 (05:23 +0000)]
Add a new target to touch the ${.OBJDIR}/release file, which
indicates the 'release' target has run (in order to prevent
subsequent invocations that may clobber original build output).

As is, the 'release' target is a dummy target that does nothing
more than depend on subsequent targets.  Unless 'make obj' is
invoked prior to 'make release', .OBJDIR and .CURDIR will always
be '/usr/src/release' (or wherever /usr/src is located).

When 'make release' invokes 'make real-release' (and subsequent
targets), .OBJDIR is not updated, which still leads to src/ tree
pollution.

While arguably a hack, 'make release' will invoke the original
dummy targets as originally intended, but instead of touching an
empty file (or returing @true), will call a 'release-done' target
that will trigger the behavior that was intended to prevent
a subsequent invocation.

Discussed with: hrs
MFC after: 3 days
X-MFC-With: r293173
Sponsored by: The FreeBSD Foundation

8 years ago"source routing" in rpcbind
asomers [Wed, 6 Jan 2016 00:00:11 +0000 (00:00 +0000)]
"source routing" in rpcbind

Fix a bug in rpcbind for multihomed hosts. If the server had interfaces on
two separate subnets, and a client on the first subnet contacted rpcbind at
the address on the second subnet, rpcbind would advertise addresses on the
first subnet. This is a bug, because it should prefer to advertise the
address where it was contacted. The requested service might be firewalled
off from the address on the first subnet, for example.

usr.sbin/rpcbind/check_bound.c
If the address on which a request was received is known, pass that
to addrmerge as the clnt_uaddr parameter. That is what addrmerge's
comment indicates the parameter is supposed to mean. The previous
behavior is that clnt_uaddr would contain the address from which the
client sent the request.

usr.sbin/rpcbind/util.c
Modify addrmerge to prefer to use an IP that is equal to clnt_uaddr,
if one is found. Refactor the relevant portion of the function for
clarity, and to reduce the number of ifdefs.

etc/mtree/BSD.tests.dist
usr.sbin/rpcbind/tests/Makefile
usr.sbin/rpcbind/tests/addrmerge_test.c
Add unit tests for usr.sbin/rpcbind/util.c:addrmerge.

usr.sbin/rpcbind/check_bound.c
usr.sbin/rpcbind/rpcbind.h
usr.sbin/rpcbind/util.c
Constify some function arguments

Reviewed by: imp
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D4690

8 years agoUse the more proper -f. Leave /bin/rm in place since that's what
imp [Tue, 5 Jan 2016 21:20:47 +0000 (21:20 +0000)]
Use the more proper -f. Leave /bin/rm in place since that's what
other rc scripts have, though it isn't strictly necessary.

8 years agoDisable abi variant hook until strangeness with packages can be sorted
imp [Tue, 5 Jan 2016 21:20:46 +0000 (21:20 +0000)]
Disable abi variant hook until strangeness with packages can be sorted
out.

8 years agoMerge ^/projects/release-install-debug:
gjb [Tue, 5 Jan 2016 21:05:17 +0000 (21:05 +0000)]
Merge ^/projects/release-install-debug:

- Rework MANIFEST generation and parsing via bsdinstall(8).
- Allow selecting debugging distribution sets during install.
- Rework bsdinstall(8) to fetch remote debug distribution sets
  when they are not available on the local install medium.
- Allow selecting additional non-GENERIC kernels during install.
  At present, GENERIC is still required, and installed by default.

Tested with: head@r293203
Sponsored by: The FreeBSD Foundation

8 years agoioat(4): Add ioat_get_max_io_size() KPI
cem [Tue, 5 Jan 2016 20:42:19 +0000 (20:42 +0000)]
ioat(4): Add ioat_get_max_io_size() KPI

Consumers need to know the permitted IO size to send maximally sized
chunks to the hardware.

Sponsored by: EMC / Isilon Storage Division

8 years agoiwm: revert r293178
avos [Tue, 5 Jan 2016 20:09:26 +0000 (20:09 +0000)]
iwm: revert r293178

This optimization is not proper (and causes kernel panic),
since driver checks fw_status to optimize away parsing stage
if it was already done.

Reported by: dchagin

8 years agoAdd sbin and /usr/local directories to _PATH_DEFPATH.
jilles [Tue, 5 Jan 2016 16:21:20 +0000 (16:21 +0000)]
Add sbin and /usr/local directories to _PATH_DEFPATH.

Set _PATH_DEFPATH to
/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin. This is the
path in the default class in the default /etc/login.conf,
excluding ~/bin which would not be expanded properly in a string
constant.

For normal logins, _PATH_DEFPATH is overridden by /etc/login.conf,
~/.login_conf or shell startup files. _PATH_DEFPATH is still used as a
default by execlp(), execvp(), posix_spawnp() and sh if PATH is not set, and
by cron. Especially the latter is a common trap (most recently in PR
204813).

PR: 204813
Reviewed by: secteam (delphij), alfred

8 years agortld: populate DT_DEBUG iff DYNAMIC segment is writable
emaste [Tue, 5 Jan 2016 15:55:45 +0000 (15:55 +0000)]
rtld: populate DT_DEBUG iff DYNAMIC segment is writable

rtld.h was accidentally missed in r293201

8 years agortld: populate DT_DEBUG iff DYNAMIC segment is writable
emaste [Tue, 5 Jan 2016 15:52:16 +0000 (15:52 +0000)]
rtld: populate DT_DEBUG iff DYNAMIC segment is writable

MIPS has/had a read-only DYNAMIC segment, and uses an extra level of
indirection (through MIPS_RLD_MAP) to locate the debugger rendezvous
data.

Some linkers (e.g. LLVM's lld) may produce MIPS binaries with a writable
DYNAMIC segment, which would allow us to eventually drop a special case.

Therefore, instead of hardcoding knowledge that DYNAMIC is not writable
on MIPS just check the permissions on the segment.

Reviewed by: kib
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D4791

8 years agoTwo fixes for excessive iterations after r292326.
kib [Tue, 5 Jan 2016 14:48:40 +0000 (14:48 +0000)]
Two fixes for excessive iterations after r292326.

Advance the logical block number to the lblkno of the found block plus
one, instead of incrementing the block number which was used for
lookup.  This change skips sparcely populated buffer ranges, similar
to r292325, instead of doing useless lookups.

Do not restart the bnoreuselist() from the start of the range if
buffer lock cannot be obtained without sleep.  Only retry lookup and
lock for the same queue and same logical block number.

Reported by: benno
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 3 days

8 years agoImplement RCU mechanism using shared exclusive locks.
hselasky [Tue, 5 Jan 2016 12:22:45 +0000 (12:22 +0000)]
Implement RCU mechanism using shared exclusive locks.

MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoFix undefined behavior when using asmc_fan_getstring()
uqs [Tue, 5 Jan 2016 10:25:22 +0000 (10:25 +0000)]
Fix undefined behavior when using asmc_fan_getstring()

It was returning a pointer to stack-allocated memory, so make the
allocation at the caller instead.

Found by: clang static analyzer
Coverity: CID 1245774
Reviewed by: ed, rpaulo
Review URL: https://reviews.freebsd.org/D4740

8 years agoFix for directly connected FULL or LOW speed USB devices.
hselasky [Tue, 5 Jan 2016 09:18:43 +0000 (09:18 +0000)]
Fix for directly connected FULL or LOW speed USB devices.

Found by: Sebastian Huber <sebastian.huber@embedded-brains.de>
MFC after: 1 week

8 years agoMFV r293125: less v481.
delphij [Tue, 5 Jan 2016 05:25:16 +0000 (05:25 +0000)]
MFV r293125: less v481.

MFC after: 1 month
Relnotes: yes

8 years agoPrevent memstick installation medium from attempting to mount
gjb [Tue, 5 Jan 2016 03:20:45 +0000 (03:20 +0000)]
Prevent memstick installation medium from attempting to mount
the root filesystem read-write.  This causes problems booting
the memstick installation medium from write-protected USB flash
drives.

Submitted by: A.J. Kehoe IV [1], Oliver Jones [2]
PR: 187161 [1], 205886 [2]
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

8 years agortld: wrap a comment to 80 columns
emaste [Tue, 5 Jan 2016 02:21:57 +0000 (02:21 +0000)]
rtld: wrap a comment to 80 columns

8 years agoHave krping use IB_ACCESS_LOCAL_WRITE because it's required for remote
np [Tue, 5 Jan 2016 01:58:30 +0000 (01:58 +0000)]
Have krping use IB_ACCESS_LOCAL_WRITE because it's required for remote
write or remote atomic operations.

Submitted by: Krishnamraju Eraparaju @ Chelsio

8 years agoiw_cxgbe: Shut down the socket but do not close the fd in case of error.
np [Tue, 5 Jan 2016 01:32:40 +0000 (01:32 +0000)]
iw_cxgbe: Shut down the socket but do not close the fd in case of error.
The fd is closed later in this case.  This fixes a "SS_NOFDREF on enter"
panic.

Submitted by: Krishnamraju Eraparaju @ Chelsio
Reviewed by: Steve Wise @ Open Grid Computing

8 years agoMerge LLVM libunwind revision 256779
emaste [Mon, 4 Jan 2016 21:41:02 +0000 (21:41 +0000)]
Merge LLVM libunwind revision 256779

8 years agourtwn: add bits for R92C_HWSEQ_CTRL and R92C_TXPAUSE registers
avos [Mon, 4 Jan 2016 21:16:49 +0000 (21:16 +0000)]
urtwn: add bits for R92C_HWSEQ_CTRL and R92C_TXPAUSE registers

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

8 years agoiwn: reduce code duplication in iwn_read_firmware()
avos [Mon, 4 Jan 2016 21:11:27 +0000 (21:11 +0000)]
iwn: reduce code duplication in iwn_read_firmware()

- Separate 'firmware_put(sc->fw_fp, FIRMWARE_UNLOAD); sc->fw_fp = NULL;'
into iwn_unload_firmware().
- Move error handling to the end of iwn_read_firmware().

No functional changes.

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

8 years agoiwm: free firmware related resources after uploading it to the hardware
avos [Mon, 4 Jan 2016 21:07:08 +0000 (21:07 +0000)]
iwm: free firmware related resources after uploading it to the hardware

iwn(4) / wpi(4) works in the same way
(read_firmware() -> hw_init() -> firmware_put())

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

8 years agoiwm: store pointer for 'struct firmware' instead of
avos [Mon, 4 Jan 2016 21:03:01 +0000 (21:03 +0000)]
iwm: store pointer for 'struct firmware' instead of
'size_t' and 'void *' pair.

Approved by: adrian (mentor)
Obtained from: DragonFlyBSD
Differential Revision: https://reviews.freebsd.org/D4765

8 years agoGet struct sctp_net_route in sync with struct route again.
tuexen [Mon, 4 Jan 2016 20:34:40 +0000 (20:34 +0000)]
Get struct sctp_net_route in sync with struct route again.

8 years agoFix path to include .OBJDIR to avoid polluting the source
gjb [Mon, 4 Jan 2016 19:38:44 +0000 (19:38 +0000)]
Fix path to include .OBJDIR to avoid polluting the source
tree during 'make release'.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

8 years agoDon't build rtwnfw if building without binary blobs.
brueffer [Mon, 4 Jan 2016 19:04:33 +0000 (19:04 +0000)]
Don't build rtwnfw if building without binary blobs.

rtwnfw got added in r293009 and depends on source-less and
non-free microcode in sys/contrib/dev/rtwn.

PR: 205874
Submitted by: Fabian Keil
Obtained from: ElectroBSD

8 years agoAdd rtwn(4) to the hardware list.
brueffer [Mon, 4 Jan 2016 18:34:27 +0000 (18:34 +0000)]
Add rtwn(4) to the hardware list.

8 years agoFinish r293098: make ip6_getpmtu() and ip6_getpmtu_ctl() use new routing API
melifaro [Mon, 4 Jan 2016 18:32:24 +0000 (18:32 +0000)]
Finish r293098: make ip6_getpmtu() and ip6_getpmtu_ctl() use new routing API

8 years agoFix a memory leak in gss_release_oid_set
dfr [Mon, 4 Jan 2016 17:42:12 +0000 (17:42 +0000)]
Fix a memory leak in gss_release_oid_set

8 years agoFix route lookup condition: do IPv6 route lookup for source based on
melifaro [Mon, 4 Jan 2016 17:25:32 +0000 (17:25 +0000)]
Fix route lookup condition: do IPv6 route lookup for source based on
  NG_NETFLOW_CONF_NOSRCLOOKUP instead of NG_NETFLOW_CONF_NODSTLOOKUP.

8 years agoMaintain consistent behavior: make fib4_lookup_nh_ext() return
melifaro [Mon, 4 Jan 2016 17:23:10 +0000 (17:23 +0000)]
Maintain consistent behavior: make fib4_lookup_nh_ext() return
  rt_ifp pointer by default, as done by other fib lookup functions.

8 years agoloader.efi: support non-contiguous console modes
emaste [Mon, 4 Jan 2016 17:22:06 +0000 (17:22 +0000)]
loader.efi: support non-contiguous console modes

Submitted by: Toomas Soome <tsoome@me.com>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D4760

8 years ago[net80211] fix duration field; it's unsigned, but not long.
adrian [Mon, 4 Jan 2016 17:17:06 +0000 (17:17 +0000)]
[net80211] fix duration field; it's unsigned, but not long.

Submitted by: Imre Vadasz <imre@vdsz.com>
Obtained from: DragonflyBSD

8 years agoAdd rib_lookup_info() to provide API for retrieving individual route
melifaro [Mon, 4 Jan 2016 15:03:20 +0000 (15:03 +0000)]
Add rib_lookup_info() to provide API for retrieving individual route
  entries data in unified format.

There are control plane functions that require information other than
  just next-hop data (e.g. individual rtentry fields like flags or
  prefix/mask). Given that the goal is to avoid rte reference/refcounting,
  re-use rt_addrinfo structure to store most rte fields. If caller wants
  to retrieve key/mask or gateway (which are sockaddrs and are allocated
  separately), it needs to provide sufficient-sized sockaddrs structures
  w/ ther pointers saved in passed rt_addrinfo.

Convert:
  * lltable new records checks (in_lltable_rtcheck(),
    nd6_is_new_addr_neighbor().
  * rtsock pre-add/change route check.
  * IPv6 NS ND-proxy check (RADIX_MPATH code was eliminated because
     1) we don't support RTF_ANNOUNCE ND-proxy for networks and there should
       not be multiple host routes for such hosts 2) if we have multiple
       routes we should inspect them (which is not done). 3) the entire idea
       of abusing KRT as storage for ND proxy seems odd. Userland programs
       should be used for that purpose).

8 years agoRemove free'ing of an uninitialized variable
ngie [Mon, 4 Jan 2016 03:34:22 +0000 (03:34 +0000)]
Remove free'ing of an uninitialized variable

Just remove it completely from the test as it's initialized but unused apart
from the free(3) call

Differential Revision: https://reviews.freebsd.org/D4769 (part of larger diff)
MFC after: 5 days
Reported by: cppcheck
Reviewed by: oshogbo
Sponsored by: EMC / Isilon Storage Division

8 years agoUse `nitems(x)` macro instead of using hardcoded numbers for indices into
ngie [Mon, 4 Jan 2016 03:26:36 +0000 (03:26 +0000)]
Use `nitems(x)` macro instead of using hardcoded numbers for indices into
the nvlists

Convert some of the variables from int to unsigned int to squelch -Wsign-compare
warnings when converting hardcoded values to nitems(..)

Differential Revision: https://reviews.freebsd.org/D4769 (part of larger diff)
MFC after: 5 days
Reviewed by: oshogbo
Sponsored by: EMC / Isilon Storage Division

8 years agoConvert another `string` variable to `string_arr` missed in r293130
ngie [Mon, 4 Jan 2016 03:12:18 +0000 (03:12 +0000)]
Convert another `string` variable to `string_arr` missed in r293130

Differential Revision: https://reviews.freebsd.org/D4769 (part of larger diff)
MFC after: 5 days
Reviewed by: oshogbo
Sponsored by: EMC / Isilon Storage Division

8 years agoRename nitems and string variables to avoid collisions
ngie [Mon, 4 Jan 2016 03:02:44 +0000 (03:02 +0000)]
Rename nitems and string variables to avoid collisions

Rename the `nitems` variable to `num_items` to avoid collisions with the
macro in sys/param.h for counting elements in an array

Similarly, rename `string` to `string_arr` to avoid future collisions with
potential keywords, as well as make it clear that `string_arr` isn't a char*
value, but instead a char** value.

Differential Revision: https://reviews.freebsd.org/D4769 (part of larger diff)
MFC after: 5 days
Reviewed by: oshogbo
Sponsored by: EMC / Isilon Storage Division

8 years agoMake arguments for booke_init() u_long, to match register width.
jhibbits [Mon, 4 Jan 2016 02:20:14 +0000 (02:20 +0000)]
Make arguments for booke_init() u_long, to match register width.

On powerpc64, pointers are 64 bits, so casting from uint32_t changes the integer
width.

The alternative was to use register_t, but I didn't see register_t used as
argument type for any other functions, though didn't look too closely.  u_long
was an acceptable alternative.  On 64-bit it's 64 bits, on 32-bit it's 32 bits.

8 years agoSet the cacheline size before calling powerpc_init()
jhibbits [Mon, 4 Jan 2016 01:33:07 +0000 (01:33 +0000)]
Set the cacheline size before calling powerpc_init()

powerpc_init() initializes the mmu.  Since this may clear pages via
pmap_zero_page(), set the cacheline size before calling into it, so
pmap_zero_page() has the right cacheline size.  This isn't completely
necessary now, but will be when 64-bit book-e is completed.

8 years agoVendor import of less v481.
delphij [Mon, 4 Jan 2016 00:22:34 +0000 (00:22 +0000)]
Vendor import of less v481.

8 years agosh: Link tests/builtins/getopts9.0 to the build.
jilles [Sun, 3 Jan 2016 22:16:27 +0000 (22:16 +0000)]
sh: Link tests/builtins/getopts9.0 to the build.

This was forgotten in r273700.

8 years agoiwm: use m_collapse() to defragment a mbuf chain
avos [Sun, 3 Jan 2016 21:32:47 +0000 (21:32 +0000)]
iwm: use m_collapse() to defragment a mbuf chain

- Simplify defragmentation code.
- Use proper number of dma segments for data.

Approved by: adrian (mentor)
Obtained from: DragonFlyBSD (mostly)
Differential Revision: https://reviews.freebsd.org/D4754

8 years agosh: Reduce size of builtins table.
jilles [Sun, 3 Jan 2016 21:30:22 +0000 (21:30 +0000)]
sh: Reduce size of builtins table.

8 years agoUse /bin/rm to remove /firstboot*. Otherwise rm -i alias is picked
imp [Sun, 3 Jan 2016 19:18:48 +0000 (19:18 +0000)]
Use /bin/rm to remove /firstboot*. Otherwise rm -i alias is picked
up and can cause issues on boot with the prompts. Fix the read-only
root case with horrible kludge of mounting rw removing the files, then
mounting ro. But since that's no more horrible than the kludge of
using marker files in /. With this change, NanoBSD configs can safely
use /firstboot + growfs to produce minimal images that grow to the
size of the card.

8 years agoFix ixl(4) compilation with PCI_IOV pre-r266974
ngie [Sun, 3 Jan 2016 18:09:46 +0000 (18:09 +0000)]
Fix ixl(4) compilation with PCI_IOV pre-r266974

stable/10 doesn't have the if_getdrvflags(9) KPI. Reference the field in the
structure directly if the __FreeBSD_version is < 1100022, so the driver can
be built with PCI_IOV support on stable/10, without backporting all of
r266974 (which requires additional changes due to projects/ifnet, etc)

Differential Revision: https://reviews.freebsd.org/D4759
Reviewed by: erj, sbruno
Sponsored by: EMC / Isilon Storage Division

8 years ago[ath] remove the inline version of the register access macros.
adrian [Sun, 3 Jan 2016 17:58:11 +0000 (17:58 +0000)]
[ath] remove the inline version of the register access macros.

These are going to be much more efficient on low end embedded systems
but unfortunately they make it .. less convenient to implement correct
bus barriers and debugging.  They also didn't implement the register
serialisation workaround required for Owl (AR5416.)

So, just remove them for now.  Later on I'll just inline the routines
from ah_osdep.c.

8 years agoFix fib4_lookup_nh_ext() flags/flowid order messed up while merging.
melifaro [Sun, 3 Jan 2016 16:13:03 +0000 (16:13 +0000)]
Fix fib4_lookup_nh_ext() flags/flowid order messed up while merging.

8 years agoInitialize the rid for input.
jhibbits [Sun, 3 Jan 2016 15:35:01 +0000 (15:35 +0000)]
Initialize the rid for input.

Left uninitialized, random rid causes the IRQ setup to fail, and the PCI device
to not be attached.

8 years agoAdd error interrupt handler for Freescale PCI errors
jhibbits [Sun, 3 Jan 2016 15:24:57 +0000 (15:24 +0000)]
Add error interrupt handler for Freescale PCI errors

This eliminates a 'interrupt storm' warning spam with the P5020.

Obtained from: Semihalf

8 years agoEliminate code for walking through the early static env data. This code
ian [Sun, 3 Jan 2016 14:46:19 +0000 (14:46 +0000)]
Eliminate code for walking through the early static env data.  This code
is called from a device attach routine, and thus cannot be called before
the cutover from static to dynamic kernel env.

8 years agoStore the pointer to the bootloader-provided env data in a static var
ian [Sun, 3 Jan 2016 14:42:28 +0000 (14:42 +0000)]
Store the pointer to the bootloader-provided env data in a static var
for use in debug printing.

8 years agoAdd sys/types.h for for size_t, etc
ngie [Sun, 3 Jan 2016 11:22:15 +0000 (11:22 +0000)]
Add sys/types.h for for size_t, etc

stable/10 requires it due to header pollution

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

8 years agoRemove 'struct route_int6' argument from in6_selectsrc() and
melifaro [Sun, 3 Jan 2016 10:43:23 +0000 (10:43 +0000)]
Remove 'struct route_int6' argument from in6_selectsrc() and
  in6_selectif().

The main task of in6_selectsrc() is to return IPv6 SAS (along with
  output interface used for scope checks). No data-path code uses
  route argument for caching. The only users are icmp6 (reflect code),
  ND6 ns/na generation code. All this fucntions are control-plane, so
  there is no reason to try to 'optimize' something by passing cached
  route into to ip6_output(). Given that, simplify code by eliminating
  in6_selectsrc() 'struct route_in6' argument. Since in6_selectif() is
  used only by in6_selectsrc(), eliminate its 'struct route_in6' argument,
  too. While here, reshape rte-related code inside in6_selectif() to
  free lookup result immediately after saving all the needed fields.

8 years agoiwm: convert to ieee80211_tx_complete()
avos [Sun, 3 Jan 2016 10:10:11 +0000 (10:10 +0000)]
iwm: convert to ieee80211_tx_complete()

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

8 years agoiwm: reorganize if_iwmvar.h
avos [Sun, 3 Jan 2016 10:06:10 +0000 (10:06 +0000)]
iwm: reorganize if_iwmvar.h

- Change order of data in if_iwmvar.h
(like it is in other drivers: defines, data structures,
vap/node structures, softc struct and locks); use indentation.
- Fix IWM_LOCK(_sc) / IWM_UNLOCK(_sc) macro.
- Add IWM_LOCK_INIT / DESTROY(sc) + fix mtx_init() usage.
- Wrap iwm_node casts into IWM_NODE() macro.
- Drop some fields:
 * wt_hwqueue from Tx radiotap header;
 * macaddr[6] from iwm_vap;

Approved by: adrian
Differential Revision: https://reviews.freebsd.org/D4753

8 years agoHandle IPV6_PATHMTU option by spliting ip6_getpmtu_ctl() from ip6_getpmtu().
melifaro [Sun, 3 Jan 2016 09:54:03 +0000 (09:54 +0000)]
Handle IPV6_PATHMTU option by spliting ip6_getpmtu_ctl() from ip6_getpmtu().
Add ro_mtu field to 'struct route' to be able to pass lookup MTU back to
  the caller.

Currently, ip6_getpmtu() has 2 totally different use cases:
1) control plane (IPV6_PATHMTU req), where we just need to calculate MTU
  and return it, w/o any reusability.
2) Actual ip6_output() data path where we (nearly) always use the provided
  route lookup data. If this data is not 'valid' we need to perform another
  lookup and save the result (which cannot be re-used by ip6_output()).

Given that, handle 1) by calling separate function doing rte lookup itself.
  Resulting MTU is calculated by (newly-added) ip6_calcmtu() used by both
  ip6_getpmtu_ctl() and ip6_getpmtu().
For 2) instead of storing ref'ed rte, store mtu (the only needed data
  from the lookup result) inside newly-added ro_mtu field.
  'struct route' was shrinked by 8(or 4 bytes) in r292978. Grow it again
  by 4 bytes. New ro_mtu field will be used in other places like
  ip/tcp_output (EMSGSIZE handling from output routines).

Reviewed by: ae

8 years agoRevert r293070
ngie [Sun, 3 Jan 2016 08:48:23 +0000 (08:48 +0000)]
Revert r293070

It seems that `options GZIP` and `options ZFS` collide because they both
define inconsistent definitions for inflate, etc

Fixing this will require upgrading zlib in the kernel, as suggested in
r245102.

Pointyhat to: ngie
Reported by: bz
Sponsored by: EMC / Isilon Storage Division

8 years ago- Use attach_md instead of hardcoding md(4) provider unit numbers
ngie [Sun, 3 Jan 2016 06:02:56 +0000 (06:02 +0000)]
- Use attach_md instead of hardcoding md(4) provider unit numbers
- Implement a gmirror_test_cleanup function, which in turn calls
  geom_test_cleanup to clean up all md(4) providers allocated in the test
  run.
- Remove duplicate logic in test scripts for removing md(4) providers.
- Don't create files in /tmp (outside the kyua sandbox); use the current
  directory instead

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

8 years agoAdd "options ZFS" to NOTES so this will be tested with the LINT
ngie [Sun, 3 Jan 2016 04:38:17 +0000 (04:38 +0000)]
Add "options ZFS" to NOTES so this will be tested with the LINT
KERNCONF when "make tinderbox" is run

This will help ensure that "options ZFS" will not be accidentally
regressed, as the current LINT configuration tests the zfs module

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

8 years agoIf md_exec_hook is defined, provide a way to create the strings
imp [Sun, 3 Jan 2016 04:32:13 +0000 (04:32 +0000)]
If md_exec_hook is defined, provide a way to create the strings
for the environment variables we look up at runtime. Otherwise,
there's no way they will change, optimize it at compile time.

Differential Review: https://reviews.freebsd.org/D2718

8 years agoAdd libsoft to the tree, just like lib32.
imp [Sun, 3 Jan 2016 04:32:05 +0000 (04:32 +0000)]
Add libsoft to the tree, just like lib32.

8 years agoAdd new LIBSOFT option. This is similar to the LIB32 option, except
imp [Sun, 3 Jan 2016 04:32:04 +0000 (04:32 +0000)]
Add new LIBSOFT option. This is similar to the LIB32 option, except
for libraries that follow the soft float ABI. It's only supported on
armv6 as a transition to the new hard float ABI, so mark as broken
everywhere else.

8 years agoCreate a generalized exec hook that different architectures can hook
imp [Sun, 3 Jan 2016 04:32:02 +0000 (04:32 +0000)]
Create a generalized exec hook that different architectures can hook
into if they need to, but default to no action.

Differential Review: https://reviews.freebsd.org/D2718

8 years agoReword the comment to better describe what I found while researching the
ian [Sat, 2 Jan 2016 23:14:52 +0000 (23:14 +0000)]
Reword the comment to better describe what I found while researching the
problem that led to this temporary workaround (and also so I can properly
cite the PR in the commit this time).

In general this is intended to be a temporary workaround until we can figure
out why including any ram from the last megabyte of the physical address
space leads to a NULL pointer deref.  Debugging that is made trickier by the
fact that I couldn't even get a backtrace in ddb.

PR: 201614

8 years agoCast pointer through uintptr_t on the way to uint64_t to squelch a warning.
ian [Sat, 2 Jan 2016 22:55:59 +0000 (22:55 +0000)]
Cast pointer through uintptr_t on the way to uint64_t to squelch a warning.

8 years agoWork around problems that happen when there is ram at the end of the
ian [Sat, 2 Jan 2016 22:31:14 +0000 (22:31 +0000)]
Work around problems that happen when there is ram at the end of the
physical address space.

8 years agoFix booting of 32-bit kernels on 64-bit G5 hardware.
andreast [Sat, 2 Jan 2016 22:04:37 +0000 (22:04 +0000)]
Fix booting of 32-bit kernels on 64-bit G5 hardware.

For rs6000, most memory insns and addi/addis do not allow GPR0 for RA
(they use literal zero there instead). So use a 'b' constraint to make
sure to have a base register other than GPR0.
GCC-4.7 and up handles this with allocating r9 instead of r0.

8 years agoUse 64-bit math when processing the lists of physical and excluded memory
ian [Sat, 2 Jan 2016 22:00:52 +0000 (22:00 +0000)]
Use 64-bit math when processing the lists of physical and excluded memory
to generate the phys_avail and dump_avail arrays.

This is a partial fix for the kernel side of the problem mentioned in the
PR.  This part handles the cases where comparing start and end addresses of
a block would fail because 32-bit wrap caused the end address to come out
zero if the end of the region is the end of the address space (0xffffffff
with 32-bit vm_paddr_t, but now the code should also work right if we ever
support LPAE with 36-bit addresses).

More work is necessary to make systems with ram at the end of the physical
address space usable, but at least initially it's going to be more like a
workaround than a fix, so this non-hacky part is being committed first.

PR: 201614

8 years agoFix the arm64 build by adding an all-important '&' to get a pointer.
ian [Sat, 2 Jan 2016 21:13:14 +0000 (21:13 +0000)]
Fix the arm64 build by adding an all-important '&' to get a pointer.

I'm not sure how I missed the error when I test-built here, I guess the
pointy hat must have slipped down over my eyes.

8 years agoHide transient EBADF errors caused by the parallel revoke(2) or forced
kib [Sat, 2 Jan 2016 20:29:28 +0000 (20:29 +0000)]
Hide transient EBADF errors caused by the parallel revoke(2) or forced
unmount of devfs mounts, by restarting the failed syscall.

When restarted, failing syscalls eventually either stop finding the
node and returning ENOENT, or the vnode op vectors finally transition
to the deadfs vop.  The later return EIO or other error, more
appropriate for the operation.

Submitted by: bde
Tested by: pho
MFC after: 3 weeks

8 years agoBump the maximum number of interrupt controllers to allow for the
nwhitehorn [Sat, 2 Jan 2016 19:34:37 +0000 (19:34 +0000)]
Bump the maximum number of interrupt controllers to allow for the
proliferation of them on large IBM systems and add some error checking if
we exceed that number.

MFC after: 1 week

8 years agoMake using the #address-cells property on the interrupt parent in device
nwhitehorn [Sat, 2 Jan 2016 19:28:35 +0000 (19:28 +0000)]
Make using the #address-cells property on the interrupt parent in device
tree parsing opt-out rather than opt-in. All FDT-based systems as well as
PowerPC systems with real Open Firmware use the CHRP-derived binding that
includes it, which makes SPARC the odd man out here. Making it opt-out
avoids astonishment on new platform bring up.

8 years agoAdd an OF_decode_addr() implementation for arm64.
ian [Sat, 2 Jan 2016 19:14:19 +0000 (19:14 +0000)]
Add an OF_decode_addr() implementation for arm64.

Discussed with: andrew

8 years agokbdmap.5: Use current names for ASCII control codes lf, ff, us
emaste [Sat, 2 Jan 2016 18:35:11 +0000 (18:35 +0000)]
kbdmap.5: Use current names for ASCII control codes lf, ff, us

Refer to the old names nl, np, ns as historical aliases.

PR: 205776, 205778
MFC After: 1 week
Sponsored by: The FreeBSD Foundation

8 years ago... and that would've never worked. Sorry!
adrian [Sat, 2 Jan 2016 18:32:20 +0000 (18:32 +0000)]
... and that would've never worked. Sorry!

(Note: everything I tested on locally has ATH_DEBUG / AH_DEBUG set.)

8 years agoUse 64-bit math when finding a block of ram to hold the kernel. This fixes
ian [Sat, 2 Jan 2016 18:16:24 +0000 (18:16 +0000)]
Use 64-bit math when finding a block of ram to hold the kernel.  This fixes
a problem on 32-bit systems which have ram occupying the end of the physical
address space -- for example, a block of ram at 0x80000000 with a size of
0x80000000 was overflowing 32 bit math and ending up with a calculated size
of zero.

This is a fix for one of the two problems mentioned in the PR.  Something
similar will need to be done on the kernel side before the PR is closed.

PR: 201614

8 years agoBring CPU features list in line with the ABI requirements.
nwhitehorn [Sat, 2 Jan 2016 18:15:10 +0000 (18:15 +0000)]
Bring CPU features list in line with the ABI requirements.

MFC after: 1 week

8 years agoSwitch setting MSR[SF] to C code. This removes any CPU-specific code
nwhitehorn [Sat, 2 Jan 2016 18:10:53 +0000 (18:10 +0000)]
Switch setting MSR[SF] to C code. This removes any CPU-specific code
(MSF[SF] is a Book 3-S thing) in the 64-bit locore64.S.

8 years ago[ath] add explicit bus barriers.
adrian [Sat, 2 Jan 2016 17:14:22 +0000 (17:14 +0000)]
[ath] add explicit bus barriers.

The ath hal and driver code all assume the world is an x86 or the
bus layer does an explicit bus flush after each operation (eg netbsd.)

However, we don't do that.

So, to be "correct" on platforms like sparc64, mips and ppc (and maybe
ARM, I am not sure), just do explicit barriers after each operation.

Now, this does slow things down a tad on embedded platforms but I'd
rather things be "correct" versus "fast."  At some later point if someone
wishes it to be fast then we should add the barrier calls to the HAL and
driver.

Tested:

* carambola 2 (AR9331.)

8 years agoReplace the cosine table with a sine table, which (due to the vagaries of
des [Sat, 2 Jan 2016 16:40:37 +0000 (16:40 +0000)]
Replace the cosine table with a sine table, which (due to the vagaries of
rounding) has better spread.  Implement fp16_sin() to go along with
fp16_cos().  In the rendering loop, switch from addition to subtraction
so the center of the pattern will be a trough rather than a peak.  This
is completely arbitrary, of course, but looks better to me.

8 years ago- Use a temporary file for the temporary md(4) devices instead of
ngie [Sat, 2 Jan 2016 10:07:31 +0000 (10:07 +0000)]
- Use a temporary file for the temporary md(4) devices instead of
  hardcoding it
- Remove the temporary file in the cleanup routine

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