]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoMFP r291227, r291228, and r292618.
Navdeep Parhar [Thu, 24 Dec 2015 02:35:59 +0000 (02:35 +0000)]
MFP r291227, r291228, and r292618.

r291227:
s/is->is_conn/ic to shorten things a bit.

r291228:
Do not generate PDUs with payload greater than max_data_segment_length.

It is perhaps preferable to have a separate limit for send instead of
reusing the receive limit.  I'll discuss with trasz@ and mav@ before
pulling this into head.

r292618:
Add comment to go with r291228.

8 years agoAdd quotes to prevent syntax errors on boot. 1.freebsd.pool.ntp.org
Warner Losh [Thu, 24 Dec 2015 02:02:05 +0000 (02:02 +0000)]
Add quotes to prevent syntax errors on boot. 1.freebsd.pool.ntp.org
isn't a very popular command :)

8 years agoMove creation of rc.conf to earlier so it winds up in /conf/boot/etc
Warner Losh [Thu, 24 Dec 2015 01:48:40 +0000 (01:48 +0000)]
Move creation of rc.conf to earlier so it winds up in /conf/boot/etc

With this change we mostly boot w/o errors on RPi-B for an
image cross built w/o privs. Other systems to follow.

Release Notes: Yes

8 years agoOnly allow one PT_INTERP ELF program header. This also fixes a potential
Jonathan T. Looney [Thu, 24 Dec 2015 00:58:11 +0000 (00:58 +0000)]
Only allow one PT_INTERP ELF program header. This also fixes a potential
memory leak for interp_buf.

Differential Revision: https://reviews.freebsd.org/D4692
Reviewed by: kib
MFC after: 2 weeks
Sponsored by: Juniper Networks

8 years agoixgbe(4): Update to version 3.1.13-k
Sean Bruno [Wed, 23 Dec 2015 22:45:17 +0000 (22:45 +0000)]
ixgbe(4): Update to version 3.1.13-k

Add support for two new devices:  X552 SFP+ 10 GbE, and the single port
version of X550T.

Submitted by: erj
Reviewed by: gnn
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D4186

8 years agoFixup native-xtools target for poudriere cross build jails after svn
Sean Bruno [Wed, 23 Dec 2015 21:55:54 +0000 (21:55 +0000)]
Fixup native-xtools target for poudriere cross build jails after svn
r291955 by excluding all debug files.

Reported by: swills

Reviewed by: emaste

8 years agoAdd support for sysctl knobs to live tune the tx packet processing limits
Sean Bruno [Wed, 23 Dec 2015 21:54:05 +0000 (21:54 +0000)]
Add support for sysctl knobs to live tune the tx packet processing limits
in igb and fix a wrap-around bug.

Reviewed by: hiren
Obtained from:  Jason (j@nitrology.com)
MFC after: 2 weeks
Sponsored by: LimeLight Networks
Differential Revision: https://reviews.freebsd.org/D4039

8 years agoAdd accessor methods to fetch the BAR holding the MSI-X table and PBA.
John Baldwin [Wed, 23 Dec 2015 21:51:10 +0000 (21:51 +0000)]
Add accessor methods to fetch the BAR holding the MSI-X table and PBA.

While here, explicitly note the requirement that the BAR(s) must be
allocated prior to calling pci_alloc_msix().

Reviewed by: andrew, emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D4688

8 years agoMove shared variables from {amd64,i386}/initcpu.c to x86/identcpu.c.
John Baldwin [Wed, 23 Dec 2015 21:41:42 +0000 (21:41 +0000)]
Move shared variables from {amd64,i386}/initcpu.c to x86/identcpu.c.
While here, move the common bits of <machine/cputypes.h> to
<x86/cputypes.h> as well.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D4670

8 years agoIncrease the timeout for resolv_test from the default (300 seconds) to
Enji Cooper [Wed, 23 Dec 2015 18:48:32 +0000 (18:48 +0000)]
Increase the timeout for resolv_test from the default (300 seconds) to
450 seconds

This is required on slower network connections, and on older releases
(stable/10 seems to be slower as far as name resolution goes.. not sure
why yet).

Remove an outdated comment in the Makefile from when I was working on
this code over a year ago on github

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

8 years agoBe stricter on which functions we can probe with FBT. We now only check the
Andrew Turner [Wed, 23 Dec 2015 17:54:19 +0000 (17:54 +0000)]
Be stricter on which functions we can probe with FBT. We now only check the
first instruction to see if it's either a pushm with lr, or a sub with sp.
The former is the common case, with the latter used with va_args.

This removes 12 probes. These are all hand-written assembly, with a few C
functions with no stack usage.

Submitted by: Howard Su <howard0su@gmail.com>
Differential Revision: https://reviews.freebsd.org/D4419

8 years agoRemove redundant declarations in sys/x86/xen which are now handled in other sys/x86
Enji Cooper [Wed, 23 Dec 2015 17:43:55 +0000 (17:43 +0000)]
Remove redundant declarations in sys/x86/xen which are now handled in other sys/x86
headers

Differential Revision: https://reviews.freebsd.org/D4685
X-MFC with: r291949
Sponsored by: EMC / Isilon Storage Division

8 years agoRemove redundant vmbus_select_outgoing_channel declaration already handled
Enji Cooper [Wed, 23 Dec 2015 17:37:30 +0000 (17:37 +0000)]
Remove redundant vmbus_select_outgoing_channel declaration already handled
in include/hyperv.h

This unbreaks the gcc 4.2.1 kernel build of hyperv

Differential Revision: https://reviews.freebsd.org/D4684
MFC after: 3 days
Reviewed by: royger
Sponsored by: EMC / Isilon Storage Division

8 years ago- grab ng_btsocket_l2cap_sockets_mtx lock in
Maksim Yevmenkin [Wed, 23 Dec 2015 16:32:04 +0000 (16:32 +0000)]
- grab ng_btsocket_l2cap_sockets_mtx lock in
  ng_btsocket_l2cap_process_l2ca_enc_change()
  before calling ng_btsocket_l2cap_pcb_by_cid();

- handle possible NULL value returned from
  ng_btsocket_l2cap_pcb_by_cid();

Submitted by: Hans Petter Selasky; hps at selasky dot org
MFC after: 1 week

8 years agoIncrease the size and alignment of the setjmp buffer. This will allow for
Andrew Turner [Wed, 23 Dec 2015 15:22:44 +0000 (15:22 +0000)]
Increase the size and alignment of the setjmp buffer. This will allow for
possible future CPU extentions with larger registers.

jmp_buf's size and alignment are baked into the ABI of third party libraries
and thus are very hard to change later so it is best to waste a small amount
of space now.

Reviewed by: brooks
Differential Revision: https://reviews.freebsd.org/D3956

8 years agoInstall ld also as ld.bfd, for use with cc -fuse-ld=bfd
Ed Maste [Wed, 23 Dec 2015 14:31:26 +0000 (14:31 +0000)]
Install ld also as ld.bfd, for use with cc -fuse-ld=bfd

PR: 205409 [exp-run]
MFC after: 1 week
Relnotes: Yes
Sponsored by: The FreeBSD Foundation

8 years agoRemove superfluous return (1) missed in r292601.
Bjoern A. Zeeb [Wed, 23 Dec 2015 10:23:47 +0000 (10:23 +0000)]
Remove superfluous return (1) missed in r292601.

Reported by: Matthew D. Fuller (fullermd over-yonder.net),
Kevin Bowling (kevin.bowling kev009.com)
MFC after: 13 days
X-MFC with: r292601
Sponsored by: The FreeBSD Foundation

8 years agoReport an error if zdb cannot initialize zfs
Baptiste Daroussin [Wed, 23 Dec 2015 10:20:46 +0000 (10:20 +0000)]
Report an error if zdb cannot initialize zfs

If the zfs module is not present and not loadable, report an error
to the user instead of crashing

Reviewed by: mahrens
Sponsored by: Gandi.net
Differential Revision: https://reviews.freebsd.org/D4691

8 years agoDelete the comment about running `test_libugidfw_strings` before testing
Enji Cooper [Wed, 23 Dec 2015 10:02:51 +0000 (10:02 +0000)]
Delete the comment about running `test_libugidfw_strings` before testing
`mac_is_present` so it doesn't accidentally confuse people

MFC after: 3 days
X-MFC with: r292650
Sponsored by: EMC / Isilon Storage Division

8 years agoMove mac_bsdextended check up before running the test_libugidfw_strings testcases
Enji Cooper [Wed, 23 Dec 2015 09:59:31 +0000 (09:59 +0000)]
Move mac_bsdextended check up before running the test_libugidfw_strings testcases

I realize that these tests could be run before mac_bsdextended is loaded, but
it would overcomplicate things to special case handle the testcases before doing
the mac_bsdextended(4) feature check

The testcases will be split up so they can be run separately in the near future

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

8 years agoUse j instead of a hardcoded index (9) and increment it after
Enji Cooper [Wed, 23 Dec 2015 09:11:18 +0000 (09:11 +0000)]
Use j instead of a hardcoded index (9) and increment it after
running the NaNs testcases

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

8 years agoRemove extraneous characters
Craig Rodrigues [Wed, 23 Dec 2015 07:28:48 +0000 (07:28 +0000)]
Remove extraneous characters

Noticed by:     markj
Reviewed by:    allanjude

8 years agoTouch /firstboot in the WORLDDIR.
Warner Losh [Wed, 23 Dec 2015 06:49:28 +0000 (06:49 +0000)]
Touch /firstboot in the WORLDDIR.

8 years agoCopy all the dtb files that we build as part of the kernel build from
Warner Losh [Wed, 23 Dec 2015 06:49:18 +0000 (06:49 +0000)]
Copy all the dtb files that we build as part of the kernel build from
boot/dtb to the fat partition. They seem to be needed.
Create an empty uEnv.txt file

8 years agoFix r292640
Enji Cooper [Wed, 23 Dec 2015 03:34:43 +0000 (03:34 +0000)]
Fix r292640

vim overzealously removed some trailing `+' and I didn't check the
diff

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

8 years agoClean up trailing whitespace; no functional change
Enji Cooper [Wed, 23 Dec 2015 03:29:37 +0000 (03:29 +0000)]
Clean up trailing whitespace; no functional change

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

8 years agoAdd support for firmware dump (a.k.a grcdump)
David C Somayajulu [Wed, 23 Dec 2015 03:19:12 +0000 (03:19 +0000)]
Add support for firmware dump (a.k.a grcdump)

MFC after:5 days

8 years agoCheck for packet_length is greater than 60 bytes as well as packet_length is
David C Somayajulu [Wed, 23 Dec 2015 01:31:32 +0000 (01:31 +0000)]
Check for packet_length is greater than 60 bytes as well as packet_length is
greater than len_on_bd, before invoking the routine to handle jumbo over SGL
(bxe_service_rxsgl()).
Add counters for number of jumbo_over_SGL packets (rx_bxe_service_rxsgl) and
erroneous jumbo_over_SGL packets (rx_erroneous_jumbo_sge_pkts)

Fix formatting in bxe_sysctl_state()

MFC after:5 days

8 years agobacktrace.3: Fix prototype of backtrace_symbols_fd_fmt().
Baptiste Daroussin [Tue, 22 Dec 2015 22:40:42 +0000 (22:40 +0000)]
backtrace.3: Fix prototype of backtrace_symbols_fd_fmt().
While here, fix a typo

Submitted by: Sascha Wildner <saw@online.de>
Obtained from: DragonflyBSD

8 years agoSilence a boring warning.
Andreas Tobler [Tue, 22 Dec 2015 21:26:50 +0000 (21:26 +0000)]
Silence a boring warning.

8 years agoFold lim_shared into lim_copy to mute a -Wunused compiler warning from
Enji Cooper [Tue, 22 Dec 2015 21:07:33 +0000 (21:07 +0000)]
Fold lim_shared into lim_copy to mute a -Wunused compiler warning from
clang when the kernel is compiled without INVARIANTS

Differential Revision: https://reviews.freebsd.org/D4683
Reviewed by: kib, jhb
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agoRevert accidental whitespace changes included with r292623
Ed Maste [Tue, 22 Dec 2015 20:40:34 +0000 (20:40 +0000)]
Revert accidental whitespace changes included with r292623

8 years agoMake it possible for the cdevsw d_close() driver method to detect last
Konstantin Belousov [Tue, 22 Dec 2015 20:37:34 +0000 (20:37 +0000)]
Make it possible for the cdevsw d_close() driver method to detect last
close and close due to revoke(2)-like operation.

A new FLASTCLOSE flag indicates that this is last close.  FREVOKE is
set for revokes, and FNONBLOCK is also set, same as is already done
for VOP_CLOSE() call from vgonel().

The flags reuse user open(2) flags which are never stored in f_flag,
to not consume bit space in the ABI visible way.  Assert this with the
static check.

Requested and reviewed by: bde
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

8 years agoSupport a.out format in nlist only on i386
Ed Maste [Tue, 22 Dec 2015 20:36:14 +0000 (20:36 +0000)]
Support a.out format in nlist only on i386

i386 is the only current FreeBSD architecture that ever used a.out
format.

Reviewed by: kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D4687

8 years agoMove the mkioctls script to libsysdecode and use it to generate a
John Baldwin [Tue, 22 Dec 2015 20:33:49 +0000 (20:33 +0000)]
Move the mkioctls script to libsysdecode and use it to generate a
sysdecode_ioctlname() function.  This function matches the behavior
of the truss variant in that it returns a pointer to a string description
for known ioctls.  The caller is responsible for displaying unknown
ioctl requests.  For kdump this meant moving the logic to handle unknown
ioctl requests out of the generated function and into an ioctlname()
function in kdump.c instead.

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

8 years agoKeep devfs mount locked for the whole duration of the devfs_setattr(),
Konstantin Belousov [Tue, 22 Dec 2015 20:22:17 +0000 (20:22 +0000)]
Keep devfs mount locked for the whole duration of the devfs_setattr(),
and ensure that our dirent is instantiated.

Reported and tested by: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agoIf we annoy user with the terminal output due to failed load of
Konstantin Belousov [Tue, 22 Dec 2015 20:12:52 +0000 (20:12 +0000)]
If we annoy user with the terminal output due to failed load of
interpreter, also show the actual error code instead of some
interpretation.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agoRemove redundant ctx_switch_xsave declaration in sys/amd64/include/md_var.h
Enji Cooper [Tue, 22 Dec 2015 20:08:32 +0000 (20:08 +0000)]
Remove redundant ctx_switch_xsave declaration in sys/amd64/include/md_var.h

This variable was added to sys/x86/include/x86_var.h recently.

This unbreaks building kernel source that #includes both md_var.h and x86_var.h
with gcc 4.2.1 on amd64

Differential Revision: https://reviews.freebsd.org/D4686
Reviewed by: kib
X-MFC with: r291949
Sponsored by: EMC / Isilon Storage Division

8 years agoAdd comment to go with r291228.
Navdeep Parhar [Tue, 22 Dec 2015 20:03:49 +0000 (20:03 +0000)]
Add comment to go with r291228.

Submitted by: trasz@

8 years agoDelete the DOS dir to mirror what we do with NANO_WORLDDIR.
Warner Losh [Tue, 22 Dec 2015 19:40:34 +0000 (19:40 +0000)]
Delete the DOS dir to mirror what we do with NANO_WORLDDIR.
Copy ubldr and ubldr.bin to the dos partition when we're making it.
Minor style fixes.

8 years agoLet tsearch()/tdelete() use an AVL tree.
Ed Schouten [Tue, 22 Dec 2015 18:12:11 +0000 (18:12 +0000)]
Let tsearch()/tdelete() use an AVL tree.

The existing implementations of POSIX tsearch() and tdelete() don't
attempt to perform any balancing at all. Testing reveals that inserting
100k nodes into a tree sequentially takes approximately one minute on my
system.

Though most other BSDs also don't use any balanced tree internally, C
libraries like glibc and musl do provide better implementations. glibc
uses a red-black tree and musl uses an AVL tree.

Red-black trees have the advantage over AVL trees that they only require
O(1) rotations after insertion and deletion, but have the disadvantage
that the tree has a maximum depth of 2*log2(n) instead of 1.44*log2(n).
My take is that it's better to focus on having a lower maximum depth,
for the reason that in the case of tsearch() the invocation of the
comparator likely dominates the running time.

This change replaces the tsearch() and tdelete() functions by versions
that create an AVL tree. Compared to musl's implementation, this version
is different in two different ways:

- We don't keep track of heights; just balances. This is sufficient.
  This has the advantage that it reduces the number of nodes that are
  being accessed. Storing heights requires us to also access all of the
  siblings along the path.

- Don't use any recursion at all. We know that the tree cannot 2^64
  elements in size, so the height of the tree can never be larger than
  96. Use a 128-bit bitmask to keep track of the path that is computed.
  This allows us to iterate over the same path twice, meaning we can
  apply rotations from top to bottom.

Inserting 100k nodes into a tree now only takes 0.015 seconds. Insertion
seems to be twice as fast as glibc, whereas deletion has about the same
performance. Unlike glibc, it uses a fixed amount of memory.

I also experimented with both recursive and iterative bottom-up
implementations of the same algorithm. This iterative top-down version
performs similar to the recursive bottom-up version in terms of speed
and code size.

For some reason, the iterative bottom-up algorithm was actually 30%
faster for deletion, but has a quadratic memory complexity to keep track
of all the parent pointers.

Reviewed by: jilles
Obtained from: https://github.com/NuxiNL/cloudlibc
Differential Revision: https://reviews.freebsd.org/D4412

8 years agoRefer to creating Phabricator Herald notifications
Craig Rodrigues [Tue, 22 Dec 2015 17:46:14 +0000 (17:46 +0000)]
Refer to creating Phabricator Herald notifications

This will allow maintainers to be notified of
any reviews or commits affecting parts of the
tree which they maintain.

Reviewed by:           jhb, emaste, allanjude
Differential Revision: https://reviews.freebsd.org/D4623

8 years agoDon't adjust the program counter to an invalid address after reaching a
Andrew Turner [Tue, 22 Dec 2015 17:18:40 +0000 (17:18 +0000)]
Don't adjust the program counter to an invalid address after reaching a
breakpoint. The value doesn't need to be adjusted as it is already
correctly returned from the kernel.

This allows lldb to set breakpoints, and stop on them, however more work
is needed, for example single stepping fails to stop.

Discussed with: emaste

8 years agoFix speed setting by NVRAM for 24xx and above chips.
Alexander Motin [Tue, 22 Dec 2015 17:01:30 +0000 (17:01 +0000)]
Fix speed setting by NVRAM for 24xx and above chips.

8 years ago[mips] Add TLB pagemask probing code, and print out the allowable page sizes.
Adrian Chadd [Tue, 22 Dec 2015 15:59:41 +0000 (15:59 +0000)]
[mips] Add TLB pagemask probing code, and print out the allowable page sizes.

This is from Stacey's work on larger kernel stack sizes for MIPS.  Thanks!

Submitted by: sson

8 years agoUndo change from r292607 that was not meant to be there
Pedro F. Giffuni [Tue, 22 Dec 2015 15:42:53 +0000 (15:42 +0000)]
Undo change from r292607 that was not meant to be there

Pointyhat: me

8 years agocron: Check the return value of pipe(2)
Pedro F. Giffuni [Tue, 22 Dec 2015 15:32:45 +0000 (15:32 +0000)]
cron: Check the return value of pipe(2)

Fix inspired by: OpenBSD (rev 1.56)
CID: 1009830

8 years agocrontab: properly free an entry
Pedro F. Giffuni [Tue, 22 Dec 2015 15:30:26 +0000 (15:30 +0000)]
crontab: properly free an entry

This should close memory leak.

Obtained from: OpenBSD (rev. 1.62)
CID: 271773

8 years agocrontab: replace malloc + bzero with calloc
Pedro F. Giffuni [Tue, 22 Dec 2015 15:20:08 +0000 (15:20 +0000)]
crontab: replace malloc + bzero with calloc

Obtained from: OpenBSD (Rev 1.20)

8 years agoIf vnets are torn down while ifconfig runs an ioctl to say, destroy an
Bjoern A. Zeeb [Tue, 22 Dec 2015 15:03:45 +0000 (15:03 +0000)]
If vnets are torn down while ifconfig runs an ioctl to say, destroy an
epair(4), we may hit if_detach_internal() without holding a lock and by
the time we aquire it the interface might be gone.
We should not panic() in this case as it is our fault for not holding
the lock all the way. It is not ideal to return silently without error
to user space, but other callers will all ignore the return values so
do not change the entire KPI for little benefit for now.
The ifp will be dealt with one way or another still.

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

8 years agoIf bootverbose is enabled every vnet startup and virtual interface
Bjoern A. Zeeb [Tue, 22 Dec 2015 15:00:04 +0000 (15:00 +0000)]
If bootverbose is enabled every vnet startup and virtual interface
creation will print extra lines on the console. We are generally not
interested in this (repeated) information for each VNET. Thus only
print it for the default VNET. Virtual interfaces on the base system
will remain printing information, but e.g. each loopback in each vnet
will no longer cause a "bpf attached" line.

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

8 years agoSimplify bringup order by removing a SYSINIT making it a static list
Bjoern A. Zeeb [Tue, 22 Dec 2015 14:57:04 +0000 (14:57 +0000)]
Simplify bringup order by removing a SYSINIT making it a static list
initialization.

Mfp4 @180384,180385:

  There is no need for a dedicated SYSINIT here.  The
  list can be initialized statically.

  Sponsored by: CK Software GmbH
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by: gnn
Differential Revision: https://reviews.freebsd.org/D4528

8 years agoSince r256624 we've been leaking routing table allocations
Bjoern A. Zeeb [Tue, 22 Dec 2015 14:53:19 +0000 (14:53 +0000)]
Since r256624 we've been leaking routing table allocations
on vnet enabled jail shutdown. Call the provided cleanup
routines for IP versions 4 and 6 to plug these leaks.

Sponsored by: The FreeBSD Foundation
MFC atfer: 2 weeks
Reviewed by: gnn
Differential Revision: https://reviews.freebsd.org/D4530

8 years agoFix a panic when launching VNETs after the commit of r292309.
Jonathan T. Looney [Tue, 22 Dec 2015 13:41:50 +0000 (13:41 +0000)]
Fix a panic when launching VNETs after the commit of r292309.

Differential Revision: https://reviews.freebsd.org/D4645
Reviewed by: rrs
Reported by: kp
Tested by: kp
Sponsored by: Juniper Networks

8 years agoWe don't need to use a temporary buffer, here.
Hajimu UMEMOTO [Tue, 22 Dec 2015 12:01:06 +0000 (12:01 +0000)]
We don't need to use a temporary buffer, here.

MFC after: 1 week

8 years agoMake CUSE usable with platforms where the size of "unsigned long" is
Hans Petter Selasky [Tue, 22 Dec 2015 09:55:44 +0000 (09:55 +0000)]
Make CUSE usable with platforms where the size of "unsigned long" is
different from the size of a pointer.

8 years agoMake CUSE usable with platforms where the size of "unsigned long" is
Hans Petter Selasky [Tue, 22 Dec 2015 09:41:33 +0000 (09:41 +0000)]
Make CUSE usable with platforms where the size of "unsigned long" is
different from the size of a pointer.

8 years agoGuard against the same process being both CUSE server and client at
Hans Petter Selasky [Tue, 22 Dec 2015 09:26:24 +0000 (09:26 +0000)]
Guard against the same process being both CUSE server and client at
the same time. This can easily lead to a deadlock when destroying the
character devices nodes.

8 years agoRemove the arm KERNPHYSADDR option as it is no longer used. The make
Andrew Turner [Tue, 22 Dec 2015 09:08:21 +0000 (09:08 +0000)]
Remove the arm KERNPHYSADDR option as it is no longer used. The make
option is still in existance as it is used to build the trampoline code.

8 years agoFor embedded platforms that require it, use mtools to copy the
Warner Losh [Tue, 22 Dec 2015 06:36:00 +0000 (06:36 +0000)]
For embedded platforms that require it, use mtools to copy the
appropriate u-boot port's files into the fat part.

8 years agoPrevent use-after-free with ctx->ns in set_nameservers(..), which could occur
Enji Cooper [Tue, 22 Dec 2015 05:57:23 +0000 (05:57 +0000)]
Prevent use-after-free with ctx->ns in set_nameservers(..), which could occur
if the memory wasn't allocated again later on

Reported by: Coverity
Submitted by: Miles Ohlrich <miles.ohlrich@isilon.com>
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agoSet env vars from values on the efi loader command line.
Ian Lepore [Tue, 22 Dec 2015 03:07:38 +0000 (03:07 +0000)]
Set env vars from values on the efi loader command line.

Examine each cmdline arg and if it contains an '=' convert it to ascii and
pass it to putenv(). This allows var=value settings to come in on the
command line.

This will allow overriding dhcp server-provided data in loader(8), as
discussed in PR 202098

PR: 202098
Differential Revision: https://reviews.freebsd.org/D4561

8 years agoAllow dhcp/bootp server-provided values to be overriden from environment
Ian Lepore [Tue, 22 Dec 2015 03:02:52 +0000 (03:02 +0000)]
Allow dhcp/bootp server-provided values to be overriden from environment
variables in loader(8) and other libstand applications.

Sometimes a dhcp server provides incorrect information along with the IP
address. It would be useful to have a way to override this with
locally-supplied information, such as command line parameters passed from a
prior-stage bootloader. This change allows pre-existing env vars to take
precedence over values delivered by the dhcp or bootp server.

The bootp/dhcp code in libstand automatically creates environment variables
from the data provided by the server (dhcp.root-path, dhcp.domain-name,
etc). It also transcribes the values to some global variables such as
'rootpath' and 'hostname'.

This change does two things:

    When adding dhcp.* vars to the environment, don't replace existing
    vars/values.

    When setting the global vars rootpath and hostname, use the
    dhcp.root-path and dhcp.host-name env var values if they exist.

This allows the platform-specific part of loader(8) to obtain override
values in some platform-specific way and store them in the environment
before opening the network device. The set of values that can be overriden
is currently limited to just string options. The values that are delivered
as binary data are things that probably shouldn't be overridden (IP,
netmask, gateway, etc).

The original patch this evolved from was submitted by martymac@

PR: 202098
Differential Revision: https://reviews.freebsd.org/D4559

8 years agoDump out the output from flock_helper on failure so failures with the
Enji Cooper [Tue, 22 Dec 2015 02:10:31 +0000 (02:10 +0000)]
Dump out the output from flock_helper on failure so failures with the
test app can be debugged

MFC after: 1 week
Obtained from: Isilon OneFS (^/onefs/head@r511419)
Sponsored by: EMC / Isilon Storage Division

8 years agoUse stable output to a test file instead of depending on the OS name being
Enji Cooper [Tue, 22 Dec 2015 01:21:27 +0000 (01:21 +0000)]
Use stable output to a test file instead of depending on the OS name being
grep'able in /bin/sh

This fixes the situation where the OS has been rebranded to something other
than `FreeBSD`

MFC after: 1 week
Obtained from: Isilon OneFS (^/onefs/head@r511419)
Reviewed by: cem, Daniel O'Connor <darius@dons.net.au>
Sponsored by: EMC / Isilon Storage Division

8 years agoAdd libxo support to jls
Craig Rodrigues [Tue, 22 Dec 2015 00:58:35 +0000 (00:58 +0000)]
Add libxo support to jls

PR:                    200746
Submitted by:          Emmanuel Vadot <manu bidouilliste com>
Reviewed by:           allanjude
Relnotes:              yes
Differential Revision: https://reviews.freebsd.org/D4452

8 years agoFix the detection of IO/memory space changing across busses when the bus
Ian Lepore [Tue, 22 Dec 2015 00:53:19 +0000 (00:53 +0000)]
Fix the detection of IO/memory space changing across busses when the bus
is not pci (and thus where, ironically, the whole situation is meaningless).

This was not an error in the original code, it was introduced during my
refactoring to commonize the routine.  A small change a few lines above
drove the need to make this change, and the error didn't show up on the
platforms I initially tested with.

8 years agoDon't dump core files with lib/libc/ssp/ssp_test and lib/libc/gen/assert_test
Enji Cooper [Tue, 22 Dec 2015 00:43:22 +0000 (00:43 +0000)]
Don't dump core files with lib/libc/ssp/ssp_test and lib/libc/gen/assert_test

The default `sysctl kern.corefile` value is compatible with `kyua test` (FreeBSD
will dump to the current directory). If it's set to an absolute path however,
`kyua test` will not be able to clean up the corefiles after the fact

The corefiles have little value when testing the behavior of feature behavior,
so just disable corefile generation

MFC after: 1 week
Obtained from: Isilon OneFS (^/onefs/head@r511419)
Sponsored by: EMC / Isilon Storage Division

8 years agoInclude machine/_bus.h so that bus_space_[tag|handle]_t will be available.
Ian Lepore [Mon, 21 Dec 2015 23:47:49 +0000 (23:47 +0000)]
Include machine/_bus.h so that bus_space_[tag|handle]_t will be available.

It appears that all platforms except aarch64 are getting the file via
various header pollution, and ensuring _bus.h is included before any
openfirmware headers in every consumer of ofw/fdt stuff seems like more of
a career path than a task, so I'm taking this easy way out.

8 years agoboot1.efi: show EFI error number, not full status value
Ed Maste [Mon, 21 Dec 2015 22:42:03 +0000 (22:42 +0000)]
boot1.efi: show EFI error number, not full status value

EFI return values set the high bit to indicate an error. The log
messages changed here are printed only in the case of an error,
so including the error bit is redundant. Also switch to decimal to
match the error definitions (in sys/boot/efi/include/efierr.h).

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

8 years agortld: Use common NT_FREEBSD_* note types introduced in r291909
Ed Maste [Mon, 21 Dec 2015 22:40:29 +0000 (22:40 +0000)]
rtld: Use common NT_FREEBSD_* note types introduced in r291909

Sponsored by: The FreeBSD Foundation

8 years agoAdd i.MX 6 IPU driver and enable it in IMX6 config
Oleksandr Tymoshenko [Mon, 21 Dec 2015 22:25:35 +0000 (22:25 +0000)]
Add i.MX 6 IPU driver and enable it in IMX6 config

Current functionality is somewhat limited: driver assumes that there
is only one active IPU unit (IPU1) and that video output is DI0 and
video mode is 1024x768. For more advanced functionality driver requires
proper clock management which is work in progress. At the moment driver
assumes that pixel clock is configured by u-boot for 1026x768 mode.

Reviewed by: andrew, ian, mmel
Differential Revision: https://reviews.freebsd.org/D4168

8 years agoFix "mount -a" for NFS and ZFS filesystems with shared mountpoints
Alan Somers [Mon, 21 Dec 2015 22:19:22 +0000 (22:19 +0000)]
Fix "mount -a" for NFS and ZFS filesystems with shared mountpoints

sbin/mount.c
Check whether an fstab entry has the same fstype as a mounted
filesystem before declaring it to be mounted. This will allow NFS
filesystems that share a mountpoint with a local filesystem to be
automatically mounted at boot.

This is not such an unusual situation. For example, if somebody uses
the standard installer with a ZFS root, he'll get a /usr/home
filesystem, even though he may choose to mount /usr/home over NFS.

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

8 years ago- Add driver for i.MX 6 HDMI framer
Oleksandr Tymoshenko [Mon, 21 Dec 2015 21:40:15 +0000 (21:40 +0000)]
- Add driver for i.MX 6 HDMI framer
- Enable HDMI driver in IMX6 config

Reviewed by: andrew, ian, mmel
Differential Revision: https://reviews.freebsd.org/D4174

8 years agoIntegrate tools/regression/mac/mac_bsdextended and
Enji Cooper [Mon, 21 Dec 2015 21:24:03 +0000 (21:24 +0000)]
Integrate tools/regression/mac/mac_bsdextended and
tools/regression/mac/mac_portacl into the FreeBSD test suite as
tests/sys/mac/bsdextended and tests/sys/mac/portacl, respectively

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

8 years agoMake the mac_portacl testcases work / more robust
Enji Cooper [Mon, 21 Dec 2015 21:15:23 +0000 (21:15 +0000)]
Make the mac_portacl testcases work / more robust

- A trap(1) call has been added to the test scripts to better
  ensure that the tests do a better job at trying to restore the
  test host state at the end of the tests (if the test was
  interrupted before it would leave the system in an odd state,
  potentially making the test results for subsequent runs
  non-deterministic).
- Add root user checks
- Fix nc(1) usage:
  -- -o is deprecated
  -- Using `-w 10` will make the call timeout after 10 seconds so it
     doesn't block indefinitely
- Use local variables
- Be more terse in the error messages
- Parameterize out "127.0.0.1"

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

8 years agoRevert this change. It broke the trampoline build. Until I'm sure
Warner Losh [Mon, 21 Dec 2015 20:36:01 +0000 (20:36 +0000)]
Revert this change. It broke the trampoline build. Until I'm sure
nothing else is broken, I'm reverting.

8 years agoAdd CCM functions to enable HDMI framer and IPU units (video controller)
Oleksandr Tymoshenko [Mon, 21 Dec 2015 20:17:24 +0000 (20:17 +0000)]
Add CCM functions to enable HDMI framer and IPU units (video controller)

Reviewed by: andrew, ian
Differential Revision: https://reviews.freebsd.org/D4168

8 years agoAdd port for IRC over TLS/SSL, as noted in RFC 7194.
Jeremie Le Hen [Mon, 21 Dec 2015 20:14:40 +0000 (20:14 +0000)]
Add port for IRC over TLS/SSL, as noted in RFC 7194.

PR: 192505
Submitted by: loic.blot@unix-experience.fr
MFC after: 3 days

8 years agoloader.efi: strip trailing whitespace
Ed Maste [Mon, 21 Dec 2015 19:56:11 +0000 (19:56 +0000)]
loader.efi: strip trailing whitespace

Sponsored by: The FreeBSD Foundation

8 years agoAs previously noted in r290409, purge old entries from MAINTAINERS.
John Baldwin [Mon, 21 Dec 2015 19:15:06 +0000 (19:15 +0000)]
As previously noted in r290409, purge old entries from MAINTAINERS.

8 years agoStop processing of a SACK when the association has been aborted.
Michael Tuexen [Mon, 21 Dec 2015 18:52:02 +0000 (18:52 +0000)]
Stop processing of a SACK when the association has been aborted.

MFC after: 3 days

8 years agoConfigure the Atmel eval boards to boot the same way. This gives
Warner Losh [Mon, 21 Dec 2015 18:27:51 +0000 (18:27 +0000)]
Configure the Atmel eval boards to boot the same way. This gives
them the same layout as other embedded systems.

8 years agoAdd a mips implementation of OF_decode_addr().
Ian Lepore [Mon, 21 Dec 2015 18:19:14 +0000 (18:19 +0000)]
Add a mips implementation of OF_decode_addr().

8 years agoImplement OF_decode_addr() for arm. Move most of powerpc's implementation
Ian Lepore [Mon, 21 Dec 2015 18:07:32 +0000 (18:07 +0000)]
Implement OF_decode_addr() for arm.  Move most of powerpc's implementation
into a new function that other platforms can share.

This creates a new ofw_reg_to_paddr() function (in a new ofw_subr.c file)
that contains most of the existing ppc implementation, mostly unchanged.
The ppc code now calls the new MI code from the MD code, then creates a
ppc-specific bus_space mapping from the results. The new arm implementation
does the same in an arm-specific way.

This also moves the declaration of OF_decode_addr() from ofw_machdep.h to
openfirm.h, except on sparc64 which uses a different function signature.

This will help all FDT platforms to set up early console access using
OF_decode_addr().

8 years agoUse _map_v4v6_address().
Hajimu UMEMOTO [Mon, 21 Dec 2015 17:54:23 +0000 (17:54 +0000)]
Use _map_v4v6_address().

MFC after: 1 week

8 years agoMake the building of libsmb and mount_smbfs unconditional, now that r292552
Ian Lepore [Mon, 21 Dec 2015 17:41:08 +0000 (17:41 +0000)]
Make the building of libsmb and mount_smbfs unconditional, now that r292552
has eliminated alignment and endian problems that were making it fail on
some platforms.

PR:        180438
PR:        189415

8 years agoAvoid unaligned memory accesses when encoding netbios names in libsmb.
Ian Lepore [Mon, 21 Dec 2015 17:17:00 +0000 (17:17 +0000)]
Avoid unaligned memory accesses when encoding netbios names in libsmb.

The current code for encoding a netbios name converts each byte to a 16-bit
value and stores the result by casting a char* to u_short*, resulting in
alignment faults on strict-alignment platforms.

This change reimplements the encoding routine using only byte accesses to
memory. There is no particular reason to work with 16-bit values just
because the encoding process creates two bytes of output for every byte of
input. Working a byte at at time also avoids endian problems for big-endian
platforms.

PR: 180438
PR: 189415
Differential Revision: https://reviews.freebsd.org/D4622

8 years agoSimplify _map_v4v6_address().
Hajimu UMEMOTO [Mon, 21 Dec 2015 16:55:36 +0000 (16:55 +0000)]
Simplify _map_v4v6_address().

Suggested by: hrs
MFC after: 1 week

8 years agomakefs: use ENTRY macro for diff reduction with NetBSD
Ed Maste [Mon, 21 Dec 2015 16:12:41 +0000 (16:12 +0000)]
makefs: use ENTRY macro for diff reduction with NetBSD

Sponsored by: The FreeBSD Foundation

8 years ago- Convert testcase to TAP format
Enji Cooper [Mon, 21 Dec 2015 12:43:04 +0000 (12:43 +0000)]
- Convert testcase to TAP format
- Use nitems(x) instead of handrolled sizeof(x) / sizeof(*x) macro
- Do not mark count != 0 case with bsde_get_rule_count as a failure; this
  generates false positives on systems with ugidfw rules set on it

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

8 years agoRedo the TAP integration so it works with Kyua
Enji Cooper [Mon, 21 Dec 2015 12:39:16 +0000 (12:39 +0000)]
Redo the TAP integration so it works with Kyua

Kyua needs numbers in the TAP results :/, but prove doesn't

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

8 years agoImplement drain_workqueue() function.
Hans Petter Selasky [Mon, 21 Dec 2015 12:20:02 +0000 (12:20 +0000)]
Implement drain_workqueue() function.

MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoIn the zero delay case in queue_delayed_work() use the return value
Hans Petter Selasky [Mon, 21 Dec 2015 12:13:03 +0000 (12:13 +0000)]
In the zero delay case in queue_delayed_work() use the return value
from taskqueue_enqueue() instead of reading "ta_pending" unlocked and
also ensure the callout is stopped before proceeding.

MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoMinor workqueue cleanup:
Hans Petter Selasky [Mon, 21 Dec 2015 11:58:59 +0000 (11:58 +0000)]
Minor workqueue cleanup:
- Make some functions global instead of inline to ease debugging.
- Fix some minor style issues.

MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoRecheck curthread->td_su after the VFS_SYNC() call, and re-sync if the
Konstantin Belousov [Mon, 21 Dec 2015 11:50:32 +0000 (11:50 +0000)]
Recheck curthread->td_su after the VFS_SYNC() call, and re-sync if the
ast was rescheduled during VFS_SYNC().  It is possible that enough
parallel writes or slow/hung volume result in VFS_SYNC() deferring to
the ast flushing of workqueue.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agoIf we end up following a CNAME chain that does not find
Hajimu UMEMOTO [Mon, 21 Dec 2015 11:24:14 +0000 (11:24 +0000)]
If we end up following a CNAME chain that does not find
any data return that instead of internal error.

PR: 156684
Obtained from: NetBSD
MFC after: 1 week

8 years agoImplement sleepable RCU mechanism using shared exclusive locks.
Hans Petter Selasky [Mon, 21 Dec 2015 11:03:12 +0000 (11:03 +0000)]
Implement sleepable RCU mechanism using shared exclusive locks.

MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoImplement ACCESS_ONCE(), WRITE_ONCE() and READ_ONCE().
Hans Petter Selasky [Mon, 21 Dec 2015 10:56:38 +0000 (10:56 +0000)]
Implement ACCESS_ONCE(), WRITE_ONCE() and READ_ONCE().

MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoFix 'make depend'
Ulrich Spörlein [Mon, 21 Dec 2015 09:38:45 +0000 (09:38 +0000)]
Fix 'make depend'