]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
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 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 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 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 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.

8 years agoRemove debugging messages. NB: SVN r187143 reads:
dteske [Thu, 31 Dec 2015 19:00:45 +0000 (19:00 +0000)]
Remove debugging messages. NB: SVN r187143 reads:
comment out some debugging messages that slipped in by mistake
(removing them 7 years after they have been commented out)

MFC after: 1 week

8 years agosh: Reindent expandmeta().
jilles [Thu, 31 Dec 2015 18:56:11 +0000 (18:56 +0000)]
sh: Reindent expandmeta().

8 years agosh: Perform pathname generation during the first expansion phases.
jilles [Thu, 31 Dec 2015 18:47:54 +0000 (18:47 +0000)]
sh: Perform pathname generation during the first expansion phases.

This avoids the need to add and remove CTLESC bytes if pathname generation
will not be performed (set -f).

Side effect: the order of operations is slightly different: pathname
generation in ${$+* $(CMD)} will not see filesystem changes from CMD.

8 years agoWhen building libstand for arm, don't emit instructions that require
ian [Thu, 31 Dec 2015 18:29:24 +0000 (18:29 +0000)]
When building libstand for arm, don't emit instructions that require
relocation fixups unsupported by the self_reloc() code, and don't optimize
memcpy/memset using floating point registers, because in a standalone
environment nothing has initialized the fpu hardware.

8 years agoAdd suppoort for the Sitecom LN-031
kp [Thu, 31 Dec 2015 18:12:35 +0000 (18:12 +0000)]
Add suppoort for the Sitecom LN-031

This is an AX88178 chip, which we already support so all we have to do is add
the USB product and vendor ID.

8 years agosh: Perform IFS splitting during the first expansion phases.
jilles [Thu, 31 Dec 2015 17:51:15 +0000 (17:51 +0000)]
sh: Perform IFS splitting during the first expansion phases.

This simplifies the code and should be faster in some cases.

Side effect: the order of operations is different so that the value of IFS
used when IFS is modified during expansion (${IFS:=...}, ${IFS=...} or
$((...IFS=...))) may be different. Note that this order is highly unportable
between shells.

8 years agoHandle when filedescriptors are closed before initialized. An early
hselasky [Thu, 31 Dec 2015 14:47:45 +0000 (14:47 +0000)]
Handle when filedescriptors are closed before initialized. An early
fdclose() call can cause fget_unlocked() to fail.

Found by: mjg @
MFC after: 1 week
Reviewed by: Mark Block <markb@mellanox.com>
Sponsored by: Mellanox Technologies
Differential Revision: https://reviews.freebsd.org/D4351

8 years agoMinor LinuxKPI code cleanup:
hselasky [Thu, 31 Dec 2015 12:30:19 +0000 (12:30 +0000)]
Minor LinuxKPI code cleanup:
- Declare some static functions in linux_compat.c instead if inside
  various header files.
- Prefix FreeBSD local functions in the LinuxKPI with "linux_" to
  avoid symbol name conflicts in the future and to make debugging
  easier.
- Make the "struct kobj_ktype" declaractions constant to shave off a
  few bytes from the data segment.

MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoMake the kobject refcounting compliant with Linux. Refcounting on the
hselasky [Thu, 31 Dec 2015 11:27:36 +0000 (11:27 +0000)]
Make the kobject refcounting compliant with Linux. Refcounting on the
parent kobject cannot be factored out and must be done by the kobject
consumers.

MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoBump copyright year.
bz [Thu, 31 Dec 2015 11:21:45 +0000 (11:21 +0000)]
Bump copyright year.

Happy New Year 2016!

8 years agoRemove unused variable after r292981 to unbreak the build.
bz [Thu, 31 Dec 2015 10:55:50 +0000 (10:55 +0000)]
Remove unused variable after r292981 to unbreak the build.

8 years agoClean up unused-but-set-variable spotted by gcc-4.9.
araujo [Thu, 31 Dec 2015 07:08:21 +0000 (07:08 +0000)]
Clean up unused-but-set-variable spotted by gcc-4.9.

Reviewed by: grehan
Approved by: rodrigc (mentor)
Differential Revision: https://reviews.freebsd.org/D4734

8 years agoClean up unused-but-set-variable spotted by gcc4.9.
araujo [Thu, 31 Dec 2015 07:03:41 +0000 (07:03 +0000)]
Clean up unused-but-set-variable spotted by gcc4.9.

Reviewed by: ngie
Approved by: rodrigc (mentor)
Differential Revision: https://reviews.freebsd.org/D4719

8 years agoImplement interface link header precomputation API.
melifaro [Thu, 31 Dec 2015 05:03:27 +0000 (05:03 +0000)]
Implement interface link header precomputation API.

Add if_requestencap() interface method which is capable of calculating
  various link headers for given interface. Right now there is support
  for INET/INET6/ARP llheader calculation (IFENCAP_LL type request).
  Other types are planned to support more complex calculation
  (L2 multipath lagg nexthops, tunnel encap nexthops, etc..).

Reshape 'struct route' to be able to pass additional data (with is length)
  to prepend to mbuf.

These two changes permits routing code to pass pre-calculated nexthop data
  (like L2 header for route w/gateway) down to the stack eliminating the
  need for other lookups. It also brings us closer to more complex scenarios
  like transparently handling MPLS nexthops and tunnel interfaces.
  Last, but not least, it removes layering violation introduced by flowtable
  code (ro_lle) and simplifies handling of existing if_output consumers.

ARP/ND changes:
Make arp/ndp stack pre-calculate link header upon installing/updating lle
  record. Interface link address change are handled by re-calculating
  headers for all lles based on if_lladdr event. After these changes,
  arpresolve()/nd6_resolve() returns full pre-calculated header for
  supported interfaces thus simplifying if_output().
Move these lookups to separate ether_resolve_addr() function which ether
  returs error or fully-prepared link header. Add <arp|nd6_>resolve_addr()
  compat versions to return link addresses instead of pre-calculated data.

BPF changes:
Raw bpf writes occupied _two_ cases: AF_UNSPEC and pseudo_AF_HDRCMPLT.
Despite the naming, both of there have ther header "complete". The only
  difference is that interface source mac has to be filled by OS for
  AF_UNSPEC (controlled via BIOCGHDRCMPLT). This logic has to stay inside
  BPF and not pollute if_output() routines. Convert BPF to pass prepend data
  via new 'struct route' mechanism. Note that it does not change
  non-optimized if_output(): ro_prepend handling is purely optional.
Side note: hackish pseudo_AF_HDRCMPLT is supported for ethernet and FDDI.
  It is not needed for ethernet anymore. The only remaining FDDI user is
  dev/pdq mostly untouched since 2007. FDDI support was eliminated from
  OpenBSD in 2013 (sys/net/if_fddisubr.c rev 1.65).

Flowtable changes:
  Flowtable violates layering by saving (and not correctly managing)
  rtes/lles. Instead of passing lle pointer, pass pointer to pre-calculated
  header data from that lle.

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

8 years agoWrap using #ifdef 'notyet' those variables and statements not yet
araujo [Thu, 31 Dec 2015 02:01:20 +0000 (02:01 +0000)]
Wrap using #ifdef 'notyet' those variables and statements not yet
implemented to lower the compiler warnings.

It fix the case of unused-but-set-variable spotted by gcc4.9.

Reviewed by: ngie, ae
Approved by: bapt (mentor)
Differential Revision: https://reviews.freebsd.org/D4720

8 years agoClean up unused-but-set-variable spotted by gcc-4.9.
araujo [Thu, 31 Dec 2015 01:57:55 +0000 (01:57 +0000)]
Clean up unused-but-set-variable spotted by gcc-4.9.

Approved by: bapt (mentor)
Differential Revision: https://reviews.freebsd.org/D4736

8 years agoClean up unused-but-set-variable spotted by gcc-4.9.
araujo [Thu, 31 Dec 2015 01:55:51 +0000 (01:55 +0000)]
Clean up unused-but-set-variable spotted by gcc-4.9.

Reviewed by: grehan
Approved by: bapt (mentor)
Differential Revision: https://reviews.freebsd.org/D4735

8 years agoClean up unused-but-set-variable spotted by gcc-4.9.
araujo [Thu, 31 Dec 2015 01:54:07 +0000 (01:54 +0000)]
Clean up unused-but-set-variable spotted by gcc-4.9.

Reviewed by: royger
Approved by: rodrigc (mentor)
Differential Revision: https://reviews.freebsd.org/D4733

8 years agoBump __FreeBSD_version because r292782 removes sys/crypto/sha2.h
allanjude [Wed, 30 Dec 2015 23:27:24 +0000 (23:27 +0000)]
Bump __FreeBSD_version because r292782 removes sys/crypto/sha2.h

Submitted by: Oliver Pinter <oliver.pinter@hardenedbsd.org>

8 years agoAdd the MOVT/MOVW types to the list of relocs which do not generate .plt
ian [Wed, 30 Dec 2015 23:04:08 +0000 (23:04 +0000)]
Add the MOVT/MOVW types to the list of relocs which do not generate .plt
entries.  This fixes the segfaults in arm userland code compiled with
-march= or -mcpu= values that allow the compiler to generate movw/movt
sequences to load 32-bit constants.

8 years agoBreak up opencrypto/xform.c so it can be reused piecemeal
allanjude [Wed, 30 Dec 2015 22:43:07 +0000 (22:43 +0000)]
Break up opencrypto/xform.c so it can be reused piecemeal

Keep xform.c as a meta-file including the broken out bits
existing code that includes xform.c continues to work as normal

Individual algorithms can now be reused elsewhere, including outside
of the kernel

Reviewed by: bapt (previous version), gnn, delphij
Approved by: secteam
MFC after: 1 week
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D4674

8 years agoForce nullfs vnode reclaim after unlinking, to potentially unlink
kib [Wed, 30 Dec 2015 19:49:22 +0000 (19:49 +0000)]
Force nullfs vnode reclaim after unlinking, to potentially unlink
lower vnode.  Otherwise, reference to the lower vnode from the upper
one prevents final unlink.

PR: 178238
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agoChange the - hopefully - last piece of ktr(9) to use PCPU_GET(cpuid)
marius [Wed, 30 Dec 2015 18:57:29 +0000 (18:57 +0000)]
Change the - hopefully - last piece of ktr(9) to use PCPU_GET(cpuid)
instead of the MD module ID for KTR_CPU.

8 years agoRename `recvfd` and `sendfd` variables in recvfd/sendfd functions to avoid
ngie [Wed, 30 Dec 2015 18:13:43 +0000 (18:13 +0000)]
Rename `recvfd` and `sendfd` variables in recvfd/sendfd functions to avoid
-Wshadow issues with gcc

MFC after: 1 week
Reported by: bz, jenkins
Sponsored by: EMC / Isilon Storage Division

8 years agoAdd the appropriate case statement for IPV6_BINDMULTI so the option can be
jtl [Wed, 30 Dec 2015 18:08:05 +0000 (18:08 +0000)]
Add the appropriate case statement for IPV6_BINDMULTI so the option can be
retrieved with getsockopt().

CID: 1229928
Differential Revision: https://reviews.freebsd.org/D4737
Reviewed by: adrian
Sponsored by: Juniper Networks

8 years agoFix a file descriptor leak in mdXhl.c (which is used by numerous hashing
jtl [Wed, 30 Dec 2015 18:04:50 +0000 (18:04 +0000)]
Fix a file descriptor leak in mdXhl.c (which is used by numerous hashing
algorithms.

CID: 1305669,1305611,1305663,1305603,1305584,1305639,1346865,1305601
Differential Revision: https://reviews.freebsd.org/D4732
Reviewed by: allanjude, delphij
MFC after: 2 weeks
Sponsored by: Juniper Networks

8 years agoDecode and print the ID_AA64* registers on boot. These registers hold
andrew [Wed, 30 Dec 2015 17:36:34 +0000 (17:36 +0000)]
Decode and print the ID_AA64* registers on boot. These registers hold
information on what the core supports. In most cases these will be
identical across most CPUs in the SoC, however there may be the case where,
with a big.LITTLE setup they may differ. In this case we print the
decoded data on all CPUs.

Reviewed by: kib
Sponsored by: ABT Systems Ltd
Differential Revision: https://reviews.freebsd.org/D4725

8 years agoThis code is not in modules that need KPI stability so no need to use
bz [Wed, 30 Dec 2015 17:10:03 +0000 (17:10 +0000)]
This code is not in modules that need KPI stability so no need to use
the wrapper functions as used in r252511.  We can directly use the
locking macros.

Reviewed by: jtl, rwatson
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D4731

8 years agoDrop the clang patch which adds recognition of 'CC' suffixes as aliases
dim [Wed, 30 Dec 2015 16:14:30 +0000 (16:14 +0000)]
Drop the clang patch which adds recognition of 'CC' suffixes as aliases
for --driver-mode=g++, since this was never upstreamed.  For backwards
compatibility, add a wrapper shell script.

MFC after: 1 week

8 years agoAdd support for modifying coalescing parameters runtime.
hselasky [Wed, 30 Dec 2015 15:01:47 +0000 (15:01 +0000)]
Add support for modifying coalescing parameters runtime.

MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoAllow I2C to read address 0x51 as well as address 0x50.
hselasky [Wed, 30 Dec 2015 14:58:55 +0000 (14:58 +0000)]
Allow I2C to read address 0x51 as well as address 0x50.

MFC after: 1 week
Submitted by: Shahar Klein <shahark@mellanox.com>
Sponsored by: Mellanox Technologies

8 years agoFix use of uninitialised Nflag
smh [Wed, 30 Dec 2015 14:57:42 +0000 (14:57 +0000)]
Fix use of uninitialised Nflag

Initialise Nflag to 0 preventing use of uninitialised value.

Reported by: uqs
MFC after: 1 week
X-MFC-With: r292266
Sponsored by: Multiplay
Differential Revision: https://reviews.freebsd.org/D4449

8 years ago10G ER/LR should present itself as LR.
hselasky [Wed, 30 Dec 2015 14:54:08 +0000 (14:54 +0000)]
10G ER/LR should present itself as LR.

MFC after: 1 week
Submitted by: Shahar Klein <shahark@mellanox.com>
Sponsored by: Mellanox Technologies

8 years ago- (Ab)use udivx for dividing the u_int pc_cpuid when implementing
marius [Wed, 30 Dec 2015 13:49:20 +0000 (13:49 +0000)]
- (Ab)use udivx for dividing the u_int pc_cpuid when implementing
  CPU_ISSET(), CPU_SET etc. in sparc64 asm. This approach has the
  benefit of not clobbering %y, allowing to revert r222827 and
  partially r222828.
- In r222828, CATR() already was changed to use the equivalent of
  PCPU_GET(cpuid) instead of the MD module ID for KTR_CPU, so
  belatedly also catch up with the C side of ktr(9). Originally,
  in r203838 CATR() was moved away from directly reading the
  module ID or equivalent as that became impractical with other
  CPU types than USI/II supported. With r222828 in place, per-CPU
  data generally is set up soon enough, though, that employing
  PCPU things in ktr(9) also for use during early stages works.
- Unfortunately, an exception to the latter is the ktr(9) use
  in pmap_bootstrap(), which actually is run so early that even
  checking for bootverbose being set via the loader doesn't work.
  Consequently, replace the ktr(9) use in pmap_bootstrap() with
  OF_printf(9) and put it under #ifdef DIAGNOSTIC instead.

MFC after: 3 days

8 years agoIntegrate tools/regression/sockets/unix_passfd into the FreeBSD test
ngie [Wed, 30 Dec 2015 11:15:07 +0000 (11:15 +0000)]
Integrate tools/regression/sockets/unix_passfd into the FreeBSD test
suite as tests/sys/kern/unix_passfd_test

- Convert testcases to ATF
- Fix an alignment issues
- Mark rights_creds_payload(..) as an expected failure (see PR # 181741)

Based [in part] on the following Differential Revision:
https://reviews.freebsd.org/D689

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

8 years agoAdd some more obsolete files, left over from the clang 3.7.0 -> 3.7.1
dim [Wed, 30 Dec 2015 09:15:02 +0000 (09:15 +0000)]
Add some more obsolete files, left over from the clang 3.7.0 -> 3.7.1
upgrade.

Noticed by: Nikolai Lifanov <lifanov@mail.lifanov.com>, jtl

8 years agoAdd platform support for QorIQ SoCs.
jhibbits [Wed, 30 Dec 2015 03:43:25 +0000 (03:43 +0000)]
Add platform support for QorIQ SoCs.

This includes the following changes:
* SMP kickoff for QorIQ (tested on P5020)
* Errata fixes for some silicon revisions
* Enables L2 (and L3 if available) caches
Obtained from: Semihalf
Sponsored by: Alex Perez/Inertial Computing

8 years agoUse __alignof__ instead of assuming int64_t to get the right
imp [Wed, 30 Dec 2015 03:36:22 +0000 (03:36 +0000)]
Use __alignof__ instead of assuming int64_t to get the right
alignment.

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

8 years agoOptimize zero_page for book-e mmu.
jhibbits [Wed, 30 Dec 2015 02:26:04 +0000 (02:26 +0000)]
Optimize zero_page for book-e mmu.

Instead of indirectly calling bzero() through mmu_booke_zero_page_area, zero the
full page the same way as the AIM pmap logic does: using dcbz.

8 years agoRewrite tid_flush() in C.
jhibbits [Wed, 30 Dec 2015 02:23:14 +0000 (02:23 +0000)]
Rewrite tid_flush() in C.

There's no need for it to be in asm.  Also, by writing in C, and marking it
static in pmap.c, it saves a branch to the function itself, as it's only used in
one location.  The generated asm is virtually identical to the handwritten code.

8 years agoFix stack leak introduced by SVN r97201 (nextboot_conf support).
dteske [Wed, 30 Dec 2015 02:15:12 +0000 (02:15 +0000)]
Fix stack leak introduced by SVN r97201 (nextboot_conf support).
Fix erroneous error path in error messages when processing boot_conf.
Fixup stack comments for functions introduced by SVN r97201.
Remove a questioning stack comment introduced by SVN r186789.
NB: Comment removed because strdup usage here is correct/not a leak.

MFC after: 1 week

8 years agoAdapt CATR() to r283283.
marius [Wed, 30 Dec 2015 00:17:37 +0000 (00:17 +0000)]
Adapt CATR() to r283283.

8 years agoDocument the recently added support for ptrace(2) LWP events.
jhb [Wed, 30 Dec 2015 00:04:57 +0000 (00:04 +0000)]
Document the recently added support for ptrace(2) LWP events.

8 years agoAdd ptrace(2) reporting for LWP events.
jhb [Tue, 29 Dec 2015 23:25:26 +0000 (23:25 +0000)]
Add ptrace(2) reporting for LWP events.

Add two new LWPINFO flags: PL_FLAG_BORN and PL_FLAG_EXITED for reporting
thread creation and destruction. Newly created threads will stop to report
PL_FLAG_BORN before returning to userland and exiting threads will stop to
report PL_FLAG_EXIT before exiting completely. Both of these events are
only enabled and reported if PT_LWP_EVENTS is enabled on a process.

8 years agoCall kern_thr_exit() instead of duplicating it.
jhb [Tue, 29 Dec 2015 23:16:20 +0000 (23:16 +0000)]
Call kern_thr_exit() instead of duplicating it.

This code is missing the racct_subr() call from kern_thr_exit() and would
require further code duplication in future changes.

Reviewed by: kib
MFC after: 1 week

8 years agoBring some of the recent locore-v4.S improvements into locore-V6...
ian [Tue, 29 Dec 2015 22:18:35 +0000 (22:18 +0000)]
Bring some of the recent locore-v4.S improvements into locore-V6...

 - Map all 4GB as VA=PA so that args passed in from a bootloader can
   be accessed regardless of where they are.
 - Figure out the kernel load address by directly masking the PC rather
   then by doing pc-relative math on the _start symbol.
 - For EARLY_PRINTF support, map device memory as uncacheable (no-op for
   ARM_NEW_PMAP because all TEX types resolve to uncacheable).

8 years agoAdd standard extended feature bit 6 from the Intel SDM rev. 57, which
kib [Tue, 29 Dec 2015 22:14:21 +0000 (22:14 +0000)]
Add standard extended feature bit 6 from the Intel SDM rev. 57, which
indicates that data-pointer in the saved x87 FPU state is only updated
on FPU exceptions.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agoFix the error checking for the ubenv command. This moves the check for an
ian [Tue, 29 Dec 2015 21:29:05 +0000 (21:29 +0000)]
Fix the error checking for the ubenv command.  This moves the check for an
empty ldvar (which amounts to the varname string starting with '=') into
the if block that manipulates ldvar, which avoids later referencing ldvar
when it was never initialized.

Submitted by: Thomas Skibo
Pointy hat: ian

8 years agosh: Split subevalvar() in #/##/%/%% and =/? parts.
jilles [Tue, 29 Dec 2015 20:51:29 +0000 (20:51 +0000)]
sh: Split subevalvar() in #/##/%/%% and =/? parts.

8 years agoFix getopt(3) argument after r290180; I forgot to change -r to -R
ngie [Tue, 29 Dec 2015 20:17:40 +0000 (20:17 +0000)]
Fix getopt(3) argument after r290180; I forgot to change -r to -R
by accident

MFC after: 3 days
Pointyhat to: ngie
Reported by: vangyzen
Sponsored by: EMC / Isilon Storage Division

8 years agoWhen checking the inp_ip_minttl restriction for IPv6 packets, don't check
jtl [Tue, 29 Dec 2015 19:20:39 +0000 (19:20 +0000)]
When checking the inp_ip_minttl restriction for IPv6 packets, don't check
the IPv4 header.

CID: 1017920
Differential Revision: https://reviews.freebsd.org/D4727
Reviewed by: bz
MFC after: 2 weeks
Sponsored by: Juniper Networks

8 years ago- Add entries for the more prominent members of the Digi International
marius [Tue, 29 Dec 2015 17:07:28 +0000 (17:07 +0000)]
- Add entries for the more prominent members of the Digi International
  Neo series, which are based on Exar PCI chips.
- Mark some unused parameters as such.
- Fix style

MFC after: 3 days

8 years agopax: prevent possible buffer overflow
pfg [Tue, 29 Dec 2015 16:31:28 +0000 (16:31 +0000)]
pax: prevent possible buffer overflow

Or at least quiet down some static analyzers about it.

CID: 978835
MFC after: 1 week
Obtained from: OpenBSD