Commit Graph

206931 Commits

Author SHA1 Message Date
Baptiste Daroussin
9cd69d502c 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
2015-12-23 10:20:46 +00:00
Enji Cooper
013829494e 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
2015-12-23 10:02:51 +00:00
Enji Cooper
ad25988f4c 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
2015-12-23 09:59:31 +00:00
Enji Cooper
194b8d633f 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
2015-12-23 09:11:18 +00:00
Craig Rodrigues
77624aed80 Remove extraneous characters
Noticed by:     markj
Reviewed by:    allanjude
2015-12-23 07:28:48 +00:00
Warner Losh
4e8617b60f Touch /firstboot in the WORLDDIR. 2015-12-23 06:49:28 +00:00
Warner Losh
14b4a9e030 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
2015-12-23 06:49:18 +00:00
Enji Cooper
853a17ad6f 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
2015-12-23 03:34:43 +00:00
Enji Cooper
905b145f0a Clean up trailing whitespace; no functional change
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2015-12-23 03:29:37 +00:00
David C Somayajulu
29e6019890 Add support for firmware dump (a.k.a grcdump)
MFC after:5 days
2015-12-23 03:19:12 +00:00
David C Somayajulu
6dbbc5f655 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
2015-12-23 01:31:32 +00:00
Baptiste Daroussin
d8eb75b418 backtrace.3: Fix prototype of backtrace_symbols_fd_fmt().
While here, fix a typo

Submitted by:	Sascha Wildner <saw@online.de>
Obtained from:	DragonflyBSD
2015-12-22 22:40:42 +00:00
Andreas Tobler
77a561088f Silence a boring warning. 2015-12-22 21:26:50 +00:00
Enji Cooper
20b4c1d2cb 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
2015-12-22 21:07:33 +00:00
Ed Maste
7ebeabcf9b Revert accidental whitespace changes included with r292623 2015-12-22 20:40:34 +00:00
Konstantin Belousov
cccac8a1ef 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
2015-12-22 20:37:34 +00:00
Ed Maste
6ee0db8b76 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
2015-12-22 20:36:14 +00:00
John Baldwin
265e58989d 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
2015-12-22 20:33:49 +00:00
Konstantin Belousov
b63d070ad1 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
2015-12-22 20:22:17 +00:00
Konstantin Belousov
d943fa35ad 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
2015-12-22 20:12:52 +00:00
Enji Cooper
418629d81d 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
2015-12-22 20:08:32 +00:00
Warner Losh
cf296cf3d7 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.
2015-12-22 19:40:34 +00:00
Ed Schouten
459d04a5ee 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
2015-12-22 18:12:11 +00:00
Craig Rodrigues
26b18977b3 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
2015-12-22 17:46:14 +00:00
Andrew Turner
b1eb23b26b 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
2015-12-22 17:18:40 +00:00
Alexander Motin
b7200a19e6 Fix speed setting by NVRAM for 24xx and above chips. 2015-12-22 17:01:30 +00:00
Adrian Chadd
7b61491a8d [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
2015-12-22 15:59:41 +00:00
Pedro F. Giffuni
587d674e16 Undo change from r292607 that was not meant to be there
Pointyhat: me
2015-12-22 15:42:53 +00:00
Pedro F. Giffuni
d985028157 cron: Check the return value of pipe(2)
Fix inspired by:	OpenBSD (rev 1.56)
CID:	1009830
2015-12-22 15:32:45 +00:00
Pedro F. Giffuni
7044922b39 crontab: properly free an entry
This should close memory leak.

Obtained from:	OpenBSD (rev. 1.62)
CID:		271773
2015-12-22 15:30:26 +00:00
Pedro F. Giffuni
c28c984689 crontab: replace malloc + bzero with calloc
Obtained from:	OpenBSD (Rev 1.20)
2015-12-22 15:20:08 +00:00
Bjoern A. Zeeb
f501e6f136 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
2015-12-22 15:03:45 +00:00
Bjoern A. Zeeb
616bc4f476 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
2015-12-22 15:00:04 +00:00
Bjoern A. Zeeb
76d68eccbd 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
2015-12-22 14:57:04 +00:00
Bjoern A. Zeeb
0a03cf8ca6 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
2015-12-22 14:53:19 +00:00
Jonathan T. Looney
c54a41def7 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
2015-12-22 13:41:50 +00:00
Hajimu UMEMOTO
eedae89765 We don't need to use a temporary buffer, here.
MFC after:	1 week
2015-12-22 12:01:06 +00:00
Hans Petter Selasky
beebd9aac8 Make CUSE usable with platforms where the size of "unsigned long" is
different from the size of a pointer.
2015-12-22 09:55:44 +00:00
Hans Petter Selasky
9fb69c9d9d Make CUSE usable with platforms where the size of "unsigned long" is
different from the size of a pointer.
2015-12-22 09:41:33 +00:00
Hans Petter Selasky
ac60e80129 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.
2015-12-22 09:26:24 +00:00
Andrew Turner
7c570e8bb1 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.
2015-12-22 09:08:21 +00:00
Warner Losh
730acac20c For embedded platforms that require it, use mtools to copy the
appropriate u-boot port's files into the fat part.
2015-12-22 06:36:00 +00:00
Enji Cooper
e830a247a1 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
2015-12-22 05:57:23 +00:00
Ian Lepore
21fddb1173 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
2015-12-22 03:07:38 +00:00
Ian Lepore
703db8ccae 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
2015-12-22 03:02:52 +00:00
Enji Cooper
8b302ecdb9 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
2015-12-22 02:10:31 +00:00
Enji Cooper
1115e598dd 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
2015-12-22 01:21:27 +00:00
Craig Rodrigues
cbbaf9b2b1 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
2015-12-22 00:58:35 +00:00
Ian Lepore
67bcc941d0 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.
2015-12-22 00:53:19 +00:00
Enji Cooper
8eb42fb2a8 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
2015-12-22 00:43:22 +00:00