]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoUpdate llvm to trunk r256945.
dim [Wed, 6 Jan 2016 20:19:13 +0000 (20:19 +0000)]
Update llvm to trunk r256945.

8 years agoVendor import of llvm trunk r256945:
dim [Wed, 6 Jan 2016 20:01:02 +0000 (20:01 +0000)]
Vendor import of llvm trunk r256945:
https://llvm.org/svn/llvm-project/llvm/trunk@256945

8 years agoMerge ^/head r293036 through r293174.
dim [Mon, 4 Jan 2016 20:31:09 +0000 (20:31 +0000)]
Merge ^/head r293036 through r293174.

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 agoMerge LLDB 3.8
emaste [Mon, 4 Jan 2016 01:16:32 +0000 (01:16 +0000)]
Merge LLDB 3.8

As with previous imports a number of plugins not immediately relevant
to FreeBSD have been excluded:

ABIMacOSX_i386
ABIMacOSX_arm
ABIMacOSX_arm64
ABISysV_hexagon
AppleObjCRuntimeV2
AppleObjCRuntimeV1
SystemRuntimeMacOSX
RenderScriptRuntime
GoLanguageRuntime
GoLanguage
ObjCLanguage
ObjCPlusPlusLanguage
ObjectFilePECOFF
DynamicLoaderWindowsDYLD
platform_linux
platform_netbsd
PlatformWindows
PlatformKalimba
platform_android
DynamicLoaderMacOSXDYLD
ObjectContainerUniversalMachO
PlatformRemoteiOS
PlatformMacOSX
OperatingSystemGo

8 years agoUpdate build infrastructure for LLDB 3.8
emaste [Mon, 4 Jan 2016 00:02:58 +0000 (00:02 +0000)]
Update build infrastructure for LLDB 3.8

8 years agoBuild Valgrind.cpp for LLDB, not only CLANG_EXTRAS
emaste [Sun, 3 Jan 2016 23:36:11 +0000 (23:36 +0000)]
Build Valgrind.cpp for LLDB, not only CLANG_EXTRAS

It's required as of LLDB 3.8.

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 agoUn-trim part of lldb trunk r256633
emaste [Sun, 3 Jan 2016 20:36:46 +0000 (20:36 +0000)]
Un-trim part of lldb trunk r256633

This was stripped in r292932 but is used in the regular configuration
of LLDB.

Obtained from: https://llvm.org/svn/llvm-project/lldb/trunk@256633

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

8 years agoUse correct name 'us' for character 31 in keymaps
emaste [Sat, 2 Jan 2016 04:42:53 +0000 (04:42 +0000)]
Use correct name 'us' for character 31 in keymaps

'ns' was a historical accident, and kbdcontrol(1) has accepted the
correct 'us' as well as 'ns' since r38139.

PR: 205776
MFC after: 1 week

8 years agoRevert accidental change that snuck into r293045.
ian [Sat, 2 Jan 2016 03:00:31 +0000 (03:00 +0000)]
Revert accidental change that snuck into r293045.

8 years agoMake the 'env' directive described in config(5) work on all architectures,
ian [Sat, 2 Jan 2016 02:53:48 +0000 (02:53 +0000)]
Make the 'env' directive described in config(5) work on all architectures,
providing compiled-in static environment data that is used instead of any
data passed in from a boot loader.

Previously 'env' worked only on i386 and arm xscale systems, because it
required the MD startup code to examine the global envmode variable and
decide whether to use static_env or an environment obtained from the boot
loader, and set the global kern_envp accordingly.  Most startup code wasn't
doing so.  Making things even more complex, some mips startup code uses an
alternate scheme that involves calling init_static_kenv() to pass an empty
buffer and its size, then uses a series of kern_setenv() calls to populate
that buffer.

Now all MD startup code calls init_static_kenv(), and that routine provides
a single point where envmode is checked and the decision is made whether to
use the compiled-in static_kenv or the values provided by the MD code.

The routine also continues to serve its original purpose for mips; if a
non-zero buffer size is passed the routine installs the empty buffer ready
to accept kern_setenv() values.  Now if the size is zero, the provided buffer
full of existing env data is installed.  A NULL pointer can be passed if the
boot loader provides no env data; this allows the static env to be installed
if envmode is set to do so.

Most of the work here is a near-mechanical change to call the init function
instead of directly setting kern_envp.  A notable exception is in xen/pv.c;
that code was originally installing a buffer full of preformatted env data
along with its non-zero size (like mips code does), which would have allowed
kern_setenv() calls to wipe out the preformatted data.  Now it passes a zero
for the size so that the buffer of data it installs is treated as
non-writeable.

8 years agoAccidentally dropped the 0 padding.
jhibbits [Fri, 1 Jan 2016 17:56:52 +0000 (17:56 +0000)]
Accidentally dropped the 0 padding.

Pointed out by: cmeyer

8 years agoUnset the gss kernel state when gssd exits
jpaetzel [Fri, 1 Jan 2016 17:06:16 +0000 (17:06 +0000)]
Unset the gss kernel state when gssd exits

When gssd exits it leaves the kernel state set by
gssd_syscall().  nfsd sees this and waits endlessly
in an unkillable state for gssd to come back.  If you
had acidentally started gssd then stopped it, then
started nfsd you'd be in a bad way until you either
restarted gssd or rebooted the system.  This change
fixes that by setting the kernel state to "" when
gssd exits.
Reviewed by: rmacklem
MFC after: 1 week
Sponsored by: iXsystems

8 years agoMinor style cleanup.
kib [Fri, 1 Jan 2016 15:48:48 +0000 (15:48 +0000)]
Minor style cleanup.

Submitted by: bde
MFC after: 1 week

8 years agoUse uint32_t for LBC block size.
jhibbits [Fri, 1 Jan 2016 15:36:56 +0000 (15:36 +0000)]
Use uint32_t for LBC block size.

LBC block size can only be up to 4GB.  The existing code already clamps it, but
mixes unsigned long and uint32_t.  This works on 32-bit targets, but not 64-bit,
so isn't completely correct.  This fixes the type confusion.

8 years agoReduce libstand Makefile duplication
emaste [Fri, 1 Jan 2016 15:30:11 +0000 (15:30 +0000)]
Reduce libstand Makefile duplication

libstand is built in three places (lib/libstand, sys/boot/libstand32,
and sys/boot/userboot/libstand). Reduce Makefile duplication by
.including libstand/Makefile from sys/boot/libstand32/Makefile.

sys/boot/userboot/libstand/Makefile will be addressed later, as it
contains additional differences yet to be handled.

This change also switches libstand32 to use the new uuid_from_string
and uuid_to_string, which was not included in r292473.

Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D4747

8 years agoFix a couple printf formats.
jhibbits [Fri, 1 Jan 2016 15:17:24 +0000 (15:17 +0000)]
Fix a couple printf formats.

This was found when working on 64-bit PowerPC book-e support.

8 years agoUse lltable_get_ifp() instead of direct access to lltable fields.
melifaro [Fri, 1 Jan 2016 12:35:33 +0000 (12:35 +0000)]
Use lltable_get_ifp() instead of direct access to lltable fields.

8 years agoUpdate leap-seconds to latest. This will satisfy the ntpd leap-second
cy [Fri, 1 Jan 2016 11:57:32 +0000 (11:57 +0000)]
Update leap-seconds to latest. This will satisfy the ntpd leap-second
version check.

Obtained from: ftp://tycho.usno.navy.mil/pub/ntp/.
See also: http://www.iers.org/SharedDocs/News/EN/BulletinC.html

8 years agoMerge ^/head r293016 through r293035.
dim [Fri, 1 Jan 2016 11:19:32 +0000 (11:19 +0000)]
Merge ^/head r293016 through r293035.

8 years agoRemove second EVENTHANDLER_REGISTER slipped in r292978.
melifaro [Fri, 1 Jan 2016 10:15:06 +0000 (10:15 +0000)]
Remove second EVENTHANDLER_REGISTER slipped in r292978.
Describe the reason of doing unconditional M_PREPEND in ether_output().

8 years ago17 years and change after I wrote warp_saver, here's a simple plasma effect
des [Fri, 1 Jan 2016 04:04:40 +0000 (04:04 +0000)]
17 years and change after I wrote warp_saver, here's a simple plasma effect
(currently only three circular patterns) which requires quite a bit of
fixed-point arithmetic, including sqrt() and cos().  Happy New Year!

8 years agoIn the unload target, check that the module is loaded first.
des [Fri, 1 Jan 2016 03:59:09 +0000 (03:59 +0000)]
In the unload target, check that the module is loaded first.
Add a reload target which unloads and then loads the module.

8 years agoUse randomly generated device names in testcases via mktemp -u instead of using
ngie [Fri, 1 Jan 2016 03:12:51 +0000 (03:12 +0000)]
Use randomly generated device names in testcases via mktemp -u instead of using
the hardcoded device name, "test"

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

8 years agoExtend idle support for newer Book-E cores.
jhibbits [Fri, 1 Jan 2016 02:47:40 +0000 (02:47 +0000)]
Extend idle support for newer Book-E cores.

Newer Book-E cores (e500mc, e5500, e6500) do not support the WE bit in the MSR,
and instead delegate CPU idling to the SoC.

Perhaps in the future the QORIQ_DPAA option for the mpc85xx platform will become
a subclass, which will eliminate most of the #ifdef's.

8 years agoAdd functions for managing md(4) devices and cleaning up said md(4) devices
ngie [Fri, 1 Jan 2016 02:25:10 +0000 (02:25 +0000)]
Add functions for managing md(4) devices and cleaning up said md(4) devices

These will be used soon in the various test scripts that source geom_subr.sh

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

8 years ago- Use geom <class> load instead of g<class> load; g<class> doesn't exist
ngie [Fri, 1 Jan 2016 02:22:45 +0000 (02:22 +0000)]
- Use geom <class> load instead of g<class> load; g<class> doesn't exist
  for all geom classes, e.g. geom_uzip(4)
- These tests require root. Skip all of the tests if they're run as non-root

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

8 years ago[net80211] document the (not completely complete) set of places where
adrian [Fri, 1 Jan 2016 00:21:07 +0000 (00:21 +0000)]
[net80211] document the (not completely complete) set of places where
we're assuming hz=1000 and not gracefully handling when it isn't.

The math involved will return 0 for hz < 1000, which it is on some
platforms and on DragonflyBSD.

This doesn't fix it, it:

* converts one manual use over to use the macro, and
* comments where it needs some thought/fixing.

I'll think about this a bit more before fixing it.

Submitted by: imre@vdsz.com

8 years agoUnify the ELFv1 and ELFv2 code paths and make ELFv1 (the normal ABI) more
nwhitehorn [Fri, 1 Jan 2016 00:11:29 +0000 (00:11 +0000)]
Unify the ELFv1 and ELFv2 code paths and make ELFv1 (the normal ABI) more
correct in the process.

MFC after: 2 weeks

8 years ago[rtwn] add rtwn module directory.
adrian [Thu, 31 Dec 2015 23:48:07 +0000 (23:48 +0000)]
[rtwn] add rtwn module directory.

Pointed out by: dim

8 years agoMerge ^/head r292951 through r293015.
dim [Thu, 31 Dec 2015 22:55:02 +0000 (22:55 +0000)]
Merge ^/head r292951 through r293015.

8 years agoMerge r293013 from clang380-import branch:
dim [Thu, 31 Dec 2015 22:52:11 +0000 (22:52 +0000)]
Merge r293013 from clang380-import branch:

Fix a clang 3.8.0 warning in pflogd.c:

contrib/pf/pflogd/pflogd.c:769:8: error: logical not is only applied to the left hand side of this comparison [-Werror,-Wlogical-not-parentheses]
if (!if_exists(interface) == -1) {
    ^                     ~~

The if_exists() function does not return -1, and even if it did, it
would not be the correct way to check.  Just ditch the == -1 instead.

Obtained from: OpenBSD's pflogd.c 1.49
MFC after: 3 days

8 years agoMerge r293006 from clang380-import branch:
dim [Thu, 31 Dec 2015 22:48:46 +0000 (22:48 +0000)]
Merge r293006 from clang380-import branch:

For determining the compiler version, quote the string to be echo'd,
otherwise the command might fail.  This is because clang -v now results
in the following:

FreeBSD clang version 3.8.0 (trunk 256633) (based on LLVM 3.8.0svn)

The second "3.8.8svn)" string tripped up the shell command.

MFC after: 3 days

8 years agoFix a clang 3.8.0 warning in pflogd.c:
dim [Thu, 31 Dec 2015 22:45:00 +0000 (22:45 +0000)]
Fix a clang 3.8.0 warning in pflogd.c:

contrib/pf/pflogd/pflogd.c:769:8: error: logical not is only applied to the left hand side of this comparison [-Werror,-Wlogical-not-parentheses]
                        if (!if_exists(interface) == -1) {
                            ^                     ~~

The if_exists() function does not return -1, and even if it did, it
would not be the correct way to check.  Just ditch the == -1 instead.

Obtained from: OpenBSD's pflogd.c 1.49
MFC after: 3 days

8 years ago[rtwn] Add initial manpages for the rtwn driver.
adrian [Thu, 31 Dec 2015 22:34:16 +0000 (22:34 +0000)]
[rtwn] Add initial manpages for the rtwn driver.

8 years ago[rtwn] Add rtwn firmware and driver module.
adrian [Thu, 31 Dec 2015 22:33:32 +0000 (22:33 +0000)]
[rtwn] Add rtwn firmware and driver module.

Submitted by: kevlo

8 years ago[rtwn] bring over initial rtwn driver.
adrian [Thu, 31 Dec 2015 22:32:36 +0000 (22:32 +0000)]
[rtwn] bring over initial rtwn driver.

This is a port from openbsd.  It's incomplete and unstable, but it's better
than nothing.  I have no plans to MFC this until it's complete and stable.

Submitted by: kevlo

8 years ago[rtwn] add rtwn firmware.
adrian [Thu, 31 Dec 2015 22:31:43 +0000 (22:31 +0000)]
[rtwn] add rtwn firmware.

Submitted by: kevlo

8 years agoFor determining the compiler version, quote the string to be echo'd,
dim [Thu, 31 Dec 2015 21:01:06 +0000 (21:01 +0000)]
For determining the compiler version, quote the string to be echo'd,
otherwise the command might fail.  This is because clang -v now results
in the following:

FreeBSD clang version 3.8.0 (trunk 256633) (based on LLVM 3.8.0svn)

The second "3.8.8svn)" string tripped up the shell command.

8 years agosh: Remove redundant CTLQUOTEMARK checks.
jilles [Thu, 31 Dec 2015 20:15:57 +0000 (20:15 +0000)]
sh: Remove redundant CTLQUOTEMARK checks.

With the new expand.c code, the intermediate representation passed to the
pathname generation code only contains CTLESC, not CTLQUOTEMARK.

CTLQUOTEMARK now only occurs in the text of NARG nodes (output of the
parser).

8 years agoIntroduce the ZFS Boot Environments menu to the loader menu
allanjude [Thu, 31 Dec 2015 20:00:53 +0000 (20:00 +0000)]
Introduce the ZFS Boot Environments menu to the loader menu

If the system was booted with ZFS, a new menu item (#7) appears
It contains an autogenerated list of ZFS Boot Environments

This allows the user to switch to an alternate root file system
Use Cases:
 - Revert a failed upgrade
 - Concurrently run different versions of FreeBSD with common home directory
 - Easier integration with the sysadmin/beadm utility

Requested by: many
Reviewed by: dteske
MFC after: 10 days
Relnotes: yes
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D3167

8 years agoRemove supposition comment that code would better live elsewhere.
dteske [Thu, 31 Dec 2015 19:37:14 +0000 (19:37 +0000)]
Remove supposition comment that code would better live elsewhere.
Thinking this through, and looking at process_assignment, I believe
moving the code would be wrong considering that set_conf_files is
called in one condition while set_nextboot_conf is guarded by a
different condition of having nextboot_enable="YES". So these must
stay separated and not combined.

MFC after: 1 week

8 years agoFix a memory leak. nextboot_conf_file is not volatile, as far as I
dteske [Thu, 31 Dec 2015 19:33:17 +0000 (19:33 +0000)]
Fix a memory leak. nextboot_conf_file is not volatile, as far as I
can tell, and thus the strdup is entirely unnecessary.

Thanks to: Toomas Soome (tsoome at-me dot-com)
MFC after: 1 week

8 years agonewvers.sh: put variable assignments on separate lines
emaste [Thu, 31 Dec 2015 19:25:35 +0000 (19:25 +0000)]
newvers.sh: put variable assignments on separate lines

This makes it easier to grep for where they're set, and may simplify
future merging for FreeBSD derivatives that change these.