]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years ago[rt] add support for the RT5350 and MT7620 SoCs.
adrian [Thu, 24 Dec 2015 18:41:16 +0000 (18:41 +0000)]
[rt] add support for the RT5350 and MT7620 SoCs.

This is a work in progress; bringing the interface down stops further
use.  It only happens on RT5350/MT7620.

This is based on work by Alexander A. Mityaev <sansan@adm.ua>.

Submitted by: Stanislav Galabov <galabov@gmail.com>

8 years ago[rt305x] Add initial RT5350 and MT7620 glue.
adrian [Thu, 24 Dec 2015 18:40:10 +0000 (18:40 +0000)]
[rt305x] Add initial RT5350 and MT7620 glue.

* Add in chipset awareness to the obio bus layout (ie, which devices are
  where);
* Add in some USB OTG changes to be aware of the newer stuff;
* Add in a configurable primary console - some chips use the normal UART,
  some use UARTLITE.

Tested (by Stanislav);

* RT3050 (NFS)
* RT5350 (NFS, MFS)
* MT7620 (USB)

Submitted by: Stanislav Galabov <sgalabov@gmail.com>

8 years ago[MT7620] add ehci/ohci USB support.
adrian [Thu, 24 Dec 2015 18:36:08 +0000 (18:36 +0000)]
[MT7620] add ehci/ohci USB support.

The newer chips don't use OTG; they're more traditional USB.

Submitted by: Stanislav Galabov <sgalabov@gmail.com>

8 years ago[MT7620] add SPI device support.
adrian [Thu, 24 Dec 2015 18:34:46 +0000 (18:34 +0000)]
[MT7620] add SPI device support.

Submitted by: Alexander A. Mityaev <sansan@adm.ua>

8 years ago[rt305x] add PCI bus / resource allocation code for the MT7620.
adrian [Thu, 24 Dec 2015 18:33:08 +0000 (18:33 +0000)]
[rt305x] add PCI bus / resource allocation code for the MT7620.

This is based on the sys/arm/mv/ pci resource/allocation code.

Submitted by: Stanislav Galabov <galabov@gmail.com>

8 years ago[rt305x] add register space definitions for later generation chips.
adrian [Thu, 24 Dec 2015 18:31:55 +0000 (18:31 +0000)]
[rt305x] add register space definitions for later generation chips.

This adds definitions for the MT5350 and MT7620 SoCs.

Submitted by: Stanislav Galabov <galabov@gmail.com>

8 years ago[rt305x] Prepare for the upcoming regime change - add RT305x options.
adrian [Thu, 24 Dec 2015 18:30:04 +0000 (18:30 +0000)]
[rt305x] Prepare for the upcoming regime change - add RT305x options.

Submitted by: Stanislav Galabov <sgalabov@gmail.com>

8 years agoFix NO INET6 build broken at svn r292674
sbruno [Thu, 24 Dec 2015 17:05:25 +0000 (17:05 +0000)]
Fix NO INET6 build broken at svn r292674

Reported by: ohartman@zedat.fu-berlin.de

8 years agoUpdate mentors for brnrd
brnrd [Thu, 24 Dec 2015 16:51:03 +0000 (16:51 +0000)]
Update mentors for brnrd

  - Remove vsevolod as mentor for brnrd
  - Add feld as mentor for brnrd

Reviewed by: koobs (mentor), vsevolod (mentor p.t.), feld (mentor h.t.)
Approved by: koobs (mentor)
Differential Revision: https://reviews.freebsd.org/D4702

8 years agoReplace all whitespaces between port name and number with tabs,
jlh [Thu, 24 Dec 2015 16:35:28 +0000 (16:35 +0000)]
Replace all whitespaces between port name and number with tabs,

8 years agoFlesh out some build time configuration options for the realtek/mediatek
adrian [Thu, 24 Dec 2015 15:58:33 +0000 (15:58 +0000)]
Flesh out some build time configuration options for the realtek/mediatek
ports.

The sys/mips/rt305x/ code currently has these hard-coded with a comment
to make them configurable; this is the first step towards that.

Submitted by: Stanislav Galabov <sgalabov@gmail.com>

8 years agoBegin the initial support for the mips1004kc core.
adrian [Thu, 24 Dec 2015 15:52:21 +0000 (15:52 +0000)]
Begin the initial support for the mips1004kc core.

* add build option;
* add initial coherence manager config register bits;
* use the right hazard instruction (ehb);
* add page attributes.

Tested:

* MT7621A SoC (not yet in-tree)

Submitted by: Stanislav Galabov <sgalabov@gmail.com>

8 years agoAdd support for RISC-V architecture.
br [Thu, 24 Dec 2015 15:47:51 +0000 (15:47 +0000)]
Add support for RISC-V architecture.

Reviewed by: andrew, kib
Sponsored by: DARPA, AFRL
Sponsored by: HEIF5
Differential Revision: https://reviews.freebsd.org/D4679

8 years agoSome polishing for command timeouts handling.
mav [Thu, 24 Dec 2015 14:53:29 +0000 (14:53 +0000)]
Some polishing for command timeouts handling.

8 years agoFixed comment placement.
pluknet [Thu, 24 Dec 2015 13:57:43 +0000 (13:57 +0000)]
Fixed comment placement.

Before r12296, this comment described the udp_recvspace default value.

Spotted by: ru
Sponsored by: Nginx, Inc.

8 years agoReduce zfs utilities overlinking
bapt [Thu, 24 Dec 2015 11:56:37 +0000 (11:56 +0000)]
Reduce zfs utilities overlinking

8 years agocamadd does not require linking to libsbuf or libbsdxml directly
bapt [Thu, 24 Dec 2015 11:43:32 +0000 (11:43 +0000)]
camadd does not require linking to libsbuf or libbsdxml directly

8 years agoSince removal of oldnfs support linking to kvm is not needed anymore
bapt [Thu, 24 Dec 2015 11:41:21 +0000 (11:41 +0000)]
Since removal of oldnfs support linking to kvm is not needed anymore

8 years agoReduce overlinking
bapt [Thu, 24 Dec 2015 11:35:42 +0000 (11:35 +0000)]
Reduce overlinking

8 years agoReduce overlinking
bapt [Thu, 24 Dec 2015 11:30:29 +0000 (11:30 +0000)]
Reduce overlinking

ifconfig does not need libbsdxml and libsbuf only lib80211 needs it

8 years agoAds support to the xhci pci attachment to use MSI-X interrupts when
andrew [Thu, 24 Dec 2015 09:40:29 +0000 (09:40 +0000)]
Ads support to the xhci pci attachment to use MSI-X interrupts when
available. As with MSI interrupts these can be disabled by setting
hw.usb.xhci.msix to 0 in the loader.

MSI-X interrupts are needed on some hardware, for example the Cavium
ThunderX only supports them, and with this we don't fall back to polling.

PR: 204378
Reviewed by: hselasky, jhb
MFC after: 1 week (after r292669)
Sponsored by: ABT Systems Ltd
Differential Revision: https://reviews.freebsd.org/D4698

8 years agoFix remaining direct tests of the carry flag in the v86 %eflags via a
jhb [Thu, 24 Dec 2015 06:22:41 +0000 (06:22 +0000)]
Fix remaining direct tests of the carry flag in the v86 %eflags via a
magic number to use V86_CY() instead.  These should have been fixed as
part of the cleanup in r226746 but were missed.

The md5 sums of the object files were unchanged, so there should be no
functional change.

PR: 205424
Submitted by: Alexander Kuleshov <kuleshovmail@gmail.com>
MFC after: 1 week

8 years agoAdd missing \n.
adrian [Thu, 24 Dec 2015 04:37:19 +0000 (04:37 +0000)]
Add missing \n.

Otherwise you end up with:

Cache info:
  picache_stride    = 4096
  picache_loopcount = 16
  pdcache_stride    = 4096
  pdcache_loopcount = 8
cpu0: MIPS Technologies processor v80.150
  MMU: Standard TLB, 32 entries (4K 16K 64K 256K 1M 16M 64M 256M pg sizes)
  L1 i-cache: 4 ways of 512 sets, 32 bytes per line
  L1 d-cache: 4 ways of 256 sets, 32 bytes per line
  L2 cache: disabled  Config1=0xbee3519e<PerfCount,WatchRegs,MIPS16,EJTAG>
  Config2=0x80000000
  Config3=0x2420

Tested:

* MT7620 SoC

8 years agoExtend Book-E to support >4GB RAM
jhibbits [Thu, 24 Dec 2015 04:30:15 +0000 (04:30 +0000)]
Extend Book-E to support >4GB RAM

Summary:
With some additional changes for AIM, that could also support much
larger physmem sizes.  Given that 32-bit AIM is more or less obsolete, though,
it's not worth it at this time.

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

8 years agoMFP r291227, r291228, and r292618.
np [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
imp [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
imp [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
jtl [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
sbruno [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
sbruno [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
sbruno [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.
jhb [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.
jhb [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
ngie [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 [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
ngie [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
ngie [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
emax [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 [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
emaste [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.
bz [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
bapt [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
ngie [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
ngie [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
ngie [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
rodrigc [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.
imp [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
imp [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
ngie [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
ngie [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)
davidcs [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
davidcs [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().
bapt [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.
andreast [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
ngie [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
emaste [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
kib [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
emaste [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
jhb [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(),
kib [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
kib [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
ngie [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 agoDelete the DOS dir to mirror what we do with NANO_WORLDDIR.
imp [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 [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
rodrigc [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 [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.
mav [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 [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
pfg [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)
pfg [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
pfg [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
pfg [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
bz [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
bz [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
bz [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
bz [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.
jtl [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.
ume [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
hselasky [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
hselasky [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
hselasky [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 [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
imp [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
ngie [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 [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 [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
ngie [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
ngie [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
rodrigc [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 [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
ngie [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 [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
emaste [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
emaste [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
gonzo [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
asomers [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
gonzo [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
ngie [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
ngie [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
imp [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.